1import{a as Nt}from"./chunk-R6YKEWAF.js";import{a as Qt}from"./chunk-44OHTKPY.js";import{a as ot}from"./chunk-BRA35DTV.js";import{a as we,b as qt,c as Ht,d as kt}from"./chunk-XDSB64N2.js";import{a as Ae}from"./chunk-6F4SDY22.js";import{a as Vt}from"./chunk-ZB44PIZA.js";import"./chunk-YBFQQSLW.js";import{a as ji,b as zi,c as Yi}from"./chunk-OBZUIDEP.js";import{a as Yt}from"./chunk-BFPYKIIC.js";import{a as Ii}from"./chunk-CHFQMRFX.js";import{e as Ui}from"./chunk-DLHY2JKF.js";import"./chunk-WLMRFXCZ.js";import"./chunk-Z3AXU4EF.js";import{a as Wi}from"./chunk-ZB64W4XA.js";import{a as W}from"./chunk-SVABVB5X.js";import{a as Ve}from"./chunk-JKMNVQUA.js";import{b as M}from"./chunk-4D5SN44G.js";import{a as $i}from"./chunk-B6XXRKU5.js";import"./chunk-6Q5DDO7R.js";import{$b as $,Ba as Fi,Be as Ni,Cc as Oi,Ce as nt,Ec as se,Ed as Pt,Ef as Ri,Ff as Li,Gb as Pe,Gc as Ce,Gd as Ot,Hc as xe,Hd as w,Kb as Et,Mb as _e,Qc as Mi,Rc as tt,Sc as ke,Vb as wt,Vd as Vi,Wc as H,Wd as ki,Yb as Ft,Zb as Ge,a as vt,b as Ke,cc as Pi,d as ge,ja as At,jg as Mt,k as ye,ka as Tt,kd as k,kh as Bi,lc as It,mb as je,ta as Be,va as wi,ve as N,ye as it}from"./chunk-X5J6QTCG.js";import{$ as ht,$a as f,$i as Dt,Ad as jt,Db as Le,E as Re,Fa as c,Fb as le,Gb as Ue,H as We,Ib as e,Jb as O,Ka as C,Kb as V,Lb as Wt,Lc as bt,Le as et,Ma as y,Mi as yi,Na as Ct,Ni as De,Qb as j,Rb as z,Sa as E,Sb as Y,Sc as _i,Th as K,U as J,Uh as Si,W as ft,Wc as Ci,Xa as ee,_ as ui,_c as xi,_i as yt,aj as Di,ba as pi,bb as h,be as ne,bg as fe,bj as X,cc as te,cj as Ai,d as ue,db as F,dc as Se,di as he,dj as Oe,eb as I,ec as xt,ej as Ti,fa as x,fb as P,fi as vi,fj as R,ga as b,gb as d,hb as r,hd as St,hh as zt,ib as a,ii as gi,ij as Ei,jb as p,k as Z,lc as Qe,ma as fi,mc as ct,nb as L,nc as Ut,ob as B,pb as st,pj as D,q as pt,qb as v,qc as mt,qf as bi,ra as hi,sb as S,tb as m,u as A,ua as _t,vd as T,wd as Ze,xb as pe,xd as q,yb as oe,yd as ie,zb as ae,zd as gt}from"./chunk-SMW7PHYX.js";import{a as Ee,b as lt,h as di}from"./chunk-BMIYOSOG.js";var Me=(function(n){return n[n.ANNUAL_FEE=1]="ANNUAL_FEE",n[n.ONE_TIME_FEE=2]="ONE_TIME_FEE",n[n.RETURN_FEE=3]="RETURN_FEE",n[n.CHARGEBACK_FEE=4]="CHARGEBACK_FEE",n[n.INTERNATIONAL_CARD_FEE=5]="INTERNATIONAL_CARD_FEE",n[n.OFFLINE_PAYMENT_FEE=6]="OFFLINE_PAYMENT_FEE",n[n.CUSTOM_FEE=7]="CUSTOM_FEE",n})(Me||{}),Rt=class{constructor(s,o,i,t){this.isProcessing=!1,this.clubFeeTypeID=s,this.clubStripeConnectedAccountID=o,i&&(this.amount=i),t&&(this.description=t)}};var ve=(()=>{let s=class s{constructor(i){this.webAPI=i,this.refreshAssignments=new ue,this.refreshAssignments$=this.refreshAssignments.asObservable()}getSitePaymentTypes(){return this.webAPI.getData("admin/clubs/payment-settings/site-payment-types")}getProgramTypes(){return this.webAPI.getData("admin/clubs/payment-settings/program-types")}getPaymentVendorMetadata(){return this.webAPI.getData("admin/clubs/payment-settings/payment-vendor/metadata")}getPaymentVendor(i){return i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/payment-vendor`):this.webAPI.getData("admin/clubs/current/payment-settings/payment-vendor")}savePaymentVendor(i,t){return t!==void 0?this.webAPI.putData(`admin/clubs/${t}/payment-settings/payment-vendor`,i):this.webAPI.putData("admin/clubs/current/payment-settings/payment-vendor",i)}getClubConnectedAccounts(i,t=!1){let l=new St;return l=l.append("refresh",t.toString()),i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/stripe/connected-accounts`,l):this.webAPI.getData("admin/clubs/current/payment-settings/stripe/connected-accounts",l)}getStripeAssignments(i){return i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/stripe/assignments`):this.webAPI.getData("admin/clubs/current/payment-settings/stripe/assignments")}saveConnectedAccount(i,t,l){return i!==void 0?this.webAPI.putData(`admin/clubs/${i}/payment-settings/stripe/connected-accounts/${t}`,l):this.webAPI.putData(`admin/clubs/current/payment-settings/stripe/connected-accounts/${t}`,l)}saveConnectedAccountPayoutSchedule(i,t,l){return i!==void 0?this.webAPI.putData(`admin/clubs/${i}/payment-settings/stripe/connected-accounts/${t}/payout-schedule`,l):this.webAPI.putData(`admin/clubs/current/payment-settings/stripe/connected-accounts/${t}/payout-schedule`,l)}createConnectedAccount(i,t,l){let u=new St;return u=u.append("createInStripe",l.toString()),i!==void 0?this.webAPI.postData(`admin/clubs/${i}/payment-settings/stripe/connected-accounts`,t,u):this.webAPI.postData("admin/clubs/current/payment-settings/stripe/connected-accounts",t,u)}deleteConnectedAccount(i,t){return i!==void 0?this.webAPI.deleteData(`admin/clubs/${i}/payment-settings/stripe/connected-accounts/${t}`):this.webAPI.deleteData(`admin/clubs/current/payment-settings/stripe/connected-accounts/${t}`)}saveConnectedAccountDefault(i,t,l){return i!==void 0?this.webAPI.putData(`admin/clubs/${i}/payment-settings/stripe/connected-accounts/${t}/default`,{isDefault:l}):this.webAPI.putData(`admin/clubs/current/payment-settings/stripe/connected-accounts/${t}/default`,{isDefault:l})}saveConnectedAccountActive(i,t,l){return i!==void 0?this.webAPI.putData(`admin/clubs/${i}/payment-settings/stripe/connected-accounts/${t}/active`,{isActive:l}):this.webAPI.putData(`admin/clubs/current/payment-settings/stripe/connected-accounts/${t}/active`,{isActive:l})}saveConnectedAccountAssignments(i,t){return i!==void 0?this.webAPI.putData(`admin/clubs/${i}/payment-settings/stripe/assignments`,t):this.webAPI.putData("admin/clubs/current/payment-settings/stripe/assignments",t)}isClubStripeConnectedAccountIDValid(i){let t=new St;return t=t.append("accountID",i),this.webAPI.getData("admin/clubs/payment-settings/stripe/connected-accounts/account-id/is-valid",t)}getConnectedAccount(i,t){return i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/stripe/connected-accounts/${t}`):this.webAPI.getData(`admin/clubs/current/payment-settings/stripe/connected-accounts/${t}`)}getStripeConnectedAccount(i,t){return i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/stripe/connected-accounts/${t}/stripe-account`):this.webAPI.getData(`admin/clubs/current/payment-settings/stripe/connected-accounts/${t}/stripe-account`)}getConnectedAccountOnboardingLink(i,t){return i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/stripe/connected-accounts/${t}/onboarding-link`):this.webAPI.getData(`admin/clubs/current/payment-settings/stripe/connected-accounts/${t}/onboarding-link`)}getConnectedAccountMetadata(){return this.webAPI.getData("admin/clubs/payment-settings/stripe/connected-accounts/metadata")}getConnectedAccountPayoutScheduleMetadata(){return this.webAPI.getData("admin/clubs/payment-settings/stripe/connected-accounts/payout-schedule/metadata")}getConnectedAccountSettingsMetadata(){return this.webAPI.getData("admin/clubs/payment-settings/stripe/settings/metadata")}getClubPaymentFees(i){return(i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/payment-fees`):this.webAPI.getData("admin/clubs/current/payment-settings/payment-fees")).pipe(pt(l=>{let u=new kt;return u.clubPaymentFeeStructureID=0,u.clubPaymentFees=l,[u]}))}saveClubPaymentFee(i,t){return t!==void 0?i.clubPaymentFeeID?this.webAPI.putData(`admin/clubs/${t}/payment-settings/payment-fees/${i.clubPaymentFeeID}
1`,i):this.webAPI.postData(`admin/clubs/${t}/payment-settings/payment-fees`,i):i.clubPaymentFeeID?this.webAPI.putData(`admin/clubs/current/payment-settings/payment-fees/${i.clubPaymentFeeID}`,i):this.webAPI.postData("admin/clubs/current/payment-settings/payment-fees",i)}deleteClubPaymentFee(i,t){return t!==void 0?this.webAPI.deleteData(`admin/clubs/${t}/payment-settings/payment-fees/${i}`):this.webAPI.deleteData(`admin/clubs/current/payment-settings/payment-fees/${i}`)}getClubPaymentFeesMetadata(){return this.webAPI.getData("admin/clubs/payment-settings/payment-fees/metadata")}setClubPaymentFeeDescription(i){i.isEnabled&&(i.feeDescription=`User pays ${zt(i.userFeePercentage)}%, Club pays ${zt(i.totalFeePercentage)}%`),i.feeDescription="Disabled"}getClubPaymentFeeStructureMetadata(){return this.webAPI.getData("admin/clubs/payment-settings/fee-structures/metadata")}getClubPaymentFeeStructures(i){return i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/fee-structures`):this.webAPI.getData("admin/clubs/current/payment-settings/fee-structures")}saveClubPaymentFeeStructure(i,t){return t!==void 0?i.clubPaymentFeeStructureID?this.webAPI.putData(`admin/clubs/${t}/payment-settings/fee-structures/${i.clubPaymentFeeStructureID}`,i):this.webAPI.postData(`admin/clubs/${t}/payment-settings/fee-structures`,i):i.clubPaymentFeeStructureID?this.webAPI.putData(`admin/clubs/current/payment-settings/fee-structures/${i.clubPaymentFeeStructureID}`,i):this.webAPI.postData("admin/clubs/current/payment-settings/fee-structures",i)}saveClubPaymentFeeStructureDefault(i,t,l){return i!==void 0?this.webAPI.putData(`admin/clubs/${i}/payment-settings/fee-structures/${t}/default`,{isDefault:l}):this.webAPI.putData(`admin/clubs/current/payment-settings/fee-structures/${t}/default`,{isDefault:l})}saveClubPaymentFeeStructureActive(i,t,l){return i!==void 0?this.webAPI.putData(`admin/clubs/${i}/payment-settings/fee-structures/${t}/active`,{isEnabled:l}):this.webAPI.putData(`admin/clubs/current/payment-settings/fee-structures/${t}/active`,{isEnabled:l})}getAccountFeeAssignmentMetadata(i){return i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/stripe/assignments/metadata`):this.webAPI.getData("admin/clubs/current/payment-settings/stripe/assignments/metadata")}getClubFees(i){return i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/club-fees`):this.webAPI.getData("admin/clubs/current/payment-settings/club-fees")}getClubFeeMetadata(i){return i!==void 0?this.webAPI.getData(`admin/clubs/${i}/payment-settings/club-fees/metadata`):this.webAPI.getData("admin/clubs/current/payment-settings/club-fees/metadata")}saveClubFee(i,t,l){return l!==void 0?i===Me.INTERNATIONAL_CARD_FEE||i===Me.OFFLINE_PAYMENT_FEE?t.clubFeeID?this.webAPI.putData(`admin/clubs/${l}/payment-settings/club-fees/${t.clubFeeID}/percentage`,t):this.webAPI.postData(`admin/clubs/${l}/payment-settings/club-fees/percentage`,t):t.clubFeeID?this.webAPI.putData(`admin/clubs/${l}/payment-settings/club-fees/${t.clubFeeID}/fixed`,t):this.webAPI.postData(`admin/clubs/${l}/payment-settings/club-fees/fixed`,t):i===Me.INTERNATIONAL_CARD_FEE||i===Me.OFFLINE_PAYMENT_FEE?t.clubFeeID?this.webAPI.putData(`admin/clubs/current/payment-settings/club-fees/${t.clubFeeID}/percentage`,t):this.webAPI.postData("admin/clubs/current/payment-settings/club-fees/percentage",t):t.clubFeeID?this.webAPI.putData(`admin/clubs/current/payment-settings/club-fees/${t.clubFeeID}/fixed`,t):this.webAPI.postData("admin/clubs/current/payment-settings/club-fees/fixed",t)}saveClubFeeEnabled(i,t,l){return l!==void 0?this.webAPI.putData(`admin/clubs/${l}/payment-settings/club-fees/${t}/enabled`,{isEnabled:i}):this.webAPI.putData(`admin/clubs/current/payment-settings/club-fees/${t}/enabled`,{isEnabled:i})}deleteClubFee(i,t){return t!==void 0?this.webAPI.deleteData(`admin/clubs/${t}/payment-settings/club-fees/${i}`):this.webAPI.deleteData(`admin/clubs/current/payment-settings/club-fees/${i}`)}};s.\u0275fac=function(t){return new(t||s)(pi(vi))},s.\u0275prov=ui({token:s,factory:s.\u0275fac});let n=s;return n})();function _n(n,s){if(n&1&&(e(0,` 2 `),r(1,"div",0),e(2,` 3 `),r(3,"app-inline-alert"),e(4,"Editing Club: \xA0"),r(5,"strong"),e(6),a()(),e(7,` 4 `),a(),e(8,` 5`)),n&2){let o=m();c(6),V(" ",o.childClubName)}}var Gt=(()=>{let s=class s{constructor(i,t,l,u,_){this.route=i,this.authorizeService=t,this.clubService=l,this.siteDataService=u,this.paymentSettingsService=_,this.showEmailAccounts=!1}
5ngOnInit(){this.clubID=this.route.snapshot.params.clubID,this.authorizeService.getUser().subscribe(i=>{i&&this.authorizeService.isSuperAdmin(i.role)&&(this.showEmailAccounts=!0)}),this.clubID!=="new"&&this.clubService.getClub(this.clubID).subscribe({next:i=>{i&&(this.childClubName=i.name)},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data")}})}ngOnDestroy(){this.paymentSettingsService.vendorSettingsTabID=null}};s.\u0275fac=function(t){return new(t||s)(C(T),C(he),C(W),C(D),C(ve))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:4,vars:1,consts:[[1,"px-3","pt-3"]],template:function(t,l){t&1&&(e(0,` 6`),f(1,_n,9,1),p(2,"router-outlet"),e(3,` 7`)),t&2&&(c(),h(l.childClubName&&l.clubID?1:-1))},dependencies:[Ze,_e],encapsulation:2});let n=s;return n})();function Cn(n,s){n&1&&(e(0,` 8 `),p(1,"hr",38),e(2,` 9 `),r(3,"h4"),e(4,` 10 USSCI Settings 11 `),a(),e(5,` 12 `))}function xn(n,s){n&1&&(e(0,` 13 `),p(1,"hr",38),e(2,` 14 `),r(3,"h4"),e(4,` 15 Hockey Settings 16 `),a(),e(5,` 17 `))}function bn(n,s){n&1&&(e(0,` 18 `),p(1,"hr",38),e(2,` 19 `),r(3,"h4"),e(4,` 20 Ankored Settings 21 `),a(),e(5,` 22 `),p(6,"app-dynamic-form-field",39),e(7,` 23 `))}function Sn(n,s){n&1&&(e(0,` 24 `),p(1,"app-dynamic-form-field",41),e(2,` 25 `))}function vn(n,s){if(n&1&&(e(0,` 26 `),p(1,"hr",38),e(2,` 27 `),r(3,"h4"),e(4,` 28 PlayerPass Connect Settings 29 `),a(),e(5,` 30 `),p(6,"app-dynamic-form-field",40),e(7,` 31 `),f(8,Sn,3,0)),n&2){let o=m(2);c(8),h(o.soccerComSapEnabled?8:-1)}}function gn(n,s){if(n&1){let o=v();e(0,` 32 `),r(1,"app-dynamic-form",3),S("onSubmit",function(t){x(o);let l=m();return b(l.saveProfile(t))}),e(2,` 33 `),p(3,"app-dynamic-form-field",4),e(4,` 34 `),p(5,"app-dynamic-form-field",5),e(6,` 35 `),p(7,"app-dynamic-form-field",6),e(8,` 36 `),p(9,"app-dynamic-form-field",7),e(10,` 37 `),r(11,"app-dynamic-form-field",8),S("onChange",function(t){x(o);let l=m();return b(l.sportChange(t))}),a(),e(12,` 38 `),p(13,"app-dynamic-form-field",9),e(14,` 39 `),p(15,"app-dynamic-form-field",10),e(16,` 40 `),p(17,"app-dynamic-form-field",11),e(18,` 41 `),p(19,"app-dynamic-form-field",12),e(20,` 42 `),p(21,"app-dynamic-form-field",13),e(22,` 43 `),p(23,"app-dynamic-form-field",14),e(24,` 44 `),p(25,"app-dynamic-form-field",15),e(26,` 45 `),p(27,"app-dynamic-form-field",16),e(28,` 46 `),p(29,"app-dynamic-form-field",17),e(30,` 47 `),p(31,"app-dynamic-form-field",18),e(32,` 48 `),p(33,"app-dynamic-form-field",19),e(34,` 49 `),p(35,"app-dynamic-form-field",20),e(36,` 50 `),p(37,"app-dynamic-form-field",21),e(38,` 51 `),p(39,"app-dynamic-form-field",22),e(40,` 52 `),p(41,"app-dynamic-form-field",23),e(42,` 53 `),p(43,"app-dynamic-form-field",24),e(44,` 54 `),p(45,"app-dynamic-form-field",25),e(46,` 55 `),p(47,"app-dynamic-form-field",26),e(48,` 56 `),p(49,"app-dynamic-form-field",27),e(50,` 57 `),p(51,"app-dynamic-form-field",28),e(52,` 58 `),p(53,"app-dynamic-form-field",29),e(54,` 59 `),p(55,"app-dynamic-form-field",30),e(56,` 60 `),p(57,"app-dynamic-form-field",31),e(58,` 61 `),p(59,"app-dynamic-form-field",32),e(60,` 62 `),p(61,"app-dynamic-form-field",33),e(62,` 63 `),p(63,"app-dynamic-form-field",34),e(64,` 64 `),f(65,Cn,6,0),p(66,"app-dynamic-form-field",35),e(67,` 65 `),f(68,xn,6,0),r(69,"app-dynamic-form-field",36),S("onChange",function(t){x(o);let l=m();return b(l.usaHockeyNumberMonthCutoffChange(t))}),e(70,` 66 `),a(),e(71,` 67 `),r(72,"app-dynamic-form-field",37),e(73,` 68 `),a(),e(74,` 69 `),f(75,bn,8,0),f(76,vn,9,1),a(),e(77,` 70 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.club)("horizontalForm",!0)("contentFieldsMode",!0)("showCancelButton",!1),c(64),h(o.ussciEnabled?65:-1),c(3),h(o.club.sportID===o.sport.HOCKEY?68:-1),c(),d("hidden",o.club.sportID!==o.sport.HOCKEY),c(3),d("hidden",o.club.sportID!==o.sport.HOCKEY),c(3),h(o.ankoredEnabled?75:-1),c(),h(o.soccerComEnabled?76:-1)}}function yn(n,s){n&1&&(e(0,` 71 `),p(1,"app-skeleton-template",42),e(2,` 72 `))}var Jt=(()=>{let s=class s{constructor(i,t,l,u,_,g,Ie){this.clubService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_,this.dropdownService=g,this.authorizeService=Ie,this.loading=!0,this.sport=et,this.parentLinkUrl="../",this.superAdmin=!1,this.ussciEnabled=!1,this.ankoredEnabled=!1,this.soccerComEnabled=!1,this.soccerComSapEnabled=!1,this.clubAdmin=!1,this.unsubscribe$=new ue}
72ngOnInit(){this.clubID=this.route.snapshot.parent.params.clubID;let i=[];i.push(this.clubService.getClubMetadata(this.clubID)),this.clubID!=="new"?i.push(this.clubService.getClub(this.clubID)):this.parentLinkUrl="/admin/club/settings",i.push(this.clubService.getClubOptions(this.clubID&&this.clubID!=="new"?+this.clubID:void 0)),this.authorizeService.getUser().pipe(We(1),ft(t=>{this.superAdmin=this.authorizeService.isSuperAdmin(t.role),this.clubAdmin=this.authorizeService.isClubAdmin(t)}),Re(()=>A(i))).subscribe(t=>{this.fields=t[0].fields,this.club=t[1]||new gi,this.club.twilioPhoneNumber&&(this.club.twilioPhoneNumber=bi(this.club.twilioPhoneNumber)),this.club.sportID=this.club.sportID||et.HOCKEY,this.ussciEnabled=t[2]?.find(l=>l.optionID===De.ENABLE_USSCI)?.boolValue&&this.superAdmin,this.ankoredEnabled=t[2]?.find(l=>l.optionID===De.ANKORED)?.boolValue&&this.superAdmin,this.soccerComEnabled=t[2]?.find(l=>l.optionID===De.PLAYER_PASS_CONNECT)?.boolValue||!1,this.soccerComSapEnabled=this.soccerComEnabled&&(this.clubAdmin||this.superAdmin),this.fields.find(l=>l.controlName==="loginClubID").options===null&&(this.fields=this.fields.filter(l=>l.controlName!=="loginClubID")),this.superAdmin||(this.fields=this.fields.filter(l=>!["isTester","inactive","adoptionException"].includes(l.controlName))),this.loading=!1,this.siteDataService.hideSiteLoader()})}sportChange(i){this.club.sportID=i,this.club.sportID===et.HOCKEY?(this.fields.find(t=>t.controlName==="usaHockeyNumberDayCutoff").hidden=!1,this.fields.find(t=>t.controlName==="usaHockeyNumberMonthCutoff").hidden=!1):(this.fields.find(t=>t.controlName==="usaHockeyNumberDayCutoff").hidden=!0,this.fields.find(t=>t.controlName==="usaHockeyNumberMonthCutoff").hidden=!0),this.fields=Array.from(this.fields)}usaHockeyNumberMonthCutoffChange(i){this.dropdownService.getDaysInMonth(i).pipe(J(this.unsubscribe$)).subscribe(t=>{this.fields.find(l=>l.controlName==="usaHockeyNumberDayCutoff").options=t,this.fields=Array.from(this.fields)})}saveProfile(i){this.superAdmin||(i.isTester=this.club.isTester,i.inactive=this.club.inactive,i.adoptionException=this.club.adoptionException),this.clubService.saveClub(this.clubID,i).subscribe(t=>{this.formService.hideFormLoader(),this.siteDataService.publicClubDomain$=null,this.siteDataService.clubSettings&&(this.siteDataService.clubSettings.club.sportID=i.sportID,this.siteDataService.clubSettings.club.sport=i.sport),this.clubID!=="new"&&this.siteDataService.clubSettingsChanged(),this.siteDataService.showSiteSuccessAlert("Club profile information saved successfully"),this.clubID==="new"&&this.router.navigate(["/admin/club/child-clubs"],{relativeTo:this.route})},t=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving club profile information. "+t?.error)})}cancel(){this.clubID!=="new"?this.router.navigate(["../.."],{relativeTo:this.route}):this.router.navigate(["/admin/club/settings"])}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C($),C(T),C(q),C(Nt),C(he))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:10,vars:4,consts:[["role","main"],["parentLinkText","Settings",3,"pageTitle","parentLinkUrl","showBackButton"],[1,"horizontal-form"],["formID","club-form","submitButtonText","Save","buttonsPosition","left",3,"onSubmit","fields","entity","horizontalForm","contentFieldsMode","showCancelButton"],["fieldName","name"],["fieldName","domain"],["fieldName","subdomain"],["fieldName","loginClubID"],["fieldName","sportID",3,"onChange"],["fieldName","address"],["fieldName","city"],["fieldName","state"],["fieldName","zip"],["fieldName","phone"],["fieldName","email"],["fieldName","instagram"],["fieldName","facebook"],["fieldName","twitter"],["fieldName","linkedIn"],["fieldName","tikTok"],["fieldName","youTube"],["fieldName","twilioPhoneNumber"],["fieldName","isNonProfit"],["fieldName","timeZoneID"],["fieldName","accountingTypeID"],["fieldName","googleAnalyticsId"],["fieldName","googleTagID"],["fieldName","metaPixelID"],["fieldName","metaDescription"],["fieldName","privacySettings"],["fieldName","ageClassStartDateID"],["fieldName","dashboardPanelDefaultGroupingID"],["fieldName","isTester"],["fieldName","inactive"],["fieldName","adoptionException"],["fieldName","ussciSportsClubID"],["fieldName","usaHockeyNumberMonthCutoff",3,"onChange","hidden"],["fieldName","usaHockeyNumberDayCutoff",3,"hidden"],[1,"form-section"],["fieldName","ankoredOrganizationID"],["fieldName","soccerComClubOrgEntityID"],["fieldName","soccerComSapID"],["skeletonType","form"]],template:function(t,l){t&1&&(r(0,"main",0),e(1,` 73 `),r(2,"app-admin-header",1),e(3,` 74 `),a(),e(4,` 75 `),r(5,"section",2),e(6,` 76 `),f(7,gn,78,11)(8,yn,3,0),a(),e(9,` 77`),a()),t&2&&(c(2),d("pageTitle","Profile")("parentLinkUrl",l.parentLinkUrl)("showBackButton",!0),c(5),h(l.loading?8:7))},dependencies:[w,k,H,N],encapsulation:2});let n=s;return n})();var qe=class{constructor(s=void 0){this.rows=100,this.orderBy=s}};var dt=class{constructor(){this.roles=[],this.permissions=[]}};var Dn=n=>[n,"settings"];function An(n,s){if(n&1&&(e(0,` 78 `),r(1,"th",17),e(2),p(3,"p-sortIcon",18),e(4,` 79 `),a(),e(5,` 80 `)),n&2){let o=s.$implicit,i=m(3);c(),d("pSortableColumn",o.field),ee("aria-label",i.AriaLabels.ACTIVATE_SORT),c(),V(` 81 `,o.header,` 82 `),c(),d("field",o.field)}}function Tn(n,s){if(n&1&&(e(0,` 83 `),r(1,"tr"),e(2,` 84 `),I(3,An,6,4,null,null,F),a(),e(5,` 85 `)),n&2){let o=m(2);c(3),P(o.clubService.columns)}}function En(n,s){if(n&1&&(e(0,` 86 `),r(1,"tr"),e(2,` 87 `),r(3,"td")(4,"a",19),e(5),a(),e(6,` 88 `),a(),e(7,` 89 `),r(8,"td"),e(9),a(),e(10,` 90 `),a(),e(11,` 91 `)),n&2){let o=s.$implicit;c(4),d("routerLink",Se(3,Dn,o.clubID)),c(),O(o.clubName),c(4),O(o.subdomain)}}function wn(n,s){if(n&1){let o=v();e(0,` 92 `),r(1,"section",12),e(2,` 93 `),r(3,"div",13),e(4,` 94 `),r(5,"p-table",14),S("onLazyLoad",function(t){x(o);let l=m();return b(l.search(t))}),e(6,` 95 `),E(7,Tn,6,0,"ng-template",15),e(8,` 96 `),E(9,En,12,5,"ng-template",16),e(10,` 97 `),a(),e(11,` 98 `),a(),e(12,` 99 `),a(),e(13,` 100`)}if(n&2){let o=m();c(5),d("columns",o.clubService.columns)("value",o.searchResults)("lazy",!0)("paginator",!0)("alwaysShowPaginator",!1)("totalRecords",o.totalRecords)("rows",100)("loading",o.loading)}}var Hi=(()=>{let s=class s{constructor(i,t,l){this.clubService=i,this.siteDataService=t,this.authorizeService=l,this.AriaLabels=fe,this.totalRecords=0,this.loading=!0,this.showTable=!1}ngOnInit(){this.authorizeService.getUser().subscribe(i=>{i&&i&&this.authorizeService.isSuperAdmin(i.role)&&(this.showAdd=!0)}),this.clubService.filters&&this.clubService.filters.page?this.showTable=!0:this.clubService.filters=new qe,this.siteDataService.hide
100SiteLoader()}run(){this.clubService.filters.page=1,this.totalRecords=0,this.showTable?this.search():this.showTable=!0}search(i=null){let t=this.clubService.filters;i&&i.sortField&&(t.orderBy=i.sortField+" "+(i.sortOrder===1?"ASC":"DESC"),t.page=i.first/t.rows+1),t.getTotalCount=this.totalRecords===0,this.loading=!0,this.clubService.getClubs().subscribe(l=>{this.searchResults=l.results,t.getTotalCount&&(this.totalRecords=l.count),this.loading=!1},()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")})}resetFilters(){this.clubService.filters=new qe(this.clubService.filters.orderBy)}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C(he))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:33,vars:4,consts:[["role","main",3,"keydown.enter"],["pageTitle","Clubs","primaryBtnUrl","./new/settings/profile",3,"primaryBtnText"],[3,"adminFilterReset","adminFilterSearch"],["primary",""],[1,"col","pr-0"],[1,"p-input-icon-left","full-width"],[1,"fa","fa-magnifying-glass"],["type","text","id","club-name","pInputText","","placeholder","Club Name",1,"full-width","pl-4",3,"ngModelChange","ngModel"],["for","club-name",1,"sr-only"],[1,"col-auto","pr-0"],["type","text","id","club-subdomain","placeholder","Subdomain",3,"ngModelChange","ngModel"],["for","club-subdomain",1,"sr-only"],[1,""],[1,"table-responsive"],["sortField","clubName",1,"table","table-striped","table-sm",3,"onLazyLoad","columns","value","lazy","paginator","alwaysShowPaginator","totalRecords","rows","loading"],["pTemplate","header"],["pTemplate","body"],[3,"pSortableColumn"],[3,"field"],[3,"routerLink"]],template:function(t,l){t&1&&(r(0,"main",0),S("keydown.enter",function(){return l.run()}),e(1,` 101 `),r(2,"app-admin-header",1),e(3,` 102 `),a(),e(4,` 103 `),r(5,"app-admin-filter",2),S("adminFilterReset",function(){return l.resetFilters()})("adminFilterSearch",function(){return l.run()}),e(6,` 104 `),L(7,3),e(8,` 105 `),r(9,"div",4),e(10,` 106 `),r(11,"span",5),e(12,` 107 `),p(13,"i",6),e(14,` 108 `),r(15,"input",7),Y("ngModelChange",function(_){return z(l.clubService.filters.clubName,_)||(l.clubService.filters.clubName=_),_}),a(),e(16,` 109 `),r(17,"label",8),e(18,"Club Search"),a(),e(19,` 110 `),a(),e(20,` 111 `),a(),e(21,` 112 `),r(22,"div",9),e(23,` 113 `),r(24,"input",10),Y("ngModelChange",function(_){return z(l.clubService.filters.subdomain,_)||(l.clubService.filters.subdomain=_),_}),a(),e(25,` 114 `),r(26,"label",11),e(27,"Club Subdomain"),a(),e(28,` 115 `),a(),e(29,` 116 `),B(),e(30,` 117 `),a(),e(31,` 118 `),f(32,wn,14,8),a()),t&2&&(c(2),d("primaryBtnText",l.showAdd?"Add Club":void 0),c(13),j("ngModel",l.clubService.filters.clubName),c(9),j("ngModel",l.clubService.filters.subdomain),c(8),h(l.showTable?32:-1))},dependencies:[Ke,ge,ye,ie,ne,N,it,se,Ce,xe],encapsulation:2});let n=s;return n})();function Fn(n,s){if(n&1){let o=v();e(0,` 119 `),r(1,"app-dynamic-form",3),S("onSubmit",function(t){x(o);let l=m();return b(l.saveEmailAccount(t))})("onCancel",function(){x(o);let t=m();return b(t.cancel())}),e(2,` 120 `),p(3,"app-dynamic-form-field",4),e(4,` 121 `),p(5,"app-dynamic-form-field",5),e(6,` 122 `),r(7,"app-dynamic-form-field",6),e(8,` 123 `),L(9,0,0),p(11,"i",7),B(),e(12,` 124 `),a(),e(13,` 125 `),p(14,"app-dynamic-form-field",8),e(15,` 126 `),a(),e(16,` 127 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.emailAccount)("horizontalForm",!0)("contentFieldsMode",!0)}}var Xt=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.emailAccountID=this.route.snapshot.params.emailAccountID;let i=[];i.push(this.clubService.getEmailAccountMetadata()),this.emailAccountID!=="new"&&i.push(this.clubService.getEmailAccount(this.clubID,+this.emailAccountID)),A(i).subscribe(t=>{this.fields=t[0].fields,this.emailAccountID!=="new"&&(this.emailAccount=t[1]),this.siteDataService.hide
127SiteLoader()})}saveEmailAccount(i){this.clubService.saveEmailAccount(this.clubID,this.emailAccountID,i).subscribe({next:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Email information saved successfully"),this.router.navigate([".."],{relativeTo:this.route})},error:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving email information.")}})}cancel(){this.router.navigate([".."],{relativeTo:this.route})}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C($),C(T),C(q))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:9,vars:3,consts:[["inputGroupStart",""],["grandParentLinkText","Settings","grandParentLinkUrl","../../","parentLinkUrl","../","parentLinkText","Email Accounts",3,"pageTitle","showBackButton"],[1,"horizontal-form","p-3"],["formID","email-account-form","submitButtonText","Save","buttonsPosition","left",3,"onSubmit","onCancel","fields","entity","horizontalForm","contentFieldsMode"],["fieldName","fromName"],["fieldName","defaultUserName"],["fieldName","domain"],[1,"fal","fa-at"],["fieldName","default"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 128 `),r(2,"app-admin-header",1),e(3,` 129 `),a(),e(4,` 130 131 `),r(5,"section",2),e(6,` 132 `),f(7,Fn,17,4),a(),e(8,` 133`),a()),t&2&&(c(2),d("pageTitle","Email Account")("showBackButton",!0),c(5),h(l.fields?7:-1))},dependencies:[w,k,N],encapsulation:2});let n=s;return n})();var In=()=>["new"],Pn=n=>[n],On=()=>["bcc","new"],Mn=n=>["bcc",n];function Vn(n,s){if(n&1&&(e(0,` 134 `),r(1,"th",14),e(2),p(3,"p-sortIcon",15),e(4,` 135 `),a(),e(5,` 136 `)),n&2){let o=s.$implicit,i=m(4);c(),d("pSortableColumn",o.field),ee("aria-label",i.AriaLabels.ACTIVATE_SORT),c(),V(` 137 `,o.header,` 138 `),c(),d("field",o.field)}}function kn(n,s){if(n&1&&(e(0,` 139 `),r(1,"tr"),e(2,` 140 `),I(3,Vn,6,4,null,null,F),p(5,"th"),e(6,` 141 `),a(),e(7,` 142 `)),n&2){let o=m(3);c(3),P(o.columns)}}function Nn(n,s){if(n&1){let o=v();e(0,` 143 `),r(1,"button",17),S("click",function(){x(o);let t=m().$implicit,l=m(3);return b(l.setupDeleteConfirm(t.clubEmailDomainID))}),e(2,"Delete"),a(),e(3,` 144 `)}}function Rn(n,s){if(n&1&&(e(0,` 145 `),r(1,"tr"),e(2,` 146 `),r(3,"td")(4,"a",16),e(5),a()(),e(6,` 147 `),r(7,"td"),e(8),a(),e(9,` 148 `),r(10,"td"),e(11),a(),e(12,` 149 `),r(13,"td"),e(14),a(),e(15,` 150 `),r(16,"td"),f(17,Nn,4,0),a(),e(18,` 151 `),a(),e(19,` 152 `)),n&2){let o=s.$implicit;c(4),d("routerLink",Se(6,Pn,o.clubEmailDomainID)),c(),O(o.fromName),c(3),O(o.defaultUserName),c(3),O(o.domain),c(3),O(o.defaultString),c(3),h(o.default?-1:17)}}function Ln(n,s){if(n&1&&(e(0,` 153 `),r(1,"section",4),e(2,` 154 `),r(3,"h3"),e(4,"From Addresses"),a(),e(5,` 155 `),r(6,"div",5),e(7,` 156 `),r(8,"app-inline-alert",6)(9,"span",7),e(10,`The email addresses entered 157 on 158 this page will be available to select as the \u2018From Address\u2019 when sending emails out of the 159 system.`),a()(),e(11,` 160 `),a(),e(12,` 161 `),r(13,"div",8),e(14,` 162 `),r(15,"p-table",9),e(16,` 163 `),E(17,kn,8,0,"ng-template",10),e(18,` 164 `),E(19,Rn,20,8,"ng-template",11),e(20,` 165 `),a(),e(21,` 166 `),a(),e(22,` 167 `),r(23,"div",12),e(24,` 168 `),r(25,"a",13),e(26,` 169 Add Email Account 170 `),a(),e(27,` 171 `),a(),e(28,` 172 `),a(),e(29,` 173 `)),n&2){let o=m(2);c(8),d("isInline",!0),c(7),d("columns",o.columns)("value",o.searchResults),c(10),d("routerLink",te(4,In))}}function Bn(n,s){n&1&&(e(0,` 174 `),r(1,"div",5),e(2,` 175 `),p(3,"app-skeleton-template",18),e(4,` 176 `),a(),e(5,` 177 `)),n&2&&(c(3),d("invertBg",!0))}function $n(n,s){if(n&1&&(e(0,` 178 `),f(1,Ln,30,5)(2,Bn,6,1)),n&2){let o=m();c(),h(o.loading?2:1)}}function Wn(n,s){if(n&1&&(e(0,` 179 `),r(1,"th",14),e(2),p(3,"p-sortIcon",15),e(4,` 180 `),a(),e(5,` 181 `)),n&2){let o=s.$implicit,i=m(3);c(),d("pSortableColumn",o.field),ee("aria-label",i.AriaLabels.ACTIVATE_SORT),c(),V(` 182 `,o.header,` 183 `),c(),d("field",o.field)}}function Un(n,s){if(n&1&&(e(0,` 184 `),r(1,"tr"),e(2,` 185 `),I(3,Wn,6,4,null,null,F),p(5,"th"),e(6,` 186 `),a(),e(7,` 187 `)),n&2){let o=m(2);c(3),P(o.bccColumns)}}function jn(n,s){if(n&1){let o=v();e(0,` 188 `),r(1,"tr"),e(2,` 189 `),r(3,"td")(4,"a",16),e(5),a()(),e(6,` 190 `),r(7,"td"),e(8),a(),e(9,` 191 `),r(10,"td"),e(11),a(),e(12,` 192 `),r(13,"td")(14,"button",17),S("click",function(){let t=x(o).$implicit,l=m(2);return b(l.setupBccDeleteConfirm(t.clubEmailBccID))}),e(15,"Delete"),a()(),e(16,` 193 `),a(),e(17,` 194 `)}if(n&2){let o=s.$implicit;c(4),d("routerLink",Se(4,Mn,o.clubEmailBccID)),c(),O(o.email),c(3),O(o.name),c(3),O(o.emailType)}}function zn(n,s){if(n&1&&(e(0,` 195 `),r(1,"tr"),e(2,` 196 `),r(3,"td",21),e(4,` 197 You do not have any bcc addresses configured 198 `),a(),e(5,` 199 `),a(),e(6,` 200 `)),n&2){let o=m(2);c(3),ee("colspan",o.columns?o.columns.length:3)}}function Yn(n,s){if(n&1&&(e(0,` 201 `),r(1,"section",4),e(2,` 202 `),r(3,"h3"),e(4,"BCC Addresses"),a(),e(5,` 203 `),r(6,"div",8),e(7,` 204 `),r(8,"p-table",19),e(9,` 205 `),E(10,Un,8,0,"ng-template",10),e(11,` 206 `),E(12,jn,18,6,"ng-template",11),e(13,` 207 `),E(14,zn,7,1,"ng-template",20),e(15,` 208 `),a(),e(16,` 209 `),a(),e(17,` 210 `),r(18,"div",12),e(19,` 211 `),r(20,"a",13),e(21,` 212 Add Email Bcc 213 `),a(),e(22,` 214 `),a(),e(23,` 215 `),a(),e(24,` 216 `)),n&2){let o=m();c(8),d("columns",o.columns)("value",o.emailBcc),c(12),d("routerLink",te(3,On))}}function qn(n,s){n&1&&(e(0,` 217 `),r(1,"div",5),e(2,` 218 `),p(3,"app-skeleton-template",18),e(4,` 219 `),a(),e(5,` 220 `)),n&2&&(c(3),d("invertBg",!0))}function Hn(n,s){if(n&1){let o=v();e(0,` 221 `),r(1,"app-dialog-footer"),e(2,` 222 `),L(3,22),e(4,` 223 `),r(5,"button",23),S("click",function(){x(o);let t=m();return b(t.showModal=!1)}),e(6,"No"),a(),e(7,` 224 `),B(),e(8,` 225 `),L(9,24),e(10,` 226 `),r(11,"button",25),S("click",function(){x(o);let t=m();return b(t.deleteEmailAccount())}),e(12,"Yes"),a(),e(13,` 227 `),B(),e(14,` 228 `),a(),e(15,` 229 `)}}function Qn(n,s){if(n&1){let o=v();e(0,` 230 `),r(1,"app-dialog-footer"),e(2,` 231 `),L(3,22),e(4,` 232 `),r(5,"button",23),S("click",function(){x(o);let t=m();return b(t.showBccDeleteConfirm=!1)}),e(6,"No"),a(),e(7,` 233 `),B(),e(8,` 234 `),L(9,24),e(10,` 235 `),r(11,"button",25),S("click",function(){x(o);let t=m();return b(t.deleteEmailBcc())}),e(12,"Yes"),a(),e(13,` 236 `),B(),e(14,` 237 `),a(),e(15,` 238 `)}}var Kt=(()=>{let s=class s{constructor(i,t,l,u){this.clubService=i,this.siteDataService=t,this.authorizeService=l,this.route=u,this.AriaLabels=fe,this.showModal=!1,this.showBccDeleteConfirm=!1,this.loading=!0,this.userIsSuperAdmin=!1,this.userIsClubAdmin=!1,this.columns=[{field:"fromName",header:"From Name"},{field:"defaultUserName",header:"Default Username"},{field:"domain",header:"Domain"},{field:"default",header:"Default Account"}],this.bccColumns=[{field:"email",header:"Email"},{field:"name",header:"Name"},{field:"emailType",header:"Email Type"}]}
238ngOnInit(){this.siteDataService.hideSiteLoader(),this.authorizeService.getUser().subscribe(i=>{i&&this.authorizeService.isSuperAdmin(i.role)&&(this.userIsSuperAdmin=!0),i&&this.authorizeService.isAdmin(i.role)&&(this.userIsClubAdmin=!0)}),this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,A({emailAccounts:this.userIsSuperAdmin?this.clubService.getEmailAccounts(this.clubID):Z(null),bccMetadata:this.clubService.getEmailBccMetadata(),bccAddresses:this.clubService.getEmailBccAddresses(this.clubID)}).subscribe({next:i=>{this.searchResults=i.emailAccounts,this.bccFields=i.bccMetadata.fields,this.emailBcc=i.bccAddresses,this.loading=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}setupDeleteConfirm(i){this.clubEmailDomainID=i,this.showModal=!0}deleteEmailAccount(){this.clubService.deleteEmailAccount(this.clubID,this.clubEmailDomainID).subscribe(()=>{this.searchResults.splice(this.searchResults.findIndex(i=>i.clubEmailDomainID===this.clubEmailDomainID),1),this.searchResults=[...this.searchResults],this.siteDataService.showSiteSuccessAlert("Email Account deleted successfully"),this.showModal=!1},()=>{this.siteDataService.showSiteErrorAlert("There was a problem processing your request."),this.showModal=!1})}setupBccDeleteConfirm(i){this.clubEmailBccID=i,this.showBccDeleteConfirm=!0}deleteEmailBcc(){this.clubService.deleteEmailBcc(this.clubID,this.clubEmailBccID).subscribe({next:()=>{this.emailBcc.splice(this.emailBcc.findIndex(i=>i.clubEmailBccID===this.clubEmailBccID),1),this.emailBcc=[...this.emailBcc],this.showBccDeleteConfirm=!1,this.siteDataService.showSiteSuccessAlert("BCC Address was deleted successfully")},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem processing your request.")}})}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C(he),C(T))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:18,vars:6,consts:[["parentLinkText","Settings","parentLinkUrl","../",3,"pageTitle","showBackButton"],["header","Delete Email Account","styleClass","shortWidthDialog",3,"visibleChange","visible"],["pTemplate","footer"],["header","Delete BCC Address","styleClass","shortWidthDialog",3,"visibleChange","visible"],[1,"card"],[1,"mb-3"],["alertType","info",3,"isInline"],[1,"text-small"],[1,"table-responsive","mb-3"],["sortField","fromName",1,"table","table-striped","table-sm",3,"columns","value"],["pTemplate","header"],["pTemplate","body"],[1,"report-filter-action"],[1,"btn","btn-add","btn-large",3,"routerLink"],[3,"pSortableColumn"],[3,"field"],[3,"routerLink"],[1,"btn","btn-sm",3,"click"],["height","20rem",3,"invertBg"],["sortField","emailType",1,"table","table-striped","table-sm",3,"columns","value"],["pTemplate","emptymessage"],[2,"text-align","left"],["slot","secondary"],[1,"btn","btn-secondary",3,"click"],["slot","primary"],[1,"btn","btn-primary",3,"click"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 239 `),r(2,"app-admin-header",0),e(3,` 240 `),a(),e(4,` 241 `),f(5,$n,3,1),f(6,Yn,25,4)(7,qn,6,1),a(),e(8,` 242 243`),r(9,"p-dialog",1),Y("visibleChange",function(_){return z(l.showModal,_)||(l.showModal=_),_}),e(10,` 244 Are you sure you want to delete this email account? 245 `),E(11,Hn,16,0,"ng-template",2),e(12,` 246`),a(),e(13,` 247 248`),r(14,"p-dialog",3),Y("visibleChange",function(_){return z(l.showBccDeleteConfirm,_)||(l.showBccDeleteConfirm=_),_}),e(15,` 249 Are you sure you want to delete this BCC address? 250 `),E(16,Qn,16,0,"ng-template",2),e(17,` 251`),a()),t&2&&(c(2),d("pageTitle","Email Accounts")("showBackButton",!0),c(3),h(l.userIsSuperAdmin?5:-1),c(),h(l.loading?7:6),c(3),j("visible",l.showModal),c(5),j("visible",l.showBccDeleteConfirm))},dependencies:[ie,ne,H,_e,N,ke,se,Ce,xe,Pe],encapsulation:2});let n=s;return n})();var Jn=n=>[n],Xn=()=>["new"];function Kn(n,s){if(n&1&&(e(0,` 252 `),r(1,"tr"),e(2,` 253 `),r(3,"th",7),e(4,` 254 Name 255 `),p(5,"p-sortIcon",8),e(6,` 256 `),a(),e(7,` 257 `),r(8,"th",9),e(9,` 258 Specialty Position 259 `),p(10,"p-sortIcon",10),e(11,` 260 `),a(),e(12,` 261 `),a(),e(13,` 262 `)),n&2){let o=m(3);c(3),ee("aria-label",o.AriaLabels.ACTIVATE_SORT),c(5),ee("aria-label",o.AriaLabels.ACTIVATE_SORT)}}function Zn(n,s){if(n&1&&(e(0,` 263 `),r(1,"tr"),e(2,` 264 `),r(3,"td")(4,"a",11),e(5),a()(),e(6,` 265 `),r(7,"td"),e(8),a(),e(9,` 266 `),a(),e(10,` 267 `)),n&2){let o=s.$implicit;c(4),d("routerLink",Se(3,Jn,o.positionID)),c(),O(o.name),c(3),O(o.specialtyPosition?"Yes":"")}}function eo(n,s){if(n&1&&(e(0,` 268 `),r(1,"p-table",4),e(2,` 269 `),E(3,Kn,14,2,"ng-template",5),e(4,` 270 `),E(5,Zn,11,5,"ng-template",6),e(6,` 271 `),a(),e(7,` 272 `)),n&2){let o=m(2);c(),d("value",o.searchResults)}}function to(n,s){if(n&1&&(e(0,` 273 `),r(1,"div",3),e(2,` 274 `),f(3,eo,8,1),a(),e(4,` 275 `)),n&2){let o=m();c(3),h(o.searchResults?3:-1)}}function io(n,s){n&1&&(e(0,` 276 `),r(1,"app-inline-alert",12),e(2,` 277 No Positions have been added. Please \xA0`),r(3,"a",13),e(4,"add some positions"),a(),e(5,`\xA0 to see them on this page. 278 `),a(),e(6,` 279 `)),n&2&&(c(),d("alertType","info")("isInline",!0),c(2),d("routerLink",te(3,Xn)))}var Qi=(()=>{let s=class s{constructor(i,t){this.positionService=i,this.siteDataService=t,this.AriaLabels=fe}ngOnInit(){this.positionService.getPositions().subscribe(i=>
279{this.searchResults=i,this.siteDataService.hideSiteLoader()},()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")})}};s.\u0275fac=function(t){return new(t||s)(C(ot),C(D))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:9,vars:1,consts:[["role","main"],["pageTitle","Positions","primaryBtnText","Add Position","primaryBtnUrl","./new"],[1,""],[1,"table-responsive"],["sortField","name",1,"table","table-striped","table-sm",3,"value"],["pTemplate","header"],["pTemplate","body"],["pSortableColumn","name"],["field","name"],["pSortableColumn","specialtyPosition"],["field","specialtyPosition"],[3,"routerLink"],[3,"alertType","isInline"],["href","javascript:void(0);",3,"routerLink"]],template:function(t,l){t&1&&(r(0,"main",0),e(1,` 280 `),p(2,"app-admin-header",1),e(3,` 281 `),r(4,"section",2),e(5,` 282 `),f(6,to,5,1)(7,io,7,4),a(),e(8,` 283`),a()),t&2&&(c(6),h((l.searchResults==null?null:l.searchResults.length)>0?6:7))},dependencies:[ie,ne,_e,N,se,Ce,xe],encapsulation:2});let n=s;return n})();function no(n,s){if(n&1){let o=v();e(0,` 284 `),r(1,"app-dynamic-form",3),S("onCancel",function(){x(o);let t=m();return b(t.cancel())})("onSubmit",function(t){x(o);let l=m();return b(l.save(t,!1))})("onSaveAndAdd",function(t){x(o);let l=m();return b(l.save(t,!0))})("onDelete",function(){x(o);let t=m();return b(t.delete())}),e(2,` 285 `),p(3,"app-dynamic-form-field",4),e(4,` 286 `),p(5,"app-dynamic-form-field",5),e(6,` 287 `),p(7,"app-dynamic-form-field",6),e(8,` 288 `),a(),e(9,` 289 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.position)("horizontalForm",!0)("contentFieldsMode",!0)("showSaveAndAddButton",!0)("showDeleteButton",!o.newPosition)}}var Gi=(()=>{let s=class s{constructor(i,t,l,u,_){this.route=i,this.router=t,this.siteDataService=l,this.positionService=u,this.formService=_,this.newPosition=!1}ngOnInit(){this.route.params.subscribe(i=>{i.id&&(i.id==="new"?(this.newPosition=!0,this.positionService.getPositionMetaData().subscribe(t=>{this.position=new Qt,this.fields=t.fields,this.siteDataService.hideSiteLoader()})):(this.positionID=+i.id,A([this.positionService.getPositionMetaData(),this.positionService.getPosition(this.positionID)]).subscribe(t=>{this.position=t[1],this.fields=t[0].fields,this.siteDataService.hideSiteLoader()})))})}save(i,t){i.positionID=this.positionID,this.positionService.savePosition(i).subscribe(l=>{this.siteDataService.showSiteSuccessAlert("Position saved successfully"),this.formService.hideFormLoader(),l&&(this.positionID=l),t?(this.positionID=void 0,this.position=new Qt,this.router.navigate(["../new"],{relativeTo:this.route})):this.router.navigate(["..",this.positionID],{relativeTo:this.route})},()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving this position")})}delete(){this.positionService.deletePosition(this.positionID).subscribe(()=>{this.siteDataService.showSiteSuccessAlert("Position deleted successfully"),this.router.navigate([".."],{relativeTo:this.route})},()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem deleting this position.")})}cancel(){this.router.navigate([".."],{relativeTo:this.route})}};s.\u0275fac=function(t){return new(t||s)(C(T),C(q),C(D),C(ot),C($))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:8,vars:3,consts:[["role","main"],["parentLinkUrl","../","parentLinkText","Positions",3,"pageTitle","showBackButton"],[1,""],["buttonsPosition","left",3,"onCancel","onSubmit","onSaveAndAdd","onDelete","fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","showDeleteButton"],["fieldName","name"],["fieldName","shortName"],["fieldName","specialtyPosition"]],template:function(t,l){t&1&&(r(0,"main",0),e(1,` 290 `),p(2,"app-admin-header",1),e(3,` 291 `),r(4,"section",2),e(5,` 292 `),f(6,no,10,6),a(),e(7,` 293`),a()),t&2&&(c(2),d("pageTitle",l.newPosition?"New Position":"Edit Position")("showBackButton",!0),c(4),h(l.fields?6:-1))},dependencies:[w,k,N],encapsulation:2});let n=s;return n})();function oo(n,s){if(n&1&&(e(0,` 294 `),r(1,"app-dynamic-form-field",7),e(2,` 295 `),a(),e(3,` 296 `)),n&2){let o=s.$implicit;c(),d("fieldName",o.name)}}function ao(n,s){if(n&1&&(e(0,` 297 `),r(1,"div"),e(2,` 298 `),r(3,"div",3),e(4,` 299 `),r(5,"div",4),e(6,` 300 `),r(7,"h2",5),e(8),a(),e(9,` 301 `),a(),e(10,` 302 `),r(11,"div",6),e(12,` 303 `),I(13,oo,4,1,null,null,F),a(),e(15,` 304 `),a(),e(16,` 305 `),a(),e(17,` 306 `)),n&2){let o=s.$implicit;c(8),O(o.name),c(5),P(o.fields)}}function ro(n,s){if(n&1){let o=v();e(0,` 307 `),r(1,"app-dynamic-form",2),S("onSubmit",function(t){x(o);let l=m();
307return b(l.save(t))}),e(2,` 308 `),I(3,ao,18,1,null,null,F),a(),e(5,` 309 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.clubOptions)("horizontalForm",!0)("contentFieldsMode",!0)("showCancelButton",!1)("buttonsSticky",!0),c(2),P(o.categories)}}function lo(n,s){n&1&&(e(0,` 310 `),p(1,"app-skeleton-template",8),e(2,` 311 `))}var Zt=(()=>{let s=class s{constructor(i,t,l,u,_,g){this.clubService=i,this.siteDataService=t,this.formService=l,this.route=u,this.authorizeService=_,this.router=g,this.loading=!0,this.sport=et,this.clubOptions={},this.isSuperAdmin=!1}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,A([this.clubService.getClubOptionsMetadata(),this.clubService.getClubOptions(this.clubID)]).subscribe(i=>{this.categories=i[0],this.fields=[],this.categories.forEach(t=>this.fields=this.fields.concat(t.fields)),this.authorizeService.getUser().subscribe(t=>{t&&t&&this.authorizeService.isSuperAdmin(t.role)&&(this.isSuperAdmin=!0)}),!this.clubID&&!this.isSuperAdmin&&(this.fields=this.fields.filter(t=>t.controlName!=="option10")),i[1].length===0?this.clubOptions=void 0:i[1].forEach(t=>{this.clubOptions["option"+t.optionID]=t.numericValue||t.textValue||t.boolValue}),this.siteDataService.hideSiteLoader(),this.loading=!1})}save(i){let t=[];this.fields.forEach(l=>{let u=new yi;switch(u.optionID=+l.name.replace("option",""),l.dynamicFormFieldTypeID){case wt.CHECKBOX:u.boolValue=i[l.name];break;case wt.TEXT:u.textValue=i[l.name];break;case wt.DROPDOWN:u.numericValue=i[l.name];break}t.push(u)}),this.clubService.saveClubOptions(this.clubID,t).subscribe({next:()=>{this.formService.hideFormLoader(),this.siteDataService.invalidateClubOptions(),this.siteDataService.showSiteSuccessAlert("Club options saved successfully")},error:l=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving club options. "+l?.error)}})}cancel(){this.router.navigate(["../.."],{relativeTo:this.route})}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C($),C(T),C(he),C(q))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:10,vars:3,consts:[["parentLinkText","Settings","parentLinkUrl","../",3,"pageTitle","showBackButton"],[1,"horizontal-form"],["formID","club-form","submitButtonText","Save","buttonsPosition","left",3,"onSubmit","fields","entity","horizontalForm","contentFieldsMode","showCancelButton","buttonsSticky"],[1,"card","edit-card","mb-4","mt-4","col-xl-9"],[1,"card-header","mb-3"],[1,""],[1,"card-body"],[3,"fieldName"],["skeletonType","form"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 312 `),r(2,"app-admin-header",0),e(3,` 313 `),a(),e(4,` 314 `),r(5,"section",1),e(6,` 315 `),f(7,ro,6,6)(8,lo,3,0),a(),e(9,` 316`),a()),t&2&&(c(2),d("pageTitle","Club Options")("showBackButton",!0),c(5),h(l.loading?8:7))},dependencies:[w,k,H,N],encapsulation:2});let n=s;return n})();var Ji=(()=>{let s=class s{};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:34,vars:2,consts:[["role","main"],["parentLinkText","Settings","parentLinkUrl","../",3,"pageTitle","showBackButton"],[1,"tabs"],["role","tablist",1,"tab-nav","no-bullets","inline-list"],["routerLinkActive","active",1,"nav-item"],["routerLink","names","role","tab","aria-controls","home","aria-selected","true",1,"nav-link"],["routerLink","display-options","role","tab","aria-controls","home","aria-selected","true",1,"nav-link"],["routerLink","renewal-dates","role","tab","aria-controls","home","aria-selected","true",1,"nav-link"],[1,"px-3"]],template:function(t,l){t&1&&(r(0,"main",0),e(1,` 317 `),r(2,"app-admin-header",1),e(3,` 318 `),a(),e(4,` 319 `),r(5,"div",2),e(6,` 320 `),r(7,"ul",3),e(8,` 321 `),r(9,"li",4),e(10,` 322 `),r(11,"a",5),e(12,` 323 Field Names 324 `),a(),e(13,` 325 `),a(),e(14,` 326 `),r(15,"li",4),e(16,` 327 `),r(17,"a",6),e(18,` 328 Display Options 329 `),a(),e(19,` 330 `),a(),e(20,` 331 `),r(21,"li",4),e(22,` 332 `),r(23,"a",7),e(24,` 333 Renewal Dates 334 `),a(),e(25,` 335 `),a(),e(26,` 336 `),a(),e(27,` 337 `),a(),e(28,` 338 `),r(29,"div",8),e(30,` 339 `),p(31,"router-outlet"),e(32,` 340 `),a(),e(33,` 341`),a()),t&2&&(c(2),d("pageTitle","Field Names")("showBackButton",!0))},dependencies:[Ze,ie,gt,N],encapsulation:2});let n=s;return n})();function so(n,s){if(n&1){let o=v();e(0,` 342 `),r(1,"li"),e(2,` 343 `),r(3,"a",7),S("click",function(){let t=x(o).$implicit,l=m(2);return b(l.scrollToElement("nav-"+t.categoryID))}),e(4),a(),e(5,` 344 `),a(),e(6,` 345 `)}if(n&2){let o=s.$implicit;c(4),O(o.name)}}function co(n,s){if(n&1&&(e(0,` 346 `),r(1,"nav",6),e(2,` 347 `),r(3,"ul"),e(4,` 348 `),I(5,so,7,1,null,null,F),a(),e(7,` 349 `),a(),e(8,` 350 `)),n&2){let o=m();c(5),P(o.categories)}}function mo(n,s){n&1&&(e(0,` 351 `),p(1,"hr"),e(2,` 352 `))}function uo(n,s){if(n&1){let o=v();e(0,` 353 `),r(1,"app-dynamic-form-field",10),S("onChange",function(t){x(o);let l=m().$implicit,u=m(2);return b(u.updateFields(l.categoryID,l.categoryFieldOption.name,t.value))}),e(2,` 354 `),a(),e(3,` 355 `)}if(n&2){let o=m().$implicit;c(),d("fieldName",o.categoryFieldOption.name)}}function po(n,s){if(n&1&&e(0),n&2){let o=m().$implicit;V(` 356 `,o.name,` 357 `)}}function fo(n,s){if(n&1&&(e(0,` 358 `),r(1,"app-dynamic-form-field",11),e(2,` 359 `),a(),e(3,` 360 `)),n&2){let o=s.$implicit;c(),d("fieldName",o.name)}}function ho(n,s){if(n&1&&(e(0,` 361 `),r(1,"div"),e(2,` 362 `),f(3,mo,3,0),r(4,"h2",9),e(5,` 363 `),f(6,uo,4,1)(7,po,1,1),a(),e(8,` 364 `),I(9,fo,4,1,null,null,F),a(),e(11,` 365 `)),n&2){let o=s.$implicit,i=s.$index;c(3),h(i!==0?3:-1),c(),d("id","nav-"+o.categoryID),c(2),h(o.categoryFieldOption?6:7),c(3),P(o.fields)}}function _o(n,s){if(n&1){let o=v();e(0,` 366 `),r(1,"app-dynamic-form",8),S("onSubmit",function(t){x(o);let l=m();
366return b(l.save(t))}),e(2,` 367 `),I(3,ho,12,3,null,null,F),a(),e(5,` 368 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.clubFieldOptions)("horizontalForm",!0)("contentFieldsMode",!0)("showCancelButton",!1)("buttonsSticky",!0),c(2),P(o.categories)}}function Co(n,s){n&1&&(e(0,` 369 `),p(1,"app-skeleton-template",12),e(2,` 370 `))}var Xi=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubFieldsService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_,this.loading=!0,this.clubFieldOptions={},this.viewIDOptions=[{label:"Member",value:1},{label:"Administrator",value:2}]}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.viewID=Ti.MEMBER,this.loading=!0,this.getDefinitions()}getDefinitions(){this.loading=!0,A([this.clubFieldsService.getClubFieldOptionsMetadata(this.viewID),this.clubFieldsService.getClubFieldOptions(this.clubID,!1,this.viewID),this.clubFieldsService.getClubFields(this.clubID)]).subscribe(i=>{this.categories=i[0],this.clubFields=i[2],this.fields=[],i[1].length===0?this.clubFieldOptions=void 0:i[1].forEach(t=>{this.clubFieldOptions["fieldOption"+t.fieldOptionID]=t.fieldOptionValueID}),this.categories.forEach(t=>{if(t.categoryFieldOption){this.fields.push(t.categoryFieldOption);let l=this.clubFieldOptions["fieldOption"+t.categoryFieldOption.name.replace("fieldOption","")];t.fields.forEach(u=>{l===Oe.OFF?u.options.forEach(_=>_.disabled=!0):l===Oe.VIEW_ONLY?u.options.forEach(_=>_.disabled=![Oe.VIEW_ONLY,Oe.OFF].includes(_.value)):u.options.forEach(_=>_.disabled=!1)})}this.fields=this.fields.concat(t.fields)}),this.fields.forEach(t=>t.label=this.clubFields.find(l=>l.fieldOptionID===+t.name.replace("fieldOption",""))?.fieldName||t.label),this.siteDataService.hideSiteLoader(),this.loading=!1})}save(i){let t=[];this.fields.forEach(l=>{let u=new Di;u.fieldOptionID=+l.name.replace("fieldOption",""),u.fieldOptionValueID=i[l.name],t.push(u)}),this.clubFieldsService.saveClubFieldOptions(this.clubID,this.viewID,t).subscribe(()=>{this.formService.hideFormLoader(),this.siteDataService.clearClubFieldOptions(),this.siteDataService.showSiteSuccessAlert("Display options saved successfully")},l=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving display options. "+l?.error)})}updateFields(i,t,l){this.clubFieldOptions=Ee({},this.form.value),this.clubFieldOptions["fieldOption"+t.replace("fieldOption","")]=l,this.categories.find(u=>u.categoryID===i).fields.forEach(u=>{l===Oe.OFF?(this.clubFieldOptions["fieldOption"+u.name.replace("fieldOption","")]=Oe.OFF,u.options.forEach(_=>_.disabled=!0)):l===Oe.VIEW_ONLY?([Oe.VIEW_ONLY,Oe.OFF].includes(+this.clubFieldOptions["fieldOption"+u.name.replace("fieldOption","")])||(this.clubFieldOptions["fieldOption"+u.name.replace("fieldOption","")]=Oe.VIEW_ONLY),u.options.forEach(_=>_.disabled=![Oe.VIEW_ONLY,Oe.OFF].includes(_.value))):u.options.forEach(_=>_.disabled=!1)}),this.fields=[...this.fields]}cancel(){this.router.navigate(["../.."],{relativeTo:this.route})}scrollToElement(i){let t=document.getElementById(i);if(t){let l=t.offsetTop+80;window.scrollTo({top:l,behavior:"smooth"})}}};s.\u0275fac=function(t){return new(t||s)(C(Ae),C(D),C($),C(T),C(q))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],viewQuery:function(t,l){if(t&1&&pe(w,5),t&2){let u;oe(u=ae())&&(l.form=u.first)}},standalone:!1,decls:20,vars:5,consts:[[1,"horizontal-form"],[1,"row"],[1,"col-auto"],[1,"col","display-options-wrapper"],[1,"border-bottom","text-center","pb-3","mb-3","position-sticky","pt-2","bg-white",2,"z-index","10000","top","0"],["optionLabel","label","optionValue","value",3,"ngModelChange","onChange","options","allowEmpty","ngModel"],[1,"page-navigation","position-sticky-top"],[1,"btn-a11y",3,"click"],["formID","club-form","submitButtonText","Save","buttonsPosition","left",3,"onSubmit","fields","entity","horizontalForm","contentFieldsMode","showCancelButton","buttonsSticky"],[1,"text-medium","fw-700","text-uppercase","mb-0",3,"id"],[3,"onChange","fieldName"],[3,"fieldName"],["skeletonType","form"]],template:function(t,l){t&1&&(r(0,"section",0),e(1,` 371 372 373 `),r(2,"div",1),e(3,` 374 `),r(4,"div",2),e(5,` 375 `),f(6,co,9,0),a(),e(7,` 376 `),r(8,"div",3),e(9,` 377 `),r(10,"div",4),e(11,` 378 `),r(12,"p-selectButton",5),Y("ngModelChange",function(_){return z(l.viewID,_)||(l.viewID=_),_}),S("onChange",function(){return l.getDefinitions()}),e(13,` 379 `),a(),e(14,` 380 `),a(),e(15,` 381 `),f(16,_o,6,6)(17,Co,3,0),a(),e(18,` 382 `),a(),e(19,` 383 384 `),a()),t&2&&(c(6),h((l.categories==null?null:l.categories.length)>0?6:-1),c(6),d("options",l.viewIDOptions)("allowEmpty",!1),j("ngModel",l.viewID),c(4),h(l.loading?17:16))},dependencies:[w,k,ge,ye,H,Oi],encapsulation:2});let n=s;return n})();function xo(n,s){if(n&1){let o=v();e(0,` 385 `),r(1,"li"),e(2,` 386 `),r(3,"a",5),S("click",function(){let t=x(o).$implicit,l=m(2);return b(l.scrollToElement("nav-"+t.categoryID))}),e(4),a(),e(5,` 387 `),a(),e(6,` 388 `)}if(n&2){let o=s.$implicit;c(4),O(o.name)}}function bo(n,s){if(n&1&&(e(0,` 389 `),r(1,"nav",4),e(2,` 390 `),r(3,"ul"),e(4,` 391 `),I(5,xo,7,1,null,null,F),a(),e(7,` 392 `),a(),e(8,` 393 `)),n&2){let o=m();c(5),P(o.categories)}}function So(n,s){n&1&&(e(0,` 394 `),p(1,"hr"),e(2,` 395 `))}function vo(n,s){if(n&1){let o=v();e(0,` 396 `),r(1,"a",10),S("click",function(){x(o);let t=m().$implicit,l=m(3);return b(l.goToValues(t))}),e(2,"Field Values"),a(),e(3,` 397 `)}}function go(n,s){if(n&1&&(e(0,` 398 `),r(1,"app-dynamic-form-field",8),e(2,` 399 400 `),r(3,"span",9),e(4,` 401 `),f(5,vo,4,0),a(),e(6,` 402 `),a(),e(7,` 403 `)),n&2){let o=s.$implicit;c(),d("fieldName",o.name),c(4),h(o.data!=null&&o.data.isCustomDropdown?5:-1)}}function yo(n,s){if(n&1&&(e(0,` 404 `),r(1,"div"),e(2,` 405 `),f(3,So,3,0),r(4,"h4",7),e(5),a(),e(6,` 406 `),I(7,go,8,2,null,null,F),a(),e(9,` 407 `)),n&2){let o=s.$implicit,i=s.$index;c(3),h(i!==0?3:-1),c(),d("id","nav-"+o.categoryID),c(),O(o.name),c(2),P(o.fields)}}function Do(n,s){if(n&1){let o=v();e(0,` 408 `),r(1,"app-dynamic-form",6),S("onSubmit",function(t){x(o);let l=m();
408return b(l.save(t))}),e(2,` 409 `),I(3,yo,10,3,null,null,F),a(),e(5,` 410 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.clubFields)("horizontalForm",!0)("contentFieldsMode",!0)("showCancelButton",!1)("buttonsSticky",!0),c(2),P(o.categories)}}function Ao(n,s){n&1&&(e(0,` 411 `),p(1,"app-skeleton-template",11),e(2,` 412 `))}var Ki=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubFieldService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_,this.loading=!0,this.clubFields={}}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,A([this.clubFieldService.getClubFieldsMetadata(),this.clubFieldService.getClubFields(this.clubID)]).subscribe(i=>{this.categories=i[0],this.fields=[],this.categories.forEach(t=>{this.fields=this.fields.concat(t.fields),t.fields.length===0&&(this.categories=this.categories.filter(l=>l.categoryID!==t.categoryID))}),i[1].length===0?this.clubFields=void 0:i[1].forEach(t=>{this.clubFields["field"+t.fieldOptionID]=t.fieldName}),this.siteDataService.hideSiteLoader(),this.loading=!1})}fieldName(i){return this.clubFields&&this.clubFields[i.name]?.toString()||i.label}goToValues(i){let t=+i.name.replace("field","");i.data.enableValueToggling?this.router.navigate([t,"values","display-options"],{state:{fieldName:this.fieldName(i),enableValueRenaming:i.data.enableValueRenaming},relativeTo:this.route}):this.router.navigate([this.getDropdownID(i.name),"value-list"],{state:{fieldName:this.fieldName(i)},relativeTo:this.route})}getDropdownID(i){switch(+i.replace("field","")){case R.CUSTOM_DROPDOWN_FIELD_1:return X.CUSTOM_DROPDOWN_FIELD_1;case R.CUSTOM_DROPDOWN_FIELD_2:return X.CUSTOM_DROPDOWN_FIELD_2;case R.CUSTOM_DROPDOWN_FIELD_3:return X.CUSTOM_DROPDOWN_FIELD_3;case R.CUSTOM_DROPDOWN_FIELD_4:return X.CUSTOM_DROPDOWN_FIELD_4;case R.CUSTOM_DROPDOWN_FIELD_5:return X.CUSTOM_DROPDOWN_FIELD_5;case R.CUSTOM_DROPDOWN_FIELD_6:return X.CUSTOM_DROPDOWN_FIELD_6;case R.CUSTOM_DROPDOWN_FIELD_7:return X.CUSTOM_DROPDOWN_FIELD_7;case R.CUSTOM_DROPDOWN_FIELD_8:return X.CUSTOM_DROPDOWN_FIELD_8;case R.CUSTOM_DROPDOWN_FIELD_9:return X.CUSTOM_DROPDOWN_FIELD_9;case R.CUSTOM_DROPDOWN_FIELD_10:return X.CUSTOM_DROPDOWN_FIELD_10;case R.STAFF_CUSTOM_DROPDOWN_FIELD_1:return X.STAFF_CUSTOM_DROPDOWN_FIELD_1;case R.STAFF_CUSTOM_DROPDOWN_FIELD_2:return X.STAFF_CUSTOM_DROPDOWN_FIELD_2;case R.STAFF_CUSTOM_DROPDOWN_FIELD_3:return X.STAFF_CUSTOM_DROPDOWN_FIELD_3;case R.STAFF_CUSTOM_DROPDOWN_FIELD_4:return X.STAFF_CUSTOM_DROPDOWN_FIELD_4;case R.STAFF_CUSTOM_DROPDOWN_FIELD_5:return X.STAFF_CUSTOM_DROPDOWN_FIELD_5;case R.STAFF_CUSTOM_DROPDOWN_FIELD_6:return X.STAFF_CUSTOM_DROPDOWN_FIELD_6;case R.STAFF_CUSTOM_DROPDOWN_FIELD_7:return X.STAFF_CUSTOM_DROPDOWN_FIELD_7;case R.STAFF_CUSTOM_DROPDOWN_FIELD_8:return X.STAFF_CUSTOM_DROPDOWN_FIELD_8;case R.STAFF_CUSTOM_DROPDOWN_FIELD_9:return X.STAFF_CUSTOM_DROPDOWN_FIELD_9;case R.STAFF_CUSTOM_DROPDOWN_FIELD_10:return X.STAFF_CUSTOM_DROPDOWN_FIELD_10;case R.STAFF_CUSTOM_DROPDOWN_FIELD_11:return X.STAFF_CUSTOM_DROPDOWN_FIELD_11;case R.STAFF_CUSTOM_DROPDOWN_FIELD_12:return X.STAFF_CUSTOM_DROPDOWN_FIELD_12;case R.STAFF_CUSTOM_DROPDOWN_FIELD_13:return X.STAFF_CUSTOM_DROPDOWN_FIELD_13;case R.STAFF_CUSTOM_DROPDOWN_FIELD_14:return X.STAFF_CUSTOM_DROPDOWN_FIELD_14;case R.STAFF_CUSTOM_DROPDOWN_FIELD_15:return X.STAFF_CUSTOM_DROPDOWN_FIELD_15;case R.TEAM_CONTACT_CUSTOM_DROPDOWN_FIELD_1:return X.TEAM_CONTACT_CUSTOM_DROPDOWN_FIELD_1;case R.TEAM_CONTACT_CUSTOM_DROPDOWN_FIELD_2:return X.TEAM_CONTACT_CUSTOM_DROPDOWN_FIELD_2;case R.TEAM_CONTACT_CUSTOM_DROPDOWN_FIELD_3:return X.TEAM_CONTACT_CUSTOM_DROPDOWN_FIELD_3}}save(i){let t=[];this.clubFields={},this.fields.forEach(l=>{let u=new yt;u.fieldOptionID=+l.name.replace("field",""),u.fieldName=i[l.name],t.push(u),this.clubFields["field"+u.fieldOptionID]=u.fieldName}),this.clubFieldService.saveClubFields(this.clubID,t).subscribe(()=>{this.formService.hideFormLoader(),this.siteDataService.clearClubFieldOptions(),this.siteDataService.showSiteSuccessAlert("Field names saved successfully")},l=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving field names. "+l?.error)})}cancel(){this.router.navigate(["../.."],{relativeTo:this.route})}scrollToElement(i){let t=document.getElementById(i);t&&t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})}};s.\u0275fac=function(t){return new(t||s)(C(Ae),C(D),C($),C(T),C(q))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:14,vars:2,consts:[[1,"row"],[1,"col-auto"],[1,"col","display-options-wrapper"],[1,"horizontal-form"],[1,"page-navigation","bg-white","position-sticky-top"],[1,"btn-a11y",3,"click"],["formID","club-form","submitButtonText","Save","buttonsPosition","left",3,"onSubmit","fields","entity","horizontalForm","contentFieldsMode","showCancelButton","buttonsSticky"],[3,"id"],[3,"fieldName"],["extraMessage",""],[1,"d-inline-block","mt-2","pl-2",3,"click"],["skeletonType","form"]],template:function(t,l){t&1&&(r(0,"div",0),e(1,` 413 `),r(2,"div",1),e(3,` 414 `),f(4,bo,9,0),a(),e(5,` 415 `),r(6,"div",2),e(7,` 416 `),r(8,"section",3),e(9,` 417 `),f(10,Do,6,6)(11,Ao,3,0),a(),e(12,` 418 `),a(),e(13,` 419`),a()),t&2&&(c(4),h((l.categories==null?null:l.categories.length)>0?4:-1),c(6),h(l.loading?11:10))},dependencies:[w,k,H],encapsulation:2});let n=s;return n})();function To(n,s){if(n&1){let o=v();e(0,` 420 `),r(1,"li"),e(2,` 421 `),r(3,"a",5),S("click",function(){let t=x(o).$implicit,l=m(2);return b(l.scrollToElement("nav-"+t.categoryID))}),e(4),a(),e(5,` 422 `),a(),e(6,` 423 `)}if(n&2){let o=s.$implicit;c(4),O(o.name)}}function Eo(n,s){if(n&1&&(e(0,` 424 `),r(1,"nav",4),e(2,` 425 `),r(3,"ul"),e(4,` 426 `),I(5,To,7,1,null,null,F),a(),e(7,` 427 `),a(),e(8,` 428 `)),n&2){let o=m();c(5),P(o.categories)}}function wo(n,s){n&1&&(e(0,` 429 `),p(1,"hr"),e(2,` 430 `))}function Fo(n,s){if(n&1&&(e(0,` 431 `),r(1,"app-dynamic-form-field",8),e(2,` 432 `),a(),e(3,` 433 `)),n&2){let o=s.$implicit;c(),d("fieldName",o.name)("dateFormat","mm/dd")("datepickerPanelClass","datepicker-hide-year")}}function Io(n,s){if(n&1&&(e(0,` 434 `),r(1,"div"),e(2,` 435 `),f(3,wo,3,0),r(4,"h4",7),e(5),a(),e(6,` 436 `),I(7,Fo,4,3,null,null,F),a(),e(9,` 437 `)),n&2){let o=s.$implicit,i=s.$index;c(3),h(i!==0?3:-1),c(),d("id","nav-"+o.categoryID),c(),O(o.name),c(2),P(o.fields)}}function Po(n,s){if(n&1){let o=v();e(0,` 438 `),r(1,"app-dynamic-form",6),S("onSubmit",function(t){x(o);let l=m();
438return b(l.save(t))}),e(2,` 439 `),I(3,Io,10,3,null,null,F),a(),e(5,` 440 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.clubFields)("horizontalForm",!0)("contentFieldsMode",!0)("showCancelButton",!1)("buttonsSticky",!0),c(2),P(o.categories)}}function Oo(n,s){n&1&&(e(0,` 441 `),p(1,"app-skeleton-template",9),e(2,` 442 `))}var Zi=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubFieldService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_,this.loading=!0,this.clubFields={}}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,A([this.clubFieldService.getClubFieldRenewalDatesMetadata(),this.clubFieldService.getClubFields(this.clubID)]).subscribe(i=>{this.categories=i[0],this.fields=[],this.categories.forEach(t=>{this.fields=this.fields.concat(t.fields),t.fields.length===0&&(this.categories=this.categories.filter(l=>l.categoryID!==t.categoryID))}),this.fields.forEach(t=>{t.minDate=new Date(t.minDate),t.maxDate=new Date(t.maxDate),t.yearRange="9999:9999"}),i[1].length===0?this.clubFields=void 0:i[1].forEach(t=>{if(t.renewalDate){let l=new Date(t.renewalDate);this.clubFields["field"+t.fieldOptionID]=l}}),this.siteDataService.hideSiteLoader(),this.loading=!1})}save(i){let t=[];this.fields.forEach(l=>{let u=new yt;u.fieldOptionID=+l.name.replace("field",""),u.renewalDate=i[l.name],t.push(u)}),this.clubFieldService.saveClubFieldRenewalDates(this.clubID,t).subscribe(()=>{this.formService.hideFormLoader(),this.siteDataService.clearClubFieldOptions(),this.siteDataService.showSiteSuccessAlert("Field renewal dates saved successfully")},l=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving field renewal dates. "+l?.error)})}cancel(){this.router.navigate(["../.."],{relativeTo:this.route})}scrollToElement(i){let t=document.getElementById(i);t&&t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})}};s.\u0275fac=function(t){return new(t||s)(C(Ae),C(D),C($),C(T),C(q))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:15,vars:2,consts:[[1,"row"],[1,"col-auto"],[1,"col","display-options-wrapper"],[1,"horizontal-form","renewal-dates-wrapper"],[1,"page-navigation","bg-white","position-sticky-top"],[1,"btn-a11y",3,"click"],["formID","club-form","submitButtonText","Save","buttonsPosition","left",3,"onSubmit","fields","entity","horizontalForm","contentFieldsMode","showCancelButton","buttonsSticky"],[3,"id"],[3,"fieldName","dateFormat","datepickerPanelClass"],["skeletonType","form"]],template:function(t,l){t&1&&(e(0,` 443`),r(1,"div",0),e(2,` 444 `),r(3,"div",1),e(4,` 445 `),f(5,Eo,9,0),a(),e(6,` 446 `),r(7,"div",2),e(8,` 447 `),r(9,"section",3),e(10,` 448 `),f(11,Po,6,6)(12,Oo,3,0),a(),e(13,` 449 `),a(),e(14,` 450 `),a()),t&2&&(c(5),h((l.categories==null?null:l.categories.length)>0?5:-1),c(6),h(l.loading?12:11))},dependencies:[w,k,H],encapsulation:2});let n=s;return n})();var Vo=()=>["../.."];function ko(n,s){n&1&&(e(0,` 451 `),r(1,"tr"),e(2,` 452 `),r(3,"th"),e(4,"Name"),a(),e(5,` 453 `),r(6,"th"),e(7,"Sequence"),a(),e(8,` 454 `),a(),e(9,` 455 `))}function No(n,s){if(n&1){let o=v();e(0,` 456 `),r(1,"tr"),e(2,` 457 `),r(3,"td")(4,"a",8),S("click",function(){let t=x(o).$implicit,l=m(2);return b(l.edit(t.clubFieldValueID))}),e(5),a(),e(6,` 458 `),a(),e(7,` 459 `),r(8,"td"),e(9),a(),e(10,` 460 `),a(),e(11,` 461 `)}if(n&2){let o=s.$implicit;c(5),V(` 462 `,o.name,` 463 `),c(4),O(o.sequence)}}function Ro(n,s){if(n&1&&(e(0,` 464 `),r(1,"p-table",5),e(2,` 465 `),E(3,ko,10,0,"ng-template",6),e(4,` 466 `),E(5,No,12,2,"ng-template",7),e(6,` 467 `),a(),e(7,` 468 `)),n&2){let o=m();c(),d("value",o.values)}}function Lo(n,s){if(n&1){let o=v();e(0,` 469 `),r(1,"app-dynamic-form",9),S("onDelete",function(){x(o);let t=m();return b(t.delete())})("onCancel",function(){x(o);let t=m();return b(t.showModal=!1)})("onSubmit",function(t){x(o);let l=m();return b(l.save(t))}),e(2,` 470 `),p(3,"app-dynamic-form-field",10),e(4,` 471 `),p(5,"app-dynamic-form-field",11),e(6,` 472 `),a(),e(7,` 473 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.value)("horizontalForm",!0)("showDeleteButton",o.clubFieldValueID!==void 0)("contentFieldsMode",!0)}}var en=(()=>{let s=class s{constructor(i,t,l,u,_){this.route=i,this.router=t,this.clubFieldService=l,this.formService=u,this.siteDataService=_,this.showModal=!1;let g=this.router.getCurrentNavigation()??this.router.lastSuccessfulNavigation();g?.extras.state&&(this.fieldName=g.extras.state.fieldName)}
473ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.dropdownID=+this.route.snapshot.params.id;let i=[this.clubFieldService.getDropdownValueMetadata(),this.clubFieldService.getDropdownValues(this.clubID,this.dropdownID)];this.fieldName||i.push(this.clubFieldService.getClubFieldNames(this.clubID,[this.getClubField(this.dropdownID)])),A(i).subscribe(t=>{this.fields=t[0].fields,this.values=t[1],this.fieldName||(this.fieldName=t[2].find(l=>l.fieldOptionID===this.getClubField(this.dropdownID)).fieldName),this.siteDataService.hideSiteLoader()})}edit(i){this.clubFieldValueID=i,this.value=this.values.find(t=>t.clubFieldValueID===i),this.showModal=!0}add(){this.clubFieldValueID=void 0,this.value=new Ai,this.showModal=!0}save(i){this.clubFieldService.saveDropdownValue(this.clubID,this.dropdownID,this.clubFieldValueID,i).subscribe(t=>{if(this.showModal=!1,i.clubFieldValueID=t,!this.clubFieldValueID)this.values.push(i);else{let l=this.values.findIndex(u=>u.clubFieldValueID===this.clubFieldValueID);this.values[l]=i}this.values=this.values.sort((l,u)=>l.sequence<u.sequence?-1:l.sequence>u.sequence?1:0),this.values=[...this.values],this.siteDataService.showSiteSuccessAlert("Dropdown value was saved successfully"),this.formService.hideFormLoader()},()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving dropdown value"),this.formService.hideFormLoader()})}delete(){this.clubFieldService.deleteDropdownValue(this.clubID,this.dropdownID,this.clubFieldValueID).subscribe(()=>{this.showModal=!1,this.values=this.values.filter(i=>i.clubFieldValueID!==this.clubFieldValueID),this.values=[...this.values],this.siteDataService.showSiteSuccessAlert("Dropdown value was deleted successfully")},()=>{this.siteDataService.showSiteErrorAlert("There was a problem deleting this dropdown value. Dropdown value is in use.")})}getClubField(i){switch(i){case 1:return R.CUSTOM_DROPDOWN_FIELD_1;case 2:return R.CUSTOM_DROPDOWN_FIELD_2;case 3:return R.CUSTOM_DROPDOWN_FIELD_3;case 4:return R.CUSTOM_DROPDOWN_FIELD_4;case 5:return R.CUSTOM_DROPDOWN_FIELD_5;case 6:return R.CUSTOM_DROPDOWN_FIELD_6;case 7:return R.CUSTOM_DROPDOWN_FIELD_7;case 8:return R.CUSTOM_DROPDOWN_FIELD_8;case 9:return R.CUSTOM_DROPDOWN_FIELD_9;case 10:return R.CUSTOM_DROPDOWN_FIELD_10}}};s.\u0275fac=function(t){return new(t||s)(C(T),C(q),C(Ae),C($),C(D))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:22,vars:7,consts:[["role","main"],["appStickyFormButtons",""],[1,"btn","btn-lg","btn-primary",3,"click"],[1,"btn","btn-lg",3,"routerLink"],["header","Add/Edit Value","styleClass","shortWidthDialog",3,"visibleChange","visible","modal"],["sortField","sequence",1,"table","table-striped","table-sm",3,"value"],["pTemplate","header"],["pTemplate","body"],[3,"click"],["buttonsPosition","left",3,"onDelete","onCancel","onSubmit","fields","entity","horizontalForm","showDeleteButton","contentFieldsMode"],["fieldName","name"],["fieldName","sequence"]],template:function(t,l){t&1&&(r(0,"main",0),e(1,` 474 `),r(2,"h2"),e(3),a(),e(4,` 475 `),r(5,"section"),e(6,` 476 `),f(7,Ro,8,1),r(8,"div",1),e(9,` 477 `),r(10,"button",2),S("click",function(){return l.add()}),e(11,"Add Value"),a(),e(12,` 478 `),r(13,"button",3),e(14,"Cancel"),a(),e(15,` 479 `),a(),e(16,` 480`),a(),e(17,` 481`),r(18,"p-dialog",4),Y("visibleChange",function(_){return z(l.showModal,_)||(l.showModal=_),_}),e(19,` 482 `),f(20,Lo,8,5),a(),e(21,` 483`),a()),t&2&&(c(3),V(` 484 `,l.fieldName,` 485 `),c(4),h(l.values?7:-1),c(6),d("routerLink",te(6,Vo)),c(5),j("visible",l.showModal),d("modal",!0),c(2),h(l.fields?20:-1))},dependencies:[w,k,ie,ne,Pt,se,Pe],encapsulation:2});let n=s;return n})();function Bo(n,s){if(n&1&&(e(0,` 486 `),r(1,"app-dynamic-form-field",2),e(2,` 487 `),a(),e(3,` 488 `)),n&2){let o=s.$implicit;c(),d("fieldName",o.name)}}function $o(n,s){if(n&1){let o=v();e(0,` 489 `),r(1,"app-dynamic-form",1),S("onSubmit",function(t){x(o);let l=m();return b(l.save(t))})("onCancel",function(){x(o);let t=m();return b(t.cancel())}),e(2,` 490 `),I(3,Bo,4,1,null,null,F),a(),e(5,` 491 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.fieldNames)("horizontalForm",!0)("contentFieldsMode",!0),c(2),P(o.fields)}}function Wo(n,s){n&1&&(e(0,` 492 `),p(1,"app-skeleton-template",3),e(2,` 493 `))}var tn=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubFieldService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_,this.loading=!0,this.fieldNames={}}
493ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.parent.params.clubID:this.clubID=void 0,this.fieldOptionID=+this.route.snapshot.parent.params.id,A([this.clubFieldService.getCustomFieldNamesMetadata(this.fieldOptionID),this.clubFieldService.getCustomFieldNames(this.clubID,this.fieldOptionID)]).subscribe(i=>{this.fields=i[0],i[1].length===0?this.fieldNames=void 0:i[1].forEach(t=>{this.fieldNames["field"+t.value]=t.label}),this.siteDataService.hideSiteLoader(),this.loading=!1})}save(i){let t=[];this.fields.forEach(l=>{let u=new Dt;u.fieldValueID=+l.name.replace("field",""),u.fieldName=i[l.name],t.push(u)}),this.clubFieldService.saveCustomFieldNames(this.clubID,this.fieldOptionID,t).subscribe(()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Field value names saved successfully")},l=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving field value names. "+l?.error)})}cancel(){this.router.navigate(["../../.."],{relativeTo:this.route})}};s.\u0275fac=function(t){return new(t||s)(C(Ae),C(D),C($),C(T),C(q))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:4,vars:1,consts:[[1,"horizontal-form"],["submitButtonText","Save","buttonsPosition","left",3,"onSubmit","onCancel","fields","entity","horizontalForm","contentFieldsMode"],[3,"fieldName"],["skeletonType","form"]],template:function(t,l){t&1&&(r(0,"section",0),e(1,` 494 `),f(2,$o,6,4)(3,Wo,3,0),a()),t&2&&(c(2),h(l.loading?3:2))},dependencies:[w,k,H],encapsulation:2});let n=s;return n})();function Uo(n,s){if(n&1&&(e(0,` 495 `),r(1,"app-dynamic-form-field",2),e(2,` 496 `),a(),e(3,` 497 `)),n&2){let o=s.$implicit;c(),d("fieldName",o.name)}}function jo(n,s){if(n&1){let o=v();e(0,` 498 `),r(1,"app-dynamic-form",1),S("onSubmit",function(t){x(o);let l=m();return b(l.save(t))})("onCancel",function(){x(o);let t=m();return b(t.cancel())}),e(2,` 499 `),I(3,Uo,4,1,null,null,F),a(),e(5,` 500 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.fieldOptions)("horizontalForm",!0)("contentFieldsMode",!0),c(2),P(o.fields)}}function zo(n,s){n&1&&(e(0,` 501 `),p(1,"app-skeleton-template",3),e(2,` 502 `))}var nn=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubFieldService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_,this.loading=!0,this.fieldOptions={}}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.parent.params.clubID:this.clubID=void 0,this.fieldOptionID=+this.route.snapshot.parent.params.id,A([this.clubFieldService.getCustomFieldOptionsMetadata(this.fieldOptionID),this.clubFieldService.getCustomFieldOptions(this.clubID,this.fieldOptionID),this.clubFieldService.getCustomFieldNames(this.clubID,this.fieldOptionID)]).subscribe(i=>{this.fields=i[0],this.fieldNames=i[2],i[1].length===0?this.fieldOptions=void 0:i[1].forEach(t=>{this.fieldOptions["field"+t.value]=t.disabled}),this.fields.forEach(t=>{t.label=this.fieldNames?.find(l=>l.value===+t.name.replace("field",""))?.label||t.label}),this.siteDataService.hideSiteLoader(),this.loading=!1})}save(i){let t=[];this.fields.forEach(l=>{let u=new Dt;u.fieldValueID=+l.name.replace("field",""),u.hidden=i[l.name],t.push(u)}),this.clubFieldService.saveCustomFieldOptions(this.clubID,this.fieldOptionID,t).subscribe(()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Field display options saved successfully")},l=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving field display options. "+l?.error)})}cancel(){this.router.navigate(["../../.."],{relativeTo:this.route})}};s.\u0275fac=function(t){return new(t||s)(C(Ae),C(D),C($),C(T),C(q))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],viewQuery:function(t,l){if(t&1&&pe(w,5),t&2){let u;oe(u=ae())&&(l.form=u.first)}},standalone:!1,decls:4,vars:1,consts:[[1,"horizontal-form"],["formID","club-form","submitButtonText","Save","buttonsPosition","left",3,"onSubmit","onCancel","fields","entity","horizontalForm","contentFieldsMode"],[3,"fieldName"],["skeletonType","form"]],template:function(t,l){t&1&&(r(0,"section",0),e(1,` 503 `),f(2,jo,6,4)(3,zo,3,0),a()),t&2&&(c(2),h(l.loading?3:2))},dependencies:[w,k,H],encapsulation:2});let n=s;return n})();function Yo(n,s){n&1&&(e(0,` 504 `),r(1,"div",3),e(2,` 505 `),r(3,"ul",4),e(4,` 506 `),r(5,"li",5),e(6,` 507 `),r(7,"a",6),e(8,` 508 Display Options 509 `),a(),e(9,` 510 `),a(),e(10,` 511 `),r(11,"li",5),e(12,` 512 `),r(13,"a",7),e(14,` 513 Names 514 `),a(),e(15,` 515 `),a(),e(16,` 516 `),a(),e(17,` 517 `),a(),e(18,` 518 `))}var on=(()=>{let s=class s{constructor(i,t,l){this.route=i,this.router=t,this.clubFieldService=l;let u=this.router.getCurrentNavigation()??this.router.lastSuccessfulNavigation();u?.extras.state&&(this.fieldName=u.extras.state.fieldName,this.enableValueRenaming=u.extras.state.enableValueRenaming)}
518ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.parent.params.clubID:this.clubID=void 0,this.fieldOptionID=+this.route.snapshot.params.id,this.fieldName||A([this.clubFieldService.getClubFieldNames(this.clubID,[this.fieldOptionID]),this.clubFieldService.getFieldOptionMetadata(this.fieldOptionID)]).subscribe(i=>{this.fieldName=i[0].find(t=>t.fieldOptionID===this.fieldOptionID).fieldName,this.enableValueRenaming=i[1].enableValueRenaming})}};s.\u0275fac=function(t){return new(t||s)(C(T),C(q),C(Ae))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:11,vars:3,consts:[["role","main"],["grandParentLinkText","Settings","grandParentLinkUrl","../../../../","parentLinkText","Field Names","parentLinkUrl","../../",3,"pageTitle","showBackButton"],[1,"px-3"],[1,"tabs"],["role","tablist",1,"tab-nav","no-bullets","inline-list"],["routerLinkActive","active",1,"nav-item"],["routerLink","display-options","role","tab","aria-controls","home","aria-selected","true",1,"nav-link"],["routerLink","names","role","tab","aria-controls","home","aria-selected","true",1,"nav-link"]],template:function(t,l){t&1&&(r(0,"main",0),e(1,` 519 `),r(2,"app-admin-header",1),e(3,` 520 `),a(),e(4,` 521 `),f(5,Yo,19,0),r(6,"div",2),e(7,` 522 `),p(8,"router-outlet"),e(9,` 523 `),a(),e(10,` 524`),a()),t&2&&(c(2),d("pageTitle",l.fieldName)("showBackButton",!0),c(3),h(l.enableValueRenaming?5:-1))},dependencies:[Ze,ie,gt,N],encapsulation:2});let n=s;return n})();function qo(n,s){n&1&&(e(0,` 525 `),r(1,"div",2),e(2,` 526 `),r(3,"h2"),e(4,"Payment Settings"),a(),e(5,` 527 `),r(6,"div",3),e(7,` 528 `),r(8,"p"),e(9,` 529 Payment Settings is where you can manage your club's merchant accounts, payment fee structures, and 530 more. 531 `),a(),e(10,` 532 `),r(11,"p"),e(12,"Here you can find settings such as: "),r(13,"strong"),e(14,"Active Payment Vendor, Default Merchant Account,"),a(),e(15,` and 533 `),r(16,"strong"),e(17,"Fee Structures"),a(),e(18,`. 534 `),a(),e(19,` 535 `),a(),e(20,` 536 `),r(21,"div",4),e(22,` 537 `),r(23,"a",6),e(24,"Edit Payment Settings"),a(),e(25,` 538 `),a(),e(26,` 539`),a(),e(27,` 540`))}function Ho(n,s){n&1&&(e(0,` 541 `),r(1,"div",2),e(2,` 542 `),r(3,"h2"),e(4,"Payment Settings"),a(),e(5,` 543 `),r(6,"div",3),e(7,` 544 `),r(8,"p"),e(9,` 545 Payment Settings is where you can see and onboard your club's merchant accounts. 546 `),a(),e(10,` 547 `),a(),e(11,` 548 `),r(12,"div",4),e(13,` 549 `),r(14,"a",7),e(15,"Onboard Accounts"),a(),e(16,` 550 `),a(),e(17,` 551 `),a(),e(18,` 552`))}function Qo(n,s){n&1&&(e(0,` 553 `),r(1,"div",2),e(2,` 554 `),r(3,"h2"),e(4,"Fiscal Year & Financial Aid Settings"),a(),e(5,` 555 `),r(6,"div",3),e(7,` 556 `),r(8,"p"),e(9,` 557 Fiscal Year & Financial Aid Settings is where you can manage your club's fiscal year dates & financial 558 aid budget. 559 `),a(),e(10,` 560 `),a(),e(11,` 561 `),r(12,"div",4),e(13,` 562 `),r(14,"a",8),e(15,"Edit Fiscal Year & Financial Aid Settings"),a(),e(16,` 563 `),a(),e(17,` 564 `),a(),e(18,` 565`))}function Go(n,s){n&1&&(e(0,` 566 `),r(1,"p"),e(2,"The "),r(3,"strong"),e(4,"email addresses"),a(),e(5,` entered on this page will be available to 567 select as the 'From 568 Address' when sending emails out of the system.`),a(),e(6,` 569 `))}function Jo(n,s){if(n&1&&(e(0,` 570 `),r(1,"div",10),e(2,` 571 `),r(3,"app-inline-alert",11),e(4,` 572 `),r(5,"span"),e(6,"You have "),r(7,"strong"),e(8),a(),e(9),a(),e(10,` 573 `),a(),e(11,` 574 `),a(),e(12,` 575`)),n&2){let o=m(2);c(3),d("isInline",!0),c(5),O(o.emailAccountCount),c(),V(" email account",o.emailAccountCount===0||o.emailAccountCount>1?"s":"",".")}}function Xo(n,s){if(n&1&&(e(0,` 576 `),r(1,"div",2),e(2,` 577 `),r(3,"h2"),e(4,"Email Accounts"),a(),e(5,` 578 `),r(6,"div",3),e(7,` 579 `),f(8,Go,7,0),r(9,"p")(10,"strong"),e(11,"BCC email addresses"),a(),e(12,` can be set to notify the club of failed payments, ACH returns, or 580 updates related to disputes\u2014including initiation, 581 status changes, response reminders, and final decisions.`),a(),e(13,` 582 `),f(14,Jo,13,3),a(),e(15,` 583`),r(16,"div",4),e(17,` 584 `),r(18,"a",9),e(19,"Edit Email Accounts"),a(),e(20,` 585`),a(),e(21,` 586`),a(),e(22,` 587`)),n&2){let o=m();c(8),h(o.userIsSuperAdmin?8:-1),c(6),h(o.userIsSuperAdmin?14:-1)}}function Ko(n,s){n&1&&(e(0,` 588 `),r(1,"div",2),e(2,` 589 `),r(3,"h2"),e(4,"Options"),a(),e(5,` 590 `),r(6,"p",3),e(7,`This page is dedicated to other club-specific options, such as the ability to register 591 with `),r(8,"strong"),e(9,`overdue 592 payments`),a(),e(10,"."),a(),e(11,` 593 `),r(12,"p",3),e(13,"Accounting classes can be used to group programs on various transaction reports."),a(),e(14,` 594 `),r(15,"div",4),e(16,` 595 `),r(17,"a",12),e(18,"Edit Club Options"),a(),e(19,` 596 `),a(),e(20,` 597 `),a(),e(21,` 598`))}function Zo(n,s){n&1&&(e(0,` 599 `),r(1,"div",2),e(2,` 600 `),r(3,"h2"),e(4,"Accounting Classes"),a(),e(5,` 601 `),r(6,"p",3),e(7,"Accounting classes can be used to group programs on various transaction reports."),a(),e(8,` 602 `),r(9,"div",4),e(10,` 603 `),r(11,"a",13),e(12,"Edit Accounting Classes"),a(),e(13,` 604 `),a(),e(14,` 605 `),a(),e(15,` 606`))}function ea(n,s){n&1&&(e(0,` 607 `),r(1,"div",2),e(2,` 608 `),r(3,"h2"),e(4,"Surcharges"),a(),e(5,` 609 `),r(6,"p",3),e(7,"A surcharge is used to apply an additional fee to cover extra costs."),a(),e(8,` 610 `),r(9,"div",4),e(10,` 611 `),r(11,"a",14),e(12,"Edit Surcharges"),a(),e(13,` 612 `),a(),e(14,` 613 `),a(),e(15,` 614`))}function ta(n,s){n&1&&(e(0,` 615 `),r(1,"div",2),e(2,` 616 `),r(3,"h2"),e(4,"Fields"),a(),e(5,` 617 `),r(6,"p",3),e(7,"The "),r(8,"strong"),e(9,"field options"),a(),e(10," are used to "),r(11,"strong"),e(12,"rename"),a(),e(13," and "),r(14,"strong"),e(15,`add 618 form fields`),a(),e(16,` 619in the system.`),a(),e(17,` 620`),r(18,"div",4),e(19,` 621 `),r(20,"a",15),e(21,"Edit Fields"),a(),e(22,` 622`),a(),e(23,` 623`),a(),e(24,` 624`))}var ei=(()=>{let s=class s{constructor(i,t,l,u,_){this.route=i,this.authorizeService=t,this.siteDataService=l,this.commService=u,this.clubService=_,this.userIsSuperAdmin=!1,this.userIsClubAdmin=!1,this.acctClassesOptionEnabled=!1,this.surchargesOptionEnabled=!1,this.PaymentVendor=Be,this.unsubscribe$=new ue}
624ngOnInit(){this.clubID=this.route.snapshot.params.clubID,this.authorizeService.getUser().subscribe(i=>{i&&this.authorizeService.isSuperAdmin(i.role)&&(this.userIsSuperAdmin=!0),i&&this.authorizeService.isAdmin(i.role)&&(this.userIsClubAdmin=!0)}),A({domains:this.commService.getDomains(),club:this.clubService.getClub(this.clubID),clubOptions:this.siteDataService.getClubOptions([De.MANAGE_ACCOUNTING_CLASSES,De.ENABLE_SURCHARGES])}).subscribe({next:i=>{this.emailAccountCount=i.domains.length-1,this.club=i.club,this.childClubName=i.club.name,i.clubOptions.find(t=>t.optionID===De.MANAGE_ACCOUNTING_CLASSES)?.boolValue&&(this.acctClassesOptionEnabled=!0),i.clubOptions.find(t=>t.optionID===De.ENABLE_SURCHARGES)?.boolValue&&(this.surchargesOptionEnabled=!0),this.siteDataService.hideSiteLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data")}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};s.\u0275fac=function(t){return new(t||s)(C(T),C(he),C(D),C(Vt),C(W))},s.\u0275cmp=y({type:s,selectors:[["app-club-settings-landing-page"]],standalone:!1,decls:48,vars:9,consts:[["role","main"],[3,"pageTitle"],[1,"card","settings-card","mb-4","mt-4","col-xl-9"],[1,"text-medium"],[1,"card-footer"],["routerLink","profile"],["routerLink","payments"],["routerLink","payments-onboard"],["routerLink","fiscal-years"],["routerLink","email-accounts"],[1,"mb-2"],[3,"isInline"],["routerLink","options"],["routerLink","accounting-classes"],["routerLink","surcharges"],["routerLink","fields"]],template:function(t,l){t&1&&(r(0,"main",0),e(1,` 625 `),p(2,"app-admin-header",1),e(3,` 626 627 `),r(4,"div",2),e(5,` 628 `),r(6,"h2"),e(7,"Profile"),a(),e(8,` 629 `),r(9,"div",3),e(10,` 630 `),r(11,"p"),e(12,"Club Profile is where you can set up all of your club's vital information. "),a(),e(13,` 631 632 `),r(14,"p"),e(15,"Here you can find settings such as: "),r(16,"strong"),e(17,"Club Name"),a(),e(18,`, 633 `),r(19,"strong"),e(20,"Domain"),a(),e(21,", "),r(22,"strong"),e(23,"Sport Type"),a(),e(24,", "),r(25,"strong"),e(26,"Club Contact Information"),a(),e(27,`, 634 and `),r(28,"strong"),e(29,"Social Media"),a(),e(30,`. 635 `),a(),e(31,` 636 `),a(),e(32,` 637 `),r(33,"div",4),e(34,` 638 `),r(35,"a",5),e(36,"Edit Club Profile"),a(),e(37,` 639 `),a(),e(38,` 640`),a(),e(39,` 641 642`),f(40,qo,28,0),f(41,Ho,19,0),f(42,Qo,19,0),f(43,Xo,23,2),f(44,Ko,22,0),f(45,Zo,16,0),f(46,ea,16,0),f(47,ta,25,0),a()),t&2&&(c(2),d("pageTitle",(l.childClubName?l.childClubName+" - ":"")+"Club Settings"),c(38),h(l.clubID!=="new"&&l.userIsSuperAdmin?40:-1),c(),h(l.clubID!=="new"&&!l.userIsSuperAdmin&&l.userIsClubAdmin?41:-1),c(),h(l.clubID!=="new"&&l.userIsSuperAdmin?42:-1),c(),h(l.clubID!=="new"?43:-1),c(),h(l.clubID!=="new"?44:-1),c(),h(l.clubID!=="new"&&l.acctClassesOptionEnabled?45:-1),c(),h(l.clubID!=="new"&&l.surchargesOptionEnabled?46:-1),c(),h(l.clubID!=="new"?47:-1))},dependencies:[ie,_e,N],styles:[".border-top-lg[_ngcontent-%COMP%]{max-width:800px}"]});let n=s;return n})();var ia=n=>[n];function na(n,s){if(n&1&&(e(0,` 643 `),r(1,"tr"),e(2,` 644 `),r(3,"th",7),e(4,` 645 Name 646 `),p(5,"p-sortIcon",8),e(6,` 647 `),a(),e(7,` 648 `),a(),e(8,` 649 `)),n&2){let o=m(2);c(3),ee("aria-label",o.AriaLabels.ACTIVATE_SORT)}}function oa(n,s){if(n&1&&(e(0,` 650 `),r(1,"tr"),e(2,` 651 `),r(3,"td",9)(4,"a",10),e(5),a()(),e(6,` 652 `),a(),e(7,` 653 `)),n&2){let o=s.$implicit;c(4),d("routerLink",Se(2,ia,o.clubRoleTemplateID)),c(),O(o.name)}}function aa(n,s){if(n&1&&(e(0,` 654 `),r(1,"p-table",4),e(2,` 655 `),E(3,na,9,1,"ng-template",5),e(4,` 656 `),E(5,oa,8,4,"ng-template",6),e(6,` 657 `),a(),e(7,` 658 `)),n&2){let o=m();c(),d("value",o.searchResults)}}var an=(()=>{let s=class s{constructor(i,t){this.clubService=i,this.siteDataService=t,this.AriaLabels=fe}ngOnInit(){this.clubService.getClubRoleTemplates().subscribe({next:i=>{this.searchResults=i,this.siteDataService.hideSiteLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:11,vars:1,consts:[["role","main"],["pageTitle","Role Templates","primaryBtnText","Add Template","primaryBtnUrl","./new"],[1,""],[1,"table-responsive"],["sortField","name",1,"table","table-striped","table-sm",3,"value"],["pTemplate","header"],["pTemplate","body"],["pSortableColumn","name",1,"align-left"],["field","name"],[1,"align-left"],[3,"routerLink"]],template:function(t,l){t&1&&(r(0,"main",0),e(1,` 659 `),p(2,"app-admin-header",1),e(3,`
660 `),r(4,"section",2),e(5,` 661 `),r(6,"div",3),e(7,` 662 `),f(8,aa,8,1),a(),e(9,` 663 `),a(),e(10,` 664`),a()),t&2&&(c(8),h(l.searchResults?8:-1))},dependencies:[ie,ne,N,se,Ce,xe],encapsulation:2});let n=s;return n})();function ra(n,s){n&1&&(e(0,` 665 `),r(1,"th"),e(2,"Club ID"),a(),e(3,` 666 `))}function la(n,s){if(n&1&&(e(0,` 667 `),r(1,"th",17),e(2),p(3,"p-sortIcon",18),e(4,` 668 `),a(),e(5,` 669 `)),n&2){let o=s.$implicit,i=m(3);c(),d("pSortableColumn",o.field),ee("aria-label",i.AriaLabels.ACTIVATE_SORT),c(),V(` 670 `,o.header,` 671 `),c(),d("field",o.field)}}function sa(n,s){if(n&1&&(e(0,` 672 `),r(1,"tr"),e(2,` 673 `),f(3,ra,4,0),I(4,la,6,4,null,null,F),p(6,"th"),e(7,` 674 `),a(),e(8,` 675 `)),n&2){let o=m(2);c(3),h(o.userIsSuperAdmin?3:-1),c(),P(o.clubService.columns)}}function ca(n,s){if(n&1&&(e(0,` 676 `),r(1,"td"),e(2),a(),e(3,` 677 `)),n&2){let o=m().$implicit;c(2),O(o.clubID)}}function ma(n,s){if(n&1){let o=v();e(0,` 678 `),r(1,"tr"),e(2,` 679 `),f(3,ca,4,1),r(4,"td"),e(5),a(),e(6,` 680 `),r(7,"td"),e(8),a(),e(9,` 681 `),r(10,"td")(11,"button",19),S("click",function(){let t=x(o).$implicit,l=m(2);return b(l.goToClub(t.subdomain))}),e(12,"Switch"),a(),e(13,` 682 `),a(),e(14,` 683 `),a(),e(15,` 684 `)}if(n&2){let o=s.$implicit,i=m(2);c(3),h(i.userIsSuperAdmin?3:-1),c(2),O(o.clubName),c(3),O(o.subdomain)}}function da(n,s){if(n&1){let o=v();e(0,` 685 `),r(1,"p-table",14),S("onLazyLoad",function(t){x(o);let l=m();return b(l.search(t))}),e(2,` 686 `),E(3,sa,9,1,"ng-template",15),e(4,` 687 `),E(5,ma,16,3,"ng-template",16),e(6,` 688 `),a(),e(7,` 689 `)}if(n&2){let o=m();c(),d("columns",o.clubService.columns)("value",o.searchResults)("lazy",!0)("paginator",!0)("alwaysShowPaginator",!1)("totalRecords",o.totalRecords)("rows",100)("loading",o.loading)}}var rn=(()=>{let s=class s{constructor(i,t,l){this.clubService=i,this.authorizeService=t,this.siteDataService=l,this.AriaLabels=fe,this.totalRecords=0,this.loading=!0,this.showTable=!1,this.userIsSuperAdmin=!1}ngOnInit(){this.clubService.filters&&this.clubService.filters.page?this.showTable=!0:(this.clubService.filters=new qe,this.run()),this.authorizeService.getUser().pipe(We(1)).subscribe({next:i=>{i&&this.authorizeService.isSuperAdmin(i.role)&&(this.userIsSuperAdmin=!0)}}),this.siteDataService.hideSiteLoader()}run(){this.clubService.filters.page=1,this.totalRecords=0,this.showTable?this.search():this.showTable=!0}goToClub(i){this.authorizeService.removeUser(),window.location.href=window.location.origin.replace(/(\/\/)([\w\d-])*\./i,`//${i}.`)+"/admin/dashboard"}search(i=null){let t=this.clubService.filters;i&&i.sortField&&(t.orderBy=i.sortField+" "+(i.sortOrder===1?"ASC":"DESC"),t.page=i.first/t.rows+1),t.getTotalCount=this.totalRecords===0,this.loading=!0,this.clubService.getRoles().subscribe(l=>{this.searchResults=l.results,t.getTotalCount&&(this.totalRecords=l.count),this.loading=!1},()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")})}resetFilters(){this.clubService.filters=new qe(this.clubService.filters.orderBy)}};s.\u0275fac=function(t){return new(t||s)(C(W),C(he),C(D))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:39,vars:3,consts:[["role","main",3,"keydown.enter"],["pageTitle","Switch Clubs"],[3,"adminFilterReset","adminFilterSearch"],["primary",""],[1,"col","pr-0"],[1,"p-input-icon-left","full-width"],[1,"fa","fa-magnifying-glass"],["type","text","id","search","pInputText","","placeholder","Search",1,"full-width","pl-4",3,"ngModelChange","ngModel"],["for","search",1,"sr-only"],[1,"sr-only"],["type","text","placeholder","Subdomain",1,"full-width",3,"ngModelChange","ngModel"],["advanced",""],[1,"card"],[1,"table-responsive"],["sortField","lastName",1,"table","table-striped","table-sm",3,"onLazyLoad","columns","value","lazy","paginator","alwaysShowPaginator","totalRecords","rows","loading"],["pTemplate","header"],["pTemplate","body"],[3,"pSortableColumn"],[3,"field"],[1,"btn","btn-sm","btn-primary",3,"click"]],template:function(t,l){t&1&&(r(0,"main",0),S("keydown.enter",function(){return l.run()}),e(1,` 690 `),p(2,"app-admin-header",1),e(3,` 691 `),r(4,"app-admin-filter",2),S("adminFilterReset",function(){return l.resetFilters()})("adminFilterSearch",function(){return l.run()}),e(5,` 692 `),L(6,3),e(7,` 693 `),r(8,"div",4),e(9,` 694 `),r(10,"span",5),e(11,` 695 `),p(12,"i",6),e(13,` 696 `),r(14,"input",7),Y("ngModelChange",function(_){return z(l.clubService.filters.clubName,_)||(l.clubService.filters.clubName=_),_}),a(),e(15,` 697 `),p(16,"label",8),e(17,` 698 `),a(),e(18,` 699 `),a(),e(19,` 700 `),r(20,"div",4),e(21,` 701 702 `),r(22,"label",9),e(23,"Subdomain"),a(),e(24,` 703 `),r(25,"input",10),Y("ngModelChange",function(_){return z(l.clubService.filters.subdomain,_)||(l.clubService.filters.subdomain=_),_}),a(),e(26,` 704 `),a(),e(27,` 705 `),B(),e(28,` 706 `),st(29,11),e(30,` 707 `),a(),e(31,` 708 `),r(32,"section",12),e(33,` 709 `),r(34,"div",13),e(35,` 710 `),f(36,da,8,8),a(),e(37,` 711`),a(),e(38,` 712`),a()),t&2&&(c(14),j("ngModel",l.clubService.filters.clubName),c(11),j("ngModel",l.clubService.filters.subdomain),c(11),h(l.showTable?36:-1))},dependencies:[Ke,ge,ye,ne,N,it,se,Ce,xe],encapsulation:2});let n=s;return n})();var ua=["form"];function pa(n,s){if(n&1){let o=v();e(0,` 713 `),r(1,"tr"),e(2,` 714 `),r(3,"td"),e(4,` 715 `),p(5,"p-treeTableToggler",15),e(6,` 716 `),r(7,"p-checkbox",16),S("onChange",function(t){let l=x(o).rowData,u=m(4);return b(u.setPermission(t.checked,l.permissionID,l.parentPermissionID))}),e(8,` 717 `),a(),r(9,"label",17),e(10),a(),e(11,` 718 `),a(),e(12,` 719 `),e(13,` 720 `),a(),e(14,` 721 `)}if(n&2){let o=s.$implicit,i=s.rowData,t=m(4);c(5),d("rowNode",o),c(2),d("inputId","permission-"+i.permissionID)("ngModel",t.clubRoleTemplate.permissions.includes(i.permissionID)),c(2),d("for","permission-"+i.permissionID),c(),O(i.description)}}function fa(n,s){if(n&1&&(e(0,` 722 `),r(1,"div",12),e(2,` 723 `),r(3,"h3"),e(4),a(),e(5,` 724 `),r(6,"p-treeTable",13),e(7,` 725 `),E(8,pa,15,5,"ng-template",14),e(9,` 726 `),a(),e(10,` 727 `),a(),e(11,` 728 `)),n&2){let o=s.$implicit;c(4),V("",o[0].data.description," Permissions"),c(2),d("value",o)}}function ha(n,s){if(n&1&&(e(0,` 729 `),r(1,"div",11),e(2,` 730 `),I(3,fa,12,2,null,null,F),a(),e(5,` 731 `)),n&2){let o=m(2);c(3),P(o.permissionTreeNodes)}}function _a(n,s){if(n&1){let o=v();e(0,` 732 `),r(1,"app-dynamic-form",4,0),S("onCancel",function(){x(o);let t=m();return b(t.cancel())})("onSubmit",function(t){x(o);let l=m();
732return b(l.save(t,!1))})("onSaveAndAdd",function(t){x(o);let l=m();return b(l.save(t,!0))})("onDelete",function(){x(o);let t=m();return b(t.delete())}),e(3,` 733 `),p(4,"app-dynamic-form-field",5),e(5,` 734 `),r(6,"app-dynamic-form-field",6),S("onChange",function(t){x(o);let l=m();return b(l.updatePermissions(t.value))}),a(),e(7,` 735 `),f(8,ha,6,0),r(9,"div",7),e(10,` 736 `),r(11,"div",8),e(12,` 737 `),r(13,"div",9),e(14,` 738 `),r(15,"app-inline-alert",10),e(16,` 739 At least one dashboard must be selected 740 `),a(),e(17,` 741 `),a(),e(18,` 742 `),a(),e(19,` 743 `),a(),e(20,` 744 `),a(),e(21,` 745 `)}if(n&2){let o=Le(2),i=m();c(),d("fields",i.fields)("entity",i.clubRoleTemplate)("horizontalForm",!0)("contentFieldsMode",!0)("showSaveAndAddButton",!0)("showDeleteButton",i.clubRoleTemplateID!=="new"),c(7),h((o==null||o.value.roles==null?null:o.value.roles.length)>0?8:-1),c(5),d("ngClass",i.showDashboardError?"d-inline-block":"d-none"),c(2),d("isInline",!0)}}var ln=(()=>{let s=class s{constructor(i,t,l,u,_){this.siteDataService=i,this.route=t,this.router=l,this.formService=u,this.clubService=_,this.showDashboardError=!1,this.showErrors=!1}ngOnInit(){this.route.params.subscribe(i=>{this.clubRoleTemplateID=i.id,A({template:this.clubRoleTemplateID!=="new"?this.clubService.getClubRoleTemplate(+this.clubRoleTemplateID):Z(null),permissions:this.clubService.getPermissions(),metadata:this.clubService.getClubRoleTemplateMetadata()}).subscribe({next:t=>{this.fields=t.metadata.fields,this.permissionDefs=t.permissions,t.template?this.clubRoleTemplate=t.template:this.clubRoleTemplate=new dt,this.buildPermissionsTree(),this.siteDataService.hideSiteLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting role template.")}})})}save(i,t){this.clubRoleTemplate.permissions.length>0&&!this.clubRoleTemplate.permissions.includes(K.AdminDashboard)&&!this.clubRoleTemplate.permissions.includes(K.TeamDashboard)?this.showDashboardError=!0:(this.showDashboardError=!1,this.clubRoleTemplate.name=i.name,this.clubRoleTemplate.roles=i.roles,this.clubService.saveClubRoleTemplate(this.clubRoleTemplate).subscribe({next:l=>{t?(this.clubRoleTemplateID=void 0,this.clubRoleTemplate=new dt,this.router.navigate(["../new"],{relativeTo:this.route})):l&&(this.clubRoleTemplateID=l.toString(),this.router.navigate(["..",this.clubRoleTemplateID],{relativeTo:this.route})),this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Role template information saved successfully")},error:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving role template.")}}))}updatePermissions(i){if(i.length===0)this.clubRoleTemplate.permissions=[];else{let t=this.permissionDefs.filter(l=>l.roles.some(u=>i.includes(u))).map(l=>l.permissionID);this.clubRoleTemplate.permissions=t}this.showDashboardError=!1}buildPermissionsTree(){this.permissionTreeNodes=this.permissionDefs.filter(i=>i.parentPermissionID===null).map(i=>[{data:i,children:[],expanded:!0}]),this.permissionDefs.filter(i=>i.parentPermissionID!==null).forEach(i=>{this.permissionTreeNodes.forEach((t,l)=>{t[0].data.permissionID===i.parentPermissionID&&this.permissionTreeNodes[l][0].children.push({data:i})})})}setPermission(i,t,l){if(i)this.clubRoleTemplate.permissions.push(t),l&&!this.clubRoleTemplate.permissions.includes(l)&&(this.clubRoleTemplate.permissions.push(l),l===K.UserAdmin&&!this.clubRoleTemplate.permissions.includes(K.UserProfile)?this.clubRoleTemplate.permissions.push(K.UserProfile):l===K.PlayerAdmin&&!this.clubRoleTemplate.permissions.includes(K.UserProfile)&&this.clubRoleTemplate.permissions.push(K.UserProfile)),this.permissionDefs.filter(_=>_.parentPermissionID===t).map(_=>_.permissionID).forEach(_=>{this.clubRoleTemplate.permissions.includes(_)||this.clubRoleTemplate.permissions.push(_)}),this.showDashboardError=!1;else{this.clubRoleTemplate.permissions=this.clubRoleTemplate.permissions.filter(_=>_!==t);let u=this.permissionDefs.filter(_=>_.parentPermissionID===t).map(_=>_.permissionID);if(u.length>0&&(this.clubRoleTemplate.permissions=this.clubRoleTemplate.permissions.filter(_=>!u.includes(_))),l){let _=this.permissionDefs.filter(g=>g.parentPermissionID===l).map(g=>g.permissionID);(t===K.UserProfile||t===K.UserProfile)&&(this.clubRoleTemplate.permissions=this.clubRoleTemplate.permissions.filter(g=>!_.includes(g))),_.length>0&&!this.clubRoleTemplate.permissions.some(g=>_.includes(g))&&(this.clubRoleTemplate.permissions=this.clubRoleTemplate.permissions.filter(g=>g!==l))}}}delete(){this.clubService.deleteClubRoleTemplate(+this.clubRoleTemplateID).subscribe({next:()=>{this.router.navigate([".."],{relativeTo:this.route}),this.siteDataService.showSiteSuccessAlert("Role template was deleted successfully")},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem deleting role template.")}})}cancel(){this.router.navigate([".."],{relativeTo:this.route})}};s.\u0275fac=function(t){return new(t||s)(C(D),C(T),C(q),C($),C(W))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],viewQuery:function(t,l){if(t&1&&pe(ua,5),t&2){let u;oe(u=ae())&&(l.form=u.first)}},standalone:!1,decls:8,vars:3,consts:[["form",""],["role","main"],["parentLinkUrl","../","parentLinkText","Role Templates",3,"pageTitle","showBackButton"],[1,""],["buttonsPosition","left",3,"onCancel","onSubmit","onSaveAndAdd","onDelete","fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","showDeleteButton"],["fieldName","name"],["fieldName","roles",3,"onChange"],[1,"form-action"],["appStickyFormButtons",""],[1,"",3,"ngClass"],["alertType","error",3,"isInline"],[1,"role-template-roles-columns"],[1,"card","roles-tree-group"],[3,"value"],["pTemplate","body"],[3,"rowNode"],["binary","true",3,"onChange","inputId","ngModel"],[1,"ml-2",3,"for"]],template:function(t,l){t&1&&(r(0,"main",1),e(1,` 746 `),p(2,"app-admin-header",2),e(3,`
747 `),r(4,"section",3),e(5,` 748 `),f(6,_a,22,9),a(),e(7,` 749`),a()),t&2&&(c(2),d("pageTitle",l.clubRoleTemplateID==="new"?"New Role Template":"Edit Role Template")("showBackButton",!0),c(4),h(l.fields?6:-1))},dependencies:[bt,w,k,ge,ye,ne,_e,N,Pt,Pi,ji,zi],styles:[".role-template-roles-columns[_ngcontent-%COMP%] label{flex-basis:100%;max-width:100%}"]});let n=s;return n})();var Bt=class{};var ba=["optionsMenu"],Sa=["createAccountForm"],va=()=>({width:"auto"}),ga=(n,s)=>({"col-md-12":n,"col-md-6":s});function ya(n,s){n&1&&(e(0,` 750 `),r(1,"div",12),e(2,` 751 `),r(3,"app-inline-alert",13),e(4,` 752 `),r(5,"span",14),e(6,` 753 You do not have an active default account specified. If not specified, the system will default to the 754 first connected account it can find, ie the first one created. 755 `),a(),e(7,` 756 `),a(),e(8,` 757 `),a(),e(9,` 758 `)),n&2&&(c(3),d("isInline",!1))}function Da(n,s){if(n&1&&(e(0,` 759 `),r(1,"th",16),e(2),p(3,"p-sortIcon",17),e(4,` 760 `),a(),e(5,` 761 `)),n&2){let o=s.$implicit,i=m(3);c(),d("pSortableColumn",o.field),ee("aria-label",i.AriaLabels.ACTIVATE_SORT),c(),V(` 762 `,o.header,` 763 `),c(),d("field",o.field)}}function Aa(n,s){if(n&1&&(e(0,` 764 `),r(1,"tr"),e(2,` 765 `),p(3,"th",15),e(4,` 766 `),I(5,Da,6,4,null,null,F),r(7,"th"),e(8,"Account Status"),a(),e(9,` 767 `),r(10,"th"),e(11,"Payouts"),a(),e(12,` 768 `),p(13,"th"),e(14,` 769 `),a(),e(15,` 770 `)),n&2){let o=m(2);c(5),P(o.columns)}}function Ta(n,s){if(n&1){let o=v();e(0,` 771 `),r(1,"label",22),e(2,` 772 `),r(3,"span",21),e(4,"Default account"),a(),e(5,` 773 `),r(6,"span",23),e(7,` 774 `),p(8,"i",24),e(9,` 775 `),a(),e(10,` 776 `),r(11,"input",25),S("click",function(){x(o);let t=m().$implicit,l=m(2);return b(l.defaultClick(t.clubStripeConnectedAccount))}),a(),e(12,` 777 `),a(),e(13,` 778 `)}if(n&2){let o=m(),i=o.$implicit,t=o.rowIndex,l=m(2);c(),d("title",i.clubStripeConnectedAccount.isDefault?"This is your default":"Set as default")("for","default-connected-account-"+t),c(7),le("far",!i.clubStripeConnectedAccount.isDefault)("fas",i.clubStripeConnectedAccount.isDefault),c(3),d("id","default-connected-account-"+t)("ngModel",i.clubStripeConnectedAccount.isDefault)("disabled",l.viewOnlyMode)}}function Ea(n,s){n&1&&(e(0,` 779 `),p(1,"i",26),e(2,` 780 `))}function wa(n,s){if(n&1){let o=v();e(0,` 781 `),r(1,"button",27),S("click",function(){x(o);let t=m().$implicit,l=m(2);return b(l.editConnectedAccount(t.clubStripeConnectedAccount))}),e(2),a(),e(3,` 782 `)}if(n&2){let o=m().$implicit;c(2),V(` 783 `,o.clubStripeConnectedAccount.name,` 784 `)}}function Fa(n,s){if(n&1&&(e(0,` 785 `),r(1,"span"),e(2),a(),e(3,` 786 `)),n&2){let o=m().$implicit;c(2),V(` 787 `,o.clubStripeConnectedAccount.name,` 788 `)}}function Ia(n,s){n&1&&(e(0,` 789 `),r(1,"td"),e(2,` 790 `),p(3,"app-status-indicator",28),e(4,` 791 `),a(),e(5,` 792 `),p(6,"td"),e(7,` 793 `)),n&2&&(c(3),d("dots",!0))}function Pa(n,s){n&1&&(e(0,` 794 `),p(1,"app-status-indicator",29),e(2,` 795 `)),n&2&&(c(),d("dots",!0))}function Oa(n,s){n&1&&(e(0,` 796 `),p(1,"app-status-indicator",30),e(2,` 797 `)),n&2&&(c(),d("dots",!0))}function Ma(n,s){n&1&&(e(0,` 798 `),p(1,"app-status-indicator",31),e(2,` 799 `)),n&2&&(c(),d("dots",!0))}function Va(n,s){n&1&&(e(0,` 800 `),p(1,"app-status-indicator",32),e(2,` 801 `)),n&2&&(c(),d("dots",!0))}function ka(n,s){if(n&1&&(e(0,` 802 `),f(1,Ma,3,1)(2,Va,3,1)),n&2){let o=m(3).$implicit;c(),h(!(o.stripeAccount==null||o.stripeAccount.future_requirements==null||o.stripeAccount.future_requirements.eventually_due==null)&&o.stripeAccount.future_requirements.eventually_due.length?1:2)}}function Na(n,s){if(n&1&&(e(0,` 803 `),f(1,Oa,3,1)(2,ka,3,1)),n&2){let o=m(2).$implicit;c(),h(!(o.stripeAccount==null||o.stripeAccount.future_requirements==null||o.stripeAccount.future_requirements.currently_due==null)&&o.stripeAccount.future_requirements.currently_due.length?1:2)}}function Ra(n,s){if(n&1&&(e(0,` 804 `),r(1,"span"),e(2,` 805 `),r(3,"strong"),e(4,"Daily"),a(),e(5),a(),e(6,` 806 `)),n&2){let o=m(3).$implicit;c(5),V(` - 807 `,o.stripeAccount.settings.payouts.schedule.delay_days,` day rolling 808 basis 809 `)}}function La(n,s){if(n&1&&(e(0,` 810 `),r(1,"span"),e(2,` 811 `),r(3,"strong"),e(4,"Weekly"),a(),e(5),Qe(6,"capitalize"),a(),e(7,` 812 `)),n&2){let o=m(3).$implicit;c(5),Wt(` - every 813 `,ct(6,2,o.stripeAccount.settings.payouts.schedule.weekly_anchor),`, 814 on a `,o.stripeAccount.settings.payouts.schedule.delay_days,` day rolling 815 basis 816 `)}}function Ba(n,s){if(n&1&&(e(0,` 817 `),r(1,"span"),e(2,` 818 `),r(3,"strong"),e(4,"Monthly"),a(),e(5),Qe(6,"shortOrdinal"),a(),e(7,` 819 `)),n&2){let o=m(3).$implicit;c(5),Wt(` - every 820 `,ct(6,2,o.stripeAccount.settings.payouts.schedule.monthly_anchor),` of 821 the month, on a `,o.stripeAccount.settings.payouts.schedule.delay_days,` 822 day rolling basis 823 `)}}function $a(n,s){n&1&&(e(0,` 824 `),r(1,"strong"),e(2,"Manual"),a(),e(3,` 825 `))}function Wa(n,s){if(n&1&&(e(0,` 826 `),f(1,Ra,7,1)(2,La,8,4)(3,Ba,8,4)(4,$a,4,0),e(5,` 827 `)),n&2){let o,i=m(2).$implicit;c(),h((o=i.stripeAccount.settings.payouts.schedule.interval)==="daily"?1:o==="weekly"?2:o==="monthly"?3:4)}}function Ua(n,s){if(n&1&&(e(0,` 828 `),r(1,"td"),e(2,` 829 `),f(3,Pa,3,1)(4,Na,3,1),a(),e(5,` 830 `),r(6,"td"),e(7,` 831 `),f(8,Wa,6,1),a(),e(9,` 832 `)),n&2){let o=m().$implicit;c(3),h(!(o.stripeAccount==null||o.stripeAccount.requirements==null)&&o.stripeAccount.requirements.disabled_reason?3:4),c(5),h(o.stripeAccount!=null&&o.stripeAccount.payouts_enabled&&(!(o.stripeAccount==null||o.stripeAccount.settings==null||o.stripeAccount.settings.payouts==null)&&o.stripeAccount.settings.payouts.schedule)?8:-1)}}function ja(n,s){n&1&&(e(0,` 833 `),p(1,"app-pill",33),e(2,` 834 `))}function za(n,s){n&1&&(e(0,` 835 `),p(1,"app-pill",34),e(2,` 836 `))}function Ya(n,s){n&1&&(e(0,` 837 `),p(1,"app-pill",35),e(2,` 838 `))}function qa(n,s){n&1&&(e(0,` 839 `),p(1,"app-pill",36),e(2,` 840 `))}function Ha(n,s){if(n&1){let o=v();e(0,` 841 `),r(1,"tr"),e(2,` 842 `),r(3,"td",15),e(4,` 843 `),f(5,Ta,14,9),f(6,Ea,3,0),a(),e(7,` 844 `),r(8,"td"),e(9,` 845 `),f(10,wa,4,1),f(11,Fa,4,1),a(),e(12,` 846 `),r(13,"td"),e(14),a(),e(15,` 847 `),r(16,"td"),e(17),a(),e(18,` 848 `),f(19,Ia,8,1)(20,Ua,10,2),r(21,"td"),e(22,` 849 `),r(23,"div",18),e(24,` 850 `),f(25,ja,3,0),f(26,za,3,0),f(27,Ya,3,0),f(28,qa,3,0),r(29,"button",19),S("click",function(t){let l=x(o).$implicit,u=m(2);return b(u.toggleOptionsMenu(l,t))}),e(30,` 851 `),p(31,"i",20),e(32,` 852 `),r(33,"div",21),e(34,"Options"),a(),e(35,` 853 `),a(),e(36,` 854 `),a(),e(37,` 855 `),a(),e(38,` 856 `),a(),e(39,` 857 `)}if(n&2){let o=s.$implicit,i=m(2);c(5),h(o.clubStripeConnectedAccount.accountTypeID!==i.ClubStripeConnectedAccountType.TEAM_ACCOUNT?5:-1),c(),h(o.clubStripeConnectedAccount.accountTypeID===i.ClubStripeConnectedAccountType.TEAM_ACCOUNT?6:-1),c(4),h(i.userIsSuperAdmin?10:-1),c(),h(i.userIsSuperAdmin?-1:11),c(3),V(` 858 `,o.clubStripeConnectedAccount.accountID,` 859 `),c(3),V(` 860 `,i.getAccountTypeLabel(o.clubStripeConnectedAccount.accountTypeID),` 861 `),c(2),h(!(o.stripeAccount==null||o.stripeAccount.requirements==null)&&o.stripeAccount.requirements.disabled_reason&&(!(o.stripeAccount==null||o.stripeAccount.requirements==null)&&o.stripeAccount.requirements.disabled_reason.includes("rejected"))?19:20),c(6),h(o.clubStripeConnectedAccount.isActive?25:-1),c(),h(o.clubStripeConnectedAccount.isActive?-1:26),c(),h(o.clubStripeConnectedAccount.isTestModeAccount?27:-1),c(),h(o.clubStripeConnectedAccount.isTestModeAccount?-1:28),c(),d("disabled",i.viewOnlyMode&&i.userIsSuperAdmin)}}function Qa(n,s){if(n&1&&(e(0,` 862 `),r(1,"tr"),e(2,` 863 `),r(3,"td",37),e(4,` 864 No Connected Accounts have been configured 865 `),a(),e(5,` 866 `),a(),e(6,` 867 `)),n&2){let o=s.$implicit;c(3),ee("colspan",o.length+1)}}function Ga(n,s){if(n&1){let o=v();e(0,` 868 `),r(1,"button",38),S("click",function(){x(o);let t=m(3);return b(t.openAddDialog())}),e(2,` 869 Add Connected Account 870 `),a(),e(3,` 871 `)}}function Ja(n,s){if(n&1&&(e(0,` 872 `),r(1,"div"),e(2,` 873 `),f(3,Ga,4,0),a(),e(4,` 874 `)),n&2){let o=m(2);c(3),h(o.viewOnlyMode?-1:3)}}function Xa(n,s){if(n&1&&(e(0,` 875 `),r(1,"section",5),e(2,` 876 `),r(3,"h2",6),e(4,"Connected Accounts"),a(),e(5,` 877 `),f(6,ya,10,1),r(7,"div",7),e(8,` 878 `),r(9,"p-table",8),e(10,` 879 `),E(11,Aa,16,0,"ng-template",9),e(12,` 880 `),E(13,Ha,40,12,"ng-template",10),e(14,`
881 `),E(15,Qa,7,1,"ng-template",11),e(16,` 882 `),a(),e(17,` 883 `),a(),e(18,` 884 `),f(19,Ja,5,1),a(),e(20,` 885`)),n&2){let o=m();c(6),h(o.hasDefaultAccount?-1:6),c(3),d("columns",o.columns)("value",o.searchResults),c(10),h(o.viewOnlyMode?-1:19)}}function Ka(n,s){if(n&1){let o=v();e(0,` 886 `),r(1,"app-yes-no-modal",39),S("onYesSelect",function(){x(o);let t=m();return b(t.saveConnectedAccountActive(!1))})("onNoSelect",function(){x(o);let t=m();return b(t.showConfirmDeactivate=!1)}),e(2,` 887 `),r(3,"div",40),e(4,` 888 `),r(5,"app-inline-alert",13),e(6,` 889 By deactivating this connected account, all assignments (program type, program, donation, invoice, etc) will 890 be updated or deleted to reflect this change. Any existing Club Fees using this connected account will no 891 longer be processed. This action cannot be undone. Are you sure you want to deactivate this connected 892 account? 893 `),a(),e(7,` 894 `),a(),e(8,` 895 `),a(),e(9,` 896`)}n&2&&(c(),d("showModalText",!1),c(4),d("isInline",!0))}function Za(n,s){if(n&1&&(e(0,` 897 `),r(1,"app-inline-alert",43),e(2,` 898 `),r(3,"div"),e(4,` 899 `),r(5,"div",44),e(6,` 900 Please see the following text from: `),r(7,"a",45),e(8,"https://docs.stripe.com/api/accounts/delete"),a(),e(9,` 901 `),a(),e(10,` 902 `),r(11,"div",46),e(12,` 903 Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, 904 which includes Standard accounts. Live-mode accounts where your platform is liable for negative 905 account balances, which includes `),r(13,"strong"),e(14,"Custom"),a(),e(15,` and Express accounts, can be deleted when 906 all balances are zero. 907 `),a(),e(16,` 908 `),a(),e(17,` 909 `),a(),e(18,` 910 `)),n&2){let o=m(2);c(),d("isInline",!1)("alertType",o.cannotDelete?"error":"note")}}function er(n,s){if(n&1){let o=v();e(0,` 911 `),r(1,"app-yes-no-modal",41),S("onYesSelect",function(){x(o);let t=m();return b(t.deleteConnectedAccount())})("onNoSelect",function(){x(o);let t=m();return b(t.closeDeleteConfirm())}),e(2,` 912 `),r(3,"div",42),e(4,` 913 `),f(5,Za,19,2),a(),e(6,` 914 `),r(7,"div",40),e(8,` 915 `),r(9,"app-inline-alert",13),e(10,` 916 By deleting this connected account, all assignments (program type, program, donation, invoice, etc) will 917 be updated or deleted to reflect this change. Any existing Club Fees using this connected account will no 918 longer be processed. This action cannot be undone. Are you sure you want to delete this connected account? 919 Please note: if the account cannot be deleted in Stripe, it will not be deleted from Sprocket. 920 `),a(),e(11,` 921 `),a(),e(12,` 922`),a(),e(13,` 923`)}if(n&2){let o=m();c(),d("showModalText",!1)("loading",o.deletingConnectedAccount),c(4),h(o.environment===o.Environment.PROD?5:-1),c(4),d("isInline",!0)}}function tr(n,s){if(n&1){let o=v();e(0,` 924 `),r(1,"div",47),e(2,` 925 `),r(3,"app-checkbox-row",48),Y("ngModelChange",function(t){x(o);let l=m();return z(l.addExistingStripeConnectedAccount,t)||(l.addExistingStripeConnectedAccount=t),b(t)}),e(4,` 926 `),a(),e(5,` 927 `),r(6,"app-checkbox-row",49),Y("ngModelChange",function(t){x(o);let l=m();return z(l.addExistingStripeConnectedAccount,t)||(l.addExistingStripeConnectedAccount=t),b(t)}),e(7,` 928 `),a(),e(8,` 929 `),a(),e(9,` 930 `)}if(n&2){let o=m();c(3),d("optionValue",o.AddConnectedAccountOption.NEW),j("ngModel",o.addExistingStripeConnectedAccount),c(3),d("optionValue",o.AddConnectedAccountOption.EXISTING),j("ngModel",o.addExistingStripeConnectedAccount)}}function ir(n,s){if(n&1){let o=v();e(0,` 931 `),r(1,"div",47),e(2,` 932 `),r(3,"h3",50),e(4,"Select Account Type"),a(),e(5,` 933 `),r(6,"app-checkbox-row",51),Y("ngModelChange",function(t){x(o);let l=m();return z(l.connectedAccount.accountTypeID,t)||(l.connectedAccount.accountTypeID=t),b(t)}),e(7,` 934 `),a(),e(8,` 935 `),r(9,"app-checkbox-row",52),Y("ngModelChange",function(t){x(o);let l=m();return z(l.connectedAccount.accountTypeID,t)||(l.connectedAccount.accountTypeID=t),b(t)}),e(10,` 936 `),a(),e(11,` 937 `),a(),e(12,` 938 `)}if(n&2){let o=m();c(6),d("optionValue",o.ClubStripeConnectedAccountType.CLUB_ACCOUNT),j("ngModel",o.connectedAccount.accountTypeID),c(3),d("verticalPadding",!!o.hasActiveTeamAccount)("optionValue",o.ClubStripeConnectedAccountType.TEAM_ACCOUNT),j("ngModel",o.connectedAccount.accountTypeID),d("disabled",o.hasActiveTeamAccount)("description",o.hasActiveTeamAccount?"(An active team account already exists)":null)("boldLabel",!1)}}
938function nr(n,s){if(n&1&&(e(0,` 939 `),r(1,"app-dynamic-form",53,1),e(3,` 940 `),p(4,"app-dynamic-form-field",54),e(5,` 941 `),p(6,"app-dynamic-form-field",55),e(7,` 942 `),a(),e(8,` 943 `)),n&2){let o=m(2);c(),d("fields",o.fields)("entity",o.connectedAccount)("horizontalForm",!0)("showSubmitButton",!o.viewOnlyMode)("showDeleteButton",!1)("showSubmitButton",!1)("contentFieldsMode",!0)("showCancelButton",!1)}}function or(n,s){n&1&&(e(0,` 944 `),p(1,"app-skeleton-template",56),e(2,` 945 `),p(3,"app-skeleton-template",56),e(4,` 946 `))}function ar(n,s){if(n&1&&(e(0,` 947 `),f(1,nr,9,8),f(2,or,5,0)),n&2){let o=m();c(),h(o.fields&&o.connectedAccount&&!o.loadingConnectedAccount?1:-1),c(),h(o.loadingConnectedAccount?2:-1)}}function rr(n,s){if(n&1){let o=v();e(0,` 948 `),r(1,"button",61),S("click",function(){x(o);let t=m(2);return b(t.accountTypeSelectionMade=!1)}),e(2,` 949 Previous 950 `),a(),e(3,` 951 `)}if(n&2){let o=m(2);c(),le("btn-disabled",o.savingConnectedAccount||o.loadingConnectedAccount||o.loading),d("disabled",o.savingConnectedAccount||o.loadingConnectedAccount||o.loading)}}function lr(n,s){if(n&1){let o=v();e(0,` 952 `),r(1,"button",61),S("click",function(){x(o);let t=m(2);return t.addConnectedAccountOptionSelected=!1,b(t.accountTypeSelectionMade=!0)}),e(2,` 953 Previous 954 `),a(),e(3,` 955 `)}if(n&2){let o=m(2);c(),le("btn-disabled",o.savingConnectedAccount||o.loadingConnectedAccount||o.loading),d("disabled",o.savingConnectedAccount||o.loadingConnectedAccount||o.loading)}}function sr(n,s){if(n&1){let o=v();e(0,` 956 `),r(1,"button",61),S("click",function(){x(o);let t=m(2);return t.addConnectedAccountOptionSelected=!1,b(t.accountTypeSelectionMade=!1)}),e(2,` 957 Previous 958 `),a(),e(3,` 959 `)}if(n&2){let o=m(2);c(),le("btn-disabled",o.savingConnectedAccount||o.loadingConnectedAccount||o.loading),d("disabled",o.savingConnectedAccount||o.loadingConnectedAccount||o.loading)}}function cr(n,s){n&1&&(e(0,` 960 `),p(1,"app-button-loader"),e(2,` 961 Saving... 962 `))}function mr(n,s){if(n&1&&e(0),n&2){let o=m(2);V(` 963 `,o.addConnectedAccountOptionSelected?"Save":"Next",` 964 `)}}
964function dr(n,s){if(n&1){let o=v();e(0,` 965 `),r(1,"app-dialog-footer"),e(2,` 966 `),L(3,57),e(4,` 967 `),r(5,"button",58),S("click",function(){x(o);let t=m();return b(t.cancelAdd())}),e(6,` 968 Cancel 969 `),a(),e(7,` 970 `),B(),e(8,` 971 `),L(9,59),e(10,` 972 `),e(11,` 973 `),f(12,rr,4,3),f(13,lr,4,3),f(14,sr,4,3),r(15,"button",60),S("click",function(){x(o);let t=m();return b(t.addConnectedAccountOptionSelected?t.createConnectedAccount():t.accountTypeSelectionMade?t.proceedWithAccountType():t.loadCreateAccountForm())}),e(16,` 974 `),f(17,cr,3,0),f(18,mr,1,1),a(),e(19,` 975 `),B(),e(20,` 976 `),a(),e(21,` 977 `)}if(n&2){let o=m();c(5),le("btn-disabled",o.savingConnectedAccount||o.loadingConnectedAccount||o.loading),d("disabled",o.savingConnectedAccount||o.loadingConnectedAccount||o.loading),c(7),h(o.accountTypeSelectionMade&&!o.addConnectedAccountOptionSelected?12:-1),c(),h(o.addConnectedAccountOptionSelected&&o.teamAccountsEnabled&&o.addExistingStripeConnectedAccount===o.AddConnectedAccountOption.NEW?13:-1),c(),h(o.addConnectedAccountOptionSelected&&(!o.teamAccountsEnabled||o.addExistingStripeConnectedAccount===o.AddConnectedAccountOption.EXISTING)?14:-1),c(),le("btn-icon-chevron-right-after",!o.addConnectedAccountOptionSelected)("btn-disabled",o.accountTypeSelectionMade&&!(o.connectedAccount!=null&&o.connectedAccount.accountTypeID)||o.savingConnectedAccount||o.loadingConnectedAccount||o.loading),d("disabled",o.accountTypeSelectionMade&&!(o.connectedAccount!=null&&o.connectedAccount.accountTypeID)||o.savingConnectedAccount||o.loadingConnectedAccount||o.loading),c(2),h(o.savingConnectedAccount?17:-1),c(),h(o.savingConnectedAccount?-1:18)}}function ur(n,s){if(n&1){let o=v();e(0,` 978 `),r(1,"app-dynamic-form",62),S("onSubmit",function(t){x(o);let l=m();return b(l.saveConnectedAccount(t))})("onCancel",function(){x(o);let t=m();return b(t.showEditConnectedAccount=!1)}),e(2,` 979 `),p(3,"app-dynamic-form-field",54),e(4,` 980 `),p(5,"app-dynamic-form-field",55),e(6,` 981 `),a(),e(7,` 982 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.connectedAccount)("horizontalForm",!0)("showSubmitButton",!o.viewOnlyMode)("showDeleteButton",!1)("contentFieldsMode",!0)}}function pr(n,s){n&1&&(e(0,` 983 `),p(1,"app-skeleton-template",56),e(2,` 984 `),p(3,"app-skeleton-template",56),e(4,` 985 `))}function fr(n,s){if(n&1){let o=v();e(0,` 986 `),r(1,"app-dynamic-form",62),S("onSubmit",function(t){x(o);let l=m();return b(l.savePayoutSchedule(t))})("onCancel",function(){x(o);let t=m();return b(t.showEditConnectedAccountPayoutSchedule=!1)}),e(2,` 987 `),r(3,"div",63),e(4,` 988 `),r(5,"div",64),e(6,` 989 `),r(7,"app-dynamic-form-field",65),S("onChange",function(t){x(o);let l=m();return b(l.payoutIntervalChange(t))}),a(),e(8,` 990 `),a(),e(9,` 991 `),r(10,"div",66),e(11,` 992 `),p(12,"app-dynamic-form-field",67),e(13,` 993 `),p(14,"app-dynamic-form-field",68),e(15,` 994 `),a(),e(16,` 995 `),a(),e(17,` 996 `),r(18,"div",63),e(19,` 997 `),r(20,"div",69),e(21,` 998 `),p(22,"app-dynamic-form-field",70),e(23,` 999 `),a(),e(24,` 1000 `),a(),e(25,` 1001 `),a(),e(26,` 1002 `)}if(n&2){let o=m();c(),d("fields",o.payoutScheduleFields)("entity",o.payoutSchedule)("horizontalForm",!1)("showSubmitButton",!o.viewOnlyMode)("showDeleteButton",!1)("contentFieldsMode",!0),c(4),d("ngClass",xt(8,ga,o.selectedPayoutInterval==="daily",o.selectedPayoutInterval!=="daily")),c(5),d("hidden",o.selectedPayoutInterval==="daily")}}function hr(n,s){n&1&&(e(0,` 1003 `),p(1,"app-skeleton-template",56),e(2,` 1004 `),p(3,"app-skeleton-template",56),e(4,` 1005 `))}var ut=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubService=i,this.siteDataService=t,this.authorizeService=l,this.route=u,this.formService=_,this.viewOnlyMode=!1,this.AriaLabels=fe,this.loading=!0,this.userIsSuperAdmin=!1,this.hasDefaultAccount=!1,this.ClubStripeConnectedAccountType=we,this.teamAccountsEnabled=!1,this.hasActiveTeamAccount=!1,this.columns=[{field:"clubStripeConnectedAccount.name",header:"Account Name"},{field:"clubStripeConnectedAccount.accountID",header:"Stripe Account ID"},{field:"clubStripeConnectedAccount.accountTypeID",header:"Account Type"}],this.options=[],this.showConfirmDeactivate=!1,this.showConfirmDelete=!1,this.cannotDelete=!1,this.showAddConnectedAccount=!1,this.showEditConnectedAccount=!1,this.showEditConnectedAccountPayoutSchedule=!1,this.addExistingStripeConnectedAccount=He.NEW,this.AddConnectedAccountOption=He,this.addConnectedAccountOptionSelected=!1,this.savingConnectedAccount=!1,this.deletingConnectedAccount=!1,this.loadingConnectedAccount=!1,this.accountTypeSelectionMade=!1,this.Environment=wi,this.unsubscribe$=new ue}
1005ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.authorizeService.getUser().pipe(We(1)).subscribe({next:i=>{i&&this.authorizeService.isSuperAdmin(i.role)&&(this.userIsSuperAdmin=!0)}}),A({connectedAccounts:this.clubService.getClubConnectedAccounts(this.clubID),environment:this.siteDataService.getEnvironment(),clubOptions:this.siteDataService.getClubOptions([De.ENABLE_TEAM_ACCOUNTS])}).subscribe({next:i=>{this.searchResults=i.connectedAccounts,this.hasDefaultAccount=this.searchResults?.some(t=>t.clubStripeConnectedAccount.isDefault&&t.clubStripeConnectedAccount.isActive),this.hasActiveTeamAccount=this.searchResults?.some(t=>t.clubStripeConnectedAccount.accountTypeID===we.TEAM_ACCOUNT),this.environment=i.environment,this.teamAccountsEnabled=i.clubOptions?.some(t=>t.optionID===De.ENABLE_TEAM_ACCOUNTS&&t.boolValue),this.siteDataService.hideSiteLoader(),this.loading=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}defaultClick(i){if(!this.viewOnlyMode){let t=i.isDefault;this.clubService.saveConnectedAccountDefault(this.clubID,i.clubStripeConnectedAccountID,!t).pipe(J(this.unsubscribe$)).subscribe({next:()=>{this.updateDefault(t,i),i.isDefault?this.siteDataService.showSiteSuccessAlert(i.name+" set as default account"):this.siteDataService.showSiteSuccessAlert(i.name+" removed as default account"),this.hasDefaultAccount=this.searchResults?.some(l=>l.clubStripeConnectedAccount.isDefault&&l.clubStripeConnectedAccount.isActive),this.clubService.refreshAssignments.next()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem making this your default account")}})}}toggleOptionsMenu(i,t){this.selectedConnectedAccount=i;let l=[];l.push({label:"Onboard",icon:"fa fa-link",command:()=>{this.clubService.getConnectedAccountOnboardingLink(this.clubID,this.selectedConnectedAccount.clubStripeConnectedAccount.clubStripeConnectedAccountID).pipe(J(this.unsubscribe$)).subscribe({next:u=>{window.open(u,"_blank")},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}})}}),this.userIsSuperAdmin&&(this.selectedConnectedAccount.clubStripeConnectedAccount.accountTypeID!==we.TEAM_ACCOUNT&&l.push({label:"Edit Payout Schedule",icon:"fa fa-cog",command:()=>{this.editPayoutSchedule()}}),l.push({label:"View in Stripe",icon:"fa fa-arrow-up-right-from-square",command:()=>{this.selectedConnectedAccount.clubStripeConnectedAccount.isTestModeAccount?window.open(`https://dashboard.stripe.com/test/connect/accounts/${this.selectedConnectedAccount.clubStripeConnectedAccount.accountID}/`,"_blank"):window.open(`https://dashboard.stripe.com/connect/accounts/${this.selectedConnectedAccount.clubStripeConnectedAccount.accountID}/`,"_blank")}}),i.clubStripeConnectedAccount.isActive?l.push({label:"Deactivate",icon:"fa fa-ban",command:()=>{this.showConfirmDeactivate=!0}}):l.push({label:"Activate",icon:"fa fa-check",command:()=>{this.saveConnectedAccountActive(!0)}}),l.push({label:"Delete",icon:"fa fa-trash",command:()=>{this.showConfirmDelete=!0}})),this.options=[{label:"Options",items:l}],this.optionsMenu.toggle(t)}saveConnectedAccountActive(i){this.clubService.saveConnectedAccountActive(this.clubID,this.selectedConnectedAccount.clubStripeConnectedAccount.clubStripeConnectedAccountID,i).pipe(J(this.unsubscribe$)).subscribe({next:()=>{this.showConfirmDeactivate=!1,this.selectedConnectedAccount.clubStripeConnectedAccount.isActive=i,this.clubService.refreshAssignments.next(),this.siteDataService.showSiteSuccessAlert("Connected account updated")},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving the connected account")}})}cancelAdd(){this.addConnectedAccountOptionSelected=!1,this.accountTypeSelectionMade=!1,this.showAddConnectedAccount=!1,this.connectedAccount=new qt,this.connectedAccount.accountTypeID=we.CLUB_ACCOUNT}openAddDialog(){this.connectedAccount=new qt,this.connectedAccount.accountTypeID=we.CLUB_ACCOUNT,this.addConnectedAccountOptionSelected=!1,this.accountTypeSelectionMade=!1,this.showAddConnectedAccount=!0}
1005proceedWithAccountType(){if(!this.connectedAccount.accountTypeID){this.siteDataService.showSiteErrorAlert("Please select an account type to continue.");return}if(this.connectedAccount.accountTypeID===we.TEAM_ACCOUNT&&this.hasActiveTeamAccount){this.siteDataService.showSiteErrorAlert("Cannot create more than one active team account. Please remove the existing team account before creating a new one.");return}this.addConnectedAccountOptionSelected=!0,this.fields?this.setAccountIDFieldForCreate():(this.loadingConnectedAccount=!0,A({metadata:this.clubService.getConnectedAccountMetadata()}).subscribe(i=>{this.fields=i.metadata.fields,this.setAccountIDFieldForCreate(),this.loadingConnectedAccount=!1}))}loadCreateAccountForm(){if(this.addExistingStripeConnectedAccount===He.NEW&&this.teamAccountsEnabled){this.accountTypeSelectionMade=!0;return}this.addExistingStripeConnectedAccount===He.EXISTING&&(this.connectedAccount.accountTypeID=we.CLUB_ACCOUNT),this.addConnectedAccountOptionSelected=!0,this.fields?this.setAccountIDFieldForCreate():(this.loadingConnectedAccount=!0,A({metadata:this.clubService.getConnectedAccountMetadata()}).subscribe(i=>{this.fields=i.metadata.fields,this.setAccountIDFieldForCreate(),this.loadingConnectedAccount=!1}))}setAccountIDFieldForCreate(){let i=this.fields.find(t=>t.controlName==="accountID");i.viewOnly=!1,this.addExistingStripeConnectedAccount===He.EXISTING?(Ft(i),i.hidden=!1):(Ge(i),i.hidden=!0),this.fields=Array.from(this.fields)}createConnectedAccount(){if(this.createAccountForm.isValid){this.savingConnectedAccount=!0;let i=this.createAccountForm.validFieldsValue,t=Z(!0);this.addExistingStripeConnectedAccount===He.EXISTING&&(t=this.clubService.isClubStripeConnectedAccountIDValid(i.accountID)),t.pipe(Re(l=>A({valid:Z(l),saveRequest:l?this.clubService.createConnectedAccount(this.clubID,i,this.addExistingStripeConnectedAccount===He.NEW):Z(null)})),Re(l=>A({valid:Z(l.valid),saveRequest:Z(l.saveRequest),stripeAccount:l.saveRequest?this.clubService.getStripeConnectedAccount(this.clubID,l.saveRequest.clubStripeConnectedAccountID):Z(null)}))).subscribe({next:l=>{l.valid?(this.siteDataService.showSiteSuccessAlert("Connected Account information saved successfully"),l.saveRequest&&(this.searchResults=this.searchResults.concat({clubStripeConnectedAccount:l.saveRequest,stripeAccount:l.stripeAccount}),l.saveRequest.accountTypeID===we.TEAM_ACCOUNT&&(this.hasActiveTeamAccount=!0))):this.formService.showFormErrorMessage("Stripe Account ID already in use"),this.savingConnectedAccount=!1,this.cancelAdd()},error:()=>{this.savingConnectedAccount=!0,this.siteDataService.showSiteErrorAlert("There was a problem saving Connected Account information.")}})}else this.createAccountForm.submitForm()}editConnectedAccount(i){this.connectedAccount=i,this.clubStripeConnectedAccountID=this.connectedAccount.clubStripeConnectedAccountID,this.showEditConnectedAccount=!0,this.fields?this.setAccountIDFieldForEdit():(this.loadingConnectedAccount=!0,A({metadata:this.clubService.getConnectedAccountMetadata()}).subscribe(t=>{this.fields=t.metadata.fields,this.setAccountIDFieldForEdit(),this.loadingConnectedAccount=!1}))}saveConnectedAccount(i){this.savingConnectedAccount=!0,this.clubService.saveConnectedAccount(this.clubID,this.clubStripeConnectedAccountID,i).subscribe({next:()=>{this.showEditConnectedAccount=!1,this.savingConnectedAccount=!1,this.searchResults.filter(t=>t.clubStripeConnectedAccount.clubStripeConnectedAccountID===this.clubStripeConnectedAccountID)[0].clubStripeConnectedAccount.name=i.name,this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Connected Account information saved successfully")},error:()=>{this.savingConnectedAccount=!1,this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving Connected Account information.")}})}setAccountIDFieldForEdit(){let i=this.fields.find(t=>t.controlName==="accountID");i.viewOnly=!0,i.hidden=!1,Ge(i),this.fields=Array.from(this.fields)}closeDeleteConfirm(){this.showConfirmDelete=!1,this.cannotDelete=!1}deleteConnectedAccount(){this.deletingConnectedAccount=!0,this.clubService.deleteConnectedAccount(this.clubID,this.selectedConnectedAccount.clubStripeConnectedAccount.clubStripeConnectedAccountID).subscribe({next:i=>{this.deletingConnectedAccount=!1,i?(this.closeDeleteConfirm(),this.selectedConnectedAccount.clubStripeConnectedAccount.accountTypeID===we.TEAM_ACCOUNT&&(this.hasActiveTeamAccount=!1),this.searchResults=this.searchResults.filter(t=>t.clubStripeConnectedAccount.clubStripeConnectedAccountID!==this.selectedConnectedAccount.clubStripeConnectedAccount.clubStripeConnectedAccountID),this.siteDataService.showSiteSuccessAlert("Connected Account information deleted successfully")):(this.cannotDelete=!0,this.siteDataService.showSiteErrorAlert("This connected account could not be deleted at this time."))},error:()=>{this.deletingConnectedAccount=!1,this.siteDataService.showSiteErrorAlert("There was a problem deleting this connected account.")}})}editPayoutSchedule(){this.clubStripeConnectedAccountID=this.selectedConnectedAccount.clubStripeConnectedAccount.clubStripeConnectedAccountID,this.showEditConnectedAccountPayoutSchedule=!0,this.selectedPayoutInterval=this.selectedConnectedAccount?.stripeAccount?.settings?.payouts?.schedule?.
1005interval,this.payoutSchedule={interval:this.selectedPayoutInterval,delayDays:this.selectedConnectedAccount?.stripeAccount?.settings?.payouts?.schedule?.delay_days,weeklyAnchor:this.selectedConnectedAccount?.stripeAccount?.settings?.payouts?.schedule?.weekly_anchor,monthlyAnchor:this.selectedConnectedAccount?.stripeAccount?.settings?.payouts?.schedule?.monthly_anchor},this.payoutScheduleFields?this.setPayoutFields():(this.loadingConnectedAccount=!0,A({metadata:this.clubService.getConnectedAccountPayoutScheduleMetadata()}).subscribe(i=>{this.payoutScheduleFields=i.metadata.fields,this.setPayoutFields(),this.loadingConnectedAccount=!1}))}payoutIntervalChange(i){this.selectedPayoutInterval=i,this.setPayoutFields()}setPayoutFields(){let i=this.payoutScheduleFields.find(l=>l.key==="weeklyAnchor"),t=this.payoutScheduleFields.find(l=>l.key==="monthlyAnchor");this.selectedPayoutInterval==="daily"?(i.hidden=!0,t.hidden=!0,Ge(t),Ge(i)):this.selectedPayoutInterval==="weekly"?(t.hidden=!0,i.hidden=!1,Ft(i),Ge(t)):this.selectedPayoutInterval==="monthly"&&(t.hidden=!1,i.hidden=!0,Ft(t),Ge(i)),this.payoutScheduleFields=Array.from(this.payoutScheduleFields)}savePayoutSchedule(i){this.savingConnectedAccount=!0,this.clubService.saveConnectedAccountPayoutSchedule(this.clubID,this.selectedConnectedAccount.clubStripeConnectedAccount.clubStripeConnectedAccountID,i).pipe(J(this.unsubscribe$)).subscribe({next:()=>{this.selectedConnectedAccount.stripeAccount.settings.payouts.schedule||(this.selectedConnectedAccount.stripeAccount.settings.payouts.schedule=new Bt),this.selectedConnectedAccount.stripeAccount.settings.payouts.schedule.delay_days=i.delayDays,this.selectedConnectedAccount.stripeAccount.settings.payouts.schedule.interval=i.interval,this.selectedConnectedAccount.stripeAccount.settings.payouts.schedule.monthly_anchor=i.monthlyAnchor,this.selectedConnectedAccount.stripeAccount.settings.payouts.schedule.weekly_anchor=i.weeklyAnchor,this.savingConnectedAccount=!1,this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Connected Account payout schedule saved successfully."),this.showEditConnectedAccountPayoutSchedule=!1},error:()=>{this.savingConnectedAccount=!1,this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving Connected Account payout schedule.")}})}updateDefault(i,t){i||this.searchResults.filter(l=>l.clubStripeConnectedAccount.clubStripeConnectedAccountID!==t.clubStripeConnectedAccountID).forEach(l=>l.clubStripeConnectedAccount.isDefault=!1),t.isDefault=!i}getAccountTypeLabel(i){if(!i)return"Club Account";switch(i){case we.CLUB_ACCOUNT:return"Club Account";case we.TEAM_ACCOUNT:return"Team Account";default:return"Club Account"}}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};s.\u0275fac=function(t){return new(t||s)(C(ve),C(D),C(he),C(T),C($))},s.\u0275cmp=y({type:s,selectors:[["app-connected-account-search"]],viewQuery:function(t,l){if(t&1&&pe(ba,5)(Sa,5),t&2){let u;oe(u=ae())&&(l.optionsMenu=u.first),oe(u=ae())&&(l.createAccountForm=u.first)}},inputs:{viewOnlyMode:"viewOnlyMode"},standalone:!1,decls:25,vars:33,consts:[["optionsMenu",""],["createAccountForm",""],["appendTo","body",3,"model","popup"],["styleClass","standardWidthDialog",3,"visibleChange","visible","header","modal","resizable","closable","draggable"],["pTemplate","footer"],[1,"card","settings-card"],[1,"text-large","text-navy","fw-800"],[1,"table-responsive","mb-3"],["sortField","name",1,"table","table-striped","table-sm",3,"columns","value"],["pTemplate","header"],["pTemplate","body"],["pTemplate","emptymessage"],[1,"mb-3"],["alertType","warning",3,"isInline"],[1,"fw-600","text-medium"],[2,"max-width","5%"],[3,"pSortableColumn"],[3,"field"],[1,"d-flex","align-items-center","justify-content-end"],["type","button",1,"btn","btn-sm","btn-tertiary","ml-3",3,"click","disabled"],[1,"fa-solid","fa-ellipsis"],[1,"sr-only"],[3,"title","for"],["aria-hidden","true",1,"favorite","text-large"],[1,"fa","fa-star"],["type","checkbox",1,"sr-only",3,"click","id","ngModel","disabled"],[1,"fad","fa-people-group"],["type","button",1,"btn","btn-naked",3,"click"],["status","default","text","Rejected","tooltipText","This account was rejected. Reasons include, but are not limited to: fraud, incomplete verification, terms of service.",3,"dots"],["status","error","text","Restricted","tooltipText","Provide more information in order to enable payments and payouts for this account.",3,"dots"],["status","warning","text","Restricted Soon","tooltipText","This account can accept payments and receive payouts, but must provide additional information in order to keep this account in good standing.",3,"dots"],["status","note","text","Enabled","tooltipText","This account has provided enough information to process payments and receive payouts. More information will eventually be required when they process enough volume.",3,"dots"],["status","success","text","Complete","tooltipText","This account has provided the required information to fully onboard onto Stripe. They can accept payments and receive payouts.",3,"dots"],["text","Active","status","success"],["text","Inactive","status","warning"],["text","Test Mode","styleClass","pill-stripe-test-mode"],["text","Live Mode","status","color1"],[2,"text-align","left"],["type","button",1,"btn","btn-icon-plus",3,"click"],["headerText","Are you sure you want to deactivate this connected account?","dialogClass","standardWidthDialog","yesButtonText","Yes, Deactivate","noButtonText","Cancel",3,"onYesSelect","onNoSelect","showModalText"],[1,"text-medium","fw-600"],["headerText","Are you sure you want to delete this connected account?","dialogClass","standardWidthDialog","yesButtonText","Yes, Delete","noButtonText","Cancel",3,"onYesSelect","onNoSelect","showModalText","loading"],[1,"text-medium","mb-3","fw-600"],[3,"isInline","alertType"],[1,"mb-1","d-block"],["href","https://docs.stripe.com/api/accounts/delete","target","_blank","rel","noopener noreferrer"],[1,"d-block"],[1,"mx-3"],["styleClass","mb-3","color","green","controlGroupName","addConnectedAccountOption","inputId","newAcct","label","Create a new connected account in Stripe and add to Sprocket",3,"ngModelChange","optionValue","ngModel"],["color","green","controlGroupName","addConnectedAccountOption","inputId","existing","label","Add a connected account that exists in Stripe to Sprocket",3,"ngModelChange","optionValue","ngModel"],[1,"text-medium","fw-600","mb-3"],["styleClass","mb-3","color","green","controlGroupName","accountType","inputId","clubAcct","label","Club Account",3,"ngModelChange","optionValue","ngModel"],["color","green","controlGroupName","accountType","inputId","teamAcct","label","Team Account",3,"ngModelChange","verticalPadding","optionValue","ngModel","disabled","description","boldLabel"],[3,"fields","entity","horizontalForm","showSubmitButton","showDeleteButton","contentFieldsMode","showCancelButton"],["fieldName","name"],["fieldName","accountID"],["skeletonType","form-single-text-input"],["slot","secondary"],["type","button",1,"btn","btn-lg","btn-naked",3,"click","disabled"],["slot","primary"],["type","button",1,"btn","btn-lg","btn-primary",3,"click","disabled"],["type","button",1,"btn","btn-lg","btn-icon-chevron-left",3,"click","disabled"],["submitButtonText","Save","buttonsPosition","left",3,"onSubmit","onCancel","fields","entity","horizontalForm","showSubmitButton","showDeleteButton","contentFieldsMode"],[1,"row"],[3,"ngClass"],["fieldName","interval",3,"onChange"],[1,"col-md-6",3,"hidden"],["fieldName","weeklyAnchor"],["fieldName","monthlyAnchor"],[1,"col-md-12"],["fieldName","delayDays"]],template:function(t,l){if(t&1){let u=v();f(0,Xa,21,4),r(1,"p-menu",2,0),e(3,` 1006`),a(),e(4,` 1007 1008`),f(5,Ka,10,2),f(6,er,14,4),r(7,"p-dialog",3),Y("visibleChange",function(g){return x(u),z(l.showAddConnectedAccount,g)||(l.showAddConnectedAccount=g),b(g)}),e(8,` 1009 `),e(9,` 1010 `),f(10,tr,10,4),f(11,ir,13,8),f(12,ar,3,2),E(13,dr,22,13,"ng-template",4),e(14,` 1011`),a(),e(15,` 1012 1013`),r(16,"p-dialog",3),Y("visibleChange",function(g){return x(u),z(l.showEditConnectedAccount,g)||(l.showEditConnectedAccount=g),b(g)}),e(17,` 1014 `),f(18,ur,8,6),f(19,pr,5,0),a(),e(20,` 1015 1016`),r(21,"p-dialog",3),Y("visibleChange",function(g){return x(u),z(l.showEditConnectedAccountPayoutSchedule,g)||(l.showEditConnectedAccountPayoutSchedule=g),b(g)}),e(22,` 1017 `),f(23,fr,27,11),f(24,hr,5,0),a()}t&2&&(h(l.loading?-1:0),c(),Ue(te(32,va)),d("model",l.options)("popup",!0),c(4),h(l.showConfirmDeactivate?5:-1),c(),h(l.showConfirmDelete?6:-1),c(),j("visible",l.showAddConnectedAccount),d("header",l.addExistingStripeConnectedAccount===l.AddConnectedAccountOption.EXISTING?"Add Existing Connected Account":"Create Connected Account")("modal",!0)("resizable",!1)("closable",!1)("draggable",!1),c(3),h(!l.accountTypeSelectionMade&&!l.addConnectedAccountOptionSelected?10:-1),c(),h(l.accountTypeSelectionMade&&!l.addConnectedAccountOptionSelected&&l.connectedAccount?11:-1),c(),h(l.addConnectedAccountOptionSelected?12:-1),c(4),j("visible",l.showEditConnectedAccount),d("header","Edit Connected Account")("modal",!0)("resizable",!1)("closable",!1)("draggable",!1),c(2),h(l.fields&&l.connectedAccount&&!l.loadingConnectedAccount?18:-1),c(),h(l.loadingConnectedAccount?19:-1),c(2),j("visible",l.showEditConnectedAccountPayoutSchedule),d("header","Edit Payout Schedule")("modal",!0)("resizable",!1)("closable",!1)("draggable",!1),c(2),h(l.payoutScheduleFields&&l.payoutSchedule&&!l.loadingConnectedAccount?23:-1),c(),h(l.loadingConnectedAccount?24:-1))},dependencies:[bt,w,k,vt,ge,ye,tt,ne,Et,H,_e,Ot,Ni,nt,ke,se,Ce,xe,Pe,je,Vi,ki],styles:[".favorite[_ngcontent-%COMP%]{color:var(--yellow-300)}.favorite[_ngcontent-%COMP%]:hover{cursor:pointer}"]});let n=s;return n})(),He=(function(n){return n[n.EXISTING=1]="EXISTING",n[n.NEW=2]="NEW",n})(He||{});var mn=di(Ei());var Cr=(n,s)=>({sitePaymentTypeID:n,programTypeID:s}),xr=n=>({sitePaymentTypeID:n}
1017),br=()=>[1,2,3,4,5,6,7,8];function Sr(n,s){if(n&1&&(e(0,` 1018 `),r(1,"app-dynamic-form",5),e(2,` 1019 `),r(3,"div",6),e(4,` 1020 `),r(5,"div",3),e(6,` 1021 `),r(7,"label"),e(8),a(),e(9,` 1022 `),a(),e(10,` 1023 `),r(11,"div",7),e(12,` 1024 `),p(13,"app-dynamic-form-field",8),e(14,` 1025 `),a(),e(15,` 1026 `),r(16,"div",7),e(17,` 1027 `),p(18,"app-dynamic-form-field",9),e(19,` 1028 `),a(),e(20,` 1029 `),a(),e(21,` 1030 `),a(),e(22,` 1031 `)),n&2){let o=m().$implicit,i=m(2).$implicit,t=m(2);c(),d("fields",t.formData[i.sitePaymentTypeID][o.programTypeID].fields)("entity",t.formData[i.sitePaymentTypeID][o.programTypeID].entity)("horizontalForm",!1)("showCancelButton",!1)("contentFieldsMode",!0)("showSubmitButton",!1)("formID","assignment-form-"+i.sitePaymentTypeID+"-"+o.programTypeID)("formData",xt(13,Cr,i.sitePaymentTypeID,o.programTypeID)),c(7),O(t.formData[i.sitePaymentTypeID][o.programTypeID].label),c(5),d("formID","assignment-form-"+i.sitePaymentTypeID+"-"+o.programTypeID)("hideLabel",!0),c(5),d("formID","assignment-form-"+i.sitePaymentTypeID+"-"+o.programTypeID)("hideLabel",!0)}}function vr(n,s){if(n&1&&(e(0,` 1032 `),f(1,Sr,23,16)),n&2){let o=s.$implicit,i=m(2).$implicit,t=m(2);c(),h(t.formData[i.sitePaymentTypeID]&&t.formData[i.sitePaymentTypeID][o.programTypeID]?1:-1)}}function gr(n,s){if(n&1&&(e(0,` 1033 `),I(1,vr,2,1,null,null,F)),n&2){let o=m(3);c(),P(o.programTypes)}}function yr(n,s){if(n&1&&(e(0,` 1034 `),r(1,"app-dynamic-form",5),e(2,` 1035 `),r(3,"div",10),e(4,` 1036 `),r(5,"div",3),e(6,` 1037 `),r(7,"label"),e(8),a(),e(9,` 1038 `),a(),e(10,` 1039 `),r(11,"div",7),e(12,` 1040 `),p(13,"app-dynamic-form-field",8),e(14,` 1041 `),a(),e(15,` 1042 `),r(16,"div",7),e(17,` 1043 `),p(18,"app-dynamic-form-field",9),e(19,` 1044 `),a(),e(20,` 1045 `),a(),e(21,` 1046 `),a(),e(22,` 1047 `)),n&2){let o=m(2),i=o.$implicit,t=o.$index,l=o.$count,u=m(2);c(),d("fields",u.formData[i.sitePaymentTypeID][0].fields)("entity",u.formData[i.sitePaymentTypeID][0].entity)("horizontalForm",!1)("showCancelButton",!1)("contentFieldsMode",!0)("showSubmitButton",!1)("formID","assignment-form-"+i.sitePaymentTypeID+"-0")("formData",Se(15,xr,i.sitePaymentTypeID)),c(2),le("border-bottom",t!==l-1),c(5),O(u.formData[i.sitePaymentTypeID][0].label),c(5),d("formID","assignment-form-"+i.sitePaymentTypeID+"-0")("hideLabel",!0),c(5),d("formID","assignment-form-"+i.sitePaymentTypeID+"-0")("hideLabel",!0)}}function Dr(n,s){if(n&1&&(e(0,` 1048 `),f(1,yr,23,17)),n&2){let o=m().$implicit,i=m(2);c(),h(i.formData[o.sitePaymentTypeID]&&i.formData[o.sitePaymentTypeID][0]?1:-1)}}function Ar(n,s){if(n&1&&(e(0,` 1049 `),f(1,gr,3,0),f(2,Dr,2,1)),n&2){let o=s.$implicit,i=m(2);c(),h(o.sitePaymentTypeID===i.SitePaymentType.REGISTRATION?1:-1),c(),h(o.sitePaymentTypeID!==i.SitePaymentType.REGISTRATION?2:-1)}}function Tr(n,s){n&1&&(e(0,` 1050 `),p(1,"app-button-loader"),e(2,` 1051 `))}function Er(n,s){n&1&&(e(0,` 1052 `),r(1,"span"),e(2,"Saving..."),a(),e(3,` 1053 `))}function wr(n,s){n&1&&(e(0,` 1054 `),r(1,"span"),e(2,"Save"),a(),e(3,` 1055 `))}function Fr(n,s){if(n&1){let o=v();e(0,` 1056 `),r(1,"div",11),e(2,` 1057 `),r(3,"button",12),S("click",function(){x(o);let t=m(2);return b(t.saveAssignments())}),e(4,` 1058 `),f(5,Tr,3,0),f(6,Er,4,0),f(7,wr,4,0),a(),e(8,` 1059 `),a(),e(9,` 1060 `)}if(n&2){let o=m(2);c(3),d("disabled",o.saving),c(2),h(o.saving?5:-1),c(),h(o.saving?6:-1),c(),h(o.saving?-1:7)}}function Ir(n,s){if(n&1&&(e(0,` 1061 `),r(1,"div",2),e(2,` 1062 `),p(3,"div",3),e(4,` 1063 `),r(5,"div",4),e(6,"Connected Account"),a(),e(7,` 1064 `),r(8,"div",4),e(9,"Fee Structure"),a(),e(10,` 1065 `),a(),e(11,` 1066 `),I(12,Ar,3,2,null,null,F),f(14,Fr,10,4)),n&2){let o=m();c(12),P(o.sitePaymentTypes),c(2),h(o.viewOnlyMode?-1:14)}}function Pr(n,s){n&1&&(e(0,` 1067 `),r(1,"div",13),e(2,` 1068 `),p(3,"app-skeleton-template",14),e(4,` 1069 `),a(),e(5,` 1070 `))}function Or(n,s){n&1&&(e(0,` 1071 `),I(1,Pr,6,0,null,null,F)),n&2&&(c(),P(te(0,br)))}var dn=(()=>{let s=class s{constructor(i,t,l,u){this.clubService=i,this.siteDataService=t,this.route=l,this.formService=u,this.viewOnlyMode=!1,this.loading=!0,this.SitePaymentType=Tt,this.formData={},this.saving=!1,this.forms=new _t,this.unsubscribe$=new ue}
1071ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.clubService.refreshAssignments$.pipe(J(this.unsubscribe$)).subscribe({next:()=>{this.load()}}),this.load()}load(){A({assignments:this.clubService.getStripeAssignments(this.clubID),metadata:this.clubService.getAccountFeeAssignmentMetadata().pipe(pt(i=>i.fields)),sitePaymentTypes:this.sitePaymentTypes?Z(this.sitePaymentTypes):this.clubService.getSitePaymentTypes(),programTypes:this.programTypes?Z(this.programTypes):this.clubService.getProgramTypes()}).pipe(J(this.unsubscribe$)).subscribe({next:i=>{this.sitePaymentTypes=i.sitePaymentTypes,this.programTypes=i.programTypes,this.defaultFields=i.metadata,this.assignments=i.assignments,this.setFormData(),this.loading=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}saveAssignments(){this.saving=!0;let i=[];this.forms.forEach(t=>{let l=t.formData.sitePaymentTypeID,u=t.formData.programTypeID||0,_=this.assignments.find(Ie=>Ie.sitePaymentTypeID===l&&(Ie.programTypeID||0)===u),g={sitePaymentTypeID:l,programTypeID:u>0?u:null,clubStripeConnectedAccountID:t.validFieldsValue.clubStripeConnectedAccountID?t.validFieldsValue.clubStripeConnectedAccountID:null,clubPaymentFeeStructureID:t.validFieldsValue.clubPaymentFeeStructureID?t.validFieldsValue.clubPaymentFeeStructureID:null};_?.clubStripeAccountFeeAssignmentID&&(g.clubStripeAccountFeeAssignmentID=_.clubStripeAccountFeeAssignmentID),(g.clubStripeAccountFeeAssignmentID||g.clubStripeConnectedAccountID||g.clubPaymentFeeStructureID)&&i.push(g)}),this.clubService.saveConnectedAccountAssignments(this.clubID,i).pipe(J(this.unsubscribe$)).subscribe({next:t=>{this.assignments=t,this.setFormData(),this.siteDataService.showSiteSuccessAlert("Assignments saved successfully."),this.formService.hideFormLoader(),this.saving=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving the assignments."),this.formService.hideFormLoader(),this.saving=!1}})}setFormData(){this.formData={},this.sitePaymentTypes.forEach(i=>{let t=(0,mn.cloneDeep)(this.defaultFields);i.sitePaymentTypeID===Tt.TEAM_FEE?t.find(l=>l.controlName==="clubStripeConnectedAccountID").options=t.find(l=>l.controlName==="clubStripeConnectedAccountID").options.filter(l=>l.data.accountTypeID===we.TEAM_ACCOUNT):t.find(l=>l.controlName==="clubStripeConnectedAccountID").options=t.find(l=>l.controlName==="clubStripeConnectedAccountID").options.filter(l=>l.data.accountTypeID===we.CLUB_ACCOUNT),this.formData[i.sitePaymentTypeID]={},i.sitePaymentTypeID===Tt.REGISTRATION?this.programTypes.forEach(l=>{this.formData[i.sitePaymentTypeID][l.programTypeID]={label:`${Fi(l)} Programs`,fields:t,entity:this.assignments?.find(u=>u.sitePaymentTypeID===i.sitePaymentTypeID&&u.programTypeID===l.programTypeID)||new Ht(i.sitePaymentTypeID,l.programTypeID)}}):this.formData[i.sitePaymentTypeID][0]={label:`${i.description}s`,fields:t,entity:this.assignments?.find(l=>l.sitePaymentTypeID===i.sitePaymentTypeID)||new Ht(i.sitePaymentTypeID,0)}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};s.\u0275fac=function(t){return new(t||s)(C(ve),C(D),C(T),C($))},s.\u0275cmp=y({type:s,selectors:[["app-assignments"]],viewQuery:function(t,l){if(t&1&&pe(w,5),t&2){let u;oe(u=ae())&&(l.forms=u)}},inputs:{viewOnlyMode:"viewOnlyMode"},standalone:!1,decls:7,vars:1,consts:[[1,"card","settings-card","assignments"],[1,"text-large","text-navy","fw-800"],[1,"row","border-bottom","mx-0","mb-2","fw-800","text-medium","mt-3"],[1,"col-2"],[1,"col-4"],["submitButtonText","Save","buttonsPosition","left",3,"fields","entity","horizontalForm","showCancelButton","contentFieldsMode","showSubmitButton","formID","formData"],[1,"row","mx-0","mb-2","pb-2","d-flex","align-items-center","border-bottom"],[1,"col-4","no-wrap"],["fieldName","clubStripeConnectedAccountID","styleClass","mb-0",3,"formID","hideLabel"],["fieldName","clubPaymentFeeStructureID","styleClass","mb-0",3,"formID","hideLabel"],[1,"row","mx-0","mb-2","pb-2","d-flex","align-items-center"],[1,"form-action"],["type","button",1,"btn","btn-lg","btn-primary",3,"click","disabled"],[1,"mb-3"],["height","3rem"]],template:function(t,l){t&1&&(r(0,"section",0),e(1,` 1072 `),r(2,"h2",1),e(3,"Default Account & Fee Assignments"),a(),e(4,`
1073 `),f(5,Ir,15,1)(6,Or,3,1),a()),t&2&&(c(5),h(l.formData&&!l.loading?5:6))},dependencies:[w,k,H,Ot],styles:[".assignments .form-group .form-dropdown{max-width:100%;width:100%}"]});let n=s;return n})();var Vr=["form"],kr=["optionsMenu"],Nr=()=>({width:"auto"});function Rr(n,s){n&1&&(e(0,` 1074 `),p(1,"i",19),e(2,` 1075 `))}function Lr(n,s){n&1&&(e(0,` 1076 `),p(1,"i",20),e(2,` 1077 `))}function Br(n,s){n&1&&(e(0,` 1078 `),p(1,"app-status-indicator",21),e(2,` 1079 `)),n&2&&(c(),d("dots",!0))}function $r(n,s){n&1&&(e(0,` 1080 `),p(1,"app-status-indicator",22),e(2,` 1081 `)),n&2&&(c(),d("dots",!0))}function Wr(n,s){if(n&1&&(e(0,` 1082 `),f(1,Br,3,1),f(2,$r,3,1)),n&2){let o=m(2);c(),h(o.fee.isEnabled?1:-1),c(),h(o.fee.isEnabled?-1:2)}}function Ur(n,s){n&1&&(e(0,` 1083 `),p(1,"app-status-indicator",21),e(2,` 1084 `)),n&2&&(c(),d("dots",!0))}function jr(n,s){n&1&&(e(0,` 1085 `),p(1,"app-pill",23),e(2,` 1086 `))}function zr(n,s){n&1&&(e(0,` 1087 `),p(1,"app-pill",24),e(2,` 1088 `))}function Yr(n,s){if(n&1){let o=v();e(0,` 1089 `),r(1,"app-dynamic-form",4,1),e(3,` 1090 `),r(4,"div",5),e(5,` 1091 `),r(6,"div",6),e(7,` 1092 `),r(8,"div",7),e(9,` 1093 `),r(10,"div",8),e(11,` 1094 `),f(12,Rr,3,0),f(13,Lr,3,0),a(),e(14,` 1095 `),r(15,"div",9),e(16,` 1096 `),r(17,"span"),e(18),a(),e(19,` 1097 `),a(),e(20,` 1098 `),a(),e(21,` 1099 `),a(),e(22,` 1100 `),r(23,"div",6),e(24,` 1101 `),f(25,Wr,3,2),f(26,Ur,3,1),a(),e(27,` 1102 `),r(28,"div",10),e(29,` 1103 `),r(30,"app-dynamic-form-field",11),e(31,` 1104 `),L(32,2,2),e(34,` 1105 `),r(35,"span",12),e(36,"%"),a(),e(37,` 1106 `),B(),e(38,` 1107 `),a(),e(39,` 1108 `),a(),e(40,` 1109 `),r(41,"div",10),e(42,` 1110 `),r(43,"app-dynamic-form-field",13),e(44,` 1111 `),L(45,2,2),e(47,` 1112 `),r(48,"span",12),e(49,"%"),a(),e(50,` 1113 `),B(),e(51,` 1114 `),a(),e(52,` 1115 `),e(53,` 1116 `),a(),e(54,` 1117 `),r(55,"div",14),e(56,` 1118 `),f(57,jr,3,0),f(58,zr,3,0),r(59,"button",15),S("click",function(){x(o);let t=m();return b(t.saveClubPaymentFee(t.fee.isEnabled))}),e(60,` 1119 `),p(61,"i",16),e(62,` 1120 `),r(63,"div",17),e(64,"Save"),a(),e(65,` 1121 `),a(),e(66,` 1122 `),r(67,"button",15),S("click",function(t){x(o);let l=m();return b(l.toggleOptionsMenu(t))}),e(68,` 1123 `),p(69,"i",18),e(70,` 1124 `),r(71,"div",17),e(72,"Options"),a(),e(73,` 1125 `),a(),e(74,` 1126 `),a(),e(75,` 1127 `),a(),e(76,` 1128 `),a(),e(77,` 1129`)}if(n&2){let o=Le(2),i=m();c(),d("fields",i.feeFields)("entity",i.fee)("horizontalForm",!1)("showCancelButton",!1)("contentFieldsMode",!0)("showSubmitButton",!1),c(3),le("border-bottom",i.borderBottom),c(8),h(i.fee.paymentTypeID===i.PaymentType.ACH?12:-1),c(),h(i.fee.paymentTypeID===i.PaymentType.CARD?13:-1),c(5),V(` 1130 `,i.fee.paymentType.paymentType,` 1131 `),c(7),h(i.fee.clubPaymentFeeID?25:-1),c(),h(i.fee.clubPaymentFeeID?-1:26),c(4),d("hideLabel",!0),c(13),d("hideLabel",!0),c(14),h(i.fee.clubPaymentFeeID?57:-1),c(),h(i.fee.clubPaymentFeeID?-1:58),c(),d("disabled",i.viewOnlyMode||!(o!=null&&o.isValid)||i.saving),c(8),d("disabled",i.viewOnlyMode||!(o!=null&&o.isValid)||i.saving)}}var un=(()=>{let s=class s{constructor(i,t,l){this.clubService=i,this.siteDataService=t,this.route=l,this.borderBottom=!0,this.viewOnlyMode=!1,this.deleted=new fi,this.PaymentVendor=Be,this.loading=!0,this.PaymentType=At,this.options=[],this.saving=!1,this.unsubscribe$=new ue}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.feeFields=Array.from(this.defaultFields)}toggleOptionsMenu(i){let t=[];this.fee.clubPaymentFeeID&&t.push({label:"Reset to Default",command:()=>{this.deleteClubPaymentFee()}}),this.fee.isEnabled?t.push({label:"Disable",command:()=>{this.saveClubPaymentFee(!1)}}):t.push({label:"Enable",command:()=>{this.saveClubPaymentFee(!0)}}),this.options=[{label:"Options",items:t}],this.optionsMenu.toggle(i)}saveClubPaymentFee(i){this.saving=!0;let t=lt(Ee(Ee({},this.fee),this.form.value),{isEnabled:i});this.clubService.saveClubPaymentFee(t,this.clubID).pipe(J(this.unsubscribe$)).subscribe({next:l=>{this.siteDataService.showSiteSuccessAlert("Fee setting saved"),this.fee=Ee(Ee({},this.fee),t),l?(this.fee.clubPaymentFeeID=l.clubPaymentFeeID,this.fee.feeDescription=l.feeDescription):this.clubService.setClubPaymentFeeDescription(this.fee),this.saving=!1,this.clubService.refreshAssignments.next()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving this fee setting"),this.saving=!1}})}deleteClubPaymentFee(){this.saving=!0,this.clubService.deleteClubPaymentFee(this.fee.clubPaymentFeeID,this.clubID).pipe(J(this.unsubscribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Fee setting saved"),this.deleted.emit(this.fee),this.saving=!1,this.clubService.refreshAssignments.next()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving this fee setting"),this.saving=!1}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};s.\u0275fac=function(t){return new(t||s)(C(ve),C(D),C(T))},s.\u0275cmp=y({type:s,selectors:[["app-payment-fee"]],viewQuery:function(t,l){if(t&1&&pe(Vr,5)(kr,5),t&2){let u;oe(u=ae())&&(l.form=u.first),oe(u=ae())&&(l.optionsMenu=u.first)}},inputs:{paymentVendorID:"paymentVendorID",fee:"fee",defaultFields:"defaultFields",borderBottom:"borderBottom",viewOnlyMode:"viewOnlyMode"},outputs:{deleted:"deleted"},standalone:!1,decls:4,vars:6,consts:[["optionsMenu",""],["form",""],["inputGroupEnd",""],["appendTo","body",3,"model","popup"],["submitButtonText","Save","buttonsPosition","left",3,"fields","entity","horizontalForm","showCancelButton","contentFieldsMode","showSubmitButton"],[1,"row","mx-0","mb-2","pb-2","d-flex","align-items-center"],[1,"col-2","d-flex","align-items-center"],[1,"row","d-flex","align-items-center"],[1,"col-1","text-center","text-navy"],[1,"col-auto","d-flex","align-items-center"],[1,"col-3","no-wrap"],["fieldName","userFeePercentage","styleClass","mb-0",3,"hideLabel"],[1,"text-medium"],["fieldName","totalFeePercentage","styleClass","mb-0",3,"hideLabel"],[1,"col-2","d-flex","align-items-center","justify-content-end"],["type","button",1,"btn","btn-sm","btn-tertiary","ml-3","text-medium",3,"click","disabled"],[1,"fa-solid","fa-save"],[1,"sr-only"],[1,"fa-solid","fa-ellipsis"],[1,"fad","fa-bank","text-large"],[1,"fad","fa-credit-card","text-large"],["status","active","text","Enabled",3,"dots"],["status","warning","text","Disabled",3,"dots"],["status","color1","text","custom setting"],["text","default setting"]],template:function(t,l){t&1&&(f(0,Yr,78,19),r(1,"p-menu",3,0),e(3,` 1132`),a()),t&2&&(h(l.feeFields&&l.fee?0:-1),c(),Ue(te(5,Nr)),d("model",l.options)("popup",!0))},dependencies:[w,k,tt,Et,je],encapsulation:2});let n=s;return n})();var Qr=["optionsMenu"],Gr=()=>({width:"auto"});function Jr(n,s){n&1&&(e(0,` 1133 `),r(1,"div",6),e(2,` 1134 `),r(3,"app-inline-alert",7),e(4,` 1135 `),r(5,"span",8),e(6,` 1136 You do not have an active default fee structure specified. If not specified, the system will 1137 default 1138 to the first fee structure it can find, ie the first one created. 1139 `),a(),e(7,` 1140 `),a(),e(8,` 1141 `),a(),e(9,` 1142 `)),n&2&&(c(3),d("isInline",!1))}
1142function Xr(n,s){if(n&1&&(e(0,` 1143 `),r(1,"span",19),e(2,` 1144 `),r(3,"span",20),e(4),a(),e(5),a(),e(6,` 1145 `)),n&2){let o=s.$implicit;c(4),V("",o.paymentType.paymentType,":"),c(),V("",o.feeDescription,` 1146 `)}}function Kr(n,s){n&1&&st(0)}function Zr(n,s){if(n&1){let o=v();e(0,` 1147 `),r(1,"app-payment-fee",23),S("deleted",function(t){x(o);let l=m(6);return b(l.feeDeleted(t))}),a(),e(2,` 1148 `)}if(n&2){let o=s.$implicit,i=s.$index,t=s.$count,l=m(6);c(),d("fee",o)("paymentVendorID",l.paymentVendorID)("viewOnlyMode",l.viewOnlyMode)("defaultFields",l.feeFields)("borderBottom",i!==t-1)}}function el(n,s){if(n&1&&(e(0,` 1149 `),r(1,"div",21),e(2,` 1150 `),E(3,Kr,1,0,"ng-container",22),e(4,` 1151 `),I(5,Zr,3,5,null,null,F),a(),e(7,` 1152 `)),n&2){let o=m().$implicit;m(4);let i=Le(6);c(3),d("ngTemplateOutlet",i),c(2),P(o.clubPaymentFees)}}function tl(n,s){if(n&1){let o=v();e(0,` 1153 `),r(1,"app-step-content-ui",9),S("menuToggle",function(t){let l=x(o).$implicit,u=m(4);return b(u.toggleOptionsMenu(l,t))})("accordionToggle",function(){let t=x(o).$implicit;return b(t.expanded=!t.expanded)}),e(2,` 1154 `),L(3,10),e(4,` 1155 `),r(5,"label",11),e(6,` 1156 `),r(7,"span",12),e(8,"Default account"),a(),e(9,` 1157 `),r(10,"span",13),e(11,` 1158 `),p(12,"i",14),e(13,` 1159 `),a(),e(14,` 1160 `),r(15,"input",15),S("click",function(){let t=x(o).$implicit,l=m(4);return b(l.defaultClick(t))}),a(),e(16,` 1161 `),a(),e(17,` 1162 `),B(),e(18,` 1163 `),L(19,16),e(20,` 1164 `),r(21,"span",17),e(22,` 1165 `),p(23,"i",18),e(24,` 1166 `),I(25,Xr,7,2,null,null,F),a(),e(27,` 1167 `),B(),e(28,` 1168 `),f(29,el,8,1),a(),e(30,` 1169 `)}if(n&2){let o=s.$implicit,i=s.$index,t=m(4);c(),d("dragDisabled",!0)("isAccordion",!0)("expanded",o.expanded)("title",o.name)("utilityPillText",o.isEnabled?"Active":"Inactive")("utilityPillStatus",o.isEnabled?"success":"warning"),c(4),d("title",o.isDefault?"This is your default":"Set as default")("for","default-fee-structure-"+i),c(5),le("selected",o.isDefault),c(2),le("far",!o.isDefault)("fas",o.isDefault),c(3),d("id","default-fee-structure-"+i)("ngModel",o.isDefault)("disabled",t.viewOnlyMode),c(10),P(o.clubPaymentFees),c(4),h(o.expanded?29:-1)}}function il(n,s){if(n&1&&(e(0,` 1170 `),f(1,Jr,10,1),I(2,tl,31,18,null,null,F)),n&2){let o=m(3);c(),h(o.hasDefaultFeeStructure?-1:1),c(),P(o.feeStructures)}}function nl(n,s){n&1&&(e(0,` 1171 `),r(1,"div",6),e(2,` 1172 `),r(3,"app-inline-alert",7),e(4,` 1173 `),r(5,"span",24),e(6,` 1174 No payment fee structures have been configured. Payments will be disabled until one is 1175 configured. 1176 `),a(),e(7,` 1177 `),a(),e(8,` 1178 `),a(),e(9,` 1179 `)),n&2&&(c(3),d("isInline",!1))}function ol(n,s){if(n&1){let o=v();e(0,` 1180 `),r(1,"div"),e(2,` 1181 `),r(3,"button",25),S("click",function(){x(o);let t=m(3);return b(t.addFeeStructure())}),e(4,` 1182 Add Fee Structure 1183 `),a(),e(5,` 1184 `),r(6,"button",26),S("click",function(){x(o);let t=m(3);return b(t.showDisableAllPaymentsConfirm=!0)}),e(7,` 1185 Disable all Payments 1186 `),a(),e(8,` 1187 `),a(),e(9,` 1188 `)}if(n&2){let o=m(3);c(3),d("disabled",o.saving||o.loadingFeeStructure),c(3),d("disabled",o.saving||o.loadingFeeStructure)}}function al(n,s){if(n&1&&(e(0,` 1189 `),f(1,il,4,1),f(2,nl,10,1),f(3,ol,10,2)),n&2){let o=m(2);c(),h(o.feeStructures!=null&&o.feeStructures.length?1:-1),c(),h(o.feeStructures!=null&&o.feeStructures.length?-1:2),c(),h(o.viewOnlyMode?-1:3)}}function rl(n,s){n&1&&(e(0,` 1190 `),r(1,"div",6),e(2,` 1191 `),p(3,"app-skeleton-template",27),e(4,` 1192 `),a(),e(5,` 1193 `)),n&2&&(c(3),d("invertBg",!0))}function ll(n,s){if(n&1&&(e(0,` 1194 `),r(1,"h2",5),e(2,"Payment Fee Structures"),a(),e(3,` 1195 `),f(4,al,4,3),f(5,rl,6,1)),n&2){let o=m();c(4),h(o.loading?-1:4),c(),h(o.loading?5:-1)}}function sl(n,s){if(n&1&&(e(0,` 1196 `),r(1,"div",29),e(2,` 1197 `),r(3,"span",20),e(4),a(),e(5),a(),e(6,` 1198 `)),n&2){let o=s.$implicit;c(4),V("",o.paymentType.paymentType,":"),c(),V("",o.feeDescription,` 1199 `)}}function cl(n,s){n&1&&st(0)}
1199function ml(n,s){if(n&1){let o=v();e(0,` 1200 `),r(1,"app-payment-fee",23),S("deleted",function(t){x(o);let l=m(3);return b(l.feeDeleted(t))}),a(),e(2,` 1201 `)}if(n&2){let o=s.$implicit,i=s.$index,t=s.$count,l=m(3);c(),d("fee",o)("paymentVendorID",l.paymentVendorID)("viewOnlyMode",l.viewOnlyMode)("defaultFields",l.feeFields)("borderBottom",i!==t-1)}}function dl(n,s){if(n&1&&(e(0,` 1202 `),r(1,"div",6),e(2,` 1203 `),r(3,"app-inline-alert",28),e(4,` 1204 `),I(5,sl,7,2,null,null,F),a(),e(7,` 1205 `),a(),e(8,` 1206 `),E(9,cl,1,0,"ng-container",22),e(10,` 1207 `),I(11,ml,3,5,null,null,F)),n&2){let o=m(2),i=Le(6);c(3),d("isInline",!0),c(2),P(o.feeStructures[0].clubPaymentFees),c(4),d("ngTemplateOutlet",i),c(2),P(o.feeStructures[0].clubPaymentFees)}}function ul(n,s){n&1&&(e(0,` 1208 `),r(1,"div",6),e(2,` 1209 `),p(3,"app-skeleton-template",27),e(4,` 1210 `),a(),e(5,` 1211 `)),n&2&&(c(3),d("invertBg",!0))}function pl(n,s){if(n&1&&(e(0,` 1212 `),r(1,"h2",5),e(2,"Payment Fees"),a(),e(3,` 1213 `),f(4,dl,13,2),f(5,ul,6,1)),n&2){let o=m();c(4),h(o.loading?-1:4),c(),h(o.loading?5:-1)}}function fl(n,s){n&1&&(e(0,` 1214 `),r(1,"div",30),e(2,` 1215 `),r(3,"div",31),e(4,` 1216 Payment Type 1217 `),a(),e(5,` 1218 `),r(6,"div",31),e(7,"Status"),a(),e(8,` 1219 `),r(9,"div",32),e(10,"User Fee"),a(),e(11,` 1220 `),r(12,"div",32),e(13,"Club Fee"),a(),e(14,` 1221 `),p(15,"div",31),e(16,` 1222 `),a(),e(17,` 1223`))}function hl(n,s){if(n&1){let o=v();e(0,` 1224 `),r(1,"app-dynamic-form",33),S("onSubmit",function(t){x(o);let l=m();return b(l.saveFeeStructure(t))})("onCancel",function(){x(o);let t=m();return b(t.showFeeStructureDialog=!1)}),e(2,` 1225 `),p(3,"app-dynamic-form-field",34),e(4,` 1226 `),a(),e(5,` 1227 `)}if(n&2){let o=m();c(),d("fields",o.feeStructureFields)("entity",o.selectedFeeStructure)("horizontalForm",!1)("contentFieldsMode",!0)}}function _l(n,s){if(n&1){let o=v();e(0,` 1228`),r(1,"app-yes-no-modal",35),S("onYesSelect",function(){x(o);let t=m();return b(t.disableAllPaymentTypes())})("onNoSelect",function(){x(o);let t=m();return b(t.showDisableAllPaymentsConfirm=!1)}),e(2,` 1229 `),r(3,"div",36),e(4,` 1230 `),r(5,"app-inline-alert",7),e(6,` 1231 This action cannot be undone. Are you sure you want to disable all payments? 1232 `),a(),e(7,` 1233 `),a(),e(8,` 1234`),a(),e(9,` 1235`)}if(n&2){let o=m();c(),d("showModalText",!1)("loading",o.saving),c(4),d("isInline",!0)}}function Cl(n,s){if(n&1){let o=v();e(0,` 1236`),r(1,"app-yes-no-modal",37),S("onYesSelect",function(){x(o);let t=m();return b(t.saveFeeStructureActive(!1))})("onNoSelect",function(){x(o);let t=m();return b(t.showConfirmDeactivate=!1)}),e(2,` 1237 `),r(3,"div",36),e(4,` 1238 `),r(5,"app-inline-alert",7),e(6,` 1239 By deactivating this fee structure, all assignments (program type, program, donation, invoice, etc) will 1240 be updated or deleted to reflect this change. This action cannot be undone. Are you sure you want to 1241 deactivate this fee structure? 1242 `),a(),e(7,` 1243 `),a(),e(8,` 1244`),a(),e(9,` 1245`)}n&2&&(c(),d("showModalText",!1),c(4),d("isInline",!0))}var pn=(()=>{let s=class s{constructor(i,t,l,u){this.clubService=i,this.siteDataService=t,this.route=l,this.formService=u,this.viewOnlyMode=!1,this.PaymentVendor=Be,this.loading=!0,this.hasDefaultFeeStructure=!1,this.PaymentType=At,this.options=[],this.showFeeStructureDialog=!1,this.loadingFeeStructure=!1,this.showDisableAllPaymentsConfirm=!1,this.showConfirmDeactivate=!1,this.saving=!1,this.unsubscribe$=new ue}ngOnChanges(i){console.log(i.viewOnlyMode)}ngOnInit(){console.log(this.viewOnlyMode),this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,A({fees:this.paymentVendorID===Be.STRIPE?this.clubService.getClubPaymentFeeStructures(this.clubID):this.clubService.getClubPaymentFees(this.clubID),metadata:this.clubService.getClubPaymentFeesMetadata()}).pipe(J(this.unsubscribe$)).subscribe({next:i=>{this.feeStructures=i?.fees,this.feeStructures?.length&&(this.feeStructures[0].expanded=!0,this.hasDefaultFeeStructure=this.feeStructures.some(t=>t.isEnabled&&t.isDefault)),this.feeFields=i?.metadata?.fields,this.loading=!1},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}})}toggleOptionsMenu(i,t){this.selectedFeeStructure=i;let l=[];l.push({label:"Edit",command:()=>{this.editFeeStructure()}}),this.selectedFeeStructure.isEnabled?l.push({label:"Deactivate",command:()=>{this.showConfirmDeactivate=!0}}):l.push({label:"Activate",command:()=>{this.saveFeeStructureActive(!0)}}),this.options=[{label:"Options",items:l}],this.optionsMenu.toggle(t)}addFeeStructure(){this.selectedFeeStructure=new kt,this.editFeeStructure()}
1245editFeeStructure(){this.showFeeStructureDialog=!0,this.feeStructureFields||(this.loadingFeeStructure=!0,this.clubService.getClubPaymentFeeStructureMetadata().pipe(J(this.unsubscribe$)).subscribe({next:i=>{this.feeStructureFields=i.fields,this.loadingFeeStructure=!1},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}}))}saveFeeStructure(i){this.saving=!0,i.clubPaymentFeeStructureID=this.selectedFeeStructure.clubPaymentFeeStructureID,this.clubService.saveClubPaymentFeeStructure(i,this.clubID).pipe(J(this.unsubscribe$)).subscribe({next:t=>{t?(t.expanded=!0,this.feeStructures.push(t)):this.selectedFeeStructure.name=i.name,this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Fee structure saved"),this.showFeeStructureDialog=!1,this.saving=!1,this.hasDefaultFeeStructure=this.feeStructures?.some(l=>l.isDefault&&l.isEnabled),this.clubService.refreshAssignments.next()},error:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving the fee structure"),this.saving=!1}})}defaultClick(i){if(!this.viewOnlyMode){let t=i.isDefault;this.clubService.saveClubPaymentFeeStructureDefault(this.clubID,i.clubPaymentFeeStructureID,!t).pipe(J(this.unsubscribe$)).subscribe({next:()=>{this.updateDefault(t,i),i.isDefault?this.siteDataService.showSiteSuccessAlert(i.name+" set as default fee structure"):this.siteDataService.showSiteSuccessAlert(i.name+" removed as default fee structure"),this.hasDefaultFeeStructure=this.feeStructures?.some(l=>l.isDefault&&l.isEnabled),this.clubService.refreshAssignments.next()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem making this your default account")}})}}disableAllPaymentTypes(){let i=[];this.feeStructures.map(t=>t.clubPaymentFees).reduce((t,l)=>
1245t.concat(l)).forEach(t=>{let l=lt(Ee({},t),{isEnabled:!1}),u=this.clubService.saveClubPaymentFee(l,this.clubID).pipe(ft(_=>{t.isEnabled=!1,_?(t.clubPaymentFeeID=_.clubPaymentFeeID,t.feeDescription=_.feeDescription):this.clubService.setClubPaymentFeeDescription(t),this.saving=!1}));i.push(u)}),i.length&&(this.saving=!0,A(i).pipe(J(this.unsubscribe$)).subscribe({next:()=>{this.saving=!1,this.showDisableAllPaymentsConfirm=!1,this.clubService.refreshAssignments.next(),this.hasDefaultFeeStructure=this.feeStructures?.some(t=>t.isDefault&&t.isEnabled),this.siteDataService.showSiteSuccessAlert("All payments disabled")},error:()=>{this.saving=!1,this.siteDataService.showSiteErrorAlert("There was a problem disabling all payments")}}))}feeDeleted(i){let t=lt(Ee({},i),{clubPaymentFeeID:0,isEnabled:!0,userFeePercentage:i.paymentType.feePercentage,totalFeePercentage:0});if(i.clubPaymentFeeStructureID){let l=this.feeStructures.find(u=>u.clubPaymentFeeStructureID===i.clubPaymentFeeStructureID).clubPaymentFees.findIndex(u=>u.clubPaymentFeeID===i.clubPaymentFeeID);this.feeStructures.find(u=>u.clubPaymentFeeStructureID===i.clubPaymentFeeStructureID).clubPaymentFees.splice(l,1,t)}else{let l=this.feeStructures[0].clubPaymentFees.findIndex(u=>u.clubPaymentFeeID===i.clubPaymentFeeID);this.feeStructures[0].clubPaymentFees.splice(l,1,t)}this.hasDefaultFeeStructure=this.feeStructures?.some(l=>l.isDefault&&l.isEnabled)}saveFeeStructureActive(i){this.clubService.saveClubPaymentFeeStructureActive(this.clubID,this.selectedFeeStructure.clubPaymentFeeStructureID,i).pipe(J(this.unsubscribe$)).subscribe({next:()=>{this.showConfirmDeactivate=!1,this.selectedFeeStructure.isEnabled=i,this.clubService.refreshAssignments.next(),this.hasDefaultFeeStructure=this.feeStructures?.some(t=>t.isDefault&&t.isEnabled),this.siteDataService.showSiteSuccessAlert("Connected account updated")},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving the connected account")}})}updateDefault(i,t){i||this.feeStructures.filter(l=>l.clubPaymentFeeStructureID!==t.clubPaymentFeeStructureID).forEach(l=>l.isDefault=!1),t.isDefault=!i}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};s.\u0275fac=function(t){return new(t||s)(C(ve),C(D),C(T),C($))},s.\u0275cmp=y({type:s,selectors:[["app-payment-fees"]],viewQuery:function(t,l){if(t&1&&pe(Qr,5),t&2){let u;oe(u=ae())&&(l.optionsMenu=u.first)}},inputs:{paymentVendorID:"paymentVendorID",viewOnlyMode:"viewOnlyMode"},standalone:!1,features:[hi],decls:18,vars:20,consts:[["tableHeader",""],["optionsMenu",""],[1,"card","settings-card"],["appendTo","body",3,"model","popup"],["styleClass","standardWidthDialog",3,"visibleChange","visible","header","modal","resizable","closable","draggable"],[1,"text-large","text-navy","fw-800"],[1,"mb-3"],["alertType","warning",3,"isInline"],[1,"fw-600","text-medium"],["variant","secondary",3,"menuToggle","accordionToggle","dragDisabled","isAccordion","expanded","title","utilityPillText","utilityPillStatus"],["slot","title-prefix"],[1,"mr-2","mb-0","cursor-pointer",3,"title","for"],[1,"sr-only"],["aria-hidden","true",1,"favorite","text-large","text-yellow"],[1,"fa","fa-star"],["type","checkbox",1,"sr-only",3,"click","id","ngModel","disabled"],["slot","title-extra"],[1,"text-small","mr-3"],[1,"fas","text-grey-lt","fa-info-circle","ml-3","mr-2","text-large"],[1,"text-medium","mr-2"],[1,"fw-800","mr-1"],[1,"fee-structure-content","full-width","align-items-center","ml-0","mr-0"],[4,"ngTemplateOutlet"],[3,"deleted","fee","paymentVendorID","viewOnlyMode","defaultFields","borderBottom"],[1,"text-medium","fw-800"],["type","button",1,"btn","btn-icon-plus",3,"click","disabled"],["type","button",1,"btn",3,"click","disabled"],["height","20rem",3,"invertBg"],["alertType","info",3,"isInline"],[1,"text-medium","mr-3"],[1,"row","border-bottom","mx-0","mb-2","fw-800","text-medium","mt-3"],[1,"col-2"],[1,"col-3"],["submitButtonText","Save","buttonsPosition","spread","formID","fee-structure-form",3,"onSubmit","onCancel","fields","entity","horizontalForm","contentFieldsMode"],["fieldName","name","formID","fee-structure-form"],["headerText","Are you sure you want to disable payments?","dialogClass","standardWidthDialog","yesButtonText","Yes, Skip","noButtonText","Cancel",3,"onYesSelect","onNoSelect","showModalText","loading"],[1,"text-medium","fw-600"],["headerText","Are you sure you want to deactivate this fee structure?","dialogClass","standardWidthDialog","yesButtonText","Yes, Deactivate","noButtonText","Cancel",3,"onYesSelect","onNoSelect","showModalText"]],template:function(t,l){if(t&1){let u=v();r(0,"section",2),e(1,` 1246 `),f(2,ll,6,2),f(3,pl,6,2),a(),e(4,` 1247 1248`),E(5,fl,18,0,"ng-template",null,0,mt),e(7,` 1249 1250 1251`),r(8,"p-menu",3,1),e(10,` 1252`),a(),e(11,` 1253 1254`),r(12,"p-dialog",4),Y("visibleChange",function(g){return x(u),z(l.showFeeStructureDialog,g)||(l.showFeeStructureDialog=g),b(g)}),e(13,` 1255 `),f(14,hl,6,4),a(),e(15,` 1256 1257`),f(16,_l,10,3),f(17,Cl,10,2)}t&2&&(le("mb-3",l.paymentVendorID===l.PaymentVendor.STRIPE)("border-bottom",l.paymentVendorID===l.PaymentVendor.STRIPE),c(2),h(l.paymentVendorID===l.PaymentVendor.STRIPE?2:-1),c(),h(l.paymentVendorID!==l.PaymentVendor.STRIPE?3:-1),c(5),Ue(te(19,Gr)),d("model",l.options)("popup",!0),c(4),j("visible",l.showFeeStructureDialog),d("header",l.selectedFeeStructure!=null&&l.selectedFeeStructure.clubPaymentFeeStructureID?l.selectedFeeStructure.name:"Create Fee Structure")("modal",!0)("resizable",!1)("closable",!1)("draggable",!1),c(2),h(l.showFeeStructureDialog&&l.feeStructureFields&&l.selectedFeeStructure?14:-1),c(2),h(l.showDisableAllPaymentsConfirm?16:-1),c(),h(l.showConfirmDeactivate?17:-1))},dependencies:[_i,w,k,vt,ge,ye,H,_e,nt,Mt,Pe,je,un],encapsulation:2});let n=s;return n})();var ni=di(Ei());var bl=["optionsMenu"],Sl=()=>({width:"auto"});function vl(n,s){n&1&&e(0,`
1258 Amount 1259 `)}function gl(n,s){n&1&&e(0,` 1260 Percentage 1261 `)}function yl(n,s){if(n&1&&(e(0,` 1262 `),r(1,"app-dynamic-form-field",23),e(2,` 1263 `),a(),e(3,` 1264 `)),n&2){let o=m(2).$index,i=m(3).$index;c(),d("hideLabel",!0)("formID","fee-"+i+"-"+o)}}function Dl(n,s){n&1&&e(0,` 1265 Originating Connected Account 1266 `)}function Al(n,s){if(n&1&&(e(0,` 1267 `),r(1,"app-dynamic-form-field",24),e(2,` 1268 `),a(),e(3,` 1269 `)),n&2){let o=m(2).$index,i=m(3),t=i.$implicit,l=i.$index,u=m(2);c(),d("hideLabel",!0)("datepickerPanelClass",t.clubFeeTypeID!==u.ClubFeeType.ONE_TIME_FEE?"datepicker-hide-year":"")("formID","fee-"+l+"-"+o)}}function Tl(n,s){n&1&&e(0,` 1270 Nightly 1271 `)}function El(n,s){if(n&1&&(e(0,` 1272 `),r(1,"div",25),e(2,` 1273 `),r(3,"app-dynamic-form-field",26),e(4,` 1274 `),a(),e(5,` 1275 `),a(),e(6,` 1276 `)),n&2){let o=m(2).$index,i=m(3).$index;c(3),d("hideLabel",!0)("formID","fee-"+i+"-"+o)}}function wl(n,s){if(n&1&&(e(0,` 1277 `),r(1,"div",25),e(2,` 1278 `),r(3,"app-dynamic-form-field",27),e(4,` 1279 `),L(5,2,2),e(7,` 1280 `),r(8,"span",28),e(9,"%"),a(),e(10,` 1281 `),B(),e(11,` 1282 `),a(),e(12,` 1283 `),a(),e(13,` 1284 `)),n&2){let o=m(2).$index,i=m(3).$index;c(3),d("hideLabel",!0)("formID","fee-"+i+"-"+o)}}function Fl(n,s){n&1&&(e(0,` 1285 `),p(1,"app-status-indicator",29),e(2,` 1286 `),p(3,"app-tooltip",30),e(4,` 1287 `)),n&2&&(c(),d("dots",!0))}function Il(n,s){n&1&&(e(0,` 1288 `),p(1,"app-status-indicator",31),e(2,` 1289 `)),n&2&&(c(),d("dots",!0))}function Pl(n,s){n&1&&(e(0,` 1290 `),p(1,"app-status-indicator",32),e(2,` 1291 `)),n&2&&(c(),d("dots",!0))}function Ol(n,s){if(n&1&&(e(0,` 1292 `),f(1,Il,3,1),f(2,Pl,3,1)),n&2){let o=m(3).$implicit;c(),h(o.isEnabled?1:-1),c(),h(o.isEnabled?-1:2)}}function Ml(n,s){if(n&1&&(e(0,` 1293 `),f(1,Fl,5,1),f(2,Ol,3,2)),n&2){let o=m(2).$implicit;c(),h(o.isProcessing?1:-1),c(),h(o.isProcessing?-1:2)}}function Vl(n,s){n&1&&(e(0,` 1294 `),p(1,"app-status-indicator",33),e(2,` 1295 `)),n&2&&(c(),d("dots",!0))}function kl(n,s){if(n&1){let o=v();e(0,` 1296 `),r(1,"app-dynamic-form",13,1),e(3,` 1297 `),r(4,"div",14),e(5,` 1298 `),r(6,"div",10),e(7,` 1299 `),r(8,"app-dynamic-form-field",15),e(9,` 1300 `),a(),e(10,` 1301 `),a(),e(11,` 1302 `),r(12,"div",10),e(13,` 1303 `),f(14,yl,4,2)(15,Dl,1,0),a(),e(16,` 1304 `),r(17,"div",16),e(18,` 1305 `),f(19,Al,4,3)(20,Tl,1,0),a(),e(21,` 1306 `),f(22,El,7,2),f(23,wl,14,2),r(24,"div",17),e(25,` 1307 `),f(26,Ml,3,2),f(27,Vl,3,1),a(),e(28,` 1308 `),r(29,"div",18),e(30,` 1309 `),r(31,"button",19),S("click",function(){x(o);let t=m().$index,l=m(3).$implicit,u=m(2);return b(u.saveFee(l.clubFeeTypeID,t))}),e(32,` 1310 `),p(33,"i",20),e(34,` 1311 `),r(35,"div",21),e(36,"Save"),a(),e(37,` 1312 `),a(),e(38,` 1313 `),r(39,"button",19),S("click",function(t){x(o);let l=m().$implicit,u=m(3).$implicit,_=m(2);return b(_.toggleOptionsMenu(u,l,t))}),e(40,` 1314 `),p(41,"i",22),e(42,`
1315 `),r(43,"div",21),e(44,"Options"),a(),e(45,` 1316 `),a(),e(46,` 1317 `),a(),e(47,` 1318 `),a(),e(48,` 1319 `),a(),e(49,` 1320 `)}if(n&2){let o=Le(2),i=m(),t=i.$implicit,l=i.$index,u=i.$count,_=m(3),g=_.$implicit,Ie=_.$index,re=m(2);c(),d("fields",re.metadata[g.clubFeeTypeID][l].fields)("entity",t)("horizontalForm",!1)("showCancelButton",!1)("contentFieldsMode",!0)("showSubmitButton",!1)("formID","fee-"+g.clubFeeTypeID+"-"+l),c(3),le("border-bottom",l!==u-1),c(4),d("hideLabel",!0)("formID","fee-"+Ie+"-"+l),c(6),h(g.clubFeeTypeID===re.ClubFeeType.ANNUAL_FEE||g.clubFeeTypeID===re.ClubFeeType.ONE_TIME_FEE||g.clubFeeTypeID===re.ClubFeeType.CUSTOM_FEE?14:15),c(5),h(g.clubFeeTypeID===re.ClubFeeType.ANNUAL_FEE||g.clubFeeTypeID===re.ClubFeeType.ONE_TIME_FEE||g.clubFeeTypeID===re.ClubFeeType.CUSTOM_FEE?19:20),c(3),h(g.clubFeeTypeID!==re.ClubFeeType.INTERNATIONAL_CARD_FEE&&g.clubFeeTypeID!==re.ClubFeeType.OFFLINE_PAYMENT_FEE?22:-1),c(),h(g.clubFeeTypeID===re.ClubFeeType.INTERNATIONAL_CARD_FEE||g.clubFeeTypeID===re.ClubFeeType.OFFLINE_PAYMENT_FEE?23:-1),c(3),h(t.clubFeeID?26:-1),c(),h(t.clubFeeID?-1:27),c(4),d("disabled",re.viewOnlyMode||!(o!=null&&o.isValid)||re.saving||t.isProcessing),c(8),d("disabled",re.viewOnlyMode||!(o!=null&&o.isValid)||re.saving||t.isProcessing)}}function Nl(n,s){if(n&1&&(e(0,` 1321 `),f(1,kl,50,19)),n&2){let o=s.$index,i=m(3).$implicit,t=m(2);c(),h(i&&t.metadata[i.clubFeeTypeID][o]?1:-1)}}function Rl(n,s){if(n&1&&(e(0,` 1322 `),r(1,"div",8),e(2,` 1323 `),r(3,"div",9),e(4,` 1324 `),r(5,"div",10),e(6,` 1325 Description 1326 `),a(),e(7,` 1327 `),r(8,"div",10),e(9,"Connected Account"),a(),e(10,` 1328 `),r(11,"div",11),e(12,` 1329 Charge Date 1330 `),a(),e(13,` 1331 `),r(14,"div",11),e(15,` 1332 `),f(16,vl,1,0),f(17,gl,1,0),a(),e(18,` 1333 `),r(19,"div",12),e(20,"Status"),a(),e(21,` 1334 `),p(22,"div",12),e(23,` 1335 `),a(),e(24,` 1336 `),I(25,Nl,2,1,null,null,F),a(),e(27,` 1337 `)),n&2){let o=m(2).$implicit,i=m(2);c(16),h(o.clubFeeTypeID!==i.ClubFeeType.INTERNATIONAL_CARD_FEE&&o.clubFeeTypeID!==i.ClubFeeType.OFFLINE_PAYMENT_FEE?16:-1),c(),h(o.clubFeeTypeID===i.ClubFeeType.INTERNATIONAL_CARD_FEE||o.clubFeeTypeID===i.ClubFeeType.OFFLINE_PAYMENT_FEE?17:-1),c(8),P(o.clubFees)}}function Ll(n,s){n&1&&(e(0,` 1338 `),r(1,"div",34),e(2,` 1339 `),r(3,"app-inline-alert",35),e(4,` 1340 `),r(5,"span",36),e(6,` 1341 No fees configured 1342 `),a(),e(7,` 1343 `),a(),e(8,` 1344 `),a(),e(9,` 1345 `)),n&2&&(c(3),d("isInline",!1))}function Bl(n,s){if(n&1){let o=v();e(0,` 1346 `),r(1,"button",37),S("click",function(){x(o);let t=m(2).$implicit,l=m(2);return b(l.addFee(t))}),e(2),a(),e(3,` 1347 `)}if(n&2){let o=m(2).$implicit;c(2),V(` 1348 Add `,o.description,` 1349 `)}}
1349function $l(n,s){if(n&1&&(e(0,` 1350 `),r(1,"div",7),e(2,` 1351 `),f(3,Rl,28,2)(4,Ll,10,1),f(5,Bl,4,1),a(),e(6,` 1352 `)),n&2){let o=m().$implicit;c(3),h(o.clubFees!=null&&o.clubFees.length?3:4),c(2),h(!(o.clubFees!=null&&o.clubFees.length)||o.allowMultiple?5:-1)}}function Wl(n,s){if(n&1){let o=v();e(0,` 1353 `),r(1,"app-step-content-ui",6),S("accordionToggle",function(){let t=x(o).$implicit;return b(t.expanded=!t.expanded)}),e(2,` 1354 `),f(3,$l,7,2),a(),e(4,` 1355 `)}if(n&2){let o=s.$implicit;c(),d("dragDisabled",!0)("showMenu",!1)("isAccordion",!0)("expanded",o.expanded)("title",o.allowMultiple?o.description+"s":o.description),c(2),h(o.expanded?3:-1)}}function Ul(n,s){if(n&1&&(e(0,` 1356 `),I(1,Wl,5,6,null,null,F)),n&2){let o=m();c(),P(o.fees)}}function jl(n,s){n&1&&(e(0,` 1357 `),r(1,"div",38),e(2,` 1358 `),p(3,"app-skeleton-template",39),e(4,` 1359 `),a(),e(5,` 1360 `)),n&2&&(c(3),d("invertBg",!0))}function zl(n,s){if(n&1){let o=v();e(0,` 1361`),r(1,"app-yes-no-modal",40),S("onYesSelect",function(){x(o);let t=m();return b(t.deleteClubFee())})("onNoSelect",function(){x(o);let t=m();return b(t.showConfirmDelete=!1)}),e(2,` 1362 `),r(3,"div",41),e(4,` 1363 `),r(5,"app-inline-alert",35),e(6,` 1364 Are you sure you want to delete this club fee? 1365 `),a(),e(7,` 1366 `),a(),e(8,` 1367`),a(),e(9,` 1368`)}n&2&&(c(),d("showModalText",!1),c(4),d("isInline",!0))}var fn=(()=>{let s=class s{constructor(i,t,l){this.siteDataService=i,this.paymentSettingsService=t,this.route=l,this.viewOnlyMode=!1,this.loading=!0,this.ClubFeeType=Me,this.metadata={},this.saving=!1,this.options=[],this.showConfirmDelete=!1,this.forms=new _t,this.unsubscribe$=new ue}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,A({fees:this.paymentSettingsService.getClubFees(this.clubID),metadata:this.paymentSettingsService.getClubFeeMetadata(this.clubID)}).pipe(J(this.unsubscribe$)).subscribe({next:i=>{this.fees=i.fees,this.defaultMetadata=i.metadata,Object.keys(this.defaultMetadata).forEach(t=>{this.defaultMetadata[t].fields.filter(u=>u.controlName==="chargeOn").forEach(u=>{u.minDate=new Date(u.minDate),u.maxDate=new Date(u.maxDate),(+t===Me.ANNUAL_FEE||+t===Me.CUSTOM_FEE)&&(u.yearRange="9999:9999")}),this.metadata[+t]={},(this.fees.find(u=>u.clubFeeTypeID===+t)?.clubFees).forEach((u,_)=>{this.metadata[+t][_]=(0,ni.cloneDeep)(this.defaultMetadata[+t]),u.isProcessing&&(this.metadata[+t][_].disabled=!0,this.metadata[+t][_].fields.forEach(g=>g.disabled=!0))})}),this.fees.forEach(t=>{t.expanded=!0,t.clubFees?.length?t.clubFees.forEach(l=>{(t.clubFeeTypeID===Me.ANNUAL_FEE||t.clubFeeTypeID===Me.CUSTOM_FEE)&&(l.chargeOn=new Date(l.chargeOn))}):this.addFee(t)}),this.loading=!1},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}})}addFee(i){let t=this.defaultMetadata[i.clubFeeTypeID].fields.find(u=>u.controlName==="clubStripeConnectedAccountID"),l=null;t?.options?.length&&(l=+t.options[0].value),i.clubFees.push(new Rt(i.clubFeeTypeID,l,i.defaultAmount,i.defaultDescription)),this.metadata[i.clubFeeTypeID][i.clubFees.length-1]=(0,ni.cloneDeep)(this.defaultMetadata[i.clubFeeTypeID])}saveFee(i,t){let l=this.forms.find(u=>u.formID===`fee-${i}-${t}`);if(l)if(l.isValid){this.saving=!0;let u=this.fees.find(Ie=>Ie.clubFeeTypeID===i),_=u.clubFees[t],g=Ee(Ee({},_),l.validFieldsValue);l.validFieldsValue.clubStripeConnectedAccountID||(g.clubStripeConnectedAccountID=null),g.clubFeeID||(g.isEnabled=!0,g.isRemoved=!1),this.paymentSettingsService.saveClubFee(i,g,this.clubID).pipe(J(this.unsubscribe$)).subscribe({next:Ie=>{Ie&&(g.clubFeeID=Ie.clubFeeID),u.clubFees.splice(t,1,g),this.saving=!1,this.siteDataService.showSiteSuccessAlert("Club fee saved successfully")},error:()=>{this.saving=!1,this.siteDataService.showSiteErrorAlert("There was a problem saving this club fee")}})}else l.submitForm()}toggleOptionsMenu(i,t,l){this.selectedFeeType=i,this.selectedClubFee=t;let u=[];t.isEnabled?u.push({label:"Disable",command:()=>{this.updateClubFeeEnabled(!1)}}):u.push({label:"Enable",command:()=>{this.updateClubFeeEnabled(!0)}}),i.allowMultiple&&i?.clubFees?.length>1&&u.push({label:"Delete",command:()=>{this.showConfirmDelete=!0}}),this.options=[{label:"Options",items:u}],this.optionsMenu.toggle(l)}updateClubFeeEnabled(i){this.saving=!0,this.paymentSettingsService.saveClubFeeEnabled(i,this.selectedClubFee.clubFeeID,this.clubID).pipe(J(this.unsubscribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert(`Club fee ${i?"enabled":"disabled"}`),this.selectedClubFee.isEnabled=i,this.saving=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving this club fee"),this.saving=!1}})}deleteClubFee(){this.saving=!0,this.paymentSettingsService.deleteClubFee(this.selectedClubFee.clubFeeID,this.clubID).pipe(J(this.unsubscribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Club fee deleted");let i=this.selectedFeeType.clubFees.findIndex(t=>t.clubFeeID===this.selectedClubFee.clubFeeID);this.selectedFeeType.clubFees.splice(i,1),this.selectedFeeType.clubFees.length||this.addFee(this.selectedFeeType),this.saving=!1,this.showConfirmDelete=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem deleting this club fee"),this.saving=!1}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};s.\u0275fac=function(t){return new(t||s)(C(D),C(ve),C(T))},s.\u0275cmp=y({type:s,selectors:[["app-club-fees"]],viewQuery:function(t,l){if(t&1&&pe(bl,5)(w,5),t&2){let u;oe(u=ae())&&(l.optionsMenu=u.first),oe(u=ae())&&(l.forms=u)}},inputs:{viewOnlyMode:"viewOnlyMode"},standalone:!1,decls:13,vars:8,consts:[["optionsMenu",""],["form",""],["inputGroupEnd",""],[1,"card","settings-card","club-fees"],[1,"text-large","text-navy","fw-800"],["appendTo","body",3,"model","popup"],["variant","secondary",3,"accordionToggle","dragDisabled","showMenu","isAccordion","expanded","title"],[1,"fee-structure-content","full-width","align-items-center"],[1,"mt-3","ml-0","mr-0"],[1,"row","border-bottom","mx-0","mb-2","fw-800","text-medium"],[1,"col-md-3","col-12"],[1,"col-md-2","col-12"],[1,"col-md-1","col-12"],["submitButtonText","Save","buttonsPosition","left",3,"fields","entity","horizontalForm","showCancelButton","contentFieldsMode","showSubmitButton","formID"],[1,"row","mx-0","mb-2","pb-2","d-flex","align-items-center"],["fieldName","description","styleClass","mb-0",3,"hideLabel","formID"],[1,"col-md-2","col-12","d-flex","align-items-center"],[1,"col-md-1","col-12","d-flex","align-items-center"],[1,"col-md-1","col-12","d-flex","align-items-center","justify-content-end"],["type","button",1,"btn","btn-sm","btn-tertiary","ml-3","text-medium",3,"click","disabled"],[1,"fa-solid","fa-save"],[1,"sr-only"],[1,"fa-solid","fa-ellipsis"],["fieldName","clubStripeConnectedAccountID","styleClass","mb-0",3,"hideLabel","formID"],["fieldName","chargeOn","styleClass","mb-0",3,"hideLabel","datepickerPanelClass","formID"],[1,"col-md-2","col-12","no-wrap"],["fieldName","amount","styleClass","mb-0",3,"hideLabel","formID"],["fieldName","percentage","styleClass","mb-0",3,"hideLabel","formID"],[1,"text-medium"],["status","warning","text","Processing...",3,"dots"],["tooltipText","Fees are not editable while being processed. In the event of a failure, the fee will be retried once per day up to 10 times."],["status","active","text","Enabled",3,"dots"],["status","warning","text","Disabled",3,"dots"],["status","warning","text","Unsaved",3,"dots"],[1,"mb-3","mx-3"],["alertType","warning",3,"isInline"],[1,"text-medium","fw-800"],["type","button",1,"btn","btn-icon-plus","mb-3","ml-3",3,"click"],[1,"mb-3"],["height","20rem",3,"invertBg"],["headerText","Confirm Delete","dialogClass","standardWidthDialog","yesButtonText","Yes, Delete","noButtonText","Cancel",3,"onYesSelect","onNoSelect","showModalText"],[1,"text-medium","fw-600"]],template:function(t,l){t&1&&(r(0,"section",3),e(1,` 1369 `),r(2,"h2",4),e(3,` 1370 Club Fees 1371 `),a(),e(4,` 1372 `),f(5,Ul,3,0),f(6,jl,6,1),a(),e(7,` 1373 1374`),r(8,"p-menu",5,0),e(10,` 1375`),a(),e(11,` 1376 1377`),f(12,zl,10,2)),t&2&&(c(5),h(l.loading?-1:5),c(),h(l.loading?6:-1),c(2),Ue(te(7,Sl)),d("model",l.options)("popup",!0),c(4),h(l.showConfirmDelete?12:-1))},dependencies:[w,k,tt,Mi,H,_e,nt,Mt,je],encapsulation:2});let n=s;return n})();function ql(n,s){n&1&&(e(0,` 1378 `),r(1,"div",12),e(2,` 1379 `),r(3,"app-inline-alert",13),e(4,` 1380 `),r(5,"span",14),e(6,` 1381 Please note: any changes made on this page are LIVE. 1382 `),a(),e(7,` 1383 `),a(),e(8,` 1384 `),a(),e(9,` 1385 `)),n&2&&(c(3),d("isInline",!1))}
1385function Hl(n,s){if(n&1){let o=v();e(0,` 1386 `),r(1,"app-dynamic-form",15),S("onSubmit",function(t){x(o);let l=m(2);return b(l.savePaymentVendor(t))}),e(2,` 1387 `),p(3,"app-dynamic-form-field",16),e(4,` 1388 `),a(),e(5,` 1389 `)}if(n&2){let o=m(2);c(),d("fields",o.vendorFields)("entity",o.paymentVendor)("horizontalForm",!0)("contentFieldsMode",!0)("showSubmitButton",!o.viewOnlyMode)("showSaveAndAddButton",!1)("showCancelButton",!1)("showConfirmSaveDialog",!0)("showDeleteButton",!1)}}function Ql(n,s){n&1&&(e(0,` 1390 `),p(1,"app-skeleton-template",17),e(2,` 1391 `))}function Gl(n,s){if(n&1){let o=v();e(0,` 1392 `),f(1,ql,10,1),r(2,"section"),e(3,` 1393 `),r(4,"h1",3),e(5,"Active Payment Vendor"),a(),e(6,` 1394 `),r(7,"div",4),e(8,` 1395 `),f(9,Hl,6,9),E(10,Ql,3,0,"ng-template",null,1,mt),e(12,` 1396 `),a(),e(13,` 1397 `),a(),e(14,` 1398 `),r(15,"section"),e(16,` 1399 `),r(17,"h1",3),e(18,"Vendor Settings"),a(),e(19,` 1400 `),r(20,"div",5),e(21,` 1401 `),r(22,"ul",6),e(23,` 1402 `),r(24,"li",7),e(25,` 1403 `),r(26,"a",8),S("click",function(){x(o);let t=m();return b(t.selectTab(t.PaymentVendor.PAYRIX))}),e(27,"Payrix"),a(),e(28,` 1404 `),a(),e(29,` 1405 `),r(30,"li",7),e(31,` 1406 `),r(32,"a",8),S("click",function(){x(o);let t=m();return b(t.selectTab(t.PaymentVendor.STRIPE))}),e(33,"Stripe"),a(),e(34,` 1407 `),a(),e(35,` 1408 `),a(),e(36,` 1409 `),a(),e(37,` 1410 `),r(38,"div",9),e(39,` 1411 `),p(40,"app-payment-fees",10),e(41,` 1412 `),a(),e(42,` 1413 `),r(43,"div",9),e(44,` 1414 `),p(45,"app-connected-account-search",11),e(46,` 1415 `),p(47,"app-payment-fees",10),e(48,` 1416 `),p(49,"app-assignments",11),e(50,` 1417 `),p(51,"app-club-fees",11),e(52,` 1418 `),a(),e(53,` 1419 `),a(),e(54,` 1420 `)}if(n&2){let o=m();c(),h(o.viewOnlyMode?-1:1),c(8),h(!o.loadingVendor&&o.vendorFields?9:-1),c(15),le("active",o.selectedTab===o.PaymentVendor.PAYRIX),c(6),le("active",o.selectedTab===o.PaymentVendor.STRIPE),c(8),d("hidden",o.selectedTab===o.PaymentVendor.STRIPE),c(2),d("viewOnlyMode",o.viewOnlyMode)("paymentVendorID",o.PaymentVendor.PAYRIX),c(3),d("hidden",o.selectedTab===o.PaymentVendor.PAYRIX),c(2),d("viewOnlyMode",o.viewOnlyMode),c(2),d("viewOnlyMode",o.viewOnlyMode)("paymentVendorID",o.PaymentVendor.STRIPE),c(2),d("viewOnlyMode",o.viewOnlyMode),c(2),d("viewOnlyMode",o.viewOnlyMode)}}function Jl(n,s){n&1&&(e(0,` 1421 `),p(1,"app-connected-account-search",11),e(2,` 1422 `)),n&2&&(c(),d("viewOnlyMode",!0))}function Xl(n,s){n&1&&(e(0,` 1423 `),r(1,"div",18),e(2,` 1424 `),p(3,"app-skeleton-template",19),e(4,` 1425 `),a(),e(5,` 1426`)),n&2&&(c(3),d("invertBg",!0))}var $t=(()=>{let s=class s{constructor(i,t,l,u,_,g){this.authorizeService=i,this.clubService=t,this.siteDataService=l,this.formService=u,this.route=_,this.paymentSettingsService=g,this.viewOnlyMode=!1,this.loadingVendor=!0,this.PaymentVendor=Be,this.userIsSuperAdmin=!1,this.userIsClubAdmin=!1,this.unsubcribe$=new ue}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.authorizeService.getUser().pipe(We(1)).subscribe({next:i=>{i&&this.authorizeService.isSuperAdmin(i.role)&&(this.userIsSuperAdmin=!0),i&&this.authorizeService.isAdmin(i.role)&&(this.userIsClubAdmin=!0);let t=this.authorizeService.getUserPermissionValue(i,K.PaymentSettingsAccess);this.viewOnlyMode=t===Si.VIEW,this.siteDataService.hideSiteLoader()}}),this.userIsSuperAdmin&&A({paymentVendorMetadata:this.clubService.getPaymentVendorMetadata(),paymentVendor:this.clubService.getPaymentVendor(this.clubID)}).pipe(J(this.unsubcribe$)).subscribe({next:i=>{this.vendorFields=i.paymentVendorMetadata.fields,this.paymentVendor=i.paymentVendor,this.paymentSettingsService.vendorSettingsTabID?this.selectedTab=this.paymentSettingsService.vendorSettingsTabID:(this.selectedTab=i.paymentVendor.paymentVendorID,this.paymentSettingsService.vendorSettingsTabID=this.selectedTab),this.loadingVendor=!1},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}})}selectTab(i){this.selectedTab=i,this.paymentSettingsService.vendorSettingsTabID=this.selectedTab}savePaymentVendor(i){this.clubService.savePaymentVendor(i,this.clubID).pipe(J(this.unsubcribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Active payment vendor updated"),this.formService.hideFormLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving the active payment vendor."),this.formService.hideFormLoader()}})}ngOnDestroy(){this.unsubcribe$.next(),this.unsubcribe$.complete()}};s.\u0275fac=function(t){return new(t||s)(C(he),C(ve),C(D),C($),C(T),C(ve))},s.\u0275cmp=y({type:s,selectors:[["app-payment-settings"]],standalone:!1,decls:10,vars:4,consts:[["skeleton",""],["loading",""],["parentLinkText","Settings","parentLinkUrl","../",3,"pageTitle","showBackButton"],[1,"text-larger","fw-800"],[1,"card","settings-card"],[1,"tabs","mb-3"],["role","tablist",1,"tab-nav","no-bullets","inline-list"],[1,"nav-item"],["href","javascript:void(0)","role","tab","aria-controls","home","aria-selected","true",1,"nav-link",3,"click"],[3,"hidden"],[3,"viewOnlyMode","paymentVendorID"],[3,"viewOnlyMode"],[1,"my-3"],["alertType","warning",3,"isInline"],[1,"fw-800","text-medium"],["buttonsPosition","left","confirmSaveMessage","Are you sure you want to change active payment vendors?",3,"onSubmit","fields","entity","horizontalForm","contentFieldsMode","showSubmitButton","showSaveAndAddButton","showCancelButton","showConfirmSaveDialog","showDeleteButton"],["fieldName","paymentVendorID"],["skeletonType","form-single-text-input"],[1,"mb-3"],["height","20rem",3,"invertBg"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 1427 `),r(2,"app-admin-header",2),e(3,` 1428 `),a(),e(4,` 1429 `),f(5,Gl,55,15),f(6,Jl,3,1),a(),e(7,` 1430`),E(8,Xl,6,1,"ng-template",null,0,mt)),t&2&&(c(2),d("pageTitle","Payment Settings")("showBackButton",!0),c(3),h(l.userIsSuperAdmin?5:-1),c(),h(!l.userIsSuperAdmin&&l.userIsClubAdmin?6:-1))},dependencies:[w,k,H,_e,N,ut,dn,pn,fn],encapsulation:2});let n=s;return n})();var Kl=()=>["new"],Zl=n=>[n];function es(n,s){if(n&1&&(e(0,` 1431 `),r(1,"th",10),e(2),p(3,"p-sortIcon",11),e(4,` 1432 `),a(),e(5,` 1433 `)),n&2){let o=s.$implicit,i=m(3);c(),d("pSortableColumn",o.field),ee("aria-label",i.AriaLabels.ACTIVATE_SORT),c(),V(` 1434 `,o.header,` 1435 `),c(),d("field",o.field)}}function ts(n,s){if(n&1&&(e(0,` 1436 `),r(1,"tr"),e(2,` 1437 `),I(3,es,6,4,null,null,F),p(5,"th"),e(6,` 1438 `),a(),e(7,` 1439 `)),n&2){let o=m(2);c(3),P(o.columns)}}function is(n,s){if(n&1){let o=v();e(0,` 1440 `),r(1,"button",13),S("click",function(){x(o);let t=m().$implicit,l=m(2);return b(l.setupDeleteConfirm(t.clubFiscalYearID))}),e(2,"Delete"),a(),e(3,` 1441 `)}}function ns(n,s){if(n&1&&(e(0,` 1442 `),r(1,"tr"),e(2,` 1443 `),r(3,"td")(4,"a",12),e(5),Qe(6,"date"),a()(),e(7,` 1444 `),r(8,"td"),e(9),Qe(10,"date"),a(),e(11,` 1445 `),r(12,"td"),e(13),Qe(14,"currency"),a(),e(15,` 1446 `),r(16,"td"),f(17,is,4,0),a(),e(18,` 1447 `),a(),e(19,` 1448 `)),n&2){let o=s.$implicit;c(4),d("routerLink",Se(13,Zl,o.clubFiscalYearID)),c(),O(Ut(6,5,o.startDate,"MM/dd
1448/yyyy")),c(4),O(Ut(10,8,o.endDate,"MM/dd/yyyy")),c(4),O(ct(14,11,o.financialAidBudgetAmount)),c(4),h(o.default?-1:17)}}function os(n,s){if(n&1&&(e(0,` 1449 `),r(1,"section",3),e(2,` 1450 `),r(3,"h3"),e(4,"Fiscal Years"),a(),e(5,` 1451 `),r(6,"div",4),e(7,` 1452 `),r(8,"p-table",5),e(9,` 1453 `),E(10,ts,8,0,"ng-template",6),e(11,` 1454 `),E(12,ns,20,15,"ng-template",7),e(13,` 1455 `),a(),e(14,` 1456 `),a(),e(15,` 1457 `),r(16,"div",8),e(17,` 1458 `),r(18,"a",9),e(19,` 1459 Add Fiscal Year 1460 `),a(),e(20,` 1461 `),a(),e(21,` 1462 `),a(),e(22,` 1463 `)),n&2){let o=m();c(8),d("columns",o.columns)("value",o.searchResults),c(10),d("routerLink",te(3,Kl))}}function as(n,s){n&1&&(e(0,` 1464 `),r(1,"div",14),e(2,` 1465 `),p(3,"app-skeleton-template",15),e(4,` 1466 `),a(),e(5,` 1467 `)),n&2&&(c(3),d("invertBg",!0))}function rs(n,s){if(n&1){let o=v();e(0,` 1468 `),r(1,"app-dialog-footer"),e(2,` 1469 `),L(3,16),e(4,` 1470 `),r(5,"button",17),S("click",function(){x(o);let t=m();return b(t.showModal=!1)}),e(6,"No"),a(),e(7,` 1471 `),B(),e(8,` 1472 `),L(9,18),e(10,` 1473 `),r(11,"button",19),S("click",function(){x(o);let t=m();return b(t.delete())}),e(12,"Yes"),a(),e(13,` 1474 `),B(),e(14,` 1475 `),a(),e(15,` 1476 `)}}var oi=(()=>{let s=class s{constructor(i,t,l){this.clubService=i,this.siteDataService=t,this.route=l,this.AriaLabels=fe,this.showModal=!1,this.loading=!0,this.columns=[{field:"startDate",header:"Start Date"},{field:"endDate",header:"End Date"},{field:"financialAidBudgetAmount",header:"Financial Aid Budget"}]}ngOnInit(){this.siteDataService.hideSiteLoader(),this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.clubService.getFiscalYears(this.clubID).subscribe({next:i=>{this.searchResults=i,this.loading=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}setupDeleteConfirm(i){this.clubFiscalYearID=i,this.showModal=!0}delete(){this.clubService.deleteFiscalYear(this.clubID,this.clubFiscalYearID).subscribe({next:()=>{this.searchResults.splice(this.searchResults.findIndex(i=>i.clubFiscalYearID===this.clubFiscalYearID),1),this.searchResults=[...this.searchResults],this.siteDataService.showSiteSuccessAlert("Fiscal Year was deleted successfully"),this.showModal=!1},error:i=>{this.siteDataService.showSiteErrorAlert("There was a problem processing your request. "+i.error),this.showModal=!1}})}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C(T))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:12,vars:3,consts:[["pageTitle","Fiscal Years & Financial Aid Settings","parentLinkText","Settings","parentLinkUrl","../",3,"showBackButton"],["header","Delete Fiscal Year","styleClass","shortWidthDialog",3,"visibleChange","visible"],["pTemplate","footer"],[1,"card"],[1,"table-responsive","mb-3"],["sortField","fromName",1,"table","table-striped","table-sm",3,"columns","value"],["pTemplate","header"],["pTemplate","body"],[1,"report-filter-action"],[1,"btn","btn-add","btn-large",3,"routerLink"],[3,"pSortableColumn"],[3,"field"],[3,"routerLink"],[1,"btn","btn-sm",3,"click"],[1,"mb-3"],["height","20rem",3,"invertBg"],["slot","secondary"],[1,"btn","btn-secondary",3,"click"],["slot","primary"],[1,"btn","btn-primary",3,"click"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 1477 `),r(2,"app-admin-header",0),e(3,` 1478 `),a(),e(4,` 1479 `),f(5,os,23,4)(6,as,6,1),a(),e(7,` 1480 1481`),r(8,"p-dialog",1),Y("visibleChange",function(_){return z(l.showModal,_)||(l.showModal=_),_}),e(9,` 1482 Are you sure you want to delete this fiscal year? 1483 `),E(10,rs,16,0,"ng-template",2),e(11,` 1484`),a()),t&2&&(c(2),d("showBackButton",!0),c(3),h(l.loading?6:5),c(3),j("visible",l.showModal))},dependencies:[ie,ne,H,N,ke,se,Ce,xe,Pe,xi,Ci],encapsulation:2});let n=s;return n})();function ls(n,s){if(n&1){let o=v();e(0,` 1485 `),r(1,"app-dynamic-form",2),S("onSubmit",function(t){x(o);let l=m();return b(l.saveFiscalYear(t))})("onCancel",function(){x(o);let t=m();return b(t.cancel())}),e(2,` 1486 `),p(3,"app-dynamic-form-field",3),e(4,` 1487 `),p(5,"app-dynamic-form-field",4),e(6,` 1488 `),p(7,"app-dynamic-form-field",5),e(8,` 1489 `),a(),e(9,` 1490 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.clubFiscalYear)("horizontalForm",!0)("contentFieldsMode",!0)}}var ai=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_}
1490ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.clubFiscalYearID=this.route.snapshot.params.clubFiscalYearID,A({metadata:this.clubService.getFiscalYearMetadata(),clubFiscalYear:this.clubFiscalYearID!=="new"?this.clubService.getFiscalYear(this.clubID,+this.clubFiscalYearID):Z(null)}).subscribe(i=>{this.fields=i.metadata.fields,this.clubFiscalYearID!=="new"&&(this.clubFiscalYear=i.clubFiscalYear),this.siteDataService.hideSiteLoader()})}saveFiscalYear(i){this.clubService.saveFiscalYear(this.clubID,this.clubFiscalYearID,i).subscribe({next:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Fiscal year information saved successfully"),this.router.navigate([".."],{relativeTo:this.route})},error:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving fiscal year information.")}})}cancel(){this.router.navigate([".."],{relativeTo:this.route})}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C($),C(T),C(q))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:9,vars:2,consts:[["pageTitle","Edit","grandParentLinkText","Settings","grandParentLinkUrl","../../","parentLinkUrl","../","parentLinkText","Fiscal Years & Financial Aid Settings",3,"showBackButton"],[1,"horizontal-form","p-3"],["submitButtonText","Save","buttonsPosition","left",3,"onSubmit","onCancel","fields","entity","horizontalForm","contentFieldsMode"],["fieldName","startDate"],["fieldName","endDate"],["fieldName","financialAidBudgetAmount"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 1491 `),r(2,"app-admin-header",0),e(3,` 1492 `),a(),e(4,` 1493 1494 `),r(5,"section",1),e(6,` 1495 `),f(7,ls,10,4),a(),e(8,` 1496`),a()),t&2&&(c(2),d("showBackButton",!0),c(5),h(l.fields?7:-1))},dependencies:[w,k,N],encapsulation:2});let n=s;return n})();var cs=n=>[n],ms=()=>["new"];function ds(n,s){if(n&1&&(e(0,` 1497 `),r(1,"th",20),e(2),p(3,"p-sortIcon",21),e(4,` 1498 `),a(),e(5,` 1499 `)),n&2){let o=s.$implicit,i=m(3);c(),d("pSortableColumn",o.field),ee("aria-label",i.AriaLabels.ACTIVATE_SORT),c(),V(` 1500 `,o.header,` 1501 `),c(),d("field",o.field)}}function us(n,s){if(n&1&&(e(0,` 1502 `),r(1,"tr"),e(2,` 1503 `),I(3,ds,6,4,null,null,F),p(5,"th"),e(6,` 1504 `),a(),e(7,` 1505 `)),n&2){let o=m(2);c(3),P(o.columns)}}function ps(n,s){if(n&1&&(e(0,` 1506 `),r(1,"a",22),e(2),a(),e(3,` 1507 `)),n&2){let o=m().$implicit;c(),d("routerLink",Se(2,cs,o.clubAccountingClassID)),c(),O(o.accountingClassName)}}function fs(n,s){if(n&1&&e(0),n&2){let o=m().$implicit;V(` 1508 `,o.accountingClassName,` 1509 `)}}function hs(n,s){if(n&1){let o=v();e(0,` 1510 `),r(1,"button",23),S("click",function(){x(o);let t=m().$implicit,l=m(2);return b(l.setupDeleteConfirm(t.clubAccountingClassID))}),e(2,"Delete"),a(),e(3,` 1511 `)}}function _s(n,s){if(n&1&&(e(0,` 1512 `),r(1,"tr"),e(2,` 1513 `),r(3,"td"),f(4,ps,4,4)(5,fs,1,1),a(),e(6,` 1514 `),r(7,"td"),f(8,hs,4,0),a(),e(9,` 1515 `),a(),e(10,` 1516 `)),n&2){let o=s.$implicit;c(4),h(o.assigned?5:4),c(4),h(o.assigned?-1:8)}}function Cs(n,s){n&1&&(e(0,` 1517 `),r(1,"a",24),e(2,` 1518 Add Accounting Class 1519 `),a(),e(3,` 1520 `)),n&2&&(c(),d("routerLink",te(1,ms)))}function xs(n,s){if(n&1){let o=v();e(0,` 1521 `),r(1,"a",25),S("click",function(){x(o);let t=m(2);return b(t.setupAssignModal())}),e(2,` 1522 Assign Accounting Class 1523 `),a(),e(3,` 1524 `)}}function bs(n,s){if(n&1&&(e(0,` 1525 `),r(1,"section",15),e(2,` 1526 `),r(3,"h3"),e(4,"Accounting Classes"),a(),e(5,` 1527 `),r(6,"div",16),e(7,` 1528 `),r(8,"p-table",17),e(9,` 1529 `),E(10,us,8,0,"ng-template",18),e(11,` 1530 `),E(12,_s,11,2,"ng-template",19),e(13,` 1531 `),a(),e(14,` 1532 `),a(),e(15,` 1533 `),r(16,"div"),e(17,` 1534 `),f(18,Cs,4,2),a(),e(19,` 1535 `),r(20,"div"),e(21,` 1536 `),f(22,xs,4,0),a(),e(23,` 1537 `),a(),e(24,` 1538 `)),n&2){let o=m();c(8),d("columns",o.columns)("value",o.filteredResults),c(10),h(!o.clubID||o.acctClassesOptionEnabled?18:-1),c(4),h(o.clubID&&!o.acctClassesOptionEnabled?22:-1)}}function Ss(n,s){n&1&&(e(0,` 1539 `),r(1,"div",26),e(2,` 1540 `),p(3,"app-skeleton-template",27),e(4,` 1541 `),a(),e(5,` 1542 `)),n&2&&(c(3),d("invertBg",!0))}function vs(n,s){if(n&1){let o=v();e(0,` 1543 `),r(1,"app-dialog-footer"),e(2,` 1544 `),L(3,28),e(4,` 1545 `),r(5,"button",29),S("click",function(){x(o);let t=m();return b(t.showModal=!1)}),e(6,"No"),a(),e(7,` 1546 `),B(),e(8,` 1547 `),L(9,30),e(10,` 1548 `),r(11,"button",31),S("click",function(){x(o);let t=m();return b(t.delete())}),e(12,"Yes"),a(),e(13,` 1549 `),B(),e(14,` 1550 `),a(),e(15,` 1551 `)}}function gs(n,s){if(n&1){let o=v();e(0,` 1552 `),r(1,"app-dialog-footer"),e(2,` 1553 `),L(3,28),e(4,` 1554 `),r(5,"button",32),S("click",function(){x(o);let t=m();
1554return b(t.showAssignModal=!1)}),e(6,"Cancel"),a(),e(7,` 1555 `),B(),e(8,` 1556 `),L(9,30),e(10,` 1557 `),r(11,"button",31),S("click",function(){x(o);let t=m();return b(t.save())}),e(12,"Save"),a(),e(13,` 1558 `),B(),e(14,` 1559 `),a(),e(15,` 1560 `)}}var ri=(()=>{let s=class s{get filteredResults(){if(!this.filterText?.trim())return this.searchResults;let i=this.filterText.toLowerCase();return(this.searchResults||[]).filter(t=>t.accountingClassName?.toLowerCase().includes(i))}constructor(i,t,l){this.clubService=i,this.siteDataService=t,this.route=l,this.filterText="",this.AriaLabels=fe,this.showModal=!1,this.acctClassesOptionEnabled=!1,this.showAssignModal=!1,this.loading=!0,this.columns=[{field:"accountingClassName",header:"Name"}]}ngOnInit(){this.siteDataService.hideSiteLoader(),this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,A({classes:this.clubService.getClubAccountingClasses(this.clubID),childClubOptions:this.clubID?this.clubService.getClubOptions(+this.clubID):Z(null)}).subscribe({next:i=>{this.searchResults=i.classes,i.childClubOptions&&i.childClubOptions.find(t=>t.optionID===De.MANAGE_ACCOUNTING_CLASSES)?.boolValue&&(this.acctClassesOptionEnabled=!0),this.loading=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}setupDeleteConfirm(i){this.clubAccountingClassID=i,this.showModal=!0}delete(){this.clubService.deleteClubAccountingClass(this.clubID,this.clubAccountingClassID).subscribe({next:()=>{this.searchResults.splice(this.searchResults.findIndex(i=>i.clubAccountingClassID===this.clubAccountingClassID),1),this.searchResults=[...this.searchResults],this.siteDataService.showSiteSuccessAlert("Accounting Class was deleted successfully"),this.showModal=!1},error:i=>{this.siteDataService.showSiteErrorAlert("There was a problem processing your request. "+i.error),this.showModal=!1}})}setupAssignModal(){this.classes?this.showAssignModal=!0:this.clubService.getClubAccountingClasses(void 0).subscribe({next:i=>{this.classes=i,this.assignClasses=this.classes.filter(t=>this.searchResults.some(l=>l.clubAccountingClassID===t.clubAccountingClassID)),this.showAssignModal=!0},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}save(){this.clubService.saveClubAccountingClassAssignments(this.clubID,this.assignClasses.map(i=>i.clubAccountingClassID)).pipe(Re(()=>this.clubService.getClubAccountingClasses(this.clubID))).subscribe({next:i=>{this.searchResults=i,this.siteDataService.showSiteSuccessAlert("Accounting Class assignments information saved successfully"),this.showAssignModal=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem processing your request.")}})}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C(T))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:51,vars:16,consts:[["pageTitle","Accounting Classes","parentLinkText","Settings","parentLinkUrl","../",3,"showBackButton"],[3,"adminFilterReset","hideSearch"],["primary",""],[1,"col","pr-0"],[1,"p-input-icon-left","full-width"],[1,"fa","fa-magnifying-glass"],["type","text","id","accounting-class-name","pInputText","","placeholder","Accounting Class Name",1,"full-width","pl-4",3,"ngModelChange","ngModel"],["for","accounting-class-name",1,"sr-only"],["header","Delete Accounting Class","styleClass","shortWidthDialog",3,"visibleChange","visible"],["pTemplate","footer"],["header","Assign Accounting Classes",3,"visibleChange","visible","closable","modal","styleClass"],[1,"form-wrapper"],[1,"horizontal-form"],[1,"form-group"],["optionLabel","accountingClassName","appendTo","body",3,"ngModelChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","selectedItemsLabel"],[1,"card"],[1,"table-responsive","mb-3"],["sortField","accountingClassName",1,"table","table-striped","table-sm",3,"columns","value"],["pTemplate","header"],["pTemplate","body"],[3,"pSortableColumn"],[3,"field"],[3,"routerLink"],[1,"btn","btn-sm",3,"click"],[1,"btn","btn-add","btn-large",3,"routerLink"],[1,"btn","btn-add","btn-large",3,"click"],[1,"mb-3"],["height","20rem",3,"invertBg"],["slot","secondary"],[1,"btn","btn-secondary",3,"click"],["slot","primary"],[1,"btn","btn-primary",3,"click"],[1,"btn",3,"click"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 1561 `),r(2,"app-admin-header",0),e(3,` 1562 `),a(),e(4,` 1563 `),r(5,"app-admin-filter",1),S("adminFilterReset",function(){return l.filterText=""}),e(6,` 1564 `),L(7,2),e(8,` 1565 `),r(9,"div",3),e(10,` 1566 `),r(11,"span",4),e(12,` 1567 `),p(13,"i",5),e(14,` 1568 `),r(15,"input",6),Y("ngModelChange",function(_){return z(l.filterText,_)||(l.filterText=_),_}),a(),e(16,` 1569 `),r(17,"label",7),e(18,"Accounting Class Name"),a(),e(19,` 1570 `),a(),e(20,` 1571 `),a(),e(21,` 1572 `),B(),e(22,` 1573 `),a(),e(23,` 1574 `),f(24,bs,25,4)(25,Ss,6,1),a(),e(26,` 1575 1576`),r(27,"p-dialog",8),Y("visibleChange",function(_){return z(l.showModal,_)||(l.showModal=_),_}),e(28,` 1577 Are you sure you want to delete this Accounting Class? 1578 `),E(29,vs,16,0,"ng-template",9),e(30,` 1579`),a(),e(31,` 1580 1581`),r(32,"p-dialog",10),Y("visibleChange",function(_){return z(l.showAssignMo
1581dal,_)||(l.showAssignModal=_),_}),e(33,` 1582 `),r(34,"div",11),e(35,` 1583 `),r(36,"div",12),e(37,` 1584 `),r(38,"div",13),e(39,` 1585 `),r(40,"label"),e(41,"Accounting Classes"),a(),e(42,` 1586 `),r(43,"p-multiSelect",14),Y("ngModelChange",function(_){return z(l.assignClasses,_)||(l.assignClasses=_),_}),e(44,` 1587 `),a(),e(45,` 1588 `),a(),e(46,` 1589 `),a(),e(47,` 1590 `),a(),e(48,` 1591 `),E(49,gs,16,0,"ng-template",9),e(50,` 1592`),a()),t&2&&(c(2),d("showBackButton",!0),c(3),d("hideSearch",!0),c(10),j("ngModel",l.filterText),c(9),h(l.loading?25:24),c(3),j("visible",l.showModal),c(5),j("visible",l.showAssignModal),d("closable",!1)("modal",!0)("styleClass","standardWidthDialog"),c(11),d("autofocusFilter",!0),j("ngModel",l.assignClasses),d("options",l.classes)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("selectedItemsLabel","{0} class(es) selected"))},dependencies:[Ke,ge,ye,ie,ne,H,N,it,ke,se,Ce,xe,Pe,It],encapsulation:2});let n=s;return n})();var ys=["form"];function Ds(n,s){if(n&1){let o=v();e(0,` 1593 `),r(1,"app-dynamic-form",3,0),S("onSubmit",function(t){x(o);let l=m();return b(l.saveClubAccountingClass(t))})("onCancel",function(){x(o);let t=m();return b(t.cancel())}),e(3,` 1594 `),p(4,"app-dynamic-form-field",4),e(5,` 1595 `),r(6,"app-dynamic-form-field",5),S("onChange",function(){x(o);let t=m();return b(t.assignmentsChanged())}),e(7,` 1596 `),a(),e(8,` 1597 `),r(9,"app-dynamic-form-field",6),e(10,` 1598 `),a(),e(11,` 1599 `),a(),e(12,` 1600 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.clubAccountingClass)("horizontalForm",!0)("contentFieldsMode",!0),c(5),d("enableFilter",!0),c(3),d("enableFilter",!0)}}var li=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.clubAccountingClassID=this.route.snapshot.params.clubAccountingClassID,A({metadata:this.clubService.getClubAccountingClassMetadata(this.clubID),clubAccountingClass:this.clubAccountingClassID!=="new"?this.clubService.getClubAccountingClass(this.clubID,+this.clubAccountingClassID):Z(null)}).subscribe(i=>{this.fields=i.metadata.fields,this.clubAccountingClassID!=="new"&&(this.clubAccountingClass=i.clubAccountingClass,this.fields.some(t=>t.controlName==="requireSurcharge")&&(this.clubAccountingClass.requireSurcharge=this.clubAccountingClass.assignments.filter(t=>t.isSurchargeRequired),this.fields.find(t=>t.controlName==="requireSurcharge").treeOptions=this.filterTreeOptionsWithHierarchy(this.fields.find(t=>t.controlName==="assignments").treeOptions,this.clubAccountingClass.assignments))),this.siteDataService.hideSiteLoader()})}saveClubAccountingClass(i){this.clubService.saveClubAccountingClass(this.clubID,this.clubAccountingClassID!=="new"?+this.clubAccountingClassID:void 0,i).subscribe({next:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Accounting class information saved successfully"),this.router.navigate([".."],{relativeTo:this.route})},error:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving accounting class information.")}})}cancel(){this.router.navigate([".."],{relativeTo:this.route})}filterTreeOptionsWithHierarchy(i,t){if(!i||!t)return null;let l=new Set(t.map(_=>_.clubID)),u=_=>{let g=_.children?_.children.map(re=>u(re)).filter(re=>re!==null):[],Ie=l.has(_.data);return Ie||g.length>0?{label:_.label,data:_.data,expandedIcon:_.expandedIcon,collapsedIcon:_.collapsedIcon,icon:_.icon,expanded:_.expanded,type:_.type,styleClass:_.styleClass,selectable:Ie?_.selectable:!1,children:g}:null};return u(i)}assignmentsChanged(){this.fields.some(i=>i.controlName==="requireSurcharge")&&(this.fields.find(i=>i.controlName==="requireSurcharge").treeOptions=this.filterTreeOptionsWithHierarchy(this.fields.find(i=>i.controlName==="assignments").treeOptions,this.form.value.assignments),this.fields=[...this.fields],this.clubAccountingClass=Ee({},this.form.value))}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C($),C(T),C(q))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],viewQuery:function(t,l){if(t&1&&pe(ys,5),t&2){let u;oe(u=ae())&&(l.form=u.first)}},standalone:!1,decls:9,vars:2,consts:[["form",""],["pageTitle","Edit","grandParentLinkText","Settings","grandParentLinkUrl","../../","parentLinkUrl","../","parentLinkText","Accounting Classes",3,"showBackButton"],[1,"horizontal-form","p-3"],["submitButtonText","Save","buttonsPosition","left",3,"onSubmit","onCancel","fields","entity","horizontalForm","contentFieldsMode"],["fieldName","accountingClassName"],["fieldName","assignments",3,"onChange","enableFilter"],["fieldName","requireSurcharge",3,"enableFilter"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 1601 `),r(2,"app-admin-header",1),e(3,` 1602 `),a(),e(4,` 1603 1604 `),r(5,"section",2),e(6,` 1605 `),f(7,Ds,13,6),a(),e(8,` 1606`),a()),t&2&&(c(2),d("showBackButton",!0),c(5),h(l.fields?7:-1))},dependencies:[w,k,N],encapsulation:2});let n=s;return n})();function As(n,s){if(n&1){let o=v();e(0,` 1607 `),r(1,"app-dynamic-form",3),S("onSubmit",function(t){x(o);let l=m();
1607return b(l.saveEmailBcc(t))})("onCancel",function(){x(o);let t=m();return b(t.cancel())}),e(2,` 1608 `),p(3,"app-dynamic-form-field",4),e(4,` 1609 `),r(5,"app-dynamic-form-field",5),e(6,` 1610 `),L(7,0,0),p(9,"i",6),B(),e(10,` 1611 `),a(),e(11,` 1612 `),p(12,"app-dynamic-form-field",7),e(13,` 1613 `),a(),e(14,` 1614 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.emailAccount)("horizontalForm",!0)("contentFieldsMode",!0)}}var si=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.clubEmailBccID=this.route.snapshot.params.clubEmailBccID;let i=[];i.push(this.clubService.getEmailBccMetadata()),this.clubEmailBccID!=="new"&&i.push(this.clubService.getEmailBccAddress(this.clubID,+this.clubEmailBccID)),A(i).subscribe(t=>{this.fields=t[0].fields,this.clubEmailBccID!=="new"&&(this.emailAccount=t[1]),this.siteDataService.hideSiteLoader()})}saveEmailBcc(i){this.emailAccount&&(i.clubEmailBccID=this.emailAccount.clubEmailBccID),this.clubService.saveEmailBcc(this.clubID,i).subscribe({next:t=>{t&&(this.emailAccount=t),this.siteDataService.showSiteSuccessAlert("BCC Address saved successfully."),this.formService.hideFormLoader(),this.router.navigate(["../.."],{relativeTo:this.route})},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving this BCC Address."),this.formService.hideFormLoader()}})}deleteEmailBcc(){this.clubService.deleteEmailBcc(this.clubID,this.emailAccount.clubEmailBccID).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("BCC Address was deleted successfully"),this.router.navigate(["../.."],{relativeTo:this.route})},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem processing your request.")}})}cancel(){this.router.navigate(["../.."],{relativeTo:this.route})}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C($),C(T),C(q))},s.\u0275cmp=y({type:s,selectors:[["ng-component"]],standalone:!1,decls:9,vars:3,consts:[["inputGroupStart",""],["grandParentLinkText","Settings","grandParentLinkUrl","../../../","parentLinkUrl","../../","parentLinkText","Email Accounts",3,"pageTitle","showBackButton"],[1,"horizontal-form","p-3"],["formID","email-account-form","submitButtonText","Save","buttonsPosition","left",3,"onSubmit","onCancel","fields","entity","horizontalForm","contentFieldsMode"],["fieldName","emailTypeID"],["fieldName","email"],[1,"fal","fa-at"],["fieldName","name"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 1615 `),r(2,"app-admin-header",1),e(3,` 1616 `),a(),e(4,` 1617 1618 `),r(5,"section",2),e(6,` 1619 `),f(7,As,15,4),a(),e(8,` 1620`),a()),t&2&&(c(2),d("pageTitle","Email Account")("showBackButton",!0),c(5),h(l.fields?7:-1))},dependencies:[w,k,N],encapsulation:2});let n=s;return n})();var Ts=n=>[n],Es=()=>["new"];function ws(n,s){if(n&1&&(e(0,` 1621 `),r(1,"th",14),e(2),p(3,"p-sortIcon",15),e(4,` 1622 `),a(),e(5,` 1623 `)),n&2){let o=s.$implicit,i=m(3);c(),d("pSortableColumn",o.field),ee("aria-label",i.AriaLabels.ACTIVATE_SORT),c(),V(` 1624 `,o.header,` 1625 `),c(),d("field",o.field)}}function Fs(n,s){if(n&1&&(e(0,` 1626 `),r(1,"tr"),e(2,` 1627 `),I(3,ws,6,4,null,null,F),p(5,"th"),e(6,` 1628 `),a(),e(7,` 1629 `)),n&2){let o=m(2);c(3),P(o.columns)}}function Is(n,s){if(n&1&&(e(0,` 1630 `),r(1,"a",16),e(2),a(),e(3,` 1631 `)),n&2){let o=m().$implicit;c(),d("routerLink",Se(2,Ts,o.clubSurchargeID)),c(),O(o.surchargeName)}}function Ps(n,s){if(n&1&&e(0),n&2){let o=m().$implicit;V(` 1632 `,o.surchargeName,` 1633 `)}}function Os(n,s){if(n&1){let o=v();e(0,` 1634 `),r(1,"button",17),S("click",function(){x(o);let t=m().$implicit,l=m(2);return b(l.setupDeleteConfirm(t.clubSurchargeID))}),e(2,"Delete"),a(),e(3,` 1635 `)}}function Ms(n,s){if(n&1&&(e(0,` 1636 `),r(1,"tr"),e(2,` 1637 `),r(3,"td"),f(4,Is,4,4)(5,Ps,1,1),a(),e(6,` 1638 `),r(7,"td"),e(8),a(),e(9,` 1639 `),r(10,"td"),f(11,Os,4,0),a(),e(12,` 1640 `),a(),e(13,` 1641 `)),n&2){let o=s.$implicit;c(4),h(o.assigned?5:4),c(4),O(o.rate),c(3),h(o.assigned?-1:11)}}function Vs(n,s){if(n&1&&(e(0,` 1642 `),r(1,"tr"),e(2,` 1643 `),r(3,"td"),e(4,"No surcharges found."),a(),e(5,` 1644 `),a(),e(6,` 1645 `)),n&2){let o=m(2);c(3),ee("colspan",o.columns.length+1)}}function ks(n,s){n&1&&(e(0,` 1646 `),r(1,"a",18),e(2,` 1647 Add Surcharge 1648 `),a(),e(3,` 1649 `)),n&2&&(c(),d("routerLink",te(1,Es)))}function Ns(n,s){if(n&1){let o=v();e(0,` 1650 `),r(1,"a",19),S("click",function(){x(o);let t=m(2);
1650return b(t.setupAssignModal())}),e(2,` 1651 Assign Surcharge 1652 `),a(),e(3,` 1653 `)}}function Rs(n,s){if(n&1&&(e(0,` 1654 `),r(1,"section",8),e(2,` 1655 `),r(3,"h3"),e(4,"Surcharges"),a(),e(5,` 1656 `),r(6,"div",9),e(7,` 1657 `),r(8,"p-table",10),e(9,` 1658 `),E(10,Fs,8,0,"ng-template",11),e(11,` 1659 `),E(12,Ms,14,3,"ng-template",12),e(13,` 1660 `),E(14,Vs,7,1,"ng-template",13),e(15,` 1661 `),a(),e(16,` 1662 `),a(),e(17,` 1663 `),r(18,"div"),e(19,` 1664 `),f(20,ks,4,2),a(),e(21,` 1665 `),r(22,"div"),e(23,` 1666 `),f(24,Ns,4,0),a(),e(25,` 1667 `),a(),e(26,` 1668 `)),n&2){let o=m();c(8),d("columns",o.columns)("value",o.searchResults),c(12),h(!o.clubID||o.surchargesOptionEnabled?20:-1),c(4),h(o.clubID&&!o.surchargesOptionEnabled?24:-1)}}function Ls(n,s){n&1&&(e(0,` 1669 `),r(1,"div",20),e(2,` 1670 `),p(3,"app-skeleton-template",21),e(4,` 1671 `),a(),e(5,` 1672 `)),n&2&&(c(3),d("invertBg",!0))}function Bs(n,s){if(n&1){let o=v();e(0,` 1673 `),r(1,"app-dialog-footer"),e(2,` 1674 `),L(3,22),e(4,` 1675 `),r(5,"button",23),S("click",function(){x(o);let t=m();return b(t.showModal=!1)}),e(6,"No"),a(),e(7,` 1676 `),B(),e(8,` 1677 `),L(9,24),e(10,` 1678 `),r(11,"button",25),S("click",function(){x(o);let t=m();return b(t.delete())}),e(12,"Yes"),a(),e(13,` 1679 `),B(),e(14,` 1680 `),a(),e(15,` 1681 `)}}function $s(n,s){if(n&1){let o=v();e(0,` 1682 `),r(1,"app-dialog-footer"),e(2,` 1683 `),L(3,22),e(4,` 1684 `),r(5,"button",26),S("click",function(){x(o);let t=m();return b(t.showAssignModal=!1)}),e(6,"Cancel"),a(),e(7,` 1685 `),B(),e(8,` 1686 `),L(9,24),e(10,` 1687 `),r(11,"button",25),S("click",function(){x(o);let t=m();return b(t.saveAssignments())}),e(12,"Save"),a(),e(13,` 1688 `),B(),e(14,` 1689 `),a(),e(15,` 1690 `)}}var ci=(()=>{let s=class s{constructor(i,t,l){this.clubService=i,this.siteDataService=t,this.route=l,this.AriaLabels=fe,this.showModal=!1,this.surchargesOptionEnabled=!1,this.showAssignModal=!1,this.loading=!0,this.columns=[{field:"surchargeName",header:"Name"},{field:"rate",header:"Rate"}]}ngOnInit(){this.siteDataService.hideSiteLoader(),this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,A({surcharges:this.clubService.getClubSurcharges(this.clubID),childClubOptions:this.clubID?this.clubService.getClubOptions(this.clubID):Z(null)}).subscribe({next:i=>{this.searchResults=i.surcharges,i.childClubOptions&&i.childClubOptions.find(t=>t.optionID===De.ENABLE_SURCHARGES)?.boolValue&&(this.surchargesOptionEnabled=!0),this.loading=!1},error:i=>{this.siteDataService.showSiteErrorAlert("There was a problem getting surcharge data. "+(i?.error||"")),this.loading=!1}})}setupDeleteConfirm(i){this.clubSurchargeID=i,this.showModal=!0}delete(){this.clubService.deleteClubSurcharge(this.clubID,this.clubSurchargeID).subscribe({next:()=>{this.searchResults=this.searchResults.filter(i=>i.clubSurchargeID!==this.clubSurchargeID),this.siteDataService.showSiteSuccessAlert("Surcharge was deleted successfully"),this.showModal=!1},error:i=>{this.siteDataService.showSiteErrorAlert("There was a problem processing your request. "+(i?.error||"")),this.showModal=!1}})}setupAssignModal(){this.surcharges?this.showAssignModal=!0:this.clubService.getClubSurcharges(void 0).subscribe({next:i=>{this.surcharges=i,this.assignSurcharges=this.surcharges.filter(t=>this.searchResults.some(l=>l.clubSurchargeID===t.clubSurchargeID)),this.showAssignModal=!0,this.loading=!1},error:i=>{this.siteDataService.showSiteErrorAlert("There was a problem getting surcharge data for assignment. "+(i?.error||"")),this.loading=!1}})}saveAssignments(){let i=this.assignSurcharges.map(t=>t.clubSurchargeID);this.clubService.saveClubSurchargeAssignments(this.clubID,i).pipe(Re(()=>this.clubService.getClubSurcharges(this.clubID))).subscribe({next:t=>{this.searchResults=t,this.siteDataService.showSiteSuccessAlert("Surcharge assignments saved successfully"),this.showAssignMo
1690dal=!1,this.loading=!1},error:t=>{this.siteDataService.showSiteErrorAlert("There was a problem saving surcharge assignments. "+(t?.error||"")),this.loading=!1}})}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C(T))},s.\u0275cmp=y({type:s,selectors:[["app-surcharge-search"]],standalone:!1,decls:32,vars:14,consts:[["pageTitle","Surcharges","parentLinkText","Settings","parentLinkUrl","../",3,"showBackButton"],["header","Delete Surcharge","styleClass","shortWidthDialog",3,"visibleChange","visible"],["pTemplate","footer"],["header","Assign Surcharges",3,"visibleChange","visible","closable","modal","styleClass"],[1,"form-wrapper"],[1,"horizontal-form"],[1,"form-group"],["optionLabel","surchargeName","appendTo","body",3,"ngModelChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","selectedItemsLabel"],[1,"card"],[1,"table-responsive","mb-3"],["sortField","surchargeName",1,"table","table-striped","table-sm",3,"columns","value"],["pTemplate","header"],["pTemplate","body"],["pTemplate","emptymessage"],[3,"pSortableColumn"],[3,"field"],[3,"routerLink"],[1,"btn","btn-sm",3,"click"],[1,"btn","btn-add","btn-large",3,"routerLink"],[1,"btn","btn-add","btn-large",3,"click"],[1,"mb-3"],["height","20rem",3,"invertBg"],["slot","secondary"],[1,"btn","btn-secondary",3,"click"],["slot","primary"],[1,"btn","btn-primary",3,"click"],[1,"btn",3,"click"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 1691 `),r(2,"app-admin-header",0),e(3,` 1692 `),a(),e(4,` 1693 `),f(5,Rs,27,4)(6,Ls,6,1),a(),e(7,` 1694 1695`),r(8,"p-dialog",1),Y("visibleChange",function(_){return z(l.showModal,_)||(l.showModal=_),_}),e(9,` 1696 Are you sure you want to delete this Surcharge? 1697 `),E(10,Bs,16,0,"ng-template",2),e(11,` 1698`),a(),e(12,` 1699 1700`),r(13,"p-dialog",3),Y("visibleChange",function(_){return z(l.showAssignModal,_)||(l.showAssignModal=_),_}),e(14,` 1701 `),r(15,"div",4),e(16,` 1702 `),r(17,"div",5),e(18,` 1703 `),r(19,"div",6),e(20,` 1704 `),r(21,"label"),e(22,"Surcharges"),a(),e(23,` 1705 `),r(24,"p-multiSelect",7),Y("ngModelChange",function(_){return z(l.assignSurcharges,_)||(l.assignSurcharges=_),_}),e(25,` 1706 `),a(),e(26,` 1707 `),a(),e(27,` 1708 `),a(),e(28,` 1709 `),a(),e(29,` 1710 `),E(30,$s,16,0,"ng-template",2),e(31,` 1711`),a()),t&2&&(c(2),d("showBackButton",!0),c(3),h(l.loading?6:5),c(3),j("visible",l.showModal),c(5),j("visible",l.showAssignModal),d("closable",!1)("modal",!0)("styleClass","standardWidthDialog"),c(11),d("autofocusFilter",!0),j("ngModel",l.assignSurcharges),d("options",l.surcharges)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("selectedItemsLabel","{0} surcharge(s) selected"))},dependencies:[ge,ye,ie,ne,H,N,ke,se,Ce,xe,Pe,It],encapsulation:2});let n=s;return n})();function Ws(n,s){if(n&1){let o=v();e(0,` 1712 `),r(1,"app-dynamic-form",2),S("onSubmit",function(t){x(o);let l=m();return b(l.saveClubSurcharge(t))})("onCancel",function(){x(o);let t=m();return b(t.cancel())}),e(2,` 1713 `),p(3,"app-dynamic-form-field",3),e(4,` 1714 `),p(5,"app-dynamic-form-field",4),e(6,` 1715 `),r(7,"app-dynamic-form-field",5),e(8,` 1716 `),a(),e(9,` 1717 `),a(),e(10,` 1718 `)}if(n&2){let o=m();c(),d("fields",o.fields)("entity",o.clubSurcharge)("horizontalForm",!0)("contentFieldsMode",!0),c(6),d("enableFilter",!0)}}var mi=(()=>{let s=class s{constructor(i,t,l,u,_){this.clubService=i,this.siteDataService=t,this.formService=l,this.route=u,this.router=_}ngOnInit(){this.route.snapshot.parent.params.clubID?this.clubID=+this.route.snapshot.parent.params.clubID:this.clubID=void 0,this.clubSurchargeID=this.route.snapshot.params.surchargeID,A({metadata:this.clubService.getClubSurchargeMetadata(this.clubID),clubSurcharge:this.clubSurchargeID!=="new"?this.clubService.getClubSurcharge(this.clubID,+this.clubSurchargeID):Z(null)}).subscribe(i=>{this.fields=i.metadata.fields,this.clubSurchargeID!=="new"&&(this.clubSurcharge=i.clubSurcharge),this.siteDataService.hideSiteLoader()})}saveClubSurcharge(i){this.clubService.saveClubSurcharge(this.clubID,this.clubSurchargeID!=="new"?+this.clubSurchargeID:void 0,i).subscribe({next:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Surcharge information saved successfully"),this.router.navigate(["../"],{relativeTo:this.route})},error:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving surcharge information.")}})}cancel(){this.router.navigate(["../"],{relativeTo:this.route})}};s.\u0275fac=function(t){return new(t||s)(C(W),C(D),C($),C(T),C(q))},s.\u0275cmp=y({type:s,selectors:[["app-surcharge-edit"]],standalone:!1,decls:9,vars:2,consts:[["pageTitle","Edit","grandParentLinkText","Settings","grandParentLinkUrl","../../","parentLinkUrl","../","parentLinkText","Surcharges",3,"showBackButton"],[1,"horizontal-form","p-3"],["submitButtonText","Save","buttonsPosition","left",3,"onSubmit","onCancel","fields","entity","horizontalForm","contentFieldsMode"],["fieldName","surchargeName"],["fieldName","rate"],["fieldName","assignments",3,"enableFilter"]],template:function(t,l){t&1&&(r(0,"main"),e(1,` 1719 `),r(2,"app-admin-header",0),e(3,` 1720 `),a(),e(4,` 1721 1722 `),r(5,"section",1),e(6,` 1723 `),f(7,Ws,11,5),a(),e(8,` 1724`),a()),t&2&&(c(2),d("showBackButton",!0),c(5),h(l.fields?7:-1))},dependencies:[w,k,N],encapsulation:2});let n=s;return n})();var hn=(()=>{let s=class s{};s.\u0275fac=function(t){return new(t||s)},s.\u0275mod=Ct({type:s}),s.\u0275inj=ht({imports:[jt.forChild([{path:"settings",canActivate:[Ve],component:Gt,children:[{path:"",component:ei,canActivate:[M],data:{metaTitle:"Club Settings"}},{path:"profile",component:Jt,canActivate:[M],data:{metaTitle:"Club Profile Settings"}},{path:"options",component:Zt,canActivate:[M],data:{metaTitle:"Club Options"}},{path:"fiscal-years",component:oi,canActivate:[M],data:{metaTitle:"Fiscal Years & Financial Aid"}},{path:"accounting-classes",component:ri,canActivate:[M],data:{metaTitle:"Accounting Classes"}},{path:"surcharges",component:ci,canActivate:[M],data:{metaTitle:"Surcharges"}},{path:"surcharges/:surchargeID",component:mi,canActivate:[M],data:{metaTitle:"Surcharges"}},{path:"accounting-classes/:clubAccountingClassID",component:li,canActivate:[M],data:{metaTitle:"Accounting Classes"}},{path:"fiscal-years/:clubFiscalYearID",component:ai,canActivate:[M],data:{metaTitle:"Fiscal Years & Financial Aid"}},{path:"fields",component:Ji,canActivate:[M],data:{metaTitle:"Fields Admin"},children:[{path:"names",component:Ki,canActivate:[M],data:{metaTitle:"Club Field Names"}},{path:"display-options",component:Xi,canActivate:[M],data:{metaTitle:"Club Field Display Options"}},{path:"renewal-dates",component:Zi,canActivate:[M],data:{metaTitle:"Club Field Renewal Dates",bodyClass:"renewal-dates"}},{path:"names/:id/value-list",component:en,canActivate:[M],data:{metaTitle:"Club Dropdown Field Values"}},{path:"",redirectTo:"names",pathMatch:"full"}]},{path:"fields/names/:id/values",component:on,children:[{path:"names",component:tn,c
1724anActivate:[M],data:{metaTitle:"Club Field Value Names"}},{path:"display-options",component:nn,canActivate:[M],data:{metaTitle:"Club Field Value Display Options"}}]},{path:"email-accounts",component:Kt,canActivate:[M],data:{metaTitle:"Club Email Accounts"}},{path:"email-accounts/bcc/:clubEmailBccID",component:si,canActivate:[M],data:{metaTitle:"Club Email Bcc Addresses"}},{path:"email-accounts/:emailAccountID",component:Xt,canActivate:[Yt,M],data:{metaTitle:"Club Email Accounts"}},{path:"payments",component:$t,canActivate:[M,Ve],data:{metaTitle:"Payment Settings",permissions:[K.PaymentSettingsAccess]}},{path:"payments-onboard",component:$t,canActivate:[M,Ii],data:{metaTitle:"Payment Settings"}},{path:"connected-accounts",component:ut,canActivate:[M],data:{metaTitle:"Merchant Accounts"}},{path:"",redirectTo:"profile",pathMatch:"full"}],data:{permissions:[K.ClubSettings]}},{path:"child-clubs/:clubID/settings",canActivate:[Ve,M],component:Gt,children:[{path:"",component:ei,canActivate:[M],data:{metaTitle:"Club Settings"}},{path:"profile",component:Jt,canActivate:[M],data:{metaTitle:"Club Profile Settings"}},{path:"options",component:Zt,canActivate:[M],data:{metaTitle:"Club Options"}},{path:"accounting-classes",component:ri,canActivate:[M],data:{metaTitle:"Accounting Classes"}},{path:"surcharges",component:ci,canActivate:[M],data:{metaTitle:"Surcharges"}},{path:"surcharges/:surchargeID",component:mi,canActivate:[M],data:{metaTitle:"Surcharges"}},{path:"accounting-classes/:clubAccountingClassID",component:li,canActivate:[M],data:{metaTitle:"Accounting Classes"}},{path:"fiscal-years",component:oi,canActivate:[M],data:{metaTitle:"Fiscal Years & Financial Aid"}},{path:"fiscal-years/:clubFiscalYearID",component:ai,canActivate:[M],data:{metaTitle:"Fiscal Years & Financial Aid"}},{path:"email-accounts",component:Kt,canActivate:[M],data:{metaTitle:"Club Email Accounts"}},{path:"email-accounts/bcc/:clubEmailBccID",component:si,canActivate:[M],data:{metaTitle:"Club Email Bcc Addresses"}},{path:"email-accounts/:emailAccountID",component:Xt,canActivate:[Yt,M],data:{metaTitle:"Club Email Accounts"}},{path:"payments",component:$t,canActivate:[M,Ve],data:{metaTitle:"Payment Settings",permissions:[K.PaymentSettingsAccess]}},{path:"connected-accounts",component:ut,canActivate:[M],data:{metaTitle:"Merchant Accounts"}}],data:{permissions:[K.ClubSettings]}},{path:"child-clubs",component:Hi,canActivate:[M],data:{permissions:[K.Clubs],metaTitle:"Club Search"}},{path:"switch",component:rn,canActivate:[M],data:{metaTitle:"Switch Clubs",bodyClass:"header-logo-sm"}},{path:"facilities",canActivate:[M],loadChildren:()=>import("./chunk-A4VI7R7L.js").then(i=>i.PracticeFacilitiesModule),data:{metaTitle:"Practice Facilities"}},{path:"positions",canActivate:[Ve,M],component:Qi,data:{permissions:[K.Positions],metaTitle:"Positions"}},{path:"role-templates",canActivate:[Ve,M],component:an,data:{permissions:[K.RoleTemplates],metaTitle:"Role Templates"}},{path:"role-templates/:id",canActivate:[Ve,M],component:ln,data:{permissions:[K.RoleTemplates],metaTitle:"Role Templates"}},{path:"positions/:id",canActivate:[Ve,M],component:Gi,data:{permissions:[K.Positions],metaTitle:"Positions"}},{path:"donation-settings",canActivate:[Ve,M],loadChildren:()=>import("./chunk-U4LQVFGF.js").then(i=>i.ClubDonationSettingsModule),data:{permissions:[K.DonationSettings],metaTitle:"Donation Settings"}},{path:"volunteer-settings",canActivate:[Ve,M],loadChildren:()=>import("./chunk-332O24NS.js").then(i=>i.ClubVolunteerSettingsModule),data:{permissions:[K.DonationSettings],metaTitle:"Volunteer Settings"}}]),jt]});let n=s;return n})();var __=(()=>{let s=class s{};s.\u0275fac=function(t){return new(t||s)},s.\u0275mod=Ct({type:s}),s.\u0275inj=ht({providers:[W,Wi,ot,Ri,Li,Ae,Vt,$i,Nt,ve],imports:[Bi,hn,Ui,Yi]});let n=s;return n})();export{__ as ClubModule};
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.