PageSourceSearch

https://midlandsoccerclub.com/chunk-ESPBIIPM.js

js midlandsoccerclub.com collected 2026-10-09 22:41:06 UTC 104,848 bytes, 629 lines download raw bytes

1import{a as Ci}from"./chunk-B7UQVWZG.js";import{a as bi}from"./chunk-4I26KT6P.js";import{a as we}from"./chunk-F56RS3OJ.js";import"./chunk-XOLDABEG.js";import{a as Zt,b as ei,c as ti,d as _i,e as xi}from"./chunk-S4DAYUOK.js";import{b as He,c as fi,d as Si}from"./chunk-EDX4FAQU.js";import"./chunk-N7LXPUNV.js";import"./chunk-56A7BQAL.js";import"./chunk-S4KZFP6D.js";import"./chunk-QTPEYOBK.js";import{a as vi,b as Ti,c as me,d as Pe}from"./chunk-GOHTRUJ2.js";import{a as ui,b as Ie,c as hi}from"./chunk-XHEHBBIB.js";import{a as X}from"./chunk-J7GAYBOE.js";import"./chunk-QD4M6VLD.js";import"./chunk-OETXZY34.js";import"./chunk-MORY5OOD.js";import"./chunk-RCQFVG4N.js";import"./chunk-U4LHYVR2.js";import"./chunk-IJCOGGVP.js";import"./chunk-PHZJLURG.js";import"./chunk-ZLBN6FZV.js";import"./chunk-BGAAGYCA.js";import"./chunk-YESMKLGV.js";import"./chunk-RBGYAKJK.js";import"./chunk-3DS6GUXH.js";import"./chunk-34RB33U7.js";import"./chunk-PMGCU7IV.js";import"./chunk-5QYJ3SBW.js";import"./chunk-OVWSJLKC.js";import"./chunk-QLS2HGKB.js";import{a as di,b as ci}from"./chunk-6TVESXYK.js";import{a as Kt,b as si}from"./chunk-S3Q2DAAY.js";import{b as pi}from"./chunk-B73O2JXS.js";import"./chunk-IIL5ULVK.js";import{a as mi}from"./chunk-HUAQNSI3.js";import"./chunk-3CBEWH77.js";import{a as ri,b as li}from"./chunk-JL5JJMSL.js";import{a as le}from"./chunk-MCU24RQK.js";import{a as ni,b as ai}from"./chunk-V2ZNI7PU.js";import"./chunk-HSJ2CSTO.js";import"./chunk-MSSEBO72.js";import"./chunk-FP3J5B6H.js";import{a as oi}from"./chunk-BQRBWX66.js";import{a as pt}from"./chunk-L5ZOOU2J.js";import"./chunk-KOPGZV6B.js";import"./chunk-BTQPKA7U.js";import{a as Ye}from"./chunk-RESNPHP2.js";import{b as ii,c as gi}from"./chunk-STA2MRHZ.js";import"./chunk-AF6G7XUW.js";import"./chunk-D5WNKLON.js";import"./chunk-FLFERWGO.js";import"./chunk-5MLCZDLN.js";import"./chunk-XTQNEHPV.js";import"./chunk-HETGIIFW.js";import"./chunk-QNNPLEYM.js";import"./chunk-VSK3DNK7.js";import"./chunk-6F4SDY22.js";import"./chunk-QUG4HHXZ.js";import"./chunk-I2Y7UB4V.js";import"./chunk-PSOULVZL.js";import"./chunk-XAXLMUF6.js";import"./chunk-RXHK7XE4.js";import"./chunk-O3BD2LYL.js";import"./chunk-6ORYOOUQ.js";import"./chunk-ZB44PIZA.js";import"./chunk-YBFQQSLW.js";import"./chunk-MB6YAV2B.js";import"./chunk-ADMKBOBN.js";import"./chunk-LCPPMNQ3.js";import"./chunk-BT6MT7GL.js";import"./chunk-RF4ESXXV.js";import"./chunk-IN6JNWJL.js";import"./chunk-GT2RX7V4.js";import"./chunk-OBZUIDEP.js";import"./chunk-WZTRTKC4.js";import"./chunk-NTPMZIRS.js";import"./chunk-AEK7Z5QZ.js";import{b as Jt}from"./chunk-64WGMCQL.js";import"./chunk-DBNHDKST.js";import"./chunk-CHFQMRFX.js";import"./chunk-4CVZBQNN.js";import"./chunk-IAGBH4HM.js";import"./chunk-MJKUV2I5.js";import"./chunk-N5PZSBUY.js";import"./chunk-4T73AMAL.js";import"./chunk-G2OHGTWE.js";import"./chunk-NAW6KKAQ.js";import"./chunk-GNX3F6NH.js";import"./chunk-VFXJ4ZBD.js";import{d as pe}from"./chunk-QQKJHWTF.js";import{Qb as Yt,Rb as We,Sb as xe,_b as Ht,ac as qe,bc as Xt,c as Se}from"./chunk-PXZNPNHI.js";import"./chunk-KWNDGQWR.js";import"./chunk-2ZFY6MCW.js";import"./chunk-KQ7PEKEE.js";import"./chunk-KVMIYEBS.js";import"./chunk-DLHY2JKF.js";import"./chunk-WLMRFXCZ.js";import"./chunk-WN3UI2QV.js";import"./chunk-YVLOHBDK.js";import{a as _e}from"./chunk-Z3AXU4EF.js";import"./chunk-TP3A6IN2.js";import"./chunk-XNFXA3ZT.js";import"./chunk-QLTRNXEK.js";import"./chunk-TEFEWVO6.js";import"./chunk-ZB64W4XA.js";import"./chunk-SVABVB5X.js";import"./chunk-CMY6WAF3.js";import"./chunk-FUY7HSJY.js";import"./chunk-JTYXZXFU.js";import"./chunk-7MK6I7GJ.js";import"./chunk-3HFTO6XY.js";import"./chunk-XNSH6ILV.js";import"./chunk-IZKA562T.js";import"./chunk-BROSYERN.js";import"./chunk-Y2KCFOCP.js";import"./chunk-Z52L74DH.js";import"./chunk-CYDDDATF.js";import"./chunk-GWQPV7EH.js";import"./chunk-RQ74XYI3.js";import"./chunk-3IFGWXMA.js";import"./chunk-EME7BUOO.js";import{a as Ee}from"./chunk-JKMNVQUA.js";import"./chunk-QH3IRCHN.js";import"./chunk-PLEH3NAH.js";import"./chunk-GXCJ5QS4.js";import{b as W}from"./chunk-4D5SN44G.js";import"./chunk-22ACI5KU.js";import"./chunk-FXUQQQIE.js";import"./chunk-VVVN3YIZ.js";import"./chunk-FSUBAQYH.js";import"./chunk-7CVCGK4Q.js";import"./chunk-FWW3IJT2.js";import"./chunk-B6LCWWQX.js";import"./chunk-HYGNXZJR.js";import{a as Qe}from"./chunk-B6XXRKU5.js";import"./chunk-6Q5DDO7R.js";import"./chunk-RW2MVE4O.js";import"./chunk-3ZVRFUA4.js";import"./chunk-H4PCL6BZ.js";import"./chunk-NXTJBJRP.js";import"./chunk-U22BTVEZ.js";import{$b as fe,$c as je,Ce as ze,Ed as Gt,Eg as Wt,Gb as $e,Hd as H,Ia as Be,Kb as Mt,Mb as Q,Ob as Vt,Ue as zt,Wc as q,Yb as Bt,Zb as Ge,_b as $t,bf as Qt,d as Me,jb as kt,k as Ve,kd as Y,kh as qt,ve as jt,xa as ie,za as Ut}from"./chunk-X5J6QTCG.js";import{$ as Le,$a as u,Ad as lt,C as K,Db as Ue,E as O,Fa as m,Fb as oe,Ff as Nt,H as Z,Hb as Te,Ib as e,Jb as P,Ka as _,Kb as E,Lb as ke,Ma as N,Mh as mt,Na as Oe,Nh as Ot,Ni as ct,Qb as be,Ra as Ct,Rb as ye,S as _t,Sa as vt,Sb as De,T as Ae,Tb as yt,Th as B,U as T,Ub as Dt,Vb as Et,W as F,Wc as At,Xa as at,Xb as st,_ as Fe,_c as Ft,ba as xt,bb as h,cc as wt,d as U,dc as ce,di as he,eb as ne,fa as f,fb as re,ga as S,gb as g,gi as dt,hb as s,ib as l,jb as p,k as D,lc as ee,ma as Re,mc as It,nb as Tt,nc as ae,ob as bt,pj as L,q as ve,qb as y,qc as Pt,ra as Ne,rf as te,sb as C,tb as d,td as Lt,u as J,vd as ue,wd as Rt,xb as k,xd as se,yb as w,yd as z,z as j,zb as I}from"./chunk-SMW7PHYX.js";import{a as x,b as A,e as St}from"./chunk-BMIYOSOG.js";var yi=(i,o)=>o.label;function Oi(i,o){if(i&1&&(e(0,`
2                    `),s(1,"app-split-button",6,1),e(3,`
3                    `),l(),e(4,`
4                `)),i&2){let n=d(3);m(),g("menuItems",n.headerActionMenuItems)}}function Ui(i,o){if(i&1&&(e(0,`
5                `),u(1,Oi,5,1)),i&2){let n=d(2);m(),h(n.headerActionMenuItems!=null&&n.headerActionMenuItems.length?1:-1)}}function ki(i,o){if(i&1&&(e(0,`
6        `),e(1,`
7        `),s(2,"app-admin-header",5),e(3,`
8            `),vt(4,Ui,2,1,"ng-template",null,0,Pt),e(6,`
9        `),l(),e(7,`
10    `)),i&2){let n=d();m(2),g("pageTitle",n.headerPageTitle)("parentLinkText",n.headerParentLink==null?null:n.headerParentLink.text)("parentLinkUrl",n.headerParentLink==null?null:n.headerParentLink.url)("grandParentLinkText",n.headerGrandParentLink==null?null:n.headerGrandParentLink.text)("grandParentLinkUrl",n.headerGrandParentLink==null?null:n.headerGrandParentLink.url)("greatGrandParentLinkText",n.headerGreatGrandParentLink==null?null:n.headerGreatGrandParentLink.text)("greatGrandParentLinkUrl",n.headerGreatGrandParentLink==null?null:n.headerGreatGrandParentLink.url)("showBackButton",!0)("pageTitleImageUrl",n.program==null?null:n.program.image)}}function Mi(i,o){if(i&1&&(e(0,`
11                    `),s(1,"li"),e(2,`
12                        `),s(3,"a",10),e(4,`
13                            `),p(5,"i"),e(6),l(),e(7,`
14                    `),l(),e(8,`
15                    `)),i&2){let n=o.$implicit,t=d(2);m(),oe("active",n.label===t.activeNavLabel),m(2),g("routerLink",n.link),at("aria-current",n.label===t.activeNavLabel?"page":null),m(2),Te(st("",n.icon," mr-1")),m(),E("",n.label,`
16                        `)}}function Vi(i,o){if(i&1&&(e(0,`
17                    `),s(1,"li"),e(2,`
18                        `),s(3,"a",11),e(4,`
19                            `),p(5,"i"),e(6),l(),e(7,`
20                    `),l(),e(8,`
21                    `)),i&2){let n=o.$implicit,t=d(2);m(),oe("active",n.label===t.activeNavLabel),m(2),g("routerLink",n.link),at("aria-current",n.label===t.activeNavLabel?"page":null),m(2),Te(st("",n.icon," mr-1")),m(),E("",n.label,`
22                        `)}}function Bi(i,o){if(i&1&&(e(0,`
23        `),s(1,"div",7),e(2,`
24            `),e(3,`
25            `),e(4,`
26            `),s(5,"nav",8),e(6,`
27                `),s(7,"ul"),e(8,`
28                    `),ne(9,Mi,9,8,null,null,yi),l(),e(11,`
29                `),p(12,"hr",9),e(13,`
30                `),s(14,"ul"),e(15,`
31                    `),ne(16,Vi,9,8,null,null,yi),l(),e(18,`
32            `),l(),e(19,`
33        `),l(),e(20,`
34        `)),i&2){let n=d();m(9),re(n.navItems),m(7),re(n.bottomNavItems)}}function $i(i,o){if(i&1){let n=y();e(0,`
35    `),s(1,"app-program-clone",12),C("cancel",function(){f(n);let r=d();return S(r.showCloneForm=!1)})("onClone",function(r){f(n);let a=d();return S(a.clone(r))}),l(),e(2,`
36`)}if(i&2){let n=d();m(),g("programName",n.program==null?null:n.program.name)("programID",n.programID)}}function Gi(i,o){if(i&1){let n=y();e(0,`
37    `),s(1,"app-program-remove",13),C("cancel",function(){f(n);let r=d();return S(r.showRemove=!1)})("remove",function(){f(n);let r=d();return S(r.removeChange(!0))}),l(),e(2,`
38`)}if(i&2){let n=d();m(),g("programID",n.programID)}}function ji(i,o){if(i&1){let n=y();e(0,`
39    `),s(1,"app-program-undo-remove",14),C("cancel",function(){f(n);let r=d();return S(r.showUndoRemove=!1)})("undoRemove",function(){f(n);let r=d();return S(r.removeChange(!1))}),l(),e(2,`
40`)}if(i&2){let n=d();m(),g("programID",n.programID)}}var gt=["overview"],Di=(()=>{let o=class o extends Ci{constructor(t,r){super(),this.router=t,this.siteDataService=r,this.paidSignupsV2Enabled=!1,this.navItems=[{label:"Time Slots and Bundles",icon:"fal fa-layer-group",link:gt},{label:"Full Schedule",icon:"fal fa-calendar",link:["timeslots"]}],this.bottomNavItems=[{label:"Program Listing",icon:"fal fa-cart-shopping",link:["listing"]},{label:"Program Settings",icon:"fal fa-gear",link:["settings"]}],this.activeNavLabel=null,this.activeRouteCache=new Map}ngOnInit(){this.loadUser(),this.watchChildChrome(),this.shellChrome&&(this.shellChrome.overviewUrl=this.router.createUrlTree(gt,{relativeTo:this.route}).toString()),this.route.params.pipe(T(this.unsubscribe$)).subscribe({next:t=>
40{t.id&&(this.programID=+t.id,this.store.initialize(this.programID,!0))}}),this.store.select(t=>({loading:t.loading})).pipe(T(this.unsubscribe$)).subscribe({next:t=>{t.loading||this.siteDataService.hideSiteLoader()},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}}),this.store.select(t=>t.program).pipe(T(this.unsubscribe$)).subscribe({next:t=>{if(this.program=t,t&&t.programTypeID!==ie.TRAINING_SESSIONS){this.siteDataService.showSiteErrorAlert("This program is not a Sessions program."),this.router.navigate(["/admin/programs",this.programID],{replaceUrl:!0});return}this.buildActionMenu()},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}}),this.siteDataService.isPaidSignupsV2Enabled$().pipe(T(this.unsubscribe$)).subscribe({next:t=>{this.paidSignupsV2Enabled=t,this.buildActionMenu()},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}}),this.router.events.pipe(j(t=>t instanceof Lt),_t(null),T(this.unsubscribe$)).subscribe(()=>{this.activeRouteCache.clear(),this.updateActiveNavItem(),this.updateChromeVisibility()})}updateActiveNavItem(){this.activeNavLabel=[...this.navItems,...this.bottomNavItems].find(t=>this.isActiveRoute(t.link))?.label??null}isActiveRoute(t){let r=t.join("/"),a=this.activeRouteCache.get(r);if(a!==void 0)return a;let c=this.router.isActive(this.router.createUrlTree(t,{relativeTo:this.route}),{paths:"subset",queryParams:"subset",fragment:"ignored",matrixParams:"ignored"});return this.activeRouteCache.set(r,c),c}updateChromeVisibility(){super.updateChromeVisibility(),this.showProgramNav=this.showProgramNav&&this.activeNavLabel!==null}buildActionMenu(){this.actionMenuItems=[{label:"Duplicate Program",icon:"fa fa-clone",command:()=>{this.showCloneForm=!0}}],this.paidSignupsV2Enabled&&this.actionMenuItems.push({label:"Create New Time Slot Group",icon:"fa fa-calendar-plus",command:()=>{this.createCanonicalSignUp()}}),this.pushRemoveMenuItem(this.actionMenuItems)}clone(t){this.showCloneForm=!1,this.router.navigate(["/admin/programs","training-sessions",t.programID,...gt])}createCanonicalSignUp(){this.router.navigate(["activities","new"],{relativeTo:this.route,state:{selectedSignUpTypeID:Se.PAID}})}};o.\u0275fac=function(r){return new(r||o)(_(se),_(L))},o.\u0275cmp=N({type:o,selectors:[["app-training-sessions-program-edit"]],standalone:!1,features:[Ct],decls:16,vars:5,consts:[["customButtonContent",""],["actions",""],["role","main"],[1,"row","d-flex","full-width","pt-3"],[1,"col"],[1,"mb-1","pb-1",3,"pageTitle","parentLinkText","parentLinkUrl","grandParentLinkText","grandParentLinkUrl","greatGrandParentLinkText","greatGrandParentLinkUrl","showBackButton","pageTitleImageUrl"],["buttonText","Actions",3,"menuItems"],[1,"col-auto"],["aria-label","Program","data-testid","training-sessions-nav",1,"page-navigation","pt-2","p-0"],[1,"my-0"],["data-testid","training-sessions-nav-item",1,"btn-a11y","text-nowrap","pr-2",3,"routerLink"],["data-testid","training-sessions-nav-item",1,"btn-a11y","pr-2",3,"routerLink"],[3,"cancel","onClone","programName","programID"],[3,"cancel","remove","programID"],[3,"cancel","undoRemove","programID"]],template:function(r,a){r&1&&(s(0,"main",2),e(1,`
41    `),u(2,ki,8,9),s(3,"div",3),e(4,`
42        `),u(5,Bi,21,0),s(6,"div",4),e(7,`
43            `),p(8,"router-outlet"),e(9,`
44        `),l(),e(10,`
45    `),l(),e(11,`
46`),l(),e(12,`
47
48`),u(13,$i,3,2),u(14,Gi,3,1),u(15,ji,3,1)),r&2&&(m(2),h(a.showAdminHeader?2:-1),m(3),h(a.program&&a.programID&&a.showProgramNav?5:-1),m(8),h(a.showCloneForm?13:-1),m(),h(a.showRemove?14:-1),m(),h(a.showUndoRemove?15:-1))},dependencies:[Rt,z,jt,zt,Zt,ei,ti],styles:["nav.page-navigation[_ngcontent-%COMP%]{max-width:300px}"]});let i=o;return i})();var zi=["listingForm"],Qi=["fileUploadField"];function Wi(i,o){i&1&&(e(0,`
49        `),p(1,"app-skeleton-template",3),e(2,`
50    `))}function qi(i,o){i&1&&(e(0,`
51        `),s(1,"app-inline-alert",4),e(2,`
52            Unable to load this program's listing settings.
53        `),l(),e(3,`
54    `))}function Yi(i,o){if(i&1){let n=y();e(0,`
55                            `),s(1,"button",22),C("click",function(){f(n);let r=d(2);return S(r.showAddProgramCategory=!0)}),e(2,`
56                                Add Program Category
57                            `),l(),e(3,`
58                            `)}}function Hi(i,o){i&1&&(e(0,`
59                    `),p(1,"hr",23),e(2,`
60                    `),s(3,"h4"),e(4,"Other Member Options"),l(),e(5,`
61                    `),p(6,"app-dynamic-form-field",24),e(7,`
62                    `))}function Xi(i,o){if(i&1){let n=y();e(0,`
63        `),e(1,`
64        `),s(2,"app-dynamic-form",5,0),C("onSubmit",function(r){f(n);let a=d();return S(a.save(r))})("onCancel",function(){f(n);let r=d();return S(r.cancel())}),e(4,`
65
66                    `),s(5,"h3"),e(6,"Website Open Programs Listing"),l(),e(7,`
67                    `),s(8,"div",6),e(9),l(),e(10,`
68                    `),s(11,"app-dynamic-form-field",7,1),C("onChange",function(r){f(n);let a=d();return S(a.file=r?r.target.files[0]:void 0)}),e(13,`
69                    `),l(),e(14,`
70                    `),p(15,"app-dynamic-form-field",8),e(16,`
71                    `),p(17,"app-dynamic-form-field",9),e(18,`
72                    `),s(19,"app-dynamic-form-field",10),e(20,`
73                    `),l(),e(21,`
74                    `),p(22,"app-dynamic-form-field",11),e(23,`
75                    `),s(24,"app-dynamic-form-field",12),C("onChange",function(r){f(n);let a=d();return S(a.contentLinkOptionChange(r))}),e(25,`
76                    `),l(),e(26,`
77                    `),s(27,"app-dynamic-form-field",13),e(28,`
78                    `),l(),e(29,`
79                    `),s(30,"app-dynamic-form-field",14),e(31,`
80                    `),l(),e(32,`
81                    `),s(33,"app-dynamic-form-field",15),e(34,`
82                    `),l(),e(35,`
83                    `),s(36,"app-dynamic-form-field",16),e(37,`
84                    `),l(),e(38,`
85                    `),p(39,"app-dynamic-form-field",17),e(40,`
86
87                    `),p(41,"hr"),e(42,` 
88
89                    `),s(43,"h3"),e(44,"Member Homepage"),l(),e(45,`
90                    `),s(46,"div",6),e(47),l(),e(48,`
91                    `),s(49,"app-dynamic-form-field",18),e(50,`
92                        `),Tt(51,19),e(52,`
93                            `),u(53,Yi,4,0),bt(),e(54,`
94                    `),l(),e(55,`
95                    `),p(56,"app-dynamic-form-field",20),e(57,`
96                    `),p(58,"app-dynamic-form-field",21),e(59,`
97                    `),u(60,Hi,8,0),l(),e(61,`
98    `)}if(i&2){let n=d();m(2),g("fields",n.fields)("entity",n.entity)("horizontalForm",!0)("contentFieldsMode",!0)("showSaveAndAddButton",!1)("buttonsSticky",!0)("showSubmitButton",!0)("showCancelButton",!0),m(7),E(`
99                        `,n.programService.openProgramsText,`
100                    `),m(2),g("acceptedFileExtensions",n.acceptedFileExtensions)("canRemoveFile",!0)("selectedFileName",n.program.image?n.program.image:null),m(8),g("enableFilter",!0),m(8),g("enableFilter",!0)("hidden",n.contentLinkOptionID===n.ContentLinkOption.EXTERNAL_LINK),m(3),g("hidden",n.contentLinkOptionID===n.ContentLinkOption.PAGE_BUILDER_PAGE),m(3),g("hidden",!n.contentLinkOptionID),m(3),g("hidden",!n.contentLinkOptionID),m(11),E(`
101                        `,n.programService.programInfoText,`
102                    `),m(6),h(n.user&&n.user[n.Permission.ProgramCategories]?53:-1),m(7),h(n.paidV2Enabled?-1:60)}}function Ji(i,o){if(i&1){let n=y();e(0,`
103    `),s(1,"app-program-category-add-dialog",25),C("onSave",function(r){f(n);let a=d();return S(a.addedNewProgramCategory(r))})("onCancel",function(){f(n);let r=d();return S(r.showAddProgramCategory=!1)}),l(),e(2,`
104`)}}var Pi=(()=>{let o=class o{constructor(t,r,a,c,v,b,R){this.route=t,this.router=r,this.siteDataService=a,this.programService=c,this.formService=v,this.authorizeService=b,this.store=R,this.loading=!0,this.error=!1,this.saving=!1,this.paidV2Enabled=!1,this.acceptedFileExtensions=Nt,this.ContentLinkOption=dt,this.showAddProgramCategory=!1,this.Permission=B,this.unsubscribe$=new U}ngOnInit(){this.authorizeService.getUser().pipe(Z(1)).subscribe({next:t=>{this.user=t},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}}),this.store.select(t=>({program:t.program,programID:t.programID})).pipe(j(t=>t.program!==null&&t.program!==void 0),F(t=>{this.program=t.program,this.programID=t.programID}),O(()=>this.displaySettingsFields?D(null):this.loadMetadata()),T(this.unsubscribe$)).subscribe({next:()=>{this.buildFields(),this.program.contentLinkOptionID&&this.contentLinkOptionChange(this.program.contentLinkOptionID),this.loading=!1,this.siteDataService.hide
104SiteLoader()},error:()=>{this.loading=!1,this.error=!0,this.siteDataService.showSiteErrorAlert("There was a problem getting this program's listing settings")}})}save(t){let r=A(x({},t),{programID:this.programID});this.saving=!0,this.fileUploadField?.hasFileChanged&&this.file?this.programService.saveProgramDisplaySettingsFile(this.file,r.programID).pipe(T(this.unsubscribe$)).subscribe({next:a=>{if(!a?.location){this.saving=!1,this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving the file");return}this.fileUploadField.hasFileChanged=!1,r.image=a.location,this.updateDisplaySettings(r)},error:()=>{this.saving=!1,this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving the file")}}):(r.image=this.fileUploadField?.hasFileChanged?void 0:this.program?.image,this.updateDisplaySettings(r))}cancel(){this.router.navigate(["../overview"],{relativeTo:this.route})}contentLinkOptionChange(t){let r=this.fields.find(v=>v.controlName==="pageBuilderPageID"),a=this.fields.find(v=>v.controlName==="linkURL");if(!r||!a)return;let c=t===dt.PAGE_BUILDER_PAGE;r.hidden=!c,a.hidden=c,this.fields.find(v=>v.controlName==="linkText").hidden=!1,this.fields.find(v=>v.controlName==="openLinkInNewTab").hidden=!1,this.fields=[...this.fields],this.contentLinkOptionID=t}addedNewProgramCategory(t){this.fields.find(r=>r.controlName==="clubProgramCategoryID").options.push({label:t.categoryName,value:t.clubProgramCategoryID}),this.fields=[...this.fields],this.entity=A(x(x({},this.entity),this.form.validFieldsValue),{clubProgramCategoryID:t.clubProgramCategoryID}),this.showAddProgramCategory=!1}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}loadMetadata(){return this.programService.getProgramDisplaySettingsMetadata().pipe(O(t=>this.siteDataService.isPaidSignupsV2Enabled$().pipe(ve(r=>{this.displaySettingsFields=t.fields,this.paidV2Enabled=r}))))}buildFields(){let t=[...this.displaySettingsFields],r=t.find(a=>a.controlName==="useRegistrationGroups");if(r&&(r.hidden=!0),this.paidV2Enabled){let a=t.find(c=>c.controlName==="forcePaymentPlanSelection");a&&(a.hidden=!0)}else t.filter(a=>a.controlName==="clubProgramCategoryID"||a.controlName==="eligibilityEndDate"||a.controlName==="programClubAssignments"||a.controlName==="image"||a.controlName.toLowerCase().includes("pagebuilderpage")||a.controlName.toLowerCase().includes("link")).forEach(a=>a.hidden=!0);this.fields=t,this.entity=x({},this.program)}updateDisplaySettings(t){this.programService.updateProgramDisplaySettings(t).pipe(T(this.unsubscribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Program listing saved successfully"),this.formService.hideFormLoader(),this.saving=!1,this.store.updateProgram(x(x({},this.program),t))},error:()=>{this.saving=!1,this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving this program's listing settings")}})}};o.\u0275fac=function(r){return new(r||o)(_(ue),_(se),_(L),_(_e),_(fe),_(he),_(X))},o.\u0275cmp=N({type:o,selectors:[["app-training-sessions-program-listing"]],viewQuery:function(r,a){if(r&1&&k(zi,5)(Qi,5),r&2){let c;w(c=I())&&(a.form=c.first),w(c=I())&&(a.fileUploadField=c.first)}},standalone:!1,decls:7,vars:2,consts:[["listingForm",""],["fileUploadField",""],[1,"col-lg-9","p-0"],["skeletonType","form"],["alertType","error"],["buttonsPosition","left",3,"onSubmit","onCancel","fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","buttonsSticky","showSubmitButton","showCancelButton"],[1,"mb-3","text-medium","text-grey"],["fieldName","image",3,"onChange","acceptedFileExtensions","canRemoveFile","selectedFileName"],["fieldName","availableOnPageBuilderPages"],["fieldName","eligibilityEndDate"],["fieldName","programClubAssignments",3,"enableFilter"],["fieldName","pageBuilderPageFeatureText"],["fieldName","contentLinkOptionID",3,"onChange"],["fieldName","pageBuilderPageID",3,"enableFilter","hidden"],["fieldName","linkURL",3,"hidden"],["fieldName","linkText",3,"hidden"],["fieldName","openLinkInNewTab",3,"hidden"],["fieldName","details"],["fieldName","clubProgramCategoryID"],["afterInputContent",""],["fieldName","sortOrder"],["fieldName","shortDe
104scription"],["type","button",1,"btn","btn-sm","btn-naked","btn-icon-plus","btn-add-program-category",3,"click"],[1,"form-section"],["fieldName","forcePaymentPlanSelection"],[3,"onSave","onCancel"]],template:function(r,a){r&1&&(s(0,"div",2),e(1,`
105    `),u(2,Wi,3,0)(3,qi,4,0)(4,Xi,62,21),l(),e(5,`
106
107`),u(6,Ji,3,0)),r&2&&(m(2),h(a.loading?2:a.error||!a.fields||!a.program?3:4),m(4),h(a.showAddProgramCategory?6:-1))},dependencies:[H,Y,q,Q,ii],encapsulation:2});let i=o;return i})();var rn=["timeSlotAddDialog"],on=["timeSlotList"],an=["signUpWizard"],sn=["bundleWizard"],ln=i=>["..","activities",i],mn=i=>["..","activities",i,"dates-times"],dn=i=>["..","activities",i,"dates-times","import"],cn=i=>["..","registrations",i],pn=()=>["..","registrations"],gn=(i,o)=>o.scheduleSignUpID,un=(i,o)=>o.registrationID;function hn(i,o){if(i&1){let n=y();e(0,`
108                `),s(1,"span"),e(2,`
109                    `),s(3,"button",7),C("click",function(){f(n);let r=d();return S(r.goToAddSignUp())}),e(4,`
110                        `),p(5,"i",8),e(6,` Add Time Slot Group
111                    `),l(),e(7,`
112                `),l(),e(8,`
113            `)}if(i&2){let n=d();m(3),g("disabled",n.loading)}}function fn(i,o){i&1&&(e(0,`
114            `),s(1,"app-loader"),e(2,"Loading time slot groups..."),l(),e(3,`
115        `))}function Sn(i,o){if(i&1&&(e(0),ee(1,"date")),i&2){let n=d().$implicit;E(`
116                                        Available through `,ae(1,1,n.endDate,"MM/dd/yyyy"),`
117                                    `)}}function _n(i,o){i&1&&e(0,` 
118                                        Open
119                                    `)}function xn(i,o){i&1&&e(0,`
120                                        Not set up yet
121                                    `)}function Cn(i,o){if(i&1&&(e(0,`
122                                                `),e(1)),i&2){let n=d(2).$implicit;m(),E(`
123                                                    `,n.activeTimeSlotCount.toString()+" of "+n.totalTimeSlotCount.toString(),`
124                                                    booked
125                                            `)}}function vn(i,o){i&1&&e(0,`   
126                                                No upcoming time slots
127                                            `)}function Tn(i,o){if(i&1&&(e(0,`
128                                            `),u(1,Cn,2,1)(2,vn,1,0)),i&2){d();let n=Et(26);m(),h(n?1:2)}}function bn(i,o){i&1&&e(0,`
129                                            All Booked
130                                        `)}function yn(i,o){if(i&1&&(e(0,`
131                                        `),s(1,"span",23),e(2,`
132                                            `),p(3,"i",24),e(4,`
133                                            `),s(5,"span"),e(6),l(),e(7,`
134                                        `),l(),e(8,`
135                                        `),e(9,`
136                                    `)),i&2){let n=d(2).$implicit;m(6),E("",n.unstaffedTimeSlotCount," Slots need staff")}}function Dn(i,o){i&1&&(e(0,`
137                                        `),s(1,"span",25),e(2,`
138                                            `),p(3,"i",26),e(4,` 
139                                            `),s(5,"span"),e(6,"Fully Staffed"),l(),e(7,`
140                                        `),l(),e(8,`
141                                        `),e(9,`
142                                    `))}function En(i,o){if(i&1&&(e(0,`
143                                    `),u(1,yn,10,1)(2,Dn,10,0)),i&2){let n=d().$implicit;m(),h(n.unstaffedTimeSlotCount?1:2)}}function wn(i,o){i&1&&(e(0,`
144                                        `),p(1,"app-pill",27),e(2,`
145                                    `)),i&2&&(m(),g("text","Open")("nowrap",!0))}function In(i,o){i&1&&(e(0,`
146                                        `),p(1,"app-pill",28),e(2,`
147                                    `)),i&2&&(m(),g("text","Upcoming")("nowrap",!0))}function Pn(i,o){i&1&&(e(0,`
148                                        `),p(1,"app-pill",29),e(2,`
149                                    `)),i&2&&(m(),g("text","Past")("nowrap",!0))}function An(i,o){i&1&&(e(0,`
150                                        `),p(1,"app-pill",30),e(2,`
151                                    `)),i&2&&(m(),g("text","Removed")("nowrap",!0))}function Fn(i,o){if(i&1&&(e(0,`
152                    `),s(1,"div",12),e(2,`
153                        `),s(3,"div",13),e(4,`
154                            `),s(5,"div",14),e(6,`
155                                `),e(7,`
156                                `),s(8,"div",15),e(9,`
157                                    `),s(10,"a",16),e(11),l(),e(12,`
158                                `),l(),e(13,`
159                                `),e(14,`
160                                `),s(15,"div",17),e(16,`
161                                    `),u(17,Sn,2,4)(18,_n,1,0)(19,xn,1,0),l(),e(20,`
162                            `),l(),e(21,`
163                            `),s(22,"div",18),e(23,`
164                                `),s(24,"div",19),e(25,`
165                                    `),yt(26),e(27,`
166                                    `),e(28,`
167                                    `),s(29,"a",20),e(30,`
168                                        `),u(31,Tn,3,1)(32,bn,1,0),l(),e(33,`
169                                `),l(),e(34,`
170                                        
171                                        
172
173                                `),s(35,"div",19),e(36,`
174                                    `),s(37,"a",21),e(38,`
175                                        Import
176                                    `),l(),e(39,`
177                                `),l(),e(40,`
178
179                                `),e(41,`
180                                `),u(42,En,3,1),l(),e(43,`
181                            `),s(44,"div",22),e(45,`
182                                `),u(46,wn,3,2)(47,In,3,2)(48,Pn,3,2)(49,An,3,2),e(50,`
183                            `),l(),e(51,`
184                        `),l(),e(52,`
185                    `),l(),e(53,`
186                `)),i&2){let n,t=o.$implicit,r=o.$index,a=o.$count,c=d(2);m(),oe("border-bottom",r!==a-1),m(9),g("routerLink",ce(11,ln,t.scheduleSignUpID)),m(),P(t.name),m(6),h(t.endDate?17:t.startDate?18:19),m(9);let b=Dt(t.totalTimeSlotCount>0)&&t.activeTimeSlotCount===t.totalTimeSlotCount;m(3),g("routerLink",ce(13,mn,t.scheduleSignUpID)),m(2),h(b?32:31),m(6),g("routerLink",ce(15,dn,t.scheduleSignUpID)),m(5),h(t.unstaffedTimeSlotCount!=null&&t.totalTimeSlotCount?42:-1),m(4),h((n=t.status)===c.ScheduleSignUpStatus.ACTIVE?46:n===c.ScheduleSignUpStatus.UPCOMING?47:n===c.ScheduleSignUpStatus.PAST?48:n===c.ScheduleSignUpStatus.REMOVED?49:-1)}}function Ln(i,o){if(i&1){let n=y();e(0,`
187                        `),s(1,"app-null-card",31),C("buttonClicked",function(){f(n);let r=d(3);return S(r.goToAddSignUp())}),e(2,`
188                        `),l(),e(3,`
189                    `)}if(i&2){let n=d(3);m(),g("showButton",n.canAddSignUp)("buttonIcon","fa fa-plus")("buttonText","Add Time Slot Group")("showCard",!1)("text","<div class='fw-600'>No Time Slot Groups Created</div> Set up time slots, assign staff, and start accepting registrations")}}function Rn(i,o){if(i&1&&(e(0,`
190                    `),u(1,Ln,4,5)),i&2){let n=d(2);m(),h(n.signUpsError?-1:1)}}function Nn(i,o){if(i&1&&(e(0,`
191            `),s(1,"div",11),e(2,`
192                `),ne(3,Fn,54,17,null,null,gn,!1,Rn,2,1),l(),e(6,`
193        `)),i&2){let n=d();m(3),re(n.signUps)}}function On(i,o){i&1&&(e(0,`
194            `),s(1,"app-loader"),e(2,"Loading bundles..."),l(),e(3,`
195        `))}function Un(i,o){if(i&1&&(e(0),ee(1,"date"),ee(2,"date")),i&2){let n=d(2).$implicit;ke(`
196                                            Availability
197                                            `,ae(1,2,n.sessionOverrideStartDate,"MM/dd/yyyy"),`
198                                            \u2013 `,ae(2,5,n.sessionOverrideEndDate,"MM/dd/yyyy"),`
199                                        `)}}function kn(i,o){if(i&1&&(e(0),ee(1,"date")),i&2){let n=d(2).$implicit;E(`
200                                            Available from `,ae(1,1,n.sessionOverrideStartDate,"MM/dd/yyyy"),`
201                                        `)}}function Mn(i,o){if(i&1&&(e(0),ee(1,"date")),i&2){let n=d(2).$implicit;E(`
202                                            Available until `,ae(1,1,n.sessionOverrideEndDate,"MM/dd/yyyy"),`
203                                        `)}}function Vn(i,o){if(i&1&&(e(0,`
204                                    `),e(1,`
205                                    `),s(2,"span",35),e(3,`
206                                        `),u(4,Un,3,8)(5,kn,2,4)(6,Mn,2,4),l(),e(7,`
207                                `)),i&2){let n=d().$implicit;m(4),h(n.sessionOverrideStartDate&&n.sessionOverrideEndDate?4:n.sessionOverrideStartDate?5:6)}}function Bn(i,o){i&1&&e(0,`
208                                        \u2022
209                                    `)}function $n(i,o){i&1&&e(0,`
210                                        Unlimited time slots
211                                    `)}function Gn(i,o){i&1&&e(0,`
212                                            per billing period
213                                        `)}function jn(i,o){if(i&1&&(e(0),u(1,Gn,1,0)),i&2){let n=d().$implicit,t=d(2);ke(`
214                                        `,n.numberOfSessions," time slot",n.numberOfSessions===1?"":"s",`
215                                        `),m(),h(n.registrationCostTypeID===t.RegistrationCostType.SUBSCRIPTION?1:-1)}}function zn(i,o){i&1&&e(0,`
216                                        No time slot count set
217                                    `)}function Qn(i,o){if(i&1&&(e(0,`
218                                `),s(1,"div",38),e(2),ee(3,"currency"),l(
218),e(4,`
219                            `)),i&2){let n=d().$implicit;m(2),E(`
220                                    List Price: `,It(3,1,n.price),`
221                                `)}}function Wn(i,o){i&1&&e(0,`
222                                        \u2022 waitlist on
223                                    `)}function qn(i,o){if(i&1&&(e(0,`
224                                `),s(1,"div",38),e(2),u(3,Wn,1,0),l(),e(4,`
225                            `)),i&2){let n=d().$implicit;m(2),E(`
226                                    Capacity: `,n.maxCapacity,`
227                                    `),m(),h(n.enableWaitlist?3:-1)}}function Yn(i,o){if(i&1&&(e(0),ee(1,"date")),i&2){let n=d().$implicit;E(`
228                                    \u2013 `,ae(1,1,n.endDate,"MM/dd/yyyy"),`
229                                `)}}function Hn(i,o){if(i&1&&(e(0,`
230                                `),s(1,"div",17),e(2),l(),e(3,`
231                            `)),i&2){let n=d().$implicit;m(2),ke(`
232                                    `,n.childRegistrations.length," included registration",n.childRegistrations.length===1?"":"s",`
233                                `)}}function Xn(i,o){i&1&&(e(0,`
234                                    `),p(1,"app-pill",39),e(2,`
235                                `)),i&2&&(m(),g("text","Subscription Bundle"))}function Jn(i,o){i&1&&(e(0,`
236                                    `),p(1,"app-pill",39),e(2,`
237                                `)),i&2&&(m(),g("text","Unlimited Bundle"))}function Kn(i,o){i&1&&(e(0,`
238                                    `),p(1,"app-pill",39),e(2,`
239                                `)),i&2&&(m(),g("text","Traditional Bundle"))}function Zn(i,o){i&1&&(e(0,`
240                                `),p(1,"app-pill",40),e(2,`
241                            `)),i&2&&(m(),g("text","Hidden"))}function er(i,o){if(i&1&&(e(0,`
242                    `),s(1,"div",32),e(2,`
243                        `),s(3,"div",33),e(4,`
244                            `),e(5,`
245                            `),e(6,`
246                            `),s(7,"a",34),e(8),l(),e(9,`
247                            `),s(10,"div"),e(11,`
248                                `),e(12,`
249                                `),e(13,`
250                                `),u(14,Vn,8,1),s(15,"span",35),e(16,`
251                                    `),u(17,Bn,1,0),u(18,$n,1,0)(19,jn,2,3)(20,zn,1,0),l(),e(21,`
252                            `),l(),e(22,`
253                        `),l(),e(23,`
254                        `),s(24,"div",36),e(25,`
255                            `),u(26,Qn,5,3),u(27,qn,5,2),s(28,"div",17),e(29),ee(30,"date"),u(31,Yn,2,4),l(),e(32,`
256                            `),u(33,Hn,4,2),l(),e(34,`
257                        `),s(35,"div",37),e(36,`
258                            `),u(37,Xn,3,1)(38,Jn,3,1)(39,Kn,3,1),e(40,`
259                            `),u(41,Zn,3,1),l(),e(42,`
260                    `),l(),e(43,`
261                `)),i&2){let n,t=o.$implicit,r=o.$index,a=o.$count,c=d(2);m(),oe("border-bottom",r!==a-1),m(6),g("routerLink",ce(17,cn,t.registrationID)),m(),P(t.name),m(6),h(t.sessionOverrideStartDate||t.sessionOverrideEndDate?14:-1),m(3),h(t.sessionOverrideStartDate||t.sessionOverrideEndDate?17:-1),m(),h(t.registrationCostTypeID===c.RegistrationCostType.UNLIMITED?18:t.numberOfSessions?19:20),m(8),h(t.price?26:-1),m(),h(t.maxCapacity?27:-1),m(2),E(`
262                                Sold `,ae(30,14,t.startDate,"MM/dd/yyyy"),`
263                                `),m(2),h(t.endDate?31:-1),m(2),h(t.childRegistrations!=null&&t.childRegistrations.length?33:-1),m(4),h((n=t.registrationCostTypeID)===c.RegistrationCostType.SUBSCRIPTION?37:n===c.RegistrationCostType.UNLIMITED?38:n===c.RegistrationCostType.FIXED?39:-1),m(4),h(t.hideInOpenPrograms?41:-1)}}function tr(i,o){if(i&1){let n=y();e(0,`
264                        `),s(1,"div",41),e(2,`
265                            `),s(3,"app-null-card",42),C("buttonClicked",function(){f(n);let r=d(3);return S(r.goToAddBundle())}),e(4,`
266                            `),l(),e(5,`
267                        `),l(),e(6,`
268                    `)}i&2&&(m(3),g("showButton",!0)("buttonIcon","fa fa-plus")("buttonText","Add Bundle")("showCard",!1)("text","<div class='fw-700'>No Bundles Created</div> Sell a set number of time slots, a subscription, or unlimited access"))}function ir(i,o){if(i&1&&(e(0,`
269                    `),u(1,tr,7,5)),i&2){let n=d(2);m(),h(n.bundlesError?-1:1)}}function nr(i,o){i&1&&(e(0,`
270                `),s(1,"p",43),e(2,`
271                    Only the first bundles are shown.
272                    `),s(3,"a",34),e(4,"See all registrations"),l(
272),e(5,`
273                `),l(),e(6,`
274            `)),i&2&&(m(3),g("routerLink",wt(1,pn)))}function rr(i,o){if(i&1&&(e(0,`
275            `),s(1,"div",11),e(2,`
276                `),ne(3,er,44,19,null,null,un,!1,ir,2,1),l(),e(6,`
277            `),u(7,nr,7,2)),i&2){let n=d();m(3),re(n.bundles),m(4),h(n.bundlesTruncated?7:-1)}}function or(i,o){if(i&1){let n=y();e(0,`
278    `),s(1,"app-time-slot-add-dialog",44,0),C("confirmInitiated",function(r){f(n);let a=d();return S(a.addTimeSlots(r))}),e(3,`
279    `),l(),e(4,`
280`)}if(i&2){let n=d();m(),g("signUpTypeID",n.SignUpType.PAID)("selectableSignUps",n.signUps)}}function ar(i,o){if(i&1){let n=y();e(0,`
281    `),s(1,"app-yes-no-modal",45),C("onYesSelect",function(){f(n);let r=d();return S(r.addSignUpForTimeSlots())})("onNoSelect",function(){f(n);let r=d();return S(r.needsSignUpForTimeSlots=!1)}),e(2,`
282    `),l(),e(3,`
283`)}}function sr(i,o){if(i&1){let n=y();e(0,`
284    `),s(1,"app-add-registration-dialog",46),C("selectionMade",function(r){f(n);let a=d();return S(a.bundleTypeChosen(r))})("cancel",function(){f(n);let r=d();return S(r.bundleTypeCancelled())}),e(2,`
285    `),l(),e(3,`
286`)}if(i&2){let n=d();m(),g("programID",n.programID)("programTypeID",n.ProgramType.TRAINING_SESSIONS)("reportSelection",!0)}}function lr(i,o){i&1&&(e(0,`
287            `),p(1,"app-skeleton-template",48),e(2,`
288        `))}function mr(i,o){if(i&1){let n=y();e(0,`
289        `),s(1,"app-registration-add",47,1),C("completed",function(){f(n);let r=d();return S(r.bundleAdded())})("cancelled",function(){f(n);let r=d();return S(r.bundleAddCancelled())}),e(3,`
290        `),l(),e(4,`
291        `),e(5,`
292        `),u(6,lr,3,0)}if(i&2){let n=Ue(2),t=d();m(),g("dialogMode",!0)("preselectedCostType",t.bundleSetup==null?null:t.bundleSetup.registrationCostTypeID)("preselectRegistrationTemplateID",t.bundleSetup==null?null:t.bundleSetup.registrationTemplateID)("preselectRegistrationID",t.bundleSetup==null?null:t.bundleSetup.duplicateRegistrationID),m(5),h(n.loading?6:-1)}}function dr(i,o){if(i&1){let n=y();e(0,`
293        `),s(1,"app-paid-schedule-sign-up-add",49,2),C("completed",function(){f(n);let r=d();return S(r.signUpAdded())})("cancelled",function(){f(n);let r=d();return S(r.signUpAddCancelled())}),e(3,`
294        `),l(),e(4,`
295    `)}i&2&&(m(),g("dialogMode",!0))}var V=class V{constructor(o,n,t,r,a){this.registrationService=o,this.siteDataService=n,this.scheduleSignUpService=t,this.store=r,this.authorizeService=a,this.showBundles=!0,this.addingSignUp=!1,this.canAddSignUp=!1,this.choosingBundleType=!1,this.addingBundle=!1,this.needsSignUpForTimeSlots=!1,this.bundles=[],this.bundlesTruncated=!1,this.signUps=[],this.loading=!0,this.bundlesError=!1,this.signUpsError=!1,this.unsubscribe$=new U,this.RegistrationCostType=pe,this.ProgramType=ie,this.ScheduleSignUpStatus=Yt,this.TimeSlotComponentView=We,this.SignUpType=Se}ngOnInit(){this.authorizeService.getUser().pipe(Z(1),T(this.unsubscribe$)).subscribe({next:o=>{this.canAddSignUp=!!o?.[B.SignUps]},error:()=>{this.canAddSignUp=!1}}),this.store.select(o=>o.programID).pipe(j(o=>!!o),Ae(o=>(this.programID=o,this.loading=!0,this.loadData(o))),T(this.unsubscribe$)).subscribe({next:o=>{this.bundles=this.toBundles(o.registrations.results),this.bundlesTruncated=(o.registrations.count??0)>V.searchRows,this.signUps=o.signUps,this.loading=!1,this.siteDataService.hideSiteLoader()},error:()=>{this.bundlesError=!0,this.signUpsError=!0,this.loading=!1,this.siteDataService.showSiteErrorAlert("An error occurred while loading data for this program. Please try again later."),this.siteDataService.hideSiteLoader()}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}canLeave(){return this.addingSignUp&&this.signUpWizard?this.signUpWizard.requestClose():this.addingBundle&&this.bundleWizard?this.bundleWizard.requestClose():D(!0)}goToAddBundle(){this.choosingBundleType=!0}bundleTypeChosen(o){this.choosingBundleType=!1,this.bundleSetup=o,this.addingBundle=!0}bundleTypeCancelled(){this.choosingBundleType=!1}bundleAdded(){this.closeBundleWizard(),this.refreshBundles()}bundleAddCancelled(){this.closeBundleWizard()}closeBundleWizard(){this.addingBundle=!1,this.bundleSetup=null}refreshBundles(){this.registrationService.searchRegistrations(this.programID,this.bundleSearchFilters()).pipe(T(this.unsubscribe$)).subscribe({next:o=>{this.bundles=this.toBundles(o.results),this.bundlesTruncated=(o.count??0)>V.searchRows,this.bundlesError=!1},error:()=>{this.siteDataService.showSiteErrorAlert("The bundle was created, but this page could not be refreshed. Please reload to see it.")}})}goToAddSignUp(){this.addingSignUp=!0}signUpAdded(){this.addingSignUp=!1,this.refreshSignUpsAndSchedule("The sign up was created").pipe(T(this.unsubscribe$)).subscribe({next:()=>{},error:()=>{this.siteDataService.showSiteErrorAlert("The sign up was created, but this page could not be refreshed. Please reload to see it.")}})}signUpAddCancelled(){this.addingSignUp=!1}goToAddTimeSlot(){if(!this.signUps.length){this.canAddSignUp?this.needsSignUpForTimeSlots=!0:this.siteDataService.showSiteInfoAlert("Time slots belong to a time slot group. This program has no time slot groups yet \u2014 ask an administrator with Sessions permission to create one first.");return}this.timeSlotAddDialog?.openDialog()}addSignUpForTimeSlots(){this.needsSignUpForTimeSlots=!1,this.goToAddSignUp()}addTimeSlots(o){if(!o?.scheduleSignUp?.scheduleSignUpID||!o.timeSlots?.length){this.timeSlotAddDialog?.cancelSave();return}let n=o.timeSlots.map(t=>A(x({},t),{startDate:te(t.startDate),endDate:te(t.endDate)}));this.scheduleSignUpService.updateScheduleSignUpTimeSlots(A(x({},o.scheduleSignUp),{timeSlots:n})).pipe(O(()=>this.refreshSignUpsAndSchedule("The time slots were added")),T(this.unsubscribe$)).subscribe({next:()=>{this.timeSlotAddDialog?.saveComplete()},error:()=>{this.timeSlotAddDialog?.cancelSave(),this.siteDataService.showSiteErrorAlert("There was a problem adding the time slots. Please try again.")}})}refreshSignUpsAndSchedule(o){return this.scheduleSignUpService.getAdminProgramSignUps(this.programID).pipe(F(n=>{this.signUps=n,this.signUpsError=!1}),K(()=>(this.siteDataService.showSiteErrorAlert(`${o}, but this page could not be refreshed. Please reload to see the change.`),D(null))),O(()=>(this.timeSlotList?.refreshTimeSlots()??D([])).pipe(K(()=>(this.siteDataService.showSiteErrorAlert(`${o}, but the schedule could not be refreshed. Please reload to see the change.`),D([]))))))}loadData(o){return this.bundlesError=!1,this.signUpsError=!1,J({registrations:this.registrationService.searchRegistrations(o,this.bundleSearchFilters()).pipe(K(()=>(this.bundlesError=!0,this.siteDataService.showSiteErrorAlert("An error occurred while loading bundles for this program. Please try again later."),D({count:0,results:[]})))),signUps:this.scheduleSignUpService.getAdminProgramSignUps(o).pipe(K(()=>(this.signUpsError=!0,this.siteDataService.showSiteErrorAlert("An error occurred while loading sign ups for this program. Please try again later."),D([]))))})}bundleSearchFilters(){let o=new pi;return o.rows=V.searchRows,o.getTotalCount=!0,o}toBundles(o){let n=new Map;return o.filter(t=>
295t.parentRegistrationID).forEach(t=>{let r=n.get(t.parentRegistrationID)??[];r.push(t),n.set(t.parentRegistrationID,r)}),o.filter(t=>!t.parentRegistrationID&&V.bundleCostTypes.includes(t.registrationCostTypeID)).map(t=>A(x({},t),{childRegistrations:n.get(t.registrationID)??[]}))}};V.bundleCostTypes=[pe.FIXED,pe.SUBSCRIPTION,pe.UNLIMITED],V.searchRows=100,V.\u0275fac=function(n){return new(n||V)(_(le),_(L),_(xe),_(X),_(he))},V.\u0275cmp=N({type:V,selectors:[["app-training-sessions-program-overview"]],viewQuery:function(n,t){if(n&1&&k(rn,5)(on,5)(an,5)(sn,5),n&2){let r;w(r=I())&&(t.timeSlotAddDialog=r.first),w(r=I())&&(t.timeSlotList=r.first),w(r=I())&&(t.signUpWizard=r.first),w(r=I())&&(t.bundleWizard=r.first)}},standalone:!1,decls:48,vars:23,consts:[["timeSlotAddDialog",""],["bundleWizard",""],["signUpWizard",""],[1,""],[1,"card","mb-4"],[1,"d-flex","flex-row","justify-content-between","align-items-center","mb-3"],[1,"mb-0"],[1,"btn","btn-sm","btn-secondary",3,"click","disabled"],[1,"fa","fa-plus","mr-1"],["header","New Bundle","styleClass","mediumWidthDialog",3,"visibleChange","visible","modal","draggable","resizable","closable","closeOnEscape","dismissableMask"],["header","New Time Slot Group","styleClass","mediumWidthDialog",3,"visibleChange","visible","modal","draggable","resizable","closable","closeOnEscape","dismissableMask"],[1,"border-all","border-radius","p-0"],["data-testid","training-sessions-sign-up-row",1,"p-3"],[1,"row","align-items-center"],[1,"col-md-7"],[1,"min-width-0","mr-2","line-clamp-1"],[1,"fw-600",3,"routerLink"],[1,"text-small","mb-1"],[1,"col-md-3"],[1,"line-height-2"],["pTooltip","Upcoming time slots with registrations / total upcoming time slots",1,"hover-dotted","text-small",3,"routerLink"],[1,"hover-dotted","text-small",3,"routerLink"],[1,"col-md-2","text-right"],[1,"text-warn","text-small"],[1,"far","fa-exclamation-triangle"],[1,"text-green","text-small"],[1,"far","fa-user-check"],["status","success",3,"text","nowrap"],["status","active",3,"text","nowrap"],["status","error",3,"text","nowrap"],["status","warning",3,"text","nowrap"],[3,"buttonClicked","showButton","buttonIcon","buttonText","showCard","text"],["data-testid","training-sessions-bundle-card",1,"row","p-3","no-gutters"],[1,"col-md-5","line-height-2"],[3,"routerLink"],[1,"text-small"],[1,"col-md-4"],[1,"col-md-3","text-right"],[1,"text-medium","mb-1"],["status","default",3,"text"],["status","warning",3,"text"],[1,"col-12","py-3"],[1,"full-width","d-block",3,"buttonClicked","showButton","buttonIcon","buttonText","showCard","text"],[1,"text-small","text-grey","mt-2"],[3,"confirmInitiated","signUpTypeID","selectableSignUps"],["headerText","Add a time slot group first","alertType","info","modalText","Time slots belong to a time slot group, and this program does not have one yet. Create a time slot group and you can schedule its time slots right after.","yesButtonText","Add Time Slot Group","noButtonText","Not Now",3,"onYesSelect","onNoSelect"],[3,"selectionMade","cancel","programID","programTypeID","reportSelection"],[3,"completed","cancelled","dialogMode","preselectedCostType","preselectRegistrationTemplateID","preselectRegistrationID"],["skeletonType","form"],[3,"completed","cancelled","dialogMode"]],template:function(n,t){n&1&&(s(0,"div",3),e(1,`
296        `),s(2,"div",4),e(3,`
297        `),s(4,"div",5),e(5,`
298            `),s(6,"h3",6),e(7,"Time Slot Groups"),l(),e(8,`
299            `),u(9,hn,9,1),l(),e(10,`
300        `),u(11,fn,4,0)(12,Nn,7,1),l(),e(13,`
301
302    `),s(14,"div",4),e(15,`
303        `),s(16,"div",5),e(17,`
304            `),s(18,"h3",6),e(19,"Bundles"),l(),e(20,`
305            `),s(21,"span"),e(22,`
306                `),s(23,"button",7),C("click",function(){return t.goToAddBundle()}),e(24,`
307                    `),p(25,"i",8),e(26,` Add Bundle
308                `),l(),e(27,`
309            `),l(),e(28,`
310        `),l(),e(29,`
311        `),u(30,On,4,0)(31,rr,8,2),l(),e(32,`
312    
313
314    `),e(33,`
315`),l(),e(34,`
316`),e(35,`
317`),u(36,or,5,2),u(37,ar,4,0),u(38,sr,4,3),s(39,"p-dialog",9),De("visibleChange",function(a){return ye(t.addingBundle,a)||(t.addingBundle=a),a}),e(40,`
318    `),u(41,mr,7,5),l(),e(42,`
319
320`),e(43,`
321`),s(44,"p-dialog",10),De("visibleChange",function(a){return ye(t.addingSignUp,a)||(t.addingSignUp=a),a}),e(45,`
322    `),u(46,dr,5,1),l(),e(47,`
323
324`)),n&2&&(m(9),h(t.canAddSignUp?9:-1),m(2),h(t.loading?11:12),m(12),g("disabled",t.loading),m(7),h(t.loading?30:31),m(6),h(!t.loading&&t.signUps.length?36:-1),m(),h(t.needsSignUpForTimeSlots?37:-1),m(),h(t.choosingBundleType?38:-1),m(),be("visible",t.addingBundle),g("modal",!0)("draggable",!1)("resizable",!1)("closable",!1)("closeOnEscape",!1)("dismissableMask",!1),m(2),h(t.addingBundle?41:-1),m(3),be("visible",t.addingSignUp),g("modal",!0)("draggable",!1)("resizable",!1)("closable",!1)("closeOnEscape",!1)("dismissableMask",!1),m(2),h(t.addingSignUp?46:-1))},dependencies:[Be,z,Mt,q,ze,Qt,$e,kt,qe,Kt,di,He,Ft,At],encapsulation:2});var et=V;var cr=["eligibilityForm"];function pr(i,o){if(i&1&&(e(0,`
325                    `),s(1,"a",25),e(2,`
326                        All eligibility settings`),p(3,"i",26),e(4,`
327                    `),l(),e(5,`
328                `)),i&2){let n=d(2);m(),g("routerLink",n.registrationLink)}}function gr(i,o){if(i&1){let n=y();e(0,`
329    `),s(1,"app-dynamic-form",1,0),e(3,`
330        `),s(4,"div",2),e(5,`
331            `),s(6,"div",3),e(7,`
332                `),s(8,"h3",4),e(9),l(),e(10,`
333                `),u(11,pr,6,1),l(),e(12,`
334            `),s(13,"div",5),e(14,`
335                `),s(15,"p",6),e(16),l(),e(17,`
336            `),l(),e(18,`
337            `),s(19,"div",7),e(20,`
338                `),p(21,"app-dynamic-form-field",8),e(22,`
339                `),p(23,"app-dynamic-form-field",9),e(24,`
340                `),p(25,"app-dynamic-form-field",10),e(26,`
341                `),p(27,"app-dynamic-form-field",11),e(28,`
342                `),s(29,"app-dynamic-form-field",12),C("onChange",function(r){f(n);let a=d();return S(a.genderChange(r))}),l(),e(30,`
343                `),p(31,"app-dynamic-form-field",13),e(32,`
344                `),p(33,"app-dynamic-form-field",14),e(34,`
345                `),p(35,"app-dynamic-form-field",15),e(36,`
346                `),p(37,"app-dynamic-form-field",16),e(38,`
347                `),p(39,"app-dynamic-form-field",17),e(40,`
348            `),l(),e(41,`
349        `),l(),e(42,`
350
351        `),s(43,"div",2),e(44,`
352            `),s(45,"div",18),e(46,`
353                `),s(47,"h3",19),e(48),l(),e(49,`
354            `),l(),e(50,`
355            `),s(51,"div",5),e(52,`
356                `),s(53,"p",6),e(54),l(),e(55,`
357            `),l(),e(56,`
358            `),s(57,"div",7),e(58,`
359                `),s(59,"app-dynamic-form-field",20),C("onChange",function(r){f(n);let a=d();return S(a.programChange(r.value))}),l(),e(60,`
360                `),p(61,"app-dynamic-form-field",21),e(62,`
361                `),p(63,"app-dynamic-form-field",22),e(64,`
362            `),l(),e(65,`
363        `),l(),e(66,`
364
365        `),s(67,"div",2),e(68,`
366            `),s(69,"div",18),e(70,`
367                `),s(71,"h3",19),e(72),l(),e(73,`
368            `),l(),e(74,`
369            `),s(75,"div",7),e(76,`
370                `),p(77,"app-dynamic-form-field",23),e(78,`
371                `),p(79,"app-dynamic-form-field",24),e(80,`
372            `),l(),e(81,`
373        `),l(),e(82,`
374    `),l(),e(83,`
375`)}if(i&2){let n=d();m(),g("fields",n.fields)("entity",n.entity)("horizontalForm",!0)("contentFieldsMode",!0)("showSaveAndAddButton",!1)("showSubmitButton",!1)("showCancelButton",!1)("saveBlankFields",!0),m(8),P(n.copy.aLaCarteEligibility.heading),m(2),h(n.registrationLink?11:-1),m(5),P(n.copy.aLaCarteEligibility.description),m(5),g("showTime",!0)("defaultTime","00:00"),m(2),g("showTime",!0)("defaultTime","23:59"),m(25),P(n.copy.aLaCartePreConditions.heading),m(6),P(n.copy.aLaCartePreConditions.description),m(18),P(n.copy.singleSessionPurchaseOptions.heading)}}var tt=(()=>{let o=class o{constructor(t,r,a,c){this.programService=t,this.adminProgramService=r,this.siteDataService=a,this.formService=c,this.registrationLink=null,this.fields=[],this.copy=me,this.programs=[],this.rebuiltByEdit=!1,this.unsubscribe$=new U}ngOnInit(){this.entity=this.registration,this.buildFields(),this.loadContingencyPrograms()}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}get isValid(){return!this.form||this.form.isValid}get isDirty(){return this.rebuiltByEdit||!!this.form?.form?.dirty}markPristine(){this.rebuiltByEdit=!1,this.form?.form?.markAsPristine()}validate(){if(!this.form)return!0;if(!this.form.isValid)return this.form.submitForm(),!1;let t=this.form.value??{};return t.startDate&&t.endDate&&new Date(t.startDate)>new Date(t.endDate)?(this.formService.showFormErrorMessage("Single session End Date cannot be before Start Date"),!1):t.birthDateFrom&&t.birthDateTo&&new Date(t.birthDateFrom)>new Date(t.birthDateTo)?(this.formService.showFormErrorMessage("Birthdate To cannot be before Birthdate From"),!1):t.graduationYearFrom&&t.graduationYearTo&&new Date(t.graduationYearFrom)>new Date(t.graduationYearTo)?(this.formService.showFormErrorMessage("Graduation Date To cannot be before Graduation Date From"),!1):Ot(this.registration?.programID,t.programContingencies,t.registrationContingencies,this.registration?.registrationID)?(this.formService.showFormErrorMessage(mt(this.registration?.program?.name)),!1):!0}payload(){let t=x(x({},this.registration),this.form?.value??{});return t.startDate&&(t.startDate=te(t.startDate)),t.endDate&&(t.endDate=te(t.endDate)),t}genderChange(t){let r=this.fields.find(c=>c.controlName==="includeOtherGender");if(!r)return;let a=!this.showsIncludeOtherGender(t);!!r.hidden!==a&&(r.hidden=a,this.rebuiltByEdit=!0,this.rebuildFields({genderID:t}))}programChange(t,r=!0){let a=this.fields.find(b=>b.controlName==="registrationContingencies"),c=this.fields.find(b=>b.controlName==="teamContingencies");if(!a||!c)return;r&&(this.rebuiltByEdit=!0);let v=t||[];(v.length?this.programService.getRegistrations(v):D([])).pipe(Z(1),T(this.unsubscribe$)).subscribe({next:b=>{a.options=(b||[]).filter(M=>M.value!==this.registration?.registrationID),c.options=this.teamOptionsForPrograms(v),v.includes(this.registration?.programID)?(Bt(a),a.note=mt(this.registration?.program?.name),this.form?.requireControl("registrationContingencies")):(Ge(a),a.note=null,this.form?.unRequireControl("registrationContingencies"));let R=this.form?.validFieldsValue??{};this.rebuildFields({programContingencies:v,registrationContingencies:(R.registrationContingencies||[]).filter(M=>a.options.some(ge=>ge.value===M)),teamContingencies:(R.teamContingencies||[]).filter(M=>c.options.some(ge=>ge.value===M))})},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting the registrations to require.")}})}buildFields(){let t=[...vi,...Ti].map(a=>(this.metadataFields||[]).find(c=>c.controlName===a)).filter(a=>!!a),r=t.find(a=>a.controlName==="includeOtherGender");r&&(r.hidden=!this.showsIncludeOtherGender(this.registration?.genderID)),this.fields=t}showsIncludeOtherGender(t){return t===pt.FEMALE||t===pt.MALE}loadContingencyPrograms(){this.registration?.programContingencies?.length&&this.adminProgramService.getPrograms({includeTeams:!0}).pipe(Z(1),T(this.unsubscribe$)).subscribe({next:t=>{this.programs=t||[],this.programChange(this.registration.programContingencies,!1)},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting the programs to require.")}})}teamOptionsForPrograms(t){let r=new Map;return(this.programs||[]).filter(a=>
375t.includes(a.programID)).forEach(a=>(a.teams||[]).forEach(c=>r.set(c.teamID,{value:c.teamID,label:c.name}))),Array.from(r.values())}rebuildFields(t){this.entity=x(x(x({},this.entity),this.form?.validFieldsValue??{}),t),this.fields=[...this.fields]}};o.\u0275fac=function(r){return new(r||o)(_(_e),_(Qe),_(L),_(fe))},o.\u0275cmp=N({type:o,selectors:[["app-training-sessions-a-la-carte-eligibility"]],viewQuery:function(r,a){if(r&1&&k(cr,5),r&2){let c;w(c=I())&&(a.form=c.first)}},inputs:{registration:"registration",metadataFields:"metadataFields",registrationLink:"registrationLink"},standalone:!1,decls:2,vars:1,consts:[["eligibilityForm",""],[3,"fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","showSubmitButton","showCancelButton","saveBlankFields"],[1,"card","mb-3"],[1,"header","d-flex","align-items-center","justify-content-between","mb-3"],[1,"card-title","mb-0"],[1,"subHeader"],[1,"text-medium"],[1,"body"],["fieldName","startDate",3,"showTime","defaultTime"],["fieldName","endDate",3,"showTime","defaultTime"],["fieldName","birthDateFrom"],["fieldName","birthDateTo"],["fieldName","genderID",3,"onChange"],["fieldName","includeOtherGender"],["fieldName","gradeID"],["fieldName","ageClass"],["fieldName","graduationYearFrom"],["fieldName","graduationYearTo"],[1,"header"],[1,"card-title"],["fieldName","programContingencies",3,"onChange"],["fieldName","registrationContingencies"],["fieldName","teamContingencies"],["fieldName","enablePromoCodes"],["fieldName","enablePayOffline"],[1,"btn","btn-naked","btn-sm",3,"routerLink"],[1,"fa-regular","fa-arrow-right","ml-1"]],template:function(r,a){r&1&&(e(0,`
376`),u(1,gr,84,18)),r&2&&(m(),h(a.fields!=null&&a.fields.length&&a.entity?1:-1))},dependencies:[H,Y,z],encapsulation:2});let i=o;return i})();var _r=["emailForm"];function xr(i,o){i&1&&(e(0,`
377    `),p(1,"app-skeleton-template",1),e(2,`
378`))}function Cr(i,o){i&1&&(e(0,`
379    `),s(1,"app-inline-alert",2),e(2,`
380        Unable to load the email settings.
381    `),l(),e(3,`
382`))}function vr(i,o){if(i&1&&(e(0,`
383                    `),s(1,"a",24),e(2,`
384                        All email settings`),p(3,"i",25),e(4,`
385                    `),l(),e(5,`
386                `)),i&2){let n=d(2);m(),g("routerLink",n.emailSettingsLink)}}function Tr(i,o){if(i&1){let n=y();e(0,`
387    `),e(1,`
388    `),s(2,"app-dynamic-form",3,0),e(4,`
389        `),s(5,"div",4),e(6,`
390            `),s(7,"div",5),e(8,`
391                `),s(9,"h3",6),e(10),l(),e(11,`
392                `),u(12,vr,6,1),l(),e(13,`
393            `),s(14,"div",7),e(15,`
394                `),s(16,"p",8),e(17),l(),e(18,`
395            `),l(),e(19,`
396            `),s(20,"div",9),e(21,`
397                `),s(22,"div",10),e(23,`
398                    `),s(24,"label"),e(25,`
399                        `),s(26,"h4",11),e(27,"Player Registration Receipt Email Settings"),l(),e(28,`
400                    `),l(),e(29,`
401                    `),s(30,"div",12),e(31,`
402                        `),s(32,"p-toggleswitch",13),C("ngModelChange",function(r){f(n);let a=d();return S(a.toggleOverride(a.receipt,r))}),l(),e(33,`
403                        `),s(34,"label",14),e(35,`Override Form
404                            Settings`),l(),e(36,`
405                    `),l(),e(37,`
406                `),l(),e(38,`
407                `),p(39,"app-dynamic-form-field",15),e(40,`
408                `),p(41,"app-dynamic-form-field",16),e(42,`
409                `),p(43,"app-dynamic-form-field",17),e(44,`
410                `),p(45,"app-dynamic-form-field",18),e(46,`
411                `),p(47,"app-dynamic-form-field",19),e(48,`
412                `),p(49,"hr"),e(50,`
413                `),s(51,"div",10),e(52,`
414                    `),s(53,"label"),e(54,`
415                        `),s(55,"h4",11),e(56,"Incomplete Registration Reminder Email Settings"),l(),e(57,`
416                    `),l(),e(58,`
417                    `),s(59,"div",12),e(60,`
418                        `),s(61,"p-toggleswitch",13),C("ngModelChange",function(r){f(n);let a=d();return S(a.toggleOverride(a.incomplete,r))}),l(),e(62,`
419                        `),s(63,"label",20),e(64,`Override Form
420                            Settings`),l(),e(65,`
421                    `),l(),e(66,`
422                `),l(),e(67,`
423                `),p(68,"app-dynamic-form-field",21),e(69,`
424                `),p(70,"app-dynamic-form-field",22),e(71,`
425                `),p(72,"app-dynamic-form-field",23),e(73,`
426            `),l(),e(74,`
427        `),l(),e(75,`
428    `),l(),e(76,`
429`)}if(i&2){let n=d();m(2),g("fields",n.activeFields)("entity",n.displayEntity)("horizontalForm",!0)("contentFieldsMode",!0)("showSaveAndAddButton",!1)("showSubmitButton",!1)("showCancelButton",!1)("saveBlankFields",!0),m(8),P(n.copy.emailSettings.heading),m(2),h(n.emailSettingsLink?12:-1),m(5),P(n.copy.emailSettings.description),m(15),g("ngModel",n.receipt.enabled)("inputId","receiptOverrideToggle"),m(29),g("ngModel",n.incomplete.enabled)("inputId","incompleteOverrideToggle")}}var it=(()=>{let o=class o{constructor(t,r,a){this.registrationService=t,this.registrationTemplateService=r,this.siteDataService=a,this.emailSettingsLink=null,this.saved=new Re,this.copy=me,this.loading=!0,this.error=!1,this.receipt=Pe.receiptEmail(),this.incomplete=Pe.incompleteEmail(),this.loadedTemplateID=null,this.toggled=!1,this.unsubscribe$=new U}ngOnInit(){J({metadata:this.registrationService.getRegistrationEmailSettingsMetadata(),template:this.registrationTemplateService.getRegistrationTemplate(this.registration.registrationTemplateID)}).pipe(T(this.unsubscribe$)).subscribe({next:t=>{this.fields=t.metadata.fields??[],this.registrationTemplate=t.template,this.loadedTemplateID=this.registration?.registrationTemplateID??null,this.seedFromTemplate(),this.loading=!1},error:()=>{this.loading=!1,this.error=!0,this.siteDataService.showSiteErrorAlert("Unable to load email settings")}})}ngOnChanges(t){t.registration&&!t.registration.firstChange&&this.reloadTemplate()}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}get isDirty(){return this.toggled||!!this.formRef?.form?.dirty}validate(){return!this.formRef||!this.isDirty||this.formRef.form?.disabled||this.formRef.isValid?!0:(this.formRef.submitForm(),!1)}save(){if(this.loading||this.error||!this.formRef||!this.isDirty)return D(null);let t=x(x({},this.registration),this.formRef.value);return t.registrationID=this.registration.registrationID,this.receipt.clearMatching(t,this.registrationTemplate),this.incomplete.clearMatching(t,this.registrationTemplate),this.registrationService.updateRegistrationEmailSettings(t).pipe(F(()=>{this.registration=t,this.saved.emit(t)}))}markPristine(){this.toggled=!1,this.formRef?.form?.markAsPristine()}toggleOverride(t,r){t.enabled=r,this.toggled=!0,this.refresh()}reloadTemplate(){let t=this.registration?.registrationTemplateID??null;this.loading||this.error||!t||t===this.loadedTemplateID||this.registrationTemplateService.getRegistrationTemplate(t).pipe(T(this.unsubscribe$)).subscribe({next:r=>{this.registrationTemplate=r,this.loadedTemplateID=t,this.seedFromTemplate()},error:()=>{this.siteDataService.showSiteErrorAlert("Unable to load email settings")}})}seedFromTemplate(){this.receipt.initFrom(this.registration,this.registrationTemplate),this.incomplete.initFrom(this.registration,this.registrationTemplate),this.refresh()}refresh(){let t=this.formRef?.value??{};this.displayEntity=x(x(x(x({},this.registration),t),this.receipt.displayValues(this.registration,this.registrationTemplate,t)),this.incomplete.displayValues(this.registration,this.registrationTemplate,t)),this.activeFields=this.incomplete.applyToFields(this.receipt.applyToFields(this.fields))}};o.\u0275fac=function(r){return new(r||o)(_(le),_(Ye),_(L))},o.\u0275cmp=N({type:o,selectors:[["app-training-sessions-a-la-carte-email-settings"]],viewQuery:function(r,a){if(r&1&&k(_r,5),r&2){let c;w(c=I())&&(a.formRef=c.first)}},inputs:{registration:"registration",emailSettingsLink:"emailSettingsLink"},outputs:{saved:"saved"},standalone:!1,features:[Ne],decls:3,vars:1,consts:[["emailForm",""],["skeletonType","form"],["alertType","error"],[3,"fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","showSubmitButton","showCancelButton","saveBlankFields"],[1,"card","mb-3"],[1,"header","d-flex","align-items-center","justify-content-between","mb-3"],[1,"card-title","mb-0"],[1,"subHeader"],[1,"text-medium"],[1,"body"],[1,"form-group"],[1,"mb-0","mr-3"],[1,"d-flex","align-items-center"],[3,"ngModelChange","ngModel","inputId"],["for","receiptOverrideToggle",1,"mb-0","ml-2","cursor-pointer","text-medium","nowrap"],["fieldName","emailSubject"],["fieldName","emailHeader"],["fieldName","emailText"],["fieldName","emailIncludeReceipt"],["fieldName","bccEmail"],["for","incompleteOverrideToggle",1,"mb-0","ml-2","cursor-pointer","text-medium","nowrap"],["fieldName","incompleteRegistrationEmailSubject"],["fieldName","incompleteRegistrationEmailHeader"],["fieldName","incompleteRegistrationEmailText"],[1,"btn","btn-naked","btn-sm",3,"routerLink"],[1,"fa-regular","fa-arrow-right","ml-1"]],template:function(r,a){r&1&&u(0,xr,3,0)(1,Cr,4,0)(2,Tr,77,15),r&2&&h(a.loading?0:a.error||!(a.activeFields!=null&&a.activeFields.length)?1:2)},dependencies:[H,Y,Me,Ve,z,q,Q,je],encapsulation:2});let i=o;return i})();var yr=["confirmationForm"];function Dr(i,o){i&1&&(e(0,`
430    `),p(1,"app-skeleton-template",1),e(2,`
431`))}function Er(i,o){i&1&&(e(0,`
432    `),s(1,"app-inline-alert",2),e(2,`
433        Unable to load the confirmation text.
434    `),l(),e(3,`
435`))}function wr(i,o){if(i&1){let n=y();e(0,`
436    `),e(1,`
437    `),s(2,"app-dynamic-form",3,0),e(4,`
438        `),s(5,"div",4),e(6,`
439            `),s(7,"div",5),e(8,`
440                `),s(9,"h3",6),e(10),l(),e(11,`
441            `),l(),e(12,`
442            `),s(13,"div",7),e(14,`
443                `),s(15,"p",8),e(16),l(),e(17,`
444            `),l(),e(18,`
445            `),s(19,"div",9),e(20,`
446                `),s(21,"div",10),e(22,`
447                    `),s(23,"div",11),e(24,`
448                        `),s(25,"p-toggleswitch",12),C("ngModelChange",function(r){f(n);let a=d();return S(a.toggleOverride(r))}),l(),e(26,`
449                        `),s(27,"label",13),e(28,"Override Form Settings"),l(),e(29,`
450                    `),l(),e(30,`
451                `),l(),e(31,`
452                `),p(32,"app-dynamic-form-field",14),e(33,`
453            `),l(),e(34,`
454        `),l(),e(35,`
455    `),l(),e(36,`
456`)}if(i&2){let n=d();m(2),g("fields",n.activeFields)("entity",n.displayEntity)("horizontalForm",!0)("contentFieldsMode",!0)("showSaveAndAddButton",!1)("showSubmitButton",!1)("showCancelButton",!1)("saveBlankFields",!0),m(8),P(n.copy.confirmationText.heading),m(6),P(n.copy.confirmationText.description),m(9),g("ngModel",n.override.enabled)("inputId","confirmationOverrideToggle")}}var nt=(()=>{let o=class o{constructor(t,r,a){this.registrationService=t,this.registrationTemplateService=r,this.siteDataService=a,this.saved=new Re,this.copy=me,this.loading=!0,this.error=!1,this.override=Pe.confirmationText(),this.loadedTemplateID=null,this.toggled=!1,this.unsubscribe$=new U}ngOnInit(){J({metadata:this.registrationService.getRegistrationConfirmationTextMetadata(),template:this.registrationTemplateService.getRegistrationTemplate(this.registration.registrationTemplateID)}).pipe(T(this.unsubscribe$)).subscribe({next:t=>{this.fields=t.metadata.fields??[],this.registrationTemplate=t.template,this.loadedTemplateID=this.registration?.registrationTemplateID??null,this.seedFromTemplate(),this.loading=!1},error:()=>{this.loading=!1,this.error=!0,this.siteDataService.showSiteErrorAlert("Unable to load the confirmation text")}})}ngOnChanges(t){t.registration&&!t.registration.firstChange&&this.reloadTemplate()}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}get isDirty(){return this.toggled||!!this.formRef?.form?.dirty}validate(){return!this.formRef||!this.isDirty||this.formRef.form?.disabled||this.formRef.isValid?!0:(this.formRef.submitForm(),!1)}save(){if(this.loading||this.error||!this.formRef||!this.isDirty)return D(null);let t=x(x({},this.registration),this.formRef.value);this.override.clearMatching(t,this.registrationTemplate);let r=t.confirmationText;return this.registrationService.updateRegistrationConfirmationText(this.registration.registrationID,r).pipe(F(()=>{this.registration=A(x({},this.registration),{confirmationText:r}),this.saved.emit(r)}))}markPristine(){this.toggled=!1,this.formRef?.form?.markAsPristine()}toggleOverride(t){this.override.enabled=t,this.toggled=!0,this.refresh()}reloadTemplate(){let t=this.registration?.registrationTemplateID??null;this.loading||this.error||!t||t===this.loadedTemplateID||this.registrationTemplateService.getRegistrationTemplate(t).pipe(T(this.unsubscribe$)).subscribe({next:r=>{this.registrationTemplate=r,this.loadedTemplateID=t,this.seedFromTemplate()},error:()=>{this.siteDataService.showSiteErrorAlert("Unable to load the confirmation text")}})}seedFromTemplate(){this.override.initFrom(this.registration,this.registrationTemplate),this.refresh()}refresh(){let t=this.formRef?.value??{};this.displayEntity=x(x({},this.registration),this.override.displayValues(this.registration,this.registrationTemplate,t)),this.activeFields=this.override.applyToFields(this.fields)}};o.\u0275fac=function(r){return new(r||o)(_(le),_(Ye),_(L))},o.\u0275cmp=N({type:o,selectors:[["app-training-sessions-a-la-carte-confirmation-text"]],viewQuery:function(r,a){if(r&1&&k(yr,5),r&2){let c;w(c=I())&&(a.formRef=c.first)}},inputs:{registration:"registration"},outputs:{saved:"saved"},standalone:!1,features:[Ne],decls:3,vars:1,consts:[["confirmationForm",""],["skeletonType","form"],["alertType","error"],[3,"fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","showSubmitButton","showCancelButton","saveBlankFields"],[1,"card","mb-3"],[1,"header"],[1,"card-title","mb-0"],[1,"subHeader"],[1,"text-medium"],[1,"body"],[1,"form-group"],[1,"d-flex","align-items-center"],[3,"ngModelChange","ngModel","inputId"],["for","confirmationOverrideToggle",1,"mb-0","ml-2","cursor-pointer","text-medium","nowrap"],["fieldName","confirmationText"]],template:function(r,a){r&1&&u(0,Dr,3,0)(1,Er,4,0)(2,wr,37,12),r&2&&h(a.loading?0:a.error||!(a.activeFields!=null&&a.activeFields.length)?1:2)},dependencies:[H,Y,Me,Ve,q,Q,je],encapsulation:2});let i=o;return i})();var Pr=["settingsForm"],Ar=["templateSettings"];function Fr(i,o){i&1&&(e(0,`
457        `),p(1,"app-skeleton-template",3),e(2,`
458    `))}function Lr(i,o){i&1&&(e(0,`
459        `),s(1,"app-inline-alert",4),e(2,`
460            Unable to load this program's settings.
461        `),l(),e(3,`
462    `))}function Rr(i,o){if(i&1&&(e(0,`
463                                `),s(1,"div",18),e(2),l(),e(3,`
464                            `)),i&2){let n=d(3);m(2),E(`
465                                    `,n.programService.accrualDatesText,`
466                                `)}}function Nr(i,o){if(i&1&&(e(0,`
467                            `),p(1,"hr",17),e(2,`
468                            `),s(3,"h4"),e(4,"Financial Reporting"),l(),e(5,`
469                            `),u(6,Rr,4,1)),i&2){let n=d(2);m(6),h(n.paidV2Enabled?-1:6)}}function Or(i,o){i&1&&(e(0,`
470                            `),p(1,"app-dynamic-form-field",29),e(2,`
471                            `),p(3,"app-dynamic-form-field",30),e(4,`
472                        `))}function Ur(i,o){if(i&1&&(e(0,`
473                            `),p(1,"hr",17),e(2,`
474                            `),s(3,"h4"),e(4,"Retention Reporting"),l(),e(5,`
475                            `),s(6,"div",18),e(7),l(),e(8,`
476                            `),p(9,"app-dynamic-form-field",31),e(10,`
477                            `),p(11,"app-dynamic-form-field",32),e(12,`
478                        `)),i&2){let n=d(2);m(7),E(`
479                                `,n.programService.retentionInfoText,`
480                            `)}}function kr(i,o){if(i&1&&(e(0,`
481                `),e(1,`
482                `),s(2,"div",6),e(3,`
483                    `),s(4,"div",7),e(5,`
484                        `),s(6,"h3",8),e(7),l(),e(8,`
485                    `),l(),e(9,`
486                    `),s(10,"div",9),e(11,`
487                        `),s(12,"div",10),e(13,`
488                            `),p(14,"app-dynamic-form-field",33),e(15,`
489                            `),p(16,"hr",17),e(17,`
490                            `),p(18,"app-dynamic-form-field",34),e(19,`
491                            `),p(20,"hr",17),e(21,`
492                            `),s(22,"h4"),e(23),l(),e(24,`
493                            `),p(25,"app-dynamic-form-field",35),e(26,`
494                            `),p(27,"app-dynamic-form-field",36),e(28,`
495                        `),l(),e(29,`
496                    `),l(),e(30,`
497                `),l(),e(31,`
498            `)),i&2){let n=d(2);m(7),P(n.copy.structureAndPurchase.heading),m(16),P(n.copy.otherPurchaseOptions.heading)}}function Mr(i,o){if(i&1){let n=y();e(0,`
499                            `),s(1,"app-registration-template-settings",44,1),C("clone",function(r){f(n);let a=d(4);return S(a.registrationTemplateCloned(r))}),e(3,`
500                            `),l(),e(4,`
501                        `)}if(i&2){let n=d(4);m(),g("registrationTemplateID",n.aLaCarteRegistration.registrationTemplateID)}}function Vr(i,o){if(i&1){let n=y();e(0,`
502                `),e(1,`
503                `),s(2,"div",6),e(3,`
504                    `),s(4,"div",7),e(5,`
505                        `),s(6,"h3",40),e(7),l(),e(8,`
506                    `),l(),e(9,`
507                    `),s(10,"div",41),e(11,`
508                        `),s(12,"p",42),e(13),l(),e(14,`
509                    `),l(),e(15,`
510                    `),s(16,"div",9),e(17,`
511                        `),s(18,"app-registration-template-change",43),C("change",function(r){f(n);let a=d(3);return S(a.registrationTemplateChanged(r))}),e(19,`
512                        `),l(),e(20,`
513                        `),u(21,Mr,5,1),l(),e(22,`
514                `),l(),e(23,`
515            `)}if(i&2){let n=d(3);m(7),P(n.copy.registrationForm.heading),m(6),P(n.copy.registrationForm.description),m(5),g("registrationID",n.aLaCarteRegistration.registrationID)("registrationTemplateID",n.aLaCarteRegistration.registrationTemplateID),m(3),h(n.aLaCarteRegistration.registrationTemplateID?21:-1)}}function Br(i,o){if(i&1){let n=y();e(0,`
516            `),s(1,"app-training-sessions-a-la-carte-eligibility",37),e(2,`
517            `),l(),e(3,`
518
519            `),u(4,Vr,24,5),s(5,"app-training-sessions-a-la-carte-email-settings",38),C("saved",function(r){f(n);let a=d(2);return S(a.emailSettingsSaved(r))}),e(6,`
520            `),l(),e(7,`
521
522            `),s(8,"app-training-sessions-a-la-carte-confirmation-text",39),C("saved",function(r){f(n);let a=d(2);return S(a.confirmationTextSaved(r))}),e(9,`
523            `),l(),e(10,`
524        `)}if(i&2){let n=d(2);m(),g("registration",n.aLaCarteRegistration)("metadataFields",n.aLaCarteFields)("registrationLink",n.aLaCarteEligibilityLink),m(3),h(n.user&&n.user[n.Permission.RegistrationTemplates]?4:-1),m(),g("registration",n.aLaCarteRegistration)("emailSettingsLink",n.aLaCarteEmailSettingsLink),m(3),g("registration",n.aLaCarteRegistration)}}function $r(i,o){if(i&1){let n=y();e(0,`
525        `),e(1,`
526        `),s(2,"app-dynamic-form",5,0),C("onSubmit",function(r){f(n);let a=d();return S(a.save(r))}),e(4,`
527            `),s(5,"div",6),e(6,`
528                `),s(7,"div",7),e(8,`
529                    `),s(9,"h3",8),e(10,"Basic Info"),l(),e(11,`
530                `),l(),e(12,`
531                `),s(13,"div",9),e(14,`
532                    `),s(15,"div",10),e(16,`
533                        `),p(17,"app-dynamic-form-field",11),e(18,`
534                        `),p(19,"app-dynamic-form-field",12),e(20,`
535                        `),p(21,"app-dynamic-form-field",13),e(22,`
536                        `),p(23,"app-dynamic-form-field",14),e(24,`
537                        `),p(25,"app-dynamic-form-field",15),e(26,`
538                        `),p(27,"app-dynamic-form-field",16),e(28,`
539                        `),p(29,"hr",17),e(30,`
540                        `),s(31,"h4"),e(32,"Program Dates"),l(),e(33,`
541                        `),s(34,"div",18),e(35),l(),e(36,`
542                        `),p(37,"app-dynamic-form-field",19),e(38,`
543                        `),p(39,"app-dynamic-form-field",20),e(40,`
544                        `),p(41,"app-dynamic-form-field",21),e(42,`
545                        `),u(43,Nr,7,1),u(44,Or,5,0),s(45,"app-dynamic-form-field",22),C("onChange",function(r){f(n);let a=d();return S(a.setClubSurchargeRequirements(r))}),l(),e(46,`
546                        `),p(47,"app-dynamic-form-field",23),e(48,`
547                        `),u(49,Ur,13,1),l(),e(50,`
548                `),l(),e(51,`
549            `),l(),e(52,`
550            `),u(53,kr,32,2),l(),e(54,`
551
552        `),e(55,`
553        `),u(56,Br,11,7),s(57,"div",24),e(58,`
554            `),s(59,"div",25),e(60,`
555                `),s(61,"button",26),C("click",function(){f(n);let r=d();return S(r.cancel())}),e(62,`
556                    Cancel
557                `),l(),e(63,`
558            `),l(),e(64,`
559            `),s(65,"div",27),e(66,`
560                `),s(67,"button",28),C("click",function(){f(n);let r=Ue(3),a=d();return S(a.save(r.value))}),e(68,`
561                    `),p(69,"i"),e(70),l(),e(71,`
562            `),l(),e(72,`
563        `),l(),e(73,`
564    `)}if(i&2){let n=d();m(2),g("fields",n.fields)("entity",n.entity)("horizontalForm",!0)("contentFieldsMode",!0)("showSaveAndAddButton",!1)("showSubmitButton",!1)("showCancelButton",!1),m(33),E(`
565                            `,n.programService.programDatesText,`
566                        `),m(8),h(n.showFinancialReporting?43:-1),m(),h(n.paidV2Enabled?-1:44),m(),g("enableFilter",!0),m(4),h(n.isSuperAdmin&&!n.paidV2Enabled?49:-1),m(4),h(n.paidV2Enabled?53:-1),m(3),h(n.aLaCarteRegistration&&(n.aLaCarteFields!=null&&n.aLaCarteFields.length)?56:-1),m(5),g("disabled",n.saving),m(6),g("disabled",n.saving),m(2),Te(n.saving?"fa fa-spinner fa-spin mr-1":"fa-regular fa-check mr-1"),m(),E("",n.saving?"Saving...":"Save",`
567                `)}}function Gr(i,o){if(i&1&&e(0),i&2){let n=d(2);E(" ",n.copy.purchaseModelChange.create," ")}}function jr(i,o){if(i&1&&e(0),i&2){let n=d(2);E(" ",n.copy.purchaseModelChange.restore," ")}}function zr(i,o){if(i&1&&e(0),i&2){let n=d(2);E(" ",n.copy.purchaseModelChange.remove," ")}}function Qr(i,o){if(i&1&&(e(0,`
568                `),s(1,"app-inline-alert",47),e(2),l(),e(3,`
569            `)),i&2){let n=d(2);m(),g("isInline",!0),m(),E(`
570                    `,n.unpricedTimeSlotWarning,`
571                `)}}function Wr(i,o){if(i&1){let n=y();e(0,`
572    `),s(1,"app-yes-no-modal",45),C("onYesSelect",function(){f(n);let r=d();return S(r.purchaseModelChangeConfirmed())})("onNoSelect",function(){f(n);let r=d();return S(r.purchaseModelChangeCancelled())}),e(2,`
573        `),s(3,"div",46),e(4,`
574            `),s(5,"app-inline-alert",47),e(6,`
575                `),u(7,Gr,1,1)(8,jr,1,1)(9,zr,1,1),e(10,`
576            `),l(),e(11,`
577            `),u(12,Qr,4,2),l(),e(13,`
578    `),l(),e(14,`
579`)}if(i&2){let n,t=d();m(),g("showModalText",!1)("headerText",t.copy.purchaseModelChange.heading),m(4),g("isInline",!0),m(2),h((n=t.purchaseModelChange.action)===t.ALaCarteRegistrationAction.CREATE?7:n===t.ALaCarteRegistrationAction.RESTORE?8:n===t.ALaCarteRegistrationAction.REMOVE?9:-1),m(5),h(t.hasUnpricedTimeSlots?12:-1)}}function qr(i,o){if(i&1){let n=y();e(0,`
580    `),s(1,"app-yes-no-modal",48),C("onYesSelect",function(){f(n);let r=d();return S(r.canDeactivate(!0))})("onNoSelect",function(){f(n);let r=d();return S(r.canDeactivate(!1))}),e(2,`
581        `),s(3,"div",46),e(4,`
582            `),s(5,"app-inline-alert",47),e(6,`
583                This program's settings have not been saved. Leaving now discards those changes.
584            `),l(),e(7,`
585        `),l(),e(8,`
586    `),l(),e(9,`
587`)}i&2&&(m(),g("showModalText",!1),m(4),g("isInline",!0))}var G=(function(i){return i[i.BASIC_INFO=0]="BASIC_INFO",i[i.PREFERENCES=1]="PREFERENCES",i[i.A_LA_CARTE=2]="A_LA_CARTE",i[i.EMAIL_SETTINGS=3]="EMAIL_SETTINGS",i[i.CONFIRMATION_TEXT=4]="CONFIRMATION_TEXT",i})(G||{}),Yr={[G.BASIC_INFO]:"There was a problem saving this program's settings",[G.PREFERENCES]:"This program's settings were saved, but there was a problem saving its Structure & Purchase options. Press Save to try again.",[G.A_LA_CARTE]:"This program's settings were saved, but there was a problem saving who can buy single time slots. Press Save to try again.",[G.EMAIL_SETTINGS]:"This program's settings were saved, but there was a problem saving its email settings. Press Save to try again.",[G.CONFIRMATION_TEXT]:"This program's settings were saved, but there was a problem saving its confirmation text. Press Save to try again."},Ai=i=>`This program cannot be changed to bundles only: ${i} single time slot ${i===1?"booking is":"bookings are"} still active. Cancel them first. Nothing was changed.`,Fi=(()=>{let o=class o{constructor(t,r,a,c,v,b,R,M){this.route=t,this.router=r,this.siteDataService=a,this.programService=c,this.formService=v,this.authorizeService=b,this.registrationService=R,this.store=M,this.preferences=null,this.aLaCarteRegistration=null,this.aLaCarteFields=null,this.aLaCarteEligibilityLink=null,this.aLaCarteEmailSettingsLink=null,this.loading=!0,this.error=!1,this.saving=!1,this.showCanDeactivate=!1,this.purchaseModelChange=null,this.hasUnpricedTimeSlots=!1,this.unpricedTimeSlotWarning="",this.ALaCarteRegistrationAction=Ie,this.pendingSave=null,this.clubAccountingClasses=[],this.showFinancialReporting=!1,this.stripeAccountFeeAssignments=[],this.surchargesOptionEnabled=!1,this.isAccrualClub=!1,this.isSuperAdmin=!1,this.paidV2Enabled=!1,this.Permission=B,this.ProgramType=ie,this.copy=me,this.originalDefaultConnectedAccountID=null,this.originalDefaultFeeStructureID=null,this.unsubscribe$=new U}ngOnInit(){this.authorizeService.getUser().pipe(Z(1)).subscribe({next:t=>{this.user=t,this.isSuperAdmin=this.authorizeService.isSuperAdmin(t.role)},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}}),this.store.select(t=>({program:t.program,programID:t.programID})).pipe(j(t=>t.program!==null&&t.program!==void 0),F(t=>{this.program=t.program,this.programID=t.programID,this.preferences=t.program.trainingSessionsPreferences??null}),O(()=>this.basicInfoFields?D(null):this.loadMetadata()),T(this.unsubscribe$)).subscribe({next:()=>{this.buildFields(),this.loading=!1,this.siteDataService.hideSiteLoader()},error:()=>{this.loading=!1,this.error=!0,this.siteDataService.showSiteErrorAlert("There was a problem getting this program's settings")}})}save(t){if(!this.validateForms())return;let ft=t,{usesMultipleSignUpGroups:r,purchaseModelID:a,defaultSessionCapacity:c,staffAcceptSessions:v}=ft,b=St(ft,["usesMultipleSignUpGroups","purchaseModelID","defaultSessionCapacity","staffAcceptSessions"]),R=this.paidV2Enabled?this.toPreferences(t):null,M=R&&this.shouldSavePreferences(R)?R:null;if(b.startDate>(b.endDate||new Date(9999,11,31))){this.formService.showFormErrorMessage("End Date cannot be before Start Date"),this.formService.hideFormLoader();return}if(this.isAccrualClub&&b.accrualStartDate>b.accrualEndDate){this.formService.showFormErrorMessage("Accrual End Date cannot be before Accrual Start Date"),this.formService.hideFormLoader();return}b.programID=this.programID,b.programTypeID=ie.TRAINING_SESSIONS,b.programInvitationTypeID=Ut.OPEN;let ge=this.aLaCarteEligibility?.payload()??null,Ni=this.preferences?.purchaseModelID??ui.SINGLE_SESSIONS_AND_BUNDLES;if(M&&M.purchaseModelID!==Ni){this.pendingSave={program:b,preferences:M,aLaCarteRegistration:ge},this.confirmPurchaseModelChange(M.purchaseModelID);return}this.saving=!0,this.updateSettings(b,M,ge)}setPurchaseModelChange(t){this.purchaseModelChange=t;
587let r=t?.unpricedTimeSlotCount??0;this.hasUnpricedTimeSlots=r>0,this.unpricedTimeSlotWarning=this.hasUnpricedTimeSlots?`${r} upcoming time ${r===1?"slot has":"slots have"} ${this.copy.purchaseModelChange.unpricedTimeSlots}`:""}purchaseModelChangeConfirmed(){this.setPurchaseModelChange(null),this.runPendingSave()}purchaseModelChangeCancelled(){this.setPurchaseModelChange(null),this.pendingSave=null,this.saving=!1,this.formService.hideFormLoader()}confirmPurchaseModelChange(t){this.saving=!0,this.programService.getTrainingSessionsPurchaseModelChange(this.programID,t).pipe(T(this.unsubscribe$)).subscribe({next:r=>{if(r.action===Ie.NONE){this.runPendingSave();return}this.pendingSave=r.isAllowed?this.pendingSave:null,this.setPurchaseModelChange(r.isAllowed?r:null),this.saving=!1,r.isAllowed||(this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert(Ai(r.liveBookingCount)))},error:()=>{this.pendingSave=null,this.saving=!1,this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem checking what this purchase option change affects")}})}runPendingSave(){let t=this.pendingSave;this.pendingSave=null,t&&(this.saving=!0,this.updateSettings(t.program,t.preferences,t.aLaCarteRegistration))}cancel(){this.router.navigate(["../overview"],{relativeTo:this.route})}emailSettingsSaved(t){this.aLaCarteRegistration=x(x({},this.aLaCarteRegistration),t)}confirmationTextSaved(t){this.aLaCarteRegistration=A(x({},this.aLaCarteRegistration),{confirmationText:t})}registrationTemplateChanged(t){this.aLaCarteRegistration=A(x({},this.aLaCarteRegistration),{registrationTemplateID:t})}registrationTemplateCloned(t){this.templateSettings?.setLoader(!0),this.registrationService.updateRegistrationTemplateID(this.aLaCarteRegistration.registrationID,t.registrationTemplateID).pipe(T(this.unsubscribe$)).subscribe({next:()=>{this.registrationTemplateChanged(t.registrationTemplateID)},error:()=>{this.templateSettings?.setLoader(!1),this.siteDataService.showSiteErrorAlert("There was a problem duplicating the registration form")}})}hasUnsavedChanges(){return!!this.form?.form?.dirty||!!this.aLaCarteEligibility?.isDirty||!!this.aLaCarteEmailSettings?.isDirty||!!this.aLaCarteConfirmationText?.isDirty}confirmDeactivate(){this.showCanDeactivate=!0}canDeactivate(t){this.siteDataService.canDeactivateConfirmed.next(t),t||(this.showCanDeactivate=!1)}validateForms(){return this.form&&!this.form.isValid?(this.form.submitForm(),!1):(!this.aLaCarteEligibility||this.aLaCarteEligibility.validate())&&(!this.aLaCarteEmailSettings||this.aLaCarteEmailSettings.validate())&&(!this.aLaCarteConfirmationText||this.aLaCarteConfirmationText.validate())}setClubSurchargeRequirements(t){let r=this.fields.find(v=>v.controlName==="clubSurchargeID");if(!r)return;let a=!!t&&this.clubAccountingClasses.some(v=>v.clubAccountingClassID===t&&v.assignments.some(b=>b.isSurchargeRequired)),c=this.surchargesOptionEnabled||a;r.hidden=!c,r.required=a,r.validators=a?[{validatorType:Vt.REQUIRED}]:[],a&&r.options?.length===1&&(this.program.clubSurchargeID=r.options[0].value,this.form?.form.patchValue({clubSurchargeID:r.options[0].value})),c||(this.program.clubSurchargeID=null,this.form?.form.patchValue({clubSurchargeID:null})),this.fields=[...this.fields],this.refreshFinancialReportingVisibility()}refreshFinancialReportingVisibility(){this.showFinancialReporting=!this.paidV2Enabled&&this.isAccrualClub||$t(this.fields,"clubAccountingClassID","clubSurchargeID")}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}loadMetadata(){return J({basicInfo:this.programService.getProgramBasicInfoMetadata(this.programID),purchaseOptions:this.programService.getTrainingSessionsProgramPurchaseOptionsMetadata(),accountingClasses:this.programService.getClubAccountingClasses(),stripeAccountFeeAssignments:this.programService.getClubStripeAccountFeeAssignments(),paidV2Enabled:this.siteDataService.isPaidSignupsV2Enabled$(),clubOptions:this.siteDataService.getClubOptions([ct.ENABLE_SURCHARGES]),aLaCarte:this.loadALaCarteRegistration()}).pipe(ve(r=>{this.basicInfoFields=r.basicInfo.fields,this.purchaseOptionsFields=r.purchaseOptions.fields,this.aLaCarteRegistration=r.aLaCarte?.registration??null,this.aLaCarteFields=r.aLaCarte?.fields??null,this.buildALaCarteLinks(),this.clubAccountingClasses=r.accountingClasses,this.stripeAccountFeeAssignments=r.stripeAccountFeeAssignments,this.paidV2Enabled=r.paidV2Enabled,this.surchargesOptionEnabled=r.clubOptions.find(a=>a.optionID===ct.ENABLE_SURCHARGES)?.boolValue===!0,this.isAccrualClub=this.basicInfoFields.some(a=>a.controlName==="accrualStartDate"),this.clubAccountingClasses.length>0&&(this.basicInfoFields.find(a=>a.controlName==="clubAccountingClassID").options=this.clubAccountingClasses.map(a=>({label:a.accountingClassName,value:a.clubAccountingClassID}))),this.storeOriginalDefaultValues(),this.updatePaymentSettingFieldNotes()}))}loadALaCarteRegistration(){let t=this.preferences?.aLaCarteRegistrationID??null;return t?J({registration:this.registrationService.getRegistration(t,!1,!1),metadata:this.registrationService.getRegistrationBasicInfoMetadata(ie.TRAINING_SESSIONS,pe.VARIABLE,t)}).pipe(ve(r=>({registration:r.registration,fields:r.metadata.fields}))):D(null)}buildALaCarteLinks(){let t=this.aLaCarteRegistration?.registrationID;this.aLaCarteEligibilityLink=t?["/admin/programs","training-sessions",this.programID,"registrations",t,"basic-info"]:null,this.aLaCarteEmailSettingsLink=t?["/admin/programs","training-sessions",this.programID,"registrations",t,"email-sett
587ings"]:null}buildFields(){let t=this.basicInfoFields.filter(c=>!o.excludedBasicInfoFields.includes(c.controlName));t.filter(c=>c.controlName==="programTypeID"||c.controlName==="programInvitationTypeID").forEach(c=>c.disabled=!0);let r=t.find(c=>c.controlName==="signUpIDs");r&&(r.hidden=this.paidV2Enabled),this.paidV2Enabled&&t.filter(c=>c.controlName==="accrualStartDate"||c.controlName==="accrualEndDate").forEach(Ge);let a=this.paidV2Enabled?[...this.purchaseOptionsFields]:[];this.fields=[...t,...a],this.setClubSurchargeRequirements(this.program.clubAccountingClassID),this.refreshFinancialReportingVisibility(),this.entity=x(x({},this.program),this.preferences??{})}shouldSavePreferences(t){return this.preferences?.hasSavedPreferences!==!1?!0:t.usesMultipleSignUpGroups!==this.preferences.usesMultipleSignUpGroups||t.purchaseModelID!==this.preferences.purchaseModelID||t.defaultSessionCapacity!==this.preferences.defaultSessionCapacity||t.staffAcceptSessions!==this.preferences.staffAcceptSessions}toPreferences(t){let r=new hi;r.usesMultipleSignUpGroups=t.usesMultipleSignUpGroups,r.purchaseModelID=+t.purchaseModelID;let a=t.defaultSessionCapacity;return r.defaultSessionCapacity=`${a??""}`.trim()===""?null:+a,r.staffAcceptSessions=t.staffAcceptSessions,r}updateSettings(t,r,a){let c=G.BASIC_INFO,v=null;this.programService.updateProgramBasicInfo(t).pipe(F(()=>{c=G.PREFERENCES}),O(()=>r?this.programService.updateTrainingSessionsProgramPreferences(t.programID,r):D(null)),F(b=>{v=b,c=G.A_LA_CARTE}),O(()=>a?this.registrationService.updateRegistrationBasicInfo(a):D(null)),F(()=>{c=G.EMAIL_SETTINGS}),O(()=>this.aLaCarteEmailSettings?.save()??D(null)),F(()=>{c=G.CONFIRMATION_TEXT}),O(()=>this.aLaCarteConfirmationText?.save()??D(null)),T(this.unsubscribe$)).subscribe({next:()=>{r&&(this.preferences=A(x(x({},this.preferences??{registrationTemplateID:null}),r),{programID:t.programID,hasSavedPreferences:!0})),a&&(this.aLaCarteRegistration=a),this.applyALaCarteRegistrationChange(v),this.form?.form?.markAsPristine(),this.aLaCarteEligibility?.markPristine(),this.aLaCarteEmailSettings?.markPristine(),this.aLaCarteConfirmationText?.markPristine(),this.siteDataService.showSiteSuccessAlert("Settings saved successfully"),this.formService.hideFormLoader(),this.saving=!1,this.store.updateProgram(A(x({},t),{trainingSessionsPreferences:this.preferences??t.trainingSessionsPreferences}))},error:b=>{this.saving=!1,this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert(b?.status===409?Ai(b?.error?.liveBookingCount??0):Yr[c])}})}applyALaCarteRegistrationChange(t){if(!(!t||t.action===Ie.NONE)){if(this.preferences=A(x({},this.preferences),{aLaCarteRegistrationID:t.aLaCarteRegistrationID}),t.action===Ie.REMOVE){this.aLaCarteRegistration=null,this.aLaCarteFields=null,this.buildALaCarteLinks();return}this.loadALaCarteRegistration().pipe(T(this.unsubscribe$)).subscribe({next:r=>{this.aLaCarteRegistration=r?.registration??null,this.aLaCarteFields=r?.fields??null,this.buildALaCarteLinks()},error:()=>{this.siteDataService.showSiteErrorAlert("This program was saved, but its single time slot settings could not be loaded. Refresh the page to configure them.")}})}}storeOriginalDefaultValues(){this.originalDefaultConnectedAccountID=this.basicInfoFields.find(t=>t.controlName==="clubStripeConnectedAccountID")?.options?.find(t=>t.icon)?.value??null,this.originalDefaultFeeStructureID=this.basicInfoFields.find(t=>t.controlName==="clubPaymentFeeStructureID")?.options?.find(t=>t.icon)?.value??null}updatePaymentSettingFieldNotes(){if(this.stripeAccountFeeAssignments.length===0)return;let t=this.stripeAccountFeeAssignments.find(r=>r.programTypeID===ie.TRAINING_SESSIONS);this.updateFieldNoteWithOverride("clubStripeConnectedAccountID",t?.clubStripeConnectedAccountID,this.originalDefaultConnectedAccountID,"connected account"),this.updateFieldNoteWithOverride("clubPaymentFeeStructureID",t?.clubPaymentFeeStructureID,this.originalDefaultFeeStructureID,"fee structure")}updateFieldNoteWithOverride(t,r,a,c){let v=this.basicInfoFields.find(R=>R.controlName===t);if(!v?.options||a===null)return;v.options.forEach(R=>{delete R.icon});let b=v.options.find(R=>R.value===(r||a));b&&(b.icon="fa fa-star text-warn"),v.note=b?.label?`Leave blank to use the default ${c} - ${b.label}`:""}};o.excludedBasicInfoFields=["parentProgramID","isAdultProgram"],o.\u0275fac=function(r){return new(r||o)(_(ue),_(se),_(L),_(_e),_(fe),_(he),_(le),_(X))},o.\u0275cmp=N({type:o,selectors:[["app-training-sessions-program-settings"]],viewQuery:function(r,a){
587if(r&1&&k(Pr,5)(tt,5)(it,5)(nt,5)(Ar,5),r&2){let c;w(c=I())&&(a.form=c.first),w(c=I())&&(a.aLaCarteEligibility=c.first),w(c=I())&&(a.aLaCarteEmailSettings=c.first),w(c=I())&&(a.aLaCarteConfirmationText=c.first),w(c=I())&&(a.templateSettings=c.first)}},standalone:!1,decls:8,vars:3,consts:[["settingsForm",""],["templateSettings",""],[1,"col-lg-9","p-0"],["skeletonType","form"],["alertType","error"],[3,"onSubmit","fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","showSubmitButton","showCancelButton"],[1,"card","mb-3"],[1,"header"],[1,"card-title","mb-0"],[1,"body"],[1,"col","col-lg-10","pl-0"],["fieldName","name"],["fieldName","programTypeID"],["fieldName","programInvitationTypeID"],["fieldName","signUpIDs"],["fieldName","clubStripeConnectedAccountID"],["fieldName","clubPaymentFeeStructureID"],[1,"form-section"],[1,"mb-3","text-medium","text-grey"],["fieldName","startDate"],["fieldName","endDate"],["fieldName","effectiveDate"],["fieldName","clubAccountingClassID",3,"onChange","enableFilter"],["fieldName","clubSurchargeID"],["appStickyFormButtons","",1,"row","border-top","no-gutters","d-flex","align-items-center"],[1,"col-md-3","d-flex","justify-content-start"],["type","button",1,"btn","btn-lg","btn-naked",3,"click","disabled"],[1,"col-md-9","d-flex","justify-content-end"],["type","button",1,"btn","btn-lg","btn-primary",3,"click","disabled"],["fieldName","accrualStartDate"],["fieldName","accrualEndDate"],["fieldName","programGroupID"],["fieldName","programGroupYear"],["fieldName","usesMultipleSignUpGroups"],["fieldName","purchaseModelID"],["fieldName","defaultSessionCapacity"],["fieldName","staffAcceptSessions"],[3,"registration","metadataFields","registrationLink"],[3,"saved","registration","emailSettingsLink"],[3,"saved","registration"],[1,"card-title"],[1,"subHeader"],[1,"text-medium"],[3,"change","registrationID","registrationTemplateID"],[3,"clone","registrationTemplateID"],["dialogClass","standardWidthDialog","yesButtonText","Yes, Save","noButtonText","No, Cancel",3,"onYesSelect","onNoSelect","showModalText","headerText"],[1,"text-medium","fw-600"],["alertType","warning",3,"isInline"],["headerText","Are you sure you want to leave this page?","dialogClass","standardWidthDialog","yesButtonText","Yes","noButtonText","No, Cancel",3,"onYesSelect","onNoSelect","showModalText"]],template:function(r,a){r&1&&(s(0,"div",2),e(1,`
588    `),u(2,Fr,3,0)(3,Lr,4,0)(4,$r,74,19),l(),e(5,`
589
590`),u(6,Wr,15,5),u(7,qr,10,2)),r&2&&(m(2),h(a.loading?2:a.error||!a.fields||!a.program?3:4),m(4),h(a.purchaseModelChange?6:-1),m(),h(a.showCanDeactivate?7:-1))},dependencies:[H,Y,q,Q,ze,Gt,ri,ni,tt,it,nt],encapsulation:2});let i=o;return i})();var Hr=["timeSlotAddDialog"],Xr=["timeSlotList"],Jr=i=>["..","activities",i,"dates-times","import"],Kr=(i,o)=>o.scheduleSignUpID;function Zr(i,o){i&1&&(e(0,`
591        `),s(1,"app-loader"),e(2,"Loading time slots..."),l(),e(3,`
592    `))}function eo(i,o){i&1&&(e(0,`
593            `),s(1,"app-inline-alert",12),e(2,`
594                This program has no time slot groups yet. Create one from the Actions menu before adding time slots.
595            `),l(),e(3,`
596        `)),i&2&&(m(),g("isInline",!0))}function to(i,o){if(i&1){let n=y();e(0,`
597            `),e(1,`
598            `),e(2,`
599            `),s(3,"app-time-slot",13,0),C("onAddRequested",function(){f(n);let r=d(2);return S(r.goToAddTimeSlot())}),e(5,`
600            `),l(),e(6,`
601        `)}if(i&2){let n=d(2);m(3),g("programID",n.programID)("isAdmin",!0)("includePastTimeSlots",!0)("signUpTypeID",n.SignUpType.PAID)("componentView",n.TimeSlotComponentView.ADMIN_EDIT)("showAssignPlayerAction",!0)}}function io(i,o){if(i&1&&(e(0,`
602        `),u(1,eo,4,1),u(2,to,7,6)),i&2){let n=d();m(),h(!n.signUps.length&&!n.error?1:-1),m(),h(n.programID?2:-1)}}function no(i,o){if(i&1){let n=y();e(0,`
603    `),s(1,"app-time-slot-add-dialog",14,1),C("confirmInitiated",function(r){f(n);let a=d();return S(a.addTimeSlots(r))}),e(3,`
604    `),l(),e(4,`
605`)}if(i&2){let n=d();m(),g("signUpTypeID",n.SignUpType.PAID)("selectableSignUps",n.signUps)}}function ro(i,o){if(i&1&&(e(0,`
606            `),s(1,"div",15),e(2,`
607                `),s(3,"a",16),e(4),l(),e(5,`
608            `),l(),e(6,`
609        `)),i&2){let n=o.$implicit,t=o.$index,r=o.$count;m(),oe("border-bottom",t!==r-1),m(2),g("routerLink",ce(4,Jr,n.scheduleSignUpID)),m(),E(`
610                    `,n.name,`
611                `)}}var Li=(()=>{let o=class o{constructor(t,r,a,c,v){this.siteDataService=t,this.scheduleSignUpService=r,this.store=a,this.router=c,this.route=v,this.signUps=[],this.loading=!0,this.error=!1,this.showImportPicker=!1,this.unsubscribe$=new U,this.TimeSlotComponentView=We,this.SignUpType=Se}ngOnInit(){this.store.select(t=>t.programID).pipe(j(t=>!!t),Ae(t=>(this.programID=t,this.loading=!0,this.error=!1,this.scheduleSignUpService.getAdminProgramSignUps(t).pipe(K(()=>(this.error=!0,this.siteDataService.showSiteErrorAlert("An error occurred while loading sign ups for this program. Please try again later."),D([])))))),T(this.unsubscribe$)).subscribe({next:t=>{this.signUps=t,this.loading=!1,this.siteDataService.hideSiteLoader()},error:()=>{this.error=!0,this.loading=!1,this.siteDataService.showSiteErrorAlertDefaultGET(),this.siteDataService.hideSiteLoader()}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}goToImport(){if(!this.signUps.length){this.siteDataService.showSiteInfoAlert("Time slots belong to a time slot group. This program has no time slot groups yet \u2014 create one from the Actions menu first.");return}if(this.signUps.length===1){this.router.navigate(["..","activities",this.signUps[0].scheduleSignUpID,"dates-times","import"],{relativeTo:this.route});return}this.showImportPicker=!0}goToAddTimeSlot(){if(!this.signUps.length){this.siteDataService.showSiteInfoAlert("Time slots belong to a time slot group. This program has no time slot groups yet \u2014 create one from the Actions menu first.");return}this.timeSlotAddDialog?.openDialog()}addTimeSlots(t){if(!t?.scheduleSignUp?.scheduleSignUpID||!t.timeSlots?.length){this.timeSlotAddDialog?.cancelSave();return}let r=t.timeSlots.map(a=>A(x({},a),{startDate:te(a.startDate),endDate:te(a.endDate)}));this.scheduleSignUpService.updateScheduleSignUpTimeSlots(A(x({},t.scheduleSignUp),{timeSlots:r})).pipe(O(()=>this.refreshAfterTimeSlotAdd()),T(this.unsubscribe$)).subscribe({next:()=>{this.timeSlotAddDialog?.saveComplete()},error:()=>{this.timeSlotAddDialog?.cancelSave(),this.siteDataService.showSiteErrorAlert("There was a problem adding the time slots. Please try again.")}})}refreshAfterTimeSlotAdd(){return this.scheduleSignUpService.getAdminProgramSignUps(this.programID).pipe(F(t=>this.signUps=t),K(()=>(this.siteDataService.showSiteErrorAlert("The time slots were added, but the sign ups could not be refreshed. Please reload to see them."),D(null))),O(()=>(this.timeSlotList?.refreshTimeSlots()??D([])).pipe(K(()=>(this.siteDataService.showSiteErrorAlert("The time slots were added, but the schedule could not be refreshed. Please reload to see them."),D([]))))))}};o.\u0275fac=function(r){return new(r||o)(_(L),_(xe),_(X),_(se),_(ue))},o.\u0275cmp=N({type:o,selectors:[["app-training-sessions-program-timeslots"]],viewQuery:function(r,a){if(r&1&&k(Hr,5)(Xr,5),r&2){let c;w(c=I())&&(a.timeSlotAddDialog=c.first),w(c=I())&&(a.timeSlotList=c.first)}},standalone:!1,decls:36,vars:9,consts:[["timeSlotList",""],["timeSlotAddDialog",""],[1,""],[1,"d-flex","flex-row","justify-content-between","align-items-center","mr-2"],[1,"justify-self-flex-start"],[1,"btn","btn-sm","btn-secondary","mr-2","mb-2",3,"click","disabled"],[1,"fa","fa-upload","mr-1"],[1,"btn","btn-sm","btn-primary","mr-2","mb-2",3,"click","disabled"],[1,"fa","fa-plus","mr-1"],["header","Import Time Slots","styleClass","standardWidthDialog",3,"visibleChange","visible","modal","draggable","resizable","dismissableMask"],[1,"mb-3"],[1,"border-all","border-radius","p-0"],["alertType","info",1,"mb-3",3,"isInline"],[3,"onAddRequested","programID","isAdmin","includePastTimeSlots","signUpTypeID","componentView","showAssignPlayerAction"],[3,"confirmInitiated","signUpTypeID","selectableSignUps"],[1,"p-3"],[1,"fw-600",3,"routerLink"]],template:function(r,a){r&1&&(s(0,"div",2),e(1,`
612    `),s(2,"div",3),e(3,`
613        `),s(4,"h3",4),e(5,"Full Schedule"),l(),e(6,`
614        `),s(7,"span"),e(8,`
615            `),s(9,"button",5),C("click",function(){return a.goToImport()}),e(10,`
616                `),p(11,"i",6),e(12,` Import
617            `),l(),e(13,`
618            `),s(14,"button",7),C("click",function(){return a.goToAddTimeSlot()}),e(15,`
619                `),p(16,"i",8),e(17,` Add Time Slot
620            `),l(),e(18,`
621        `),l(),e(19,`
622    `),l(),e(20,`
623    `),u(21,Zr,4,0)(22,io,3,2),l(),e(23,`
624`),u(24,no,5,2),s(25,"p-dialog",9),De("visibleChange",function(v){return ye(a.showImportPicker,v)||(a.showImportPicker=v),v}),e(26,`
625    `),s(27,"p",10),e(28,"Choose the time slot group to import into."),l(),e(29,`
626    `),s(30,"div",11),e(31,`
627        `),ne(32,ro,7,6,null,null,Kr),l(),e(34,`
628`),l(),e(35,`
629`)),r&2&&(m(9),g("disabled",a.loading||!a.signUps.length),m(5),g("disabled",a.loading||!a.signUps.length),m(7),h(a.loading?21:22),m(3),h(!a.loading&&a.signUps.length?24:-1),m(),be("visible",a.showImportPicker),g("modal",!0)("draggable",!1)("resizable",!1)("dismissableMask",!0),m(7),re(a.signUps))},dependencies:[Be,z,Q,$e,Ht,qe],encapsulation:2});let i=o;return i})();var rt=(()=>{let o=class o{canDeactivate(t){return t.canLeave()}};o.\u0275fac=function(r){return new(r||o)},o.\u0275prov=Fe({token:o,factory:o.\u0275fac});let i=o;return i})();var ot=(()=>{let o=class o{constructor(t){this.siteDataService=t}canDeactivate(t){return t.hasUnsavedChanges()?(t.confirmDeactivate(),this.siteDataService.canDeactivateConfirmed$.pipe(F(r=>{r&&this.siteDataService.showSiteLoader()}))):(this.siteDataService.showSiteLoader(),D(!0))}};o.\u0275fac=function(r){return new(r||o)(xt(L))},o.\u0275prov=Fe({token:o,factory:o.\u0275fac});let i=o;return i})();var Ri=(()=>{let o=class o{};o.\u0275fac=function(r){return new(r||o)},o.\u0275mod=Oe({type:o}),o.\u0275inj=Le({imports:[lt.forChild([{path:"",component:Di,providers:[mi],children:[{path:"activities",canActivate:[Ee,W,we],data:{permissions:[B.Programs]},children:[{path:"new",canActivate:[Ee,W,we],canDeactivate:[fi],component:He,data:{admin:!0,permissions:[B.SignUps],metaTitle:"Session Add",hasCanDeactivate:!0}},{path:":id",canActivate:[Ee,W,we],loadChildren:()=>import("./chunk-SPXOQCYC.js").then(t=>t.ScheduleSignUpEditModule),data:{admin:!0,permissions:[B.SignUps],metaTitle:"Session Edit"}},{path:"",canActivate:[W],component:bi,data:{metaTitle:"Activities"}}]},{path:"registrations",canActivate:[Ee,W,we],loadChildren:()=>import("./chunk-6DUURCZL.js").then(t=>t.RegistrationModule),data:{admin:!0,permissions:[B.Programs],metaTitle:"Bundles"}},{path:"overview",canActivate:[W],canDeactivate:[rt],component:et,data:{metaTitle:"Program Overview",hasCanDeactivate:!0}},{path:"timeslots",canActivate:[W],component:Li,data:{metaTitle:"Full Schedule"}},{path:"listing",canActivate:[W],component:Pi,data:{metaTitle:"Program Listing"}},{path:"settings",canActivate:[W],canDeactivate:[ot],component:Fi,data:{metaTitle:"Program Settings",hasCanDeactivate:!0}},{path:"",redirectTo:"overview",pathMatch:"full"}]}]),lt]});let i=o;return i})();var wm=(()=>{let o=class o{};o.\u0275fac=function(r){return new(r||o)},o.\u0275mod=Oe({type:o}),o.\u0275inj=Le({providers:[X,xe,rt,ot,Qe],imports:[qt,Wt,Jt,oi,_i,xi,gi,li,Ri,Xt,si,ci,ai,Si]});let i=o;return i})();export{wm as TrainingSessionsProgramEditModule};

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.