PageSourceSearch

https://sociallab.sa/chunk-Damfun47.js

js sociallab.sa collected 2026-09-24 13:31:11 UTC 71,065 bytes, 1 lines download raw bytes

1import {t as ti}from'./chunk-BPEH4FkM.js';import {w}from'./chunk-5dqHqB46.js';import {b}from'./chunk-Dhh_5C9J.js';import {c as ce}from'./chunk-Cha4_V9g.js';import'./chunk-yuXVPJRt.js';import {g,co as He,fe as qi,db as s,H,bP as V,e as b$1,a as G,bQ as P,bO as Gt$1,aE as lt,O,dZ as Zt,K as Kb,T as Tt,cr as pe,d5 as Pe,k as Kv,aA as FM,P as Pg,bt as Is,bu as Tg,bT as zc,V as Vg,l as b0,L as L0,Y as Yx,m as dn$1,n as Vw,o as nk,t as td,p as tC,q as bC,s as sv,N as NC,X as XC,_ as _D,aO as oD,b0 as mD,aX as sD,r as il,u as XD,v as rM,F as Fb,w as t1,y as A1,z as gS,B as Vs,I as Fi$1,J as NS,Z as ZS,M as EI,Q as us,R as ms,S as HI,U as ZI,$ as Dn$1,a0 as kE,a1 as Jv,a2 as go$1,a3 as qd,av as on$1,a4 as YE,a5 as OT,a6 as lA,a7 as mt,a8 as cy,aB as Qm,aC as vS,a9 as qT,ai as ay,bC as tS,ag as _C,ah as ZT,ar as kt,aL as co$1,C as zs,cA as zM,aa as Xs,ab as my,ac as V_,ad as hd,ae as fS,af as KT,ba as _y,aj as ky,al as hS,aD as Fy,ak as Dd,am as XT,bg as gS$1,b as gr,E,D,cP as Ft,eZ as U,h as c$1,aF as ta$1,aG as pr,aH as ov,aP as lD,cB as Hg,aY as Hs,aR as o_,aS as Pp,aT as l_,aU as Lp,b5 as sy,bZ as Vy,b_ as G_,bB as lb,b$ as By,bE as fb,b8 as an$1,aN as Rd,b9 as jm,b1 as ei,b2 as da$1,by as vr,bz as yr,b3 as ed,cb as XI,cU as $v,cV as Zv,cW as Xv,bi as v_,bh as nS,gM as Km,gN as HT,gO as UT,bk as dy,fl as oS,bm as Vg$1}from'./main-CTPND76J.js';import {R as Ri$1}from'./chunk-CLFEoJNz.js';import'./chunk-CAH8VGMK.js';var Ai=(e,l)=>l.id;function zi(e,l){e&1&&(Xs(0,"span",5),V_(1),fS(2,"translate"),hd()),e&2&&(_C(),ky(hS(2,1,"current")));}function Vi(e,l){e&1&&(Xs(0,"span",5),V_(1),fS(2,"translate"),hd()),e&2&&(_C(),ky(hS(2,1,"current")));}function Ri(e,l){e&1&&(Xs(0,"div",6)(1,"mat-icon"),V_(2,"build"),hd(),Xs(3,"span"),V_(4),fS(5,"translate"),hd()()),e&2&&(_C(4),ky(hS(5,1,"The billing system stays the same \u2014 only the plan moves to the matching catalogue. Use this to fix a client holding a plan from the other generation.")));}function Li(e,l){if(e&1&&(Xs(0,"mat-option",4),V_(1),hd()),e&2){let t=l.$implicit,r=l_();ay("value",t.id),_C(),ky(r.planLabel(t));}}function Ni(e,l){e&1&&cy(0,"mat-progress-bar",8);}function Ui(e,l){e&1&&(Xs(0,"div",9)(1,"mat-icon"),V_(2,"error"),hd(),Xs(3,"span"),V_(4),fS(5,"translate"),hd()()),e&2&&(_C(4),ky(hS(5,1,"There are no plans available in the target billing system. Create one first.")));}function ji(e,l){e&1&&(Xs(0,"div",6)(1,"mat-icon"),V_(2,"toll"),hd(),Xs(3,"span"),V_(4),fS(5,"translate"),hd()()),e&2&&(_C(4),ky(hS(5,1,"Any points that were frozen will be restored, and their expiry dates extended by however long they were held.")));}function Gi(e,l){e&1&&(Xs(0,"div",9)(1,"mat-icon"),V_(2,"ac_unit"),hd(),Xs(3,"span"),V_(4),fS(5,"translate"),hd()()),e&2&&(_C(4),ky(hS(5,1,"The points balance will be frozen, not deducted. It cannot be spent while on subscription billing, and returns unchanged if the client moves back.")));}var ki=(()=>{class e{constructor(t,r,n,u){this.dialogRef=t,this.clientsService=r,this.cdr=n,this.data=u,this.selectedPlanId=null,this.plans=[],this.isLoadingPlans=false,this.EnumBillingMode=s,this.selectedMode=u.targetMode,this.plans=u.plans??[],this.selectedPlanId=this.plans.length?this.plans[0].id:null;}onModeChange(t){t!==this.selectedMode&&(this.selectedMode=t,this.selectedPlanId=null,this.plans=[],this.isLoadingPlans=true,this.cdr.detectChanges(),this.clientsService.getBillingModeSwitchTargets(this.data.clientId,t).subscribe({next:r=>{this.isLoadingPlans=false,this.plans=r?.succeeded?r.data||[]:[],this.selectedPlanId=this.plans.length?this.plans[0].id:null,this.cdr.detectChanges();},error:()=>{this.isLoadingPlans=false,this.plans=[],this.selectedPlanId=null,this.cdr.detectChanges();}}));}get isMovingToPoints(){return this.selectedMode===s.PointsBased}get isRepairOnly(){return this.selectedMode===this.data.currentMode}planLabel(t){let r=t.monthlyFee??t.annualFee??0;return `${t.nameAr} \u2014 ${r}`}confirm(){this.selectedPlanId&&this.dialogRef.close({mode:this.selectedMode,planId:this.selectedPlanId});}cancel(){this.dialogRef.close();}static{this.\u0275fac=function(r){return new(r||e)(H(an$1),H(b$1),H(Rd),H(jm))};}static{this.\u0275cmp=Kb({type:e,selectors:[["app-billing-mode-switch-dialog"]],decls:42,vars:39,consts:[["mat-dialog-title",""],[1,"f-s-14","m-b-16"],["appearance","outline",1,"w-100"],[3,"selectionChange","value"],[3,"value"],[1,"switch-opt-tag"],[1,"switch-note","switch-note--info"],[3,"ngModelChange","ngModel","disabled"],["mode","indeterminate"],[1,"switch-note","switch-note--warn"],["align","end"],["mat-stroked-button","",3,"click"],["mat-flat-button","","color","primary",3,"click","disabled"]],template:function(r,n){r&1&&(Xs(0,"h2",0),V_(1),fS(2,"translate"),hd(),Xs(3,"mat-dialog-content")(4,"p",1),V_(5),fS(6,"translate"),hd(),Xs(7,"mat-form-field",2)(8,"mat-label"),V_(9),fS(10,"translate"),hd(),Xs(11,"mat-select",3),my("selectionChange",function(k){return n.onModeChange(k.value)}),Xs(12,"mat-option",4),V_(13),fS(14,"translate"),qT(15,zi,3,3,"span",5),hd(),Xs(16,"mat-option",4),V_(17),fS(18,"translate"),qT(19,Vi,3,3,"span",5),hd()()(),qT(20,Ri,6,3,"div",6),Xs(21,"mat-form-field",2)(22,"mat-label"),V_(23),fS(24,"translate"),hd(),Xs(25,"mat-select",7),Vy("ngModelChange",function(k){return G_(n.selectedPlanId,k)||(n.selectedPlanId=k),k}),KT(26,Li,2,2,"mat-option",4,Ai),hd(),lb(),Xs(28,"mat-hint"),V_(29),fS(30,"translate"),hd()(),qT(31,Ni,1,0,"mat-progress-bar",8),qT(32,Ui,6,3,"div",9),qT(33,ji,6,3,"div",6)(34,Gi,6,3,"div",9),hd(),Xs(35,"mat-dialog-actions",10)(36,"button",11),my("click",function(){return n.cancel()}),V_(37),fS(38,"translate"),hd(),Xs(39,"button",12),my("click",function(){return n.confirm()}),V_(40),fS(41,"translate"),hd()()),r&2&&(_C(),ky(hS(2,21,"Change Billing Mode")),_C(4),Dd(" ",hS(6,23,"The subscription will be moved to the plan you choose below. Its end date stays the same \u2014 only the plan behind it changes.")," "),_C(4),ky(hS(10,25,"Billing system")),_C(2),ay("value",n.selectedMode),_C(),ay("value",n.EnumBillingMode.PointsBased),_C(),Dd(" ",hS(14,27,"Points system")," "),_C(2),ZT(n.data.currentMode===n.EnumBillingMode.PointsBased?15:-1),_C(),ay("value",n.EnumBillingMode.SubscriptionLimits),_C(),Dd(" ",hS(18,29,"Pre-paid subscription")," "),_C(2),ZT(n.data.currentMode===n.EnumBillingMode.SubscriptionLimits?19:-1),_C(),ZT(n.isRepairOnly?20:-1),_C(3),ky(hS(24,31,"Target plan")),_C(2),By("ngModel",n.selectedPlanId),ay("disabled",n.isLoadingPlans),fb(),_C(),XT(n.plans),_C(3),ky(hS(30,33,"Only plans belonging to the target billing system are listed.")),_C(2),ZT(n.isLoadingPlans?31:-1),_C(),ZT(!n.isLoadingPlans&&n.plans.length===0?32:-1),_C(),ZT(n.isMovingToPoints?33:34),_C(4),ky(hS(38,35,"Cancel")),_C(2),ay("disabled",!n.selectedPlanId),_C(),Dd(" ",hS(41,37,"Confirm")," "));},dependencies:[Kv,Pg,Tg,zc,Tt,Vg,b0,ei,L0,Yx,dn$1,da$1,vr,yr,Vw,nk,td,ed,tC,bC,sv,NC,XC,_D,il,XD,rM,Fb,t1,A1,gS,Vs,zs,NS,ZS,EI,us,ms,HI,ZI,XI,Dn$1,kE,Jv,$v,Zv,Xv,go$1,qd,YE,OT,lA,mt],styles:[".switch-note[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:flex-start;border-radius:10px;padding:12px 14px;margin-top:8px;font-size:.85rem;line-height:1.6}.switch-note--info[_ngcontent-%COMP%]{background:#eaf4ff;border:1px solid #b9d8f8}.switch-note--warn[_ngcontent-%COMP%]{background:#fff8e6;border:1px solid #f0d9a8}.switch-opt-tag[_ngcontent-%COMP%]{font-size:.68rem;opacity:.65;margin-inline-start:8px}"],changeDetection:1});}}return e})();var we=()=>["Admin_ManageClients"],Ei=()=>["Admin_ManageSubscriptions"];function Xi(e,l){if(e&1&&(Xs(0,"button",7)(1,"mat-icon"),V_(2,"tune"),hd(),V_(3),fS(4,"translate"),hd()),e&2){l_(
1);let t=v_(2);ay("matMenuTriggerFor",t),_C(3),Dd(" ",hS(4,2,"Manage")," ");}}function Zi(e,l){if(e&1){let t=o_();Xs(0,"button",3),my("click",function(){Pp(t);let n=l_(2);return Lp(n.addSubscription())}),Xs(1,"mat-icon"),V_(2,"add"),hd(),Xs(3,"span"),V_(4),fS(5,"translate"),hd()();}e&2&&(_C(4),ky(hS(5,1,"Add Subscription")));}function Yi(e,l){if(e&1){let t=o_();Qm(0,Xi,5,4,"button",2),Xs(1,"mat-menu",null,0)(3,"button",3),my("click",function(){Pp(t);let n=l_();return Lp(n.sendMessage(n.client.phoneNumber,n.client.displayName))}),Xs(4,"mat-icon"),V_(5,"chat"),hd(),Xs(6,"span"),V_(7),fS(8,"translate"),hd()(),Xs(9,"button",3),my("click",function(){Pp(t);let n=l_();return Lp(n.editClient())}),Xs(10,"mat-icon"),V_(11,"edit"),hd(),Xs(12,"span"),V_(13),fS(14,"translate"),hd()(),Qm(15,Zi,6,3,"button",4),cy(16,"mat-divider"),Xs(17,"button",3),my("click",function(){Pp(t);let n=l_();return Lp(n.changeBillingMode())}),Xs(18,"mat-icon"),V_(19,"account_balance_wallet"),hd(),Xs(20,"span"),V_(21),fS(22,"translate"),hd()(),Xs(23,"button",3),my("click",function(){Pp(t);let n=l_();return Lp(n.toggleActivateDeactivateClient())}),Xs(24,"mat-icon"),V_(25),hd(),Xs(26,"span"),V_(27),fS(28,"translate"),hd()(),cy(29,"mat-divider"),Xs(30,"button",5),my("click",function(){Pp(t);let n=l_();return Lp(n.deleteClient())}),Xs(31,"mat-icon",6),V_(32,"delete"),hd(),Xs(33,"span"),V_(34),fS(35,"translate"),hd()()();}if(e&2){let t=l_();ay("ngxPermissionsOnly",tS(19,we)),_C(7),ky(hS(8,9,"Send message to client")),_C(6),ky(hS(14,11,"Edit the client info")),_C(2),ay("ngxPermissionsOnly",tS(20,Ei)),_C(6),Fy("",hS(22,13,"Change Billing Mode")," (",t.getBillingModeLabel(),")"),_C(4),ky(t.client.isActive?"block":"check_circle"),_C(2),ky(hS(28,15,t.client.isActive?"Deactivate":"Activate")),_C(7),ky(hS(35,17,"Delete this client"));}}function Ji(e,l){if(e&1){let t=o_();Xs(0,"div",9)(1,"button",10),my("click",function(){Pp(t);let n=l_(2);return Lp(n.sendMessage(n.client.phoneNumber,n.client.displayName))}),Xs(2,"mat-icon",11),V_(3,"chat"),hd()(),Xs(4,"div",12)(5,"span",13),V_(6),fS(7,"translate"),hd(),Xs(8,"h5",14),V_(9),fS(10,"translate"),hd()()();}e&2&&(_C(6),ky(hS(7,2,"Send message to client")),_C(3),Dd(" ",hS(10,4,"Messaging")," "));}function Qi(e,l){if(e&1){let t=o_();Xs(0,"div",9)(1,"button",15),my("click",function(){Pp(t);let n=l_(2);return Lp(n.editClient())}),Xs(2,"mat-icon",11),V_(3,"edit"),hd()(),Xs(4,"div",12)(5,"span",13),V_(6),fS(7,"translate"),hd(),Xs(8,"h5",14),V_(9),fS(10,"translate"),hd()()();}e&2&&(_C(6),ky(hS(7,2,"Edit the client info")),_C(3),Dd(" ",hS(10,4,"Edit")," "));}function en(e,l){if(e&1){let t=o_();Xs(0,"div",9)(1,"button",16),my("click",function(){Pp(t);let n=l_(2);return Lp(n.addSubscription())}),Xs(2,"mat-icon",11),V_(3,"add"),hd()(),Xs(4,"div",12)(5,"span",13),V_(6),fS(7,"translate"),hd(),Xs(8,"h5",14),V_(9),fS(10,"translate"),hd()()();}e&2&&(_C(6),ky(hS(7,2,"Add Subscription")),_C(3),Dd(" ",hS(10,4,"Add a new subscription for this client.")," "));}function tn(e,l){if(e&1){let t=o_();Xs(0,"div",9)(1,"button",17),my("click",function(){Pp(t);let n=l_(3);return Lp(n.toggleActivateDeactivateClient())}),Xs(2,"mat-icon",11),V_(3,"check_circle"),hd()(),Xs(4,"div",12)(5,"span",13),V_(6),fS(7,"translate"),hd(),Xs(8,"h5",14),V_(9),fS(10,"translate"),hd()()();}e&2&&(_C(6),ky(hS(7,2,"Activate this client")),_C(3),Dd(" ",hS(10,4,"Activate")," "));}function nn(e,l){e&1&&Qm(0,tn,11,6,"div",8),e&2&&ay("ngxPermissionsOnly",tS(1,we));}function on(e,l){if(e&1){let t=o_();Xs(0,"div",9)(1,"button",18),my("click",function(){Pp(t);let n=l_(3);return Lp(n.toggleActivateDeactivateClient())}),Xs(2,"mat-icon",19),V_(3,"block"),hd()(),Xs(4,"div",12)(5,"span",13),V_(6),fS(7,"translate"),hd(),Xs(8,"h5",14),V_(9),fS(10,"translate"),hd()()();}e&2&&(_C(6),ky(hS(7,2,"Deactivate this client")),_C(3),Dd(" ",hS(10,4,"Deactivate")," "));}function an(e,l){e&1&&Qm(0,on,11,6,"div",8),e&2&&ay("ngxPermissionsOnly",tS(1,we));}function ln(e,l){if(e&1){let t=o_();Xs(0,"div",9)(1,"button",20),my("click",function(){Pp(t);let n=l_(2);return Lp(n.changeBillingMode())}),Xs(2,"mat-icon",21),V_(3,"account_balance_wallet"),hd()(),Xs(4,"div",12)(5,"span",13),V_(6),fS(7,"translate"),hd(),Xs(8,"h5",14),V_(9),fS(10,"translate"),hd()()();}if(e&2){let t=l_(2);_C(6),ky(hS(7,3,"Change Billing Mode")),_C(3),Fy(" ",hS(10,5,"Current"),": ",t.getBillingModeL
1abel()," ");}}function rn(e,l){if(e&1){let t=o_();Xs(0,"div",9)(1,"button",22),my("click",function(){Pp(t);let n=l_(2);return Lp(n.deleteClient())}),Xs(2,"mat-icon",23),V_(3,"delete"),hd()(),Xs(4,"div",12)(5,"span",13),V_(6),fS(7,"translate"),hd(),Xs(8,"h5",14),V_(9),fS(10,"translate"),hd()()();}e&2&&(_C(6),ky(hS(7,2,"Delete this client")),_C(3),Dd(" ",hS(10,4,"Delete")," "));}function sn(e,l){if(e&1&&(Xs(0,"mat-card-content",1),Qm(1,Ji,11,6,"div",8)(2,Qi,11,6,"div",8)(3,en,11,6,"div",8),qT(4,nn,1,2,"div",9),qT(5,an,1,2,"div",9),Qm(6,ln,11,7,"div",8)(7,rn,11,6,"div",8),hd()),e&2){let t=l_();_C(),ay("ngxPermissionsOnly",tS(7,we)),_C(),ay("ngxPermissionsOnly",tS(8,we)),_C(),ay("ngxPermissionsOnly",tS(9,Ei)),_C(),ZT(t.client.isActive?-1:4),_C(),ZT(t.client.isActive?5:-1),_C(),ay("ngxPermissionsOnly",tS(10,we)),_C(),ay("ngxPermissionsOnly",tS(11,we));}}var jt=(()=>{class e{constructor(t,r,n,u,k,Me,Ye,Je){this.router=t,this.clientsService=r,this.loadingService=n,this.toastr=u,this.errorService=k,this.customerService=Me,this.translate=Ye,this.dialogConfigService=Je,this.dialog=g(gr),this.displayMode="panel",this.clientUpdate=new kt;}ngOnDestroy(){this.sub&&this.sub.unsubscribe();}sendMessage(t,r){t?r?this.sub=this.customerService.getOrCreateCustomer(t,r).subscribe({next:n=>{this.loadingService.loadingOff(),n.succeeded&&this.router.navigate(["/apps/customers/customer-profile/"+n.data.id]);},error:n=>this.errorService.setError(n,"Error while sending")}):this.errorService.setError(null,"The contact name is invalid."):this.errorService.setError(null,"The selected phone is invalid!");}editClient(){let t=this.dialogConfigService.getDefaultDialogConfig();this.dialog.open(ti,E(D({},t),{width:"700px",data:{client:this.client}})).afterClosed().subscribe(n=>{n!==void 0&&n.submitted&&this.clientUpdate.emit();});}deleteClient(){this.dialog.open(Ri$1,{data:{confirmed:true}}).afterClosed().subscribe(r=>{(r===true||r?.confirmed===true)&&this.confirmDeleteClient();});}confirmDeleteClient(){this.loadingService.loadingOn(),this.clientsService.deleteClient(this.client.id).subscribe({next:t=>{this.loadingService.loadingOff(),t?.succeeded?(this.router.navigate(["/admin/clients"]),this.toastr.success("Deleted Successfully")):this.errorService.setError(t,"Fail to delete!");},error:t=>{this.loadingService.loadingOff(),this.errorService.setError(t,"Fail to delete!");}});}toggleActivateDeactivateClient(){this.client.isActive?this.deactivateClient():this.activateClient();}activateClient(){this.dialog.open(Ft,{data:{title:this.translate.instant("Activate"),message:this.translate.instant("Are you sure you want to activate this client?"),confirmText:this.translate.instant("Activate"),cancelText:this.translate.instant("Cancel"),confirmColor:"primary",cancelColor:"primary"},width:"400px"}).afterClosed().subscribe(r=>{r&&this.confirmActivateClient();});}confirmActivateClient(){this.loadingService.loadingOn(),this.clientsService.activateClientById(this.client.id).subscribe({next:t=>{this.loadingService.loadingOff(),t?.succeeded?(this.clientUpdate.emit(),this.toastr.success("Activated Successfully")):this.errorService.setError(t,"Failed to Complete the Operation");},error:t=>{this.loadingService.loadingOff(),this.errorService.setError(t,"Failed to Complete the Operation");}});}deactivateClient(){this.dialog.open(Ft,{data:{title:this.translate.instant("Deactivate"),message:this.translate.instant("Are you sure you want to deactivate this client?"),confirmText:this.translate.instant("Deactivate"),cancelText:this.translate.instant("Cancel"),confirmColor:"warn",cancelColor:"primary"},width:"400px"}).afterClosed().subscribe(r=>{r&&this.confirmDeactivateClient();});}confirmDeactivateClient(){this.loadingService.loadingOn(),this.clientsService.deactivateClientById(this.client.id).subscribe({next:t=>{this.loadingService.loadingOff(),t?.succeeded?(this.clientUpdate.emit(),this.toastr.success("Deactivated successfully")):this.errorService.setError(t,"Failed to Complete the Operation");},error:t=>{this.loadingService.loadingOff(),this.errorService.setError(t,"Failed to Complete the Operation");}});}addSubscription(){this.router.navigate(["/admin/subscriptions/new"],{queryParams:{clientId:this.client?.id}});}changeBillingMode(){let t=this.client.billingMode,r=s.PointsBased;this.loadingService.loadingOn(),this.clientsService.getBillingModeSwitchTargets(this.client.id,r).subscribe({next:n=>{this.loadingService.loadingOff();let u=n?.succeeded?n.data||[]:[];this.dialog.open(ki,E(D({},this.dialogConfigService.getDefaultDialogConfig()),{width:"520px",data:{clientId:this.client.id,currentMode:t,targetMode:r,plans:u,clientName:this.client?.businessName}})).afterClosed().subscribe(Me=>{Me?.planId&&this.confirmChangeBillingMode(Me.mode,Me.planId);});},error:n=>{this.loadingService.loadingOff(),this.errorService.setError(n,"Failed to Complete the Operation");}});}confirmChangeBillingMode(t,r){this.loadingService.loadingOn(),this.clientsService.updateBillingMode(this.client.id,t,r).subscribe({next:n=>{this.loadingService.loadingOff(),n?.succeeded?(this.client.billingMode=t,this.clientUpdate.emit(),this.toastr.success("Updated Successfully")):this.errorService.setError(n,"Failed to Complete the Operation");},error:n=>{this.loadingService.loadingOff(),this.errorService.setError(n,"Failed to Complete the Operation");}});}
1getBillingModeLabel(){return this.client.billingMode===s.PointsBased?this.translate.instant("Points Based"):this.translate.instant("Subscription Limits")}static{this.\u0275fac=function(r){return new(r||e)(H(G),H(b$1),H(P),H(lt),H(Gt$1),H(U),H(O),H(c$1))};}static{this.\u0275cmp=Kb({type:e,selectors:[["app-client-profile-options"]],inputs:{client:"client",displayMode:"displayMode"},outputs:{clientUpdate:"clientUpdate"},decls:2,vars:1,consts:[["actionsMenu","matMenu"],[1,"p-y-24","b-t-1"],["mat-stroked-button","",3,"matMenuTriggerFor",4,"ngxPermissionsOnly"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"click",4,"ngxPermissionsOnly"],["mat-menu-item","",1,"text-error",3,"click"],[1,"text-error"],["mat-stroked-button","",3,"matMenuTriggerFor"],["class","cardWithShadow d-flex align-items-center m-t-24 m-r-10 p-10",4,"ngxPermissionsOnly"],[1,"cardWithShadow","d-flex","align-items-center","m-t-24","m-r-10","p-10"],["mat-mini-fab","","aria-label","chat",1,"bg-light-primary","shadow-none","rounded","icon-48",3,"click"],[1,"d-flex","text-primary"],[1,"m-l-16","w-100"],[1,"f-s-14","d-block","m-b-4"],[1,"f-s-16","f-w-600","m-0","m-b-4"],["mat-mini-fab","","aria-label","edit",1,"bg-light-primary","shadow-none","rounded","icon-48",3,"click"],["mat-mini-fab","","aria-label","add",1,"bg-light-primary","shadow-none","rounded","icon-48",3,"click"],["mat-mini-fab","","aria-label","check circle",1,"bg-light-primary","shadow-none","rounded","icon-48",3,"click"],["mat-mini-fab","","aria-label","block",1,"bg-light-warn","shadow-none","rounded","icon-48",3,"click"],[1,"d-flex","text-warn"],["mat-mini-fab","","aria-label","account balance wallet",1,"bg-light-accent","shadow-none","rounded","icon-48",3,"click"],[1,"d-flex","text-accent"],["mat-mini-fab","","aria-label","delete",1,"bg-light-error","shadow-none","rounded","icon-48",3,"click"],[1,"d-flex","text-error"]],template:function(r,n){r&1&&qT(0,Yi,36,21)(1,sn,8,12,"mat-card-content",1),r&2&&ZT(n.displayMode==="menu"?0:1);},dependencies:[Tt,pe,Pe,Kv,Pg,Vg,b0,L0,Yx,dn$1,Vw,nk,td,tC,bC,sv,ta$1,pr,ov,NC,XC,_D,lD,il,Hg,XD,rM,Fb,t1,A1,gS,Vs,zs,Hs,NS,ZS,EI,us,ms,HI,ZI,Dn$1,kE,Jv,go$1,qd,YE,OT,lA,mt],encapsulation:2,changeDetection:1});}}return e})();var cn=(e,l)=>l.label;function dn(e,l){if(e&1){let t=o_();Xs(0,"div",15)(1,"mat-icon"),V_(2,"block"),hd(),Xs(3,"div")(4,"strong"),V_(5),fS(6,"translate"),hd(),Xs(7,"span"),V_(8),fS(9,"translate"),hd()(),Xs(10,"button",17),my("click",function(){Pp(t);let n=l_(2);return Lp(n.go("options"))}),V_(11),fS(12,"translate"),hd()();}e&2&&(_C(5),ky(hS(6,3,"This client is deactivated")),_C(3),ky(hS(9,5,"They cannot sign in or send messages until reactivated.")),_C(3),ky(hS(12,7,"Options")));}function pn(e,l){if(e&1&&(Xs(0,"span"),V_(1),fS(2,"translate"),fS(3,"date"),hd()),e&2){let t=l_(3);_C(),Fy("",hS(2,2,"Since")," ",gS$1(3,4,t.client.stopSendingSince,"dd MMM yyyy, HH:mm"));}}function mn(e,l){if(e&1){let t=o_();Xs(0,"div",16)(1,"mat-icon"),V_(2,"pause_circle"),hd(),Xs(3,"div")(4,"strong"),V_(5),fS(6,"translate"),hd(),qT(7,pn,4,7,"span"),hd(),Xs(8,"button",17),my("click",function(){Pp(t);let n=l_(2);return Lp(n.go("whatsapp-api"))}),V_(9),fS(10,"translate"),hd()();}if(e&2){let t=l_(2);_C(5),ky(hS(6,3,"Sending is stopped")),_C(2),ZT(t.client.stopSendingSince?7:-1),_C(2),ky(hS(10,5,"WhatsApp API"));}}function _n(e,l){if(e&1&&(Xs(0,"div",1),qT(1,dn,13,9,"div",15),qT(2,mn,11,7,"div",16),hd()),e&2){let t=l_();_C(),ZT(t.client.isActive?-1:1),_C(),ZT(t.isStopSending?2:-1);}}function fn(e,l){e&1&&V_(0," \u2014 ");}function Cn(e,l){if(e&1&&(V_(0),fS(1,"translate")),e&2){let t=l_();Dd(" ",hS(1,1,t.hasActiveSubscription?"Active":"None")," ");}}function un(e,l){if(e&1&&cy(0,"img",19),e&2){let t=l_().$implicit;ay("src",t.iconImg,Vg$1);}}function gn(e,l){if(e&1&&(Xs(0,"mat-icon"),V_(1),hd()),e&2){let t=l_().$implicit;_C(),ky(t.icon);}}function xn(e,l){e&1&&(V_(0),fS(1,"translate")),e&2&&Dd(" ",hS(1,1,"Checking\u2026")," ");}function hn(e,l){if(e&1&&(V_(0),fS(1,"translate")),e&2){let t=l_().$implicit;Dd(" ",hS(1,1,t.connected?"Connected":"Not connected")," ");}}
1function vn(e,l){if(e&1){let t=o_();Xs(0,"button",18),my("click",function(){let n=Pp(t).$implicit,u=l_();return Lp(u.go(n.section))}),qT(1,un,1,1,"img",19)(2,gn,2,1,"mat-icon"),Xs(3,"span",20),V_(4),fS(5,"translate"),hd(),Xs(6,"span",21),qT(7,xn,2,3)(8,hn,2,3),hd()();}if(e&2){let t=l.$implicit;_y("is-off",t.connected===false),_C(),ZT(t.iconImg?1:2),_C(3),ky(hS(5,9,t.label)),_C(2),_y("is-on",t.connected===true)("is-off",t.connected===false),_C(),ZT(t.connected===null?7:8);}}var Bi=(()=>{class e{constructor(){this.status=null,this.openSection=new kt;}get isPointsBased(){return this.client?.billingMode===s.PointsBased}get billingModeLabel(){return this.isPointsBased?"Points Based":"Subscription Limits"}get billingSection(){return this.isPointsBased?"points":"subscriptions-list"}get hasActiveSubscription(){return this.status?this.status.hasActiveSubscribtion:null}get featureCount(){return this.status?.features?.length??0}get isStopSending(){return this.client?.isStopSending===true||this.status?.isStopSending===true}get channels(){let t=this.status;return [{label:"WhatsApp",icon:"chat",iconImg:"/assets/images/icons/whatsapp.png",connected:t?t.whatsAppConnected:this.client?!!this.client.whatsAppBusinessPhoneNumberId:null,section:"whatsapp-api"},{label:"Instagram",icon:"photo_camera",iconImg:"/assets/images/icons/instagram.png",connected:t?t.isInstagramConnected:null,section:"instagram"},{label:"Messenger",icon:"forum",iconImg:"/assets/images/icons/messenger.png",connected:t?t.isMessengerConnected:null,section:"messenger"},{label:"TikTok",icon:"videocam",iconImg:"/assets/images/icons/tiktok.png",connected:t?t.isTikTokConnected:null,section:"tiktok"},{label:"X (Twitter)",icon:"tag",iconImg:"/assets/images/icons/x.png",connected:t?t.isXConnected:null,section:"x"},{label:"Salla",icon:"storefront",connected:!!this.client?.sallaMerchantId,section:"salla-auth"},{label:"Zid",icon:"store",connected:!!this.client?.zidStoreId,section:"zid-webhooks"}]}get connectedChannelCount(){return this.channels.filter(t=>t.connected===true).length}go(t){this.openSection.emit(t);}static{this.\u0275fac=function(r){return new(r||e)};}static{this.\u0275cmp=Kb({type:e,selectors:[["app-client-overview"]],inputs:{client:"client",status:"status"},outputs:{openSection:"openSection"},decls:122,vars:85,consts:[[1,"overview"],[1,"ov-alerts"],[1,"ov-tiles"],["type","button",1,"ov-tile",3,"click"],[1,"ov-tile__icon"],[1,"ov-tile__label"],[1,"ov-tile__value"],[1,"ov-tile__value","ov-tile__value--link"],[1,"ov-section"],[1,"ov-section__title"],[1,"ov-channels"],["type","button",1,"ov-channel",3,"is-off"],[1,"ov-facts"],[1,"ov-fact"],["dir","ltr"],[1,"ov-alert","ov-alert--error"],[1,"ov-alert","ov-alert--warn"],["mat-stroked-button","",3,"click"],["type","button",1,"ov-channel",3,"click"],["width","20","height","20","alt","",3,"src"],[1,"ov-channel__label"],[1,"ov-channel__state"]],template:function(r,n){r&1&&(Xs(0,"div",0),qT(1,_n,3,2,"div",1),Xs(2,"div",2)(3,"button",3),my("click",function(){return n.go("options")}),Xs(4,"span",4)(5,"mat-icon"),V_(6),hd()(),Xs(7,"span",5),V_(8),fS(9,"translate"),hd(),Xs(10,"span",6),V_(11),fS(12,"translate"),hd()(),Xs(13,"button",3),my("click",function(){return n.go(n.billingSection)}),Xs(14,"span",4)(15,"mat-icon"),V_(16),hd()(),Xs(17,"span",5),V_(18),fS(19,"translate"),hd(),Xs(20,"span",6),V_(21),fS(22,"translate"),hd()(),Xs(23,"button",3),my("click",function(){return n.go("subscriptions-list")}),Xs(24,"span",4)(25,"mat-icon"),V_(26,"workspace_premium"),hd()(),Xs(27,"span",5),V_(28),fS(29,"translate"),hd(),Xs(30,"span",6),qT(31,fn,1,0)(32,Cn,2,3),hd()(),Xs(33,"button",3),my("click",function(){return n.go("subscriptions-list")}),Xs(34,"span",4)(35,"mat-icon"),V_(36,"widgets"),hd()(),Xs(37,"span",5),V_(38),fS(39,"translate"),hd(),Xs(40,"span",6),V_(41),hd()(),Xs(42,"button",3),my("click",function(){return n.go("health")}),Xs(43,"span",4)(44,"mat-icon"),V_(45,"hub"),hd()(),Xs(46,"span",5),V_(47),fS(48,"translate"),hd(),Xs(49,"span",6),V_(50),hd()(),Xs(51,"button",3),my("click",function(){return n.go("users")}),Xs(52,"span",4)(53,"mat-icon"),V_(54,"group"),hd()(),Xs(55,"span",5),V_(56),fS(57,"translate"),hd(),Xs(58,"span",7),V_(59),fS(60,"translate"),hd()()(),Xs(61,"section",8)(62,"h4",9)(63,"mat-icon"),V_(64,"hub"),hd(),V_(65),fS(66,"translate"),hd(),Xs(67,"div",10),KT(68,vn,9,11,"button",11,cn),hd()(),Xs(70,"section",8)(71,"h4",9)(72,"mat-icon"),V_(73,"badge"),hd(),V_(74),fS(75,"translate"),hd(),Xs(76,"dl",12)(77,"div",13)(78,"dt"),V_(79),fS(80,"translate"),hd(),Xs(81,"dd"),V_(82),hd()(),Xs(83,"div",13)(84,"dt"),V_(85),fS(86,"translate"),hd(),Xs(87,"dd"),V_(88),hd()(),Xs(89,"div",13)(90,"dt"),V_(91),fS(92,"translate"),hd(),Xs(93,"dd",14),V_(94),hd()(),Xs(95,"div",13)(96,"dt"),V_(97),fS(98,"translate"),hd(),Xs(99,"dd"),V_(100),fS(101,"date"),hd()(),Xs(102,"div",13)(103,"dt"),V_(104),fS(105,"translate"),hd(),Xs(106,"dd"),V_(107),fS(108,"translate"),hd()(),Xs(109,"div",13)(110,"dt"),V_(111),fS(112,"translate"),hd(),Xs(113,"dd"),V_(114),fS(115,"translate"),hd()(),Xs(116,"div",13)(117,"dt"),V_(118),fS(119,"translate"),hd(),Xs(120,"dd"),V_(121),hd()()()()()),r&2&&(_C(),ZT(!n.client.isActive||n.isStopSending?1:-1),_C(3),_y("is-good",n.client.isActive)("is-bad",!n.client.isActive),_C(2),ky(n.client.isActive?"check_circle":"block"),_C(2),ky(hS(9,42,"Status")),_C(3),ky(hS(12,44,n.client.isActive?"Active":"Inactive")),_C(3),_y("is-accent",n.isPointsBased),_C(2),ky(n.isPointsBased?"stars":"
1credit_card"),_C(2),ky(hS(19,46,"Billing Mode")),_C(3),ky(hS(22,48,n.billingModeLabel)),_C(3),_y("is-good",n.hasActiveSubscription===true)("is-bad",n.hasActiveSubscription===false),_C(4),ky(hS(29,50,"Subscription")),_C(3),ZT(n.hasActiveSubscription===null?31:32),_C(7),ky(hS(39,52,"Features")),_C(3),ky(n.status?n.featureCount:"\u2014"),_C(6),ky(hS(48,54,"Connected channels")),_C(3),Fy("",n.status?n.connectedChannelCount:"\u2014"," / ",n.channels.length),_C(6),ky(hS(57,56,"Users")),_C(3),ky(hS(60,58,"View")),_C(6),Dd(" ",hS(66,60,"Channels & integrations")," "),_C(3),XT(n.channels),_C(6),Dd(" ",hS(75,62,"Account")," "),_C(5),ky(hS(80,64,"Business Name")),_C(3),ky(n.client.businessName||"\u2014"),_C(3),ky(hS(86,66,"Email")),_C(3),ky(n.client.email||"\u2014"),_C(3),ky(hS(92,68,"Phone Number")),_C(3),ky(n.client.phoneNumber||"\u2014"),_C(3),ky(hS(98,70,"Created On")),_C(3),ky(n.client.createdOn?gS$1(101,72,n.client.createdOn,"dd MMM yyyy"):"\u2014"),_C(4),ky(hS(105,75,"Account Manager")),_C(3),ky(n.client.accountManagerName||hS(108,77,"Unassigned")),_C(4),ky(hS(112,79,"Follower")),_C(3),ky(n.client.followerName||hS(115,81,"Unassigned")),_C(4),ky(hS(119,83,"Templates Daily Limit")),_C(3),ky(n.client.templatesDailyLimit??n.status?.templatesDailyLimit??"\u2014"));},dependencies:[Tt,Kv,Pg,Vg,b0,co$1,L0,Yx,dn$1,Vw,nk,td,tC,bC,sv,NC,XC,_D,il,XD,rM,Fb,t1,A1,gS,Vs,zs,NS,ZS,EI,us,ms,HI,ZI,Dn$1,kE,Jv,go$1,qd,YE,OT,lA,mt,zM],styles:['@charset "UTF-8";.overview[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:20px}.ov-alerts[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.ov-alert[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:var(--radius-lg, 12px);border:1px solid transparent;border-inline-start-width:3px}.ov-alert[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{flex-shrink:0}.ov-alert[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column}.ov-alert[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{font-size:var(--font-size-sm, 13px);font-weight:600}.ov-alert[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:var(--font-size-xs, 12px);color:#5d6b85}.ov-alert--error[_ngcontent-%COMP%]{background:#fa896b12;border-color:#fa896b40}.ov-alert--error[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%], .ov-alert--error[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{color:#fa896b}.ov-alert--warn[_ngcontent-%COMP%]{background:#ffae1f17;border-color:#ffae1f4d}.ov-alert--warn[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%], .ov-alert--warn[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{color:#e19000}.ov-tiles[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}.ov-tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:12px 14px;border:1px solid rgba(0,0,0,.06);border-radius:var(--radius-lg, 12px);background:#ffffffb8;cursor:pointer;text-align:start;font:inherit;transition:transform .18s cubic-bezier(.25,.1,.25,1),box-shadow .18s cubic-bezier(.25,.1,.25,1),border-color .18s cubic-bezier(.25,.1,.25,1)}.ov-tile[_ngcontent-%COMP%]:hover{transform:translateY(-2px);border-color:#1f9d4d4d;box-shadow:0 4px 14px #1f9d4d1a}.ov-tile[_ngcontent-%COMP%]:focus-visible{outline:2px solid #1f9d4d;outline-offset:2px}.ov-tile__icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:var(--radius-md, 8px);background:#e8f6ee;margin-bottom:6px}.ov-tile__icon[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-primary, #1f9d4d)}.ov-tile__icon.is-good[_ngcontent-%COMP%]{background:#13deb91f}.ov-tile__icon.is-good[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{color:#13deb9}.ov-tile__icon.is-bad[_ngcontent-%COMP%]{background:#fa896b1a}.ov-tile__icon.is-bad[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{color:#fa896b}.ov-tile__icon.is-accent[_ngcontent-%COMP%]{background:#19e3c21f}
1.ov-tile__icon.is-accent[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{color:#19e3c2}.ov-tile__label[_ngcontent-%COMP%]{font-size:var(--font-size-xs, 12px);color:#5d6b85;line-height:1.3}.ov-tile__value[_ngcontent-%COMP%]{font-size:var(--font-size-base, 15px);font-weight:700;color:#2a3547;line-height:1.3}.ov-tile__value--link[_ngcontent-%COMP%]{color:var(--color-primary, #1f9d4d);font-weight:600}.ov-section__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin:0 0 10px;font-size:var(--font-size-sm, 13px);font-weight:600;color:#2a3547}.ov-section__title[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;color:#5d6b85}.ov-channels[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px}.ov-channel[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid rgba(0,0,0,.06);border-radius:var(--radius-lg, 12px);background:#ffffffb8;cursor:pointer;text-align:start;font:inherit;transition:border-color .18s cubic-bezier(.25,.1,.25,1),background .18s cubic-bezier(.25,.1,.25,1)}.ov-channel[_ngcontent-%COMP%]:hover{border-color:#1f9d4d4d;background:#1f9d4d0a}.ov-channel[_ngcontent-%COMP%]:focus-visible{outline:2px solid #1f9d4d;outline-offset:2px}.ov-channel.is-off[_ngcontent-%COMP%]   img[_ngcontent-%COMP%], .ov-channel.is-off[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{opacity:.45}.ov-channel[_ngcontent-%COMP%]   img[_ngcontent-%COMP%], .ov-channel[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{flex-shrink:0}.ov-channel[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:#5d6b85}.ov-channel__label[_ngcontent-%COMP%]{flex:1;min-width:0;font-size:var(--font-size-sm, 13px);font-weight:500;color:#2a3547;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ov-channel__state[_ngcontent-%COMP%]{flex-shrink:0;font-size:10px;font-weight:600;letter-spacing:.2px;text-transform:uppercase;padding:2px 7px;border-radius:999px;background:#0000000d;color:#5d6b85}.ov-channel__state.is-on[_ngcontent-%COMP%]{background:#13deb921;color:#0ea68a}.ov-channel__state.is-off[_ngcontent-%COMP%]{background:#0000000d;color:#5d6b85}.ov-facts[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px;margin:0}.ov-fact[_ngcontent-%COMP%]{padding:10px 12px;border:1px solid rgba(0,0,0,.05);border-radius:var(--radius-lg, 12px);background:#fff9}.ov-fact[_ngcontent-%COMP%]   dt[_ngcontent-%COMP%]{font-size:var(--font-size-xs, 12px);color:#5d6b85;margin-bottom:2px}.ov-fact[_ngcontent-%COMP%]   dd[_ngcontent-%COMP%]{margin:0;font-size:var(--font-size-sm, 13px);font-weight:600;color:#2a3547;word-break:break-word}'],changeDetection:1});}}return e})();var bn=()=>[import('./chunk-BLLFqtAn.js').then(e=>e.ClientAccountDetailsComponent)],Mn=()=>[import('./chunk-DhHaNII_.js').then(e=>e.ClientUsersListComponent)],Pn=()=>[jt],Sn=()=>[import('./chunk-z0zJglD6.js').then(e=>e.ClientCleanupComponent)],wn=()=>[import('./chunk-DOT8fLcq.js').then(e=>e.ClientSubscriptionsComponent)],On=()=>[import('./chunk-zGvjkZOF.js').then(e=>e.InvoicesListComponent)],Tn=()=>[import('./chunk-C2zUW7HK.js').then(e=>e.ClientPaymentMethodsComponent)],yn=()=>[import('./chunk-BuBQ1bUO.js').then(e=>e.CartSummaryComponent)],In=()=>[import('./chunk-BfsngFag.js').then(e=>e.ClientPointsWalletComponent)],kn=()=>[import('./chunk-BdjB5JPV.js').then(e=>e.ClientWhatsAppApiDetailsComponent)],Dn=()=>[import('./chunk-zHaDkgOB.js').then(e=>e.AdminAPIPromotionListComponent)],En=()=>[import('./chunk-__FLMSPl.js').then(e=>e.PromotionStatsComponent)],Bn=()=>[import('./chunk-Bbvc0UxH.js').then(e=>e.ClientCatalogComponent)],Fn=()=>[import('./chunk-Dy4owMFT.js').then(e=>e.ShowInstagramDetailsComponent)],An=()=>[import('./chunk-DFqD3P6A.js').then(e=>e.ShowMessengerDetailsComponent)],zn=()=>[import('./chunk-B8EPA49c.js').then(e=>e.ShowTikTokDetailsComponent)],Vn=()=>[import('./chunk-CwcSLjit.js').then(e=>e.ShowXDetailsComponent)],Rn=()=>[import('./chunk-Ba_T4n7p.js').then(e=>e.SallaAuthStatusComponent)],Ln=()=>[import('./chunk-DmQNvtFW.js').then(e=>e.SallaNotificationsListComponent)],Nn=()=>[import('./chunk-Dk2cFpxL.js').then(e=>e.AdminZidWebhookSubscriptionsComponent)],Un=()=>[import('./chunk-Co2Uw-re.js').then(e=>e.ZidNotificationsListComponent)],jn=()=>[import('./chunk-BP2J6pdI.js').then(e=>e.ClientHealthComponent)],Gn=()=>[import('./chunk-BellSckX.js').then(e=>e.MessagesCounterComponent)],$n=()=>[import('./chunk-BcTm0lqc.js').then(e=>e.ClientActivityTabComponent)],Wn=()=>[import('./chunk-OxfsmNyt.js').then(e=>e.ClientMappedCommentsComponent)],Kn=()=>[import('./chunk-Dvia1tla.js').then(e=>e.ClientNotesComponent)],Hn=()=>["Overview answers 'is this client OK?' at a glance; every tile opens the section behind it.","Pick a section from the sidebar; the open section is kept in the URL, so links are shareable.","Subscription, points and features are where billing problems are diagnosed.","A greyed channel with 'Not connected' simply means this client never linked that account."],qn=()=>["Admin_ManageClients"],Fi=e=>[e],Ze=e=>({$implicit:e}),Xn=(e,l,t)=>({clientId:e,merchant:l,clientName:t}),Gt=(e,l)=>l.id;function Zn(e,l){if(e&1&&cy(0,"img",4),e&2){let t=l_().$implicit;ay("src",t.iconImg,Vg$1);}}function Yn(e,l){if(e&1&&(Xs(0,"mat-icon",5),V_(1),hd()),e&2){let t=l_().$implicit;_C(),ky(t.icon);}}function Jn(e,l){if(e&1&&(cy(0,"span",8),fS(1,"translate")),e&2){let t=l_().$implicit,r=l_();_y("is-on",r.connectionState(t.connectionKey)===true),ay("matTooltip",hS(1,3,r.connectionState(t.connectionKey)?"Connected":"Not connected"));}}
1function Qn(e,l){if(e&1){let t=o_();Xs(0,"button",3),my("click",function(){let n=Pp(t).$implicit,u=l_();return Lp(u.selectSection(n.id))}),qT(1,Zn,1,1,"img",4)(2,Yn,2,1,"mat-icon",5),Xs(3,"span",6),V_(4),fS(5,"translate"),hd(),qT(6,Jn,2,5,"span",7),hd();}if(e&2){let t=l.$implicit,r=l_();_y("nav-item--overview",t.id===r.overviewSection)("is-active",r.isSectionActive(t.id)),sy("aria-current",r.isSectionActive(t.id)?"page":null),_C(),ZT(t.iconImg?1:2),_C(3),ky(hS(5,8,t.label)),_C(2),ZT(r.connectionState(t.connectionKey)!==null?6:-1);}}function eo(e,l){if(e&1){let t=o_();Xs(0,"button",37),fS(1,"translate"),my("click",function(){Pp(t);let n=l_(2);return Lp(n.navFilter="")}),Xs(2,"mat-icon"),V_(3,"close"),hd()();}e&2&&sy("aria-label",hS(1,1,"Clear"));}function to(e,l){e&1&&dy(0);}function io(e,l){if(e&1&&(Xs(0,"div"),Qm(1,to,1,0,"ng-container",39),hd()),e&2){let t=l_(2).$implicit;l_(2);let r=v_(2);_C(),ay("ngTemplateOutlet",r)("ngTemplateOutletContext",nS(2,Ze,t));}}function no(e,l){if(e&1&&Qm(0,io,2,4,"div",38),e&2){let t=l_().$implicit;ay("ngxPermissionsOnly",nS(1,Fi,t.permission));}}function oo(e,l){e&1&&dy(0);}function ao(e,l){if(e&1&&Qm(0,oo,1,0,"ng-container",39),e&2){let t=l_().$implicit;l_(2);let r=v_(2);ay("ngTemplateOutlet",r)("ngTemplateOutletContext",nS(2,Ze,t));}}function lo(e,l){if(e&1&&qT(0,no,1,3,"div")(1,ao,1,4,"ng-container"),e&2){let t=l.$implicit;ZT(t.permission?0:1);}}function ro(e,l){e&1&&dy(0);}function so(e,l){if(e&1&&(Xs(0,"div"),Qm(1,ro,1,0,"ng-container",39),hd()),e&2){let t=l_(2).$implicit;l_(5);let r=v_(2);_C(),ay("ngTemplateOutlet",r)("ngTemplateOutletContext",nS(2,Ze,t));}}function co(e,l){if(e&1&&Qm(0,so,2,4,"div",38),e&2){let t=l_().$implicit;ay("ngxPermissionsOnly",nS(1,Fi,t.permission));}}function po(e,l){e&1&&dy(0);}function mo(e,l){if(e&1&&Qm(0,po,1,0,"ng-container",39),e&2){let t=l_().$implicit;l_(5);let r=v_(2);ay("ngTemplateOutlet",r)("ngTemplateOutletContext",nS(2,Ze,t));}}function _o(e,l){if(e&1&&qT(0,co,1,3,"div")(1,mo,1,4,"ng-container"),e&2){let t=l.$implicit;ZT(t.permission?0:1);}}function fo(e,l){if(e&1&&(Xs(0,"div",43),KT(1,_o,2,1,null,null,Gt),hd()),e&2){let t=l_(2).$implicit,r=l_(2);_C(),XT(r.visibleItems(t));}}function Co(e,l){if(e&1){let t=o_();Xs(0,"div",40)(1,"button",41),my("click",function(){Pp(t);let n=l_().$implicit,u=l_(2);return Lp(u.toggleGroup(n.id))}),Xs(2,"mat-icon",5),V_(3),hd(),Xs(4,"span",6),V_(5),fS(6,"translate"),hd(),Xs(7,"mat-icon",42),V_(8,"expand_more"),hd()(),qT(9,fo,3,0,"div",43),hd();}if(e&2){let t=l_().$implicit,r=l_(2);_C(),_y("has-active",r.groupHasActiveSection(t)&&!r.isGroupExpanded(t.id)),sy("aria-expanded",r.isGroupExpanded(t.id)),_C(2),ky(t.icon),_C(2),ky(hS(6,8,t.label)),_C(2),_y("is-open",r.isGroupExpanded(t.id)),_C(2),ZT(r.isGroupExpanded(t.id)||r.navFilter?9:-1);}}function uo(e,l){if(e&1&&qT(0,Co,10,10,"div",40),e&2){let t=l.$implicit,r=l_(2);ZT(r.isGroupVisible(t)?0:-1);}}function go(e,l){if(e&1&&(Xs(0,"span",30),fS(1,"translate"),Xs(2,"mat-icon"),V_(3,"support_agent"),hd(),V_(4),hd()),e&2){let t=l_(2);ay("matTooltip",hS(1,2,"Account Manager")),_C(4),Dd(" ",t.client.accountManagerName," ");}}function xo(e,l){if(e&1&&(Xs(0,"span",30),fS(1,"translate"),Xs(2,"mat-icon"),V_(3,"person_search"),hd(),V_(4),hd()),e&2){let t=l_(2);ay("matTooltip",hS(1,2,"Follower")),_C(4),Dd(" ",t.client.followerName," ");}}function ho(e,l){if(e&1){let t=o_();Xs(0,"div",44)(1,"app-client-profile-options",45),my("clientUpdate",function(){Pp(t);let n=l_(2);return Lp(n.refreshClient())}),hd()();}if(e&2){let t=l_(2);_C(),ay("client",t.client);}}function vo(e,l){if(e&1&&(Xs(0,"span",48),V_(1),fS(2,"translate"),hd()),e&2){let t=l_(3);_C(),ky(hS(2,1,t.activeGroupLabel));}}function bo(e,l){if(e&1&&(Xs(0,"div",34)(1,"div",46)(2,"mat-icon"),V_(3),hd()(),Xs(4,"h3",47),V_(5),fS(6,"translate"),hd(),qT(7,vo,3,3,"span",48),hd()),e&2){let t=l_(2);_C(3),ky(t.activeItem?.icon||"dashboard"),_C(2),ky(hS(6,3,t.activeItem?.label||"")),_C(2),ZT(t.activeGroupLabel?7:-1);}}function Mo(e,l){e&1&&(Xs(0,"div",36)(1,"mat-icon"),V_(2,"link_off"),hd(),Xs(3,"h3"),V_(4),fS(5,"translate"),hd(),Xs(6,"p"),V_(7),fS(8,"translate"),hd()()),e&2&&(_C(4),ky(hS(5,2,"Not connected")),_C(3),ky(hS(8,4,"This client has no store connected for this integration.")));}
1function Po(e,l){if(e&1){let t=o_();Xs(0,"app-client-overview",50),my("openSection",function(n){Pp(t);let u=l_(3);return Lp(u.selectSection(n))}),hd();}if(e&2){let t=l_(3);ay("client",t.client)("status",t.clientStatus);}}function So(e,l){if(e&1){let t=o_();Xs(0,"app-client-account-details",51),my("clientUpdate",function(){Pp(t);let n=l_(4);return Lp(n.refreshClient())}),hd();}if(e&2){let t=l_(4);ay("client",t.client);}}function wo(e,l){e&1&&cy(0,"div",52);}function Oo(e,l){e&1&&(Km(0,So,1,1)(1,wo,1,0),HT(2,0,bn,null,1),UT());}function To(e,l){if(e&1){let t=o_();Xs(0,"app-client-users-list",53),my("addUser",function(){Pp(t);let n=l_(4);return Lp(n.onAddUserClick(n.id))}),hd();}if(e&2){let t=l_(4);ay("clientId",t.id);}}function yo(e,l){e&1&&cy(0,"div",52);}function Io(e,l){e&1&&(Km(0,To,1,1)(1,yo,1,0),HT(2,0,Mn,null,1),UT());}function ko(e,l){if(e&1){let t=o_();Xs(0,"app-client-profile-options",51),my("clientUpdate",function(){Pp(t);let n=l_(4);return Lp(n.refreshClient())}),hd();}if(e&2){let t=l_(4);ay("client",t.client);}}function Do(e,l){e&1&&cy(0,"div",52);}function Eo(e,l){e&1&&(Km(0,ko,1,1)(1,Do,1,0),HT(2,0,Pn,null,1),UT());}function Bo(e,l){if(e&1&&cy(0,"app-client-cleanup",54),e&2){let t=l_(4);ay("clientId",t.client.id);}}function Fo(e,l){e&1&&cy(0,"div",52);}function Ao(e,l){e&1&&(Km(0,Bo,1,1)(1,Fo,1,0),HT(2,0,Sn,null,1),UT());}function zo(e,l){if(e&1&&cy(0,"app-client-subscriptions",54),e&2){let t=l_(4);ay("clientId",t.id);}}function Vo(e,l){e&1&&cy(0,"div",52);}function Ro(e,l){e&1&&(Km(0,zo,1,1)(1,Vo,1,0),HT(2,0,wn,null,1),UT());}function Lo(e,l){if(e&1&&cy(0,"app-invoices-list",55),e&2){let t=l_(4);ay("clientId",t.id)("clientName",t.client.businessName)("loadMode","clientId")("isAdmin",true);}}function No(e,l){e&1&&cy(0,"div",52);}function Uo(e,l){e&1&&(Km(0,Lo,1,4)(1,No,1,0),HT(2,0,On,null,1),UT());}function jo(e,l){if(e&1&&cy(0,"app-client-payment-methods",54),e&2){let t=l_(4);ay("clientId",t.id);}}function Go(e,l){e&1&&cy(0,"div",52);}function $o(e,l){e&1&&(Km(0,jo,1,1)(1,Go,1,0),HT(2,0,Tn,null,1),UT());}function Wo(e,l){if(e&1&&cy(0,"app-cart-summary",56),e&2){let t=l_(4);ay("clientId",t.id)("isAdmin",true);}}function Ko(e,l){e&1&&cy(0,"div",52);}function Ho(e,l){e&1&&(Km(0,Wo,1,2)(1,Ko,1,0),HT(2,0,yn,null,1),UT());}function qo(e,l){if(e&1&&cy(0,"app-client-points-wallet",54),e&2){let t=l_(4);ay("clientId",t.client.id);}}function Xo(e,l){e&1&&cy(0,"div",52);}function Zo(e,l){e&1&&(Km(0,qo,1,1)(1,Xo,1,0),HT(2,0,In,null,1),UT());}function Yo(e,l){if(e&1){let t=o_();Xs(0,"app-client-whatsapp-api-details",51),my("clientUpdate",function(n){Pp(t);let u=l_(4);return Lp(u.client=n)}),hd();}if(e&2){let t=l_(4);ay("client",t.client);}}function Jo(e,l){e&1&&cy(0,"div",52);}function Qo(e,l){e&1&&(Km(0,Yo,1,1)(1,Jo,1,0),HT(2,0,kn,null,1),UT());}function ea(e,l){if(e&1&&cy(0,"admin-api-promotions-list",54),e&2){let t=l_(4);ay("clientId",t.client.id);}}function ta(e,l){e&1&&cy(0,"div",52);}function ia(e,l){e&1&&(Km(0,ea,1,1)(1,ta,1,0),HT(2,0,Dn,null,1),UT());}function na(e,l){if(e&1&&cy(0,"app-promotion-stats",54),e&2){let t=l_(4);ay("clientId",t.client.id);}}function oa(e,l){e&1&&cy(0,"div",52);}function aa(e,l){e&1&&(Km(0,na,1,1)(1,oa,1,0),HT(2,0,En,null,1),UT());}function la(e,l){if(e&1){let t=o_();Xs(0,"app-client-catalog",51),my("clientUpdate",function(n){Pp(t);let u=l_(4);return Lp(u.client=n)}),hd();}if(e&2){let t=l_(4);ay("client",t.client);}}function ra(e,l){e&1&&cy(0,"div",52);}function sa(e,l){e&1&&(Km(0,la,1,1)(1,ra,1,0),HT(2,0,Bn,null,1),UT());}function ca(e,l){if(e&1&&cy(0,"app-show-instagram-details",57),e&2){let t=l_(4);ay("isAdmin",true)("id",t.client.id);}}function da(e,l){e&1&&cy(0,"div",52);}function pa(e,l){e&1&&(Km(0,ca,1,2)(1,da,1,0),HT(2,0,Fn,null,1),UT());}function ma(e,l){if(e&1&&cy(0,"app-show-messenger-details",57),e&2){let t=l_(4);ay("isAdmin",true)("id",t.client.id);}}function _a(e,l){e&1&&cy(0,"div",52);}function fa(e,l){e&1&&(Km(0,ma,1,2)(1,_a,1,0),HT(2,0,An,null,1),UT());}function Ca(e,l){if(e&1&&cy(0,"app-show-tiktok-details",57),e&2){let t=l_(4);ay("isAdmin",true)("id",t.client.id);}}function ua(e,l){e&1&&cy(0,"div",52);}function ga(e,l){e&1&&(Km(0,Ca,1,2)(1,ua,1,0),HT(2,0,zn,null,1),UT());}function xa(e,l){if(e&1&&cy(0,"app-show-x-details",57),e&2){let t=l_(4);ay("isAdmin",true)("id",t.client.id);}}function ha(e,l){e&1&&cy(0,"div",52);}function va(e,l){e&1&&(Km(0,xa,1,2)(1,ha,1,0),HT(2,0,Vn,null,1),UT());}function ba(e,l){if(e&1&&cy(0,"app-salla-auth-status",58),e&2){let t=l_(4);ay("singleClient",oS(1,Xn,t.client.id,t.client.sallaMerchantId,t.client.displayName||t.client.businessName||""));}}function Ma(e,l){e&1&&cy(0,"div",52);}function Pa(e,l){e&1&&(Km(0,ba,1,5)(1,Ma,1,0),HT(2,0,Rn,null,1),UT());}function Sa(e,l){if(e&1&&cy(0,"app-salla-notificatios-list",59),e&2){let t=l_(4);ay("sallaMerchantId",t.client.sallaMerchantId)("isAdmin",true)("clientId",t.client.id);}}function wa(e,l){e&1&&cy(0,"div",52);}function Oa(e,l){e&1&&(Km(0,Sa,1,3)(1,wa,1,0),HT(2,0,Ln,null,1),UT());}function Ta(e,l){if(e&1&&cy(0,"app-admin-zid-webhook-subscriptions",54),e&2){let t=l_(4);ay("clientId",t.client.id);}}function ya(e,l){e&1&&cy(0,"div",52);}
1function Ia(e,l){e&1&&(Km(0,Ta,1,1)(1,ya,1,0),HT(2,0,Nn,null,1),UT());}function ka(e,l){if(e&1&&cy(0,"app-zid-notifications-list",60),e&2){let t=l_(4);ay("zidStoreId",t.client.zidStoreId)("isAdmin",true)("clientId",t.client.id);}}function Da(e,l){e&1&&cy(0,"div",52);}function Ea(e,l){e&1&&(Km(0,ka,1,3)(1,Da,1,0),HT(2,0,Un,null,1),UT());}function Ba(e,l){if(e&1&&cy(0,"app-client-health",54),e&2){let t=l_(4);ay("clientId",t.client.id);}}function Fa(e,l){e&1&&cy(0,"div",52);}function Aa(e,l){e&1&&(Km(0,Ba,1,1)(1,Fa,1,0),HT(2,0,jn,null,1),UT());}function za(e,l){if(e&1&&cy(0,"messages-counter",56),e&2){let t=l_(4);ay("clientId",t.client.id)("isAdmin",true);}}function Va(e,l){e&1&&cy(0,"div",52);}function Ra(e,l){e&1&&(Km(0,za,1,2)(1,Va,1,0),HT(2,0,Gn,null,1),UT());}function La(e,l){if(e&1&&cy(0,"app-client-activity-tab",61),e&2){let t=l_(4);ay("clientId",t.client.id)("clientName",t.client.displayName||t.client.businessName||"");}}function Na(e,l){e&1&&cy(0,"div",52);}function Ua(e,l){e&1&&(Km(0,La,1,2)(1,Na,1,0),HT(2,0,$n,null,1),UT());}function ja(e,l){if(e&1&&cy(0,"app-client-mapped-comments",54),e&2){let t=l_(4);ay("clientId",t.client.id);}}function Ga(e,l){e&1&&cy(0,"div",52);}function $a(e,l){e&1&&(Km(0,ja,1,1)(1,Ga,1,0),HT(2,0,Wn,null,1),UT());}function Wa(e,l){if(e&1&&cy(0,"app-client-notes",54),e&2){let t=l_(4);ay("clientId",t.client.id);}}function Ka(e,l){e&1&&cy(0,"div",52);}function Ha(e,l){e&1&&(Km(0,Wa,1,1)(1,Ka,1,0),HT(2,0,Kn,null,1),UT());}function qa(e,l){if(e&1&&qT(0,Po,1,2,"app-client-overview",49)(1,Oo,4,0)(2,Io,4,0)(3,Eo,4,0)(4,Ao,4,0)(5,Ro,4,0)(6,Uo,4,0)(7,$o,4,0)(8,Ho,4,0)(9,Zo,4,0)(10,Qo,4,0)(11,ia,4,0)(12,aa,4,0)(13,sa,4,0)(14,pa,4,0)(15,fa,4,0)(16,ga,4,0)(17,va,4,0)(18,Pa,4,0)(19,Oa,4,0)(20,Ia,4,0)(21,Ea,4,0)(22,Aa,4,0)(23,Ra,4,0)(24,Ua,4,0)(25,$a,4,0)(26,Ha,4,0),e&2){let t,r=l_(2);ZT((t=r.activeSection)===r.overviewSection?0:t==="account"?1:t==="users"?2:t==="options"?3:t==="cleanup"?4:t==="subscriptions-list"?5:t==="receipts"?6:t==="payment-methods"?7:t==="cart"?8:t==="points"?9:t==="whatsapp-api"?10:t==="api-promotions"?11:t==="promotion-stats"?12:t==="catalog"?13:t==="instagram"?14:t==="messenger"?15:t==="tiktok"?16:t==="x"?17:t==="salla-auth"?18:t==="salla-notifications"?19:t==="zid-webhooks"?20:t==="zid-notifications"?21:t==="health"?22:t==="message-stats"?23:t==="activity"?24:t==="comments"?25:t==="notes"?26:-1);}}function Xa(e,l){if(e&1){let t=o_();Xs(0,"mat-card",2)(1,"mat-card-header",9)(2,"mat-card-title",10)(3,"div",11)(4,"button",12),fS(5,"translate"),my("click",function(){Pp(t);let n=l_();return Lp(n.sidebarOpen=!n.sidebarOpen)}),Xs(6,"mat-icon"),V_(7,"short_text"),hd()(),Xs(8,"span",13),V_(9),hd()()()(),Xs(10,"div",14)(11,"div",15),my("click",function(){Pp(t);let n=l_();return Lp(n.sidebarOpen=false)}),hd(),Xs(12,"aside",16)(13,"div",17)(14,"mat-icon"),V_(15,"search"),hd(),Xs(16,"input",18),fS(17,"translate"),fS(18,"translate"),Vy("ngModelChange",function(n){Pp(t);let u=l_();return G_(u.navFilter,n)||(u.navFilter=n),Lp(n)}),hd(),lb(),qT(19,eo,4,3,"button",19),hd(),Xs(20,"nav",20),KT(21,lo,2,1,null,null,Gt),KT(23,uo,1,1,null,null,Gt),hd()(),Xs(25,"main",21)(26,"div",22)(27,"div",23),V_(28),hd(),Xs(29,"div",24)(30,"h2",25),V_(31),hd(),Xs(32,"div",26)(33,"span",27),cy(34,"span",28),V_(35),fS(36,"translate"),hd(),Xs(37,"span",29),fS(38,"translate"),Xs(39,"mat-icon"),V_(40),hd(),V_(41),fS(42,"translate"),hd(),qT(43,go,5,4,"span",30),qT(44,xo,5,4,"span",30),Xs(45,"button",31),fS(46,"translate"),my("click",function(){Pp(t);let n=l_();return Lp(n.copyClientId())}),Xs(47,"mat-icon"),V_(48,"content_copy"),hd(),V_(49),fS(50,"translate"),hd()()(),Qm(51,ho,2,1,"div",32),hd(),Xs(52,"div",33),qT(53,bo,8,5,"div",34),Xs(54,"div",35),qT(55,Mo,9,6,"div",36)(56,qa,27,1),hd()()()()();}if(e&2){let t=l_();_C(4),sy("aria-label",hS(5,29,"Sections")),_C(5),ky(t.client.businessName),_C(),_y("sidebar-open",t.sidebarOpen),_C(),_y("visible",t.sidebarOpen),_C(5),By("ngModel",t.navFilter),ay("placeholder",hS(17,31,"Find a section")),sy("aria-label",hS(18,33,"Find a section")),fb(),_C(3),ZT(t.navFilter?19:-1),_C(2),XT(t.
1standaloneItems),_C(2),XT(t.navGroups),_C(5),ky(t.getInitials()),_C(3),ky(t.client.displayName||t.client.businessName),_C(2),_y("active",t.client.isActive)("inactive",!t.client.isActive),_C(2),Dd(" ",hS(36,35,t.client.isActive?"Active":"Inactive")," "),_C(2),_y("points",t.isPointsBased()),ay("matTooltip",hS(38,37,"Billing Mode")),_C(3),ky(t.isPointsBased()?"stars":"credit_card"),_C(),Dd(" ",hS(42,39,t.getBillingModeLabel())," "),_C(2),ZT(t.client.accountManagerName?43:-1),_C(),ZT(t.client.followerName?44:-1),_C(),ay("matTooltip",hS(46,41,"Copy client ID")),_C(4),Dd(" ",hS(50,43,"ID")," "),_C(2),ay("ngxPermissionsOnly",tS(45,qn)),_C(2),ZT(t.activeSection!==t.overviewSection?53:-1),_C(2),ZT(t.isStoreSectionBlocked()?55:56);}}var Xe="overview",Xl=(()=>{class e{constructor(t,r,n,u,k,Me,Ye,Je){this.activatedRoute=t,this.clientsService=r,this.router=n,this.loadingService=u,this.errorService=k,this.toastr=Me,this.translate=Ye,this.breakpointObserver=Je,this.destroyRef=g(He),this.clipboard=g(b),this.overviewSection=Xe,this.standaloneItems=[{id:Xe,label:"Overview",icon:"space_dashboard"},{id:"activity",label:"Activity",icon:"history",permission:"Read_Clients"},{id:"comments",label:"Comments",icon:"comment",permission:"Read_Clients"},{id:"notes",label:"Notes",icon:"sticky_note_2",permission:"Admin_ManageClients"}],this.clientStatus=null,this.activeSection=Xe,this.activeItem=null,this.activeGroupLabel="",this.expandedGroups={},this.sidebarOpen=false,this.isOver=false,this.navFilter="",this.navGroups=[{id:"account",label:"Account",icon:"person",items:[{id:"account",label:"Account details",icon:"badge"},{id:"users",label:"Users",icon:"group"},{id:"options",label:"Options",icon:"more_horiz",permission:"Admin_ManageClients"},{id:"cleanup",label:"Clean Up",icon:"delete_sweep",permission:"Admin_Cleanup"}]},{id:"billing",label:"Billing",icon:"credit_card",items:[{id:"subscriptions-list",label:"Subscriptions List",icon:"list"},{id:"receipts",label:"Receipts",icon:"receipt"},{id:"payment-methods",label:"Payment methods",icon:"credit_card"},{id:"cart",label:"Cart",icon:"shopping_cart"},{id:"points",label:"Points",icon:"stars"}]},{id:"whatsapp",label:"WhatsApp",icon:"chat",items:[{id:"whatsapp-api",label:"WhatsApp API",icon:"chat",connectionKey:"whatsapp"},{id:"api-promotions",label:"API Promotions",icon:"task_alt"},{id:"promotion-stats",label:"Promotion Stats",icon:"bar_chart"},{id:"catalog",label:"Catalog",icon:"inventory_2"}]},{id:"channels",label:"Channels",icon:"hub",items:[{id:"instagram",label:"Instagram",icon:"photo_camera",iconImg:"/assets/images/icons/instagram.png",connectionKey:"instagram"},{id:"messenger",label:"Messenger",icon:"forum",iconImg:"/assets/images/icons/messenger.png",connectionKey:"messenger"},{id:"tiktok",label:"TikTok",icon:"videocam",iconImg:"/assets/images/icons/tiktok.png",connectionKey:"tiktok"},{id:"x",label:"X (Twitter)",icon:"tag",iconImg:"/assets/images/icons/x.png",connectionKey:"x"}]},{id:"stores",label:"Stores",icon:"storefront",items:[{id:"salla-auth",label:"Salla Token",icon:"key",connectionKey:"salla"},{id:"salla-notifications",label:"Salla Notifications",icon:"notifications",connectionKey:"salla"},{id:"zid-webhooks",label:"Zid Webhooks",icon:"webhook",connectionKey:"zid"},{id:"zid-notifications",label:"Zid Notifications",icon:"notifications",connectionKey:"zid"}]},{id:"insights",label:"Insights",icon:"insights",items:[{id:"health",label:"Health Status",icon:"monitor_heart"},{id:"message-stats",label:"Message Stats",icon:"bar_chart"}]}];}ngOnInit(){this.activatedRoute.paramMap.pipe(w(this.destroyRef)).subscribe(t=>{let r=t.get("id");!r||r===this.id||(this.id=r,this.getProfile(r),this.getClientStatus(r));}),this.activatedRoute.queryParamMap.pipe(w(this.destroyRef)).subscribe(t=>{let r=t.get("section");this.applySection(r&&this.findItem(r)?r:Xe);}),this.breakpointObserver.observe([qi.Handset,qi.TabletPortrait]).pipe(w(this.destroyRef)).subscribe(t=>{this.isOver=t.matches;});}getProfile(t){this.loadingService.loadingOn(),this.clientsService.getClientById(t).pipe(w(this.destroyRef)).subscribe({next:r=>{this.loadingService.loadingOff(),r.succeeded?this.client=r.data:this.errorService.setError(r,"Error while getting the data");},error:r=>{this.loadingService.loadingOff(),this.errorService.setError(r,"Error while getting the data");}});}getClientStatus(t){this.clientsService.getClientStatus(t,null,null).pipe(w(this.destroyRef)).subscribe({next:r=>{let n=r?.data??[];this.clientStatus=n.length?n[0]:null;},error:()=>{this.clientStatus=null;}});}
1refreshClient(){this.getProfile(this.id),this.getClientStatus(this.id);}selectSection(t){this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:{section:t},queryParamsHandling:"merge"}),this.isOver&&(this.sidebarOpen=false);}applySection(t){this.activeSection=t,this.activeItem=this.findItem(t);let r=this.navGroups.find(n=>n.items.some(u=>u.id===t));this.activeGroupLabel=r?.label??"",r&&(this.expandedGroups[r.id]=true);}findItem(t){let r=this.standaloneItems.find(n=>n.id===t);if(r)return r;for(let n of this.navGroups){let u=n.items.find(k=>k.id===t);if(u)return u}return null}toggleGroup(t){this.expandedGroups[t]=!this.expandedGroups[t];}isGroupExpanded(t){return !!this.expandedGroups[t]}isSectionActive(t){return this.activeSection===t}groupHasActiveSection(t){return t.items.some(r=>r.id===this.activeSection)}matches(t,r){if(t.toLowerCase().includes(r))return  true;let n=this.translate.instant(t);return typeof n=="string"&&n.toLowerCase().includes(r)}visibleItems(t){let r=this.navFilter.trim().toLowerCase();return r?t.items.filter(n=>this.matches(n.label,r)):t.items}isGroupVisible(t){let r=this.navFilter.trim().toLowerCase();return r?this.matches(t.label,r)||this.visibleItems(t).length>0:true}connectionState(t){if(!t)return null;switch(t){case "salla":return !!this.client?.sallaMerchantId;case "zid":return !!this.client?.zidStoreId;case "whatsapp":return this.clientStatus?this.clientStatus.whatsAppConnected:this.client?!!this.client.whatsAppBusinessPhoneNumberId:null;case "instagram":return this.clientStatus?this.clientStatus.isInstagramConnected:null;case "messenger":return this.clientStatus?this.clientStatus.isMessengerConnected:null;case "tiktok":return this.clientStatus?this.clientStatus.isTikTokConnected:null;case "x":return this.clientStatus?this.clientStatus.isXConnected:null;default:return null}}isStoreSectionBlocked(){if(!this.activeItem)return  false;let t=this.activeItem.connectionKey;return t!=="salla"&&t!=="zid"?false:this.connectionState(t)===false}getInitials(){let t=this.client?.displayName||this.client?.businessName||"",r=t.trim().split(/\s+/);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():(t.substring(0,2)||"??").toUpperCase()}getBillingModeLabel(){return this.client?.billingMode===s.PointsBased?"Points Based":"Subscription Limits"}isPointsBased(){return this.client?.billingMode===s.PointsBased}copyClientId(){this.client?.id&&(this.clipboard.copy(this.client.id),this.toastr.success("Copied to clipboard"));}onAddUserClick(t){this.router.navigate(["/admin/clients/add-user",t]);}static{this.\u0275fac=function(r){return new(r||e)(H(V),H(b$1),H(G),H(P),H(Gt$1),H(lt),H(O),H(Zt))};}static{this.\u0275cmp=Kb({type:e,selectors:[["app-client-profile"]],decls:4,vars:3,consts:[["navRow",""],["helpKey","admin-client-profile","intro","Everything about one client, split into sections down the side \u2014 subscription, features, wallet, users, integrations and settings.","warning","Changes here take effect on a live client account immediately. There is no draft state.",3,"steps"],[1,"profile-glass-card","overflow-hidden"],["type","button",1,"nav-item",3,"click"],["width","18","height","18","alt","",1,"nav-item__icon-img",3,"src"],[1,"nav-item__icon"],[1,"nav-item__label"],[1,"nav-dot",3,"is-on","matTooltip"],[1,"nav-dot",3,"matTooltip"],[1,"mobile-header","p-10","d-block","d-lg-none"],[1,"m-b-0"],[1,"d-flex","align-items-center"],["mat-icon-button","",3,"click"],[1,"mobile-header-title","m-l-16"],[1,"client-profile-box"],[1,"client-profile-backdrop",3,"click"],[1,"client-profile-sidebar"],[1,"sidebar-filter"],["type","text",3,"ngModelChange","ngModel","placeholder"],["type","button",1,"sidebar-filter__clear"],[1,"sidebar-scroll"],[1,"client-profile-content"],[1,"client-header-bar","d-none","d-lg-flex"],[1,"client-avatar"],[1,"client-info"],[1,"client-name"],[1,"client-meta"],[1,"status-badge"],[1,"status-dot"],[1,"billing-chip",3,"matTooltip"],[1,"info-chip",3,"matTooltip"],["type","button",1,"info-chip","info-chip--button",3,"click","matTooltip"],["class","client-header-actions",4,"ngxPermissionsOnly"],[1,"content-scroll"],[1,"section-header"],[1,"panel-content"],[1,"not-connected-state"],["type","button",1,"sidebar-filter__clear",3,"click"],[4,"ngxPermissionsOnly"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"nav-group"],["type","button",1,"nav-item","nav-group__header",3,"click"],[1,"nav-item__chevron"],[1,"nav-children"],[1,"client-header-actions"],["displayMode","menu",3,"clientUpdate","client"],[1,"section-icon-box"],[1,"section-title"],[1,"section-breadcrumb"],[3,"client","status"],[3,"openSection","client","status"],[3,"clientUpdate","client"],[1,"section-skeleton"],[3,"addUser","clientId"],[3,"clientId"],[3,"clientId","clientName","loadMode","isAdmin"],[3,"clientId","isAdmin"],[3,"isAdmin","id"],[3,"singleClient"],[3,"sallaMerchantId","isAdmin","clientId"],[3,"zidStoreId","isAdmin","clientId"],[3,"clientId","clientName"]],template:function(r,n){r&1&&(cy(0,"app-page-help",1),Qm(1,Qn,7,10,"ng-template",null,0,vS),qT(3,Xa,57,46,"mat-card",2)),r&2&&(ay("steps",tS(2,Hn)),_C(3),ZT(n.client?3:-1));},dependencies:[ce,Tt,pe,Pe,Bi,jt,Kv,FM,Pg,Is,Tg,zc,Vg,b0,L0,Yx,dn$1,Vw,nk,td,tC,bC,sv,NC,XC,_D,oD,mD,sD,il,XD,rM,Fb,t1,A1,gS,Vs,Fi$1,NS,ZS,EI,us,ms,HI,ZI,Dn$1,kE,Jv,go$1,qd,on$1,YE,OT,lA,mt],styles:['@charset "UTF-8";[_nghost-%COMP%]     .profile-glass-card{border-radius:16px;background:#ffffffa6;backdrop-filter:blur(20px) saturate(1.6);-webkit-backdrop-filter:blur(20px) saturate(1.6);border:1px solid rgba(255,255,255,.5);box-shadow:var(--shadow-float);overflow:hidden}[_nghost-%COMP%]     .profile-glass-card .mat-mdc-card-header, [_nghost-%COMP%]     .profile-glass-card .mdc-card__actions{padding:0}.client-profile-box[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:row;height:calc(100dvh - 182px);min-height:400px;overflow:hidden}.client-profile-backdrop[_ngcontent-%COMP%]{display:none;position:fixed;inset:0;z-index:4;background:#00000059;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);opacity:0;pointer-events:none;transition:opacity .3s cubic-bezier(.25,.1,.25,1)}.client-profile-backdrop.visible[_ngcontent-%COMP%]{opacity:1;pointer-events:auto}@media(max-width:991px){.client-profile-backdrop[_ngcontent-%COMP%]{display:block}}.client-profile-sidebar[_ngcontent-%COMP%]{flex:0 0 auto;width:210px;min-width:210px;height:100%;overflow:hidden;display:flex;flex-direction:column;background:#ffffffc7;backdrop-filter:blur(40px) saturate(1.8);-webkit-backdrop-filter:blur(40px) saturate(1.8);border-inline-end:1px solid rgba(0,0,0,.06);z-index:5}@media(max-width:991px){.client-profile-sidebar[_ngcontent-%COMP%]{position:fixed;inset-inline-start:0;top:0;bottom:0;width:260px;min-width:260px;transform:translate(-100%);transition:transform .3s cubic-bezier(.25,.1,.25,1);box-shadow:var(--shadow-float)}}@media(max-width:991px){[dir=rtl][_ngcontent-%COMP%]   .client-profile-sidebar[_ngcontent-%COMP%]{transform:translate(100%)}}@media(max-width:991px){.client-profile-box.sidebar-open[_ngcontent-%COMP%]   .client-profile-sidebar[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%]   .client-profile-box.sidebar-open[_ngcontent-%COMP%]   .client-profile-sidebar[_ngcontent-%COMP%]{transform:translate(0)}}.sidebar-filter[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex-shrink:0;margin:10px 10px 6px;padding:6px 8px;border-radius:12px;background:#00000009;border:1px solid transparent;transition:border-color .2s cubic-bezier(.25,.1,.25,1),background .2s cubic-bezier(.25,.1,.25,1)}.sidebar-filter[_ngcontent-%COMP%]:focus-within{background:#fff;border-color:#1f9d4d59}.sidebar-filter[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;color:#5d6b85;flex-shrink:0}.sidebar-filter[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:var(--font-size-sm, 13px);color:#2a3547}.sidebar-filter[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:#5d6b85}.sidebar-filter__clear[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;border:0;padding:0;background:transparent;cursor:pointer;color:#5d6b85}.sidebar-filter__clear[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:15px;width:15px;height:15px}.sidebar-scroll[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:4px 10px 12px}.sidebar-scroll[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px}.sidebar-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.sidebar-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#1f9d4d2e;border-radius:var(--radius-sm)}.sidebar-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#1f9d4d59}.nav-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:9px;width:100%;margin-bottom:2px;padding:7px 10px;border:0;border-radius:12px;background:transparent;font:inherit;text-align:start;cursor:pointer;position:relative;transition:background .2s cubic-bezier(.25,.1,.25,1)}.nav-item[_ngcontent-%COMP%]:hover{background:#1f9d4d0f}.nav-item[_ngcontent-%COMP%]:focus-visible{outline:2px solid #1f9d4d;outline-offset:-2px}.nav-item__icon[_ngcontent-%COMP%]{flex-shrink:0;font-size:18px;width:18px;height:18px;color:#5d6b85}.nav-item__icon-img[_ngcontent-%COMP%]{flex-shrink:0}.nav-item__label[_ngcontent-%COMP%]{flex:1;min-width:0;font-size:var(--font-size-sm, 13px);font-weight:500;color:#2a3547;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nav-item__chevron[_ngcontent-%COMP%]{flex-shrink:0;font-size:18px;width:18px;height:18px;color:#5d6b85;transition:transform .25s cubic-bezier(.25,.1,.25,1)}.nav-item__chevron.is-open[_ngcontent-%COMP%]{transform:rotate(180deg)}.nav-item.is-active[_ngcontent-%COMP%]{background:#1f9d4d1a;box-shadow:0 1px 4px #1f9d4d14}.nav-item.is-active[_ngcontent-%COMP%]:before{content:"";position:absolute;inset-inline-start:0;top:50%;transform:translateY(-50%);width:3px;height:60%;border-start-end-radius:var(--radius-sm);border-end-end-radius:var(--radius-sm);background:linear-gradient(180deg,#1f9d4d,#19e3c2)}.nav-item.is-active[_ngcontent-%COMP%]   .nav-item__label[_ngcontent-%COMP%]{color:#1f9d4d;font-weight:600}.nav-item.is-active[_ngcontent-%COMP%]   .nav-item__icon[_ngcontent-%COMP%]{color:#1f9d4d}.nav-item--overview[_ngcontent-%COMP%]{margin-bottom:6px}.nav-group__header.has-active[_ngcontent-%COMP%]   .nav-item__label[_ngcontent-%COMP%], .nav-group__header.has-active[_ngcontent-%COMP%]   .nav-item__icon[_ngcontent-%COMP%]{color:#1f9d4d;font-weight:600}.nav-group[_ngcontent-%COMP%]{margin-bottom:2px}.nav-children[_ngcontent-%COMP%]{margin-top:2px;margin-bottom:6px;margin-inline-start:14px;padding-inline-start:8px;border-inline-start:2px solid rgba(31,157,77,.15)}
1.nav-dot[_ngcontent-%COMP%]{flex-shrink:0;width:7px;height:7px;border-radius:50%;background:#00000029}.nav-dot.is-on[_ngcontent-%COMP%]{background:#13deb9;box-shadow:0 0 5px #13deb98c}.client-profile-content[_ngcontent-%COMP%]{flex:1;min-width:0;min-height:0;overflow:hidden;display:flex;flex-direction:column;background:#f5f7fa80}.content-scroll[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:auto;padding:12px 16px;display:flex;flex-direction:column}.client-header-bar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:14px 20px;background:#fff9;border-bottom:1px solid rgba(0,0,0,.04);flex-shrink:0}.client-header-bar[_ngcontent-%COMP%]   .client-avatar[_ngcontent-%COMP%]{width:44px;height:44px;border-radius:var(--radius-lg);display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#1f9d4d,#19e3c2);color:#fff;font-weight:700;font-size:var(--font-size-lg);letter-spacing:.5px;flex-shrink:0;box-shadow:0 2px 8px #1f9d4d40}.client-header-bar[_ngcontent-%COMP%]   .client-info[_ngcontent-%COMP%]{flex:1;min-width:0}.client-header-bar[_ngcontent-%COMP%]   .client-info[_ngcontent-%COMP%]   .client-name[_ngcontent-%COMP%]{font-size:var(--font-size-base);font-weight:700;color:#2a3547;margin:0;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.client-header-bar[_ngcontent-%COMP%]   .client-info[_ngcontent-%COMP%]   .client-meta[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-top:4px;flex-wrap:wrap}.client-header-actions[_ngcontent-%COMP%]{flex-shrink:0}.status-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:2px 10px;border-radius:9999px;font-size:11px;font-weight:600;letter-spacing:.3px;text-transform:uppercase}.status-badge[_ngcontent-%COMP%]   .status-dot[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%}.status-badge.active[_ngcontent-%COMP%]{background:#13deb91f;color:#0faf92}.status-badge.active[_ngcontent-%COMP%]   .status-dot[_ngcontent-%COMP%]{background:#13deb9;box-shadow:0 0 6px #13deb980}.status-badge.inactive[_ngcontent-%COMP%]{background:#fa896b1a;color:#fa896b}.status-badge.inactive[_ngcontent-%COMP%]   .status-dot[_ngcontent-%COMP%]{background:#fa896b}.billing-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:9999px;font-size:11px;font-weight:600;background:#1f9d4d1a;color:#14633a}.billing-chip[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:13px;width:13px;height:13px;color:inherit}.billing-chip.points[_ngcontent-%COMP%]{background:#19e3c229;color:#0b6254}.info-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:9999px;font-size:11px;color:#5d6b85;background:#0000000a;max-width:220px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.info-chip[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:13px;width:13px;height:13px;color:inherit;flex-shrink:0}.info-chip--button[_ngcontent-%COMP%]{border:0;font:inherit;font-size:11px;cursor:pointer}.info-chip--button[_ngcontent-%COMP%]:hover{background:#1f9d4d1a;color:#14633a}.section-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:0 4px 12px;margin-bottom:4px;border-bottom:1px solid rgba(0,0,0,.05);flex-shrink:0}.section-header[_ngcontent-%COMP%]   .section-icon-box[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:var(--radius-lg);display:flex;align-items:center;justify-content:center;background:#e8f6ee;flex-shrink:0}.section-header[_ngcontent-%COMP%]   .section-icon-box[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:var(--font-size-lg);width:18px;height:18px;color:var(--color-primary, #1f9d4d)}.section-header[_ngcontent-%COMP%]   .section-title[_ngcontent-%COMP%]{font-size:var(--font-size-base);font-weight:600;color:#2a3547;margin:0}.section-header[_ngcontent-%COMP%]   .section-breadcrumb[_ngcontent-%COMP%]{font-size:var(--font-size-xs);color:#5d6b85;margin-inline-start:auto}.panel-content[_ngcontent-%COMP%]{flex:1;min-height:0}.section-skeleton[_ngcontent-%COMP%]{height:180px;border-radius:var(--radius-lg, 12px);background:linear-gradient(100deg,#00000008 30%,#0000000f,#00000008 70%);background-size:220% 100%;animation:_ngcontent-%COMP%_section-skeleton-sweep 1.2s cubic-bezier(.25,.1,.25,1) infinite}@keyframes _ngcontent-%COMP%_section-skeleton-sweep{0%{background-position:180% 0}to{background-position:-20% 0}}.not-connected-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:260px;padding:24px}.not-connected-state[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:44px;width:44px;height:44px;color:#5d6b85;opacity:.55;margin-bottom:12px}.not-connected-state[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{font-size:var(--font-size-lg);font-weight:700;color:#2a3547;margin:0 0 6px}.not-connected-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-size:var(--font-size-sm);color:#5d6b85;margin:0;max-width:320px}.mobile-header[_ngcontent-%COMP%]{background:linear-gradient(135deg,#1f9d4d,#19e3c2);border-start-start-radius:16px;border-start-end-radius:16px}.mobile-header[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{color:#fff!important}.mobile-header[_ngcontent-%COMP%]   .mobile-header-title[_ngcontent-%COMP%]{font-size:var(--font-size-base);font-weight:600;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media(max-width:991px){.client-profile-box[_ngcontent-%COMP%]{height:calc(100dvh - 140px)}}'],changeDetection:1});}}return e})();export{Xl as ClientProfileComponent};

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.