1import{a as ut}from"./chunk-JRPFWWR4.js";import{a as pt,b as mt}from"./chunk-2L7BC3FF.js";import{a as ae}from"./chunk-JEL6HJ7P.js";import{Da as Ge,Dc as oe,Ea as Ke,F as ze,Hc as ct,L as z,Mb as lt,Nb as dt,Qa as te,Ua as Je,Va as Xe,Wa as Ze,Xa as ie,Ya as et,aa as Ue,c as Me,gb as ne,hb as tt,ib as it,jb as nt,ma as $e,n as We,o as He,ra as Ye,sa as q,tb as ot,ub as at,vb as rt,wb as st}from"./chunk-YQOD7X2Z.js";import"./chunk-563YFTIG.js";import"./chunk-36JN3LZY.js";import{ra as Qe,sa as qe}from"./chunk-WPHW6CRH.js";import{K as Ne,c as Oe,h as Le,o as Fe,r as je}from"./chunk-76O7YCWW.js";import{a as Ae,c as B,d as Be,e as P,k as Pe}from"./chunk-YYIIKC2W.js";import"./chunk-3WYGUSDH.js";import{a as Ve,c as Ie}from"./chunk-LU7SZU5X.js";import{A as De,i as Ee,j as ee,t as H,z as Te}from"./chunk-PO2RDVKE.js";import{Ab as me,Ac as T,Bc as fe,Cc as ge,E as J,Ec as S,Fc as k,Gc as R,J as ce,M as X,Oc as Se,Pb as v,Rb as w,Tb as O,Tc as A,Ub as L,Vb as F,Vc as j,Wb as C,Wc as ke,Xb as a,Yb as r,Yc as Ce,Za as pe,Zb as x,_c as Re,ca as Q,da as xe,db as d,ec as y,g as we,ga as D,jc as g,lc as p,n as Y,oa as _,pa as h,pb as b,pc as ue,qc as _e,rc as he,s as G,ub as I,uc as Z,vb as be,wc as ye,y as K,zc as c}from"./chunk-3URBZWPM.js";import{a as U,b as $}from"./chunk-ODN5LVDJ.js";var _t=["TP Main Contact","Exams Officer","Tutor","EPA centre contact"],ht=["TP Main Contact","Exams Officer","EPA centre contact"],ft=["TP Main Contact","Exams Officer"],gt=["admin","staff"];var V={"2c85984f-9129-eb11-8114-00505693c1d6":{epa:"01f822bb-3bc4-ee11-817b-00155da07a74",shortName:"EPA L2 v1.4"},"4efd1649-ba34-eb11-810c-005056930a83":{epa:"6b2ccdf6-c8a0-ef11-81ca-00155da0a6fb",shortName:"EPA L4 v1.2"}};var Ct=(()=>{let s=class s{constructor(t){this.locale=t,this._index=0}buildTables(t,e,i=!0){let l=[];if(!e?.length)return l;if(i){let f=e.reduce(function(u,m){return u[m.qualificationId]=u[m.qualificationId]||[],u[m.qualificationId].push(m),u},Object.create(null));for(let u in f){let m=f[u];l.push(this._buildTable(t,m,u,m[0].qualificationName))}}else l.push(this._buildTable(t,e));return l}_buildTable(t,e,i,l){let f=e.map(u=>({name:`${u.givenName} ${u.familyName}`,studentId:u.memberId,dob:Ee(u.birthDate,"dd MMM yyyy",this.locale),centre:u.trainingProviderName}));return this._index++,{type:t,heading:this._getTableHeading(t,i,l),qualificationId:i,qualificationName:l,rowData:f,confirmation:{content:{id:`confirmation-checkbox-${this._index}`,label:this._getConfirmationCopy(t,i),checkboxPosition:"right"},isChecked:!1}}}_getTableHeading(t,e,i){switch(t){case"qual":return`${i} \u2013 the following student(s) will be removed from this qualification at the centre(s) displayed`;case"student":return"The following student(s) will be removed from the centre(s) displayed";case"epa-true":return`${i} \u2013 the following student(s) will be marked as studying this as part of the ${V[e].shortName} apprenticeship`;case"epa-false":return`${i} \u2013 the following student(s) will be marked as NOT studying this as part of the ${V[e].shortName} apprenticeship`}}_getConfirmationCopy(t,e){switch(t){case"qual":return"By ticking this box, you confirm the student(s) will be removed from this qualification at the centre(s) displayed.";case"student":return"By ticking this box, you confirm the student(s) will be removed from the centre(s) displayed.";case"epa-true":return`By ticking this box, you confirm the student(s) are studying this as part of the ${V[e].shortName} apprenticeship.`;case"epa-false":return`By ticking this box, you confirm the student(s) are NOT studying this as part of the ${V[e].shortName} apprenticeship.`}}};s.\u0275fac=function(e){return new(e||s)(D(Re))},s.\u0275prov=Q({token:s,factory:s.\u0275fac,providedIn:"root"});let n=s;return n})();var re=(()=>{let s=class s{createHeaders(){return{headers:new Ve({"Content-Type":"application/json",Authorization:this.ssrCookieService.get("access_token")})}}constructor(t,e){this.httpClient=t,this.ssrCookieService=e}filter(t){return this.httpClient.post(ae.API_URL+"/programme-registration/filter",t,this.createHeaders())}remove(t){return this.httpClient.post(ae.API_URL+"/programme-registration/removeStudent",t,this.createHeaders())}updateEpaField(t){return this.httpClient.post(ae.API_URL+"/programme-registration/update-epas",t,this.createHeaders())}};s.\u0275fac=function(e){return new(e||s)(D(Ie),D(Me))},s.\u0275prov=Q({token:s,factory:s.\u0275fac,providedIn:"root"});let n=s;return n})();var M=(()=>{let s=class s{constructor(t,e,i){this.contactService=t,this.tableBuilder=e,this.programmeRegistrationService=i,this.changeCentres=new we(null),this.changeCentres$=this.changeCentres.asObservable(),this.centres=null,this.roles=[],this.allowedQuals=[],this.isAdmin=()=>this.contactService.contactGroups().some(l=>gt.includes(l)),this.removeStudentsList=[],this.removeProgRegsList=[],this.epaRegisteredOnList=[]}setCentres(t,e=[],i){this.roles=e||[],this.centres=t,this.allowedQuals=i,this.reset(),this.changeCentres.next(t)}hasAnyToUpdate(){return!!this.removeStudentsList.length||!!this.removeProgRegsList.length||!!this.epaRegisteredOnList.length}_countToDelete(){return this.removeStudentsList.length+this.removeProgRegsList.length}reset(){this.removeStudentsList=[],this.removeProgRegsList=[],this.epaRegisteredOnList=[]}getAllTables(){return[...this.tableBuilder.buildTables("student",this.get
1StudentsToDelete(),!1),...this.tableBuilder.buildTables("qual",this.getProgRegsToDelete()),...this.tableBuilder.buildTables("epa-true",this.getEpaRegisteredOnList(!0)),...this.tableBuilder.buildTables("epa-false",this.getEpaRegisteredOnList(!1))]}commitChanges(){let t=[],e=(i,l)=>{if(!l.length)return;let f=l.reduce(function(u,m){return u[m.trainingProviderOrganisationId]=u[m.trainingProviderOrganisationId]||[],u[m.trainingProviderOrganisationId].push(m),u},{});for(let u in f)switch(i){case"student":t.push(this.programmeRegistrationService.remove({trainingProviderId:u,contactIds:f[u].map(m=>m.contactId)}));break;case"qual":t.push(this.programmeRegistrationService.remove({trainingProviderId:u,programRegistrationIds:f[u].map(m=>m.programmeRegistrationId)}));break;case"epa":t.push(this.programmeRegistrationService.updateEpaField({trainingProviderId:u,changes:f[u].reduce((m,{programmeRegistrationId:E,epaRegisteredOn:W})=>(m[E]=W,m),{})}));break}};return e("student",this.getStudentsToDelete()),e("qual",this.getProgRegsToDelete()),e("epa",this.getEpaRegisteredOnList()),K(t)}updateStudentToDelete(t,e){if(e){if(this._countToDelete()>=50)return!1;this.removeStudentsList.push(t),this.removeProgRegsList=this.removeProgRegsList.filter(i=>i.contactId!==t.contactId),this.epaRegisteredOnList=this.epaRegisteredOnList.filter(i=>i.contactId!==t.contactId)}else this.removeStudentsList=this.removeStudentsList.filter(i=>i.contactId!==t.contactId);return!0}getStudentsToDelete(){return this.removeStudentsList.slice()}updateProgRegToDelete(t,e){if(e){if(this.removeProgRegsList.includes(t))return!0;if(this._countToDelete()>=50)return!1;this.removeProgRegsList.push(t),this.removeStudentsList=this.removeStudentsList.filter(i=>i.contactId!==t.contactId),this.epaRegisteredOnList=this.epaRegisteredOnList.filter(i=>i.programmeRegistrationId!==t.programmeRegistrationId)}else this.removeProgRegsList=this.removeProgRegsList.filter(i=>i.programmeRegistrationId!==t.programmeRegistrationId);return!0}getProgRegsToDelete(){return this.removeProgRegsList.slice()}updateEpaRegisteredOn(t,e){return!!t.epaRegisteredOn===e?this.epaRegisteredOnList=this.epaRegisteredOnList.filter(i=>i.programmeRegistrationId!==t.programmeRegistrationId):this.epaRegisteredOnList.push($(U({},t),{epaRegisteredOn:e})),!0}getEpaRegisteredOnList(t=void 0){return t!==void 0?this.epaRegisteredOnList.filter(e=>e.epaRegisteredOn===t).slice():this.epaRegisteredOnList.slice()}};s.\u0275fac=function(e){return new(e||s)(D(Ue),D(Ct),D(re))},s.\u0275prov=Q({token:s,factory:s.\u0275fac,providedIn:"root"});let n=s;return n})();var Tt=n=>({"view-and-remove--hidden":n});function Dt(n,s){n&1&&x(0,"fab-loader")}function Vt(n,s){n&1&&x(0,"fab-loader")}function It(n,s){n&1&&x(0,"router-outlet")}function At(n,s){n&1&&(a(0,"div",8)(1,"h3"),c(2,"Sorry, access to this service is restricted"),r(),a(3,"p"),c(4," You don't have the correct permissions to access this service. This may be because you don't have the correct role at your selected centre. "),r(),a(5,"p"),c(6," Try selecting a different centre from the drop-down (if applicable), or if you think you should have access, please "),a(7,"a",9),c(8,"contact us"),r(),c(9,". "),r()())}function Bt(n,s){if(n&1&&v(0,It,1,0,"router-outlet")(1,At,10,0,"div",8),n&2){let o=p();w(o.hasAccess?0:1)}}var xt=(()=>{let s=class s{constructor(t,e,i,l){this.viewAndRemoveService=t,this.programmeComponentService=e,this.router=i,this.activatedRoute=l,this.isLoadingCentrePicker=!0,this.isLoadingBody=!0,this.allowCentreChange=!0,this.selectMultipleCentres=!1,this.hasAccess=!1,this.isAdmin=!1,this.standardHeroData={title:"View your students",expanded:!1,toplineLink:null,authorline:null,sponsorshipDetails:null,isContentDetail:!1,isContentArticle:!1,align:"left"},this.multiCentreConfig={enabled:!0,roles:["TP Main Contact","Exams Officer"]},this.router.events.subscribe(f=>{f instanceof Ae&&(this.allowCentreChange=!this.activatedRoute.snapshot.firstChild.url.length)})}changeCentre(t){if(this.isLoadingBody=!0,!Array.isArray(t)&&(!t||!t.organisationId)||Array.isArray(t)&&!t.length)return;Array.isArray(t)||(t=[t]);let e=(l,f)=>{if(!l&&!l.length)return;if(!Array.isArray(l[0]))return l;let u=[].concat.apply([],l);return f?u=u.reduce((m,E)=>(m.find(W=>W[f]===E[f])||m.push(E),m),[]):u=Array.from(new Set(u)),u},i=e(t.map(l=>l.role?l.role.split(", "):[]));K(t.map(l=>this.programmeComponentService.getProgrammesByOrganizationId(l.organisationId,"viewAndRemove").pipe(G(f=>f?.map(u=>$(U({},u),{organisationId:l.organisationId}))),J(()=>Y([]))))).pipe(X(()=>{this.isLoadingCentrePicker=!1,this.isLoadingBody=!1})).subscribe(l=>{let f=e(l,"programmeComponentId").sort((u,m)=>
1u.onlineDisplaySequence-m.onlineDisplaySequence);this.hasAccess=f?.length>0&&(this.viewAndRemoveService.isAdmin()||i.some(u=>_t.includes(u))),this.viewAndRemoveService.setCentres(t,i,f)})}};s.\u0275fac=function(e){return new(e||s)(b(M),b($e),b(P),b(B))},s.\u0275cmp=I({type:s,selectors:[["app-view-and-remove"]],standalone:!1,decls:11,vars:8,consts:[[1,"view-and-remove"],[3,"content"],[1,"view-and-remove__centre-picker",3,"ngClass"],["userGroup","trainingprovider",3,"change","allowCentreChange","multiCentreConfig"],[1,"container-fluid"],[1,"row"],[1,"col-lg-6","col-lg-offset-3","col-md-8","col-md-offset-2","col-xs-12"],[1,"view-and-remove__container"],[1,"view-page"],["href","/about/help-and-support/answers-for-training-providers"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"fab-standard-hero",1),v(2,Dt,1,0,"fab-loader"),a(3,"div",2)(4,"fab-centre-picker",3),g("change",function(f){return i.changeCentre(f)}),r()()(),a(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7),v(9,Vt,1,0,"fab-loader")(10,Bt,2,1),r()()()()()),e&2&&(d(),C("content",i.standardHeroData),d(),w(i.isLoadingCentrePicker?2:-1),d(),C("ngClass",Se(6,Tt,i.isLoadingCentrePicker)),d(),C("allowCentreChange",i.allowCentreChange)("multiCentreConfig",i.multiCentreConfig),d(5),w(i.isLoadingBody?9:10))},dependencies:[ee,Be,lt,ne,at],styles:[`:root{--aat-ui-grey-25: #bfbfbf;--aat-ui-grey-55: #737373;--aat-slate: #3a5066;--aat-ui-grey-05: #f2f2f2}.view-and-remove .view-and-remove--hidden{display:none!important}.view-and-remove__centre-picker .centre-picker{margin-top:30px;border:1px solid rgb(34.425,34.425,34.425);background-color:inherit}.view-and-remove__centre-picker .admin-select input{background-color:inherit;border:none}.view-and-remove__centre-picker .admin-select li:first-child,.view-and-remove__centre-picker .admin-select ul:hover li:hover{background-color:#f9f9f9}.view-and-remove .standard-hero{background-color:#e6e6e6}.view-and-remove__container{background-color:#fff;border-style:solid;border-width:thin;border-color:#e6e6e6;border-radius:2px;margin:10px;padding:0 10px 10px}@media (min-width: 992px){.view-and-remove__container{margin:20px;padding:0 25px 25px}}@media (min-width: 1200px){.view-and-remove__container{margin:10px}}.view-and-remove .container-fluid{padding-left:0;padding-right:0}.main-panel{background-color:#f9f9f9;max-height:initial;height:initial}.view-page{margin-top:25px}.view-page__table{margin-top:40px;border:1px solid #c3c3c3;border-radius:3px;padding:20px}.view-page__table--heading{margin-bottom:15px}.view-page__table--confirmation-box{margin-top:15px;text-align:right}.view-page__table--confirmation-box fab-input-checkbox label{font-size:14px;font-weight:600}.view-page__buttons{display:flex;align-items:center;justify-content:space-between;margin-top:40px}.view-page fab-notification{display:block}.view-page fab-notification .notification__message{text-align:center}.view-page fab-notification .notification__content{max-width:none} 2`],encapsulation:2});let n=s;return n})();var Pt=["regDatePicker"],Mt=["completeDatePicker"];function Ot(n,s){if(n&1){let o=y();a(0,"div",6)(1,"p"),c(2," You must acknowledge and accept that users and their employing organisation are responsible for any data downloaded or copied from the system, including for the security of that data in accordance with "),a(3,"a",7),c(4," AAT's terms and conditions "),r(),c(5," and the contractual agreements between AAT and your employing organisation. "),r(),a(6,"fab-input-checkbox",8),g("onChange",function(){_(o);let e=p();return h(e.confirmCsvDownloadCheck())}),R("isCheckedChange",function(e){_(o);let i=p();return k(i.confirmCsvButtonEnabled,e)||(i.confirmCsvButtonEnabled=e),h(e)}),r(),x(7,"br")(8,"fab-button",9),r()}if(n&2){let o=p();d(6),C("content",o.confirmCsvCheckBox),S("isChecked",o.confirmCsvButtonEnabled),d(2),C("enabled",o.confirmCsvButtonEnabled)("button",o.confirmDownloadCsvButton)}}function Lt(n,s){n&1&&(a(0,"div",6),x(1,"br"),a(2,"p"),c(3," You've selected 50 results, which is the maximum you can select for now. Please proceed to the next page to review and confirm your selections. "),r()())}function Ft(n,s){n&1&&(a(0,"p"),c(1," If you need to remove a student or their qualification please use the relevant check boxes. You may remove up to 50 records at a time in one go, and you'll be able to review and confirm your selections on the next step. "),r())}
2function jt(n,s){if(n&1){let o=y();a(0,"li",52),g("mousedown",function(){let e=_(o).$index;p();let i=Z(12);return h(i.selectSuggestion(e))}),x(1,"span",53),A(2,"textHighlight"),x(3,"span",53),A(4,"textHighlight"),r()}if(n&2){let o=s.$implicit,t=s.$index;p();let e=Z(12);ye("selected",e.currentSuggestionIndex==t),d(),C("innerHTML",j(2,4,o.name,e.inputValue),pe),d(2),C("innerHTML",j(4,7,o.memberId,e.inputValue),pe)}}function Nt(n,s){if(n&1){let o=y();a(0,"div",54)(1,"div",55)(2,"p-button",56),g("click",function(e){let i=_(o).clearCallback;return h(i(e))}),r()(),a(3,"div",57)(4,"p-button",58),g("click",function(){_(o);let e=p(3);return h(e.onPresetRangeSelection("registration","days",0))}),r()(),a(5,"div",59)(6,"p-button",60),g("click",function(){_(o);let e=p(3);return h(e.onPresetRangeSelection("registration","days",7))}),r(),a(7,"p-button",61),g("click",function(){_(o);let e=p(3);return h(e.onPresetRangeSelection("registration","days",30))}),r()(),a(8,"div",59)(9,"p-button",62),g("click",function(){_(o);let e=p(3);return h(e.onPresetRangeSelection("registration","thisMonth"))}),r(),a(10,"p-button",63),g("click",function(){_(o);let e=p(3);return h(e.onPresetRangeSelection("registration","lastMonth"))}),r()()()}}function Qt(n,s){if(n&1){let o=y();a(0,"div",54)(1,"div",55)(2,"p-button",56),g("click",function(e){let i=_(o).clearCallback;return h(i(e))}),r()(),a(3,"div",57)(4,"p-button",58),g("click",function(){_(o);let e=p(3);return h(e.onPresetRangeSelection("completed","days",0))}),r()(),a(5,"div",59)(6,"p-button",60),g("click",function(){_(o);let e=p(3);return h(e.onPresetRangeSelection("completed","days",7))}),r(),a(7,"p-button",61),g("click",function(){_(o);let e=p(3);return h(e.onPresetRangeSelection("completed","days",30))}),r()(),a(8,"div",59)(9,"p-button",62),g("click",function(){_(o);let e=p(3);return h(e.onPresetRangeSelection("completed","thisMonth"))}),r(),a(10,"p-button",63),g("click",function(){_(o);let e=p(3);return h(e.onPresetRangeSelection("completed","lastMonth"))}),r()()()}}function qt(n,s){if(n&1){let o=y();a(0,"div",16)(1,"label"),c(2,"Filter by apprenticeship"),r(),a(3,"fab-input-checkbox",8),g("onChange",function(){_(o);let e=p(3);return h(e.filterCheckboxChange())}),R("isCheckedChange",function(e){_(o);let i=p(3);return k(i.isEpaFilterChecked,e)||(i.isEpaFilterChecked=e),h(e)}),r()()}if(n&2){let o=p(3);d(3),C("content",o.epaFilterCheckbox),S("isChecked",o.isEpaFilterChecked)}}function Wt(n,s){if(n&1){let o=y();a(0,"div",36),x(1,"fab-button",40),a(2,"div")(3,"a",64),g("click",function(){_(o);let e=p(3);return h(e.resetFilters())}),c(4,"Clear filters"),x(5,"i",65),r()()()}if(n&2){let o=p(3);d(),C("button",o.applyFiltersButton)}}function Ht(n,s){if(n&1&&x(0,"fab-notification",37),n&2){let o=p(3);C("isNotificationOpen",!0)("notification",o.notificationContent)}}function zt(n,s){if(n&1){let o=y();a(0,"div",50)(1,"fab-input-checkbox",8),g("onChange",function(e){_(o);let i=p(3);return h(i.selectAll(e))}),R("isCheckedChange",function(e){_(o);let i=p(3);return k(i.isSelectAllChecked,e)||(i.isSelectAllChecked=e),h(e)}),r()()}if(n&2){let o=p(3);d(),C("content",o.selectAllCheckbox),S("isChecked",o.isSelectAllChecked)}}function Ut(n,s){n&1&&x(0,"fab-loader")}function $t(n,s){if(n&1&&(a(0,"b"),c(1,"D.O.B:"),r(),c(2),A(3,"date")),n&2){let o=p().$implicit;d(2),fe(" ",j(3,1,o.birthDate,"dd MMM yyyy")," ")}}function Yt(n,s){if(n&1&&(a(0,"div",75)(1,"div",81),x(2,"i",82),r()()),n&2){let o=p().$implicit,t=p(5);d(2),C("ngClass",t.getIconForStatus(o.registrationStatus))}}function Gt(n,s){if(n&1&&(a(0,"div",77),c(1),r()),n&2){let o=p().$implicit;d(),ge(" ",o.qualificationName," (",o.qualificationStandardName,") ")}}function Kt(n,s){if(n&1&&(a(0,"div",77),c(1),r()),n&2){let o=p().$implicit;d(),fe(" ",o.qualificationName," ")}}function Jt(n,s){if(n&1&&(a(0,"div",77),c(1," Registered date: "),a(2,"b"),c(3),A(4,"date"),r()()),n&2){let o=p().$implicit;d(3),T(j(4,1,o.registrationDate,"dd MMM yyyy"))}}function Xt(n,s){if(n&1&&(a(0,"div",77),c(1," Completed date: "),a(2,"b"),c(3),A(4,"date"),r()()),n&2){let o=p().$implicit;d(3),T(j(4,1,o.registrationStatusDate,"dd MMM yyyy"))}}
2function Zt(n,s){if(n&1&&(a(0,"div",77),c(1," End date: "),a(2,"b"),c(3),A(4,"date"),r()()),n&2){let o=p().$implicit;d(3),T(j(4,1,o.endDate,"dd MMM yyyy"))}}function ei(n,s){if(n&1&&(a(0,"div",78)(1,"div",77),c(2," Centre: "),a(3,"b"),c(4),r()()()),n&2){let o=p().$implicit;d(4),T(o.trainingProviderName)}}function ti(n,s){if(n&1){let o=y();a(0,"div",78)(1,"fab-input-checkbox",83),R("isCheckedChange",function(e){_(o);let i=p().$implicit;return k(i.checkboxes.removeStudent.isSelected,e)||(i.checkboxes.removeStudent.isSelected=e),h(e)}),g("onChange",function(e){_(o);let i=p().$implicit,l=p(5);return h(l.removeCheckboxChange("student",i,e))}),r()()}if(n&2){let o=p().$implicit;d(),C("content",o.checkboxes.removeStudent.content),S("isChecked",o.checkboxes.removeStudent.isSelected)}}function ii(n,s){if(n&1){let o=y();a(0,"div",78)(1,"fab-input-checkbox",83),R("isCheckedChange",function(e){_(o);let i=p().$implicit;return k(i.checkboxes.removeQual.isSelected,e)||(i.checkboxes.removeQual.isSelected=e),h(e)}),g("onChange",function(e){_(o);let i=p().$implicit,l=p(5);return h(l.removeCheckboxChange("qual",i,e))}),r()()}if(n&2){let o=p().$implicit;d(),C("content",o.checkboxes.removeQual.content),S("isChecked",o.checkboxes.removeQual.isSelected)}}function ni(n,s){if(n&1){let o=y();a(0,"div",78)(1,"fab-input-checkbox",83),R("isCheckedChange",function(e){_(o);let i=p().$implicit;return k(i.checkboxes.epaRegisteredOn.isSelected,e)||(i.checkboxes.epaRegisteredOn.isSelected=e),h(e)}),g("onChange",function(e){_(o);let i=p().$implicit,l=p(5);return h(l.removeCheckboxChange("epa",i,e))}),r()()}if(n&2){let o=p().$implicit;d(),C("content",o.checkboxes.epaRegisteredOn.content),S("isChecked",o.checkboxes.epaRegisteredOn.isSelected)}}function oi(n,s){if(n&1&&(a(0,"div",66)(1,"div",68)(2,"div",69)(3,"div",70)(4,"div",71)(5,"b"),c(6),r()(),a(7,"div",72)(8,"b"),c(9),r()(),a(10,"div",73),v(11,$t,4,4),r()(),a(12,"div",74),v(13,Yt,3,1,"div",75),a(14,"div",75)(15,"div",76),v(16,Gt,2,2,"div",77),v(17,Kt,2,1,"div",77),r(),a(18,"div",78),v(19,Jt,5,4,"div",77),v(20,Xt,5,4,"div",77),v(21,Zt,5,4,"div",77),r(),v(22,ei,5,1,"div",78),r()()(),a(23,"div",79)(24,"div",80),v(25,ti,2,2,"div",78),v(26,ii,2,2,"div",78),v(27,ni,2,2,"div",78),r()()()()),n&2){let o=s.$implicit,t=p(5);d(6),ge("",o.givenName," ",o.familyName),d(3),T(o.memberId),d(2),w(o.birthDate?11:-1),d(2),w(o.registrationStatus?13:-1),d(3),w(o.qualificationStandardName?16:-1),d(),w(o.qualificationStandardName?-1:17),d(2),w(o.registrationDate?19:-1),d(),w(o.registrationStatus==="Completed"&&o.registrationStatusDate?20:-1),d(),w(o.registrationStatus==="Ended"&&t.isDateInPast(o.endDate)?21:-1),d(),w(t.centres&&t.centres.length>1&&o.trainingProviderName?22:-1),d(3),w(t.userCanRemove?25:-1),d(),w(t.userCanRemove?26:-1),d(),w(t.shouldShowEpaCheckbox(o)?27:-1)}}function ai(n,s){if(n&1&&(a(0,"div",67),x(1,"fab-button",40),r()),n&2){let o=p(5);d(),C("button",o.loadMoreButton)}}function ri(n,s){if(n&1&&(L(0,oi,28,14,"div",66,O),v(2,ai,2,1,"div",67)),n&2){let o=p(4);F(o.resultsToDisplay),d(2),w(o.lastEvaluatedKey?2:-1)}}function si(n,s){n&1&&(a(0,"div",10)(1,"p"),c(2,"There are no results available. Please try amending or clearing the filters you've applied."),r()())}function li(n,s){if(n&1&&v(0,ri,3,1)(1,si,3,0,"div",10),n&2){let o=p(3);w(o.resultsToDisplay&&o.resultsToDisplay.length?0:1)}}function di(n,s){if(n&1&&(a(0,"div",51),x(1,"fab-button",9),r()),n&2){let o=p(3);d(),C("enabled",!o.nextButton.disabled)("button",o.nextButton)}}function ci(n,s){if(n&1){let o=y();a(0,"div",11)(1,"h4",12)(2,"strong"),c(3,"Filter results"),r()(),a(4,"div",13),c(5," If you select students and then change your filter settings, those selections have been recorded and you'll see them on the next page. "),r(),a(6,"div",14)(7,"div",15)(8,"div",16)(9,"label"),c(10,"Filter by student names/IDs"),r(),a(11,"fab-autocomplete-multiselect",17,0),g("onChange",function(e){_(o);let i=p(2);return h(i.onStudentPickerChange(e))}),a(13,"ul"),L(14,jt,5,10,"li",18,O),A(16,"slice"),r()(),a(17,"div",19),c(18,"You can select multiple students"),r()()(),a(19,"div",20)(20,"div",16)(21,"label"),c(22,"Filter by qualification"),r(),a(23,"fab-dropdown",21),g("outputReturnSelectedOptions",function(e){_(o);let i=p(2);return h(i.getSelectedQualsOptions(e))}),r(),a(24,"div",19),c(25,"You can select multiple qualifications"),r()()(),a(26,"div",22)(27,"p-floatlabel",23)(28,"p-datepicker",24,1),g("ngModelChange",function(e){_(o);let i=p(2);return h(i.onDateChange("registration",e))}),me(30,Nt,11,0,"ng-template",null,2,Ce),r(),a(32,"label",25),c(33,"Filter by registration date"),r()(),a(34,"p-floatlabel",23)(35,"p-datepicker",26,3),g("ngModelChange",function(e){_(o);let i=p(2);return h(i.onDateChange("completed",e))}),me(37,Qt,11,0,"ng-template",null,2,Ce),r(),a(39,"label",27),c(40,"Filter by completed date"),r()()(),a(41,"div",28)(42,"div",16)(43,"label"),c(44,"Filter by qualification status"),r(),a(45,"div",29)(46,"input",30),R("ngModelChange",function(e){_(o);let i=p(2);return k(i.filterByQualStatus,e)||(i.filterByQualStatus=e),h(e)}),g("change",function(){_(o);let e=p(2);
2return h(e.filterCheckboxChange())}),r(),a(47,"label",31),c(48,"Active"),r()(),a(49,"div",29)(50,"input",32),R("ngModelChange",function(e){_(o);let i=p(2);return k(i.filterByQualStatus,e)||(i.filterByQualStatus=e),h(e)}),g("change",function(){_(o);let e=p(2);return h(e.filterCheckboxChange())}),r(),a(51,"label",33),c(52,"Completed"),r()(),a(53,"div",29)(54,"input",34),R("ngModelChange",function(e){_(o);let i=p(2);return k(i.filterByQualStatus,e)||(i.filterByQualStatus=e),h(e)}),g("change",function(){_(o);let e=p(2);return h(e.filterCheckboxChange())}),r(),a(55,"label",35),c(56,"Ended"),r()()()(),a(57,"div",28),v(58,qt,4,2,"div",16),r()(),a(59,"div",14),v(60,Wt,6,1,"div",36),r()(),v(61,Ht,1,2,"fab-notification",37),a(62,"div",38)(63,"div",39)(64,"h4")(65,"strong"),c(66,"Results"),r()(),x(67,"fab-button",40),r(),a(68,"div",41)(69,"div",42)(70,"b"),c(71,"Key:"),r(),a(72,"div",43)(73,"div",44),x(74,"i",45),c(75," Completed "),r(),a(76,"div",46),x(77,"i",47),c(78," Active "),r(),a(79,"div",48),x(80,"i",49),c(81," Ended "),r()()(),v(82,zt,2,2,"div",50),r(),v(83,Ut,1,0,"fab-loader")(84,li,2,1),r(),v(85,di,2,2,"div",51)}if(n&2){let o=Z(12),t=p(2);d(11),C("config",t.studentPickerConfig),d(3),F(ke(16,25,o.suggestions,0,10)),d(9),C("content",t.dropdownQuals),d(5),C("ngModel",t.regDateSelection)("showIcon",!0)("showOnFocus",!0)("showButtonBar",!0)("maxDate",t.todayDate),d(7),C("ngModel",t.completeDateSelection)("showIcon",!0)("showOnFocus",!0)("showButtonBar",!0)("maxDate",t.todayDate),d(11),C("disabled",t.filterByActiveDisabled),S("ngModel",t.filterByQualStatus),d(4),C("disabled",t.filterByCompletedDisabled),S("ngModel",t.filterByQualStatus),d(4),C("disabled",t.filterByEndedDisabled),S("ngModel",t.filterByQualStatus),d(4),w(t.showEpaFilter?58:-1),d(2),w(t.filtersApplied?60:-1),d(),w(t.userCanRemove?61:-1),d(6),C("button",t.downloadAllButton),d(15),w(t.userCanRemove?82:-1),d(),w(t.showResultsLoader?83:84),d(2),w(t.userCanRemove||t.userCanUpdateEpas?85:-1)}}function pi(n,s){n&1&&(a(0,"div",10)(1,"h4")(2,"strong"),c(3,"There are no student records to show"),r()(),a(4,"p"),c(5," This may be because you haven't registered any students at your centre yet, or you've selected the wrong centre. "),r(),a(6,"p"),c(7," Try selecting a different centre from the drop-down (if applicable), or if you think you should have students showing, please "),a(8,"a",84),c(9,"contact us"),r(),c(10,". "),r()())}function mi(n,s){if(n&1&&v(0,ci,86,29)(1,pi,11,0,"div",10),n&2){let o=p();w(o.userHasResults||o.showResultsLoader?0:1)}}function ui(n,s){n&1&&x(0,"fab-loader")}var bt=(()=>{let s=class s{constructor(t,e,i,l,f,u,m){this.viewAndRemoveService=t,this.contactSearchService=e,this.programmeRegistrationService=i,this.documentGenerationService=l,this.route=f,this.datePipe=u,this.router=m,this.showEpaFilter=!1,this.epaApprovals={},this.isPageLoaded=!1,this.userCanRemove=!0,this.userCanUpdateEpas=!0,this.userHasResults=!1,this.modalOpen=!1,this.maxSelectionsModalOpen=!1,this.resultsToDisplay=[],this.showResultsPagination=!1,this.confirmCsvButtonEnabled=!1,this.filtersApplied=!1,this.filterByQualStatus=void 0,this.filterByActiveDisabled=!1,this.filterByCompletedDisabled=!1,this.filterByEndedDisabled=!1,this.todayDate=new Date,this.dropdownQuals={placeholder:"Select",allSelected:"Select all qualifications",validationDisabled:!0,options:[]},this.epaFilterCheckbox={id:"epaRegisteredOn-checkbox",label:"Studying as part of an apprenticeship"},this.applyFiltersButton={text:"Apply filters",action:{type:"callback",callback:this.applyFilters.bind(this)},type:"primary",aria:"Apply filters"},this.confirmDownloadCsvButton={text:"Download CSV",action:{type:"callback",callback:()=>{this.modalOpen=!1,this.confirmCsvButtonEnabled=!1,this.downloadAll()}},type:"primary",aria:"Download CSV"},this.confirmCsvCheckBox={id:"confirm-csv",label:"I acknowledge and accept these terms"},this.notificationContent={type:"warning",fullWidth:!0,message:"<div>By selecting any of the records below, you can either remove the student from your centre or remove a qualification from the student's record at your centre. If you make any changes to student records in error, they'll need to get in touch with us to have them corrected.</div>"},this.selectAllCheckbox={id:"select-all-checkbox",label:"Select all qualifications below",checkboxPosition:"right"},this.downloadAllButton={text:"Download all results (CSV)",action:{type:"callback",callback:()=>{this.modalOpen=!0}},type:"primary",aria:"Download all results (CSV)"},this.loadMoreButton={text:"Load more results",action:{type:"callback",callback:this.loadMore.bind(this)},type:"primary",aria:"Load more results"},this.nextButton={text:"Next",action:{type:"callback",callback:this.next.bind(this)},type:"primary",aria:"Next"},this.contactSearchService.serviceRoot="programme-registration",this.nextButton.disabled=!this.viewAndRemoveService.hasAnyToUpdate()}ngOnInit(){this.changeCentre=this.viewAndRemoveService.changeCentres$.subscribe(t=>{this.filterRequest&&this.filterRequest.unsubscribe(),this.epaApprovals={},this.showEpaFilter=!1,this.centresInit(t),this.qualsInit(this.viewAndRemoveService.allowedQuals)})}ngOnDestroy(){this.changeCentre.unsubscribe(),this.filterRequest.unsubscribe()}onStudentPickerChange(t){this.filterStudentsSelected=t,this.filtersApplied=!0}
2onPresetRangeSelection(t,e,i){let l=new Date;switch(e){case"days":l.setDate(this.todayDate.getDate()-(i>0?i-1:i)),l.setUTCHours(0,0,0,0),this.onDateChange(t,[l,this.todayDate]);break;case"thisMonth":let f=new Date(l.getFullYear(),l.getMonth(),1);this.onDateChange(t,[f,this.todayDate]);break;case"lastMonth":let u=new Date(l.getFullYear(),l.getMonth()-1,1),m=new Date(l.getFullYear(),l.getMonth(),0);this.onDateChange(t,[u,m]);break}switch(t){case"registration":this._regDatePicker&&(this._regDatePicker.overlayVisible=!1);break;case"completed":this._completeDatePicker&&(this._completeDatePicker.overlayVisible=!1)}}onDateChange(t,e){let i=new Date(e[0]);i.setUTCHours(0,0,0,0);let l=e[1]?new Date(e[1]):new Date(e[0]);l.setUTCHours(23,59,59,999);let f={from:i.toISOString(),to:l.toISOString()};switch(t){case"registration":this.regDateSelection=e,this.filterRegistrationDate=f;break;case"completed":this.completeDateSelection=e,this.filterCompletionDate=f,this.filterByActiveDisabled=!0,this.filterByEndedDisabled=!0,this.filterByQualStatus="Completed";break}this.filtersApplied=!0}getSelectedQualsOptions(t){this.filterQualificationIds=t.map(e=>e.value),this.filtersApplied=!0}filterCheckboxChange(){this.filtersApplied=!0}applyFilters(){this.isSelectAllChecked=!1,this.getResults()}resetFilters(){this.lastEvaluatedKey=void 0,this.filtersApplied=!1,this.filterStudentsSelected=void 0,this.filterQualificationIds=void 0,this.filterRegistrationDate=void 0,this.filterCompletionDate=void 0,this.studentPickerConfig=Object.assign({},this.studentPickerConfig),this.dropdownQuals.options.forEach(t=>{t.selected=!1}),this.dropdownQuals=Object.assign({},this.dropdownQuals),this.regDateSelection=null,this.completeDateSelection=null,this.filterByActiveDisabled=!1,this.filterByEndedDisabled=!1,this.filterByQualStatus=void 0,this.isEpaFilterChecked=!1,this.getResults()}getResults(t=!1){t?(this.loadMoreButton.text="Loading...",this.loadMoreButton.glyph={icon:z.LOOP2,glyphAnimation:"spin"}):(this.showResultsLoader=!0,this.resultsToDisplay=[]),this.filterRequest=this.programmeRegistrationService.filter(this.getBody(t)).pipe(G(e=>e&&e.count>0?(this.userHasResults=!0,this.lastEvaluatedKey=e.lastEvaluatedKey,e.items.map(i=>{let l=this.centres.find(f=>f.organisationId===i.trainingProviderOrganisationId);return i.birthDate==="nullT00:00:00.00"&&(i.birthDate=void 0),i.trainingProviderName=l?l.name:void 0,i.checkboxes={removeStudent:this.getCheckboxContent("student",i.programmeRegistrationId),removeQual:this.getCheckboxContent("qual",i.programmeRegistrationId),epaRegisteredOn:this.getCheckboxContent("epa",i.programmeRegistrationId,i.epaRegisteredOn,["Completed","Ended"].includes(i.registrationStatus),i.qualificationId)},i}),e.items):[]),ce(1),J(e=>(e.status!==404&&console.error(e),Y([])))).subscribe(e=>{t?this.resultsToDisplay=[...this.resultsToDisplay,...e]:this.resultsToDisplay=e,this.updateResultCheckboxes(),this.showResultsLoader=!1,this.loadMoreButton.glyph=null,this.loadMoreButton.text="Load more results"})}getIconForStatus(t){switch(t){case"Completed":return"icon-success";case"Ended":return"icon-minus";default:return"icon-circle"}}isDateInPast(t){if(!t)return!1;let e=new Date;return typeof t=="string"?new Date(t)<e:t<e}removeCheckboxChange(t,e,i){switch(this.isSelectAllChecked=!1,t){case"student":this.viewAndRemoveService.updateStudentToDelete(e,i)||(this.maxSelectionsModalOpen=!0,setTimeout(()=>{e.checkboxes.removeStudent.isSelected=!1},0));break;case"qual":this.viewAndRemoveService.updateProgRegToDelete(e,i)||(this.maxSelectionsModalOpen=!0,setTimeout(()=>{e.checkboxes.removeQual.isSelected=!1},0));break;case"epa":this.viewAndRemoveService.updateEpaRegisteredOn(e,i);break}this.updateResultCheckboxes(),this.nextButton.disabled=!this.viewAndRemoveService.hasAnyToUpdate()}updateResultCheckboxes(){let t=this.viewAndRemoveService.getStudentsToDelete(),e=t.map(m=>m.contactId),i=t.map(m=>m.programmeRegistrationId),f=this.viewAndRemoveService.getProgRegsToDelete().map(m=>m.programmeRegistrationId),u=this.viewAndRemoveService.getEpaRegisteredOnList();this.resultsToDisplay.map(m=>{let E=e.includes(m.contactId),W=i.includes(m.programmeRegistrationId),de=f.includes(m.programmeRegistrationId);return m.checkboxes.removeStudent.isSelected=E,m.checkboxes.removeStudent.content.style=E&&!W?"gray":"default",m.checkboxes.removeQual.content.disabled=!this.userCanRemove||E,m.checkboxes.removeQual.isSelected=de,m.checkboxes.epaRegisteredOn.isSelected=u.find(kt=>kt.programmeRegistrationId===m.programmeRegistrationId)?.epaRegisteredOn??m.epaRegisteredOn,m.checkboxes.epaRegisteredOn.c
2ontent.disabled=!this.userCanUpdateEpas||E||de,m.checkboxes.epaRegisteredOn.content.style=!this.userCanUpdateEpas||E||de?"gray":"default",m})}selectAll(t){if(t)try{this.resultsToDisplay.forEach(e=>{if(!this.viewAndRemoveService.updateProgRegToDelete(e,!0))throw"LIMIT_REACHED"})}catch(e){e==="LIMIT_REACHED"&&(this.maxSelectionsModalOpen=!0)}else this.resultsToDisplay.forEach(e=>this.viewAndRemoveService.updateProgRegToDelete(e,!1));this.updateResultCheckboxes(),this.nextButton.disabled=!this.viewAndRemoveService.hasAnyToUpdate()}closeDialog(){this.modalOpen=!1,this.maxSelectionsModalOpen=!1,this.confirmCsvButtonEnabled=!1}confirmCsvDownloadCheck(){this.confirmCsvButtonEnabled=!0}downloadAll(){!this.resultsToDisplay||!this.resultsToDisplay.length||(this.downloadAllButton.text="Downloading...",this.downloadAllButton.glyph={icon:z.LOOP2,glyphAnimation:"spin"},this.documentGenerationService.createCSV(this.getBody(),"viewAndRemove").pipe(X(()=>{this.downloadAllButton.glyph=null,this.downloadAllButton.text="Download all results (CSV)"}),ce(1)).subscribe({next:t=>{let e=`Students registered with AAT ${this.datePipe.transform(new Date,ze)}.csv`,i=window.URL.createObjectURL(t.body),l=document.createElement("a");l.href=i,l.download=e,l.click()},error:t=>{console.error(t)}}))}shouldShowEpaCheckbox(t){return this.epaApprovals[t.trainingProviderOrganisationId]?.[V[t.qualificationId]?.epa]}centresInit(t){this.centres=t,this.nextButton.disabled=!this.viewAndRemoveService.hasAnyToUpdate(),this.userCanRemove=this.viewAndRemoveService.roles.some(e=>ft.includes(e)),this.userCanUpdateEpas=this.viewAndRemoveService.roles.some(e=>ht.includes(e)),this.contactSearchService.organisationIds=t.map(e=>e.organisationId),this.studentPickerConfig={service:this.contactSearchService,errorMessage:"We can't find any results for this student at your centre. Please double check you've entered the correct name or ID.",showError:!0}}qualsInit(t){if(t){for(let{epa:e}of Object.values(V))for(let i of this.centres){this.epaApprovals[i.organisationId]||(this.epaApprovals[i.organisationId]={});let l=t.some(f=>f.TPApproval&&e===f.programmeComponentId&&f.organisationId===i.organisationId);this.epaApprovals[i.organisationId][e]=l,l&&(this.showEpaFilter=!0)}this.dropdownQuals.options=t.map(e=>({label:`${e.name}${e.qualificationStandardName?` (${e.qualificationStandardName})`:""}`,value:e.topLevelComponentId,qualification:e})),this.isPageLoaded=!0,this.centres&&this.getResults()}}getBody(t=!1,e=25){let i=t&&this.lastBody?this.lastBody:{trainingProviderIds:this.centres.map(l
2=>l.organisationId),qualificationIds:this.filterQualificationIds?this.filterQualificationIds:this.dropdownQuals.options.map(l=>String(l.value)),registrationStatus:this.filterByQualStatus,registrationDate:this.filterRegistrationDate,completionDate:this.filterCompletionDate,contactIds:this.filterStudentsSelected&&this.filterStudentsSelected.length?this.filterStudentsSelected.map(l=>l.contactId):void 0,epaRegisteredOn:this.isEpaFilterChecked?!0:void 0,limit:e};return t&&(i.lastEvaluatedKey=this.lastEvaluatedKey),this.lastBody=i,i}loadMore(){this.isSelectAllChecked=!1,this.getResults(!0)}next(){this.router.navigate(["./review"],{relativeTo:this.route})}getCheckboxContent(t,e,i=!1,l=!1,f){let u,m="default";switch(t){case"student":u="Remove this student from this centre";break;case"qual":u="Remove only this qualification";break;case"epa":u=`Studying as part of the ${V[f]?.shortName} apprenticeship`,(!this.userCanUpdateEpas||l)&&(l=!0,m="gray");break}return{isSelected:i,content:{id:`result-checkbox-${t?t+"-":""}${e.toLowerCase()}`,label:u,checkboxPosition:"right",style:m,disabled:l}}}};s.\u0275fac=function(e){return new(e||s)(b(M),b(Ye),b(re),b(ut),b(B),b(H),b(P))},s.\u0275cmp=I({type:s,selectors:[["app-view"]],viewQuery:function(e,i){if(e&1&&(ue(Pt,5),ue(Mt,5)),e&2){let l;_e(l=he())&&(i._regDatePicker=l.first),_e(l=he())&&(i._completeDatePicker=l.first)}},standalone:!1,decls:17,vars:6,consts:[["studentPicker",""],["regDatePicker",""],["buttonbar",""],["completeDatePicker",""],[1,"view-page"],[3,"modalClose","isModalOpened"],[1,"modal__content"],["href","/policies/terms-conditions-aat-systems-training-providers","target","_blank"],[3,"onChange","isCheckedChange","content","isChecked"],[3,"enabled","button"],[1,"view-page__no-results"],[1,"view-page__filters"],[1,"view-page__filters--heading"],[1,"view-page__filters--sub-heading"],[1,"row"],[1,"col-xs-12"],[1,"view-page__filters--filter-box"],[3,"onChange","config"],[1,"suggestions__option",3,"selected"],[1,"view-page__filters--filter-box-text"],[1,"col-sm-12","col-xs-12"],[3,"outputReturnSelectedOptions","content"],[1,"flex","flex-col","md:flex-row","w-full","gap-3","mt-5","mb-3","justify-between"],["variant","on",1,"w-full","md:w-2/5","my-3"],["placeholder","dd/mm/yyyy","dateFormat","dd/mm/yy","inputId","registration_range_selection","data-auto","registrationRangeSelection","selectionMode","range","fluid","",1,"mt-1",3,"ngModelChange","ngModel","showIcon","showOnFocus","showButtonBar","maxDate"],["for","registration_range_selection"],["placeholder","dd/mm/yyyy","dateFormat","dd/mm/yy","inputId","completed_date_range_selection","data-auto","completedDateRangeSelection","selectionMode","range","fluid","",1,"mt-1",3,"ngModelChange","ngModel","showIcon","showOnFocus","showButtonBar","maxDate"],["for","completed_date_range_selection"],[1,"col-xs-12","col-md-6"],[1,"view-page__filters--radio"],["type","radio","name","qualStatusFilter","id","activeRadio","value","Active",3,"ngModelChange","change","disabled","ngModel"],["for","activeRadio"],["type","radio","name","qualStatusFilter","id","completedRadio","value","Completed",3,"ngModelChange","change","disabled","ngModel"],["for","completedRadio"],["type","radio","name","qualStatusFilter","id","endedRadio","value","Ended",3,"ngModelChange","change","disabled","ngModel"],["for","endedRadio"],[1,"view-page__filters--apply-reset"],[3,"isNotificationOpen","notification"],[1,"view-page__results"],[1,"view-page__results--title"],[3,"button"],[1,"view-page__results--row"],[1,"view-page__results--key"],[1,"view-page__results--key-wrapper"],["data-help","The student has successfully completed the qualification.",1,"view-page__results--key-item"],[1,"icon","icon-success"],["data-help","The student has current access to the qualification.",1,"view-page__results--key-item"],[1,"icon","icon-circle"],["data-help","The student's access to the qualification has ended without them completing it.",1,"view-page__results--key-item"],[1,"icon","icon-minus"],[1,"view-page__results--select-all"],[1,"view-page__next-button"],[1,"suggestions__option",3,"mousedown"],[3,"innerHTML"],[1,"flex","flex-col","gap-2","w-full"],[1,"flex","justify-end"],["size","small","label","Clear dates","severity","danger","variant","outlined",1,"w-3/7",3,"click"],[1,"flex","justify-end","w-full"],["size","small","label","Today","data-auto","todayButton",1,"w-3/7",3,"click"],[1,"flex","justify-between","w-full"],["size","small","label","Last 7 days","data-auto","last7daysButton",1,"w-3/7",3,"click"],["size","small","label","Last 30 days","data-auto","last30daysButton",1,"w-3/7",3,"click"],["size","small","label","This month","data-auto","thisMonthButton",1,"w-3/7",3,"click"],["size","small","label","Last month","data-auto","lastMonthButton",1,"w-3/7",3,"click"],[3,"click"],[1,"icon","icon-cross-small"],[1,"view-result"],[1,"view-page__results--show-more"],[1,"view-page__result"],[1,"view-page__result-col","view-page__result-col--main"],[1,"view-page__result-row","view-page__result-row--top"],[1,"view-page__result--text","view-page__result--name"],[1,"view-page__result--text","view-page__result--member-id"],[1,"view-page__result--text","view-page__result--dob"],[1,"view-page__result-row","view-page__result--info"],[1,"view-page__result-col"],[1,"view-page__result-row","view-page__result--qual-name"],[1,"view-page__result--text"],[1,"view-page__result-row"],[1,"view-page__result-col","view-page__result-col--checkboxes"],[1,"view-page__result--remove-buttons"],[1,"view-page__result--icon"],[1,"icon",3,"ngClass"],[3,"isCheckedChange","onChange","content","isChecked"],["href","/about/help-and-support/answers-for-training-providers"]],template:function(e,i){e&1&&(a(0,"div",4)(1,"fab-modal",5),g("modalClose",function(){return i.closeDialog()}),v(2,Ot,9,4,"div",6),r(),a(3,"fab-modal",5),g("modalClose",function(){return i.closeDialog()}
2),v(4,Lt,4,0,"div",6),r(),a(5,"p"),c(6," Use this service to see which students are attached to your centre and check their qualification details. You can filter the results using the options below. Use the download function for an overview of all results. "),r(),v(7,Ft,2,0,"p"),a(8,"p"),c(9,"In line with GDPR requirements you'll only see students registered at your centre(s)."),r(),a(10,"p"),c(11," Use of this service is subject to "),a(12,"a",7),c(13,"AAT's terms and conditions"),r(),c(14,". "),r(),v(15,mi,2,1)(16,ui,1,0,"fab-loader"),r()),e&2&&(d(),C("isModalOpened",i.modalOpen),d(),w(i.modalOpen?2:-1),d(),C("isModalOpened",i.maxSelectionsModalOpen),d(),w(i.maxSelectionsModalOpen?4:-1),d(3),w(i.userCanRemove?7:-1),d(8),w(i.isPageLoaded?15:16))},dependencies:[ee,ne,tt,te,We,pt,ot,ie,Xe,Oe,je,Le,Fe,q,Qe,Te,H,Ge],styles:[`:root{--aat-ui-grey-25: #bfbfbf;--aat-ui-grey-55: #737373;--aat-slate: #3a5066;--aat-ui-grey-05: #f2f2f2}.view-page,.view-page__filters{margin-top:25px}.view-page__filters--filter-tag{margin-bottom:0}.view-page__filters--filter-box{margin-top:20px}.view-page__filters--filter-box label{font-size:14px;margin-bottom:.5em;display:inline-block}.view-page__filters--filter-box-text{font-size:11px}.view-page__filters--filter-box fab-input-checkbox{margin-bottom:10px}@media (min-width: 992px){.view-page__filters--filter-box.date-picker{margin-right:1em}.view-page__filters--filter-box.checkbox{display:flex;align-items:center;height:100px;margin-bottom:-50px}}.view-page__filters--apply-reset{margin:30px 0;color:#00ab4e;display:flex}.view-page__filters--apply-reset div{margin-top:10px;margin-left:25px}.view-page__results{margin:25px 0}.view-page__results--title{display:flex;width:100%;justify-content:space-between;flex-wrap:wrap;margin-bottom:10px}.view-page__results--show-more{text-align:center}.view-page__results--row{display:flex;justify-content:space-between;flex-wrap:wrap;align-items:center}.view-page__results--key{display:flex;margin-bottom:15px}.view-page__results--key-wrapper{display:flex;justify-content:space-between;margin-left:15px;flex-wrap:wrap}.view-page__results--key-item{display:flex;margin-right:20px;cursor:pointer;position:relative}.view-page__results--key-item i{margin-right:10px}.view-page__results--key-item:hover:before{content:attr(data-help);display:block;background-color:#eee;border-radius:3px;position:absolute;font-size:12px;padding:10px;width:18vw;bottom:calc(100% + 10px);left:calc(50% - 9vw);text-align:center}.view-page__results--select-all{font-size:16px}.view-page__result{border:1px solid #c3c3c3;border-radius:3px;padding:20px;display:flex;justify-content:space-between;margin:20px 0}.view-page__result-row{display:flex;width:100%;row-gap:5px}.view-page__result-row:not(:last-of-type){margin-bottom:15px}@media (max-width: 400px){.view-page__result-row{flex-wrap:wrap}}.view-page__result-row--top{width:calc(100% - 15px);justify-content:space-between}.view-page__result-col{display:flex;flex-direction:column}.view-page__result-col--main{margin-right:20px;flex-grow:1}.view-page__result--text:not(:last-of-type),.view-page__result--icon{margin-right:20px}.view-page__result--icon{margin-bottom:15px}.view-page__result--remove-buttons{font-size:14px;text-align:right}.view-page__result--remove-buttons .view-page__result-row{flex-direction:row-reverse}.view-page__result--remove-buttons .view-page__result-row:nth-of-type(3)>fab-input-checkbox{max-width:272px}@media (min-width: 1200px){.view-page__result--dob{min-width:170px}}.view-page__result--info{justify-content:normal}.view-page__result--name{flex:3}.view-page__result--member-id,.view-page__result--dob{flex:2}.view-page__result .checkbox__input:disabled+label{color:#999}.view-page__next-button{text-align:right;position:sticky;bottom:0;background-color:#fff;margin:0 -25px;padding:10px 25px}.view-page__no-results{margin-top:25px;border-style:solid;border-width:thin;border-color:#e6e6e6;border-radius:2px;padding:25px;text-align:center}.view-page__no-results h4{margin-bottom:20px}.view-page .icon-success{color:#008048;font-size:20px}@media (min-width: 992px){.view-page .icon-success{font-size:30px}}.view-page i.icon{font-size:25px}.view-page i.icon.icon-success{color:#00ab4e}.view-page i.icon.icon-error{color:#31373e}.view-page i.icon.icon-circle{position:relative;display:flex;height:25px;width:25px;box-sizing:border-box}.view-page i.icon.icon-circle:before{content:"";position:absolute;height:25px;width:25px;top:0;left:0;border:1px solid #31373e;border-radius:50%;box-sizing:inherit}.view-page fab-notification{margin-top:25px}
2.view-page .modal-open .modal{display:block}.view-page .modal__content{padding:20px;overflow:auto;max-height:calc(100vh - 200px)}.view-page input[type=radio]{display:none!important}.view-page input[type=radio]~label{padding-left:34px;position:relative;text-transform:none;font-size:14px;line-height:24px;cursor:pointer;display:inline-block;height:24px}.view-page input[type=radio]~label:before{content:"";box-sizing:border-box;border-radius:50%;display:inline-block;width:24px;height:24px;border:2px solid rgb(229.5,229.5,229.5);position:absolute;left:0;top:0}.view-page input[type=radio]~label:after{opacity:0;transition:opacity .15s ease;content:"";display:inline-flex;justify-content:center;align-items:center;width:12px;height:12px;margin:6px;background-color:#00ab4e;position:absolute;left:0;top:0;border-radius:50%}.view-page input[type=radio]:checked~label:before{border-color:#00ab4e;border-width:4px}.view-page input[type=radio]:checked~label:after{opacity:1}.view-page input[type=radio]:disabled~label{color:#dfdfdf}.view-page input[type=radio]:disabled~label:before{border-color:#dfdfdf} 3`],encapsulation:2});let n=s;return n})();function _i(n,s){n&1&&(a(0,"strong"),c(1,"Error"),r())}function hi(n,s){if(n&1){let o=y();a(0,"div",2)(1,"div",7)(2,"h5")(3,"strong"),c(4),r()()(),x(5,"fab-table",8),a(6,"div",9)(7,"fab-input-checkbox",10),R("isCheckedChange",function(e){let i=_(o).$implicit;return k(i.confirmation.isChecked,e)||(i.confirmation.isChecked=e),h(e)}),g("onChange",function(e){let i=_(o).$index,l=p();return h(l.onCheckboxChange(i,e))}),r(),v(8,_i,2,0,"strong"),r()()}if(n&2){let o=s.$implicit,t=p();d(4),T(o.heading),d(),C("columnDefs",t.columnDefs)("defaultColDef",t.defaultColDef)("rowData",o.rowData),d(2),C("content",o.confirmation.content),S("isChecked",o.confirmation.isChecked),d(),w(o.invalid?8:-1)}}function fi(n,s){n&1&&(a(0,"div",3),c(1," Sorry, we've encountered an error removing your records. Please try again and "),a(2,"a",11),c(3,"contact us"),r(),c(4," if you get the same result. "),r())}var yt=(()=>{let s=class s{constructor(t,e,i){this.viewAndRemoveService=t,this.router=e,this.activatedRoute=i,this.showError=!1,this.tables=[],this.columnDefs=[{headerName:"Name",field:"name"},{headerName:"Student ID",field:"studentId"},{headerName:"D.O.B",field:"dob"},{headerName:"Centre",field:"centre"}],this.defaultColDef={resizable:!0},this.notificationContent={type:"warning",fullWidth:!0,message:`<strong>Please review the details below carefully before submitting</strong> 4 <div>If you make any changes to student records in error, they'll need to get in touch with us to have them corrected.</div>`},this.confirmButton={text:"Confirm",action:{type:"callback",callback:this.submit.bind(this)},type:"primary",aria:"Confirm"}}ngOnInit(){if(!this.viewAndRemoveService.hasAnyToUpdate()){this.goBack();return}this.tables=this.viewAndRemoveService.getAllTables()}goBack(){this.router.navigate(["./"],{relativeTo:this.activatedRoute.parent})}onCheckboxChange(t,e){e&&(this.tables[t].confirmation.content.invalid=!1)}submit(){this.tables.forEach(e=>e.confirmation.content.invalid=!1);let t=this.tables.filter(e=>!e.confirmation.isChecked);if(t.length){t.forEach(e=>e.confirmation.content.invalid=!0),this.scroll(t[0].confirmation.content.id);return}this.confirmButton.text="Confirming...",this.confirmButton.glyph={icon:z.LOOP2,glyphAnimation:"spin"},this.confirmButton.disabled=!0,this.showError=!1,this.viewAndRemoveService.commitChanges().subscribe({next:e=>{if(e.some(i=>i!=="Updated successfully"))console.error("Unexpected result:",e),this.showError=!0;else return this.router.navigate(["../confirmation"],{relativeTo:this.activatedRoute})},error:e=>{console.error("Error occurred:",e),this.showError=!0}}).add(()=>{this.confirmButton.text="Confirm",this.confirmButton.glyph=null,this.confirmButton.disabled=!1})}scroll(t){setTimeout(()=>{let e=document.getElementById(t);if(!e)return;let i=e.parentElement.getBoundingClientRect().top+window.scrollY-window.innerHeight/2;window.scrollTo({top:i,behavior:"smooth"})},0)}};s.\u0275fac=function(e){return new(e||s)(b(M),b(P),b(B))},s.\u0275cmp=I({type:s,selectors:[["app-review-changes"]],standalone:!1,decls:15,vars:5,consts:[[1,"view-page"],[3,"isNotificationOpen","notification"],[1,"view-page__table"],[1,"view-page__error"],[1,"view-page__buttons"],[3,"click"],["type","button",3,"enabled","button"],[1,"view-page__table--heading"],[3,"columnDefs","defaultColDef","rowData"],[1,"view-page__table--confirmation-box"],[3,"isCheckedChange","onChange","content","isChecked"],["href","/about/help-and-support/answers-for-training-providers"]],template:function(e,i){e&1&&(a(0,"div",0),x(1,"fab-notification",1),a(2,"h4")(3,"strong"),c(4,"Review and confirm"),r()(),a(5,"p"),
4c(6," You are making changes to the following records from the centres displayed below. If any of the details below are incorrect, please go back and correct them. "),r(),L(7,hi,9,7,"div",2,O),v(9,fi,5,0,"div",3),a(10,"div",4)(11,"div")(12,"a",5),g("click",function(){return i.goBack()}),c(13,"Go back"),r()(),x(14,"fab-button",6),r()()),e&2&&(d(),C("isNotificationOpen",!0)("notification",i.notificationContent),d(6),F(i.tables),d(2),w(i.showError?9:-1),d(5),C("enabled",!0)("button",i.confirmButton))},dependencies:[te,oe,ie,q],styles:[`:root{--aat-ui-grey-25: #bfbfbf;--aat-ui-grey-55: #737373;--aat-slate: #3a5066;--aat-ui-grey-05: #f2f2f2}.view-page fab-notification{margin-bottom:25px}.view-page__error{margin-top:40px;font-size:16px;color:#e22b25;text-align:center} 5`],encapsulation:2});let n=s;return n})();function gi(n,s){if(n&1&&(a(0,"div",2)(1,"div",5)(2,"h5")(3,"strong"),c(4),r()()(),x(5,"fab-table",6),r()),n&2){let o=s.$implicit,t=p();d(4),T(o.heading),d(),C("columnDefs",t.columnDefs)("defaultColDef",t.defaultColDef)("rowData",o.rowData)}}var St=(()=>{let s=class s{constructor(t,e,i){this.viewAndRemoveService=t,this.router=e,this.activatedRoute=i,this.tables=[],this.columnDefs=[{headerName:"Name",field:"name"},{headerName:"Student ID",field:"studentId"},{headerName:"D.O.B",field:"dob"},{headerName:"Centre",field:"centre"}],this.defaultColDef={resizable:!0}}ngOnInit(){if(!this.viewAndRemoveService.hasAnyToUpdate()){this.goBack();return}this.tables=this.viewAndRemoveService.getAllTables(),this.viewAndRemoveService.reset()}goBack(){this.router.navigate(["./"],{relativeTo:this.activatedRoute.parent})}};s.\u0275fac=function(e){return new(e||s)(b(M),b(P),b(B))},s.\u0275cmp=I({type:s,selectors:[["app-confirmation"]],standalone:!1,decls:20,vars:0,consts:[[1,"view-page"],["href","/about/help-and-support/answers-for-training-providers"],[1,"view-page__table"],[1,"view-page__buttons"],[3,"click"],[1,"view-page__table--heading"],[3,"columnDefs","defaultColDef","rowData"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"h4")(2,"strong"),c(3,"Your student record(s) are being updated"),r()(),a(4,"p"),c(5," The following student records are being updated. If the student has been removed, they've been contacted via email to inform them of the removal. However, please note that if the student has had changes to their apprenticeship, they will not be contacted about this change. "),r(),a(6,"p"),c(7,"Please be aware that changes may take up to 24 hours to process, so you may not see your updates immediately."),r(),a(8,"p"),c(9,"If you need any help you can "),a(10,"a",1),c(11,"contact us"),r(),c(12,"."),r(),L(13,gi,6,4,"div",2,O),a(15,"div",3),x(16,"div"),a(17,"div")(18,"a",4),g("click",function(){return i.goBack()}),c(19,"Return to view your students"),r()()()()),e&2&&(d(13),F(i.tables))},dependencies:[oe],encapsulation:2});let n=s;return n})();var Ci=[{path:"",component:xt,children:[{path:"",component:bt},{path:"review",component:yt},{path:"confirmation",component:St}]}],dn=(()=>{let s=class s{};s.\u0275fac=function(e){return new(e||s)},s.\u0275mod=be({type:s}),s.\u0275inj=xe({providers:[H],imports:[De,Pe.forChild(Ci),dt,it,st,nt,Ke,Je,He,mt,rt,ct,et,Ze,Ne,q,qe]});let n=s;return n})();export{dn as ViewAndRemoveModule};
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.