1import {x}from'./chunk-cHXJZtHI.js';import {m}from'./chunk-xJNx45px.js';import {f as ft$1,g as gt$1,T as Te$1,R as Re$1,j as je$1,G as Ge$1}from'./chunk-B69UjOcf.js';import'./chunk-Dt1H99k3.js';import {U}from'./chunk-H0H1Ukk-.js';import'./chunk-BeddvKBr.js';import'./chunk-BWJJ3S5-.js';import'./chunk-BcKmwJJ0.js';import'./chunk-CBiEowTI.js';import {I,aa as $,ac as h,D as _,a as Ti,a3 as wb,K,Q,ay as t$1,s as sC,bo as E_,Y as Yn,R as Je$1,S as Ln,aG as un,aC as M_,r as rs,n as ng,z as zw,G as Gu,c as cg,J as JC,d as cE,y as yg,t as tg,X as XC,_ as _g,aw as Ue$1,bA as P,aN as Pl,dM as vr,dN as Kl,dO as Wl,a9 as yt,az as V$1,g as gw,o as Yu,aT as pb,aW as mb,u as uw,F as Fd,L as Ld,ap as ww,al as Gh,am as Db,an as ub,m as cb,a0 as mI,bg as kg,bh as Jw,a1 as vI,bi as Rg,q as Tg,f as nw,aH as tw,h as rw}from'./main-IULO3ZKV.js';var Se=(()=>{class i{http=I(Ue$1);apiUrl=t$1.apiUrl;getCandidates(e){let n=new P().set("role",e);return this.http.get(`${this.apiUrl}/uslax-membership/candidates`,{params:n})}reconcile(e){return this.http.post(`${this.apiUrl}/uslax-membership/reconcile`,e)}startEmail(e){return this.http.post(`${this.apiUrl}/uslax-membership/email`,e)}getEmailStatus(e){return this.http.get(`${this.apiUrl}/uslax-membership/email/${e}/status`)}sendTestEmail(e){return this.http.post(`${this.apiUrl}/uslax-membership/email/test-send`,e)}sendEmailAndAwait(e){return this.startEmail(e).pipe(Pl(n=>vr(0,1e3).pipe(Pl(()=>this.getEmailStatus(n.batchJobId)),Kl(t=>!t.done,true),Wl(),yt(t=>({start:n,status:t})))))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=V$1({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Te=()=>({field:"lastName",direction:"Ascending"}),Le=i=>[i],Re=i=>({columns:i}),Ae=()=>({wrapMode:"Header"}),Ne=()=>({class:"row-number-cell"}),we=()=>({class:"uslax-date-cell"});function Ue(i,l){i&1&&(rs(0,"span",28)(1,"span",29),zw(2,"Reconciling..."),Gu()(),zw(3," Reconciling "));}function De(i,l){if(i&1&&(ng(0,"i",30),zw(1)),i&2){let e=gw();cE(),Yu("Reconcile ",e.candidates().length," ");}}function ke(i,l){i&1&&(rs(0,"span",18),zw(1),pb(2,"date"),Gu()),i&2&&(cE(),_g(mb(2,1,l,"mediumDate")));}function Ie(i,l){i&1&&(rs(0,"span",19),zw(1,"Not set"),Gu());}function Oe(i,l){if(i&1&&(rs(0,"div",23),ng(1,"i",31),zw(2),Gu()),i&2){let e=gw();cE(2),Yu(" ",e.errorMessage()," ");}}function Pe(i,l){if(i&1&&(rs(0,"span",34)(1,"strong"),zw(2),Gu(),zw(3),Gu()),i&2){let e=gw();cE(2),_g(e.failed),cE(),Yu(" ",e.failed===1?"check failed":"checks failed"," ");}}function Ve(i,l){if(i&1&&(rs(0,"div",24)(1,"div",32)(2,"span")(3,"strong"),zw(4),Gu(),zw(5),Gu(),rs(6,"span",33)(7,"strong"),zw(8),Gu(),zw(9),Gu(),JC(10,Pe,4,2,"span",34),Gu()()),i&2){let e=l;cE(4),_g(e.totalPinged),cE(),Yu(" ",e.totalPinged===1?"membership":"memberships"," checked with USA Lacrosse"),cE(3),_g(e.datesUpdated),cE(),Yu(" ",e.datesUpdated===1?"expiry date updated":"expiry dates updated"," "),cE(),XC(e.failed>0?10:-1);}}function Be(i,l){if(i&1&&(rs(0,"span",40),zw(1),Gu()),i&2){let e=gw(2);cE(),Yu(" ",e.selectedHealthy().length," selected in good standing (will be skipped) ");}}function $e(i,l){i&1&&zw(0," Each coach is emailed at their own address. ");}function je(i,l){i&1&&zw(0," Each player's email goes to every address the family has on file \u2014 mom, dad, and the player's own. ");}function Fe(i,l){if(i&1){let e=uw();rs(0,"app-test-send-button",59),cg("send",function(t){Fd(e);let d=gw(3);return Ld(d.sendTestEmail(t))}),Gu();}if(i&2){let e=gw(3);tg("disabled",!e.canSendEmail())("busy",e.isSendingTest());}}function We(i,l){i&1&&(rs(0,"span",28)(1,"span",29),zw(2,"Sending..."),Gu()(),zw(3," Sending "));}function He(i,l){if(i&1&&(ng(0,"i",60),zw(1)),i&2){let e=gw(3);cE(),Yu("Send to ",e.effectiveRecipientCount()," ");}}function Ye(i,l){if(i&1){let e=uw();rs(0,"section",41,0)(2,"div",42)(3,"h3",43),zw(4,"Compose email"),Gu(),rs(5,"div",44)(6,"button",45),cg("click",function(){Fd(e);let t=gw(2);return Ld(t.loadDefaultTemplate())}),ng(7,"i",46),zw(8,"Load default template "),Gu(),rs(9,"button",45),cg("click",function(){Fd(e);let t=gw(2);return Ld(t.clearCompose())}
1),zw(10," Clear "),Gu(),rs(11,"button",47),cg("click",function(){Fd(e);let t=gw(2);return Ld(t.closeCompose())}),ng(12,"i",48),Gu()()(),rs(13,"div",49),zw(14," Sending to "),rs(15,"strong"),zw(16),Gu(),zw(17),rs(18,"span",50),JC(19,$e,1,0)(20,je,1,0),Gu()(),rs(21,"div",51)(22,"label",52),zw(23,"Subject"),Gu(),rs(24,"input",53),cg("ngModelChange",function(t){Fd(e);let d=gw(2);return Ld(d.subject.set(t))}),Gu(),mI(),Gu(),rs(25,"div",51)(26,"label",54),zw(27,"Body"),Gu(),rs(28,"app-email-body-editor",55),kg("bodyChange",function(t){Fd(e);let d=gw(2);return Jw(d.body,t)||(d.body=t),Ld(t)}),Gu(),rs(29,"small",50),zw(30," All standard email tokens work here ("),rs(31,"code"),zw(32,"!PERSON"),Gu(),zw(33,", "),rs(34,"code"),zw(35,"!JOBNAME"),Gu(),zw(36,", "),rs(37,"code"),zw(38,"!JOBLINK"),Gu(),zw(39,", "),rs(40,"code"),zw(41,"!USLAXVALIDTHROUGHDATE"),Gu(),zw(42,", "),rs(43,"code"),zw(44,"!UNSUBSCRIBE"),Gu(),zw(45,", \u2026). Per-recipient USLax tokens: "),rs(46,"code"),zw(47,"!PLAYERDOB"),Gu(),zw(48,", "),rs(49,"code"),zw(50,"!USLAXMEMBERID"),Gu(),zw(51,", "),rs(52,"code"),zw(53,"!USLAXMEMBERSTATUS"),Gu(),zw(54,", "),rs(55,"code"),zw(56,"!USLAXAGEVERIFIED"),Gu(),zw(57,", "),rs(58,"code"),zw(59,"!USLAXEXPIRY"),Gu(),zw(60,". "),Gu()(),rs(61,"div",56),JC(62,Fe,1,2,"app-test-send-button",57),rs(63,"button",11),cg("click",function(){Fd(e);let t=gw(2);return Ld(t.send())}),JC(64,We,4,0)(65,He,2,1),Gu(),rs(66,"button",58),cg("click",function(){Fd(e);let t=gw(2);return Ld(t.closeCompose())}),zw(67," Cancel "),Gu()()();}if(i&2){let e=gw(2);cE(6),tg("disabled",e.isSending()),cE(3),tg("disabled",e.isSending()),cE(2),tg("disabled",e.isSending()),cE(5),_g(e.effectiveRecipientCount()),cE(),Yu(" ",e.effectiveRecipientCount()===1?"registrant":"registrants",". "),cE(2),XC(e.isCoachRole()?19:20),cE(5),tg("ngModel",e.subject())("disabled",e.isSending()),vI(),cE(4),Rg("body",e.body),tg("height",380)("disabled",e.isSending()),cE(34),XC(e.isNonProd&&e.isSuperuser()?62:-1),cE(),tg("disabled",!e.canSendEmail()),cE(),XC(e.isSending()?64:65),cE(2),tg("disabled",e.isSending());}}function Je(i,l){if(i&1){let e=uw();rs(0,"div",35)(1,"button",36),cg("click",function(){Fd(e);let t=gw();return Ld(t.emailThoseNeedingEmail())}),ng(2,"i",37),zw(3),Gu(),rs(4,"button",38),cg("click",function(){Fd(e);let t=gw();return Ld(t.openCompose())}),ng(5,"i",39),zw(6),Gu(),JC(7,Be,2,1,"span",40),Gu(),JC(8,Ye,68,15,"section",41);}if(i&2){let e=gw();cE(),tg("disabled",e.rowsNeedingAction().length===0||e.showCompose()),cE(2),Yu("Email Those Needing Email (",e.rowsNeedingAction().length,") "),cE(),tg("disabled",e.effectiveRecipientCount()===0||e.showCompose())("title",e.emailDisabledReason()??"Compose email for the rows you have checked"),cE(2),Yu("Email Selected (",e.effectiveRecipientCount(),") "),cE(),XC(e.selectedHealthy().length>0&&e.selectedRows().length>0?7:-1),cE(),XC(e.showCompose()?8:-1);}}function ze(i,l){i&1&&(rs(0,"div",25)(1,"div",61)(2,"span",29),zw(3,"Loading..."),Gu()()());}function Ge(i,l){i&1&&ng(0,"i",79);}function Xe(i,l){if(i&1&&JC(0,Ge,1,0,"i",79),i&2){let e=l.$implicit,n=gw(2);XC(n.needsAction(e)?0:-1);}}function Ke(i,l){if(i&1&&(rs(0,"span",80),zw(1),Gu()),i&2){let e=l.$implicit,n=gw(2);tg("ngClass",n.rowClass(e)),cE(),Tg(" ",e.lastName,", ",e.firstName," ");}}function Qe(i,l){if(i&1&&zw(0),i&2){let e=l.$implicit,n=gw(2);Yu(" ",n.padMembershipId(e.membershipId)," ");}}function qe(i,l){if(i&1&&(rs(0,"span",83),zw(1),Gu()),i&2){let e=gw().$implicit;yg("bg-success-subtle",e.memStatus==="Active")("text-success-emphasis",e.memStatus==="Active")("bg-warning-subtle",e.memStatus!=="Active")("text-warning-emphasis",e.memStatus!=="Active"),cE(),Yu(" ",e.memStatus," ");}}function Ze(i,l){i&1&&(rs(0,"span",82),zw(1,"\u2014"),Gu());}function et(i,l){if(i&1&&JC(0,qe,2,9,"span",81)(1,Ze,2,0,"span",82),i&2){let e=l.$implicit;XC(e.memStatus?0:1);}}function tt(i,l){if(i&1&&zw(0),i&2){let e=l.$implicit,n=gw(2);Yu(" ",n.ageVerifiedDisplay(e)," ");}}function it(i,l){if(i&1&&(rs(0,"span",85),zw(1),Gu()),i&2){let e=l.$implicit;cE(),_g(e);}}function nt(i,l){if(i&1&&(rs(0,"div",84),nw(1,it,2,1,"span",85,tw),Gu()),i&2){let e=l.$implicit,n=gw(2);cE(),rw(n.involvementBadges(e));}}function ot(i,l){if(i&1&&(rs(0,"span",86),zw(1),Gu()),i&2){let e=l.$implicit,n=gw(2);tg("ngClass",n.checkClass(e.lastNameMatch))("title",n.checkTitle(e,"lastName")),cE(),_g(e.lastNameMatch);}}function at(i,l){if(i&1&&(rs(0,"span",86),zw(1),Gu()),i&2){let e=l.$implicit,n=gw(2);tg("ngClass",n.checkClass(e.dobMatch))("title",n.checkTitle(e,"dob")),cE(),_g(e.dobMatch);}}function st(i,l){if(i&1&&(rs(0,"span",86),zw(1),Gu()),i&2){let e=l.$implicit,n=gw(2);tg("ngClass",n.checkClass(e.meetsValidThrough))("title",n.checkTitle(e,"validThrough")),cE(),_g(e.meetsValidThrough);}}function rt(i,l){if(i&1&&(rs(0,"span",86),zw(1),Gu()),i&2){let e=l.$implicit,n=gw(2);tg("ngClass",n.otherIssueClass(e.otherIssue))("title",n.otherIssueTitle(e)),cE(),_g(e.otherIssue);}}function lt(i,l){if(i&1&&(zw(0),pb(1,"date")),i&2){let e=l.$implicit;
1Yu(" ",e.previousExpiryDate?mb(1,1,e.previousExpiryDate,"MM/dd/yyyy"):"\u2014"," ");}}function dt(i,l){i&1&&ng(0,"i",87);}function ct(i,l){if(i&1&&(rs(0,"span"),zw(1),pb(2,"date"),JC(3,dt,1,0,"i",87),Gu()),i&2){let e=l.$implicit;yg("updated-cell",e.expiryDateUpdated),cE(),Yu(" ",e.newExpiryDate?mb(2,4,e.newExpiryDate,"MM/dd/yyyy"):"\u2014"," "),cE(2),XC(e.expiryDateUpdated?3:-1);}}function mt(i,l){if(i&1&&zw(0),i&2){let e=l.$implicit,n=gw(2);Yu(" ",n.detailLines(e).join(" ")," ");}}function pt(i,l){if(i&1){let e=uw();rs(0,"div",26)(1,"ejs-grid",62,1),cg("rowSelecting",function(t){Fd(e);let d=gw();return Ld(d.onRowSelecting(t))})("rowSelected",function(){Fd(e);let t=ww(2),d=gw();return Ld(d.onSelectionChanged(t))})("rowDeselected",function(){Fd(e);let t=ww(2),d=gw();return Ld(d.onSelectionChanged(t))})("rowDataBound",function(t){Fd(e);let d=gw();return Ld(d.onRowDataBound(t))})("dataBound",function(){Fd(e);let t=ww(2),d=gw();return Ld(d.onGridDataBound(t))})("toolbarClick",function(t){Fd(e);let d=ww(2),p=gw();return Ld(p.onGridToolbarClick(t,d))})("excelQueryCellInfo",function(t){Fd(e);let d=gw();return Ld(d.onExcelQueryCellInfo(t))}),rs(3,"e-columns"),ng(4,"e-column",63)(5,"e-column",64),rs(6,"e-column",65),Gh(7,Xe,1,1,"ng-template",null,2,Db),Gu(),rs(9,"e-column",66),Gh(10,Ke,2,3,"ng-template",null,2,Db),Gu(),rs(12,"e-column",67),Gh(13,Qe,1,1,"ng-template",null,2,Db),Gu(),ng(15,"e-column",68),rs(16,"e-column",69),Gh(17,et,2,1,"ng-template",null,2,Db),Gu(),rs(19,"e-column",70),Gh(20,tt,1,1,"ng-template",null,2,Db),Gu(),rs(22,"e-column",71),Gh(23,nt,3,0,"ng-template",null,2,Db),Gu(),rs(25,"e-column",72),Gh(26,ot,2,3,"ng-template",null,2,Db),Gu(),rs(28,"e-column",73),Gh(29,at,2,3,"ng-template",null,2,Db),Gu(),rs(31,"e-column",74),Gh(32,st,2,3,"ng-template",null,2,Db),Gu(),rs(34,"e-column",75),Gh(35,rt,2,3,"ng-template",null,2,Db),Gu(),rs(37,"e-column",76),Gh(38,lt,2,4,"ng-template",null,2,Db),Gu(),rs(40,"e-column",77),Gh(41,ct,4,7,"ng-template",null,2,Db),Gu(),rs(43,"e-column",78),Gh(44,mt,1,1,"ng-template",null,2,Db),Gu()()()();}if(i&2){let e=gw();cE(),tg("dataSource",e.gridRows())("allowSorting",true)("sortSettings",ub(25,Re,ub(23,Le,cb(22,Te))))("allowTextWrap",true)("textWrapSettings",cb(27,Ae))("allowExcelExport",true)("allowResizing",true)("allowFiltering",true)("filterSettings",e.filterSettings)("toolbar",e.gridToolbar)("selectionSettings",e.selectionSettings),cE(3),tg("allowSorting",false)("allowFiltering",false),cE(),tg("allowSorting",false)("allowFiltering",false)("customAttributes",cb(28,Ne)),cE(17),tg("allowFiltering",false)("sortComparer",e.involvementSortComparer),cE(15),tg("customAttributes",cb(29,we)),cE(3),tg("customAttributes",cb(30,we)),cE(3),tg("visible",false)("allowFiltering",false);}}function ut(i,l){i&1&&zw(0," No eligible coaches on this job. Reconciliation requires active unassigned-adult registrations with a USA Lacrosse number and date of birth on file. ");}function ht(i,l){i&1&&zw(0," No eligible Lacrosse players on this job. Reconciliation requires active Player registrations with a USA Lacrosse number and date of birth on file. ");}function gt(i,l){if(i&1&&(rs(0,"div",25),ng(1,"i",88),rs(2,"p",89),JC(3,ut,1,0)(4,ht,1,0),Gu()()),i&2){let e=gw();cE(3),XC(e.isCoachRole()?3:4);}}function bt(i,l){i&1&&(rs(0,"div",27),zw(1," Press "),rs(2,"strong"),zw(3,"Reconcile"),Gu(),zw(4," to check USA Lacrosse for each eligible registrant. Expiry dates will be updated automatically. "),Gu());}var V={Player:0,Coach:1},L={dob:["DobMismatch"],lastName:["LastNameMismatch"],validThrough:["ExpiresBeforeCutoff","NoCutoffConfigured"]},_t=new Set(Object.values(L).flat()),ft="!JOBNAME: Your USA Lacrosse Membership Status",ye=`<p>The USA Lacrosse Membership on file for your !JOBNAME registration:</p> 2<ul> 3 <li>Name: !PERSON</li> 4 <li>Date of Birth: !PLAYERDOB</li> 5 <li>Membership ID: !USLAXMEMBERID</li> 6 <li>Membership Status: !USLAXMEMBERSTATUSSTATUS</li> 7 <li>Age Verification Status: !USLAXAGEVERIFIED</li> 8 <li>Expiration Date: !USLAXEXPIRY</li> 9</ul>`,Ee=`<p>Your membership must be <strong>Active</strong> and valid through the dates required for !JOBNAME. If the information above is not correct, or your status is anything other than Active, follow the guidance below for your situation.</p> 10<hr> 11<p><strong>If your status is PENDING or SUSPENDED</strong></p> 12<p>This is usually related to USA Lacrosse's Age Verification requirements. See <a href="https://www.usalacrosse.com/age-verification">https://www.usalacrosse.com/age-verification</a> for details.</p> 13<ul> 14 <li>If Age Verification shows <em>Not Initiated</em>, follow the steps at the link above.</li> 15 <li>If Age Verification shows <em>Pending Review</em>, USA Lacrosse is reviewing your documentation.</li> 16 <li>If Age Verification shows <em>Failed Verification</em>, please resubmit documentation.</li> 17 <li>Questions: <a href="mailto:[email protected]">[email protected]</a> or 410-235-6882.</li> 18</ul> 19<p><strong>If your status is INACTIVE or your membership is expired</strong></p> 20<ul> 21 <li>Go to <a href="https://account.usalacrosse.com/login">https://account.usalacrosse.com/login</a> to renew or update your membership.</li> 22</ul>`,xt=`<p>Hello !PERSON,</p> 23${ye} 24${Ee} 25<p><strong>If your status is ACTIVE but the Name or DOB above is wrong</strong></p> 26<p>The DOB and Last Name on your TeamSportsInfo.com registration must match what USA Lacrosse has on file, and your USA Lacrosse membership must include a <em>Player</em> involvement.</p> 27<ol> 28 <li>Login to !JOBLINK</li> 29 <li>Select your !PERSON registration for !JOBNAME</li> 30 <li>Select 'Player Registration' from the 'Player' dropdown at the top right</li> 31 <li>Click 'Next' to review/edit Last Name, DOB, and USA Lacrosse number</li> 32 <li>Click 'Submit Registration(s)' to save changes</li> 33</ol> 34<p>If the data on the USA Lacrosse membership itself is incorrect, contact <a href="mailto:[email protected]">[email protected]</a> or call 410-235-6882.</p> 35<p>Thank you!</p>`,Ct=`<p>Hello !PERSON,</p> 36${ye} 37${Ee} 38<p><strong>If your status is ACTIVE but the Name or DOB above is wrong</strong></p> 39<p>The DOB and Last Name on your TeamSportsInfo.com registration must match what USA Lacrosse has on file. Login to !JOBLINK, open your !JOBNAME registration, and correct any discrepancies on the Registration form.</p> 40<p>If the data on the USA Lacrosse membership itself is incorrect, contact <a href="mailto:[email protected]">[email protected]</a> or call 410-235-6882.</p> 41<p>Thank you!</p>`,Ht=(()=>
41{class i{service=I(Se);jobService=I($);toast=I(h);auth=I(_);MEMBERSHIP_ROLE=V;role=Ti(V.Player);candidates=Ti([]);rows=Ti([]);isLoadingCandidates=Ti(false);isReconciling=Ti(false);errorMessage=Ti(null);summary=Ti(null);selectedRows=Ti([]);showCompose=Ti(false);subject=Ti("");body=Ti("");isSending=Ti(false);gridRef;jobValidThrough=wb(()=>{let e=this.jobService.currentJob()?.usLaxNumberValidThroughDate;if(!e)return null;let n=new Date(e);return isNaN(n.getTime())?null:n});canReconcile=wb(()=>this.candidates().length>0&&!this.isReconciling());isCoachRole=wb(()=>this.role()===V.Coach);eligibleLabel=wb(()=>this.isCoachRole()?"Eligible coaches":"Eligible players");eligibleNote=wb(()=>this.isCoachRole()?"Active unassigned adults with a USA Lacrosse number on file":"Active Lacrosse Players with a membership ID on file");filterSettings={type:"Excel"};static NOT_ASSESSED="\u2014";gridRows=wb(()=>this.rows().map(e=>K(Q({},e),{needsEmail:this.needsAction(e)?"Yes":"No",lastNameMatch:this.verdictOf(e,L.lastName),dobMatch:this.verdictOf(e,L.dob),meetsValidThrough:this.verdictOf(e,L.validThrough),otherIssue:this.otherIssueOf(e)})));gridToolbar=["ExcelExport"];selectionSettings={type:"Multiple",checkboxOnly:true};rowsNeedingAction=wb(()=>this.rows().filter(e=>this.needsAction(e)));selectedHealthy=wb(()=>this.selectedRows().filter(e=>!this.needsAction(e)));effectiveRecipientCount=wb(()=>this.selectedRows().filter(e=>this.needsAction(e)).length);emailDisabledReason=wb(()=>this.selectedRows().length===0?"Select one or more rows to email.":this.effectiveRecipientCount()===0?"All selected rows are already in good standing \u2014 nothing to send.":null);canSendEmail=wb(()=>!this.isSending()&&this.effectiveRecipientCount()>0&&this.subject().trim().length>0&&this.body().trim().length>0);ngOnInit(){this.loadCandidates();}setRole(e){this.role()!==e&&(this.role.set(e),this.rows.set([]),this.summary.set(null),this.selectedRows.set([]),this.closeCompose(),this.loadCandidates());}loadCandidates(){this.isLoadingCandidates.set(true),this.errorMessage.set(null),this.selectedRows.set([]),this.service.getCandidates(this.role()).subscribe({next:e=>{this.candidates.set(e),this.isLoadingCandidates.set(false);},error:e=>{this.errorMessage.set(e?.error?.message||"Failed to load candidates."),this.isLoadingCandidates.set(false);}});}reconcileAll(){this.canReconcile()&&(this.isReconciling.set(true),this.rows.set([]),this.summary.set(null),this.selectedRows.set([]),this.service.reconcile({role:this.role()}).subscribe({next:e=>{this.rows.set(e.rows),this.summary.set({totalPinged:e.totalPinged,datesUpdated:e.datesUpdated,failed:e.failed}),this.isReconciling.set(false);let n=e.totalPinged===1?"membership":"memberships",t=e.datesUpdated===1?"expiry date":"expiry dates",d=e.failed>0?`, ${e.failed} ${e.failed===1?"check":"checks"} failed`:"",p=`Checked ${e.totalPinged} ${n}. ${e.datesUpdated} ${t} updated${d}.`;this.toast.show(p,e.failed>0?"warning":"success",5e3),this.loadCandidates();},error:e=>{this.isReconciling.set(false),this.toast.show(`Reconciliation failed: ${e?.error?.message||"Unknown error"}`,"danger",5e3);}}));}onSelectionChanged(e){this.gridRef=e,Promise.resolve().then(()=>{let n=e.getSelectedRecords()??[];this.selectedRows.set([...n]);});}openCompose(){this.effectiveRecipientCount()!==0&&(!this.subject().trim()&&!this.body().trim()&&this.loadDefaultTemplate(),this.showCompose.set(true),setTimeout(()=>{let e=document.getElementById("uslaxSubject");e?.scrollIntoView({behavior:"smooth",block:"start"}),e?.focus({preventScroll:true});},0));}closeCompose(){this.showCompose.set(false);}loadDefaultTemplate(){this.subject.set(ft),this.body.set(this.isCoachRole()?Ct:xt);}clearCompose(){this.subject.set(""),this.body.set("");}buildRecipients(){return this.selectedRows().filter(e=>this.needsAction(e)).map(e=>({registrationId:e.registrationId,firstName:e.firstName,lastName:e.lastName,email:e.email,dob:null,membershipId:e.membershipId,memStatus:e.memStatus??null,ageVerified:e.ageVerified??null,expiryDate:e.newExpiryDate??e.previousExpiryDate??null}))}isNonProd=t$1.envName!=="production";isSuperuser=this.auth.isSuperuser;isSendingTest=Ti(false);sendTestEmail(e){if(!this.subject().trim()||!this.body().trim())return;let n=this.buildRecipients()[0];if(!n){this.toast.show("No recipient needing action to render the test against.","warning",4e3);return}this.isSendingTest.set(true),this.service.sendTestEmail({subject:this.subject(),body:this.body(),recipient:n,testRecipient:e.recipient}).subscribe({next:t=>{this.isSendingTest.set(false),t.sent?this.toast.show(`Test email (rendered for ${t.renderedFor}) sent to ${t.recipient}`,"success",6e3):this.toast.show(t.message||"Test send failed","danger",5e3);},error:t=>{this.isSendingTest.set(false),this.toast.show(`Test send failed: ${t?.error?.message||"Unknown error"}`,"danger",5e3);}});}send(){if(!this.canSendEmail())return;let e=this.buildRecipients();if(e.length===0){this.toast.show("No recipients need action \u2014 all selected rows are in good standing.","warning",4e3);return}let n=`Send this email to ${e.length} recipient${e.length===1?"":"s"}?`;confirm(n)&&(this.isSending.set(true),this.service.sendEmailAndAwait({subject:this.subject(),body:this.body(),recipients:e}).subscribe({next:({start:t,status:d})=>{this.isSending.set(false);let p=[`Sent ${d.sent} of ${t.totalRecipients}`];d.failed>0&&p.push(`${d.failed} failed`),d.optedOut>0&&p.push(`${d.optedOut} unsubscribed`),t.missingEmail>0&&p.push(`${t.missingEmail} had no email`),t.skippedHealthy>0&&p.push(`${t.skippedHealthy} skipped (already in good standing)`),t.unverifiable>0&&p.push(t.noCutoffConfigured?`${t.unverifiable} not checked \u2014 this event has no USA Lacrosse cutoff date set`:`${t.unverifiable} not checked \u2014 USA Lacrosse was unreachable, try again later`);let E=p.join(", ")+".",I=d.failed>0||t.skippedHealthy>0||t.unverifiable>0?"warning":"success";this.toast.show(E,I,t.unverifiable>0?9e3:6e3),this.showCompose.set(false),this.gridRef?.clearSelection(),this.selectedRows.set([]);},error:t=>{this.isSending.set(false),this.toast.show(`Email send failed: ${t?.error?.message||"Unknown error"}`,"danger",5e3);}}));}static UNVERIFIABLE_REASONS=["VendorUnavailable","NoCutoffConfigured"];needsAction(e){return i.UNVERIFIABLE_REASONS.includes(e.eligibilityReason)?false:!e.eligible}onRowSelecting(e){if(Array.isArray(e.data))return;let n=e.data;n&&!this.needsAction(n)&&(e.cancel=true);}onRowDataBound(e){let n=e.data;n&&!this.needsAction(n)&&e.row?.classList.add("uslax-row-not-mailable");}emailThoseNeedingEmail(){this.selectRowsWhere(e=>this.needsAction(e),()=>{this.effectiveRecipientCount()>0&&this.openCompose();});}selectRowsWhere(e,n){let t=this.gridRef;if(!t)return;let p=(t.getCurrentViewRecords()??[]).map((E,I)=>e(E)?I:-1).filter(E=>E>=0);t.clearSelection(),p.length>0&&t.selectRows(p),Promise.resolve().then(()=>{let E=t.getSelectedRecords()??[];this.selectedRows.set([...E]),n?.();});}onGridDataBound(e){this.gridRef=e;}padMembershipId(e){if(e==null)return "";let n=String(e).replace(/\D/g,"");return n?n.padStart(12,"0"):""}rowClass(e){return e.statusCode!==200?"row-error":e.expiryDateUpdated?"row-updated":e.memStatus==="Inactive"?"row-inactive":""}checkFor(e,n){return e.checks?.find(t=>n.includes(t.key))}verdictOf(e,n){let t=this.checkFor(e,n);return !t||t.passed===null||t.passed===void 0?i.NOT_ASSESSED:t.passed?"Yes":"No"}checkClass(e){return e==="No"?"text-danger fw-semibold":e==="Yes"?"text-success-emphasis":"text-body-secondary"}checkTitle(e,n){let t=this.checkFor(e,L[n]);return t?n==="dob"?t.passed===true?"Matches the birthdate USA Lacrosse has on file.":t.passed===false?"Does not match the birthdate USA Lacrosse has on file.":"Not checked.":t.detail??t.label:"Not checked \u2014 there was no USA Lacrosse record to check against."}otherChecks(e){return (e.checks??[]).filter(n=>!_t.has(n.key))}static OTHER_ISSUE_LABELS={VendorUnavailable:"Unreachable",NotFound:"No record",NotActive:"Not active",NotAPlayer:"Not a player",NotACoach:"Not a coach"};otherIssueOf(e){let n=this.otherChecks(e);if(n.length===0)return !e.checks?.length&&e.statusCode!==200?"Unreachable":i.NOT_ASSESSED;let t=n.filter(d=>d.passed===false);
41if(t.length>0){let d=i.OTHER_ISSUE_LABELS[t[0].key]??"Yes";return t.length>1?`${d} +${t.length-1}`:d}return n.some(d=>d.passed===true)?"No":i.NOT_ASSESSED}otherIssueClass(e){return e==="No"?"text-success-emphasis":e===i.NOT_ASSESSED?"text-body-secondary":"text-danger fw-semibold"}otherIssueTitle(e){let n=this.otherIssueLines(e);return n.length>0?n.join(" "):this.otherChecks(e).some(t=>t.passed===true)?"No other criteria failed.":"Not checked."}otherIssueLines(e){let n=this.otherChecks(e);return n.length===0?!e.checks?.length&&e.errorMessage?[e.errorMessage]:[]:n.filter(t=>t.passed!==true).map(t=>t.detail??t.label)}detailLines(e){let n=e.checks??[];return n.length===0?e.eligibilityDetail?[e.eligibilityDetail]:[]:n.filter(t=>t.passed!==true).map(t=>L.dob.includes(t.key)?"Date of birth does not match USA Lacrosse.":t.detail??t.label)}involvementSortComparer=(e,n,t,d)=>{let p=t?this.involvementBadges(t).join(", "):"",E=d?this.involvementBadges(d).join(", "):"";return p.localeCompare(E)};involvementBadges(e){let n=e.involvement;return Array.isArray(n)?n.filter(t=>typeof t=="string"):[]}ageVerifiedDisplay(e){let n=e.ageVerified;return n==null?"":n.toString().trim()}onGridToolbarClick(e,n){if(e.item?.id?.endsWith("_excelexport")){let t=this.isCoachRole()?"Coaches":"Players";n.excelExport({fileName:`USLaxMembershipReconciliation_${t}.xlsx`,includeHiddenColumn:true});}}onExcelQueryCellInfo(e){let n=e.data;switch(e.column.headerText){case "#":{let t=this.gridRef?.getCurrentViewRecords()??this.rows();e.value=t.findIndex(d=>d.registrationId===n.registrationId)+1;break}case "Email?":e.value=this.needsAction(n)?"Yes":"";break;case "Name":e.value=`${n.lastName}, ${n.firstName}`;break;case "Member ID":e.value=this.padMembershipId(n.membershipId);break;case "Status":e.value=n.memStatus??"";break;case "Details":{let t=this.detailLines(n);e.value=t.length>0?t.join(" "):n.errorMessage??(n.eligible?"Passes validation":"");break}case "Age Verified":e.value=this.ageVerifiedDisplay(n);break;case "Involvement":e.value=this.involvementBadges(n).join(", ");break;case "Other issue?":{let t=this.otherIssueLines(n),d=this.otherIssueOf(n);e.value=t.length>0?`${d} \u2014 ${t.join(" ")}`:d;break}case "Expiry Old":e.value=n.previousExpiryDate?new Date(n.previousExpiryDate).toLocaleDateString():"";break;case "Expiry New":e.value=n.newExpiryDate?new Date(n.newExpiryDate).toLocaleDateString():"";break}}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=sC({type:i,selectors:[["app-uslax-membership"]],decls:42,vars:21,consts:[["composePanel",""],["grid",""],["template",""],[1,"page-header"],[1,"page-title"],[1,"bi","bi-award","page-title-icon"],[1,"page-header-actions"],["role","group","aria-label","Membership role",1,"btn-group","role-toggle"],["type","button",1,"btn","btn-sm",3,"click","disabled"],["title","Refresh",1,"btn","btn-outline-secondary","btn-sm",3,"click","disabled"],[1,"bi","bi-arrow-clockwise"],[1,"btn","btn-primary","btn-sm",3,"click","disabled"],["aria-label","Job and eligibility context",1,"context-panel"],[1,"context-stat"],["aria-hidden","true",1,"stat-icon"],[1,"bi","bi-calendar-event"],[1,"stat-body"],[1,"stat-label"],[1,"stat-value"],[1,"stat-value","stat-value-muted"],["aria-hidden","true",1,"stat-divider"],[1,"bi","bi-people"],[1,"stat-note"],["role","alert",1,"alert","alert-danger","d-flex","align-items-center"],["role","status",1,"alert","alert-info","summary-panel"],[1,"text-center","py-5"],[1,"uslax-membership-grid"],[1,"text-center","py-4","text-body-secondary"],["role","status",1,"spinner-border","spinner-border-sm","me-1"],[1,"visually-hidden"],[1,"bi","bi-cloud-arrow-down","me-1"],[1,"bi","bi-exclamation-triangle-fill","me-2"],[1,"d-flex","flex-wrap","gap-3"],[1,"text-success"],[1,"text-danger"],[1,"d-flex","align-items-center","gap-2","mb-2","flex-wrap"],["title","Select every row marked in the Email? column and open the compose panel",1,"btn","btn-outline-primary","btn-sm",3,"click","disabled"],[1,"bi","bi-envelope-exclamation","me-1"],[1,"btn","btn-outline-primary","btn-sm",3,"click","disabled","title"],[1,"bi","bi-envelope","me-1"],[1,"text-body-secondary","small"],["aria-label","Compose USLax email",1,"compose-panel"],[1,"compose-header"],[1,"mb-0"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-sm","btn-outline-secondary",3,"click","disabled"],[1,"bi","bi-file-earmark-text","me-1"],["type","button","aria-label","Close compose panel",1,"btn","btn-sm","btn-link","text-body-secondary",3,"click","disabled"],[1,"bi","bi-x-lg"],[1,"compose-recipients"],[1,"text-body-secondary"],[1,"compose-field"],["for","uslaxSubject",1,"form-label"],["id","uslaxSubject","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel","disabled"],[1,"form-label"],[3,"bodyChange","body","height","disabled"],[1,"compose-actions"],[3,"disabled","busy"],["type","button",1,"btn","btn-outline-secondary","btn-sm",3,"click","disabled"],[3,"send","disabled","busy"],[1,"bi","bi-send","me-1"],["role","status",1,"spinner-border","spinner-border-sm","text-primary"],["width","100%","height","100%","tsicRowNumbers","","cssClass","tsic-grid-tight",3,"rowSelecting","rowSelected","rowDeselected","rowDataBound","dataBound","toolbarClick","excelQueryCellInfo","dataSource","allowSorting","sortSettings","allowTextWrap","textWrapSettings","allowExcelExport","allowResizing","allowFiltering","filterSettings","toolbar","selectionSettings"],["type","checkbox","width","40",3,"allowSorting","allowFiltering"],["headerText","#","width","44","textAlign","Center",3,"allowSorting","allowFiltering","customAttributes"],["headerText","Email?","width","104","minWidth","96","textAlign","Center","field","needsEmail"],["field","lastName","headerText","Name","width","150","minWidth","120","clipMode","EllipsisWithTooltip"],["field","membershipId","headerText","Member ID","width","134","minWidth","120"],["field","teamName","headerText","Team","width","120","minWidth","104","clipMode","EllipsisWithTooltip"],["field","memStatus","headerText","Status","width","102","minWidth","96","textAlign","Center"],["field","ageVerified","headerText","Age Verified","width","116","minWidth","104","clipMode","EllipsisWithTooltip"],["headerText","Involvement","width","140","minWidth","128","field","involvement",3,"allowFiltering","sortComparer"],["field","lastNameMatch","headerText","LN Match?","width","108","minWidth","100","textAlign","Center"],["field","dobMatch","headerText","DOB Match?","width","108","minWidth","100","textAlign","Center"],["field","meetsValidThrough","headerText","Meets Valid Thru?","width","102","minWidth","96","textAlign","Center"],["field","otherIssue","headerText","Other issue?","
41width","142","minWidth","128","textAlign","Center"],["field","previousExpiryDate","headerText","Expiry Old","width","112","minWidth","104","textAlign","Center","type","date","format","MM/dd/yyyy",3,"customAttributes"],["field","newExpiryDate","headerText","Expiry New","width","124","minWidth","112","textAlign","Center","type","date","format","MM/dd/yyyy",3,"customAttributes"],["field","eligibilityDetail","headerText","Details","width","240",3,"visible","allowFiltering"],["title","This family would receive the reminder email \u2014 the verdict columns say why","aria-label","Needs email",1,"bi","bi-check2","text-danger","fw-bold"],[1,"fw-semibold",3,"ngClass"],[1,"badge",3,"bg-success-subtle","text-success-emphasis","bg-warning-subtle","text-warning-emphasis"],["title","USA Lacrosse returned no membership status \u2014 see Other issue?",1,"badge","bg-secondary-subtle","text-body-secondary"],[1,"badge"],[1,"d-flex","flex-wrap","gap-1"],[1,"badge","bg-primary-subtle","text-primary-emphasis"],[3,"ngClass","title"],["title","Updated this run",1,"bi","bi-check-circle-fill","text-success","ms-1"],[1,"bi","bi-award","fs-1","text-body-secondary"],[1,"mt-2","text-body-secondary"]],template:function(n,t){if(n&1&&(rs(0,"div",3)(1,"h2",4),ng(2,"i",5),zw(3," USA Lacrosse Membership Reconciliation"),Gu(),rs(4,"div",6)(5,"div",7)(6,"button",8),cg("click",function(){return t.setRole(t.MEMBERSHIP_ROLE.Player)}),zw(7," Players "),Gu(),rs(8,"button",8),cg("click",function(){return t.setRole(t.MEMBERSHIP_ROLE.Coach)}),zw(9," Coaches "),Gu()(),rs(10,"button",9),cg("click",function(){return t.loadCandidates()}),ng(11,"i",10),Gu(),rs(12,"button",11),cg("click",function(){return t.reconcileAll()}),JC(13,Ue,4,0)(14,De,2,1),Gu()()(),rs(15,"section",12)(16,"div",13)(17,"div",14),ng(18,"i",15),Gu(),rs(19,"div",16)(20,"span",17),zw(21,"Job valid through"),Gu(),JC(22,ke,3,4,"span",18)(23,Ie,2,0,"span",19),Gu()(),ng(24,"div",20),rs(25,"div",13)(26,"div",14),ng(27,"i",21),Gu(),rs(28,"div",16)(29,"span",17),zw(30),Gu(),rs(31,"span",18),zw(32),Gu(),rs(33,"span",22),zw(34),Gu()()()(),JC(35,Oe,3,1,"div",23),JC(36,Ve,11,5,"div",24),JC(37,Je,9,7),JC(38,ze,4,0,"div",25)(39,pt,46,31,"div",26)(40,gt,5,1,"div",25)(41,bt,5,0,"div",27)),n&2){let d,p;cE(6),yg("btn-primary",!t.isCoachRole())("btn-outline-secondary",t.isCoachRole()),tg("disabled",t.isLoadingCandidates()||t.isReconciling()),cE(2),yg("btn-primary",t.isCoachRole())("btn-outline-secondary",!t.isCoachRole()),tg("disabled",t.isLoadingCandidates()||t.isReconciling()),cE(2),tg("disabled",t.isLoadingCandidates()||t.isReconciling()),cE(2),tg("disabled",!t.canReconcile()),cE(),XC(t.isReconciling()?13:14),cE(9),XC((d=t.jobValidThrough())?22:23,d),cE(8),_g(t.eligibleLabel()),cE(2),_g(t.candidates().length),cE(2),_g(t.eligibleNote()),cE(),XC(t.errorMessage()?35:-1),cE(),XC((p=t.summary())?36:-1,p),cE(),XC(t.rows().length>0?37:-1),cE(),XC(t.isLoadingCandidates()&&t.candidates().length===0?38:t.rows().length>0?39:!t.isLoadingCandidates()&&t.candidates().length===0&&!t.errorMessage()?40:!t.isReconciling()&&t.rows().length===0?41:-1);}},dependencies:[E_,Yn,Je$1,Ln,un,ft$1,gt$1,Te$1,Re$1,je$1,Ge$1,m,x,U,M_],styles:['.context-panel[_ngcontent-%COMP%]{display:flex;align-items:stretch;gap:var(--space-5);padding:var(--space-4) var(--space-5);margin-bottom:var(--space-3);background:linear-gradient(135deg,rgba(var(--bs-primary-rgb),.06) 0%,var(--brand-surface) 55%);border:1px solid var(--border-color);border-left:3px solid var(--bs-primary);border-radius:var(--radius-md);box-shadow:var(--shadow-sm)}.context-stat[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:var(--space-3);flex:1;min-width:0}.stat-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;flex:0 0 2.25rem;border-radius:50%;background:rgba(var(--bs-primary-rgb),.1);color:var(--bs-primary);font-size:1.15rem;line-height:1}.stat-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;gap:2px}.stat-label[_ngcontent-%COMP%]{font-size:var(--font-size-xs);font-weight:var(--font-weight-medium);text-transform:uppercase;letter-spacing:.04em;color:var(--brand-text-muted);line-height:1.1}.stat-value[_ngcontent-%COMP%]{font-size:var(--font-size-xl);font-weight:var(--font-weight-semibold);color:var(--brand-text);line-height:1.15;font-variant-numeric:tabular-nums}.stat-value-muted[_ngcontent-%COMP%]{color:var(--brand-text-muted);font-weight:var(--font-weight-normal);font-style:italic}.stat-note[_ngcontent-%COMP%]{font-size:var(--font-size-xs);color:var(--brand-text-muted);line-height:var(--line-height-tight);margin-top:2px}.stat-divider[_ngcontent-%COMP%]{width:1px;background:var(--border-color);align-self:stretch}@media(max-width:576px){.context-panel[_ngcontent-%COMP%]{flex-direction:column;gap:var(--space-3);padding:var(--space-3) var(--space-4)}.stat-divider[_ngcontent-%COMP%]{width:100%;height:1px}}.summary-panel[_ngcontent-%COMP%]{border:1px solid var(--bs-info-border-subtle);background:var(--bs-info-bg-subtle);color:var(--bs-body-color)}.row-updated[_ngcontent-%COMP%]{color:var(--bs-success-text-emphasis)}.row-inactive[_ngcontent-%COMP%]{color:var(--bs-warning-text-emphasis)}.row-error[_ngcontent-%COMP%]{color:var(--bs-danger-text-emphasis)}.updated-cell[_ngcontent-%COMP%]{font-weight:600}.role-toggle[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding:.25rem .75rem}.compose-panel[_ngcontent-%COMP%]{margin-top:var(--space-4);padding:var(--space-4) var(--space-5);background:var(--brand-surface);border:1px solid var(--border-color);border-left:3px solid var(--bs-primary);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);display:flex;flex-direction:column;gap:var(--space-3)}.compose-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);flex-wrap:wrap}.compose-recipients[_ngcontent-%COMP%]{font-size:var(--font-size-sm);color:var(--brand-text-muted)}.compose-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--space-1)}.compose-body[_ngcontent-%COMP%]{font-family:var(--font-family-monospace, ui-monospace, "SFMono-Regular", Menlo, monospace);font-size:var(--font-size-sm);line-height:1.45}.compose-actions[_ngcontent-%COMP%]{display:flex;gap:var(--space-2);justify-content:flex-end}[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0}.uslax-membership-grid[_ngcontent-%COMP%]{flex:1;min-height:0}[_nghost-%COMP%] .uslax-membership-grid .e-grid .e-gridheader .e-headercell{padding-inline:var(--space-2)}[_nghost-%COMP%] .uslax-membership-grid .e-grid .e-gridcontent .e-rowcell{padding-inline:var(--space-2)}[_nghost-%COMP%] .uslax-membership-grid .e-grid .e-headercelldiv, [_nghost-%COMP%] .uslax-membership-grid .e-grid .e-headercelldiv .e-headertext{white-space:normal!important;word-wrap:normal!important;overflow-wrap:normal!important;word-break:keep-all!important;line-height:1.2}[_nghost-%COMP%] .uslax-membership-grid .e-grid .uslax-date-cell{white-space:nowrap}']})}return i})();
41export{Ht as UsLaxMembershipComponent};
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.