1import{a as V}from"./chunk-SPSMUDOJ.js";import{e as P}from"./chunk-KCPIJL6W.js";import"./chunk-64ZEVU2M.js";import"./chunk-TRSIHZNG.js";import"./chunk-UNSAKLS7.js";import"./chunk-JS6I5FQ5.js";import"./chunk-UTO46H5S.js";import"./chunk-2ZZOJFT2.js";import{a as F}from"./chunk-JWSAKKVQ.js";import{a as w}from"./chunk-LT72JKOL.js";import"./chunk-VBIRK3HD.js";import"./chunk-YFREARA7.js";import"./chunk-AGCAGPAP.js";import"./chunk-AHQSOXDD.js";import"./chunk-XBBEU2YL.js";import"./chunk-I7CB4NGY.js";import"./chunk-JZMNR7QN.js";import"./chunk-LH7AKJBU.js";import"./chunk-M7VQHQXJ.js";import{d as T}from"./chunk-BAGWPQZV.js";import{D as O}from"./chunk-TZ2MW36L.js";import{a as M}from"./chunk-WZBVDNS6.js";import{a as k}from"./chunk-3KOQRKYT.js";import"./chunk-MTKRVMUJ.js";import"./chunk-SHTGYNA2.js";import{j as y,k as C,u as E}from"./chunk-4YERUHPX.js";import{Db as _,Ib as h,Jb as f,Pa as N,Tb as p,Ub as b,Xa as a,Ya as l,ac as I,da as x,ib as m,mb as s,na as d,oa as g,xb as n,yb as c,zb as u}from"./chunk-DQGQ5ICO.js";import{a as S}from"./chunk-4IDNTCH7.js";function j(i,t){i&1&&(n(0,"div",8),p(1," Por el momento no tienes ninguna notificaci\xF3n "),c())}function H(i,t){i&1&&u(0,"div",12)}function A(i,t){if(i&1){let e=_();n(0,"li"),m(1,H,1,0,"div",9),n(2,"div",10)(3,"p")(4,"a",11),h("click",function(){let o=d(e).$implicit,v=f(2);return g(v.navigate(o.url))}),p(5,"content"),c()(),n(6,"span"),p(7),c()()()}if(i&2){let e=t.$implicit,r=f(2);a(),s("ngIf",!e.seen),a(3),s("innerHTML",e.value,N),a(3),b(r.getIntervalTime(e.date))}}function B(i,t){if(i&1){let e=_();n(0,"label")(1,"a",13),h("click",function(){d(e);let o=f(2);return g(o.next())}),p(2," Cargar m\xE1s notificaciones "),u(3,"span",14),c()()}}function D(i,t){if(i&1&&(n(0,"div",4),m(1,j,2,0,"div",5),n(2,"ul"),m(3,A,8,3,"li",6),c(),m(4,B,4,0,"label",7),c()),i&2){let e=f();a(),s("ngIf",e.collection.length===0),a(2),s("ngForOf",e.collection)("ngForTrackBy",e.trackByIndex),a(),s("ngIf",e.filter.hasNextPage)}}var U=class i{constructor(t,e,r,o,v,R){this.router=t;this.portalMainService=e;this.userService=r;this.helperService=o;this.authService=v;this.eventEmitterService=R;this.user=this.authService.user}filter={};collection=[];user;ngOnInit(){this.activate()}activate(){this.filter.page=0,this.filter.pageSize=10,this.filter.hasNextPage=!1,this.portalMainService.seo.title="Notificaciones",this.eventEmitterService.startErrorUser.subscribe(()=>this.startErrorUser()),this.eventEmitterService.logOff.subscribe(()=>this.logOff()),this.bind()}next(){this.filter.page+=1,this.bind()}logOff(){this.router.navigate(["/"])}bind(){this.userService.getNotifications(this.filter).subscribe({next:t=>this.setGetNotifications(t),error:t=>this.helperService.handlerException(t)})}setGetNotifications(t){if(this.filter.page===0)this.collection=t.results;else for(var e=0;e<t.results.length;e++)this.collection.push(t.results[e]);this.filter.hasNextPage=t.meta.hasNextPage;var r=this.collection.filter(v=>!v.seen).length,o=S({},this.authService.user);o.unseenNotifications-=r,o.unseenNotifications<0&&(o.unseenNotifications=0),this.authService.user=o}startErrorUser(){this.router.navigate(["/"])}trackByIndex(t,e){return t}navigate(t){this.router.navigate([t])}getIntervalTime(t){try{t.date.getIntervalTime()}catch(e){console.error(e),t.date}}static \u0275fac=function(e){return new(e||i)(l(T),l(P),l(w),l(M),l(F),l(k))};static \u0275cmp=x({type:i,selectors:[["app-notifications"]],standalone:!0,features:[I],decls:6,vars:2,consts:[[1,"content_all"],[3,"seedValue"],[1,"section-tit"],["class","noti-content",4,"ngIf"],[1,"noti-content"],["style","padding: 50px; text-align: center",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[4,"ngIf"],[2,"padding","50px","text-align","center"],["class","new",4,"ngIf"],[1,"noti-wText"],[1,"noti-link",3,"click","innerHTML"],[1,"new"],["href","",1,"more-page",3,"click"],[1,"icon-down"]],template:function(e,r){e&1&&(n(0,"section",0),u(1,"app-seed",1),n(2,"h2",2),p(3,"Notificaciones"),c(),n(4,"div",0),m(5,D,5,4,"div",3),c()()),e&2&&(a(),s("seedValue","Notificaciones"),a(4),s("ngIf",r.user==null?null:r.user.name))},dependencies:[E,y,C,O,V]})};export{U as NotificationsComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.