IoTService.factory("api",["$http",function(t){var e={get:function(e,r=!1){return t.get("api/"+e,{cache:r})},put:function(e,r){return t.put("api/"+e,r)},post:function(e,r){return t.post("api/"+e,r)},delete:(function(e,r){return t.delete("api/"+e,r)},function(e,r){return t.delete("api/"+e,r)})};return e}]),IoTService.factory("httpResponseInterceptor",["$q","$window","$rootScope",function(t,e,r){return{response:function(e){return e.status,e||t.when(e)},responseError:function(r){return 401===r.status&&(e.location="/"),t.reject(r)}}}]),IoTService.factory("Usuario",["$http","$q",function(t,e){return{misDatos:"",setVista:!1,get:function(){var r=e.defer();return this.misDatos||(t.get("api/misdatos").then((function(t){r.resolve(t.data)})),this.misDatos=r.promise),this.misDatos}}}]),IoTService.factory("Modal",["$uibModal",function(t){var e={open:function(e,r,n,o="lg"){var a=e;return t.open({animation:!0,ariaLabelledBy:"modal-title",ariaDescribedBy:"modal-body",templateUrl:"static/modal/"+r+".html",size:o,controller:"Modal",controllerAs:"mc",backdrop:"static",scope:a,resolve:{data:function(){return n}}})}};return e}]),IoTService.service("DateService",[function(){var t={fechaFormateada:function(t){var e=new Date(t),r=""+(e.getMonth()+1),n=""+e.getDate(),o=e.getFullYear();return r.length<2&&(r="0"+r),n.length<2&&(n="0"+n),[o,r,n].join("-")+"T12:00:00"},fechaCorta:function(t){var e=new Date(t),r=""+(e.getMonth()+1),n=""+e.getDate(),o=e.getFullYear();return r.length<2&&(r="0"+r),n.length<2&&(n="0"+n),[o,r,n].join("-")}};return t}]);