{"version":3,"sources":["registrationForm_A.js","registrationSsoForm_A.js","registrationB2BForm_A.js","resetPasswordForm_A.js"],"names":["Vendd","Scripts","load","form","formData","$form","$","$loyaltyErrorWrapper","length","get","getQueryStringValueByName","hide","show","User","ClearClientModel","window","location","loyaltyMemberCardNumberIsValid","loyaltyMemberCardNumberIsEnabled","data","verifyemail","toString","toLowerCase","useEmailAsLoginName","importEmailForRegistration","title","text","firstName","val","lastName","email","trim","username","password","passwordConfirmation","newsletter","reCaptchaCode","redirectUrl","phone","mobilephone","socialSecurityNumber","birthdate","registerToLoyalty","isLoyaltyMember","loyaltyRequest","loyaltyMemberId","ReceiveEinvoice","alreadyRegisteredToLoyalty","loyaltyMemberCardNumber","postalCode","registrationSetData","captchaWidgetId","areas","$captchaElement","find","$captchaContainer","captchaEnabled","initRecaptcha","sitekey","grecaptcha","render","callback","recaptchaCallback","on","e","preventDefault","this","hasClass","removeClass","siblings","prop","addClass","validateRecaptcha","res","resetRecaptcha","reset","removeRecaptcha","remove","getAreasForPostCode","envelope","message","valOpts","isValidPostalCode","config","rf","validateField","setRegistrationData","$sets","each","set","$set","setData","Name","Id","Values","input","is","setValues","push","loading","onSuccess","response","success","code","LhApp","Context","IsConsentsEnabled","checkConsents","animate","scrollTop","LoyaltyRegistrationUrl","MessageBus","publishAsync","Loyalty","Messages","CheckByMobile","fbPixelTracker","fbPixelCanTrack","Properties","FacebookPixelId","fbq","offset","top","onFailure","submit","einvoiceVal","attr","Register","updatePasswordBar","field","value","score","Helpers","textStrength","i","css","match","join","datepicker","changeMonth","changeYear","yearRange","maxDate","setIsRegistered","isRegistered","sessionStorage","setItem","fn","validationEngine","validations","passwordStrength","Validations","initialValidation","el","inputName","required","consentType","checkboxRequired","_","extend","isEmail","venddProjectConfigs","phoneLocalizationEnabled","isValidPhoneLocalized","validator","type","Registration","GreekPhoneValidation","isGreekPhone","isPhoneNumber","GreekMobileValidation","isGreekMobile","limit","matchField","isSocialSecurityNumber","prevLoyaltyMemberCardNumber","$formRow","closest","replace","GetMemberByLoyaltyNumber","loyaltyCheckboxes","removeAttr","off","$this","fieldName","validate","$text","fancybox","open","maxWidth","padding","modal","afterShow","consentForm","closeButton","acceptButton","close","afterClose","click","trigger","stopPropagation","val1","val2","first","checkboxes","chkbx","source","approved","ConsentsManager","insertConsents","setField","keyCode","removeWhiteSpaces","debounce","GetAreasForPostCode","not","isLoyaltyRegistered","$chkbx","chkbxId","undefined","removeField","addField","JSON","parse","addEventListener","subscribe","RegisterSuccess","RegisterFailure","Plugins","RecaptcaLoaded","CheckByMobileSuccess","StatusCode","loyaltyErrorWrapper","html","ResponseMessage","origin","CheckByMobileFailure","toastr","error","LoginSuccess","returnUrl","decodeURIComponent","Function","QueryString","getValueOf","href","document","GetMemberByLoyaltyNumberSuccess","model","ErrorCode","GetMemberByLoyaltyNumberFailed","GetAreasForPostCodeSuccess","Widget","BindControl","$submitButton","mobilePhone","CompleteSsoRegistration","Consents","InsertConsents","companyName","occupation","taxAgency","taxIdentifier","officerName","vatstatus","emailConfirmation","town","address","number","storesNumber","phoneTwo","mobile","fax","siteUrl","acceptTerms","store","CompanyCategory","OpeningHours","area","prefecture","officerLastName","officerPosition","countryCode","Country","areaAutoCompleteEnabled","invoiceAutoCompleteEnabled","areaLabel","selectedCountry","areasCount","isEUCountry","initialAjaxCall","Handlebars","empty","append","City","updatePostalCode","country","valOptPostalCode","hideLoader","keyup","B2BRegister","resetAddressFields","TaxIdentifierValidationEnabled","isServiceValidTaxIdentifier","isValid","isGreekTaxIdentifier","offsetTop","addTaxIdentifierValidation","focus","vatInfoService","Account","GetAllTaxAgencies","touch","autoFocus","B2BRegisterSuccess","B2BRegisterFailure","GetAllTaxAgenciesSuccess","taxAgencies","$taxAgenciesWrapper","literalsModel","TaxAgency","taxAgenciesHtml","Literals","Service","call","url","request","vat","name","taxAgencyCode","notificationType","ResetPassword","ResetPasswordSuccess","ResetPasswordFailure","onResendSuccess","onResendFailure","resend","ResendActivationCode","ResendActivationCodeSucc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BACAD,EAAAwI,kBAEA4I,IAAA3J,YACAtL,KAAAyH,WAGAvH,MAAA0D,GAAA,QAAA,oBAAA,SAAAC,GACAA,EAAAC,iBACAD,EAAAwI,kBAEArM,KAAA6U,WAGA3U,MAAA0D,GAAA,QAAA,cAAA,SAAAC,GAEA,GAAA,KAAAA,EAAAmJ,QAOA,OANAnJ,EAAAC,iBACAD,EAAAwI,uBAEA4I,IAAA3J,YACAtL,KAAAyH,UAKA,IAAA2D,MAAAjL,EAAA4D,MACAsH,UAAAD,MAAAzD,KAAA,QAEA,aAAA0D,WACArL,KAAA6H,kBAAAuD,MAAA3J,OAIAwT,IAAA3J,SAAAD,aAGAnL,MAAA0D,GAAA,QAAA,sBAAA,SAAAC,GACAA,EAAAC,iBACA3D,EAAA4D,MAAAC,SAAA,SACA7D,EAAA4D,MAAAE,YAAA,SAAAC,SAAA,SAAAC,KAAA,OAAA,YAEAhE,EAAA4D,MAAAK,SAAA,SAAAF,SAAA,SAAAC,KAAA,OAAA","file":"scripts-user.min.js","sourcesContent":["Vendd.Scripts.load(function () {\n var $form = $('.x-registration-form'), form, formData, $loyaltyErrorWrapper = $('.loyalty-error-container'), loyaltyRegistrationUrl;\n\n if ($form.length < 1) return;\n\n form = $form.get(0);\n\n //get verification token\n var token = getQueryStringValueByName(\"vtoken\");\n if (token.length > 0) {\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-content', $form).hide();\n $('.js-success', $form).show();\n $('.js-need-verification', $form).hide();\n\n //clear user model\n Vendd.User.ClearClientModel();\n //redirect\n window.location = '/';\n }\n\n var loyaltyMemberCardNumberIsValid = true;\n var loyaltyMemberCardNumberIsEnabled = $form.data('loyaltymembercardnumberisenabled');\n var verifyemail = $form.data('verifyemail').toString().toLowerCase() === 'true';\n var useEmailAsLoginName = $form.data('useemailasloginname').toString().toLowerCase() === 'true';\n\n importEmailForRegistration();\n\n formData = {\n \"title\": $(\"option:selected\", 'select[name=title]').text(),\n \"firstName\": $('input[name=\"firstName\"]').val(),\n \"lastName\": $('input[name=\"lastName\"]').val(),\n \"email\": $('input[name=\"email\"]').val().trim(),\n \"username\": ($('input[name=\"username\"]').length > 0 ? $('input[name=\"username\"]').val() : ''),\n \"password\": \"\",\n \"passwordConfirmation\": \"\",\n \"newsletter\": false,\n \"reCaptchaCode\": \"\",\n \"redirectUrl\": $form.data('redirect') || \"\",\n \"phone\": $('input[name=\"phone\"]').val(),\n \"mobilephone\": \"\", //$('input[name=\"mobilephone\"]').val()\n \"socialSecurityNumber\": $('input[name=\"socialSecurityNumber\"]').val(),\n \"birthdate\": \"\",\n \"registerToLoyalty\": false,\n \"isLoyaltyMember\": false,\n \"loyaltyRequest\": false,\n \"loyaltyMemberId\": \"\",\n \"ReceiveEinvoice\": null,\n \"alreadyRegisteredToLoyalty\": false,\n \"loyaltyMemberCardNumber\": \"\",\n \"postalCode\": \"\",\n \"registrationSetData\": registrationSetData || null\n };\n\n var areas = [];\n var registrationSetData = [];\n\n // reCAPTCHA\n var captchaWidgetId;\n var captchaId = \"registrationCaptcha\";\n var $captchaElement = $form.find(\"#\" + captchaId);\n var $captchaContainer = $form.find('.recaptcha-container');\n var captchaEnabled = $captchaElement.length > 0 ? true : false;\n\n form.initRecaptcha = function () {\n\n if (!captchaEnabled)\n return;\n\n var sitekey = $captchaElement.data(\"sitekey\");\n if (sitekey) {\n captchaEnabled = true;\n captchaWidgetId = grecaptcha.render(captchaId, {\n 'sitekey': sitekey,\n 'callback': form.recaptchaCallback\n });\n }\n };\n\n $form.on('click', '.js-password-reveal', function (e) {\n e.preventDefault();\n if ($(this).hasClass('shown')) {\n $(this).removeClass('shown').siblings('input').prop('type', 'password');\n } else {\n $(this).addClass('shown').siblings('input').prop('type', 'text');\n }\n });\n\n form.validateRecaptcha = function () {\n if (!captchaEnabled)\n return true;\n\n formData.reCaptchaCode = $captchaElement.find('.g-recaptcha-response').val();\n\n var res = false;\n\n if (formData.reCaptchaCode) {\n $captchaContainer.find('.recaptcha-required').removeClass('error');\n res = true;\n }\n else {\n $captchaContainer.find('.recaptcha-required').addClass('error');\n }\n\n return res;\n };\n\n form.resetRecaptcha = function () {\n // Website must only verify the user's reCAPTCHA response token (g-recaptcha-response) once. \n // If a verify attempt has been made with a particular token, it cannot be used again. \n // Call grecaptcha.reset() to ask the end user to verify with reCAPTCHA again.\n if (captchaEnabled)\n grecaptcha.reset(captchaWidgetId);\n };\n\n form.removeRecaptcha = function () {\n $captchaElement.remove();\n };\n\n form.recaptchaCallback = function () {\n form.validateRecaptcha();\n };\n\n form.getAreasForPostCode = function (envelope) {\n\n areas = envelope.message.data;\n\n //validate postal code.\n if (valOpts.postalCode && valOpts.postalCode.isValidPostalCode) {\n valOpts.postalCode.isValidPostalCode.config.areas = areas;\n }\n rf.validateField(\"postalCode\");\n };\n\n form.setRegistrationData = function () {\n\n var $sets = $('.js-registration-set', $form);\n\n if ($sets.length < 1) return;\n\n //init array\n registrationSetData = [];\n\n $.each($sets, function (e, set) {\n var $set = $(set);\n\n var setData = {\n Name: $set.data('set-name'),\n Id: $set.data('set-id'),\n Values: []\n }\n\n $.each($('input[type=\"checkbox\"]', $set), function (e, input) {\n if ($(input).is(':checked')) {\n var setValues = {\n Id: $(input).data('id'),\n Name: $(input).data('name')\n }\n\n setData.Values.push(setValues); \n }\n });\n\n if (setData.Values.length > 0)\n registrationSetData.push(setData);\n });\n\n if (registrationSetData.length > 0)\n formData.registrationSetData = registrationSetData;\n };\n\n form.loading = function (loading) {\n if (loading) {\n $form.addClass('x-loading');\n } else {\n $form.removeClass('x-loading');\n }\n };\n\n form.onSuccess = function (envelope) {\n form.loading(false);\n var response = envelope.message.data;\n\n if (response.success && response.code === \"Registration_OperationSuccesful\") {\n //insert consents after registration success\n if (LhApp.Context.IsConsentsEnabled) {\n form.checkConsents();\n }\n\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-content', $form).hide();\n $('.js-need-verification', $form).hide();\n $('.js-success', $form).hide();\n\n if (verifyemail) {\n $('.js-need-verification', $form).show(); \n } else {\n $('.js-success', $form).show();\n }\n\n $('html,body').animate({ scrollTop: 0 }, 300);\n\n var isLoyaltyActivated = (formData.alreadyRegisteredToLoyalty || formData.registerToLoyalty);\n if (isLoyaltyActivated && formData.mobilephone) {\n loyaltyRegistrationUrl = response.data.LoyaltyRegistrationUrl;\n Vendd.MessageBus.publishAsync(Vendd.Loyalty, new Vendd.Loyalty.Messages.CheckByMobile(formData.mobilephone));\n }\n\n form.removeRecaptcha();\n\n /* Track User Registration */\n if (typeof fbPixelTracker !== 'undefined' && typeof fbPixelCanTrack !== 'undefined') {\n if (fbPixelTracker && fbPixelTracker.Properties.FacebookPixelId && fbPixelCanTrack) {\n fbq('track', 'CompleteRegistration');\n }\n }\n /* END Track User Registration */\n\n } else {\n\n if (response.code === 'Registration_EmailExists') {\n $('.js-error', $form).hide();\n $('.js-exists', $form).show();\n $('html,body').animate({ scrollTop: $('.js-exists', $form).offset().top - 100 }, 300);\n } else {\n $('.js-exists', $form).hide();\n $('.js-error', $form).show();\n $('html,body').animate({ scrollTop: $('.js-error', $form).offset().top - 100 }, 300);\n }\n\n form.resetRecaptcha();\n }\n };\n\n form.onFailure = function (envelope) {\n form.loading(false);\n\n var response = envelope.message.data;\n if (response.code === 'Registration_EmailExists') {\n $('.js-error', $form).hide();\n $('.js-exists', $form).show();\n $('html,body').animate({ scrollTop: $('.js-exists', $form).offset().top - 100 }, 300);\n } else {\n $('.js-exists', $form).hide();\n $('.js-error', $form).show();\n $('html,body').animate({ scrollTop: $('.js-error', $form).offset().top - 100 }, 300);\n }\n\n form.resetRecaptcha();\n };\n\n form.submit = function () {\n form.loading(true);\n\n formData.newsletter = $('#chkNewsletter').prop(\"checked\");\n formData.registerToLoyalty = $('#chkRegisterToLoyaltyPoints').prop(\"checked\");\n formData.alreadyRegisteredToLoyalty = $('#chkAlreadyRegisteredToLoyaltyPoints').prop(\"checked\");\n\n formData.isLoyaltyMember = $('#isLoyaltyMember').prop(\"checked\");\n formData.loyaltyRequest = $('#loyaltyRequest').prop(\"checked\");\n\n var einvoiceVal = $(\"input:radio[name='einvoice']:checked\").val();\n\n if (einvoiceVal === \"true\") {\n formData.ReceiveEinvoice = true;\n } else if (einvoiceVal === \"false\") {\n formData.ReceiveEinvoice = false;\n } else {\n formData.ReceiveEinvoice = null;\n }\n\n form.setRegistrationData();\n\n $('input:not([type=\"checkbox\"]), textarea:not([name=\"g-recaptcha-response\"])', $form).each(function () {\n if ($(this).attr('name') === 'email') {\n formData[$(this).attr('name')] = $(this).val().trim();\n } else {\n formData[$(this).attr('name')] = $(this).val();\n }\n });\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.Register(\n formData.firstName,\n formData.lastName,\n formData.email,\n formData.username,\n formData.password,\n formData.passwordConfirmation,\n formData.newsletter,\n formData.reCaptchaCode,\n formData.redirectUrl,\n formData.phone,\n formData.mobilephone,\n formData.socialSecurityNumber,\n formData.birthdate,\n formData.isLoyaltyMember,\n formData.loyaltyRequest,\n formData.ReceiveEinvoice,\n formData.loyaltyMemberId,\n formData.loyaltyMemberCardNumber,\n formData.postalCode,\n formData.registrationSetData ));\n };\n\n form.reset = function () {\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-success', $form).hide();\n $('.js-need-verification', $form).hide();\n $('.js-content', $form).show();\n\n $('input[name=\"firstName\"]', $form).val(\"\");\n $('input[name=\"lastName\"]', $form).val(\"\");\n $('input[name=\"email\"]', $form).val(\"\");\n $('input[name=\"username\"]', $form).val(\"\");\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n\n $('input[name=\"phone\"]', $form).val(\"\");\n $('input[name=\"mobilephone\"]', $form).val(\"\");\n $('input[name=\"socialSecurityNumber\"]', $form).val(\"\");\n $('input[name=\"birthdate\"]', $form).val(\"\");\n $('input[name=\"loyaltyMemberCardNumber\"]', $form).val(\"\");\n $('input[name=\"postalCode\"]', $form).val(\"\");\n\n rf.reset();\n };\n\n form.updatePasswordBar = function (field) {\n var value = field.val();\n var score = Vendd.Helpers.textStrength(value);\n\n var $passwordStrength = $('#chkPassLabel, #chkPassText');\n\n $passwordStrength.removeClass(function (i, css) {\n return (css.match(/(^|\\s)level\\S+/g) || []).join(' ');\n }).addClass('level' + score);\n };\n\n $(\".js-datepicker\", $form).datepicker({\n changeMonth: true,\n changeYear: true,\n yearRange: \"-100:+0\",\n maxDate: \"0\"\n });\n\n form.setIsRegistered = function (isRegistered) {\n sessionStorage.setItem('LoyaltyIsRegistered', isRegistered);\n };\n $.fn.validationEngine.validations.passwordStrength = Vendd.Validations.passwordStrength;\n\n //init validation options\n var valOpts = {}, initialValidation = false;\n\n //add required validations\n $.each($('input[data-required], textarea[data-required], select[data-required]', $form), function (e, el) {\n var inputName = $(el).attr('name');\n valOpts[inputName] = { required: inputName + '-required' };\n });\n\n //add consent validations\n $.each($('div.consent.checkbox[data-required]'), function (e, el) {\n var consentType = $('input', el).attr('name');\n valOpts[consentType] = { checkboxRequired: consentType + '-required' };\n });\n\n //add email validation\n if ($('input[name=\"email\"]', $form).length > 0) {\n valOpts.email = valOpts.email || {};\n _.extend(valOpts.email, { isEmail: 'email-invalid' });\n }\n\n //add phone validation\n if ($('input[name=\"phone\"]', $form).length > 0) {\n valOpts.phone = valOpts.phone || {};\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n _.extend(valOpts.phone, { isValidPhoneLocalized: { validator: 'phone-invalid', config: { type: 'phone' } } });\n } else {\n if (venddProjectConfigs.Registration.GreekPhoneValidation) {\n _.extend(valOpts.phone, { isGreekPhone: 'phone-invalid' });\n } else {\n _.extend(valOpts.phone, { isPhoneNumber: 'phone-invalid' });\n }\n }\n }\n\n //add mobile validation\n if ($('input[name=\"mobilephone\"]', $form).length > 0) {\n valOpts.mobilephone = valOpts.mobilephone || {};\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n _.extend(valOpts.mobilephone, { isValidPhoneLocalized: { validator: 'mobilephone-invalid', config: { type: 'mobile' } } });\n } else {\n if (venddProjectConfigs.Registration.GreekMobileValidation) {\n _.extend(valOpts.mobilephone, { isGreekMobile: 'mobilephone-invalid' });\n } else {\n _.extend(valOpts.mobilephone, { isPhoneNumber: 'mobilephone-invalid' });\n }\n }\n }\n\n //add password strength validation\n if ($('input[name=\"password\"]', $form).length > 0) {\n valOpts.password = valOpts.password || {};\n _.extend(valOpts.password, { passwordStrength: { validator: 'password-weak', config: { limit: $form.data('pwdstrength') } } });\n }\n\n //add confirmation password match validation\n if ($('input[name=\"passwordConfirmation\"]', $form).length > 0) {\n valOpts.passwordConfirmation = valOpts.passwordConfirmation || {};\n _.extend(valOpts.passwordConfirmation, { match: { validator: 'passwordConfirmation-match', matchField: 'password' } });\n }\n\n //add social security number validation\n if ($('input[name=\"socialSecurityNumber\"]', $form).length > 0) {\n valOpts.socialSecurityNumber = { isSocialSecurityNumber: 'socialSecurityNumber-invalid' };\n }\n\n //add postalCode validation\n //if ($('input[name=\"postalCode\"]', $form).length > 0) {\n // valOpts.postalCode = valOpts.postalCode || {};\n // _.extend(valOpts.email, { isValidPostalCode: { validator: 'postalCode-invalid', config: {country: 'GR', areas: areas } } });\n //}\n\n var prevLoyaltyMemberCardNumber = '';\n\n if (loyaltyMemberCardNumberIsEnabled) {\n $('input[name=\"loyaltyMemberCardNumber\"]', $form).on('blur', function () {\n var loyaltyMemberCardNumber = $(this).val();\n var $formRow = $(this).closest('.form-row');\n loyaltyMemberCardNumber = loyaltyMemberCardNumber.replace(/\\s/g, '');\n $(this).val(loyaltyMemberCardNumber);\n if (loyaltyMemberCardNumber == '') {\n $('.loyaltyMemberCardNumber-invalid', $formRow).hide();\n $formRow.removeClass('with-error');\n loyaltyMemberCardNumberIsValid = true;\n }\n else {\n if (loyaltyMemberCardNumber != prevLoyaltyMemberCardNumber) {\n $('.js-submit-button', $form).attr('disabled', 'disabled');\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.GetMemberByLoyaltyNumber(loyaltyMemberCardNumber));\n prevLoyaltyMemberCardNumber = loyaltyMemberCardNumber;\n }\n }\n });\n }\n\n var clickedCheckbox;\n var loyaltyCheckboxes = $('.js-loyalty-checkbox .checkbox-wrapper input', $form);\n loyaltyCheckboxes.removeAttr('disabled');\n\n $('.consent-wrapper', $form).each(function (e, el) {\n var $chkbx = $('.checkbox-wrapper > input', el); \n\n $chkbx.off('click').on('click', function () {\n var $this = $(this);\n\n if (!$this.is(':checked')) {\n var fieldName = $this.attr('name');\n\n formData[fieldName] = $this.is(':checked');\n rf = $form.data('validationEngine');\n rf.validate(fieldName);\n return;\n }\n\n var $text = $('.consent-text-wrapper', el);\n $.fancybox.open($text, {\n maxWidth: 900,\n padding: 0,\n modal: true,\n afterShow: function () {\n var consentForm = $('.js-consent-form');\n //var scrollContForm = $('.js-scrollbar', consentForm);\n var closeButton = $('.js-consent-decline-button', consentForm);\n var acceptButton = $('.js-consent-accept-button', consentForm);\n\n //scrollContForm.mCustomScrollbar({\n // scrollbarPosition: \"outside\",\n // scrollInertia: 400,\n // timeout: 1000,\n // theme: \"dark-2\",\n // mouseWheel: { preventDefault: true },\n // callbacks: {\n // onTotalScrollOffset: 25,\n // onTotalScroll: function () {\n // consentForm.addClass('has-scrolled');\n // $('.js-consent-accept-button', consentForm).prop('disabled', false);\n // $('.js-tooltip', consentForm).addClass('hidden');\n // },\n // onInit: function () {\n // $('.js-scroll-btn', consentForm).addClass('show');\n // },\n // onCreate: function () {\n // setTimeout(function () {\n // if (scrollContForm.hasClass('mCS_no_scrollbar')) {\n // consentForm.addClass('has-scrolled');\n // $('.js-consent-accept-button', consentForm).prop('disabled', false);\n // $('.js-tooltip', consentForm).addClass('hidden');\n // }\n // }, 100);\n // }\n // }\n //});\n\n //$('.js-scroll-btn', consentForm).click(function () {\n // scrollContForm.mCustomScrollbar('scrollTo', '-=' + (scrollContForm.height()));\n //});\n\n closeButton.off('click').on('click', function () {\n //clickedCheckbox.prop(\"checked\", false);\n //$this.prop(\"checked\", false);\n $.fancybox.close(true);\n });\n acceptButton.off('click').on('click', function () {\n //clickedCheckbox.prop(\"checked\", true);\n //$this.prop(\"checked\", true);\n $.fancybox.close(true);\n });\n },\n afterClose: function () {\n\n var fieldName = $this.attr('name');\n\n formData[fieldName] = $this.is(':checked');\n rf = $form.data('validationEngine');\n rf.validate(fieldName);\n },\n });\n });\n });\n\n loyaltyCheckboxes.click(function (e) {\n clickedCheckbox = $(this);\n $('.consent-wrapper.loyalty .checkbox-wrapper > input', $form).trigger('click');\n });\n\n if (!useEmailAsLoginName) {\n valOpts.username = {\n required: 'username-required'\n };\n\n }\n\n $form.validationEngine(valOpts);\n var rf = $form.data('validationEngine');\n\n $.each($('.consent.checkbox[data-required]', $form), function (e, el) {\n var consentType = $('input', el);\n consentType.on('change', function () {\n rf.validate(consentType.attr('name'));\n });\n });\n\n $form.on('click', '.js-submit-button', function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n var val1 = form.validateRecaptcha();\n var val2 = rf.validate();\n\n if (val1 && val2 && loyaltyMemberCardNumberIsValid) {\n form.submit();\n } else {\n if ($('.form-row.with-error', $form).length > 0) {\n $('html,body').animate({ scrollTop: $('.form-row.with-error', $form).first().offset().top - 100 }, 600);\n }\n }\n\n initialValidation = true;\n });\n\n form.checkConsents = function () {\n var data = [];\n var checkboxes = $('.form-row.consent.checkbox', $form);\n $.each(checkboxes, function (e, el) {\n var chkbx = $('.checkbox-wrapper input', el);\n data.push({ type: chkbx.attr('id'), source: 'Registration Form', approved: chkbx.prop(\"checked\") });\n });\n\n if (data.length > 0) {\n window.ConsentsManager.insertConsents(data);\n }\n };\n\n $form.on('change', 'select[name]', function (e) {\n form.setField($(this));\n });\n\n $form.on('change', '.js-datepicker', function (e) {\n $(this).trigger('keyup');\n });\n\n $form.on('keyup', 'input[name]:not([type=\"checkbox\"]), textarea[name]', function (e) {\n if (e.keyCode === 13) {\n e.preventDefault();\n e.stopPropagation();\n\n $('.js-submit-button', $form).click();\n\n return;\n }\n\n if ($(this).attr('name') === \"postalCode\") {\n removeWhiteSpaces($(this));\n }\n\n if ($(this).attr('name') === \"password\") {\n form.updatePasswordBar($(this));\n rf.validate(\"passwordConfirmation\");\n }\n\n form.setField($(this)); \n });\n\n $form.on('blur', 'input[name]:not([type=\"checkbox\"]), textarea[name]', function (e) {\n\n if ($(this).attr('name') === \"password\") {\n form.updatePasswordBar($(this));\n rf.validate(\"passwordConfirmation\");\n }\n\n //validate fields instantly\n if (!initialValidation) {\n if ($(this).attr('name') === \"email\") {\n rf.validateField(\"email\");\n }\n\n if ($(this).attr('name') === \"phone\") {\n rf.validateField(\"phone\");\n }\n\n if ($(this).attr('name') === \"mobilephone\") {\n rf.validateField(\"mobilephone\");\n }\n }\n\n form.setField($(this));\n });\n\n form.setField = function (field) {\n var fieldName = field.attr('name');\n rf.validate(fieldName);\n };\n\n $form.on('keyup', 'input[name = \"postalCode\"]', $.debounce(400, function () {\n var $this = $(this);\n var postalCode = $this.val();\n\n if (postalCode === null) return;\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.GetAreasForPostCode(\"GR\", postalCode, \"\"));\n }));\n\n $form.on('click', 'input.single-check', function () {\n $('input.single-check').not(this).prop('checked', false);\n formData.registerToLoyalty = $('#chkRegisterToLoyaltyPoints').prop(\"checked\");\n formData.alreadyRegisteredToLoyalty = $('#chkAlreadyRegisteredToLoyaltyPoints').prop(\"checked\");\n var isLoyaltyRegistered = formData.registerToLoyalty || formData.alreadyRegisteredToLoyalty;\n $('.consent-wrapper', $form).each(function (e, el) {\n var $chkbx = $('.checkbox-wrapper input', el);\n var chkbxId = $chkbx.attr('id');\n if (chkbxId != undefined && chkbxId != \"\") {\n valOpts = $form.validationEngine();\n formData[chkbxId] = $chkbx.prop(\"checked\");\n valOpts[chkbxId] = isLoyaltyRegistered ? { checkboxRequired: (chkbxId + '-required') } : {};\n $form.validationEngine(valOpts);\n }\n if (isLoyaltyRegistered) {\n $chkbx.removeAttr('disabled').closest('.checkbox-wrapper').removeClass('disabled');\n $form.data('validationEngine').removeField(chkbxId);\n $form.data('validationEngine').addField(JSON.parse(\"{\\\"\" + chkbxId + \"\\\" : { \\\"checkboxRequired\\\" : \\\"\" + chkbxId + \"-required\\\" }}\"));\n $chkbx.prop(\"checked\", true);\n $chkbx.on('change', function () {\n $form.data('validationEngine').validate($chkbx.attr('name'));\n });\n } else {\n $chkbx.attr('disabled', 'disabled').closest('.checkbox-wrapper').addClass('disabled');\n $('.' + chkbxId + '-required', $form).removeClass(\"error\");\n $form.data('validationEngine').removeField(chkbxId);\n $chkbx.prop(\"checked\", false);\n $chkbx.off('change');\n }\n });\n });\n\n $form.on('click', '.js-clear-loyalty', function () {\n $('input.single-check:checked').prop('checked', false);\n });\n\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n if ($('input[name=\"phone\"]', $form).length > 0) {\n $('input[name=\"phone\"]', $form).get(0).addEventListener(\"countrychange\", function () {\n formData.phone = $(this).val();\n rf = $form.data('validationEngine');\n rf.validate('phone');\n });\n }\n if ($('input[name=\"mobilephone\"]', $form).length > 0) {\n $('input[name=\"mobilephone\"]', $form).get(0).addEventListener(\"countrychange\", function () {\n formData.mobilephone = $(this).val();\n rf = $form.data('validationEngine');\n rf.validate('mobilephone');\n });\n }\n }\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.RegisterSuccess, form, form.onSuccess);\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.RegisterFailure, form, form.onFailure);\n\n Vendd.MessageBus.subscribe(Vendd.Plugins.Messages.RecaptcaLoaded, form, form.initRecaptcha);\n\n Vendd.MessageBus.subscribe(Vendd.Loyalty.Messages.CheckByMobileSuccess, form, function (envelope) {\n var data = envelope.message.data;\n\n //if status 409 mobile exists in multiple members\n if (data.StatusCode === 409) {\n var loyaltyErrorWrapper = $loyaltyErrorWrapper.get(0);\n $('.js-error', loyaltyErrorWrapper).html(data.ResponseMessage).show();\n $loyaltyErrorWrapper.show(); \n\n return;\n }\n\n form.setIsRegistered(data.StatusCode === 200);\n sessionStorage.setItem('LoyaltyMobilePhone', formData.mobilephone);\n window.location = window.location.origin + data.LoyaltyRegistrationUrl;\n });\n\n Vendd.MessageBus.subscribe(Vendd.Loyalty.Messages.CheckByMobileFailure, form, function () {\n form.loading(false);\n toastr.error('Something went wrong');\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.LoginSuccess, form, function (envelope) {\n\n if (formData.registerToLoyalty || formData.alreadyRegisteredToLoyalty)\n return;\n\n var returnUrl = decodeURIComponent(LhApp.Function.QueryString.getValueOf('ReturnUrl', window.location.href));\n if (returnUrl) document.location.href = returnUrl;\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetMemberByLoyaltyNumberSuccess, form, function (envelope) {\n var data = envelope.message.data.model.data;\n if (data.ErrorCode) {\n $('.loyaltyMemberCardNumber-invalid', $form).show().closest('.form-row').addClass('with-error');\n loyaltyMemberCardNumberIsValid = false;\n }\n else {\n $('.loyaltyMemberCardNumber-invalid', $form).hide().closest('.form-row').removeClass('with-error');\n loyaltyMemberCardNumberIsValid = true;\n }\n $('.js-submit-button', $form).removeAttr('disabled');\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetMemberByLoyaltyNumberFailed, form, function (envelope) {\n var message = envelope.message.data.model.message;\n toastr.error(message);\n loyaltyMemberCardNumberIsValid = false;\n $('.js-submit-button', $form).removeAttr('disabled');\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetAreasForPostCodeSuccess, form, form.getAreasForPostCode);\n\n Vendd.MessageBus.publishAsync(form, new Vendd.Widget.Messages.BindControl($form));\n\n});\n","Vendd.Scripts.load(function () {\n\n var $form = $('.x-registration-form-sso'), $submitButton, form, formData, $loyaltyErrorWrapper = $('.loyalty-error-container'),\n loyaltyRegistrationUrl;\n\n if ($form.length < 1)\n return;\n\n var loyaltyMemberCardNumberIsValid = true, loyaltyMemberCardNumberIsEnabled = $form.data('loyaltymembercardnumberisenabled');\n\n $submitButton = $('.js-submit-button', $form);\n\n form = $form.get(0);\n\n importEmailForRegistration();\n\n formData = {\n \"title\": $(\"option:selected\", 'select[name=title]').text(),\n \"newsletter\": false,\n \"redirectUrl\": $form.data('redirect') || \"\",\n \"phone\": $('input[name=\"phone\"]').val(),\n \"mobilePhone\": \"\", //$('input[name=\"mobilePhone\"]').val()\n \"socialSecurityNumber\": $('input[name=\"socialSecurityNumber\"]').val(),\n \"registerToLoyalty\": false,\n \"isLoyaltyMember\": false,\n \"loyaltyRequest\": false,\n \"loyaltyMemberId\": \"\",\n \"alreadyRegisteredToLoyalty\": false,\n \"loyaltyMemberCardNumber\": \"\",\n \"postalCode\": \"\"\n };\n\n var areas = [];\n\n form.getAreasForPostCode = function (envelope) {\n\n areas = envelope.message.data;\n\n //validate postal code.\n if (valOpts.postalCode && valOpts.postalCode.isValidPostalCode) {\n valOpts.postalCode.isValidPostalCode.config.areas = areas;\n }\n rf.validateField(\"postalCode\");\n };\n\n form.loading = function (loading) {\n if (loading) {\n $form.addClass('x-loading');\n } else {\n $form.removeClass('x-loading');\n }\n };\n\n form.onSuccess = function (envelope) {\n form.loading(false);\n\n var response = envelope.message.data;\n if (response.success && response.code === \"Registration_OperationSuccesful\") {\n $('.js-error', $form).hide();\n $('.js-content', $form).hide();\n\n var isLoyaltyActivated = (formData.alreadyRegisteredToLoyalty || formData.registerToLoyalty);\n if (isLoyaltyActivated && formData.mobilePhone) {\n loyaltyRegistrationUrl = response.data.LoyaltyRegistrationUrl;\n Vendd.MessageBus.publishAsync(Vendd.Loyalty, new Vendd.Loyalty.Messages.CheckByMobile(formData.mobilePhone));\n } else {\n $('.js-success', $form).show();\n }\n\n $('.js-success', $form).show();\n\n $('html,body').animate({scrollTop: 0}, 300);\n\n /* Track User Registration */\n if (typeof fbPixelTracker !== 'undefined' && typeof fbPixelCanTrack !== 'undefined') {\n if (fbPixelTracker && fbPixelTracker.Properties.FacebookPixelId && fbPixelCanTrack) {\n fbq('track', 'CompleteRegistration');\n }\n }\n /* END Track User Registration */\n\n } else {\n\n $('.js-error', $form).show();\n $('html,body').animate({scrollTop: $('.js-error', $form).offset().top - 100}, 300);\n\n }\n };\n\n form.onFailure = function (envelope) {\n form.loading(false);\n\n $('.js-error', $form).show();\n $('html,body').animate({scrollTop: $('.js-error', $form).offset().top - 100}, 300);\n };\n\n form.submit = function () {\n form.loading(true);\n\n formData.newsletter = $('#chkNewsletter').prop(\"checked\");\n formData.registerToLoyalty = $('#chkRegisterToLoyaltyPoints').prop(\"checked\");\n formData.alreadyRegisteredToLoyalty = $('#chkAlreadyRegisteredToLoyaltyPoints').prop(\"checked\");\n\n formData.isLoyaltyMember = $('#isLoyaltyMember').prop(\"checked\");\n formData.loyaltyRequest = $('#loyaltyRequest').prop(\"checked\");\n\n $('input:not([type=\"checkbox\"]), textarea:not([name=\"g-recaptcha-response\"])', $form).each(function () {\n formData[$(this).attr('name')] = $(this).val();\n });\n\n Vendd.MessageBus.publishAsync(\n form,\n new Vendd.User.Messages.CompleteSsoRegistration(\n formData.newsletter,\n formData.redirectUrl,\n formData.phone,\n formData.mobilePhone,\n formData.socialSecurityNumber,\n formData.isLoyaltyMember,\n formData.loyaltyRequest,\n formData.loyaltyMemberId,\n formData.loyaltyMemberCardNumber,\n formData.postalCode\n )\n );\n };\n\n form.reset = function () {\n $('.js-error', $form).hide();\n $('.js-success', $form).hide();\n $('.js-content', $form).show();\n\n $('input[name=\"phone\"]', $form).val(\"\");\n $('input[name=\"mobilePhone\"]', $form).val(\"\");\n $('input[name=\"socialSecurityNumber\"]', $form).val(\"\");\n $('input[name=\"loyaltyMemberCardNumber\"]', $form).val(\"\");\n $('input[name=\"postalCode\"]', $form).val(\"\");\n rf.reset();\n };\n\n $(\".js-datepicker\", $form).datepicker({\n changeMonth: true,\n changeYear: true,\n yearRange: \"-100:+0\",\n maxDate: \"0\"\n });\n\n form.setIsRegistered = function (isRegistered) {\n sessionStorage.setItem('LoyaltyIsRegistered', isRegistered);\n };\n\n var valOpts = {\n phone: {\n required: 'phone-required'\n },\n mobilePhone: {\n required: 'mobilePhone-required'\n },\n /*postalCode: {\n isValidPostalCode: { validator: 'postalCode-invalid', config: {country: 'GR', areas: areas } }\n }*/\n };\n\n if ($('input[name=\"postalCode\"]', $form).length > 0 && $('.postalCode-required', $form).length > 0) {\n _.extend(valOpts.postalCode, {required: 'postalCode-required'});\n }\n\n if ($('input[name=\"socialSecurityNumber\"]', $form).length > 0) {\n valOpts.socialSecurityNumber = {\n isSocialSecurityNumber: 'social-security-number'\n };\n }\n\n var prevLoyaltyMemberCardNumber = '';\n\n if (loyaltyMemberCardNumberIsEnabled) {\n $('input[name=\"loyaltyMemberCardNumber\"]', $form).on('blur', function () {\n var loyaltyMemberCardNumber = $(this).val();\n var $formRow = $(this).closest('.form-row');\n loyaltyMemberCardNumber = loyaltyMemberCardNumber.replace(/\\s/g, '');\n $(this).val(loyaltyMemberCardNumber);\n if (loyaltyMemberCardNumber == '') {\n $('.loyaltyMemberCardNumber-invalid', $formRow).hide();\n $formRow.removeClass('with-error');\n loyaltyMemberCardNumberIsValid = true;\n } else {\n if (loyaltyMemberCardNumber != prevLoyaltyMemberCardNumber) {\n $('.js-submit-button', $form).attr('disabled', 'disabled');\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.GetMemberByLoyaltyNumber(loyaltyMemberCardNumber));\n prevLoyaltyMemberCardNumber = loyaltyMemberCardNumber;\n }\n }\n });\n }\n\n //Validate Phone only if config parameter is true\n if (venddProjectConfigs.Registration.GreekPhoneValidation) {\n _.extend(valOpts.phone, {isGreekPhone: 'phone-invalid'});\n } else {\n _.extend(valOpts.phone, {isPhoneNumber: 'phone-invalid'});\n }\n\n //Validate Mobile only if config parameter is true\n if (venddProjectConfigs.Registration.GreekMobileValidation) {\n _.extend(valOpts.mobilePhone, {isGreekMobile: 'mobilePhone-invalid'});\n } else {\n _.extend(valOpts.mobilePhone, {isPhoneNumber: 'mobilePhone-invalid'});\n }\n\n //add consent validations\n $.each($('div.consent.checkbox[data-required]', $form), function (e, el) {\n var consentType = $('input', el).attr('name');\n valOpts[consentType] = {\n checkboxRequired: consentType + '-required'\n };\n });\n\n var clickedCheckbox;\n var loyaltyCheckboxes = $('.js-loyalty-checkbox .checkbox-wrapper input', $form);\n loyaltyCheckboxes.removeAttr('disabled');\n\n $('.consent-wrapper', $form).each(function (e, el) {\n var $chkbx = $('.checkbox-wrapper > input', el);\n\n $chkbx.off('click').on('click', function () {\n var $this = $(this);\n\n if (!$this.is(':checked')) {\n var fieldName = $this.attr('name');\n\n formData[fieldName] = $this.is(':checked');\n rf = $form.data('validationEngine');\n rf.validate(fieldName);\n return;\n }\n\n var $text = $('.consent-text-wrapper', el);\n $.fancybox.open($text, {\n maxWidth: 900,\n padding: 0,\n modal: true,\n afterShow: function () {\n var consentForm = $('.js-consent-form');\n //var scrollContForm = $('.js-scrollbar', consentForm);\n var closeButton = $('.js-consent-decline-button', consentForm);\n var acceptButton = $('.js-consent-accept-button', consentForm);\n\n //scrollContForm.mCustomScrollbar({\n // scrollbarPosition: \"outside\",\n // scrollInertia: 400,\n // timeout: 1000,\n // theme: \"dark-2\",\n // mouseWheel: {preventDefault: true},\n // callbacks: {\n // onTotalScrollOffset: 25,\n // onTotalScroll: function () {\n // consentForm.addClass('has-scrolled');\n // $('.js-consent-accept-button', consentForm).prop('disabled', false);\n // $('.js-tooltip', consentForm).addClass('hidden');\n // },\n // onInit: function () {\n // $('.js-scroll-btn', consentForm).addClass('show');\n // },\n // onCreate: function () {\n // setTimeout(function () {\n // if (scrollContForm.hasClass('mCS_no_scrollbar')) {\n // consentForm.addClass('has-scrolled');\n // $('.js-consent-accept-button', consentForm).prop('disabled', false);\n // $('.js-tooltip', consentForm).addClass('hidden');\n // }\n // }, 100);\n // }\n // }\n //});\n\n //$('.js-scroll-btn', consentForm).click(function () {\n // scrollContForm.mCustomScrollbar('scrollTo', '-=' + (scrollContForm.height()));\n //});\n\n closeButton.off('click').on('click', function () {\n //clickedCheckbox.prop(\"checked\", false);\n //$this.prop(\"checked\", false);\n $.fancybox.close(true);\n });\n acceptButton.off('click').on('click', function () {\n //clickedCheckbox.prop(\"checked\", true);\n //$this.prop(\"checked\", true);\n $.fancybox.close(true);\n });\n },\n afterClose: function () {\n\n var fieldName = $this.attr('name');\n\n formData[fieldName] = $this.is(':checked');\n rf = $form.data('validationEngine');\n rf.validate(fieldName);\n },\n });\n });\n });\n\n loyaltyCheckboxes.click(function (e) {\n clickedCheckbox = $(this);\n $('.consent-wrapper.loyalty .checkbox-wrapper > input', $form).trigger('click');\n });\n\n $form.validationEngine(valOpts);\n var rf = $form.data('validationEngine');\n\n var val3 = true;\n $form.on('click', '.js-submit-button', function (e) {\n valOpts = $form.validationEngine();\n\n $form.validationEngine(valOpts);\n rf = $form.data('validationEngine');\n\n e.preventDefault();\n e.stopPropagation();\n\n var val1 = true;//form.validateRecaptcha();\n var val2 = rf.validate();\n\n if (val1 && val2 && val3 && loyaltyMemberCardNumberIsValid) {\n if (LhApp.Context.IsConsentsEnabled) {\n form.checkConsents();\n } else {\n form.submit();\n }\n } else {\n if ($('.form-row.with-error', $form).length > 0) {\n $('html,body').animate({scrollTop: $('.form-row.with-error', $form).first().offset().top - 100}, 600);\n }\n }\n });\n\n form.checkConsents = function () {\n var data = [];\n var checkboxes = $('.form-row.consent.checkbox');\n $.each(checkboxes, function (e, el) {\n var chkbx = $('.checkbox-wrapper input', el);\n data.push({type: chkbx.attr('id'), source: 'Registration Form', approved: chkbx.prop(\"checked\")});\n });\n\n if (data.length > 0) {\n window.ConsentsManager.insertConsents(data);\n } else {\n form.submit();\n }\n };\n\n $form.on('change', 'select[name]', function (e) {\n form.setField($(this));\n });\n\n $form.on('change', '.js-datepicker', function (e) {\n $(this).trigger('keyup');\n });\n\n $form.on('keyup', 'input[name]:not([type=\"checkbox\"]), textarea[name]', function (e) {\n if (e.keyCode === 13) {\n e.preventDefault();\n e.stopPropagation();\n\n $submitButton.click();\n\n return;\n }\n\n if ($(this).attr('name') === \"postalCode\") {\n removeWhiteSpaces($(this));\n }\n\n form.setField($(this));\n });\n\n $form.on('keyup', 'input[name = \"postalCode\"]', $.debounce(400, function () {\n var $this = $(this);\n var postalCode = $this.val();\n\n if (postalCode === null) return;\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.GetAreasForPostCode(\"GR\", postalCode, \"\"));\n }));\n\n $form.on('blur', 'input[name]:not([type=\"checkbox\"]), textarea[name]', function (e) {\n form.setField($(this));\n });\n\n form.setField = function (field) {\n var fieldName = field.attr('name');\n rf.validate(fieldName);\n };\n\n $form.on('click', 'input.single-check', function () {\n $('input.single-check').not(this).prop('checked', false);\n formData.registerToLoyalty = $('#chkRegisterToLoyaltyPoints').prop(\"checked\");\n formData.alreadyRegisteredToLoyalty = $('#chkAlreadyRegisteredToLoyaltyPoints').prop(\"checked\");\n var isLoyaltyRegistered = formData.registerToLoyalty || formData.alreadyRegisteredToLoyalty;\n $('.consent-wrapper', $form).each(function (e, el) {\n var $chkbx = $('.checkbox-wrapper input', el);\n var chkbxId = $chkbx.attr('id');\n if (chkbxId != undefined && chkbxId != \"\") {\n valOpts = $form.validationEngine();\n formData[chkbxId] = $chkbx.prop(\"checked\");\n valOpts[chkbxId] = isLoyaltyRegistered ? {checkboxRequired: (chkbxId + '-required')} : {};\n $form.validationEngine(valOpts);\n }\n if (isLoyaltyRegistered) {\n $form.data('validationEngine').removeField(chkbxId);\n $form.data('validationEngine').addField(JSON.parse(\"{\\\"\" + chkbxId + \"\\\" : { \\\"checkboxRequired\\\" : \\\"\" + chkbxId + \"-required\\\" }}\"));\n $chkbx.prop(\"checked\", true);\n } else {\n $('.' + chkbxId + '-required', $form).removeClass(\"error\");\n $form.data('validationEngine').removeField(chkbxId);\n $chkbx.prop(\"checked\", false);\n }\n });\n });\n\n $form.on('click', '.js-clear-loyalty', function () {\n $('input.single-check:checked').prop('checked', false);\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.RegisterSuccess, form, form.onSuccess);\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.RegisterFailure, form, function (envelope) {\n form.onFailure(envelope);\n });\n\n Vendd.MessageBus.subscribe(Vendd.Loyalty.Messages.CheckByMobileSuccess, form, function (envelope) {\n var data = envelope.message.data;\n\n //if status 409 mobile exists in multiple members\n if (data.StatusCode === 409) {\n var loyaltyErrorWrapper = $loyaltyErrorWrapper.get(0);\n $('span.error-message', loyaltyErrorWrapper).html(data.ResponseMessage);\n $loyaltyErrorWrapper.show();\n\n return;\n }\n\n form.setIsRegistered(data.StatusCode === 200);\n sessionStorage.setItem('LoyaltyMobilePhone', formData.mobilePhone);\n window.location = window.location.origin + data.LoyaltyRegistrationUrl;\n });\n\n Vendd.MessageBus.subscribe(Vendd.Loyalty.Messages.CheckByMobileFailure, form, function () {\n form.loading(false);\n toastr.error('Something went wrong');\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.LoginSuccess, form, function (envelope) {\n if (formData.registerToLoyalty || formData.alreadyRegisteredToLoyalty)\n return;\n\n var returnUrl = decodeURIComponent(LhApp.Function.QueryString.getValueOf('ReturnUrl', window.location.href));\n if (returnUrl) document.location.href = returnUrl;\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetMemberByLoyaltyNumberSuccess, form, function (envelope) {\n var data = envelope.message.data.model.data;\n if (data.ErrorCode) {\n $('.loyaltyMemberCardNumber-invalid', $form).show().closest('.form-row').addClass('with-error');\n loyaltyMemberCardNumberIsValid = false;\n } else {\n $('.loyaltyMemberCardNumber-invalid', $form).hide().closest('.form-row').removeClass('with-error');\n loyaltyMemberCardNumberIsValid = true;\n }\n $('.js-submit-button', $form).removeAttr('disabled');\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetMemberByLoyaltyNumberFailed, form, function (envelope) {\n var message = envelope.message.data.model.message;\n toastr.error(message);\n loyaltyMemberCardNumberIsValid = false;\n $('.js-submit-button', $form).removeAttr('disabled');\n });\n\n Vendd.MessageBus.subscribe(Vendd.Consents.Messages.InsertConsents, form, form.submit);\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetAreasForPostCodeSuccess, form, form.getAreasForPostCode);\n\n});\n","Vendd.Scripts.load(function () {\n\n var $form = $('.x-registration-b2b-form'), form, formData;\n\n if ($form.length < 1) return;\n\n form = $form.get(0);\n\n //get verification token\n var token = getQueryStringValueByName(\"vtoken\");\n if (token.length > 0) {\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-content', $form).hide();\n $('.js-success', $form).show();\n $('.js-need-verification', $form).hide();\n\n //clear user model\n Vendd.User.ClearClientModel();\n //redirect\n window.location = '/';\n }\n\n importEmailForRegistration();\n\n formData = {\n companyName: \"\",\n occupation: \"\",\n taxAgency: $('select[name=\"taxAgency\"]').val() || \"\",\n taxIdentifier: \"\",\n officerName: \"\",\n vatstatus: 0,\n email: $('input[name=\"email\"]').val().trim() || \"\",\n emailConfirmation: \"\",\n username: \"\",\n\n town: \"\",\n address: \"\",\n number: \"\",\n postalCode: \"\",\n phone: \"\",\n password: \"\",\n passwordConfirmation: \"\",\n\n storesNumber: \"\",\n phoneTwo: \"\",\n mobile: \"\",\n socialSecurityNumber: \"\",\n fax: \"\",\n siteUrl: \"\",\n message: \"\",\n\n newsletter: false,\n reCaptchaCode: \"\",\n redirectUrl: $form.data('redirect') || \"\",\n acceptTerms: false,\n\n store: \"\",\n CompanyCategory: \"\",\n OpeningHours: \"\",\n area: $('select[name=\"area\"]').val() || \"\",\n prefecture: \"\",\n ReceiveEinvoice: null,\n officerLastName: \"\",\n officerPosition: \"\",\n\n countryCode: $('select[name=\"countryCode\"]').val() || LhApp.Context.Country,\n\n registrationSetData: registrationSetData || null\n };\n\n var useEmailAsLoginName = $form.data('useemailasloginname').toString().toLowerCase() === 'true';\n var areaAutoCompleteEnabled = $form.data('areaautocomplete').toString().toLowerCase() === 'true';\n var invoiceAutoCompleteEnabled = $form.data('invoiceautocomplete').toString().toLowerCase() === 'true';\n var verifyemail = $form.data('verifyemail').toString().toLowerCase() === 'true';\n\n var areaLabel = $form.data('arealabel');\n var areas = [];\n var selectedCountry = $('.js-countries-selector option:selected', $form);\n var areasCount = selectedCountry.length > 0 ? selectedCountry.data('areascount') : 0;\n var isEUCountry = selectedCountry.length > 0 ? selectedCountry.data('eucountry').toString().toLowerCase() === 'true' : false;\n var initialAjaxCall = true;\n var registrationSetData = [];\n\n // reCAPTCHA\n var captchaWidgetId;\n var captchaId = \"registrationCaptcha\";\n var $captchaElement = $form.find(\"#\" + captchaId);\n var $captchaContainer = $form.find('.recaptcha-container');\n var captchaEnabled = $captchaElement.length > 0 ? true : false;\n\n form.initRecaptcha = function () {\n\n if (!captchaEnabled)\n return;\n\n var sitekey = $captchaElement.data(\"sitekey\");\n if (sitekey) {\n captchaEnabled = true;\n captchaWidgetId = grecaptcha.render(captchaId, {\n 'sitekey': sitekey,\n 'callback': form.recaptchaCallback\n });\n }\n };\n\n form.validateRecaptcha = function () {\n if (!captchaEnabled)\n return true;\n\n formData.reCaptchaCode = $captchaElement.find('.g-recaptcha-response').val();\n\n var res = false;\n\n if (formData.reCaptchaCode) {\n $captchaContainer.find('.recaptcha-required').removeClass('error');\n res = true;\n }\n else {\n $captchaContainer.find('.recaptcha-required').addClass('error');\n }\n\n return res;\n };\n\n form.resetRecaptcha = function () {\n // Website must only verify the user's reCAPTCHA response token (g-recaptcha-response) once.\n // If a verify attempt has been made with a particular token, it cannot be used again.\n // Call grecaptcha.reset() to ask the end user to verify with reCAPTCHA again.\n if (captchaEnabled)\n grecaptcha.reset(captchaWidgetId);\n };\n\n form.removeRecaptcha = function () {\n $captchaElement.remove();\n };\n\n form.recaptchaCallback = function () {\n form.validateRecaptcha();\n };\n\n form.getAreasForPostCode = function (envelope) {\n\n areas = envelope ? envelope.message.data : [];\n\n var html = Vendd.Handlebars.parse(\"registrationB2BArea_A\", areas);\n $('.form-row.area .js-area-wrapper').html(html);\n\n //add new validation for area select\n var valOptArea = { area: { required: 'area-required' } };\n rf.removeField(\"area\");\n rf.addField(valOptArea);\n\n if (areas.length < 1) {\n $('.form-row.area').removeClass('select');\n $('.form-row.area label').empty().append(areaLabel);\n\n } else {\n $('.form-row.area').addClass('select');\n\n //submit value in formData\n if (areas.length === 1) {\n formData.area = areas[0].Name;\n rf.validate(\"area\");\n }\n\n //if City exists, submit the value in formData\n if (areas.length > 0 && areas[0].City.length > 0) {\n $('input[name = \"town\"]:text').val(areas[0].City);\n formData.town = areas[0].City;\n }\n }\n\n //validate postal code\n if (areaAutoCompleteEnabled && areasCount > 1)\n valOpts.postalCode.isValidPostalCode.config.areas = areas;\n };\n\n form.updatePostalCode = function (countryCode) {\n //delete validations related to country\n if (valOpts.postalCode && valOpts.postalCode.isValidPostalCode)\n delete valOpts.postalCode.isValidPostalCode;\n\n selectedCountry = $('.js-countries-selector option:selected', $form);\n areasCount = selectedCountry.length > 0 ? selectedCountry.data('areascount') : 0;\n\n //add validation\n if (areaAutoCompleteEnabled && areasCount > 1) {\n valOpts.postalCode = valOpts.postalCode || {};\n _.extend(valOpts.postalCode, { isValidPostalCode: { validator: 'postalCode-invalid', config: { country: countryCode, areas: areas } } });\n }\n \n //update validation field\n if (valOpts.postalCode) {\n var valOptPostalCode = { postalCode: valOpts.postalCode };\n rf.removeField(\"postalCode\");\n rf.addField(valOptPostalCode);\n }\n };\n\n form.setRegistrationData = function () {\n\n var $sets = $('.js-registration-set', $form);\n\n if ($sets.length < 1) return;\n\n //init array\n registrationSetData = [];\n\n $.each($sets, function (e, set) {\n var $set = $(set);\n\n var setData = {\n Name: $set.data('set-name'),\n Id: $set.data('set-id'),\n Values: []\n }\n\n $.each($('input[type=\"checkbox\"]', $set), function (e, input) {\n if ($(input).is(':checked')) {\n var setValues = {\n Id: $(input).data('id'),\n Name: $(input).data('name')\n }\n\n setData.Values.push(setValues);\n }\n });\n\n if (setData.Values.length > 0)\n registrationSetData.push(setData);\n });\n\n if (registrationSetData.length > 0)\n formData.registrationSetData = registrationSetData;\n };\n\n form.loading = function (loading) {\n if (loading) {\n $form.addClass('x-loading');\n } else {\n $form.removeClass('x-loading');\n }\n };\n\n form.onSuccess = function (envelope) {\n form.loading(false);\n\n var response = envelope.message.data;\n\n if (response.success && response.code === \"Registration_OperationSuccesful\") {\n //insert consents after registration success\n if (LhApp.Context.IsConsentsEnabled) {\n form.checkConsents();\n }\n\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-content', $form).hide();\n $('.js-need-verification', $form).hide();\n $('.js-success', $form).hide();\n\n if (verifyemail) {\n $('.js-need-verification', $form).show();\n } else {\n $('.js-success', $form).show();\n }\n\n $('html,body').animate({ scrollTop: 0 }, 300);\n\n form.removeRecaptcha();\n\n /* Track User Registration */\n if (typeof fbPixelTracker !== 'undefined' && typeof fbPixelCanTrack !== 'undefined') {\n if (fbPixelTracker && fbPixelTracker.Properties.FacebookPixelId && fbPixelCanTrack) {\n fbq('track', 'CompleteRegistration');\n }\n }\n /* END Track User Registration */\n\n } else {\n\n if (response.code === 'Registration_EmailExists') {\n $('.js-error', $form).hide();\n $('.js-exists', $form).show();\n $('html,body').animate({ scrollTop: $('.js-exists', $form).offset().top - 100 }, 300);\n } else {\n $('.js-exists', $form).hide();\n $('.js-error', $form).show();\n $('html,body').animate({ scrollTop: $('.js-error', $form).offset().top - 100 }, 300);\n }\n\n form.resetRecaptcha();\n }\n };\n\n form.onFailure = function (envelope) {\n form.hideLoader();\n\n var response = envelope.message.data;\n if (response === 'Registration_EmailExists') {\n $('.js-error', $form).hide();\n $('.js-exists', $form).show();\n $('html,body').animate({ scrollTop: $('.js-exists', $form).offset().top - 100 }, 300);\n } else {\n $('.js-exists', $form).hide();\n $('.js-error', $form).show();\n $('html,body').animate({ scrollTop: $('.js-error', $form).offset().top - 100 }, 300);\n }\n\n form.resetRecaptcha();\n };\n\n $('input[name=\"taxIdentifier\"]').keyup(function () {\n $('input[name=\"username\"]').val($(this).val());\n });\n\n form.submit = function () {\n form.loading(true);\n\n formData.vatstatus = $('select[name=\"vatstatus\"]').val();\n formData.newsletter = $('#chkNewsletter').prop(\"checked\");\n\n var einvoiceVal = $(\"input:radio[name='einvoice']:checked\").val();\n\n if (einvoiceVal === \"true\") {\n formData.ReceiveEinvoice = true;\n } else if (einvoiceVal === \"false\") {\n formData.ReceiveEinvoice = false;\n } else {\n formData.ReceiveEinvoice = null;\n }\n\n formData.username = formData.taxIdentifier;\n\n form.setRegistrationData();\n\n $('input:not([type=\"checkbox\"]), textarea:not([name=\"g-recaptcha-response\"]), select', $form).each(function () {\n if ($(this).attr('name') === 'email' || $(this).attr('name') === 'emailConfirmation') {\n formData[$(this).attr('name')] = $(this).val().trim();\n } else {\n formData[$(this).attr('name')] = $(this).val();\n }\n });\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.B2BRegister(\n formData.companyName,\n formData.occupation,\n formData.taxAgency,\n formData.taxIdentifier,\n formData.officerName,\n formData.vatstatus,\n formData.email,\n formData.emailConfirmation,\n formData.username,\n formData.town,\n formData.address,\n formData.number,\n formData.postalCode,\n formData.phone,\n formData.password,\n formData.passwordConfirmation,\n formData.storesNumber,\n formData.phoneTwo,\n formData.mobile,\n formData.socialSecurityNumber,\n formData.fax,\n formData.siteUrl,\n formData.store,\n formData.CompanyCategory,\n formData.OpeningHours,\n formData.area,\n formData.prefecture,\n formData.officerLastName,\n formData.officerPosition,\n formData.message,\n formData.newsletter,\n formData.ReceiveEinvoice,\n formData.reCaptchaCode,\n formData.redirectUrl,\n formData.countryCode,\n formData.registrationSetData));\n };\n\n form.reset = function () {\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-success', $form).hide();\n $('.js-need-verification', $form).hide();\n $('.js-content', $form).show();\n\n $('input[name=\"companyName\"]', $form).val(\"\");\n $('input[name=\"occupation\"]', $form).val(\"\");\n $('input[name=\"taxAgency\"]', $form).val(\"\");\n $('input[name=\"taxIdentifier\"]', $form).val(\"\");\n $('input[name=\"officerName\"]', $form).val(\"\");\n $('input[name=\"vatstatus\"]', $form).val(\"\");\n $('input[name=\"email\"]', $form).val(\"\");\n $('input[name=\"emailConfirmation\"]', $form).val(\"\");\n $('input[name=\"username\"]', $form).val(\"\");\n $('input[name=\"town\"]', $form).val(\"\");\n $('input[name=\"address\"]', $form).val(\"\");\n $('input[name=\"number\"]', $form).val(\"\");\n $('input[name=\"postalCode\"]', $form).val(\"\");\n\n $('input[name=\"phone\"]', $form).val(\"\");\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n $('select[name=\"storesNumber\"]', $form).val(\"\");\n $('input[name=\"phoneTwo\"]', $form).val(\"\");\n $('input[name=\"mobile\"]', $form).val(\"\");\n $('input[name=\"socialSecurityNumber\"]', $form).val(\"\");\n\n $('input[name=\"fax\"]', $form).val(\"\");\n $('input[name=\"siteUrl\"]', $form).val(\"\");\n $('input[name=\"message\"]', $form).val(\"\");\n $('input[name=\"store\"]', $form).val(\"\");\n $('input[name=\"CompanyCategory\"]', $form).val(\"\");\n $('input[name=\"OpeningHours\"]', $form).val(\"\");\n $('input[name=\"area\"]', $form).val(\"\");\n $('select[name=\"area\"]', $form).val(\"\");\n $('input[name=\"prefecture\"]', $form).val(\"\");\n\n $('input[name=\"officerLastName\"]', $form).val(\"\");\n $('input[name=\"officerPosition\"]', $form).val(\"\");\n\n rf.reset();\n };\n\n form.resetAddressFields = function () {\n\n $('input[name=\"address\"]', $form).val(\"\");\n $('input[name=\"number\"]', $form).val(\"\");\n $('input[name=\"postalCode\"]', $form).val(\"\");\n $('input[name=\"town\"]', $form).val(\"\");\n $('input[name=\"area\"]', $form).val(\"\");\n $('select[name=\"area\"]', $form).val(\"\");\n $('input[name=\"prefecture\"]', $form).val(\"\");\n\n form.getAreasForPostCode();\n\n };\n\n form.updatePasswordBar = function (field) {\n var value = field.val();\n var score = Vendd.Helpers.textStrength(value);\n\n var $passwordStrength = $('#chkPassLabel, #chkPassText');\n\n $passwordStrength.removeClass(function (i, css) {\n return (css.match(/(^|\\s)level\\S+/g) || []).join(' ');\n }).addClass('level' + score); \n };\n\n $.fn.validationEngine.validations.passwordStrength = Vendd.Validations.passwordStrength;\n\n //init validation options\n var valOpts = {}, initialValidation = false;\n\n //add required validations\n $.each($('input[data-required], textarea[data-required], select[data-required]', $form), function (e, el) {\n var inputName = $(el).attr('name');\n valOpts[inputName] = { required: inputName + '-required' };\n });\n\n //add consent validations\n $.each($('.consent.checkbox[data-required]', $form), function (e, el) {\n var consentType = $('input', el).attr('name');\n valOpts[consentType] = { checkboxRequired: consentType + '-required' };\n });\n\n //add AFM validation only if config parameter is true\n if (venddProjectConfigs.TaxIdentifierValidationEnabled && $('input[name=\"taxIdentifier\"]', $form).length > 0) {\n valOpts.taxIdentifier = valOpts.taxIdentifier || {};\n if (invoiceAutoCompleteEnabled && isEUCountry) {\n _.extend(valOpts.taxIdentifier, { isServiceValidTaxIdentifier: { validator: 'taxIdentifier-invalid', config: { isValid: true } } });\n } else {\n if (formData.countryCode === \"GR\")\n _.extend(valOpts.taxIdentifier, { isGreekTaxIdentifier: 'taxIdentifier-invalid' });\n }\n }\n\n //add email validation\n if ($('input[name=\"email\"]', $form).length > 0) {\n valOpts.email = valOpts.email || {};\n _.extend(valOpts.email, { isEmail: 'email-invalid' });\n }\n\n //add email confirmation validation\n if ($('input[name=\"emailConfirmation\"]', $form).length > 0) {\n valOpts.emailConfirmation = valOpts.emailConfirmation || {};\n _.extend(valOpts.emailConfirmation, { isEmail: 'emailConfirmation-invalid', match: { validator: 'emailConfirmation-match', matchField: 'email' } });\n }\n\n //add phone validation\n if ($('input[name=\"phone\"]', $form).length > 0) {\n valOpts.phone = valOpts.phone || {};\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n _.extend(valOpts.phone, { isValidPhoneLocalized: { validator: 'phone-invalid', config: { type: 'phone' } } });\n } else {\n if (venddProjectConfigs.Registration.GreekPhoneValidation) {\n _.extend(valOpts.phone, { isGreekPhone: 'phone-invalid' });\n } else {\n _.extend(valOpts.phone, { isPhoneNumber: 'phone-invalid' });\n }\n }\n }\n\n //add mobile validation\n if ($('input[name=\"mobile\"]', $form).length > 0) {\n valOpts.mobile = valOpts.mobile || {};\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n _.extend(valOpts.mobile, { isValidPhoneLocalized: { validator: 'mobile-invalid', config: { type: 'mobile' } } });\n } else {\n if (venddProjectConfigs.Registration.GreekMobileValidation) {\n _.extend(valOpts.mobile, { isGreekMobile: 'mobile-invalid' });\n } else {\n _.extend(valOpts.mobile, { isPhoneNumber: 'mobile-invalid' });\n }\n }\n }\n\n //add password strength validation\n if ($('input[name=\"password\"]', $form).length > 0) {\n valOpts.password = valOpts.password || {};\n _.extend(valOpts.password, { passwordStrength: { validator: 'password-weak', config: { limit: $form.data('pwdstrength') } } });\n }\n\n //add confirmation password match validation\n if ($('input[name=\"passwordConfirmation\"]', $form).length > 0) {\n valOpts.passwordConfirmation = valOpts.passwordConfirmation || {};\n _.extend(valOpts.passwordConfirmation, { match: { validator: 'passwordConfirmation-match', matchField: 'password' } });\n }\n\n //add social security number validation\n if ($('input[name=\"socialSecurityNumber\"]', $form).length > 0) {\n valOpts.socialSecurityNumber = { isSocialSecurityNumber: 'socialSecurityNumber-invalid' };\n }\n \n //add postalCode validation only if config parameter is true and selected country has areas\n if (areaAutoCompleteEnabled && areasCount > 1) {\n valOpts.postalCode = valOpts.postalCode || {};\n _.extend(valOpts.postalCode, { isValidPostalCode: { validator: 'postalCode-invalid', config: { country: formData.countryCode, areas: areas } } });\n }\n\n $form.validationEngine(valOpts);\n var rf = $form.data('validationEngine');\n\n $.each($('.consent.checkbox[data-required]', $form), function (e, el) {\n var consentType = $('input', el);\n consentType.on('change', function () {\n rf.validate(consentType.attr('name'));\n });\n });\n\n $form.on('click', '.js-submit-button', function (e) {\n\n e.preventDefault();\n e.stopPropagation();\n\n var val1 = form.validateRecaptcha();\n var val2 = rf.validate();\n\n if (val1 && val2) {\n form.submit();\n } else {\n if ($('.form-row.with-error', $form).length > 0) {\n $('.registration-page .region-area-two').animate({ scrollTop: $(\".form-row.with-error\").get(0).offsetTop - 30 }, 600);\n }\n }\n\n initialValidation = true;\n });\n\n form.checkConsents = function () {\n var data = [];\n var checkboxes = $('.form-row.consent.checkbox', $form);\n $.each(checkboxes, function (e, el) {\n var chkbx = $('.checkbox-wrapper input', el);\n data.push({ type: chkbx.attr('id'), source: 'Registration Form', approved: chkbx.prop(\"checked\") });\n });\n\n if (data.length > 0) {\n window.ConsentsManager.insertConsents(data);\n }\n };\n\n $form.on('click', '.js-password-reveal', function (e) {\n e.preventDefault();\n if ($(this).hasClass('shown')) {\n $(this).removeClass('shown').siblings('input').prop('type', 'password');\n } else {\n $(this).addClass('shown').siblings('input').prop('type', 'text');\n }\n });\n\n $form.on('change', 'select[name]', function (e) {\n //update validation for postal code\n if ($(this).attr('name') === \"countryCode\") {\n\n var countryCode = $(this).val();\n\n if (countryCode === formData.countryCode) return;\n\n form.resetAddressFields();\n form.updatePostalCode(countryCode);\n }\n\n form.setField($(this));\n });\n\n $form.on('keyup', 'input[name]:not([type=\"checkbox\"]), textarea[name]', function (e) {\n //if (e.keyCode === 13) {\n // e.preventDefault();\n // e.stopPropagation();\n\n // $('.js-submit-button', $form).click();\n\n // return;\n //}\n\n if ($(this).attr('name') === \"postalCode\") {\n removeWhiteSpaces($(this));\n }\n\n if ($(this).attr('name') === \"password\") {\n form.updatePasswordBar($(this));\n rf.validate(\"passwordConfirmation\");\n }\n\n form.setField($(this));\n });\n\n $form.on('blur', 'input[name]:not([type=\"checkbox\"]), textarea[name]', function (e) {\n if ($(this).attr('name') === \"password\") {\n form.updatePasswordBar($(this));\n rf.validate(\"passwordConfirmation\");\n }\n\n //validate fields instantly\n if (!initialValidation) {\n if ($(this).attr('name') === \"email\") {\n rf.validateField(\"email\");\n }\n\n if ($(this).attr('name') === \"phone\") {\n rf.validateField(\"phone\");\n }\n\n if ($(this).attr('name') === \"mobile\") {\n rf.validateField(\"mobile\");\n }\n }\n\n form.setField($(this));\n });\n\n form.setField = function (field) {\n var fieldName = field.attr('name');\n formData[fieldName] = (fieldName === 'email' || fieldName === 'emailConfirmation') ? field.val().trim() : field.val();\n rf.validate(fieldName);\n };\n\n form.addTaxIdentifierValidation = function () {\n rf.removeField(\"taxIdentifier\");\n $('.taxIdentifier-invalid', $form).removeClass('error');\n $('.form-row.taxidentifier-container', $form).removeClass('with-error');\n\n if (isEUCountry) {\n rf.addField({ taxIdentifier: { required: 'taxIdentifier-required', isServiceValidTaxIdentifier: { validator: 'taxIdentifier-invalid', config: { isValid: true } } } });\n } else {\n rf.addField({ taxIdentifier: { required: 'taxIdentifier-required' } });\n }\n\n if (initialValidation)\n rf.validate(\"taxIdentifier\");\n };\n\n if (areaAutoCompleteEnabled) {\n $form.on('keyup', 'input[name=\"postalCode\"]', $.debounce(400, function () {\n var $this = $(this);\n var postalCode = $this.val();\n\n if (postalCode.length > 0 && areasCount > 1)\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.GetAreasForPostCode(formData.countryCode, postalCode, \"\"));\n }));\n\n $form.on('focus', 'input[name=\"area\"]', function (e) {\n e.preventDefault();\n\n if (areasCount > 1)\n $('input[name=\"postalCode\"]', $form).focus();\n });\n }\n \n if (invoiceAutoCompleteEnabled) {\n $form.on('keyup', 'input[name = \"taxIdentifier\"]', $.debounce(400, function () {\n var $this = $(this);\n var taxIdentifier = $this.val();\n\n //ajax call for Vat Info Service\n vatInfoService(taxIdentifier);\n }));\n\n $form.on('change', 'select[name = \"countryCode\"]', function (e) {\n //update isEUCountry parameter\n isEUCountry = $(this).find('option:selected').data('eucountry').toString().toLowerCase() === 'true';\n\n //add taxIdentifier validation\n if (venddProjectConfigs.TaxIdentifierValidationEnabled && $('input[name=\"taxIdentifier\"]', $form).length > 0)\n form.addTaxIdentifierValidation();\n\n //call service for taxAgencies\n Vendd.MessageBus.publishAsync(form, new Vendd.Account.Messages.GetAllTaxAgencies(formData.countryCode));\n });\n }\n\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n if ($('input[name=\"phone\"]', $form).length > 0) {\n $('input[name=\"phone\"]', $form).get(0).addEventListener(\"countrychange\", function () {\n formData.phone = $(this).val();\n rf = $form.data('validationEngine');\n rf.validate('phone');\n });\n }\n if ($('input[name=\"mobile\"]', $form).length > 0) {\n $('input[name=\"mobile\"]', $form).get(0).addEventListener(\"countrychange\", function () {\n formData.mobile = $(this).val();\n rf = $form.data('validationEngine');\n rf.validate('mobile');\n });\n }\n }\n\n function vatInfoService(taxIdentifier) {\n\n if (taxIdentifier == null || taxIdentifier == '' || !isEUCountry) {\n rf.validateField('taxIdentifier');\n return;\n }\n\n Vendd.Service.call({\n url: 'EcomService.svc/GetVatInfo',\n data: {\n request: {\n country: selectedCountry.val(),\n vat: taxIdentifier\n }\n },\n onSuccess: function (res) {\n rf.removeField(\"taxIdentifier\");\n\n if (res.isValid) {\n if (res.name) {\n $('input[name = \"companyName\"]:text').val(res.name);\n formData.companyName = res.name;\n }\n if (res.occupation) {\n $('input[name = \"occupation\"]:text').val(res.occupation);\n formData.occupation = res.occupation;\n }\n if (res.taxAgency) {\n if ($('select[name=\"taxAgency\"]').length > 0) {\n $('select[name=\"taxAgency\"] option[data-code=' + res.taxAgencyCode + ']').prop('selected', true);\n formData.taxAgency = $('select[name=\"taxAgency\"]').val();\n } else {\n $('input[name=\"taxAgency\"]').val(res.taxAgency);\n formData.taxAgency = res.taxAgency;\n } \n }\n\n rf.addField({ taxIdentifier: { required: 'taxIdentifier-required', isServiceValidTaxIdentifier: { validator: 'taxIdentifier-invalid', config: { isValid: true } } } });\n } else {\n if (res.error && res.error.message) {\n $('.taxidentifier-container .taxIdentifier-invalid', $form).text(res.error.message);\n }\n\n rf.addField({ taxIdentifier: { required: 'taxIdentifier-required', isServiceValidTaxIdentifier: { validator: 'taxIdentifier-invalid', config: { isValid: false } } } });\n }\n \n rf.validateField('taxIdentifier');\n },\n onFailure: function (res) {\n return;\n }\n });\n\n }\n\n $(\".view-terms\").fancybox({\n touch: false,\n autoFocus: false\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.B2BRegisterSuccess, form, form.onSuccess);\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.B2BRegisterFailure, form, form.onFailure);\n\n Vendd.MessageBus.subscribe(Vendd.Plugins.Messages.RecaptcaLoaded, form, form.initRecaptcha);\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetAreasForPostCodeSuccess, form, form.getAreasForPostCode);\n\n Vendd.MessageBus.publishAsync(form, new Vendd.Account.Messages.GetAllTaxAgencies(formData.countryCode));\n\n Vendd.MessageBus.subscribe(Vendd.Account.Messages.GetAllTaxAgenciesSuccess, form, function (envelope) {\n var taxAgencies = envelope.message.data.model;\n var $taxAgenciesWrapper = $(\".js-tax-agencies-select\", $form);\n var literalsModel = { TaxAgency: $taxAgenciesWrapper.data('literal') };\n\n if (taxAgencies.length > 0) {\n var taxAgenciesHtml = Vendd.Handlebars.parse(\"accountTaxAgencyCombo_A\", taxAgencies);\n } else {\n var data = {};\n data.Literals = literalsModel;\n var taxAgenciesHtml = Vendd.Handlebars.parse(\"accountTaxAgencyCombo_A\", data);\n }\n\n $taxAgenciesWrapper.html(taxAgenciesHtml);\n\n //re-init validation after html parse\n rf.removeField(\"taxAgency\");\n rf.addField({ taxAgency: { required: 'taxAgency-required' } });\n\n //validate again taxAgency if fields area already validated\n if (initialValidation)\n rf.validateField(\"taxAgency\");\n\n //ajax call for Vat Info Service\n if (!initialAjaxCall)\n vatInfoService(formData.taxIdentifier);\n\n initialAjaxCall = false;\n });\n\n});","Vendd.Scripts.load(function () {\n\n var $form = $('.x-resetpassword-form');\n\n if ($form.length < 1)\n return;\n\n var form = $form.get(0);\n var formData = {\n code: $form.data('code'),\n notificationType: $form.data('notification-type'),\n password: \"\",\n passwordConfirmation: \"\"\n };\n\n form.loading = function (loading) {\n if (loading) {\n $form.addClass('x-loading');\n } else {\n $form.removeClass('x-loading');\n }\n };\n\n form.onSuccess = function (envelope) {\n form.loading(false);\n\n var data = envelope.message.data;\n if (data.success && data.code === \"ResetPassword_OperationSuccesful\") {\n $('.js-error', $form).hide();\n $('.js-expired', $form).hide();\n $('.js-content', $form).hide();\n $('.js-success', $form).show();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n } else {\n if (data.code === 'ResetPassword_CodeExpired') {\n $('.js-error', $form).hide();\n $('.js-expired', $form).show();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n\n } else {\n $('.js-expired', $form).hide();\n $('.js-error', $form).show();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n };\n };\n };\n\n form.onFailure = function (envelope) {\n form.loading(false);\n\n $('.js-expired', $form).hide();\n $('.js-error', $form).show();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n };\n\n form.submit = function () {\n form.loading(true);\n formData.password = $('input[name=\"password\"]', $form).val();\n formData.passwordConfirmation = $('input[name=\"passwordConfirmation\"]', $form).val();\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.ResetPassword(formData.code, formData.password, formData.passwordConfirmation));\n };\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.ResetPasswordSuccess, form, form.onSuccess);\n Vendd.MessageBus.subscribe(Vendd.User.Messages.ResetPasswordFailure, form, form.onFailure);\n\n form.onResendSuccess = function (envelope) {\n form.loading(false);\n\n var data = envelope.message.data;\n if (data.success) {\n $('.js-error', $form).hide();\n $('.js-expired', $form).hide();\n $('.js-content', $form).hide();\n $('.js-success', $form).show();\n } else {\n $('.js-expired', $form).hide();\n $('.js-error', $form).show();\n };\n };\n\n form.onResendFailure = function (envelope) {\n form.loading(false);\n\n $('.js-expired', $form).hide();\n $('.js-error', $form).show();\n };\n\n form.resend = function () {\n form.loading(true);\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.ResendActivationCode(formData.code, formData.notificationType));\n };\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.ResendActivationCodeSuccess, form, form.onResendSuccess);\n Vendd.MessageBus.subscribe(Vendd.User.Messages.ResendActivationCodeFailure, form, form.onResendFailure);\n\n form.reset = function () {\n $('.js-error', $form).hide();\n $('.js-expired', $form).hide();\n $('.js-success', $form).hide();\n $('.js-content', $form).show();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n\n rpf.reset();\n };\n\n form.updatePasswordBar = function (value) {\n var score = Vendd.Helpers.textStrength(value);\n\n var $passwordStrength = $('#chkPassLabel, #chkPassText');\n\n $passwordStrength.removeClass(function (i, css) {\n return (css.match(/(^|\\s)level\\S+/g) || []).join(' ');\n }).addClass('level' + score);\n };\n\n $.fn.validationEngine.validations.passwordStrength = Vendd.Validations.passwordStrength;\n\n //init validation options\n var valOpts = {};\n\n if ($('.form-row.password', $form).length > 0) {\n valOpts.password = {\n required: 'password-required',\n passwordStrength: {\n validator: 'password-weak',\n config: {\n limit: $('.form-row.password', $form).data('strength')\n }\n }\n };\n }\n\n if ($('.form-row.password-confirm', $form).length > 0) {\n valOpts.passwordConfirmation = {\n required: 'password-confirm-required',\n match: {\n validator: 'password-confirm-match',\n matchField: 'password'\n }\n };\n }\n\n $form.validationEngine(valOpts);\n var rpf = $form.data('validationEngine');\n\n $form.on('click', '.js-submit-button', function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n if (rpf.validate())\n form.submit();\n });\n\n $form.on('click', '.js-resend-button', function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n form.resend(); \n });\n\n $form.on('keyup', 'input[name]', function (e) {\n\n if (e.keyCode === 13) {\n e.preventDefault();\n e.stopPropagation();\n\n if (rpf.validate())\n form.submit();\n\n return;\n };\n\n var $this = $(this);\n var fieldName = $this.attr('name');\n\n if (fieldName === \"password\") {\n form.updatePasswordBar($this.val());\n };\n\n\n rpf.validate(fieldName);\n });\n\n $form.on('click', '.js-password-reveal', function (e) {\n e.preventDefault();\n if ($(this).hasClass('shown')) {\n $(this).removeClass('shown').siblings('input').prop('type', 'password');\n } else {\n $(this).addClass('shown').siblings('input').prop('type', 'text');\n }\n });\n});\n"]}