import{a as O}from"./chunk-2ZNS6QTD.js";import{a as S}from"./chunk-FSCI3FDB.js";import{a as C}from"./chunk-VSFNMVXJ.js";import{Q as I,S as _,X as b}from"./chunk-YSQLW2JA.js";import{pa as T}from"./chunk-NVJ2ZZFT.js";import{Aa as c,Ba as m,Ng as N,Pd as h,Vc as g,ab as f,bb as d,bh as R,dd as v,gb as u,ha as l,ya as p}from"./chunk-SKPDQO4E.js";var A=`<div>
  <ng-template *ngTemplateOutlet="readAllTemplate">
  </ng-template>
  <div class="row mt-2">
    @switch (inModalUsage) {
    @case (true) {
    <div class="overflow-y-auto mxh-vh-60" id="notification-list-scroll-container">
      <ng-template *ngTemplateOutlet="notificationListTemplate">
      </ng-template>
    </div>
    }
    @case (false) {
    <ng-template *ngTemplateOutlet="notificationListTemplate">
    </ng-template>
    }
    }
  </div>
  <ng-template *ngTemplateOutlet="readAllTemplate">
  </ng-template>
  <div class="row">
    <div class="col-12">
      <armon-pagination [paginationResponse]="paginationResponse" (pageChanged)="pageChanged($event)"
        [scrollDomId]="'notification-list-scroll-container'">
      </armon-pagination>
    </div>
  </div>
  <div class="row pt-5" *ngIf="notifications && notifications.length==0">
    <div class="col-12">
      <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">
        <ng-template #contentTpl>
          <span>{{(isUnreadList ? 'NOTIFICATIONS.NO_UNREAD_IN_LIST' : 'NOTIFICATIONS.NO_READ_IN_LIST' ) |
            translate}}</span>
        </ng-template>
      </nz-empty>
    </div>
  </div>
</div>

<ng-template #readAllTemplate>
  <div class="row" *ngIf="notifications && notifications.length>0 && isUnreadList">
    <div class="col-12 d-flex justify-content-end">
      <button class="btn btn-link btn-sm" (click)="readAllClicked($event)">
        {{'NOTIFICATIONS.BUTTON_SET_AS_READ_ALL' | translate}}
      </button>
    </div>
  </div>
</ng-template>

<ng-template #notificationListTemplate>
  <div class="col-12" *ngFor="let notification of notifications">
    <armon-notificationjobs-instance [notificationJobInstance]="notification" [selfView]="true"
      (routingStarted)="navigateToRouteClicked()"></armon-notificationjobs-instance>
  </div>
</ng-template>`;var L="";var U=function(o,t,e,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(o,t,e,n);else for(var r=o.length-1;r>=0;r--)(a=o[r])&&(i=(s<3?a(i):s>3?a(t,e,i):a(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i},y=class{notificationJobService;notificationService;sessionService;isUnreadList=!0;inModalUsage=!1;allMarkedAsRead=new l;navigatedToRoute=new l;notifications;request;paginationResponse=new N;constructor(t,e,n){this.notificationJobService=t,this.notificationService=e,this.sessionService=n}ngOnInit(){this.request=_.getEmptyModel(),this.getData()}getData(){this.request.filter.mediums=new I,this.request.filter.mediums.sms=!1,this.request.filter.mediums.pushNotification=!1,this.request.filter.mediums.email=!1,this.request.filter.mediums.web=!0,this.request.filter.states=this.isUnreadList?[4]:[5],this.request.filter.receiverFilter=T.getEmptyModel(),this.request.filter.receiverFilter.userIds=[this.sessionService.currentUserId],this.request.sorting.field="createdT",this.request.sorting.order=g.DESC,this.notificationJobService.listNotificationJobInstances(this.request).subscribe(t=>{t.items.forEach(e=>{e.isNew=this.isUnreadList}),this.notifications=t.items,this.paginationResponse=t.pagination})}refreshList(){this.getData()}readAllClicked(t){this.notificationService.markAsReadAllNotifications().subscribe(e=>{this.allMarkedAsRead.emit()})}pageChanged(t){this.request.pagination=t,this.refreshList()}navigateToRouteClicked(){this.navigatedToRoute.emit()}static ctorParameters=()=>[{type:b},{type:S},{type:h}];static propDecorators={isUnreadList:[{type:c}],inModalUsage:[{type:c}],allMarkedAsRead:[{type:m}],navigatedToRoute:[{type:m}]}};y=U([p({selector:"armon-notification-list",template:A,standalone:!0,imports:[u,f,O,C,d,R,v],styles:[L]})],y);export{y as a};
