webpackJsonp([0],{

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HomePage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_native_geolocation__ = __webpack_require__(108);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_common_http__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__agm_core__ = __webpack_require__(77);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_moment__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_ionic_pullup__ = __webpack_require__(533);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__providers_tracking_tracking__ = __webpack_require__(194);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__ionic_native_in_app_browser__ = __webpack_require__(78);
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);
};












// import { EMPTY_MAP } from '@angular/core/src/view';
// declare var google: any;
var HomePage = /** @class */ (function () {
    function HomePage(navCtrl, navParams, doctorService, geolocation, toastCtrl, popoverCtrl, http, loadingCtrl, service, mapsAPILoader, ngZone, alertCtrl, platform, locationTracker, storage, renderer, iab) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.doctorService = doctorService;
        this.geolocation = geolocation;
        this.toastCtrl = toastCtrl;
        this.popoverCtrl = popoverCtrl;
        this.http = http;
        this.loadingCtrl = loadingCtrl;
        this.service = service;
        this.mapsAPILoader = mapsAPILoader;
        this.ngZone = ngZone;
        this.alertCtrl = alertCtrl;
        this.platform = platform;
        this.locationTracker = locationTracker;
        this.storage = storage;
        this.renderer = renderer;
        this.iab = iab;
        this.lat = -33.4727092;
        this.lng = -70.7699146;
        this.state = true;
        this.list = [];
        this.buscando = [];
        this.buscar = '';
        this.distanceRequirement = '';
        this.timeRequirement = '';
        this.searching = false;
        this.active = { profile_id: '0' };
        this.secureSearch = '';
        this.activo = null;
        this.verDetalle = false;
        this.vistaDeals = 'map';
        this.arrayService = [];
        this.polyline = [];
        this.waitings = [];
        this.shownGroup = null;
        this.checkStart = "NoIniciado";
        this.idServIniciado = 0;
        this.voy = '';
        this.renderOptions = {
            suppressMarkers: true,
            preserveViewport: true,
            travelMode: 'DRIVING',
            drivingOptions: {
                trafficModel: 'best_guess'
            }
        };
        this.markerOptions = {
            origin: {
                icon: 'assets/img/markerTruck4.png'
            },
            destination: {
                icon: 'assets/img/goal.png'
            },
        };
        this.fromPlacesRetiro = false;
        this.fromPlacesEntrega = false;
        this.fromPlacesBusca = false;
        this.styles = [{ "featureType": "all", "elementType": "labels.text.fill", "stylers": [{ "color": "#7c93a3" }, { "lightness": "-10" }] }, { "featureType": "administrative.country", "elementType": "geometry", "stylers": [{ "visibility": "on" }] }, { "featureType": "administrative.country", "elementType": "geometry.stroke", "stylers": [{ "color": "#a0a4a5" }] }, { "featureType": "administrative.province", "elementType": "geometry.stroke", "stylers": [{ "color": "#62838e" }] }, { "featureType": "landscape", "elementType": "geometry.fill", "stylers": [{ "color": "#dde3e3" }] }, { "featureType": "landscape.man_made", "elementType": "geometry.stroke", "stylers": [{ "color": "#3f4a51" }, { "weight": "0.30" }] }, { "featureType": "poi", "elementType": "all", "stylers": [{ "visibility": "simplified" }] }, { "featureType": "poi.attraction", "elementType": "all", "stylers": [{ "visibility": "on" }] }, { "featureType": "poi.business", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.government", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.park", "elementType": "all", "stylers": [{ "visibility": "on" }] }, { "featureType": "poi.place_of_worship", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.school", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.sports_complex", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "road", "elementType": "all", "stylers": [{ "saturation": "-100" }, { "visibility": "on" }] }, { "featureType": "road", "elementType": "geometry.stroke", "stylers": [{ "visibility": "on" }] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{ "color": "#bbcacf" }] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "lightness": "0" }, { "color": "#bbcacf" }, { "weight": "0.50" }] }, { "featureType": "road.highway", "elementType": "labels", "stylers": [{ "visibility": "on" }] }, { "featureType": "road.highway", "elementType": "labels.text", "stylers": [{ "visibility": "on" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry.fill", "stylers": [{ "color": "#ffffff" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry.stroke", "stylers": [{ "color": "#a9b4b8" }] }, { "featureType": "road.arterial", "elementType": "labels.icon", "stylers": [{ "invert_lightness": true }, { "saturation": "-7" }, { "lightness": "3" }, { "gamma": "1.80" }, { "weight": "0.01" }] }, { "featureType": "transit", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "water", "elementType": "geometry.fill", "stylers": [{ "color": "#a3c7df" }] }];
        this.shipment = false;
        this.latitude = 0;
        this.longitude = 0;
        this.zoom = 14;
        this.showPlaceSavedRetira = false;
        this.showPlaceSavedEntrega = false;
        this.showPlaceSavedBusca = false;
        this.loaderPlaces = false;
        this.addresses = [];
        this.origenShow = false;
        this.destinoShow = false;
        this.myPlaceDialog = '';
        this.requerimentBtnRetira = false;
        this.requrimentBtnEntrega = false;
        this.clickableIcons = false;
        this.driverInformation = {
            distance: '',
            actual: '',
            timer: ''
        };
        this.iconWait = {
            url: 'assets/img/icono.camion.png',
            scaledSize: {
                height: 32,
                width: 32
            }
        };
        this.sLoad = null;
        this.requirementOk = false;
        this.diponibilidadOk = false;
        this.comentario = '';
        this.shipment = false;
        this.footerState = __WEBPACK_IMPORTED_MODULE_9_ionic_pullup__["a" /* IonPullUpFooterState */].Collapsed;
        this.loading = loadingCtrl.create();
        this.gotome();
        setTimeout(function () {
            _this.setCurrentPosition();
        }, 400);
        this.driverServicesInProgress();
        /*
        setInterval(() => {
           console.log(this.origin,this.destination);
        }, 2000);
        */
    }
    HomePage.prototype.waze = function () {
        var toto = this.destination.lat + ',' + this.destination.lng;
        window.open('https://www.waze.com/ul?ll=' + toto + '&navigate=yes', '_system');
    };
    HomePage.prototype.ionViewDidEnter = function () {
        this.cleanMap();
    };
    HomePage.prototype.ionViewDidLeave = function () {
        this.cleanMap();
    };
    HomePage.prototype.ngOnDestroy = function () {
    };
    HomePage.prototype.changeDirectionConductor = function (event) {
        console.log('this.checkStart', this.checkStart);
        if (this.idServIniciado > 0 && event.routes && event.routes[0]) {
            /*console.log(event.routes[0]);*/
            this.driverInformation = {
                distance: event.routes[0].legs[0].distance.text,
                actual: event.routes[0].summary,
                timer: event.routes[0].legs[0].duration.text
            };
            this.doctorService.serviceUpdateDriverData(this.idServIniciado, this.driverInformation.distance, this.driverInformation.actual, this.driverInformation.timer, this.locationTracker.UbicacionLat(), this.locationTracker.UbicacionLng()).subscribe(function (data) {
                //update ok
            });
        }
    };
    HomePage.prototype.changeDirectionReq = function (event) {
        console.log(event);
        this.distanceRequirement = event.routes[0].legs[0].distance.text;
        this.timeRequirement = event.routes[0].legs[0].duration.text;
    };
    HomePage.prototype.toggleFooter = function () {
        this.footerState = this.footerState == __WEBPACK_IMPORTED_MODULE_9_ionic_pullup__["a" /* IonPullUpFooterState */].Collapsed ? __WEBPACK_IMPORTED_MODULE_9_ionic_pullup__["a" /* IonPullUpFooterState */].Expanded : __WEBPACK_IMPORTED_MODULE_9_ionic_pullup__["a" /* IonPullUpFooterState */].Collapsed;
    };
    HomePage.prototype.toggleGroup = function (group) {
        if (this.isGroupShown(group)) {
            this.shownGroup = null;
        }
        else {
            this.shownGroup = group;
        }
    };
    ;
    HomePage.prototype.isGroupShown = function (group) {
        return this.shownGroup === group;
    };
    HomePage.prototype.footerExpanded = function () {
    };
    HomePage.prototype.footerCollapsed = function () {
    };
    HomePage.prototype.start = function (id, latd, lngd, destino, city, notes) {
        var _this = this;
        var alert = this.alertCtrl.create({
            title: 'Confirmar inicio',
            subTitle: 'Notificaremos al usuario que vás en camino y podrá ver tu posición',
            /*inputs: [
              {
                name: 'guia',
                placeholder: 'Ingrese folio'
              }
            ],*/
            buttons: [
                {
                    text: 'Cancelar',
                    role: 'cancel',
                    handler: function (data) {
                    }
                },
                {
                    text: 'Iniciar',
                    handler: function (data) {
                        _this.voy = (destino + ", " + city).toUpperCase();
                        /*
                        this.loading = this.loadingCtrl.create();
                        this.loading.present();
                        this.doctorService.setServiceGuia(id,data.guia).subscribe((data:any)=> {
                          this.loading.dismiss();
                          if (data.res == "OK") {
                            this.origin = { lat: this.locationTracker.UbicacionLat(),lng: this.locationTracker.UbicacionLng() }
                            this.destination = { lat: parseFloat(latd), lng: parseFloat(lngd) }
                            this.trakingStart(id);
                            this.toggleFooter();
                          } else {
                            this.service.showMsg(data.msg);
                          }
                        });
                        */
                        _this.comentario = notes;
                        _this.origin = { lat: _this.latitude, lng: _this.longitude };
                        _this.destination = { lat: parseFloat(latd), lng: parseFloat(lngd) };
                        _this.trakingStart(id);
                        _this.toggleFooter();
                    }
                }
            ]
        });
        alert.present();
    };
    HomePage.prototype.stop = function (id, estado) {
        var _this = this;
        var alert = this.alertCtrl.create({
            title: 'Confirmar termino',
            subTitle: 'Notificaremos al usuario que el pedido fue ' + estado,
            /*inputs: [
              {
                name: 'guia',
                placeholder: 'Ingrese folio'
              }
            ],*/
            buttons: [
                {
                    text: 'Cancelar',
                    role: 'cancel',
                    handler: function (data) {
                    }
                },
                {
                    text: 'Confirmar',
                    handler: function (data) {
                        _this.trakingStop(id, estado);
                        _this.toggleFooter();
                    }
                }
            ]
        });
        alert.present();
    };
    HomePage.prototype.starintervalo = function () {
        var _this = this;
        if (!this.locationTracker.queryInProgress()) {
            this.locationTracker.startTracking();
            this.secuencia = setInterval(function () {
                _this.sendTracktoserver();
            }, 5000);
        }
    };
    HomePage.prototype.trakingStart = function (id) {
        var _this = this;
        this.loading = this.loadingCtrl.create();
        this.loading.present();
        var params = {
            'service_id': id,
            'lat': this.locationTracker.UbicacionLat(),
            'lng': this.locationTracker.UbicacionLng()
        };
        this.doctorService.setStartService(params).subscribe(function (data) {
            _this.loading.dismiss();
            if (data["res"] == "ok" || data["res"] == "OK") {
                _this.checkStart = "iniciado";
                _this.idServIniciado = id;
                _this.starintervalo();
            }
            else {
                _this.service.showMsg(data["msg"]);
            }
        }), function (err) {
            _this.loading.dismiss();
            _this.service.showMsg("Ha ocurrido un error");
        };
    };
    HomePage.prototype.trakingStop = function (id, estado) {
        var _this = this;
        var params = {
            'service_id': id,
            'estado': estado,
            'lat': this.locationTracker.UbicacionLat(),
            'lng': this.locationTracker.UbicacionLng()
        };
        this.checkStart = "NoIniciado";
        this.driverServices();
        this.doctorService.setStopService(params).subscribe(function (data) {
            if (data["res"] == "ok" || data["res"] == "OK") {
                _this.service.showMsg(data["msg"]);
                clearInterval(_this.secuencia);
                _this.cleanMap();
            }
            else {
                _this.service.showMsg(data["msg"]);
            }
        }), function (err) {
            _this.service.showMsg("Ha ocurrido un error");
        };
    };
    HomePage.prototype.cleanMap = function () {
        this.polyline = [];
        this.setCurrentPosition();
        this.destination = this.origin;
    };
    HomePage.prototype.sendTracktoserver = function () {
        var params = {
            'service_id': this.idServIniciado,
            'lat': this.locationTracker.UbicacionLat(),
            'lng': this.locationTracker.UbicacionLng()
        };
        this.latitude = this.locationTracker.UbicacionLat();
        this.longitude = this.locationTracker.UbicacionLng();
        this.origin = { lat: this.latitude, lng: this.longitude };
        /*this.doctorService.sendPositionTraking(params).subscribe((data) => {
        }), (err) => {
          console.log("Ha ocurrido un error");
        }*/
    };
    HomePage.prototype.driverServices = function () {
        var _this = this;
        this.loading = this.loadingCtrl.create();
        this.loading.present();
        this.sLoad = this.doctorService.getDriverService().subscribe(function (data) {
            if (data["res"] == "OK") {
                for (var i = 0; i < data.data.length; i++) {
                    data.data[i].dist = _this.getDistanceFromLatLonInKm(_this.latitude, _this.longitude, data.data[i].lat, data.data[i].lng);
                }
                data.data.sort(function (a, b) {
                    return parseFloat(a.dist) - parseFloat(b.dist);
                });
                _this.arrayService = data.data;
                _this.checkStart = "NoIniciado";
                _this.loading.dismiss();
            }
            else {
                _this.loading.dismiss();
                _this.service.showMsg(data["msg"]);
            }
        }), function (err) {
            _this.service.showMsg("Ha ocurrido un error");
            _this.loading.dismiss();
        };
    };
    HomePage.prototype.gotome = function () {
        var _this = this;
        this.latitude = -33.4727092;
        this.longitude = -70.7699146;
        this.geolocation.getCurrentPosition().then(function (position) {
            _this.latitude = position.coords.latitude;
            _this.longitude = position.coords.longitude;
        });
    };
    HomePage.prototype.driverServicesInProgress = function () {
        var _this = this;
        this.doctorService.getDriverServiceInProgress().subscribe(function (data) {
            if (data["res"] == "OK") {
                var servicoenprogreso = data["data"];
                if (servicoenprogreso.length == 0) {
                    _this.driverServices();
                    _this.setCurrentPosition();
                }
                else {
                    var serviData = servicoenprogreso[0];
                    _this.comentario = serviData.notes;
                    var idServicio = serviData["id"];
                    _this.checkStart = "iniciado";
                    _this.idServIniciado = idServicio;
                    _this.voy = (serviData["address_street"] + ", " + serviData["address_city"]).toUpperCase();
                    _this.ngZone.run(function () {
                        //this.origin = { lat: parseFloat(serviData.last_lat),lng: parseFloat(serviData.last_lng) }
                        _this.origin = { lat: _this.latitude, lng: _this.longitude };
                        _this.destination = { lat: parseFloat(serviData.lat), lng: parseFloat(serviData.lng) };
                        _this.starintervalo();
                    });
                    //this.drawpolylineService(this.idServIniciado);
                }
            }
            else {
                _this.service.showMsg(data["msg"]);
            }
        }), function (err) {
            _this.service.showMsg("Ha ocurrido un error");
        };
    };
    /*drawpolylineService(idServicio) {
      this.loading = this.loadingCtrl.create();
      this.loading.present();
      let param = idServicio;
      console.log("servicio para draw:" + idServicio);
      this.doctorService.getTrucking(param).subscribe((data) => {
        console.log("sigue array para draw");
        console.log(data)
        this.loading.dismiss();
        if (data["res"]=="OK"){
          this.ngZone.run(() => {
         this.polyline = data["data"];
         let posicion = (this.polyline.length - 1);
          this.LatestDate = this.polyline[posicion]["in_time"];
          this.latitude = this.polyline[posicion]["lat"];
          this.longitude = this.polyline[posicion]["lng"];
        })
      }else{
          this.service.showMsg(data["msg"]);
          this.setCurrentPosition();
        }
      }),(err) => {
        this.service.showMsg("Ha ocurrido un error");
        this.loading.dismiss();
      }
    }*/
    HomePage.prototype.getDistanceFromLatLonInKm = function (lat1, lon1, lat2, lon2) {
        var R = 6371; // Radius of the earth in km
        var dLat = this.deg2rad(lat2 - lat1); // deg2rad below
        var dLon = this.deg2rad(lon2 - lon1);
        var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
            Math.cos(this.deg2rad(lat1)) * Math.cos(this.deg2rad(lat2)) *
                Math.sin(dLon / 2) * Math.sin(dLon / 2);
        var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
        var d = R * c; // Distance in km
        return d.toFixed(2);
    };
    HomePage.prototype.deg2rad = function (deg) {
        return deg * (Math.PI / 180);
    };
    HomePage.prototype.close = function () {
        this.verDetalle = false;
    };
    HomePage.prototype.reverseGeocode = function (latitud, longitude) {
        var _this = this;
        var geocoder = new google.maps.Geocoder;
        var latlng = { lat: latitud, lng: longitude };
        geocoder.geocode({ 'location': latlng }, function (result, status) {
            _this.ngZone.run(function () {
                if (status.toString() === 'OK') {
                    _this.requerimentBtnRetira = true;
                    _this.miUbicacion = result[0]["formatted_address"].toUpperCase();
                    _this.fromPlacesRetiro = true;
                    _this.OrigenCityName = result[0]["formatted_address"].toUpperCase();
                    console.log(result[0]["formatted_address"]);
                }
                else {
                    _this.miUbicacion = latlng["lat"] + ', ' + latlng["lng"];
                }
            });
        });
    };
    HomePage.prototype.setCurrentPosition = function (setVar) {
        var _this = this;
        var inputField = document.getElementById('txtEntrega');
        inputField && inputField.focus();
        this.geolocation.getCurrentPosition().then(function (position) {
            if (setVar == 1) {
                _this.reverseGeocode(position.coords.latitude, position.coords.longitude);
                _this.miUbicacionCoords = { lat: position.coords.latitude, lng: position.coords.longitude };
                _this.origin = { lat: position.coords.latitude, lng: position.coords.longitude };
                _this.showPlaceSavedRetira = false;
                _this.showPlaceSavedEntrega = false;
                //this.showButton();
            }
            _this.latitude = position.coords.latitude;
            _this.longitude = position.coords.longitude;
            /*this.zoom = 17;*/
        });
    };
    HomePage.prototype.loadAPIWrapper = function (map) {
        this.map = map;
    };
    HomePage.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_5_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_5_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_5_moment__["ISO_8601"]).format();
    };
    HomePage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-home',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/home/home.html"*/'<ion-header no-border>\n  <ion-navbar transparent>\n    <button ion-button menuToggle>\n      <ion-icon name="menu-outline"></ion-icon>\n    </button>\n  </ion-navbar>\n</ion-header>\n\n<!--<div class="findme" (click)="gotome()"><img src="assets/img/findme.png" /></div>-->\n\n<div *ngIf="checkStart== \'iniciado\'" class="waze" (click)="waze()">\n  <img src="assets/img/waze.png" />\n  <span>Usar Waze</span>\n</div>\n<!--\n<div *ngIf="checkStart== \'iniciado\'" class="gmaps" (click)="gmaps()"><img src="assets/img/gmaps.png" /></div>\n-->\n\n<agm-map [latitude]="latitude" [clickableIcons]="clickableIcons" [longitude]="longitude" [styles]="styles" [zoom]="zoom" [zoomControl]="false" id="map" [streetViewControl]="false" (onMapLoad)=\'loadAPIWrapper($event)\'>\n  <agm-marker [visible]="checkStart != \'iniciado\'" [latitude]="latitude" [longitude]="longitude" [iconAnchorX]="5" [iconAnchorY]="5" [iconHeight]="10" [iconWidth]="10" [iconUrl]="\'assets/img/icono.go.png\'">\n    <agm-info-window><b>Estás aquí</b></agm-info-window>\n  </agm-marker>\n  <agm-direction [visible]="checkStart == \'iniciado\'" (onChange)="changeDirectionConductor($event)" [origin]="origin" [destination]="destination" [renderOptions]="renderOptions" [markerOptions]="markerOptions"></agm-direction>\n</agm-map>\n<div *ngIf="checkStart == \'iniciado\'" class="bubble_driver_info">\n  Llegada en: {{driverInformation.timer}} <br />\n  Distancia: {{driverInformation.distance}} <br />\n  Referencia: {{driverInformation.actual}}\n</div>\n\n<ion-pullup (onExpand)="footerExpanded()" class="PullContainer" (onCollapse)="footerCollapsed()" [(state)]="footerState">\n  <ion-pullup-tab [footer]="pullup" (tap)="toggleFooter()" class="pullUp_">\n    <ion-icon class="arrowUp" *ngIf="footerState == 0"></ion-icon>\n    <ion-icon class="arrowDown" *ngIf="footerState == 1"></ion-icon>\n  </ion-pullup-tab>\n  <div align="center" (tap)="toggleFooter()" class="toolbar_">\n    <h3>Servicios</h3>\n  </div>\n  <ion-content class="MapContent">\n    <div *ngIf="checkStart== \'iniciado\'" text-center>\n        <!--<ion-img class="truckLo"></ion-img>-->\n        <br>\n        <h4><b>DESTINO:</b><br /> {{voy}}</h4>\n        <br>\n        <button ion-button full color="primary" (tap)="stop(idServIniciado,\'entregado\')">\n          Entregado\n        </button>\n        <br />\n        <button ion-button full color="danger" (tap)="stop(idServIniciado,\'devuelto\')">\n          Devuelto\n        </button>\n        <br />\n        <b>Comentario cliente:</b><br />\n        {{comentario}}\n    </div>\n    <ion-row>\n      <div *ngIf="checkStart== \'NoIniciado\'" class="noinit">\n      <div *ngIf="arrayService.length == 0" text-center><h4>No tienes servicios pendiente</h4></div>\n      <ion-col col-12 col-xl-6 *ngFor="let data of arrayService; let i=index">\n          <ion-card class="schedu-list" text-wrap (tap)="toggleGroup(i)" [ngClass]="{active: isGroupShown(i)}" no-padding align="center">\n            <ion-row no-padding>\n              <!--\n              <div *ngIf="data.status == \'5\' && data.is_evaluate ==\'1\'" class="clsTerminado" align="center">\n                <label class="fnt-Terminado">TERMINADO - PATENTE {{data.plate}}</label>\n              </div>\n              -->\n              <div *ngIf="data.status == \'3\'  || data.status == \'7\'" class="clsEnCurso" align="center">\n                <label class="fnt-Terminado">POR INICIAR (A {{(getDistanceFromLatLonInKm(latitude,longitude,data.lat,data.lng))}} KM)</label>\n              </div>\n              <!--\n              <div *ngIf="data.status == \'5\' && data.is_evaluate ==\'0\'" class="clsPorValorizar" align="center">\n                <div (click)="valorizar()">\n                  <label class="fnt-Terminado">VALORIZAR - PATENTE {{data.plate}}</label>\n                  <ion-icon class="iconStar"></ion-icon>\n                </div>\n              </div>\n              <div *ngIf="data.status == \'1\' && data.is_evaluate ==\'0\'" class="clsEnEspera" align="center">\n                <label class="fnt-Espera">EN ESPERA - PATENTE {{data.plate}}</label>\n              </div>\n              -->\n            </ion-row>\n            <ion-row no-padding class="containerItem">\n              <ion-col col-3 class="wraperColumn">\n                  <table width="100%">\n                      <tr align="center">\n                          <label class="medium">\n                            <b>CLIENTE</b>\n                          </label>\n                        </tr>\n                    <tr align="center">\n                    <label class="small">\n                      {{data.user_fullname}}\n                    </label>\n                  </tr>\n                </table>\n              </ion-col>\n              <ion-col col-6 align="center" class="itemCenter">\n                <label class="fntTitLabel">\n                  <strong>Pedido:</strong> # {{data.id}}\n                </label>\n                <!--\n                <label class="fntTitLabel">\n                  \n                </label>\n                -->\n                <br>\n                <button ion-button round (tap)="start(data.id,data.lat,data.lng,data.address_street,data.address_city,data.notes)" class="btn btn-iniciar">\n                  INICIAR\n                </button>\n                <br />\n                {{data.notes}}\n              </ion-col>\n              <ion-col col-3 class="wraperColumnRight">\n                <br>\n                <table width="100%">\n                    <tr align="center">\n                        <label class="medium">\n                          <b>ENTREGA</b>\n                        </label>\n                      </tr>\n                  <tr align="center">\n                    <label class="small" style="text-transform:uppercase;">\n                      {{data.address_street}}, {{data.address_city}}\n                    </label>\n                  </tr>\n                </table>\n              </ion-col>\n            </ion-row>\n          </ion-card>\n      </ion-col>\n    </div>\n    </ion-row>\n  </ion-content>\n</ion-pullup>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/home/home.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_6__services_doctor_service__["a" /* DoctorService */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_native_geolocation__["a" /* Geolocation */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["q" /* ToastController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["o" /* PopoverController */],
            __WEBPACK_IMPORTED_MODULE_3__angular_common_http__["a" /* HttpClient */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_7__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_4__agm_core__["e" /* MapsAPILoader */],
            __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["n" /* Platform */],
            __WEBPACK_IMPORTED_MODULE_10__providers_tracking_tracking__["a" /* TrackingProvider */],
            __WEBPACK_IMPORTED_MODULE_8__ionic_storage__["b" /* Storage */],
            __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"],
            __WEBPACK_IMPORTED_MODULE_11__ionic_native_in_app_browser__["a" /* InAppBrowser */]])
    ], HomePage);
    return HomePage;
}());

//# sourceMappingURL=home.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LoginPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__home_home__ = __webpack_require__(109);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__services_auth_service__ = __webpack_require__(42);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__signup_signup__ = __webpack_require__(537);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ionic_native_status_bar__ = __webpack_require__(193);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__lostpassword_lostpassword__ = __webpack_require__(539);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__farmacia_farmacia__ = __webpack_require__(196);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_ng2_rut__ = __webpack_require__(542);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_ng2_rut___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_ng2_rut__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__signup_signup2__ = __webpack_require__(195);
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 LoginPage = /** @class */ (function () {
    function LoginPage(navCtrl, navParams, service, loadingCtrl, storage, platform, statusBar, auth, rutValidator) {
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.service = service;
        this.loadingCtrl = loadingCtrl;
        this.storage = storage;
        this.platform = platform;
        this.statusBar = statusBar;
        this.auth = auth;
        this.rutValidator = rutValidator;
        this.appInvite = true;
        this.login = {
            rut: '',
            password: '',
            level: '1,5'
        };
        this.appInvite = this.service.appInvite;
        this.login = {
            rut: '',
            password: '',
            level: '1,5'
        };
    }
    LoginPage.prototype.lostPassword = function () {
        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_8__lostpassword_lostpassword__["a" /* LostPasswordPage */]);
    };
    LoginPage.prototype.next = function () {
        var _this = this;
        if (this.login.rut == "") {
            if (this.appInvite) {
                this.service.logError({}, "Email no puede estar vacío o es incorrecto");
            }
            else {
                this.service.logError({}, "Rut no puede estar vacío o es incorrecto");
            }
        }
        else if (this.login.password == "") {
            this.service.logError({}, "La contraseña no puede estar vacía");
        }
        else {
            this.loading = this.loadingCtrl.create();
            this.loading.present();
            this.auth.login(this.login).subscribe(function (data) {
                _this.loading.dismiss();
                if (data.res == "OK") {
                    _this.auth.setToken(data.token);
                    _this.storage.set("MP-Profile", data.profile);
                    if (data.profile.level == "1") {
                        _this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_9__farmacia_farmacia__["a" /* FarmaciaPage */]);
                    }
                    else if (data.profile.level == "5") {
                        _this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_3__home_home__["a" /* HomePage */]);
                    }
                }
                else {
                    _this.service.logError({}, data.msg);
                }
            }, function (err) {
                _this.loading.dismiss();
                _this.service.logError({});
            });
        }
    };
    LoginPage.prototype.gotoSignup = function () {
        if (this.appInvite) {
            this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_11__signup_signup2__["a" /* SignupPage2 */], {
                rut: '27'
            });
        }
        else {
            this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_6__signup_signup__["a" /* SignupPage */]);
        }
    };
    LoginPage.prototype.noRegistered = function () {
        var _this = this;
        this.loading = this.loadingCtrl.create();
        this.loading.present();
        this.auth.login({
            rut: '666',
            password: '666',
            level: '1,5'
        }).subscribe(function (data) {
            _this.loading.dismiss();
            if (data.res == "OK") {
                _this.auth.setToken(data.token);
                _this.storage.set("MP-Profile", data.profile);
                if (data.profile.level == "1") {
                    _this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_9__farmacia_farmacia__["a" /* FarmaciaPage */]);
                }
                else if (data.profile.level == "5") {
                    _this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_3__home_home__["a" /* HomePage */]);
                }
            }
            else {
                _this.service.logError({}, data.msg);
            }
        }, function (err) {
            _this.loading.dismiss();
            _this.service.logError({});
        });
    };
    LoginPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-login',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/login/login.html"*/'<!--\n  Generated template for the LoginPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-content padding class="newbg">\n	<img class="logo" src="assets/img/logo-green.png" alt="">\n	<div class="welcome">{{ \'LOGIN.WELCOME\' | translate }}</div>\n	<div class="listWrapper" scroll="false">\n		<ion-list>\n			<ion-item [hidden]="!appInvite">\n				<ion-label floating>Ingresa tu email</ion-label>\n				<ion-input type="email" [(ngModel)]="login.rut"></ion-input>\n			</ion-item>\n			<ion-item [hidden]="appInvite">\n				<ion-label floating>Ingresa tu rut</ion-label>\n				<ion-input type="text" formatRut [(ngModel)]="login.rut"></ion-input>\n			</ion-item>\n			<ion-item>\n				<ion-label floating>{{ \'LOGIN.PASSWORD\' | translate }}</ion-label>\n				<ion-input type="password" [(ngModel)]="login.password"></ion-input>\n			</ion-item>\n		</ion-list>\n		<div class="buttonWrapper">\n			<button class="buttonPinkOrange btnLogin" ion-button round full (tap)="next()">Iniciar sesión</button>\n		</div>\n		<div class="buttonWrapper">\n			<button class="buttonPinkOrange small signup" ion-button round (tap)="gotoSignup()">{{ \'LOGIN.TO_SIGNUP\' | translate }}</button>\n			<button [hidden]="!appInvite" class="buttonPinkOrange small signup" ion-button round (tap)="noRegistered()">Entrar sin registro</button>\n		</div>\n		<div text-center>\n			<button class="button-clear" (tap)="lostPassword()">Recuperar contraseña</button>\n		</div>\n	</div>\n	<!--\n	<div class="background"></div>\n	<div class="overlay"></div>\n	-->\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/login/login.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_4__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["n" /* Platform */],
            __WEBPACK_IMPORTED_MODULE_7__ionic_native_status_bar__["a" /* StatusBar */],
            __WEBPACK_IMPORTED_MODULE_5__services_auth_service__["a" /* AuthService */],
            __WEBPACK_IMPORTED_MODULE_10_ng2_rut__["RutValidator"]])
    ], LoginPage);
    return LoginPage;
}());

//# sourceMappingURL=login.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NewsService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common_http__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__base_service__ = __webpack_require__(96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_mergeMap__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_mergeMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_mergeMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_fromPromise__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_fromPromise__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__environments_environment__ = __webpack_require__(27);
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
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 NewsService = /** @class */ (function (_super) {
    __extends(NewsService, _super);
    function NewsService(http, storage) {
        var _this = _super.call(this, http, storage) || this;
        _this.http = http;
        _this.storage = storage;
        return _this;
    }
    NewsService.prototype.geList = function (page, perPage) {
        var apiNewsUrl = __WEBPACK_IMPORTED_MODULE_6__environments_environment__["a" /* environment */].apiUrl + 'news?page=' + page + '&per_page=' + perPage;
        return this.http.get(apiNewsUrl, {
            params: null
        });
    };
    NewsService = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1__angular_common_http__["a" /* HttpClient */], __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */]])
    ], NewsService);
    return NewsService;
}(__WEBPACK_IMPORTED_MODULE_3__base_service__["a" /* BaseService */]));

//# sourceMappingURL=news.service.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PetService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common_http__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__base_service__ = __webpack_require__(96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_mergeMap__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_mergeMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_mergeMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_fromPromise__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_fromPromise__);
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
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 PetService = /** @class */ (function (_super) {
    __extends(PetService, _super);
    function PetService(http, storage) {
        var _this = _super.call(this, http, storage) || this;
        _this.http = http;
        _this.storage = storage;
        return _this;
    }
    PetService.prototype.getLast = function () {
        return this.get('pets/last/');
    };
    PetService.prototype.getId = function (id) {
        return this.get('pets/' + id + '/');
    };
    PetService.prototype.update = function (id, data) {
        return this.post('pets/' + id, {
            "_method": "PUT",
            name: data.name,
            type: data.type,
            breed: data.breed,
            size: data.size,
            sex: data.sex,
            color: data.color,
            birthday: data.birthday,
            identifier: data.code,
            code: data.code,
            description: ''
        });
    };
    PetService.prototype.uniqueQR = function (code) {
        return this.post('pets/checkqr', {
            code: code
        });
    };
    PetService.prototype.getMascotByQR = function (code) {
        return this.post('missing-pet/found', {
            code: code
        });
    };
    /** Get My Missing Pet  */
    PetService.prototype.getMyMissingPet = function (idPet) {
        return this.get('pets/missing/' + idPet, {});
    };
    /** El dueño marca como mascota encontrada */
    PetService.prototype.petFound = function (code) {
        return this.post('missing-pet/found', {
            code: code
        });
    };
    /** Notificar al usuario de la mascota perdida */
    PetService.prototype.notifyFoundPetFromQr = function (body) {
        return this.post('missing-pet/seen', body);
        /*
        * {
          "code":body.code,
          "lat_seen":body.lat_seen,
          "lng_seen":body.lng_seen,
          "user_id":body.user_id
        }*/
    };
    /** saber si el QR pertenece a una mascota perdida */
    PetService.prototype.getLostPetByQR = function (code) {
        return this.get('missing-pet/code/' + code);
    };
    PetService.prototype.setCode = function (id, code) {
        return this.post('pets/code', {
            id: id,
            code: code
        });
    };
    PetService.prototype.add = function (id, data) {
        return this.post('pets/', {
            user_id: id,
            name: data.name,
            type: data.type,
            breed: data.breed,
            size: data.size,
            sex: data.sex,
            color: data.color,
            birthday: data.birthday,
            identifier: data.code,
            code: data.code,
            description: ''
        });
    };
    PetService.prototype.setState = function (id, state, obj) {
        if (state == 'searching') {
            return this.post('pets/available/', {
                id: id,
                available: 1
            });
        }
        if (state == 'nosearching') {
            return this.post('pets/available/', {
                id: id,
                available: 0
            });
        }
        else if (state == 'remove') {
            return this.delete('pets/' + id);
        }
        else if (state == 'lost') {
            return this.post('missing-pet/', {
                pet_id: id,
                lat: obj.lat,
                lng: obj.lng
            });
        }
        else if (state == 'found') {
            return this.post('missing-pet/found/', {
                id: id
            });
        }
    };
    /** Notificar al dueño */
    PetService.prototype.notifyOwner = function (id, myPetId) {
        return this.post('applications/' + id, {
            requester_pet_id: myPetId
        });
    };
    PetService.prototype.accept = function (id) {
        return this.get('applications/accept/' + id);
    };
    PetService.prototype.reject = function (id) {
        return this.get('applications/reject/' + id);
    };
    PetService.prototype.searchAvailable = function (data) {
        return this.post('pets/search/', data);
    };
    PetService.prototype.searchLost = function (data) {
        return this.post('missing-pet/search/', data);
    };
    PetService.prototype.getMyLove = function (data) {
        return this.post('pets/search/', data);
    };
    PetService.prototype.getMyLoveRecived = function (id) {
        return this.get('applications/received/' + id);
    };
    PetService.prototype.mainImage = function (id, index) {
        return this.post('pets/image/main/', {
            pet_id: id,
            index: index
        });
    };
    PetService.prototype.deleteImage = function (id, index) {
        return this.post('pets/image/delete/', {
            pet_id: id,
            index: index
        });
    };
    PetService.prototype.especie = function () {
        return this.get('species');
    };
    PetService.prototype.raza = function (raza) {
        return this.get('species/' + raza + '/breeds');
    };
    PetService.prototype.region = function () {
        return this.get('region');
    };
    PetService.prototype.distrito = function (region) {
        return this.get('region/' + region + '/district');
    };
    PetService.prototype.color = function () {
        return this.get('color');
    };
    PetService.prototype.size = function () {
        return this.get('size');
    };
    PetService.prototype.sex = function () {
        return this.get('petsex');
    };
    PetService = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1__angular_common_http__["a" /* HttpClient */], __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */]])
    ], PetService);
    return PetService;
}(__WEBPACK_IMPORTED_MODULE_3__base_service__["a" /* BaseService */]));

//# sourceMappingURL=pet.service.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Pata; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_http__ = __webpack_require__(388);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map__ = __webpack_require__(336);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_catch__ = __webpack_require__(308);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_catch___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_catch__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_observable_forkJoin__ = __webpack_require__(297);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_add_observable_forkJoin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_add_observable_forkJoin__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__modals_ok_ok__ = __webpack_require__(389);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__modals_err_err__ = __webpack_require__(390);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__environments_environment__ = __webpack_require__(27);
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 Pata = /** @class */ (function () {
    function Pata(alertCtrl, storage, http, modalCtrl) {
        this.alertCtrl = alertCtrl;
        this.storage = storage;
        this.http = http;
        this.modalCtrl = modalCtrl;
        this.send = [];
        this.backup = [];
        this.appInvite = true;
        this.storeName = "Productos";
        this.startApp = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
    }
    Pata.prototype.launch = function () {
        var _this = this;
        this.http.get(__WEBPACK_IMPORTED_MODULE_9__environments_environment__["a" /* environment */].apiUrl + "appInvite").map(function (data) { return data.json(); }).subscribe(function (data) {
            if (data.res == "OK") {
                _this.appInvite = true;
            }
            else {
                _this.appInvite = false;
            }
            console.log('appInvite response', data);
            _this.startApp.emit(true);
            _this.storeName = data.storeName;
        });
    };
    Pata.prototype.logError = function (o, msg, cb) {
        if (!msg) {
            msg = "Ha ocurrido un error, intente nuevamente";
        }
        var errModal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_8__modals_err_err__["a" /* ModalERR */], { msg: msg });
        errModal.present();
        errModal.onDidDismiss(function (data) {
            if (cb) {
                cb();
            }
        });
    };
    Pata.prototype.showMsg = function (msg) {
        var alert = this.alertCtrl.create({
            title: '',
            cssClass: 'alertSuccess',
            subTitle: msg,
            buttons: ['Aceptar']
        });
        alert.present();
    };
    Pata.prototype.showOk = function (msg) {
        if (!msg) {
            msg = "La acción fue realizada exitosamente!";
        }
        var okModal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_7__modals_ok_ok__["a" /* ModalOK */], { msg: msg });
        okModal.present();
    };
    Pata.prototype.headers = function () {
        var headers = new __WEBPACK_IMPORTED_MODULE_2__angular_http__["a" /* Headers */]();
        headers.append('Accept', 'application/json');
        headers.append('Content-Type', 'application/json');
        headers.append('Authorization', this.perfil.token);
        var options = new __WEBPACK_IMPORTED_MODULE_2__angular_http__["d" /* RequestOptions */]({ headers: headers });
        return options;
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"])(),
        __metadata("design:type", Object)
    ], Pata.prototype, "startApp", void 0);
    Pata = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */], __WEBPACK_IMPORTED_MODULE_3__ionic_storage__["b" /* Storage */], __WEBPACK_IMPORTED_MODULE_2__angular_http__["b" /* Http */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */]])
    ], Pata);
    return Pata;
}());

//# sourceMappingURL=pata.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalDetallesPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_moment__);
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 ModalDetallesPage = /** @class */ (function () {
    function ModalDetallesPage(navCtrl, viewCtrl, docService, service, loadingCtrl, modalCtrl, navParams) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.viewCtrl = viewCtrl;
        this.docService = docService;
        this.service = service;
        this.loadingCtrl = loadingCtrl;
        this.modalCtrl = modalCtrl;
        this.navParams = navParams;
        this.order = null;
        this.load = false;
        this.id = '';
        var id = this.navParams.get('id');
        var load = this.loadingCtrl.create({ content: 'cargando...' });
        load.present();
        this.docService.getOrders(id).subscribe(function (data) {
            load.dismiss();
            _this.load = true;
            _this.order = data.data;
        });
    }
    ModalDetallesPage.prototype.dismiss = function () {
        this.viewCtrl.dismiss();
    };
    ModalDetallesPage.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_4_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_4_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_4_moment__["ISO_8601"]).format();
    };
    ModalDetallesPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-modal-detalles',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/modal-detalles/modal-detalles.html"*/'<ion-content padding class="main-view">\n  <!--<div class="overlay" (click)="dismiss()"></div>--> \n  <div class="modal_content">\n    <ion-grid>\n      <ion-row>\n        <ion-col col-10><h3>Detalles del pedido</h3></ion-col>\n        <ion-col col-2>\n          <h3><ion-icon name="close-circle-outline" (click)="dismiss()"></ion-icon></h3>\n        </ion-col>\n      </ion-row>\n    </ion-grid>\n    <div *ngIf="load">\n      \n      <ion-list mode="md">\n        <ion-item>\n          <ion-label class="font-lb">\n            Fecha de creación:\n          </ion-label>\n          <ion-label class="dateExpire">\n            {{order.created_at | date: "dd/MM/yyyy HH:mm"}}\n          </ion-label>\n        </ion-item>\n        <ion-item>\n          <ion-label class="font-lb">\n            Entrega programada:\n          </ion-label>\n          <ion-label class="dateExpire">\n            {{order.delivered_program | date: "dd/MM/yyyy"}}\n          </ion-label>\n        </ion-item>\n        <ion-item>\n          <ion-label class="font-lb">\n            Estado:\n          </ion-label>\n          <ion-label class="dateExpire">\n              <span class="status-waiting" *ngIf="order.status == \'0\'">Programado</span>\n              <span class="status-waiting" *ngIf="order.status == \'1\'">Programado</span>\n              <span class="status-waiting" *ngIf="order.status == \'2\'">Programado</span>\n              <span class="status-waiting" *ngIf="order.status == \'3\'">Programado</span>\n              <span class="status-waiting" *ngIf="order.status == \'4\'">Programado</span>\n              <span class="status-waiting" *ngIf="order.status == \'5\'">Programado</span>\n              <span class="status-waiting" *ngIf="order.status == \'6\'">Programado</span>\n              <span class="status-expire" *ngIf="order.status == \'7\'">En tránsito</span>\n  \n              <span class="status-expire" *ngIf="order.status == \'10\'">Por entregar</span>\n              <span class="status-success" *ngIf="order.status == \'15\'">Entregada</span>\n              <span class="status-declined" *ngIf="order.status == \'666\'">Anulada</span>\n              <span class="status-declined" *ngIf="order.status == \'-1\'">Devuelta</span> \n          </ion-label>\n        </ion-item>\n        <ion-item>\n          <label class="font-lb">\n            Lista de artículos:\n          </label>\n        </ion-item>\n        <ion-item>\n          <ion-grid>\n            <ion-row *ngFor="let item of order.items; let j = index;">\n              <ion-col col-5 style="white-space:normal">{{item.product_name}}</ion-col>\n              <ion-col col-3>{{item.qty | number}} {{(item.product_type == \'FLOR\' ? \'grs\' : \'unid.\')}}</ion-col>\n              <ion-col col-4>$ {{item.total_line | number}}</ion-col>\n            </ion-row>\n          </ion-grid>\n        </ion-item>\n        <ion-item>\n          <label class="font-lb labelRed">\n            Valor pedido:\n          </label>\n          <p class="pRed">\n            $ {{order.items_price | number }}\n          </p>\n        </ion-item>\n        <ion-item>\n          <label class="font-lb labelRed">\n            Despacho:\n          </label>\n          <p class="pRed">\n            $ {{order.ship_price | number }}\n          </p>\n        </ion-item>\n        <ion-item>\n          <label class="font-lb labelRed">\n            Valor abonado total:\n          </label>\n          <p class="pRed">\n            $ {{order.total | number }}\n          </p>\n        </ion-item>\n        <ion-item>\n          <label class="font-lb">\n            Observaciones:\n          </label>\n          <p>\n            {{order.notes}}\n          </p>\n        </ion-item>\n      </ion-list>\n\n    </div>\n   \n  </div>\n\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/modal-detalles/modal-detalles.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */]])
    ], ModalDetallesPage);
    return ModalDetallesPage;
}());

//# sourceMappingURL=modal-detalles.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TrackingProvider; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ionic_native_background_geolocation__ = __webpack_require__(536);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_native_geolocation__ = __webpack_require__(108);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_filter__ = __webpack_require__(326);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ionic_angular__ = __webpack_require__(6);
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 TrackingProvider = /** @class */ (function () {
    function TrackingProvider(zone, platform, backgroundGeolocation, geolocation) {
        this.zone = zone;
        this.platform = platform;
        this.backgroundGeolocation = backgroundGeolocation;
        this.geolocation = geolocation;
        this.lat = 0;
        this.lng = 0;
        this.trackingInProgress = false;
    }
    TrackingProvider.prototype.queryInProgress = function () {
        return this.trackingInProgress;
    };
    TrackingProvider.prototype.startTracking = function () {
        var _this = this;
        if (this.trackingInProgress == false) {
            console.log('starting tracking, this is first time');
            var config = {
                desiredAccuracy: 0,
                stationaryRadius: 20,
                distanceFilter: 10,
                debug: false,
                interval: 10000,
                pauseLocationUpdates: false
            };
            //Corriendo en segundo plano
            this.backgroundGeolocation.configure(config).subscribe(function (location) {
                console.log('Ubicacion:  ' + location.latitude + ',' + location.longitude);
                _this.zone.run(function () {
                    _this.lat = location.latitude;
                    _this.lng = location.longitude;
                });
            }, function (err) {
                var options = {
                    frequency: 10000,
                    enableHighAccuracy: true
                };
                _this.watch = _this.geolocation.watchPosition(options).filter(function (p) { return p.code === undefined; }).subscribe(function (position) {
                    /*console.log(position);*/
                    _this.zone.run(function () {
                        _this.lat = position.coords.latitude;
                        _this.lng = position.coords.longitude;
                    });
                });
            });
            this.backgroundGeolocation.start();
            //Corriendo en primer plano (aplicacion abierta)
            var options = {
                frequency: 10000,
                enableHighAccuracy: true
            };
            this.watch = this.geolocation.watchPosition(options).filter(function (p) { return p.code === undefined; }).subscribe(function (position) {
                /*console.log(position);*/
                _this.zone.run(function () {
                    _this.lat = position.coords.latitude;
                    _this.lng = position.coords.longitude;
                });
            });
        }
        this.trackingInProgress = true;
    };
    TrackingProvider.prototype.stopTracking = function () {
        console.log('stopTracking');
        this.backgroundGeolocation.finish();
        this.watch.unsubscribe();
    };
    TrackingProvider.prototype.UbicacionLat = function () {
        var _this = this;
        if (!this.platform.is('cordova')) {
            this.geolocation.getCurrentPosition().then(function (ok) {
                _this.lat = ok.coords.latitude;
                _this.lng = ok.coords.longitude;
                //console.log('Ubicacion por Ubicación Lat', ok.coords);
            }, function (err) {
                console.log('no cordova geo err');
            });
        }
        return this.lat;
    };
    TrackingProvider.prototype.UbicacionLng = function () {
        var _this = this;
        if (!this.platform.is('cordova')) {
            this.geolocation.getCurrentPosition().then(function (ok) {
                _this.lat = ok.coords.latitude;
                _this.lng = ok.coords.longitude;
                /*console.log('Ubicacion por Ubicación Lng', ok.coords);*/
            }, function (err) {
                /*console.log('no cordova geo err');*/
            });
        }
        return this.lng;
    };
    TrackingProvider = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"],
            __WEBPACK_IMPORTED_MODULE_4_ionic_angular__["n" /* Platform */],
            __WEBPACK_IMPORTED_MODULE_1__ionic_native_background_geolocation__["a" /* BackgroundGeolocation */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_native_geolocation__["a" /* Geolocation */]])
    ], TrackingProvider);
    return TrackingProvider;
}());

//# sourceMappingURL=tracking.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SignupPage2; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__signup_signup3__ = __webpack_require__(538);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__services_auth_service__ = __webpack_require__(42);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ionic_native_in_app_browser__ = __webpack_require__(78);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ionic_native_camera__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__environments_environment__ = __webpack_require__(27);
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 SignupPage2 = /** @class */ (function () {
    function SignupPage2(navCtrl, service, loadingCtrl, storage, navParams, auth, iab, platform, camera, actionSheetCtrl) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.service = service;
        this.loadingCtrl = loadingCtrl;
        this.storage = storage;
        this.navParams = navParams;
        this.auth = auth;
        this.iab = iab;
        this.platform = platform;
        this.camera = camera;
        this.actionSheetCtrl = actionSheetCtrl;
        this.agree = false;
        this.reg = {
            rut: '',
            email: '',
            first_name: '',
            last_name: '',
            street: '',
            city: '',
            state: '',
            additional: '',
            phone: '',
            passwd: '',
            passwd2: '',
            cedula: '',
            cedula2: ''
        };
        this.terms = '';
        this.cities = null;
        this.states = null;
        this.subido = false;
        this.subido2 = false;
        this.reg.card_code = this.navParams.get("rut");
        this.loading = this.loadingCtrl.create();
        this.loading.present();
        this.auth.getStates().subscribe(function (data) {
            _this.states = data.data;
            _this.loading.dismiss();
        }, function (err) {
            _this.loading.dismiss();
            _this.service.logError({});
        });
        this.auth.getTerms().subscribe(function (data) {
            _this.terms = data.url;
        });
        // get terms
    }
    SignupPage2.prototype.verTerminos = function () {
        var browser = this.iab.create(this.terms, '_blank', 'location=no,closebuttoncaption=Listo,closebuttoncolor=#FFFFFF,footer=yes,hideurlbar=yes');
    };
    SignupPage2.prototype.next = function () {
        var _this = this;
        if (this.agree == false) {
            this.service.logError({}, "Debes aceptar los términos y condiciones de MY para continuar");
        }
        else if (this.reg.card_code == "") {
            this.service.logError({}, "RUT no puede estar vacío");
        }
        else if (this.reg.email == "") {
            this.service.logError({}, "Email no puede estar vacío");
        }
        else if (this.reg.first_name == "" || this.reg.last_name == "") {
            this.service.logError({}, "Nombre y apellido no puede estar vacío");
        }
        else if ((this.reg.state == "" || this.reg.city == "") && this.reg.card_code != '27') {
            this.service.logError({}, "Debe indicar una región y comuna");
        }
        else if (this.reg.phone.length < 15 && this.reg.card_code != '27') {
            this.service.logError({}, "Ingrese 11 dìgitos en el teléfono");
        }
        else if (this.reg.passwd == "") {
            this.service.logError({}, "Tu clave no puede estar vacía");
        }
        else if (this.reg.passwd != this.reg.passwd2) {
            this.service.logError({}, "Las claves no coinciden, ingresa en los 2 campos una misma clave");
        }
        else if (this.reg.cedula == "" && this.reg.card_code != '27') {
            this.service.logError({}, "Debes subir una foto frontal de tu cédula");
        }
        else if (this.reg.cedula2 == "" && this.reg.card_code != '27') {
            this.service.logError({}, "Debes subir una foto del reverso de tu cédula");
        }
        else {
            this.loading = this.loadingCtrl.create();
            this.loading.present();
            this.auth.register(this.reg).subscribe(function (data) {
                _this.loading.dismiss();
                if (data.res == "OK") {
                    _this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_3__signup_signup3__["a" /* SignupPage3 */]);
                }
                else {
                    _this.service.logError({}, data.msg);
                }
            }, function (err) {
                _this.loading.dismiss();
                _this.service.logError({});
            });
        }
    };
    SignupPage2.prototype.cedula = function () {
        var _this = this;
        if (this.platform.is('cordova')) {
            this.camera.getPicture({
                destinationType: this.camera.DestinationType.DATA_URL,
                quality: 100,
                encodingType: this.camera.EncodingType.JPEG,
                mediaType: this.camera.MediaType.PICTURE,
                correctOrientation: true
            }).then(function (imageData) {
                _this.processTake(imageData, 1);
            }, function (err) {
                console.log(err);
            });
        }
        else {
            this.processTake(" ", 1);
        }
    };
    SignupPage2.prototype.cedula2 = function () {
        var _this = this;
        if (this.platform.is('cordova')) {
            this.camera.getPicture({
                destinationType: this.camera.DestinationType.DATA_URL,
                quality: 100,
                encodingType: this.camera.EncodingType.JPEG,
                mediaType: this.camera.MediaType.PICTURE,
                correctOrientation: true
            }).then(function (imageData) {
                _this.processTake(imageData, 2);
            }, function (err) {
                console.log(err);
            });
        }
        else {
            this.processTake(" ", 2);
        }
    };
    SignupPage2.prototype.optionsImagen = function (index) {
        var actionSheet = this.actionSheetCtrl.create({
            title: 'Opciones de la imagen',
            buttons: [
                {
                    text: 'Eliminar',
                    role: 'destructive',
                    handler: function () {
                        /*this.images.splice(index, 1);*/
                    }
                }, {
                    text: 'Cancelar',
                    role: 'cancel',
                    handler: function () {
                    }
                }
            ]
        });
        actionSheet.present();
    };
    SignupPage2.prototype.dataURItoBlob = function (dataURI) {
        var byteString;
        if (dataURI.split(',')[0].indexOf('base64') >= 0)
            byteString = atob(dataURI.split(',')[1]);
        else
            byteString = (dataURI.split(',')[1]);
        var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
        var ia = new Uint8Array(byteString.length);
        for (var i = 0; i < byteString.length; i++) {
            ia[i] = byteString.charCodeAt(i);
        }
        return new Blob([ia], {
            type: mimeString
        });
    };
    SignupPage2.prototype.processTake = function (imageData, destiny) {
        if (destiny == 1) {
            this.base64Image = "data:image/jpeg;base64," + imageData;
        }
        else {
            this.base64Image2 = "data:image/jpeg;base64," + imageData;
        }
        this.loading = this.loadingCtrl.create({ content: 'subiendo...' });
        this.loading.present();
        var self0 = this;
        var blob = null;
        if (destiny == 1) {
            blob = this.dataURItoBlob(this.base64Image);
        }
        else {
            blob = this.dataURItoBlob(this.base64Image2);
        }
        var objURL = window.URL.createObjectURL(blob);
        var image = new Image();
        image.src = objURL;
        window.URL.revokeObjectURL(objURL);
        var url = window.URL.createObjectURL(blob);
        var formData = new FormData();
        formData.append('avatar', blob, 'avatar.jpg');
        var xhr = new XMLHttpRequest();
        xhr.open("post", __WEBPACK_IMPORTED_MODULE_8__environments_environment__["a" /* environment */].apiUrl + "cedula");
        xhr.onreadystatechange = function () {
            if (xhr.readyState === 4 && xhr.status === 200) {
                var uri = xhr.responseText;
                self0.loading.dismiss();
                if (uri.indexOf('error') > -1) {
                    self0.service.logError({}, 'Error al procesar la solicitud. Inténtelo más tarde.');
                }
                else {
                    console.log(uri);
                    var json = JSON.parse(uri);
                    if (destiny == 1) {
                        self0.subido = true;
                        self0.addUploadOK(json);
                    }
                    else {
                        self0.subido2 = true;
                        self0.addUploadOK2(json);
                    }
                }
            }
        };
        xhr.send(formData);
    };
    SignupPage2.prototype.b64toBlob = function (b64, onsuccess, onerror) {
        var img = new Image();
        img.onerror = onerror;
        img.onload = function onload() {
            var canvas = document.createElement('canvas');
            canvas.width = img.width;
            canvas.height = img.height;
            var ctx = canvas.getContext('2d');
            ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
            canvas.toBlob(onsuccess);
        };
        img.src = b64;
    };
    SignupPage2.prototype.changeCities = function (newObj) {
        var _this = this;
        this.reg.city = "";
        this.loading = this.loadingCtrl.create();
        this.loading.present();
        this.auth.getCities(newObj).subscribe(function (data) {
            _this.cities = data.data;
            _this.loading.dismiss();
        }, function (err) {
            _this.loading.dismiss();
            _this.service.logError({});
        });
    };
    SignupPage2.prototype.gotoLogin = function () {
        this.navCtrl.pop().then(function () {
        });
    };
    SignupPage2.prototype.addUploadOK = function (uri) {
        this.reg.cedula = uri.url;
    };
    SignupPage2.prototype.addUploadOK2 = function (uri) {
        this.reg.cedula2 = uri.url;
    };
    SignupPage2 = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-signup2',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/signup/signup2.html"*/'<!--\n  Generated template for the LoginPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-content padding class="newbg">\n  <img class="back-arrow" src="assets/img/back.png" alt="" (tap)="gotoLogin()" />\n  <img class="logo" src="assets/img/logo-green.png" alt="" />\n  <div class="description">Completa los siguientes datos para comenzar</div>\n  <div class="listWrapper">\n    <ion-list>\n      <ion-item *ngIf="reg.card_code != \'27\'">\n        <input class="fwrut text-input" readonly type="text" [(ngModel)]="reg.card_code" formatRut placeholder="RUT" />\n      </ion-item>\n      <ion-item>\n        <ion-input type="text" [(ngModel)]="reg.first_name" placeholder="Nombres"></ion-input>\n      </ion-item>\n      <ion-item>\n        <ion-input type="text" [(ngModel)]="reg.last_name" placeholder="Apellido"></ion-input>\n      </ion-item>\n      <ion-item>\n        <ion-input type="tel" *ngIf="reg.card_code == \'27\'" [brmasker]="{phone: true}" placeholder="Teléfono (opcional)" [(ngModel)]="reg.phone"></ion-input>\n        <ion-input type="tel" *ngIf="reg.card_code != \'27\'" [brmasker]="{phone: true}" placeholder="Teléfono" [(ngModel)]="reg.phone"></ion-input>\n      </ion-item>  \n      <ion-item>\n        <ion-input type="email" [(ngModel)]="reg.email" placeholder="Email"></ion-input>\n      </ion-item>\n    </ion-list>\n  </div>\n\n  <div class="description" *ngIf="reg.card_code != \'27\'"><br />Sube tu carnet</div>\n  <div class="listWrapper" *ngIf="reg.card_code != \'27\'">  \n    <p>Sube una foto de tu cédula de identidad (frontal y reverso). Regularmente nuestro equipo revisa las cédulas de los usuarios</p>\n\n    <ion-grid>\n      <ion-row>\n        <ion-col col-12>\n            <h3>Frontal</h3>\n            <button ion-button round (tap)="cedula()" class="openCamera" small>Abrir Cámara</button>\n        </ion-col>\n      </ion-row>\n      <ion-row *ngIf="subido">\n        <ion-col col-12>\n          <div class="sube_carnet" [ngStyle]="{\'background-image\': \'url(\'+(base64Image)+\')\'}">\n\n          </div>\n        </ion-col>\n      </ion-row>\n      <ion-row>\n        <ion-col col-12>\n            <h3>Reverso</h3>\n            <button ion-button round (tap)="cedula2()" class="openCamera" small>Abrir Cámara</button>\n        </ion-col>\n      </ion-row>\n      <ion-row *ngIf="subido2">\n        <ion-col col-12>\n          <div class="sube_carnet" [ngStyle]="{\'background-image\': \'url(\'+(base64Image2)+\')\'}">\n\n          </div>\n        </ion-col>\n      </ion-row>\n    </ion-grid>\n  </div>\n  \n  <div class="description"><br />Crea una clave</div>\n  <div class="listWrapper">  \n    <ion-list>\n      <ion-item>\n        <ion-input placeholder=\'Clave\' type="password" [(ngModel)]="reg.passwd"></ion-input>\n      </ion-item>  \n      <ion-item>\n        <ion-input placeholder="Repite clave" type="password" [(ngModel)]="reg.passwd2"></ion-input>\n      </ion-item>  \n    </ion-list>\n  </div>\n\n  <div class="description" *ngIf="reg.card_code != \'27\'">Tu dirección principal</div>\n  <div class="listWrapper" *ngIf="reg.card_code != \'27\'">  \n    <ion-list>\n      <ion-item>\n        <ion-input type="text" [(ngModel)]="reg.street" placeholder="Calle y Número"></ion-input>\n      </ion-item>\n      <ion-item>\n        <ion-input type="text" [(ngModel)]="reg.additional" placeholder="Departamento, Piso, Torre"></ion-input>\n      </ion-item>\n      <ion-item>\n        <ion-label>Región</ion-label>\n        <ion-select [(ngModel)]="reg.state" okText="OK" cancelText="Cancelar" (ngModelChange)="changeCities($event)">\n          <ion-option *ngFor="let state of states" [value]="state.id">{{state.name}}</ion-option>\n        </ion-select>\n      </ion-item>\n      <ion-item>\n        <ion-label>Ciudad/Comuna</ion-label>\n        <ion-select [(ngModel)]="reg.city" okText="OK" cancelText="Cancelar">\n          <ion-option *ngFor="let city of cities" [value]="city.id">{{city.name}}</ion-option>\n        </ion-select>\n      </ion-item>\n    </ion-list>\n  </div>\n  <div class="listWrapper">\n    <ion-list>\n      <ion-row class="row_terms">\n        <ion-col col-2>\n          <ion-checkbox [(ngModel)]="agree"></ion-checkbox>\n        </ion-col>           \n        <ion-col col-10 style=\'line-height: 50px;\'>\n          <a (tap)="verTerminos()">Acepto los términos y condiciones</a>\n        </ion-col>\n      </ion-row>\n    </ion-list>\n  </div>\n  <div class="buttonWrapper">\n    <button class="buttonPinkOrange" ion-button round full (tap)="next()">Siguiente</button>\n  </div>\n\n\n  <div class="buttonWrapper">\n    <button class="buttonPinkOrange small login" ion-button round  (tap)="gotoLogin()">Volver</button>\n  </div>\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/signup/signup2.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_4__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_5__services_auth_service__["a" /* AuthService */],
            __WEBPACK_IMPORTED_MODULE_6__ionic_native_in_app_browser__["a" /* InAppBrowser */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["n" /* Platform */],
            __WEBPACK_IMPORTED_MODULE_7__ionic_native_camera__["a" /* Camera */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* ActionSheetController */]])
    ], SignupPage2);
    return SignupPage2;
}());

//# sourceMappingURL=signup2.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FarmaciaPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_moment__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__receta_add__ = __webpack_require__(197);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_observable_forkJoin__ = __webpack_require__(89);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs_observable_forkJoin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs_observable_forkJoin__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__producto_producto__ = __webpack_require__(199);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__category_category__ = __webpack_require__(540);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__modals_cart_cart__ = __webpack_require__(79);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__modals_modal_terms_modal_terms__ = __webpack_require__(541);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__services_user_service__ = __webpack_require__(28);
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 FarmaciaPage = /** @class */ (function () {
    function FarmaciaPage(navCtrl, modalCtrl, loadingCtrl, alertCtrl, service, userService, doctorService) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.modalCtrl = modalCtrl;
        this.loadingCtrl = loadingCtrl;
        this.alertCtrl = alertCtrl;
        this.service = service;
        this.userService = userService;
        this.doctorService = doctorService;
        this.products = [];
        this.results = [];
        this.categorys = [];
        this.balance = 0;
        this.loadFeatured = null;
        this.loadBalance = null;
        this.loadCategory = null;
        this.search = '';
        this.cartItems = 0;
        this.searching = false;
        this.searchSub = null;
        this.running = false;
        this.appInvite = true;
        this.user = { id: '0' };
        this.storeName = "Productos";
        this.appInvite = this.service.appInvite;
        this.userService.getProfile().subscribe(function (result) {
            _this.user = result;
        });
        var loading = this.loadingCtrl.create();
        loading.present();
        /*
        this.doctorService.getCart().subscribe((data:any)=> {
          this.cartItems = data.short.length;
        });
        */
        this.loadBalance = this.doctorService.getBalanceGrow();
        this.loadFeatured = this.doctorService.featured();
        this.loadCategory = this.doctorService.getCategory();
        this.doctorService.getTerms().subscribe(function (tdata) {
            var termsModal = _this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_10__modals_modal_terms_modal_terms__["a" /* ModalTermsPage */], { obj: tdata.data }, { enableBackdropDismiss: false, showBackdrop: true });
            var presentModal = 0;
            if (tdata.res == "ERR") {
                presentModal = 1;
            }
            Object(__WEBPACK_IMPORTED_MODULE_6_rxjs_observable_forkJoin__["forkJoin"])(_this.loadBalance, _this.loadFeatured, _this.loadCategory).subscribe(function (data) {
                loading.dismiss();
                if (presentModal == 1) {
                    termsModal.present();
                }
                _this.balance = data[0].balance;
                _this.products = data[1].data;
                _this.categorys = data[2].data;
            });
        });
    }
    FarmaciaPage.prototype.ionViewDidEnter = function () {
        var _this = this;
        this.storeName = this.service.storeName;
        this.doctorService.getCart().subscribe(function (data) {
            _this.cartItems = data.short.length;
        });
    };
    FarmaciaPage.prototype.onCancel = function (evt) {
        this.search = '';
        this.getItems('nothing');
    };
    FarmaciaPage.prototype.getItems = function (evt) {
        var _this = this;
        if (this.search.trim() == '') {
            this.searching = false;
            this.results = [];
        }
        else {
            this.searching = true;
        }
        try {
            this.searchSub.unsubscribe();
            this.running = false;
        }
        catch (err) {
        }
        if (this.searching) {
            this.running = true;
            this.searchSub = this.doctorService.search(this.search);
            this.searchSub.subscribe(function (data) {
                _this.running = false;
                _this.results = data.data;
            });
        }
    };
    FarmaciaPage.prototype.cart = function () {
        var _this = this;
        var cartModal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_9__modals_cart_cart__["a" /* ModalCart */]);
        cartModal.onDidDismiss(function (data) {
            if (data) {
                _this.cartItems = data.items.length;
                _this.doctorService.cartFull = data;
                _this.doctorService.syncCart();
                if (data.hasOwnProperty("finish") && data.finish == 1) {
                    _this.service.showOk(data.msg);
                }
            }
        });
        cartModal.present();
    };
    FarmaciaPage.prototype.goRecetasAdd = function () {
        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_5__receta_add__["a" /* RecetaAddPage */]);
    };
    FarmaciaPage.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_4_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_4_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_4_moment__["ISO_8601"]).format();
    };
    FarmaciaPage.prototype.detail = function (product) {
        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_7__producto_producto__["a" /* ProductoPage */], { id: product.id });
    };
    FarmaciaPage.prototype.navcategory = function (category) {
        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_8__category_category__["a" /* CategoryPage */], { id: category.id });
    };
    FarmaciaPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-farmacia',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/farmacia/farmacia.html"*/'<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>{{storeName}}</ion-title>\n    <ion-buttons end *ngIf="user?.id != \'0\'">\n      <div class="glovo">{{cartItems}}</div>\n      <button class="search-top" ion-button icon-only (tap)="cart()">\n        <ion-icon ios="ios-cart-outline" md="ios-cart-outline"></ion-icon>\n      </button>\n    </ion-buttons>\n  </ion-navbar>\n</ion-header>\n\n<ion-content>\n  <ion-searchbar [(ngModel)]="search" (ionCancel)="onCancel($event)" (ionInput)="getItems($event)" placeholder="Buscar..." [showCancelButton]="false"></ion-searchbar>\n \n  <div class="aviso_clean" *ngIf="!appInvite && balance > 0 && !searching">\n    <span>tienes</span> <h2>{{balance | number}} grs</h2> <span>disponibles</span> <img src="assets/img/icon_marijuana.png" style="max-width:32px;" />\n  </div>\n\n  <div class="aviso_clean" *ngIf="!appInvite && balance == 0 && !searching">\n    <ion-grid>\n      <ion-row>\n        <ion-col col-3>\n            <img src="assets/img/icon_marijuana.png" />\n        </ion-col>\n        <ion-col col-5>\n          <span>Sin recetas vigentes</span> <h2>Tienes 0 grs</h2> <span>disponibles para abonar flores.</span> \n        </ion-col>\n        <ion-col col-3>\n            <button class="button-white solucionar" ion-button small outline (tap)="goRecetasAdd()">Solucionar</button>\n        </ion-col>\n      </ion-row>\n    </ion-grid>\n  </div>\n\n  <div *ngIf="products.length > 0 && !searching" class="itemlisting">\n    <h1>Destacados</h1>\n    <ion-slides spaceBetween="10" slidesPerView="1.8">\n      <ion-slide (tap)="detail(product)" *ngFor="let product of products" [ngStyle]="{\'background-image\': \'url(\'+(product.image == \'\' ? \'assets/img/default/no-pictures.png\' : product.image)+\')\'}">\n        <div class="slide-product">\n          <div class="slide-title">{{product.name}}</div>\n          <div class="slide-price" *ngIf="product.price > 0">$ {{product.price | number:\'1.0-0\' }}</div>\n        </div>\n      </ion-slide> \n    </ion-slides>\n  </div>\n \n  <div *ngIf="categorys.length > 0 && !searching" class="itemlisting">\n    <h1>Categorias</h1>\n    <div *ngFor="let category of categorys" class="category" (tap)="navcategory(category)">\n      <div class="category-item">\n        <div class="category-background" [ngStyle]="{\'background-image\':\'url(\'+(category.banner != \'\' ? category.banner : \'assets/img/default/no-pictures.png\')+\')\'}"></div>\n        <div class="category-item-title">{{category.name}}</div>\n      </div>\n    </div>\n  </div>\n\n  <div *ngIf="searching">\n    <ion-card *ngIf="results.length == 0 || running">\n      <ion-card-header class="no-items" text-wrap>\n        <div class="sping-refresh" *ngIf="running">\n          <img src="assets/img/loader.gif">\n          <br /> buscando...\n        </div>\n        <div *ngIf="!running">\n          <img src="assets/img/icon.route.png" />\n          <br /> Por ahora, no hay resultados para <b>&quot;{{search}}&quot;</b>\n          <br />\n        </div>\n\n      </ion-card-header>\n    </ion-card>\n    <div *ngIf="results.length > 0" class="itemlisting">\n      <h1>Resultados</h1>\n      <div *ngFor="let product of results" class="category-product" (tap)="detail(product)">\n        <div class="category-product-item">\n          <img [src]="product.image" />\n          <div class="category-product-title">{{product.name}}</div>\n        </div>\n      </div>\n    </div>\n\n  </div>\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/farmacia/farmacia.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_11__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */]])
    ], FarmaciaPage);
    return FarmaciaPage;
}());

//# sourceMappingURL=farmacia.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RecetaAddPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__environments_environment__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_moment__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ionic_native_camera__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__receta__ = __webpack_require__(198);
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 RecetaAddPage = /** @class */ (function () {
    function RecetaAddPage(navCtrl, modalCtrl, loadingCtrl, alertCtrl, service, platform, camera, actionSheetCtrl, doctorService) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.modalCtrl = modalCtrl;
        this.loadingCtrl = loadingCtrl;
        this.alertCtrl = alertCtrl;
        this.service = service;
        this.platform = platform;
        this.camera = camera;
        this.actionSheetCtrl = actionSheetCtrl;
        this.doctorService = doctorService;
        this.images = [];
        this.doctor = { name: '', card_code: '' };
        this.inicio = '';
        this.final = '';
        this.gramos = 0;
        this.token = '';
        this.loading = null;
        this.maxDate = '';
        this.minDate = '';
        this.showWarning = false;
        this.doctorService.getToken().subscribe(function (data) {
            _this.token = data;
        });
        var now = __WEBPACK_IMPORTED_MODULE_5_moment__();
        var now2 = __WEBPACK_IMPORTED_MODULE_5_moment__();
        now.add(240, 'M');
        now2.subtract(36, 'M');
        this.maxDate = now.format("YYYY-MM-DD");
        this.minDate = now2.format("YYYY-MM-DD");
        this.searchRecetaPending();
    }
    RecetaAddPage.prototype.ionViewDidEnter = function () {
    };
    RecetaAddPage.prototype.searchRecetaPending = function () {
        var _this = this;
        this.doctorService.getRecetas().subscribe(function (data) {
            for (var x = 0; x < data.data.length; x++) {
                if (parseInt(data.data[x].status) == 0) {
                    _this.showWarning = true;
                    break;
                }
            }
        }, function (err) {
        });
    };
    RecetaAddPage.prototype.takePicture = function () {
        var _this = this;
        if (this.platform.is('cordova')) {
            this.camera.getPicture({
                destinationType: this.camera.DestinationType.DATA_URL,
                quality: 100,
                encodingType: this.camera.EncodingType.JPEG,
                mediaType: this.camera.MediaType.PICTURE,
                correctOrientation: true
            }).then(function (imageData) {
                _this.processTake(imageData);
            }, function (err) {
                console.log(err);
            });
        }
        else {
            this.processTake(" ");
        }
    };
    RecetaAddPage.prototype.openGallery = function () {
        var _this = this;
        var cameraOptions = {
            sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
            destinationType: this.camera.DestinationType.DATA_URL,
            quality: 60,
            targetWidth: 320,
            targetHeight: 320,
            encodingType: this.camera.EncodingType.JPEG,
            correctOrientation: true
        };
        this.camera.getPicture(cameraOptions)
            .then(function (file_uri) {
            _this.processTake(file_uri);
        }, function (err) {
            console.log(err);
        });
    };
    RecetaAddPage.prototype.addFotoReceta = function () {
        var _this = this;
        var actionSheet = this.actionSheetCtrl.create({
            title: 'Sube una imagen',
            buttons: [
                {
                    text: 'Usar mi cámara',
                    handler: function () {
                        _this.takePicture();
                    }
                }, {
                    text: 'Usar galeria',
                    handler: function () {
                        _this.openGallery();
                    }
                }, {
                    text: 'Cancelar',
                    role: 'cancel',
                    handler: function () {
                    }
                }
            ]
        });
        actionSheet.present();
    };
    RecetaAddPage.prototype.optionsImagen = function (index) {
        var _this = this;
        var actionSheet = this.actionSheetCtrl.create({
            title: 'Opciones de la imagen',
            buttons: [
                {
                    text: 'Eliminar',
                    role: 'destructive',
                    handler: function () {
                        _this.images.splice(index, 1);
                    }
                }, {
                    text: 'Cancelar',
                    role: 'cancel',
                    handler: function () {
                    }
                }
            ]
        });
        actionSheet.present();
    };
    RecetaAddPage.prototype.save = function () {
        var _this = this;
        var ini = __WEBPACK_IMPORTED_MODULE_5_moment__(this.inicio);
        var end = __WEBPACK_IMPORTED_MODULE_5_moment__(this.final);
        if (this.images.length == 0) {
            this.service.showMsg("Es necesario cargar a lo menos una imagen de receta");
        }
        else if (this.gramos < 1) {
            this.service.showMsg("Gramos diarios debe ser superior a 0");
        }
        else if (!ini.isValid() || !end.isValid()) {
            this.service.showMsg("Debe indicar fecha de inicio y término");
        }
        else if (ini.isAfter(end)) {
            this.service.showMsg("Fecha de inicio debe ser inferior a fecha de término");
        }
        else if (this.doctor.name == "" || this.doctor.card_code == "") {
            this.service.showMsg("Ingrese datos del médico firmante");
        }
        else {
            this.doctorService.savePrescription({
                start: ini.format("YYYY-MM-DD"),
                end: end.format("YYYY-MM-DD"),
                grs: this.gramos,
                image: this.images.join(','),
                doctorname: this.doctor.name,
                doctorcode: this.doctor.card_code
            }).subscribe(function (data) {
                if (data.res == "OK") {
                    _this.service.showOk("Receta enviada con éxito");
                    _this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_7__receta__["a" /* RecetaPage */], {}, { direction: 'forward' });
                }
                else {
                    _this.service.showMsg(data.msg);
                }
            });
        }
    };
    RecetaAddPage.prototype.dataURItoBlob = function (dataURI) {
        var byteString;
        if (dataURI.split(',')[0].indexOf('base64') >= 0)
            byteString = atob(dataURI.split(',')[1]);
        else
            byteString = (dataURI.split(',')[1]);
        var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
        var ia = new Uint8Array(byteString.length);
        for (var i = 0; i < byteString.length; i++) {
            ia[i] = byteString.charCodeAt(i);
        }
        return new Blob([ia], {
            type: mimeString
        });
    };
    RecetaAddPage.prototype.processTake = function (imageData) {
        this.base64Image = "data:image/jpeg;base64," + imageData;
        this.loading = this.loadingCtrl.create({ content: 'subiendo...' });
        this.loading.present();
        var self0 = this;
        var blob = this.dataURItoBlob(this.base64Image);
        var objURL = window.URL.createObjectURL(blob);
        var image = new Image();
        image.src = objURL;
        window.URL.revokeObjectURL(objURL);
        var url = window.URL.createObjectURL(blob);
        var formData = new FormData();
        formData.append('avatar', blob, 'avatar.jpg');
        var xhr = new XMLHttpRequest();
        xhr.open("post", __WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + "prescriptions/files/upload");
        xhr.setRequestHeader("Authorization", self0.token);
        xhr.onreadystatechange = function () {
            if (xhr.readyState === 4 && xhr.status === 200) {
                var uri = xhr.responseText;
                self0.loading.dismiss();
                if (uri.indexOf('error') > -1) {
                    self0.service.logError({}, 'Error al procesar la solicitud. Inténtelo más tarde.');
                }
                else {
                    console.log(uri);
                    var json = JSON.parse(uri);
                    self0.addUploadOK(json);
                }
            }
        };
        xhr.send(formData);
    };
    RecetaAddPage.prototype.b64toBlob = function (b64, onsuccess, onerror) {
        var img = new Image();
        img.onerror = onerror;
        img.onload = function onload() {
            var canvas = document.createElement('canvas');
            canvas.width = img.width;
            canvas.height = img.height;
            var ctx = canvas.getContext('2d');
            ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
            canvas.toBlob(onsuccess);
        };
        img.src = b64;
    };
    RecetaAddPage.prototype.addUploadOK = function (uri) {
        this.images.push(uri.url);
    };
    RecetaAddPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-receta-add',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/receta/add.html"*/'<ion-header class="header-green">\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>AGREGAR RECETA</ion-title>\n    <ion-buttons end>\n\n    </ion-buttons>\n  </ion-navbar>\n</ion-header>\n\n<ion-content class="new2018">\n  <div class="aviso" *ngIf="showWarning">\n    <span>Hay recetas pendientes de revisar.<br />No subas recetas duplicadas</span>\n  </div>\n  <h2>Agrega las imágenes de tu receta</h2>\n  <div class="itemlisting">\n    <ion-slides spaceBetween="20" slidesPerView="3.4">\n      <ion-slide style="background-image: url(assets/img/add.png);" (tap)="addFotoReceta()">\n      </ion-slide>\n      <ion-slide (tap)="optionsImagen(i)" *ngFor="let image of images; let i = index;" [ngStyle]="{\'background-image\': \'url(\'+(image)+\')\'}">          \n      </ion-slide>\n    </ion-slides>\n    <p>Asegurate que se vea claramente las fechas y gramos recetados por tu médico, nuestro equipo podría rechazar tu receta si no es consistente.</p>\n  </div>\n  \n  <h2>Confirma las fechas</h2>\n  <div class="itemlisting">\n    <ion-item>\n      <ion-label>Inicio</ion-label>\n      <ion-datetime displayFormat="DD/MM/YYYY" doneText="Listo" [min]="minDate" [max]="maxDate" cancelText="Cancelar" [(ngModel)]="inicio"></ion-datetime>\n    </ion-item>\n    <ion-item>\n      <ion-label>Término</ion-label>\n      <ion-datetime displayFormat="DD/MM/YYYY" doneText="Listo" [min]="minDate" [max]="maxDate" cancelText="Cancelar" [(ngModel)]="final"></ion-datetime>\n    </ion-item>\n  </div>\n  <h2>Confirma gramos diarios</h2>\n  <div class="itemlisting">\n      <ion-item>\n        <ion-label>Gramos Diarios</ion-label>\n        <ion-input type="tel" [(ngModel)]="gramos" maxlength="5" placeholder=""></ion-input>\n      </ion-item>\n  </div>\n  <h2>Médico tratante</h2>\n  <div class="itemlisting">\n    <ion-item>\n      <ion-label>Nombre</ion-label>\n      <ion-input type="text" [(ngModel)]="doctor.name"></ion-input>\n    </ion-item>\n    <ion-item>\n      <ion-label>RUT</ion-label>\n      <ion-input type="text" [(ngModel)]="doctor.card_code" formatRut></ion-input>\n    </ion-item>\n  </div>\n\n  <div class="action-button">\n    <button class="button-black" ion-button outline (tap)="save()">Enviar receta</button>\n  </div>\n\n  \n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/receta/add.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["n" /* Platform */],
            __WEBPACK_IMPORTED_MODULE_6__ionic_native_camera__["a" /* Camera */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* ActionSheetController */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */]])
    ], RecetaAddPage);
    return RecetaAddPage;
}());

//# sourceMappingURL=add.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RecetaPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_moment__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__add__ = __webpack_require__(197);
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 RecetaPage = /** @class */ (function () {
    function RecetaPage(navCtrl, modalCtrl, loadingCtrl, alertCtrl, service, doctorService) {
        this.navCtrl = navCtrl;
        this.modalCtrl = modalCtrl;
        this.loadingCtrl = loadingCtrl;
        this.alertCtrl = alertCtrl;
        this.service = service;
        this.doctorService = doctorService;
        this.shownGroup = null;
        this.prescriptions = [];
    }
    RecetaPage.prototype.ionViewDidEnter = function () {
        this.getRecetas();
    };
    RecetaPage.prototype.getRecetas = function () {
        var _this = this;
        var loading = this.loadingCtrl.create();
        loading.present();
        this.doctorService.getRecetas().subscribe(function (data) {
            _this.prescriptions = data.data;
            loading.dismiss();
        }, function (err) {
            loading.dismiss();
        });
    };
    RecetaPage.prototype.eliminarReceta = function (index) {
        var _this = this;
        var id = this.prescriptions[index].id;
        var alert = this.alertCtrl.create({
            title: '',
            message: '¿Desea eliminar esta solicitud?',
            buttons: [
                { text: 'Cancel', role: 'cancel', handler: function () { } },
                { text: 'OK', handler: function () { _this.deleteRecetaOK(id); } }
            ]
        });
        alert.present();
    };
    RecetaPage.prototype.deleteRecetaOK = function (id) {
        var _this = this;
        var loading = this.loadingCtrl.create();
        loading.present();
        this.doctorService.deleteReceta(id).subscribe(function (data) {
            loading.dismiss();
            if (data.res == "OK") {
                _this.service.showOk();
                _this.getRecetas();
            }
            else {
                _this.service.showMsg(data.msg);
            }
        }, function (err) {
            _this.service.showMsg("No fue posible eliminar la solicitud");
        });
    };
    RecetaPage.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_4_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_4_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_4_moment__["ISO_8601"]).format();
    };
    RecetaPage.prototype.doRefresh = function (refresher) {
        this.getRecetas();
        setTimeout(function () {
            refresher.complete();
        }, 0);
    };
    RecetaPage.prototype.addReceta = function () {
        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_5__add__["a" /* RecetaAddPage */]);
    };
    RecetaPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-receta',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/receta/receta.html"*/'<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>MIS RECETAS</ion-title>\n    <ion-buttons end>\n      <button ion-button icon-only (tap)="addReceta()">\n        <ion-icon name="add"></ion-icon>\n      </button>\n    </ion-buttons>\n\n  </ion-navbar>\n</ion-header>\n\n<ion-content>\n  <ion-refresher (ionRefresh)="doRefresh($event)" pullMin="80">\n    <ion-refresher-content pullingIcon="arrow-dropdown" pullingText="Desliza para actualizar" refreshingSpinner=\'dots\' refreshingText="Actualizando...">\n    </ion-refresher-content>\n  </ion-refresher>\n  <ion-card *ngIf="prescriptions.length == 0">\n    <ion-card-header class="no-items">\n      <img src="assets/img/prescription.png" />\n      <br /> No tienes recetas activas\n      <br /><br />\n      <button ion-button small outline (tap)="addReceta()">Agrega una receta</button>\n    </ion-card-header>\n  </ion-card>\n  <ion-card *ngFor="let prescription of prescriptions; let i = index">\n    <ion-grid>\n      <ion-row>\n        <ion-col col-3 text-center class="prescription-head">\n          <img src="assets/img/prescription.png" class="subicon" />\n          <h2>ID./ {{prescription.id}}</h2>\n          <h4>Enviada:<br />{{prescription.upload_at | date: \'dd/MM/yyyy\'}}</h4>\n        </ion-col>\n        <ion-col col-6>\n          <b>Resumen</b>\n          <ion-grid class="prescription-info">\n            <ion-row>\n              <ion-col col-4>\n                <h4>{{prescription.total_days_in_range | number}}</h4>\n                días               \n              </ion-col>\n              <ion-col col-4>\n                <h4>{{prescription.total_qty_in_range | number}}</h4>\n                grs/disp\n              </ion-col>\n              <ion-col col-4>\n                <h4>{{prescription.used_qty | number}}</h4>\n                grs/uso\n              </ion-col>\n            </ion-row>\n          </ion-grid>\n          <hr />\n          Desde {{prescription.start_at | date: \'dd/MM/yyyy\'}}<br />\n          Hasta {{prescription.expire_at | date: \'dd/MM/yyyy\'}}\n        </ion-col>\n        <ion-col col-3 text-center class="prescription-tools">\n          <div text-right>\n            <span class="status-declined" *ngIf="prescription.status == \'-1\'">Rechazada</span>\n            <span class="status-accepted" *ngIf="prescription.status == \'1\'">Aceptada</span>\n            <span class="status-waiting" *ngIf="prescription.status == \'0\'">En revisión</span>\n            <span class="status-expire" *ngIf="prescription.status == \'2\'">Expirada</span>\n          </div>\n          <br />\n          <a (tap)="eliminarReceta(i)" *ngIf="prescription.status == \'0\'">\n            <ion-icon name="trash"></ion-icon>\n          </a>\n        </ion-col>\n      </ion-row>\n    </ion-grid>\n  </ion-card>\n\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/receta/receta.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */]])
    ], RecetaPage);
    return RecetaPage;
}());

//# sourceMappingURL=receta.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ProductoPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_native_social_sharing__ = __webpack_require__(111);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_moment__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__modals_cart_cart__ = __webpack_require__(79);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__services_user_service__ = __webpack_require__(28);
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 ProductoPage = /** @class */ (function () {
    function ProductoPage(navCtrl, navParams, socialSharing, loadingCtrl, modalCtrl, service, alertCtrl, toastCtrl, userService, doctorService) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.socialSharing = socialSharing;
        this.loadingCtrl = loadingCtrl;
        this.modalCtrl = modalCtrl;
        this.service = service;
        this.alertCtrl = alertCtrl;
        this.toastCtrl = toastCtrl;
        this.userService = userService;
        this.doctorService = doctorService;
        this.image = '';
        this.link = '';
        this.id = '';
        this.loaded = false;
        this.product = null;
        this.loading = null;
        this.cartItems = 0;
        this.item = { quantity: null };
        this.pkg5 = null;
        this.pkg8 = null;
        this.balance = 0;
        this.limits = false;
        this.user = { id: '0' };
        var loading = this.loadingCtrl.create();
        loading.present();
        this.id = this.navParams.get("id");
        this.userService.getProfile().subscribe(function (result) {
            _this.user = result;
        });
        this.doctorService.getProduct(this.id).subscribe(function (data) {
            _this.product = data.data;
            var max_order = parseFloat(_this.product.max_order);
            var min_order = parseFloat(_this.product.min_order);
            if (min_order > 0 || max_order > 0) {
                _this.limits = true;
            }
            _this.loaded = true;
            loading.dismiss();
        });
        this.doctorService.getBalanceGrow().subscribe(function (data) {
            _this.balance = data.balance;
        });
        this.doctorService.getCart().subscribe(function (data) {
            _this.cartItems = data.short.length;
        });
    }
    ProductoPage.prototype.ngOnInit = function () {
    };
    ProductoPage.prototype.comprar = function () {
        var max_order = parseFloat(this.product.max_order);
        var min_order = parseFloat(this.product.min_order);
        if (min_order == 0) {
            min_order = 1;
        }
        if (max_order == 0) {
            max_order = 999999999;
        }
        if (this.product.type_sale == 'FLOR') {
            this.item.quantity = (((this.pkg5 ? this.pkg5 : 0) * 5) + ((this.pkg8 ? this.pkg8 : 0) * 8));
        }
        if (this.item.quantity < min_order) {
            var toast = this.toastCtrl.create({
                message: 'Cantidad debe ser ' + min_order + ' o más',
                duration: 3000,
                position: 'bottom'
            });
            toast.onDidDismiss(function () { });
            toast.present();
        }
        else if (this.item.quantity > max_order) {
            var toast = this.toastCtrl.create({
                message: 'Cantidad debe ser ' + max_order + ' o menos',
                duration: 3000,
                position: 'bottom'
            });
            toast.onDidDismiss(function () { });
            toast.present();
        }
        else {
            var add = this.doctorService.addCartItem({
                id: this.product.id,
                stock: this.stock(),
                qty: this.item.quantity,
                price: parseFloat(this.product.price),
                total: ((this.item.quantity) * parseFloat(this.product.price))
            });
            if (add) {
                this.service.showOk("Producto agregado con éxito");
                this.item.quantity = null;
                this.cartItems = this.doctorService.cartFull.items.length;
                this.pkg5 = null;
                this.pkg8 = null;
                this.doctorService.syncCart();
            }
            else {
                var toast = this.toastCtrl.create({
                    message: 'La cantidad de tu carro supera el stock (Max: ' + this.stock() + ')',
                    duration: 3000,
                    position: 'bottom'
                });
                toast.onDidDismiss(function () { });
                toast.present();
            }
        }
    };
    ProductoPage.prototype.ionViewDidEnter = function () {
    };
    ProductoPage.prototype.stock = function () {
        var s = parseInt(this.product.stock_sale) || 0;
        return s;
    };
    ProductoPage.prototype.add = function () {
        this.item.quantity++;
    };
    ProductoPage.prototype.rem = function () {
        this.item.quantity--;
        if (this.item.quantity < 0) {
            this.item.quantity = 0;
        }
    };
    ProductoPage.prototype.cart = function () {
        var _this = this;
        var cartModal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_6__modals_cart_cart__["a" /* ModalCart */]);
        cartModal.onDidDismiss(function (data) {
            if (data) {
                _this.cartItems = data.items.length;
                _this.doctorService.cartFull = data;
                _this.doctorService.syncCart();
                if (data.hasOwnProperty("finish") && data.finish == 1) {
                    _this.service.showOk(data.msg);
                }
            }
        });
        cartModal.present();
    };
    ProductoPage.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_3_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_3_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_3_moment__["ISO_8601"]).format();
    };
    ProductoPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-producto',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/producto/producto.html"*/'<ion-header>\n    <ion-navbar>\n      <button ion-button menuToggle>\n        <ion-icon name="menu"></ion-icon>\n      </button>\n      <ion-title>PRODUCTO</ion-title>\n      <ion-buttons end *ngIf="user?.id!=\'0\'">\n        <div class="glovo">{{cartItems}}</div>\n        <button class="search-top" ion-button icon-only (tap)="cart()">\n          <ion-icon ios="ios-cart-outline" md="ios-cart-outline"></ion-icon>\n        </button>\n      </ion-buttons>\n    </ion-navbar>\n  </ion-header>\n<ion-content>\n  <div *ngIf="loaded">\n    <div class="image"> <!--  [style.background-image]="\'url(\' + product.image + \')\'" style="background-size: cover;" -->\n      <img [src]="product.image" style="width: 100%; height: auto; max-height: 75vh;">\n      <div class="titulo">\n        <p>{{product.name}}</p>\n        <!--<span class="subtitulo"> {{ dateformat(news.date) | date}}</span>-->\n      </div>\n    </div>\n    \n    <ul class="icon-set" *ngIf="product.attribs.length > 0">\n      <li *ngFor="let atrib of product.attribs; let i = index;">\n        <div class="icon-set-title">{{atrib.name}}</div>\n        <div class="icon-set-value" [ngStyle]="{\'border\':\'1.5px solid #\'+atrib.color}">{{atrib.attribute_value}}%</div>\n      </li>\n    </ul>\n    <div class="content-html" [innerHtml]="product.description">\n    </div>\n\n    <div *ngIf="product.type_sale == \'FLOR\'">\n      <div class="aviso">\n        <span>tienes</span> <h2>{{balance | number}} grs</h2> <span>disponibles</span> <img src="assets/img/icon_marijuana.png" />\n      </div>\n      <div padding>\n        <ion-item *ngIf="stock() > 0">\n          <ion-label stacked>Ingresa cantidad de frascos que deseas:</ion-label>\n          <ion-input type="number" [(ngModel)]="pkg5" placeholder="0"></ion-input>\n        </ion-item>\n        <ion-item *ngIf="stock() > 0" hidden>\n          <ion-label stacked>Paquetes de 8 gramos:</ion-label>\n          <ion-input type="number" [(ngModel)]="pkg8" placeholder="0"></ion-input>\n        </ion-item>\n        <p *ngIf="stock() == 0">\n          Lamentablemente no tenemos disponibilidad de esta flor. Intenta revisarla proximamente\n        </p>\n        <p *ngIf="stock() > 0" padding>\n          En cada frasco vienen 5 gramos\n        </p>\n        <p *ngIf="stock() > 0 && limits" padding>\n          <span [hidden]="product.min_order == 0">Mínimo de {{ product.min_order | number: \'1.0-0\'}} grs.</span>\n          <span [hidden]="product.max_order == 0">Máximo de {{ product.max_order | number: \'1.0-0\'}} grs</span>\n        </p>\n        <!--\n        <p *ngIf="stock() > 0 && !limits" padding>\n          Este producto no tiene venta restringida, puedes adquirir la cantidad que necesites.\n        </p>\n        -->\n        \n        <div class="itemlisting product-price">\n          un abono de <h4>$ {{(product.price * 5) | number}}</h4> por cada frasco.\n        </div>\n      </div>\n    </div>\n    <div *ngIf="product.type_sale != \'FLOR\'">\n      <ion-grid class="prod_container" *ngIf="stock() > 0 && user?.id!=\'0\'">\n      <ion-row>\n        <ion-col class="prod_button prod_button_rem">\n          <button ion-button color="danger" (tap)="rem()">-</button>\n        </ion-col>\n        <ion-col class="prod_quantity">\n          <ion-input type="number" placeholder="0" clearInput [(ngModel)]="item.quantity"></ion-input>\n        </ion-col>\n        <ion-col class="prod_button prod_button_add">\n          <button ion-button color="bck-light-blue" (tap)="add()">+</button>\n        </ion-col>\n      </ion-row>\n      </ion-grid>\n\n      <p *ngIf="stock() == 0 && user?.id!=\'0\'" padding>\n        Lamentablemente no tenemos disponibilidad. Intenta revisar proximamente\n      </p>\n      <p *ngIf="stock() > 0 && limits && user?.id!=\'0\'" padding>\n        <!--<span [hidden]="product.min_order == 0">Este producto tiene venta restringida,</span>-->\n        <span [hidden]="product.min_order == 0">Mínimo de {{ product.min_order | number: \'1.0-0\'}} unids.</span>\n        <span [hidden]="product.max_order == 0">Máximo de {{ product.max_order | number: \'1.0-0\'}} unids.</span>\n      </p>\n      <!--\n      <p *ngIf="stock() > 0 && !limits && user?.id!=\'0\'" padding>\n        Este producto no tiene venta restringida, puedes adquirir la cantidad que necesites.\n      </p>\n      -->\n\n      <div class="itemlisting product-price">\n        <h4>$ {{product.price | number}}</h4> por cada uno\n      </div>\n    </div>\n    <div class="formContainer">\n      <div class="buttonWrapper" *ngIf="stock() > 0 && user?.id!=\'0\'">\n        <button (tap)="comprar()" class="buttonPinkOrange" ion-button round>Agregar al pedido</button>\n      </div>\n      <div *ngIf="user?.id==\'0\'">\n        Sólo usuarios registrados pueden agregar este producto a su pedido\n      </div>\n      <br /><br />\n    </div>\n  </div>\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/producto/producto.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_native_social_sharing__["a" /* SocialSharing */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_5__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["q" /* ToastController */],
            __WEBPACK_IMPORTED_MODULE_7__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_4__services_doctor_service__["a" /* DoctorService */]])
    ], ProductoPage);
    return ProductoPage;
}());

//# sourceMappingURL=producto.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DoctorService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common_http__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__base_service__ = __webpack_require__(96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_mergeMap__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_mergeMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_operator_mergeMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_fromPromise__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_observable_fromPromise__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rxjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rxjs__);
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
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 DoctorService = /** @class */ (function (_super) {
    __extends(DoctorService, _super);
    function DoctorService(http, storage) {
        var _this = _super.call(this, http, storage) || this;
        _this.http = http;
        _this.storage = storage;
        _this.finishCompra = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        return _this;
    }
    DoctorService.prototype.getToken = function () {
        return __WEBPACK_IMPORTED_MODULE_6_rxjs__["Observable"].fromPromise(this.storage.get('token'));
    };
    DoctorService.prototype.addCartItem = function (o) {
        var found = 0;
        var error = 0;
        for (var x = 0; x < this.cartFull.items.length; x++) {
            if (this.cartFull.items[x].id == o.id) {
                var newsum = parseFloat(this.cartFull.items[x].qty) + parseFloat(o.qty);
                if (o.stock < newsum) {
                    return false;
                }
                else {
                    this.cartFull.items[x].qty = newsum;
                    this.cartFull.items[x].total = newsum * this.cartFull.items[x].price;
                    found = 1;
                }
            }
        }
        if (found == 0) {
            if (o.stock < o.qty) {
                return false;
            }
            else {
                this.cartFull.items.push(o);
                return true;
            }
        }
        else {
            return true;
        }
    };
    DoctorService.prototype.syncCart = function () {
        var c = this.post('customers/cart', {
            cart: this.cartFull.items
        }).share();
        c.subscribe(function (data) { });
        return c;
    };
    DoctorService.prototype.getCart = function () {
        var _this = this;
        var c = this.get('customers/cart').share();
        c.subscribe(function (data) {
            _this.cartFull = data.data;
        });
        return c;
    };
    DoctorService.prototype.search = function (search) {
        return this.post('search', { search: search });
    };
    DoctorService.prototype.getTerms = function () {
        return this.get('terms');
    };
    DoctorService.prototype.acceptTerms = function () {
        return this.get('terms/ok');
    };
    /* Another */
    DoctorService.prototype.getRecetas = function () {
        return this.get('prescriptions');
    };
    DoctorService.prototype.deleteReceta = function (id) {
        return this.post('prescriptions/delete', { id: id });
    };
    DoctorService.prototype.savePrescription = function (data) {
        return this.post('prescriptions/save', data);
    };
    DoctorService.prototype.getCards = function () {
        return this.get('customers/cards');
    };
    DoctorService.prototype.getBalance = function () {
        return this.get('customers/balance');
    };
    DoctorService.prototype.deleteTarjeta = function (id) {
        return this.post('customers/cards/delete', { id: id });
    };
    DoctorService.prototype.getBalanceGrow = function () {
        return this.get('prescriptions/balance');
    };
    DoctorService.prototype.getHistory = function () {
        return this.get('customers/history');
    };
    DoctorService.prototype.featured = function () {
        return this.get('products/featured');
    };
    DoctorService.prototype.getCategory = function (id) {
        if (id) {
            return this.get('category/' + id);
        }
        else {
            return this.get('products/category');
        }
    };
    DoctorService.prototype.getProduct = function (id) {
        return this.get('products/detail/' + id);
    };
    DoctorService.prototype.getAddresses = function () {
        return this.get('customers/addresses');
    };
    DoctorService.prototype.putPedido = function (order) {
        return this.post('orders/save', order);
    };
    DoctorService.prototype.shippingPrice = function (idCity) {
        return this.get('orders/shipping?city=' + idCity);
    };
    DoctorService.prototype.getOrders = function (id) {
        if (id) {
            return this.get('customers/orders/' + id);
        }
        else {
            return this.get('customers/orders');
        }
    };
    DoctorService.prototype.deleteOrder = function (id) {
        return this.post('customers/orders/delete', { id: id });
    };
    DoctorService.prototype.getTbkOrder = function (id) {
        return this.get('tbk/' + id);
    };
    DoctorService.prototype.address = function () {
        return this.get('address');
    };
    DoctorService.prototype.masterdata = function () {
        return this.get('masterdata');
    };
    DoctorService.prototype.trucks = function () {
        return this.get('vehicle/truck');
    };
    DoctorService.prototype.trailers = function () {
        return this.get('vehicle/trailer');
    };
    DoctorService.prototype.getTruck = function () {
        return this.get('vehicle/truck');
    };
    DoctorService.prototype.getTrailer = function () {
        return this.get('vehicle/trailer');
    };
    DoctorService.prototype.getOfferForReq = function (param) {
        return this.get('requeriments/offers/' + param);
    };
    DoctorService.prototype.getDrivers = function () {
        return this.get('drivers');
    };
    DoctorService.prototype.getDriverService = function () {
        return this.get('services/open');
    };
    DoctorService.prototype.getDriverServiceInProgress = function () {
        return this.get('services/onservice');
    };
    DoctorService.prototype.getTrucking = function (param) {
        return this.get('services/tracking/' + param);
    };
    DoctorService.prototype.getRating = function (param) {
        return this.get('users/raiting/' + param);
    };
    DoctorService.prototype.getService = function () {
        return this.get('services');
    };
    DoctorService.prototype.getRates = function () {
        return this.get('services/rates');
    };
    DoctorService.prototype.getRatesId = function (param) {
        return this.get('services/rates/' + param);
    };
    DoctorService.prototype.getWaitings = function (lat, lng) {
        return this.get('deals/waitings?lat=' + lat + '&lng=' + lng);
    };
    DoctorService.prototype.getOfferConditions = function () {
        return this.get('offers/conditions');
    };
    //POST
    DoctorService.prototype.addAdress = function (params) {
        return this.post('address', params);
    };
    DoctorService.prototype.saveDisponibilidad = function (params) {
        return this.post('users/availability', params);
    };
    DoctorService.prototype.addRequeriment = function (params) {
        return this.post('requirements/add', params);
    };
    DoctorService.prototype.addVehicle = function (params) {
        return this.post('vehicle/add', params);
    };
    DoctorService.prototype.editVehicle = function (params) {
        return this.post('vehicle/update', params);
    };
    DoctorService.prototype.evaluateOffer = function (params) {
        return this.post('offers/evaluate', params);
    };
    DoctorService.prototype.setDriverStatus = function (params) {
        return this.post('drivers/set', params);
    };
    DoctorService.prototype.sendPositionTraking = function (params) {
        return this.post('services/tracking', params);
    };
    DoctorService.prototype.setStartService = function (params) {
        return this.post('services/start', params);
    };
    DoctorService.prototype.setStopService = function (params) {
        return this.post('services/finish', params);
    };
    DoctorService.prototype.matchOferta = function (params) {
        return this.post('requirements/match', params);
    };
    DoctorService.prototype.addOffer = function (params) {
        return this.post('offers/add', params);
    };
    DoctorService.prototype.updateTruchAndTrailer = function (params) {
        return this.post('drivers/update', params);
    };
    DoctorService.prototype.sendRate = function (params) {
        return this.post('users/rate', params);
    };
    DoctorService.prototype.declineOffer = function (params) {
        return this.post('offers/decline', params);
    };
    DoctorService.prototype.sendLatLong = function (params) {
        return this.post('address/latlng', params);
    };
    //Delete
    DoctorService.prototype.deleteRequeriment = function (params) {
        return this.post('requirements/delete', params);
    };
    DoctorService.prototype.deleteOffer = function (params) {
        return this.post('offers/delete', params);
    };
    DoctorService.prototype.serviceQuery = function (id) {
        return this.get("services/driverdata/" + id);
    };
    DoctorService.prototype.serviceUpdateDriverData = function (id, distance, actual, timer, lat, lng) {
        return this.post('services/driverdata/' + id, {
            distance: distance,
            actual: actual,
            timer: timer,
            lat: lat,
            lng: lng
        });
    };
    DoctorService.prototype.setServiceGuia = function (service_id, guia) {
        return this.post('services/setdocument/' + service_id, { document: guia });
    };
    DoctorService.prototype.getAlertaTransportista = function () {
        return this.get('requirements/new_requirement_alert');
    };
    DoctorService.prototype.getAlertaGenerador = function () {
        return this.get('requirements/new_offer_alert');
    };
    DoctorService = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1__angular_common_http__["a" /* HttpClient */], __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */]])
    ], DoctorService);
    return DoctorService;
}(__WEBPACK_IMPORTED_MODULE_3__base_service__["a" /* BaseService */]));

//# sourceMappingURL=doctor.service.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalCheckout; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_auth_service__ = __webpack_require__(42);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_observable_forkJoin__ = __webpack_require__(89);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_observable_forkJoin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_forkJoin__);
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 ModalCheckout = /** @class */ (function () {
    function ModalCheckout(viewCtrl, alertCtrl, loadingCtrl, params, service, auth, doctorService, toastCtrl, navCtrl, ionicApp, renderer) {
        var _this = this;
        this.viewCtrl = viewCtrl;
        this.alertCtrl = alertCtrl;
        this.loadingCtrl = loadingCtrl;
        this.params = params;
        this.service = service;
        this.auth = auth;
        this.doctorService = doctorService;
        this.toastCtrl = toastCtrl;
        this.navCtrl = navCtrl;
        this.ionicApp = ionicApp;
        this.renderer = renderer;
        this.cartFull = null;
        this.addresses = [];
        this.cities = [];
        this.states = [];
        this.loading = null;
        this.order = {
            to: '',
            street: '',
            additional: '',
            city: '',
            state: '',
            ship_price: 0,
            items: [],
            comment: ''
        };
        this.enablePay = false;
        var load = this.loadingCtrl.create({ content: 'actualizando...' });
        load.present();
        var loadCart = this.doctorService.getCart();
        var loadAddress = this.doctorService.getAddresses();
        var loadStates = this.auth.getStates();
        Object(__WEBPACK_IMPORTED_MODULE_5_rxjs_observable_forkJoin__["forkJoin"])(loadCart, loadAddress, loadStates).subscribe(function (data) {
            _this.cartFull = data[0].data;
            _this.addresses = data[1].data;
            _this.states = data[2].data;
            load.dismiss();
            if (_this.addresses.length > 0) {
                _this.order.to = _this.addresses[0].id;
            }
            console.log(_this.addresses);
        });
    }
    ModalCheckout.prototype.closeCart = function () {
        var data = this.cartFull;
        this.viewCtrl.dismiss(data);
    };
    ModalCheckout.prototype.calculateShipping = function (evt) {
        var _this = this;
        var city = '';
        if (this.order.to == 'N') {
            city = this.order.city;
        }
        else {
            for (var x = 0; x < this.addresses.length; x++) {
                if (this.addresses[x].id == this.order.to) {
                    city = this.addresses[x].city;
                }
            }
        }
        if (city != '') {
            var load_1 = this.loadingCtrl.create({ content: 'calculando despacho...' });
            load_1.present();
            this.doctorService.shippingPrice(city).subscribe(function (data) {
                load_1.dismiss();
                _this.order.ship_price = data.price;
                if (data.res == "OK") {
                    _this.enablePay = true;
                }
                else {
                    _this.enablePay = false;
                }
            });
        }
        else {
            this.enablePay = false;
            this.order.ship_price = 0;
        }
    };
    ModalCheckout.prototype.cartTotal = function () {
        var total = 0;
        if (this.cartFull != null) {
            for (var x = 0; x < this.cartFull.items.length; x++) {
                total += parseFloat(this.cartFull.items[x].total);
            }
        }
        total += parseFloat(this.order.ship_price);
        return total;
    };
    ModalCheckout.prototype.itemsTotal = function () {
        var total = 0;
        if (this.cartFull != null) {
            for (var x = 0; x < this.cartFull.items.length; x++) {
                total += parseFloat(this.cartFull.items[x].total);
            }
        }
        return total;
    };
    ModalCheckout.prototype.pagar = function () {
        var _this = this;
        if (!this.enablePay) {
            var toast = this.toastCtrl.create({
                message: 'No podemos despachar a la comuna indicada tu pedido.',
                duration: 3000,
                position: 'bottom'
            });
            toast.present();
        }
        else {
            if (this.order.to != 'N') {
                for (var x = 0; x < this.addresses.length; x++) {
                    if (this.addresses[x].id == this.order.to) {
                        this.order.street = this.addresses[x].street;
                        this.order.additional = this.addresses[x].additional;
                        this.order.city = this.addresses[x].city;
                        this.order.state = this.addresses[x].state;
                        break;
                    }
                }
            }
            if (this.order.street == '' || this.order.city == '') {
                this.service.logError({}, "Verifica la dirección y comuna de despacho para realizar el pago del pedido");
            }
            else {
                this.order.items = this.cartFull.items;
                var prepay_1 = this.loadingCtrl.create({ content: 'Validando pedido...' });
                prepay_1.present();
                this.doctorService.putPedido(this.order).subscribe(function (data) {
                    if (data.res == "OK") {
                        prepay_1.dismiss();
                        var cleanCart = {
                            items: [],
                            total: 0,
                            finish: 1,
                            msg: data.msg
                        };
                        _this.navCtrl.popToRoot();
                        _this.doctorService.finishCompra.emit(cleanCart);
                        /*
                        let activeModal=this.ionicApp._modalPortal.getActive();
                        activeModal.dismiss(cleanCart).then((a)=> {
                          console.log(a);
                          this.service.showOk(data.msg);
                          this.viewCtrl.dismiss(cleanCart);
                        });
                        */
                    }
                    else {
                        prepay_1.dismiss();
                        _this.service.logError({}, data.msg);
                    }
                });
            }
        }
    };
    ModalCheckout.prototype.ngOnDestroy = function () {
    };
    ModalCheckout.prototype.changeDirection = function (evt) {
        console.log('changeDirection', evt);
        if (this.order.to == 'N' && this.order.city == '') {
            this.enablePay = false;
            this.order.ship_price = 0;
        }
        else {
            //this.order.to = evt;
            this.calculateShipping();
        }
    };
    ModalCheckout.prototype.changeCities = function (newObj) {
        var _this = this;
        this.order.city = "";
        this.loading = this.loadingCtrl.create();
        this.loading.present();
        this.auth.getCities(newObj).subscribe(function (data) {
            _this.cities = data.data;
            _this.loading.dismiss();
        }, function (err) {
            _this.loading.dismiss();
            _this.service.logError({});
        });
    };
    ModalCheckout = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-checkout',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/checkout/checkout.html"*/'<ion-header>\n  <ion-navbar>\n	<ion-buttons start>\n	</ion-buttons>\n    <ion-title>ENVÍO Y ABONO</ion-title>\n    <ion-buttons end>\n    </ion-buttons>\n  </ion-navbar>\n</ion-header>\n\n<ion-content class="new2018">\n\n  <h2>DIRECCIÓN DE ENVÍO</h2>\n  <div class="itemlisting">\n    <ion-list radio-group [(ngModel)]="order.to" (ionChange)="changeDirection($event)">\n      <!-- <ion-list-header>\n        Auto Manufacturers\n      </ion-list-header> -->\n      <ion-item *ngFor="let address of addresses; let i = index;">\n        <ion-label class="fullname text-wrap">{{address.street}}<br />{{address.city_name}}</ion-label>\n        <ion-radio value="{{address.id}}"></ion-radio>\n      </ion-item>\n      <ion-item>\n        <ion-label class="fullname">Nueva dirección</ion-label>\n        <ion-radio value="N"></ion-radio>\n      </ion-item>\n    </ion-list>\n  </div>\n  <h2 *ngIf="order.to == \'N\'">NUEVA DIRECCIÓN</h2>\n  <div class="itemlisting" *ngIf="order.to == \'N\'">\n      <ion-list>\n        <ion-item>\n          <ion-input type="text" [(ngModel)]="order.street" placeholder="Calle y Número"></ion-input>\n        </ion-item>\n        <ion-item>\n          <ion-input type="text" [(ngModel)]="order.additional" placeholder="Departamento, Piso, Torre"></ion-input>\n        </ion-item>\n        <ion-item>\n          <ion-label>Región</ion-label>\n          <ion-select [(ngModel)]="order.state" okText="OK" cancelText="Cancelar" (ngModelChange)="changeCities($event)">\n            <ion-option *ngFor="let state of states" [value]="state.id">{{state.name}}</ion-option>\n          </ion-select>\n        </ion-item>\n        <ion-item>\n          <ion-label>Ciudad/Comuna</ion-label>\n          <ion-select [(ngModel)]="order.city" okText="OK" cancelText="Cancelar" (ngModelChange)="calculateShipping($event)">\n            <ion-option *ngFor="let city of cities" [value]="city.id">{{city.name}}</ion-option>\n          </ion-select>\n        </ion-item>\n      </ion-list>\n  </div>\n\n  <h2>COMENTARIOS</h2>\n  <div class="formContainer itemlisting">\n    <ion-item>\n      <ion-textarea [(ngModel)]="order.comment" placeholder="Escribe aqui algun mensaje adicional para el motoboy / repartidor"></ion-textarea>\n    </ion-item>\n  </div>\n\n\n</ion-content>\n<ion-footer>\n  <ion-navbar>\n    <ion-title>\n      <h4>\n        Pedido: $ {{itemsTotal() | number}}<br />\n        Despacho: $ {{order.ship_price | number}}\n      </h4>\n      <h3>A abonar: $ {{cartTotal() | number}}</h3>\n    </ion-title>\n    <ion-buttons end>\n      <button class="make-buy" ion-button round outline (tap)="pagar()">\n        Abonar ahora\n      </button>\n    </ion-buttons>\n  </ion-navbar>\n</ion-footer>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/checkout/checkout.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_4__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_3__services_auth_service__["a" /* AuthService */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["q" /* ToastController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* IonicApp */],
            __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"]])
    ], ModalCheckout);
    return ModalCheckout;
}());

//# sourceMappingURL=checkout.js.map

/***/ }),

/***/ 210:
/***/ (function(module, exports) {

function webpackEmptyAsyncContext(req) {
	// Here Promise.resolve().then() is used instead of new Promise() to prevent
	// uncatched exception popping up in devtools
	return Promise.resolve().then(function() {
		throw new Error("Cannot find module '" + req + "'.");
	});
}
webpackEmptyAsyncContext.keys = function() { return []; };
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
module.exports = webpackEmptyAsyncContext;
webpackEmptyAsyncContext.id = 210;

/***/ }),

/***/ 253:
/***/ (function(module, exports) {

function webpackEmptyAsyncContext(req) {
	// Here Promise.resolve().then() is used instead of new Promise() to prevent
	// uncatched exception popping up in devtools
	return Promise.resolve().then(function() {
		throw new Error("Cannot find module '" + req + "'.");
	});
}
webpackEmptyAsyncContext.keys = function() { return []; };
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
module.exports = webpackEmptyAsyncContext;
webpackEmptyAsyncContext.id = 253;

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return environment; });
var environment = {
    "production": true,
    "apiUrl": "https://api.yodalife.cl/",
    //"apiUrl":"http://greenapp.test/",
    "version": "1.8.2",
    "staticUrl": ""
};
//# sourceMappingURL=environment.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UserService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common_http__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_device__ = __webpack_require__(192);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__base_service__ = __webpack_require__(96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__environments_environment__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_mergeMap__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_mergeMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_add_operator_mergeMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_observable_fromPromise__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rxjs_add_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rxjs_add_observable_fromPromise__);
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
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 UserService = /** @class */ (function (_super) {
    __extends(UserService, _super);
    function UserService(http, storage, device) {
        var _this = _super.call(this, http, storage) || this;
        _this.http = http;
        _this.storage = storage;
        _this.device = device;
        _this.changeAvatar = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        _this.push = '';
        return _this;
    }
    UserService.prototype.setPush = function (token) {
        this.push = token;
    };
    UserService.prototype.sendPushToServer = function () {
        var _this = this;
        this.getProfile().subscribe(function (result) {
            _this.post('users/device', {
                id: result.id,
                token: _this.push,
                os: _this.device.platform,
                osversion: _this.device.version,
                appversion: __WEBPACK_IMPORTED_MODULE_6__environments_environment__["a" /* environment */].version
            }).subscribe(function (ok) {
                console.log('push ok', ok);
            }, function (err) {
                console.log('push err', err);
            });
        });
    };
    UserService.prototype.getProfile = function () {
        return __WEBPACK_IMPORTED_MODULE_5_rxjs_Observable__["Observable"].fromPromise(this.storage.get('MP-Profile'));
    };
    UserService.prototype.getHelpdesk = function () {
        return this.get('helpdesk');
    };
    UserService.prototype.sendHelpdesk = function (message) {
        return this.post('users/help', { message: message });
    };
    UserService.prototype.getId = function (id) {
        return this.get('users/profile/' + id);
    };
    UserService.prototype.update = function (obj) {
        return this.post('users/profile/update', obj);
    };
    UserService.prototype.region = function () {
        return this.get('region');
    };
    UserService.prototype.distrito = function (region) {
        return this.get('region/' + region + '/district');
    };
    UserService.prototype.changePassword = function (currentPass, newPass) {
        return this.post('users/password', { new: newPass, old: currentPass });
    };
    UserService = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1__angular_common_http__["a" /* HttpClient */], __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */], __WEBPACK_IMPORTED_MODULE_3__ionic_native_device__["a" /* Device */]])
    ], UserService);
    return UserService;
}(__WEBPACK_IMPORTED_MODULE_4__base_service__["a" /* BaseService */]));

//# sourceMappingURL=user.service.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalOK; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
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 ModalOK = /** @class */ (function () {
    function ModalOK(viewCtrl, params, renderer) {
        this.viewCtrl = viewCtrl;
        this.params = params;
        this.renderer = renderer;
        this.msg = params.get('msg');
        //this.renderer.addClass(document.body.querySelector("ng-component.app-root"), 'blur');
    }
    ModalOK.prototype.close = function () {
        this.viewCtrl.dismiss();
    };
    ModalOK.prototype.ngOnDestroy = function () {
        //this.renderer.removeClass(document.body.querySelector("ng-component.app-root"), 'blur');
    };
    ModalOK = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-modalOK',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/ok/ok.html"*/'<ion-content>\n	<div class="full"></div>\n	<div class="msg">\n	<img src="assets/img/checked.png" style="max-width: 25%; padding-bottom: 30px; display: block; margin: auto;">\n	{{msg}}\n	</div>\n	<button class="buttonPinkOrange small" ion-button round  (tap)="close()">Aceptar</button>\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/ok/ok.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"]])
    ], ModalOK);
    return ModalOK;
}());

//# sourceMappingURL=ok.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalERR; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
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 ModalERR = /** @class */ (function () {
    function ModalERR(viewCtrl, params, renderer) {
        this.viewCtrl = viewCtrl;
        this.params = params;
        this.renderer = renderer;
        this.msg = params.get('msg');
        //this.renderer.addClass(document.body.querySelector("ng-component.app-root"), 'blur');
    }
    ModalERR.prototype.close = function () {
        this.viewCtrl.dismiss();
    };
    ModalERR.prototype.ngOnDestroy = function () {
        //this.renderer.removeClass(document.body.querySelector("ng-component.app-root"), 'blur');
    };
    ModalERR = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-modalERR',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/err/err.html"*/'<ion-content>\n	<div class="full"></div>\n	<div class="msg">\n	<img src="assets/img/unchecked.png" style="max-width: 25%; padding-bottom: 30px; display: block; margin: auto;">\n	{{msg}}\n	</div>\n	<button class="buttonPinkOrange small" ion-button round  (tap)="close()">Aceptar</button>\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/err/err.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_0__angular_core__["Renderer2"]])
    ], ModalERR);
    return ModalERR;
}());

//# sourceMappingURL=err.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AuthService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common_http__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_device__ = __webpack_require__(192);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__environments_environment__ = __webpack_require__(27);
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 AuthService = /** @class */ (function () {
    function AuthService(http, storage, device) {
        this.http = http;
        this.storage = storage;
        this.device = device;
        this.loginOk = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.push = '';
    }
    /** login */
    AuthService.prototype.login = function (params) {
        var _this = this;
        var req = this.http.post(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'users/login', params).share();
        req.subscribe(function (data) {
            _this.loginOk.emit(data);
        });
        return req;
    };
    AuthService.prototype.version = function (v) {
        var req = this.http.post(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'versionValidate', { version: v });
        return req;
    };
    AuthService.prototype.getTerms = function () {
        var req = this.http.get(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'terms/url');
        return req;
    };
    /** signup */
    AuthService.prototype.register = function (params) {
        var req = this.http.post(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'users/register', params);
        return req;
    };
    AuthService.prototype.recoverPassword = function (rut) {
        var req = this.http.post(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'users/recover', { rut: rut });
        return req;
    };
    AuthService.prototype.evaluate = function (params) {
        var req = this.http.post(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'users/evaluate', params);
        return req;
    };
    AuthService.prototype.setToken = function (token) {
        this.storage.set('token', token);
    };
    AuthService.prototype.getStates = function () {
        var req = this.http.get(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'states');
        return req;
    };
    AuthService.prototype.getMaster = function (type) {
        var req = this.http.get(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'masterdata/' + type);
        return req;
    };
    AuthService.prototype.getCities = function (id) {
        var req = this.http.get(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'cities/' + id);
        return req;
    };
    AuthService.prototype.setPush = function (token) {
        this.push = token;
    };
    AuthService.prototype.sendPushToServer = function (id) {
        this.http.post(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'users/device', {
            id: id,
            token: this.push,
            os: this.device.platform,
            osversion: this.device.version,
            appversion: __WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].version
        }).subscribe(function (ok) {
            console.log('push ok', ok);
        }, function (err) {
            console.log('push err', err);
        });
    };
    /** logout */
    AuthService.prototype.logout = function () { };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"])(),
        __metadata("design:type", Object)
    ], AuthService.prototype, "loginOk", void 0);
    AuthService = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1__angular_common_http__["a" /* HttpClient */], __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */], __WEBPACK_IMPORTED_MODULE_3__ionic_native_device__["a" /* Device */]])
    ], AuthService);
    return AuthService;
}());

//# sourceMappingURL=auth.service.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SplitpaneProvider; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
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);
};



/*
  Generated class for the SplitpaneProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
var SplitpaneProvider = /** @class */ (function () {
    function SplitpaneProvider(platform, storage) {
        this.platform = platform;
        this.storage = storage;
        this.splitPaneState = false;
    }
    SplitpaneProvider.prototype.getSplitPane = function () {
        if (localStorage.getItem('token')) {
            if (this.platform.width() > 850) {
                this.splitPaneState = true;
            }
            else {
                this.splitPaneState = false;
            }
        }
        else {
            this.splitPaneState = false;
        }
        return this.splitPaneState;
    };
    SplitpaneProvider = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["n" /* Platform */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */]])
    ], SplitpaneProvider);
    return SplitpaneProvider;
}());

//# sourceMappingURL=splitpane.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Profile; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_user_service__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_auth_service__ = __webpack_require__(42);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__popovers_profile_media_profile_media__ = __webpack_require__(531);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ionic_native_date_picker__ = __webpack_require__(525);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__change_password_change_password__ = __webpack_require__(532);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__angular_common__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__home_home__ = __webpack_require__(109);
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 Profile = /** @class */ (function () {
    function Profile(navCtrl, storage, navParams, popoverCtrl, loadingCtrl, service, userService, authService, datePicker, modalCtrl, datePipe) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.storage = storage;
        this.navParams = navParams;
        this.popoverCtrl = popoverCtrl;
        this.loadingCtrl = loadingCtrl;
        this.service = service;
        this.userService = userService;
        this.authService = authService;
        this.datePicker = datePicker;
        this.modalCtrl = modalCtrl;
        this.datePipe = datePipe;
        this.isBlurred = false;
        this.loaded = false;
        this.states = [];
        this.cities = [];
        this.appInvite = true;
        this.appInvite = this.service.appInvite;
        this.storage.get("MP-Profile").then(function (val) {
            _this.userService.getId(val.id).subscribe(function (ok) {
                _this.me = ok.data;
                _this.loaded = true;
                if (_this.me.avatar == null && _this.me.avatar == "") {
                    _this.me.avatar = "assets/img/default/avatar.png";
                }
                _this.changeAvatar(_this.me.avatar);
            }, function (err) {
                _this.service.logError(null, "No fue posible recuperar tu perfil. Verifica la disponibilidad de internet");
            });
        });
    }
    Profile.prototype.save = function () {
        var _this = this;
        var loading = this.loadingCtrl.create({
            content: 'guardando...'
        });
        loading.present();
        this.storage.get('MP-Profile').then(function (val) {
            var updateOperation = _this.userService.update({
                first_name: _this.me.first_name,
                last_name: _this.me.last_name,
                email: _this.me.email
            });
            updateOperation.subscribe(function (ok) {
                loading.dismiss();
                if (ok.res == 'OK') {
                    _this.storage.set("MP-Profile", ok.data);
                    _this.service.showOk();
                }
                else {
                    _this.service.logError(null, "No fue posible guardar sus datos, intente nuevamente");
                }
            }, function (error) {
                loading.dismiss();
                _this.service.logError(null, "No fue posible guardar sus datos, error en el servidor");
                console.log(error);
            });
        });
    };
    Profile.prototype.removeBlur = function () {
        this.isBlurred = false;
    };
    Profile.prototype.presentMediaOptionsPopover = function (event) {
        var _this = this;
        var popover = this.popoverCtrl.create(__WEBPACK_IMPORTED_MODULE_6__popovers_profile_media_profile_media__["a" /* ProfileMedia */]);
        popover.present({
            ev: event
        });
        popover.onDidDismiss(function (change) {
            if (change) {
                _this.storage.get("MP-Profile").then(function (val) {
                    _this.me = val;
                    _this.loaded = true;
                    console.log('avatar is ', _this.me.avatar);
                    if (_this.me.avatar != null && _this.me.avatar != "") {
                        _this.me.avatar = _this.me.avatar.replace('/public/', '');
                    }
                    _this.changeAvatar(_this.me.avatar);
                });
            }
            //this.removeBlur();
        });
        //this.isBlurred = true;
    };
    Profile.prototype.changeAvatar = function (avatar) {
        this.userService.changeAvatar.emit(avatar);
    };
    /** Birthday Date Picker */
    Profile.prototype.openDatepicker = function () {
        var _this = this;
        this.datePicker.show({
            date: new Date(),
            mode: 'date',
            androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK
        }).then(function (date) {
            var d = _this.datePipe.transform(date, 'dd/MM/yyyy');
            console.log('Got date: ', d);
            _this.me.birthday = d;
        }, function (err) {
            console.log('Error occurred while getting date: ', err);
        });
    };
    Profile.prototype.changePassword = function () {
        var _this = this;
        var profileModal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_8__change_password_change_password__["a" /* ChangePasswordPage */], {});
        profileModal.onDidDismiss(function (data) {
            if (data) {
                _this.service.showOk();
            }
            else {
                //this.service.showOk();
            }
        });
        profileModal.present();
    };
    Profile.prototype.formatDate = function (date) {
        return date;
    };
    Profile.prototype.gotoHome = function () {
        this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_10__home_home__["a" /* HomePage */]);
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])('datepicker'),
        __metadata("design:type", Object)
    ], Profile.prototype, "datepicker", void 0);
    Profile = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-profile',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/profile/profile.html"*/'<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>MI PERFIL</ion-title>\n    <ion-buttons end>\n    <button (tap)="presentMediaOptionsPopover($event)" ion-button icon-only>\n      <ion-icon ios="ios-camera-outline" md="ios-camera-outline"></ion-icon>\n    </button>\n    </ion-buttons>\n  </ion-navbar>\n\n</ion-header>\n\n<ion-content [ngClass]="{\'blurred\' : isBlurred}">\n\n  <div *ngIf="loaded">\n    <div class="mediaSlideContainer">\n        <div class="media" [style.background-image]="\'url(\' + (me.avatar != \'\' && me.avatar != null ? me.avatar : \'assets/img/default/avatar.png\' ) + \')\'" style="background-size: cover;"></div>\n    </div>\n    <div class="name">\n      {{ me.first_name }}\n    </div>\n    <div class="welcome">\n      Información de mi cuenta\n    </div>\n\n    <div class="formContainer">\n      <ion-item [hidden]="appInvite">\n        <ion-label fixed>RUT</ion-label>\n        <ion-input type="text" [(ngModel)]="me.card_code" disabled></ion-input>\n      </ion-item>\n      <ion-item>\n        <ion-label fixed>Nombre</ion-label>\n        <ion-input type="text" [(ngModel)]="me.first_name"></ion-input>\n      </ion-item>\n      <ion-item>\n        <ion-label fixed>Apellido</ion-label>\n        <ion-input type="text" [(ngModel)]="me.last_name"></ion-input>\n      </ion-item>\n      <ion-item>\n        <ion-label fixed>Email</ion-label>\n        <ion-input type="text" [(ngModel)]="me.email"></ion-input>\n      </ion-item>\n    </div>\n\n    <div class="welcome">\n      Seguridad\n    </div>\n    <div class="formContainer">\n      <ion-item>\n        <ion-label fixed>Contraseña</ion-label>\n        <ion-label fixed><button (tap)="changePassword()" class="buttonPinkOrange" style="top: 7px; left: 124px;" ion-button round>Cambiar</button>\n        </ion-label>\n      </ion-item>\n\n\n      <div class="buttonWrapper">\n        <button (tap)="save()" class="buttonPinkOrange" ion-button round>{{ \'PET.UPDATE_INFO\' | translate }}</button>\n      </div>\n    </div>\n  </div>\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/profile/profile.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1__ionic_storage__["b" /* Storage */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["o" /* PopoverController */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_5__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_3__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_4__services_auth_service__["a" /* AuthService */],
            __WEBPACK_IMPORTED_MODULE_7__ionic_native_date_picker__["a" /* DatePicker */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_9__angular_common__["d" /* DatePipe */]])
    ], Profile);
    return Profile;
}());

//# sourceMappingURL=profile.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ProfileMedia; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_camera__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_user_service__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__environments_environment__ = __webpack_require__(27);
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 ProfileMedia = /** @class */ (function () {
    function ProfileMedia(navCtrl, navParams, viewCtrl, service, userService, loadingCtrl, camera, platform, storage) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.viewCtrl = viewCtrl;
        this.service = service;
        this.userService = userService;
        this.loadingCtrl = loadingCtrl;
        this.camera = camera;
        this.platform = platform;
        this.storage = storage;
        this.loading = null;
        this.token = '';
        this.userId = null;
        this.storage.get("MP-Profile").then(function (val) {
            _this.userId = val.id;
        });
        this.storage.get("token").then(function (val) {
            _this.token = val;
        });
    }
    ProfileMedia.prototype.ionViewDidLoad = function () {
    };
    ProfileMedia.prototype.close = function () {
        this.viewCtrl.dismiss();
    };
    ProfileMedia.prototype.takePicture = function () {
        var _this = this;
        if (this.platform.is('cordova')) {
            this.camera.getPicture({
                destinationType: this.camera.DestinationType.DATA_URL,
                targetWidth: 300,
                targetHeight: 300,
                correctOrientation: true
            }).then(function (imageData) {
                _this.processTake(imageData);
            }, function (err) {
                console.log(err);
            });
        }
        else {
            this.processTake(" ");
        }
    };
    ProfileMedia.prototype.openGallery = function () {
        var _this = this;
        var cameraOptions = {
            sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
            destinationType: this.camera.DestinationType.DATA_URL,
            quality: 60,
            targetWidth: 320,
            targetHeight: 320,
            encodingType: this.camera.EncodingType.JPEG,
            correctOrientation: true
        };
        this.camera.getPicture(cameraOptions)
            .then(function (file_uri) {
            _this.processTake(file_uri);
        }, function (err) {
            console.log(err);
        });
    };
    ProfileMedia.prototype.dataURItoBlob = function (dataURI) {
        var byteString;
        if (dataURI.split(',')[0].indexOf('base64') >= 0)
            byteString = atob(dataURI.split(',')[1]);
        else
            byteString = (dataURI.split(',')[1]);
        var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
        var ia = new Uint8Array(byteString.length);
        for (var i = 0; i < byteString.length; i++) {
            ia[i] = byteString.charCodeAt(i);
        }
        return new Blob([ia], {
            type: mimeString
        });
    };
    ProfileMedia.prototype.processTake = function (imageData) {
        this.base64Image = "data:image/jpeg;base64," + imageData;
        this.loading = this.loadingCtrl.create({ content: 'actualizando...' });
        this.loading.present();
        var self0 = this;
        var blob = this.dataURItoBlob(this.base64Image);
        var objURL = window.URL.createObjectURL(blob);
        var image = new Image();
        image.src = objURL;
        window.URL.revokeObjectURL(objURL);
        var url = window.URL.createObjectURL(blob);
        var formData = new FormData();
        formData.append('avatar', blob, 'avatar.jpg');
        formData.append('userId', self0.userId);
        var xhr = new XMLHttpRequest();
        xhr.open("post", __WEBPACK_IMPORTED_MODULE_6__environments_environment__["a" /* environment */].apiUrl + "users/avatar");
        xhr.setRequestHeader("Authorization", self0.token);
        xhr.onreadystatechange = function () {
            if (xhr.readyState === 4 && xhr.status === 200) {
                var uri = xhr.responseText;
                self0.loading.dismiss();
                if (uri.indexOf('error') > -1) {
                    self0.service.logError({}, 'Error al procesar la solicitud. Inténtelo más tarde.');
                }
                else {
                    self0.service.showOk("Foto actualizada con éxito");
                    var jj = JSON.parse(uri);
                    self0.userService.getProfile().subscribe(function (result) {
                        console.log(jj);
                        result.avatar = jj.url;
                        self0.storage.set("MP-Profile", result).then(function () {
                            self0.viewCtrl.dismiss(true);
                        });
                    }, function (err) {
                        console.log(JSON.stringify(err));
                    });
                }
            }
        };
        xhr.send(formData);
    };
    ProfileMedia.prototype.b64toBlob = function (b64, onsuccess, onerror) {
        var img = new Image();
        img.onerror = onerror;
        img.onload = function onload() {
            var canvas = document.createElement('canvas');
            canvas.width = img.width;
            canvas.height = img.height;
            var ctx = canvas.getContext('2d');
            ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
            canvas.toBlob(onsuccess);
        };
        img.src = b64;
    };
    ProfileMedia = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-profile-media',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/popovers/profile-media/profile-media.html"*/'<ion-list radio-group class="popover-page">\n  <div class="close" (tap)="close()">\n    <span class="icon-cerrar"></span>\n  </div>\n  <ion-item (tap)="takePicture()">\n    <ion-label>{{ \'POPOVER_PET_MEDIA_OPTIONS.TAKE_PICTURE\' | translate }}</ion-label>\n    <ion-note item-right>\n      <span class="icon-movil"></span>\n    </ion-note>\n  </ion-item>\n  <ion-item (tap)="openGallery()">\n    <ion-label>{{ \'POPOVER_PET_MEDIA_OPTIONS.CHOOSE_FROM_ALBUM\' | translate }}</ion-label>\n    <ion-note item-right>\n      <span class="icon-album"></span>\n    </ion-note>\n  </ion-item>\n  <!--\n  <ion-item>\n    <ion-label>{{ \'POPOVER_PET_MEDIA_OPTIONS.SET_AS_MAIN\' | translate }}</ion-label>\n    <ion-note item-right>\n      <span class="icon-principal"></span>\n    </ion-note>\n  </ion-item>\n\n  <ion-item>\n    <ion-label>{{ \'POPOVER_PET_MEDIA_OPTIONS.DELETE_PICTURE\' | translate }}</ion-label>\n    <ion-note item-right>\n      <span class="icon-eliminar"></span>\n    </ion-note>\n  </ion-item>\n  -->\n\n</ion-list>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/popovers/profile-media/profile-media.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["r" /* ViewController */],
            __WEBPACK_IMPORTED_MODULE_5__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_4__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_3__ionic_native_camera__["a" /* Camera */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["n" /* Platform */],
            __WEBPACK_IMPORTED_MODULE_1__ionic_storage__["b" /* Storage */]])
    ], ProfileMedia);
    return ProfileMedia;
}());

//# sourceMappingURL=profile-media.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ChangePasswordPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_user_service__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
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);
};




/**
 * Generated class for the ChangePasswordPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */
var ChangePasswordPage = /** @class */ (function () {
    function ChangePasswordPage(navCtrl, navParams, userService, service, loadingCtrl, viewCtrl) {
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.userService = userService;
        this.service = service;
        this.loadingCtrl = loadingCtrl;
        this.viewCtrl = viewCtrl;
        this.user = { currentPass: '', newPass: '', repeatPass: '' };
        //this.userId = this.navParams.get('userId')
    }
    ChangePasswordPage.prototype.ionViewDidLoad = function () {
    };
    ChangePasswordPage.prototype.dismiss = function (data) {
        this.viewCtrl.dismiss(data);
    };
    ChangePasswordPage.prototype.changePassword = function () {
        var _this = this;
        if (this.user.newPass != this.user.repeatPass) {
            this.service.logError(null, "Las contraseñas no coinciden");
            return false;
        }
        var loading = this.loadingCtrl.create({
            content: 'cargando...'
        });
        loading.present();
        console.log(JSON.stringify(this.user));
        this.userService.changePassword(this.user.currentPass, this.user.newPass).subscribe(function (data) {
            loading.dismiss();
            if (data.status) {
                _this.dismiss(true);
                _this.service.showOk();
            }
            else {
                //this.dismiss(false);
                _this.service.logError(null, data.message);
            }
        }, function (error) {
            loading.dismiss();
            console.log('Change.error: ' + JSON.stringify(error));
            _this.service.logError(null, "Error al intentar cambiar la contraseña");
        });
    };
    ChangePasswordPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-change-password',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/change-password/change-password.html"*/'<!--\n  Generated template for the ChangePasswordPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-buttons left>\n      <button ion-button icon-only (tap)="viewCtrl.dismiss()" class="my-style-for-modal">\n        <ion-icon class="ionicons" name="arrow-back"></ion-icon>\n      </button>\n    </ion-buttons>\n    <ion-title>Cambiar Contraseña</ion-title>\n  </ion-navbar>\n</ion-header>\n\n\n<ion-content padding>\n\n\n  <div class="formContainer">\n    <ion-item>\n      <ion-label fixed>Contraseña Actual</ion-label>\n      <ion-input type="password" [(ngModel)]="user.currentPass"></ion-input>\n    </ion-item>\n    <ion-item>\n      <ion-label fixed>Nueva Contraseña</ion-label>\n      <ion-input type="password" [(ngModel)]="user.newPass"></ion-input>\n    </ion-item>\n    <ion-item>\n      <ion-label fixed>Repetir Nueva contraseña</ion-label>\n      <ion-input type="password" [(ngModel)]="user.repeatPass"></ion-input>\n    </ion-item>\n\n\n    <div class="buttonWrapper">\n      <button (tap)="changePassword()" class="buttonPinkOrange" ion-button round>Cambiar Contraseña</button>\n    </div>\n  </div>\n\n\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/change-password/change-password.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */]])
    ], ChangePasswordPage);
    return ChangePasswordPage;
}());

//# sourceMappingURL=change-password.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SignupPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__signup_signup2__ = __webpack_require__(195);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__services_auth_service__ = __webpack_require__(42);
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 SignupPage = /** @class */ (function () {
    function SignupPage(navCtrl, navParams, service, loadingCtrl, storage, alertCtrl, auth) {
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.service = service;
        this.loadingCtrl = loadingCtrl;
        this.storage = storage;
        this.alertCtrl = alertCtrl;
        this.auth = auth;
        this.login = null;
        this.login = {
            rut: ''
        };
    }
    SignupPage.prototype.back1 = function () {
        this.navCtrl.pop();
    };
    SignupPage.prototype.next = function () {
        var _this = this;
        if (this.login.rut == "") {
            this.service.logError({}, "Rut no puede estar vacío o es incorrecto");
        }
        else {
            this.loading = this.loadingCtrl.create();
            this.loading.present();
            this.auth.evaluate(this.login).subscribe(function (data) {
                _this.loading.dismiss();
                if (data.res == "OK") {
                    _this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_3__signup_signup2__["a" /* SignupPage2 */], {
                        rut: _this.login.rut
                    });
                }
                else {
                    _this.service.logError({}, data.msg);
                }
            }, function (err) {
                _this.loading.dismiss();
                _this.service.logError({});
            });
        }
    };
    SignupPage.prototype.gotoLogin = function () {
        this.navCtrl.pop();
    };
    SignupPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-signup',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/signup/signup.html"*/'<!--\n  Generated template for the LoginPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-content padding class="newbg">\n    <img class="back-arrow" src="assets/img/back.png" alt="" (tap)="back1()">\n    <img class="logo" src="assets/img/logo-green.png" alt="">\n\n    <div class="description">Registro</div>\n    <div class="alert">Ingresa tu RUT<br />no te preocupes de los puntos o el guión</div>\n    <div class="listWrapper">\n      <ion-list>\n        <ion-item>\n          <input formatRut type="text" class="rut_login" [(ngModel)]="login.rut" placeholder="12.345.678-9" />\n        </ion-item>\n      </ion-list>\n    </div>\n\n    <div class="buttonWrapper">\n      <button class="buttonPinkOrange" ion-button round full (tap)="next()">{{ \'SIGNUP.NEXT\' | translate }}</button>\n    </div>\n\n    <div class="alert">El registro en MY está limitado solo a usuarios autorizados por la Fundación MY</div>\n\n    <div class="buttonWrapper">\n      <button class="buttonPinkOrange small login" ion-button round  (tap)="back1()">Volver</button>\n    </div>\n\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/signup/signup.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_4__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_5__services_auth_service__["a" /* AuthService */]])
    ], SignupPage);
    return SignupPage;
}());

//# sourceMappingURL=signup.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SignupPage3; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__login_login__ = __webpack_require__(110);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__services_auth_service__ = __webpack_require__(42);
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 SignupPage3 = /** @class */ (function () {
    function SignupPage3(navCtrl, service, loadingCtrl, storage, navParams, auth) {
        this.navCtrl = navCtrl;
        this.service = service;
        this.loadingCtrl = loadingCtrl;
        this.storage = storage;
        this.navParams = navParams;
        this.auth = auth;
        this.login = null;
        this.appInvite = true;
        this.appInvite = this.service.appInvite;
    }
    SignupPage3.prototype.next = function () {
        this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_3__login_login__["a" /* LoginPage */], {}, { animate: true, direction: 'forward' });
    };
    SignupPage3.prototype.gotoLogin = function () {
        this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_3__login_login__["a" /* LoginPage */], {}, { animate: true, direction: 'forward' });
    };
    SignupPage3 = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-signup3',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/signup/signup3.html"*/'<!--\n  Generated template for the LoginPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-content padding class="newbg">\n  <img class="logo" src="assets/img/logo-green.png" alt="">\n  <div class="description"><br />Registrado con éxito<br /><br /></div>\n  <p style="text-align:left;" *ngIf="!appInvite">Ya puedes ingresar a tu cuenta<br /><br />Utiliza tu RUT y clave para cargar tus recetas y disfrutar de MY.<br /><br /></p>\n  <p style="text-align:left;" *ngIf="appInvite">Ya puedes ingresar a tu cuenta<br /><br />Utiliza tu Email y clave para acceder a tu cuenta<br /><br /></p>\n  <div class="buttonWrapper">\n    <button class="buttonPinkOrange" ion-button round full (tap)="next()">Volver al inicio</button>\n  </div>\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/signup/signup3.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_4__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_5__services_auth_service__["a" /* AuthService */]])
    ], SignupPage3);
    return SignupPage3;
}());

//# sourceMappingURL=signup3.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LostPasswordPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_auth_service__ = __webpack_require__(42);
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);
};





/**
 * Generated class for the LoginCodePage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */
var LostPasswordPage = /** @class */ (function () {
    function LostPasswordPage(navCtrl, navParams, service, storage, auth) {
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.service = service;
        this.storage = storage;
        this.auth = auth;
        this.requestInProgress = false;
        this.rut = '';
        this.appInvite = true;
        this.appInvite = this.service.appInvite;
    }
    LostPasswordPage.prototype.accept = function () {
        /*let EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;*/
        var _this = this;
        if (this.rut.trim() == '') {
            if (this.appInvite) {
                this.service.logError({}, "RUT no puede estar vacio");
            }
            else {
                this.service.logError({}, "Email no puede estar vacio");
            }
        }
        else {
            this.requestInProgress = true;
            this.auth.recoverPassword(this.rut.trim()).subscribe(function (data) {
                if (data.res == 'OK') {
                    _this.requestInProgress = false;
                    _this.service.showOk(data.msg);
                    _this.navCtrl.pop();
                }
                else {
                    _this.requestInProgress = false;
                    _this.service.logError({}, data.msg);
                }
            });
        }
    };
    LostPasswordPage.prototype.back = function () {
        this.navCtrl.pop();
    };
    LostPasswordPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-lostpassword',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/lostpassword/lostpassword.html"*/'<ion-content padding class="newbg">\n\n    <img class="back-arrow" src="assets/img/back.png" alt="" (tap)="back()">\n    <img class="logo" src="assets/img/logo-green.png" alt="">\n\n    <div class="description">Recupera tu contraseña</div>\n    <div class="alert" *ngIf="!appInvite">Ingresa tu Rut y recibirás una nueva clave para acceder a MY</div>\n    <div class="alert" *ngIf="appInvite">Ingresa tu email y recibirás una nueva clave para acceder a MY</div>\n    <div class="listWrapper">\n      <ion-list>\n        <ion-item *ngIf="!appInvite">\n          <input formatRut type="text" class="rut_login" [(ngModel)]="rut" placeholder="12.345.678-9" />\n        </ion-item>\n        <ion-item *ngIf="appInvite">\n          <input type="email" class="rut_login" [(ngModel)]="rut" placeholder="tu@correo.com" />\n        </ion-item>\n      </ion-list>\n    </div>\n\n    <div class="buttonWrapper">\n      <button class="buttonPinkOrange" ion-button round full (tap)="accept()">Solicitar</button>\n    </div>\n    <div class="spinnerWrapper" *ngIf="requestInProgress">\n      <ion-spinner></ion-spinner>\n    </div>\n\n    <div class="alert" *ngIf="!appInvite">El registro en MY está limitado solo a usuarios autorizados por la Fundación MY</div>\n\n    <div class="buttonWrapper">\n      <button class="buttonPinkOrange small login" ion-button round  (tap)="back()">Volver</button>\n    </div>\n\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/lostpassword/lostpassword.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_storage__["b" /* Storage */],
            __WEBPACK_IMPORTED_MODULE_4__services_auth_service__["a" /* AuthService */]])
    ], LostPasswordPage);
    return LostPasswordPage;
}());

//# sourceMappingURL=lostpassword.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CategoryPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_native_social_sharing__ = __webpack_require__(111);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_moment__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__producto_producto__ = __webpack_require__(199);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__modals_cart_cart__ = __webpack_require__(79);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__services_user_service__ = __webpack_require__(28);
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 CategoryPage = /** @class */ (function () {
    function CategoryPage(navCtrl, navParams, socialSharing, loadingCtrl, modalCtrl, service, userService, doctorService) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.socialSharing = socialSharing;
        this.loadingCtrl = loadingCtrl;
        this.modalCtrl = modalCtrl;
        this.service = service;
        this.userService = userService;
        this.doctorService = doctorService;
        this.image = '';
        this.link = '';
        this.id = '';
        this.loaded = false;
        this.category = null;
        this.products = [];
        this.categorys = [];
        this.loading = null;
        this.cartItems = 0;
        this.user = { id: '0' };
        this.storeName = "Productos";
        var loading = this.loadingCtrl.create();
        loading.present();
        this.id = this.navParams.get("id");
        this.userService.getProfile().subscribe(function (result) {
            _this.user = result;
        });
        this.doctorService.getCategory(this.id).subscribe(function (data) {
            _this.category = data.data;
            _this.categorys = data.subcats;
            _this.products = data.products;
            _this.loaded = true;
            loading.dismiss();
        });
    }
    CategoryPage_1 = CategoryPage;
    CategoryPage.prototype.ngOnInit = function () {
    };
    CategoryPage.prototype.ionViewDidEnter = function () {
        var _this = this;
        this.storeName = this.service.storeName;
        this.doctorService.getCart().subscribe(function (data) {
            _this.cartItems = data.short.length;
        });
    };
    CategoryPage.prototype.share = function () {
        /*
        if(this.isSharing) return false;
        this.isSharing = true;
        this.socialSharing.share(this.news.title.rendered,this.news.description, this.image, this.news.link).then(() => {
          this.isSharing = false;
        }).catch(() => {
          this.isSharing = false;
        });
        */
    };
    CategoryPage.prototype.navproduct = function (product) {
        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_5__producto_producto__["a" /* ProductoPage */], { id: product.id });
    };
    CategoryPage.prototype.navcategory = function (category) {
        this.navCtrl.push(CategoryPage_1, { id: category.id });
    };
    CategoryPage.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_3_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_3_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_3_moment__["ISO_8601"]).format();
    };
    CategoryPage.prototype.cart = function () {
        var _this = this;
        var cartModal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_6__modals_cart_cart__["a" /* ModalCart */]);
        cartModal.onDidDismiss(function (data) {
            if (data) {
                _this.cartItems = data.items.length;
                _this.doctorService.cartFull = data;
                _this.doctorService.syncCart();
                if (data.hasOwnProperty("finish") && data.finish == 1) {
                    _this.service.showOk(data.msg);
                }
            }
        });
        cartModal.present();
    };
    CategoryPage = CategoryPage_1 = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-category',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/category/category.html"*/'<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>{{category?.name}}</ion-title>\n    <ion-buttons end *ngIf="user?.id != \'0\'">\n      <div class="glovo">{{cartItems}}</div>\n      <button class="search-top" ion-button icon-only (tap)="cart()">\n        <ion-icon ios="ios-cart-outline" md="ios-cart-outline"></ion-icon>\n      </button>\n    </ion-buttons>\n  </ion-navbar>\n</ion-header>\n\n<ion-content>\n\n  <div *ngIf="categorys.length > 0" class="itemlisting">\n    <h1>Subcategorias</h1>\n    <div (tap)="navcategory(cat)" class="category-category" *ngFor="let cat of categorys" [ngStyle]="{\'background-image\': \'url(\'+(cat.banner == \'\' ? \'assets/img/default/no-pictures.png\' : cat.banner)+\')\'}">\n      <div class="category-category-name">{{cat.name}}</div>\n    </div>\n    <!--\n    <ion-slides spaceBetween="20" slidesPerView="1.2">\n      <ion-slide (tap)="navcategory(cat)" *ngFor="let cat of categorys" [ngStyle]="{\'background-image\': \'url(\'+(cat.banner == \'\' ? \'assets/img/default/no-pictures.png\' : cat.banner)+\')\'}">\n        <div class="category-category">\n          <div class="category-category-name">{{cat.name}}</div>\n        </div>\n      </ion-slide>\n    </ion-slides>\n    -->\n  </div>\n  \n  <div *ngIf="products.length > 0" class="itemlisting">\n    <h1>{{storeName}}</h1>\n    <div *ngFor="let product of products" class="category-product" (tap)="navproduct(product)">\n      <div class="category-product-item">\n        <div class="product-background" [ngStyle]="{\'background-image\': \'url(\'+(product.image != \'\' ? product.image : \'assets/img/default/no-pictures.png\')+\')\'}"></div>\n        <div class="category-product-title">\n          {{product.name}}\n          <div class="category-product-price" *ngIf="product.price > 0">$ {{product.price | number:\'1.0-0\' }}</div>\n        </div>\n        \n      </div>\n    </div>\n  </div>\n  <ion-card *ngIf="products.length == 0 && categorys.length == 0">\n    <ion-card-header class="no-items">\n      <img src="assets/img/error.png" />\n      <br /> Por ahora, no hay contenido en esta categoria\n      <br />\n    </ion-card-header>\n  </ion-card>\n\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/category/category.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_native_social_sharing__["a" /* SocialSharing */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_7__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_8__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_4__services_doctor_service__["a" /* DoctorService */]])
    ], CategoryPage);
    return CategoryPage;
    var CategoryPage_1;
}());

//# sourceMappingURL=category.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalTermsPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_moment__);
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 ModalTermsPage = /** @class */ (function () {
    function ModalTermsPage(navCtrl, viewCtrl, docService, service, loadingCtrl, modalCtrl, navParams) {
        this.navCtrl = navCtrl;
        this.viewCtrl = viewCtrl;
        this.docService = docService;
        this.service = service;
        this.loadingCtrl = loadingCtrl;
        this.modalCtrl = modalCtrl;
        this.navParams = navParams;
        this.obj = null;
        this.load = false;
        this.obj = this.navParams.get('obj');
        /*
        let load = this.loadingCtrl.create({content: 'cargando...'});
        load.present();
        this.docService.getOrders(id).subscribe((data:any)=>{
          load.dismiss();
          this.load = true;
          this.order = data.data;
        });
        */
    }
    ModalTermsPage.prototype.accept = function () {
        this.docService.acceptTerms().subscribe(function (data) { });
        this.viewCtrl.dismiss();
    };
    ModalTermsPage.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_4_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_4_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_4_moment__["ISO_8601"]).format();
    };
    ModalTermsPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-modal-terms',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/modal-terms/modal-terms.html"*/'<ion-header>\n    <ion-navbar>\n        <ion-title>ACTUALIZACIÓN</ion-title>\n        <ion-buttons end>\n\n        </ion-buttons>\n      </ion-navbar>\n</ion-header>\n<ion-content padding class="main-view">\n  <!--<div class="overlay" (click)="dismiss()"></div>--> \n  <div class="modal_content">\n    \n    <h3>Términos y condiciones</h3>\n    <div>\n      <p>Hemos actualizado nuestros términos y condiciones. Acéptalos para seguir usando MY</p>\n      <div class="scroll-terms" [innerHTML]="obj?.content"></div>\n      <button ion-button round small (tap)="accept()">Aceptar</button>\n    </div>\n   \n  </div>\n\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/modal-terms/modal-terms.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */]])
    ], ModalTermsPage);
    return ModalTermsPage;
}());

//# sourceMappingURL=modal-terms.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OnboardingPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__login_login__ = __webpack_require__(110);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_storage__ = __webpack_require__(15);
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);
};




/**
 * Generated class for the OnboardingPage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */
var OnboardingPage = /** @class */ (function () {
    function OnboardingPage(navCtrl, navParams, menu, storage) {
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.menu = menu;
        this.storage = storage;
        this.menu.swipeEnable(false, 'leftMenu');
    }
    OnboardingPage.prototype.onIonDrag = function (event) {
        // if (this.slider.getPreviousIndex() >= (this.slider.length() - 1)) {
        //   this.skip();
        // }
    };
    OnboardingPage.prototype.skip = function () {
        this.storage.set("MP-FirstTime", true);
        this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_2__login_login__["a" /* LoginPage */], {}, { animate: true, direction: 'forward' });
    };
    OnboardingPage.prototype.next = function () {
        if (this.slider.isEnd()) {
            this.skip();
        }
        else {
            this.slider.slideNext();
        }
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])('slider'),
        __metadata("design:type", __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["p" /* Slides */])
    ], OnboardingPage.prototype, "slider", void 0);
    OnboardingPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-onboarding',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/onboarding/onboarding.html"*/'<!--\n  Generated template for the OnboardingPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-content>\n  <ion-slides #slider pager slidesPerView="1" (ionSlideWillChange)="onIonDrag($event)" >\n    <ion-slide id="slide1">\n      <div class="title">Medicinal</div>\n      <div class="card">\n        <img class="step-one" src="./assets/img/icon.route.png" alt="">\n        <div>Esta es la primera app en Chile</div>\n        <div class="bold">absolutamente regulada</div> con recetas controladas\n      </div>\n    </ion-slide>\n    <ion-slide id="slide0">\n      <div class="title">Tratamiento Online</div>\n      <div class="card">\n        <img class="step-one" src="./assets/img/icon.online.png" alt="">\n        <div>MY hace tu tratamiento más comodo y facil.</div>\n      </div>\n    </ion-slide>\n    <ion-slide id="slide2">\n      <div class="title">Abona en línea</div>\n      <div class="card">\n        <img class="step-two" src="./assets/img/icon.box.png" alt="">\n        <div>\n          Con <span class="bold">MY</span> tu tarjeta queda registrada o mantienes un saldo, abona directo en la App.\n        </div>\n      </div>\n    </ion-slide>\n    <ion-slide id="slide3">\n      <div class="title">Sigue tu pedido</div>\n      <div class="card">\n        <img class="step-three" src="./assets/img/icon.deliveryman.png" alt="">\n        <div>\n          Tracking de tu pedido\n        </div>\n      </div>\n    </ion-slide>\n  </ion-slides>\n  <div class="labels">\n    <div class="labelsWrapper">\n      <div id="skip" (tap)="skip()">{{ \'ONBOARDING.SKIP\' | translate }}</div>\n      <div id="next" (tap)="next()">{{ \'ONBOARDING.NEXT\' | translate }}</div>\n    </div>\n  </div>\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/onboarding/onboarding.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* MenuController */], __WEBPACK_IMPORTED_MODULE_3__ionic_storage__["b" /* Storage */]])
    ], OnboardingPage);
    return OnboardingPage;
}());

//# sourceMappingURL=onboarding.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AyudaPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_user_service__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
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);
};




/**
 * Generated class for the AyudaPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */
var AyudaPage = /** @class */ (function () {
    function AyudaPage(navCtrl, navParams, userService, service, loadingCtrl, viewCtrl) {
        //this.userId = this.navParams.get('userId')
        var _this = this;
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.userService = userService;
        this.service = service;
        this.loadingCtrl = loadingCtrl;
        this.viewCtrl = viewCtrl;
        this.comment = '';
        this.whatsapp = 0;
        this.email = '';
        var loading = this.loadingCtrl.create();
        loading.present();
        this.userService.getHelpdesk().subscribe(function (data) {
            loading.dismiss();
            _this.whatsapp = data.whatsapp;
            _this.email = data.email;
        }, function (error) {
            loading.dismiss();
            console.log('Change.error: ' + JSON.stringify(error));
            _this.service.logError(null, "Error al intentar cambiar la contraseña");
        });
    }
    AyudaPage.prototype.ionViewDidLoad = function () {
    };
    AyudaPage.prototype.sendWhatsapp = function () {
        window.open("https://wa.me/" + this.whatsapp, '_system');
    };
    AyudaPage.prototype.sendEmail = function () {
        window.open("mailto:" + this.email, '_system');
    };
    AyudaPage.prototype.dismiss = function (data) {
        this.viewCtrl.dismiss(data);
    };
    AyudaPage.prototype.enviarMensaje = function () {
        var _this = this;
        var loading = this.loadingCtrl.create({
            content: 'cargando...'
        });
        loading.present();
        this.userService.sendHelpdesk(this.comment).subscribe(function (data) {
            loading.dismiss();
            _this.service.showOk(data.msg);
            _this.comment = '';
        }, function (error) {
            loading.dismiss();
            console.log('Change.error: ' + JSON.stringify(error));
            _this.service.logError(null, "Error al enviar el mensaje");
        });
    };
    AyudaPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-ayuda',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/ayuda/ayuda.html"*/'<!--\n  Generated template for the ChangePasswordPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n  <ion-navbar>\n  <button ion-button menuToggle>\n    <ion-icon name="menu"></ion-icon>\n  </button>\n  <ion-title>AYUDA</ion-title>\n\n</ion-navbar>\n</ion-header>\n\n\n<ion-content padding>\n  <div class="formContainer">\n    <div>Escrìbenos directo a nuestro WhatsApp</div>\n  </div>\n  <ion-row class="another">\n    <ion-col col-12 text-center>\n      <a (tap)="sendWhatsapp()">\n        <img src="assets/img/whatsapp.png" />\n        <br />\n        Abrir WhatsApp\n      </a>\n    </ion-col>\n  </ion-row>\n\n  <!--\n  <div class="formContainer">\n    <div>Escribe tu <b>solicitud</b> a continuación. El equipo de MY revisará tu mensaje y te responderá lo más pronto posible.</div>\n    <ion-item>\n      <ion-textarea [(ngModel)]="comment" placeholder="Escribe aquí"></ion-textarea>\n    </ion-item>\n\n    <div class="buttonWrapper">\n      <button (click)="enviarMensaje()" class="buttonPinkOrange" ion-button round>Enviar mensaje</button>\n    </div>\n\n    <br /><br />\n  </div>\n\n  <h4 text-center>Otros medios de contacto</h4>\n  <br />\n  <ion-row class="another">\n    <ion-col col-6 text-center>\n      <a (click)="sendWhatsapp()">\n        <img src="assets/img/whatsapp.png" />\n        <br />\n        WhatsApp\n      </a>\n    </ion-col>\n    <ion-col col-6 text-center>\n      <a (click)="sendEmail()">\n      <img src="assets/img/envelope.png" />\n      <br />\n      Email\n      </a>\n    </ion-col>\n  </ion-row>\n  -->\n\n\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/ayuda/ayuda.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */]])
    ], AyudaPage);
    return AyudaPage;
}());

//# sourceMappingURL=ayuda.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HistorialPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_user_service__ = __webpack_require__(28);
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 HistorialPage = /** @class */ (function () {
    function HistorialPage(navCtrl, modalCtrl, loadingCtrl, alertCtrl, userService, service, doctorService) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.modalCtrl = modalCtrl;
        this.loadingCtrl = loadingCtrl;
        this.alertCtrl = alertCtrl;
        this.userService = userService;
        this.service = service;
        this.doctorService = doctorService;
        this.shownGroup = null;
        this.finanzas = [];
        this.thc = [];
        this.user = { id: '0' };
        this.appInvite = true;
        this.appInvite = this.service.appInvite;
        this.userService.getProfile().subscribe(function (result) {
            _this.user = result;
        });
    }
    HistorialPage.prototype.ionViewDidEnter = function () {
        this.getStats();
    };
    HistorialPage.prototype.getStats = function () {
        var _this = this;
        this.doctorService.getHistory().subscribe(function (data) {
            _this.finanzas = data.finance;
            _this.thc = data.thc;
        });
    };
    ;
    HistorialPage.prototype.dateformat = function (fecha) {
        //var fecha_mm = moment(fecha);
        //return moment(fecha_mm.format(),moment.ISO_8601).format();
        fecha = fecha.replace(' ', 'T');
        var f = new Date(fecha);
        var dd = f.getDate();
        var mm = f.getMonth() + 1; //January is 0!
        var sdd = '';
        var smm = '';
        var yyyy = f.getFullYear();
        if (dd < 10) {
            sdd = '0' + dd;
        }
        else {
            sdd = dd + '';
        }
        if (mm < 10) {
            smm = '0' + mm;
        }
        else {
            smm = mm + '';
        }
        var today = sdd + '/' + smm; // + '/' + yyyy;
        return today;
    };
    HistorialPage.prototype.doRefresh = function (refresher) {
        this.getStats();
        setTimeout(function () {
            refresher.complete();
        }, 0);
    };
    HistorialPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-historial',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/historial/historial.html"*/'<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>HISTORIAL</ion-title>\n    <ion-buttons end>\n    </ion-buttons>\n  </ion-navbar>\n</ion-header>\n\n\n<ion-content>\n  <ion-refresher (ionRefresh)="doRefresh($event)" pullMin="80">\n    <ion-refresher-content pullingIcon="arrow-dropdown" pullingText="Desliza para actualizar" refreshingSpinner=\'dots\' refreshingText="Actualizando...">\n    </ion-refresher-content>\n  </ion-refresher>\n  <ion-card *ngIf="finanzas.length + thc.length == 0">\n    <ion-card-header class="no-items" *ngIf="user?.id != \'0\'">\n      <img src="assets/img/history-button.png" />\n      <br /> No tienes movimientos\n    </ion-card-header>\n    <ion-card-header class="no-items" *ngIf="user?.id == \'0\'">\n      <img src="assets/img/history-button.png" />\n      <br /> Usuarios invitados no tienen historial\n    </ion-card-header>\n  </ion-card>\n  <div *ngIf="finanzas.length > 0">\n    <h1>Movimientos financieros</h1>\n    <ion-list *ngFor="let t of finanzas; let i = index">\n        <ion-item>\n          <ion-grid>\n            <ion-row>\n              <ion-col col-2>{{dateformat(t.move_date)}}</ion-col>\n              <ion-col col-6>{{t.description}}</ion-col>\n              <ion-col col-4 text-right>$ {{t.amount | number}}</ion-col>\n            </ion-row>\n          </ion-grid>\n        </ion-item>\n      </ion-list>\n  </div>\n\n  <div *ngIf="thc.length > 0 && !appInvite">\n    <h1>Movimientos THC</h1>\n    <ion-list *ngFor="let t of thc; let i = index">\n      <ion-item>\n        <ion-grid>\n          <ion-row>\n              <ion-col col-2>{{dateformat(t.move_date)}}</ion-col>\n              <ion-col col-6>{{t.description}}</ion-col>\n              <ion-col col-4 text-right>{{t.amount | number}} grs</ion-col>\n          </ion-row>\n        </ion-grid>\n      </ion-item>\n    </ion-list>\n  </div>\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/historial/historial.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_4__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */]])
    ], HistorialPage);
    return HistorialPage;
}());

//# sourceMappingURL=historial.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PagosPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__environments_environment__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_moment__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ionic_native_in_app_browser__ = __webpack_require__(78);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__modals_modal_pago_ok_modal_pago_ok__ = __webpack_require__(551);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__services_user_service__ = __webpack_require__(28);
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 PagosPage = /** @class */ (function () {
    function PagosPage(navCtrl, modalCtrl, loadingCtrl, alertCtrl, iab, service, userService, doctorService) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.modalCtrl = modalCtrl;
        this.loadingCtrl = loadingCtrl;
        this.alertCtrl = alertCtrl;
        this.iab = iab;
        this.service = service;
        this.userService = userService;
        this.doctorService = doctorService;
        this.shownGroup = null;
        this.cards = [];
        this.balance = 0;
        this.amount = null;
        this.loading = null;
        this.token = '';
        this.user = { id: '0' };
        this.superload = null;
        this.doctorService.getToken().subscribe(function (data) {
            _this.token = data;
        });
        this.userService.getProfile().subscribe(function (result) {
            _this.user = result;
        });
    }
    PagosPage.prototype.ionViewDidEnter = function () {
        this.getTarjetas(1);
    };
    PagosPage.prototype.getTarjetas = function (starting) {
        var _this = this;
        this.superload = this.loadingCtrl.create();
        this.superload.present();
        this.doctorService.getCards().subscribe(function (data) {
            _this.cards = data.data;
            if (starting) {
                _this.getBalance(1);
            }
            else {
                _this.superload.dismiss();
            }
        }, function (err) {
            if (starting) {
                _this.getBalance(1);
            }
            else {
                _this.superload.dismiss();
            }
        });
    };
    PagosPage.prototype.getBalance = function (starting) {
        var _this = this;
        if (!starting) {
            this.superload = this.loadingCtrl.create();
            this.superload.present();
        }
        this.doctorService.getBalance().subscribe(function (data) {
            _this.balance = data.balance;
            _this.superload.dismiss();
        }, function (err) {
            _this.superload.dismiss();
        });
    };
    PagosPage.prototype.deleteTarjeta = function (index) {
        var _this = this;
        var id = this.cards[index].id;
        var alert = this.alertCtrl.create({
            title: '',
            message: '¿Desea eliminar esta tarjeta?',
            buttons: [
                { text: 'Cancelar', role: 'cancel', handler: function () { } },
                { text: 'Si', handler: function () { _this.deleteTarjetaOk(id); } }
            ]
        });
        alert.present();
    };
    PagosPage.prototype.deleteTarjetaOk = function (id) {
        var _this = this;
        this.superload = this.loadingCtrl.create();
        this.superload.present();
        this.doctorService.deleteTarjeta(id).subscribe(function (data) {
            _this.superload.dismiss();
            if (data.res == "OK") {
                _this.service.showOk();
                _this.getTarjetas();
            }
            else {
                _this.service.showMsg(data.msg);
            }
        }, function (err) {
            _this.service.showMsg("No fue posible eliminar la tarjeta");
        });
    };
    PagosPage.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_5_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_5_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_5_moment__["ISO_8601"]).format();
    };
    PagosPage.prototype.addCard = function () {
        var _this = this;
        var browser = this.iab.create(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'customers/enroll?token=' + this.token, '_blank', {
            location: 'no',
            zoom: 'no',
            hardwareback: 'no',
            hideurlbar: 'yes',
            closebuttoncaption: 'Cancelar'
        });
        browser.on('loadstop').subscribe(function (event) {
            if (event.url.indexOf("appFinish2") > 0) {
                if (event.url.indexOf("success") > 0) {
                    browser.close();
                    _this.getTarjetas();
                    var alert_1 = _this.alertCtrl.create({
                        title: 'Listo',
                        subTitle: "Se ha enrolado la tarjeta correctamente",
                        buttons: ['Aceptar']
                    });
                    alert_1.present();
                }
                else if (event.url.indexOf("error") > 0) {
                    browser.close();
                    var alert_2 = _this.alertCtrl.create({
                        title: 'Error',
                        subTitle: "No fue posible enrolar tu tarjeta, intenta nuevamente o comunicate con tu banco",
                        buttons: ['Aceptar']
                    });
                    alert_2.present();
                }
            }
        });
    };
    PagosPage.prototype.loadBalance = function () {
        var _this = this;
        var amount = this.amount;
        if (amount < 1) {
            var alert_3 = this.alertCtrl.create({
                title: 'Error',
                subTitle: "Monto a abonar debe ser superior a cero",
                buttons: ['Aceptar']
            });
            alert_3.present();
        }
        else {
            var browser_1 = this.iab.create(__WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].apiUrl + 'customers/addfunds?amount=' + amount + '&token=' + this.token, '_blank', {
                location: 'no',
                zoom: 'no',
                hardwareback: 'no',
                hideurlbar: 'yes',
                closebuttoncaption: 'Cancelar'
            });
            this.amount = 0;
            browser_1.on('loadstop').subscribe(function (event) {
                if (event.url.indexOf("wsFinish") > 0) {
                    if (event.url.indexOf("success") > 0) {
                        browser_1.close();
                        _this.getBalance();
                        var ex = event.url.split('id=');
                        var x = _this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_7__modals_modal_pago_ok_modal_pago_ok__["a" /* ModalPagoOkPage */], { id: ex[1] });
                        x.present();
                        /*
                        let alert = this.alertCtrl.create({
                          title: 'Listo',
                          subTitle: "Se han abonado los fondos a tu cuenta GreenApp",
                          buttons: ['Aceptar']
                        });
                        alert.present();
                        */
                    }
                    else if (event.url.indexOf("error") > 0) {
                        browser_1.close();
                        var alert_4 = _this.alertCtrl.create({
                            title: 'Error',
                            subTitle: "No fue posible realizar la carga, intenta nuevamente o comunicate con tu banco",
                            buttons: ['Aceptar']
                        });
                        alert_4.present();
                    }
                }
            });
        }
    };
    PagosPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-pagos',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/pagos/pagos.html"*/'<ion-header>\n    <ion-navbar>\n      <button ion-button menuToggle>\n        <ion-icon name="menu"></ion-icon>\n      </button>\n      <ion-title>SALDO MY</ion-title>\n      <ion-buttons end>\n\n      </ion-buttons>\n  \n    </ion-navbar>\n  </ion-header>\n  \n  <ion-content class="new2018">\n   <div *ngIf="user?.id != \'0\'">\n    <h2>Saldo disponible</h2>\n    <ion-card>\n      <ion-card-header class="pay-balance">\n        <h3>$ {{ balance | number }}</h3>\n      </ion-card-header>\n    </ion-card>\n\n    <h2>Tarjetas de crédito</h2>\n    <ion-card *ngIf="cards.length == 0">\n      <ion-card-header class="no-items">\n        <img src="assets/img/debit-card.png" />\n        <br /> No tienes tarjetas enroladas\n        <br /><br />\n        <button ion-button small outline (tap)="addCard()">Agrega una tarjeta</button>\n      </ion-card-header>\n    </ion-card>\n    <ion-card *ngFor="let card of cards; let i = index;" class="credit-card">\n      <ion-grid>\n        <ion-row>\n          <ion-col col-3>\n            <ion-icon name="card"></ion-icon>\n          </ion-col>\n          <ion-col col-6>\n            <h3>{{card.cc_type}} | {{card.last4digits}}</h3>\n            <h4>Desde: {{card.auth_at | date: \'dd/MM/yyyy HH:mm\'}}</h4>\n          </ion-col>\n          <ion-col col-3 class="card-tools">\n            <a (tap)="deleteTarjeta(i)">\n              <ion-icon name="trash"></ion-icon>\n            </a>\n          </ion-col>\n        </ion-row>\n      </ion-grid>\n      \n    </ion-card>\n\n    <h2>Pre-abono Webpay</h2>\n    <ion-card>\n      <p>Con el preabono webpay guarda saldo en tu billetera virtual de MY, tu saldo estará protegido para tu próximo abono.</p>\n      <ion-item>\n        <ion-label>Monto:</ion-label>\n        <ion-input type="tel" [(ngModel)]="amount"></ion-input>\n      </ion-item>\n      <br />\n      <div class="action-button">\n        <button ion-button small outline (tap)="loadBalance()">Carga saldo</button>\n      </div>\n    </ion-card>\n  </div>\n  <div *ngIf="user?.id == \'0\'">\n    <h2>Saldo disponible</h2>\n    <ion-card>\n      <ion-card-header class="pay-balance" text-wrap>\n        <h4>Solo los usuarios registrados tienen acceso a una cuenta de saldos</h4>\n      </ion-card-header>\n    </ion-card>\n  </div>\n  <br /><br /><br /><br />\n  </ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/pagos/pagos.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_6__ionic_native_in_app_browser__["a" /* InAppBrowser */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_8__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */]])
    ], PagosPage);
    return PagosPage;
}());

//# sourceMappingURL=pagos.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalPagoOkPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_moment__);
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 ModalPagoOkPage = /** @class */ (function () {
    function ModalPagoOkPage(navCtrl, viewCtrl, docService, service, loadingCtrl, modalCtrl, navParams) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.viewCtrl = viewCtrl;
        this.docService = docService;
        this.service = service;
        this.loadingCtrl = loadingCtrl;
        this.modalCtrl = modalCtrl;
        this.navParams = navParams;
        this.data = null;
        this.load = false;
        this.id = '';
        var id = this.navParams.get('id');
        var load = this.loadingCtrl.create({ content: 'cargando...' });
        load.present();
        this.docService.getTbkOrder(id).subscribe(function (data) {
            load.dismiss();
            _this.load = true;
            _this.data = data.data;
        });
    }
    ModalPagoOkPage.prototype.dismiss = function () {
        this.viewCtrl.dismiss();
    };
    ModalPagoOkPage.prototype.df = function (fecha) {
        if (!fecha) {
            return new Date();
        }
        fecha = fecha.replace(' ', 'T');
        return fecha;
    };
    ModalPagoOkPage.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_4_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_4_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_4_moment__["ISO_8601"]).format();
    };
    ModalPagoOkPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-modal-pago-ok',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/modal-pago-ok/modal-pago-ok.html"*/'<ion-header>\n    <ion-navbar>\n        <ion-title>ABONO RECIBIDO</ion-title>\n        <ion-buttons end>\n\n        </ion-buttons>\n      </ion-navbar>\n</ion-header>\n<ion-content padding class="main-view">\n  <!--<div class="overlay" (click)="dismiss()"></div>--> \n  <div class="modal_content">\n    <div [hidden]="!load">\n        <ion-list>\n          <ion-item>\n            <b>Comercio:</b><br /> MY\n          </ion-item>\n          <ion-item>\n            <b>Nro. de orden:</b><br /> {{data?.Tbk_orden_compra}}\n          </ion-item>\n          <ion-item>\n            <b>Fecha y Hora:</b><br /> {{df(data?.pay_at) | date:\'dd/MM/y HH:mm\' }}\n          </ion-item>\n          <ion-item>\n            <b>Monto abonado:</b><br /> $ {{data?.Tbk_monto | number:\'1.0-0\' }}\n          </ion-item>\n          <ion-item>\n            <b>Cliente:</b><br /> {{data?.first_name}} {{data?.last_name}}\n          </ion-item>\n          <ion-item>\n            <b>Cod. Autorización:</b><br /> {{data?.Tbk_codigo_autorizacion}}\n          </ion-item>\n          <ion-item>\n            <b>Num. Tarjeta:</b><br /> XXXX XXXX XXXX {{data?.Tbk_Final_numero_Tarjeta}}\n          </ion-item>\n          <ion-item>\n            <b>Tipo Tarjeta:</b><br /> {{(data?.Tbk_tipo_pago == \'VD\' ? \'Débito\' : \'Crédito\')}}\n          </ion-item>\n          <ion-item>\n            <b>Núm. Cuotas:</b><br /> {{(data?.Tbk_tipo_pago == \'VD\' ? \'No aplica\' : data?.Tbk_numero_cuotas)}}\n          </ion-item>\n        </ion-list>\n        <p>Ante cualquier duda, contáctanos en el menú <b>Ayuda</b> de la App</p>\n\n      <button ion-button round small (tap)="dismiss()">Aceptar</button>\n    </div>\n   \n  </div>\n\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/modal-pago-ok/modal-pago-ok.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */]])
    ], ModalPagoOkPage);
    return ModalPagoOkPage;
}());

//# sourceMappingURL=modal-pago-ok.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PedidosPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_moment__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ver_recorrido_ver_recorrido__ = __webpack_require__(553);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__modals_modal_detalles_modal_detalles__ = __webpack_require__(120);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__services_user_service__ = __webpack_require__(28);
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 PedidosPage = /** @class */ (function () {
    function PedidosPage(navCtrl, modalCtrl, loadingCtrl, alertCtrl, service, userService, doctorService) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.modalCtrl = modalCtrl;
        this.loadingCtrl = loadingCtrl;
        this.alertCtrl = alertCtrl;
        this.service = service;
        this.userService = userService;
        this.doctorService = doctorService;
        this.orders = [];
        this.user = { id: '0' };
        this.getOrders();
        this.userService.getProfile().subscribe(function (result) {
            _this.user = result;
        });
    }
    PedidosPage.prototype.ionViewDidEnter = function () {
    };
    PedidosPage.prototype.getOrders = function () {
        var _this = this;
        var load = this.loadingCtrl.create({ content: 'cargando...' });
        load.present();
        this.doctorService.getOrders().subscribe(function (data) {
            load.dismiss();
            _this.orders = data.data;
        });
    };
    PedidosPage.prototype.detalles = function (index) {
        var detallesModal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_6__modals_modal_detalles_modal_detalles__["a" /* ModalDetallesPage */], { id: this.orders[index].id });
        detallesModal.onDidDismiss(function (data) {
        });
        detallesModal.present();
    };
    PedidosPage.prototype.seguimiento = function (index) {
        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_5__ver_recorrido_ver_recorrido__["a" /* VerRecorridoPage */], {
            id: this.orders[index].id,
            origen: {
                lat: -33.4049614,
                lng: -70.5998516
            },
            destino: {
                lat: parseFloat(this.orders[index].lat),
                lng: parseFloat(this.orders[index].lng)
            }
        });
    };
    PedidosPage.prototype.cancelarCompra = function (index) {
        var _this = this;
        var id = this.orders[index].id;
        var alert = this.alertCtrl.create({
            title: 'Anular el abono',
            message: 'Solo podrás anular el abono que aún no estén en reparto. ¿Deseas continuar con la anulación?',
            buttons: [
                {
                    text: 'Cancelar',
                    role: 'cancel',
                    handler: function () {
                    }
                },
                {
                    text: 'Anular abono',
                    role: 'destructive',
                    handler: function () {
                        _this.anularBackend(id, index);
                    }
                }
            ]
        });
        alert.present();
    };
    PedidosPage.prototype.anularBackend = function (id, index) {
        var _this = this;
        var load = this.loadingCtrl.create({ content: 'anulando...' });
        load.present();
        this.doctorService.deleteOrder(id).subscribe(function (data) {
            load.dismiss();
            if (data.res == "OK") {
                _this.orders.splice(index, 1);
                _this.service.showOk("Abono anulado exitosamente");
            }
            else {
                var alert_1 = _this.alertCtrl.create({
                    title: 'Anulación Fallida',
                    subTitle: 'No fue posible anular el abono ' + data.msg,
                    buttons: ['Aceptar']
                });
                alert_1.present();
            }
        });
    };
    PedidosPage.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_4_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_4_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_4_moment__["ISO_8601"]).format();
    };
    PedidosPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-pedidos',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/pedidos/pedidos.html"*/'<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>MIS PEDIDOS</ion-title>\n    <ion-buttons end>\n    </ion-buttons>\n  </ion-navbar>\n</ion-header>\n\n<ion-content>\n  <!--\n  <ion-refresher (ionRefresh)="doRefresh($event)" pullMin="80">\n    <ion-refresher-content pullingIcon="arrow-dropdown" pullingText="Desliza para actualizar" refreshingSpinner=\'dots\' refreshingText="Actualizando...">\n  </ion-refresher-content>\n  </ion-refresher>\n  -->\n  <ion-card *ngIf="orders.length == 0">\n    <ion-card-header class="no-items" *ngIf="user?.id == \'0\'">\n      <img src="assets/img/online-shop.png" />\n      <br /> Usuarios invitados no pueden hacer pedidos\n    </ion-card-header>\n    <ion-card-header class="no-items" *ngIf="user?.id != \'0\'">\n      <img src="assets/img/online-shop.png" />\n      <br /> No tienes pedidos\n    </ion-card-header>\n  </ion-card>\n\n  <ion-card *ngFor="let order of orders; let i = index">\n    <ion-grid>\n      <ion-row>\n        <ion-col col-4 text-center class="prescription-head">\n          <img src="assets/img/trolley.png" class="subicon" />\n          <h2>ID./ {{order.id}}</h2>\n          <h4>Fecha:<br />{{order.created_at | date: \'dd/MM/yyyy\'}}</h4>\n          <br />\n          <div>\n            <span class="status-waiting" *ngIf="order.status == \'0\'">Programado</span>\n            <span class="status-waiting" *ngIf="order.status == \'1\'">Programado</span>\n            <span class="status-waiting" *ngIf="order.status == \'2\'">Programado</span>\n            <span class="status-waiting" *ngIf="order.status == \'3\'">Programado</span>\n            <span class="status-waiting" *ngIf="order.status == \'4\'">Programado</span>\n            <span class="status-waiting" *ngIf="order.status == \'5\'">Programado</span>\n            <span class="status-waiting" *ngIf="order.status == \'6\'">Programado</span>\n            <span class="status-expire" *ngIf="order.status == \'7\'">En tránsito</span>\n\n            <span class="status-expire" *ngIf="order.status == \'10\'">Por entregar</span>\n            <span class="status-success" *ngIf="order.status == \'15\'">Entregada</span>\n            <span class="status-declined" *ngIf="order.status == \'666\'">Anulada</span>\n            <span class="status-declined" *ngIf="order.status == \'-1\'">Devuelta</span> \n          </div>\n        </ion-col>\n        <ion-col col-8>\n          <b>Resumen</b>\n          <ion-grid class="prescription-info">\n            <ion-row>\n              <ion-col col-4>\n                <h4>$ {{order.total | number}}</h4>\n                abono               \n              </ion-col>\n              <ion-col col-4>\n                <h4>{{order.delivered_program | date:\'dd/MM/yyyy\'}}</h4>\n                entrega\n              </ion-col>\n              <ion-col col-4>\n                <h4>{{order.total_items | number}}</h4>\n                items\n              </ion-col>\n            </ion-row>\n          </ion-grid>\n          <hr />\n          <ion-grid>\n            <ion-row class="order-icons">\n              <ion-col col-6>\n                <a (tap)="seguimiento(i)">\n                  <img src="assets/img/logistic.png" />\n                  <span>Seguimiento</span>\n                </a>\n              </ion-col>\n              <ion-col col-6>\n                <a (tap)="detalles(i)">\n                  <img src="assets/img/clipboard.png" />\n                  <span>Ver detalles</span>\n                </a>\n              </ion-col>\n              <!--\n              <ion-col col-4>\n                <a (click)="cancelarCompra(i)">\n                  <img src="assets/img/error.png" />\n                </a>\n              </ion-col>\n              -->\n            </ion-row>\n            <ion-row>\n              <ion-col col-12>\n                Comentarios: {{order.notes}}\n              </ion-col>\n            </ion-row>\n          </ion-grid>\n        </ion-col>\n      </ion-row>\n    </ion-grid>\n  </ion-card>\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/pedidos/pedidos.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_7__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */]])
    ], PedidosPage);
    return PedidosPage;
}());

//# sourceMappingURL=pedidos.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VerRecorridoPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_native_geolocation__ = __webpack_require__(108);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__agm_core__ = __webpack_require__(77);
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 VerRecorridoPage = /** @class */ (function () {
    function VerRecorridoPage(navCtrl, geolocation, ngZone, doctorService, mapsAPILoader, navParams) {
        this.navCtrl = navCtrl;
        this.geolocation = geolocation;
        this.ngZone = ngZone;
        this.doctorService = doctorService;
        this.mapsAPILoader = mapsAPILoader;
        this.navParams = navParams;
        this.clickableIcons = false;
        this.styles = [{ "featureType": "all", "elementType": "labels.text.fill", "stylers": [{ "color": "#7c93a3" }, { "lightness": "-10" }] }, { "featureType": "administrative.country", "elementType": "geometry", "stylers": [{ "visibility": "on" }] }, { "featureType": "administrative.country", "elementType": "geometry.stroke", "stylers": [{ "color": "#a0a4a5" }] }, { "featureType": "administrative.province", "elementType": "geometry.stroke", "stylers": [{ "color": "#62838e" }] }, { "featureType": "landscape", "elementType": "geometry.fill", "stylers": [{ "color": "#dde3e3" }] }, { "featureType": "landscape.man_made", "elementType": "geometry.stroke", "stylers": [{ "color": "#3f4a51" }, { "weight": "0.30" }] }, { "featureType": "poi", "elementType": "all", "stylers": [{ "visibility": "simplified" }] }, { "featureType": "poi.attraction", "elementType": "all", "stylers": [{ "visibility": "on" }] }, { "featureType": "poi.business", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.government", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.park", "elementType": "all", "stylers": [{ "visibility": "on" }] }, { "featureType": "poi.place_of_worship", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.school", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.sports_complex", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "road", "elementType": "all", "stylers": [{ "saturation": "-100" }, { "visibility": "on" }] }, { "featureType": "road", "elementType": "geometry.stroke", "stylers": [{ "visibility": "on" }] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{ "color": "#bbcacf" }] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "lightness": "0" }, { "color": "#bbcacf" }, { "weight": "0.50" }] }, { "featureType": "road.highway", "elementType": "labels", "stylers": [{ "visibility": "on" }] }, { "featureType": "road.highway", "elementType": "labels.text", "stylers": [{ "visibility": "on" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry.fill", "stylers": [{ "color": "#ffffff" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry.stroke", "stylers": [{ "color": "#a9b4b8" }] }, { "featureType": "road.arterial", "elementType": "labels.icon", "stylers": [{ "invert_lightness": true }, { "saturation": "-7" }, { "lightness": "3" }, { "gamma": "1.80" }, { "weight": "0.01" }] }, { "featureType": "transit", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "water", "elementType": "geometry.fill", "stylers": [{ "color": "#a3c7df" }] }];
        this.zoom = 16;
        this.started = false;
        this.terminado = false;
        this.sus = null;
        this.primero = false;
        this.renderOptions = {
            suppressMarkers: true,
            preserveViewport: true,
            travelMode: 'DRIVING',
            drivingOptions: {
                trafficModel: 'bestguess'
            }
        };
        this.markerOptions = {
            origin: {
                icon: 'assets/img/markerTruck.png'
            },
            destination: {
                icon: 'assets/img/goal.png'
            },
        };
        this.driverInformation = {
            distance: '',
            actual: '',
            timer: '',
            when: ''
        };
        this.norefresh = false;
        this.zoom = 14;
        this.origen = this.navParams.get('origen');
        this.destino = this.navParams.get('destino');
        this.myLocation('constructor');
        this.refresh();
        console.log('destino', this.navParams.get('destino'));
        console.log('origen', this.navParams.get('origen'));
    }
    VerRecorridoPage.prototype.onMapReady = function (map) {
        var bounds = new google.maps.LatLngBounds();
        bounds.extend(new google.maps.LatLng(this.origen.lat, this.origen.lng));
        bounds.extend(new google.maps.LatLng(this.destino.lat, this.destino.lng));
        map.fitBounds = bounds;
    };
    VerRecorridoPage.prototype.refresh = function () {
        var _this = this;
        this.sus = this.doctorService.serviceQuery(this.navParams.get('id')).subscribe(function (resp) {
            var data = resp.data;
            if (data.status == '10') {
                _this.started = true;
            }
            else if (data.status == '15') {
                _this.terminado = true;
                _this.started = true;
            }
            else {
                _this.started = false;
                _this.terminado = false;
            }
            console.log('update status started: ' + _this.started);
            console.log('update status terminado: ' + _this.terminado);
            _this.driverInformation = {
                distance: data.tracking_distance,
                actual: data.tracking_actual,
                timer: data.tracking_timer,
                when: data.tracking_when
            };
            if (data.tracking_lat != '0') {
                console.log('update position in map');
                _this.ngZone.run(function () {
                    _this.lat = parseFloat(data.tracking_lat);
                    _this.lng = parseFloat(data.tracking_lng);
                    _this.origin = {
                        lat: _this.lat,
                        lng: _this.lng
                    };
                });
                if (_this.primero == false) {
                }
                _this.primero = true;
                _this.myLocation('refresh');
            }
            setTimeout(function () {
                if (!_this.norefresh) {
                    _this.refresh();
                }
            }, 5000);
        });
    };
    VerRecorridoPage.prototype.ionViewDidLeave = function () {
        if (typeof this.sus == "object") {
            this.norefresh = true;
            this.sus.unsubscribe();
        }
    };
    VerRecorridoPage.prototype.changeDirection = function (event) {
        /*
    
        */
    };
    VerRecorridoPage.prototype.myLocation = function (from) {
        console.log('call my location', from);
        if (this.started == true) {
            //this.ngZone.run(() => {
            this.zoom = 16;
            this.lat = this.origin.lat;
            this.lng = this.origin.lng;
            //this.origin=this.origen;
            this.destination = this.destino;
            //});
        }
        else {
            this.zoom = 16;
            this.lat = this.destino.lat;
            this.lng = this.destino.lng;
        }
    };
    VerRecorridoPage.prototype.backButton = function () {
        this.navCtrl.pop();
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])('AgmMap'),
        __metadata("design:type", __WEBPACK_IMPORTED_MODULE_4__agm_core__["b" /* AgmMap */])
    ], VerRecorridoPage.prototype, "agmMap", void 0);
    VerRecorridoPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-ver-recorrido',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/ver-recorrido/ver-recorrido.html"*/'<ion-icon name="md-arrow-round-back" (tap)="backButton()" class="backButton"></ion-icon>\n\n<agm-map [latitude]="lat" (mapReady)="onMapReady($event)" [styles]="styles" [longitude]="lng" [zoom]="zoom" [clickableIcons]="clickableIcons" [zoomControl]="false" [streetViewControl]="false">\n <agm-direction *ngIf="started && !terminado" [fitBounds]="bounds" (onChange)="changeDirection($event)" [origin]="origin" [destination]="destination" [renderOptions]="renderOptions" [markerOptions]="markerOptions"></agm-direction>\n <agm-marker *ngIf="!started || terminado" [latitude]="lat" [longitude]="lng"></agm-marker>\n</agm-map>\n<div class="bubble_driver_info" *ngIf="!started">\n  <b>Tránsito aún no iniciado:</b> podrás ver dónde está tu pedido el día que esté en tránsito, lo entregaremos en éste lugar. \n</div>\n<div class="bubble_driver_info" *ngIf="terminado && started">\n  <b>Pedido entregado:</b> El pedido ya fue entregado en el punto indicado\n</div>\n<div class="bubble_driver_info" *ngIf="!terminado && started">\n  <b>En condiciones actuales:</b><br />\n  Actualización: {{driverInformation.when | date:\'dd/MM/yy HH:mm\'}} <br />\n  Tiempo tránsito: {{driverInformation.timer}} <br />\n  Distancia: {{driverInformation.distance}} \n</div>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/ver-recorrido/ver-recorrido.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_2__ionic_native_geolocation__["a" /* Geolocation */],
            __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"],
            __WEBPACK_IMPORTED_MODULE_3__services_doctor_service__["a" /* DoctorService */],
            __WEBPACK_IMPORTED_MODULE_4__agm_core__["e" /* MapsAPILoader */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */]])
    ], VerRecorridoPage);
    return VerRecorridoPage;
}());

//# sourceMappingURL=ver-recorrido.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NewsDetalle; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__environments_environment__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_social_sharing__ = __webpack_require__(111);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_news_service__ = __webpack_require__(113);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_moment__);
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 NewsDetalle = /** @class */ (function () {
    function NewsDetalle(navCtrl, navParams, socialSharing, newsService) {
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.socialSharing = socialSharing;
        this.newsService = newsService;
        this.image = '';
        this.link = '';
        this.news = null;
        this.staticUrl = __WEBPACK_IMPORTED_MODULE_2__environments_environment__["a" /* environment */].staticUrl;
        this.news = this.navParams.get("news");
    }
    NewsDetalle.prototype.ngOnInit = function () {
        /*
        this.newsService.getFeatured(this.news.featured_media).subscribe(
          (data: any) => {
            this.image =  data.guid.rendered;
          },
          error => {
            console.log(error);
          }
        )
        */
    };
    NewsDetalle.prototype.share = function () {
        /*
        if(this.isSharing) return false;
        this.isSharing = true;
        this.socialSharing.share(this.news.title.rendered,this.news.description, this.image, this.news.link).then(() => {
          this.isSharing = false;
        }).catch(() => {
          this.isSharing = false;
        });
        */
    };
    NewsDetalle.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_5_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_5_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_5_moment__["ISO_8601"]).format();
    };
    NewsDetalle = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-newsDetalle',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/noticias/newsDetalle.html"*/'<ion-header>\n  <ion-navbar>\n    <ion-buttons end>\n      <button class="camera" (tap)="share()">\n        <ion-icon name="md-share"></ion-icon>\n      </button>\n    </ion-buttons>\n  </ion-navbar>\n</ion-header>\n\n<ion-content>\n\n  <div class="image" [style.background-image]="\'url(\' + news.image + \')\'" style="background-size: cover;">\n    <div class="titulo">\n      <p>{{news.title}}</p>\n      <span class="subtitulo"> {{ dateformat(news.date) | date}}</span>\n    </div>\n  </div>\n\n  <div class="content-html" [innerHtml]="news.content">\n\n  </div>\n\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/noticias/newsDetalle.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_3__ionic_native_social_sharing__["a" /* SocialSharing */],
            __WEBPACK_IMPORTED_MODULE_4__services_news_service__["a" /* NewsService */]])
    ], NewsDetalle);
    return NewsDetalle;
}());

//# sourceMappingURL=newsDetalle.js.map

/***/ }),

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

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__ = __webpack_require__(560);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_module__ = __webpack_require__(564);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_core__ = __webpack_require__(0);



Object(__WEBPACK_IMPORTED_MODULE_2__angular_core__["enableProdMode"])();
Object(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__["a" /* platformBrowserDynamic */])().bootstrapModule(__WEBPACK_IMPORTED_MODULE_1__app_module__["a" /* AppModule */]);
//# sourceMappingURL=main.js.map

/***/ }),

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

"use strict";
/* unused harmony export HttpLoaderFactory */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__modals_modal_detalles_modal_detalles__ = __webpack_require__(120);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__modals_modalvalorizacion_modalvalorizacion__ = __webpack_require__(882);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_platform_browser__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__angular_http__ = __webpack_require__(388);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__angular_common_http__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ngx_translate_core__ = __webpack_require__(181);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__agm_core__ = __webpack_require__(77);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ionic_native_barcode_scanner__ = __webpack_require__(523);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__ionic_native_geolocation__ = __webpack_require__(108);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__ionic_native_camera__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__ionic_native_date_picker__ = __webpack_require__(525);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__ionic_native_fcm__ = __webpack_require__(526);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__ionic_native_device__ = __webpack_require__(192);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__ionic_native_in_app_browser__ = __webpack_require__(78);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__app_component__ = __webpack_require__(890);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__ionic_native_insomnia__ = __webpack_require__(529);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__pages_profile_profile__ = __webpack_require__(530);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__pages_home_home__ = __webpack_require__(109);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__pages_noticias_newsDetalle__ = __webpack_require__(554);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__pages_onboarding_onboarding__ = __webpack_require__(546);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__pages_login_login__ = __webpack_require__(110);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__pages_signup_signup__ = __webpack_require__(537);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__pages_ayuda_ayuda__ = __webpack_require__(547);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__pages_signup_signup2__ = __webpack_require__(195);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__pages_signup_signup3__ = __webpack_require__(538);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__pages_pedidos_pedidos__ = __webpack_require__(552);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__pages_noticias_noticias__ = __webpack_require__(893);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__pages_lostpassword_lostpassword__ = __webpack_require__(539);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__pages_farmacia_farmacia__ = __webpack_require__(196);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__agm_snazzy_info_window__ = __webpack_require__(894);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__pages_popovers_pet_media_options_pet_media_options__ = __webpack_require__(897);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__pages_popovers_profile_media_profile_media__ = __webpack_require__(531);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__pages_popovers_ads_ads__ = __webpack_require__(898);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__services_auth_service__ = __webpack_require__(42);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__services_user_service__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__services_pet_service__ = __webpack_require__(114);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__services_news_service__ = __webpack_require__(113);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__components_news_preview_news_preview__ = __webpack_require__(899);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__components_qr_card_qr_card__ = __webpack_require__(900);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44_brmasker_ionic_3__ = __webpack_require__(901);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__ionic_native_status_bar__ = __webpack_require__(193);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__ionic_native_splash_screen__ = __webpack_require__(528);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__ngx_translate_http_loader__ = __webpack_require__(904);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__modals_ok_ok__ = __webpack_require__(389);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__modals_err_err__ = __webpack_require__(390);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__ionic_native_social_sharing__ = __webpack_require__(111);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__pages_change_password_change_password__ = __webpack_require__(532);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__angular_common__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__providers_splitpane_splitpane__ = __webpack_require__(527);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54_ionic2_rating__ = __webpack_require__(906);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__angular_common_locales_ES__ = __webpack_require__(908);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56_ionic_pullup__ = __webpack_require__(533);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__ionic_native_background_geolocation__ = __webpack_require__(536);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__providers_tracking_tracking__ = __webpack_require__(194);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__modals_user_info_user_info__ = __webpack_require__(909);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__pages_ver_recorrido_ver_recorrido__ = __webpack_require__(553);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61_agm_direction__ = __webpack_require__(910);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__ionic_native_market__ = __webpack_require__(548);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__pages_historial_historial__ = __webpack_require__(549);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__pages_pagos_pagos__ = __webpack_require__(550);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__pages_receta_receta__ = __webpack_require__(198);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66_ng2_rut__ = __webpack_require__(542);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66_ng2_rut___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_66_ng2_rut__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__pages_receta_add__ = __webpack_require__(197);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__reverse_pipe__ = __webpack_require__(911);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__pages_producto_producto__ = __webpack_require__(199);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__pages_category_category__ = __webpack_require__(540);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__modals_cart_cart__ = __webpack_require__(79);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__modals_checkout_checkout__ = __webpack_require__(200);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__modals_modal_terms_modal_terms__ = __webpack_require__(541);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__modals_modal_pago_ok_modal_pago_ok__ = __webpack_require__(551);
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);
};








//import { OptionCoreModule } from '@option/core';











// Pages















// Popovers



// Services





// Components







// Modals





//import {EmailComposer} from "@ionic-native/email-composer";


//import {Ionic2MaskDirective} from "ionic2-mask-directive";





Object(__WEBPACK_IMPORTED_MODULE_52__angular_common__["j" /* registerLocaleData */])(__WEBPACK_IMPORTED_MODULE_55__angular_common_locales_ES__["a" /* default */]);
















// import { GoogleMaps } from "@ionic-native/google-maps";
// The translate loader needs to know where to load i18n files
// in Ionic's static asset pipeline.
function HttpLoaderFactory(http) {
    return new __WEBPACK_IMPORTED_MODULE_47__ngx_translate_http_loader__["a" /* TranslateHttpLoader */](http, './assets/i18n/', '.json');
}
var AppModule = /** @class */ (function () {
    function AppModule(translate) {
        this.translate = translate;
        this.initTranslate();
    }
    AppModule.prototype.initTranslate = function () {
        // Set the default language for translation strings, and the current language.
        this.translate.setDefaultLang('es-cl');
        this.translate.use('es-cl');
    };
    AppModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_3__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_17__app_component__["a" /* MyApp */],
                __WEBPACK_IMPORTED_MODULE_20__pages_home_home__["a" /* HomePage */],
                __WEBPACK_IMPORTED_MODULE_21__pages_noticias_newsDetalle__["a" /* NewsDetalle */],
                __WEBPACK_IMPORTED_MODULE_34__pages_popovers_pet_media_options_pet_media_options__["a" /* PetMediaOptionsPage */],
                __WEBPACK_IMPORTED_MODULE_35__pages_popovers_profile_media_profile_media__["a" /* ProfileMedia */],
                __WEBPACK_IMPORTED_MODULE_22__pages_onboarding_onboarding__["a" /* OnboardingPage */],
                __WEBPACK_IMPORTED_MODULE_23__pages_login_login__["a" /* LoginPage */],
                __WEBPACK_IMPORTED_MODULE_19__pages_profile_profile__["a" /* Profile */],
                __WEBPACK_IMPORTED_MODULE_24__pages_signup_signup__["a" /* SignupPage */],
                __WEBPACK_IMPORTED_MODULE_26__pages_signup_signup2__["a" /* SignupPage2 */],
                __WEBPACK_IMPORTED_MODULE_27__pages_signup_signup3__["a" /* SignupPage3 */],
                __WEBPACK_IMPORTED_MODULE_36__pages_popovers_ads_ads__["a" /* AdsMedia */],
                __WEBPACK_IMPORTED_MODULE_28__pages_pedidos_pedidos__["a" /* PedidosPage */],
                __WEBPACK_IMPORTED_MODULE_64__pages_pagos_pagos__["a" /* PagosPage */],
                __WEBPACK_IMPORTED_MODULE_63__pages_historial_historial__["a" /* HistorialPage */],
                __WEBPACK_IMPORTED_MODULE_29__pages_noticias_noticias__["a" /* NoticiasPage */],
                __WEBPACK_IMPORTED_MODULE_30__pages_lostpassword_lostpassword__["a" /* LostPasswordPage */],
                __WEBPACK_IMPORTED_MODULE_48__modals_ok_ok__["a" /* ModalOK */],
                __WEBPACK_IMPORTED_MODULE_49__modals_err_err__["a" /* ModalERR */],
                __WEBPACK_IMPORTED_MODULE_71__modals_cart_cart__["a" /* ModalCart */],
                __WEBPACK_IMPORTED_MODULE_42__components_news_preview_news_preview__["a" /* NewsPreviewComponent */],
                __WEBPACK_IMPORTED_MODULE_43__components_qr_card_qr_card__["a" /* QrCardComponent */],
                __WEBPACK_IMPORTED_MODULE_51__pages_change_password_change_password__["a" /* ChangePasswordPage */],
                __WEBPACK_IMPORTED_MODULE_31__pages_farmacia_farmacia__["a" /* FarmaciaPage */],
                __WEBPACK_IMPORTED_MODULE_65__pages_receta_receta__["a" /* RecetaPage */],
                __WEBPACK_IMPORTED_MODULE_0__modals_modal_detalles_modal_detalles__["a" /* ModalDetallesPage */],
                __WEBPACK_IMPORTED_MODULE_1__modals_modalvalorizacion_modalvalorizacion__["a" /* ModalvalorizacionPage */],
                __WEBPACK_IMPORTED_MODULE_59__modals_user_info_user_info__["a" /* UserInfoPage */],
                __WEBPACK_IMPORTED_MODULE_60__pages_ver_recorrido_ver_recorrido__["a" /* VerRecorridoPage */],
                __WEBPACK_IMPORTED_MODULE_25__pages_ayuda_ayuda__["a" /* AyudaPage */],
                __WEBPACK_IMPORTED_MODULE_67__pages_receta_add__["a" /* RecetaAddPage */],
                __WEBPACK_IMPORTED_MODULE_69__pages_producto_producto__["a" /* ProductoPage */],
                __WEBPACK_IMPORTED_MODULE_70__pages_category_category__["a" /* CategoryPage */],
                __WEBPACK_IMPORTED_MODULE_72__modals_checkout_checkout__["a" /* ModalCheckout */],
                __WEBPACK_IMPORTED_MODULE_68__reverse_pipe__["a" /* ReversePipe */],
                __WEBPACK_IMPORTED_MODULE_73__modals_modal_terms_modal_terms__["a" /* ModalTermsPage */],
                __WEBPACK_IMPORTED_MODULE_74__modals_modal_pago_ok_modal_pago_ok__["a" /* ModalPagoOkPage */]
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_2__angular_platform_browser__["a" /* BrowserModule */],
                __WEBPACK_IMPORTED_MODULE_56_ionic_pullup__["b" /* IonPullupModule */],
                __WEBPACK_IMPORTED_MODULE_44_brmasker_ionic_3__["a" /* BrMaskerModule */],
                __WEBPACK_IMPORTED_MODULE_54_ionic2_rating__["a" /* Ionic2RatingModule */],
                __WEBPACK_IMPORTED_MODULE_4_ionic_angular__["g" /* IonicModule */].forRoot(__WEBPACK_IMPORTED_MODULE_17__app_component__["a" /* MyApp */], {
                    backButtonText: '',
                    backButtonIcon: 'ios-arrow-back',
                    iconMode: 'ios',
                    tabsPlacement: 'bottom',
                    pageTransition: 'ios-transition',
                    scrollAssist: true,
                    autoFocusAssist: true,
                    doneText: 'Listo',
                    cancelText: 'Cancelar',
                    monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
                    monthShortNames: ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],
                    dayNames: ['domingo', 'lunes', 'martes', 'miercoles', 'jueves', 'viernes', 'sabado', 'domingo'],
                    dayShortNames: ['dom', 'lun', 'mar', 'mie', 'jue', 'vie', 'sab'],
                }, {
                    links: []
                }),
                __WEBPACK_IMPORTED_MODULE_5__angular_http__["c" /* HttpModule */],
                __WEBPACK_IMPORTED_MODULE_6__angular_common_http__["b" /* HttpClientModule */],
                __WEBPACK_IMPORTED_MODULE_9__agm_core__["a" /* AgmCoreModule */].forRoot({
                    apiKey: 'AIzaSyBIckYy0s-R_wqEy6bVNstu_vCdrDnmjZQ',
                    libraries: ["places"]
                }),
                __WEBPACK_IMPORTED_MODULE_32__agm_snazzy_info_window__["a" /* AgmSnazzyInfoWindowModule */],
                __WEBPACK_IMPORTED_MODULE_61_agm_direction__["a" /* AgmDirectionModule */],
                __WEBPACK_IMPORTED_MODULE_7__ngx_translate_core__["b" /* TranslateModule */].forRoot({
                    loader: {
                        provide: __WEBPACK_IMPORTED_MODULE_7__ngx_translate_core__["a" /* TranslateLoader */],
                        useFactory: HttpLoaderFactory,
                        deps: [__WEBPACK_IMPORTED_MODULE_6__angular_common_http__["a" /* HttpClient */]]
                    }
                }),
                __WEBPACK_IMPORTED_MODULE_8__ionic_storage__["a" /* IonicStorageModule */].forRoot({
                    name: "__greenapp",
                    driverOrder: ['indexeddb', 'websql']
                }),
                __WEBPACK_IMPORTED_MODULE_66_ng2_rut__["Ng2Rut"]
            ],
            bootstrap: [__WEBPACK_IMPORTED_MODULE_4_ionic_angular__["e" /* IonicApp */]],
            entryComponents: [
                __WEBPACK_IMPORTED_MODULE_17__app_component__["a" /* MyApp */],
                __WEBPACK_IMPORTED_MODULE_20__pages_home_home__["a" /* HomePage */],
                __WEBPACK_IMPORTED_MODULE_21__pages_noticias_newsDetalle__["a" /* NewsDetalle */],
                __WEBPACK_IMPORTED_MODULE_34__pages_popovers_pet_media_options_pet_media_options__["a" /* PetMediaOptionsPage */],
                __WEBPACK_IMPORTED_MODULE_35__pages_popovers_profile_media_profile_media__["a" /* ProfileMedia */],
                __WEBPACK_IMPORTED_MODULE_22__pages_onboarding_onboarding__["a" /* OnboardingPage */],
                __WEBPACK_IMPORTED_MODULE_23__pages_login_login__["a" /* LoginPage */],
                __WEBPACK_IMPORTED_MODULE_24__pages_signup_signup__["a" /* SignupPage */],
                __WEBPACK_IMPORTED_MODULE_26__pages_signup_signup2__["a" /* SignupPage2 */],
                __WEBPACK_IMPORTED_MODULE_27__pages_signup_signup3__["a" /* SignupPage3 */],
                __WEBPACK_IMPORTED_MODULE_36__pages_popovers_ads_ads__["a" /* AdsMedia */],
                __WEBPACK_IMPORTED_MODULE_28__pages_pedidos_pedidos__["a" /* PedidosPage */],
                __WEBPACK_IMPORTED_MODULE_64__pages_pagos_pagos__["a" /* PagosPage */],
                __WEBPACK_IMPORTED_MODULE_63__pages_historial_historial__["a" /* HistorialPage */],
                __WEBPACK_IMPORTED_MODULE_29__pages_noticias_noticias__["a" /* NoticiasPage */],
                __WEBPACK_IMPORTED_MODULE_30__pages_lostpassword_lostpassword__["a" /* LostPasswordPage */],
                __WEBPACK_IMPORTED_MODULE_42__components_news_preview_news_preview__["a" /* NewsPreviewComponent */],
                __WEBPACK_IMPORTED_MODULE_43__components_qr_card_qr_card__["a" /* QrCardComponent */],
                __WEBPACK_IMPORTED_MODULE_48__modals_ok_ok__["a" /* ModalOK */],
                __WEBPACK_IMPORTED_MODULE_49__modals_err_err__["a" /* ModalERR */],
                __WEBPACK_IMPORTED_MODULE_71__modals_cart_cart__["a" /* ModalCart */],
                __WEBPACK_IMPORTED_MODULE_19__pages_profile_profile__["a" /* Profile */],
                __WEBPACK_IMPORTED_MODULE_31__pages_farmacia_farmacia__["a" /* FarmaciaPage */],
                __WEBPACK_IMPORTED_MODULE_51__pages_change_password_change_password__["a" /* ChangePasswordPage */],
                __WEBPACK_IMPORTED_MODULE_65__pages_receta_receta__["a" /* RecetaPage */],
                __WEBPACK_IMPORTED_MODULE_0__modals_modal_detalles_modal_detalles__["a" /* ModalDetallesPage */],
                __WEBPACK_IMPORTED_MODULE_1__modals_modalvalorizacion_modalvalorizacion__["a" /* ModalvalorizacionPage */],
                __WEBPACK_IMPORTED_MODULE_59__modals_user_info_user_info__["a" /* UserInfoPage */],
                __WEBPACK_IMPORTED_MODULE_60__pages_ver_recorrido_ver_recorrido__["a" /* VerRecorridoPage */],
                __WEBPACK_IMPORTED_MODULE_25__pages_ayuda_ayuda__["a" /* AyudaPage */],
                __WEBPACK_IMPORTED_MODULE_67__pages_receta_add__["a" /* RecetaAddPage */],
                __WEBPACK_IMPORTED_MODULE_69__pages_producto_producto__["a" /* ProductoPage */],
                __WEBPACK_IMPORTED_MODULE_70__pages_category_category__["a" /* CategoryPage */],
                __WEBPACK_IMPORTED_MODULE_72__modals_checkout_checkout__["a" /* ModalCheckout */],
                __WEBPACK_IMPORTED_MODULE_73__modals_modal_terms_modal_terms__["a" /* ModalTermsPage */],
                __WEBPACK_IMPORTED_MODULE_74__modals_modal_pago_ok_modal_pago_ok__["a" /* ModalPagoOkPage */]
            ],
            providers: [
                __WEBPACK_IMPORTED_MODULE_37__services_auth_service__["a" /* AuthService */],
                __WEBPACK_IMPORTED_MODULE_38__services_user_service__["a" /* UserService */],
                __WEBPACK_IMPORTED_MODULE_39__services_pet_service__["a" /* PetService */],
                __WEBPACK_IMPORTED_MODULE_40__services_news_service__["a" /* NewsService */],
                __WEBPACK_IMPORTED_MODULE_41__services_doctor_service__["a" /* DoctorService */],
                __WEBPACK_IMPORTED_MODULE_18__ionic_native_insomnia__["a" /* Insomnia */],
                __WEBPACK_IMPORTED_MODULE_45__ionic_native_status_bar__["a" /* StatusBar */],
                __WEBPACK_IMPORTED_MODULE_46__ionic_native_splash_screen__["a" /* SplashScreen */],
                __WEBPACK_IMPORTED_MODULE_9__agm_core__["d" /* GoogleMapsAPIWrapper */],
                { provide: __WEBPACK_IMPORTED_MODULE_3__angular_core__["ErrorHandler"], useClass: __WEBPACK_IMPORTED_MODULE_4_ionic_angular__["f" /* IonicErrorHandler */] },
                __WEBPACK_IMPORTED_MODULE_33__pata__["a" /* Pata */],
                __WEBPACK_IMPORTED_MODULE_10__ionic_native_barcode_scanner__["a" /* BarcodeScanner */],
                __WEBPACK_IMPORTED_MODULE_11__ionic_native_geolocation__["a" /* Geolocation */],
                __WEBPACK_IMPORTED_MODULE_57__ionic_native_background_geolocation__["a" /* BackgroundGeolocation */],
                __WEBPACK_IMPORTED_MODULE_12__ionic_native_camera__["a" /* Camera */],
                __WEBPACK_IMPORTED_MODULE_13__ionic_native_date_picker__["a" /* DatePicker */],
                __WEBPACK_IMPORTED_MODULE_14__ionic_native_fcm__["a" /* FCM */],
                __WEBPACK_IMPORTED_MODULE_15__ionic_native_device__["a" /* Device */],
                { provide: __WEBPACK_IMPORTED_MODULE_3__angular_core__["LOCALE_ID"], useValue: "es-ES" },
                __WEBPACK_IMPORTED_MODULE_50__ionic_native_social_sharing__["a" /* SocialSharing */],
                __WEBPACK_IMPORTED_MODULE_52__angular_common__["d" /* DatePipe */],
                //EmailComposer,
                __WEBPACK_IMPORTED_MODULE_66_ng2_rut__["RutValidator"],
                __WEBPACK_IMPORTED_MODULE_16__ionic_native_in_app_browser__["a" /* InAppBrowser */],
                __WEBPACK_IMPORTED_MODULE_53__providers_splitpane_splitpane__["a" /* SplitpaneProvider */],
                __WEBPACK_IMPORTED_MODULE_58__providers_tracking_tracking__["a" /* TrackingProvider */],
                __WEBPACK_IMPORTED_MODULE_62__ionic_native_market__["a" /* Market */],
                __WEBPACK_IMPORTED_MODULE_68__reverse_pipe__["a" /* ReversePipe */]
                // GoogleMaps
            ],
            schemas: [__WEBPACK_IMPORTED_MODULE_3__angular_core__["CUSTOM_ELEMENTS_SCHEMA"]]
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_7__ngx_translate_core__["c" /* TranslateService */]])
    ], AppModule);
    return AppModule;
}());

//# sourceMappingURL=app.module.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalCart; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__checkout_checkout__ = __webpack_require__(200);
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 ModalCart = /** @class */ (function () {
    function ModalCart(viewCtrl, navCtrl, alertCtrl, loadingCtrl, params, doctorService) {
        var _this = this;
        this.viewCtrl = viewCtrl;
        this.navCtrl = navCtrl;
        this.alertCtrl = alertCtrl;
        this.loadingCtrl = loadingCtrl;
        this.params = params;
        this.doctorService = doctorService;
        this.cartFull = null;
        /*this.msg = params.get('msg');*/
        /*this.renderer.addClass(document.body.querySelector("ng-component.app-root"), 'blur');*/
        this.doctorService.finishCompra.subscribe(function (data) {
            _this.viewCtrl.dismiss(data);
        });
        var load = this.loadingCtrl.create({ content: 'actualizando...' });
        load.present();
        this.doctorService.getCart().subscribe(function (data) {
            load.dismiss();
            _this.cartFull = data.data;
        });
    }
    ModalCart.prototype.closeCart = function () {
        var data = this.cartFull;
        this.viewCtrl.dismiss(data);
    };
    ModalCart.prototype.add = function (index) {
        this.cartFull.items[index].qty++;
        this.cartFull.items[index].total = (this.cartFull.items[index].price * this.cartFull.items[index].qty);
        this.doctorService.addCartItem;
    };
    ModalCart.prototype.remove = function (index) {
        if (this.cartFull.items[index].qty > 1) {
            this.cartFull.items[index].qty--;
            this.cartFull.items[index].total = this.cartFull.items[index].price * this.cartFull.items[index].qty;
        }
    };
    ModalCart.prototype.delete = function (index) {
        var _this = this;
        var alert = this.alertCtrl.create({
            title: 'Eliminar linea',
            message: '¿Deseas eliminar ' + this.cartFull.items[index].name + '?',
            buttons: [
                {
                    text: 'Cancelar',
                    role: 'cancel',
                    handler: function () {
                    }
                },
                {
                    text: 'Eliminar',
                    handler: function () {
                        _this.cartFull.items.splice(index, 1);
                    }
                }
            ]
        });
        alert.present();
    };
    ModalCart.prototype.cartTotal = function () {
        var total = 0;
        if (this.cartFull != null) {
            for (var x = 0; x < this.cartFull.items.length; x++) {
                total += parseFloat(this.cartFull.items[x].total);
            }
        }
        return total;
    };
    ModalCart.prototype.checkout = function () {
        var _this = this;
        var l = this.loadingCtrl.create();
        l.present();
        this.doctorService.cartFull = this.cartFull;
        this.doctorService.syncCart().subscribe(function (data) {
            l.dismiss();
            _this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_3__checkout_checkout__["a" /* ModalCheckout */]);
        });
    };
    ModalCart.prototype.ngOnDestroy = function () {
        /*this.renderer.removeClass(document.body.querySelector("ng-component.app-root"), 'blur');*/
    };
    ModalCart = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-cart',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/cart/cart.html"*/'<ion-header>\n  <ion-navbar>\n	<ion-buttons start>\n	</ion-buttons>\n    <ion-title>CARRITO</ion-title>\n    <ion-buttons end>\n      <button class="search-top" ion-button icon-only (tap)="closeCart()">\n        <ion-icon ios="ios-close" md="ios-close"></ion-icon>\n      </button>\n    </ion-buttons>\n  </ion-navbar>\n</ion-header>\n\n<ion-content>\n\n  <ion-card *ngIf="cartFull?.items.length == 0">\n    <ion-card-header class="no-items">\n      <img src="assets/img/icon.route.png" />\n      <br /> Tu carrito está vacío\n      <br />\n    </ion-card-header>\n  </ion-card>\n\n  <div class="itemlisting" *ngFor="let item of cartFull?.items; let i = index;">\n	<ion-grid>\n		<ion-row class="item-row">\n			<ion-col col-2>\n				<div class="item-image" [ngStyle]="{\'background-image\': \'url(\'+(item.image == \'\' ? \'assets/img/default/no-pictures.png\' : item.image)+\')\'}"></div>\n			</ion-col>\n			<ion-col col-3 class="item-name">{{item.name}}</ion-col>\n			<ion-col col-3 class="item-number">\n				<table>\n					<tr>\n						<td *ngIf="item.type_sale != \'FLOR\'"><button class="item-number-remove" (tap)="remove(i)">-</button></td>\n						<td>\n              <input type="number" [(ngModel)]="item.qty" class="item-number-number" />\n              <div *ngIf="item.type_sale == \'FLOR\'">gramos</div>\n						</td>\n						<td *ngIf="item.type_sale != \'FLOR\'"><button class="item-number-add" (tap)="add(i)">+</button></td>\n					</tr>\n				</table>\n			</ion-col>\n			<ion-col col-3 class="item-price">\n				<!--$ {{item.price | number }} (<span *ngIf="item.type_sale == \'FLOR\'">gr</span><span *ngIf="item.type_sale != \'FLOR\'">unid</span>)<br />-->\n				<strong>$ {{item.total | number}}</strong>\n			</ion-col>\n			<ion-col col-1 class="item-button">\n				<button ion-button icon-only (tap)="delete(i)">\n					<ion-icon name="trash"></ion-icon>\n				</button>\n			</ion-col>\n		</ion-row>\n	</ion-grid>\n  </div>\n  <!--\n  <div *ngIf="categorys.length > 0" class="itemlisting">\n    <h1>Subcategorias</h1>\n    <ion-slides spaceBetween="20" slidesPerView="1.2">\n      <ion-slide (click)="navcategory(cat)" *ngFor="let cat of categorys" [ngStyle]="{\'background-image\': \'url(\'+(cat.banner == \'\' ? \'assets/img/default/no-pictures.png\' : cat.banner)+\')\'}">\n        <div class="category-category">\n          <div class="category-category-name">{{cat.name}}</div>\n        </div>\n      </ion-slide>\n    </ion-slides>\n  </div>\n  -->\n\n</ion-content>\n<ion-footer>\n  <ion-navbar>\n	<ion-title>$ {{cartTotal() | number}} <span>+ envío</span></ion-title>\n    <ion-buttons end>\n      <button class="make-buy" ion-button round outline (tap)="checkout()" *ngIf="cartFull?.items.length > 0">\n        Hacer el pedido\n      </button>\n    </ion-buttons>\n  </ion-navbar>\n</ion-footer>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/cart/cart.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* AlertController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */], __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */]])
    ], ModalCart);
    return ModalCart;
}());

//# sourceMappingURL=cart.js.map

/***/ }),

/***/ 881:
/***/ (function(module, exports, __webpack_require__) {

var map = {
	"./af": 391,
	"./af.js": 391,
	"./ar": 392,
	"./ar-dz": 393,
	"./ar-dz.js": 393,
	"./ar-kw": 394,
	"./ar-kw.js": 394,
	"./ar-ly": 395,
	"./ar-ly.js": 395,
	"./ar-ma": 396,
	"./ar-ma.js": 396,
	"./ar-sa": 397,
	"./ar-sa.js": 397,
	"./ar-tn": 398,
	"./ar-tn.js": 398,
	"./ar.js": 392,
	"./az": 399,
	"./az.js": 399,
	"./be": 400,
	"./be.js": 400,
	"./bg": 401,
	"./bg.js": 401,
	"./bm": 402,
	"./bm.js": 402,
	"./bn": 403,
	"./bn.js": 403,
	"./bo": 404,
	"./bo.js": 404,
	"./br": 405,
	"./br.js": 405,
	"./bs": 406,
	"./bs.js": 406,
	"./ca": 407,
	"./ca.js": 407,
	"./cs": 408,
	"./cs.js": 408,
	"./cv": 409,
	"./cv.js": 409,
	"./cy": 410,
	"./cy.js": 410,
	"./da": 411,
	"./da.js": 411,
	"./de": 412,
	"./de-at": 413,
	"./de-at.js": 413,
	"./de-ch": 414,
	"./de-ch.js": 414,
	"./de.js": 412,
	"./dv": 415,
	"./dv.js": 415,
	"./el": 416,
	"./el.js": 416,
	"./en-au": 417,
	"./en-au.js": 417,
	"./en-ca": 418,
	"./en-ca.js": 418,
	"./en-gb": 419,
	"./en-gb.js": 419,
	"./en-ie": 420,
	"./en-ie.js": 420,
	"./en-il": 421,
	"./en-il.js": 421,
	"./en-nz": 422,
	"./en-nz.js": 422,
	"./eo": 423,
	"./eo.js": 423,
	"./es": 424,
	"./es-do": 425,
	"./es-do.js": 425,
	"./es-us": 426,
	"./es-us.js": 426,
	"./es.js": 424,
	"./et": 427,
	"./et.js": 427,
	"./eu": 428,
	"./eu.js": 428,
	"./fa": 429,
	"./fa.js": 429,
	"./fi": 430,
	"./fi.js": 430,
	"./fo": 431,
	"./fo.js": 431,
	"./fr": 432,
	"./fr-ca": 433,
	"./fr-ca.js": 433,
	"./fr-ch": 434,
	"./fr-ch.js": 434,
	"./fr.js": 432,
	"./fy": 435,
	"./fy.js": 435,
	"./gd": 436,
	"./gd.js": 436,
	"./gl": 437,
	"./gl.js": 437,
	"./gom-latn": 438,
	"./gom-latn.js": 438,
	"./gu": 439,
	"./gu.js": 439,
	"./he": 440,
	"./he.js": 440,
	"./hi": 441,
	"./hi.js": 441,
	"./hr": 442,
	"./hr.js": 442,
	"./hu": 443,
	"./hu.js": 443,
	"./hy-am": 444,
	"./hy-am.js": 444,
	"./id": 445,
	"./id.js": 445,
	"./is": 446,
	"./is.js": 446,
	"./it": 447,
	"./it.js": 447,
	"./ja": 448,
	"./ja.js": 448,
	"./jv": 449,
	"./jv.js": 449,
	"./ka": 450,
	"./ka.js": 450,
	"./kk": 451,
	"./kk.js": 451,
	"./km": 452,
	"./km.js": 452,
	"./kn": 453,
	"./kn.js": 453,
	"./ko": 454,
	"./ko.js": 454,
	"./ku": 455,
	"./ku.js": 455,
	"./ky": 456,
	"./ky.js": 456,
	"./lb": 457,
	"./lb.js": 457,
	"./lo": 458,
	"./lo.js": 458,
	"./lt": 459,
	"./lt.js": 459,
	"./lv": 460,
	"./lv.js": 460,
	"./me": 461,
	"./me.js": 461,
	"./mi": 462,
	"./mi.js": 462,
	"./mk": 463,
	"./mk.js": 463,
	"./ml": 464,
	"./ml.js": 464,
	"./mn": 465,
	"./mn.js": 465,
	"./mr": 466,
	"./mr.js": 466,
	"./ms": 467,
	"./ms-my": 468,
	"./ms-my.js": 468,
	"./ms.js": 467,
	"./mt": 469,
	"./mt.js": 469,
	"./my": 470,
	"./my.js": 470,
	"./nb": 471,
	"./nb.js": 471,
	"./ne": 472,
	"./ne.js": 472,
	"./nl": 473,
	"./nl-be": 474,
	"./nl-be.js": 474,
	"./nl.js": 473,
	"./nn": 475,
	"./nn.js": 475,
	"./pa-in": 476,
	"./pa-in.js": 476,
	"./pl": 477,
	"./pl.js": 477,
	"./pt": 478,
	"./pt-br": 479,
	"./pt-br.js": 479,
	"./pt.js": 478,
	"./ro": 480,
	"./ro.js": 480,
	"./ru": 481,
	"./ru.js": 481,
	"./sd": 482,
	"./sd.js": 482,
	"./se": 483,
	"./se.js": 483,
	"./si": 484,
	"./si.js": 484,
	"./sk": 485,
	"./sk.js": 485,
	"./sl": 486,
	"./sl.js": 486,
	"./sq": 487,
	"./sq.js": 487,
	"./sr": 488,
	"./sr-cyrl": 489,
	"./sr-cyrl.js": 489,
	"./sr.js": 488,
	"./ss": 490,
	"./ss.js": 490,
	"./sv": 491,
	"./sv.js": 491,
	"./sw": 492,
	"./sw.js": 492,
	"./ta": 493,
	"./ta.js": 493,
	"./te": 494,
	"./te.js": 494,
	"./tet": 495,
	"./tet.js": 495,
	"./tg": 496,
	"./tg.js": 496,
	"./th": 497,
	"./th.js": 497,
	"./tl-ph": 498,
	"./tl-ph.js": 498,
	"./tlh": 499,
	"./tlh.js": 499,
	"./tr": 500,
	"./tr.js": 500,
	"./tzl": 501,
	"./tzl.js": 501,
	"./tzm": 502,
	"./tzm-latn": 503,
	"./tzm-latn.js": 503,
	"./tzm.js": 502,
	"./ug-cn": 504,
	"./ug-cn.js": 504,
	"./uk": 505,
	"./uk.js": 505,
	"./ur": 506,
	"./ur.js": 506,
	"./uz": 507,
	"./uz-latn": 508,
	"./uz-latn.js": 508,
	"./uz.js": 507,
	"./vi": 509,
	"./vi.js": 509,
	"./x-pseudo": 510,
	"./x-pseudo.js": 510,
	"./yo": 511,
	"./yo.js": 511,
	"./zh-cn": 512,
	"./zh-cn.js": 512,
	"./zh-hk": 513,
	"./zh-hk.js": 513,
	"./zh-tw": 514,
	"./zh-tw.js": 514
};
function webpackContext(req) {
	return __webpack_require__(webpackContextResolve(req));
};
function webpackContextResolve(req) {
	var id = map[req];
	if(!(id + 1)) // check for number or string
		throw new Error("Cannot find module '" + req + "'.");
	return id;
};
webpackContext.keys = function webpackContextKeys() {
	return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = 881;

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalvalorizacionPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_doctor_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ionic_storage__ = __webpack_require__(15);
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 ModalvalorizacionPage = /** @class */ (function () {
    // edita: any;
    function ModalvalorizacionPage(navCtrl, service, viewCtrl, docService, loadingCtrl, navParams, storage) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.service = service;
        this.viewCtrl = viewCtrl;
        this.docService = docService;
        this.loadingCtrl = loadingCtrl;
        this.navParams = navParams;
        this.storage = storage;
        this.range = [];
        this.starMin = 0;
        this.starMin2 = 0;
        this.starMin3 = 0;
        this.storage.get("active").then(function (active) {
            console.log(active["profile_id"]);
            _this.profileActive = active["profile_id"];
        });
        this.serviceID = this.navParams.get('id');
        var edita = this.navParams.get('editable');
        this.data = this.navParams.get('data');
        if (edita) {
            this.editable = true;
        }
        else {
            this.editable = false;
        }
    }
    ModalvalorizacionPage.prototype.dismiss = function () {
        this.viewCtrl.dismiss();
    };
    ModalvalorizacionPage.prototype.onModelChange = function (ev, id) {
        console.log('evento ', ev, 'id ' + id);
        var data = { 'star': ev, 'id': id };
        var range = this.range;
        for (var i = 0; i < range.length; i++) {
            if (range[i]["id"] == id) {
                this.range[i]["id"] = "no";
            }
        }
        this.range.push(data);
    };
    // saveRating() {
    //   let newArray = [];
    //   for (let i = 0; i < this.range.length; i++) {
    //     if (this.range[i]["id"] != "no") {
    //       newArray.push(this.range[i]);
    //     }
    //   }
    //   console.log(newArray);
    //   // this.service.showMsg("Rating Enviado (No conectado)");
    // }
    ModalvalorizacionPage.prototype.ratingRate = function (rate) {
        this.rate = rate;
    };
    ModalvalorizacionPage.prototype.ratingRate2 = function (rate) {
        this.rate2 = rate;
    };
    ModalvalorizacionPage.prototype.ratingRate3 = function (rate) {
        this.rate3 = rate;
    };
    ModalvalorizacionPage.prototype.sendRate = function () {
        var _this = this;
        var param = {
            "service_id": this.serviceID,
            "comments": this.comentario,
            "rate": this.rate,
            "rate2": this.rate2,
            "rate3": this.rate3
        };
        console.log(param);
        var loading = this.loadingCtrl.create();
        loading.present();
        this.docService.sendRate(param).subscribe(function (data) {
            loading.dismiss();
            _this.dismiss();
            _this.service.showMsg(data["msg"]);
        }, function (err) {
            loading.dismiss();
            console.error(err);
            _this.service.showMsg("Algo ocurrio");
        });
    };
    ModalvalorizacionPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-modalvalorizacion',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/modalvalorizacion/modalvalorizacion.html"*/'<ion-content padding class="main-view">\n  <div class="overlay" (click)="dismiss()"></div>\n  <div class="modal_content" align="center">\n    <h2 align="center">Valorización</h2>\n    <div *ngIf="editable==false">\n        <div *ngIf="profileActive==\'2\'">\n\n            <label>¿El camión cumplía con las especificaciones ofertadas?</label>\n            <rating readOnly="true" max="5" [(ngModel)]="data.rate1" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n              nullable="false">\n            </rating>\n            <label>¿El camión llego a tiempo a retirar?</label>\n            <rating readOnly="true" max="5" [(ngModel)]="data.rate2" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n              nullable="false">\n            </rating>\n            <label>¿La carga llegó a destino en buenas condiciones?</label>\n            <rating readOnly="true" max="5" [(ngModel)]="data.rate3" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n              nullable="false">\n            </rating>\n        </div>\n        <div *ngIf="profileActive==\'3\'">\n          <label>¿El tiempo de espera para retirar la carga fue el adecuado?</label>\n          <rating readOnly="true" max="5" [(ngModel)]="data.rate1" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n            nullable="false">\n          </rating>\n          <label>¿El tiempo de espera para entregar la carga fue el adecuado?</label>\n          <rating readOnly="true" max="5" [(ngModel)]="data.rate2" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n            nullable="false">\n          </rating>\n          <label>¿En general, el requerimiento estaba acorde a la realidad?</label>\n          <rating readOnly="true" max="5" [(ngModel)]="data.rate3" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n            nullable="false">\n          </rating>\n        </div> \n              \n        <ion-label class="fontQuestion">\n            Comentario:\n          </ion-label>\n                <textarea stacked [(ngModel)]="data.comments" type="text" disabled></textarea>\n        \n    </div>\n    <div *ngIf="editable==true">\n    <div padding>\n      <div *ngIf="profileActive==\'2\'">\n          <label>¿El tiempo de espera para retirar la carga fue el adecuado?</label>\n          <rating readOnly="false" max="5" [(ngModel)]="starMin" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n            nullable="false" (ngModelChange)="ratingRate($event)">\n          </rating>\n          <label>¿El tiempo de espera para entregar la carga fue el adecuado?</label>\n          <rating readOnly="false" max="5" [(ngModel)]="starMin2" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n            nullable="false" (ngModelChange)="ratingRate2($event)">\n          </rating>\n          <label>¿En general, el requerimiento estaba acorde a la realidad?</label>\n          <rating readOnly="false" max="5" [(ngModel)]="starMin3" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n            nullable="false" (ngModelChange)="ratingRate3($event)">\n          </rating>\n      </div>\n      <div *ngIf="profileActive==\'3\'">\n          <label>¿El camión cumplía con las especificaciones ofertadas?</label>\n          <rating readOnly="false" max="5" [(ngModel)]="starMin" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n            nullable="false" (ngModelChange)="ratingRate($event)">\n          </rating>\n          <label>¿El camión llego a tiempo a retirar?</label>\n          <rating readOnly="false" max="5" [(ngModel)]="starMin2" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n            nullable="false" (ngModelChange)="ratingRate2($event)">\n          </rating>\n          <label>¿la carga llegó a destino en buenas condiciones?</label>\n          <rating readOnly="false" max="5" [(ngModel)]="starMin3" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n            nullable="false" (ngModelChange)="ratingRate3($event)">\n          </rating>\n      </div> \n            \n      <ion-label class="fontQuestion">\n          Envía tu comentario:\n        </ion-label>\n              <textarea stacked [(ngModel)]="comentario" type="text" placeholder="Comentario"></textarea>\n        <button ion-button class="buttonPinkOrange" (tap)="sendRate()">Enviar</button>\n      </div>\n\n    </div>\n\n  </div>\n\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/modalvalorizacion/modalvalorizacion.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_2__pata__["a" /* Pata */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */],
            __WEBPACK_IMPORTED_MODULE_3__services_doctor_service__["a" /* DoctorService */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_4__ionic_storage__["b" /* Storage */]])
    ], ModalvalorizacionPage);
    return ModalvalorizacionPage;
}());

//# sourceMappingURL=modalvalorizacion.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MyApp; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__providers_splitpane_splitpane__ = __webpack_require__(527);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_status_bar__ = __webpack_require__(193);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ionic_native_splash_screen__ = __webpack_require__(528);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ngx_translate_core__ = __webpack_require__(181);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ionic_native_insomnia__ = __webpack_require__(529);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__pages_profile_profile__ = __webpack_require__(530);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__pages_login_login__ = __webpack_require__(110);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__pages_home_home__ = __webpack_require__(109);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__pages_onboarding_onboarding__ = __webpack_require__(546);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__pages_farmacia_farmacia__ = __webpack_require__(196);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__pages_ayuda_ayuda__ = __webpack_require__(547);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__services_user_service__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__services_auth_service__ = __webpack_require__(42);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__ionic_native_fcm__ = __webpack_require__(526);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__environments_environment__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__ionic_native_market__ = __webpack_require__(548);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__pages_historial_historial__ = __webpack_require__(549);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__pages_pagos_pagos__ = __webpack_require__(550);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__pages_pedidos_pedidos__ = __webpack_require__(552);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__pages_receta_receta__ = __webpack_require__(198);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__modals_cart_cart__ = __webpack_require__(79);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__modals_modal_detalles_modal_detalles__ = __webpack_require__(120);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__modals_checkout_checkout__ = __webpack_require__(200);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__providers_tracking_tracking__ = __webpack_require__(194);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__ionic_native_in_app_browser__ = __webpack_require__(78);
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);
};














//import { MimaskotUser } from '../models/mimaskot-user.model';















var MyApp = /** @class */ (function () {
    function MyApp(platform, statusBar, splashScreen, translate, config, storage, app, ionicApp, service, alertCtrl, userService, loadingController, authService, fcm, split, locationTracker, menu, insomnia, iab, market) {
        this.platform = platform;
        this.statusBar = statusBar;
        this.splashScreen = splashScreen;
        this.translate = translate;
        this.config = config;
        this.storage = storage;
        this.app = app;
        this.ionicApp = ionicApp;
        this.service = service;
        this.alertCtrl = alertCtrl;
        this.userService = userService;
        this.loadingController = loadingController;
        this.authService = authService;
        this.fcm = fcm;
        this.split = split;
        this.locationTracker = locationTracker;
        this.menu = menu;
        this.insomnia = insomnia;
        this.iab = iab;
        this.market = market;
        this.rootPage = null;
        this.appInvite = true;
        this.storeName = "";
        /*active: any;*/
        this.zones = [];
        this.iam = { lat: 0, lng: 0 };
        this.success = false;
        this.initializeApp();
    }
    MyApp.prototype.initializeApp = function () {
        var _this = this;
        this.platform.ready().then(function () {
            console.log("plataforma ready");
            // Okay, so the platform is ready and our plugins are available.
            // Here you can do any higher level native things you might need.
            _this.staticUrl = __WEBPACK_IMPORTED_MODULE_18__environments_environment__["a" /* environment */].staticUrl;
            _this.appInvite = _this.service.appInvite;
            _this.iam.lat = _this.locationTracker.UbicacionLat();
            _this.iam.lng = _this.locationTracker.UbicacionLng();
            _this.authService.version(__WEBPACK_IMPORTED_MODULE_18__environments_environment__["a" /* environment */].version).subscribe(function (data) {
                if (data.res == "ERR") {
                    var alert_1 = _this.alertCtrl.create({
                        title: 'Actualiza MY',
                        message: data.msg,
                        buttons: [
                            {
                                text: 'Ir a actualizar',
                                handler: function () {
                                    if (_this.platform.is('ios')) {
                                        _this.market.open('1451771784');
                                        _this.platform.exitApp();
                                    }
                                    else if (_this.platform.is('android')) {
                                        //this.market.open('cl.myoda.app');
                                        _this.iab.create("https://www.yodalife.cl", "_system");
                                    }
                                    return false;
                                }
                            }
                        ],
                        enableBackdropDismiss: false
                    });
                    alert_1.present();
                }
            });
            _this.userService.changeAvatar.subscribe(function (st) {
                console.log(st);
                _this.user.avatar = st;
            });
            Date.prototype.toISOString = function () {
                var tzo = -this.getTimezoneOffset(), dif = tzo >= 0 ? '+' : '-', pad = function (num) {
                    var norm = Math.floor(Math.abs(num));
                    return (norm < 10 ? '0' : '') + norm;
                };
                return this.getFullYear() +
                    '-' + pad(this.getMonth() + 1) +
                    '-' + pad(this.getDate()) +
                    'T' + pad(this.getHours()) +
                    ':' + pad(this.getMinutes()) +
                    ':' + pad(this.getSeconds()) +
                    dif + pad(tzo / 60) +
                    ':' + pad(tzo % 60);
            };
            setTimeout(function () {
                _this.splashScreen.hide();
            }, 0);
            setTimeout(function () {
                if (_this.success == false) {
                    _this.welcomeApp();
                }
            }, 4000);
            _this.service.startApp.subscribe(function (start) {
                _this.appInvite = _this.service.appInvite;
                _this.success = true;
                console.log('this.appInvite: ' + _this.appInvite);
                _this.welcomeApp();
            });
            _this.service.launch();
            if (_this.platform.is('ios')) {
                _this.statusBar.overlaysWebView(true);
                _this.statusBar.styleBlackOpaque();
                _this.statusBar.styleLightContent();
            }
            else if (_this.platform.is('android')) {
                _this.statusBar.hide();
            }
            if (_this.platform.is('cordova')) {
                _this.platform.registerBackButtonAction(function () {
                    var nav = _this.app.getActiveNav();
                    var view = nav.getActive().instance.pageName;
                    if (view == __WEBPACK_IMPORTED_MODULE_24__modals_cart_cart__["a" /* ModalCart */] || view == __WEBPACK_IMPORTED_MODULE_25__modals_modal_detalles_modal_detalles__["a" /* ModalDetallesPage */] || view == __WEBPACK_IMPORTED_MODULE_26__modals_checkout_checkout__["a" /* ModalCheckout */]) {
                        var activeModal = _this.ionicApp._modalPortal.getActive();
                        activeModal.dismiss();
                        return;
                    }
                    else {
                        if (_this.menu.isOpen()) {
                            _this.menu.close();
                            return;
                        }
                        else if (_this.nav.canGoBack()) {
                            _this.nav.pop();
                            return;
                        }
                        else {
                            _this.platform.exitApp();
                        }
                    }
                });
                if (_this.platform.is('android') || _this.platform.is('ios')) {
                    _this.fcm.getToken().then(function (token) {
                        //alert('push:'+ token);
                        _this.userService.setPush(token);
                        _this.authService.setPush(token);
                    });
                    _this.fcm.onNotification().subscribe(function (data) {
                        console.log('onNotification');
                        console.log(data);
                        //alert('Push:' + JSON.stringify(data));
                        if (data.wasTapped) {
                            console.log("Received in background", data);
                        }
                        else {
                            console.log("Received in foreground", data);
                        }
                        ;
                    });
                    _this.fcm.onTokenRefresh().subscribe(function (token) {
                        //alert('push:'+ token);
                        _this.userService.setPush(token);
                        _this.authService.setPush(token);
                    });
                }
            }
            _this.authService.loginOk.subscribe(function (data) {
                console.log('loginOk subscribe');
                if (data.res == "OK") {
                    if (data.profile.avatar == null || data.profile.avatar == "") {
                        data.profile.avatar = "assets/img/default/avatar.png";
                    }
                    _this.user = data.profile;
                    //this.active = data.profile.types[0];
                    //this.storage.set("active", this.active);
                    _this.reloadSide();
                    _this.authService.sendPushToServer(_this.user.id);
                }
            });
            /*
            Translate
            this.pages.forEach((page) => {
              this.translate.get(page.titleTranslationKey).subscribe((translation) => {
                page.title = translation;
              })
            });
            */
        });
    };
    MyApp.prototype.welcomeApp = function () {
        var _this = this;
        console.log('welcomeApp');
        this.insomnia.allowSleepAgain().then(function () { return console.log('success'); }, function () { return console.log('insomnia error'); });
        this.storage.get("MP-FirstTime").then(function (val) {
            if (val == true) {
                _this.storage.get("token").then(function (token) {
                    localStorage.setItem('token', token);
                    if (token) {
                        _this.startUser();
                    }
                    else {
                        _this.startLogin('err => firstitme => get token => ok => else');
                    }
                }, function (err) { _this.startLogin('err => firstitme => get token => err'); });
            }
            else {
                if (_this.appInvite) {
                    /* appInvite never first time ! */
                    _this.storage.get("token").then(function (token) {
                        if (token) {
                            _this.startUser();
                        }
                        else {
                            _this.startLogin('MP-firsttime => else -> appinvite -> ok -> else');
                        }
                    }, function () { _this.startLogin('err MP-FirstTime => else -> appinvite -> err'); });
                }
                else {
                    _this.rootPage = __WEBPACK_IMPORTED_MODULE_11__pages_onboarding_onboarding__["a" /* OnboardingPage */];
                    _this.loadingHidden();
                }
            }
        }, function (err) {
            console.log('err MP-FirstTime, get token (email mode)');
            _this.storage.get("token").then(function (token) {
                if (token) {
                    _this.startUser();
                }
                else {
                    _this.startLogin('err MP-firsttime => OK => else');
                }
            }, function () { _this.startLogin('err MP-FirstTime => err'); });
        });
    };
    MyApp.prototype.startLogin = function (str) {
        console.log(str);
        this.rootPage = __WEBPACK_IMPORTED_MODULE_9__pages_login_login__["a" /* LoginPage */];
        this.loadingHidden();
    };
    MyApp.prototype.startUser = function () {
        var _this = this;
        this.userService.getProfile().subscribe(function (result) {
            _this.user = result;
            _this.userService.getId(result.id).subscribe(function (ok) {
                if (ok.res == "ERR") {
                    console.log('ERR: userService: getProfile : getId : Backend ERR');
                    _this.rootPage = __WEBPACK_IMPORTED_MODULE_9__pages_login_login__["a" /* LoginPage */];
                    _this.loadingHidden();
                }
                else {
                    _this.user = ok.data;
                    if (_this.user.avatar == null || _this.user.avatar == "") {
                        _this.user.avatar = "assets/img/default/avatar.png";
                    }
                    if (_this.user.level == "1") {
                        _this.rootPage = __WEBPACK_IMPORTED_MODULE_12__pages_farmacia_farmacia__["a" /* FarmaciaPage */];
                    }
                    else if (_this.user.level == "5") {
                        _this.rootPage = __WEBPACK_IMPORTED_MODULE_10__pages_home_home__["a" /* HomePage */];
                    }
                    _this.reloadSide();
                    _this.userService.sendPushToServer();
                    _this.loadingHidden();
                }
            }, function (err) {
                _this.service.logError(null, "No fue posible recuperar tu perfil. Por favor accede nuevamente.");
                console.log('ERR: userService: getProfile : getId');
                _this.rootPage = __WEBPACK_IMPORTED_MODULE_9__pages_login_login__["a" /* LoginPage */];
                _this.loadingHidden();
            });
        }, function (err) {
            console.log('ERR: userService: getProfile');
            _this.rootPage = __WEBPACK_IMPORTED_MODULE_9__pages_login_login__["a" /* LoginPage */];
            _this.loadingHidden();
        });
    };
    MyApp.prototype.switchActive = function (zone) {
        console.log("switch zone: ", zone);
    };
    MyApp.prototype.loadingHidden = function () {
        setTimeout(function () {
            document.getElementById("loader-spinner").classList.add("animated-start");
            document.getElementById("logo-loader").classList.add("animated");
            document.getElementById("logo-loader").classList.add("bounceOut");
            setTimeout(function () {
                document.getElementById("custom-overlay").style.display = "none";
            }, 1200);
        }, 500);
    };
    MyApp.prototype.profile = function () {
        if (this.menu.isOpen()) {
            this.menu.close();
        }
        if (this.user.id == '0') {
            var alert_2 = this.alertCtrl.create({
                title: 'Usuario no registrado',
                message: 'Sólo los usuarios registrados pueden tener un perfil',
                buttons: [
                    {
                        text: 'Aceptar',
                        role: 'cancel',
                        handler: function () { }
                    }
                ]
            });
            alert_2.present();
        }
        else {
            this.nav.setRoot(__WEBPACK_IMPORTED_MODULE_8__pages_profile_profile__["a" /* Profile */]);
        }
    };
    MyApp.prototype.reloadSide = function () {
        console.log('reloadSide');
        this.storeName = this.service.storeName;
        this.pages = [];
        if (this.user.level == "1") {
            this.pages.push({ title: this.storeName, component: __WEBPACK_IMPORTED_MODULE_12__pages_farmacia_farmacia__["a" /* FarmaciaPage */], selected: true, inviteOff: false });
            this.pages.push({ title: 'Mis pedidos', component: __WEBPACK_IMPORTED_MODULE_22__pages_pedidos_pedidos__["a" /* PedidosPage */], selected: false, inviteOff: false });
            this.pages.push({ title: 'Mis recetas', component: __WEBPACK_IMPORTED_MODULE_23__pages_receta_receta__["a" /* RecetaPage */], selected: true, inviteOff: true });
            this.pages.push({ title: 'Tarjetas y Saldos', component: __WEBPACK_IMPORTED_MODULE_21__pages_pagos_pagos__["a" /* PagosPage */], selected: false, inviteOff: false });
            this.pages.push({ title: 'Historial', component: __WEBPACK_IMPORTED_MODULE_20__pages_historial_historial__["a" /* HistorialPage */], selected: false, inviteOff: false });
            this.pages.push({ title: 'Ayuda', component: __WEBPACK_IMPORTED_MODULE_13__pages_ayuda_ayuda__["a" /* AyudaPage */], selected: false, inviteOff: false });
        }
        else if (this.user.level == "5") {
            this.pages.push({ title: 'Repartos', component: __WEBPACK_IMPORTED_MODULE_10__pages_home_home__["a" /* HomePage */], selected: true, inviteOff: false });
            /*
            
            this.pages.push({ title: 'Mis requerimientos', component: RequerimientosPage, selected: false });
            this.pages.push({ title: 'Mis servicios', component: ServiciosPage, selected: false });
            this.pages.push({ title: 'Mis valoraciones', component: ValorizacionPage, selected: false });
            this.pages.push({ title: 'Noticias', component: NoticiasPage, selected: false });
            this.pages.push({ title: 'Ayuda', component: AyudaPage, selected: false });
            */
        }
        this.zones = [];
        /*
        if (this.user.types.length > 1) {
          for (let i=0; i < this.user.types.length ; i++) {
            if (this.user.types[i].profile_id != this.active.profile_id ) {
              this.zones.push(this.user.types[i]);
            }
          }
        }
        */
    };
    MyApp.prototype.openPage = function (page) {
        if (this.menu.isOpen()) {
            this.menu.close();
        }
        this.nav.setRoot(page.component);
    };
    MyApp.prototype.closeSession = function () {
        var _this = this;
        if (this.menu.isOpen()) {
            this.menu.close();
        }
        var alert = this.alertCtrl.create({
            title: 'Hasta pronto',
            message: '¿Quieres volver al login?',
            buttons: [
                {
                    text: 'Cancelar',
                    role: 'cancel',
                    handler: function () { }
                },
                {
                    text: 'Confirmar',
                    handler: function () {
                        _this.storage.remove("token");
                        _this.storage.remove("MP-Profile");
                        localStorage.removeItem('token');
                        _this.storage.remove("active");
                        _this.nav.setRoot(__WEBPACK_IMPORTED_MODULE_9__pages_login_login__["a" /* LoginPage */]);
                    }
                }
            ]
        });
        alert.present();
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["ViewChild"])(__WEBPACK_IMPORTED_MODULE_2_ionic_angular__["k" /* Nav */]),
        __metadata("design:type", __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["k" /* Nav */])
    ], MyApp.prototype, "nav", void 0);
    MyApp = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["Component"])({template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/app/app.html"*/'<ion-split-pane [when]="split.getSplitPane()" class="split">\n\n  <ion-menu swipeEnabled="false" [content]="content" id="leftMenu" class="sidenav">\n    <br><br>\n    <div class="profile" *ngIf="user">\n      <div class="image" [style.background-image]="\'url(\' + user.avatar + \')\'" style="background-size: cover"></div>\n      <div class="name">{{ user.first_name }} {{ user.last_name }} {{ user.company }}</div>\n      <div class="scope" *ngIf="active">{{ active.name }} </div>\n      <button (tap)="profile()" ion-button round color="light">MI PERFIL</button>\n    </div>\n\n    <div *ngFor="let p of pages" [hidden]="appInvite && p.inviteOff" class="link" [ngClass]="{\'selected\' : p.selected}" (tap)="openPage(p)">\n      <span>{{p.title}}</span>\n    </div>\n\n    <div class="link" [ngClass]="{\'selected\' : selected}" (tap)="closeSession()">\n      <span>Salir</span>\n    </div>\n\n    <div class="side-logo" style="text-align: left; padding: 20px; padding-top:0;">\n      <hr />\n      <img src="assets/img/logo-my.png" />\n      <h1>Master Yoda<br />Derechos reservados<br />&copy; Chile</h1>\n    </div>\n\n  </ion-menu>\n\n  <!-- Disable swipe-to-go-back because it\'s poor UX to combine STGB with side menus -->\n  <ion-nav [root]="rootPage" main #content swipeBackEnabled="false"></ion-nav>\n\n</ion-split-pane>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/app/app.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ionic_angular__["n" /* Platform */],
            __WEBPACK_IMPORTED_MODULE_3__ionic_native_status_bar__["a" /* StatusBar */],
            __WEBPACK_IMPORTED_MODULE_4__ionic_native_splash_screen__["a" /* SplashScreen */],
            __WEBPACK_IMPORTED_MODULE_5__ngx_translate_core__["c" /* TranslateService */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["d" /* Config */],
            __WEBPACK_IMPORTED_MODULE_6__ionic_storage__["b" /* Storage */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["c" /* App */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["e" /* IonicApp */],
            __WEBPACK_IMPORTED_MODULE_16__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["b" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_14__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_15__services_auth_service__["a" /* AuthService */],
            __WEBPACK_IMPORTED_MODULE_17__ionic_native_fcm__["a" /* FCM */],
            __WEBPACK_IMPORTED_MODULE_0__providers_splitpane_splitpane__["a" /* SplitpaneProvider */],
            __WEBPACK_IMPORTED_MODULE_27__providers_tracking_tracking__["a" /* TrackingProvider */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["i" /* MenuController */],
            __WEBPACK_IMPORTED_MODULE_7__ionic_native_insomnia__["a" /* Insomnia */],
            __WEBPACK_IMPORTED_MODULE_28__ionic_native_in_app_browser__["a" /* InAppBrowser */],
            __WEBPACK_IMPORTED_MODULE_19__ionic_native_market__["a" /* Market */]])
    ], MyApp);
    return MyApp;
}());

//# sourceMappingURL=app.component.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NoticiasPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_pet_service__ = __webpack_require__(114);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_news_service__ = __webpack_require__(113);
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 NoticiasPage = /** @class */ (function () {
    function NoticiasPage(navCtrl, petService, newsService) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.petService = petService;
        this.newsService = newsService;
        this.pets = [];
        this.news = [];
        this.pageNews = 1;
        this.perPegeNews = 3;
        this.newsService.geList(this.pageNews, this.perPegeNews).subscribe(function (news) {
            _this.pageNews++;
            _this.news = news;
        }, function (error) {
            console.log(error);
        });
    }
    NoticiasPage.prototype.doRefresh = function (refresher) {
        var _this = this;
        this.pageNews = 1;
        this.newsService.geList(this.pageNews, this.perPegeNews).subscribe(function (news) {
            _this.pageNews++;
            _this.news = news;
            refresher.complete();
        }, function (error) {
            console.log(error);
            refresher.complete();
        });
    };
    NoticiasPage.prototype.doInfinite = function (infiniteScroll) {
        var _this = this;
        console.log('doInfinite...');
        this.newsService.geList(this.pageNews, this.perPegeNews).subscribe(function (news) {
            _this.pageNews++;
            news.forEach(function (value) {
                _this.news.push(value);
            });
            infiniteScroll.complete();
        }, function (error) {
            console.log(error);
            infiniteScroll.complete();
        });
    };
    NoticiasPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-noticias',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/noticias/noticias.html"*/'<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>NOTICIAS Y NOVEDADES</ion-title>\n  </ion-navbar>\n</ion-header>\n\n<ion-content>\n  <ion-refresher (ionRefresh)="doRefresh($event)">\n    <ion-refresher-content></ion-refresher-content>\n  </ion-refresher>\n\n  <div class="subTitle">{{ \'HOME.NEWS\' | translate }}</div>\n  <news-preview *ngFor="let n of news" [news]="n"></news-preview>\n\n	<ion-infinite-scroll (ionInfinite)="doInfinite($event)">\n	<ion-infinite-scroll-content></ion-infinite-scroll-content>\n	</ion-infinite-scroll>\n\n\n</ion-content>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/noticias/noticias.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_2__services_pet_service__["a" /* PetService */],
            __WEBPACK_IMPORTED_MODULE_3__services_news_service__["a" /* NewsService */]])
    ], NoticiasPage);
    return NoticiasPage;
}());

//# sourceMappingURL=noticias.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PetMediaOptionsPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_camera__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_user_service__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__services_pet_service__ = __webpack_require__(114);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__environments_environment__ = __webpack_require__(27);
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 PetMediaOptionsPage = /** @class */ (function () {
    function PetMediaOptionsPage(navCtrl, navParams, viewCtrl, service, userService, petService, loadingCtrl, camera, storage) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.viewCtrl = viewCtrl;
        this.service = service;
        this.userService = userService;
        this.petService = petService;
        this.loadingCtrl = loadingCtrl;
        this.camera = camera;
        this.storage = storage;
        this.imagenIndex = 0;
        this.loading = null;
        this.token = '';
        this.petId = null;
        this.additionalImages = null;
        this.canDelete = false;
        this.canMark = false;
        this.imagenIndex = this.navParams.get("imagenIndex");
        this.additionalImages = this.navParams.get("additionalImages");
        this.petId = this.navParams.get("id");
        if (this.additionalImages != "") {
            this.canMark = true;
            this.canDelete = true;
        }
        this.storage.get("token").then(function (val) {
            _this.token = val;
        });
    }
    PetMediaOptionsPage.prototype.ionViewDidLoad = function () {
    };
    PetMediaOptionsPage.prototype.close = function () {
        this.viewCtrl.dismiss({ reload: false });
    };
    PetMediaOptionsPage.prototype.takePicture = function () {
        var _this = this;
        this.camera.getPicture({
            destinationType: this.camera.DestinationType.DATA_URL,
            targetWidth: 1000,
            targetHeight: 1000,
            correctOrientation: true
        }).then(function (imageData) {
            _this.processTake(imageData);
        }, function (err) {
            console.log(err);
        });
    };
    PetMediaOptionsPage.prototype.openGallery = function () {
        var _this = this;
        var cameraOptions = {
            sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
            destinationType: this.camera.DestinationType.DATA_URL,
            quality: 70,
            targetWidth: 620,
            targetHeight: 620,
            encodingType: this.camera.EncodingType.JPEG,
            correctOrientation: true
        };
        this.camera.getPicture(cameraOptions)
            .then(function (file_uri) { return _this.processTake(file_uri); }, function (err) { return console.log(err); });
    };
    PetMediaOptionsPage.prototype.dataURItoBlob = function (dataURI) {
        var byteString;
        if (dataURI.split(',')[0].indexOf('base64') >= 0)
            byteString = atob(dataURI.split(',')[1]);
        else
            byteString = (dataURI.split(',')[1]);
        var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
        var ia = new Uint8Array(byteString.length);
        for (var i = 0; i < byteString.length; i++) {
            ia[i] = byteString.charCodeAt(i);
        }
        return new Blob([ia], {
            type: mimeString
        });
    };
    PetMediaOptionsPage.prototype.processTake = function (imageData) {
        this.base64Image = "data:image/jpeg;base64," + imageData;
        this.loading = this.loadingCtrl.create({ content: 'subiendo foto...' });
        this.loading.present();
        var self0 = this;
        var blob = this.dataURItoBlob(this.base64Image);
        var objURL = window.URL.createObjectURL(blob);
        var image = new Image();
        image.src = objURL;
        window.URL.revokeObjectURL(objURL);
        var url = window.URL.createObjectURL(blob);
        var formData = new FormData();
        formData.append('avatar', blob, 'avatar.jpg');
        var xhr = new XMLHttpRequest();
        xhr.open("post", __WEBPACK_IMPORTED_MODULE_7__environments_environment__["a" /* environment */].apiUrl + "pets/avatar/" + self0.petId);
        xhr.setRequestHeader("Authorization", "Bearer " + self0.token);
        xhr.onreadystatechange = function () {
            if (xhr.readyState === 4 && xhr.status === 200) {
                var uri = xhr.responseText;
                self0.loading.dismiss();
                if (uri.indexOf('error') > -1) {
                    self0.service.logError({}, 'Error al procesar la solicitud. Inténtelo más tarde.');
                }
                else {
                    self0.service.showOk("Foto agregada con éxito");
                    self0.viewCtrl.dismiss({ reload: true });
                }
            }
        };
        xhr.send(formData);
        /*
        this.b64toBlob(this.base64Image,
        function(blob) {
            var url = window.URL.createObjectURL(blob);
            // do something with url
            var formData = new FormData();
            formData.append('avatar', blob, 'avatar.jpg');
    
            var xhr = new XMLHttpRequest();
            xhr.open("post", environment.apiUrl+"pets/avatar/"+self0.petId);
            xhr.setRequestHeader("Authorization", "Bearer "+self0.token);
    
            xhr.onreadystatechange = function () {
    
              if(xhr.readyState === 4 && xhr.status === 200) {
                var uri = xhr.responseText;
                self0.loading.dismiss();
    
                if (uri.indexOf('error') > -1) {
                  self0.service.logError({}, 'Error al procesar la solicitud. Inténtelo más tarde.');
                }
                else {
                  self0.service.showOk("Foto agregada con éxito");
                  self0.viewCtrl.dismiss({reload:true});
                }
              }
    
    
    
            };
    
            xhr.send(formData);
    
        }, function(error) {
            console.log('error',error);
        });
    
        */
    };
    PetMediaOptionsPage.prototype.b64toBlob = function (b64, onsuccess, onerror) {
        var img = new Image();
        img.onerror = onerror;
        img.onload = function onload() {
            var canvas = document.createElement('canvas');
            canvas.width = img.width;
            canvas.height = img.height;
            var ctx = canvas.getContext('2d');
            ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
            canvas.toBlob(onsuccess);
        };
        img.src = b64;
    };
    PetMediaOptionsPage.prototype.markMain = function (index) {
        var _this = this;
        this.loading = this.loadingCtrl.create({ content: 'guardando...' });
        this.loading.present();
        var ps = this.petService.mainImage(this.petId, index);
        ps.subscribe(function (ok) {
            _this.loading.dismiss();
            _this.service.showOk("Foto marcada como principal");
            _this.viewCtrl.dismiss({ reload: false });
        }, function (error) {
            _this.loading.dismiss();
            _this.service.logError({}, 'Error al procesar la solicitud. Inténtelo más tarde.');
            _this.viewCtrl.dismiss({ reload: false });
        });
    };
    PetMediaOptionsPage.prototype.delete = function (index) {
        var _this = this;
        this.loading = this.loadingCtrl.create({ content: 'guardando...' });
        this.loading.present();
        var ps = this.petService.deleteImage(this.petId, index);
        ps.subscribe(function (ok) {
            _this.loading.dismiss();
            _this.service.showOk("Foto eliminada");
            _this.viewCtrl.dismiss({ reload: true });
        }, function (error) {
            _this.loading.dismiss();
            _this.service.logError({}, 'Error al procesar la solicitud. Inténtelo más tarde.');
            _this.viewCtrl.dismiss({ reload: false });
        });
    };
    PetMediaOptionsPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-pet-media-options',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/popovers/pet-media-options/pet-media-options.html"*/'<ion-list radio-group class="popover-page" style="border-radius: 10px">\n  <div class="close" (tap)="close()">\n    <span class="icon-cerrar"></span>\n  </div>\n  <ion-item (tap)="takePicture()" style="border-radius: 10px 10px 0px 0px;">\n    <ion-label>{{ \'POPOVER_PET_MEDIA_OPTIONS.TAKE_PICTURE\' | translate }}</ion-label>\n    <ion-note item-right>\n      <span class="icon-movil"></span>\n    </ion-note>\n  </ion-item>\n  <ion-item (tap)="openGallery()">\n    <ion-label>{{ \'POPOVER_PET_MEDIA_OPTIONS.CHOOSE_FROM_ALBUM\' | translate }}</ion-label>\n    <ion-note item-right>\n      <span class="icon-album"></span>\n    </ion-note>\n  </ion-item>\n\n  <ion-item *ngIf="canMark" (tap)="markMain(imagenIndex)">\n    <ion-label>{{ \'POPOVER_PET_MEDIA_OPTIONS.SET_AS_MAIN\' | translate }}</ion-label>\n    <ion-note item-right>\n      <span class="icon-principal"></span>\n    </ion-note>\n  </ion-item>\n\n  <ion-item *ngIf="canDelete" (tap)="delete(imagenIndex)" style="border-radius: 10px;">\n    <ion-label>{{ \'POPOVER_PET_MEDIA_OPTIONS.DELETE_PICTURE\' | translate }}</ion-label>\n    <ion-note item-right>\n      <span class="icon-eliminar"></span>\n    </ion-note>\n  </ion-item>\n\n\n</ion-list>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/popovers/pet-media-options/pet-media-options.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["r" /* ViewController */],
            __WEBPACK_IMPORTED_MODULE_6__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_4__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_5__services_pet_service__["a" /* PetService */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_3__ionic_native_camera__["a" /* Camera */],
            __WEBPACK_IMPORTED_MODULE_1__ionic_storage__["b" /* Storage */]])
    ], PetMediaOptionsPage);
    return PetMediaOptionsPage;
}());

//# sourceMappingURL=pet-media-options.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AdsMedia; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ionic_storage__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_camera__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_user_service__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__environments_environment__ = __webpack_require__(27);
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 AdsMedia = /** @class */ (function () {
    function AdsMedia(navCtrl, navParams, viewCtrl, service, userService, loadingCtrl, camera, storage) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.viewCtrl = viewCtrl;
        this.service = service;
        this.userService = userService;
        this.loadingCtrl = loadingCtrl;
        this.camera = camera;
        this.storage = storage;
        this.loading = null;
        this.token = '';
        this.userId = null;
        this.image = '';
        this.title = '';
        this.text = '';
        this.link = '';
        this.storage.get("MP-Profile").then(function (val) {
            _this.userId = val.id;
        });
        this.storage.get("token").then(function (val) {
            _this.token = val;
        });
        this.image = this.navParams.get("image");
        this.title = this.navParams.get("title");
        this.text = this.navParams.get("text");
        this.link = this.navParams.get("link");
    }
    AdsMedia.prototype.ionViewDidLoad = function () {
    };
    AdsMedia.prototype.close = function () {
        this.viewCtrl.dismiss();
    };
    AdsMedia.prototype.takePicture = function () {
        var _this = this;
        this.camera.getPicture({
            destinationType: this.camera.DestinationType.DATA_URL,
            targetWidth: 300,
            targetHeight: 300,
            correctOrientation: true
        }).then(function (imageData) {
            _this.processTake(imageData);
        }, function (err) {
            console.log(err);
        });
    };
    AdsMedia.prototype.openGallery = function () {
        var _this = this;
        var cameraOptions = {
            sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
            destinationType: this.camera.DestinationType.DATA_URL,
            quality: 60,
            targetWidth: 320,
            targetHeight: 320,
            encodingType: this.camera.EncodingType.JPEG,
            correctOrientation: true
        };
        this.camera.getPicture(cameraOptions)
            .then(function (file_uri) {
            _this.processTake(file_uri);
        }, function (err) {
            console.log(err);
        });
    };
    AdsMedia.prototype.dataURItoBlob = function (dataURI) {
        var byteString;
        if (dataURI.split(',')[0].indexOf('base64') >= 0)
            byteString = atob(dataURI.split(',')[1]);
        else
            byteString = (dataURI.split(',')[1]);
        var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
        var ia = new Uint8Array(byteString.length);
        for (var i = 0; i < byteString.length; i++) {
            ia[i] = byteString.charCodeAt(i);
        }
        return new Blob([ia], {
            type: mimeString
        });
    };
    AdsMedia.prototype.processTake = function (imageData) {
        this.base64Image = "data:image/jpeg;base64," + imageData;
        this.loading = this.loadingCtrl.create({ content: 'actualizando...' });
        this.loading.present();
        var self0 = this;
        var blob = this.dataURItoBlob(this.base64Image);
        var objURL = window.URL.createObjectURL(blob);
        var image = new Image();
        image.src = objURL;
        window.URL.revokeObjectURL(objURL);
        var url = window.URL.createObjectURL(blob);
        var formData = new FormData();
        formData.append('avatar', blob, 'avatar.jpg');
        formData.append('userId', self0.userId);
        var xhr = new XMLHttpRequest();
        xhr.open("post", __WEBPACK_IMPORTED_MODULE_6__environments_environment__["a" /* environment */].apiUrl + "users/avatar");
        xhr.setRequestHeader("Authorization", "Bearer " + self0.token);
        xhr.onreadystatechange = function () {
            if (xhr.readyState === 4 && xhr.status === 200) {
                var uri = xhr.responseText;
                self0.loading.dismiss();
                if (uri.indexOf('error') > -1) {
                    self0.service.logError({}, 'Error al procesar la solicitud. Inténtelo más tarde.');
                }
                else {
                    self0.service.showOk("Foto actualizada con éxito");
                    self0.userService.getProfile().subscribe(function (result) {
                        result.avatar = __WEBPACK_IMPORTED_MODULE_6__environments_environment__["a" /* environment */].staticUrl + uri.replace('/public/', '');
                        self0.storage.set("MP-Profile", result);
                        self0.viewCtrl.dismiss(true);
                    }, function (err) {
                        console.log(JSON.stringify(err));
                    });
                }
            }
        };
        xhr.send(formData);
        /*
        this.b64toBlob(this.base64Image,
        function(blob) {
    
            var url = window.URL.createObjectURL(blob);
    
            var formData = new FormData();
            formData.append('avatar', blob, 'avatar.jpg');
            formData.append('userId', self0.userId);
    
            
            var xhr = new XMLHttpRequest();
            xhr.open("post", environment.apiUrl+"users/avatar");
            xhr.setRequestHeader("Authorization", "Bearer "+self0.token);
    
            xhr.onreadystatechange = function () {
    
              if(xhr.readyState === 4 && xhr.status === 200) {
                var uri = xhr.responseText;
                self0.loading.dismiss();
    
                if (uri.indexOf('error') > -1) {
                  self0.service.logError({}, 'Error al procesar la solicitud. Inténtelo más tarde.');
                }
                else {
                  self0.service.showOk("Foto actualizada con éxito");
    
                  self0.userService.getProfile().subscribe(
                    (result)=>{
                      result.avatar = environment.staticUrl+uri.replace('/public/','');
                      self0.storage.set("MP-Profile", result);
                      self0.viewCtrl.dismiss(true);
                    },
                    err => {
                      console.log(JSON.stringify(err));
                    }
                  );
                }
              }
              
    
              
            };
    
            xhr.send(formData);
    
        }, function(error) {
            console.log('error',error);
        });
        */
    };
    AdsMedia.prototype.b64toBlob = function (b64, onsuccess, onerror) {
        var img = new Image();
        img.onerror = onerror;
        img.onload = function onload() {
            var canvas = document.createElement('canvas');
            canvas.width = img.width;
            canvas.height = img.height;
            var ctx = canvas.getContext('2d');
            ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
            canvas.toBlob(onsuccess);
        };
        img.src = b64;
    };
    AdsMedia = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-ads',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/popovers/ads/ads.html"*/'<ion-list radio-group class="popover-page">\n  <div class="close" (tap)="close()">\n      <ion-icon name="close"></ion-icon>\n  </div>\n  <ion-row>\n    <ion-col col-4>\n        <a href="{{link}}" target="_blank">\n            <img class="verticalAling" src="{{image}}" /></a>\n    </ion-col>\n    <ion-col col-8>\n        <a href="{{link}}" target="_blank">\n            <strong>{{title}}</strong>\n            <p>{{text}}</p></a>\n    </ion-col>\n  </ion-row>\n\n</ion-list>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/pages/popovers/ads/ads.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["r" /* ViewController */],
            __WEBPACK_IMPORTED_MODULE_5__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_4__services_user_service__["a" /* UserService */],
            __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_3__ionic_native_camera__["a" /* Camera */],
            __WEBPACK_IMPORTED_MODULE_1__ionic_storage__["b" /* Storage */]])
    ], AdsMedia);
    return AdsMedia;
}());

//# sourceMappingURL=ads.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NewsPreviewComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_moment__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pages_noticias_newsDetalle__ = __webpack_require__(554);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__environments_environment__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__services_news_service__ = __webpack_require__(113);
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);
};






/**
 * Generated class for the NewsPreviewComponent component.
 *
 * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html
 * for more info on Angular Components.
 */
var NewsPreviewComponent = /** @class */ (function () {
    function NewsPreviewComponent(navCtrl, newsService) {
        this.navCtrl = navCtrl;
        this.newsService = newsService;
        this.image = '';
        this.staticUrl = __WEBPACK_IMPORTED_MODULE_4__environments_environment__["a" /* environment */].staticUrl;
    }
    NewsPreviewComponent.prototype.ngOnInit = function () {
        /*console.log('A::' + this.news.featured_media);
        this.newsService.getFeatured(this.news.featured_media).subscribe(
          (data: any) => {
            this.image =  data.guid.rendered;
          },
          error => {
            console.log(error);
          }
        )*/
    };
    NewsPreviewComponent.prototype.detalleNews = function (obj) {
        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_3__pages_noticias_newsDetalle__["a" /* NewsDetalle */], {
            news: this.news
        });
    };
    NewsPreviewComponent.prototype.dateformat = function (fecha) {
        var fecha_mm = __WEBPACK_IMPORTED_MODULE_2_moment__(fecha);
        return __WEBPACK_IMPORTED_MODULE_2_moment__(fecha_mm.format(), __WEBPACK_IMPORTED_MODULE_2_moment__["ISO_8601"]).format();
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(),
        __metadata("design:type", Object)
    ], NewsPreviewComponent.prototype, "news", void 0);
    NewsPreviewComponent = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'news-preview',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/components/news-preview/news-preview.html"*/'<!-- Generated template for the NewsPreviewComponent component -->\n<div class="wrapper">\n  <div class="image" [style.background-image]="\'url(\' + news.image + \')\'" style="background-size: cover;" (click)="detalleNews(news);">\n    <div class="descriptionContainer">\n      <div class="title">{{ news.title }}</div>\n      <div class="date">{{ dateformat(news.date) | date }}</div>\n    </div>\n  </div>\n  '/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/components/news-preview/news-preview.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_5__services_news_service__["a" /* NewsService */]])
    ], NewsPreviewComponent);
    return NewsPreviewComponent;
}());

//# sourceMappingURL=news-preview.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return QrCardComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_native_barcode_scanner__ = __webpack_require__(523);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pata__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_pet_service__ = __webpack_require__(114);
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);
};





/**
 * Generated class for the QrCardComponent component.
 *
 * See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html
 * for more info on Angular Components.
 */
var QrCardComponent = /** @class */ (function () {
    function QrCardComponent(barcodeScanner, service, petService, loadingCtrl, platform) {
        this.barcodeScanner = barcodeScanner;
        this.service = service;
        this.petService = petService;
        this.loadingCtrl = loadingCtrl;
        this.platform = platform;
        this.nueva = false;
        this.change = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"]();
        this.loading = null;
    }
    QrCardComponent.prototype.scanear = function () {
        var _this = this;
        if (this.platform.is('ios') || this.platform.is('android')) {
            this.barcodeScanner.scan().then(function (barcodeData) {
                if (barcodeData.text.indexOf('mimaskot.pe') > -1) {
                    var data = barcodeData.text.split('/');
                    var code = data[data.length - 1].trim();
                    _this.loading = _this.loadingCtrl.create();
                    _this.loading.present();
                    var petcheck = _this.petService.uniqueQR(code);
                    petcheck.subscribe(function (ok) {
                        if (ok.status == 1) {
                            _this.okQr(code);
                        }
                        else {
                            _this.loading.dismiss();
                            _this.service.logError({}, 'El QR leidó está asignado a otra mascota');
                        }
                    }, function (err) {
                        _this.loading.dismiss();
                        _this.service.logError({}, 'No fue posible validar el QR');
                    });
                }
                else {
                    _this.service.logError({}, 'QR escaneado no corresponde a MiMaskot');
                }
            }, function (err) {
                _this.service.logError({}, 'Error al internar abrir la cámara');
            });
        }
        else {
            var code = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 8).toUpperCase();
            this.loading = this.loadingCtrl.create();
            this.loading.present();
            this.okQr(code);
        }
    };
    QrCardComponent.prototype.okQr = function (codex) {
        var _this = this;
        this.pet.code = codex;
        this.pet.qr = "https://chart.googleapis.com/chart?cht=qr&chs=300x300&chl=" + codex + "&chld=H|1";
        if (this.nueva == false) {
            var scode = this.petService.setCode(this.pet.id, codex);
            scode.subscribe(function (ok) {
                _this.loading.dismiss();
                _this.setOK(true, codex);
            }, function (err) {
                _this.loading.dismiss();
                _this.service.logError({}, 'No fue posible actualizar el QR');
            });
        }
        else {
            this.loading.dismiss();
            this.setOK(true, codex);
        }
    };
    QrCardComponent.prototype.setOK = function (ok, identifier) {
        this.change.emit({ ok: ok, identifier: identifier });
    };
    QrCardComponent.prototype.getQR = function (codez) {
        return "https://chart.googleapis.com/chart?cht=qr&chs=300x300&chl=" + codez + "&chld=H|1";
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(),
        __metadata("design:type", Object)
    ], QrCardComponent.prototype, "pet", void 0);
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(),
        __metadata("design:type", Boolean)
    ], QrCardComponent.prototype, "nueva", void 0);
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Output"])(),
        __metadata("design:type", __WEBPACK_IMPORTED_MODULE_0__angular_core__["EventEmitter"])
    ], QrCardComponent.prototype, "change", void 0);
    QrCardComponent = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'qr-card',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/components/qr-card/qr-card.html"*/'<!-- Generated template for the QrCardComponent component -->\n<div class="subTitle white">{{ \'PET.ID_MIMASKOT\' | translate }}</div>\n<div class="qrCard">\n  <img class="qr" *ngIf="pet.code" [src]="getQR(pet.code)" alt="qr">\n  <div class="qr emptyQr" *ngIf="!pet.code"></div>\n  <div class="identifierWrapper">\n    <div>{{ \'PET.IDENTIFIER\' | translate }}</div>\n    <div class="identifier">{{ pet.code }}</div>\n  </div>\n  <img id="mimaskotLogo" src="./assets/img/logo_mimaskot.png" alt="Mimaskot">\n  <button ion-button round (click)="scanear()" outline *ngIf="nueva">{{ \'PET.SCAN\' | translate }}</button>\n  <button ion-button round (click)="scanear()" outline *ngIf="!nueva">{{ \'PET.SCAN_AGAIN\' | translate }}</button>\n</div>\n'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/components/qr-card/qr-card.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2__ionic_native_barcode_scanner__["a" /* BarcodeScanner */],
            __WEBPACK_IMPORTED_MODULE_3__pata__["a" /* Pata */],
            __WEBPACK_IMPORTED_MODULE_4__services_pet_service__["a" /* PetService */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["n" /* Platform */]])
    ], QrCardComponent);
    return QrCardComponent;
}());

//# sourceMappingURL=qr-card.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UserInfoPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__ = __webpack_require__(20);
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 UserInfoPage = /** @class */ (function () {
    function UserInfoPage(navCtrl, navParams, docService, viewCtrl) {
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.docService = docService;
        this.viewCtrl = viewCtrl;
        this.idUser = this.navParams.get('id');
        this.loadUserInfo();
    }
    UserInfoPage.prototype.dismiss = function () {
        this.viewCtrl.dismiss();
    };
    UserInfoPage.prototype.loadUserInfo = function () {
        var _this = this;
        this.load = true;
        var param = this.idUser;
        this.docService.getRating(param).subscribe(function (data) {
            _this.load = false;
            console.log(data);
            if (data["res"] == "OK") {
                _this.numService = data["services"];
                _this.registro = data["oldest"];
                _this.coments = data["comments"];
                if (data["stars"] == null) {
                    _this.star = 0;
                }
                else {
                    _this.star = data["stars"];
                }
            }
        });
    };
    UserInfoPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-user-info',template:/*ion-inline-start:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/user-info/user-info.html"*/'<ion-content padding class="main-view">\n  <div class="overlay" (click)="dismiss()"></div>\n  <div class="modal_content" align="center">\n\n    <div class="loading" *ngIf="load==true">\n      <ion-spinner name="ios"></ion-spinner>\n    </div>\n    <div *ngIf="load==false" class="body">\n      <ion-grid>\n      <ion-row>\n        <ion-col col-10><h3>Datos de usuario</h3></ion-col>\n        <ion-col col-2>\n          <h3><ion-icon name="close-circle-outline" (click)="dismiss()"></ion-icon></h3>\n        </ion-col>\n      </ion-row>\n      </ion-grid>\n      \n      <hr style="width:90%">\n      <label align="left"><strong>Valorización</strong></label>\n      <rating readOnly="true" max="5" [(ngModel)]="star" emptyStarIconName="star-outline" halfStarIconName="star-half" starIconName="star"\n        nullable="true">\n      </rating>\n      <ion-item no-lines>\n        <label align="left"><strong>Envios realizados: </strong></label>\n        <label align="left" class="orange">{{numService}} Envios</label>\n      </ion-item>\n      <ion-item no-lines>\n        <label align="left"><strong>Registrado hace:  </strong></label>\n  \n        <label align="left" class="orange">{{registro}}</label>\n      </ion-item>\n      <ion-item *ngFor="let data of coments; let i=index">\n        <p>\n          {{data.comments}}\n        </p>\n      </ion-item>\n    </div>\n\n\n  </div>\n\n</ion-content>'/*ion-inline-end:"/Users/mac/projects/masteryoda/masteryoda-app/src/modals/user-info/user-info.html"*/,
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["l" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2__services_doctor_service__["a" /* DoctorService */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["r" /* ViewController */]])
    ], UserInfoPage);
    return UserInfoPage;
}());

//# sourceMappingURL=user-info.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ReversePipe; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
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 ReversePipe = /** @class */ (function () {
    function ReversePipe() {
    }
    ReversePipe.prototype.transform = function (value) {
        return value.slice().reverse();
    };
    ReversePipe = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Pipe"])({ name: 'reverse' })
    ], ReversePipe);
    return ReversePipe;
}());

//# sourceMappingURL=reverse.pipe.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BaseService; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_common_http__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__environments_environment__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_mergeMap__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_mergeMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_mergeMap__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_fromPromise__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_fromPromise__);





var BaseService = /** @class */ (function () {
    function BaseService(http, storage) {
        this.http = http;
        this.storage = storage;
    }
    /** get token */
    BaseService.prototype.getAuthToken = function () {
        return __WEBPACK_IMPORTED_MODULE_2_rxjs_Observable__["Observable"].fromPromise(this.storage.get('token'));
    };
    /** GET */
    BaseService.prototype.get = function (url, body) {
        var _this = this;
        return this.getAuthToken().flatMap(function (token) {
            return _this.http.get(__WEBPACK_IMPORTED_MODULE_1__environments_environment__["a" /* environment */].apiUrl + url, {
                params: body,
                headers: new __WEBPACK_IMPORTED_MODULE_0__angular_common_http__["c" /* HttpHeaders */]().append('Authorization', token)
            });
        });
    };
    /** POST */
    BaseService.prototype.post = function (url, body) {
        var _this = this;
        return this.getAuthToken().flatMap(function (token) {
            return _this.http.post(__WEBPACK_IMPORTED_MODULE_1__environments_environment__["a" /* environment */].apiUrl + url, body, {
                headers: new __WEBPACK_IMPORTED_MODULE_0__angular_common_http__["c" /* HttpHeaders */]().append('Authorization', token)
            });
        });
    };
    /** PUT */
    BaseService.prototype.put = function (url, body) {
        var _this = this;
        return this.getAuthToken().flatMap(function (token) {
            return _this.http.put(__WEBPACK_IMPORTED_MODULE_1__environments_environment__["a" /* environment */].apiUrl + url, body, {
                headers: new __WEBPACK_IMPORTED_MODULE_0__angular_common_http__["c" /* HttpHeaders */]().append('Authorization', token)
            });
        });
    };
    /** DELETE */
    BaseService.prototype.delete = function (url, body) {
        var _this = this;
        return this.getAuthToken().flatMap(function (token) {
            return _this.http.delete(__WEBPACK_IMPORTED_MODULE_1__environments_environment__["a" /* environment */].apiUrl + url, {
                headers: new __WEBPACK_IMPORTED_MODULE_0__angular_common_http__["c" /* HttpHeaders */]().append('Authorization', token)
            });
        });
    };
    return BaseService;
}());

//# sourceMappingURL=base.service.js.map

/***/ })

},[559]);
//# sourceMappingURL=main.js.map