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