!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\n
\r\n
\r\n
\r\n
\r\n
\r\n

Uw e-mail adres werd niet geaccepteerd

\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n

Lidnummer

\r\n

Hou dit unieke identificatienummer bij de hand om ons te contacteren. Zo kunnen we snel een bestelling terugvinden.

\r\n

\r\n Lidnummer:\r\n \r\n

\r\n
\r\n
\r\n\r\n

Jouw gegevens

\r\n \r\n
\r\n
\r\n \r\n Dit is niet geldig, gelieve dit aan te passen.\r\n
\r\n
\r\n
\r\n
\r\n \r\n Dit is niet geldig, gelieve dit aan te passen.\r\n
\r\n
\r\n \r\n Dit is niet geldig, gelieve dit aan te passen.\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n Dit is niet geldig, gelieve dit aan te passen.\r\n
\r\n
\r\n
\r\n
\r\n

Geboortedatum

\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n Dit is niet geldig, gelieve dit aan te passen.\r\n
\r\n
\r\n \r\n Dit is niet geldig, gelieve dit aan te passen.\r\n
\r\n
\r\n
\r\n
\r\n * Verplicht in te vullen\r\n
\r\n
\r\n
\r\n

\r\n Ik ga akkoord met de \r\n \r\n algemene voorwaarden\r\n \r\n

\r\n \r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n\r'),n.put("/enrolmentPremiumClubTemplate",'\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n

Uw e-mail adres werd niet geaccepteerd

\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n

Lidnummer

\r\n

Hou dit unieke identificatienummer bij de hand om ons te contacteren. Zo kunnen we snel een bestelling terugvinden.

\r\n

\r\n Lidnummer:\r\n \r\n

\r\n
\r\n
\r\n\r\n

Jouw gegevens

\r\n
\r\n
\r\n \r\n Dit is niet geldig, gelieve dit aan te passen.\r\n
\r\n\r\n
\r\n \r\n Dit is niet geldig, gelieve dit aan te passen.\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n \r\n Dit is niet geldig, gelieve dit aan te passen.\r\n
\r\n
\r\n \r\n Dit is niet geldig, gelieve dit aan te passen.\r\n
\r\n
\r\n
\r\n
\r\n * Verplicht in te vullen\r\n
\r\n
\r\n
\r\n

\r\n Ik ga akkoord met de \r\n \r\n algemene voorwaarden\r\n \r\n

\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n\r'),n.put("/enrolmentSuccessTemplate",'\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n

Welkom bij !

\r\n

We willen je, als trouwe klant, graag belonen met geschenken.

\r\n
Je lidnummer: {{::mpEnrolmentSuccessData.loyaltyProgram.loyaltyProgramSubscriptionId}}
\r\n \r\n \r\n Ontdek je Premium Club\r\n \r\n \r\n Ontdek je Bizz Club\r\n \r\n \r\n \r\n \r\n Ontdek je Premium Club\r\n \r\n \r\n Ontdek je Bizz Club\r\n \r\n \r\n\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n\r\n'),n.put("/enrolmentSuccessBottomTemplate",' \r\n \r\n Ontdek je Premium Club\r\n \r\n \r\n Ontdek je Bizz Club\r\n \r\n \r\n \r\n \r\n Ontdek je Premium Club\r\n \r\n \r\n Ontdek je Bizz Club\r\n \r\n \r\n\r\n'),n.put("/enrolProgramNameTemplate",'\r\n

Lid worden van Bizz Club

\r\n

Lid worden van Premium Club

\r\n\r\n'),n.put("/notEligibleToEnrolAlertTemplate",'
\r\n
\r\n
\r\n
\r\n
Jammer genoeg kom je niet in aanmerking om lid te worden van dit getrouwheidsprogramma. Gelieve onze algemene voorwaarden op onze website te raadplegen.
\r\n
    \r\n
  • \r\n Professional Usage value is 'No' (NL)\r\n Professional Usage value is 'Yes' (NL)\r\n Specified channels are not valid (NL)\r\n Uw gemiddeld factuurbedrag is te hoog.\r\n Number of Subscribers are not met (NL)\r\n Eligible Active Duration not met (NL)\r\n End-User is not active (NL)\r\n Customer Category is not valid (NL)\r\n Customer is a ProxiVolume customer (NL)\r\n Pricing Plan is not eligible (NL)\r\n SIMPLY-ONE customers (NL)\r\n Conversion to MTV (NL)\r\n No Contact Person Details (NL)\r\n Macrosegment not eligible (NL)\r\n Customer lifetime shorter than 18 months (NL)\r\n Customer not active (NL)\r\n Customer is pure Auto reload (NL)\r\n Omwille van één of meerdere openstaande facturen is het tijdelijk niet mogelijk om deze pagina\'s te consulteren. Ga naar het overzicht van uw facturen voor meer informatie.\r\n
  • \r\n
\r\n
\r\n
\r\n
\r\n')}])}(); !function(){"use strict";function t(t,e,o,r,n,a,i){return{execute:function(){var l=t.defer(),c={customerId:o.customerId},s=r.createEntity(n.loyaltyProgramSubscription_v1,c);delete i.emails,delete i.phones,delete i._links,s.value=i;var u;return r.saveEntity(s,c).subscribe(function(t){u=t.value,a.setLoyaltyProgram(u),e.setString("loyaltyContactEmail",i.email),e.setString("loyaltyProgramSubscriptionStatus","active")},function(t){l.reject(t)},function(){l.resolve(u)}),l.promise}}}commangular.create("EnrolToLoyaltyProgramCommand",t,{resultKey:"loyaltyProgram"}),t.$inject=["$q","$sessionStorage","customerAccount","$entityManager","GlpEntityConfig","LoyaltyEnrolmentService","loyaltyContact"]}(); !function(){"use strict";function t(t,r,e,o,n){return{execute:function(){var a=t.defer(),c={customerId:r.customerId};return e.getEntity(n.loyaltyProgramSubscription_v1,c).subscribe(function(t){o.setLoyaltyProgram(t.value)},function(t){a.reject(t)},function(){a.resolve(o.data.loyaltyProgram)}),a.promise}}}commangular.create("GetEnrolLoyaltyProgramCommand",t,{resultKey:"loyaltyProgram"}),t.$inject=["$q","customerAccount","$entityManager","LoyaltyEnrolmentService","GlpEntityConfig"]}(); !function(){"use strict";function t(t,e,n,o,a){return{execute:function(){var c=t.defer(),r={customerId:e.customerId,context:"loyalty"},u={};return n.getEntity(o.contact_v1,r).subscribe(function(t){u=t.value,a.setContactData(u),c.resolve(u)},function(t){_.isEqual(t.status,404)?(a.setContactData(u),c.resolve(u)):c.reject(!1)}),c.promise}}}commangular.create("GetLoyaltyContactDataCommand",t,{resultKey:"loyaltyContact"}),t.$inject=["$q","customerAccount","$entityManager","GlpEntityConfig","LoyaltyEnrolmentService"]}(); !function(){"use strict";function e(e){return{execute:function(){e.go("glp.enrolSuccess",{},{reload:!0})}}}commangular.create("ShowEnrolSuccessPageCommand",e),e.$inject=["$state"]}(); !function(){"use strict";function t(t,e,n,c,r){function o(){var o=t.defer(),a={customerId:r.customerId,context:"loyalty"},u=e.createEntity(n.contact_v1,a);return u.value=c.data.userContact,e.saveEntity(u,a).subscribe(function(t){o.resolve(t)},function(t){o.reject(t)}),o.promise}var a={execute:o};return a}commangular.create("UpdateContactPersonCommand",t),t.$inject=["$q","$entityManager","GlpEntityConfig","LoyaltyEnrolmentService","customerAccount"]}(); !function(){"use strict";function e(e,t){function a(e){m.data.loyaltyProgram=e}function r(e){m.data.loyaltyEligibility=e}function n(a){var r=t.getSelectedLanguage();if(_.isEmpty(a)){var n=e.data.customerAccount,o=e.getLoyaltyResidentialSubsegments();(n.fls&&!_.includes(o,n.fls.subsegment)||n.mcs&&!_.includes(o,n.mcs.subsegment))&&s(r,a)}else a.birthDate?a.processedBirthDate=i(a.birthDate):s(r,a),_.isEmpty(a.emails)||_.isEqual(a.emails[0].context,"LOYALTY")&&(a.email=a.emails[0].emailAddress),_.isEmpty(a.phones)||(a.phoneNumber=a.phones[0].phoneNumber);m.data.userContact=a}function o(){var e=m.data.userContact;return delete e.processedBirthDate,e}function s(e,t){switch(e){case"nl":t.processedBirthDate={day:"DD",month:"MM",year:"JJJJ"};break;case"fr":t.processedBirthDate={day:"JJ",month:"MM",year:"AAAA"};break;default:t.processedBirthDate={day:"DD",month:"MM",year:"YYYY"}}}function i(e){var t=new Date(e);return{day:t.getDate(),month:t.getMonth()+1,year:t.getFullYear()}}function c(e){var t=parseInt(e.year),a=parseInt(e.month)-1,r=parseInt(e.day),n=Date.UTC(t,a,r),o=new Date(t,a,r);return _.isEqual(o.getDate(),r)||(n=void 0),n}function u(e,t){t=t||"LOYALTY";var a=[];return e&&a.push({emailAddress:e,context:t}),a}function l(e,t){t=t||"LOYALTY";var a=[];return e&&a.push({phoneNumber:e,context:t}),a}var m={setLoyaltyEligibility:r,setContactData:n,formatProcessedBirthDateObject:c,formatEmail:u,formatPhone:l,getUpdateContactRequestBody:o,setLoyaltyProgram:a,data:{loyaltyEligibility:void 0,userContact:void 0,loyaltyProgram:void 0}};return m}angular.module("myProximus.glp.enrolment").factory("LoyaltyEnrolmentService",e),e.$inject=["CustomerAccountService","LanguageService"]}(); !function(){"use strict";function E(E,C,T){E.mapTo(T.CHECK_USER_ELIGIBLE_TO_ENROL.EVENT).asSequence().add(C.GET_CUSTOMER_ACCOUNT.COMMAND).add(T.CHECK_USER_ELIGIBLE_TO_ENROL.COMMAND),E.mapTo(T.GET_LOYALTY_CONTACT_DATA.EVENT).asSequence().add(C.GET_CUSTOMER_ACCOUNT.COMMAND).add(T.GET_LOYALTY_CONTACT_DATA.COMMAND),E.mapTo(T.ENROL_TO_LOYALTY_PROGRAM.EVENT).asSequence().add(C.GET_CUSTOMER_ACCOUNT.COMMAND).add(T.UPDATE_CONTACT_PERSON.COMMAND).add(T.ENROL_TO_LOYALTY_PROGRAM.COMMAND).add(T.SHOW_ENROL_SUCCESS_PAGE.COMMAND),E.mapTo(T.UPDATE_CONTACT_PERSON.EVENT).asSequence().add(C.GET_CUSTOMER_ACCOUNT.COMMAND).add(T.UPDATE_CONTACT_PERSON.COMMAND),E.mapTo(T.GET_ENROL_LOYALTY_PROGRAM.EVENT).asSequence().add(C.GET_CUSTOMER_ACCOUNT.COMMAND).add(T.GET_ENROL_LOYALTY_PROGRAM.COMMAND)}var C={CHECK_USER_ELIGIBLE_TO_ENROL:{EVENT:"CheckUserEligibleToEnrolEvent",COMMAND:"CheckUserEligibleToEnrolCommand"},GET_LOYALTY_CONTACT_DATA:{EVENT:"GetLoyaltyContactDataEvent",COMMAND:"GetLoyaltyContactDataCommand"},GET_ENROL_LOYALTY_PROGRAM:{EVENT:"GetEnrolLoyaltyProgramEvent",COMMAND:"GetEnrolLoyaltyProgramCommand"},ENROL_TO_LOYALTY_PROGRAM:{EVENT:"EnrolToLoyaltyProgramEvent",COMMAND:"EnrolToLoyaltyProgramCommand"},UPDATE_CONTACT_PERSON:{EVENT:"UpdateContactPersonEvent",COMMAND:"UpdateContactPersonCommand"},SHOW_ENROL_SUCCESS_PAGE:{COMMAND:"ShowEnrolSuccessPageCommand"}};angular.module("myProximus.glp.enrolment").config(E).constant("EnrolmentCommandConfig",C),E.$inject=["$commangularProvider","CommonCommandConfig","EnrolmentCommandConfig"]}(); //# sourceMappingURL=enrolment.myProximus.process.js.map