1import{a as H}from"./chunk-J5SC4Q72.js";import{a as Y}from"./chunk-2MO6WU6B.js";import{a as X}from"./chunk-6NSFUL2T.js";import"./chunk-7SXQRWJB.js";import"./chunk-3UU2J6K5.js";import"./chunk-AU3Z5FOC.js";import"./chunk-DSIFISEG.js";import"./chunk-VNNGBPAK.js";import"./chunk-W7TU4BTL.js";import"./chunk-6L2NCZW5.js";import"./chunk-YE7IZADY.js";import"./chunk-36L7HO2D.js";import"./chunk-6DGZVVJ6.js";import"./chunk-IIKZKUNZ.js";import"./chunk-5AL3UP33.js";import"./chunk-2UBTYKWQ.js";import"./chunk-FAFAOJIW.js";import"./chunk-F6WAK53M.js";import"./chunk-Z3QSNUU2.js";import"./chunk-DF6UDE75.js";import{a as G}from"./chunk-RZGLMMB6.js";import{a as W}from"./chunk-HI5J4A2D.js";import"./chunk-Y6EFL3KD.js";import"./chunk-Y477RBGN.js";import"./chunk-CG6PJ3O3.js";import"./chunk-O734C6NI.js";import"./chunk-CRKP4JOY.js";import{a as J}from"./chunk-PBA7I7E7.js";import"./chunk-YEIKQLRS.js";import"./chunk-7IOOLH33.js";import"./chunk-YWW23FGB.js";import"./chunk-GQQDCOH2.js";import"./chunk-TBCHVPVT.js";import"./chunk-M5UJOICU.js";import{La as Q}from"./chunk-LZ4RZU6S.js";import{G as U,J as K,l as j}from"./chunk-EQIWCYQC.js";import{R as z}from"./chunk-LQTFT3Z4.js";import{Ba as R,F as N,J as C,Kc as x,Lb as S,Lc as V,Mb as F,Nb as m,Nc as b,Ob as o,Oc as y,Pb as s,Q as M,Qb as _,S as D,Zb as k,da as p,db as n,fc as u,hc as O,ja as w,ka as L,ra as I,rb as f,uc as T,vb as E,vc as B,wa as l,wc as A}from"./chunk-LD77J3V7.js";import{N as P,r as $}from"./chunk-3EKC573S.js";import"./chunk-XPKYUPJI.js";import"./chunk-FDXKYDEV.js";import"./chunk-3A2TMJPV.js";import"./chunk-WFMAM73Y.js";import"./chunk-3W3UUJRA.js";import"./chunk-C2BKNTEV.js";import"./chunk-7LSXCVNU.js";import"./chunk-W2KDYWKP.js";import"./chunk-2VH7GMSN.js";import"./chunk-YUNOCBLG.js";import"./chunk-VGMJM2GZ.js";import"./chunk-2NIBOUWM.js";import"./chunk-I547WOKC.js";import"./chunk-AROIUTHY.js";import"./chunk-FY5VXINF.js";import"./chunk-NMFL75IO.js";import{a as g,b as v,l as c}from"./chunk-GM3FZBKO.js";var te=(a,e,i,t)=>["/",a,e,i,t],ie=(a,e,i)=>["/",a,e,i],h=class a{notificationTemplate;delete=new I;RoutePath=P;static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["unv-notification-template-card"]],inputs:{notificationTemplate:"notificationTemplate"},outputs:{delete:"delete"},decls:13,vars:22,consts:[[1,"border-neutral-200","ion-padding","radius-4xl","d-grid","gap-12"],[1,"d-flex","items-center","gap-12","j-between"],[1,"d-flex","items-center","gap-12","flex-wrap"],[1,"text-xs"],[3,"delete","resourceId","editLink","cloneLink"],[1,"d-flex","items-center","j-between","flex-wrap","pr-16"],["label","Created",3,"showMissing","value"],["label","Updated",3,"showMissing","value"]],template:function(i,t){i&1&&(o(0,"article",0)(1,"div",1)(2,"div",2)(3,"h5"),T(4),s(),o(5,"span",3),T(6),s()(),o(7,"unv-admin-fab-buttons",4),u("delete",function(){return t.delete.emit(t.notificationTemplate._id)}),s()(),o(8,"div",5),_(9,"unv-item-lable-value",6),b(10,"date"),_(11,"unv-item-lable-value",7),b(12,"date"),s()()),i&2&&(n(4),B(t.notificationTemplate.event),n(2),A("(",t.notificationTemplate.topic,")"),n(),m("resourceId",t.notificationTemplate._id)("editLink",V(13,te,t.RoutePath.admin,t.RoutePath.notificationTemplates,t.notificationTemplate._id,t.RoutePath.edit))("cloneLink",x(18,ie,t.RoutePath.admin,t.RoutePath.notificationTemplates,t.RoutePath.create)),n(2),m("showMissing",!1)("value",y(10,9,t.notificationTemplate.createdAt)),n(2),m("showMissing",!1)("value",y(12,11,t.notificationTemplate.updatedAt)))},dependencies:[X,W,j],encapsulation:2})};var ae=(a,e)=>e._id;function ne(a,e){if(a&1){let i=k();o(0,"unv-notification-template-card",2),u("delete",function(){let r=w(i).$implicit,d=O();return L(d.delete(r._id))}),s()}if(a&2){let i=e.$implicit;m("notificationTemplate",i)}}var Z=class a extends J{svc=p(H);seo=p(G);route=p(U);router=p(K);loadingCtrl=p(Q);loading=l(!1);filters={};page=l(1);totalPages=l(1);totalDocs=l(0);hasMore=l(!0);templates=l([]);topics=z.enumToKeyLabelValuePair($);ngOnInit(){this.seo.setPageTitle("Notification templates"),this.watchQueryParams()}findMinimal(e){return this.svc.find(v(g({},e),{page:this.page()}))}watchQueryParams(){return c(this,null,function*(){this.route.queryParams.pipe(N(400),D(this.dead$),C(),M(e=>{this.filters=e;let{page:i}=e;return i&&this.page.set(+i),this.loading.set(!0),this.findMinimal(e)})).subscribe({next:e=>{this.loading.set(!1),this.hasMore.set(e.hasNextPage),this.templates.set(e.docs),this.totalPages.set(e.totalPages),this.totalDocs.set(e.totalDocs),e.nextPage&&this.page.set(e.nextPage)},error:()=>{this.loading.set(!1)}})})}fetch(e){return c(this,null,function*(){if(!this.hasMore()){e&&e.target.complete();return}this.findMinimal(v(g({},this.filters),{page:this.page})).subscribe(i=>{e&&e.target.complete(),this.templates.update(t=>[...t,...i.docs]),this.hasMore.set(i.hasNextPage),i.nextPage&&this.page.set(i.nextPage)})})}refresh(e){return c(this,null,function*(){this.reset(),yield this.fetch(e)})}reset(){this.page.set(1),this.hasMore.set(!0),this.templates.set([])}add(){this.router.navigate(["create"],{relativeTo:this.route})}delete(e){return c(this,null,function*(){let i=yield this.loadingCtrl.create({message:"Deleting package..."});yield i.present(),this.svc.delete(e).subscribe({next:()=>{this.templates.update(t=>t.filter(r=>r._id!==e)),i.dismiss()},error:()=>
1{i.dismiss()}})})}static \u0275fac=(()=>{let e;return function(t){return(e||(e=R(a)))(t||a)}})();static \u0275cmp=f({type:a,selectors:[["unv-notification-templates-list"]],features:[E],decls:3,vars:6,consts:[["pageTitle","Templates","layout","admin","statusKey","topic","statusLabel","Topic",3,"addButtonClick","loadMore","refresh","statusOptions","dataLength","totalPages","hasMore","loading","showAddButton"],[3,"notificationTemplate"],[3,"delete","notificationTemplate"]],template:function(i,t){i&1&&(o(0,"unv-dashboard-search-page-layout",0),u("addButtonClick",function(){return t.add()})("loadMore",function(d){return t.fetch(d)})("refresh",function(d){return t.refresh(d)}),S(1,ne,1,1,"unv-notification-template-card",1,ae),s()),i&2&&(m("statusOptions",t.topics)("dataLength",t.totalDocs())("totalPages",t.totalPages())("hasMore",t.hasMore())("loading",t.loading())("showAddButton",!0),n(),F(t.templates()))},dependencies:[Y,h],encapsulation:2})};export{Z as NotificationTemplatesList};
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.