1import{a as dt}from"./chunk-5CLNTZXT.js";import{b as K,c as Fe,d as ee,e as A,f as qi,g as ki,h as $,i as ie,j as Tt}from"./chunk-4PHIHL6P.js";import{a as p,b as Ee}from"./chunk-FZWSN3O2.js";import{a as ve}from"./chunk-EMQ6BLJB.js";import{a as Te}from"./chunk-GDA2ORYV.js";import{a as St,b as Ai}from"./chunk-WQIYR2AT.js";import{a as Pi}from"./chunk-QUG4HHXZ.js";import{a as Vi,b as Ni}from"./chunk-PSOULVZL.js";import"./chunk-XAXLMUF6.js";import{k as pt}from"./chunk-O3BD2LYL.js";import"./chunk-6ORYOOUQ.js";import"./chunk-ZB44PIZA.js";import{c as Qi,f as Mi}from"./chunk-YBFQQSLW.js";import{a as Se}from"./chunk-BT6MT7GL.js";import{a as lt}from"./chunk-4CVZBQNN.js";import"./chunk-VFXJ4ZBD.js";import{a as Ri,b as Di,c as Li,d as Oi}from"./chunk-TP3A6IN2.js";import"./chunk-ZB64W4XA.js";import{a as wi}from"./chunk-SVABVB5X.js";import"./chunk-CMY6WAF3.js";import{a as Ii}from"./chunk-3IFGWXMA.js";import"./chunk-4D5SN44G.js";import"./chunk-VVVN3YIZ.js";import{a as bi}from"./chunk-B6LCWWQX.js";import"./chunk-HYGNXZJR.js";import"./chunk-B6XXRKU5.js";import"./chunk-6Q5DDO7R.js";import"./chunk-RW2MVE4O.js";import"./chunk-3ZVRFUA4.js";import"./chunk-H4PCL6BZ.js";import"./chunk-U22BTVEZ.js";import{Ad as hi,Ce as fi,Ec as ui,Eg as Fi,Ff as vi,Gb as oi,Gc as pi,Hc as di,Hd as Ci,Ia as rt,Kb as li,Ne as xi,Pe as Si,Sc as ci,Sd as gi,Se as Ti,Vb as si,Xc as mi,Zc as _i,b as Yt,cc as ai,d as ge,jb as ri,jc as st,k as fe,kd as yi,kh as Ei,lc as at,t as jt,u as Ze,ua as ni,v as et,ve as ut,xb as ot}from"./chunk-X5J6QTCG.js";import{$ as $e,$a as C,Ac as Ut,Ad as ft,Db as de,Eb as Ce,Fa as a,Fb as Vt,H as Dt,Hb as Pt,Ib as e,Ic as Gt,J as Lt,Jb as L,Ka as M,Kb as O,Ma as H,Na as Je,Pf as Zt,Q as he,Qb as I,Rb as w,Sa as je,Sb as R,Th as me,U as Q,Wb as Nt,Yc as Wt,_ as Ot,_c as Bt,ac as qt,ba as N,bb as g,be as Ht,cc as X,d as Y,db as B,dc as j,di as xe,eb as k,fa as y,fb as U,fj as xt,ga as h,gb as f,hb as l,ib as s,ij as ti,jb as b,jj as ii,k as bt,lc as ce,lf as Xt,mc as ze,mf as Kt,nb as ht,nc as gt,nf as $t,ob as Ct,oh as ei,pj as z,q as It,qb as S,qc as kt,r as wt,sb as v,sf as Jt,tb as d,u as Rt,vd as tt,wd as zt,xb as Qt,xd as te,xg as nt,yb as Mt,yd as it,z as ye,zb as At}from"./chunk-SMW7PHYX.js";import{a as q,h as Et}from"./chunk-BMIYOSOG.js";var ne=(function(o){return o[o.EDITING_QUERY=0]="EDITING_QUERY",o[o.VIEWING_RESULT=1]="VIEWING_RESULT",o[o.VIEWING_RESULTS_AND_FILTERS=2]="VIEWING_RESULTS_AND_FILTERS",o})(ne||{}),re=(()=>{let c=class c extends ii{get isSuperAdmin(){return this.user?this.authorizeService.isSuperAdmin(this.user.role):!1}get isClubAdmin(){return this.user?this.authorizeService.isAdmin(this.user.role):!1}constructor(i,n,r,u,m,x,T,D,V,G,W,J,Z,oe,le,se,ae){super({lookUpTypeOptions:{},loadingLookUpTypeOptions:{}}),this.queryService=i,this.route=n,this.authorizeService=r,this.location=u,this.router=m,this.siteDataService=x,this.customReportService=T,this.reportService=D,this.registrationService=V,this.teamService=G,this.tryoutService=W,this.donationsService=J,this.clubService=Z,this.userService=oe,this.adminUserService=le,this.staffOnboardingService=se,this.sharedPlayerService=ae,this.unsubscribe$=new Y,this.pendingGlobalTemplateAction=null}initialize(){this.reset(),this.set(i=>{i.initializing=!0,i.lookUpTypeOptions={},i.loadingLookUpTypeOptions={},i.modelOptions=[],i.savedQueries=[],i.currentQuery=null,i.queryResult=null,i.currentModel=null,i.currentModelReportTableAliases={},i.currentModelReportFieldAliases={},i.reports=[],i.playerIDIndex=-1,i.playerNameIndex=-1,i.clubSubdomainIndex=-1,i.clubNameIndex=-1,i.clubIDIndex=-1,i.showLinkToPlayerProfile=!1}),this.authorizeService.getUser().pipe(Dt(1)).subscribe(i=>{if(i){this.user=i,this.reportService.profile=i,this.set(r=>{r.clubID=+this.user.clubID});let n={modelOptions:this.queryService.getAllModels(),programTypes:this.reportService.getProgramTypes(),programs:this.reportService.getPrograms(),seasons:this.registrationService.getRegistrationSeasons(),inviteStatuses:this.teamService.getInviteStatuses(),donations:this.donationsService.getClubDonationOptionsTitles(),volunteerOptions:this.donationsService.getClubVolunteerOptionsTitles(),clubs:this.clubService.getClubsDropdown(),reports:this.reportService.getReportCategories(!0),clubUser:this.userService.getClub
1User(),playerPools:this.user[me.PlayerPools]&&this.user[me.TryoutSettings]?this.tryoutService.getPlayerPools():bt(null),grades:this.sharedPlayerService.getGrades(),ageClasses:this.reportService.getAgeClasses(),credentialingTemplates:this.staffOnboardingService.getStaffOnboardingTemplatesAndWaivers(),roles:this.adminUserService.getRoles()};Rt(n).pipe(Q(this.unsubscribe$)).subscribe(r=>{this.set(u=>{if(u.initializing=!1,u.modelOptions=r.modelOptions,u.programTypes=r.programTypes,u.programs=r.programs,u.seasons=r.seasons,u.programs){let m=u.programs.flatMap(x=>x.teams).map(x=>({teamID:x.teamID,name:x.name,inactive:x.inactive}));u.teams=[...new Set(m.map(x=>JSON.stringify(x)))].map(x=>JSON.parse(x))}if(u.inviteStatuses=r.inviteStatuses,u.donations=r.donations,u.volunteerOptions=r.volunteerOptions,u.clubs=r.clubs,u.reports=r.reports.flatMap(m=>m.reports).sort((m,x)=>m.label.localeCompare(x.label)),u.clubUserID=r.clubUser.clubUserID,u.playerPools=r.playerPools?r.playerPools:[],u.grades=r.grades,u.ageClasses=r.ageClasses,u.credentialingTemplates=r.credentialingTemplates,u.pledgesWaivers=[],r.credentialingTemplates){let m=new Set;
1r.credentialingTemplates.forEach(x=>{x.steps&&x.steps.forEach(T=>{T.waivers&&T.waivers.length>0&&T.waivers.forEach(D=>{D.waiverID&&!m.has(D.waiverID)&&(m.add(D.waiverID),u.pledgesWaivers.push({label:D.waiver.title,value:D.waiver.waiverID}))})})})}u.roles=r.roles})})}})}ngOnDestroy(){this.unsubscribe$.next(null),this.unsubscribe$.complete()}toggleEntityExpanded(i){this.set(n=>{if(n.currentModel){let r=n.currentModel.reportEntities?.find(u=>u.reportEntityID===i);r&&(r.expanded=!r.expanded)}})}resetQueryResultFlags(){this.set(i=>{i.playerIDIndex=-1,i.playerNameIndex=-1,i.clubSubdomainIndex=-1,i.clubNameIndex=-1,i.clubIDIndex=-1,i.showLinkToPlayerProfile=!1})}initializeNewQuery(i){this.siteDataService.showSiteLoader(),this.set(r=>{r.loadingLookUpTypeOptions={},r.chunkSettings={offset:0,limit:25}});let n=i??this.state.currentModel?.reportModelID??+this.state.modelOptions[0].value;this.resetQueryResultFlags(),this.queryService.getModel(n).pipe(Q(this.unsubscribe$)).subscribe({next:r=>{this.set(u=>{u.currentModel=r.model,u.currentModel.reportEntities=u.currentModel.reportEntities?.sort((m,x)=>m.sortOrder-x.sortOrder),u.loadingModel=!1,u.currentModelReportTableAliases={},u.currentModelReportFieldAliases={};for(let m=0;m<r.allTables?.length;m++){let x=r.allTables[m];u.currentModelReportTableAliases[x.tableAliasID]=x;for(let T=0;T<x.reportFields?.length;T++){let D=x.reportFields[T];u.currentModelReportFieldAliases[D.reportFieldID]=D}}u.currentQuery={queryID:0,reportModelID:n,name:"",description:"",queryFields:[],queryConditions:[],queryFilters:u.currentModel.reportFilters.map(m=>({queryFilterID:0,reportFilterID:m.reportFilterID,queryID:0,value:null,reportFilter:m})),customReportTypeID:K.USER},u.queryViewState=ne.EDITING_QUERY}),this.evaluateSaveMenuItems(),this.siteDataService.hideSiteLoader()},error:()=>{this.siteDataService.hideSiteLoader()}})}initializeQuery(i,n=!1){this.siteDataService.showSiteLoader(),this.set(r=>{r.loadingLookUpTypeOptions={},r.chunkSettings={offset:0,limit:25}}),this.resetQueryResultFlags(),this.queryService.getQuery(i).pipe(Q(this.unsubscribe$)).subscribe({next:r=>{this.set(u=>{u.currentModel=r.model,u.currentModel.reportEntities=u.currentModel.reportEntities?.sort((m,x)=>m.sortOrder-x.sortOrder),u.currentModelReportTableAliases={},u.currentModelReportFieldAliases={};for(let m=0;m<r.allTables?.length;m++){let x=r.allTables[m];u.currentModelReportTableAliases[x.tableAliasID]=x;for(let T=0;T<x.reportFields?.length;T++){let D=x.reportFields[T];u.currentModelReportFieldAliases[D.reportFieldID]=D}}u.currentQuery=r.query,u.currentQuery.queryFields=u.currentQuery.queryFields?.sort((m,x)=>m.index-x.index),u.queryViewState=ne.EDITING_QUERY,u.currentReport=u.reports.find(m=>m.isCustom&&m.value===u.currentQuery.queryID)}),this.evaluateSaveMenuItems(),n?setTimeout(()=>{this.fetchData(),this.siteDataService.hideSiteLoader()}):this.siteDataService.hideSiteLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was an error loading your query"),this.siteDataService.hideSiteLoader(),this.router.navigate(["../new"],{relativeTo:this.route})}})}loadModelLookupOptions(i){this.queryService.getAllLookupFieldValues(i).pipe(Q(this.unsubscribe$)).subscribe({next:n=>{this.set(r=>{r.lookUpTypeOptions=n})},error:()=>{}})}entityInQuery(i){let n=this.state.currentModel.reportEntities?.find(r=>r.reportEntityID===i);return this.state.currentQuery.queryFields?.some(r=>n.entityFields.some(u=>u.reportEntityFieldID===r.reportEntityFieldID))}entityFieldInQuery(i){return this.state.currentQuery.queryFields?.some(n=>n.reportEntityFieldID===i)}toggleEntityInQuerySelection(i){this.state.currentQuery&&(this.entityInQuery(i)?this.removeEntityFromQuery(i):this.addEntityToQuery(i))}removeEntityFromQuery(i){this.set(n=>{if(n.currentQuery){let r=this.state.currentModel.reportEntities?.find(m=>m.reportEntityID===i),u=n.currentQuery.queryFields?.filter(m=>r.entityFields.some(x=>x.reportEntityFieldID===m.reportEntityFieldID));if(u.length>0){for(let m=0;m<u.length;m++){let x=u[m];n.currentQuery.queryFields=n.currentQuery.queryFields.filter(T=>T.reportEntityFieldID!==x.reportEntityFieldID)}n.currentQuery.pendingChanges=!0}}}),this.sequenceCurrentQueryBasedOnIndexPositions()}
1addEntityToQuery(i){this.set(n=>{if(n.currentQuery){let u=(this.state.currentModel.reportEntities?.find(m=>m.reportEntityID===i)).entityFields.filter(m=>!n.currentQuery.queryFields?.some(x=>x.reportEntityFieldID===m.reportEntityFieldID));if(u.length>0){for(let m=0;m<u.length;m++){let x=u[m];n.currentQuery.queryFields.push({queryFieldID:0,queryID:n.currentQuery.queryID,reportEntityID:i,reportEntityFieldID:x.reportEntityFieldID,index:n.currentQuery.queryFields.length})}n.currentQuery.pendingChanges=!0}}}),this.sequenceCurrentQueryBasedOnIndexPositions()}toggleEntityFieldInQuerySelection(i){this.state.currentQuery&&(this.entityFieldInQuery(i)?this.removeEntityFieldFromQuery(i):this.addEntityFieldToQuery(i))}addEntityFieldToQuery(i){this.set(n=>{if(n.currentQuery&&!n.currentQuery.queryFields?.find(u=>u.reportEntityFieldID===i)){let u=this.state.currentModel.reportEntities?.find(m=>m.entityFields.some(x=>x.reportEntityFieldID===i));n.currentQuery.queryFields.push({queryFieldID:0,queryID:n.currentQuery.queryID,reportEntityID:u.reportEntityID,reportEntityFieldID:i,index:n.currentQuery.queryFields.length}),n.currentQuery.pendingChanges=!0}}),this.sequenceCurrentQueryBasedOnIndexPositions()}removeEntityFieldFromQuery(i){this.set(n=>{n.currentQuery&&n.currentQuery.queryFields?.find(u=>u.reportEntityFieldID===i)&&(n.currentQuery.queryFields=n.currentQuery.queryFields.filter(u=>u.reportEntityFieldID!==i),n.currentQuery.pendingChanges=!0)}),this.sequenceCurrentQueryBasedOnIndexPositions()}moveQueryFieldInQuery(i,n){this.set(r=>{if(r.currentQuery){let u=r.currentQuery.queryFields?.splice(i,1)[0];r.currentQuery.queryFields?.splice(n,0,u),r.currentQuery.pendingChanges=!0}}),this.sequenceCurrentQueryBasedOnIndexPositions()}sequenceCurrentQueryBasedOnIndexPositions(){this.set(i=>{if(i.currentQuery)for(let n=0;n<i.currentQuery.queryFields.length;n++)i.currentQuery.queryFields[n].index=n+1})}setFilterValue(i,n){this.set(r=>{r.currentQuery&&(r.currentQuery.queryFilters.find(u=>u.reportFilter.customReportFilterTypeID===i).value=n)})}getQueryFilter(i,n){return i.currentQuery.queryFilters.find(r=>r.reportFilter.customReportFilterTypeID===n)}clearFilterValues(){this.set(i=>{i.currentQuery&&i.currentQuery.queryFilters.forEach(n=>{n.value=null})})}setFilterValues(){this.state.currentQuery.queryFilters.length<1||(this.clearFilterValues(),this.set(i=>{this.getQueryFilter(i,p.NOT_ASSIGNED_PLAYERS)&&(this.getQueryFilter(i,p.NOT_ASSIGNED_PLAYERS).value=this.customReportService.filters.notAssignedPlayerOption.toString()),this.getQueryFilter(i,p.TEST_PLAYERS)&&(this.getQueryFilter(i,p.TEST_PLAYERS).value=this.customReportService.filters.testUserOption.toString()),this.customReportService.filters.clubID&&this.getQueryFilter(i,p.CLUB)&&(this.getQueryFilter(i,p.CLUB).value=this.customReportService.filters.clubID.toString()),this.customReportService.filters.programTypeID&&this.getQueryFilter(i,p.PROGRAM_TYPE)&&(this.getQueryFilter(i,p.PROGRAM_TYPE).value=this.customReportService.filters.programTypeID.toString()),this.customReportService.filters.programID&&this.getQueryFilter(i,p.PROGRAM)&&(this.getQueryFilter(i,p.PROGRAM).value=this.customReportService.filters.programID.toString()),this.customReportService.filters.dobFrom&&this.getQueryFilter(i,p.BIRTH_DATE_FROM)&&(this.getQueryFilter(i,p.BIRTH_DATE_FROM).value=this.customReportService.filters.dobFrom.toDateString()),this.customReportService.filters.dobTo&&this.getQueryFilter(i,p.BIRTH_DATE_TO)&&(this.getQueryFilter(i,p.BIRTH_DATE_TO).value=this.customReportService.filters.dobTo.toDateString()),this.customReportService.filters.graduationYearFrom&&this.getQueryFilter(i,p.GRADUATION_YEAR_FROM)&&(this.getQueryFilter(i,p.GRADUATION_YEAR_FROM).value=this.customReportService.filters.graduationYearFrom.getFullYear().toString()),this.customReportService.filters.graduationYearTo&&this.getQueryFilter(i,p.GRADUATION_YEAR_TO)&&(this.getQueryFilter(i,p.GRADUATION_YEAR_TO).value=this.customReportService.filters.graduationYearTo.getFullYear().toString()),this.customReportService.filters.genderID&&this.getQueryFilter(i,p.GENDER)&&(this.getQueryFilter(i,p.GENDER).value=this.customReportService.filters.genderID),this.customReportService.filters.playerName&&this.getQueryFilter(i,p.LAST_NAME)&&(this.getQueryFilter(i,p.LAST_NAME).value=this.customReportService.filters.playerName),this.customReportService.filters.registrations&&this.customReportService.filters.registrations.length>0&&this.getQueryFilter(i,p.REGISTRATION)&&(this.getQueryFilter(i,p.REGISTRATION).value=this.customReportService.filters.registrations.map(n=>n.registrationID.toString()).join(",")),this.customReportService.filters.seasons&&this.customReportService.filters.seasons.length>0&&this.getQueryFilter(i,p.SEASON)&&(this.getQueryFilter(i,p.SEASON).value=this.customReportService.filters.seasons.map(n=>n.value.toString()).join(",")),this.customReportService.filters.teams&&this.customReportService.filters.teams.length>0&&this.getQueryFilter(i,p.TEAM)&&(this.getQueryFilter(i,p.TEAM).value=this.customReportService.filters.teams.map(n=>n.teamID.toString()).join(",")),this.customReportService.filters.statuses&&this.customReportService.filters.statuses.length>0&&this.getQueryFilter(i,p.STATUS)&&(this.getQueryFilter(i,p.STATUS).value=this.customReportService.filters.statuses.map(n=>n.value.toString()).join(",")),this.customReportService.filters.clubs&&this.customReportService.filters.clubs.length>0&&this.getQueryFilter(i,p.CLUB_MULTISELECT)&&(this.getQueryFilter(i,p.CLUB_MULTISELECT).value=this.customReportService.filters.clubs.map(n=>n.clubID.toString()).join(",")),this.customReportService.filters.programTypes&&this.customReportService.filters.programTypes.length>0&&this.getQueryFilter(i,p.PROGRAM_TYPE_MULTISELECT)&&(this.getQueryFilter(i,p.PROGRAM_TYPE_MULTISELECT).value=this.customReportService.filters.programTypes.map(n=>n.value.toString()).join(",")),this.customReportService.filters.programs&&this.customReportService.filters.programs.length>0&&this.getQueryFilter(i,p.PROGRAM_MULTISELECT)&&(this.getQueryFilter(i,p.PROGRAM_MULTISELECT).value=this.customReportService.filters.programs.map(n=>n.programID.toString()).join(",")),this.customReportService.filters.creditName&&this.getQueryFilter(i,p.CREDIT_DISCOUNT_NAME)&&(this.getQueryFilter(i,p.CREDIT_DISCOUNT_NAME).value=this.customReportService.filters.creditName),this.customReportService.filters.dateFrom&&this.getQueryFilter(i,p.DATE_FROM)&&(this.getQueryFilter(i,p.DATE_FROM).value=this.customReportService.filters.dateFrom.toDateString()),this.customReportService.filters.dateTo&&this.getQueryFilter(i,p.DATE_TO)&&(this.getQueryFilter(i,p.DATE_TO).value=this.customReportService.filters.dateTo.toDateString()),this.customReportService.filters.dateFrom2&&this.getQueryFilter(i,p.EXPIRATION_DATE_FROM)&&(this.getQueryFilter(i,p.EXPIRATION_DATE_FROM).value=this.customReportService.filters.dateFrom2.toDateString()),this.customReportService.filters.dateTo2&&this.getQueryFilter(i,p.EXPIRATION_DATE_TO)&&(this.getQueryFilter(i,p.EXPIRATION_DATE_TO).value=this.customReportService.filters.dateTo2.toDateString()),this.customReportService.filters.donations&&this.customReportService.filters.donations.length>0&&this.getQueryFilter(i,p.DONATION_OPTION)&&(this.getQueryFilter(i,p.DONATION_OPTION).value=this.customReportService.filters.donations.map(n=>n.id.toString()).join(",")),this.customReportService.filters.volunteerOptions&&this.customReportService.filters.volunteerOptions.length>0&&this.getQueryFilter(i,p.VOLUNTEER_OPTION)&&(this.getQueryFilter(i,p.VOLUNTEER_OPTION).value=this.customReportService.filters.volunteerOptions.map(n=>n.id.toString()).join(",")),this.customReportService.filters.notInPrograms&&this.customReportService.filters.notInPrograms.length>0&&this.getQueryFilter(i,p.NOT_IN_PROGRAM)&&(this.getQueryFilter(i,p.NOT_IN_PROGRAM).value=this.customReportService.filters.notInPrograms.map(n=>n.programID.toString()).join(",")),this.customReportService.filters.alsoInPrograms&&this.customReportService.filters.alsoInPrograms.length>0&&this.getQueryFilter(i,p.ALSO_IN_PROGRAM)&&(this.getQueryFilter(i,p.ALSO_IN_PROGRAM).value=this.customReportService.filters.alsoInPrograms.map(n=>n.programID.toString()).join(",")),this.customReportService.filters.invitationOption&&this.getQueryFilter(i,p.EXPIRED_INVITATIONS)&&(this.getQueryFilter(i,p.EXPIRED_INVITATIONS).value=this.customReportService.filters.invitationOption.toString()),this.customReportService.filters.asOfDate&&this.getQueryFilter(i,p.AS_OF_DATE)&&(this.getQueryFilter(i,p.AS_OF_DATE).value=this.customReportService.filters.asOfDate.toDateString()),this.customReportService.filters.playerPools&&this.customReportService.filters.playerPools.length>0&&this.getQueryFilter(i,p.PLAYER_POOL)&&(this.getQueryFilter(i,p.PLAYER_POOL).value=this.customReportService.filters.playerPools.map(n=>n.playerPoolID.toString()).join(",")),this.customReportService.filters.grades&&this.customReportService.filters.grades.length>0&&this.getQueryFilter(i,p.GRADE_MULTISELECT)&&(this.getQueryFilter(i,p.GRADE_MULTISELECT).value=this.customReportService.filters.grades.map(n=>n.value.toString()).join(",")),this.customReportService.filters.ageClasses&&this.customReportService.filters.ageClasses.length>0&&this.getQueryFilter(i,p.AGE_CLASS_MULTISELECT)&&(this.getQueryFilter(i,p.AGE_CLASS_MULTISELECT).value=this.customReportService.filters.ageClasses.map(n=>n.value.toString()).join(",")),this.customReportService.filters.includeCancelledRegistrations&&this.getQueryFilter(i,p.INCLUDE_CANCELLED_REGISTRATIONS)&&(this.getQueryFilter(i,p.INCLUDE_CANCELLED_REGISTRATIONS).value=this.customReportService.filters.includeCancelledRegistrations.toString()),this.customReportService.filters.registrationOptions&&this.customReportService.filters.registrationOptions.length>0&&this.getQueryFilter(i,p.CHECKOUT_OPTION_MULTISELECT)&&(this.getQueryFilter(i,p.CHECKOUT_OPTION_MULTISELECT).value=this.customReportService.filters.registrationOptions.map(n=>n.value.toString()).join(",")),this.customReportService.filters.registrationOptionValues&&this.customReportService.filters.registrationOptionValues.length>0&&this.getQueryFilter(i,p.CHECKOUT_OPTION_RESPONSE_MULTISELECT)&&(this.getQueryFilter(i,p.CHECKOUT_OPTION_RESPONSE_MULTISELECT).value=this.customReportService.filters.registrationOptionValues.map(n=>n.value.toString()).join(",")),this.customReportService.filters.registrationQuestions&&this.customReportService.filters.registrationQuestions.length>0&&this.getQueryFilter(i,p.REGISTRATION_QUESTION_MULTISELECT)&&(this.getQueryFilter(i,p.REGISTRATION_QUESTION_MULTISELECT).value=this.customReportService.filters.registrationQuestions.map(n=>n.value.toString()).join(",")),this.customReportService.filters.registrationQuestionResponses&&this.customReportService.filters.registrationQuestionResponses.length>0&&this.getQueryFilter(i,p.REGISTRATION_QUESTION_RESPONSE_MULTISELECT)&&(this.getQueryFilter(i,p.REGISTRATION_QUESTION_RESPONSE_MULTISELECT).value=this.customReportService.filters.registrationQuestionResponses.map(n=>n.value.toString()).join(",")),this.customReportService.filters.credentialingTemplates&&this.customReportService.filters.credentialingTemplates.length>0&&this.getQueryFilter(i,p.STAFF_CREDENTIALING_TEMPLATE)&&(this.getQueryFilter(i,p.STAFF_CREDENTIALING_TEMPLATE).value=this.customReportService.filters.credentialingTemplates.map(n=>n.staffOnboardingTemplateID.toString()).join(",")),this.customReportService.filters.pledgesWaivers&&this.getQueryFilter(i,p.PLEDGES_WAIVERS)&&(this.getQueryFilter(i,p.PLEDGES_WAIVERS).value=this.customReportService.filters.pledgesWaivers.map(n=>n.value.toString()).join(",")),this.customReportService.filters.roles&&this.getQueryFilter(i,p.ROLES)&&(this.getQueryFilter(i,p.ROLES).value=this.customReportService.filters.roles.map(n=>n.value.toString()).join(","))}))}fetchData(i=null,n=!1){if(this.state.currentQuery.queryFields?.length===0){this.siteDataService.showSiteErrorAlert("Add fields to your query before executing.");return}this.setFilterValues(),this.set(r=>{if(r.currentQuery&&(r.fetchingData=!0),i){r.chunkSettings=i;for(let u=0;u<r.currentQuery.queryFields.length;u++)i.sortColumnIndex!==null&&u===i.sortColumnIndex?(r.currentQuery.queryFields[u].sortIndex=1,r.currentQuery.queryFields[u].sortDirection=i.sortDirection):(r.currentQuery.queryFields[u].sortIndex=0,r.currentQuery.queryFields[u].sortDirection=Fe.NONE)}else if(!n)for(let u=0;u<r.currentQuery.queryFields.length;u++)r.currentQuery.queryFields[u].sortIndex=0,r.currentQuery.queryFields[u].sortDirection=Fe.NONE}),n?this.queryService.exportData(this.state.currentQuery).pipe(Q(this.unsubscribe$)).subscribe({next:r=>{r.fileName=r.fileName??"new-query",Zt(r),this.set(u=>{u.fetchingData=!1})},error:()=>{this.siteDataService.showSiteErrorAlert("There was an error running your query. "),this.set(r=>{r.fetchingData=!1,r.queryResult=null})}}):this.queryService.fetchData(this.state.currentQuery,this.state.chunkSettings).pipe(Q(this.unsubscribe$)).subscribe({next:r=>{this.set(u=>{u.fetchingData=!1,u.queryResult=r,u.queryViewState=ne.VIEWING_RESULT;for(let m=0;m<u.queryResult.resultSet.rows.length;m++){let x=u.queryResult.resultSet.rows[m];for(let T=0;T<x.length;T++){let D=u.queryResult.resultSet.columns[T].type,V=u.queryResult.resultSet.columns[T].displayFormat;m===0&&u.queryResult.resultSet.columns[T].label===ie.playerIDLabel?u.playerIDIndex=T:m===0&&(u.queryResult.resultSet.columns[T].label===ie.playerNameLabel||u.queryResult.resultSet.columns[T].label===ie.playerLastNameLabel)?u.playerNameIndex=T:m===0&&u.queryResult.resultSet.columns[T].label===ie.subdomainLabel?u.clubSubdomainIndex=T:m===0&&(u.queryResult.resultSet.columns[T].label===ie.clubNameLabel||u.queryResult.resultSet.columns[T].label===ie.clubNameAlternateLabel)?u.clubNameIndex=T:m===0&&u.queryResult.resultSet.columns[T].label===ie.clubIDLabel&&(u.clubIDIndex=T),V?u.queryResult.resultSet.rows[m][T]=this.formatColumnWithFormatString(V,x[T]):u.queryResult.resultSet.rows[m][T]=this.formatColumnValueWithDefaultFormat(D,x[T])}}u.showLinkToPlayerProfile=u.playerIDIndex>-1&&u.playerNameIndex>-1&&u.clubSubdomainIndex>-1&&u.clubNameIndex>-1&&u.clubIDIndex>-1}
1)},error:()=>{this.siteDataService.showSiteErrorAlert("There was an error running your query. "),this.set(r=>{r.fetchingData=!1,r.queryResult=null})}})}sendEmail(){this.setFilterValues(),this.siteDataService.showSiteLoader(),this.queryService.getEmailRecipients(this.state.currentQuery).pipe(Q(this.unsubscribe$)).subscribe({next:i=>{this.siteDataService.hideSiteLoader(),this.set(n=>{n.players=i,n.showComposeEmail=!0})},error:()=>{this.siteDataService.showSiteErrorAlert("There was an error getting email recipients."),this.siteDataService.hideSiteLoader()}})}hideComposeEmail(){this.siteDataService.showSiteLoader(),setTimeout(()=>{this.set(i=>{i.showComposeEmail=!1,this.siteDataService.hideSiteLoader()})})}addFilter(i){let n=this.state.currentModel.reportEntities?.map(r=>r.entityFields).flat().find(r=>r.reportEntityFieldID===i);n.fieldLookupTypeID>0&&!this.state.lookUpTypeOptions[n.fieldLookupTypeID]&&(this.set(r=>{r.loadingLookUpTypeOptions[n.fieldLookupTypeID]=!0}),this.queryService.getLookupFieldValues(this.state.currentModel.reportModelID,n.fieldLookupTypeID).pipe(Q(this.unsubscribe$)).subscribe({next:r=>{this.set(u=>{u.lookUpTypeOptions[n.fieldLookupTypeID]=r.values,u.loadingLookUpTypeOptions[n.fieldLookupTypeID]=!1;for(let m=0;m<u.currentQuery.queryConditions.length;m++)u.currentQuery.queryConditions[m].reportEntityFieldID===n.reportEntityFieldID&&(u.currentQuery.queryConditions[m].queryConditionLookupOptions=r.values)})},error:()=>{this.set(r=>{r.loadingLookUpTypeOptions[n.fieldLookupTypeID]=!1})}})),this.set(r=>{if(r.currentQuery){let u=0;r.currentQuery.queryConditions&&(u=r.currentQuery.queryConditions.reduce((T,D)=>Math.max(T,D.queryConditionID),0));let m=r.currentModel.reportEntities?.map(T=>T.entityFields).flat().find(T=>T.reportEntityFieldID===i),x={queryConditionID:u+1,queryID:r.currentQuery.queryID,conditionGroupTypeID:qi.SIMPLE,conditionGroupLinkTypeID:ki.ALL,reportEntityFieldID:i,reportEntityID:m.reportEntityID,operatorID:this.getOperatorsByDataType(m.dataTypeID,m.fieldLookupTypeID>0)[0].operatorType,queryConditionParameters:[],queryConditionLookupOptions:r.lookUpTypeOptions[m.fieldLookupTypeID]??[]};x.queryConditionParameters=this.createDefaultQueryConditionParameters(x),r.currentQuery.queryConditions.push(x),r.currentQuery.pendingChanges=!0}})}createDefaultQueryConditionParameters(i){let n=[],r=i.reportEntityFieldID,u=this.state.currentModel.reportEntities.map(G=>G.entityFields).flat().find(G=>G.reportEntityFieldID===r),m=this.GetDataTypeCategory(u.dataTypeID),T=this.state.currentModel.operators[m].find(G=>G.operatorType===i.operatorID).expression,D=/\{(param_\d)\}/g,V=[...T.matchAll(D)];if(V){let G=V.map(W=>W[1]).filter((W,J,Z)=>Z.indexOf(W)===J);for(let W=0;W<G.length;W++)W>n.length-1&&n.push({queryConditionParameterID:0,queryConditionID:i.queryConditionID,queryID:i.queryID,value:null,reportEntityFieldID:r})}return n}setFilterEntityField(i,n){this.set(u=>{if(u.currentQuery){for(let m=0;m<u.currentQuery.queryConditions.length;m++)if(u.currentQuery.queryConditions[m].queryConditionID===i){let x=u.currentModel.reportEntities?.map(D=>D.entityFields).flat().find(D=>D.reportEntityFieldID===u.currentQuery.queryConditions[m].reportEntityFieldID);u.currentQuery.queryConditions[m].reportEntityFieldID=n;let T=u.currentModel.reportEntities?.map(D=>D.entityFields).flat().find(D=>D.reportEntityFieldID===n);(x.dataTypeID!==T.dataTypeID||x.fieldLookupTypeID!==T.fieldLookupTypeID)&&(u.currentQuery.queryConditions[m].operatorID=this.getOperatorsByDataType(this.GetDataTypeCategory(T.dataTypeID),T.fieldLookupTypeID>0)[0].operatorType,u.currentQuery.queryConditions[m].queryConditionParameters=this.createDefaultQueryConditionParameters(u.currentQuery.queryConditions[m]),u.currentQuery.queryConditions[m].queryConditionLookupOptions=u.lookUpTypeOptions[T.fieldLookupTypeID]??[]),u.currentQuery.pendingChanges=!0;break}}});let r=this.state.currentModel.reportEntities?.map(u=>u.entityFields).flat().find(u=>u.reportEntityFieldID===n);r.fieldLookupTypeID>0&&!this.state.lookUpTypeOptions[r.fieldLookupTypeID]&&(this.set(u=>{u.loadingLookUpTypeOptions[r.fieldLookupTypeID]=!0}),this.queryService.getLookupFieldValues(this.state.currentModel.reportModelID,r.fieldLookupTypeID).pipe(Q(this.unsubscribe$)).subscribe({next:u=>{this.set(m=>{m.lookUpTypeOptions[r.fieldLookupTypeID]=u.values,m.loadingLookUpTypeOptions[r.fieldLookupTypeID]=!1;for(let x=0;x<m.currentQuery.queryConditions.length;x++)m.currentQuery.queryConditions[x].queryConditionID===i&&(m.currentQuery.queryConditions[x].queryConditionLookupOptions=u.values)})},error:()=>{this.set(u=>{u.loadingLookUpTypeOptions[r.fieldLookupTypeID]=!1})}}))}setFilterOperator(i,n){this.set(r=>{if(r.currentQuery){for(let u=0;u<r.currentQuery.queryConditions.length;u++)if(r.currentQuery.queryConditions[u].queryConditionID===i){r.currentQuery.queryConditions[u].operatorID=n,r.currentQuery.queryConditions[u].queryConditionParameters=this.createDefaultQueryConditionParameters(r.currentQuery.queryConditions[u]),r.currentQuery.pendingChanges=!0;break}}})}setConditionParameterValues(i,n,r){this.set(u=>{if(u.currentQuery){for(let m=0;m<u.currentQuery.queryConditions.length;m++)if(u.currentQuery.queryConditions[m].queryConditionID===i){u.currentQuery.queryConditions[m].queryConditionParameters[n].value=r,u.currentQuery.pendingChanges=!0;break}}})}removeQueryCondition(i){this.set(n=>{n.currentQuery&&(n.currentQuery.queryConditions=n.currentQuery.queryConditions.filter(r=>r.queryConditionID!==i),n.currentQuery.pendingChanges=!0)})}getOperatorsByDataType(i,n=!1){let r=this.state.currentModel.operators[this.GetDataTypeCategory(i)];return n&&(r=r.filter(u=>u.operatorType===$.EQUAL||u.operatorType===$.NOT_EQUAL||u.operatorType===$.IN_LIST||u.operatorType===$.NOT_IN_
1LIST||u.operatorType===$.IS_NULL||u.operatorType===$.IS_NOT_NULL)),r}editReport(){this.set(i=>{i.queryViewState=ne.EDITING_QUERY})}isTemplateFromAnotherClub(){let i=this.currentState.currentQuery;return!!i&&i.queryID>0&&i.customReportTypeID===K.TEMPLATE&&i.clubID!==this.currentState.clubID}isGlobalTemplate(){let i=this.currentState.currentQuery;return!!i&&i.queryID>0&&i.customReportTypeID===K.TEMPLATE&&i.clubID===ei}confirmIfGlobalTemplate(i){this.isGlobalTemplate()?(this.pendingGlobalTemplateAction=i,this.set(n=>{n.showGlobalTemplateWarningDialog=!0})):i()}confirmGlobalTemplateAction(){let i=this.pendingGlobalTemplateAction;this.pendingGlobalTemplateAction=null,this.set(n=>{n.showGlobalTemplateWarningDialog=!1}),i&&i()}cancelGlobalTemplateAction(){this.pendingGlobalTemplateAction=null,this.set(i=>{i.showGlobalTemplateWarningDialog=!1})}canSaveCurrentReport(){return this.currentState.currentQuery?!(this.currentState.currentQuery.queryID>0&&this.currentState.currentQuery.customReportTypeID===K.TEMPLATE&&(!this.isSuperAdmin&&this.currentState.currentQuery.ownerClubUserID!==this.currentState.clubUserID||this.isTemplateFromAnotherClub())):!1}canRemoveReport(){return this.currentState.currentQuery?this.currentState.currentQuery.queryID===0||this.isTemplateFromAnotherClub()?!1:!!(this.currentState.currentQuery.ownerClubUserID===this.currentState.clubUserID||this.isSuperAdmin):!1}saveCopyOfReport(i){this.set(n=>{n.currentQuery.queryID=0,n.currentQuery.customReportTypeID=K.USER,n.currentQuery.name=i}),this.saveCurrentReport(i)}saveCopyOfReportAsTemplate(i){this.set(n=>{n.currentQuery.queryID=0,n.currentQuery.customReportTypeID=K.TEMPLATE,n.currentQuery.name=i}),this.saveCurrentReport(i)}renameAndSaveReport(i){this.set(n=>{n.currentQuery.name=i}),this.saveCurrentReport()}cancelRenameQuery(){this.set(i=>{i.showRenameReportDialog=!1,i.showSaveCopyAsTemplatePromptDialog=!1,i.showSaveCopyPromptDialog=!1})}saveReportAsTemplate(i){this.set(n=>{n.currentQuery.name=i,n.currentQuery.customReportTypeID=K.TEMPLATE,n.currentQuery.queryFilters.forEach(r=>{r.value=null})}),this.saveCurrentReport(i)}hideSaveReportAsTemplate(){this.set(i=>{i.showSaveReportAsTemplateDialog=!1})}hideShowSaveNewReport(){this.set(i=>{i.showSaveNewReportDialog=!1})}saveCurrentReport(i){!(this.currentState.currentQuery.queryID>0)&&!i?this.set(n=>{n.currentQuery.queryID=0,n.showSaveNewReportDialog=!0}):(this.set(n=>{n.showSaveReportAsTemplateDialog=!1,n.showSaveCopyPromptDialog=!1,n.showRenameReportDialog=!1,n.showSaveNewReportDialog=!1,n.showSaveCopyAsTemplatePromptDialog=!1,n.savingQuery=!0,this.currentState.currentQuery.queryID>0||(n.currentQuery.name=i)}),this.setFilterValues(),this.queryService.saveQuery(this.currentState.currentQuery).pipe(Q(this.unsubscribe$)).subscribe({next:n=>{let r=!(this.currentState.currentQuery.queryID>0);this.set(u=>{u.savingQuery=!1,u.currentQuery.queryID=n}),r&&this.location.replaceState("/admin/reports/custom-report-query/"+n),this.siteDataService.showSiteSuccessAlert("Query saved"),this.evaluateSaveMenuItems(),this.reportService.getReportCategories(!0).pipe(Q(this.unsubscribe$)).subscribe(u=>{this.set(m=>{m.reports=u.flatMap(x=>x.reports).sort((x,T)=>x.label.localeCompare(T.label)),m.currentReport=m.reports.find(x=>x.isCustom&&x.value===m.currentQuery.queryID)})})},error:()=>{this.siteDataService.showSiteErrorAlert("There was an error saving your query. "),this.set(n=>{n.savingQuery=!1})}}))}removeQuery(){this.set(i=>{i.showRemoveReportDialog=!1,i.savingQuery=!0}),this.queryService.removeQuery(this.currentState.currentQuery.queryID).pipe(Q(this.unsubscribe$)).subscribe({next:()=>{this.set(i=>{i.savingQuery=!1}),this.router.navigate(["admin/reports"])},error:()=>{this.siteDataService.showSiteErrorAlert("There was an error removing your report. "),this.set(i=>{i.savingQuery=!1})}})}tryChangeModel(i){this.currentState.currentQuery&&this.currentState.currentQuery.pendingChanges?this.set(n=>{n.modelIDToChangeTo=i,n.showChangeModelDiscardChangesDialog=!0}):this.initializeNewQuery(i)}confirmChangeModel(){let i=this.currentState.modelIDToChangeTo;this.set(n=>{n.modelIDToChangeTo=null,n.showChangeModelDiscardChangesDialog=!1}),this.initializeNewQuery(i)}cancelChangeModel(){this.set(i=>{i.modelIDToChangeTo=null,i.showChangeModelDiscardChangesDialog=!1})}showSaveReportAsTemplateDialog(){this.set(i=>{i.showSaveReportAsTemplateDialog=!0})}showSaveCopyPrompt(){this.set(i=>{i.showSaveCopyPromptDialog=!0})}showSaveCopyAsTemplatePrompt(){this.set(i=>{i.showSaveCopyAsTemplatePromptDialog=!0})}showRemoveQuery(){this.set(i=>{i.showRemoveReportDialog=!0})}hideRemoveQuery(){this.set(i=>{i.showRemoveReportDialog=!1})}showRenameReportDialog(){this.set(i=>{i.showRenameReportDialog=!0})}evaluateSaveMenuItems(){this.set(i=>{i.saveMenuItems=[];let n=i.currentQuery?.customReportTypeID===K.TEMPLATE,r=i.currentQuery?.queryID>0,u;this.canSaveCurrentReport()&&(u={label:"Save "+(n?"Template":"Report"),icon:"fa-regular fa-floppy-disk",command:()=>{this.confirmIfGlobalTemplate(()=>this.saveCurrentReport())}},i.saveMenuItems.push(u));let m;r&&(m={label:"Save a Copy",icon:"fa-regular fa-copy",command:()=>{this.showSaveCopyPrompt()}},i.saveMenuItems.push(m));let x;r&&(x={label:"Save a Copy As Template",icon:"fa-regular fa-copy",command:()=>{this.showSaveCopyAsTemplatePrompt()}},i.saveMenuItems.push(x));let T;this.canSaveAsTemplate()&&(T={label:"Save Report As Template",icon:"fa-regular fa-clone",command:()=>{this.showSaveReportAsTemplateDialog()}},i.saveMenuItems.push(T));let D;this.canRemoveReport()&&(D={label:"Remove "+(n?"Template":"Report"),icon:"fa-regular fa-trash",command:()=>{this.confirmIfGlobalTemplate(()=>this.showRemoveQuery())}},i.saveMenuItems.push(D));let V;this.canRemoveReport()&&(V={label:"Rename "+(n?"Template":"Report"),icon:"fa-regular fa-pencil",command:()=>{this.confirmIfGlobalTemplate(()=>this.showRenameReportDialog())}},i.saveMenuItems.push(V))})}canSaveAsTemplate(){return this.currentState.currentQuery?!(this.currentState.currentQuery.queryID>0&&this.currentState.currentQuery.customReportTypeID===K.TEMPLATE):!1}
1formatColumnValueWithDefaultFormat(i,n){if(n===null)return null;switch(i){case A.Bool:return n?"Yes":"No";case A.Float:case A.Currency:return n;case A.Date:return nt(n,!1);case A.DateTime:return nt(n,!1);case A.DateOnly:return nt(n,!1);default:return n}}formatColumnWithFormatString(i,n){if(!n||!i)return n;if(typeof n=="number"){if(i.charAt(0)==="P")return n.toLocaleString(void 0,{style:"percent",minimumFractionDigits:i.length>1?Number(i.substring(1)):0});if(i==="C")return n.toLocaleString(void 0,{style:"currency",currency:"USD"});if(i==="0.##"){let r=Math.floor(n),u=n-r;return u===0?r.toString():u*10%1===0?n.toFixed(1):n.toFixed(2)}else{let r=i.match(/\.(\d+)/),u=r?parseInt(r[1]):0;return n.toLocaleString(void 0,{minimumFractionDigits:u,maximumFractionDigits:u})}}else{if(typeof n=="string"&&i.includes("0"))return n.padStart(i.length,"0");if(i.includes("y")){let r=new Date(n),u=r.getFullYear(),m=r.getMonth()+1,x=r.getDate(),T=r.getHours(),D=r.getMinutes(),V=r.getSeconds(),G=T>=12?"PM":"AM";return i.replace("yyyy",u.toString()).replace("yy",u.toString().slice(-2)).replace("MM",m.toString().padStart(2,"0")).replace("dd",x.toString().padStart(2,"0")).replace("HH",T.toString().padStart(2,"0")).replace("mm",D.toString().padStart(2,"0")).replace("ss",V.toString().padStart(2,"0")).replace("hh",((T+11)%12+1).toString().padStart(2,"0")).replace("tt",G)}}}GetDataTypeCategory(i){switch(i){case A.String:case A.BCD:case A.FixedChar:case A.Word:return ee.TEXT;case A.Byte:case A.Int32:case A.Int64:case A.Autoinc:case A.Float:case A.Currency:return ee.NUMERIC;case A.Bool:return ee.BOOLEAN;case A.Date:case A.DateTime:case A.DateOnly:case A.Time:return ee.DATE;default:return ee.UNKNOWN}}};c.\u0275fac=function(n){return new(n||c)(N(ve),N(tt),N(xe),N(Gt),N(te),N(z),N(Ee),N(Te),N(Se),N(vi),N(bi),N(Ii),N(wi),N(ni),N(pt),N(dt),N(Pi))},c.\u0275prov=Ot({token:c,factory:c.\u0275fac});let o=c;return o})();var Yi=Et(ti());function un(o,c){if(o&1){let t=S();e(0,` 2 `),l(1,"input",2),v("change",function(n){y(t);let r=d().$index,u=d(2);return h(u.onValueChanged(n,r))}),s(),e(2,` 3 `)}if(o&2){let t=d().$implicit;a(),f("value",t.value)}}function pn(o,c){if(o&1){let t=S();e(0,` 4 `),l(1,"p-datepicker",3),R("ngModelChange",function(n){y(t);let r=d().$implicit;return w(r.value,n)||(r.value=n),h(n)}),v("onSelect",function(n){y(t);let r=d().$index,u=d(2);return h(u.onDateValueChanged(n,r))}),s(),e(2,` 5 `)}if(o&2){let t=d().$implicit;a(),I("ngModel",t.value)}}function dn(o,c){if(o&1){let t=S();e(0,` 6 `),l(1,"p-multiSelect",4),R("ngModelChange",function(n){y(t);let r=d(2).$implicit;return w(r.value,n)||(r.value=n),h(n)}),v("onChange",function(n){y(t);let r=d(2).$index,u=d(2);return h(u.onLookupValueChanged(n,r))}),s(),e(2,` 7 `)}if(o&2){let t=d(2).$implicit,i=d(2);a(),f("options",i.condition.queryConditionLookupOptions)("maxSelectedLabels",3)("selectionLimit",i.getSelectionLimit()),I("ngModel",t.value)}}function cn(o,c){o&1&&(e(0,` 8 `),b(1,"app-loader"),e(2,` 9 `))}function mn(o,c){if(o&1&&(e(0,` 10 `),C(1,dn,3,4),C(2,cn,3,0)),o&2){let t=d(3);a(),g(t.loadingLookupValues?-1:1),a(),g(t.loadingLookupValues?2:-1)}}function _n(o,c){if(o&1&&(e(0,` 11 `),l(1,"div",1),e(2,` 12 `),C(3,un,3,1),C(4,pn,3,1),C(5,mn,3,2),s(),e(6,` 13 `)),o&2){let t=d(2);a(3),g(!t.isLookupField&&(t.dataTypeCategory===t.DataTypeCategory.TEXT||t.dataTypeCategory===t.DataTypeCategory.NUMERIC)?3:-1),a(),g(t.dataTypeCategory===t.DataTypeCategory.DATE?4:-1),a(),g(t.isLookupField?5:-1)}}function yn(o,c){if(o&1&&(e(0,` 14 `),l(1,"div",0),e(2,` 15 `),k(3,_n,7,3,null,null,B),s(),e(5,` 16`)),o&2){let t=d();a(3),U(t.conditionParameters)}}var ji=(()=>{let c=class c{get _conditionID(){return this.conditionID}set _conditionID(i){this.conditionID=i,this.initialize()}constructor(i,n,r){this.queryStore=i,this.router=n,this.siteDataService=r,this.unsubscribe$=new Y,this.loadingLookupValues=!1,this.DataTypeCategory=ee,this.DataType=A}initialize(){this.queryStore.select(i=>({currentQuery:i.currentQuery,currentModel:i.currentModel,allTables:i.currentModelReportTableAliases,allFields:i.currentModelReportFieldAliases,loadingLookUpTypeOptions:i.loadingLookUpTypeOptions})).pipe(ye(i=>!!i.currentModel&&!!i.currentQuery)).subscribe(i=>{if(this.condition=i.currentQuery.queryConditions.find(n=>n.queryConditionID===this.conditionID),this.condition){let n=this.condition.reportEntityFieldID,r=i.currentModel.reportEntities.map(u=>u.entityFields).flat().find(u=>u.reportEntityFieldID===n);this.isLookupField=r.fieldLookupTypeID>0,this.conditionParameters=(0,Yi.cloneDeep)(this.condition.queryConditionParameters)??[],this.dataType=r.dataTypeID,this.dataTypeCategory=this.queryStore.GetDataTypeCategory(this.dataType),this.operator=i.currentModel.operators[this.dataTypeCategory].find(u=>u.operatorType===this.condition.operatorID);for(let u=0;u<this.conditionParameters.length;u++)this.dataTypeCategory===ee.DATE&&this.conditionParameters[u].value&&(this.conditionParameters[u].value=new Date(this.conditionParameters[u].value).toLocaleDateString()),this.isLookupField&&this.conditionParameters[u].value&&(this.conditionParameters[u].value=[...this.conditionParameters[u].value?.split(",")]);this.loadingLookupValues=this.isLookupField&&i.loadingLookUpTypeOptions[r.fieldLookupTypeID]===!0}})}onValueChanged(i,n){let r=i.target.value;this.queryStore.setConditionParameterValues(this.conditionID,n,r)}
16onDateValueChanged(i,n){this.queryStore.setConditionParameterValues(this.conditionID,n,this.toLocalDateTimeString(i))}toLocalDateTimeString(i){let n=String(i.getHours()).padStart(2,"0"),r=String(i.getMinutes()).padStart(2,"0"),u=String(i.getSeconds()).padStart(2,"0");return`${Jt(i)} ${n}:${r}:${u}`}onLookupValueChanged(i,n){i.originalEvent.stopPropagation();let r=i.value.join(",");this.queryStore.setConditionParameterValues(this.conditionID,n,r)}getSelectionLimit(){if(!(this.operator.operatorType===$.IN_LIST||this.operator.operatorType===$.NOT_IN_LIST))return 1}ngOnDestroy(){this.unsubscribe$.next(null),this.unsubscribe$.complete()}};c.\u0275fac=function(n){return new(n||c)(M(re),M(te),M(z))},c.\u0275cmp=H({type:c,selectors:[["app-condition-value-editor"]],inputs:{_conditionID:[0,"conditionID","_conditionID"]},standalone:!1,decls:1,vars:1,consts:[[1,"row","no-gutters","nowrap"],[1,"col"],["type","text",1,"full-width",3,"change","value"],[1,"full-width",3,"ngModelChange","onSelect","ngModel"],["selectedItemsLabel","({0} items selected)","appendTo","body",1,"full-width",3,"ngModelChange","onChange","options","maxSelectedLabels","selectionLimit","ngModel"]],template:function(n,r){n&1&&C(0,yn,6,0),n&2&&g((r.conditionParameters==null?null:r.conditionParameters.length)>0?0:-1)},dependencies:[ge,fe,rt,st,at],encapsulation:2});let o=c;return o})();function gn(o,c){if(o&1&&(e(0,` 17 `),l(1,"option",10),e(2),s(),e(3,` 18 `)),o&2){let t=c.$implicit;a(),f("value",t.clubID),a(),O(` 19 `,t.name,` 20 `)}}function fn(o,c){if(o&1){let t=S();e(0,` 21 `),l(1,"div",7),e(2,` 22 `),l(3,"div",8),e(4,` 23 `),l(5,"label"),e(6),s(),e(7,` 24 `),l(8,"select",9),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.clubID,n)||(r.filters.clubID=n),h(n)}),v("change",function(){y(t);let n=d(2);return n.filterPrograms(),h(n.updateRegistrations())}),e(9,` 25 `),k(10,gn,4,2,null,null,B),s(),e(12,` 26 `),s(),e(13,` 27 `),s(),e(14,` 28 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.CLUB].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.CLUB].label),a(2),I("ngModel",t.filters.clubID),a(2),U(t.reportService.clubs)}}function xn(o,c){if(o&1){let t=S();e(0,` 29 `),l(1,"div",7),e(2,` 30 `),l(3,"div",8),e(4,` 31 `),l(5,"label"),e(6),s(),e(7,` 32 `),l(8,"p-multiSelect",11),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.clubs,n)||(r.filters.clubs=n),h(n)}),v("onChange",function(){y(t);let n=d(2);return n.filterPrograms(),n.updateRegistrations(),h(n.refreshRegistrationOptionsForClubChange())}),s(),e(9,` 33 `),s(),e(10,` 34 `),s(),e(11,` 35 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.CLUB_MULTISELECT].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.CLUB_MULTISELECT].label),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.clubs),f("options",t.reportService.clubs)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("selectedItemsLabel","{0} clubs selected")}}function Sn(o,c){if(o&1){let t=S();e(0,` 36 `),l(1,"div",12),e(2,` 37 `),l(3,"div",8),e(4,` 38 `),l(5,"label"),e(6),s(),e(7,` 39 `),l(8,"p-select",13),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.programTypeID,n)||(r.filters.programTypeID=n),h(n)}),v("onChange",function(){y(t);let n=d(2);return h(n.filterPrograms())}),s(),e(9,` 40 `),s(),e(10,` 41 `),s(),e(11,` 42 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM_TYPE].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM_TYPE].label),a(2),I("ngModel",t.filters.programTypeID),f("options",t.programTypes)}}function Tn(o,c){if(o&1){let t=S();e(0,` 43 `),l(1,"p-multiSelect",14),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.programTypes,n)||(r.filters.programTypes=n),h(n)}),v("onChange",function(){y(t);let n=d(3);return n.filterPrograms(),h(n.updateRegistrations())}),s(),e(2,` 44 `)}if(o&2){let t=d(3);a(),f("autofocusFilter",!0),I("ngModel",t.filters.programTypes),f("options",t.programTypes)("showToggleAll",!0)("filter",!0)("maxSelectedLabels",1)("selectedItemsLabel","{0} program types selected")}}function vn(o,c){if(o&1&&(e(0,` 45 `),l(1,"div",7),e(2,` 46 `),l(3,"div",8),e(4,` 47 `),l(5,"label"),e(6),s(),e(7,` 48 `),C(8,Tn,3,7),s(),e(9,` 49 `),s(),e(10,` 50 `)),o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM_TYPE_MULTISELECT].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM_TYPE_MULTISELECT].label),a(2),g(t.programTypes?8:-1)}}function Fn(o,c){if(o&1&&(e(0,` 51 `),l(1,"option",10),e(2),s(),e(3,` 52 `)),o&2){let t=c.$implicit;a(),f("value",t.programID),a(),O(` 53 `,t.name,` 54 `)}}
54function En(o,c){if(o&1){let t=S();e(0,` 55 `),l(1,"div",7),e(2,` 56 `),l(3,"div",8),e(4,` 57 `),l(5,"label"),e(6),s(),e(7,` 58 `),l(8,"select",9),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.programID,n)||(r.filters.programID=n),h(n)}),v("change",function(){y(t);let n=d(2);return h(n.updateRegistrations())}),e(9,` 59 `),k(10,Fn,4,2,null,null,B),s(),e(12,` 60 `),s(),e(13,` 61 `),s(),e(14,` 62 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM].label),a(2),I("ngModel",t.filters.programID),a(2),U(t.programs)}}function bn(o,c){if(o&1){let t=S();e(0,` 63 `),l(1,"p-multiSelect",15),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.programs,n)||(r.filters.programs=n),h(n)}),v("onChange",function(){y(t);let n=d(3);return n.updateRegistrations(),h(n.syncAlsoInProgramOptions())}),s(),e(2,` 64 `)}if(o&2){let t=d(3);a(),f("autofocusFilter",!0),I("ngModel",t.filters.programs),f("options",t.programs)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.programs?"All":"Select club(s)")("selectedItemsLabel","{0} programs selected")}}function In(o,c){if(o&1&&(e(0,` 65 `),l(1,"div",7),e(2,` 66 `),l(3,"div",8),e(4,` 67 `),l(5,"label"),e(6),s(),e(7,` 68 `),C(8,bn,3,8),s(),e(9,` 69 `),s(),e(10,` 70 `)),o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM_MULTISELECT].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM_MULTISELECT].label),a(2),g(t.programs?8:-1)}}function wn(o,c){if(o&1){let t=S();e(0,` 71 `),l(1,"div",12),e(2,` 72 `),l(3,"div",8),e(4,` 73 `),l(5,"label"),e(6),s(),e(7,` 74 `),l(8,"p-multiSelect",16),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.registrations,n)||(r.filters.registrations=n),h(n)}),s(),e(9,` 75 `),s(),e(10,` 76 `),s(),e(11,` 77 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.REGISTRATION].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.REGISTRATION].label),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.registrations),f("options",t.registrations)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.filters.programs?"All":"Select program(s)")("selectedItemsLabel","{0} registration(s) selected")}}function Rn(o,c){if(o&1){let t=S();e(0,` 78 `),l(1,"div",12),e(2,` 79 `),l(3,"div",8),e(4,` 80 `),l(5,"label"),e(6),s(),e(7,` 81 `),l(8,"p-multiSelect",17),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.seasons,n)||(r.filters.seasons=n),h(n)}),s(),e(9,` 82 `),s(),e(10,` 83 `),s(),e(11,` 84 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.SEASON].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.SEASON].label),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.seasons),f("options",t.seasons)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("selectedItemsLabel","{0} seasons selected")}}function Dn(o,c){if(o&1){let t=S();e(0,` 85 `),l(1,"div",12),e(2,` 86 `),l(3,"div",8),e(4,` 87 `),l(5,"label"),e(6),s(),e(7,` 88 `),l(8,"p-multiSelect",18),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.teams,n)||(r.filters.teams=n),h(n)}),s(),e(9,` 89 `),s(),e(10,` 90 `),s(),e(11,` 91 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.TEAM].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.TEAM].label),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.teams),f("options",t.teams)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("selectedItemsLabel","{0} team(s) selected")}}
91function Ln(o,c){if(o&1){let t=S();e(0,` 92 `),l(1,"div",19),e(2,` 93 `),l(3,"div",8),e(4,` 94 `),l(5,"label"),e(6),s(),e(7,` 95 `),l(8,"input",20),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.playerName,n)||(r.filters.playerName=n),h(n)}),s(),e(9,` 96 `),s(),e(10,` 97 `),s(),e(11,` 98 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.LAST_NAME].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.LAST_NAME].label),a(2),I("ngModel",t.filters.playerName)}}function On(o,c){if(o&1){let t=S();e(0,` 99 `),l(1,"p-inputgroup"),e(2,` 100 `),l(3,"p-datepicker",26,0),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.dobFrom,n)||(r.filters.dobFrom=n),h(n)}),s(),e(5,` 101 `),l(6,"p-inputgroup-addon"),e(7,"to"),s(),e(8,` 102 `),l(9,"p-datepicker",27),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.dobTo,n)||(r.filters.dobTo=n),h(n)}),v("onSelect",function(){y(t);let n=d(3);return h(n.filters.dobTo=n.setToDateToEOY(n.filters.dobTo))}),s(),e(10,` 103 `),s(),e(11,` 104 `)}if(o&2){let t=de(4),i=d(3);a(3),I("ngModel",i.filters.dobFrom),f("defaultDate",i.minBirthYear)("minDate",i.minBirthYear)("maxDate",i.maxBirthYear),a(6),I("ngModel",i.filters.dobTo),f("defaultDate",i.minBirthYear)("minDate",t.value?t.value:i.minBirthYear)("maxDate",i.maxBirthYear)}}function Qn(o,c){if(o&1){let t=S();e(0,` 105 `),l(1,"p-inputgroup"),e(2,` 106 `),l(3,"p-datepicker",28),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.dobFrom,n)||(r.filters.dobFrom=n),h(n)}),s(),e(4,` 107 `),l(5,"p-inputgroup-addon"),e(6,"to"),s(),e(7,` 108 `),l(8,"p-datepicker",29),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.dobTo,n)||(r.filters.dobTo=n),h(n)}),s(),e(9,` 109 `),s(),e(10,` 110 `)}if(o&2){let t=d(3);a(3),I("ngModel",t.filters.dobFrom),a(5),I("ngModel",t.filters.dobTo)}}function Mn(o,c){if(o&1){let t=S();e(0,` 111 `),l(1,"div",21),e(2,` 112 `),l(3,"div",22),e(4,` 113 `),l(5,"label"),e(6),s(),e(7,` 114 `),l(8,"p-select",23),v("onChange",function(){y(t);let n=d(2);return n.filters.dobFrom=void 0,h(n.filters.dobTo=void 0)}),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.dobType,n)||(r.filters.dobType=n),h(n)}),s(),e(9,` 115 `),s(),e(10,` 116 `),l(11,"div",24),e(12,` 117 `),C(13,On,12,8)(14,Qn,11,2),l(15,"a",25),v("click",function(){y(t);let n=d(2);return n.filters.dobFrom=void 0,h(n.filters.dobTo=void 0)}),e(16,` 118 `),b(17,"i",6),e(18,` 119 `),s(),e(19,` 120 `),s(),e(20,` 121 `),s(),e(21,` 122 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.BIRTH_DATE_FROM].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.BIRTH_DATE_FROM].label),a(2),f("options",t.yearTypes),I("ngModel",t.filters.dobType),a(5),g(t.filters.dobType===1?13:14)}}function An(o,c){if(o&1){let t=S();e(0,` 123 `),l(1,"div",21),e(2,` 124 `),l(3,"div",22),e(4,` 125 `),l(5,"label"),e(6),s(),e(7,` 126 `),l(8,"div",30),e(9,` 127 `),l(10,"p-inputgroup"),e(11,` 128 `),l(12,"p-datepicker",31,1),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.graduationYearFrom,n)||(r.filters.graduationYearFrom=n),h(n)}),s(),e(14,` 129 `),l(15,"p-inputgroup-addon"),e(16,"to"),s(),e(17,` 130 `),l(18,"p-datepicker",31),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.graduationYearTo,n)||(r.filters.graduationYearTo=n),h(n)}),s(),e(19,` 131 `),s(),e(20,` 132 `),l(21,"a",25),v("click",function(){y(t);let n=d(2);return n.filters.graduationYearFrom=void 0,h(n.filters.graduationYearTo=void 0)}),e(22,` 133 `),b(23,"i",6),e(24,` 134 `),s(),e(25,` 135 `),s(),e(26,` 136 `),s(),e(27,` 137 `),s(),e(28,` 138 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.GRADUATION_YEAR_FROM].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.GRADUATION_YEAR_FROM].label),a(6),I("ngModel",t.filters.graduationYearFrom),a(6),I("ngModel",t.filters.graduationYearTo)}}function Vn(o,c){if(o&1){let t=S();e(0,` 139 `),l(1,"div",7),e(2,` 140 `),l(3,"div",8),e(4,` 141 `),l(5,"label"),e(6),s(),e(7,` 142 `),l(8,"p-multiSelect",32),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.grades,n)||(r.filters.grades=n),h(n)}),s(),e(9,` 143 `),s(),e(10,` 144 `),s(),e(11,` 145 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.GRADE_MULTISELECT].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.GRADE_MULTISELECT].label),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.grades),f("options",t.grades)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("selectedItemsLabel","{0} grades selected")}}function Pn(o,c){if(o&1){let t=S();e(0,` 146 `),l(1,"div",7),e(2,` 147 `),l(3,"div",8),e(4,` 148 `),l(5,"label"),e(6),s(),e(7,` 149 `),l(8,"p-multiSelect",32),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.ageClasses,n)||(r.filters.ageClasses=n),h(n)}),s(),e(9,` 150 `),s(),e(10,` 151 `),s(),e(11,` 152 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.AGE_CLASS_MULTISELECT].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.AGE_CLASS_MULTISELECT].label),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.ageClasses),f("options",t.ageClasses)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("selectedItemsLabel","{0} selected")}}function Nn(o,c){if(o&1){let t=S();e(0,` 153 `),l(1,"div",33),e(2,` 154 `),l(3,"div",8),e(4,` 155 `),l(5,"label"),e(6),s(),e(7,` 156 `),l(8,"select",34),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.genderID,n)||(r.filters.genderID=n),h(n)}),e(9,` 157 `),l(10,"option",35),e(11,"All"),s(),e(12,` 158 `),l(13,"option",36),e(14,"Female"),s(),e(15,` 159 `),l(16,"option",37),e(17,"Male"),s(),e(18,` 160 `),l(19,"option",38),e(20,"Other"),s(),e(21,` 161 `),s(),e(22,` 162 `),s(),e(23,` 163 `),s(),e(24,` 164 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.GENDER].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.GENDER].label),a(2),I("ngModel",t.filters.genderID)}}function qn(o,c){if(o&1){let t=S();e(0,` 165 `),l(1,"div",19),e(2,` 166 `),l(3,"div",8),e(4,` 167 `),l(5,"label"),e(6),s(),e(7,` 168 `),l(8,"p-multiSelect",39),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.statuses,n)||(r.filters.statuses=n),h(n)}),s(),e(9,` 169 `),s(),e(10,` 170 `),s(),e(11,` 171 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.STATUS].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.STATUS].label),a(2),I("ngModel",t.filters.statuses),f("options",t.inviteStatuses)("filter",!1)("showToggleAll",!0)("maxSelectedLabels",1)("selectedItemsLabel","{0} status selected")}}function kn(o,c){if(o&1){let t=S();e(0,` 172 `),l(1,"div",40),e(2,` 173 `),l(3,"div",8),e(4,` 174 `),l(5,"label"),e(6),s(),e(7,` 175 `),l(8,"select",34),R("ngModelChange",function(n){y(t);let r=d(2);
175return w(r.filters.notAssignedPlayerOption,n)||(r.filters.notAssignedPlayerOption=n),h(n)}),e(9,` 176 `),l(10,"option",37),e(11,"Exclude"),s(),e(12,` 177 `),l(13,"option",36),e(14,"Include"),s(),e(15,` 178 `),l(16,"option",38),e(17,"Only"),s(),e(18,` 179 `),s(),e(19,` 180 `),s(),e(20,` 181 `),s(),e(21,` 182 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.NOT_ASSIGNED_PLAYERS].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.NOT_ASSIGNED_PLAYERS].label),a(2),I("ngModel",t.filters.notAssignedPlayerOption)}}function Un(o,c){if(o&1){let t=S();e(0,` 183 `),l(1,"div",40),e(2,` 184 `),l(3,"div",8),e(4,` 185 `),l(5,"label"),e(6),s(),e(7,` 186 `),l(8,"p-multiSelect",41),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.donations,n)||(r.filters.donations=n),h(n)}),s(),e(9,` 187 `),s(),e(10,` 188 `),s(),e(11,` 189 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.DONATION_OPTION].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.DONATION_OPTION].label),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.donations),f("options",t.filteredDonations)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.filteredDonations?"All":"Select option(s)")("selectedItemsLabel","{0} donation options selected")}}function Gn(o,c){if(o&1){let t=S();e(0,` 190 `),l(1,"div",40),e(2,` 191 `),l(3,"div",8),e(4,` 192 `),l(5,"label"),e(6),s(),e(7,` 193 `),l(8,"p-multiSelect",41),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.volunteerOptions,n)||(r.filters.volunteerOptions=n),h(n)}),s(),e(9,` 194 `),s(),e(10,` 195 `),s(),e(11,` 196 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.VOLUNTEER_OPTION].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.VOLUNTEER_OPTION].label),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.volunteerOptions),f("options",t.filteredVolunteerOptions)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.filteredVolunteerOptions?"All":"Select option(s)")("selectedItemsLabel","{0} volunteer options selected")}}function Wn(o,c){if(o&1){let t=S();e(0,` 197 `),l(1,"div",7),e(2,` 198 `),l(3,"div",8),e(4,` 199 `),l(5,"label"),e(6),s(),e(7,` 200 `),l(8,"input",42),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.creditName,n)||(r.filters.creditName=n),h(n)}),s(),e(9,` 201 `),s(),e(10,` 202 `),s(),e(11,` 203 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.CREDIT_DISCOUNT_NAME].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.CREDIT_DISCOUNT_NAME].label),a(2),I("ngModel",t.filters.creditName)}}function Bn(o,c){if(o&1){let t=S();e(0,` 204 `),l(1,"p-inputgroup-addon"),e(2,"to"),s(),e(3,` 205 `),l(4,"p-datepicker",45),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.dateTo,n)||(r.filters.dateTo=n),h(n)}),s(),e(5,` 206 `)}if(o&2){let t=d(3);a(4),I("ngModel",t.filters.dateTo)}}function Yn(o,c){if(o&1){let t=S();e(0,` 207 `),l(1,"a",25),v("click",function(){y(t);let n=d(3);return n.filters.dateFrom=n.reportService.defaultDate,h(n.filters.dateTo=void 0)}),e(2,` 208 `),b(3,"i",6),e(4,` 209 `),s(),e(5,` 210 `)}}function jn(o,c){if(o&1){let t=S();e(0,` 211 `),l(1,"div",21),e(2,` 212 `),l(3,"div",8),e(4,` 213 `),l(5,"label"),e(6),s(),e(7,` 214 `),l(8,"div",43),e(9,` 215 `),l(10,"p-inputgroup"),e(11,` 216 `),l(12,"p-datepicker",44),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.dateFrom,n)||(r.filters.dateFrom=n),h(n)}),s(),e(13,` 217 `),C(14,Bn,6,1),s(),e(15,` 218 `),C(16,Yn,6,0),s(),e(17,` 219 `),s(),e(18,` 220 `),s(),e(19,` 221 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.DATE_FROM].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.DATE_FROM].label),a(6),I("ngModel",t.filters.dateFrom),a(2),g(t.showFilterFlags[t.CustomReportFilterTypes.DATE_TO].visible?14:-1),a(2),g(t.showFilterFlags[t.CustomReportFilterTypes.DATE_TO].visible?16:-1)}}function zn(o,c){if(o&1){let t=S();e(0,` 222 `),l(1,"p-inputgroup-addon"),e(2,"to"),s(),e(3,` 223 `),l(4,"p-datepicker",45),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.dateTo2,n)||(r.filters.dateTo2=n),h(n)}),s(),e(5,` 224 `)}if(o&2){let t=d(3);a(4),I("ngModel",t.filters.dateTo2)}}function Hn(o,c){if(o&1){let t=S();e(0,` 225 `),l(1,"a",25),v("click",function(){y(t);let n=d(3);return n.filters.dateFrom2=n.getExpirationDateFromFilterDefault(),h(n.filters.dateTo2=void 0)}),e(2,` 226 `),b(3,"i",6),e(4,` 227 `),s(),e(5,` 228 `)}}function Xn(o,c){if(o&1){let t=S();e(0,` 229 `),l(1,"div",21),e(2,` 230 `),l(3,"div",8),e(4,` 231 `),l(5,"label"),e(6),s(),e(7,` 232 `),l(8,"div",43),e(9,` 233 `),l(10,"p-inputgroup"),e(11,` 234 `),l(12,"p-datepicker",44),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.dateFrom2,n)||(r.filters.dateFrom2=n),h(n)}),s(),e(13,` 235 `),C(14,zn,6,1),s(),e(15,` 236 `),C(16,Hn,6,0),s(),e(17,` 237 `),s(),e(18,` 238 `),s(),e(19,` 239 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.EXPIRATION_DATE_FROM].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.EXPIRATION_DATE_FROM].label),a(6),I("ngModel",t.filters.dateFrom2),a(2),g(t.showFilterFlags[t.CustomReportFilterTypes.EXPIRATION_DATE_TO].visible?14:-1),a(2),g(t.showFilterFlags[t.CustomReportFilterTypes.EXPIRATION_DATE_TO].visible?16:-1)}}function Kn(o,c){if(o&1){let t=S();e(0,` 240 `),l(1,"div",46),e(2,` 241 `),l(3,"div",8),e(4,` 242 `),l(5,"label"),e(6),s(),e(7,` 243 `),l(8,"select",34),R("ngModelChange",function(n){y(t);let r=d(2);
243return w(r.filters.invitationOption,n)||(r.filters.invitationOption=n),h(n)}),e(9,` 244 `),l(10,"option",37),e(11,"Exclude"),s(),e(12,` 245 `),l(13,"option",36),e(14,"Include"),s(),e(15,` 246 `),l(16,"option",38),e(17,"Only"),s(),e(18,` 247 `),s(),e(19,` 248 `),s(),e(20,` 249 `),s(),e(21,` 250 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.EXPIRED_INVITATIONS].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.EXPIRED_INVITATIONS].label),a(2),I("ngModel",t.filters.invitationOption)}}function $n(o,c){if(o&1){let t=S();e(0,` 251 `),l(1,"p-multiSelect",16),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.notInPrograms,n)||(r.filters.notInPrograms=n),h(n)}),s(),e(2,` 252 `)}if(o&2){let t=d(3);a(),f("autofocusFilter",!0),I("ngModel",t.filters.notInPrograms),f("options",t.programMembershipOptions)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.programMembershipOptions?"None":"Select program(s)")("selectedItemsLabel","{0} program(s) selected")}}function Jn(o,c){if(o&1&&(e(0,` 253 `),l(1,"div",7),e(2,` 254 `),l(3,"div",8),e(4,` 255 `),l(5,"label"),e(6),s(),e(7,` 256 `),C(8,$n,3,8),s(),e(9,` 257 `),s(),e(10,` 258 `)),o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.NOT_IN_PROGRAM].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.NOT_IN_PROGRAM].label),a(2),g(t.programMembershipOptions?8:-1)}}function Zn(o,c){if(o&1){let t=S();e(0,` 259 `),l(1,"p-multiSelect",16),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.alsoInPrograms,n)||(r.filters.alsoInPrograms=n),h(n)}),s(),e(2,` 260 `)}if(o&2){let t=d(3);a(),f("autofocusFilter",!0),I("ngModel",t.filters.alsoInPrograms),f("options",t.alsoInProgramOptions)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.alsoInProgramOptions?"None":"Select program(s)")("selectedItemsLabel","{0} program(s) selected")}}function er(o,c){if(o&1&&(e(0,` 261 `),l(1,"div",7),e(2,` 262 `),l(3,"div",8),e(4,` 263 `),l(5,"label"),e(6),s(),e(7,` 264 `),C(8,Zn,3,8),s(),e(9,` 265 `),s(),e(10,` 266 `)),o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.ALSO_IN_PROGRAM].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.ALSO_IN_PROGRAM].label),a(2),g(t.alsoInProgramOptions?8:-1)}}function tr(o,c){if(o&1){let t=S();e(0,` 267 `),l(1,"p-multiSelect",47),R("ngModelChange",function(n){y(t);let r=d(3);return w(r.filters.playerPools,n)||(r.filters.playerPools=n),h(n)}),s(),e(2,` 268 `)}if(o&2){let t=d(3);a(),f("autofocusFilter",!0)("disabled",!t.user[t.Permission.PlayerPools]||!t.user[t.Permission.TryoutSettings]),I("ngModel",t.filters.playerPools),f("options",t.playerPools)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder","Select player pool(s)")("selectedItemsLabel","{0} player pool(s) selected")}}function ir(o,c){if(o&1&&(e(0,` 269 `),l(1,"div",7),e(2,` 270 `),l(3,"div",8),e(4,` 271 `),l(5,"label"),e(6),s(),e(7,` 272 `),C(8,tr,3,9),s(),e(9,` 273 `),s(),e(10,` 274 `)),o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.PLAYER_POOL].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.PLAYER_POOL].label),a(2),g(t.programMembershipOptions?8:-1)}}function nr(o,c){if(o&1){let t=S();e(0,` 275 `),l(1,"div",48),e(2,` 276 `),l(3,"div",8),e(4,` 277 `),l(5,"label"),e(6),s(),e(7,` 278 `),l(8,"p-multiSelect",49),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.credentialingTemplates,n)||(r.filters.credentialingTemplates=n),h(n)}),v("onChange",function(){y(t);let n=d(2);return h(n.filterWaivers())}),s(),e(9,` 279 `),s(),e(10,` 280 `),s(),e(11,` 281 `)}if(o&2){let t=d(2);a(6),O(` 282 `,t.showFilterFlags[t.CustomReportFilterTypes.STAFF_CREDENTIALING_TEMPLATE].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.STAFF_CREDENTIALING_TEMPLATE].label,` 283 `),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.credentialingTemplates),f("options",t.credentialingTemplates)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.credentialingTemplates?"All":"Select option(s)")("selectedItemsLabel","{0} items selected")}}function rr(o,c){if(o&1){let t=S();e(0,` 284 `),l(1,"div",48),e(2,` 285 `),l(3,"div",8),e(4,` 286 `),l(5,"label"),e(6),s(),e(7,` 287 `),l(8,"p-multiSelect",50),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.pledgesWaivers,n)||(r.filters.pledgesWaivers=n),h(n)}),s(),e(9,` 288 `),s(),e(10,` 289 `),s(),e(11,` 290 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.PLEDGES_WAIVERS].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.PLEDGES_WAIVERS].label),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.pledgesWaivers),f("options",t.f
290ilteredPledgesWaivers)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.filteredPledgesWaivers?"All":"Select option(s)")("selectedItemsLabel","{0} items selected")}}function or(o,c){if(o&1){let t=S();e(0,` 291 `),l(1,"div",48),e(2,` 292 `),l(3,"div",8),e(4,` 293 `),l(5,"label"),e(6),s(),e(7,` 294 `),l(8,"p-multiSelect",50),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.roles,n)||(r.filters.roles=n),h(n)}),s(),e(9,` 295 `),s(),e(10,` 296 `),s(),e(11,` 297 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.ROLES].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.ROLES].label),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.roles),f("options",t.roles)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.roles?"All":"Select option(s)")("selectedItemsLabel","{0} items selected")}}function lr(o,c){if(o&1){let t=S();e(0,` 298 `),l(1,"div",46),e(2,` 299 `),l(3,"div",8),e(4,` 300 `),l(5,"label"),e(6),s(),e(7,` 301 `),l(8,"select",34),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.testUserOption,n)||(r.filters.testUserOption=n),h(n)}),e(9,` 302 `),l(10,"option",37),e(11,"Exclude"),s(),e(12,` 303 `),l(13,"option",36),e(14,"Include"),s(),e(15,` 304 `),l(16,"option",38),e(17,"Only"),s(),e(18,` 305 `),s(),e(19,` 306 `),s(),e(20,` 307 `),s(),e(21,` 308 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.TEST_PLAYERS].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.TEST_PLAYERS].label),a(2),I("ngModel",t.filters.testUserOption)}}function sr(o,c){if(o&1){let t=S();e(0,` 309 `),l(1,"div",46),e(2,` 310 `),l(3,"div",8),e(4,` 311 `),l(5,"label"),e(6),s(),e(7,` 312 `),l(8,"p-inputgroup"),e(9,` 313 `),l(10,"p-datepicker",51),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.asOfDate,n)||(r.filters.asOfDate=n),h(n)}),s(),e(11,` 314 `),l(12,"p-inputgroup-addon"),e(13,` 315 `),l(14,"a",25),v("click",function(){y(t);let n=d(2);return h(n.filters.asOfDate=void 0)}),e(15,` 316 `),b(16,"i",6),e(17,` 317 `),s(),e(18,` 318 `),s(),e(19,` 319 `),s(),e(20,` 320 `),s(),e(21,` 321 `),s(),e(22,` 322 `)}if(o&2){let t=d(2);a(6),L(t.showFilterFlags[t.CustomReportFilterTypes.AS_OF_DATE].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.AS_OF_DATE].label),a(4),I("ngModel",t.filters.asOfDate)}}function ar(o,c){if(o&1){let t=S();e(0,` 323 `),l(1,"div",7),e(2,` 324 `),l(3,"div",8),e(4,` 325 `),l(5,"label"),e(6),s(),e(7,` 326 `),l(8,"p-checkbox",52),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.includeCancelledRegistrations,n)||(r.filters.includeCancelledRegistrations=n),h(n)}),s(),e(9,` 327 `),s(),e(10,` 328 `),s(),e(11,` 329 `)}if(o&2){let t=d(2);a(6),O(` 330 `,t.showFilterFlags[t.CustomReportFilterTypes.INCLUDE_CANCELLED_REGISTRATIONS].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.INCLUDE_CANCELLED_REGISTRATIONS].label,` 331 `),a(2),f("binary",!0),I("ngModel",t.filters.includeCancelledRegistrations)}}function ur(o,c){if(o&1){let t=S();e(0,` 332 `),l(1,"div",48),e(2,` 333 `),l(3,"div",8),e(4,` 334 `),l(5,"label"),e(6),s(),e(7,` 335 `),l(8,"p-multiSelect",53),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.registrationOptions,n)||(r.filters.registrationOptions=n),h(n)}),v("onChange",function(){y(t);let n=d(2);return h(n.updateRegistrationOptionValues())}),s(),e(9,` 336 `),s(),e(10,` 337 `),s(),e(11,` 338 `)}if(o&2){let t=d(2);a(6),O(` 339 `,t.showFilterFlags[t.CustomReportFilterTypes.CHECKOUT_OPTION_MULTISELECT].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.CHECKOUT_OPTION_MULTISELECT].label,` 340 `),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.registrationOptions),f("options",t.registrationOptions)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.programs?"All":"Select option(s)")("selectedItemsLabel","{0} checkout options selected")}}function pr(o,c){if(o&1){let t=S();e(0,` 341 `),l(1,"div",48),e(2,` 342 `),l(3,"div",8),e(4,` 343 `),l(5,"label"),e(6),s(),e(7,` 344 `),l(8,"p-multiSelect",50),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.registrationOptionValues,n)||(r.filters.registrationOptionValues=n),h(n)}),s(),e(9,` 345 `),s(),e(10,` 346 `),s(),e(11,` 347 `)}if(o&2){let t=d(2);a(6),O(` 348 `,t.showFilterFlags[t.CustomReportFilterTypes.CHECKOUT_OPTION_RESPONSE_MULTISELECT].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.CHECKOUT_OPTION_RESPONSE_MULTISELECT].label,` 349 `),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.registrationOptionValues),f("options",t.registrationOptionValues)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.registrationOptions?"All":"Select checkout option(s)")("selectedItemsLabel","{0} responses selected")}}function dr(o,c){if(o&1){let t=S();e(0,` 350 `),l(1,"div",48),e(2,` 351 `),l(3,"div",8),e(4,` 352 `),l(5,"label"),e(6),s(),e(7,` 353 `),l(8,"p-multiSelect",53),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.registrationQuestions,n)||(r.filters.registrationQuestions=n),h(n)}),v("onChange",function(){y(t);let n=d(2);return h(n.updateRegistrationQuestionOptions())}),s(),e(9,` 354 `),s(),e(10,` 355 `),s(),e(11,` 356 `)}if(o&2){let t=d(2);a(6),O(` 357 `,t.showFilterFlags[t.CustomReportFilterTypes.REGISTRATION_QUESTION_MULTISELECT].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.REGISTRATION_QUESTION_MULTISELECT].label,` 358 `),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.registrationQuestions),f("options",t.registrationQuestions)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.programs?"All":"Select question(s)")("selectedItemsLabel","{0} registration questions selected")}}function cr(o,c){if(o&1){let t=S();e(0,` 359 `),l(1,"div",48),e(2,` 360 `),l(3,"div",8),e(4,` 361 `),l(5,"label"),e(6),s(),e(7,` 362 `),l(8,"p-multiSelect",50),R("ngModelChange",function(n){y(t);let r=d(2);return w(r.filters.registrationQuestionResponses,n)||(r.filters.registrationQuestionResponses=n),h(n)}),s(),e(9,` 363 `),s(),e(10,` 364 `),s(),e(11,` 365 `)}if(o&2){let t=d(2);a(6),O(` 366 `,t.showFilterFlags[t.CustomReportFilterTypes.REGISTRATION_QUESTION_RESPONSE_MULTISELECT].overrideLabel??t.showFilterFlags[t.CustomReportFilterTypes.REGISTRATION_QUESTION_RESPONSE_MULTISELECT].label,` 367 `),a(2),f("autofocusFilter",!0),I("ngModel",t.filters.registrationQuestionResponses),f("options",t.registrationQuestionResponses)("filter",!0)("showToggleAll",!0)("maxSelectedLabels",1)("placeholder",t.registrationQuestions?"All":"Select registration question(s)")("selectedItemsLabel","{0} responses selected")}}function mr(o,c){if(o&1){let t=S();e(0,` 368 `),l(1,"div",2),e(2,` 369 `),l(3,"div",3),e(4,` 370 `),C(5,fn,15,2),C(6,xn,12,8),C(7,Sn,12,3),C(8,vn,11,2),C(9,En,15,2),C(10,In,11,2),C(11,wn,12,9),C(12,Rn,12,8),C(13,Dn,12,8),C(14,Ln,12,2),C(15,Mn,22,4),C(16,An,29,3),C(17,Vn,12,8),C(18,Pn,12,8),C(19,Nn,25,2),C(20,qn,12,7),C(21,kn,22,2),C(22,Un,12,9),C(23,Gn,12,9),C(24,Wn,12,2),C(25,jn,20,4),C(26,Xn,20,4),C(27,Kn,22,2),C(28,Jn,11,2),C(29,er,11,2),C(30,ir,11,2),C(31,nr,12,9),C(32,rr,12,9),C(33,or,12,9),C(34,lr,22,2),C(35,sr,23,2),C(36,ar,12,3),C(37,ur,12,9),C(38,pr,12,9),C(39,dr,12,9),C(40,cr,12,9),s(),e(41,` 371 `),l(42,"div",4),e(43,` 372 `),l(44,"button",5),v("click",function(){y(t);let n=d();return h(n.setFilterFlags(!0))}),e(45,` 373 `),b(46,"i",6),e(47,` 374 Reset 375 `),s(),e(48,` 376 `),s(),e(49,` 377 `),s(),e(50,` 378`)}if(o&2){let t=d();
378a(5),g(t.showFilterFlags[t.CustomReportFilterTypes.CLUB].visible&&t.reportService.clubs&&t.reportService.clubs.length>1?5:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.CLUB_MULTISELECT].visible&&t.reportService.clubs&&t.reportService.clubs.length>1?6:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM_TYPE].visible?7:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM_TYPE_MULTISELECT].visible?8:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM].visible?9:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.PROGRAM_MULTISELECT].visible?10:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.REGISTRATION].visible?11:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.SEASON].visible?12:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.TEAM].visible?13:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.LAST_NAME].visible?14:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.BIRTH_DATE_FROM].visible?15:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.GRADUATION_YEAR_FROM].visible?16:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.GRADE_MULTISELECT].visible?17:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.AGE_CLASS_MULTISELECT].visible?18:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.GENDER].visible?19:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.STATUS].visible?20:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.NOT_ASSIGNED_PLAYERS].visible?21:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.DONATION_OPTION].visible?22:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.VOLUNTEER_OPTION].visible?23:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.CREDIT_DISCOUNT_NAME].visible?24:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.DATE_FROM].visible?25:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.EXPIRATION_DATE_FROM].visible?26:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.EXPIRED_INVITATIONS].visible?27:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.NOT_IN_PROGRAM].visible?28:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.ALSO_IN_PROGRAM].visible?29:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.PLAYER_POOL].visible?30:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.STAFF_CREDENTIALING_TEMPLATE].visible?31:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.PLEDGES_WAIVERS].visible?32:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.ROLES].visible?33:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.TEST_PLAYERS].visible?34:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.AS_OF_DATE].visible?35:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.INCLUDE_CANCELLED_REGISTRATIONS].visible?36:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.CHECKOUT_OPTION_MULTISELECT].visible?37:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.CHECKOUT_OPTION_RESPONSE_MULTISELECT].visible?38:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.REGISTRATION_QUESTION_MULTISELECT].visible?39:-1),a(),g(t.showFilterFlags[t.CustomReportFilterTypes.REGISTRATION_QUESTION_RESPONSE_MULTISELECT].visible?40:-1)}}var zi=(()=>{let c=class c{constructor(i,n,r,u,m,x){this.reportService=i,this.customReportService=n,this.registrationService=r,this.authorize=u,this.siteDataService=m,this.queryStore=x,this.minBirthYear=Xt,this.maxBirthYear=Kt,this.CustomReportFilterTypes=p,this.unsubscribe$=new Y,this.showFilterFlags={[p.CLUB]:{visible:!1,label:"Club",overrideLabel:null},[p.PROGRAM_TYPE]:{visible:!1,label:"Program Type",overrideLabel:null},[p.PROGRAM]:{visible:!1,label:"Program",overrideLabel:null},[p.REGISTRATION]:{visible:!1,label:"Registration",overrideLabel:null},[p.LAST_NAME]:{visible:!1,label:"Last Name",overrideLabel:null},[p.BIRTH_DATE_FROM]:{visible:!1,label:"Birth Date",overrideLabel:null},[p.BIRTH_DATE_TO]:{visible:!1,label:"Birth Date To",overrideLabel:null},[p.GRADUATION_YEAR_FROM]:{visible:!1,label:"Graduation Year",overrideLabel:null},[p.GRADUATION_YEAR_TO]:{visible:!1,label:"Graduation Year To",overrideLabel:null},[p.GENDER]:{visible:!1,label:"Gender",overrideLabel:null},[p.STATUS]:{visible:!1,label:"Status",overrideLabel:null},[p.SEASON]:{visible:!1,label:"Season",overrideLabel:null},[p.TEAM]:{visible:!1,label:"Team",overrideLabel:null},[p.TEST_PLAYERS]:{visible:!1,label:"Test Players",overrideLabel:null},[p.STAFF_CREDENTIALING_TEMPLATE]:{visible:!1,label:"Staff Credentialing Template",overrideLabel:null},[p.PLEDGES_WAIVERS]:{visible:!1,label:"Pledges/Waivers",overrideLabel:null},[p.ROLES]:{visible:!1,label:"Roles",overrideLabel:null},[p.NOT_ASSIGNED_PLAYERS]:{visible:!1,label:"Not Assigned Players",overrideLabel:null},[p.CLUB_MULTISELECT]:{visible:!1,label:"Club",overrideLabel:null},[p.PROGRAM_TYPE_MULTISELECT]:{visible:!1,label:"Program Type",overrideLabel:null},[p.PROGRAM_MULTISELECT]:{visible:!1,label:"Program",overrideLabel:null},[p.DATE_FROM]:{visible:!1,label:"Issued Date",overrideLabel:null},[p.DATE_TO]:{visible:!1,label:"Issued Date To",overrideLabel:null},[p.EXPIRATION_DATE_FROM]:{visible:!1,label:"Expiration Date",overrideLabel:null},[p.EXPIRATION_DATE_TO]:{visible:!1,label:"Expiration Date To",overrideLabel:null},[p.DONATION_OPTION]:{visible:!1,label:"Donation Option",overrideLabel:null},[p.VOLUNTEER_OPTION]:{visible:!1,label:"Volunteer Option",overrideLabel:null},[p.CREDIT_DISCOUNT_NAME]:{visible:!1,label:"Credit Name",overrideLabel:null},[p.NOT_IN_PROGRAM]:{visible:!1,label:"Not In Program",overrideLabel:null},[p.ALSO_IN_PROGRAM]:{visible:!1,label:"Also In Program",overrideLabel:null},[p.EXPIRED_INVITATIONS]:{visible:!1,label:"Expired Invitations",overrideLabel:null},[p.AS_OF_DATE]:{visible:!1,label:"As Of Date",overrideLabel:null},[p.PLAYER_POOL]:{visible:!1,label:"Player Pool",overrideLabel:null},[p.GRADE_MULTISELECT]:{visible:!1,label:"Grade",overrideLabel:null},[p.AGE_CLASS_MULTISELECT]:{visible:!1,label:"Age Group",overrideLabel:null},[p.INCLUDE_CANCELLED_REGISTRATIONS]:{visible:!1,label:"Include Cancelled Registrations",overrideLabel:null},[p.CHECKOUT_OPTION_MULTISELECT]:{visible:!1,label:"Checkout Option",overrideLabel:null},[p.CHECKOUT_OPTION_RESPONSE_MULTISELECT]:{visible:!1,label:"Checkout Option Response",overrideLabel:null},[p.REGISTRATION_QUESTION_MULTISELECT]:{visible:!1,label:"Registration Question",overrideLabel:null},[p.REGISTRATION_QUESTION_RESPONSE_MULTISELECT]:{visible:!1,label:"Registration Question Response",overrideLabel:null}},this.Permission=me}ngOnInit(){this.dobSelect=this.reportService.dobYears(),this.yearTypes=this.reportService.yearTypes(),this.authorize.getUser().subscribe(i=>{i&&(this.user=i,this.reportService.clubID=+i.clubID)}),this.queryStore.select(i=>({currentQuery:i.currentQuery,programTypes:i.programTypes,programs:i.programs,seasons:i.seasons,teams:i.teams,inviteStatuses:i.inv
378iteStatuses,donations:i.donations,volunteerOptions:i.volunteerOptions,clubs:i.clubs,playerPools:i.playerPools,grades:i.grades,ageClasses:i.ageClasses,credentialingTemplates:i.credentialingTemplates,pledgesWaivers:i.pledgesWaivers,roles:i.roles})).pipe(Q(this.unsubscribe$),ye(i=>!!i.currentQuery)).subscribe(i=>{let n=!0;this.query&&this.query.reportModelID===i.currentQuery.reportModelID&&(n=!1),this.query=i.currentQuery,this.reportService.programs=i.programs.map(r=>q({},r)),this.seasons=i.seasons.map(r=>q({},r)),this.inviteStatuses=i.inviteStatuses.map(r=>q({},r)),this.donations=i.donations.map(r=>q({},r)),this.volunteerOptions=i.volunteerOptions.map(r=>q({},r)),this.reportService.clubs=i.clubs.map(r=>q({},r)),this.playerPools=i.playerPools.map(r=>q({},r)),this.grades=i.grades.map(r=>q({},r)),this.ageClasses=i.ageClasses.map(r=>q({},r)),this.credentialingTemplates=i.credentialingTemplates.map(r=>q({},r)),this.pledgesWaivers=i.pledgesWaivers.map(r=>q({},r)),this.roles=i.roles.map(r=>q({},r)),this.teams=i.teams.map(r=>q({},r)).filter(r=>r.inactive===null||r.inactive===!1),this.defaultFilters||(this.defaultFilters=this.query.queryFilters),n&&(this.programTypes=i.programTypes.map(r=>q({},r)),this.setFilterFlags(),this.query.queryFilters.find(r=>r.reportFilter.customReportFilterTypeID===p.PROGRAM)&&this.filters.programID===void 0&&this.programs&&this.programs.length>0&&(this.filters.programID=this.programs[0].programID,this.updateRegistrations()),this.filters.clubID=this.reportService.clubID)}),this.clearSubscription$=this.reportService.clearFilters.subscribe(()=>{this.reportService.reportFilters[this.reportService.reportType]=new St,this.filters=this.reportService.reportFilters[Ai.CUSTOM]})}resetFilterFlags(){for(let i of Object.keys(this.showFilterFlags))this.showFilterFlags[i].visible=!1,this.showFilterFlags[i].overrideLabel=null}setFilterFlags(i=!1){this.resetFilterFlags(),this.filters=new St,this.customReportService.filters=this.filters,i&&(this.query.queryFilters=this.defaultFilters);let n=!1,r=!1,u=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.CLUB);
378u&&(this.showFilterFlags[p.CLUB].visible=!0,this.customReportService.state?.clubID?(this.reportService.clubID=+this.customReportService.state?.clubID,this.filters.clubID=this.reportService.clubID):u.value&&(this.reportService.clubID=+u.value,this.filters.clubID=this.reportService.clubID),u.reportFilter.overrideLabel&&(this.showFilterFlags[p.CLUB].overrideLabel=u.reportFilter.overrideLabel));let m=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.PROGRAM_TYPE);m&&(this.showFilterFlags[p.PROGRAM_TYPE].visible=!0,this.customReportService.state?.programTypeID?this.filters.programTypeID=+this.customReportService.state?.programTypeID:m.value?this.filters.programTypeID=+m.value:this.filters.programTypeID=+this.programTypes[0].value,m.reportFilter.overrideLabel&&(this.showFilterFlags[p.PROGRAM_TYPE].overrideLabel=m.reportFilter.overrideLabel));let x=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.PROGRAM);x&&(this.showFilterFlags[p.PROGRAM].visible=!0,this.filterPrograms(),this.customReportService.state?.programID?this.filters.programID=this.customReportService.state.programID:this.filters.programID=x.value?+x.value:this.programs[0]?.programID,x.reportFilter.overrideLabel&&(this.show
378FilterFlags[p.PROGRAM].overrideLabel=x.reportFilter.overrideLabel));let T=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.LAST_NAME);T&&(this.showFilterFlags[p.LAST_NAME].visible=!0,T.value&&(this.filters.playerName=T.value),T.reportFilter.overrideLabel&&(this.showFilterFlags[p.LAST_NAME].overrideLabel=T.reportFilter.overrideLabel));let D=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.BIRTH_DATE_FROM);D&&(this.showFilterFlags[p.BIRTH_DATE_FROM].visible=!0,this.customReportService.state?.dobFrom?this.filters.dobFrom=new Date(this.customReportService.state.dobFrom):D.value&&(this.filters.dobFrom=new Date(D.value)),D.reportFilter.overrideLabel&&(this.showFilterFlags[p.BIRTH_DATE_FROM].overrideLabel=D.reportFilter.overrideLabel));let V=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.BIRTH_DATE_TO);V&&(this.showFilterFlags[p.BIRTH_DATE_TO].visible=!0,this.customReportService.state?.dobTo?this.filters.dobTo=new Date(this.customReportService.state.dobTo):V.value&&(this.filters.dobTo=new Date(V.value)));let G=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.GRADUATION_YEAR_FROM);
378G&&(this.showFilterFlags[p.GRADUATION_YEAR_FROM].visible=!0,this.customReportService.state?.graduationYearFrom&&(this.filters.graduationYearFrom=new Date(this.customReportService.state.graduationYearFrom,0,1)),G.reportFilter.overrideLabel&&(this.showFilterFlags[p.GRADUATION_YEAR_FROM].overrideLabel=G.reportFilter.overrideLabel));let W=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.GRADUATION_YEAR_TO);W&&(this.showFilterFlags[p.GRADUATION_YEAR_TO].visible=!0,this.customReportService.state?.graduationYearTo&&(this.filters.graduationYearTo=new Date(this.customReportService.state.graduationYearTo,0,1)),W.reportFilter.overrideLabel&&(this.showFilterFlags[p.GRADUATION_YEAR_TO].overrideLabel=W.reportFilter.overrideLabel));let J=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.GENDER);J&&(this.showFilterFlags[p.GENDER].visible=!0,this.customReportService.state?.genderID?this.filters.genderID=this.customReportService.state.genderID:J.value&&(this.filters.genderID=J.value),J.reportFilter.overrideLabel&&(this.show
378FilterFlags[p.GENDER].overrideLabel=J.reportFilter.overrideLabel));let Z=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.STATUS);if(Z){if(this.showFilterFlags[p.STATUS].visible=!0,this.customReportService.state?.statuses)this.filters.statuses=this.inviteStatuses?.filter(_=>this.customReportService.state.statuses.includes(_.value));else if(Z.value){let _=Z.value.split(",");this.filters.statuses=this.inviteStatuses?.filter(F=>_.find(E=>+E===F.value))}Z.reportFilter.overrideLabel&&(this.showFilterFlags[p.STATUS].overrideLabel=Z.reportFilter.overrideLabel)}let oe=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.SEASON);if(oe){if(this.showFilterFlags[p.SEASON].visible=!0,this.customReportService.state?.seasons)this.filters.seasons=this.seasons.filter(_=>this.customReportService.state.seasons.includes(_.value));else if(oe.value){let _=oe.value.split(",");this.filters.seasons=this.seasons?.filter(F=>_.find(E=>+E===F.value))}oe.reportFilter.overrideLabel&&(this.showFilterFlags[p.SEASON].overrideLabel=oe.reportFilter.overrideLabel)}let le=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.TEAM);if(le){if(this.showFilterFlags[p.TEAM].visible=!0,le.value){let _=le.value.split(",");this.filters.teams=this.teams?.filter(F=>_.find(E=>+E===F.teamID))}
378le.reportFilter.overrideLabel&&(this.showFilterFlags[p.TEAM].overrideLabel=le.reportFilter.overrideLabel)}let se=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.TEST_PLAYERS);se&&(this.showFilterFlags[p.TEST_PLAYERS].visible=!0,this.customReportService.state?.testUserOption?this.filters.testUserOption=this.customReportService.state.testUserOption:se.value&&(this.filters.testUserOption=+se.value),se.reportFilter.overrideLabel&&(this.showFilterFlags[p.TEST_PLAYERS].overrideLabel=se.reportFilter.overrideLabel));let ae=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.EXPIRED_INVITATIONS);ae&&(this.showFilterFlags[p.EXPIRED_INVITATIONS].visible=!0,ae.value&&(this.filters.invitationOption=+ae.value),ae.reportFilter.overrideLabel&&(this.showFilterFlags[p.EXPIRED_INVITATIONS].overrideLabel=ae.reportFilter.overrideLabel));let be=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.NOT_ASSIGNED_PLAYERS);be&&(this.showFilterFlags[p.NOT_ASSIGNED_PLAYERS].visible=!0,be.value&&(this.filters.notAssignedPlayerOption=+be.value),be.reportFilter.overrideLabel&&(this.show
378FilterFlags[p.NOT_ASSIGNED_PLAYERS].overrideLabel=be.reportFilter.overrideLabel));let Ie=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.CLUB_MULTISELECT);if(Ie){if(this.showFilterFlags[p.CLUB_MULTISELECT].visible=!0,this.customReportService.state?.clubID)this.filters.clubs=this.reportService.clubs?.filter(_=>+this.customReportService.state.clubID===_.clubID);else if(Ie.value){let _=Ie.value.split(",");this.filters.clubs=this.reportService.clubs?.filter(F=>_.find(E=>+E===F.clubID))}this.filters.clubs?.length||(this.filters.clubs=this.reportService.clubs?.filter(_=>_.clubID===this.reportService.clubID)),Ie.reportFilter.overrideLabel&&(this.showFilterFlags[p.CLUB_MULTISELECT].overrideLabel=Ie.reportFilter.overrideLabel)}let ue=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.PROGRAM_TYPE_MULTISELECT);if(ue){if(this.showFilterFlags[p.PROGRAM_TYPE_MULTISELECT].visible=!0,this.customReportService.state?.programTypes)this.filters.programTypes=this.programTypes?.filter(_=>this.customReportService.state.programTypes.includes(_.value));else if(this.customReportService.state?.programTypeID)this.filters.programTypes=this.programTypes?.filter(_=>_.value===this.customReportService.state.programTypeID);else if(ue.value&&!this.customReportService.state?.programTypesAll){let _=ue.value.split(",");this.filters.programTypes=this.programTypes?.filter(F=>_.find(E=>+E===F.value))}
378ue.reportFilter.overrideLabel&&(this.showFilterFlags[p.PROGRAM_TYPE_MULTISELECT].overrideLabel=ue.reportFilter.overrideLabel)}let we=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.PROGRAM_MULTISELECT);if(we){this.showFilterFlags[p.PROGRAM_MULTISELECT].visible=!0;let _,F=this.query.queryFilters.find(E=>E.reportFilter.customReportFilterTypeID===p.PROGRAM_TYPE_MULTISELECT);if(F&&F.value&&!this.customReportService.state?.programTypesAll){let E=ue.value.split(",");_=this.programTypes?.filter(P=>E.find(pe=>+pe===P.value)).map(P=>P.value)}if(this.filterPrograms(_),n=!0,r=!0,this.customReportService.state?.programs)this.filters.programs=this.programs?.filter(E=>this.customReportService.state.programs.includes(E.programID));else if(this.customReportService.state?.programID)this.filters.programs=this.programs?.filter(E=>E.programID===this.customReportService.state.programID);else if(we.value){let E=we.value.split(",");this.filters.programs=this.programs?.filter(P=>E.find(pe=>+pe===P.programID))}
378we.reportFilter.overrideLabel&&(this.showFilterFlags[p.PROGRAM_MULTISELECT].overrideLabel=we.reportFilter.overrideLabel)}let Re=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.REGISTRATION);Re&&(this.showFilterFlags[p.REGISTRATION].visible=!0,this.customReportService.state?.registrationID&&(this.filters.registrations=this.customReportService.state.registrationID.map(_=>({registrationID:_}))),this.updateRegistrations().subscribe({next:()=>{if(Re.value){let _=Re.value.split(",");this.filters.registrations=this.registrations?.filter(F=>_.find(E=>+E===F.registrationID))}this.customReportService.state?.registrationID&&(this.filters.registrations=this.registrations.filter(_=>this.customReportService.state.registrationID.includes(_.registrationID)))}}),Re.reportFilter.overrideLabel&&(this.showFilterFlags[p.REGISTRATION].overrideLabel=Re.reportFilter.overrideLabel));let De=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.DONATION_OPTION);if(De){if(this.showFilterFlags[p.DONATION_OPTION].visible=!0,this.filterDonations(),De.value){let _=De.value.split(",");this.filters.donations=this.donations?.filter(F=>_.find(E=>+E===F.id))}
378De.reportFilter.overrideLabel&&(this.showFilterFlags[p.DONATION_OPTION].overrideLabel=De.reportFilter.overrideLabel)}let Le=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.VOLUNTEER_OPTION);if(Le){if(this.showFilterFlags[p.VOLUNTEER_OPTION].visible=!0,this.filterVolunteerOptions(),Le.value){let _=Le.value.split(",");this.filters.volunteerOptions=this.volunteerOptions?.filter(F=>_.find(E=>+E===F.id))}Le.reportFilter.overrideLabel&&(this.showFilterFlags[p.VOLUNTEER_OPTION].overrideLabel=Le.reportFilter.overrideLabel)}let Oe=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.CREDIT_DISCOUNT_NAME);Oe&&(this.showFilterFlags[p.CREDIT_DISCOUNT_NAME].visible=!0,Oe.value&&(this.filters.creditName=Oe.value),Oe.reportFilter.overrideLabel&&(this.showFilterFlags[p.CREDIT_DISCOUNT_NAME].overrideLabel=Oe.reportFilter.overrideLabel));let Qe=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.DATE_FROM);Qe&&(this.showFilterFlags[p.DATE_FROM].visible=!0,this.customReportService.state?.dateFrom?this.filters.dateFrom=new Date(this.customReportService.state.dateFrom):Qe.value&&(this.filters.dateFrom=new Date(Qe.value)),Qe.reportFilter.overrideLabel&&(this.show
378FilterFlags[p.DATE_FROM].overrideLabel=Qe.reportFilter.overrideLabel));let _t=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.DATE_TO);_t&&(this.showFilterFlags[p.DATE_TO].visible=!0,this.customReportService.state?.dateTo?this.filters.dateTo=new Date(this.customReportService.state.dateTo):_t.value&&(this.filters.dateTo=new Date(_t.value)));let Me=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.EXPIRATION_DATE_FROM);Me&&(this.showFilterFlags[p.EXPIRATION_DATE_FROM].visible=!0,this.customReportService.state?.dateFrom2?this.filters.dateFrom2=new Date(this.customReportService.state.dateFrom2):Me.value?this.filters.dateFrom2=new Date(Me.value):this.filters.dateFrom2=this.getExpirationDateFromFilterDefault(),Me.reportFilter.overrideLabel&&(this.showFilterFlags[p.EXPIRATION_DATE_FROM].overrideLabel=Me.reportFilter.overrideLabel));let yt=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.EXPIRATION_DATE_TO);yt&&(this.showFilterFlags[p.EXPIRATION_DATE_TO].visible=!0,this.customReportService.state?.dateTo2?this.filters.dateTo2=new Date(this.customReportService.state.dateTo2):yt.value&&(this.filters.dateTo2=new Date(yt.value)));let Ae=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.NOT_IN_PROGRAM);if(Ae){this.showFilterFlags[p.NOT_IN_PROGRAM].visible=!0;let _,F=this.query.queryFilters.find(E=>E.reportFilter.customReportFilterTypeID===p.PROGRAM_TYPE_MULTISELECT);if(F&&F.value){let E=ue.value.split(",");_=this.programTypes?.filter(P=>E.find(pe=>+pe===P.value))}if(n?this.programMembershipOptions=this.reportService.setProgramsDisplayName(this.filters):this.filterPrograms(_),r=!0,this.customReportService.state?.notInPrograms)this.filters.notInPrograms=this.programMembershipOptions?.filter(E=>this.customReportService.state.notInPrograms.includes(E.programID));else if(Ae.value){let E=Ae.value.split(",");this.filters.notInPrograms=this.programMembershipOptions?.filter(P=>E.find(pe=>+pe===P.programID))}
378Ae.reportFilter.overrideLabel&&(this.showFilterFlags[p.NOT_IN_PROGRAM].overrideLabel=Ae.reportFilter.overrideLabel)}let Ve=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.ALSO_IN_PROGRAM);if(Ve){if(this.showFilterFlags[p.ALSO_IN_PROGRAM].visible=!0,r||(this.filterPrograms(),r=!0),this.customReportService.state?.alsoInPrograms)this.filters.alsoInPrograms=this.programMembershipOptions?.filter(_=>this.customReportService.state.alsoInPrograms.includes(_.programID));else if(Ve.value){let _=Ve.value.split(",");this.filters.alsoInPrograms=this.programMembershipOptions?.filter(F=>_.find(E=>+E===F.programID))}this.syncAlsoInProgramOptions(),Ve.reportFilter.overrideLabel&&(this.showFilterFlags[p.ALSO_IN_PROGRAM].overrideLabel=Ve.reportFilter.overrideLabel)}let Pe=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.AS_OF_DATE);Pe&&(this.showFilterFlags[p.AS_OF_DATE].visible=!0,this.customReportService.state?.asOfDate?this.filters.asOfDate=new Date(this.customReportService.state.asOfDate):Pe.value&&(this.filters.asOfDate=new Date(Pe.value)),Pe.reportFilter.overrideLabel&&(this.show
378FilterFlags[p.AS_OF_DATE].overrideLabel=Pe.reportFilter.overrideLabel));let Ne=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.PLAYER_POOL);if(Ne){if(this.showFilterFlags[p.PLAYER_POOL].visible=!0,Ne.value){let _=Ne.value.split(",");this.filters.playerPools=this.playerPools?.filter(F=>_.find(E=>+E===F.playerPoolID))}Ne.reportFilter.overrideLabel&&(this.showFilterFlags[p.PLAYER_POOL].overrideLabel=Ne.reportFilter.overrideLabel)}let qe=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.STAFF_CREDENTIALING_TEMPLATE);if(qe){if(this.showFilterFlags[p.STAFF_CREDENTIALING_TEMPLATE].visible=!0,qe.value){let _=qe.value.split(",");this.filters.credentialingTemplates=this.credentialingTemplates?.filter(F=>_.find(E=>+E===F.staffOnboardingTemplateID))}qe.reportFilter.overrideLabel&&(this.showFilterFlags[p.STAFF_CREDENTIALING_TEMPLATE].overrideLabel=qe.reportFilter.overrideLabel),this.filterWaivers()}let ke=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.ROLES);if(ke){if(this.showFilterFlags[p.ROLES].visible=!0,ke.value){let _=ke.value.split(",");this.filters.roles=this.roles?.filter(F=>_.find(E=>+E===F.value))}
378ke.reportFilter.overrideLabel&&(this.showFilterFlags[p.ROLES].overrideLabel=ke.reportFilter.overrideLabel)}let Ue=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.PLEDGES_WAIVERS);if(Ue){if(this.showFilterFlags[p.PLEDGES_WAIVERS].visible=!0,Ue.value){let _=Ue.value.split(",");this.filters.pledgesWaivers=this.pledgesWaivers?.filter(F=>_.find(E=>+E===F.value))}Ue.reportFilter.overrideLabel&&(this.showFilterFlags[p.PLEDGES_WAIVERS].overrideLabel=Ue.reportFilter.overrideLabel)}let Ge=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.GRADE_MULTISELECT);if(Ge){if(this.showFilterFlags[p.GRADE_MULTISELECT].visible=!0,this.customReportService.state?.grades&&(this.filters.grades=this.grades?.filter(_=>this.customReportService.state.grades.includes(_.value))),Ge.value){let _=Ge.value.split(",");this.filters.grades=this.grades?.filter(F=>_.find(E=>+E===F.value))}Ge.reportFilter.overrideLabel&&(this.showFilterFlags[p.GRADE_MULTISELECT].overrideLabel=Ge.reportFilter.overrideLabel)}let We=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.AGE_CLASS_MULTISELECT);We&&this.siteDataService.getClubFieldOptions().subscribe({next:_=>{if(this.clubFieldOptions=_,this.showFilterFlags[p.AGE_CLASS_MULTISELECT].visible=!0,this.customReportService.state?.ageClasses&&(this.filters.ageClasses=this.ageClasses?.filter(F=>this.customReportService.state.ageClasses.includes(F.value))),We.value){let F=We.value.split(",");this.filters.ageClasses=this.ageClasses?.filter(E=>F.find(P=>+P===E.value))}We.reportFilter.overrideLabel?this.showFilterFlags[p.AGE_CLASS_MULTISELECT].overrideLabel=We.reportFilter.overrideLabel:this.getFieldoptionName(xt.AGE_CLASS)&&(this.showFilterFlags[p.AGE_CLASS_MULTISELECT].overrideLabel=this.getFieldoptionName(xt.AGE_CLASS))}});let Ke=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.INCLUDE_CANCELLED_REGISTRATIONS);
378Ke&&(this.showFilterFlags[p.INCLUDE_CANCELLED_REGISTRATIONS].visible=!0,(this.customReportService.state?.includeCancelledRegistrations||Ke.value==="true")&&(this.filters.includeCancelledRegistrations=!0),Ke.reportFilter.overrideLabel&&(this.showFilterFlags[p.INCLUDE_CANCELLED_REGISTRATIONS].overrideLabel=Ke.reportFilter.overrideLabel));let Be=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.CHECKOUT_OPTION_MULTISELECT);Be&&(this.showFilterFlags[p.CHECKOUT_OPTION_MULTISELECT].visible=!0,this.updateRegistrationOptions().subscribe({next:()=>{if(this.customReportService.state?.registrationOptions&&(this.filters.registrationOptions=this.registrationOptions?.filter(F=>this.customReportService.state.registrationOptions.includes(F.value))),Be.value){let F=Be.value.split(",");this.filters.registrationOptions=this.registrationOptions?.filter(E=>F.find(P=>+P===E.value))}let _=this.query.queryFilters.find(F=>F.reportFilter.customReportFilterTypeID===p.CHECKOUT_OPTION_RESPONSE_MULTISELECT);_&&(this.showFilterFlags[p.CHECKOUT_OPTION_RESPONSE_MULTISELECT].visible=!0,this.updateRegistrationOptionValues().subscribe({next:()=>{if(this.customReportService.state?.registrationOptionValues&&(this.filters.registrationOptionValues=this.registrationOptionValues?.filter(F=>this.customReportService.state.registrationOptionValues.includes(F.value))),_.value){let F=_.value.split(",");this.filters.registrationOptionValues=this.registrationOptionValues?.filter(E=>F.find(P=>+P===E.value))}}}
378),_.reportFilter.overrideLabel&&(this.showFilterFlags[p.CHECKOUT_OPTION_MULTISELECT].overrideLabel=_.reportFilter.overrideLabel))}}),Be.reportFilter.overrideLabel&&(this.showFilterFlags[p.CHECKOUT_OPTION_MULTISELECT].overrideLabel=Be.reportFilter.overrideLabel));let Ye=this.query.queryFilters.find(_=>_.reportFilter.customReportFilterTypeID===p.REGISTRATION_QUESTION_MULTISELECT);Ye&&(this.showFilterFlags[p.REGISTRATION_QUESTION_MULTISELECT].visible=!0,this.updateRegistrationQuestions().subscribe({next:()=>{if(this.customReportService.state?.registrationQuestions&&(this.filters.registrationQuestions=this.registrationQuestions?.filter(F=>this.customReportService.state.registrationQuestions.includes(F.value))),Ye.value){let F=Ye.value.split(",");this.filters.registrationQuestions=this.registrationQuestions?.filter(E=>F.find(P=>+P===E.value))}let _=this.query.queryFilters.find(F=>F.reportFilter.customReportFilterTypeID===p.REGISTRATION_QUESTION_RESPONSE_MULTISELECT);_&&(this.showFilterFlags[p.REGISTRATION_QUESTION_RESPONSE_MULTISELECT].visible=!0,this.updateRegistrationQuestionOptions().subscribe({next:()=>{if(this.customReportService.state?.registrationQuestionResponses&&(this.filters.registrationQuestionResponses=this.registrationQuestionResponses?.filter(F=>this.customReportService.state.registrationQuestionResponses.includes(F.value))),_.value){let F=_.value.split(",");this.filters.registrationQuestionResponses=this.registrationQuestionResponses?.filter(E=>F.find(P=>+P===E.value))}}}
378),_.reportFilter.overrideLabel&&(this.showFilterFlags[p.REGISTRATION_QUESTION_RESPONSE_MULTISELECT].overrideLabel=_.reportFilter.overrideLabel))}}),Ye.reportFilter.overrideLabel&&(this.showFilterFlags[p.REGISTRATION_QUESTION_MULTISELECT].overrideLabel=Ye.reportFilter.overrideLabel)),n||this.filterPrograms(),this.updateRegistrations()}updateRegistrations(){let i;this.filters.programID?i=[this.filters.programID]:this.filters.programs&&(i=this.filters.programs.map(r=>r.programID));let n=(i?this.registrationService.getFilteredRegistrations(i):this.registrationService.getAllRegistrations()).pipe(he(1));return n.subscribe(r=>{this.registrations=r,this.filters.registrations=this.filters.registrations?.filter(u=>this.registrations.find(m=>m.registrationID===u.registrationID))}),n}filterPrograms(i){this.programs=this.reportService.filterPrograms(this.filters,i,this.query.queryFilters.find(n=>n.reportFilter.customReportFilterTypeID===p.CLUB_MULTISELECT)!==void 0),this.programMembershipOptions=this.reportService.setProgramsDisplayName(this.filters),this.syncAlsoInProgramOptions(),this.programs?this.filters.programID&&(this.programs?.find(n=>n.programID===this.filters.programID)||(this.filters.programID=this.programs[0].programID)):this.filters.programID=null}syncAlsoInProgramOptions(){let i=new Set(this.filters?.programs?.map(r=>r.programID)??[]),n=i.size===0;this.alsoInProgramOptions=n?[]:this.programMembershipOptions?.filter(r=>!i.has(r.programID)),this.filters?.alsoInPrograms?.length&&(this.filters.alsoInPrograms=n?[]:this.filters.alsoInPrograms.filter(r=>!i.has(r.programID)))}filterDonations(){if(this.filters.clubs||this.reportService.clubs.length===1){let i=this.filters.clubs?this.filters.clubs.map(n=>n.clubID):[this.reportService.clubs[0].clubID];this.filteredDonations=this.donations.filter(n=>i.includes(n.clubID)).map(n=>q({},n)),this.filters.donations&&(this.filters.donations=this.filters.donations.filter(n=>i.includes(n.clubID))),this.filteredDonations.forEach(n=>{this.filters.clubs?.length>1?n.displayName=`${this.reportService.clubs.find(r=>r.clubID===n.clubID).name} - ${n.title}`:n.displayName=n.title})}}getFieldoptionName(i){return this.clubFieldOptions?.find(n=>n.fieldOptionID===i)?.fieldName}filterVolunteerOptions(){if(this.filters.clubs||this.reportService.clubs.length===1){let i=this.filters.clubs?this.filters.clubs.map(n=>n.clubID):[this.reportService.clubs[0].clubID];this.filteredVolunteerOptions=this.volunteerOptions.filter(n=>i.includes(n.clubID)).map(n=>q({},n)),this.filters.volunteerOptions&&(this.filters.volunteerOptions=this.filters.volunteerOptions.filter(n=>i.includes(n.clubID))),this.filteredVolunteerOptions.forEach(n=>{this.filters.clubs?.length>1?n.displayName=`${this.reportService.clubs.find(r=>r.clubID===n.clubID).name} - ${n.title}`:n.displayName=n.title})}}setToDateToEOY(i){return $t(i)}getExpirationDateFromFilterDefault(){if(this.query.reportModelID===Tt.REGISTRATION_DETAILS||this.query.reportModelID===Tt.REGISTRATION_DETAILS_OPTIONS)return new Date(new Date().setFullYear(new Date().getFullYear()-1))}updateRegistrationOptionValues(){let i=this.reportService.getRegistrationOptionsValues(this.filters.registrationOptions,this.filters.clubs?.map(n=>n.clubID)).pipe(he(1));return i.subscribe(n=>{this.registrationOptionValues=n,this.filters.registrationOptionValues=this.filters.registrationOptionValues?.filter(r=>this.registrationOptionValues.find(u=>u.value===r.value))}),i}updateRegistrationOptions(){let i=this.reportService.getRegistrationOptions(this.filters.registrations,this.filters.clubs?.map(n=>n.clubID)).pipe(he(1));return i.subscribe(n=>{this.registrationOptions=n,this.filters.registrationOptions=this.filters.registrationOptions?.filter(r=>this.registrationOptions.find(u=>u.value===r.value))}),i}refreshRegistrationOptionsForClubChange(){this.showFilterFlags[p.CHECKOUT_OPTION_MULTISELECT].visible&&this.updateRegistrationOptions().subscribe({next:()=>{this.showFilterFlags[p.CHECKOUT_OPTION_RESPONSE_MULTISELECT].visible&&this.updateRegistrationOptionValues()}}),this.showFilterFlags[p.REGISTRATION_QUESTION_MULTISELECT].visible&&this.updateRegistrationQuestions().subscribe({next:()=>
378{this.showFilterFlags[p.REGISTRATION_QUESTION_RESPONSE_MULTISELECT].visible&&this.updateRegistrationQuestionOptions()}})}updateRegistrationQuestions(){let i=this.reportService.getRegistrationQuestions(this.filters.clubs?.map(n=>n.clubID)).pipe(he(1));return i.subscribe(n=>{this.registrationQuestions=n,this.filters.registrationQuestions=this.filters.registrationQuestions?.filter(r=>this.registrationQuestions.find(u=>u.value===r.value))}),i}updateRegistrationQuestionOptions(){let i=this.reportService.getRegistrationQuestionOptions(this.filters.registrationQuestions,this.filters.clubs?.map(n=>n.clubID)).pipe(he(1));return i.subscribe(n=>{this.registrationQuestionResponses=n,this.filters.registrationQuestionResponses=this.filters.registrationQuestionResponses?.filter(r=>this.registrationQuestionResponses.find(u=>u.value===r.value))}),i}filterWaivers(){if(this.filters.credentialingTemplates?.length>0){let i=new Set;this.filters.credentialingTemplates.forEach(n=>{n.steps&&n.steps.forEach(r=>{r.waivers&&r.waivers.length>0&&r.waivers.forEach(u=>{u.waiverID&&!i.has(u.waiverID)&&i.add(u.waiverID)})})}),this.filteredPledgesWaivers=[...this.pledgesWaivers?.filter(n=>i.has(n.value))]}else this.filteredPledgesWaivers=[...this.pledgesWaivers]}ngOnDestroy(){this.clearSubscription$.unsubscribe()}};c.\u0275fac=function(n){return new(n||c)(M(Te),M(Ee),M(Se),M(xe),M(z),M(re))},c.\u0275cmp=H({type:c,selectors:[["app-query-filters"]],standalone:!1,decls:1,vars:1,consts:[["dobFromInput",""],["graduationYearFromInput",""],[1,"report-filters"],[1,"row"],[1,"mt-3"],[1,"btn","btn-blank",3,"click"],[1,"far","fa-redo-alt"],[1,"col-md-5","col-lg-3"],[1,"form-group"],[3,"ngModelChange","change","ngModel"],[3,"value"],["optionLabel","name","appendTo","body","placeholder","All",3,"ngModelChange","onChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","selectedItemsLabel"],[1,"col-md-5","col-lg-2"],["value","value","placeholder","All",1,"full-width",3,"ngModelChange","onChange","ngModel","options"],["placeholder","All","optionLabel","label","appendTo","body",3,"ngModelChange","onChange","autofocusFilter","ngModel","options","showToggleAll","filter","maxSelectedLabels","selectedItemsLabel"],["optionLabel","name","appendTo","body",3,"ngModelChange","onChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","placeholder","selectedItemsLabel"],["optionLabel","name","appendTo","body",3,"ngModelChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","placeholder","selectedItemsLabel"],["optionLabel","label","placeholder","All","appendTo","body",3,"ngModelChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","selectedItemsLabel"],["optionLabel","name","appendTo","body","placeholder","All",3,"ngModelChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","selectedItemsLabel"],[1,"col-md-2"],["type","text",3,"ngModelChange","ngModel"],[1,"col-md-6","col-lg-3"],[1,"form-group","form-group--birthday-range"],["optionLabel","name","optionValue","value","styleClass","birthday-range-frequency","appendTo","body","placeholder","Type",3,"onChange","ngModelChange","options","ngModel"],[1,"d-flex","align-items-center"],[1,"resetBtn",3,"click"],["view","year","dateFormat","yy","styleClass","birthday-range-start","inputId","yearpicker","appendTo","body",3,"ngModelChange","ngModel","defaultDate","minDate","maxDate"],["view","year","dateFormat","yy","styleClass","birthday-range-start","inputId","yearpicker","appendTo","body",3,"ngModelChange","onSelect","ngModel","defaultDate","minDate","maxDate"],["id","dobFrom","appendTo","body","dateFormat","mm/dd/yy","placeholder","MM/DD/YYYY",3,"ngModelChange","ngModel"],["id","dobTo","dateFormat","mm/dd/yy","placeholder","MM/DD/YYYY","appendTo","body",3,"ngModelChange","ngModel"],[1,"d-inline-flex","align-items-center"],["view","year","dateFormat","yy","styleClass","birthday-range-start","inputId","yearpicker","appendTo","body",3,"ngModelChange","ngModel"],["optionLabel","label","appendTo","body","placeholder","All",3,"ngModelChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","selectedItemsLabel"],[1,"col-md-2","col-lg-1"],[3,"ngModelChange","ngModel"],["value",""],["value","2"],["value","1"],["value","3"],["optionLabel","label","appendTo","body",3,"ngModelChange","ngModel","options","filter","showToggleAll","maxSelectedLabels","selectedItemsLabel"],[1,"col-md-2","col-lg-3"],["optionLabel","displayName","appendTo","body",3,"ngModelChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","placeholder","selectedItemsLabel"],["id","creditName","type","text",3,"ngModelChange","ngModel"],[1,"d-inline-flex","align-items-center","position-relative"],["id","regFrom","dateFormat","mm/dd/yy","placeholder","MM/DD/YYYY","appendTo","body",3,"ngModelChange","ngModel"],["id","regTo","dateFormat","mm/dd/yy","placeholder","MM/DD/YYYY","appendTo","body",3,"ngModelChange","ngModel"],[1,"col-md-2","col-lg-2"],["optionLabel","name","appendTo","body",3,"ngModelChange","autofocusFilter","disabled","ngModel","options","filter","showToggleAll","maxSelectedLabels","placeholder","selectedItemsLabel"],[1,"col-md-5","col-lg-5"],["optionLabel","title","appendTo","body",3,"ngModelChange","onChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","placeholder","selectedItemsLabel"],["o
378ptionLabel","label","appendTo","body",3,"ngModelChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","placeholder","selectedItemsLabel"],["id","asOfDate","dateFormat","mm/dd/yy","placeholder","MM/DD/YYYY","appendTo","body",3,"ngModelChange","ngModel"],[3,"ngModelChange","binary","ngModel"],["optionLabel","label","appendTo","body",3,"ngModelChange","onChange","autofocusFilter","ngModel","options","filter","showToggleAll","maxSelectedLabels","placeholder","selectedItemsLabel"]],template:function(n,r){n&1&&C(0,mr,51,36),n&2&&g(r.showFilterFlags?0:-1)},dependencies:[mi,_i,Ze,et,Yt,jt,ge,fe,st,ai,ot,at],encapsulation:2});let o=c;return o})();var hr=()=>["./new"],mt=o=>[o],Hi=()=>({run:!0}),Xi=(o,c)=>c.value;function Cr(o,c){if(o&1){let t=S();e(0,` 379 `),l(1,"span",10)(2,"a",11),v("click",function(){y(t);let n=d().$implicit,r=d(2);return h(r.markQueryAsFavorite(n.value))}),b(3,"i",12),s()(),e(4,` 380 `)}o&2&&(a(3),f("pTooltip","Mark as Favorite"))}function gr(o,c){if(o&1){let t=S();e(0,` 381 `),l(1,"span",10)(2,"a",11),v("click",function(){y(t);let n=d().$implicit,r=d(2);return h(r.unMarkQueryAsFavorite(n.value))}),b(3,"i",13),s()(),e(4,` 382 `)}o&2&&(a(3),f("pTooltip","Remove Favorite"))}function fr(o,c){if(o&1&&(e(0,` 383 `),l(1,"tr"),e(2,` 384 `),l(3,"td"),e(4),C(5,Cr,5,1),C(6,gr,5,1),s(),e(7,` 385 `),l(8,"td"),e(9,` 386 `),l(10,"button",8),e(11,"Configure"),s(),e(12,` 387 `),l(13,"button",9),e(14,"Run"),s(),e(15,` 388 `),s(),e(16,` 389 `),s(),e(17,` 390 `)),o&2){let t=c.$implicit;a(4),O(` 391 `,t.label,` 392 `),a(),g(t.favorite?-1:5),a(),g(t.favorite?6:-1),a(4),f("routerLink",j(6,mt,t.value)),a(3),f("routerLink",j(8,mt,t.value))("queryParams",X(10,Hi))}}function xr(o,c){if(o&1&&(e(0,` 393 `),l(1,"section",5),e(2,` 394 `),l(3,"div",6),e(4,` 395 `),l(5,"div",7),e(6,` 396 `),l(7,"table"),e(8,` 397 `),l(9,"thead"),e(10,` 398 `),l(11,"tr"),e(12,` 399 `),l(13,"th"),e(14,"Templates"),s(),e(15,` 400 `),b(16,"th"),e(17,` 401 `),s(),e(18,` 402 `),s(),e(19,` 403 `),l(20,"tbody"),e(21,` 404 `),k(22,fr,18,11,null,null,Xi),s(),e(24,` 405 `),s(),e(25,` 406 `),s(),e(26,` 407 `),s(),e(27,` 408 `),s(),e(28,` 409 `)),o&2){let t=d();a(22),U(t.templates)}}function Sr(o,c){if(o&1){let t=S();e(0,` 410 `),l(1,"span",10)(2,"a",11),v("click",function(){y(t);let n=d().$implicit,r=d(2);return h(r.markQueryAsFavorite(n.value))}),b(3,"i",12),s()(),e(4,` 411 `)}o&2&&(a(3),f("pTooltip","Mark as Favorite"))}function Tr(o,c){if(o&1){let t=S();e(0,` 412 `),l(1,"span",10)(2,"a",11),v("click",function(){y(t);let n=d().$implicit,r=d(2);return h(r.unMarkQueryAsFavorite(n.value))}),b(3,"i",13),s()(),e(4,` 413 `)}o&2&&(a(3),f("pTooltip","Remove Favorite"))}function vr(o,c){if(o&1&&(e(0,` 414 `),l(1,"tr"),e(2,` 415 `),l(3,"td"),e(4),C(5,Sr,5,1),C(6,Tr,5,1),s(),e(7,` 416 `),l(8,"td"),e(9,` 417 `),l(10,"button",8),e(11,"Configure"),s(),e(12,` 418 `),l(13,"button",9),e(14,"Run"),s(),e(15,` 419 `),s(),e(16,` 420 `),s(),e(17,` 421 `)),o&2){let t=c.$implicit;a(4),O(` 422 `,t.label,` 423 `),a(),g(t.favorite?-1:5),a(),g(t.favorite?6:-1),a(4),f("routerLink",j(6,mt,t.value)),a(3),f("routerLink",j(8,mt,t.value))("queryParams",X(10,Hi))}}function Fr(o,c){if(o&1&&(e(0,` 424 `),l(1,"section",5),e(2,` 425 `),l(3,"div",6),e(4,` 426 `),l(5,"div",7),e(6,` 427 `),l(7,"table"),e(8,` 428 `),l(9,"thead"),e(10,` 429 `),l(11,"tr"),e(12,` 430 `),l(13,"th"),e(14,"My Queries"),s(),e(15,` 431 `),b(16,"th"),e(17,` 432 `),s(),e(18,` 433 `),s(),e(19,` 434 `),l(20,"tbody"),e(21,` 435 `),k(22,vr,18,11,null,null,Xi),s(),e(24,` 436 `),s(),e(25,` 437 `),s(),e(26,` 438 `),s(),e(27,` 439 `),s(),e(28,` 440 `)),o&2){let t=d();a(22),U(t.queries)}}var Ki=(()=>{let c=class c{constructor(i,n){this.siteDataService=i,this.queryService=n,this.unsubscribe$=new Y,this.templates=[],this.queries=[]}
440ngOnInit(){this.loading=!0,this.siteDataService.hideSiteLoader(),this.queryService.getClubAndUserQueries().pipe(Q(this.unsubscribe$)).subscribe(i=>{this.loading=!1,this.queries=i.queries,this.templates=i.templates})}markQueryAsFavorite(i){this.queryService.markQueryAsFavorite(i).pipe(Q(this.unsubscribe$)).subscribe(()=>{let n=this.templates.find(u=>u.value===i);n&&(n.favorite=!0);let r=this.queries.find(u=>u.value===i);r&&(r.favorite=!0),this.siteDataService.showSiteSuccessAlert("Query marked as favorite")})}unMarkQueryAsFavorite(i){this.queryService.unMarkQueryAsFavorite(i).pipe(Q(this.unsubscribe$)).subscribe(()=>{let n=this.templates.find(u=>u.value===i);n&&(n.favorite=!1);let r=this.queries.find(u=>u.value===i);r&&(r.favorite=!1),this.siteDataService.showSiteSuccessAlert("Removed query from favorites")})}ngOnDestroy(){this.unsubscribe$.next(null),this.unsubscribe$.complete()}};c.\u0275fac=function(n){return new(n||c)(M(z),M(ve))},c.\u0275cmp=H({type:c,selectors:[["ng-component"]],standalone:!1,decls:18,vars:5,consts:[["role","main","data-testid","custom-report-query-list"],[1,"container","ml-0"],[1,"d-flex","justify-content-between","border-bottom","mb-3"],["pageTitle","Reports",3,"hideBorder"],[1,"btn","btn-primary",3,"routerLink"],[1,"card"],[1,"row"],[1,"col-lg-12"],[1,"btn","btn-secondary",3,"routerLink"],[1,"btn","btn-primary",3,"routerLink","queryParams"],[1,"ml-2"],[3,"click"],["tooltipPosition","top",1,"fa-regular","fa-star",3,"pTooltip"],["tooltipPosition","top",1,"fa","fa-star",3,"pTooltip"]],template:function(n,r){n&1&&(l(0,"main",0),e(1,` 441 `),l(2,"div",1),e(3,` 442 `),l(4,"div",2),e(5,` 443 `),b(6,"app-admin-header",3),e(7,` 444 `),l(8,"div"),e(9,` 445 `),l(10,"button",4),e(11,"New Report"),s(),e(12,` 446 `),s(),e(13,` 447 `),s(),e(14,` 448 `),C(15,xr,29,0),C(16,Fr,29,0),s(),e(17,` 449`),s()),n&2&&(a(6),f("hideBorder",!0),a(4),f("routerLink",X(4,hr)),a(5),g(r.loading?-1:15),a(),g(!r.loading&&r.queries.length>0?16:-1))},dependencies:[it,ut,ri],encapsulation:2});let o=c;return o})();var $i=Et(ti());var Er=["reportTable"],Ft=()=>({"margin-top":"50%"}),br=o=>["/admin/players",o,"overview"],Xe=o=>[o],Ji=()=>({});function Ir(o,c){o&1&&(e(0,` 450 `),l(1,"app-pill",49),e(2,"Custom"),s(),e(3,` 451 `))}function wr(o,c){if(o&1&&(e(0,` 452 `),l(1,"div",47),e(2,` 453 `),l(3,"span",48),e(4),s(),e(5,` 454 `),C(6,Ir,4,0),s(),e(7,` 455 `)),o&2){let t=c.$implicit;a(4),L(t.label),a(2),g(t.isCustom?6:-1)}}function Rr(o,c){if(o&1){let t=S();e(0,` 456 `),l(1,"div",50),e(2,` 457 `),l(3,"a",51),v("click",function(n){y(t);let r=d(2);return h(r.runPrimarySaveAction(n))}),e(4),s(),e(5,` 458 `),l(6,"p-splitButton",52),v("onClick",function(n){y(t);let r=d(2);return h(r.runPrimarySaveAction(n))}),e(7,` 459 `),s(),e(8,` 460 `),l(9,"a",53),v("click",function(){y(t);let n=d(2);return h(n.editReportButtonClick())}),e(10,` 461 `),b(11,"i",54),e(12,` Configure 462 `),s(),e(13,` 463 `),l(14,"a",51),v("click",function(){y(t);let n=d(2);return h(n.exportDataButtonClick())}),e(15,` 464 `),b(16,"i",55),e(17,` Export Results 465 `),s(),e(18,` 466 `),l(19,"a",51),v("click",function(){y(t);let n=d(2);return h(n.emailDataButtonClick())}),e(20,` 467 `),b(21,"i",56),e(22,` Email 468 `),s(),e(23,` 469 `),s(),e(24,` 470 `)}if(o&2){let t=d(2);a(3),f("hidden",(t.saveMenuItems==null?null:t.saveMenuItems.length)>1),a(),O(` 471 `,t.saveMenuItems[0]==null?null:t.saveMenuItems[0].label,` 472 `),a(2),Pt("btn-sm"),f("hidden",(t.saveMenuItems==null?null:t.saveMenuItems.length)<=1)("label",t.saveMenuItems[0]==null?null:t.saveMenuItems[0].label)("model",t.saveMenuItems),a(3),f("hidden",t.queryViewState===t.QueryViewState.EDITING_QUERY),a(5),f("hidden",t.queryViewState===t.QueryViewState.EDITING_QUERY),a(5),f("hidden",t.queryViewState===t.QueryViewState.EDITING_QUERY)}}function Dr(o,c){if(o&1&&(e(0,` 473 `),l(1,"option",58),e(2),s(),e(3,` 474 `)),o&2){let t=c.$implicit,i=d(3);a(),f("value",t.value)("selected",+t.value===i.currentModel.reportModelID),a(),O(` 475 `,t.label,` 476 `)}}function Lr(o,c){if(o&1){let t=S();e(0,` 477 `),l(1,"div",50),e(2,` 478 `),l(3,"a",51),v("click",function(n){y(t);let r=d(3);return h(r.runPrimarySaveAction(n))}),e(4),s(),e(5,` 479 `),l(6,"p-splitButton",59),v("onClick",function(n){y(t);let r=d(3);return h(r.runPrimarySaveAction(n))}),e(7,` 480 `),s(),e(8,` 481 `),l(9,"a",60),v("click",function(){y(t);let n=d(3);return h(n.editReportButtonClick())}),e(10,` 482 `),b(11,"i",54),e(12,` Configure 483 `),s(),e(13,` 484 `),l(14,"a",61),v("click",function(){y(t);let n=d(3);return h(n.exportDataButtonClick())}),e(15,` 485 `),b(16,"i",55),e(17,` Export Results 486 `),s(),e(18,` 487 `),l(19,"a",61),v("click",function(){y(t);let n=d(3);return h(n.emailDataButtonClick())}),e(20,` 488 `),b(21,"i",56),e(22,` Email 489 `),s(),e(23,` 490 `),s(),e(24,` 491 `)}if(o&2){let t=d(3);a(3),f("hidden",(t.saveMenuItems==null?null:t.saveMenuItems.length)>1),a(),O(` 492 `,t.saveMenuItems[0]==null?null:t.saveMenuItems[0].label,` 493 `),a(2),f("hidden",(t.saveMenuItems==null?null:t.saveMenuItems.length)<=1)("label",t.saveMenuItems[0]==null?null:t.saveMenuItems[0].label)("model",t.saveMenuItems==null?null:t.saveMenuItems.slice(1))("styleClass","btn-sm")}}function Or(o,c){if(o&1){let t=S();e(0,` 494 `),l(1,"div",44),e(2,` 495 `),l(3,"div",30),e(4,` 496 `),l(5,"select",57,1),v("change",function(){y(t);let n=de(6),r=d(2);return h(r.tryChangeModel(+n.value))}),e(7,` 497 `),k(8,Dr,4,3,null,null,B),s(),e(10,` 498 `),s(),e(11,` 499 `),C(12,Lr,25,6),s(),e(13,` 500 `)}if(o&2){let t=d(2);a(5),f("disabled",t.loadingModel),a(3),U(t.modelOptions),a(4),g((t.saveMenuItems==null?null:t.saveMenuItems.length)>0&&t.queryViewState!==t.QueryViewState.EDITING_QUERY?12:-1)}}function Qr(o,c){o&1&&(e(0,` 501 `),l(1,"div"),e(2,` 502 `),l(3,"div",29),e(4,` 503 `),l(5,"div",62),e(6,` 504 `),l(7,"h3",32),e(8,"Filters"),s(),e(9,` 505 `),s(),e(10,` 506 `),s(),e(11,` 507 `),b(12,"app-query-filters"),e(13,` 508 `),b(14,"hr",28),e(15,` 509 `),s(),e(16,` 510 `))}function Mr(o,c){o&1&&(e(0,` 511 `),b(1,"app-loader",63),e(2,` 512 `)),o&2&&(a(),f("spinnerStyle",X(1,Ft)))}function Ar(o,c){o&1&&(e(0,` 513 `),b(1,"i",69),e(2,` 514 `))}function Vr(o,c){o&1&&(e(0,` 515 `),b(1,"i",70),e(2,` 516 `))}function Pr(o,c){o&1&&(e(0,` 517 `),b(1,"i",71),e(2,` 518 `))}function Nr(o,c){o&1&&(e(0,` 519 `),b(1,"i",72),e(2,` 520 `))}function qr(o,c){o&1&&(e(0,` 521 `),b(1,"i",71),e(2,` 522 `))}function kr(o,c){o&1&&(e(0,` 523 `),b(1,"i",72),e(2,` 524 `))}function Ur(o,c){if(o&1){let t=S();e(0,` 525 `),l(1,"div",73),e(2,` 526 `),l(3,"label"),e(4,` 527 `),l(5,"a",66),v("click",function(){let n=y(t).$implicit,r=d(4);return h(r.toggleEntityFieldInQuerySelection(n.reportEntityFieldID))}),e(6,` 528 `),C(7,qr,3,0),C(8,kr,3,0),s(),e(9,` 529 `),l(10,"a",74),v("click",function(){let n=y(t).$implicit,r=d(4);return h(r.toggleEntityFieldInQuerySelection(n.reportEntityFieldID))}),e(11),s(),e(12,` 530 `),s(),e(13,` 531 `),s(),e(14,` 532 `)}if(o&2){let t=c.$implicit,i=d(4);a(7),g(i.entityFieldInQuery(t.reportEntityFieldID)?7:-1),a(),g(i.entityFieldInQuery(t.reportEntityFieldID)?-1:8),a(3),O(` 533 `,t.displayNameOverride??i.getReportField(t.reportFieldID).displayName,` 534 `)}}function Gr(o,c){if(o&1){let t=S();e(0,` 535 `),l(1,"div",39),e(2,` 536 `),l(3,"div",64),e(4,` 537 `),l(5,"a",65),v("click",function(){let n=y(t).$implicit,r=d(3);return h(r.toggleEntityExpanded(n.reportEntityID))}),e(6,` 538 `),C(7,Ar,3,0),C(8,Vr,3,0),s(),e(9,` 539 `),l(10,"a",66),v("click",function(){let n=y(t).$implicit,r=d(3);return h(r.toggleEntityInQuerySelection(n.reportEntityID))}),e(11,` 540 `),C(12,Pr,3,0),C(13,Nr,3,0),s(),e(14,` 541 `),l(15,"label"),e(16,` 542 `),l(17,"a",67),v("click",function(){let n=y(t).$implicit,r=d(3);return h(r.toggleEntityExpanded(n.reportEntityID))}),e(18),s(),e(19,` 543 `),s(),e(20,` 544 `),s(),e(21,` 545 `),l(22,"div",68),e(23,` 546 `),k(24,Ur,15,3,null,null,B),s(),e(26,` 547 `),s(),e(27,` 548 `)}if(o&2){let t=c.$implicit,i=d(3);a(5),f("title","Toggle entity"+t.name),a(2),g(t.expanded?-1:7),a(),g(t.expanded?8:-1),a(4),g(i.entity
548InQuery(t.reportEntityID)?12:-1),a(),g(i.entityInQuery(t.reportEntityID)?-1:13),a(5),O(` 549 `,t.name,` 550 `),a(4),f("id",Nt(t.reportEntityID))("hidden",!t.expanded),a(2),U(t.entityFields)}}function Wr(o,c){if(o&1&&(e(0,` 551 `),l(1,"div",38),e(2,` 552 `),k(3,Gr,28,9,null,null,B),s(),e(5,` 553 `)),o&2){let t=d(2);a(3),U(t.currentModel.reportEntities)}}function Br(o,c){o&1&&(e(0,` 554 `),b(1,"app-loader",63),e(2,` 555 `)),o&2&&(a(),f("spinnerStyle",X(1,Ft)))}function Yr(o,c){if(o&1){let t=S();e(0,` 556 `),l(1,"div",76,2),e(3,` 557 `),l(4,"div",77),e(5,` 558 `),l(6,"button",78),e(7,` 559 `),b(8,"i",79),e(9,` 560 `),b(10,"i",79),e(11,` 561 `),s(),e(12,` 562 `),s(),e(13,` 563 `),l(14,"div",80),e(15,` 564 `),l(16,"label"),e(17),s(),e(18,` 565 `),s(),e(19,` 566 `),l(20,"div",77),e(21,` 567 `),l(22,"a",74),v("click",function(){let n=y(t).$implicit,r=d(3);return h(r.toggleEntityFieldInQuerySelection(n.reportEntityFieldID))}),e(23,` 568 `),b(24,"i",81),e(25,` 569 `),s(),e(26,` 570 `),s(),e(27,` 571 `),s(),e(28,` 572 `)}if(o&2){let t=c.$implicit,i=d(3);a(),f("id",t.reportEntityFieldID),a(16),O(` 573 `,i.getEntity(t.reportEntityFieldID).name+" : "+(i.getEntityField(t.reportEntityFieldID).displayNameOverride??i.getReportField(i.getEntityField(t.reportEntityFieldID).reportFieldID).displayName),` 574 `)}}function jr(o,c){if(o&1){let t=S();e(0,` 575 `),l(1,"div",75),v("cdkDropListDropped",function(n){y(t);let r=d(2);return h(r.entityQueryFieldDropped(n))}),e(2,` 576 `),k(3,Yr,29,2,null,null,B),s(),e(5,` 577 `)}if(o&2){let t=d(2);a(),f("cdkDropListData",t.currentQuery.queryFields),a(2),U(t.currentQuery.queryFields)}}function zr(o,c){o&1&&(e(0,` 578 `),b(1,"app-loader",63),e(2,` 579 `)),o&2&&(a(),f("spinnerStyle",X(1,Ft)))}function Hr(o,c){if(o&1){let t=S();e(0,` 580 `),l(1,"div",86,5),v("mouseover",function(){return""})("mouseleave",function(){return""}),e(3,` 581 `),l(4,"div",87),e(5,` 582 `),l(6,"a",74),v("click",function(n){let r=y(t).$implicit,u=de(14);return d(3).getQueryConditionEntityFieldItems(r),h(u.toggle(n))}),e(7),s(),e(8,` 583 `),l(9,"div",null,6),e(11,` 584 `),s(),e(12,` 585 `),b(13,"p-tieredMenu",85,7),e(15,` 586 `),s(),e(16,` 587 `),l(17,"div",87),e(18,` 588 `),l(19,"a",74),v("click",function(n){let r=y(t).$implicit,u=de(27);return d(3).getQueryConditionOperatorMenuItems(r),h(u.toggle(n))}),e(20),s(),e(21,` 589 `),l(22,"div",null,8),e(24,` 590 `),s(),e(25,` 591 `),b(26,"p-tieredMenu",85,9),e(28,` 592 `),s(),e(29,` 593 `),l(30,"div",88),e(31,` 594 `),l(32,"app-condition-value-editor",89),e(33,` 595 `),s(),e(34,` 596 `),e(35,` 597 `),e(36,` 598 `),l(37,"a",74),v("click",function(){let n=y(t).$implicit,r=d(3);return h(r.removeQueryCondition(n.queryConditionID))}),e(38,` 599 `),b(39,"i",81),e(40,` 600 `),s(),e(41,` 601 `),e(42,`
602 `),s(),e(43,` 603 `),s(),e(44,` 604 `)}if(o&2){let t=c.$implicit,i=d(3);a(7),L(i.getQueryConditionFieldName(t)),a(2),Ce("position","relative"),a(4),f("model",i.queryConditionEntityFieldItems)("popup",!0),a(7),L(i.getQueryConditionLabel(t)),a(2),Ce("position","relative"),a(4),f("model",i.queryConditionOperatorMenuItems)("popup",!0),a(6),f("conditionID",t.queryConditionID)}}function Xr(o,c){if(o&1){let t=S();e(0,` 605 `),l(1,"div",82),e(2,` 606 `),k(3,Hr,45,11,null,null,B),l(5,"div",83),e(6,` 607 `),l(7,"div",30),e(8,` 608 `),l(9,"a",60),v("click",function(n){y(t);let r=de(19);return h(r.toggle(n))}),e(10,` 609 `),b(11,"i",84),e(12,` 610 Add filter 611 `),s(),e(13,` 612 `),l(14,"div",null,3),e(16,` 613 `),s(),e(17,` 614 `),b(18,"p-tieredMenu",85,4),e(20,` 615 `),s(),e(21,` 616 `),b(22,"div",30),e(23,` 617 `),b(24,"div",30),e(25,` 618 `),b(26,"div",30),e(27,` 619 `),s(),e(28,` 620 `),s(),e(29,` 621 `)}if(o&2){let t=d(2);a(3),U(t.currentQuery==null?null:t.currentQuery.queryConditions),a(11),Ce("position","relative"),a(4),f("model",t.addFilterMenu)("popup",!0)}}function Kr(o,c){o&1&&(e(0,` 622 `),b(1,"span",90),e(2,` 623 `))}function $r(o,c){if(o&1&&(e(0,` 624 `),l(1,"span",92),e(2),s(),e(3,` 625 `)),o&2){let t=d(3);a(2),O(` 626 `,t.queryResult.totalPlayers+" players",` 627 `)}}function Jr(o,c){if(o&1&&(e(0,` 628 `),l(1,"th"),e(2),s(),e(3,` 629 `)),o&2){let t=d().$implicit;a(2),O(` 630 `,t.label,` 631 `)}}function Zr(o,c){if(o&1&&(e(0,` 632 `),l(1,"th",96),e(2),b(3,"p-sortIcon",97),e(4,` 633 `),s(),e(5,` 634 `)),o&2){let t=d().$implicit;a(),f("pSortableColumn",t.index.toString()),a(),O(` 635 `,t.label,` 636 `),a(),f("field",t.id)}}function eo(o,c){if(o&1&&(e(0,` 637 `),C(1,Jr,4,1)(2,Zr,6,3)),o&2){let t=c.$implicit;a(),g(t.isSortable!==!0?1:2)}}function to(o,c){if(o&1&&(e(0),ce(1,"number")),o&2){let t=d().$implicit;O(` 638 `,gt(1,1,t.total,"1.0-0"),` 639 `)}}function io(o,c){if(o&1&&(e(0),ce(1,"currency")),o&2){let t=d().$implicit;O(` 640 `,ze(1,1,t.total),` 641 `)}}function no(o,c){if(o&1&&(e(0),ce(1,"accountingCurrency")),o&2){let t=d().$implicit;O(` 642 `,ze(1,1,t.total),` 643 `)}}function ro(o,c){if(o&1&&(e(0),ce(1,"number")),o&2){let t=d().$implicit;O(` 644 `,gt(1,1,t.total,"1.2-2"),` 645 `)}}function oo(o,c){if(o&1&&(e(0,` 646 `),l(1,"td"),e(2,` 647 `),C(3,to,2,4),C(4,io,2,3),C(5,no,2,3),C(6,ro,2,4),s(),e(7,` 648 `)),o&2){let t=c.$implicit,i=d(6);a(),Vt("green",t.label==="Total Fee"),a(2),g((t.type===i.DataType.Int32||t.type===i.DataType.Int64)&&t.total!==null?3:-1),a(),g(t.type===i.DataType.Currency&&!i.currentModel.formatAccountingCurrency&&t.total!==null?4:-1),a(),g(t.type===i.DataType.Currency&&i.currentModel.formatAccountingCurrency&&t.total!==null?5:-1),a(),g(t.type===i.DataType.Float&&t.total&&t.total!==null?6:-1)}}function lo(o,c){if(o&1&&(e(0,` 649 `),l(1,"tr",98),e(2,` 650 `),k(3,oo,8,6,null,null,B),s(),e(5,` 651 `)),o&2){let t=d(5);a(3),U(t.visibleColumns)}}function so(o,c){if(o&1&&(e(0,` 652 `),l(1,"tr"),e(2,` 653 `),k(3,eo,3,1,null,null,B),s(),e(5,` 654 `),C(6,lo,6,0)),o&2){let t=d(4);a(3),U(t.visibleColumns),a(3),g(t.currentModel.showTotalRow?6:-1)}}function ao(o,c){if(o&1&&(e(0),ce(1,"currency")),o&2){let t=d().$implicit,i=d().$implicit;O(` 655 `,ze(1,1,i[t.index]),` 656 `)}}
656function uo(o,c){if(o&1&&(e(0),ce(1,"accountingCurrency")),o&2){let t=d().$implicit,i=d().$implicit;O(` 657 `,ze(1,1,i[t.index]),` 658 `)}}function po(o,c){if(o&1){let t=S();e(0,` 659 `),l(1,"a",74),v("click",function(){y(t);let n=d(4).$implicit,r=d(4);return h(r.setupModal(n[r.playerIDIndex],n[r.clubSubdomainIndex],n[r.clubNameIndex]))}),e(2),s(),e(3,` 660 `)}if(o&2){let t=d(3).$implicit,i=d().$implicit;a(2),O(` 661 `,i[t.index],` 662 `)}}function co(o,c){if(o&1&&(e(0,` 663 `),l(1,"a",99),e(2),s(),e(3,` 664 `)),o&2){let t=d(3).$implicit,i=d().$implicit,n=d(4);a(),f("routerLink",j(2,br,i[n.playerIDIndex])),a(),O(` 665 `,i[t.index],` 666 `)}}function mo(o,c){if(o&1&&(e(0,` 667 `),C(1,po,4,1),C(2,co,4,4)),o&2){let t=d(3).$implicit,i=d(4);a(),g(t[i.clubIDIndex]!==i.clubID?1:-1),a(),g(t[i.clubIDIndex]===i.clubID?2:-1)}}function _o(o,c){if(o&1&&e(0),o&2){let t=d(2).$implicit,i=d().$implicit;O(` 668 `,i[t.index],` 669 `)}}function yo(o,c){if(o&1&&(e(0,` 670 `),C(1,mo,3,2)(2,_o,1,1)),o&2){let t=d(6);a(),g(t.reportService.profile[t.Permission.Profile]&&t.showLinkToPlayerProfile?1:2)}}function ho(o,c){if(o&1&&e(0),o&2){let t=d().$implicit,i=d().$implicit;O(` 671 `,i[t.index],` 672 `)}}function Co(o,c){if(o&1&&(e(0,` 673 `),l(1,"td"),e(2,` 674 `),C(3,ao,2,3),C(4,uo,2,3),C(5,yo,3,1),C(6,ho,1,1),s(),e(7,` 675 `)),o&2){let t=c.$implicit,i=d(5);a(3),g(t.type===i.DataType.Currency&&!i.currentModel.formatAccountingCurrency&&!t.displayFormat?3:-1),a(),g(t.type===i.DataType.Currency&&i.currentModel.formatAccountingCurrency&&!t.displayFormat?4:-1),a(),g(t.index===i.playerNameIndex?5:-1),a(),g(t.index!==i.playerNameIndex&&(t.type!==i.DataType.Currency||t.displayFormat)?6:-1)}}function go(o,c){if(o&1&&(e(0,` 676 `),l(1,"tr"),e(2,` 677 `),k(3,Co,8,4,null,null,B),s(),e(5,` 678 `)),o&2){let t=d(4);a(3),U(t.visibleColumns)}}function fo(o,c){if(o&1){let t=S();e(0,` 679 `),l(1,"p-table",93,10),v("onLazyLoad",function(n){y(t);let r=d(3);return h(r.lazyLoad(n))}),e(3,` 680 `),je(4,so,7,1,"ng-template",94),e(5,` 681 `),je(6,go,6,0,"ng-template",95),e(7,` 682 `),s(),e(8,` 683 `)}if(o&2){let t=d(3);a(),f("columns",t.queryResult.resultSet==null?null:t.queryResult.resultSet.columns)("value",t.queryResult.resultSet==null?null:t.queryResult.resultSet.rows)("lazy",!0)("loading",t.fetching)("paginator",!0)("totalRecords",t.queryResult.totalRecords)("rows",t.chunkSettings.limit)}}function xo(o,c){if(o&1&&(e(0,` 684 `),b(1,"hr",28),e(2,` 685 `),l(3,"h2",91),e(4,`Result 686 `),l(5,"span",92),e(6),s(),e(7,` 687 `),C(8,$r,4,1),s(),e(9,` 688 `),C(10,fo,9,7)),o&2){let t=d(2);a(6),O(` 689 `,t.queryResult.totalRecords+" rows",` 690 `),a(2),g(t.queryResult.totalPlayers?8:-1),a(2),g(t.queryResult?10:-1)}}function So(o,c){if(o&1){let t=S();e(0,` 691 `),l(1,"section",21),e(2,` 692 `),l(3,"div"),e(4,` 693 `),l(5,"div",22),e(6,` 694 `),l(7,"div",23),e(8,` 695 `),l(9,"div",24),e(10,` 696 `),l(11,"label",25),e(12,` 697 `),l(13,"h2",26),e(14,"Report"),s(),e(15,` 698 `),s(),e(16,` 699 `),l(17,"p-select",27),R("ngModelChange",function(n){y(t);let r=d();return w(r.currentReport,n)||(r.currentReport=n),h(n)}),v("ngModelChange",function(n){y(t);let r=d();return h(r.changeReport(n))}),e(18,` 700 `),je(19,wr,8,2,"ng-template",null,0,kt),e(21,` 701 `),s(),e(22,` 702 `),s(),e(23,` 703 `),s(),e(24,` 704 `),C(25,Rr,25,10),s(),e(26,` 705 `),b(27,"hr",28),e(28,` 706 `),s(),e(29,` 707 `),l(30,"div"),e(31,` 708 `),l(32,"div",29),e(33,` 709 `),l(34,"div",30),e(35,` 710 `),l(36,"label",31),e(37,` 711 `),l(38,"h3",32),e(39,"Select a Report Category"),s(),e(40,` 712 `),s(),e(41,` 713 `),s(),e(42,` 714 `),s(),e(43,` 715 `),C(44,Or,14,2),b(45,"hr",28),e(46,` 716 `),s(),e(47,` 717 `),e(48,` 718 `),C(49,Qr,17,0),l(50,"div",33),e(51,` 719 `),l(52,"div",34),e(53,"Available Fields"),s(),e(54,` 720 `),l(55,"div",34),e(56,"Added"),s(),e(57,` 721 `),s(),e(58,` 722 `),l(59,"div",35),e(60,` 723 `),l(61,"div",36),e(62,` 724 `),C(63,Mr,3,2),C(64,Wr,6,0),s(),e(65,` 725 `),l(66,"div",37),e(67,` 726 `),C(68,Br,3,2),l(69,"div",38),e(70,` 727 `),l(71,"div",39),e(72,` 728 `),C(73,jr,6,1),s(),e(74,` 729 `),s(),e(75,` 730 `),s(),e(76,` 731 `),b(77,"hr",28),e(78,` 732 `),s(),e(79,` 733 `),l(80,"div",40),e(81,` 734 `),l(82,"div",41),e(83,` 735 `),l(84,"div",30),e(85,` 736 `),l(86,"h2",32),e(87,"Add Advanced Filters"),s(),e(88,` 737 `),l(89,"div",42),e(90,` 738 `),l(91,"div",43),e(92,` 739 `),C(93,zr,3,2),C(94,Xr,30,4),s(),e(95,` 740 `),s(),e(96,` 741 `),s(),e(97,` 742 `),s(),e(98,` 743 `),s(),e(99,` 744 `),l(100,"div",44),e(101,` 745 `),l(102,"div",30),e(103,` 746 `),l(104,"a",45),v("click",function(){y(t);let n=d();return h(n.fetchData())}),e(105,` 747 `),C(106,Kr,3,0),e(107,` 748 Run Report 749 `),s(),e(108,` 750 `),s(),e(109,` 751 `),s(),e(110,` 752 `),l(111,"div",46),e(112,` 753 `),C(113,xo,11,3),s(),e(114,` 754 `),s(),e(115,` 755 `)}if(o&2){let t=d();a(3),f("@slideInOut",t.currentReport?"in":"out"),a(14),I("ngModel",t.currentReport),f("options",t.reports)("optionLabel","label")("filter",!0)("placeholder","Select a Report"),a(8),g(t.saveMenuItems?25:-1),a(5),f("@slideInOut",!((t.currentQuery==null?null:t.currentQuery.queryID)>0)&&(t.modelOptions==null?null:t.modelOptions.length)>0?"in":"out"),a(14),g(t.modelOptions&&t.currentModel?44:-1),a(5),g(t.currentQuery&&t.currentQuery.queryFilters.length>0?49:-1),a(),f("@slideInOut",t.queryViewState===t.QueryViewState.EDITING_QUERY?"in":"out"),a(9),f("@slideInOut",t.queryViewState===t.QueryViewState.EDITING_QUERY?"in":"out"),a(4),g(t.loadingModel?63:-1),a(),g(t.currentModel&&!t.loadingModel?64:-1),a(4),g(t.loadingModel?68:-1),a(5),g(t.currentQuery&&!t.loadingModel?73:-1),a(7),f("@slideInOut",t.queryViewState===t.QueryViewState.EDITING_QUERY?"in":"out"),a(13),g(t.loadingModel?93:-1),a(),g(t.loadingModel?-1:94),a(12),g(t.fetching?106:-1),a(5),f("@slideInOut",t.queryViewState!==t.QueryViewState.EDITING_QUERY?"in":"out"),a(2),g(t.queryResult?113:-1)}}
755function To(o,c){if(o&1){let t=S();e(0,` 756 `),l(1,"app-email-compose",100),v("send",function(){y(t);let n=d();return h(n.hideComposeEmail())})("cancel",function(){y(t);let n=d();return h(n.hideComposeEmail())}),e(2,` 757 `),s(),e(3,` 758 `)}if(o&2){let t=d();a(),f("recipients",t.players)("emailTemplateType",t.EmailTemplateType.GENERAL)("showSaveDraftButton",!0)("showSteps",!1)("showHeader",!1)("emailCategoryID",t.EmailCategoryLV.CLUB_COMMUNICATIONS)("hideSearch",!0)("selectRecipientsButtonText","Continue")}}function vo(o,c){if(o&1){let t=S();e(0,` 759`),l(1,"app-yes-no-modal",101),v("onYesSelect",function(){y(t);let n=d();return h(n.confirmChangeModel())})("onNoSelect",function(){y(t);let n=d();return h(n.cancelChangeModel())}),e(2,` 760`),s(),e(3,` 761`)}}function Fo(o,c){if(o&1){let t=S();e(0,` 762`),l(1,"app-yes-no-modal",102),v("onYesSelect",function(){y(t);let n=d();return h(n.confirmRemoveQuery())})("onNoSelect",function(){y(t);let n=d();return h(n.cancelRemoveQuery())}),s(),e(2,` 763`)}}function Eo(o,c){if(o&1){let t=S();e(0,` 764`),l(1,"app-yes-no-modal",103),v("onYesSelect",function(){y(t);let n=d();return h(n.confirmGlobalTemplateAction())})("onNoSelect",function(){y(t);let n=d();return h(n.cancelGlobalTemplateAction())}),s(),e(2,` 765`)}}function bo(o,c){if(o&1){let t=S();e(0,` 766 `),l(1,"app-dynamic-form",104),v("onSubmit",function(n){y(t);let r=d();return h(r.saveNewReportButtonClick(n))})("onCancel",function(){y(t);let n=d();return h(n.cancelSaveNewReport())}),e(2,` 767 `),l(3,"app-dynamic-form-field",105),e(4,` 768 `),s(),e(5,` 769 `),s(),e(6,` 770 `)}if(o&2){let t=d();a(),f("fields",j(7,Xe,t.renameField))("entity",t.currentQuery)("contentFieldsMode",!0)("horizontalForm",!0)("showCancelButton",!0)("showSubmitButton",!0)("buttonsPosition","left")}}function Io(o,c){if(o&1){let t=S();e(0,` 771 `),l(1,"app-dynamic-form",106),v("onSubmit",function(n){y(t);let r=d();return h(r.renameQuery(n))})("onCancel",function(){y(t);let n=d();return h(n.cancelRenameQuery())}),e(2,` 772 `),l(3,"app-dynamic-form-field",105),e(4,` 773 `),s(),e(5,` 774 `),s(),e(6,` 775 `)}if(o&2){let t=d();a(),f("fields",j(8,Xe,t.renameField))("entity",t.currentQuery)("contentFieldsMode",!0)("horizontalForm",!0)("showCancelButton",!0)("showSubmitButton",!0)("buttonsPosition","left")("modalContent",!0)}}function wo(o,c){if(o&1){let t=S();e(0,` 776 `),l(1,"app-dynamic-form",107),v("onSubmit",function(n){y(t);let r=d();return h(r.saveReportCopy(n))})("onCancel",function(){y(t);let n=d();return h(n.cancelRenameQuery())}),e(2,` 777 `),l(3,"app-dynamic-form-field",105),e(4,` 778 `),s(),e(5,` 779 `),s(),e(6,` 780 `)}if(o&2){let t=d();a(),f("fields",j(9,Xe,t.renameField))("entity",X(11,Ji))("contentFieldsMode",!0)("horizontalForm",!0)("showCancelButton",!0)("showSubmitButton",!0)("buttonsPosition","left")("submitButtonText","Save Copy")("modalContent",!0)}}function Ro(o,c){if(o&1){let t=S();e(0,` 781 `),l(1,"app-dynamic-form",107),v("onSubmit",function(n){y(t);let r=d();return h(r.saveReportCopyAsTemplate(n))})("onCancel",function(){y(t);let n=d();return h(n.cancelRenameQuery())}),e(2,` 782 `),l(3,"app-dynamic-form-field",105),e(4,` 783 `),s(),e(5,` 784 `),s(),e(6,` 785 `)}if(o&2){let t=d();a(),f("fields",j(9,Xe,t.renameField))("entity",X(11,Ji))("contentFieldsMode",!0)("horizontalForm",!0)("showCancelButton",!0)("showSubmitButton",!0)("buttonsPosition","left")("submitButtonText","Save Copy As Template")("modalContent",!0)}}function Do(o,c){o&1&&(e(0,` 786 `),l(1,"span"),e(2,"This will save this report as a template available to all users at this client."),s(),e(3,` 787 `))}function Lo(o,c){o&1&&(e(0,` 788 `),l(1,"span")(2,"b"),e(3,`This will save this report as a template available to all users at all 789 clients.`),s()(),e(4,` 790 `))}function Oo(o,c){if(o&1){let t=S();e(0,` 791 `),l(1,"app-dynamic-form",107),v("onSubmit",function(n){y(t);let r=d(2);return h(r.saveReportAsTemplate(n))})("onCancel",function(){y(t);let n=d(2);return h(n.cancelSaveReportAsTemplate())}),e(2,` 792 `),l(3,"app-dynamic-form-field",105),e(4,` 793 `),s(),e(5,` 794 `),s(),e(6,` 795 `)}if(o&2){let t=d(2);a(),f("fields",j(9,Xe,t.renameField))("entity",t.currentQuery)("contentFieldsMode",!0)("horizontalForm",!0)("showCancelButton",!0)("showSubmitButton",!0)("buttonsPosition","left")("submitButtonText","Save As Template")("modalContent",!0)}}function Qo(o,c){if(o&1){let t=S();e(0,` 796`),l(1,"p-dialog",15),R("visibleChange",function(n){y(t);let r=d();return w(r.showSaveReportAsTemplateDialog,n)||(r.showSaveReportAsTemplateDialog=n),h(n)}),e(2,` 797 `),C(3,Do,4,0),C(4,Lo,5,0),C(5,Oo,7,11),s(),e(6,` 798`)}if(o&2){let t=d();a(),I("visible",t.showSaveReportAsTemplateDialog),f("closable",!1),a(2),g(t.clubID>0?3:-1),a(),g(t.clubID===0?4:-1),a(),g(t.currentQuery?5:-1)}}function Mo(o,c){if(o&1){let t=S();e(0,` 799 `),l(1,"app-dialog-footer"),e(2,` 800 `),ht(3,108),e(4,` 801 `),l(5,"button",109),v("click",function(){y(t);let n=d();return h(n.showChangeClubModal=!1)}),e(6,"No"),s(),e(7,` 802 `),Ct(),e(8,` 803 `),ht(9,110),e(10,` 804 `),l(11,"button",111),v("click",function(){y(t);let n=d();return h(n.goToClub())}),e(12,"Yes"),s(),e(13,` 805 `),Ct(),e(14,` 806 `),s(),e(15,` 807 `)}}var Zi=(()=>{let c=class c{constructor(i,n,r,u,m,x,T,D){this.queryStore=i,this.route=n,this.router=r,this.cdr=u,this.siteDataService=m,this.customReportService=x,this.reportService=T,this.authorizeService=D,this.unsubscribe$=new Y,this.EmailCategoryLV=Qi,this.renameField={name:"name",dynamicFormFieldTypeID:si.TEXT,key:"name",controlName:"name",label:"Name",required:!0,hasS
807pellCheck:!1},this.QueryViewState=ne,this.DataType=A,this.showComposeEmail=!1,this.EmailTemplateType=Mi,this.initialLoad=!0,this.Permission=me,this.showChangeClubModal=!1;let V=this.router.getCurrentNavigation()??this.router.lastSuccessfulNavigation();V?.extras.state&&(this.customReportService.state=V.extras.state.filters,this.runAfterLoad=V.extras.state.run)}ngOnInit(){this.siteDataService.showSiteLoader(),this.queryStore.initialize(),this.queryStore.select(i=>({currentModel:i.currentModel,modelOptions:i.modelOptions,allTables:i.currentModelReportTableAliases,allFields:i.currentModelReportFieldAliases,showComposeEmail:i.showComposeEmail,players:i.players,reports:i.reports})).pipe(Q(this.unsubscribe$)).subscribe(i=>{if(this.modelOptions=i.modelOptions,this.currentModel=i.currentModel,this.currentModelReportTableAliases=i.allTables,this.currentModelReportFieldAliases=i.allFields,this.showComposeEmail=i.showComposeEmail,this.players=i.players,this.reports=i.reports,this.addFilterMenu=[],this.currentModel)for(let n=0;n<this.currentModel.reportEntities.length;n++){let r=this.currentModel.reportEntities[n],u={label:r.name,items:[]};for(let m=0;m<r.entityFields.length;m++){let x=r.entityFields[m],D={label:x.displayNameOverride??this.getReportField(x.reportFieldID).displayName,command:()=>{this.addFilter(x.reportEntityFieldID)}};u.items.push(D)}this.addFilterMenu.push(u)}this.cdr.markForCheck()}),this.queryStore.select(i=>({queryResult:i.queryResult,chunkSettings:i.chunkSettings,playerIDIndex:i.playerIDIndex,playerNameIndex:i.playerNameIndex,clubIDIndex:i.clubIDIndex,clubNameIndex:i.clubNameIndex,clubSubdomainIndex:i.clubSubdomainIndex,showLinkToPlayerProfile:i.showLinkToPlayerProfile})).pipe(Q(this.unsubscribe$)).subscribe(i=>{this.queryResult=i.queryResult,this.chunkSettings=i.chunkSettings,this.cdr.markForCheck(),this.playerIDIndex=i.playerIDIndex,this.playerNameIndex=i.playerNameIndex,this.clubIDIndex=i.clubIDIndex,this.clubNameIndex=i.clubNameIndex,this.clubSubdomainIndex=i.clubSubdomainIndex,this.showLinkToPlayerProfile=i.showLinkToPlayerProfile,this.queryResult&&(this.visibleColumns=this.queryResult.resultSet.columns.filter(n=>!n.isHidden))}),this.queryStore.select(i=>({currentQuery:i.currentQuery,currentReport:i.currentReport})).pipe(Q(this.unsubscribe$),ye(i=>!!i.currentQuery)).subscribe(i=>{this.currentQuery=i.currentQuery,this.currentReport=i.currentReport}),this.queryStore.select(i=>({queryViewState:i.queryViewState,saveMenuItems:i.saveMenuItems,savedQueries:i.savedQueries,showSaveReportAsTemplateDialog:i.showSaveReportAsTemplateDialog,showSaveCopyPromptDialog:i.showSaveCopyPromptDialog,showSaveCopyAsTemplatePromptDialog:i.showSaveCopyAsTemplatePromptDialog,showRemoveReportDialog:i.showRemoveReportDialog,showRenameReportDialog:i.showRenameReportDialog,showChangeModelDiscardChangesDialog:i.showChangeModelDiscardChangesDialog,showSaveNewReportDialog:i.showSaveNewReportDialog,showGlobalTemplateWarningDialog:i.showGlobalTemplateWarningDialog,savingQuery:i.savingQuery})).pipe(Q(this.unsubscribe$)).subscribe(i=>{this.queryViewState=i.queryViewState,this.saveMenuItems=i.saveMenuItems,this.savedQueries=i.savedQueries,this.showSaveReportAsTemplateDialog=i.showSaveReportAsTemplateDialog,this.showSaveCopyPromptDialog=i.showSaveCopyPromptDialog,this.showSaveCopyAsTemplatePromptDialog=i.showSaveCopyAsTemplatePromptDialog,this.showRemoveReportDialog=i.showRemoveReportDialog,this.showRenameReportDialog=i.showRenameReportDialog,this.showChangeModelDiscardChangesDialog=i.showChangeModelDiscardChangesDialog,this.showSaveNewReportDialog=i.showSaveNewReportDialog,this.showGlobalTemplateWarningDialog=i.showGlobalTemplateWarningDialog,this.savingQuery=i.savingQuery,this.cdr.markForCheck()}),this.queryStore.select(i=>({initializing:i.initializing,fetchingData:i.fetchingData,clubID:i.clubID})).pipe(Q(this.unsubscribe$)).subscribe(i=>{this.clubID=i.clubID,this.initializing=i.initializing,this.initializing||this.initialize(),this.fetching=i.fetchingData,this.cdr.markForCheck()}),this.queryStore.select(i=>i.loadingModel).pipe(Q(this.unsubscribe$)).subscribe(i=>{this.loadingModel=i,this.cdr.markForCheck()})}allEntityFields(){return this.currentModel.reportEntities.map(i=>i.reportEntityID.toString())}showTable(){return this.queryViewState!==ne.EDITING_QUERY&&!!this.queryResult}entityQueryFieldDropped(i){let n=i.currentIndex,r=i.previousIndex;this.queryStore.moveQueryFieldInQuery(r,n)}getEntityField(i){for(let n=0;n<this.currentModel.reportEntities.length;n++){let r=this.currentModel.reportEntities[n];for(let u=0;u<r.entityFields.length;u++){let m=r.entityFields[u];if(m.reportEntityFieldID===i)return m}}return null}getEntity(i){for(let n=0;n<this.currentModel.reportEntities.length;n++){let r=this.currentModel.reportEntities[n];for(let u=0;u<r.entityFields.length;u++)if(r.entityFields[u].reportEntityFieldID===i)return r}return null}getQueryConditionLabel(i){let n=this.getEntityField(i.reportEntityFieldID);return this.queryStore.getOperatorsByDataType(n.dataTypeID).find(u=>u.operatorType===i.operatorID)?.caption}getQueryConditionFieldName(i){if(i.reportEntityFieldID>0){let n=this.getEntityField(i.reportEntityFieldID),r=this.getReportField(n.reportFieldID);return n.displayNameOverride??r.displayName}}changeReport(i){this.router.navigate(["admin/reports/"+i.routerLink],{state:{run:!1,reportType:i.value}}),i.isCustom&&(this.runAfterLoad=!1,this.initialize())}runPrimarySaveAction(i){this.saveMenuItems?.[0]?.command?.(i)}getQueryConditionEntityFieldItems(i){let n=[];for(let r=0;r<this.currentModel.reportEntities.length;r++){let u=this.currentModel.reportEntities[r],m={label:u.name,items:[]};for(let x=0;x<u.entityFields.length;x++){let T=u.entityFields[x],V={label:T.displayNameOverride??this.getReportField(T.reportFieldID).displayName,command:()=>{this.setFilterEntityField(i.queryConditionID,T.reportEntityFieldID)}};m.items.push(V)}n.push(m)}this.queryConditionEntityFieldItems=n}getQueryConditionOperatorMenuItems(i){let n=this.getEntityField(i.reportEntityFieldID),r=this.queryStore.getOperatorsByDataType(n.dataTypeID,n.fieldLookupTypeID>0);this.queryConditionOperatorMenuItems=r.map(u=>({label:u.caption,command:()=>{this.queryStore.setFilterOperator(i.queryConditionID,u.operatorType)}}))}getReportField(i){return this.currentModelReportFieldAliases[i]}hideComposeEmail(){this.queryStore.hideComposeEmail()}initialize(){wt([this.route.params,this.route.queryParams]).pipe(Q(this.unsubscribe$),It(i=>({queryID:i[0].queryID,runAfterLoad:i[1].run??!1})),Lt($i.isEqual)).subscribe(i=>{if(this.currentQueryID!=i.queryID)if(i.queryID==="new")this.currentQueryID="new",this.queryStore.initializeNewQuery();else{let n=+i.queryID;this.currentQueryID=n,this.queryStore.initializeQuery(n,i.runAfterLoad||this.runAfterLoad)}})}entityInQuery(i){return this.currentQuery.queryFields.some(n=>n.reportEntityID===i)}entityFieldInQuery(i){return this.currentQuery.queryFields.some(n=>n.reportEntityFieldID===i)}toggleEntityInQuerySelection(i){this.queryStore.toggleEntityInQuerySelection(i)}toggleEntityFieldInQuerySelection(i){this.queryStore.toggleEntityFieldInQuerySelection(i)}removeQueryCondition(i){this.queryStore.removeQueryCondition(i)}toggleEntityExpanded(i){this.queryStore.toggleEntityExpanded(i)}lazyLoad(i){if(i){let n={offset:i.first,limit:i.rows};i.sortField!=null&&i.sortField!==""&&(n.sortColumnIndex=+i.sortField,n.sortDirection=i.sortOrder>0?Fe.ASC:Fe.DESC),this.initialLoad?this.initialLoad=!1:this.queryStore.fetchData(n)}else this.queryStore.fetchData()}addFilter(i){this.queryStore.addFilter(i)}setFilterEntityField(i,n){this.queryStore.setFilterEntityField(i,n)}fetchData(){if(!this.validate()){this.siteDataService.showSiteErrorAlert(this.errorMessages);return}this.reportTable&&(this.reportTable.sortField=null,this.reportTable.sortOrder=1,this.reportTable.tableService.onSort(null)),this.queryStore.fetchData()}validate(){return this.errorMessages="",this.currentQuery.queryFilters.find(n=>n.reportFilter.customReportFilterTypeID===p.PROGRAM)&&!this.customReportService.filters.programID?(this.errorMessages="Must select a program.",!1):!0}editReportButtonClick(){this.queryStore.editReport()}tryChangeModel(i){this.queryStore.tryChangeModel(i)}cancelChangeModel(){this.queryStore.cancelChangeModel()}confirmChangeModel(){this.queryStore.confirmChangeModel()}cancelRenameQuery(){this.queryStore.cancelRenameQuery()}renameQuery(i){let n=i.name;this.queryStore.renameAndSaveReport(n)}saveReportCopy(i){this.queryStore.saveCopyOfReport(i.name)}saveReportCopyAsTemplate(i){this.queryStore.saveCopyOfReportAsTemplate(i.name)}confirmRemoveQuery(){this.queryStore.removeQuery()}cancelRemoveQuery(){this.queryStore.hideRemoveQuery()}confirmGlobalTemplateAction(){this.queryStore.confirmGlobalTemplateAction()}cancelGlobalTemplateAction(){this.queryStore.cancelGlobalTemplateAction()}saveReportAsTemplate(i){this.queryStore.saveReportAsTemplate(i.name)}cancelSaveReportAsTemplate(){this.queryStore.hideSaveReportAsTemplate()}saveNewReportButtonClick(i){this.queryStore.saveCurrentReport(i.name)}cancelSaveNewReport(){this.queryStore.hideShowSaveNewReport()}exportDataButtonClick(){this.queryStore.fetchData(null,!0)}emailDataButtonClick(){this.queryStore.sendEmail()}setupModal(i,n,r){this.playerID=i,this.subdomain=n,this.clubName=r,this.showChangeClubModal=!0}goToClub(){this.authorizeService.removeUser(),window.location.href=`${window.location.origin.replace(/(\/\/)([\w\d-])*\./i,`//${this.subdomain}.`)}/admin/players/${this.playerID}/overview`}ngOnDestroy(){this.unsubscribe$.next(null),this.unsubscribe$.complete()}};c.\u0275fac=function(n){return new(n||c)(M(re),M(tt),M(te),M(Ut),M(z),M(Ee),M(Te),M(xe))},c.\u0275cmp=H({type:c,selectors:[["ng-component"]],viewQuery:function(n,r){if(n&1&&Qt(Er,5),n&2){let u;Mt(u=At())&&(r.reportTable=u.first)}},standalone:!1,features:[qt([re])],decls:40,vars:31,consts:[["item",""],["currentModelSelect",""],["queryFieldDragElement",""],["addFilter",""],["addFilterM",""],["queryCondition",""],["changeFilter",""],["changeFilterMenu",""],["changeFilterOperation",""],["changeFilterOperationMenu",""],["reportTable",""],["role","main"],[1,"ml-0"],[1,"d-flex","justify-content-between","border-bottom","mb-3"],["parentLinkUrl","../../","parentLinkText"," Reports",3,"pageTitle","hideBorder","showBackButton"],["header","Save Report",3,"visibleChange","visible","closable"],["header","Re
807name Query","styleClass","standardWidthDialog",3,"visibleChange","visible","showHeader","closable","modal","draggable"],["header","Copy Report",3,"visibleChange","visible","closable"],["header","Copy Report as Template",3,"visibleChange","visible","closable"],["styleClass","shortWidthDialog",3,"visibleChange","header","visible"],["pTemplate","footer"],[1,"card"],[1,"row","mb-3","justify-content-between"],[1,"col-md-auto"],[1,"form-group","horizontal-form","form-select"],["for","report-selector"],[1,"text-medium","fw-700","text-uppercase","mb-0","mr-5"],["inputId","report-selector",3,"ngModelChange","ngModel","options","optionLabel","filter","placeholder"],[1,"mb-3"],[1,"row","mb-2"],[1,"col"],["for","currentModel",1,"mr-3"],[1,"card-heading","mb-2"],[1,"row"],[1,"col","card-subheading","mb-2"],[1,"entity-panel-container"],[1,"entity-panel","border-right"],[1,"query-panel"],[1,"entity-children"],[1,"entity"],[1,""],[1,"row","my-3"],[1,"entity-panel-container","bg-white","mb-3"],[1,"filter-panel"],[1,"row","mb-3"],["href","javascript:void(0)",1,"btn","btn-primary",3,"click"],[1,"table-responsive","report-table"],[1,"d-flex","justify-content-between","align-items-center","full-width"],[1,"flex-grow-1"],["label","Custom","size","small"],[1,"col-md-auto","d-flex","justify-content-end","align-items-center","pl-0","title-button-row"],["href","javascript:void(0)",1,"btn","btn-sm",3,"click","hidden"],["icon","fa-regular fa-plus",3,"onClick","hidden","label","model"],[1,"btn","btn-sm",3,"click","hidden"],[1,"fas","fa-pencil"],[1,"fal","fa-table"],[1,"fal","fa-at"],["id","currentModel",3,"change","disabled"],[3,"value","selected"],["icon","fa-regular fa-plus",3,"onClick","hidden","label","model","styleClass"],[1,"btn","btn-sm",3,"click"],["href","javascript:void(0)",1,"btn","btn-sm",3,"click"],[1,"col","mr-3"],[3,"spinnerStyle"],[1,"entity-header"],["href","javascript:void(0)",1,"entity-header-button",3,"click","title"],[1,"mr-1",3,"click"],["href","javascript:void(0)",3,"click"],[1,"entity-fields",3,"id","hidden"],[1,"fa","fa-caret-right"],[1,"fa","fa-caret-down"],[1,"fa","fa-square-check"],[1,"fa","fa-square-dashed"],[1,"entity-field"],[3,"click"],["cdkDropList","",1,"entity-fields",3,"cdkDropListDropped","cdkDropListData"],["cdkDrag","",1,"row","mr-0","ml-0","entity-field","mb-1","btn-success","align-items-center",3,"id"],[1,"col-sm-1"],[1,"btn","btn-tertiary-inverted","btn-sm"],[1,"fa","fa-ellipsis-vertical","fa-width-auto"],[1,"col-sm-10"],[1,"fal","fa-circle-xmark"],[1,"entity-fields"],[1,"row","mr-0","ml-0","my-2"],[1,"fa","fa-plus"],["appendTo","body",3,"model","popup"],[1,"row","mr-0","ml-0","py-2","border-bottom","align-items-center",3,"mouseover","mouseleave"],[1,"col-sm"],[1,"col","d-flex","align-items-center"],[1,"flex-grow-1","mr-2",3,"conditionID"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"],[1,"card-heading"],[1,"ml-3","text-small"],["styleClass","table-sticky-header",1,"table","table-striped","table-sm",3,"onLazyLoad","columns","value","lazy","loading","paginator","totalRecords","rows"],["pTemplate","header"],["pTemplate","body"],[3,"pSortableColumn"],[3,"field"],[1,"total-table-body"],[3,"routerLink"],[3,"send","cancel","recipients","emailTemplateType","showSaveDraftButton","showSteps","showHeader","emailCategoryID","hideSearch","selectRecipientsButtonText"],["modalText","There are unsaved changes to this report. Discard changes and continue?","headerText","Unsaved Changes",3,"onYesSelect","onNoSelect"],["modalText"," Are you sure you want to remove this query?","headerText","Remove Query",3,"onYesSelect","onNoSelect"],["modalText","This report is a shared template that is pushed down to ALL clubs in the system. Saving, renaming, or removing it will change this report for every club. Are you sure you want to continue?","headerText","Shared Report Template",3,"onYesSelect","onNoSelect"],[3,"onSubmit","onCancel","fields","entity","contentFieldsMode","horizontalForm","showCancelButton","showSubmitButton","buttonsPosition"],["fieldName","name"],[3,"onSubmit","onCancel","fields","entity","contentFieldsMode","horizontalForm","showCancelButton","showSubmitButton","buttonsPosition","modalContent"],[3,"onSubmit","onCancel","fields","entity","contentFieldsMode","horizontalForm","showCancelButton","showSubmitButton","buttonsPosition","submitButtonText","modalContent"],["slot","secondary"],[1,"btn","btn-secondary",3,"click"],["slot","primary"],[1,"btn","btn-primary",3,"click"]],template:function(n,r){n&1&&(l(0,"main",11),e(1,` 808 `),l(2,"div",12),e(3,`
809 `),l(4,"div",13),e(5,` 810 `),b(6,"app-admin-header",14),e(7,` 811 `),s(),e(8,` 812 `),C(9,So,116,22),s(),e(10,` 813 814 `),C(11,To,4,8),s(),e(12,` 815 816`),C(13,vo,4,0),C(14,Fo,3,0),C(15,Eo,3,0),l(16,"p-dialog",15),R("visibleChange",function(m){return w(r.showSaveNewReportDialog,m)||(r.showSaveNewReportDialog=m),m}),e(17,` 817 `),C(18,bo,7,9),s(),e(19,` 818 819 820`),l(20,"p-dialog",16),R("visibleChange",function(m){return w(r.showRenameReportDialog,m)||(r.showRenameReportDialog=m),m}),e(21,` 821 `),l(22,"div"),e(23,` 822 `),C(24,Io,7,10),s(),e(25,` 823`),s(),e(26,` 824 825 826`),l(27,"p-dialog",17),R("visibleChange",function(m){return w(r.showSaveCopyPromptDialog,m)||(r.showSaveCopyPromptDialog=m),m}),e(28,` 827 828 `),C(29,wo,7,12),s(),e(30,` 829 830`),l(31,"p-dialog",18),R("visibleChange",function(m){return w(r.showSaveCopyAsTemplatePromptDialog,m)||(r.showSaveCopyAsTemplatePromptDialog=m),m}),e(32,` 831 832 `),C(33,Ro,7,12),s(),e(34,` 833 834 835`),C(35,Qo,7,5),l(36,"p-dialog",19),R("visibleChange",function(m){return w(r.showChangeClubModal,m)||(r.showChangeClubModal=m),m}),e(37),je(38,Mo,16,0,"ng-template",20),e(39,` 836`),s()),n&2&&(a(6),f("pageTitle","Custom Reports")("hideBorder",!0)("showBackButton",!0),a(3),g((!r.initializing||!r.loadingModel)&&!r.showComposeEmail?9:-1),a(2),g(r.showComposeEmail?11:-1),a(2),g(r.showChangeModelDiscardChangesDialog===!0?13:-1),a(),g(r.showRemoveReportDialog===!0?14:-1),a(),g(r.showGlobalTemplateWarningDialog===!0?15:-1),a(),I("visible",r.showSaveNewReportDialog),f("closable",!1),a(2),g(r.currentQuery?18:-1),a(2),I("visible",r.showRenameReportDialog),f("showHeader",!0)("closable",!1)("modal",!0)("draggable",!1),a(4),g(r.currentQuery?24:-1),a(3),Ce("min-height","500px"),I("visible",r.showSaveCopyPromptDialog),f("closable",!1),a(2),g(r.currentQuery?29:-1),a(2),Ce("min-height","500px"),I("visible",r.showSaveCopyAsTemplatePromptDialog),f("closable",!1),a(2),g(r.currentQuery?33:-1),a(2),g(r.showSaveReportAsTemplateDialog?35:-1),a(),f("header","Navigate To "+r.clubName),I("visible",r.showChangeClubModal),a(),O(` 837 To see this account you will be taken to `,r.clubName,` site, do you wish to proceed? 838 `))},dependencies:[it,Ht,li,ut,fi,ci,Ci,yi,Ze,et,ge,fe,rt,ui,pi,di,oi,ot,Si,xi,Ri,Vi,Li,ji,zi,Wt,Bt,gi],styles:[".entity-panel[_ngcontent-%COMP%], .query-panel[_ngcontent-%COMP%]{flex-basis:0;flex-grow:1;overflow:auto;height:600px}.filter-panel[_ngcontent-%COMP%]{flex-basis:0;flex-grow:1;overflow:auto;border-radius:var(--border-radius)}.entity-panel-container[_ngcontent-%COMP%], .query-filter-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;margin:0;border:var(--border);border-radius:var(--border-radius);background:var(--grey-50);position:relative}.query-panel[_ngcontent-%COMP%]{padding-top:5px}.entity-children[_ngcontent-%COMP%]{float:left;width:100%}.entity[_ngcontent-%COMP%]{clear:both}.entity-header[_ngcontent-%COMP%]{border-bottom:1px solid var(--grey-300);padding:3px 0;white-space:nowrap}.entity-header[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{display:inline-block;cursor:pointer;font:700 15px Calibri;white-space:nowrap;margin:0}.entity-header[_ngcontent-%COMP%] .entity-header-button[_ngcontent-%COMP%]{display:inline-block;padding:4px 10px 7px}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:var(--border-radius);background:var(--color-white);
838box-shadow:var(--box-shadow)}.entity-fields[_ngcontent-%COMP%]{float:left;width:100%;min-height:20px}.show-dropzone[_ngcontent-%COMP%]{border:2px solid var(--green-300)!important}.entity-field[_ngcontent-%COMP%]{outline:none!important}.entity-field[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:var(--grey-900);font-size:var(--text-medium);font-weight:400;padding:0 0 0 5px;display:inline-block;cursor:pointer;white-space:nowrap;margin-left:30px}.level_2[_ngcontent-%COMP%], .level_3[_ngcontent-%COMP%], .level_4[_ngcontent-%COMP%]{border-left:var(--border)}.level_2[_ngcontent-%COMP%]{padding-left:1.5rem;margin-right:.5rem}.title-button-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-left:1rem}"],data:{animation:[hi]}});let o=c;return o})();var en=(()=>{let c=class c{constructor(i,n){this.router=i,this.siteDataService=n,this.unsubscribe$=new Y}ngOnInit(){this.siteDataService.showSiteLoader()}ngOnDestroy(){this.unsubscribe$.next(null),this.unsubscribe$.complete()}};c.\u0275fac=function(n){return new(n||c)(M(te),M(z))},c.\u0275cmp=H({type:c,selectors:[["ng-component"]],standalone:!1,decls:3,vars:0,template:function(n,r){n&1&&(e(0,` 839`),b(1,"router-outlet"),e(2,` 840`))},dependencies:[zt],encapsulation:2});let o=c;return o})();var tn=(()=>{let c=class c{};c.\u0275fac=function(n){return new(n||c)},c.\u0275mod=Je({type:c}),c.\u0275inj=$e({imports:[ft.forChild([{path:"",component:en,canActivateChild:[lt],children:[{path:":queryID",component:Zi,canActivateChild:[lt]},{path:"",component:Ki,canActivateChild:[lt]}]}]),ft]});let o=c;return o})();var ha=(()=>{let c=class c{};c.\u0275fac=function(n){return new(n||c)},c.\u0275mod=Je({type:c}),c.\u0275inj=$e({providers:[ve,Se,pt,dt],imports:[tn,Fi,Ei,Ti,Di,Ni,Oi]});let o=c;return o})();export{ha as QueryModule};
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.