1"use strict";(self.webpackChunkinitiative_as_a_service=self.webpackChunkinitiative_as_a_service||[]).push([["src_app_features_users_users_module_ts"],{16966(j,M,r){r.d(M,{UsersModule:()=>bo});var p=r(72200),m=r(89417),f=r(36471),P=r(71228),T=r(99213),x=r(59115),S=r(9183),_=r(76192),F=r(96850),c=r(78884),u=r(69327),I=r(84467),$=r(7957),b=r(46828),O=r(51549),h=r(52021),g=r(89451),e=r(73664),l=r(2615);let L=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.$C({type:n})}static{this.\u0275inj=l.G2t({imports:[p.MD]})}}return n})();var re=r(38132),Fe=r(21413),ae=r(56977),D=r(96697),De=r(5964),K=r(86906),Re=r(88192),k=function(n){return n.ForumNetwork="ForumNetwork",n}(k||{}),we=r(75139),E=r(32591),y=r(91708),le=r(15548),v=r(1835),H=r(20731),X=r(95416);function Ne(n,s){if(1&n&&(e.EFF(0),e.nrm(1,"br"),e.EFF(2," Please reach out to the member or "),e.j41(3,"a",8),e.EFF(4,"Forum Spaces support"),e.k0s(),e.EFF(5," team for further support ")),2&n){const t=e.XpG();e.SpI(" ",t.userSubject," already part of this community. "),e.R7$(3),e.Y8G("href","mailto:"+t.supportEmail,e.B4B)}}function je(n,s){if(1&n&&e.EFF(0),2&n){const t=e.XpG();e.SpI(" ",t.errorMessage," ")}}
1function Ge(n,s){if(1&n&&(e.j41(0,"span",6),e.EFF(1),e.k0s()),2&n){const t=s.$implicit;e.R7$(),e.SpI(" ",t," ")}}let Le=(()=>{class n{constructor(t,o,i,a){this.data=t,this.dialogRef=o,this.sharableLinkService=i,this.snackBar=a,this.supportEmail=le.k}get errorMessage(){return"We can't invite one or more users right now. Please try again later."}get userSubject(){return(()=>1===this.data.emails.length?"User is":"Users are")()}get isAlreadyMemberErrorType(){return this.data.emails.length>0&&this.data.emails.every(t=>this.isAlreadyMemberError(t))}isAlreadyMemberError(t){return this.data.reasons?.[t]?.email?.includes("already a member")||!1}onLeave(){this.dialogRef.close()}handleCopyToClipboard(){this.sharableLinkService.tryCopyToClipboard(this.data.emails.join(" "))||this.snackBar.openFromComponent(y.Y,v.z)}static{this.\u0275fac=function(o){return new(o||n)(e.rXU(E.Vh),e.rXU(E.CP),e.rXU(H.c),e.rXU(X.UG))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["app-invite-members-confirmation-dialog"]],decls:12,vars:1,consts:[["modalContainerHeader","","headerText","Invite members",3,"closeModal"],[1,"invite-members-confirmation-dialog__description-container"],["svgIcon","warning-triangle",1,"invite-members-confirmation-dialog__description-icon"],[1,"body-sm-regular-higher","invite-members-confirmation-dialog__description-text"],[1,"invite-members-confirmation-dialog__clipboard-container"],[1,"invite-members-confirmation-dialog__clipboard-email-addresses-container"],[1,"body-sm-regular","invite-members-confirmation-dialog__clipboard-email-addresses"],["modalContainerFooter","","primaryButtonLabel","Done","secondaryButtonLabel","Copy emails",3,"primaryButtonClick","secondaryButtonClick"],[1,"link-basic-styles",3,"href"]],template:function(o,i){1&o&&(e.j41(0,"lib-modal-container")(1,"lib-modal-container-header",0),e.bIt("closeModal",function(){return i.onLeave()}),e.k0s(),e.j41(2,"div",1),e.nrm(3,"mat-icon",2),e.j41(4,"span",3),e.nVh(5,Ne,6,2)(6,je,1,1),e.k0s()(),e.j41(7,"div",4)(8,"div",5),e.Z7z(9,Ge,2,1,"span",6,e.fX1),e.k0s()(),e.j41(11,"lib-modal-container-footer",7),e.bIt("primaryButtonClick",function(){return i.onLeave()})("secondaryButtonClick",function(){return i.handleCopyToClipboard()}),e.k0s()()),2&o&&(e.R7$(5),e.vxM(i.isAlreadyMemberErrorType?5:6),e.R7$(4),e.Dyx(i.data.emails))},dependencies:[p.MD,c.CYR,c.bEy,c.rxf,T.m_,T.An],styles:[".invite-members-confirmation-dialog__description-container[_ngcontent-%COMP%], .invite-members-confirmation-dialog__container[_ngcontent-%COMP%]{display:flex;flex-direction:column}.invite-members-confirmation-dialog__description-text[_ngcontent-%COMP%], .invite-members-confirmation-dialog__header-title[_ngcontent-%COMP%]{color:var(--colour-text-primary)}.invite-members-confirmation-dialog__description-icon[_ngcontent-%COMP%]{color:var(--colour-icon-warning-default)}.invite-members-confirmation-dialog__description-text[_ngcontent-%COMP%]{margin-top:var(--space-100)}.invite-members-confirmation-dialog__clipboard-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) 32px;max-height:192px;padding:var(--space-100);gap:var(--space-100);border-radius:var(--border-radius-100);margin-top:var(--space-150);background-color:var(--colour-surface-neutral-subtle-default);overflow:hidden auto}.invite-members-confirmation-dialog__clipboard-email-addresses-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;margin:var(--space-050) 0;padding:var(--space-050) var(--space-100)}.invite-members-confirmation-dialog__clipboard-email-addresses[_ngcontent-%COMP%]{color:var(--colour-text-primary)}.invite-members-confirmation-dialog__clipboard-email-addresses[_ngcontent-%COMP%]:not(:last-child){margin-bottom:var(--space-100)}"],changeDetection:0})}}return n})();var ce=r(10438),J=r(70980),Be=r(19714),Z=function(n){return n.SUCCESS="success",n.FAILED="failed",n}(Z||{}),Ve=r(92549),me=function(n){return n.LimitExceeded="maximum number of emails allowed is 100",n}(me||{}),B=r(17705),A=r(44513),Q=r(49030),Xe=r(64727),pe=r(89079),q=r(29330),Y=r(84412),de=r(96354),ue=r(88141);let Ye=(()=>{class n{constructor(){this.communitiesService=(0,l.WQX)(A.d),this.destroyRef=(0,l.WQX)(l.abz),this.subcommunities$=new Y.t([]),this.isLoadingSubcommunities=(0,l.vPA)(!1),this.page=1,this.query=""}onQueryChange(t){this.page=1,this.query=t,this.subcommunities$.next([]),this.get
1Subcommunities(!0)}onCommunitiesSelectorScrolled(){this.page=this.page+1,this.getSubcommunities()}getSubcommunities(t){this.isLoadingSubcommunities.set(!0),this.communitiesService.getRelatedSubcommunities(this.getInitiativeId(),new q.Nl({fromObject:{query:this.query,allowsInvite:!0,page:this.page}})).pipe((0,de.T)(o=>o.body?.data||[]),(0,ue.M)(o=>{this.subcommunities$.next(t?o:[...this.subcommunities$.value,...o]),this.isLoadingSubcommunities.set(!1)}),(0,pe.pQ)(this.destroyRef)).subscribe()}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275dir=e.FsC({type:n})}}return n})(),ee=(()=>{class n extends Ye{constructor(){super(...arguments),this.initiativeId=B.hFB.required(),this.label=(0,B.hFB)("Invite member(s) to community"),this.inputId=(0,B.hFB)("subcommunity"),this.internalControl=new m.MJ(null),this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this.internalControl.valueChanges.pipe((0,pe.pQ)(this.destroyRef)).subscribe(t=>{this.onChange(t)})}getInitiativeId(){return this.initiativeId()}writeValue(t){this.internalControl.setValue(t,{emitEvent:!1})}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){t?this.internalControl.disable({emitEvent:!1}):this.internalControl.enable({emitEvent:!1})}static{this.\u0275fac=(()=>{let t;return function(i){return(t||(t=e.xGo(n)))(i||n)}})()}static{this.\u0275cmp=e.VBU({type:n,selectors:[["app-subcommunity-selector-field"]],inputs:{initiativeId:[1,"initiativeId"],label:[1,"label"],inputId:[1,"inputId"]},features:[e.Jv_([{provide:m.kq,useExisting:(0,l.Rfq)(()=>n),multi:!0}]),e.Vt3],decls:5,vars:9,consts:[[1,"form-row"],[1,"label","body-small",3,"for"],[1,"subcommunity-selector-field-autocomplete",3,"queryChange","scrolled","id","noResultsText","formControl","dataSource","showLoading"]],template:function(o,i){1&o&&(e.j41(0,"div",0)(1,"label",1),e.EFF(2),e.k0s(),e.j41(3,"app-select-autocomplete",2),e.nI1(4,"async"),e.bIt("queryChange",function(d){return i.onQueryChange(d)})("scrolled",function(){return i.onCommunitiesSelectorScrolled()}),e.k0s()()),2&o&&(e.R7$(),e.Y8G("for",i.inputId()),e.R7$(),e.JRh(i.label()),e.R7$(),e.Y8G("id",i.inputId())("noResultsText","No subcommunities available for selection")("formControl",i.internalControl)("dataSource",e.bMT(4,7,i.subcommunities$))("showLoading",i.isLoadingSubcommunities()))},dependencies:[m.X1,m.BC,m.l_,h.K,p.Jj],styles:["[_nghost-%COMP%] .form-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-family:var(--typography-label-regular-font-family);font-weight:var(--typography-label-regular-font-weight);line-height:var(--typography-label-regular-line-height);font-size:var(--typography-label-regular-font-size);letter-spacing:var(--typography-body-regular-letter-spacing);text-transform:var(--typography-body-regular-text-case);display:inline-block;margin:0 0 var(--space-100)}"],changeDetection:0})}}return n})();function Ae(n,s){if(1&n){const t=e.RV6();e.j41(0,"div",10)(1,"div",11),e.nrm(2,"lib-input",12),e.j41(3,"div",13)(4,"lib-button",14),e.bIt("buttonClick",function(i){l.eBV(t);const a=e.XpG(2);return l.Njj(a.copyLink(i))}),e.EFF(5," Copy Link "),e.k0s()()()()}if(2&n){const t=e.XpG(2);e.R7$(4),e.Aen(t.buttonStyle.Outline),e.Y8G("size",t.buttonSize.Regular)("type",t.buttonType.Secondary)}}function ze(n,s){if(1&n&&(e.j41(0,"mat-chip-row",23),e.EFF(1),e.k0s()),2&n){const t=s.$implicit;e.R7$(),e.SpI(" ",t," ")}}function We(n,s){if(1&n){const t=e.RV6();e.j41(0,"lib-chip",24),e.bIt("removed",function(){const i=l.eBV(t).$implicit,a=e.XpG(3);return l.Njj(a.remove(i))}),e.k0s()}if(2&n){const t=s.$implicit,o=e.XpG(3);e.Y8G("label",t)("selectable",!1)("type",o.chipType.Choice)("removable",!0)}}function Ke(n,s){if(1&n){const t=e.RV6();e.j41(0,"div",15)(1,"label",16),e.EFF(2,"Enter email address"),e.k0s(),e.j41(3,"mat-form-field",17)(4,"mat-chip-grid",18,0),e.DNE(6,ze,2,1,"mat-chip-row",19),e.Z7z(7,We,1,4,"lib-chip",20,e.Vm6),e.j41(9,"input",21,1),e.bIt("paste",function(i){l.eBV(t);const a=e.sdS(10),d=e.XpG(2);return l.Njj(d.handlePaste(i,a))})("matChipInputTokenEnd",function(i){l.eBV(t);const a=e.XpG(2);return l.Njj(a.add(i))}),e.k0s()()(),e.j41(11,"label",22),e.EFF(12,"Enter multiple emails, separated by comma"),e.k0s()()}if(2&n){const t=e.sdS(5),o=e.XpG(2);e.R7$(6),e.Y8G("ngForOf",null==o.emails?null:o.emails.value),e.R7$(),e.Dyx(null==o.emails?null:o.emails.value),e.R7$(2),e.Y8G("matChipInputFor",t)("matChipInputAddOnBlur",!0)("matChipInputSeparatorKeyCodes",o.separatorKeyCodes)}}
1function He(n,s){if(1&n&&e.nrm(0,"app-subcommunity-selector-field",25),2&n){const t=e.XpG(2);e.Y8G("initiativeId",t.activeCommunity.initiativeId)}}function Je(n,s){if(1&n&&(e.j41(0,"form",6),e.DNE(1,Ae,6,4,"div",7)(2,Ke,13,4,"div",8)(3,He,1,1,"app-subcommunity-selector-field",9),e.k0s()),2&n){const t=e.XpG();e.Y8G("formGroup",t.form),e.R7$(),e.Y8G("ngIf",t.activeCommunity.allowSelfSignUpForNonToplinkUsers),e.R7$(),e.Y8G("ngIf",t.activeCommunity.allowInvitationOfNontoplinkUsers||t.activeCommunity.type===t.communityType.ForumNetwork),e.R7$(),e.Y8G("ngIf",t.activeCommunity.type===t.communityType.ForumNetwork)}}let Ze=(()=>{class n{constructor(t,o,i,a,d,C,R,V){this.dialog=t,this.activeCommunity=o,this.formBuilder=i,this.sharableLinkService=a,this.communitiesService=d,this.snackBar=C,this.cdr=R,this.mixPanelService=V,this.isLoading=!1,this.separatorKeyCodes=[ce.Fm,ce.KE],this.buttonSize=c.or0,this.buttonStyle=c.inm,this.buttonType=c.VQ,this.buttonState=c.UwB,this.chipType=c.pbY,this.inputSize=c.YIZ,this.communityType=k,this.faildEmailInvitationsText="email invitations failed to be sent"}get emails(){return this.form?.get("emailAddress")}ngOnInit(){const t=(0,Ve.cK)(this.activeCommunity.initiativeUrl);this.form=this.formBuilder.group({inviteLink:[{value:t,disabled:!0}],emailAddress:[[],[m.k0.required,(0,Be.s)()]]}),this.activeCommunity.type===this.communityType.ForumNetwork&&this.form.addControl("subcommunity",new m.MJ("",[m.k0.required]))}onLeave(t){this.dialog.close(t)}copyLink(t){t.preventDefault();const o=this.form?.get("inviteLink")?.value;if(o){const i=this.sharableLinkService.tryCopyToClipboard(o);this.mixPanelService.pageTrack(this.mixPanelService.ACTIONS.SUBMIT,{type:"copy link"}),this.snackBar.openFromComponent(y.Y,i?v.W$:v.z)}}add(t){const o=t.value.trim();o&&""!==o&&this.emails&&this.emails.patchValue([...this.emails.value,o]),t.chipInput.clear()}remove(t){const o=this.emails?.value.indexOf(t);o>=0&&this.emails?.patchValue([...this.emails.value.slice(0,o),...this.emails.value.slice(o+1)])}handlePaste(t,o){t.preventDefault();const i=t.clipboardData?.getData("text");if(!i||!this.emails)return;const a=i.split(",").map(d=>d.trim()).filter(d=>d.length>0);this.emails.patchValue([...this.emails.value,...a]),o.value=""}onSendInvite(){const t=this.emails?.value,o=this.form?.get("subcommunity")?.value?.id;this.emails?.errors?.invalidEmail?this.snackBar.openFromComponent(y.Y,v.Dh):(this.isLoading=!0,this.communitiesService.inviteExternalMemberToCommunity(t,this.activeCommunity.initiativeId,o).pipe((0,D.s)(1),(0,J.j)(()=>{this.isLoading=!1,this.cdr.detectChanges()})).subscribe(a=>{this.handleInvitationResult(a),this.mixPanelService.pageTrack(this.mixPanelService.SUBMIT_TYPE.SEND_INVITE,{type:"mail",count:t.length})},a=>{400===a.status&&this.notifyErrorStatus(a.error)}))}handleInvitationResult(t){if(Object.values(t).some(o=>o.status===Z.FAILED&&o.reasons)){const o=Object.keys(t).filter(i=>t[i].status===Z.FAILED).reduce((i,a)=>{i.emails.push(a);const d=t[a].reasons;return d&&(i.reasons||(i.reasons={}),i.reasons[a]=d),i},{emails:[]});this.onLeave(o)}else this.notifySuccessStatus(),this.onLeave()}notifySuccessStatus(t){const o=t?{...v.oy,data:{...v.oy.data,message:`${t} ${v.oy.data.message}`}}:v.oy;this.snackBar.openFromComponent(y.Y,o)}getErrorConfig(t){return t.error===me.LimitExceeded?v.O3:v.wM}notifyErrorStatus(t){t.emails.forEach(o=>{this.snackBar.openFromComponent(y.Y,this.getErrorConfig(o))})}static{this.\u0275fac=function(o){return new(o||n)(e.rXU(E.CP),e.rXU(E.Vh),e.rXU(m.ze),e.rXU(H.c),e.rXU(A.d),e.rXU(X.UG),e.rXU(B.gRc),e.rXU(Q.aO))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["app-invite-members-dialog"]],standalone:!1,decls:4,vars:3,consts:[["chipList",""],["emailInput",""],[3,"leave"],["modalContainerHeader","","headerText","Invite Members",3,"closeModal"],[3,"formGroup",4,"ngIf"],["modalContainerFooter","","primaryButtonLabel","Send Invite","secondaryButtonLabel","Cancel",3,"primaryButtonClick","secondaryButtonClick","isPrimaryButtonDisabled","isLoading"],[3,"formGroup"],["class","form-row",4,"ngIf"],["class","form-row mb-3",4,"ngIf"],["formControlName","subcommunity","label","Invite member(s) to community",3,"initiativeId",4,"ngIf"],[1,"form-row"],[1,"link-wrapper"],["id","inviteLink","name","invite-link","label","Invite link","formControlName","inviteLink"],[1,"copy-link"],[3,"buttonClick","size","type"],[1,"form-row","mb-3"],["for","emailAddress",1,"label"],["appearance","outline",1,"chips-autocomplete-input"],["formControlName","emailAddress","name","email-address"],["class","hidden",4,"ngFor","ngForOf"],[3,"label","selectable","type","removable"],["id","emailAddress","type","email",3,"paste","matChipInputTokenEnd","matChipInputFor","matChipInputAddOnBlur","matChipInputSeparatorKeyCodes"],["for","emailAddress",1,"one-forum-form-hint"],[1,"hidden"],[3,"removed","label","selectable","type","removable"],["formControlName","subcommunity","label","Invite member(s) to community",3,"initiativeId"]],template:function(o,i){1&o&&(e.j41(0,"lib-modal-container",2),e.bIt("leave",function(){return i.onLeave()}),e.j41(1,"lib-modal-container-header",3),e.bIt("closeModal",function(){return i.onLeave()}),e.k0s(),e.DNE(2,Je,4,4,"form",4),e.j41(3,"lib-modal-container-footer",5),e.bIt("primaryButtonClick",function(){return i.onSendInvite()})("secondaryButtonClick",function(){return i.onLeave()}),e.k0s()()),2&o&&(e.R7$(2),e.Y8G("ngIf",i.form),e.R7$(),e.Y8G("isPrimaryButtonDisabled",!(null==i.form||!i.form.invali
1d))("isLoading",i.isLoading))},dependencies:[p.Sq,p.bT,m.qT,m.BC,m.cb,m.j4,m.JD,c.Qpp,c.wux,c.CYR,c.rxf,c.bEy,c.Sjx,f.HW,f.D7,f.jH,Xe.rl,ee],styles:["[_nghost-%COMP%] .form-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-family:var(--typography-label-regular-font-family);font-weight:var(--typography-label-regular-font-weight);line-height:var(--typography-label-regular-line-height);font-size:var(--typography-label-regular-font-size);letter-spacing:var(--typography-body-regular-letter-spacing);text-transform:var(--typography-body-regular-text-case);display:inline-block;margin:0 0 var(--space-100)}[_nghost-%COMP%] .form-row[_ngcontent-%COMP%]:not(:last-child){margin:0 0 var(--space-200)}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{width:100%;margin-bottom:var(--space-100)}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{max-height:150px;overflow:auto}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mdc-evolution-chip-set__chips{flex-wrap:wrap;gap:var(--space-100)}[_nghost-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-100)}[_nghost-%COMP%] .link-wrapper[_ngcontent-%COMP%] lib-input[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0})}}return n})();var _e=function(n){return n.MEMBERS="Members",n.FOLLOWERS="Followers",n.INVITED="Invited members",n}(_e||{}),te=r(91029),fe=r(71153),ge=r(983),Qe=r(99437),he=r(73878);let ve=(()=>{class n{constructor(t,o){this.httpClient=t,this.apiEndpointService=o,this.followers$=new Y.t([]),this.isFollowersLoaded$=new Y.t(!1),this.isFollowersLoading$=new Y.t(!1),this.totalFollowers$=new Y.t(""),this.followersHasNextPage=!0}getFollowers(t){return this.followersHasNextPage?(this.isFollowersLoading$.next(!0),this.httpClient.get(this.followersNextPage??`${this.apiEndpointService.getFWSEndpoint()}/communities/v1/sites/${t}/followers`,{observe:"response"}).pipe((0,de.T)(o=>{this.totalFollowers$.next(o.headers.get("X-Total-Count")),this.followersNextPage=o.headers.get("Link");const i=o.body;this.handleFollowersNextPage();const a=this.mapFollowersToFollowersRows(i),d=[...this.followers$.value,...a];return this.followers$.next(d),i}),(0,Qe.W)(o=>ge.w),(0,J.j)(()=>{this.isFollowersLoading$.next(!1),this.isFollowersLoaded$.next(!0)}))):ge.w}promoteToMember(t,o,i,a){const d={emails:i,...a?{subCommunityId:a}:{}};return this.httpClient.post(`${this.apiEndpointService.getFWSEndpoint()}/communities/v1/sites/${t}/invitations`,d,{observe:"response"}).pipe((0,ue.M)(()=>{const C=this.followers$.value,R=(Number(this.totalFollowers$.value)-1).toString(),V=C.findIndex(W=>W.id===o);C.splice(V,1),this.followers$.next(C),this.totalFollowers$.next(R)}))}resetFollowers(){this.followers$.next([]),this.totalFollowers$.next(""),this.isFollowersLoaded$.next(!1),this.followersHasNextPage=!0,this.followersNextPage=void 0}handleFollowersNextPage(){if(this.followersNextPage){const t=this.followersNextPage.split(";")[0];this.followersNextPage=t.substring(1,t.length-1)}else this.followersHasNextPage=!1}mapFollowersToFollowersRows(t){return t.map(o=>({...o,primaryPosition:o.email,primaryOrganisation:o.organization}))}static{this.\u0275fac=function(o){return new(o||n)(l.KVO(q.Qq),l.KVO(he.J))}}static{this.\u0275prov=l.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var z=r(61945),qe=r(31397),Ce=r(84100),et=r(10373),be=r(32850),tt=r(17036),ne=r(97005),oe=r(97657);const nt=["fullName","primaryOrganisation","joiningDate","actions"],ot=["fullName","communities","primaryOrganisation","joiningDate","actions"],it=["email","inviteSent","status","actions"],st=["email","community","inviteSent","status","actions"];var rt=r(24228);class ye{static checkToLoadMoreUsers(s,t){return s.length<=10&&Number(t)>s.length}}var ie=r(15955),se=r(86820),Me=r(54219);const mt=()=>({label:"Remove Member",id:"remove",destructive:!0}),pt=n=>[n],dt=n=>({items:n}),ut=()=>[];
1function _t(n,s){if(1&n){const t=e.RV6();e.j41(0,"div",20)(1,"app-filter",21),e.nI1(2,"async"),e.bIt("filterChange",function(i){l.eBV(t);const a=e.XpG();return l.Njj(a.onFiltersChanged(i))}),e.k0s(),e.j41(3,"lib-button",22),e.bIt("buttonClick",function(){l.eBV(t);const i=e.XpG();return l.Njj(i.onExportMembersList())}),e.nrm(4,"mat-icon",23),e.EFF(5," Export "),e.k0s()()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("isAdmin",!0)("facets",e.bMT(2,8,t.facets$)||e.lJ4(10,ut))("selectedFilter",t.filterValues),e.R7$(2),e.Aen(t.buttonStyle.Outline),e.Y8G("size",t.buttonSize.Small)("type",t.buttonType.Secondary)("iconPosition",t.buttonIconPosition.Left)}}function ft(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Name"),e.k0s())}function gt(n,s){if(1&n&&(e.j41(0,"mat-cell"),e.nrm(1,"app-contact",24),e.k0s()),2&n){const t=s.$implicit,o=e.XpG();e.R7$(),e.Y8G("contact",t)("type",o.memberRowSize)("positionOnly",!0)}}function ht(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Communities"),e.k0s())}function vt(n,s){if(1&n&&(e.j41(0,"p",28),e.EFF(1),e.k0s()),2&n){const t=s.$implicit,o=s.last;e.R7$(),e.Lme(" ",t.communityName,"",o?"":","," ")}}
1function Ct(n,s){if(1&n&&(e.qex(0),e.DNE(1,vt,2,2,"p",27),e.bVm()),2&n){const t=e.XpG().$implicit;e.R7$(),e.Y8G("ngForOf",null==t?null:t.communities)}}function bt(n,s){if(1&n&&(e.j41(0,"mat-cell",25),e.DNE(1,Ct,2,1,"ng-container",26),e.k0s()),2&n){const t=s.$implicit;e.XpG();const o=e.sdS(31);e.R7$(),e.Y8G("ngIf",null==t.communities?null:t.communities.length)("ngIfElse",o)}}function yt(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Organization"),e.k0s())}function Mt(n,s){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",t.primaryOrganisation," ")}}function It(n,s){if(1&n&&(e.j41(0,"mat-cell"),e.DNE(1,Mt,2,1,"span",26),e.k0s()),2&n){const t=s.$implicit;e.XpG();const o=e.sdS(31);e.R7$(),e.Y8G("ngIf",t.primaryOrganisation)("ngIfElse",o)}}function Ot(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Joining date"),e.k0s())}function Pt(n,s){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"date"),e.k0s()),2&n){const t=e.XpG().$implicit,o=e.XpG();e.R7$(),e.SpI(" ",e.i5U(2,1,t.joiningDate,o.DatePipeFormat.DD_MMM_YYYY)," ")}}function Tt(n,s){if(1&n&&(e.j41(0,"mat-cell"),e.DNE(1,Pt,3,4,"span",26),e.k0s()),2&n){const t=s.$implicit;e.XpG();const o=e.sdS(31);e.R7$(),e.Y8G("ngIf",t.joiningDate)("ngIfElse",o)}}function xt(n,s){1&n&&e.nrm(0,"mat-header-cell")}function St(n,s){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"lib-icon-button",31,2),e.bIt("click",function(i){l.eBV(t);const a=e.XpG().$implicit,d=e.XpG();return i.preventDefault(),l.Njj(d.onMemberActionClick(a))}),e.j41(3,"mat-icon",32),e.EFF(4,"more_horiz"),e.k0s()(),e.bVm()}if(2&n){const t=e.XpG(2),o=e.sdS(29);e.R7$(),e.Aen(t.buttonStyle.Ghost),e.Y8G("type",t.iconButtonType.Secondary)("matMenuTriggerFor",o.menu)}}function Et(n,s){if(1&n&&(e.j41(0,"mat-cell",29),e.DNE(1,St,5,4,"ng-container",30),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.showMoreButton)}}function Ft(n,s){1&n&&e.nrm(0,"mat-header-row")}function Dt(n,s){1&n&&e.nrm(0,"mat-row")}function Rt(n,s){1&n&&(e.j41(0,"div",33),e.nrm(1,"mat-spinner",34),e.k0s())}function wt(n,s){1&n&&(e.j41(0,"div",35),e.nrm(1,"lib-empty-list",36),e.k0s())}function $t(n,s){1&n&&(e.j41(0,"span",37),e.EFF(1,"-"),e.k0s())}let kt=(()=>{class n{get activeCommunityId(){return this._activeCommunityId}set activeCommunityId(t){this._activeCommunityId=t,this.resetData(),this.loadMembers()}constructor(t,o,i,a,d,C,R){this.membersService=t,this.filtersMapperService=o,this.cdr=i,this.snackBar=a,this.dialog=d,this.sitesSnapshotsService=C,this.mixPanelService=R,this.showMoreButton=!1,this.memberRowSize=oe.G.SMALLEST,this.members$=this.membersService.members$,this.isMembersLoaded$=this.membersService.isMembersLoaded$,this.isMembersLoading$=this.membersService.isMembersLoading$,this.totalMembers$=this.membersService.totalMembers$,this.buttonSize=c.MpK,this.buttonStyle=c.inm,this.buttonType=c.VQ,this.iconButtonType=c.ZUJ,this.buttonIconPosition=c.fEU,this.communityType=k,this.DatePipeFormat=Ce.u,this.facets$=this.filtersMapperService.facets$,this.filterValues=this.filtersMapperService.filterValues,this.selectedMember=null,this._activeCommunityId="",this.track=new e.bkB}get displayedColumns(){return this.isNetwork()?ot:nt}isNetwork(){return this.activeCommunity?.type===this.communityType.ForumNetwork}ngOnDestroy(){this.resetData()}loadMoreData(){this.membersService.pageNumber=this.membersService.pageNumber+1,this.loadMembers()}onFiltersChanged(t){this.filtersMapperService.onFiltersChanged(t),this.filterValues=this.filtersMapperService.filterValues,this.membersService.pageNumber=0,this.loadMembers()}onMemberActionClick(t){this.selectedMember=t}onRemoveMember(t){t&&this.dialog.open(ne.P,(n=>({disableClose:!0,width:"424px",data:{title:"Remove Member",message:`${n} would be removed from member list. Are you sure?`,buttons:{cancel:{title:"Cancel"},confirm:{title:"Remove",type:rt.O.ERROR}}}}))(`${t.firstName} ${t.lastName??""}`)).afterClosed().subscribe(a=>{a&&this.handleRemoveMember(t)})}onExportMembersList(){const{siteId:t,communityName:o}=this.getCommunityData(),i=this.dialog.open(ne.P,{disableClose:!0,width:"424px",data:{title:"Export members list",message:"This list can be used for internal purposes only. Please check GDPR policy before sharing with external
1constituents.",hasLoading:!0,buttons:{cancel:{title:"Cancel"},confirm:{title:"Download"}}}});i.componentInstance.primaryButtonClicked.pipe((0,qe.Z)(()=>this.membersService.exportMembers(t)),(0,J.j)(()=>{i.close()}),(0,D.s)(1)).subscribe({next:a=>{const d=(0,tt.V)({blob:a.body,communityName:o,exportDataType:be.R.MEMBERS,fileType:be.D.XLSX});this.mixPanelService.pageTrack(this.mixPanelService.ACTIONS.OPEN_DOCUMENT,{type:this.mixPanelService.SUBMIT_TYPE.MEMBERS_LIST,documentName:d,documentType:"File",action:this.mixPanelService.ACTIONS.DOWNLOAD}),this.snackBar.openFromComponent(y.Y,v.g0)},error:()=>{this.snackBar.openFromComponent(y.Y,v.z)}})}getCommunityData(){const o=this.sitesSnapshotsService.communityList$.getValue().find(i=>i.id===this.activeCommunityId);return{siteId:o?.site.id??"",communityName:o?.name??""}}handleRemoveMember(t){this.membersService.deleteMember(this.activeCommunityId,t.id).pipe((0,D.s)(1)).subscribe(()=>{this.snackBar.openFromComponent(y.Y,v.oL),ye.checkToLoadMoreUsers(this.members$.value,this.totalMembers$.value)&&this.loadMoreData()},()=>{this.snackBar.openFromComponent(y.Y,v.z)})}resetData(){this.membersService.resetMembers(),this.filtersMapperService.clearFilters(),this.filterValues=this.filtersMapperService.filterValues}loadMembers(){this.membersService.getMembers(this.activeCommunityId,this.filterValues).pipe((0,D.s)(1)).subscribe(t=>{const{events:o,memberLetters:i,nationalities:a,...d}=t.filters;this.filtersMapperService.filterOptions=d,this.filtersMapperService.filtersHelper=et.JJ,this.filtersMapperService.buildFilterFacets(),this.cdr.detectChanges()})}static{this.\u0275fac=function(o){return new(o||n)(e.rXU(fe.x),e.rXU(ie.W),e.rXU(B.gRc),e.rXU(X.UG),e.rXU(E.bZ),e.rXU(z.X),e.rXU(Q.aO))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["app-users-members"]],inputs:{activeCommunity:"activeCommunity",showMoreButton:"showMoreButton",activeCommunityId:"activeCommunityId"},outputs:{track:"track"},standalone:!1,decls:32,vars:32,consts:[["menuInstance","libMenu"],["noOrganization",""],["trigger","matMenuTrigger"],["class","members-header",4,"ngIf"],[1,"content-wrapper"],["infiniteScroll","",3,"scrolled","dataSource","infiniteScrollDistance","infiniteScrollThrottle","scrollWindow"],["matColumnDef","fullName"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","communities"],["class","d-block",4,"matCellDef"],["matColumnDef","primaryOrganisation"],["matColumnDef","joiningDate"],["matColumnDef","actions"],["class","action-cell",4,"matCellDef"],[4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],["class","table-spinner",4,"ngIf"],["class","table-no-content",4,"ngIf"],["xPosition","before",3,"clicked","menuItemsConfig"],[1,"members-header"],[3,"filterChange","isAdmin","facets","selectedFilter"],[3,"buttonClick","size","type","iconPosition"],["libIconContent","","svgIcon","document-file-table"],[3,"contact","type","positionOnly"],[1,"d-block"],[4,"ngIf","ngIfElse"],["class","m-0",4,"ngFor","ngForOf"],[1,"m-0"],[1,"action-cell"],[4,"ngIf"],[3,"click","type","matMenuTriggerFor"],["libIconContent",""],[1,"table-spinner"],["diameter","40",1,"loading"],[1,"table-no-content"],["type","Members"],[1,"organization-missing"]],template:function(o,i){if(1&o){const a=e.RV6();e.DNE(0,_t,6,11,"div",3),e.nI1(1,"async"),e.j41(2,"div",4)(3,"mat-table",5),e.nI1(4,"async"),e.bIt("scrolled",function(){return l.eBV(a),l.Njj(i.loadMoreData())}),e.qex(5,6),e.DNE(6,ft,2,0,"mat-header-cell",7)(7,gt,2,3,"mat-cell",8),e.bVm(),e.qex(8,9),e.DNE(9,ht,2,0,"mat-header-cell",7)(10,bt,2,2,"mat-cell",10),e.bVm(),e.qex(11,11),e.DNE(12,yt,2,0,"mat-header-cell",7)(13,It,2,2,"mat-cell",8),e.bVm(),e.qex(14,12),e.DNE(15,Ot,2,0,"mat-header-cell",7)(16,Tt,2,2,"mat-cell",8),e.bVm(),e.qex(17,13),e.DNE(18,xt,1,0,"mat-header-cell",7)(19,Et,2,1,"mat-cell",14),e.bVm(),e.DNE(20,Ft,1,0,"mat-header-row",15)(21,Dt,1,0,"mat-row",16),e.k0s(),e.DNE(22,Rt,2,0,"div",17),e.nI1(23,"async"),e.nI1(24,"async"),e.DNE(25,wt,2,0,"div",18),e.nI1(26,"async"),e.nI1(27,"async"),e.k0s(),e.j41(28,"lib-menu",19,0),e.bIt("clicked",function(C){return l.eBV(a),l.Njj("remove"===C.id&&i.onRemoveMember(i.selectedMember))}),e.k0s(),e.DNE(30,$t,2,0,"ng-template",null,1,e.C5r)}if(2&o){let a,d,C;e.Y8G("ngIf",null==(a=e.bMT(1,15,i.facets$))?null:a.length),e.R7$(3),e.AVh("table-empty",!(null!=(d=e.bMT(4,17,i.members$))&&d.length))("network",
1i.isNetwork()),e.Y8G("dataSource",i.members$)("infiniteScrollDistance",1)("infiniteScrollThrottle",250)("scrollWindow",!1),e.R7$(17),e.Y8G("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",!0),e.R7$(),e.Y8G("matRowDefColumns",i.displayedColumns),e.R7$(),e.Y8G("ngIf",e.bMT(23,19,i.isMembersLoading$)||!e.bMT(24,21,i.isMembersLoaded$)),e.R7$(3),e.Y8G("ngIf",e.bMT(26,23,i.isMembersLoaded$)&&!(null!=(C=e.bMT(27,25,i.members$))&&C.length)),e.R7$(3),e.Y8G("menuItemsConfig",e.eq3(30,dt,e.eq3(28,pt,e.lJ4(27,mt))))}},dependencies:[p.Sq,p.bT,$.y,se.D,c.TDG,Me.i,c.Qpp,c.CR$,c.ZuA,c.xBz,_.Zl,_.tL,_.ji,_.cC,_.YV,_.iL,_.KS,_.$R,_.YZ,_.NB,S.LG,x.Cp,T.An,p.Jj,p.vh],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}.members-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.members-header[_ngcontent-%COMP%] app-filter[_ngcontent-%COMP%]{flex-grow:1;padding:0}.content-wrapper[_ngcontent-%COMP%]{height:100%;margin-top:var(--space-200);position:relative}.content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%]:not(.network) mat-cell[_ngcontent-%COMP%]:first-of-type, .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%]:not(.network) mat-header-cell[_ngcontent-%COMP%]:first-of-type, .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%]:not(.network) mat-footer-cell[_ngcontent-%COMP%]:first-of-type{padding-right:60px}.content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%]:not(.network) mat-header-cell[_ngcontent-%COMP%]:first-of-type, .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%]:not(.network) mat-cell[_ngcontent-%COMP%]:first-of-type{flex:2}.content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%]:not(.network) mat-header-cell[_ngcontent-%COMP%]:last-of-type, .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%]:not(.network) mat-cell[_ngcontent-%COMP%]:last-of-type{flex:.25}.content-wrapper[_ngcontent-%COMP%] mat-table.network[_ngcontent-%COMP%] .mat-column-fullName[_ngcontent-%COMP%]{flex:0 0 30%}.content-wrapper[_ngcontent-%COMP%] mat-table.network[_ngcontent-%COMP%] .mat-column-communities[_ngcontent-%COMP%]{flex:0 0 35%}.content-wrapper[_ngcontent-%COMP%] mat-table.network[_ngcontent-%COMP%] .mat-column-primaryOrganisation[_ngcontent-%COMP%]{flex:0 0 12%}.content-wrapper[_ngcontent-%COMP%] mat-table.network[_ngcontent-%COMP%] .mat-column-joiningDate[_ngcontent-%COMP%]{flex:0 0 18%}.content-wrapper[_ngcontent-%COMP%] .table-no-content[_ngcontent-%COMP%]{margin-top:var(--space-150);border:var(--border-width-hairline) solid var(--colour-border-tertiary)}.organization-missing[_ngcontent-%COMP%]{font-family:var(--typography-body-small-font-family);font-weight:var(--typography-body-small-font-weight);line-height:var(--typography-body-small-line-height);font-size:var(--typography-body-small-font-size);letter-spacing:var(--typography-body-regular-letter-spacing);text-transform:var(--typography-body-regular-text-case);color:var(--colour-text-primary);display:inline-block;transform:scaleX(2)}"],changeDetection:0})}}return n})();const Ie={PROMOTE_TO_MEMBER_SUCCESS:"User was successfully invited to become a member",PROMOTE_TO_MEMBER_NETWORK_ERROR:`You cannot promote a follower to a member for a network community, please contact initiative manager or ${le.k}`};var Oe=function(n){return n.PROMOTE_FOLLOWER_NETWORK_ERROR="can't add members directly to a network",n}(Oe||{}),Ut=r(59295);function Nt(n,s){if(1&n&&e.nrm(0,"app-subcommunity-selector-field",5),2&n){const t=e.XpG(2);e.Y8G("initiativeId",t.initiativeId)}}function jt(n,s){if(1&n&&(e.j41(0,"form",3),e.nVh(1,Nt,1,1,"app-subcommunity-selector-field",5),e.k0s()),2&n){const t=e.XpG();e.Y8G("formGroup",t.form),e.R7$(),e.vxM(t.isForumNetwork()?1:-1)}}let Pe=(()=>{class n{constructor(){this.dialogRef=(0,l.WQX)(E.CP),this.dialogData=(0,l.WQX)(E.Vh),this.formBuilder=(0,l.WQX)(m.ok),this.followerName=this.dialogData.followerName,this.initiativeId=this.dialogData.initiativeId,this.isForumNetwork=(0,Ut.EW)(()=>this.dialogData.type===k.ForumNetwork)}ngOnInit(){this.isForumNetwork()&&(this.form=this.formBuilder.group({subcommunity:new m.MJ(null,[m.k0.required])}))}onLeave(){this.dialogRef.close()}
1onPromote(){if(!this.form||this.form.invalid)return;const t=this.form.get("subcommunity")?.value?.id;t&&this.dialogRef.close({subCommunityId:t})}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["app-promote-to-member-dialog"]],decls:6,vars:3,consts:[[3,"leave"],["modalContainerHeader","","headerText","Promote to Member",3,"closeModal"],[1,"promote-message","body-small"],[3,"formGroup"],["modalContainerFooter","","primaryButtonLabel","Promote","secondaryButtonLabel","Cancel",3,"primaryButtonClick","secondaryButtonClick","isPrimaryButtonDisabled"],["formControlName","subcommunity","label","Promote member(s) to community",3,"initiativeId"]],template:function(o,i){1&o&&(e.j41(0,"lib-modal-container",0),e.bIt("leave",function(){return i.onLeave()}),e.j41(1,"lib-modal-container-header",1),e.bIt("closeModal",function(){return i.onLeave()}),e.k0s(),e.j41(2,"p",2),e.EFF(3),e.k0s(),e.nVh(4,jt,2,2,"form",3),e.j41(5,"lib-modal-container-footer",4),e.bIt("primaryButtonClick",function(){return i.onPromote()})("secondaryButtonClick",function(){return i.onLeave()}),e.k0s()()),2&o&&(e.R7$(3),e.SpI("Are you sure you want to promote ",i.followerName," to a community member?"),e.R7$(),e.vxM(i.form?4:-1),e.R7$(),e.Y8G("isPrimaryButtonDisabled",!!i.form.invalid))},dependencies:[m.X1,m.qT,m.BC,m.cb,m.j4,m.JD,ee,c.CYR,c.bEy,c.rxf],styles:["[_nghost-%COMP%] .promote-message[_ngcontent-%COMP%]{margin:0 0 var(--space-200)}"],changeDetection:0})}}return n})();const Gt=()=>({label:"Promote to Member",id:"promote"}),Lt=n=>[n],Bt=n=>({items:n});function Vt(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Name"),e.k0s())}function Xt(n,s){if(1&n&&(e.j41(0,"mat-cell"),e.nrm(1,"app-contact",20),e.k0s()),2&n){const t=s.$implicit,o=e.XpG(3);e.R7$(),e.Y8G("contact",t)("type",o.followerRowSize)("positionOnly",!0)}}function Yt(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Organization"),e.k0s())}function At(n,s){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",t.primaryOrganisation," ")}}function zt(n,s){if(1&n&&(e.j41(0,"mat-cell"),e.DNE(1,At,2,1,"span",5),e.k0s()),2&n){const t=s.$implicit;e.XpG(3);const o=e.sdS(7);e.R7$(),e.Y8G("ngIf",t.primaryOrganisation)("ngIfElse",o)}}function Wt(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Date created"),e.k0s())}function Kt(n,s){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"date"),e.k0s()),2&n){const t=e.XpG().$implicit,o=e.XpG(3);e.R7$(),e.SpI(" ",e.i5U(2,1,t.createdAt,o.DatePipeFormat.DD_MMMM_YYYY)," ")}}function Ht(n,s){if(1&n&&(e.j41(0,"mat-cell"),e.DNE(1,Kt,3,4,"span",21),e.k0s()),2&n){const t=s.$implicit;e.R7$(),e.Y8G("ngIf",t.createdAt)}}function Jt(n,s){1&n&&e.nrm(0,"mat-header-cell")}function Zt(n,s){if(1&n){const t=e.RV6();e.j41(0,"lib-icon-button",24,4),e.bIt("click",function(i){l.eBV(t);const a=e.XpG().$implicit,d=e.XpG(3);return i.preventDefault(),l.Njj(d.onFollowerActionClick(a))}),e.j41(2,"mat-icon",25),e.EFF(3,"more_horiz"),e.k0s()()}if(2&n){const t=e.XpG(4),o=e.sdS(3);e.Aen(t.buttonStyle.Ghost),e.Y8G("type",t.buttonType.Secondary)("matMenuTriggerFor",o.menu)}}function Qt(n,s){if(1&n&&(e.j41(0,"mat-cell",22),e.DNE(1,Zt,4,4,"lib-icon-button",23),e.k0s()),2&n){const t=e.XpG(3);e.R7$(),e.Y8G("ngIf",null==t.activeCommunity?null:t.activeCommunity.allowInvitationOfNontoplinkUsers)}}function qt(n,s){1&n&&e.nrm(0,"mat-header-row")}function en(n,s){1&n&&e.nrm(0,"mat-row")}function tn(n,s){1&n&&e.eu8(0)}function nn(n,s){if(1&n&&(e.j41(0,"div",26),e.DNE(1,tn,1,0,"ng-container",27),e.k0s()),2&n){e.XpG(3);const t=e.sdS(5);e.R7$(),e.Y8G("ngTemplateOutlet",t)}}function on(n,s){if(1&n){const t=e.RV6();e.j41(0,"div",8)(1,"mat-table",9),e.nI1(2,"async"),e.bIt("scrolled",function(){l.eBV(t);const i=e.XpG(2);return l.Njj(i.loadMoreData())}),e.qex(3,10),e.DNE(4,Vt,2,0,"mat-header-cell",11)(5,Xt,2,3,"mat-cell",12),e.bVm(),e.qex(6,13),e.DNE(7,Yt,2,0,"mat-header-cell",11)(8,zt,2,2,"mat-cell",12),e.bVm(),e.qex(9,14),e.DNE(10,Wt,2,0,"mat-header-cell",11)(11,Ht,2,1,"mat-cell",12),e.bVm(),e.qex(12,15),e.DNE(13,Jt,1,0,"mat-header-cell",11)(14,Qt,2,1,"mat-cell",16),e.bVm(),e.DNE(15,qt,1,0,"mat-header-row",17)(16,en,1,0,"mat-row",18),e.k0s(),e.DNE(17,nn,2,1,"div",19),e.nI1(18,"async"),e.k0s()}if(2&n){let t;const o=e.XpG(2);e.R7$(),e.AVh("table-empty",!(null!=(t=e.bMT(2,10,o.followers$))&&t.length)),e.Y8G("dataSource",o.followers$)("infiniteScrollDistance",1)("infiniteScrollThrottle",250)("scrollWindow",!1),e.R7$(14),e.Y8G("matHeaderRowDef",o.displayedColumns)("matHeaderRowDefSticky",!0),e.R7$(),e.Y8G("matRowDefColumns",o.displayedColumns),e.R7$(),e.Y8G("ngIf",e.bMT(18,12,o.isFollowersLoading$))}}function sn(n,s){if(1&n&&(e.qex(0),e.DNE(1,on,19,14,"div",7),e.nI1(2,"async"),e.bVm()),2&n){let t;const o=e.XpG(),i=e.sdS(9);e.R7$(),e.Y8G("ngIf",null==(t=e.bMT(2,2,o.followers$))?null:t.length)("ngIfElse",i)}}function rn(n,s){1&n&&e.nrm(0,"mat-spinner",28)}function an(n,s){1&n&&(e.j41(0,"span",29),e.EFF(1,"-"),e.k0s())}function ln(n,s){1&n&&(e.j41(0,"div",30),e.nrm(1,"mat-icon",31),e.j41(2,"p",32),e.EFF(3,"Looks like you don't have any followers yet"),e.k0s()())}let cn=(()=>{class n{get activeCommunityId(){return this._activeCommunityId}set activeCommunityId(t){this._activeCommunityId=t,this.activeSiteId=this.getActiveSiteId(),this.resetData(),this.loadFollowers()}constructor(t,o,i,a){this.followersService=t,this.sitesSnapshotsService=o,this.snackBar=i,this.dialog=a,this.track=new e.bkB,this.followerRowSize=oe.G.SMALLEST,this.followers$=this.followersService.followers$,this.totalFollowers$=this.followersService.totalFollowers$,this.isFollowersLoaded$=this.followersService.isFollowersLoaded$,this.isFollowersLoading$=this.followersService.isFollowersLoading$,this.buttonType=c.ZUJ,this.buttonStyle=c.inm,this.DatePipeFormat=Ce.u,this.displayedColumns=["name","organization","createdAt","actions"],this.activeSiteId="",this._activeCommunityId="",this.selectedFollower=null}ngOnDestroy(){this.resetData()}loadMoreData(){this.loadFollowers()}onFollowerActionClick(t){this.selectedFollower=t}userMenuItemClicked(t){"promote"===t.id&&(this.onPromoteToMember(this.selectedFollower),this.track.emit("promote member"))}onPromoteToMember(t){t?.name&&(this.activeCommunity?.type!==k.ForumNetwork?this.dialog.open(ne.P,(n=>({disableClose:!0,width:"424px",data:{title:"Promote to Member",message:`Are you sure you want to promote ${n} to a community member?`,buttons:{cancel:{title:"Cancel"},confirm:{title:"Promote"}}}}))(t.name)).afterClosed().subscribe(i=>{i&&this.handlePromoteToMember(t)}):this.openPromoteToMemberDialog(t,t.name))}openPromoteToMemberDialog(t,o){const i=this.activeSiteId;i&&this.dialog.open(Pe,{disableClose:!0,width:"696px",panelClass:K.C,autoFocus:!1,data:{followerName:o,type:k.ForumNetwork,initiativeId:i}}).afterClosed().pipe((0,D.s)(1)).subscribe(d=>{d?.subCommunityId&&this.handlePromoteToMember(t,d.subCommunityId)})}handlePromoteToMember(t,o){this.activeSiteId&&this.followersService.promoteToMember(this.activeSiteId,t.id,[t.email],o).pipe((0,D.s)(1)).subscribe(()=>{this.snackBar.openFromComponent(y.Y,(0,v.Jz)(Ie.PROMOTE_TO_MEMBER_SUCCESS,{panelClass:""})),ye.checkToLoadMoreUsers(this.followers$.value,this.totalFollowers$.value)&&this.loadMoreData()},i=>{this.handleErrorPromoteToMember(i)})}handleErrorPromoteToMember(t){const o=t.error?.errors?.community;Array.isArray(o)&&o.find(a=>
1a===Oe.PROMOTE_FOLLOWER_NETWORK_ERROR)?this.snackBar.openFromComponent(y.Y,(0,v.en)(Ie.PROMOTE_TO_MEMBER_NETWORK_ERROR)):this.snackBar.openFromComponent(y.Y,v.z)}getActiveSiteId(){return this.sitesSnapshotsService.communityList$.value.find(o=>o.id===this.activeCommunityId)?.site.id}resetData(){this.followersService.resetFollowers()}loadFollowers(){this.activeSiteId&&this.followersService.getFollowers(this.activeSiteId).pipe((0,D.s)(1)).subscribe()}static{this.\u0275fac=function(o){return new(o||n)(e.rXU(ve),e.rXU(z.X),e.rXU(X.UG),e.rXU(E.bZ))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["app-users-followers"]],inputs:{activeCommunityId:"activeCommunityId",activeCommunity:"activeCommunity"},outputs:{track:"track"},standalone:!1,decls:10,vars:10,consts:[["menuInstance","libMenu"],["loading",""],["noOrganization",""],["emptyList",""],["trigger","matMenuTrigger"],[4,"ngIf","ngIfElse"],["xPosition","before",3,"clicked","menuItemsConfig"],["class","content-wrapper",4,"ngIf","ngIfElse"],[1,"content-wrapper"],["infiniteScroll","",3,"scrolled","dataSource","infiniteScrollDistance","infiniteScrollThrottle","scrollWindow"],["matColumnDef","name"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","organization"],["matColumnDef","createdAt"],["matColumnDef","actions"],["class","action-cell",4,"matCellDef"],[4,"matHeaderRowDef","matHeaderRowDefSticky"],[4,"matRowDef","matRowDefColumns"],["class","table-spinner",4,"ngIf"],[3,"contact","type","positionOnly"],[4,"ngIf"],[1,"action-cell"],[3,"type","style","matMenuTriggerFor","click",4,"ngIf"],[3,"click","type","matMenuTriggerFor"],["libIconContent",""],[1,"table-spinner"],[4,"ngTemplateOutlet"],["diameter","40",1,"loading"],[1,"organization-missing"],[1,"followers-empty"],["svgIcon","user-followers"],[1,"body-sm-regular"]],template:function(o,i){if(1&o){const a=e.RV6();e.DNE(0,sn,3,4,"ng-container",5),e.nI1(1,"async"),e.j41(2,"lib-menu",6,0),e.bIt("clicked",function(C){return l.eBV(a),l.Njj(i.userMenuItemClicked(C))}),e.k0s(),e.DNE(4,rn,1,0,"ng-template",null,1,e.C5r)(6,an,2,0,"ng-template",null,2,e.C5r)(8,ln,4,0,"ng-template",null,3,e.C5r)}if(2&o){const a=e.sdS(5);e.Y8G("ngIf",e.bMT(1,3,i.isFollowersLoaded$))("ngIfElse",a),e.R7$(2),e.Y8G("menuItemsConfig",e.eq3(8,Bt,e.eq3(6,Lt,e.lJ4(5,Gt))))}},dependencies:[p.bT,p.T3,$.y,se.D,c.CR$,c.ZuA,c.xBz,_.Zl,_.tL,_.ji,_.cC,_.YV,_.iL,_.KS,_.$R,_.YZ,_.NB,S.LG,x.Cp,T.An,p.Jj,p.vh],styles:["@keyframes _ngcontent-%COMP%_shine-lines{to{transform:translate(100%)}}[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}.content-wrapper[_ngcontent-%COMP%]{height:100%;margin-top:var(--space-200);position:relative}.content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]:first-of-type, .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]:first-of-type, .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-footer-cell[_ngcontent-%COMP%]:first-of-type{flex:4;padding-right:0}.content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]:nth-of-type(2), .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]:nth-of-type(2), .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-footer-cell[_ngcontent-%COMP%]:nth-of-type(2){padding-left:0;padding-right:100px;flex:2}.content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]:nth-of-type(3), .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]:nth-of-type(3), .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-footer-cell[_ngcontent-%COMP%]:nth-of-type(3){padding:0}.content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]:last-of-type, .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]:last-of-type, .content-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-footer-cell[_ngcontent-%COMP%]:last-of-type{padding-left:0}.followers-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:var(--space-200);margin-top:140px}.followers-empty[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{height:var(--size-600);width:var(--size-600);font-size:var(--size-600);line-height:var(--size-600);color:var(--colour-text-accent-default)}.followers-empty[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{color:var(--colour-text-secondary)}.loading[_ngcontent-%COMP%]{top:30%;left:50%;transform:translate(-50%,50%)}.organization-missing[_ngcontent-%COMP%]{font-family:var(--typography-body-small-font-family);
1font-weight:var(--typography-body-small-font-weight);line-height:var(--typography-body-small-line-height);font-size:var(--typography-body-small-font-size);letter-spacing:var(--typography-body-regular-letter-spacing);text-transform:var(--typography-body-regular-text-case);color:var(--colour-text-primary);display:inline-block;transform:scaleX(2)}"],changeDetection:0})}}return n})();var mn=r(18359),pn=r(25558),dn=r(7673),U=function(n){return n.InProgress="in_progress",n.Requested="requested",n.Opened="opened",n.Received="received",n.Blocked="blocked",n.Spam="spam_report",n}(U||{}),w=function(n){return n.InProgress="In Preparation",n.Requested="To be sent",n.Received="Delivered",n.Opened="Opened",n.Blocked="Delivery failed",n.Spam="In spam",n.Expired="Expired",n}(w||{}),Te=function(n){return n.Pending="pending",n.Expired="expired",n}(Te||{}),un=r(52889),G=function(n){return n.RESEND_INVITE="resendInvite",n.COPY_LINK="copyLink",n}(G||{});const _n={[G.COPY_LINK]:{label:"Copy personalized invite link",id:G.COPY_LINK,icon:{icon:"copy-to-cl
1ipboard",isSVG:!0}},[G.RESEND_INVITE]:{label:"Resend Invite",id:G.RESEND_INVITE,icon:{icon:"send-response",isSVG:!0}}};function fn(n,s){if(1&n&&(e.j41(0,"li",7),e.EFF(1),e.k0s()),2&n){const t=s.$implicit;e.R7$(),e.Lme(" ",t.email," (",t.communityName,") ")}}let gn=(()=>{class n{constructor(t,o){this.dialog=t,this.users=o,this.modalType=c.q3N}onLeave(){this.dialog.close()}confirm(){this.dialog.close(!0)}static{this.\u0275fac=function(o){return new(o||n)(e.rXU(E.CP),e.rXU(E.Vh))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["app-confirm-resend-invites-dialog"]],standalone:!1,decls:10,vars:4,consts:[["modalMaxHeight","500px",3,"type"],["modalContainerHeader","","headerText","Confirm resend invitations",3,"closeModal"],[1,"confirm-question"],["singular","address","plural","addresses",3,"count"],[1,"confirm-resend__list"],["class","body-sm-regular my-1","data-cy","users-invited-resend-email",4,"ngFor","ngForOf"],["modalContainerFooter","","primaryButtonLabel","Resend","secondaryButtonLabel","Cancel",3,"primaryButtonClick","secondaryButtonClick"],["data-cy","users-invited-resend-email",1,"body-sm-regular","my-1"]],template:function(o,i){1&o&&(e.j41(0,"lib-modal-container",0)(1,"lib-modal-container-header",1),e.bIt("closeModal",function(){return i.onLeave()}),e.k0s(),e.j41(2,"div")(3,"div",2),e.EFF(4),e.nrm(5,"app-pluralized-text",3),e.EFF(6," ? "),e.k0s(),e.j41(7,"ul",4),e.DNE(8,fn,2,2,"li",5),e.k0s()(),e.j41(9,"lib-modal-container-footer",6),e.bIt("primaryButtonClick",function(){return i.confirm()})("secondaryButtonClick",function(){return i.onLeave()}),e.k0s()()),2&o&&(e.Y8G("type",i.modalType.Confirmation),e.R7$(4),e.SpI(" Are you sure you want to resend the invitations to the ",i.users.length," selected email "),e.R7$(),e.Y8G("count",i.users.length),e.R7$(3),e.Y8G("ngForOf",i.users))},dependencies:[p.Sq,O.p,c.CYR,c.rxf,c.bEy],styles:["[_nghost-%COMP%] .confirm-question[_ngcontent-%COMP%]{margin-bottom:var(--space-200)}[_nghost-%COMP%] .confirm-resend__list[_ngcontent-%COMP%]{list-style-type:none;padding:var(--space-150);background-color:var(--colour-surface-neutral-subtle-default);border-radius:var(--border-radius-100);margin:0}[_nghost-%COMP%] .confirm-resend__list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--colour-text-primary)}"],changeDetection:0})}}return n})();var N=function(n){return n.Expired="Expired",n.Pending="Pending",n}(N||{}),hn=r(2933),vn=r(6602);let Cn=(()=>{class n{constructor(t,o){this.httpClient=t,this.apiEndpointService=o,this.INVITED_USER_PER_PAGE="18",this.initialParams={per_page:this.INVITED_USER_PER_PAGE}}getInvitedUsers(t,o){return new hn.L(a=>this.httpClient.get(`${this.apiEndpointService.getFWSEndpoint()}/communities/v1/sites/${t}/invitations?status=${o}`,{observe:"response",params:(0,vn.sr)({per_page:a?.get("per_page"),page:a?.get("page"),query:a?.get("query")})})).params({...this.initialParams})}static{this.\u0275fac=function(o){return new(o||n)(l.KVO(q.Qq),l.KVO(he.J))}}static{this.\u0275prov=l.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var bn=r(57303),yn=r(68169);function Mn(n,s){if(1&n&&(e.j41(0,"span",5),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.JRh(t.count)}}function In(n,s){if(1&n){const t=e.RV6();e.j41(0,"div",2),e.bIt("click",function(){const i=l.eBV(t).$implicit,a=e.XpG();return l.Njj(a.select(i))}
1),e.j41(1,"span",3),e.EFF(2),e.k0s(),e.DNE(3,Mn,2,1,"span",4),e.k0s()}if(2&n){const t=s.$implicit,o=e.XpG();e.AVh("toggle-pill__item--selected",o.selected===t.name),e.R7$(2),e.JRh(t.name),e.R7$(),e.Y8G("ngIf",void 0!==t.count)}}let On=(()=>{class n{constructor(){this.choiceSelected=new e.bkB}select(t){t.name!==this.selected&&this.choiceSelected.next(t)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["app-toggle-pill"]],inputs:{selected:"selected",choices:"choices"},outputs:{choiceSelected:"choiceSelected"},decls:2,vars:1,consts:[[1,"toggle-pill__container"],["class","toggle-pill__item",3,"toggle-pill__item--selected","click",4,"ngFor","ngForOf"],[1,"toggle-pill__item",3,"click"],[1,"body-xs-medium"],["class","body-xs-medium toggle-pill__count",4,"ngIf"],[1,"body-xs-medium","toggle-pill__count"]],template:function(o,i){1&o&&(e.j41(0,"div",0),e.DNE(1,In,4,4,"div",1),e.k0s()),2&o&&(e.R7$(),e.Y8G("ngForOf",i.choices))},dependencies:[p.bT,p.Sq],styles:["[_nghost-%COMP%] .toggle-pill__container[_ngcontent-%COMP%]{display:inline-flex;border-radius:999px;background-color:var(--colour-surface-base);color:var(--colour-text-secondary);padding:var(--space-025)}[_nghost-%COMP%] .toggle-pill__item[_ngcontent-%COMP%]{padding:var(--space-050) var(--space-050) var(--space-050) var(--space-150);cursor:pointer;display:flex;align-items:center}[_nghost-%COMP%] .toggle-pill__item--selected[_ngcontent-%COMP%]{background-color:var(--colour-surface-neutral-default);color:var(--colour-text-primary);border-radius:999px}[_nghost-%COMP%] .toggle-pill__item--selected[_ngcontent-%COMP%] .toggle-pill__count[_ngcontent-%COMP%]{color:var(--colour-text-on-accent);background-color:var(--colour-surface-accent-default)}[_nghost-%COMP%] .toggle-pill__count[_ngcontent-%COMP%]{padding:0 var(--space-050);background-color:var(--colour-surface-neutral-default);color:var(--colour-text-primary);border-radius:999px;margin-left:var(--space-050);min-width:var(--size-250);height:var(--size-250);display:inline-flex;align-items:center;justify-content:center}"],changeDetection:0})}}return n})();var Pn=r(97586),Tn=r.n(Pn);let xn=(()=>{class n{transform(t){return Tn()(t).fromNow()}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275pipe=e.EJ8({name:"ago",type:n,pure:!0,standalone:!1})}}return n})(),Sn=(()=>{class n{transform(t,o){if(o===N.Expired)return w.Expired;switch(t){case U.InProgress:return w.InProgress;case U.Opened:return w.Opened;case U.Received:return w.Received;case U.Requested:return w.Requested;case U.Blocked:return w.Blocked;case U.Spam:return w.Spam;default:return w.InProgress}}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275pipe=e.EJ8({name:"usersInvitedStatusPipe",type:n,pure:!0,standalone:!1})}}return n})();const En=()=>[],Fn=n=>({primaryPosition:n});function Dn(n,s){if(1&n){const t=e.RV6();e.j41(0,"app-toggle-pill",11),e.bIt("choiceSelected",function(i){l.eBV(t);const a=e.XpG(2);return l.Njj(a.onChoiceSelected(i))}),e.k0s()}if(2&n){const t=e.XpG(2);e.Y8G("selected",t.mode)("choices",t.modesChoices)}}function Rn(n,s){if(1&n&&(e.j41(0,"div",12),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI(" ",t.mode," ")}}function wn(n,s){if(1&n){const t=e.RV6();e.j41(0,"div",13)(1,"div",14),e.EFF(2),e.nrm(3,"app-pluralized-text",15),e.EFF(4," selected "),e.k0s(),e.j41(5,"div",16)(6,"lib-button",17),e.bIt("buttonClick",function(){l.eBV(t);const i=e.XpG(2);return l.Njj(i.clearForm())}),e.EFF(7," Clear selection "),e.k0s(),e.j41(8,"lib-button",18),e.bIt("buttonClick",function(){l.eBV(t);const i=e.XpG(2);return l.Njj(i.resendInvites())}),e.EFF(9," Resend invites "),e.k0s()()()}if(2&n){const t=e.XpG(2);e.R7$(2),e.SpI(" ",t.getFormUserSelectedCount()," "),e.R7$(),e.Y8G("count",t.getFormUserSelectedCount()||0),e.R7$(3),e.Aen(t.buttonStyle.Ghost),e.Y8G("size",t.buttonSize.Regular),e.R7$(2),e.Aen(t.buttonStyle.Outline),e.Y8G("size",t.buttonSize.Regular)}}function $n(n,s){1&n&&(e.j41(0,"div",22)(1,"div",23),e.nrm(2,"mat-icon",24),e.j41(3,"p",25),e.EFF(4,"Looks like there are no invited users yet"),e.k0s()()())}function kn(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Email"),e.k0s())}function Un(n,s){if(1&n){const t=e.RV6();e.j41(0,"mat-cell",39)(1,"lib-checkbox",40),e.bIt("click",function(i){return l.eBV(t),l.Njj(i.stopImmediatePropagation())}),e.k0s(),e.nrm(2,"app-contact",41),e.k0s()}if(2&n){const t=s.$implicit,o=e.XpG(4);e.R7$(),e.HbH(o.forumTheme),e.Y8G("formControlName",t.id+""),e.R7$(),e.Y8G("contact",e.eq3(6,Fn,t.email))("type",o.contactSizeType.SMALLEST)("positionOnly",!0)}}function Nn(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Community"),e.k0s())}function jn(n,s){if(1&n&&(e.j41(0,"p",43),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.SpI(" ",t.communityName," ")}}function Gn(n,s){if(1&n&&(e.j41(0,"mat-cell"),e.DNE(1,jn,2,1,"p",42),e.k0s()),2&n){const t=s.$implicit;e.R7$(),e.Y8G("ngIf",t.communityName)}}function Ln(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Invite sent"),e.k0s())}function Bn(n,s){if(1&n&&(e.j41(0,"mat-cell"),e.EFF(1),e.nI1(2,"ago"),e.k0s()),2&n){const t=s.$implicit;e.R7$(),e.SpI(" ",e.bMT(2,1,t.invitedAt)," ")}}function Vn(n,s){1&n&&(e.j41(0,"mat-header-cell"),e.EFF(1,"Status"),e.k0s())}function Xn(n,s){if(1&n&&(e.j41(0,"mat-cell")(1,"span",44),e.EFF(2),e.nI1(3,"usersInvitedStatusPipe"),e.k0s()()),2&n){const t=s.$implicit,o=e.XpG(4);e.R7$(),e.AVh("users-invited__status-label--error",(t.emailDeliveryStatus===o.status.Spam||t.emailDeliveryStatus===o.status.Blocked)&&o.mode!==o.modes.Expired)("users-invited__status-label--success",t.emailDeliveryStatus===o.status.Opened&&o.mode!==o.modes.Expired),e.R7$(),e.SpI(" ",e.i5U(3,5,t.emailDeliveryStatus,o.mode)," ")}}function Yn(n,s){1&n&&e.nrm(0,"mat-header-cell")}function An(n,s){if(1&n){const t=e.RV6();e.j41(0,"mat-cell",45)(1,"lib-icon-button",46,1),e.bIt("click",function(i){const a=l.eBV(t).$implicit,d=e.XpG(4);return i.preventDefault(),i.stopPropagation(),l.Njj(d.onUserActionClick(a))}),e.j41(3,"mat-icon",47),e.EFF(4,"more_horiz"),e.k0s()()()}if(2&n){const t=e.XpG(4),o=e.sdS(2);e.R7$(),e.Aen(t.buttonStyle.Ghost),e.Y8G("type",t.buttonType.Secondary)("matMenuTriggerFor",o.menu)}}function zn(n,s){1&n&&e.nrm(0,"mat-header-row")}function Wn(n,s){if(1&n){const t=e.RV6();e.j41(0,"mat-row",48),e.bIt("click",function(){const i=l.eBV(t).$implicit,a=e.XpG(4);return l.Njj(a.select(i.id))}),e.k0s()}if(2&n){const t=s.$implicit,o=e.XpG(4);e.AVh("selected",o.isSelected(t.id))}}function Kn(n,s){if(1&n){const t=e.RV6();e.j41(0,"mat-table",26),e.nI1(1,"async"),e.nI1(2,"async"),e.bIt("scrolled",function(){l.eBV(t);const i=e.XpG(3);return l.Njj(i.request$.loadMore())}
1),e.j41(3,"form",27),e.qex(4,28),e.DNE(5,kn,2,0,"mat-header-cell",29)(6,Un,3,8,"mat-cell",30),e.bVm(),e.qex(7,31),e.DNE(8,Nn,2,0,"mat-header-cell",29)(9,Gn,2,1,"mat-cell",32),e.bVm(),e.qex(10,33),e.DNE(11,Ln,2,0,"mat-header-cell",29)(12,Bn,3,3,"mat-cell",32),e.bVm(),e.qex(13,34),e.DNE(14,Vn,2,0,"mat-header-cell",29)(15,Xn,4,8,"mat-cell",32),e.bVm(),e.qex(16,35),e.DNE(17,Yn,1,0,"mat-header-cell",29)(18,An,5,4,"mat-cell",36),e.bVm(),e.DNE(19,zn,1,0,"mat-header-row",37)(20,Wn,1,2,"mat-row",38),e.k0s()()}if(2&n){let t;const o=e.XpG(3);e.AVh("table-empty",!(null!=(t=e.bMT(1,12,o.request$.results$))&&t.length))("network",o.isNetwork),e.Y8G("dataSource",e.bMT(2,14,o.request$.results$))("infiniteScrollDistance",1)("infiniteScrollThrottle",250)("scrollWindow",!1),e.R7$(3),e.Y8G("formGroup",o.form),e.R7$(16),e.Y8G("matHeaderRowDef",o.displayedColumns)("matHeaderRowDefSticky",!0),e.R7$(),e.Y8G("matRowDefColumns",o.displayedColumns)}}function Hn(n,s){if(1&n&&(e.j41(0,"div",19),e.DNE(1,$n,5,0,"div",20),e.nI1(2,"async"),e.DNE(3,Kn,21,16,"mat-table",21),e.nI1(4,"async"),e.nI1(5,"async"),e.k0s()),2&n){let t,o;const i=e.XpG(2);e.R7$(),e.Y8G("ngIf",!(null!=(t=e.bMT(2,2,i.request$.results$))&&t.length)),e.R7$(2),e.Y8G("ngIf",e.bMT(4,4,i.request$.isLoaded$)&&(null==(o=e.bMT(5,6,i.request$.results$))?null:o.length))}}function Jn(n,s){1&n&&(e.j41(0,"div",49),e.nrm(1,"mat-spinner",50),e.k0s())}function Zn(n,s){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"div",4)(2,"app-filter",5),e.bIt("filterChange",function(i){l.eBV(t);const a=e.XpG();return l.Njj(a.onFiltersChanged(i))}),e.k0s(),e.DNE(3,Dn,1,2,"app-toggle-pill",6),e.k0s(),e.DNE(4,Rn,2,1,"div",7)(5,wn,10,8,"div",8)(6,Hn,6,8,"div",9),e.nI1(7,"async"),e.DNE(8,Jn,2,0,"div",10),e.nI1(9,"async"),e.nI1(10,"async"),e.bVm()}if(2&n){const t=e.XpG();e.R7$(2),e.Y8G("isAdmin",!0)("facets",e.lJ4(15,En))("selectedFilter",t.filterValues)("hideClearAll",!1),e.R7$(),e.Y8G("ngIf",t.modesChoices),e.R7$(),e.Y8G("ngIf",!t.formHasUserSelected()),e.R7$(),e.Y8G("ngIf",t.formHasUserSelected()),e.R7$(),e.Y8G("ngIf",e.bMT(7,9,t.request$.isLoaded$)),e.R7$(2),e.Y8G("ngIf",e.bMT(9,11,t.request$.isLoading$)||!e.bMT(10,13,t.request$.isLoaded$))}}let Qn=(()=>{class n extends un.c{constructor(t,o,i,a,d,C,R,V,W,xe,Se,yo){super(t,R,V,W,xe,d,Se),this.sitesSnapshotsService=t,this.invitedUsersService=o,this.communitiesService=i,this.dialogService=a,this.cdr=d,this.snackBar=C,this.route=R,this.location=V,this.filtersMapperService=W,this.routerHelperService=xe,this.router=Se,this.sharableLinkService=yo,this.count=new e.bkB,this.track=new e.bkB,this.form=new m.gE({}),this.sub=new mn.yU,this.mode=N.Pending,this.modes=N,this.status=U,this.contactSizeType=oe.G,this.containerClass=!1,this.selectedUser=null,this.buttonSize=c.or0,this.buttonStyle=c.inm,this.communityType=k,this.buttonType=c.ZUJ,this.forumTheme=K.C,this.menuItems=_n,this.loadedUsers=[],this.invitedUserActionsConfig=()=>{const Ee=[this.menuItems.resendInvite];return this.mode===this.modes.Pending&&Ee.unshift(this.menuItems.copyLink),{items:Ee}}}get displayedColumns(){return this.isNetwork?st:it}get isNetwork(){return this.activeCommunity?.type===this.communityType.ForumNetwork}ngOnInit(){this.initialize()}ngOnDestroy(){this.sub.unsubscribe()}onUserActionClick(t){this.selectedUser=t}onMenuActionClick(t){t===G.RESEND_INVITE&&(this.resendInvites([this.selectedUser.id]),this.track.emit("resend invite")),t===G.COPY_LINK&&(this.copyToClipboard(this.selectedUser.url),this.track.emit("copy invite link"))}copyToClipboard(t){this.sharableLinkService.tryCopyToClipboard(t)?this.snackBar.openFromComponent(y.Y,v.oD):this.snackBar.openFromComponent(y.Y,v.py)}select(t){this.form.controls[t].setValue(!this.isSelected(t))}isSelected(t){return this.form.controls[t].value}getFormUserSelectedIds(){const t=this.form.getRawValue();return Object.keys(t).filter(o=>t[o])}getFormUserSelectedCount(){return this.getFormUserSelectedIds().length}formHasUserSelected(){return!!this.getFormUserSelectedCount()}clearForm(){this.form.reset()}onChoiceSelected(t){this.mode=t.name,this.removeFormControls(),this.initialize()}onFiltersChanged(t){this.removeFormControls(),this.handleFilter(t)}handleFilterGetData(){this.initialize()}resendInvites(t){this.confirmEmails(t).afterClosed().pipe((0,D.s)(1),(0,pn.n)(o=>
1o?this.communitiesService.inviteExternalMemberToCommunityByInviteId(t||this.getFormUserSelectedIds(),this.getActiveSiteId()):(0,dn.of)())).pipe((0,D.s)(1)).subscribe(()=>{this.snackBar.openFromComponent(y.Y,v.oy),this.clearForm(),this.initialize()})}removeFormControls(){for(const t in this.form.controls)t in this.form.controls&&this.form.removeControl(t)}initializeForm(){this.sub.add(this.request$.results$.subscribe(t=>{this.setupModeChoices(),this.updateCount(),this.updateFilterOptionsAndValues(this.request$.filters),this.filtersMapperService.buildFilterFacets(),t.length&&(t.forEach(o=>this.form.addControl(o.id,new m.MJ)),this.loadedUsers.push(...t)),this.cdr.detectChanges()}))}getActiveSiteId(){return this.sitesSnapshotsService.communityList$.value.find(o=>o.id===this.activeCommunityId)?.site.id}confirmEmails(t){return this.dialogService.open(gn,{maxWidth:"424px",data:this.getEmailsAssociatedWithIds(t||this.getFormUserSelectedIds())})}getEmailsAssociatedWithIds(t){return t.map(o=>this.getInvitedUserDataById(o))}getInvitedUserDataById(t){return this.loadedUsers.find(o=>o.id==t)}initialize(){const t=this.mode.toLowerCase()||Te.Pending;this.request$=null,this.request$=this.invitedUsersService.getInvitedUsers(this.getActiveSiteId(),t),this.cdr.detectChanges(),this.request$.reset(),this.request$.params({...this.invitedUsersService.initialParams,...this.filterValues}),this.request$.load(),this.initializeForm()}setupModeChoices(){this.request$.filters.status&&(this.modesChoices=[{name:N.Pending,count:this.request$.filters.status.find(t=>t.key===N.Pending).count||0},{name:N.Expired,count:this.request$.filters.status.find(t=>t.key===N.Expired).count||0}])}updateFilterOptionsAndValues(t){this.filtersMapperService.filterOptions=t}updateCount(){if(!this.request$.filters.status)return;const t=this.request$.filters.status.reduce((o,i)=>o+(i.count||0),0);this.count.next(t)}static{this.\u0275fac=function(o){return new(o||n)(e.rXU(z.X),e.rXU(Cn),e.rXU(A.d),e.rXU(E.bZ),e.rXU(B.gRc),e.rXU(X.UG),e.rXU(te.nX),e.rXU(bn.aZ),e.rXU(ie.W),e.rXU(yn.T),e.rXU(te.Ix),e.rXU(H.c))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["app-users-invited"]],inputs:{activeCommunityId:"activeCommunityId",activeCommunity:"activeCommunity"},outputs:{count:"count",track:"track"},standalone:!1,features:[e.Jv_([ie.W]),e.Vt3],decls:3,vars:2,consts:[["menuInstance","libMenu"],["trigger","matMenuTrigger"],[4,"ngIf"],["xPosition","before",3,"clicked","menuItemsConfig"],[1,"users-invited__filter-wrapper"],["data-cy","users-invited-filter",1,"p-0","users-invited__filter",3,"filterChange","isAdmin","facets","selectedFilter","hideClearAll"],["data-cy","users-invited-toggle-pill",3,"selected","choices","choiceSelected",4,"ngIf"],["class","heading-medium-bold m-0 mt-2","data-cy","users-invited-mode",4,"ngIf"],["class","mt-2 d-flex justify-between align-center",4,"ngIf"],["class","users-invited__content-wrapper",4,"ngIf"],["class","table-spinner",4,"ngIf"],["data-cy","users-invited-toggle-pill",3,"choiceSelected","selected","choices"],["data-cy","users-invited-mode",1,"heading-medium-bold","m-0","mt-2"],[1,"mt-2","d-flex","justify-between","align-center"],["data-cy","users-invited-count",1,"heading-medium-bold","m-0"],["singular","user",3,"count"],[1,"actions"],["data-cy","users-invited-clear",1,"mr-1",3,"buttonClick","size"],["data-cy","users-invited-resend",3,"buttonClick","size"],[1,"users-invited__content-wrapper"],["data-cy","users-invited-empty","class","table-no-content",4,"ngIf"],["infiniteScroll","",3,"dataSource","infiniteScrollDistance","infiniteScrollThrottle","scrollWindow","table-empty","network","scrolled",4,"ngIf"],["data-cy","users-invited-empty",1,"table-no-content"],[1,"invited-empty"],["svgIcon","user-followers"],[1,"body-sm-regular"],["infiniteScroll","",3,"scrolled","dataSource","infiniteScrollDistance","infiniteScrollThrottle","scrollWindow"],[1,"users-invited__form",3,"formGroup"],["matColumnDef","email"],[4,"matHeaderCellDef"],["data-cy","users-invited-contact-cell",4,"matCellDef"],["matColumnDef","community"],[4,"matCellDef"],["matColumnDef","inviteSent"],["matColumnDef","status"],["matColumnDef","actions"],["class","action-cell",4,"matCellDef"],[4,"matHeaderRowDef","matHeaderRowDefSticky"],["data-cy","users-invited-contact-row",3,"selected","click",4,"matRowDef","matRowDefColumns"],["data-cy","users-invited-contact-cell"],[1,"mr-2",3,"click","formControlName"],["data-cy","users-invited-contact",3,"contact","type","positionOnly"],["class","m-0",4,"ngIf"],[1,"m-0"],[1,"users-invited__status-label"],[1,"action-cell"],["data-cy","users-invited-actions-row",3,"click","type","matMenuTriggerFor"],["libIconContent",""],["data-cy","users-invited-contact-row",3,"click"],[1,"table-spinner"],["diameter","40",1,"loading"]],template:function(o,i){if(1&o){const a=e.RV6();e.DNE(0,Zn,11,16,"ng-container",2),e.j41(1,"lib-menu",3,0),e.bIt("clicked",function(C){return l.eBV(a),l.Njj(i.onMenuActionClick(C.id))}),e.k0s()}2&o&&(e.Y8G("ngIf",i.request$),e.R7$(),e.Y8G("menuItemsConfig",i.invitedUserActionsConfig()))},dependencies:[p.bT,$.y,se.D,m.qT,m.BC,m.cb,m.j4,m.JD,Me.i,c.Qpp,c.CR$,O.p,On,c.PYJ,c.ZuA,c.xBz,_.Zl,_.tL,_.ji,_.cC,_.YV,_.iL,_.KS,_.$R,_.YZ,_.NB,S.LG,x.Cp,T.An,p.Jj,xn,Sn],styles:["@keyframes _ngcontent-%COMP%_shine-lines{to{transform:translate(100%)}}[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}[_nghost-%COMP%] .contact-position{color:var(--colour-text-neutral-default)!important}[_nghost-%COMP%] mat-table.network[_ngcontent-%COMP%] .mat-column-email[_ngcontent-%COMP%]{flex:0 0 30%}[_nghost-%COMP%] mat-table.network[_ngcontent-%COMP%] .mat-column-community[_ngcontent-%COMP%]{flex:0 0 35%}[_nghost-%COMP%] mat-table.network[_ngcontent-%COMP%] .mat-column-inviteSent[_ngcontent-%COMP%]{flex:0 0 15%}[_nghost-%COMP%] mat-table.network[_ngcontent-%COMP%] .mat-column-status[_ngcontent-%COMP%]{flex:0 0 15%}[_nghost-%COMP%] mat-table.network[_ngcontent-%COMP%] .mat-column-actions[_ngcontent-%COMP%]{flex:0 0 var(--size-800)}[_nghost-%COMP%] .mat-column-email[_ngcontent-%COMP%]{flex:0 0 50%}[_nghost-%COMP%] .mat-column-community[_ngcontent-%COMP%]{flex:0 0 30%}[_nghost-%COMP%] .mat-column-actions[_ngcontent-%COMP%]{flex:0 0 var(--size-800)}[_nghost-%COMP%] .users-invited__filter[_ngcontent-%COMP%]{flex-grow:1}[_nghost-%COMP%] .users-invited__filter[_ngcontent-%COMP%] .divider{display:none}[_nghost-%COMP%] .users-invited__wrapper[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .users-invited__content-wrapper[_ngcontent-%COMP%]{height:100%;margin-top:var(--space-200);position:relative}[_nghost-%COMP%] .users-invited__filter-wrapper[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:space-between;align-items:center}[_nghost-%COMP%] .contact-container{display:flex!important;align-items:center}[_nghost-%COMP%] mat-row[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] mat-row[_ngcontent-%COMP%]:hover mat-cell[_ngcontent-%COMP%]{background-color:var(--colour-surface-accent-subtle-hover)!important}[_nghost-%COMP%] mat-row.selected[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]{background-color:var(--colour-surface-accent-subtle-default)}[_nghost-%COMP%] mat-cell[_ngcontent-%COMP%]:hover lib-button[_ngcontent-%COMP%]{display:block}[_nghost-%COMP%] mat-cell[_ngcontent-%COMP%] lib-button[_ngcontent-%COMP%]{display:none;position:absolute;right:var(--space-200)}[_nghost-%COMP%] .invited-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:var(--space-200);margin-top:140px}[_nghost-%COMP%] .invited-empty[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{height:var(--size-600);width:var(--size-600);font-size:var(--size-600);line-height:var(--size-600);color:var(--colour-text-accent-default)}[_nghost-%COMP%] .invited-empty[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{color:var(--colour-text-secondary)}.users-invited__status-label[_ngcontent-%COMP%]{font-family:var(--typography-label-bold-small-font-family);
1font-weight:var(--typography-label-bold-small-font-weight);line-height:var(--typography-label-bold-small-line-height);font-size:var(--typography-label-bold-small-font-size);letter-spacing:var(--typography-body-regular-letter-spacing);text-transform:var(--typography-body-regular-text-case);display:flex;height:var(--size-250);max-width:200px;padding:0 var(--space-050);justify-content:center;align-items:center;color:var(--colour-text-neutral-default);border-radius:var(--border-radius-050);background:var(--colour-surface-raised)}.users-invited__status-label--success[_ngcontent-%COMP%]{color:var(--colour-text-positive-default);background:var(--colour-surface-positive-subtle-default)}.users-invited__status-label--error[_ngcontent-%COMP%]{color:var(--colour-text-negative-default);background:var(--colour-surface-negative-subtle-default)}"],changeDetection:0})}}return n})();const qn=()=>({tierName:"Follower"});function eo(n,s){if(1&n){const t=e.RV6();e.j41(0,"div")(1,"lib-button",10),e.bIt("buttonClick",function(){l.eBV(t);const i=e.XpG(3);return l.Njj(i.openInviteMembersDialog())}),e.EFF(2,"Invite Members"),e.k0s()()}if(2&n){const t=e.XpG(3);e.R7$(),e.Aen(t.buttonStyle.Solid)}}function to(n,s){if(1&n&&(e.qex(0),e.DNE(1,eo,3,2,"div",5),e.bVm()),2&n){const t=s.ngIf,o=e.XpG(2);e.R7$(),e.Y8G("ngIf",(null==t?null:t.allowInvitationOfNontoplinkUsers)||(null==t?null:t.allowSelfSignUpForNonToplinkUsers)||(null==t?null:t.type)===o.communityType.ForumNetwork)}}function no(n,s){if(1&n&&(e.qex(0),e.DNE(1,to,2,1,"ng-container",5),e.nI1(2,"async"),e.bVm()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngIf",e.bMT(2,1,t.community$))}}function oo(n,s){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=s.ngIf;e.R7$(),e.SpI("(",t,")")}}function io(n,s){if(1&n&&(e.EFF(0),e.DNE(1,oo,2,1,"span",5),e.nI1(2,"async")),2&n){const t=e.XpG();e.SpI(" ",t.tabNames.MEMBERS,"\xa0 "),e.R7$(),e.Y8G("ngIf",e.bMT(2,2,t.totalMembers$))}}function so(n,s){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"app-users-members",11),e.nI1(2,"async"),e.bIt("track",function(i){l.eBV(t);const a=e.XpG();return l.Njj(a.track(i))}),e.k0s(),e.bVm()}if(2&n){let t;const o=e.XpG();e.R7$(),e.Y8G("activeCommunity",o.activeCommunity)("activeCommunityId",o.activeCommunityId)("showMoreButton",null==(t=e.bMT(2,3,o.community$))?null:t.manageMembership)}}function ro(n,s){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=s.ngIf;e.R7$(),e.SpI("(",t,")")}}function ao(n,s){if(1&n&&(e.EFF(0),e.DNE(1,ro,2,1,"span",5),e.nI1(2,"async")),2&n){const t=e.XpG();e.SpI(" ",t.tabNames.FOLLOWERS,"\xa0 "),e.R7$(),e.Y8G("ngIf",e.bMT(2,2,t.totalFollowers$))}}function lo(n,s){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"app-users-followers",12),e.bIt("track",function(i){l.eBV(t);const a=e.XpG(2);return l.Njj(a.track(i))}),e.k0s(),e.bVm()}if(2&n){const t=e.XpG(2);e.R7$(),e.Y8G("activeCommunityId",t.activeCommunityId)("activeCommunity",t.activeCommunity)}}function co(n,s){if(1&n&&(e.qex(0),e.DNE(1,lo,2,2,"ng-container",9),e.nI1(2,"async"),e.bVm()),2&n){const t=e.XpG(),o=e.sdS(21);e.R7$(),e.Y8G("ngIf",!e.bMT(2,2,t.loadingCommunity$))("ngIfElse",o)}}function mo(n,s){1&n&&e.eu8(0)}function po(n,s){if(1&n&&e.DNE(0,mo,1,0,"ng-container",13),2&n){e.XpG();const t=e.sdS(23);e.Y8G("ngTemplateOutlet",t)("ngTemplateOutletContext",e.lJ4(2,qn))}}function uo(n,s){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.SpI("(",t.invitedUsersCount,")")}}function _o(n,s){if(1&n&&(e.EFF(0),e.DNE(1,uo,2,1,"span",5)),2&n){const t=e.XpG();e.SpI(" ",t.tabNames.INVITED,"\xa0 "),e.R7$(),e.Y8G("ngIf",t.invitedUsersCount)}}function fo(n,s){if(1&n){const t=e.RV6();e.qex(0),e.j41(1,"app-users-invited",14),e.bIt("count",function(i){l.eBV(t);const a=e.XpG();return l.Njj(a.updateInvitedUsersCount(i))})("track",function(i){l.eBV(t);const a=e.XpG();return l.Njj(a.track(i))}),e.k0s(),e.bVm()}if(2&n){const t=e.XpG();e.R7$(),e.Y8G("activeCommunityId",t.activeCommunityId)("activeCommunity",t.activeCommunity)}}function go(n,s){1&n&&e.nrm(0,"mat-spinner",15)}function ho(n,s){if(1&n&&(e.j41(0,"div",16),e.nrm(1,"mat-icon",17),e.j41(2,"p",18),e.EFF(3),e.k0s(),e.j41(4,"p",19),e.EFF(5," Please contact Forum Spaces at "),e.j41(6,"a",20),e.EFF(7,"[email protected]"),e.k0s(),e.EFF(8," team to enable this tier. "),e.k0s()()),2&n){const t=s.tierName;e.R7$(3),e.SpI("",t," space is not enabled")}}const vo=[{path:"",component:(()=>{class n{constructor(t,o,i,a,d,C,R){this.activatedRoute=t,this.membersService=o,this.followersService=i,this.communitiesService=a,this.dialog=d,this.sitesSnapshotsService=C,this.mixPanelService=R,this.tabNames=_e,this.community$=this.communitiesService.community$,this.totalMembers$=this.membersService.totalMembers$,this.totalFollowers$=this.followersService.totalFollowers$,this.loadingCommunity$=this.communitiesService.loadingCommunity$,this.USER_TIERS=Re.J,this.forumTheme=K.C,this.activeCommunityId="",this.activeCommunity=null,this.communityType=k,this.buttonStyle=c.inm,this.destroy$=new Fe.B}ngOnInit(){this.activatedRoute.parent?.parent?.url.pipe((0,ae.Q)(this.destroy$)).subscribe(t=>{this.activeCommunityId=t[0].path,this.loadCommunity()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}track(t){this.mixPanelService.pageTrack(this.mixPanelService.ACTIONS.SUBMIT,{type:t})}updateInvitedUsersCount(t){this.invitedUsersCount=t}openInviteMembersDialog(){const o=this.sitesSnapshotsService.communityList$.getValue().find(a=>a.id===this.activeCommunityId);this.dialog.open(Ze,{disableClose:!0,width:"696px",panelClass:this.forumTheme,autoFocus:!1,data:{...this.activeCommunity,initiativeUrl:o?.site?.path||this.activeCommunity?.initiativeUrl||"",initiativeId:o?.site?.id}}).afterClosed().pipe((0,D.s)(1),(0,ae.Q)(this.destroy$),(0,De.p)(Boolean)).subscribe(a=>{this.dialog.open(Le,{data:a,width:"696px"})})}isSectionTierAvailable(t){const i=this.sitesSnapshotsService.communityList$.getValue().find(a=>a.id===this.activeCommunityId);return!i||(0,we.z)(i.tiers,t)}loadCommunity(){this.communitiesService.getCommunity(this.activeCommunityId).pipe((0,D.s)(1)).subscribe(t=>{this.activeCommunity=t})}static{this.\u0275fac=function(o){return new(o||n)(e.rXU(te.nX),e.rXU(fe.x),e.rXU(ve),e.rXU(A.d),e.rXU(E.bZ),e.rXU(z.X),e.rXU(Q.aO))}}static{this.\u0275cmp=e.VBU({type:n,selectors:[["app-users"]],standalone:!1,decls:24,vars:13,consts:[["followerTierNotAvailable",""],["loading",""],["t
1ierNotAvailable",""],[1,"header"],[1,"heading-bold"],[4,"ngIf"],[1,"users-tabs"],["mat-align-tabs","start","animationDuration","0ms","mat-stretch-tabs","false","preserveContent","",1,"horizontal-tabs"],["mat-tab-label",""],[4,"ngIf","ngIfElse"],[3,"buttonClick"],[3,"track","activeCommunity","activeCommunityId","showMoreButton"],[3,"track","activeCommunityId","activeCommunity"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"count","track","activeCommunityId","activeCommunity"],["diameter","40",1,"loading"],[1,"tier-not-available"],["svgIcon","members-followers"],[1,"body-sm-medium"],[1,"body-sm-regular"],["href","mailto:[email protected]"]],template:function(o,i){if(1&o&&(e.j41(0,"div",3)(1,"div",4),e.EFF(2,"Users"),e.k0s(),e.DNE(3,no,3,3,"ng-container",5),e.nI1(4,"async"),e.k0s(),e.j41(5,"div",6)(6,"mat-tab-group",7)(7,"mat-tab"),e.DNE(8,io,3,4,"ng-template",8)(9,so,3,5,"ng-container",9),e.nI1(10,"async"),e.k0s(),e.j41(11,"mat-tab"),e.DNE(12,ao,3,4,"ng-template",8)(13,co,3,4,"ng-container",9)(14,po,1,3,"ng-template",null,0,e.C5r),e.k0s(),e.j41(16,"mat-tab"),e.DNE(17,_o,2,2,"ng-template",8)(18,fo,2,2,"ng-container",9),e.nI1(19,"async"),e.k0s()()(),e.DNE(20,go,1,0,"ng-template",null,1,e.C5r)(22,ho,9,1,"ng-template",null,2,e.C5r)),2&o){const a=e.sdS(15),d=e.sdS(21);e.R7$(3),e.Y8G("ngIf",!e.bMT(4,7,i.loadingCommunity$)),e.R7$(6),e.Y8G("ngIf",!e.bMT(10,9,i.loadingCommunity$))("ngIfElse",d),e.R7$(4),e.Y8G("ngIf",i.isSectionTierAvailable(i.USER_TIERS.FOLLOWERS))("ngIfElse",a),e.R7$(5),e.Y8G("ngIf",!e.bMT(19,11,i.loadingCommunity$))("ngIfElse",d)}},dependencies:[p.bT,p.T3,c.Qpp,F.ES,F.mq,F.T8,S.LG,T.An,kt,cn,Qn,p.Jj],styles:["@keyframes _ngcontent-%COMP%_shine-lines{to{transform:translate(100%)}}[_nghost-%COMP%]{display:flex;flex-direction:column;color:var(--colour-text-primary);height:100%;padding-top:var(--space-400);overflow:hidden}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--space-200);min-height:var(--size-600)}.users-tabs[_ngcontent-%COMP%]{height:100%;padding-bottom:var(--space-200)}.loading[_ngcontent-%COMP%]{top:30%;left:50%;transform:translate(-50%,50%)}.tier-not-available[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;width:280px;margin:var(--space-1400) auto}.tier-not-available[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{height:var(--size-600);width:var(--size-600);font-size:var(--size-600);line-height:var(--size-600);color:var(--colour-text-accent-default);margin-bottom:var(--space-300)}.tier-not-available[_ngcontent-%COMP%] > p[class=body-sm-medium][_ngcontent-%COMP%]{margin-bottom:var(--space-100)}.tier-not-available[_ngcontent-%COMP%] > p[class=body-sm-regular][_ngcontent-%COMP%]{text-align:center;color:var(--colour-text-secondary)}.tier-not-available[_ngcontent-%COMP%] > p[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{color:var(--colour-text-accent-default)}"],changeDetection:0})}}return n})()}];let Co=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.$C({type:n})}static{this.\u0275inj=l.G2t({imports:[re.iI.forChild(vo),re.iI]})}}return n})(),bo=(()=>{class n{static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275mod=e.$C({type:n})}static{this.\u0275inj=l.G2t({imports:[p.MD,Co,$.y,u.$,m.X1,I.K,c.TDG,g.R,c.Qpp,O.p,b.b,L,c.PYJ,c.wux,c.CYR,c.rxf,c.bEy,c.Sjx,c.ZuA,c.xBz,h.K,_.tP,F.RI,S.D6,x.Cn,f.YN,P.R,T.m_,Pe,ee]})}}return n})()},20731(j,M,r){r.d(M,{c:()=>$});var p=r(83569),m=r(2615),f=r(61945);class _{_document;_textarea;constructor(O,h){this._document=h;const g=this._textarea=this._document.createElement("textarea"),e=g.style;e.position="fixed",e.top=e.opacity="0",e.left="-999em",g.setAttribute("aria-hidden","true"),g.value=O,g.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(g)}copy(){const O=this._textarea;let h=!1;try{if(O){const g=this._document.activeElement;O.select(),O.setSelectionRange(0,O.value.length),h=this._document.execCommand("copy"),g&&g.focus()}}catch{}return h}destroy(){const O=this._textarea;O&&(O.remove(),this._textarea=void 0)}}let F=(()=>{class b{_document=(0,m.WQX)(m.qQL);constructor(){}copy(h){const g=this.beginCopy(h),e=g.copy();return g.destroy(),e}beginCopy(h){return new _(h,this._document)}static \u0275fac=function(g){return new(g||b)};static \u0275prov=m.jDH({token:b,factory:b.\u0275fac,providedIn:"root"})}return b})(),$=(()=>{class b{constructor(h,g){this.sitesSnapshotsService=h,this.clipboard=g}createSharableLink(h,g){let e;const l="#"+(0,p.C1)(h);e=`${this.sitesSnapshotsService.currentSite$.value?.configuration.path}${g}${l}`,this.tryCopyToClipboard(e)}tryCopyToClipboard(h){const g=this.clipboard.beginCopy(h);let e=3;const l=()=>{const L=g.copy();return!L&&--e?(setTimeout(l),!1):(g.destroy(),!!L)};return l()}static{this.\u0275fac=function(g){return new(g||b)(m.KVO(f.X),m.KVO(F))}}static{this.\u0275prov=m.jDH({token:b,factory:b.\u0275fac,providedIn:"root"})}}return b})()},2933(j,M,r){r.d(M,{L:()=>_});var p=r(29330),m=r(21413),f=r(84412),P=r(18810),T=r(99437),x=r(88141),S=r(79328);class _ extends S.N{constructor(c){super(c),this._results$=new f.t([]),this._totalCount$=new m.B,this._params=new p.Nl,this.filters={},this.page="",this.perPage="",this.totalCount="",this.results$=this._results$.asObservable()}reset(){return this._params=new p.Nl,this.isLoaded$.next(!1),this._results$.next([]),this}loadMore(){this.page&&(this.params({page:this.page}),this.load(!0))}params(c){return Object.keys(c).filter(u=>
1c[u]).forEach(u=>{this._params=this._params.has(u)?this._params.set(u,c[u]):this._params.append(u,c[u])}),this}load(c=!1){return this.isLoading$.next(!0),this.source(this._params).pipe((0,x.M)(u=>{const I=u.headers.get("X-Page"),$=u.headers.get("X-Total-Count")||u.headers.get("X-Count");this.page=I,this.perPage=u.headers.get("X-Per-Page"),this.totalCount=$??this.totalCount,this.filters=u.body?.filters;const b=c?this._results$.value:[];this._data$.next(u),this._results$.next([...b,...u?.body?.data||[]]),this.isLoading$.next(!1),this.isLoaded$.next(!0)}),(0,T.W)(u=>(this.isError$.next(u),this._error$.next(u),this.isLoading$.next(!1),this.isLoaded$.next(!0),(0,P.$)(u)))).subscribe(),this}}},79328(j,M,r){r.d(M,{N:()=>F});var p=r(29330),m=r(84412),f=r(18359),P=r(18810),T=r(5964),x=r(99437),S=r(44668),_=r(88141);class F{constructor(u){this._isSuccess=new m.t(!1),this._queryParams=new p.Nl,this.isLoading$=new m.t(!1),this.isLoaded$=new m.t(!1),this.isError$=new m.t(!1),this.isSuccess$=this._isSuccess.asObservable().pipe((0,T.p)(Boolean)),this._data$=new m.t(null),this.data$=this._data$,this._error$=new m.t(null),this.error$=this._error$.asObservable().pipe((0,S.t)()),this.subscription=new f.yU,u&&(this.source=u)}destroy(){this.subscription.unsubscribe()}setSource(u){return this.source=u,this}reset(){return this._queryParams=new p.Nl,this.isLoaded$.next(!1),this.isError$.next(!1),this._isSuccess.next(!1),this._data$.next(null),this}params(u){return Object.keys(u).filter(I=>u[I]).forEach(I=>{this._queryParams=this._queryParams.has(I)?this._queryParams.set(I,u[I]):this._queryParams.append(I,u[I])}),this}load(){return this.isLoading$.next(!0),this.source(this._queryParams).pipe((0,_.M)(u=>{this._data$.next(u),this.isLoading$.next(!1),this.isLoaded$.next(!0),this._isSuccess.next(!0)}),(0,x.W)(u=>(this.isError$.next(u),this._error$.next(u),this.isLoading$.next(!1),this.isLoaded$.next(!0),(0,P.$)(u)))).subscribe(),this}}},10373(j,M,r){r.d(M,{D7:()=>f,E2:()=>P,JJ:()=>m});var p=r(62965);const m={companies:{label:"Organizations",type:p.c.DROPDOWN},locations:{label:"Locations",type:p.c.DROPDOWN},memberIndustries:{label:"Industries",type:p.c.DROPDOWN},memberInsights:{label:"Expertise",type:p.c.DROPDOWN},memberCategories:{label:"Categories",type:p.c.DROPDOWN},memberRoles:{label:"Roles",type:p.c.DROPDOWN},projects:{label:"Projects",type:p.c.DROPDOWN},subcommunities:{label:"Sub-Communities",type:p.c.DROPDOWN}},f=["locations","memberInsights","memberIndustries","companies","projects","subcommunities","memberCategories","memberRoles"],P={locations:{label:"Locations",type:p.c.DROPDOWN},organizations:{label:"Organizations",type:p.c.DROPDOWN},projects:{label:"Projects",type:p.c.DROPDOWN},industries:{label:"Industries",type:p.c.DROPDOWN},insights:{label:"Insights",type:p.c.DROPDOWN},subcommunities:{label:"Sub-Communities",type:p.c.DROPDOWN}}},32850(j,M,r){r.d(M,{D:()=>m,R:()=>p});var p=function(f){return f.MEMBERS="MemberList",f.EVENTS="Events",f.ASSESSMENT_REPORT="AssessmentReport",f}(p||{}),m=function(f){return f.XLSX="xlsx",f.PPTX="pptx",f.PDF="pdf",f}(m||{})},17036(j,M,r){r.d(M,{V:()=>P});var p=r(72200),m=r(2578);const P=T=>{const{blob:x,communityName:S,exportDataType:_,fileType:F}=T;if(x){const I=`${S.replace(/ /g,"_")}_${_}_${(0,p.Yq)(new Date,"dMMMyy","en-US")}.${F}`;return m.saveAs(x,I),I}return""}},75139(j,M,r){r.d(M,{z:()=>m});var p=r(88192);const m=(f,P)=>!!(!f||P===p.J.MEMBERS&&f.initiativeMemberSpace||P===p.J.FOLLOWERS&&f.authenticatedSpace||P===p.J.PUBLIC&&f.publicSpace)}}]);
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.