!function(){"use strict";angular.module("myProximus.glp.enrolment",[]).constant("EnrolmentConstants",{FILES:[]})}(); !function(){"use strict";function t(){var t={restrict:"A",controller:a};return t}function a(t,a,e,n,r,o,i,s,m,l){function c(){e.emitMessage("formValidator.validate")}function E(){e.onMessage("formValidator.validated",d,t)}function d(){t.mpEnrolmentData.submitDisabled=!0,p(),t.mpEnrolmentData.isInvalidDate=_.isUndefined(t.mpEnrolmentData.userContact.birthDate),C(),y(),t.mpEnrolmentData.isInvalidDate?t.mpEnrolmentData.submitDisabled=!1:t.mpEnrolmentData.userAlreadySubscribed?D():u()}function u(){n.dispatch(i.ENROL_TO_LOYALTY_PROGRAM.EVENT,{loyaltyContact:t.mpEnrolmentData.userContact})["catch"](function(a){t.mpEnrolmentData.submitDisabled=!1;var e;a.errorData?"EMAIL-INVALID"===a.errorData.code&&(e={translationKey:"myProximus.myAdvantages.messages",id:"myAdvantages.messages.error.invalidContactEmail",displayContext:l.DISPLAY_CONTEXT.AUTO_REMOVE},n.dispatch(s.SHOW_ERROR_NOTIFICATION.EVENT,{notification:e})):(e={translationKey:"myProximus.myAdvantages.messages",id:"myAdvantages.messages.error.enrolmentFailed",displayContext:l.DISPLAY_CONTEXT.AUTO_REMOVE},n.dispatch(s.SHOW_ERROR_NOTIFICATION.EVENT,{notification:e}))})}function D(){o.setContactData(t.mpEnrolmentData.userContact),n.dispatch(i.UPDATE_CONTACT_PERSON.EVENT).then(function(){var a={translationKey:"myProximus.myAdvantages.messages",id:"myAdvantages.messages.confirmation.userContactDetailsUpdated",displayContext:l.DISPLAY_CONTEXT.AUTO_REMOVE};n.dispatch(s.SHOW_CONFIRMATION_NOTIFICATION.EVENT,{notification:a}),t.mpEnrolmentData.submitDisabled=!1,t.mpEnrolmentData.isEmailValid=!0},function(a){t.mpEnrolmentData.submitDisabled=!1;var e;a.errorData?"EMAIL-INVALID"===a.errorData.code&&(e={translationKey:"myProximus.myAdvantages.messages",id:"myAdvantages.messages.error.invalidContactEmail",displayContext:l.DISPLAY_CONTEXT.AUTO_REMOVE},n.dispatch(s.SHOW_ERROR_NOTIFICATION.EVENT,{notification:e})):(t.mpEnrolmentData.isEmailValid=!0,e={translationKey:"myProximus.myAdvantages.messages",id:"myAdvantages.messages.error.userContactDetailsUpdateFailed",displayContext:l.DISPLAY_CONTEXT.AUTO_REMOVE},n.dispatch(s.SHOW_ERROR_NOTIFICATION.EVENT,{notification:e}))})}function p(){!t.mpEnrolmentData.userContact.processedBirthDate||_.isEqual(t.mpEnrolmentData.userContact.processedBirthDate.day,"DD")||_.isEqual(t.mpEnrolmentData.userContact.processedBirthDate.month,"MM")||_.isEqual(t.mpEnrolmentData.userContact.processedBirthDate.year,"YYYY")?t.mpEnrolmentData.userContact.birthDate=null:t.mpEnrolmentData.userContact.birthDate=o.formatProcessedBirthDateObject(t.mpEnrolmentData.userContact.processedBirthDate)}function C(){t.mpEnrolmentData.userContact.emails=o.formatEmail(t.mpEnrolmentData.userContact.email)}function y(){t.mpEnrolmentData.userContact.phones=o.formatPhone(t.mpEnrolmentData.userContact.phoneNumber)}function T(t){try{return t?!_.isEqual("INACTIVE",t.subscriptionStatus):m.current.data.userAlreadySubscribed}catch(a){return}}n.dispatch(i.GET_LOYALTY_CONTACT_DATA.EVENT)["catch"](function(){t.mpEnrolmentData.componentError=a.error});var A=(new Date).getFullYear();t.mpEnrolmentData={userContact:{},submitDisabled:!1,userAlreadySubscribed:T(),loyaltyProgram:void 0,validDays:_.range(1,32),validMonths:_.range(1,13),validYears:_.range(A-100,A+1),saveChanges:c,isEmailValid:!0},t.$watch(function(){return o.data.userContact},function(a,e){if(a&&(!_.isEqual(a,e)||_.isUndefined(t.mpEnrolmentData.userContact.firstName))){var i=o.data.userContact;_.isEmpty(i)?r.dispatchWithAttributes("root","myAdvantages.messages.technicalError.enrolmentContactTechnicalSupport"):_.isUndefined(i.email)&&!t.mpEnrolmentData.userAlreadySubscribed?n.dispatch(s.GET_CONTACT_EMAIL.EVENT,{contactContext:"user"}).then(function(a){i.email=a.contactEmail,t.mpEnrolmentData.userContact=i},function(){t.mpEnrolmentData.userContact=i}):t.mpEnrolmentData.userContact=i}}),(t.mpEnrolmentData.userAlreadySubscribed||_.isUndefined(t.mpEnrolmentData.userAlreadySubscribed))&&(t.$watch(function(){return o.data.loyaltyProgram},function(a){a&&!_.isEqual(a,t.mpEnrolmentData.loyaltyProgram)&&(t.mpEnrolmentData.loyaltyProgram=o.data.loyaltyProgram,t.mpEnrolmentData.userAlreadySubscribed=T(t.mpEnrolmentData.loyaltyProgram))}),n.dispatch(i.GET_ENROL_LOYALTY_PROGRAM.EVENT)["catch"](function(){t.mpEnrolmentData.componentError=a.error})),t.enrol=function(a){t.mpEnrolmentData.userContact.loyaltyProgramTitle=a,e.emitMessage("formValidator.validate")},E()}angular.module("myProximus.glp.enrolment").directive("mpEnrolment",t),t.$inject=[],a.$inject=["$scope","$attrs","$eventBus","$commangular","$errorService","LoyaltyEnrolmentService","EnrolmentCommandConfig","CommonCommandConfig","$state","NotificationService"]}(); !function(){"use strict";function t(){var t={restrict:"A",templateUrl:"/enrolmentSuccessTemplate",controller:e};return t}function e(t,e,l,i){_.isUndefined(i.data.loyaltyEligibility)?e.go("glp.overview"):t.mpEnrolmentSuccessData={loyaltyProgram:i.data.loyaltyProgram,isCbuLoyaltyProgram:_.isEqual(i.data.loyaltyEligibility.loyaltyProgram,"GLP_CBU"),isMyProximusMobileAppV2:l.isMyProximusMobileAppV2()}}angular.module("myProximus.glp.enrolment").directive("mpEnrolmentSuccess",t),t.$inject=[],e.$inject=["$scope","$state","$environment","LoyaltyEnrolmentService"]}(); !function(){"use strict";function a(){var a={restrict:"A",templateUrl:"/enrolProgramNameTemplate",controller:r};return a}function r(a,r,o,t){r.dispatch(t.CHECK_USER_ELIGIBLE_TO_ENROL.EVENT),a.$watch(function(){return o.data.loyaltyEligibility},function(r){if(r&&_.isUndefined(a.mpEnrolProgramNameData)){var t=o.data.loyaltyEligibility.loyaltyProgram;a.mpEnrolProgramNameData={},_.isEqual(t,"GLP_EBU")?a.mpEnrolProgramNameData.showEbuLoyaltyProgramName=!0:a.mpEnrolProgramNameData.showCbuLoyaltyProgramName=!0}})}angular.module("myProximus.glp.enrolment").directive("mpEnrolProgramName",a),a.$inject=[],r.$inject=["$scope","$commangular","LoyaltyEnrolmentService","EnrolmentCommandConfig"]}(); !function(){"use strict";function t(){var t={restrict:"A",controller:e,templateUrl:"/notEligibleToEnrolAlertTemplate"};return t}function e(t,e){t.$watch(function(){return e.data.loyaltyEligibility._embedded},function(){t.mpNotEligibleToEnrolAlertData=e.data.loyaltyEligibility._embedded})}angular.module("myProximus.glp.enrolment").directive("mpNotEligibleToEnrolAlert",t),t.$inject=[],e.$inject=["$scope","LoyaltyEnrolmentService"]}(); !function(){"use strict";function e(e,t,i,r,n){return{execute:function(){var o=e.defer(),l={customerId:t.customerId};return i.getEntity(n.loyaltyProgramEligibility_v1,l).subscribe(function(e){r.setLoyaltyEligibility(e.value),o.resolve(e.value)},function(){o.reject(!1)}),o.promise}}}commangular.create("CheckUserEligibleToEnrolCommand",e,{resultKey:"loyaltyProgramEligibility"}),e.$inject=["$q","customerAccount","$entityManager","LoyaltyEnrolmentService","GlpEntityConfig"]}(); !function(){angular.module("myProximus.glp.enrolment.templates",[]).run(["$templateCache",function(n){n.put("/enrolmentBizzClubTemplate",'\r\n
\r\nUw e-mail adres werd niet geaccepteerd
\r\nUw e-mail adres werd niet geaccepteerd
\r\n\r\n \r\n Meer informatie over Premium Club\r\n \r\n
\r\n\r\n \r\n Meer informatie over Bizz Club\r\n \r\n
\r\n