1import{a as X}from"./chunk-7ZWQUIIS.js";import{a as ee}from"./chunk-V4PKTO67.js";import{a as ae}from"./chunk-2MO6WU6B.js";import"./chunk-AU3Z5FOC.js";import"./chunk-DSIFISEG.js";import"./chunk-W7TU4BTL.js";import"./chunk-6L2NCZW5.js";import"./chunk-YE7IZADY.js";import"./chunk-36L7HO2D.js";import"./chunk-6DGZVVJ6.js";import{f as q}from"./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 Z}from"./chunk-QD2H22W6.js";import{a as K}from"./chunk-RZGLMMB6.js";import{a as te}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 Y}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 G,Qa as H,xa as z}from"./chunk-LZ4RZU6S.js";import{G as $,J as V,h as j,l as Q}from"./chunk-EQIWCYQC.js";import"./chunk-LQTFT3Z4.js";import{Ba as L,F as N,Gb as h,H as F,Hb as D,Hc as T,Ib as v,Ic as I,J as S,Lb as _,Mb as y,Nb as l,Nc as d,Ob as o,Oc as u,Pb as r,Pc as f,Q as E,Qb as s,S as B,da as c,db as n,fc as A,hc as b,rb as g,uc as C,vb as k,vc as R,wa as p,wc as O,xc as U}from"./chunk-LD77J3V7.js";import{N as J}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 P,b as W,l as m}from"./chunk-GM3FZBKO.js";var oe=()=>["firstName","lastName"],ie=t=>({select:t}),re=()=>["name","isPartner"],de=(t,e)=>e.currency;function pe(t,e){if(t&1&&(s(0,"ion-icon",6),o(1,"h5"),C(2),r()),t&2){let a=e;n(2),U("",a.firstName," ",a.lastName)}}function ce(t,e){t&1&&s(0,"ion-skeleton-text",5),t&2&&l("animated",!0)}function me(t,e){if(t&1&&(h(0,pe,3,2),d(1,"user"),d(2,"async"),D(3,ce,1,1,"ion-skeleton-text",5)),t&2){let a,i=b();v((a=u(2,4,f(1,1,i.wallet.user,I(7,ie,T(6,oe)))))?0:3,a)}}function ue(t,e){t&1&&(s(0,"ion-icon",7),o(1,"h5"),C(2),r()),t&2&&(n(2),R(e.name))}function fe(t,e){t&1&&s(0,"ion-skeleton-text",5),t&2&&l("animated",!0)}function ge(t,e){if(t&1&&(h(0,ue,3,1),d(1,"organisation"),d(2,"async"),D(3,fe,1,1,"ion-skeleton-text",5)),t&2){let a,i=b();v((a=u(2,4,f(1,1,i.wallet.organisation,I(7,ie,T(6,re)))))?0:3,a)}}function he(t,e){if(t&1&&(o(0,"div",4),s(1,"unv-item-lable-value",8)(2,"unv-item-lable-value",9),d(3,"unCurrency"),s(4,"unv-item-lable-value",10),d(5,"unCurrency"),r()),t&2){let a=e.$implicit;n(),l("showMissing",!1)("value",a.currency),n(),l("showMissing",!1)("value",f(3,6,a.available,a.currency)),n(2),l("showMissing",!1)("value",f(5,9,a.total,a.currency))}}function ve(t,e){if(t&1&&(o(0,"div",4),s(1,"unv-item-lable-value",11),d(2,"date"),s(3,"unv-item-lable-value",12),d(4,"date"),r()),t&2){let a=b();n(),l("showMissing",!1)("value",u(2,4,a.wallet.createdAt)),n(2),l("showMissing",!1)("value",u(4,6,a.wallet.updatedAt))}}var w=class t{wallet;RoutePath=J;static \u0275fac=function(a){return new(a||t)};static \u0275cmp=g({type:t,selectors:[["unv-wallet-card"]],inputs:{wallet:"wallet"},decls:10,vars:3,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"],[1,"d-flex","items-center","j-between","flex-wrap","pr-16"],[3,"animated"],["src","/assets/mobile/icons/person.svg"],["name","business-outline"],["label","Currency",3,"showMissing","value"],["label","Available",3,"showMissing","value"],["label","Total",3,"showMissing","value"],["label","Created",3,"showMissing","value"],["label","Updated",3,"showMissing","value"]],template:function(a,i){a&1&&(o(0,"article",0)(1,"div",1)(2,"div",2),h(3,me,4,9)(4,ge,4,9),o(5,"p",3),C(6),r()()(),_(7,he,6,12,"div",4,de,!1,ve,5,8,"div",4),r()),a&2&&(n(3),v(i.wallet.user?3:i.wallet.organisation?4:-1),n(3),O("( ",i.wallet._id," )"),n(),y(i.wallet.balances))},dependencies:[z,te,H,Z,Q,q,ee,j],encapsulation:2})};var _e=(t,e)=>e._id;function ye(t,e){if(t&1&&s(0,"unv-wallet-card",1),t&2){let a=e.$implicit;l("wallet",a)}}var ne=class t extends Y{svc=c(X);seo=c(K);route=c($);router=c(V);loadingCtrl=c(G);loading=p(!1);filters={};page=p(1);totalPages=p(1);totalDocs=p(0);hasMore=p(!0);wallets=p([]);ngOnInit(){this.seo.setPageTitle("Wallets list"),this.watchQueryParams()}findMinimal(e){return this.svc.find(W(P({},e),{page:this.page(),sort:["balances.total,-1"]})).pipe(F(1))}watchQueryParams(){return m(this,null,function*(){this.route.queryParams.pipe(N(400),B(this.dead$),S(),E(e=>{this.filters=e;let{page:a}=e;return a&&this.page.set(+a),this.loading.set(!0),this.findMinimal(e)})).subscribe({next:e=>{this.loading.set(!1),this.hasMore.set(e.hasNextPage),this.wallets.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 m(this,null,function*(){if(!this.hasMore()){e&&e.target.complete();return}let a=yield this.loadingCtrl.create({message:"Fetching wallets..."});yield a.present(),this.findMinimal(W(P({},this.filters),{page:this.page})).subscribe({next:i=>{e&&e.target.complete(),this.wallets.update(x=>[...x,...i.docs]),this.hasMore.set(i.hasNextPage),i.nextPage&&this.page.set(i.nextPage)},complete:()=>m(this,null,function*(){return yield a.dismiss()})})})}refresh(e){return m(this,null,function*(){this.reset(),yield this.fetch(e)})}reset(){this.page.set(1),this.hasMore.set(!0),this.wallets.set([])}static \u0275fac=(()=>{let e;return function(i){return(e||(e=L(t)))(i||t)}})();static \u0275cmp=g({type:t,selectors:[["unv-wallets-list"]],features:[
1k],decls:3,vars:4,consts:[["pageTitle","Wallets","layout","admin",3,"loadMore","refresh","dataLength","totalPages","hasMore","loading"],[3,"wallet"]],template:function(a,i){a&1&&(o(0,"unv-dashboard-search-page-layout",0),A("loadMore",function(M){return i.fetch(M)})("refresh",function(M){return i.refresh(M)}),_(1,ye,1,1,"unv-wallet-card",1,_e),r()),a&2&&(l("dataLength",i.totalDocs())("totalPages",i.totalPages())("hasMore",i.hasMore())("loading",i.loading()),n(),y(i.wallets()))},dependencies:[ae,w],encapsulation:2})};export{ne as WalletsList};
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.