1"use strict";(self.webpackChunkangular_io_example=self.webpackChunkangular_io_example||[]).push([[4919],{205:(Ie,ne,i)=>{i.d(ne,{S:()=>M});var f=i(46443),e=i(68559),t=i(59452),Y=i(28404),O=i(55327);let M=(()=>{var W;class Q{constructor(){this.http=(0,e.WQX)(f.Qq),this.configService=(0,e.WQX)(Y.w),this.websiteService=(0,e.WQX)(O.j),this.CDO_URL=this.configService.getCdoUrl(),this.COMPANY_URL="".concat(this.CDO_URL,"api/b2b_company"),this.studentCourseData={}}patchCompanyB2BData(X,F){const P="".concat(this.COMPANY_URL,"/").concat(X);return this.http.patch(P,F)}companyB2BStudents(X){const F="".concat(this.COMPANY_URL,"/").concat(X,"/students");return this.http.get(F,{observe:"response"})}companyB2BStudentCourses(X,F){const P="".concat(this.COMPANY_URL,"/").concat(X,"/students/").concat(F,"/courses"),L=new f.Lr({"Accept-Language":this.websiteService.getLang()});return this.http.get(P,{headers:L,observe:"response"})}companyB2BOrders(X){const F="".concat(this.COMPANY_URL,"/").concat(X,"/orders");return this.http.get(F,{observe:"response"})}returnCourses(){return(0,t.of)(this.studentCourseData)}pushCourse(X,F,P){this.studentCourseData[F+P]=X}}return(W=Q).\u0275fac=function(X){return new(X||W)},W.\u0275prov=e.jDH({token:W,factory:W.\u0275fac,providedIn:"root"}),Q})()},67557:(Ie,ne,i)=>{i.d(ne,{B:()=>t});var f=i(68559),e=i(48503);let t=(()=>{var Y;class O{}return(Y=O).\u0275fac=function(W){return new(W||Y)},Y.\u0275cmp=f.VBU({type:Y,selectors:[["app-delta-warning-message"]],decls:13,vars:6,consts:[[1,"col-12","mt-3","pt-3","pt-sm-0"],["role","alert",1,"alert","alert-secondary","w-100"],[1,"mb-0"],["href","callto:+32 (3) 292.33.33"],[1,"fas","fa-phone","mr-1"]],template:function(W,Q){1&W&&(f.j41(0,"div",0)(1,"div",1)(2,"p"),f.EFF(3),f.nI1(4,"translate"),f.k0s(),f.nrm(5,"hr"),f.j41(6,"small",2)(7,"strong")(8,"a",3),f.nrm(9,"i",4),f.j41(10,"span"),f.EFF(11),f.nI1(12,"translate"),f.k0s()()()()()()),2&W&&(f.R7$(3),f.JRh(f.bMT(4,2,"deltaTextAccount")),f.R7$(8),f.JRh(f.bMT(12,4,"moreInfo")))},dependencies:[e.D9],encapsulation:2}),O})()},20892:(Ie,ne,i)=>{i.d(ne,{W:()=>Ae});var f=i(90954),e=i(68559),t=i(34456),Y=i(48503),O=i(50565),M=i(54285),W=i(84205),Q=i(59452),E=i(61873),X=i(1365),F=i(70271),P=i(61318),L=i(33900),D=i(205),z=i(10682),q=i(51360),A=i(32496),C=i(17077),fe=i(16453),_e=i(28404),Ce=i(40982),be=i(55327),ce=i(46325),pe=i(66643),ee=i(62849),ae=i(84175),Se=i(38223),me=i(71517),re=i(39096),Re=i(20075),ue=i(67557),$e=i(82465),ye=i(51731);const de=["tab"];function Ee(d,k){1&d&&e.nrm(0,"app-spinner")}function he(d,k){1&d&&e.nrm(0,"app-delta-warning-message")}function m(d,k){if(1&d&&e.nrm(0,"app-custom-input",19),2&d){const s=e.XpG(3);e.Y8G("label","dateOfBirth")("form",s.userForm)("control","dob")("type","date")("dateOptions",s.dobDatePickerOptions)("validation","formValidation.date")}}function x(d,k){if(1&d&&e.nrm(0,"app-custom-input",20),2&d){const s=e.XpG(3);e.Y8G("label","selectYourCountry")("form",s.userForm)("control","country")("type","auto-complete")("selectOptions",s.countryList)("visible",6)("validation","formValidation.country")("canClear",!0)}}function I(d,k){if(1&d&&e.DNE(0,m,1,6,"app-custom-input",19)(1,x,1,8,"app-custom-input",20),2&d){const s=e.XpG(2);e.vxM(null!=s.userForm.controls&&s.userForm.controls.dob?0:-1),e.R7$(),e.vxM(null!=s.userForm.controls&&s.userForm.controls.country?1:-1)}}function R(d,k){if(1&d&&e.nrm(0,"app-custom-input",21),2&d){const s=e.XpG(3);e.Y8G("label","street")("form",s.userForm)("control","street")("type","text")("validation","formValidation.street")}}function w(d,k){if(1&d&&e.nrm(0,"app-custom-input",21),2&d){const s=e.XpG(3);e.Y8G("label","number")("form",s.userForm)("control","streetNumber")("type","text")("validation","formValidation.number")}}function K(d,k){if(1&d&&e.nrm(0,"app-custom-input",22),2&d){const s=e.XpG(3);e.Y8G("label","mailboxNumber")("form",s.userForm)("control","bus")("type","text")}}function se(d,k){if(1&d&&e.nrm(0,"app-custom-input",21),2&d){const s=e.XpG(3);e.Y8G("label","postcode")("form",s.userForm)("control","zip")("type","text")("validation","formValidation.zipcode")}}function oe(d,k){if(1&d&&e.nrm(0,"app-custom-input",21),2&d){const s=e.XpG(3);e.Y8G("label","city")("form",s.userForm)("control","cityName")("type","text")("validation","formValidation.city")}}function ve(d,k){if(1&d&&e.DNE(0,R,1,5,"app-custom-input",21)(1,w,1,5,"app-custom-input",21)(2,K,1,4,"app-custom-input",22)(3,se,1,5,"app-custom-input",21)(4,oe,1,5,"app-custom-input",21),2&d){const s=e.XpG(2);e.vxM(null!=s.userForm.controls&&s.userForm.controls.street?0:-1),e.R7$(),e.vxM(null!=s.userForm.controls&&s.userForm.controls.streetNumber?1:-1),e.R7$(),e.vxM(null!=s.userForm.controls&&s.userForm.controls.bus?2:-1),e.R7$(),e.vxM(null!=s.userForm.controls&&s.userForm.controls.zip?3:-1),e.R7$(),e.vxM(null!=s.userForm.controls&&s.userForm.controls.cityName?4:-1)}}function Z(d,k){if(1&d){const s=e.RV6();
1e.j41(0,"small",12),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"span",23),e.bIt("click",function(){e.eBV(s);const v=e.XpG(2);return e.Njj(v.switchTab(2))}),e.EFF(4),e.nI1(5,"translate"),e.nI1(6,"titleCaseFirstWord"),e.k0s()()}2&d&&(e.R7$(),e.SpI(" ",e.bMT(2,2,"addressCopiedToShipping")," "),e.R7$(3),e.SpI(" ",e.bMT(6,6,e.bMT(5,4,"clickHere"))," "))}function xe(d,k){if(1&d&&e.nrm(0,"app-custom-input",25),2&d){const s=e.XpG(3);e.Y8G("label","businessType")("form",s.invoiceForm)("control","type")("type","select")("selectOptions",s.companyTypes)("visible",8)}}function Me(d,k){if(1&d&&e.nrm(0,"app-custom-input",24),2&d){const s=e.XpG(3);e.Y8G("label","accountNumber")("form",s.invoiceForm)("control","iban")("type","text")}}function Te(d,k){if(1&d&&e.nrm(0,"app-custom-input",26),2&d){const s=e.XpG(3);e.Y8G("label","CRKBOregistered")("form",s.invoiceForm)("control","registered")("type","select")("selectOptions",s.yesNoSelect)}}function De(d,k){if(1&d&&e.nrm(0,"app-custom-input",19),2&d){const s=e.XpG(3);e.Y8G("label","validUntil")("form",s.invoiceForm)("control","validDate")("type","date")("dateOptions",s.vatDatePickerOptions)("validation","formValidation.date")}}function Fe(d,k){if(1&d&&e.nrm(0,"app-custom-input",28),2&d){const s=e.XpG(3);e.Y8G("label","selectYourCountry")("form",s.invoiceForm)("control","country")("type","auto-complete")("selectOptions",s.countryList)("visible",6)("validation","formValidation.country")("canClear",!s.isCompResponsible)}}function Oe(d,k){if(1&d){const s=e.RV6();e.j41(0,"mat-tab",4),e.nI1(1,"translate"),e.j41(2,"form",5),e.bIt("ngSubmit",function(){e.eBV(s);const v=e.XpG(2);return e.Njj(v.onInvoiceFormSubmit())}),e.j41(3,"div",6)(4,"div",2),e.nrm(5,"app-custom-input",24)(6,"app-custom-input",24),e.DNE(7,xe,1,6,"app-custom-input",25)(8,Me,1,4,"app-custom-input",24)(9,Te,1,5,"app-custom-input",26)(10,De,1,6,"app-custom-input",19),e.nrm(11,"app-custom-input",24)(12,"app-custom-input",24)(13,"app-custom-input",24)(14,"app-custom-input",24)(15,"app-custom-input",27),e.DNE(16,Fe,1,8,"app-custom-input",28),e.k0s(),e.j41(17,"div",2)(18,"div",29)(19,"button",30),e.EFF(20),e.nI1(21,"translate"),e.k0s()()()()()()}if(2&d){const s=e.XpG(2);e.Y8G("position",1)("label",e.bMT(1,40,"myCompanyDetails"))("bodyClass","container"),e.R7$(2),e.Y8G("formGroup",s.invoiceForm),e.R7$(3),e.Y8G("label","companyName")("form",s.invoiceForm)("control","name")("type","text"),e.R7$(),e.Y8G("label","BTWNumber")("form",s.invoiceForm)("control","vat")("type","text"),e.R7$(),e.vxM(s.isCompResponsible||s.isStudent||!s.invoiceForm.controls.type?-1:7),e.R7$(),e.vxM(s.isCompResponsible||s.isStudent||!s.invoiceForm.controls.iban?-1:8),e.R7$(),e.vxM(s.isCompResponsible||s.isStudent||!s.invoiceForm.controls.registered?-1:9),e.R7$(),e.vxM(!s.isCompResponsible&&!s.isStudent&&s.invoiceForm.controls.validDate&&s.invoiceRegistered&&(+s.invoiceRegistered.value>0||+s.invoiceRegistered.value)?10:-1),e.R7$(),e.Y8G("label","street")("form",s.invoiceForm)("control","street")("type","text"),e.R7$(),e.Y8G("label","number")("form",s.invoiceForm)("control","streetNumber")("type","text"),e.R7$(),e.Y8G("label","mailboxNumber")("form",s.invoiceForm)("control","bus")("type","text"),e.R7$(),e.Y8G("label","postcode")("form",s.invoiceForm)("control","zip")("type","text"),e.R7$(),e.Y8G("label","city")("form",s.invoiceForm)("control","city")("type","text")("validation","formValidation.city"),e.R7$(),e.vxM(s.invoiceForm.controls.country?16:-1),e.R7$(3),e.Y8G("disabled",s.invoiceForm.pristine||!s.invoiceForm.touched||s.invoiceForm.invali
1d),e.R7$(),e.SpI(" ",e.bMT(21,42,"save")," ")}}function Ue(d,k){if(1&d){const s=e.RV6();e.j41(0,"mat-tab",4),e.nI1(1,"translate"),e.j41(2,"form",5),e.bIt("ngSubmit",function(){e.eBV(s);const v=e.XpG(2);return e.Njj(v.onShippingFormSubmit())}),e.j41(3,"div",6)(4,"div",2),e.nrm(5,"app-custom-input",21)(6,"app-custom-input",21)(7,"app-custom-input",22)(8,"app-custom-input",21)(9,"app-custom-input",21)(10,"app-custom-input",20),e.k0s(),e.j41(11,"div",2)(12,"div",29)(13,"button",14),e.EFF(14),e.nI1(15,"translate"),e.k0s()()()()()()}if(2&d){const s=e.XpG(2);e.Y8G("position",2)("label",e.bMT(1,38,"myShippingAddress"))("bodyClass","container"),e.R7$(2),e.Y8G("formGroup",s.shippingForm),e.R7$(3),e.Y8G("label","street")("form",s.shippingForm)("control","shippingStreet")("type","text")("validation","formValidation.street"),e.R7$(),e.Y8G("label","number")("form",s.shippingForm)("control","shippingHouseNumber")("type","text")("validation","formValidation.number"),e.R7$(),e.Y8G("label","bus")("form",s.shippingForm)("control","shippingBus")("type","text"),e.R7$(),e.Y8G("label","postcode")("form",s.shippingForm)("control","shippingZip")("type","text")("validation","formValidation.zipcode"),e.R7$(),e.Y8G("label","city")("form",s.shippingForm)("control","shippingCity")("type","text")("validation","formValidation.city"),e.R7$(),e.Y8G("label","selectYourCountry")("form",s.shippingForm)("control","shippingCountry")("type","auto-complete")("selectOptions",s.countryList)("visible",6)("validation","formValidation.country")("canClear",!0),e.R7$(3),e.Y8G("disabled",s.shippingForm.pristine||!s.shippingForm.touched||s.shippingForm.invalid),e.R7$(),e.SpI(" ",e.bMT(15,40,"save")," ")}}function Pe(d,k){1&d&&(e.j41(0,"span")(1,"em",12),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&d&&(e.R7$(2),e.JRh(e.bMT(3,1,"inProcess")))}function Le(d,k){if(1&d){const s=e.RV6();e.j41(0,"div",1),e.DNE(1,he,1,0,"app-delta-warning-message"),e.j41(2,"div",2)(3,"mat-tab-group",3,0)(5,"mat-tab",4),e.nI1(6,"translate"),e.j41(7,"form",5),e.bIt("ngSubmit",function(){e.eBV(s);const v=e.XpG();return e.Njj(v.onUserFormSubmit())}),e.j41(8,"div",6)(9,"div",2),e.nrm(10,"app-custom-input",7)(11,"app-custom-input",7)(12,"app-custom-input",8),e.DNE(13,I,2,2),e.j41(14,"div",9),e.nrm(15,"app-phone-number",10),e.k0s(),e.DNE(16,ve,5,5),e.k0s(),e.j41(17,"div",2)(18,"div",11),e.DNE(19,Z,7,8,"small",12),e.k0s(),e.j41(20,"div",13)(21,"button",14),e.EFF(22),e.nI1(23,"translate"),e.k0s()()()()()(),e.DNE(24,Oe,22,44,"mat-tab",4)(25,Ue,16,42,"mat-tab",4),e.j41(26,"mat-tab",4),e.nI1(27,"translate"),e.j41(28,"div",15)(29,"div",16),e.nrm(30,"div",17),e.nI1(31,"sanitize"),e.k0s(),e.j41(32,"div",16),e.nrm(33,"hr"),e.k0s(),e.j41(34,"div",16),e.nrm(35,"div",17),e.nI1(36,"sanitize"),e.j41(37,"button",18),e.bIt("click",function(){e.eBV(s);const v=e.XpG();return e.Njj(v.confirmDeleteAccount())}),e.EFF(38),e.nI1(39,"translate"),e.k0s(),e.DNE(40,Pe,4,3,"span"),e.k0s()()()()()()}if(2&d){const s=e.XpG();e.R7$(),e.vxM(s.isDelta?1:-1),e.R7$(2),e.Y8G("stretchTabs",!0)("dynamicHeight",!0),e.R7$(2),e.Y8G("position",0)("label",e.bMT(6,40,"myPersonalData"))("bodyClass","w-100"),e.R7$(2),e.Y8G("formGroup",s.userForm),e.R7$(3),e.Y8G("label","firstName")("form",s.userForm)("control","firstName")("type","text")("validation","formValidation.firstname"),e.R7$(),e.Y8G("label","lastName")("form",s.userForm)("control","lastName")("type","text")("validation","formValidation.lastname"),e.R7$(),e.Y8G("label","eMail")("form",s.userForm)("control","email")("type","text")("validation","email")("disabled",!0),e.R7$(),e.vxM(s.isCompResponsible?-1:13),e.R7$(2),e.Y8G("form",s.userForm)("controlName","phone"),e.R7$(),e.vxM(s.isCompResponsible?-1:16),e.R7$(3),e.vxM(s.copiedToShipping?19:-1),e.R7$(2),e.Y8G("disabled",s.userForm.pristine||!s.userForm.touched||s.userForm.invali
1d),e.R7$(),e.SpI(" ",e.bMT(23,42,"save")," "),e.R7$(2),e.vxM(s.invoiceForm?24:-1),e.R7$(),e.vxM(s.isStudent&&s.shippingForm?25:-1),e.R7$(),e.Y8G("position",3)("label",e.bMT(27,44,"privacy"))("bodyClass","container"),e.R7$(4),e.Y8G("innerHTML",e.bMT(31,46,s.privacyText),e.npT),e.R7$(5),e.Y8G("innerHTML",e.bMT(36,48,s.deleteText),e.npT),e.R7$(2),e.Y8G("disabled",s.hasUserDeleteRequest),e.R7$(),e.SpI(" ",e.bMT(39,50,"deleteAccount")," "),e.R7$(2),e.vxM(s.hasUserDeleteRequest?40:-1)}}let Ae=(()=>{var d;class k{constructor(){this.formBuilder=(0,e.WQX)(t.Qk),this.websiteService=(0,e.WQX)(be.j),this.userService=(0,e.WQX)(ce.D),this.companyService=(0,e.WQX)(fe.B),this.teacherService=(0,e.WQX)(pe.O),this.elementRef=(0,e.WQX)(e.aKT),this.helperService=(0,e.WQX)(Ce.w),this.toastService=(0,e.WQX)(M.tw),this.translateService=(0,e.WQX)(Y.c$),this.companyProfileService=(0,e.WQX)(D.S),this.authService=(0,e.WQX)(z.k),this.configService=(0,e.WQX)(_e.w),this.deviceDetectorService=(0,e.WQX)(O.Kg),this.isLoading=!0,this.userFormSubmitted=!1,this.invoiceFormSubmitted=!1,this.shippingFormSubmitted=!1,this.copiedToShipping=!1,this.dobDatePickerOptions={minSelectableDate:(0,ee.I1)().subtract(q.V4,A.$.year),maxSelectableDate:(0,ee.I1)().subtract(q.Fp,A.$.year),enableTouchUI:!this.deviceDetectorService.isDesktop()},this.hasUserDeleteRequest=!1,this.isDelta=!1,this.destroy$=new W.B}get invoiceRegistered(){return this.invoiceForm.get("registered")}ngOnInit(){this.elementRef.nativeElement.style.setProperty("--color-main",this.websiteService.getBackgroundColor()),this.authService.getCurrentUserStatus$().pipe((0,X.Z)(g=>{this.userStatus=g,this.isCompResponsible="COMP_RESP"===this.userStatus,this.isStudent="CUR"===this.userStatus||"COMP_CUR"===this.userStatus;const v=this.websiteService.getCompanyLegalText("PRIVACY_SHORT").pipe((0,F.T)(_=>{var o;return(null==_||null===(o=_.data)||void 0===o?void 0:o.text)||""}),(0,P.W)(()=>(0,Q.of)(""))),T=this.websiteService.getCompanyLegalText("DELETE_ACCOUNT").pipe((0,F.T)(_=>{var o;return(null==_||null===(o=_.data)||void 0===o?void 0:o.text)||""}),(0,P.W)(()=>(0,Q.of)(""))),N=this.websiteService.getCountries().pipe((0,F.T)(_=>{var o;return(null==_||null===(o=_.body)||void 0===o?void 0:o.data)||[]}),(0,P.W)(()=>(0,Q.of)([]))),B=this.userService.getUserInfo(this.getLongUserStatus()).pipe((0,F.T)(_=>(null==_?void 0:_.data)||""),(0,P.W)(()=>(0,Q.of)("")));let U=(0,Q.of)([]),j=(0,Q.of)([]);return!this.isStudent&&!this.isCompResponsible&&(U=this.companyService.getCompanyTypes().pipe((0,F.T)(_=>{var o;return(null==_||null===(o=_.body)||void 0===o?void 0:o.data)||[]})),j=this.teacherService.getTeacherCompanyInfo().pipe((0,F.T)(_=>{var o;return(null==_||null===(o=_.body)||void 0===o?void 0:o.data)||[]})),this.yesNoSelect=[{label:this.translateService.instant("no"),value:"0"},{label:this.translateService.instant("yes"),value:"1"}]),(0,E.p)([v,T,N,B,U,j])}),(0,L.Q)(this.destroy$)).subscribe(([g,v,T,N,B,U])=>{this.privacyText=g,this.deleteText=v,this.countryList=T.map(({countryCode:j,countryName:_})=>({value:j,label:_})),this.user=N,this.hasUserDeleteRequest=this.user.deleteRequestInitiated,B.length&&(this.companyTypes=B.map(({id:j,name:_})=>({value:j,label:_}))),U.hasOwnProperty("companyName")&&(this.companyInfo=U),this.createAndPatchForms(),this.isLoading=!1}),this.isDelta=this.configService.isEnvDelta()}ngAfterViewChecked(){const g=this.userService.getMissingShippingAddress();this.tabs&&g&&(this.switchTab(2),this.userService.setMissingShippingAddress(!1))}onUserFormSubmit(){this.userFormSubmitted=!0;const g=this.userForm.getRawValue();if(!this.isCompResponsible){g.country=g.country.value;const{dob:v}=g;g.dob=ee.I1.isDateWrapper(v)?v.format(A.x.iso.date):v}if(this.isStudent){const v=(({shippingCity:T,shippingCountry:N,shippingHouseNumber:B,shippingStreet:U,shippingZip:j})=>({shippingCity:T,shippingCountry:""===N?"":N.value,shippingHouseNumber:B,shippingStreet:U,shippingZip:j}))(this.shippingForm.value);if(this.helperService.areAllObjectValuesEmpty(v)){const{street:T,streetNumber:N,bus:B,zip:U,cityName:j,country:_}
1=g,o={shippingStreet:T,shippingHouseNumber:N,shippingBus:B,shippingZip:U,shippingCity:j,shippingCountry:_};this.shippingForm.patchValue((0,f.A)((0,f.A)({},o),{},{shippingCountry:this.userForm.get("country").value})),this.userService.updateUserShipping(o).pipe((0,L.Q)(this.destroy$)).subscribe(b=>{b.success?(this.copiedToShipping=!0,this.userService.updateUserInfo(this.getLongUserStatus(),g).pipe((0,L.Q)(this.destroy$)).subscribe({next:c=>this.formSubmitted(c),error:c=>this.handleFormSubmitError(c.error)})):this.toastService.warning(this.translateService.instant("errorLabel"))})}else this.userService.updateUserInfo(this.getLongUserStatus(),g).pipe((0,L.Q)(this.destroy$)).subscribe({next:T=>this.formSubmitted(T),error:T=>this.handleFormSubmitError(T.error)})}else this.userService.updateUserInfo(this.getLongUserStatus(),g).pipe((0,L.Q)(this.destroy$)).subscribe({next:v=>this.formSubmitted(v),error:v=>this.handleFormSubmitError(v.error)})}onInvoiceFormSubmit(){this.invoiceFormSubmitted=!0;const g=this.createInvoiceObject(this.invoiceForm.getRawValue());this.isStudent?this.userService.updateUserInvoice(g).pipe((0,L.Q)(this.destroy$)).subscribe({next:v=>this.formSubmitted(v),error:v=>this.handleFormSubmitError(v.error)}):this.isCompResponsible?this.companyProfileService.patchCompanyB2BData(this.user.b2bCompany.id,g).pipe((0,L.Q)(this.destroy$)).subscribe({next:v=>this.formSubmitted(v),error:v=>this.handleFormSubmitError(v.error)}):this.teacherService.patchTeacherCompanyInfo(g).pipe((0,L.Q)(this.destroy$)).subscribe({next:v=>this.formSubmitted(v),error:v=>this.handleFormSubmitError(v.error)})}onShippingFormSubmit(){this.shippingFormSubmitted=!0;const g=this.shippingForm.getRawValue();g.shippingCountry=this.shippingForm.get("shippingCountry").value.value,this.userService.updateUserShipping(g).pipe((0,L.Q)(this.destroy$)).subscribe({next:v=>this.formSubmitted(v),error:v=>this.handleFormSubmitError(v.error)})}confirmDeleteAccount(){this.userService.deleteAccount().pipe((0,L.Q)(this.destroy$)).subscribe(g=>{this.hasUserDeleteRequest=g})}switchTab(g){this.tabs.selectedIndex=g}createAndPatchForms(){var g;let v;if(this.userForm=this.formBuilder.group({firstName:["",(0,C.xE)(!0)],lastName:["",(0,C.jh)(!0)],email:[{value:"",disabled:!0}],phone:["",[t.k0.required,(0,C.rK)()]]}),this.isCompResponsible||(this.userForm.addControl("dob",this.formBuilder.control(null,[t.k0.required,(0,C.CB)(q.Fp,q.V4,A.x.iso.date)])),this.userForm.addControl("street",this.formBuilder.control("",(0,C.A6)(!0))),this.userForm.addControl("streetNumber",this.formBuilder.control("",(0,C.IZ)(!0))),this.userForm.addControl("bus",this.formBuilder.control("",(0,C.ii)())),this.userForm.addControl("zip",this.formBuilder.control("",(0,C.uT)(!0))),this.userForm.addControl("cityName",this.formBuilder.control("",(0,C.A6)(!0))),this.userForm.addControl("country",this.formBuilder.control("",[t.k0.required,(0,C.$t)(this.countryList)]))),v=this.isStudent?this.user.invoice:this.isCompResponsible?this.user.b2bCompany:this.companyInfo,this.invoiceForm=this.createInvoiceFormGroup(v),this.isCompResponsible&&null!==(g=this.invoiceForm.controls)&&void 0!==g&&g.country&&this.invoiceForm.controls.country.disable(),!this.isCompResponsible&&!this.isStudent&&(this.vatDatePickerOptions={minSelectableDate:(0,ee.I1)().subtract(1,A.$.year),maxSelectableDate:(0,ee.I1)().add(50,A.$.year),enableTouchUI:!this.deviceDetectorService.isDesktop()},this.invoiceForm.valueChanges.pipe((0,L.Q)(this.destroy$)).subscribe(({registered:T})=>{+T?this.invoiceForm.controls.validDate.addValidators(t.k0.required):(this.invoiceForm.controls.validDate.setValue(null,{onlySelf:!0,emitEvent:!1}),this.invoiceForm.controls.validDate.clearValidators()),this.invoiceForm.controls.validDate.updateValueAndValidity({emitEvent:!1})})),this.isStudent){const{shippingBus:T,shippingStreet:N,shippingNumber:B,shippingZip:U,shippingCity:j,shippingCountry:_}=this.user.shipping;this.shippingForm=this.formBuilder.group({shippingStreet:[N,(0,C.A6)(!0)],shippingHouseNumber:[B,(0,C.IZ)(!0)],shippingBus:[T,(0,C.ii)()],shippingZip:[U,(0,C.uT)(!0)],shippingCity:[j,(0,C.A6
1)(!0)],shippingCountry:[this.getCountry(_)||"",[t.k0.required,(0,C.$t)(this.countryList)]]})}if(this.userForm.patchValue((({firstName:T,lastName:N,email:B,phone:U})=>({firstName:T,lastName:N,email:B,phone:U}))(this.user)),this.user.phone&&!this.user.phone.startsWith("+")){const{phone:T}=this.userForm.controls;T.setValue(""),T.updateValueAndValidity({emitEvent:!1})}this.isCompResponsible||this.userForm.patchValue((({street:T,streetNumber:N,zip:B,cityName:U,bus:j,dob:_,country:o})=>({street:T,streetNumber:N,zip:B,cityName:U,bus:j,dob:"00-00-0000"===_?null:(0,ee.I1)(_,A.x.eu.dashes.date),country:this.getCountry(o)||""}))(this.user)),this.userForm.markAllAsTouched(),this.invoiceForm.markAllAsTouched(),this.shippingForm&&this.shippingForm.markAllAsTouched()}formSubmitted({success:g}){g?(this.toastService.success(this.translateService.instant("CVdataUpdatedSuccess")),this.resetForms()):(this.toastService.warning(this.translateService.instant("errorLabel")),this.resetForms())}resetForms(){this.shippingFormSubmitted=!1,this.invoiceFormSubmitted=!1,this.userFormSubmitted=!1,this.userForm.markAsPristine(),this.userForm.markAsUntouched(),this.shippingForm&&(this.shippingForm.markAsPristine(),this.shippingForm.markAsUntouched()),this.invoiceForm.markAsPristine(),this.invoiceForm.markAsUntouched()}handleFormSubmitError(g){this.toastService.warning(this.translateService.instant("errorLabel"))}getCountry(g){return this.countryList.find(v=>v.value===g)}getLongUserStatus(){switch(this.userStatus){case"COMP_RESP":return"b2b_responsible";
1case"DOC":case"CANDTEACH":return"teacher";default:return"student"}}createInvoiceFormGroup(g){const v=t.k0.required;if(this.isStudent){const{invoiceStreet:T,invoiceHouseNumber:N,invoiceBus:B,invoiceZip:U,invoiceCity:j,invoiceCountry:_,invoiceCompanyName:o,invoiceCompanyBTW:b}=g,c=this.getCountry(_)||"";return this.formBuilder.group({street:[T,(0,C.A6)()],streetNumber:[N,(0,C.IZ)()],bus:[B,(0,C.ii)()],zip:[U,(0,C.uT)()],city:[j,(0,C.A6)(!0)],country:[c,[v,(0,C.$t)(this.countryList)]],name:[o,(0,C.QG)()],vat:[b,(0,C.iT)(!1)]})}if(this.isCompResponsible){const{street:T,streetNumber:N,bus:B,postcode:U,city:j,countryCode:_,name:o,vat:b}=g,c=this.getCountry(_)||"";return this.formBuilder.group({street:[T,(0,C.A6)(!0)],streetNumber:[N,(0,C.IZ)(!0)],bus:[B,(0,C.ii)()],zip:[U,(0,C.uT)(!0)],city:[j,(0,C.A6)(!0)],country:[c,[v,(0,C.$t)(this.countryList)]],name:[o,(0,C.QG)()],vat:[b,(0,C.iT)()]})}{const{companyStreet:T,companyStreetNumber:N,companyBus:B,companyZip:U,companyCityName:j,companyCountryCode:_,companyName:o,companyVAT:b,companyTypeId:c,companyIBAN:l,CRKBORegistered:p,CRKBOValidDate:h}=g,y=this.getCountry(_)||"";return this.formBuilder.group({street:[T,(0,C.A6)(!0)],streetNumber:[N,(0,C.IZ)(!0)],bus:[B,(0,C.ii)()],zip:[U,(0,C.uT)(!0)],city:[j,(0,C.A6)(!0)],country:[y,[v,(0,C.$t)(this.countryList)]],name:[o,(0,C.QG)()],vat:[b,(0,C.iT)()],type:[c,[v]],iban:[l,(0,C.n5)()],registered:[p,[v]],validDate:[h?(0,ee.I1)(h,A.x.eu.dashes.date):null]})}}createInvoiceObject(g){const{street:v,streetNumber:T,bus:N,zip:B,city:U,country:j,name:_,vat:o}=g;if(this.isStudent)return{invoiceStreet:v,invoiceHouseNumber:T,invoiceBus:N,invoiceZip:B,invoiceCity:U,invoiceCountry:j.value,invoiceCompanyName:_,invoiceCompanyBTW:o};if(this.isCompResponsible)return{street:v,streetNumber:T,bus:N,postcode:B,city:U,countryCode:j.value,
1name:_,vat:o};{const{type:b,iban:c,registered:l,validDate:p}=g;return{companyStreet:v,companyStreetNumber:T,companyBus:N,companyZip:B,companyCityName:U,companyCountryCode:j.value,companyName:_,companyVAT:o,companyTypeId:b,companyIBAN:c,CRKBORegistered:+l,CRKBOValidDate:p?(0,ee.I1)(p).format(A.x.eu.dashes.date):""}}}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}return(d=k).\u0275fac=function(g){return new(g||d)},d.\u0275cmp=e.VBU({type:d,selectors:[["app-user-profile"]],viewQuery:function(g,v){if(1&g&&e.GBs(de,5),2&g){let T;e.mGM(T=e.lsd())&&(v.tabs=T.first)}},decls:2,vars:1,consts:[["tab",""],["id","user-profile",1,"container","mat-elevation-z3","sm-no-shadow","mb-0","mb-sm-5","p-0"],[1,"row"],["backgroundColor","primary",1,"w-100","tabs-main",3,"stretchTabs","dynamicHeight"],[3,"position","label","bodyClass"],[3,"ngSubmit","formGroup"],[1,"container","py-1","px-1","px-sm-5","py-sm-4"],["icon","user",1,"col-lg-6","col-md-12",3,"label","form","control","type","validation"],["icon","envelope",1,"col-lg-6","col-md-12",3,"label","form","control","type","validation","disabled"],[1,"col-lg-6","col-md-12"],["label","phoneNumber","icon","mobile-screen-button",3,"form","controlName"],[1,"col-12","col-md-8"],[1,"text-muted"],[1,"col-12","col-md-4","text-right"],["type","submit","mat-raised-button","","color","primary",1,"mr-0","btn-md",3,"disabled"],[1,"row","py-1","px-1","px-sm-5","py-sm-4"],[1,"col-12"],[1,"privacy-text",3,"innerHTML"],["type","button","mat-raised-button","","color","primary",1,"mr-0","btn-md",3,"click","disabled"],["icon","calendar-days",1,"col-lg-6","col-md-12",3,"label","form","control","type","dateOptions","validation"],["icon","house",1,"col-lg-6","col-md-12",3,"label","form","control","type","selectOptions","visible","validation","canClear"],["icon","house",1,"col-lg-6","col-md-12",3,"label","form","control","type","validation"],["icon","house",1,"col-lg-6","col-md-12",3,"label","form","control","type"],[1,"underline","c-p",3,"click"],["icon","building",1,"col-lg-6","col-md-12",3,"label","form","control","type"],["icon","building",1,"col-lg-6","col-md-12",3,"label","form","control","type","selectOptions","visible"],["icon","building",1,"col-lg-6","col-md-12",3,"label","form","control","type","selectOptions"],["icon","building",1,"col-lg-6","col-md-12",3,"label","form","control","type","validation"],["icon","building",1,"col-lg-6","col-md-12",3,"label","form","control","type","selectOptions","visible","validation","canClear"],[1,"col-12","text-right"],["mat-raised-button","","color","primary","type","submit",1,"mr-0","btn-md",3,"disabled"]],template:function(g,v){1&g&&e.DNE(0,Ee,1,0,"app-spinner")(1,Le,41,52,"div",1),2&g&&e.vxM(v.isLoading?0:1)},dependencies:[t.qT,t.cb,t.j4,ae.$z,Se.mq,Se.T8,me.t,re.H,Re.D,ue.B,Y.D9,$e.v,ye.p],styles:["#user-profile[_ngcontent-%COMP%]{overflow:hidden}@media (max-width: 576px){form[_ngcontent-%COMP%]{padding:var(--space-2rem)}}\n\n/*# sourceMappingURL=user-profile.component.css.map*/"]}),k})()},17077:(Ie,ne,i)=>{i.d(ne,{$t:()=>Re,A2:()=>$e,A6:()=>C,BU:()=>Ee,CB:()=>ue,FV:()=>de,IZ:()=>fe,KL:()=>me,QG:()=>ae,au:()=>be,e:()=>Se,e4:()=>he,iT:()=>pe,ii:()=>_e,jh:()=>A,n5:()=>ee,nw:()=>ce,rK:()=>re,uT:()=>Ce,xE:()=>q,z6:()=>ye});var f=i(34456),e=i(70271),t=i(62849),Y=i(51360),O=i(32496),M=i(64486);const E=f.k0.required,X=f.k0.email,F=m=>f.k0.minLength(m),P=m=>f.k0.maxLength(m),L=m=>f.k0.pattern(m),D=(m,...x)=>m?[E,...x]:x,z=(m=1,x=100,I=!0)=>{const R=[F(m),P(x)];return I?[...R,re()]:R},q=(m=!0)=>D(m,...z(void 0,32),L(M.AE)),A=(m=!0)=>D(m,...z(void 0,48),L(M.AE)),C=(m=!1)=>D(m,...z(void 0,100),L(M.vW)),fe=(m=!1)=>D(m,P(8),L(M.Ae),re()),_e=(m=!1)=>
1D(m,P(8),L(M.vW),re()),Ce=(m=!1)=>D(m,P(15),L(M.XK),re()),be=(m=!0)=>D(m,X,L(M.Xw)),ce=(m=!0)=>D(m,...z(6,32,!1),L(M.A9)),pe=(m=!0)=>D(m,...z(void 0,20)),ee=(m=!0)=>D(m,...z(void 0,35)),ae=(m,x,I=!0)=>D(I,...z(m,x)),Se=()=>m=>{let x=m.value;return(x.match(/<.*?>/gim)||[]).forEach(R=>{x=x.replace(R,"")}),x=x.replace(/ |\t|\n/gim," ").trim(),!x.length&&m.value.length?{actualLength:{value:x.length}}:null},me=m=>x=>x&&x.parent&&x.parent.get(m).value!==x.value?{mustMatch:!0}:null,re=()=>m=>{if(!m.value)return null;const x=null==m?void 0:m.value.match(/^[^\s].*/),I=null==m?void 0:m.value.match(M.bp);return x?I?{consecutiveSpaces:!0}:null:{noStartingSpaces:!0}},Re=m=>R=>{if(R.value.hasOwnProperty("label")&&R.value.hasOwnProperty("value"))return null;const w=R.value.toLowerCase();return!R.hasValidator(f.k0.required)&&!w||m.find(se=>se.label.toLowerCase()===w)?null:{foundCountry:{value:R.value}}},ue=(m=Y.Fp,x=Y.V4,I=O.x.eu.dashes.date)=>R=>{const w=R.value;let K;K="string"==typeof w?(0,t.I1)(w,I):(0,t.I1)(w);const oe=(0,t.I1)().diff(K,O.$.year);return oe<m||oe>x?{dateValidation:!0}:null},$e=(m,x)=>I=>{var R,w;const K=I.parent,se=null==K||null===(R=K.get(m))||void 0===R?void 0:R.value,oe=null==K||null===(w=K.get(x))||void 0===w?void 0:w.value;return se&&oe&&se.isAfter(oe)?{endDatePrecedesStartDate:!0}:null},ye=(m,x,I,R)=>w=>{var K,se,oe,ve;const Z=w.parent,xe=null==Z||null===(K=Z.get(m))||void 0===K?void 0:K.value,Me=null==Z||null===(se=Z.get(x))||void 0===se?void 0:se.value,Te=null==Z||null===(oe=Z.get(I))||void 0===oe?void 0:oe.value,De=null==Z||null===(ve=Z.get(R))||void 0===ve?void 0:ve.value;if(!(xe&&Me&&Te&&De))return null;{const Fe=(0,t.I1)(Te,O.x.misc.time),Oe=(0,t.I1)(De,O.x.misc.time);if(xe.isSame(Me)&&Fe.isAfter(Oe))return{endTimePrecedesStartTime:!0}}},de=(m=0)=>x=>{const{value:I}=x;if(!I)return null;const R=I.trim();return R?R.length>=m?null:{minlength:!0}:{emptyOrWhitespace:!0}},Ee=(m,x)=>I=>{var R;if(!I||!I.get(m)||!I.get(x))return console.warn("make sure the mustMatchValidator is correctly set up"),null;null!==(R=I.get(m))&&void 0!==R&&null!==(R=R.errors)&&void 0!==R&&R.mustMatch&&(delete I.get(m).errors.mustMatch,I.get(m).updateValueAndValidity());const w=I.get(m).getRawValue(),K=I.get(x).getRawValue();return w&&w!==K&&I.get(m).setErrors({mustMatch:!0}),null},he=m=>x=>{const{value:I}=x;if(!I)return null;const R=I.trim();return m.doesEmailAddressExists({email:R}).pipe((0,e.T)(w=>w.success?{emailAlreadyExists:!0}:null))}},26611:(Ie,ne,i)=>{i.d(ne,{w:()=>je});var f=i(60316),e=i(68559),t=i(11624),Y=i(50565),O=i(84205),M=i(33900),W=i(18537),Q=i(52575),E=i(51360),X=i(68752),F=i(55327),P=i(84175),L=i(17049),D=i(90954),z=i(87941),q=i(80436),A=i(48503),C=i(54285),fe=i(70271),_e=i(61318),Ce=i(59452),be=i(27717),ce=i(10682),pe=i(29357),ee=i(88701),ae=i(21675),Se=i(75433),me=i(46325),re=i(66643);let Re=(()=>{var a;class S{constructor(){this.toastrService=(0,e.WQX)(C.tw),this.translateService=(0,e.WQX)(A.c$),this.userService=(0,e.WQX)(me.D),this.data=(0,e.WQX)(ae.y2),this.authService=(0,e.WQX)(ce.k),this.isButtonDisabled=!1,this.destroy$=new O.B}ngOnInit(){var n;this.userEmail=(null===(n=this.authService.getCurrentUser())||void 0===n?void 0:n.email)||""}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}confirmEmail(){this.isButtonDisabled=!0,this.userService.sendConfirmationEmail(this.userService.getUserStatusEntity()).pipe((0,Q.B)(400),(0,M.Q)(this.destroy$)).subscribe({next:n=>{200===n.status&&(this.isButtonDisabled=!1,this.toastrService.success(this.translateService.instant("sendConfirmationEmailSuccess")),this.data.dialogRef.close())},error:n=>{403===n.status?(this.toastrService.warning(this.translateService.instant("emailVerified")),this.data.dialogRef.close()):this.toastrService.error(this.translateService.instant("somethingWentWrongTryAgain")),setTimeout(()=>{this.isButtonDisabled=!1},1e3)}})}}return(a=S).\u0275fac=function(n){return new(n||a)},a.\u0275cmp=e.VBU({type:a,selectors:[["app-confirm-email-dialog"]],decls:13,vars:11,consts:[["mat-dialog-content","",1,"text-center"],[1,"mb-0"],[1,"font-weight-bold"],["mat-dialog-actions","","align","center"],["mat-button","","color","primary","type","button",3,"click","disabled"]],template:function(n,r){1&n&&(e.j41(0,"div",0)(1,"p"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p",1),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"p",2),e.EFF(8),e.k0s()(),e.j41(9,"div",3)(10,"button",4),e.bIt("click",function(){return r.confirmEmail()}),e.EFF(11),e.nI1(12,"translate"),e.k0s()()),2&n&&(e.R7$(2),e.JRh(e.bMT(3,5,"verifyEmailMessage")),e.R7$(3),e.JRh(e.bMT(6,7,"emailSentTo")),e.R7$(3),e.JRh(r.userEmail),e.R7$(2),e.Y8G("disabled",r.isButtonDisabled),e.R7$(),e.SpI(" ",e.bMT(12,9,"
1sendConfirmationEmail")," "))},dependencies:[P.$z,z.E7,z.Yi,A.D9],encapsulation:2}),S})();var ue=i(71920),$e=i(85763);const ye=a=>[{title:"myMessages",link:"/".concat(a,"/communication"),icon:"fa-regular fa-envelope",route:"communication sent",notificationProp:"unreadMessages"},{title:"inbox",link:"/".concat(a,"/communication"),icon:"fa-regular fa-envelope-open",route:"communication",subLink:!1,notificationProp:"unreadMessages"},{title:"sent",link:"/".concat(a,"/communication/sent"),icon:"fa-regular fa-paper-plane",route:"sent",subLink:!1}],de=a=>[{title:"calendar",link:"/".concat(a,"/agenda"),icon:"fa-regular fa-calendar-days",route:"agenda"}],Ee={title:"documents",action:{method:"openSelectCourse",param:"documents"},icon:"fa-solid fa-file",route:"documents"},he={title:"tutorialsLinks",action:{method:"openSelectCourse",param:"tutorials"},icon:"fa-solid fa-circle-play",route:"tutorials"},m={title:"singOutLabel",action:{method:"logout"},icon:"fa-solid fa-power-off",route:"logout"},oe={student:[{title:"course.plural",items:[{title:"myInterests",link:"/student/interesses",icon:"fa-solid fa-heart",route:"interesses"},{title:"myCourses",link:"/student/cursussen",icon:"fa-brands fa-leanpub",route:"cursussen"}]},{title:"stprograme",items:[...ye(E.Ed.student),...de(E.Ed.student),{title:"fInfoSessions",link:"/student/infosession",icon:"fa-solid fa-chalkboard-user",route:"infosession"},{title:"diploma",link:"/student/diploma",icon:"fa-solid fa-medal",route:"diploma"},{title:"feedback",link:"/student/feedback",icon:"fa-regular fa-comment-dots",route:"feedback"},{title:"courseMaterial",link:"/student/materials",icon:"fa-solid fa-cubes",route:"materials"}]},{title:"eCampus",items:[{title:"virtualClassRoom",action:{method:"openSelectCourse",param:"virtual-room"},icon:"fa-solid fa-video",route:"virtual-room"},{title:"courseInfo",action:{method:"openSelectCourse",param:"details"},icon:"fa-solid fa-circle-info",route:"details"},{title:"tasks",action:{method:"openSelectCourse",param:"tasks"},icon:"fa-solid fa-clipboard-list",route:"tasks"},{title:"exercises",action:{method:"openSelectCourse",param:"exercises"},icon:"fa-solid fa-diagram-project",route:"exercises"},he,Ee,{title:"ai.askAi",action:{method:"openSelectCourse",param:"ai-teacher"},icon:"fa-solid fa-comments",route:"ai-teacher"}]},{title:"profile",items:[{title:"changeProfile",link:"/student/info",icon:"fa-solid fa-users",route:"profile"},m]}],teacher:[{title:"course.plural",items:[{title:"myCourses",link:"/teacher/courses",icon:"fa-brands fa-leanpub",route:"courses"},{title:"myInvTH",link:"/teacher/invitations",icon:"fa-solid fa-receipt",route:"invitations"},{title:"myClassPreference",link:"/teacher/preferences",icon:"fa-solid fa-heart",route:"preferences"}]},{title:"stprograme",items:[...ye(E.Ed.teacher),...de(E.Ed.teacher),{title:"correctionJob",link:"/teacher/correction",icon:"fa-regular fa-square-check",route:"correction",notificationProp:"openEvaluations"}]},{title:"eCampus",items:[{title:"mhEcampus",action:{method:"teacherEloLink"},icon:"fa-solid fa-graduation-cap",route:"elo"},{title:"courseInfo",action:{method:"openSelectCourse",param:"course"},icon:"fa-solid fa-circle-info",route:"detail"},{title:"attendanceListTitle",action:{method:"openSelectCourse",param:"attend"},icon:"fa-solid fa-users",route:"attend"},{title:"tasks",action:{method:"openSelectCourse",param:"task"},icon:"fa-solid fa-clipboard-list",route:"task"},{title:"exercises",action:{method:"openSelectCourse",param:"exercise"},icon:"fa-solid fa-diagram-project",route:"exercise"},{title:"evaluation.examAndEvaluation",action:{method:"openSelectCourse",param:"exam"},icon:"fa-solid fa-trophy",route:"exam"},Ee,he,{title:"virtualClassRoom",action:{method:"openSelectCourse",param:"virtual-room"},icon:"fa-solid fa-video",route:"virtual-room"},{title:"courseMaterial",action:{method:"openSelectCourse",param:"materials"},icon:"fa-solid fa-cubes",route:"materials"}]},{title:"profile",items:[{title:"invoices.myInvoices",link:"/teacher/invoices",icon:"fa-solid fa-receipt",route:"invoices"},{title:"myCv",link:"/teacher/cv",icon:"fa-solid fa-pen",route:"cv"},{title:"changeProfile",link:"/teacher/profile",icon:"fa-solid fa-users",route:"profile"},m]}],company:[{title:"",items:[{title:"cmpEmployees",link:"/company/collaborators",icon:"fa-solid fa-user-group",route:"collaborators"},{title:"cmpSubscriptions",link:"/company/subscriptions",icon:"fa-solid fa-pencil",route:"subscriptions"},{title:"cmpCommunication",link:"/company/communication",icon:"fa-solid fa-envelope",route:"communication sent",disabled:!0},{title:"invoices.invoices",link:"/company/invoices",icon:"fa-solid fa-file-invoice",route:"invoices",disabled:!0},{title:"cmpCoursePlanning",link:"/company/planning",icon:"fa-solid fa-clipboard-list",route:"planning",disabled:!0}]},{title:"profile",items:[{title:"cmpCompanyProfile",link:"/company/profile",icon:"fa-solid fa-user-tie",route:"profile"},m]}]};var ve=i(61620),Z=i(16256);const xe=a=>({extraPadding:a}),Me=(a,S)=>({active:a,disabled:S}),Te=a=>({"text-white":a});
1function De(a,S){if(1&a&&(e.qex(0),e.nrm(1,"i",5),e.bVm()),2&a){const u=e.XpG(2);e.R7$(),e.Y8G("ngClass",0===u.hasExam[0]?"text-danger":"text-warning")}}function Fe(a,S){if(1&a&&(e.nrm(0,"div",6),e.nI1(1,"translate")),2&a){const u=e.XpG(2);e.Y8G("matBadge",u.notificationBadge>=100?e.bMT(1,1,"maxNotificationValue"):u.notificationBadge)}}function Oe(a,S){if(1&a){const u=e.RV6();e.j41(0,"li",1)(1,"a",2),e.bIt("click",function(){e.eBV(u);const r=e.XpG();return r.handleCloseNav(),e.Njj(r.navItem.action?r.emitAction():null)}),e.nrm(2,"i",1),e.j41(3,"span"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.DNE(6,De,2,1,"ng-container",3)(7,Fe,2,3,"div",4),e.k0s()()}if(2&a){const u=e.XpG();e.Y8G("ngClass",e.eq3(12,xe,u.extraPadding)),e.R7$(),e.Y8G("ngClass",e.l_i(14,Me,u.active,u.navItem.disabled))("routerLink",u.navItem.link)("tabIndex",u.navItem.disabled?-1:0),e.R7$(),e.HbH(u.navItem.icon),e.Y8G("ngClass",e.eq3(17,Te,u.active)),e.R7$(2),e.JRh(e.bMT(5,10,u.navItem.title)),e.R7$(2),e.Y8G("ngIf",u.hasExam),e.R7$(),e.Y8G("ngIf",u.notificationBadge)}}let Ue=(()=>{var a;class S{constructor(){this.messageService=(0,e.WQX)(ve.b),this.hasExam=null,this.notificationBadge=null,this.actionOutput=new e.bkB,this.closeNav=new e.bkB,this.extraPadding=!1,this.showLink=!0,this.needsPadding=new Set(["communicatie","sent","communication"])}ngOnInit(){this.extraPadding=this.needsPadding.has(this.navItem.route),this.navItem.hasOwnProperty("subLink")&&(this.showLink=this.navItem.subLink)}emitAction(){this.actionOutput.emit(this.navItem.action)}handleCloseNav(){window.innerWidth<=1440&&this.closeNav.emit(),["communication sent","communication","sent"].includes(this.navItem.route)&&this.messageService.resetCurrentMessageSearchTerm()}}return(a=S).\u0275fac=function(n){return new(n||a)},a.\u0275cmp=e.VBU({type:a,selectors:[["app-sidebar-nav-item"]],inputs:{active:"active",navItem:"navItem",hasExam:"hasExam",notificationBadge:"notificationBadge"},outputs:{actionOutput:"actionOutput",closeNav:"closeNav"},decls:1,vars:1,consts:[[3,"ngClass",4,"ngIf"],[3,"ngClass"],[1,"link",3,"click","ngClass","routerLink","tabIndex"],[4,"ngIf"],["class","mx-2","matBadgeOverlap","false",3,"matBadge",4,"ngIf"],[1,"pl-3","fas","fa-exclamation-triangle","exam-warning",3,"ngClass"],["matBadgeOverlap","false",1,"mx-2",3,"matBadge"]],template:function(n,r){1&n&&e.DNE(0,Oe,8,19,"li",0),2&n&&e.Y8G("ngIf",r.showLink)},dependencies:[f.YU,f.bT,t.Wk,Z.k,A.D9],styles:["li[_ngcontent-%COMP%]:hover:not(:has(.link.active)){background-color:var(--color-black-transparency-2)!important}li[_ngcontent-%COMP%]:has(.link.active){background-color:var(--color-background)}a[_ngcontent-%COMP%]{padding:var(--space-0_2rem) var(--space-1rem);display:flex;flex-direction:row;align-items:center;min-height:var(--size-icon-md);font-size:var(--font-size-81);font-weight:var(--font-weight-light)}a.active[_ngcontent-%COMP%]{color:var(--color-tint-1)}a[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-left:var(--space-5px);color:var(--color-tint-15)}a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;width:var(--size-20px)}.link.active[_ngcontent-%COMP%]{background-color:var(--color-background)}.link.active[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--color-tint-1)}.link.active[_ngcontent-%COMP%]:hover{background-color:var(--color-background)!important;opacity:var(--opacity-65)}.extraPadding[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding-left:var(--space-30px)}.disabled[_ngcontent-%COMP%]{opacity:var(--opacity-50)}.exam-warning[_ngcontent-%COMP%]{animation:pulse var(--behavior-function-linear) var(--duration-1000) var(--animation-iteration-infinite);opacity:var(--opacity-100)}\n\n/*# sourceMappingURL=sidebar-nav-item.component.css.map*/"]}),S})();var Pe=i(82571);function Le(a,S){if(1&a){const u=e.RV6();e.j41(0,"a",2),e.bIt("click",function(){const r=e.eBV(u).$implicit,$=e.XpG();return e.Njj($.handleProfileClick(r.status))}),e.j41(1,"div",3),e.nrm(2,"i",4),e.j41(3,"span"),e.EFF(4),e.nI1(5,"translate"),e.k0s()()()}if(2&a){const u=S.$implicit;e.Y8G("routerLink",u.link),e.R7$(2),e.Y8G("ngClass",u.icon),e.R7$(2),e.JRh(e.bMT(5,3,u.btnText))}}let Ae=(()=>{var a;class S{constructor(){this.authService=(0,e.WQX)(ce.k),this.mainNavigationService=(0,e.WQX)(X.Z)}ngOnInit(){const n=this.authService.getCurrentUserStatuses();this.btnList=n.reduce((r,$)=>{if(E.L8.student.includes($)){if(r.find(({status:H})=>H===E.Du.cur))return r;const V={icon:"fa-graduation-cap",status:E.Du.cur,btnText:"studentProfileHeader",link:Pe.Hm.CUR};return[...r,V]}if(E.L8.teacher.includes($)){if(r.find(({status:H})=>H===E.Du.doc))return r;const V={icon:"fa-chalkboard-user",status:E.Du.doc,btnText:"teacherProfile",link:Pe.Hm.DOC};return[...r,V]}if(E.L8.company.includes($)){const V={icon:"fa-building-user",status:E.Du.compResp,btnText:"cmpCompanyProfile",link:Pe.Hm.COMP_RESP};return[...r,V]}return[...r]},[])}handleProfileClick(n){this.mainNavigationService.handleOnProfileClick(n,!1)}}return(a=S).\u0275fac=function(n){return new(n||a)},a.\u0275cmp=e.VBU({type:a,selectors:[["app-change-status-dialog"]],decls:3,vars:0,consts:[["mat-dialog-content",""],["matDialogClose","","mat-button","","color","primary",3,"routerLink"],["matDialogClose","","mat-button","","color","primary",3,"click","routerLink"],[1,"btn-content"],[1,"fa-solid","text-white",3,"ngClass"]],template:function(n,r){1&n&&(e.j41(0,"div",0),e.Z7z(1,Le,6,5,"a",1,e.fX1),e.k0s()),2&n&&(e.R7$(),e.Dyx(r.btnList))},dependencies:[f.YU,t.Wk,P.It,z.tx,z.Yi,A.D9],styles:["a[_ngcontent-%COMP%]{width:var(--size-100-percent);margin-top:var(--space-15px);margin-bottom:var(--space-15px);min-height:var(--size-70px)}a[_ngcontent-%COMP%] .btn-content[_ngcontent-%COMP%]{width:var(--size-100-percent);display:flex;flex-direction:column;align-items:center;justify-content:center}\n\n/*# sourceMappingURL=change-status-dialog.component.css.map*/"]}),S})();var d=i(77919),k=i(24950),s=i(4419),g=i(44317);const v=["uploader"];
1function T(a,S){if(1&a&&(e.j41(0,"mat-error",3),e.EFF(1),e.k0s()),2&a){const u=e.XpG();e.R7$(),e.SpI(" ",u.errors," ")}}function N(a,S){1&a&&e.nrm(0,"app-inner-loader",5),2&a&&e.Y8G("inline",!0)}function B(a,S){1&a&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&a&&(e.R7$(),e.JRh(e.bMT(2,1,"startUpload")))}let U=(()=>{var a;class S{constructor(){this.translateService=(0,e.WQX)(A.c$),this.userService=(0,e.WQX)(me.D),this.authService=(0,e.WQX)(ce.k),this.toastrService=(0,e.WQX)(C.tw),this.data=(0,e.WQX)(ae.y2),this.isLoading=!1,this.ALLOWED_IMAGE_EXTENSIONS=E.qu,this.errors="",this.destroy$=new O.B}ngOnInit(){const{userInfo:n,entity:r}=this.data;this.userInfo=n,this.entity=r}onSubmit(){var n;this.isLoading=!0;const[r]=this.fileUploader.filesToUpload.getValue(),$=null!==(n=null==r?void 0:r.file)&&void 0!==n?n:r;this.userService.postUserProfilePhoto(this.entity,$).pipe((0,fe.T)(V=>{var H;return(null==V||null===(H=V.body)||void 0===H?void 0:H.data)||null}),(0,_e.W)(V=>(0,d.$)(()=>V)),(0,M.Q)(this.destroy$)).subscribe({next:({file:V,success:H})=>{H?(this.isLoading=!1,this.userInfo.avatar=V.path,this.authService.setCurrentLoggedInUser(this.userInfo),this.data.dialogRef.close(),this.toastrService.success(this.translateService.instant("successLabel"))):this.handleUploadError()},error:V=>{this.handleUploadError()}})}handleUploadError(){this.isLoading=!1,this.errors=this.translateService.instant("somethingWentWrongTryAgain")}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}return(a=S).\u0275fac=function(n){return new(n||a)},a.\u0275cmp=e.VBU({type:a,selectors:[["app-user-avatar-upload-dialog"]],viewQuery:function(n,r){if(1&n&&e.GBs(v,5),2&n){let $;e.mGM($=e.lsd())&&(r.fileUploader=$.first)}},decls:7,vars:7,consts:[["uploader",""],["mat-dialog-content",""],[3,"maxFiles","withFab","uploadIcon","allowedFileTypes"],[1,"fs-12"],["mat-button","","color","primary","type","button",1,"btn-block","mt-2",3,"click","disabled"],[3,"inline"]],template:function(n,r){if(1&n){const $=e.RV6();e.j41(0,"div",1),e.nrm(1,"app-file-upload",2,0),e.DNE(3,T,2,1,"mat-error",3),e.j41(4,"button",4),e.bIt("click",function(){return e.eBV($),e.Njj(r.onSubmit())}),e.DNE(5,N,1,1,"app-inner-loader",5)(6,B,3,3,"span"),e.k0s()()}2&n&&(e.R7$(),e.Y8G("maxFiles",1)("withFab",!0)("uploadIcon",!0)("allowedFileTypes",r.ALLOWED_IMAGE_EXTENSIONS),e.R7$(2),e.vxM(r.errors?3:-1),e.R7$(),e.Y8G("disabled",r.isLoading),e.R7$(),e.vxM(r.isLoading?5:6))},dependencies:[P.$z,k.TL,z.Yi,s.H,g.P,A.D9],encapsulation:2}),S})();var j=i(59813);const _=a=>({placeholder:a});function o(a,S){if(1&a&&(e.qex(0),e.EFF(1),e.bVm()),2&a){const u=e.XpG();e.R7$(),e.Lme("",null==u.userInfo?null:u.userInfo.firstName," ",null==u.userInfo?null:u.userInfo.lastName,"")}}function b(a,S){if(1&a&&e.EFF(0),2&a){const u=e.XpG();e.SpI(" ",null==u.userInfo?null:u.userInfo.companyName," ")}}function c(a,S){if(1&a){const u=e.RV6();e.j41(0,"p",10),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"lowercase"),e.j41(4,"span",11),e.bIt("click",function(){e.eBV(u);const r=e.XpG();return e.Njj(r.changeStatusModal())}),e.EFF(5),e.nI1(6,"translate"),e.k0s()()}if(2&a){const u=e.XpG();e.Y8G("ngClass",e.eq3(10,_,!u.userInfo)),e.R7$(),e.Lme(" ",e.bMT(2,4,"signedAsA")," ",e.bMT(3,6,u.title)," - "),e.R7$(4),e.SpI(" ",e.bMT(6,8,"change")," ")}}let l=(()=>{var a;class S{constructor(){this.dialogService=(0,e.WQX)(z.bZ),this.url="../../assets/img/user.png"}ngOnInit(){this.isCompany=this.userEntity===E.Ed.company}changeStatusModal(){this.dialogService.open(ue.m,{data:{type:ae.m6.info,component:Ae},panelClass:["material-modal"],autoFocus:!1,disableClose:!0,minWidth:300,maxWidth:400})}openUploader(){const{userInfo:n,userEntity:r}=this;this.dialogService.open(ue.m,{data:{type:ae.m6.info,component:U,componentData:{userInfo:n,entity:r}},panelClass:["material-modal"],width:"var(--size-sidebar-avatar-dialog-width)",maxWidth:"var(--size-sidebar-avatar-dialog-width)"})}}return(a=S).\u0275fac=function(n){return new(n||a)},a.\u0275cmp=e.VBU({type:a,selectors:[["app-sidebar-avatar"]],inputs:{userInfo:"userInfo",title:"title",userEntity:"userEntity",userEmail:"userEmail",canChangeStatus:"canChangeStatus"},decls:16,vars:20,consts:[["companyName",""],[1,"py-2","bg-white"],[1,"profile-img"],["data-toggle","modal","data-target","#basicExample",1,"m-0",3,"click"],[1,"user-info","text-center","text-dark","px-4"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-break",3,"ngClass"],[1,"font-weight-bold",3,"ngClass"],["class","font-italic",3,"ngClass",4,"ngIf"],[1,"font-italic",3,"ngClass"],[1,"change-status",3,"click"]],template:function(n,r){if(1&n){const $=e.RV6();e.j41(0,"li",1)(1,"div",2)(2,"a",3),e.bIt("click",function(){return e.eBV($),e.Njj(r.openUploader())}),e.nrm(3,"app-user-avatar"),e.k0s()(),e.j41(4,"div",4)(5,"p",5),e.DNE(6,o,2,2,"ng-container",6)(7,b,1,1,"ng-template",null,0,e.C5r),e.k0s(),e.j41(9,"p",7),e.EFF(10),e.k0s(),e.j41(11,"p",8),e.EFF(12),e.nI1(13,"translate"),e.nI1(14,"translate"),e.k0s(),e.DNE(15,c,7,12,"p",9),e.k0s()()}if(2&n){const $=e.sdS(8);e.R7$(5),e.Y8G("ngClass",e.eq3(14,_,!r.userInfo)),e.R7$(),e.Y8G("ngIf",!r.isCompany)("ngIfElse",$),e.R7$(3),e.Y8G("ngClass",e.eq3(16,_,!r.userInfo)),e.R7$(),e.SpI(" ",null==r.userInfo?null:r.userInfo.email," "),e.R7$(),e.Y8G("ngClass",e.eq3(18,_,!r.userInfo)),e.R7$(),e.E5c("",e.bMT(13,10,"id"),"",e.bMT(14,12,"typography.colon"),"",null==r.userInfo?null:r.userInfo.id,""),e.R7$(3),e.Y8G("ngIf",r.canChangeStatus)}},dependencies:[f.YU,f.bT,j.a,f.GH,A.D9],styles:[".profile-img[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{height:var(--size-100-percent);max-height:var(--size-240px);min-height:var(--size-170px);overflow:hidden;display:block;padding:var(--space-0) var(--space-1rem)}.user-info[_ngcontent-%COMP%]{min-height:var(--size-75px);padding:var(--space-0) var(--space-16px)}.user-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:var(--font-size-87);padding-top:var(--space-0_3rem);margin:var(--space-0);font-weight:var(--font-weight-light)}.change-status[_ngcontent-%COMP%]{cursor:pointer;-webkit-text-decoration:var(--text-decoration-underline);text-decoration:var(--text-decoration-underline)}.placeholder[_ngcontent-%COMP%]{display:block;height:var(--size-21px);width:var(--size-100-percent);background:var(--color-tint-3) no-repeat;animation:pulse var(--duration-1500) var(--behavior-function-cubic-2) var(--animation-iteration-infinite);animation-delay:var(--duration-500);color:var(--color-black-transparency-1)}\n\n/*# sourceMappingURL=sidebar-avatar.component.css.map*/"]}),S})();function p(a,S){if(1&a&&(e.j41(0,"li",5)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&a){const u=e.XpG().$implicit;e.R7$(2),e.JRh(e.bMT(3,1,u.title))}}function h(a,S){if(1&a){const u=e.RV6();e.j41(0,"app-sidebar-nav-item",7),e.bIt("actionOutput",function(r){e.eBV(u);const $=e.XpG(2);return e.Njj($.handleAction(r))})("closeNav",function(){e.eBV(u);const r=e.XpG(2);return e.Njj(r.toggleSidebar(!1))}),e.k0s()}if(2&a){const u=S.$implicit,n=e.XpG(2);e.Y8G("active",n.activeRoute===u.route||u.route.includes(n.activeRoute))("navItem",u)("hasExam",n.pendingExams&&n.pendingExams.length&&"student"===n.profile&&"cursussen"===u.route?n.pendingExams:null)("notificationBadge",n.hasNotifications&&u.notificationProp&&n.notifications[u.notificationProp]?n.notifications[u.notificationProp]:null)}}function y(a,S){1&a&&e.nrm(0,"hr")}
1function G(a,S){if(1&a&&(e.DNE(0,p,4,3,"li",5),e.Z7z(1,h,1,4,"app-sidebar-nav-item",6,e.fX1),e.DNE(3,y,1,0,"hr")),2&a){const u=S.$implicit,n=S.$index,r=S.$count;e.vxM(u.title?0:-1),e.R7$(),e.Dyx(u.items),e.R7$(2),e.vxM(n!==r-1?3:-1)}}let J=(()=>{var a;class S{constructor(){this.authService=(0,e.WQX)(ce.k),this.userService=(0,e.WQX)(me.D),this.websiteService=(0,e.WQX)(F.j),this.teacherService=(0,e.WQX)(re.O),this.deviceService=(0,e.WQX)(Y.Kg),this.translateService=(0,e.WQX)(A.c$),this.titleService=(0,e.WQX)(q.hE),this.router=(0,e.WQX)(t.Ix),this.toastrService=(0,e.WQX)(C.tw),this.eCampusService=(0,e.WQX)(Se.u),this.interestsService=(0,e.WQX)(pe.p),this.notificationService=(0,e.WQX)(ee.J),this.mainNavigationService=(0,e.WQX)(X.Z),this.dialogService=(0,e.WQX)(z.bZ),this.isDesktop=this.deviceService.isDesktop(),this.canChangeStatus=!1,this.pendingExams=[],this.showMenu=!0,this.hasNotifications=!1,this.notifications={},this.destroy$=new O.B,this.LOGIN_ROUTE="/check",this.mainNavStyles={position:"sticky",top:0,"z-index":"var(--z-index-layer-9)"}}ngOnInit(){this.websiteService.setNavbarStyles(this.mainNavStyles),this.mainNavigationService.getBOSidenavVisibility().pipe((0,M.Q)(this.destroy$)).subscribe(r=>{this.toggleSidebar(r,!0)}),this.userEntity=this.profile===E.Ed.company?"company":this.profile,this.title=this.translateService.instant(this.profile===E.Ed.company?"companyResp":this.profile),this.titleService.setTitle(this.title),this.setNavItems(),this.checkStatusChange(),this.getCurrentUrl(),this.router.events.pipe((0,M.Q)(this.destroy$)).subscribe(r=>{r instanceof t.wF&&this.getCurrentUrl()}),this.profile===E.Ed.student&&this.eCampusService.getPendingExams().pipe((0,M.Q)(this.destroy$)).subscribe(r=>this.pendingExams=r),this.profile===E.Ed.teacher&&this.websiteService.getIsolation().pipe((0,M.Q)(this.destroy$)).subscribe(r=>{this.websiteService.showMenu(!r),this.showMenu=!r}),this.notificationService.getActiveNotifications().pipe((0,M.Q)(this.destroy$)).subscribe(r=>{this.notifications=r}),this.hasNotifications=[E.Ed.student,E.Ed.teacher].includes(this.profile)}toggleSidebar(n,r=!1){r||this.mainNavigationService.setBOSidenavVisibility(n)}handleAction({method:n,param:r}){this[n]&&this[n](r||null)}checkStatusChange(){const n=this.authService.getCurrentUserStatuses(),r=E.L8[this.userEntity]||!1;if(!r)return this.canChangeStatus=!1;n.filter(V=>!r.includes(V)).length&&(this.canChangeStatus=!0)}setNavItems(){const n=oe[this.userEntity];if(!n||null==n||!n.length)return this.router.navigate([this.LOGIN_ROUTE]);this.navSections=n,this.authService.getCurrentUserStatus()===E.Du.compCur?this.getUserInfo():(this.userInfo=this.authService.getCurrentUser(),this.checkEmailConfirmation())}getCurrentUrl(){const n=this.router.url.split("/");if(this.activeRoute=this.userEntity===E.Ed.student&&n.length>4?n[5]:3===n.length?n[2]:n[3],n.includes("communication")&&(this.activeRoute=n.includes("sent")?"sent":"communication"),n.includes("correction")&&(this.activeRoute="correction"),/^\d+$/.test(this.activeRoute)&&(this.activeRoute="detail"),"info"===this.activeRoute&&(this.activeRoute="profile"),this.profile===E.Ed.student||this.profile===E.Ed.teacher){const $=new Set(["communicatie","communication","sent"]);this.navSections=this.navSections.map(V=>{if(V.items.some(H=>H.hasOwnProperty("subLink"))){const H=V.items.map(Be=>Be.hasOwnProperty("subLink")?(0,D.A)((0,D.A)({},Be),{},{subLink:$.has(this.activeRoute)}):Be);return(0,D.A)((0,D.A)({},V),{},{items:H})}return V})}}confirmEmailModal(){this.dialogService.open(ue.m,{data:{type:ae.m6.info,header:"verifyEmail",component:Re},disableClose:!0,panelClass:["material-modal","col-12","col-md-4"]}).afterClosed().pipe((0,M.Q)(this.destroy$)).subscribe($=>sessionStorage.setItem(be.c.popupEmitted,"true"))}getUserInfo(){this.userService.getUserInfo(this.profile).pipe((0,fe.T)(n=>(null==n?void 0:n.data)||null),(0,_e.W)(n=>(0,Ce.of)(null)),(0,M.Q)(this.destroy$)).subscribe(n=>{if(n){this.userService.isUserInfoComplete(n);const{firstName:r,lastName:$,email:V,picture:H,id:Be,emailConfirmed:Ve,b2bCompany:Ge,encryptedUserData:We}=n;this.authService.setCurrentLoggedInUser((0,D.A)((0,D.A)({},n),{},{avatar:H,isEmailConfirmed:Ve})),this.userInfo={firstName:r,lastName:$,email:V,avatar:H,id:Be,isEmailConfirmed:Ve,encryptedUserData:We},Ge&&(this.userInfo=(0,D.A)((0,D.A)({},this.userInfo),{},{companyName:Ge.name,companyId:Ge.id})),this.checkEmailConfirmation()}else this.toastrService.error(this.translateService.instant("notAuthorized")),this.router.navigate([this.LOGIN_ROUTE])})}checkEmailConfirmation(){!this.userInfo.isEmailConfirmed&&!sessionStorage.getItem(be.c.popupEmitted)&&this.confirmEmailModal()}teacherEloLink(){const n=window.open("about:blank","_blank");this.teacherService.getEloLoginLink().pipe((0,M.Q)(this.destroy$)).subscribe(r=>{r.success&&(n.location=r.data.url)})}openSelectCourse(n){this.dialogService.open(ue.m,{data:{component:$e.t,componentData:{entity:this.profile,page:n}},autoFocus:!0})}logout(){this.interestsService.resetInterests(),this.interestsService.resetInterestCodes(),this.authService.logout({message:"loggedOutSuccessfully"}),this.authService.logoutTabs()}ngOnDestroy(){this.websiteService.setNavbarStyles({}),this.destroy$.next(),this.destroy$.complete()}}return(a=S).\u0275fac=function(n){return new(n||a)},a.\u0275cmp=e.VBU({type:a,selectors:[["app-sidebar"]],inputs:{profile:"profile",showFixed:"showFixed"},decls:8,vars:5,consts:[[1,"bo-sidenav","mt-0"],[1,"p-0"],[1,"bg-white","close-sidenav",3,"click"],[1,"fa-regular","fa-circle-left"],[3,"userInfo","title","userEntity","userEmail","canChangeStatus"],[1,"sec-title","nav-item"],[3,"active","navItem","hasExam","notificationBadge"],[3,"actionOutput","closeNav","active","navItem","hasExam","notificationBadge"]],template:function(n,r){1&n&&(e.j41(0,"ul",0)(1,"li",1)(2,"a",2),e.bIt("click",function(){return r.toggleSidebar(!1)}),e.nrm(3,"i",3),e.k0s()(),e.nrm(4,"app-sidebar-avatar",4)(5,"hr"),e.Z7z(6,G,4,2,null,null,e.fX1),e.k0s()),2&n&&(e.R7$(4),e.Y8G("userInfo",r.userInfo)("title",r.title)("userEntity",r.profile)("userEmail",r.displayEmail)("canChangeStatus",r.canChangeStatus),e.R7$(2),e.Dyx(r.navSections))},dependencies:[Ue,l,A.D9],styles:["ul.bo-sidenav[_ngcontent-%COMP%]{display:flex;flex-direction:column;list-style-type:none;margin:var(--space-0);height:var(--size-100-percent);font-size:var(--font-size-100);font-weight:var(--font-weight-medium);padding:var(--space-8px) var(--space-0);max-width:var(--size-230px)}ul.bo-sidenav[_ngcontent-%COMP%] li.sec-title[_ngcontent-%COMP%]{font-size:var(--font-size-75);padding:var(--space-0_3rem) var(--space-1rem)}hr[_ngcontent-%COMP%]{margin-top:var(--space-0);margin-bottom:var(--space-0);width:var(--size-100-percent);height:var(--size-1px)}.close-sidenav[_ngcontent-%COMP%]{width:var(--size-100-percent);padding-right:var(--space-8px);margin:var(--space-0);height:var(--size-21px);line-height:var(--font-size-125);text-align:center;
1z-index:var(--z-index-layer-15);display:flex;flex-direction:row;align-items:center;justify-content:flex-end}@media (min-width: 1300px){ul.bo-sidenav[_ngcontent-%COMP%]{padding-top:var(--space-0)}ul.bo-sidenav[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;align-items:center;padding:var(--space-0_5rem)}ul.bo-sidenav[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{padding-right:var(--space-0)}}\n\n/*# sourceMappingURL=sidebar.component.css.map*/"]}),S})();const te=a=>({fullscreen:a}),ge=a=>({"position-fixed":a});function le(a,S){if(1&a){const u=e.RV6();e.qex(0),e.j41(1,"button",7),e.bIt("click",function(){e.eBV(u),e.XpG();const r=e.sdS(3);return e.Njj(r.open())}),e.nrm(2,"i",8),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.bVm()}if(2&a){const u=e.XpG();e.R7$(),e.Y8G("ngClass",e.eq3(4,ge,!u.showFixed)),e.R7$(2),e.SpI(" ",e.bMT(4,2,"headerPrompt")," ")}}function ie(a,S){if(1&a&&e.nrm(0,"app-sidebar",9),2&a){const u=e.XpG();e.Y8G("profile",u.userEntity)("showFixed",u.showFixed)}}function Ne(a,S){1&a&&e.nrm(0,"div",10)}let je=(()=>{var a;class S{constructor(){this.route=(0,e.WQX)(t.nX),this.deviceDetector=(0,e.WQX)(Y.Kg),this.websiteService=(0,e.WQX)(F.j),this.mainNavigationService=(0,e.WQX)(X.Z),this.platformId=(0,e.WQX)(e.Agw),this.showSpacer=!0,this.showFixed=!0,this.isDesktop=this.deviceDetector.isDesktop(),this.hasFooter=!1,this.isFullscreen=!1,this.showMenu=!0,this.destroy$=new O.B}ngOnInit(){this.mainNavigationService.getBOSidenavVisibility().pipe((0,M.Q)(this.destroy$)).subscribe(n=>{this.isShown=n}),this.userEntity=this.route.snapshot.data.module,this.mainNavigationService.setMobileSearchBarVisibility(!1),this.mainNavigationService.setStickyToolbar(!0),this.mainNavigationService.setBOSidenavVisibility(!0),this.websiteService.getIsolation().pipe((0,M.Q)(this.destroy$)).subscribe(n=>{this.isFullscreen=n}),(0,f.UE)(this.platformId)&&(this.checkScreenWidth(),(0,W.R)(window,"resize").pipe((0,Q.B)(100),(0,M.Q)(this.destroy$)).subscribe(()=>this.checkScreenWidth())),this.userEntity===E.Ed.teacher&&this.websiteService.getIsolation().pipe((0,M.Q)(this.destroy$)).subscribe(n=>{this.websiteService.showMenu(!n),this.showMenu=!n})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.mainNavigationService.setMobileSearchBarVisibility(!0),this.mainNavigationService.setStickyToolbar(!1),this.mainNavigationService.setBOSidenavVisibility(!1)}checkOpenedState(n){this.isShown=n,this.mainNavigationService.setBOSidenavVisibility(n)}checkScreenWidth(){const{innerWidth:n}=window||{};n&&(n<=1440?(this.mainNavigationService.setBOSidenavVisibility(!1),this.showFixed=!0):(this.mainNavigationService.setBOSidenavVisibility(!0),this.showFixed=!1,this.showSpacer=n&&n>=1440))}}return(a=S).\u0275fac=function(n){return new(n||a)},a.\u0275cmp=e.VBU({type:a,selectors:[["app-ecampus-layout"]],decls:8,vars:7,consts:[["boSideNav",""],["autosize","",1,"bo-sidenav-container"],[4,"ngIf"],["mode","over","position","start","fixedInViewport","true","autoFocus","false",1,"bo-side-nav",3,"openedChange","openedStart","closedStart","opened"],[3,"profile","showFixed",4,"ngIf"],["class","w-100 mb-5",4,"ngIf"],[1,"main",3,"ngClass"],["mat-raised-button","","color","accent-inverted",1,"text-uppercase","menu-toggle",3,"click","ngClass"],[1,"fa-regular","fa-circle-user"],[3,"profile","showFixed"],[1,"w-100","mb-5"]],template:function(n,r){if(1&n){const $=e.RV6();e.j41(0,"mat-sidenav-container",1),e.DNE(1,le,5,6,"ng-container",2),e.j41(2,"mat-sidenav",3,0),e.mxI("openedChange",function(H){return e.eBV($),e.DH7(r.isShown,H)||(r.isShown=H),e.Njj(H)}),e.bIt("openedStart",function(){return e.eBV($),e.Njj(r.checkOpenedState(!0))})("closedStart",function(){return e.eBV($),e.Njj(r.checkOpenedState(!1))}),e.DNE(4,ie,1,2,"app-sidebar",4),e.k0s(),e.DNE(5,Ne,1,0,"div",5),e.j41(6,"div",6),e.nrm(7,"router-outlet"),e.k0s()()}2&n&&(e.R7$(),e.Y8G("ngIf",r.isDesktop&&r.showMenu),e.R7$(),e.R50("opened",r.isShown),e.R7$(2),e.Y8G("ngIf",r.userEntity&&!r.isFullscreen),e.R7$(),e.Y8G("ngIf",!r.showFixed),e.R7$(),e.Y8G("ngClass",e.eq3(5,te,r.isFullscreen)))},dependencies:[f.YU,f.bT,t.n3,P.$z,L.LG,L.US,J,A.D9],styles:[".main[_ngcontent-%COMP%]{padding-top:var(--space-15px);padding-bottom:var(--space-0)}.menu-toggle[_ngcontent-%COMP%]{display:none}.bo-side-nav[_ngcontent-%COMP%]{top:var(--space-56px)!important;padding-bottom:var(--space-10px)!important}@media (min-width: 576px){.main[_ngcontent-%COMP%]{padding-top:var(--space-30px)}}@media (min-width: 1300px){.menu-toggle[_ngcontent-%COMP%]{display:block;position:absolute;top:var(--space-8px);left:var(--space-5px);font-size:var(--font-size-125);line-height:var(--font-size-225)}.bo-side-nav[_ngcontent-%COMP%]{top:var(--space-64px)!important}}@media (min-width: 1441px){.main[_ngcontent-%COMP%]{margin-left:var(--space-266px)}.main.fullscreen[_ngcontent-%COMP%]{margin-left:var(--space-0)}.menu-toggle[_ngcontent-%COMP%]{top:var(--space-70px)}}\n\n/*# sourceMappingURL=ecampus-layout.component.ts-angular-inline--8.css.map*/"]}),S})()},61620:(Ie,ne,i)=>{i.d(ne,{b:()=>_});var f=i(90954),e=i(46443),t=i(68559),Y=i(87941),O=i(48503),M=i(54285),W=i(75797),Q=i(59452),E=i(70271),X=i(61318),F=i(46325),P=i(78603),L=i(71920),D=i(34456),z=i(84205),q=i(33900),A=i(51360),C=i(17077),fe=i(23657),_e=i(21675),Ce=i(60316),be=i(84175),ce=i(95541),pe=i(24950),ee=i(25175),ae=i(85060),Se=i(4419),me=i(99353),re=i(44317),Re=i(2238);let ue=(()=>{var o;class b{constructor(){this.allValues=[],this.matSelect=(0,t.WQX)(ee.VO),this.matOption=(0,t.WQX)(ae.wT),this.destroy$=new z.B}
1ngAfterViewInit(){const l=this.matSelect,p=l.ngControl.control;this.matOption.onSelectionChange.pipe((0,q.Q)(this.destroy$)).subscribe(h=>{h.isUserInput&&(h.source.selected?(null==p||p.setValue(this.allValues),this.matOption.select()):(null==p||p.setValue([]),this.matOption.deselect()))}),l.optionSelectionChanges.pipe((0,q.Q)(this.destroy$)).subscribe(h=>{h.isUserInput&&h.source.value!==this.matOption.value&&(h.source.selected?(null==p?void 0:p.value.length)===this.allValues.length&&this.matOption.select():this.matOption.deselect())})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}return(o=b).\u0275fac=function(l){return new(l||o)},o.\u0275dir=t.FsC({type:o,selectors:[["mat-option","appSelectAllOptions",""]],inputs:{allValues:"allValues"}}),b})();const $e=["uploader"],ye=()=>({height:250}),de=o=>({$implicit:o}),Ee=o=>({content:o}),he=o=>({max:o});function m(o,b){if(1&o&&(t.j41(0,"mat-option",19),t.EFF(1),t.k0s()),2&o){const c=b.$implicit;t.Y8G("value",c.courseId),t.R7$(),t.SpI(" ",c.label," ")}}function x(o,b){1&o&&t.eu8(0)}function I(o,b){if(1&o&&(t.j41(0,"mat-error"),t.DNE(1,x,1,0,"ng-container",20),t.k0s()),2&o){const c=t.XpG(3),l=t.sdS(3);t.R7$(),t.Y8G("ngTemplateOutlet",l)("ngTemplateOutletContext",t.eq3(2,de,c.course))}}function R(o,b){if(1&o){const c=t.RV6();t.j41(0,"mat-form-field",5)(1,"mat-label",6),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"mat-select",18),t.bIt("selectionChange",function(p){t.eBV(c);const h=t.XpG(2);return t.Njj(h.onCourseSelected(p))}),t.Z7z(5,m,2,2,"mat-option",19,t.Vm6),t.nI1(7,"async"),t.k0s(),t.DNE(8,I,2,4,"mat-error"),t.k0s()}if(2&o){const c=t.XpG(2);t.R7$(2),t.JRh(t.bMT(3,2,"selectCourse")),t.R7$(3),t.Dyx(t.bMT(7,4,c.courses$)),t.R7$(3),t.vxM(c.course.invalid&&(c.course.dirty||c.course.touched)?8:-1)}}function w(o,b){if(1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.nI1(3,"translate"),t.k0s()),2&o){const c=t.XpG(3);t.R7$(),t.Lme("(",t.i5U(2,2,"typography.plus_sign",t.eq3(7,Ee,c.recipientLength))," ",t.bMT(3,5,2===c.recipientLength?"others.singular":"others.plural"),")")}}function K(o,b){if(1&o&&(t.j41(0,"mat-option",21),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const c=t.XpG(3);t.Y8G("allValues",c.possibleRecipients),t.R7$(),t.JRh(t.bMT(2,2,"selectAllRecipients"))}}function se(o,b){if(1&o&&(t.j41(0,"mat-option",19),t.EFF(1),t.k0s()),2&o){const c=b.$implicit;t.Y8G("value",c.recipientId),t.R7$(),t.SpI(" ",c.label," ")}}function oe(o,b){if(1&o&&(t.j41(0,"mat-select",7)(1,"mat-select-trigger"),t.EFF(2),t.DNE(3,w,4,9,"span"),t.k0s(),t.DNE(4,K,3,4,"mat-option",21),t.Z7z(5,se,2,2,"mat-option",19,t.Vm6),t.nI1(7,"async"),t.k0s()),2&o){const c=t.XpG(2);t.R7$(2),t.SpI(" ",c.recipientLabel," "),t.R7$(),t.vxM(c.recipientLength?3:-1),t.R7$(),t.vxM(c.possibleRecipients.length>1?4:-1),t.R7$(),t.Dyx(t.bMT(7,3,c.recipients$))}}function ve(o,b){if(1&o&&(t.j41(0,"mat-option",22),t.EFF(1),t.k0s()),2&o){const c=b.$implicit;t.Y8G("value",c),t.R7$(),t.SpI(" ",c.label," ")}}function Z(o,b){if(1&o&&(t.j41(0,"mat-select",8),t.Z7z(1,ve,2,2,"mat-option",22,t.Vm6),t.nI1(3,"async"),t.k0s()),2&o){const c=t.XpG(2);t.Y8G("formControl",c.recipient),t.R7$(),t.Dyx(t.bMT(3,1,c.recipients$))}}function xe(o,b){1&o&&t.eu8(0)}function Me(o,b){if(1&o&&(t.j41(0,"mat-error"),t.DNE(1,xe,1,0,"ng-container",20),t.k0s()),2&o){const c=t.XpG(2),l=t.sdS(3);t.R7$(),t.Y8G("ngTemplateOutlet",l)("ngTemplateOutletContext",t.eq3(2,de,c.recipient))}}function Te(o,b){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R
17$(),t.JRh(t.bMT(2,1,"formValidation.required")))}function De(o,b){if(1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const c=t.XpG(3);t.R7$(),t.JRh(t.i5U(2,1,"formValidation.tooLong",t.eq3(4,he,c.maxSubjectLength)))}}function Fe(o,b){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"formValidation.noStartingSpaces")))}function Oe(o,b){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"formValidation.consecSpaces")))}function Ue(o,b){if(1&o&&(t.j41(0,"mat-error"),t.DNE(1,Te,3,3,"span")(2,De,3,6,"span")(3,Fe,3,3,"span")(4,Oe,3,3,"span"),t.k0s()),2&o){const c=t.XpG(2);t.R7$(),t.vxM(null!=c.subject.errors&&c.subject.errors.required?1:null!=c.subject.errors&&c.subject.errors.maxlength?2:null!=c.subject.errors&&c.subject.errors.noStartingSpaces?3:null!=c.subject.errors&&c.subject.errors.consecutiveSpaces?4:-1)}}function Pe(o,b){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"formValidation.required")))}function Le(o,b){if(1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const c=t.XpG(3);t.R7$(),t.JRh(t.i5U(2,1,"formValidation.tooLong",t.eq3(4,he,c.maxMessageLength)))}}function Ae(o,b){if(1&o&&(t.j41(0,"mat-error",12),t.DNE(1,Pe,3,3,"span")(2,Le,3,6,"span"),t.k0s()),2&o){const c=t.XpG(2);t.R7$(),t.vxM(null!=c.message.errors&&c.message.errors.required?1:-1),t.R7$(),t.vxM(null!=c.message.errors&&c.message.errors.maxlength?2:-1)}}function d(o,b){if(1&o){const c=t.RV6();t.j41(0,"form",2)(1,"div",4),t.DNE(2,R,9,6,"mat-form-field",5),t.j41(3,"mat-form-field",5)(4,"mat-label",6),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.DNE(7,oe,8,5,"mat-select",7)(8,Z,4,3,"mat-select",8)(9,Me,2,4,"mat-error"),t.k0s(),t.j41(10,"mat-form-field",5)(11,"mat-label"),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.nrm(14,"input",9),t.DNE(15,Ue,5,1,"mat-error"),t.k0s(),t.j41(16,"div",10),t.nrm(17,"app-wysiwyg-editor",11),t.DNE(18,Ae,3,2,"mat-error",12),t.k0s(),t.j41(19,"div",13),t.nrm(20,"app-file-upload",14,1),t.k0s()(),t.j41(22,"div",15)(23,"button",16),t.EFF(24),t.nI1(25,"translate"),t.k0s(),t.j41(26,"button",17),t.bIt("click",function(){t.eBV(c);const p=t.XpG();return t.Njj(p.onSubmit())}),t.EFF(27),t.nI1(28,"translate"),t.k0s()()()}if(2&o){const c=t.XpG();t.Y8G("formGroup",c.messageForm),t.R7$(2),t.vxM(c.isTeacher?2:-1),t.R7$(3),t.JRh(t.bMT(6,17,c.isTeacher?"chooseRecipients":"onDocent")),t.R7$(2),t.vxM(c.isTeacher?7:8),t.R7$(2),t.vxM(c.recipient.invalid&&(c.recipient.dirty||c.recipient.touched)?9:-1),t.R7$(3),t.JRh(t.bMT(13,19,"topic")),t.R7$(2),t.Y8G("formControl",c.subject),t.R7$(),t.vxM(c.subject.invalid&&(c.subject.dirty||c.subject.touched)?15:-1),t.R7$(2),t.Y8G("form",c.messageForm)("options",t.lJ4(25,ye)),t.R7$(),t.vxM(c.message.invali
1d&&(c.message.dirty||c.message.touched)?18:-1),t.R7$(2),t.Y8G("multiple",!0)("allowedFileTypes",c.allowedFileTypes)("uploadIcon",!0),t.R7$(4),t.SpI(" ",t.bMT(25,21,"cancel")," "),t.R7$(2),t.Y8G("disabled",c.messageForm.invalid||c.messageForm.pristine),t.R7$(),t.SpI(" ",t.bMT(28,23,"send")," ")}}function k(o,b){1&o&&t.nrm(0,"app-inner-loader",3)}function s(o,b){1&o&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"formValidation.required")))}function g(o,b){if(1&o&&t.DNE(0,s,3,3,"span"),2&o){const c=b.$implicit;t.vxM(null!=c.errors&&c.errors.required?0:-1)}}let v=(()=>{var o;class b{constructor(){this.loaderService=(0,t.WQX)(fe.Z),this.formBuilder=(0,t.WQX)(D.ok),this.messageService=(0,t.WQX)(_),this.toastrService=(0,t.WQX)(M.tw),this.translateService=(0,t.WQX)(O.c$),this.dialogData=(0,t.WQX)(_e.y2),this.isLoading=!0,this.courses$=new W.t([]),this.recipients$=new W.t([]),this.isTeacher=!1,this.allowedFileTypes=A.i_,this.maxSubjectLength=250,this.maxMessageLength=64e3,this.messageForm=this.formBuilder.group({subject:["",(0,C.QG)(1,this.maxSubjectLength)],recipient:[null,D.k0.required],message:["",[D.k0.required,D.k0.maxLength(this.maxMessageLength)]]}),this.allRecipients=[],this.destroy$=new z.B}get recipient(){return this.messageForm.get("recipient")}get subject(){return this.messageForm.get("subject")}get message(){return this.messageForm.get("message")}get course(){return this.messageForm.get("course")}get recipientLabel(){var l;return null!==(l=this.recipient)&&void 0!==l&&null!==(l=l.value)&&void 0!==l&&l.length?this.recipients$.getValue().find(({recipientId:h})=>{const y=this.isSelectAll()?1:0;return h===this.recipient.value[y]}).label:""}get recipientLength(){var l,p;if(null===(l=this.recipient)||void 0===l||!l.value)return 0;const h=this.isSelectAll()?2:1;return(null===(p=this.recipient)||void 0===p||null===(p=p.value)||void 0===p?void 0:p.length)-h}get possibleRecipients(){const l=this.recipients$.getValue();return null!=l&&l.length?l.map(({recipientId:p})=>p):[]}ngOnInit(){const{course:l,entity:p}=this.dialogData;this.isTeacher=p===A.Ed.teacher,l?this.initReply():this.messageService.getPossibleRecipients().pipe((0,E.T)(h=>{var y;return(null==h||null===(y=h.body)||void 0===y?void 0:y.data)||[]}),(0,q.Q)(this.destroy$)).subscribe(h=>this.processRecipientsData(h))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onCourseSelected({value:l}){this.recipient.setValue(null);const p=this.allRecipients.filter(h=>h.courseId===l).map(({recipientId:h,courseId:y,recipientFirstName:G,recipientLastName:J})=>({recipientId:h,courseId:y,label:"".concat(G," ").concat(J)}));this.recipient.enable(),this.recipients$.next(p)}onSubmit(){this.loaderService.setIsLoading(!0);const{recipient:l,subject:p,message:h,course:y}=this.messageForm.getRawValue();if(!this.messageForm.valid&&!h){const ie=this.translateService.instant("somethingWentWrongTryAgain");return void this.toastrService.error(ie)}let G;G=this.isTeacher?l.filter(ie=>"select-all"!==ie):[l.recipientId];const te={subject:p,courseId:this.isTeacher?y:l.courseId,message:h,recipients:G},le=this.uploader.filesToUpload.getValue().map(ie=>ie.file).filter(ie=>ie instanceof File);this.messageService.postDirectMessage(te,le).pipe((0,q.Q)(this.destroy$)).subscribe({next:ie=>{this.loaderService.setIsLoading(!1),this.messageForm.reset(),this.dialogData.dialogRef.close(),this.toastrService.info(this.translateService.instant("sendSuccessful"))},error:ie=>{this.loaderService.setIsLoading(!1);const Ne={"Access denied":"teacherMessageErrors.accessDeniedError","Course expired. You cannot send this message!":"teacherMessageErrors.courseExpiredError","Message was not been sent!":"errorLabel",default:"CVdataUpdatedError"};if(this.isTeacher){const{message:je}=ie.error||{};this.toastrService.error(this.translateService.instant("".concat(Ne["".concat(je)]||Ne.default)))}else this.toastrService.error(this.translateService.instant(Ne.default))}})}processRecipientsData(l){if(this.isTeacher){this.allRecipients=l,this.messageForm.addControl("course",this.formBuilder.control(null,D.k0.required)),this.recipient.disable();const p=l.map(h=>{const{courseId:y,courseName:G,recipientId:J}=h;return{courseId:y,teacherId:J,label:this.translateService.instant("typography.dash",{left:G,right:y})}}).filter((h,y,G)=>y===G.findIndex(({courseId:J})=>J===h.courseId));this.courses$.next(p)}else{const p=l.map(h=>{const{courseId:y,recipientId:G,courseName:J,recipientFirstName:te,recipientLastName:ge}=h,le="".concat(te," ").concat(ge);return this.createSelectLabel(G,y,J,le)});this.recipients$.next(p)}this.isLoading=!1}initReply(){const{course:l,message:p,sender:h,subject:y}=this.dialogData;if(this.isTeacher){const J={courseId:l.id,teacherId:h.id,label:this.translateService.instant("typography.dash",{left:l.name,right:l.id})};this.courses$.next([J]),this.messageForm.addControl("course",this.formBuilder.control(null,D.k0.required)),this.course.patchValue(l.id),this.course.disable()}const G=this.createSelectLabel(h.id,l.id,l.name,h.name);this.recipients$.next([G]),this.messageForm.patchValue({message:this.messageService.applyOldMessage(p),subject:this.messageService.setSubject(y),recipient:this.isTeacher?[h.id]:G}),this.recipient.disable(),this.isLoading=!1}createSelectLabel(l,p,h,y){return{courseId:p,recipientId:l,label:this.isTeacher?y:this.translateService.instant("typography.dash",{left:"".concat(this.translateService.instant("teacherLabel")," ").concat(h),right:y})}}isSelectAll(){var l;const[p]=null===(l=this.recipient)||void 0===l?void 0:l.value;return"select-all"===p}}return(o=b).\u0275fac=function(l){return new(l||o)}
1,o.\u0275cmp=t.VBU({type:o,selectors:[["app-message-send-dialog"]],viewQuery:function(l,p){if(1&l&&t.GBs($e,5),2&l){let h;t.mGM(h=t.lsd())&&(p.uploader=h.first)}},decls:4,vars:1,consts:[["formValidation",""],["uploader",""],[3,"formGroup"],[1,"bg-light-grey"],["mat-dialog-content","",1,"message-send-content"],["appearance","fill"],["appRemoveAriaOwns",""],["formControlName","recipient","multiple",""],[3,"formControl"],["matInput","","type","text",3,"formControl"],[1,"mt-2"],["controlName","message",3,"form","options"],[1,"fs-12","mx-3"],[1,"mt-4"],[3,"multiple","allowedFileTypes","uploadIcon"],["mat-dialog-actions","","align","end"],["mat-raised-button","","color","primary-inverted","type","button","matDialogClose",""],["mat-raised-button","","color","primary","type","submit",3,"click","disabled"],["formControlName","course",3,"selectionChange"],[3,"value"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["value","select-all","appSelectAllOptions","",3,"allValues"],[1,"disable-checkbox",3,"value"]],template:function(l,p){1&l&&t.DNE(0,d,29,26,"form",2)(1,k,1,0,"app-inner-loader",3)(2,g,1,1,"ng-template",null,0,t.C5r),2&l&&t.vxM(p.isLoading?1:0)},dependencies:[Ce.T3,D.qT,D.me,D.BC,D.cb,D.l_,D.j4,D.JD,be.$z,ce.fg,pe.rl,pe.nJ,pe.TL,ee.VO,ee.$2,ae.wT,Y.tx,Y.E7,Y.Yi,Se.H,me.e,re.P,Re.K,ue,Ce.Jj,O.D9],encapsulation:2}),b})();var T=i(95062),N=i(28404),B=i(97582),U=i(88701),j=i(55327);let _=(()=>{var o;class b{constructor(){this.http=(0,t.WQX)(e.Qq),this.configService=(0,t.WQX)(N.w),this.websiteService=(0,t.WQX)(j.j),this.notificationService=(0,t.WQX)(U.J),this.translateService=(0,t.WQX)(O.c$),this.toastrService=(0,t.WQX)(M.tw),this.dialogService=(0,t.WQX)(Y.bZ),this.userService=(0,t.WQX)(F.D),this.faviconService=(0,t.WQX)(B.U),this.CDO_URL=this.configService.getCdoUrl(),this.messageIdSubject=new W.t(0),this.messageSearchTerm=new W.t(""),this.navigationTab=new W.t("")}getNavigationTab(){return this.navigationTab.getValue()}setNavigationTab(l){this.navigationTab.next(l)}updateCurrentMessageId(l){this.messageIdSubject.next(l)}getCurrentMessageId(){return this.messageIdSubject.getValue()}resetCurrentMessageId(){this.messageIdSubject.next(0)}updateCurrentMessageSearchTerm(l){this.messageSearchTerm.next(l)}getCurrentMessageSearchTerm(){return this.messageSearchTerm.getValue()}resetCurrentMessageSearchTerm(){this.messageSearchTerm.next("")}getUserMessages(l=T.G.inbox,p=""){const h="".concat(this.CDO_URL,"api/message/list?type=").concat(l).concat(p?"&text=".concat(p):"");return this.http.get(h,{observe:"response"}).pipe((0,E.T)(y=>{var G;return null==y||null===(G=y.body)||void 0===G?void 0:G.data}),(0,X.W)(y=>(0,Q.of)([])))}getUserInboxList(){return this.getUserMessages().pipe((0,E.T)((l=[])=>(this.notificationService.unreadInboxMessageCountSubject.next(l.filter(p=>!p.read).length),l)),(0,X.W)(()=>(0,Q.of)([])))}getUserSentList(){return this.getUserMessages(T.G.sent).pipe((0,E.T)((l=[])=>l.map(p=>(0,f.A)((0,f.A)({},p),{},{read:!0}))),(0,X.W)(()=>(0,Q.of)([])))}getCompanyMessages(){const l=this.userService.getUserStatusEntity(),p="".concat(this.CDO_URL,"api/").concat(l,"/messages");return this.http.get(p,{observe:"response"}).pipe((0,E.T)(h=>{var y;return(null==h||null===(y=h.body)||void 0===y?void 0:y.data)||[]}),(0,E.T)(h=>{const y=this.websiteService.getWebsiteName(),G=this.faviconService.getFavicon();return h.map(({historyId:J,dateSent:te,subject:ge,sender:le})=>({id:J,date:te,subject:ge,senderFirstName:le||y,read:!0,senderLastName:"",courseId:null,courseCode:"",senderPhoto:G}))}),(0,X.W)(h=>(0,Q.of)([])))}getMessage(l){const p="".concat(this.CDO_URL,"api/message/").concat(l);return this.http.get(p,{observe:"response"})}getCompanyMessage(l){const p=this.userService.getUserStatusEntity(),h="".concat(this.CDO_URL,"api/").concat(p,"/contact_history/").concat(l);return this.http.get(h,{responseType:"text"})}patchMessage(l,p){const h="".concat(this.CDO_URL,"api/message");return this.http.patch(h,[(0,f.A)({id:l},p)],{observe:"response"})}markMessageAsRead(l,p=!0){return this.patchMessage(l,{read:p?1:0}).pipe((0,E.T)(y=>(this.notificationService.updateUnreadCounter(),y)))}markMessageAsImportant(l,p=!0){return this.patchMessage(l,{important:p?1:0})}postDirectMessage(l,p=[]){const{subject:h,message:y,courseId:G,recipients:J}=l,te=new FormData;te.append("subject",h),te.append("message",y),te.append("courseId","".concat(G)),J.forEach(ie=>{te.append("recipients[]","".concat(ie))}
1),Array.from(p).forEach(ie=>{te.append("attachments[]",ie)});const le="".concat(this.CDO_URL,"api/message");return this.http.post(le,te,{observe:"response"})}getPossibleRecipients(){const l="".concat(this.CDO_URL,"api/message/recipients");return this.http.get(l,{observe:"response"})}applyOldMessage(l){return l?"".concat("<p><br></p><br><br><p>----------------------------</p>"," ").concat(l):""}setSubject(l){return l?"Re: ".concat(l):""}createReplyData(l=null,p=null,h=null,y=null,G="",J=""){if(l&&p&&h&&y)return{subject:G,message:J,course:{id:l,name:p},sender:{id:y,name:h}};{const te=(0,P.L)(),ge=new Error("No course details or sender details were provided");te.handleError(ge);const le=this.translateService.instant("somethingWentWrongTryAgain");this.toastrService.error(le)}}openMessageSendDialog(l,p){const h={data:{header:"sendMessageTitle",component:v,componentData:{entity:l}},disableClose:!0,minHeight:"50vh",maxWidth:"100%",autoFocus:!1,panelClass:["material-modal","dialog-responsive"]};p&&(h.data.componentData=(0,f.A)((0,f.A)({},h.data.componentData),p)),this.dialogService.open(L.m,h)}}return(o=b).\u0275fac=function(l){return new(l||o)},o.\u0275prov=t.jDH({token:o,factory:o.\u0275fac,providedIn:"root"}),b})()},95062:(Ie,ne,i)=>{i.d(ne,{G:()=>f});var f=function(e){return e.inbox="inbox",e.sent="sent",e.newsletter="newsletter",e}(f||{})},97978:(Ie,ne,i)=>{i.d(ne,{p:()=>t});var f=i(77697),e=i(64486);class t extends f.I6{constructor(){super(...arguments),this.direction="asc",this.sortData=(O,M)=>{const{active:W,direction:Q}=M;return W&&""!==Q?(this.direction=Q,O.sort((E,X)=>{const F=this.sortingDataAccessor(E,W)||"",P=this.sortingDataAccessor(X,W)||"";if("number"==typeof F&&"number"==typeof P)return this.compareNumeric(F,P);const D=e.E6.test(F),z=e.E6.test(P);if(D&&z){const q=this.extractNumericPart(F),A=this.extractNumericPart(P);return q===A?this.compareString(F.toString(),P.toString()):this.compareNumeric(q,A)}return this.compareString(F.toString(),P.toString())})):O}}compareNumeric(O,M){return(O-M)*("asc"===this.direction?1:-1)}compareString(O,M){return O.localeCompare(M,void 0,{sensitivity:"base"})*("asc"===this.direction?1:-1)}extractNumericPart(O){return parseInt(O.match(/\d+/)||0,10)}}}}]); 2//# sourceMappingURL=4919.38b6dbb126978a00.js.map
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.