function sleep(n){const i=Date.now();let t=null;do t=Date.now();while(t-i<n)}function sleepForRedisFix(){sleep(250)}function initFormElements(){function i(){function k(){n.on("click",".ico",function(){i.find(".more-information").stop().slideToggle()})}var i=$(this),t=i.find("input, textarea"),u=t.filter("textarea"),p=i.find(".first-name,.last-name"),d=i.find(".dob-input"),e=i.find(".dob-group.day input"),o=i.find(".dob-group.month input"),s=i.find(".dob-group.year input"),f=i.find(".counter"),r=n.find('input[type="submit"]'),h=u.data("character-limit"),c=t.filter("input.postCode"),l=t.filter("input.tel-mobile"),w=t.filter("input.loan-number"),a=t.filter("input.member-number"),v=t.filter("input.uasort-code"),y=t.filter("input.account-number"),w=t.filter("input.loan-number"),b=t.filter("input.pay-amount"),g=t.filter("input.dob-input");f.text(h);n.on("keyup",t,function(i){i.which===16||i.which===9||i.which===13||n.closest(".calculator-tool").length||(f.length&&f.text(h-u.val().length),t.val()===""?(t.removeClass("typing"),r.prop("disabled",!0).addClass("disabled")):(t.addClass("typing"),r.prop("disabled",!1).removeClass("disabled")),window.aa.salesJourneyApp.helpers.initInputMasking(t.filter("#day-number").add(t.filter("#month-number")),window.aa.salesJourneyApp.constants.regex.days))});w.on({blur:function(){var t=$(this),n=t.val(),i=n.substring(0,4);n!=""&&(i!="0007"||n.length!=19?($("#mcc6012AccountNumber").parent().parent().parent(".form-field").addClass("error"),$("#mcc6012AccountNumber").parent().parent().parent(".form-field").find('.err-msgs div[data-validation="minLength"]').show()):$("#mcc6012AccountNumber").parent().parent().parent(".form-field").find('.err-msgs div[data-validation="minLength"]').hide())}});b.on({keypress:function(n){var n=n||window.event,i=n.which||n.keyCode,u=String.fromCharCode(i),r=$(this),t=window.event?n.keyCode:n.which;if(t===37||t===38||t===39||t===40)return!0;r.autoNumeric("init",{mDec:"2",vMin:"0",vMax:"5000"})},paste:function(n){var i=$(this),t=window.event?n.keyCode:n.which;if(t===37||t===38||t===39||t===40)return!0;i.autoNumeric("init",{mDec:"2",vMin:"0",vMax:"5000"})}});c.on({keydown:function(){window.aa.salesJourneyApp.helpers.initInputMasking(c,window.aa.salesJourneyApp.constants.regex.postcodeRegister)},paste:function(n){return n.which===8?!0:/^(?!\s)[0-9a-zA-Z0-9]*$/.test(n.originalEvent.clipboardData.getData("text"))}});l.on({keydown:function(){window.aa.salesJourneyApp.helpers.initInputMasking(l,window.aa.salesJourneyApp.constants.regex.telephoneNumberRegister)},paste:function(n){return n.which===8?!0:/^(?!\s)[0-9+]*$/.test(n.originalEvent.clipboardData.getData("text"))}});a.on({keydown:function(){window.aa.salesJourneyApp.helpers.initInputMasking(a,window.aa.salesJourneyApp.constants.regex.numeric)},paste:function(n){return n.which===8?!0:/^[0-9]*$/.test(n.originalEvent.clipboardData.getData("text"))}});v.on({keydown:function(){window.aa.salesJourneyApp.helpers.initInputMasking(v,window.aa.salesJourneyApp.constants.regex.numeric)},paste:function(n){return n.which===8?!0:/^[0-9]*$/.test(n.originalEvent.clipboardData.getData("text"))}});y.on({keydown:function(){window.aa.salesJourneyApp.helpers.initInputMasking(y,window.aa.salesJourneyApp.constants.regex.numeric)},paste:function(n){return n.which===8?!0:/^[0-9]*$/.test(n.originalEvent.clipboardData.getData("text"))}});e.on({keydown:function(){window.aa.salesJourneyApp.helpers.initInputMasking(e,window.aa.salesJourneyApp.constants.regex.days)},paste:function(n){return n.which===8?!0:/^[0-9]*$/.test(n.originalEvent.clipboardData.getData("text"))}});o.on({keydown:function(){window.aa.salesJourneyApp.helpers.initInputMasking(o,window.aa.salesJourneyApp.constants.regex.months)},paste:function(n){return n.which===8?!0:/^[0-9]*$/.test(n.originalEvent.clipboardData.getData("text"))}});s.on({keydown:function(){window.aa.salesJourneyApp.helpers.initInputMasking(s,window.aa.salesJourneyApp.constants.regex.numeric)},paste:function(n){return n.which===8?!0:/^[0-9]*$/.test(n.originalEvent.clipboardData.getData("text"))}});p.on({input:function(){$input=$(this);var n=$input.val();if(hasInvalidCharacter=/^[a-zA-Z#~`_+=?><:!@”$%&.’()* '"+\-,\/;\[\\\]\^_`{|}~\xC0-\xD6\xD8-\xF6\xF8-\xFF]*$/.test($input.val()),!hasInvalidCharacter){$input.addClass("masked");$input.val($input.val().replace($input,""));$input.val(n.slice(0,-1)).removeClass("masked").focus();return}},paste:function(n){if(n.which===8||/^[a-zA-Z#~`_+=?><:!@”$%&.’() *'"+\-,\/;\[\\\]\^_`{|}~\xC0-\xD6\xD8-\xF6\xF8-\xFF]*$/.test(n.originalEvent.clipboardData.getData("text")))return!0;n.preventDefault();n.stopImmediatePropagation()}});u.on({keypress:function(n){var t=$(this);return n.which===8?!0:t.data("disable-characters")?!0:/^[a-zA-Z0-9-',.\n ]*$/.test($(this).val())},keyup:function(){var n=$(this),t=/[^a-zA-Z0-9-',.\n ]+/g,i=t.test(n.val());i&&n.data("disable-characters")&&n.val(n.val().replace(t,""))},paste:function(n){return n.which===8?!0:/^[a-zA-Z0-9-',. ]*$/.test(n.originalEvent.clipboardData.getData("text"))}});n.on("change","select",function(){r.prop("disabled",!1).removeClass("disabled")});n.on("click",'[type="radio"], [type="checkbox"]',function(){var n=$(this),t=n.closest(".radio-inputs");r.prop("disabled",!n.is(":checked")).removeClass("disabled");n.parent(".stylish-ds").siblings("label").toggleClass("checked");n.filter('[type="radio"]').parent().siblings("label").addClass("checked");n.closest(".stylish-ds").siblings().children("label").removeClass("checked");n.filter('[type="radio"]').closest(".radio-field, .radio").siblings().children("label").removeClass("checked");t.length&&(t.find("label").removeClass("checked"),n.closest(".radio-input-group").children("label").addClass("checked"))});t.hasClass("hidden")?(t.parent(".stylish-ds").hide(),stylishForms.update()):(t.parent(".stylish-ds").show(),stylishForms.update());k()}function r(){function s(){var n=u.val(),s=t.find('input[type="radio"]#Yes').is(":checked");n.length>=2?(r.addClass("disabled processing"),$.ajax({url:"/cms/ajax/api/battery/getbatteryresults/"+n,type:"GET"}).done(function(u){u.IsValidVrm&&u.BatteryCount>0?$("<div>").load("/cms/ajax/fragment/batteryform/GetBatteryComponent",{id:n,isMember:s},function(n){t.hide();f.html(n);r.removeClass("disabled processing")}):(i.text(u.ValidationError).show(),o.show(),r.removeClass("disabled processing"))})):i.text(e).show()}var n=$(this),t=n.find("form"),f=n.find(".results"),u=t.find('input[type="text"].registration'),i=u.parents(".form-field").find(".error-message"),e=i.data("defaultmessage"),o=n.find(".having-trouble"),r=n.find('input[type="submit"]');r.on("click",function(n){n.preventDefault();s()});n.on("click",".reset-form",function(n){n.preventDefault();t.show();u.val("");i.text(e).hide();f.html("");o.hide()})}function u(){var t=$(this),n=t.find("form"),u=t.find(".results"),r=n.find(".full-submit"),i=!1;formValidation.api[t.data("id")].events.full=function(t){i||t&&(r.addClass("disabled processing"),i=!0,$.ajax({type:"POST",url:"/cms/ajax/fragment/CallMeBackForm/RequestCallBack",dataType:"json",data:n.serialize().replace(/%0D%0A/g,"%2C+"),success:function(t){t.ShowError?(n.find(".service-error-message").text(t.ErrorMessage).show(),n.find(".service-error-failed").hide()):(n.hide(),u.show());r.removeClass("disabled processing");i=!1},error:function(){n.find(".service-error-failed").show();n.find(".service-error-message").hide();r.removeClass("disabled processing");i=!1}}))};n.on("submit",function(n){n.preventDefault()});t.on("click",".reset-form",function(t){t.preventDefault();n.show();u.hide()})}function f(){var n=$(this),t=n.find("form"),i=n.find(".full-submit");formValidation.api[n.data("id")].events.full=function(n){document.getElementById("chargetotal").value=document.getElementById("chargetotal").value.split(",").join("");var t=document.getElementById("dob_day").value.length===1?"0"+document.getElementById("dob_day").value:document.getElementById("dob_day").value,i=document.getElementById("dob_month").value.length===1?"0"+document.getElementById("dob_month").value:document.getElementById("dob_month").value;document.getElementById("mcc6012BirthDay").value=t+"."+i+"."+document.getElementById("dob_year").value;n&&(typeof GenerateHash=="function"?GenerateHash(function(){document.getElementById("frmPaymentGateway").submit()}):console.log("GenerateHash not found"))};t.on("submit",function(n){n.preventDefault()})}function e(){$("#sortcode").on({keydown:function(n){if(n.which===32)return!1},change:function(){this.value=this.value.replace(/\s/g,"")}});$("#accountnumber").on({keydown:function(n){if(n.which===32)return!1},change:function(){this.value=this.value.replace(/\s/g,"")}});$("#insurancepolicy").on({keydown:function(n){if(n.which===32)return!1},change:function(){this.value=this.value.replace(/\s/g,"")}});var t=$(this),u=t.find("#register-user"),r=u.find(".full-submit"),f,e,n=1,i;$("#password1").on("input",function(){f=$("#password1").val()});$("#password2").on("input",function(){e=$("#password2").val()});$(".AAMembership").hide();$(".radio-field:first-child > .AAMembership ").show();$("#options1").find('input[type="text"]').removeAttr("disabled");$("input[name$='Fields.MembershipSelection.Value']").click(function(){n=$(this).val();$(".AAMembership").hide();$("#options"+n).show();$("#options"+n).parent(".radio-card").addClass("selected").siblings().removeClass("selected");$("#options"+n).find('input[type="text"]').prop("disabled",!1);$("#options"+n).parent().siblings().find('input[type="text"]').prop("disabled",!0);$("#options"+n).parent().siblings().find(".AAMembership .form-field").hasClass("error")&&$("#options"+n).parent().siblings().find(".AAMembership .form-field").removeClass("error")});formValidation.api[t.data("id")].events.full=function(o){var h,c,l,s;formValidation.api[t.data("id")].events.formPost||(o?(r.addClass("disabled processing"),i=n==1?"AAPersonal":n==2?"Bank":n==3?"Insurance":"null",h=$("#Email").val(),c=$("#Fields_Email_Value").val(),h===null&&c!==null&&(h=c),formValidation.api[t.data("id")].events.formPost=$.ajax({type:"POST",url:"/cms/ajax/fragment/UniversalAccount/RegisterUser",dataType:"json",data:u.serialize().replace(/%0D%0A/g,"%2C+"),success:function(n){var s=grecaptcha.getResponse(),u=$(".fc-err-msg.givenName"),f=$(".fc-err-msg.SurName"),e=$(".fc-err-msg.Password"),o=$(".fc-err-msg.UserName");if(s.length!==0&&(n.Token===null&&n.ErrorMessage!=="AA_UNIQUE"?($("#dvMain").show(),$("#dvAlreadyRegisteredsMessage").hide(),$("#dvSuccessMessage").hide(),$("#dvErrorsMessage").hide()):n.ErrorMessage==="AA_UNIQUE"?($("#dvMain").hide(),$("#dvSuccessMessage").hide(),$("#dvErrorsMessage").hide(),$("#dvAlreadyRegisteredsMessage").show(),utag.view({site_section:"Your account",page_name:"/account/#register/email_already_registered",error_message:"email already registered",forgerockID:"",userType:i}),window.location.href=window.location.href+"#alreadyaccount"):n.Token===null&&n.IsOkay===!1?($("#dvMain").show(),$("#dvAlreadyRegisteredsMessage").hide(),$("#dvSuccessMessage").hide(),$("#dvErrorsMessage").hide()):($(".check-inbox .userEmail").text(h),$("#dvMain").hide(),$("#dvErrorsMessage").hide(),$("#dvAlreadyRegisteredsMessage").hide(),$("#dvSuccessMessage").show(),utag.view({site_section:"Your account",page_name:"/account/#register/check_your_inbox",forgerockID:"",userType:i}),window.location.href=window.location.href+"#success")),console.log(n.ErrorMessage),n.ErrorMessage!==null)return $(u).data("fieldname")===n.Fieldname?$(u).show():$(u).hide(),$(f).data("fieldname")===n.Fieldname?$(f).show():$(f).hide(),$(e).data("fieldname")===n.Fieldname?$(e).show():$(e).hide(),$(o).data("fieldname")===n.Fieldname?$(o).show():$(o).hide(),window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100),r.removeClass("disabled processing"),formValidation.api[t.data("id")].events.formPost=null,!1;window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100);r.removeClass("disabled processing");formValidation.api[t.data("id")].events.formPost=null},error:function(){$("#dvMain").hide();$("#dvAlreadyRegisteredsMessage").hide();$("#dvSuccessMessage").hide();$("#dvErrorsMessage").show();window.location.href=window.location.href+"#fail";r.removeClass("disabled processing");formValidation.api[t.data("id")].events.formPost=null;window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100)}})):(f!=null&&$("#password1").val(f),e!=null&&$("#password2").val(e),typeof $(".errors .error").first().offset()!="undefined"&&($("html, body").animate({scrollTop:$(".errors .error").first().offset().top-75},150),l=0,($(".errors .error").first().hasClass("year")||$(".errors .error").first().hasClass("month")||$(".errors .error").first().hasClass("day"))&&$("html, body").animate({scrollTop:$(".errors .error").first().offset().top-140},150)),s=[],$("div.form-field.cf.error").each(function(n,t){$(t).find("label").text()&&($(t).find('input[type="text"],input[type="password"]').val()?s.push($(t).find("label").text()+"-invalid"):s.push($(t).find("label").text()+"-missing"))}),$("div.form-field.cf.captchRel.error").length&&s.push($(".form-field.cf.Recaptcha-group .field >label").text()+"-missing"),$(".form-field.cf.date-of-birth-group .error").length&&($(".form-field.cf.date-of-birth-group .error").find('input[type="text"]').val()&&$(".form-field.cf.date-of-birth-group .error").hasClass("error")?s.push($(".form-field.cf.date-of-birth-group fieldset legend").text()+"-invalid"):s.push($(".form-field.cf.date-of-birth-group fieldset legend").text()+"-missing")),utag.link({event_category:"ua - enter details",event_name:"registration form - incomplete fields",event_label:s.join(",")})))};u.on("submit",function(n){n.preventDefault()})}function o(){var n=$(this),i=n.find("#register-email"),t=i.find(".full-submit");formValidation.api[n.data("id")].events.full=function(r){var u,f,o,e;formValidation.api[n.data("id")].events.formPost||(r?(utag.link({event_category:"create account",event_name:"email check",event_label:"submit email"}),t.addClass("disabled processing"),u=$("#Email").val(),f=$("#Fields_Email_Value").val(),u===null&&f!==null&&(u=f),formValidation.api[n.data("id")].events.formPost=$.ajax({type:"POST",url:"/cms/ajax/fragment/UniversalAccount/RegisterEmailvalidation",dataType:"json",data:i.serialize().replace(/%0D%0A/g,"%2C+"),success:function(i){var r=$(".fc-err-msg.UserName");if(i.IsOkay===!1&&i.ErrorMessage!=="AA_UNIQUE"&&(t.addClass("disabled processing"),$("#dvMain").show()),i.ErrorMessage==="AA_UNIQUE"&&i.IsOkay===!1)t.addClass("disabled processing"),$("#dvMain").show(),window.location.href=window.location.origin+"/create-account/already-registered";else if(i.RecaptchaFail)window.location.href=window.location.origin+"/create-account/error";else{$("#dvMain").show();function i(n,t){return Math.round(t/(Math.random()*t+n))}function r(n){return n%2}let u=0,f=0,e=sessionStorage.getItem("variant"),n=0;for(let t=0;t<1;t++)n=i(1,3),r(n)||e==="b"?(u++,location.href=window.location.origin+"/create-account/register"):(f++,location.href=window.location.origin+"/create-account/details");t.addClass("disabled processing")}if(console.log(i.ErrorMessage),i.ErrorMessage!==null)return $(given_name).data("fieldname")===i.Fieldname?$(given_name).show():$(given_name).hide(),$(sur_name).data("fieldname")===i.Fieldname?$(sur_name).show():$(sur_name).hide(),$(Password_fc).data("fieldname")===i.Fieldname?$(Password_fc).show():$(Password_fc).hide(),$(r).data("fieldname")===i.Fieldname?$(r).show():$(r).hide(),window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100),t.removeClass("disabled processing"),formValidation.api[n.data("id")].events.formPost=null,!1;window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100);t.removeClass("disabled processing");formValidation.api[n.data("id")].events.formPost=null},error:function(){$("#dvMain").hide();$("#dvAlreadyRegisteredsMessage").hide();$("#dvSuccessMessage").hide();$("#dvErrorsMessage").show();window.location.href=window.location.href+"#fail";t.removeClass("disabled processing");formValidation.api[n.data("id")].events.formPost=null;window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100)}})):($password!=null&&$("#password1").val($password),$confirmPassword!=null&&$("#password2").val($confirmPassword),typeof $(".errors .error").first().offset()!="undefined"&&($("html, body").animate({scrollTop:$(".errors .error").first().offset().top-75},150),o=0,($(".errors .error").first().hasClass("year")||$(".errors .error").first().hasClass("month")||$(".errors .error").first().hasClass("day"))&&$("html, body").animate({scrollTop:$(".errors .error").first().offset().top-140},150)),e=[],$("div.form-field.cf.error").each(function(n,t){$(t).find("label").text()&&e.push($(t).find("label").text())}),utag.link({event_category:"create account",event_name:"email check",event_label:e.join(",")})))};i.on("submit",function(n){n.preventDefault()})}function s(){$("#sortcode").on({keydown:function(n){if(n.which===32)return!1},change:function(){this.value=this.value.replace(/\s/g,"")}});$("#accountnumber").on({keydown:function(n){if(n.which===32)return!1},change:function(){this.value=this.value.replace(/\s/g,"")}});$("#insurancepolicy").on({keydown:function(n){if(n.which===32)return!1},change:function(){this.value=this.value.replace(/\s/g,"")}});var i="",t=$(this),f=t.find("#register-user"),u=f.find(".full-submit"),e,o,n=1,r;$("#password1").on("input",function(){e=$("#password1").val()});$("#password2").on("input",function(){o=$("#password2").val()});$(".AAMembership").hide();$(".radio-field:first-child > .AAMembership ").show();$("#options1").find('input[type="text"]').removeAttr("disabled");$("input[name$='Fields.MembershipSelection.Value']").click(function(){n=$(this).val();$(".AAMembership").hide();$("#options"+n).show();$("#options"+n).parent(".radio-card").addClass("selected").siblings().removeClass("selected");$("#options"+n).find('input[type="text"]').prop("disabled",!1);$("#options"+n).parent().siblings().find('input[type="text"]').prop("disabled",!0)});formValidation.api[t.data("id")].events.full=function(s){var p,h;if(!formValidation.api[t.data("id")].events.formPost)if(s){u.addClass("disabled processing");n==1?(r="AAPersonal",i="Variant A"):n==2?(r="Bank",i="Variant A"):n==3?(r="Insurance",i="Variant A"):(r="null",i="Variant B");function e(n){var i="; "+document.cookie,t=i.split("; "+n+"=");if(t.length==2)return t.pop().split(";").shift()}var a=e("aa-state"),v=a.split("&"),y=v[0].split("="),c=y[1],l=$("#Fields_Email_Value").val();c===null&&l!==null&&(c=l);formValidation.api[t.data("id")].events.formPost=$.ajax({type:"POST",url:"/cms/ajax/fragment/UniversalAccount/RegisterUserDetails",dataType:"json",data:f.serialize().replace(/%0D%0A/g,"%2C+"),success:function(n){var f=$(".fc-err-msg.givenName"),e=$(".fc-err-msg.SurName"),o=$(".fc-err-msg.Password");if(n.Token===null&&n.IsOkay===!1?($("#dvMain").show(),$("#dvAlreadyRegisteredsMessage").hide(),$("#dvSuccessMessage").hide(),$("#dvErrorsMessage").hide()):(utag.link({event_category:"create account",event_action:"Check Inbox",userType:r,test_variant:i}),window.location.href=window.location.origin+"/create-account/check-inbox"),console.log(n.ErrorMessage),n.ErrorMessage!==null)return $(f).data("fieldname")===n.Fieldname?$(f).show():$(f).hide(),$(e).data("fieldname")===n.Fieldname?$(e).show():$(e).hide(),$(o).data("fieldname")===n.Fieldname?$(o).show():$(o).hide(),$(user_email).data("fieldname")===n.Fieldname?$(user_email).show():$(user_email).hide(),window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100),u.removeClass("disabled processing"),formValidation.api[t.data("id")].events.formPost=null,!1;window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100);u.removeClass("disabled processing");formValidation.api[t.data("id")].events.formPost=null},error:function(){$("#dvMain").hide();$("#dvAlreadyRegisteredsMessage").hide();$("#dvSuccessMessage").hide();$("#dvErrorsMessage").show();window.location.href=window.location.href+"#fail";u.removeClass("disabled processing");formValidation.api[t.data("id")].events.formPost=null;window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100)}})}else e!=null&&$("#password1").val(e),o!=null&&$("#password2").val(o),typeof $(".errors .error").first().offset()!="undefined"&&($("html, body").animate({scrollTop:$(".errors .error").first().offset().top-75},150),p=0,($(".errors .error").first().hasClass("year")||$(".errors .error").first().hasClass("month")||$(".errors .error").first().hasClass("day"))&&$("html, body").animate({scrollTop:$(".errors .error").first().offset().top-140},150)),h=[],$("div.form-field.cf.error").each(function(n,t){$(t).find("label").text()&&h.push($(t).find("label").text())}),utag.link({event_category:"create account",event_name:"email check",event_label:h.join(",")})};f.on("submit",function(n){n.preventDefault()})}function h(){var t=$(this),r=t.find("#account-association"),u=r.find(".full-submit"),i,n;$(".AAMembership").hide();$("#options1").find('input[type="text"]').removeAttr("disabled");$(".radio-card").find("span").removeClass("checked");$(".radio-card").find("label").removeClass("checked");$("#membership").val()!=""&&($(".AAMembership").hide(),$("#options1").parent().find("span").addClass("checked"),$("#options1").parent().find("label").addClass("checked"),$("#options1").show(),$("#options1").parent(".radio-card").addClass("selected").siblings().removeClass("selected"),$("#options1").find('input[type="text"]').prop("disabled",!1),$("#options1").parent().siblings().find('input[type="text"]').prop("disabled",!0));$("#sortcode").val()!=""&&($(".AAMembership").hide(),$("#options2").parent().find("span").addClass("checked"),$("#options2").parent().find("label").addClass("checked"),$("#options2").show(),$("#options2").parent(".radio-card").addClass("selected").siblings().removeClass("selected"),$("#options2").find('input[type="text"]').prop("disabled",!1),$("#options2").parent().siblings().find('input[type="text"]').prop("disabled",!0));$("#insurancepolicy").val()!=""&&($(".AAMembership").hide(),$("#options3").parent().find("span").addClass("checked"),$("#options3").parent().find("label").addClass("checked"),$("#options3").show(),$("#options3").parent(".radio-card").addClass("selected").siblings().removeClass("selected"),$("#options3").find('input[type="text"]').prop("disabled",!1),$("#options3").parent().siblings().find('input[type="text"]').prop("disabled",!0));$("input[data-type-radio='membership']").click(function(){opt_chosen=$(this).val();opt_chosen==1&&$("#options1").parent().find("span").addClass("checked");$(".AAMembership").hide();$("#options"+opt_chosen).show();$("#options"+opt_chosen).parent(".radio-card").addClass("selected").siblings().removeClass("selected");$("#options"+opt_chosen).find('input[type="text"]').prop("disabled",!1);$("#options"+opt_chosen).parent().siblings().find('input[type="text"]').prop("disabled",!0)});$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(t){t!==null&&(i=$(".member-number").val(),n=t)}});formValidation.api[t.data("id")].events.full=function(f){var e,o,s;formValidation.api[t.data("id")].events.formPost||(e=$("#dvMain #membership").val(),o=$("#dvMainOld #membership").val(),o!==e&&e===""?$("#hiddenPolicyNumberAfterEdit").val(o):$("#hiddenPolicyNumberAfterEdit").val(e),f?(u.addClass("disabled processing"),$("#loader").stop().fadeIn(300),window.aa.salesJourneyApp.cache.$main.addClass("loading"),formValidation.api[t.data("id")].events.formPost=$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetAssociateAccountViewModel",dataType:"html",data:r.serialize().replace(/%0D%0A/g,"%2C+"),success:function(r){var f,o,e;if(u.removeClass("disabled processing"),setTimeout(function(){$("#loader")&&($("#loader").stop().fadeOut(300),window.aa.salesJourneyApp.cache.$main.removeClass("loading"))},700),window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},150),formValidation.api[t.data("id")].events.formPost=null,f=window.location.origin,r.indexOf("flagAlreadyAssociated")<=0&&r.indexOf("flagEditAssociation")<=0&&r.indexOf("flagVrnEntry")<=0&&r.indexOf("flagPushToCall")<=0)window.location.href=f+"/products/#successassoc";else if(r.indexOf("flagAlreadyAssociated")>=0&&r.indexOf("flagEditAssociation")<=0&&r.indexOf("flagVrnEntry")<=0&&r.indexOf("flagPushToCall")<=0){setAssociationUrlBack();o=window.location.search;const t=new URLSearchParams(o),u=t.get("mobileapps");window.location.href=f+"/create-account/your-products#alreadyassociated";$("#dvMain").hide();$("#dvMainOld").hide();u=="true"?$("#dvAlreadyAssociated").hide():$("#dvAlreadyAssociated").show();$("#dvAlreadyAssociated").html(r);utag.view({site_section:"Your account",page_name:"/associateaccount/customer_already_registered",error_message:"customer already registered, forgerock_ID:"+n,forgerock_ID:n,user_ID:i})}else r.indexOf("flagVrnEntry")>=0&&r.indexOf("flagAlreadyAssociated")<=0&&r.indexOf("flagEditAssociation")<=0&&r.indexOf("flagPushToCall")<=0?(window.location.href=f+"/create-account/your-products",$("#dvMain").hide(),$("#dvMainOld").hide(),$("#dvAlreadyAssociated").hide(),$("#dvDetails").hide(),$("#dvVrnEntry").show(),utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/enter_number_plate, forgerockId:"+n,forgerockID:n,user_ID:i})):r.indexOf("flagVrnEntry")<=0&&r.indexOf("flagAlreadyAssociated")<=0&&r.indexOf("flagEditAssociation")<=0&&r.indexOf("flagPushToCall")>=0?(window.location.href=f+"/create-account/your-products",$("#dvMain").hide(),$("#dvMainOld").hide(),$("#dvAlreadyAssociated").hide(),$("#dvDetails").hide(),$("#dvVrnEntry").hide(),$("#dvPushTocall").show(),utag.view({site_section:"Your account",page_name:"/account/details_not_found",error_message:"customer details not found - no details, forgerock_ID:"+n,forgerock_ID:n,user_ID:i}),window.location.href=window.location.href+"#associationfail"):($("#dvDetails").hide(),$("#dvAlreadyAssociated").hide(),$("#dvMainOld").hide(),$("#dvMain").show(),$(".needMoreInfo").hide(),$(".editDetails").show(),e=$(".member-number1").val(),opt_chosen==1&&($(".aaMembershipError").show(),$(".aaBankError").hide(),$(".aaInsuranceError").hide(),$(".cdlInsuranceError").hide()),opt_chosen==2&&($(".aaMembershipError").hide(),$(".aaBankError").show(),$(".aaInsuranceError").hide(),$(".cdlInsuranceError").hide()),opt_chosen==3&&e!=""&&($(".aaMembershipError").hide(),$(".aaBankError").hide(),$(".aaInsuranceError").hide(),$(".cdlInsuranceError").hide(),e.slice(0,6)==="AAMOBR"||e.slice(0,6)==="AAHOBR"?$(".cdlInsuranceError").show():$(".aaInsuranceError").show()),utag.view({site_section:"Your account",page_name:"/associateaccount/edit_details",error_message:"customer details not found – edit_details, forgerock_ID:"+n,forgerock_ID:n,user_ID:i}),window.location.href=f+"/create-account/your-products")},error:function(){u.removeClass("disabled processing");formValidation.api[t.data("id")].events.formPost=null;setTimeout(function(){$("#loader")&&($("#loader").stop().fadeOut(300),window.aa.salesJourneyApp.cache.$main.removeClass("loading"))},700);window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},150)}})):(typeof $(".errors .error").first().offset()!="undefined"&&($("html, body").animate({scrollTop:$(".errors .error").first().offset().top-75},150),s=0,($(".errors .error").first().hasClass("year")||$(".errors .error").first().hasClass("month")||$(".errors .error").first().hasClass("day"))&&$("html, body").animate({scrollTop:$(".errors .error").first().offset().top-140},150)),$(".setError").css("display")=="block"&&($(".month").addClass("error"),$(".day").addClass("error")),$(".setError1").css("display")=="block"&&($(".month").addClass("error"),$(".day").addClass("error"))))};r.on("submit",function(n){n.preventDefault()})}function c(){var n=$(this),i=n.find("#vrn-check"),t=i.find(".full-submit");formValidation.api[n.data("id")].events.full=function(i){if(!formValidation.api[n.data("id")].events.formPost&&i){t.addClass("disabled processing");var r=$("#txtVehicleNumber").val();formValidation.api[n.data("id")].events.formPost=$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetVehicleDetails",dataType:"JSON",data:{VehicleNumber:r},success:function(i){i.isVehicledetailsFound?($("#dvVrnEntry").hide(),$("#dvVehicleDetails").show(),$("#vehicleColor").text(i.Vehicle.Color),$("#vehcileMake").text(i.Vehicle.Make),$("#vehicleModel").text(i.Vehicle.Model),$("#hiddenVehicleNumber").val(i.VehicleNumber),$("#hiddenIsVehicleMatching").val(i.IsVehicleMatchingInRes),$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){if(n!==null){var t=$(".member-number").val();utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/validate_car_details, forgerock_ID:"+n,forgerock_ID:n,user_ID:t})}}})):!i.isVehicledetailsFound&&i.IsVehicleMatchingInRes?($("#dvHaveMembership").show(),$("#dvVrnEntry").hide(),$("#dvVehicleNotFound").hide(),$("#dvVehicleDetails").hide()):($("#dvVrnEntry").hide(),$("#dvVehicleNotFound").show(),$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){if(n!==null){var t=$(".member-number").val();utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/validate_plate_details, forgerock_ID:"+n,forgerock_ID:n,user_ID:t})}}}),$("#vehicleNumber").text(i.VehicleNumber),$("#hiddenVehicleNumber").val(i.VehicleNumber));t.removeClass("disabled processing");formValidation.api[n.data("id")].events.formPost=null},error:function(){t.removeClass("disabled processing");formValidation.api[n.data("id")].events.formPost=null}})}};i.on("submit",function(n){n.preventDefault()});$("#txtVehicleNumber").keypress(function(n){n.stopImmediatePropagation();var t=t=document.all?n.keyCode:n.which;return n.which===8||n.which===0?!0:t===32?!1:t>64&&t<91||t>96&&t<123||t>=48&&t<=57})}function l(){var t=$(this),n=t.find("form"),i=t.find('.form-field.info-field input[type="text"]');i.focus(function(){$(this).val()===""&&$(this).val("MAN")});formValidation.api[t.data("id")].events.full=function(r){var u,f,e;r===!0&&(u=t.find('input[name="manufacturer"]').val(),f=i.val(),e=t.find('.form-field.postcode input[type="text"]').val(),n.find(".full-submit").addClass("disabled processing"),$.ajax({type:"GET",url:"/cms/ajax/api/mancon/validate?manufacturer="+u+"&manNumber="+f+"&postcode="+e,success:function(t){t.ServiceResponse==="Success"?window.location=t.JourneyUri:(n.find(".service-error-message").text(t.ValidationError).show(),n.find(".service-error-failed").hide(),n.find(".full-submit").removeClass("disabled processing"))},error:function(){n.find(".service-error-failed").show();n.find(".service-error-message").hide();n.find(".full-submit").removeClass("disabled processing")}}))};n.on("submit",function(n){n.preventDefault()})}function a(){function a(){if($membershipValue=t.val().replace(/\s/g,""),$membershipValue!="")t.removeClass("errorInput"),f.removeClass("errorDiv-input"),$membershipValueTestResult=v.test($membershipValue),$membershipValueTestResult?(i.removeAttr("name"),e&&i.is(":checked")&&e.submit()):(t.addClass("errorInput"),f.addClass("errorDiv-input"),c.css("display","block"));else{MembershipRegexResult=!1;t.addClass("errorInput");f.addClass("errorDiv-input");h.css("display","block");var n=l.hasClass("hidden");u.length>0&&(n=(!!u.attr("style")==!0?u.attr("style").indexOf("none")>0:!1)?!0:!1);n&&i.is(":checked")&&e&&e.submit()}i.is(":not(:checked)")?r.css("display","block"):r.css("display","none")}var n=$(this),p=n.find("input,textarea"),i=n.find('input[type="checkbox"]'),o=n.find('input[type="submit"]'),t=n.find('input[type="text"]'),w=t.val().replace(/\s/g,""),s=n.find(".error-message"),h=n.find("#errorMessageEmpty"),c=n.find("#errorMessageInvalid"),f=n.find(".field.information"),l=n.find(".form-field"),e=document.getElementById("prePolutionForm"),r=n.find("#fs-terms-cond"),v=/^(((635601)\d{10})|((6356 01)\d{2}\s\d{4}\s\d{4})\d{16})$/,y=n.find(".link").val(),u=n.find(".membership-toggle");n.on("click",'[type="radio"], [type="checkbox"]',function(){o.prop("disabled",!1);i.is(":not(:checked)")?r.css("display","block"):r.css("display","none")});l.hasClass("hidden")&&$(".fs-checkbox").css("padding-top","0");$("#membershipButtonPost").click(function(n){n.preventDefault();a()});t.focusin(function(){t.removeClass("errorInput");f.removeClass("errorDiv-input");c.css("display","none");h.css("display","none");r.css("display","none")});o.on("click",function(t){t.preventDefault();a();var i=serialise.jQueryData(n,"input");(i.membershipNumber=i.membershipNumber.replace(/\s/g,""),$(".loans-calculator.newVersion").length>0&&(!!u.attr("style")==!0?u.attr("style").indexOf("none")>0:!1)&&(i.variant="2"),aa.helpers.cache.cachedElements.$main.find(".user-feedback-form").hasClass("active"))||$.ajax({type:"POST",url:"/cms/ajax/api/eligibility/validate?"+serialise.obj(i)+"",dataType:"json"}).done(function(n){var u=n.IsValidationPassed,f=n.IsCheckboxChecked,t=n.IsMembershipNumberCorrect,h=i.variant,r=!0,e;switch(h){case"1":r=u===!0&&f===!1&&(t===!1||t===null);break;case"2":r=u===!0&&f===!0&&(t===!1||t===null);break;case"3":r=u===!0&&f===!0&&t===!0;break;default:r=u===!1&&f===!1&&t===!1}r?(s.hide(),$(".loans-calculator.newVersion").length>0?(e=$(".link").val(),window.location=decodeURIComponent(e)):window.location=decodeURIComponent(y)):(s.show(),o.removeClass("processing"))}).fail(function(){n.find(".wrapper").html("<h5>"+s.data("defaultmessage")+"<\/h5>")})})}function v(){function c(){$membershipValue=t.val().replace(/\s/g,"");$membershipValue!=""?(t.removeClass("errorInput"),u.removeClass("errorDiv-input"),$membershipValueTestResult=a.test($membershipValue),$membershipValueTestResult?(i.removeAttr("name"),f&&i.is(":checked")&&f.submit()):(t.addClass("errorInput"),u.addClass("errorDiv-input"),h.css("display","block"))):(MembershipRegexResult=!1,t.addClass("errorInput"),u.addClass("errorDiv-input"),s.css("display","block"),$(".sectionTwo").hasClass("hidden")&&i.is(":checked")&&f&&f.submit());i.is(":not(:checked)")?r.css("display","block"):r.css("display","none")}var n=$(this),y=n.find("input,textarea"),i=n.find('input[type="checkbox"]'),e=n.find('input[type="submit"]'),t=n.find('input[type="text"]'),p=t.val().replace(/\s/g,""),o=n.find(".error-message"),s=n.find("#loanErrorMessageEmpty"),h=n.find("#loanErrorMessageInvalid"),u=n.find(".field.information"),l=n.find(".form-field"),f=document.getElementById("prePopulationForm"),r=n.find("#fs-terms-condn"),a=/^(((635601)\d{10})|((6356 01)\d{2}\s\d{4}\s\d{4})\d{16})$/,v=n.find(".link").val();n.on("click",'[type="radio"], [type="checkbox"]',function(){e.prop("disabled",!1);i.is(":not(:checked)")?r.css("display","block"):r.css("display","none")});l.hasClass("hidden")&&$(".fs-checkbox").css("padding-top","0");$("#loanmembershipButtonPost").click(function(n){n.preventDefault();c()});t.focusin(function(){t.removeClass("errorInput");u.removeClass("errorDiv-input");h.css("display","none");s.css("display","none");r.css("display","none")});e.on("click",function(t){t.preventDefault();c();var i=serialise.jQueryData(n,"input");(i.membershipNumber=i.membershipNumber.replace(/\s/g,""),aa.helpers.cache.cachedElements.$main.find(".user-feedback-form").hasClass("active"))||$.ajax({type:"POST",url:"/cms/ajax/api/eligibility/validate?"+serialise.obj(i)+"",dataType:"json"}).done(function(n){var u=n.IsValidationPassed,f=n.IsCheckboxChecked,t=n.IsMembershipNumberCorrect,s=i.variant,r=!0;switch(s){case"1":r=u===!0&&f===!1&&(t===!1||t===null);break;case"2":r=u===!0&&f===!0&&(t===!1||t===null);break;case"3":r=u===!0&&f===!0&&t===!0;break;default:r=u===!1&&f===!1&&t===!1}r?(o.hide(),window.location=decodeURIComponent(v)):e.removeClass("processing")}).fail(function(){n.find(".wrapper").html("<h5>"+o.data("defaultmessage")+"<\/h5>")})})}function t(n){var i=parseInt(n.find("#day-number").val(),10),r=parseInt(n.find("#month-number").val(),10),u=parseInt(n.find("#year-number").val(),10),t=new Date(u,r-1,i),f=new Date;this.fullDateOfBirth=n.find('input[name="DateOfBirth"]').map(function(){return this.value}).get().join("/");this.isValid=function(){return t.getFullYear()===u&&t.getMonth()+1===r&&t.getDate()===i&&t<=f};this.isFutureDate=function(){return t>f};this.isLeapYear=function(){return t.getFullYear()===u&&t.getMonth()+1===r&&t.getDate()===i}}function y(){var i=$(this),r=i.find(".dob-input"),u=r.closest(".form-field"),f=u.find('[data-custom-validation="future"]'),e=u.find('[data-custom-validation="leapYear"]'),n=i.find(".date-of-birth-group"),o=new t(i);r.on("change",function(){r.closest(".dob-group").hasClass("error")?n.addClass("error"):n.removeClass("error future-date-error leap-year-error")});o.isFutureDate()?(f.show(),n.addClass("future-date-error"),i.submit(function(n){n.preventDefault()})):(f.hide(),n.removeClass("future-date-error"));o.isLeapYear()?(e.hide(),n.removeClass("leap-year-error")):(e.show(),n.addClass("leap-year-error"),i.submit(function(n){n.preventDefault()}))}function p(){var e=$(this),i=window.aa.helpers.cache.cachedElements.$body.find("#update-password"),n=window.aa.helpers.cache.cachedElements.$body.find("#associate-account"),r=window.aa.helpers.cache.cachedElements.$body.find("#update-email-address"),o=e.find(".strength-meter"),h=e.find("#new-password"),s=o.find("#strength-weak").val(),c=o.find("#strength-good").val(),l=o.find("#strength-strong").val(),u,f;if($("#update-password").length){boot.loadScript("strength-meter.min.js","libs",function(){h.strength({mainTemplate:'<div class="password-checker-container" data-stylish-form="true">{input}<span class="meter-container">{meter}<\/span><\/div>',containerClass:"password-meter",showMeter:!0,showToggle:!1,meterClass:"score-meter",scoreBarClass:"scorebar",verdictTitles:[s,s,s,c,c,l],verdictClasses:["weak","weak","weak","good","good","strong"]});$(".meter-container").appendTo(o);stylishForms.update()});i.find('input[type="submit"]').off("click").on("click",function(n){var t=$(this),r=i.find(".service-error-failed"),u=i.find(".service-error-message"),f=serialise.jQueryData(i,"serialise-form");(n.preventDefault(),r.add(u).hide(),formValidation.api[i.data("id")].validateForm(),i.hasClass("errors")&&h.strength("verdict")<3)||(t.prop("disabled",!0).addClass("disabled processing"),window.aa.helpers.saveAccountForm("/cms/ajax/api/accountsettings/updatepassword",i,f,u,r,t))})}if($("#update-email-address").length)r.find('input[type="submit"]').off("click").on("click",function(n){var t=$(this),i=r.find(".service-error-failed"),u=r.find(".service-error-message"),f=serialise.jQueryData(r,"serialise-form");(n.preventDefault(),u.add(i).hide(),formValidation.api[r.data("id")].validateForm(),r.hasClass("errors"))||(t.prop("disabled",!0).addClass("disabled processing"),window.aa.helpers.saveAccountForm("/cms/ajax/api/AccountSettings/UpdateEmail",r,f,u,i,t))});if($("#associate-account").length){u=n.find('[name="FirstName"]');f=n.find('[name="LastName"]');function i(n){n.val("")}function r(){var n=$(this);n.val(n.val().replace("&#39;","'"))}u.add(f).each(r);n.find('input[type="submit"]').off("click").on("click",function(i){var u=n.find('input[type="submit"]'),f=n.find(".service-error-failed"),o=n.find(".service-error-message"),s=new t(e),r;(i.preventDefault(),o.add(f).hide(),formValidation.api[n.data("id")].validateForm(),e.each(y),!n.hasClass("errors")&&s.isValid())&&(r=serialise.jQueryData(n,"serialise-form"),r.DateOfBirth=s.fullDateOfBirth,u.prop("disabled",!0).addClass("disabled processing"),window.aa.helpers.saveAccountForm("/cms/ajax/api/Registration/AssociateFrUserInCmd",n,r,o,f,u))});u.add(f).off("click").on("click",function(){i($(this))});window.aa.helpers.cache.cachedElements.$document.on({keyup:function(n){n.which===9&(!u.is(n.target)||!f.is(n.target))&&(u.has(n.target).length===0||f.has(n.target).length===0)&&i($(n.target))}})}}function w(){function u(){var u={Name:n.find("#Name").val(),Email:n.find("#Email").val(),CustomerMessage:n.find("#customer-message").val(),__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()};$.ajax({method:"POST",url:"/cms/ajax/api/hospitality/sendfeedback",data:u}).done(function(){n.find("form").hide();t.removeClass("disabled processing");r.show()}).fail(function(){t.removeClass("disabled processing");i.show()})}var n=$(this),t=n.find(".full-submit"),r=n.closest(".accordion-content").find(".results"),i=n.find(".service-error-failed");t.on("click",function(n){n.preventDefault();t.addClass("disabled processing");i.hide();u()})}function w(){function u(){var u={Name:n.find("#Name").val(),Email:n.find("#Email").val(),CustomerMessage:n.find("#customer-message").val(),__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()};$.ajax({method:"POST",url:"/cms/ajax/api/hospitality/sendfeedback",data:u}).done(function(){n.find("form").hide();t.removeClass("disabled processing");r.show()}).fail(function(){t.removeClass("disabled processing");i.show()})}var n=$(this),t=n.find(".full-submit"),r=n.closest(".accordion-content").find(".results"),i=n.find(".service-error-failed");t.on("click",function(n){n.preventDefault();t.addClass("disabled processing");i.hide();u()})}function b(){function u(){aa.helpers.cache.registerCookie.check("userFeedbackForm")?f():(t=!0,aa.helpers.cache.cachedElements.$main.children().attr("aria-hidden","true"),n.add(i).attr("aria-hidden","false").addClass("active"),aa.helpers.cache.registerCookie.write("userFeedbackForm",t,n.data("expiry")))}function f(){t=!1;aa.helpers.cache.cachedElements.$main.children().attr("aria-hidden","false");n.add(i).attr("aria-hidden","true").removeClass("active");aa.helpers.cache.cachedElements.$main.find(".user-feedback-view").add(aa.helpers.cache.cachedElements.$footer.find(".user-feedback-view")).removeClass("user-feedback-view")}function e(){var t=serialise.jQueryData(n,"serialise-form");t.QualitativeFeedbackQuestion=n.find(".form-field.character-limit").find("label").text();$.ajax({method:"POST",contentType:"application/json",url:"/cms/ajax/api/UserFeedbackForm/SendFeedBack",data:JSON.stringify(t)}).done(f)}var n=$(this),i=$("#nav-overlay"),r,t=!1;if(n.add(i).attr("aria-hidden","true"),aa.helpers.cache.cachedElements.$body.addClass("feedback-form"),n.data("on-time-has-elapsed")&&(r=setTimeout(u,n.data("delayed-time")*1e3)),!aa.helpers.cache.registerCookie.check("userFeedbackForm")&&n.data("on-page-exit")){aa.salesJourneyApp.helpers.pushDataToHistory("formShown",t);aa.helpers.cache.cachedElements.$main.find("a").add(aa.helpers.cache.cachedElements.$footer.find("a")).addClass("user-feedback-view");$(window).on("popstate",function(){clearTimeout(r);u()})}aa.helpers.cache.cachedElements.$main.find(".user-feedback-view").add(aa.helpers.cache.cachedElements.$footer.find(".user-feedback-view")).on("click",function(n){$(this).hasClass("user-feedback-view")&&n.preventDefault();clearTimeout(r);u();t=!1});n.find(".close").add(i).add(n.find(".text-button")).on("click",function(n){n.preventDefault();clearTimeout(r);f();t&&history.back()});n.find(".cta").find('input[type="submit"]').on("click",function(n){n.preventDefault();e()})}function k(){let o=$(this),t=o.find('input[type="text"]#countryName'),s=o.find('input[type="submit"]'),i=o.parents(".ebc-coutry-search"),h=i.find("#search"),a=i.find(".check-another-country"),n=i.find("#SearchPass"),u=i.find("#SearchFail"),f=n.find(".tab-group-country ul.tabs-list"),e=n.find(".tab-coutry-map ul"),c,r;$.expr[":"].contains=$.expr.createPseudo(function(n){return function(t){return $(t).text().toUpperCase().indexOf(n.toUpperCase())>=0}});$.ajax({type:"GET",url:"/cms/ajax/fragment/DestinationChecker/DestinationCheckerUniqueList",dataType:"JSON"}).done(function(n){c=n;t.autocomplete({source:c,minLength:2,autoFocus:!0,appendTo:".ebc-destination-checker .field"})}).fail(function(n){console.log(n)});t.on({focusin:function(){$(this).parents(".form-field").removeClass("hasError");$(this).parents(".form-field").find(".error-msges div").hide()},keyup:function(){$(this).trigger("click")}});let l=function(){t.val(t.val().replace(/^[^a-zA-ZÜü]*/,""))};t.keyup(l).blur(l);s.on("click",function(i){if(i.preventDefault(),i.stopImmediatePropagation(),r=t.val().trimEnd(),r==""){$(this).parents(".form-field").addClass("hasError");$(this).parents(".form-field").find(".error-msges div").show();return}$(this).addClass("disabled processing").attr("disabled",!0);$.ajax({type:"POST",url:"/cms/ajax/fragment/DestinationChecker/DestinationCheckerDisplayResult",dataType:"json",data:{countryName:r}}).done(function(i){if(i.Covered){let t="",u=i.Zone,o;f.find("li").hide();for(let n=0;n<u.length;n++)u.length-n==1?u.length===1?t+=i.Zone[n]:t=t.replace(/,\s*$/,"")+(" and "+i.Zone[n]):t+=i.Zone[n]+", ",f.find("li[id='"+i.Zone[n]+"']").show();n.find("p:first span#country").empty();n.find("p:first span#zones").empty();n.find("p:first span#country").append(i.CountryName);n.find("p:first span#zones").append(t);o=u[0].split(" ");h.hide();f.find("li").removeClass("active");f.find("li:nth-child("+o[1]+")").addClass("active");e.find("li").removeClass("active");e.find("li:nth-child("+o[1]+")").addClass("active");e.find("li ul li:contains("+r+")").addClass("highlighted");n.show()}else u.find("p:first span#country-uncovered").empty(),u.find("p:first span#country-uncovered").append(r),u.show(),h.hide();t.val("");s.removeClass("disabled processing").attr("disabled",!1)}).fail(function(){s.removeClass("disabled processing").attr("disabled",!1)})});a.on("click",function(t){t.preventDefault();n.hide();u.hide();e.find("li ul li:contains("+r+")").removeClass("highlighted");$(this).parents(i).find(h).show();window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:i.first().offset().top-75},1e3)})}var n=$(this);n.find(".form-field").each(i);n.filter(".battery-form").each(r);n.filter(".call-me-back-form").each(u);n.filter(".mancon-form").each(l);n.filter(".account-management").each(p);n.filter(".feedback-form").each(w);$(".terms-and-conditions").find(n).each(a);$(".loan-eligibility-check").find(n).each(v);n.filter(".user-feedback-form").each(b);n.filter(".registration-form").each(e);n.filter(".registration-email").each(o);n.filter(".registration-Userdetail").each(s);n.filter(".loan-payment-form").each(f);n.filter(".account-association").each(h);n.filter(".account-association-details").each(accountAssociationDetailsForm);n.filter(".vrn-check").each(c);$(".ebc-coutry-search").find(n).each(k)}function initWffmFormElements(){var n=$(this),i=n.find("input, textarea"),t=n.find("select"),r=n.find(".help-block").not(".field-validation-error, .field-validation-valid");r.each(function(){$(this).hide().siblings("label.control-label").addClass("info-block")});n.find(".info-block").on({click:function(n){n.preventDefault();$(this).siblings(".help-block").not(".field-validation-error, .field-validation-valid").slideToggle()}});i.on("keyup",function(n){n.which===16||n.which===9||n.which===13});t.on("click",function(){$(this).toggleClass("selected")});i.filter('[type="checkbox"]').add(i.filter('[type="radio"]')).on("click",function(){var n=$(this);n.closest("label").parent(".checkbox").add(n.closest("label")).toggleClass("checked");n.filter('[type="radio"]').closest("label").parent(".radio").addClass("checked");n.filter('[type="radio"]').closest(".radio").siblings().children("label").parent().removeClass("checked")});window.aa.helpers.cache.cachedElements.$document.on({click:function(n){t.is(n.target)||t.has(n.target).length!==0||t.removeClass("selected")}})}function accountAssociationDetailsForm(){var n=$(this),t=n.find("#account-association-details"),i=t.find(".full-submit");formValidation.api[n.data("id")].events.full=function(r){if(!formValidation.api[n.data("id")].events.formPost&&r){var u=window.location.origin;i.addClass("disabled processing");formValidation.api[n.data("id")].events.formPost=$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/AssociateAccountDetailsCapture",dataType:"html",data:t.serialize().replace(/%0D%0A/g,"%2C+"),success:function(t){JSON.parse(t).IsOkay?window.location.href=u+"/products/#successassoc":(i.removeClass("disabled processing").attr("disabled",!1),window.location.href=u+"/create-account/your-policy");window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100);i.removeClass("disabled processing");formValidation.api[n.data("id")].events.formPost=null}})}};t.on("submit",function(n){n.preventDefault()})}function AssociateVehicleBeneficiary(n){var e,o,s,h,c,l,a,v,y,u;if(n===undefined){var t=$("#hdnPolicySession").data("value"),i=$("#hiddenPolicyNumberAfterEdit").val(),f=$("#dvMainOld input[name='AssociationViewModel.Title']:checked").val(),r=$("#dvMain input[name='AssociationViewModel.Title']:checked").val();e=f!==r&&r===undefined?f:r;o=$(".first-name").val();s=$(".last-name").val();h=$("#dvMainOld #number-day").val()!==$("#dvMain #number-day1").val()&&$("#dvMain #number-day1").val()===""?$("#dvMainOld #number-day").val():$("#dvMain #number-day1").val();c=$("#dvMainOld #number-month").val()!==$("#dvMain #number-month1").val()&&$("#dvMain #number-month1").val()===""?$("#dvMainOld #number-month").val():$("#dvMain #number-month1").val();l=$("#dvMainOld #number-year").val()!==$("#dvMain #number-year1").val()&&$("#dvMain #number-year1").val()===""?$("#dvMainOld #number-year").val():$("#dvMain #number-year1").val();a=$("#dvMainOld #Telephone").val()!==$("#dvMain #Telephone1").val()&&$("#dvMain #Telephone1").val()===""?$("#dvMainOld #Telephone").val():$("#dvMain #Telephone1").val();v=$("#dvMainOld #HomePostcode").val()!==$("#dvMain #HomePostcode1").val()&&$("#dvMain #HomePostcode1").val()===""?$("#dvMainOld #HomePostcode").val():$("#dvMain #HomePostcode1").val();y=$("#dvMainOld #membership").val()!==$("#dvMain #membership1").val()&&$("#dvMain #membership1").val()===""?$("#dvMainOld #membership").val():$("#dvMain #membership1").val();t!==i&&i!==""&&(t=i);u={Title:e,FirstName:o,LastName:s,Postcode:v,PolicyNumber:t,DayOfBirth:h,MonthOfBirth:c,YearOfBirth:l,PhoneNumber:a}}else u=n;$("#loader").show();$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/AssociateVehicleBeneficiary",dataType:"json",data:u,success:function(n){if(n.IsOkay){var t=window.location.origin;window.location.href=t+"/products/#successassoc"}else $("#dvHaveMembershipNo").hide(),$("#dvPushTocallVB").parent().parent(".row").css("display","block"),$("#dvPushTocallVB").show(),$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){n!==null&&utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/vehicle_policyholder_not_found",error_message:"vehicle policyholder not found, forgerock_ID:"+n})}}),$("#loader").hide(),window.location.href=window.location.href+"#notvb"},error:function(){$("#dvHaveMembershipNo").hide();$("#dvPushTocallVB").parent().parent(".row").css("display","block");$("#dvPushTocallVB").show();$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){n!==null&&utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/vehicle_policyholder_not_found",error_message:"vehicle policyholder not found, forgerock_ID:"+n})}});$("#loader").hide();window.location.href=window.location.href+"#notvb"}})}function setUrlBack(){var t=window.location.href,n=new Array(2);n=t.split("#",2);(n[1]==="fail"||n[1]==="success"||n[1]==="alreadyaccount"||n[1]==="vrnfail"||n[1]==="notvb"||n[1]==="successassoc"||n[1]==="alreadyassociated"||n[1]==="associationfail")&&(t=t.split("#",1),history.pushState(null,null,t))}function setAssociationUrlBack(){var n=window.location.href,t=new Array(2);t=n.split("#",2);(t[1]==="fail"||t[1]==="alreadyassociated")&&(n=n.split("#",1),history.pushState(null,null,n))}function ValidationSummaryMover(){function t(){var t=document.getElementsByClassName(n);return t==null||t.length===0?(console.info("No matching div was found to move the validation summary."),null):t[0]}function i(){var n=document.getElementsByClassName("validation-summary-valid");return!n||n.length===0?(console.info("No validation summary was found."),null):n[0]}function r(){var n=i(),r;n&&(r=t(),r)&&(n.remove(),r.append(n),console.info("Validation summary moved to placeholder."))}var n="validation-summary-placeholder";this.init=function(){if(document.getElementsByClassName(n)&&document.getElementsByClassName(n).length>0){r();return}console.info("No validation summary placeholder found.")}}var Cookie,$selectedIndexMainPolicyHolderGrp,validationSummaryMover;$(window).on("popstate",function(){setTimeout(function(){$(".pg-vehicles h5.vehicle-quote ").is(":empty")&&($(".pg-vehicles-display").css("display","none"),$(".pg-vehicles").css("display","none"))},3e3)});$(document).on("click","#app-progress-bar .journey-steps .step",function(){setTimeout(function(){$(".pg-vehicles h5.vehicle-quote ").is(":empty")&&($(".pg-vehicles-display").css("display","none"),$(".pg-vehicles").css("display","none"))},3e3)});$(document).on("click","#sales-journey-header .journey-steps .step",function(){setTimeout(function(){$(".pg-vehicles h5.vehicle-quote ").is(":empty")&&($(".pg-vehicles-display").css("display","none"),$(".pg-vehicles").css("display","none"))},3e3)});$(document).on("click",".full-submit",function(){setTimeout(function(){$(".pg-vehicles h5.vehicle-quote ").is(":empty")&&($(".pg-vehicles-display").css("display","none"),$(".pg-vehicles").css("display","none"))},3e3)});if(window.boot||(window.boot={}),window.boot=new function(){return this.config={},this.config.global="/Assets/scripts/libs/",this.config.local="/Assets/scripts/libs/codehouse-js/",this.config.cdn="",this.loadScript=function(n,t,i){function u(n,t){("loaded"===n.readyState||"complete"===n.readyState)&&t()}var f=-1!=navigator.appVersion.indexOf("MSIE 10"),r=document.createElement("script"),e=t?this.config[t]:this.config.local;r.type="text/javascript";r.src=e+n;document.body.appendChild(r);r.addEventListener&&!f?i&&r.addEventListener("load",function(){i()},!1):r.attachEvent&&i&&r.attachEvent("onreadystatechange",function(){r.onload=r.onreadystatechange=null;u(r,i)})},this},"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";var t=n.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4");}(jQuery);+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(void 0!==i.style[t])return{end:n[t]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one("bsTransitionEnd",function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){n.support.transition=t();n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery);+function(n){"use strict";function u(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));"string"==typeof i&&u[i].call(r)})}var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.VERSION="3.3.7";t.TRANSITION_DURATION=150;t.prototype.close=function(i){function e(){r.detach().trigger("closed.bs.alert").remove()}var f=n(this),u=f.attr("data-target"),r;u||(u=f.attr("href"),u=u&&u.replace(/.*(?=#[^\s]*$)/,""));r=n("#"===u?[]:u);i&&i.preventDefault();r.length||(r=f.closest(".alert"));r.trigger(i=n.Event("close.bs.alert"));i.isDefaultPrevented()||(r.removeClass("in"),n.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e())};r=n.fn.alert;n.fn.alert=u;n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f="object"==typeof i&&i;r||u.data("bs.button",r=new t(this,f));"toggle"==i?r.toggle():i&&r.setState(i)})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},r;t.VERSION="3.3.7";t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var i="disabled",r=this.$element,f=r.is("input")?"val":"html",u=r.data();t+="Text";null==u.resetText&&r.data("resetText",r[f]());setTimeout(n.proxy(function(){r[f](null==u[t]?this.options[t]:u[t]);"loadingText"==t?(this.isLoading=!0,r.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,r.removeClass(i).removeAttr(i).prop(i,!1))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length?(n=this.$element.find("input"),"radio"==n.prop("type")?(n.prop("checked")&&(t=!1),i.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),t&&n.trigger("change")):(this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active"))};r=n.fn.button;n.fn.button=i;n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=r,this};n(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=n(t.target).closest(".btn");i.call(r,"toggle");n(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),r.is("input,button")?r.trigger("focus"):r.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){n(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=null;this.sliding=null;this.interval=null;this.$active=null;this.$items=null;this.options.keyboard&&this.$element.on("keydown.bs.carousel",n.proxy(this.keydown,this));"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},u,r;t.VERSION="3.3.7";t.TRANSITION_DURATION=600;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0};t.prototype.keydown=function(n){if(!/input|textarea/i.test(n.target.tagName)){switch(n.which){case 37:this.prev();break;case 39:this.next();break;default:return}n.preventDefault()}};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getItemIndex=function(n){return this.$items=n.parent().children(".item"),this.$items.index(n||this.$active)};t.prototype.getItemForDirection=function(n,t){var i=this.getItemIndex(t),f="prev"==n&&0===i||"next"==n&&i==this.$items.length-1,r,u;return f&&!this.options.wrap?t:(r="prev"==n?-1:1,u=(i+r)%this.$items.length,this.$items.eq(u))};t.prototype.to=function(n){var i=this,t=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(n>this.$items.length-1||n<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){i.to(n)}):t==n?this.pause().cycle():this.slide(n>t?"next":"prev",this.$items.eq(n))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(i,r){var e=this.$element.find(".item.active"),u=r||this.getItemForDirection(i,e),l=this.interval,f="next"==i?"left":"right",a=this,o,s,h,c;return u.hasClass("active")?this.sliding=!1:(o=u[0],s=n.Event("slide.bs.carousel",{relatedTarget:o,direction:f}),(this.$element.trigger(s),!s.isDefaultPrevented())?((this.sliding=!0,l&&this.pause(),this.$indicators.length)&&(this.$indicators.find(".active").removeClass("active"),h=n(this.$indicators.children()[this.getItemIndex(u)]),h&&h.addClass("active")),c=n.Event("slid.bs.carousel",{relatedTarget:o,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(u.addClass(i),u[0].offsetWidth,e.addClass(f),u.addClass(f),e.one("bsTransitionEnd",function(){u.removeClass([i,f].join(" ")).addClass("active");e.removeClass(["active",f].join(" "));a.sliding=!1;setTimeout(function(){a.$element.trigger(c)},0)}).emulateTransitionEnd(t.TRANSITION_DURATION)):(e.removeClass("active"),u.addClass("active"),this.sliding=!1,this.$element.trigger(c)),l&&this.cycle(),this):void 0)};u=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=u,this};r=function(t){var o,r=n(this),u=n(r.attr("data-target")||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,"")),e,f;u.hasClass("carousel")&&(e=n.extend({},u.data(),r.data()),f=r.attr("data-slide-to"),f&&(e.interval=!1),i.call(u,e),f&&u.data("bs.carousel").to(f),t.preventDefault())};n(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r);n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function r(t){var i,r=t.attr("data-target")||(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return n(r)}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i);!r&&f.toggle&&/show|hide/.test(i)&&(f.toggle=!1);r||u.data("bs.collapse",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.$trigger=n('[data-toggle="collapse"][href="#'+i.id+'"],[data-toggle="collapse"][data-target="#'+i.id+'"]');this.transitioning=null;this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger);this.options.toggle&&this.toggle()},u;t.VERSION="3.3.7";t.TRANSITION_DURATION=350;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var f,r,e,u,o,s;if(!this.transitioning&&!this.$element.hasClass("in")&&(r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing"),!(r&&r.length&&(f=r.data("bs.collapse"),f&&f.transitioning))&&(e=n.Event("show.bs.collapse"),this.$element.trigger(e),!e.isDefaultPrevented()))){if(r&&r.length&&(i.call(r,"hide"),f||r.data("bs.collapse",null)),u=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[u](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1,o=function(){this.$element.removeClass("collapsing").addClass("collapse in")[u]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return o.call(this);s=n.camelCase(["scroll",u].join("-"));this.$element.one("bsTransitionEnd",n.proxy(o,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[u](this.$element[0][s])}};t.prototype.hide=function(){var r,i,u;if(!this.transitioning&&this.$element.hasClass("in")&&(r=n.Event("hide.bs.collapse"),this.$element.trigger(r),!r.isDefaultPrevented()))return i=this.dimension(),this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1,u=function(){this.transitioning=0;this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")},n.support.transition?void this.$element[i](0).one("bsTransitionEnd",n.proxy(u,this)).emulateTransitionEnd(t.TRANSITION_DURATION):u.call(this)};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};t.prototype.getParent=function(){return n(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(n.proxy(function(t,i){var u=n(i);this.addAriaAndCollapsedClass(r(u),u)},this)).end()};t.prototype.addAriaAndCollapsedClass=function(n,t){var i=n.hasClass("in");n.attr("aria-expanded",i);t.toggleClass("collapsed",!i).attr("aria-expanded",i)};u=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=u,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var u=n(this);u.attr("data-target")||t.preventDefault();var f=r(u),e=f.data("bs.collapse"),o=e?"toggle":u.data();i.call(f,o)})}(jQuery);+function(n){"use strict";function r(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}function u(t){t&&3===t.which||(n(o).remove(),n(i).each(function(){var u=n(this),i=r(u),f={relatedTarget:this};i.hasClass("open")&&(t&&"click"==t.type&&/input|textarea/i.test(t.target.tagName)&&n.contains(i[0],t.target)||(i.trigger(t=n.Event("hide.bs.dropdown",f)),t.isDefaultPrevented()||(u.attr("aria-expanded","false"),i.removeClass("open").trigger(n.Event("hidden.bs.dropdown",f)))))}))}function e(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));"string"==typeof i&&u[i].call(r)})}var o=".dropdown-backdrop",i='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.3.7";t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=r(f),o=i.hasClass("open"),u(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(n(this)).on("click",u),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus").attr("aria-expanded","true");i.toggleClass("open").trigger(n.Event("shown.bs.dropdown",e))}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,u;if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=r(e),s=o.hasClass("open"),!s&&27!=t.which||s&&27==t.which)return 27==t.which&&o.find(i).trigger("focus"),e.trigger("click");h=" li:not(.disabled):visible a";f=o.find(".dropdown-menu"+h);f.length&&(u=f.index(t.target),38==t.which&&u>0&&u--,40==t.which&&u<f.length-1&&u++,~u||(u=0),f.eq(u).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=e;n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",u).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i,t.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",t.prototype.keydown)}(jQuery);+function(n){"use strict";function i(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),"object"==typeof i&&i);u||f.data("bs.modal",u=new t(this,e));"string"==typeof i?u[i](r):e.show&&u.show(r)})}var t=function(t,i){this.options=i;this.$body=n(document.body);this.$element=n(t);this.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=!1;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},r;t.VERSION="3.3.7";t.TRANSITION_DURATION=300;t.BACKDROP_TRANSITION_DURATION=150;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this.isShown?this.hide():this.show(n)};t.prototype.show=function(i){var r=this,u=n.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(u);this.isShown||u.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open-add"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){n(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var f=n.support.transition&&r.$element.hasClass("fade"),u;r.$element.parent().length||r.$element.appendTo(r.$body);r.$element.show().scrollTop(0);r.adjustDialog();f&&r.$element[0].offsetWidth;r.$element.addClass("in");r.enforceFocus();u=n.Event("shown.bs.modal",{relatedTarget:i});f?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(u)}).emulateTransitionEnd(t.TRANSITION_DURATION):r.$element.trigger("focus").trigger(u)}))};t.prototype.hide=function(i){i&&i.preventDefault();i=n.Event("hide.bs.modal");this.$element.trigger(i);this.isShown&&!i.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(t.TRANSITION_DURATION):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){document===n.target||this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.trigger("focus")},this))};t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",n.proxy(function(n){27==n.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")};t.prototype.resize=function(){this.isShown?n(window).on("resize.bs.modal",n.proxy(this.handleUpdate,this)):n(window).off("resize.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$body.removeClass("modal-open-add");n.resetAdjustments();n.resetScrollbar();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(i){var e=this,f=this.$element.hasClass("fade")?"fade":"",r,u;if(this.isShown&&this.options.backdrop){if(r=n.support.transition&&f,this.$backdrop=n(document.createElement("div")).addClass("modal-backdrop "+f).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(n.target===n.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),r&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!i)return;r?this.$backdrop.one("bsTransitionEnd",i).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):i()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),u=function(){e.removeBackdrop();i&&i()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",u).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):u()):i&&i()};t.prototype.handleUpdate=function(){this.adjustDialog()};t.prototype.adjustDialog=function(){var n=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&n?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!n?this.scrollbarWidth:""})};t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};t.prototype.checkScrollbar=function(){var n=window.innerWidth,t;n||(t=document.documentElement.getBoundingClientRect(),n=t.right-Math.abs(t.left));this.bodyIsOverflowing=document.body.clientWidth<n;this.scrollbarWidth=this.measureScrollbar()};t.prototype.setScrollbar=function(){var n=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";this.bodyIsOverflowing&&this.$body.css("padding-right",n+this.scrollbarWidth)};t.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)};t.prototype.measureScrollbar=function(){var n=document.createElement("div"),t;return n.className="modal-scrollbar-measure",this.$body.append(n),t=n.offsetWidth-n.clientWidth,this.$body[0].removeChild(n),t};r=n.fn.modal;n.fn.modal=i;n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=r,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=n(this),f=r.attr("href"),u=n(r.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,"")),e=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(f)&&f},u.data(),r.data());r.is("a")&&t.preventDefault();u.one("show.bs.modal",function(n){n.isDefaultPrevented()||u.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})});i.call(u,e,this)})}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f="object"==typeof i&&i;!r&&/destroy|hide/.test(i)||(r||u.data("bs.tooltip",r=new t(this,f)),"string"==typeof i&&r[i]())})}var t=function(n,t){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init("tooltip",n,t)},i;t.VERSION="3.3.7";t.TRANSITION_DURATION=150;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}};t.prototype.init=function(t,i,r){var f,e,u,o,s;if(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(n.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focusin",s="hover"==u?"mouseleave":"focusout",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusin"==t.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())};t.prototype.isInStateTrue=function(){for(var n in this.inState)if(this.inState[n])return!0;return!1};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusout"==t.type?"focus":"hover"]=!1),!i.isInStateTrue())return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()};t.prototype.show=function(){var c=n.Event("show.bs."+this.type),l,p,e,w,h;if(this.hasContent()&&this.enabled){if(this.$element.trigger(c),l=n.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]),c.isDefaultPrevented()||!l)return;var u=this,r=this.tip(),a=this.getUID(this.type);this.setContent();r.attr("id",a);this.$element.attr("aria-describedby",a);this.options.animation&&r.addClass("fade");var i="function"==typeof this.options.placement?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement,v=/\s?auto?\s?/i,y=v.test(i);y&&(i=i.replace(v,"")||"top");r.detach().css({top:0,left:0,display:"block"}).addClass(i).data("bs."+this.type,this);this.options.container?r.appendTo(this.options.container):r.insertAfter(this.$element);this.$element.trigger("inserted.bs."+this.type);var f=this.getPosition(),o=r[0].offsetWidth,s=r[0].offsetHeight;y&&(p=i,e=this.getPosition(this.$viewport),i="bottom"==i&&f.bottom+s>e.bottom?"top":"top"==i&&f.top-s<e.top?"bottom":"right"==i&&f.right+o>e.width?"left":"left"==i&&f.left-o<e.left?"right":i,r.removeClass(p).addClass(i));w=this.getCalculatedOffset(i,f,o,s);this.applyPlacement(w,i);h=function(){var n=u.hoverState;u.$element.trigger("shown.bs."+u.type);u.hoverState=null;"out"==n&&u.leave(u)};n.support.transition&&this.$tip.hasClass("fade")?r.one("bsTransitionEnd",h).emulateTransitionEnd(t.TRANSITION_DURATION):h()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top+=o;t.left+=s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;"top"==i&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var c=/top|bottom/.test(i),a=c?2*u.left-l+h:2*u.top-e+f,v=c?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(a,r[0][v],c)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i?"left":"top",50*(1-n/t)+"%").css(i?"top":"left","")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(i){function f(){"in"!=r.hoverState&&u.detach();r.$element&&r.$element.removeAttr("aria-describedby").trigger("hidden.bs."+r.type);i&&i()}var r=this,u=n(this.$tip),e=n.Event("hide.bs."+this.type);if(this.$element.trigger(e),!e.isDefaultPrevented())return u.removeClass("in"),n.support.transition&&u.hasClass("fade")?u.one("bsTransitionEnd",f).emulateTransitionEnd(t.TRANSITION_DURATION):f(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){t=t||this.$element;var r=t[0],u="BODY"==r.tagName,i=r.getBoundingClientRect();null==i.width&&(i=n.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var f=window.SVGElement&&r instanceof window.SVGElement,e=u?{top:0,left:0}:f?null:t.offset(),o={scroll:u?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},s=u?{width:n(window).width(),height:n(window).height()}:null;return n.extend({},i,o,s,e)};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.right&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(1e6*Math.random());while(document.getElementById(n));return n};t.prototype.tip=function(){if(!this.$tip&&(this.$tip=n(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&(i=n(t.currentTarget).data("bs."+this.type),i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));t?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){var n=this;clearTimeout(this.timeout);this.hide(function(){n.$element.off("."+n.type).removeData("bs."+n.type);n.$tip&&n.$tip.detach();n.$tip=null;n.$arrow=null;n.$viewport=null;n.$element=null})};i=n.fn.tooltip;n.fn.tooltip=r;n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f="object"==typeof i&&i;!r&&/destroy|hide/.test(i)||(r||u.data("bs.popover",r=new t(this,f)),"string"==typeof i&&r[i]())})}var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.3.7";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof t?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||("function"==typeof n.content?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};i=n.fn.popover;n.fn.popover=r;n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";function t(i,r){this.$body=n(document.body);this.$scrollElement=n(n(i).is(document.body)?window:i);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",n.proxy(this.process,this));this.refresh();this.process()}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f="object"==typeof i&&i;r||u.data("bs.scrollspy",r=new t(this,f));"string"==typeof i&&r[i]()})}t.VERSION="3.3.7";t.DEFAULTS={offset:10};t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};t.prototype.refresh=function(){var t=this,i="offset",r=0;this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();n.isWindow(this.$scrollElement[0])||(i="position",r=this.$scrollElement.scrollTop());this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),t=/^#./.test(u)&&n(u);return t&&t.length&&t.is(":visible")&&[[t[i]().top+r,u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var n,i=this.$scrollElement.scrollTop()+this.options.offset,f=this.getScrollHeight(),e=this.options.offset+f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget;if(this.scrollHeight!=f&&this.refresh(),i>=e)return u!=(n=r[r.length-1])&&this.activate(n);if(u&&i<t[0])return this.activeTarget=null,this.clear();for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(void 0===t[n+1]||i<t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;this.clear();var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};t.prototype.clear=function(){n(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var r=n.fn.scrollspy;n.fn.scrollspy=i;n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=r,this};n(window).on("load.bs.scrollspy.data-api",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));"string"==typeof i&&r[i]()})}var t=function(t){this.element=n(t)},u,i;t.VERSION="3.3.7";t.TRANSITION_DURATION=150;t.prototype.show=function(){var t=this.element,f=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),u;if(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=f.find(".active:last a"),e=n.Event("hide.bs.tab",{relatedTarget:t[0]}),o=n.Event("show.bs.tab",{relatedTarget:r[0]});(r.trigger(e),t.trigger(o),o.isDefaultPrevented()||e.isDefaultPrevented())||(u=n(i),this.activate(t.closest("li"),f),this.activate(u,u.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:t[0]});t.trigger({type:"shown.bs.tab",relatedTarget:r[0]})}))}};t.prototype.activate=function(i,r,u){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1);i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0);o?(i[0].offsetWidth,i.addClass("in")):i.removeClass("fade");i.parent(".dropdown-menu").length&&i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0);u&&u()}var f=r.find("> .active"),o=u&&n.support.transition&&(f.length&&f.hasClass("fade")||!!r.find("> .fade").length);f.length&&o?f.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e();f.removeClass("in")};u=n.fn.tab;n.fn.tab=r;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=u,this};i=function(t){t.preventDefault();r.call(n(this),"show")};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f="object"==typeof i&&i;r||u.data("bs.affix",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$target=n(this.options.target).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=null;this.unpin=null;this.pinnedOffset=null;this.checkPosition()},r;t.VERSION="3.3.7";t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0,target:window};t.prototype.getState=function(n,t,i,r){var u=this.$target.scrollTop(),f=this.$element.offset(),e=this.$target.height();if(null!=i&&"top"==this.affixed)return u<i&&"top";if("bottom"==this.affixed)return null!=i?!(u+this.unpin<=f.top)&&"bottom":!(u+e<=n-r)&&"bottom";var o=null==this.affixed,s=o?u:f.top,h=o?e:t;return null!=i&&u<=i?"top":null!=r&&s+h>=n-r&&"bottom"};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,o;if(this.$element.is(":visible")){var s=this.$element.height(),r=this.options.offset,f=r.top,u=r.bottom,h=Math.max(n(document).height(),n(document.body).height());if("object"!=typeof r&&(u=f=r),"function"==typeof f&&(f=r.top(this.$element)),"function"==typeof u&&(u=r.bottom(this.$element)),i=this.getState(h,s,f,u),this.affixed!=i){if(null!=this.unpin&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),o=n.Event(e+".bs.affix"),this.$element.trigger(o),o.isDefaultPrevented())return;this.affixed=i;this.unpin="bottom"==i?this.getPinnedOffset():null;this.$element.removeClass(t.RESET).addClass(e).trigger(e.replace("affix","affixed")+".bs.affix")}"bottom"==i&&this.$element.offset({top:h-s-u})}};r=n.fn.affix;n.fn.affix=i;n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=r,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var r=n(this),t=r.data();t.offset=t.offset||{};null!=t.offsetBottom&&(t.offset.bottom=t.offsetBottom);null!=t.offsetTop&&(t.offset.top=t.offsetTop);i.call(r,t)})})}(jQuery);window.client||(window.client={});window.client=new function(){var n=navigator.userAgent.toLowerCase(),r=document.createElement("div"),i={iPad:"ipad",iPhone:"iphone",iOS:"iphone|ipad|ipod",Mac:"intel mac",Chrome:"chrome",Firefox:"firefox",IE:"msie|rv:11",IE7:"msie 7.0",IE8:"msie 8.0",IE9:"msie 9.0",IE10:"msie 10.0",IE11:"rv:11.0",OldIE:"msie 7.0|msie 8.0",Opera:"opera|opr",Android:"android",Mobile:"android|webos|iphone|ipad|ipod|blackberry|windows phone|iemobile",WindowsPhone:"windows phone"},t=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"],u=function(){function s(n,t){var i=t.charAt(0).toUpperCase();return n["webkit"+i]||n[t]||n["moz"+i]||n["ms"+i]||function(n){setTimeout(n,60)}}var u={},h="",e,c,f,o;for(e in i)c=new RegExp(i[e],["i"]),u[e]=c.test(n);for(f in t)if(void 0!==r.style[t[f]]){u.Perspective=t[f];u.CSSVendorPrefix="-"+t[f].replace("Perspective","").toLowerCase()+"-";break}u.Safari=n.indexOf("chrome")>-1?!1:n.indexOf("safari")>-1;u.HighDef=window.devicePixelRatio>1;u.RequestAnimationId=s(window,"requestAnimationFrame");u.CancelAnimationId=s(window,"cancelAnimationFrame");u.iOSVersion=u.iOS?parseFloat(n.split(" os ")[1].split(" ")[0].replace("_",".")):void 0;for(o in u)u[o]&&(h+=" "+o.toLowerCase());return u.domApply=function(){document.documentElement.className+=h},u};return new u};Cookie=function(){this.read=function(){var i,r,t,u,f;if(!document.cookie)return!1;for(i=[],r=document.cookie.split(/; */),t=0;t<r.length;t++)u=r[t].split("="),f=new n(u[0],u[1]),i.push(f);return i};this.write=function(n,t,i){var r,u;i!=undefined&&(r=new Date,r.setDate(r.getDate()+i),u="; expires="+r.toUTCString());document.cookie=i!==undefined?n+"="+t+u+";path=/":n+"="+t+";path=/"};this.check=function(n){var t=this.read();for(var i in t)if(t[i].name===n)return t[i].value;return undefined};this.erase=function(n){var t,i;if(n!==undefined)this.write(n,"",-1);else{t=this.read();for(i in t)this.write(t[i].name,"",-1)}};var n=function(n,t){this.name=n;this.value=t}};window.aa||(window.aa={});window.aa.helpers={cache:{cachedElements:new function(){this.$window=$(window);this.$document=$(document);this.$html=$("html");this.$body=$("body");this.$main=$("#main");this.$footer=$("#site-footer");this.isExperienceEditor=this.$body.hasClass("experience-editor");this.url=window.location.pathname},constants:{TABLET_LANDSCAPE:1024,TABLET_BREAKPOINT:880,MOBILE_BREAKPOINT:737},registerCookie:new Cookie},truncateText:function(n,t){var i=n.trim().substring(0,t).split(" ").slice(0,-1).join(" ");return n.length>t?i:!1},showResults:function(n,t){n.stop().fadeIn(100,function(){t.removeClass("loading")})},hideResults:function(n,t,i){n.stop().fadeOut(100,function(){t.removeClass("loading");i===!0&&n.empty()})},autoComplete:function(n){function v(){var i=n.url.replace("{value}",t);f=$.ajax({url:i,type:"GET",success:n.onSuccess,error:function(){window.aa.helpers.hideResults(n.$resultsContainer,n.$loadingElem)}})}function c(){a?v():n.onSuccess()}function o(){f&&f.abort();u&&clearTimeout(u)}function l(n){return $.trim(n.replace(/[*|&;$%@"<>()+,]/g,""))}var a=typeof n.url!="undefined",s=new RegExp(/ 13 | 27 | 38 | 40 /i),i,r,u,f,h,t,e={upAndDown:function(t){n.preventArrowBehaviour||(window.aa.helpers.autoCompleteArrowKeyHelper(n.$resultsContainer.find("li").not(".hide"),t),window.aa.helpers.placeItemInViewHelper(n.$resultsContainer.find(".focus"),n.$resultsContainer.children("ul")))},13:n.onEnter,27:function(){n.$input.trigger("blur")},38:function(){e.upAndDown(!0)},40:function(){e.upAndDown(!1)}};n.$input.on({keypress:function(n){s.test(" "+n.keyCode+" ")||/^[a-zA-Z0-9- ]*$/.test($(this).val())===!1?n.preventDefault():o()},keyup:function(i){var r=i.keyCode;if(t=l(n.$input.val()),h=t,s.test(" "+r+" ")){e[r]();return}o();t.length>=n.characterCount?(n.$loadingElem.addClass("loading"),u=setTimeout(function(){c(t)},150)):window.aa.helpers.hideResults(n.$resultsContainer,n.$loadingElem)},blur:function(){i||(r=setTimeout(function(){o();window.aa.helpers.hideResults(n.$resultsContainer,n.$loadingElem,!1);typeof n.onBlur=="function"&&n.onBlur()},100))},focus:function(){t=l(n.$input.val());r&&clearTimeout(r);t.length>=n.characterCount&&n.$resultsContainer[0].innerHTML!==""&&(t===h?window.aa.helpers.showResults(n.$resultsContainer,n.$loadingElem):c(t));typeof n.onFocus=="function"&&n.onFocus()}});n.$resultsContainer.on({mousedown:function(){i=!0},mouseup:function(){n.$input.trigger("focus");i=!1}})},autoCompleteArrowKeyHelper:function(n,t){for(var i=-1,r=0;r<n.length;r+=1)if($(n[r]).hasClass("focus")){i=r;break}if(i!==-1){if(n.removeClass("focus"),t){i!==0&&n.eq(i-1).addClass("focus");return}i!==n.length-1&&n.eq(i+1).addClass("focus")}else{if(t){n.last().addClass("focus");return}n.first().addClass("focus")}},placeItemInViewHelper:function(n,t){var r,i,u,f,o,e;n.length&&(n.length>1&&(n=n.first()),t=t||$(n[0].offsetParent),r=t.outerHeight(),i=n.position().top,u=n.outerHeight(),f=i<0,o=i+u>r,(f||o)&&(e=t.scrollTop(),f?t.stop().animate({scrollTop:e+i},100):t.stop().animate({scrollTop:e+(i-r+u)},100)))},getTallestHeightHelper:function(n){return Math.max.apply(Math,n.map(function(){return $(this).outerHeight()}))},panelHeight:function(){function t(n){n.height("");n.height(function(){return Math.max.apply(Math,n.map(function(){return $(this).height()}))})}var i=$(this),n;window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT||window.aa.helpers.cache.cachedElements.isExperienceEditor||(n=i.closest(".two-column"),t(n.find(".beam")),t(n.find(".info")),t(n.find(".features")))},accordions:function(){function r(){function l(){u.stop().slideUp(function(){r.stop().addClass("open").slideDown(250)})}function o(){r.stop().removeClass("open").slideUp(function(){u.stop().slideDown(250)})}function a(){n.siblings().children(".accordion-content").stop().removeClass("open").slideUp(function(){n.siblings().children(".accordion-summary").slideDown(250)})}function s(){n.hasClass("active")?i.animating===!0?u.length?l():r.stop().addClass("open").slideDown(250):u.length?o():r.stop().removeClass("open").hide():u.length?o():r.stop().removeClass("open").slideUp(250)}function h(t){t.preventDefault();n.toggleClass("active");s()}function f(n,t){var i,f;if(n.preventDefault(),i=$(n.target).is("a")?$(n.target):$(n.target).parents("a"),!i.length){t(n);return}var r=i.attr("id").replace("accordionTitle_","accordionText_"),u=$(document).find("#"+r),e=u.find(".inner").length?u.find(".inner"):u,o=e.html().trim().length;o?t(n):(f=i.attr("href"),window.aa.pageContentCache?(c(r),t(n)):$.get(f,function(i){var u=$.parseHTML(i);window.aa.pageContentCache=$(u);c(r);t(n)}))}function c(n){var i=$(window.aa.pageContentCache).find("#"+n),t=$(document).find("#"+n);t.html($(i).html());v(t)}function v(n){for(var r,i=window.aa.salesJourneyApp.accordionContentDownloadHandlers||[],t=0;t<i.length;t++)r=!1,i[t].isHandler&&typeof i[t].isHandler=="function"&&(r=i[t].isHandler(n)),r&&i[t].performAction&&typeof i[t].performAction=="function"&&i[t].performAction(n)}var n=$(this),e=n.find(".accordion-header"),r=n.find(".accordion-content"),u=n.find(".accordion-summary");if(r.hasClass("open")&&(r.show(),u.hide()),window.aa.helpers.cache.cachedElements.isExperienceEditor&&(t.addClass("active"),r.stop().addClass("open").show(),u.show()),window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT){e.click(function(t){t.preventDefault();f(t,function(){n.toggleClass("active").siblings().removeClass("active");u.length?a():n.siblings().children(".accordion-content").removeClass("open").slideUp(250);s()})});return}e.on({click:function(n){f(n,h)},keypress:function(n){(n.keyCode===13||n.which===13)&&f(n,h)}})}var n=$(this),t=n.find(".accordion-item"),i=n.data();window.aa.pageContentCache=null;window.aa.helpers.registerAccordionContentDownloadHandlers();t.each(r)},registerAccordionContentDownloadHandlers:function(){window.aa.salesJourneyApp.accordionContentDownloadHandlers=[];var n={isHandler:function(n){var t=n.find(".call-me-back-form");return t&&t.length&&!t.attr("data-id")},performAction:function(n){var t=n.find(".call-me-back-form");try{formValidation.init();t.each(initFormElements)}catch(i){console.log(i)}}};window.aa.salesJourneyApp.accordionContentDownloadHandlers.push(n)},moduleAccordion:function(){var n=$(this),i=n.find(".module-accordion-content"),t=n.find(".module-accordion-summary");if(window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT||$(".desktop-enabled").length){t.length&&(n.hasClass("active")?(i.show(),t.hide()):(t.show(),i.hide()));openbydefaultlinkvalue=n.hasClass("openbydefault");openbydefaultlinkvalue&&(i.css("display","block").slideDown(300),t.slideUp(300),n.toggleClass("active").siblings().removeClass("active"));n.find(".module-accordion-header").on("click",function(){n.toggleClass("active").siblings().removeClass("active");n.siblings().find(".module-accordion-content").stop().slideUp(300,function(){n.siblings().find(".module-accordion-summary").stop().slideDown(300)});n.hasClass("active")?t.length?t.stop().slideUp(300,function(){i.stop().slideDown(300)}):i.stop().slideDown(300):t.length?i.stop().slideUp(300,function(){t.stop().slideDown(300)}):i.stop().slideUp(300)});n.find(".module-accordion-header-sublink").on("click",function(){n.toggleClass("active").siblings().removeClass("active");n.siblings().find(".module-accordion-content").stop().slideUp(300,function(){n.siblings().find(".module-accordion-summary").stop().slideDown(300)});n.hasClass("active")?t.length?t.stop().slideUp(300,function(){i.stop().slideDown(300)}):i.stop().slideDown(300):t.length?i.stop().slideUp(300,function(){t.stop().slideDown(300)}):i.stop().slideUp(300)})}},saveAccountForm:function(n,t,i,r,u,f){function o(n){var i=t.find(".success-result");n.IsOkay?(i.show().find(".result-msg").html('<span class="info-check"><\/span>'+n.Message),e=setTimeout(function(){t.find(".success-result").hide();window.location.href=n.SuccessRedirect},n.SuccessMessageExpiry*1e3)):(t.find(".service-error-message").text(n.Message).show(),t.find(".service-error-failed").hide());f.prop("disabled",!1).removeClass("disabled processing")}function s(n){f.prop("disabled",!1).removeClass("disabled processing");typeof n.responseJSON=="undefined"||typeof n.responseJSON.IsOkay=="undefined"||n.responseJSON.IsOkay?t.find(".service-error-failed").show():(t.find(".service-error-message").text(n.responseJSON.Message).show(),t.find(".service-error-failed").hide())}var e;$.ajax({type:"POST",url:n,contentType:"application/json",dataType:"json",data:JSON.stringify(i)}).done(o).fail(s)},youtubeLightbox:function(){var n=window.aa.helpers.cache.cachedElements.$main.find("#youtube-lightbox"),u=n.find(".youtube-video"),e=u.find(".video-container"),r=window.aa.helpers.cache.cachedElements.$main.find(".cinemagraph-container button.play-media"),f=n.find("button.close-media"),t=n.find("iframe"),i;r.on({click:function(r){var f=t.prop("src");r.preventDefault();window.aa.salesJourneyApp.helpers.isDefined(f)&&(f+="&autoplay=1",clearTimeout(i),window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&u.stop().animate({scrollTop:250}),window.aa.helpers.cache.cachedElements.$body.addClass("youtube-hero-on"),t.stop().fadeIn(250).prop("src",f),e.animate({opacity:1},800),i=setTimeout(function(){n.stop().fadeIn(250).attr("aria-hidden",!1).addClass("active")},150))}});f.on({click:function(r){var u=t.prop("src");r.preventDefault();clearTimeout(i);window.aa.salesJourneyApp.helpers.isDefined(u)&&(u=u.replace("&autoplay=1",""),t.prop("src",u),n.stop().fadeOut(400).attr("aria-hidden",!0).removeClass("active"),window.aa.helpers.cache.cachedElements.$body.removeClass("youtube-hero-on"),i=setTimeout(function(){t.hide()},150))}});window.aa.helpers.cache.cachedElements.$document.on("keyup",function(n){r.is(n.target&&n.which===13)&&r.trigger("click");window.aa.helpers.cache.cachedElements.$body.is(".youtube-hero-on")&&n.which===27&&f.trigger("click")})},initThousandsFormatting:function(n,t){$(n).each(function(){function r(){i=n.val().split(",").join("");n.removeClass("masked");i!==""&&t.test(i)?n.is(".thousands-format")&&t.test(i)&&(i.length>3?n.val(function(n,t){return t.replace(/\D/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,",")}):n.val(i)):(n.addClass("masked"),n.val(n.val().slice(0,-1)).removeClass("masked").focus())}var n=$(this),i;r();n.on({input:function(n){n.which!==37&&n.which!==38&&n.which!==39&&n.which!==40&&n.which!==9&&n.which!==13&&n.which!==16&&n.which!==46&&n.which!==32&&n.which!==8&&(n.which!==17||n.which!==86)&&(n.which!==17||n.which!==65)&&r()}})})}};window.FormValidation||(window.FormValidation={});window.FormValidation.Application=function(){"use strict";function t(){this.submit=!1;this.valid=!0}String.prototype.toBool=function(){return!/^(false|0)$/i.test(this)};var i=function(i,r){var w=!1,f=i,y=null,k=null,d=null,st=null,ht=null,at=null,u={form:new t,segs:[],activeSeg:0,id:"modForm_"+r,customRules:{},disabledSegs:0},ft={data:[]},s=null,o=void 0,et=void 0,g=void 0,p=!0,b={},h=void 0,c=[],ot=0,nt=0,tt=!1,it={},vt=function(){for(var t,r=FormValidation.Manifest.Externals.manifest,i=0;i<r.length;i+=1)t=r[i],"undefined"==typeof FormValidation.Manifest[t.className]&&n.handle(n.fact.loadRuleExtensionFile+": "+t.className),n.safe(e.extensions.registerRule,[t.className],{msg:"ruleExtension",param:t.filename});e.set();e._dom();pt()},e={inline:void 0,summary:void 0,instantFeedback:void 0,serverErrorMessage:void 0,extensions:{registerRule:function(n){var t=new window.FormValidation.Manifest[n];for(var i in t)"function"==typeof t[i]&&(rt.rules[i]=t[i])}},set:function(){e.inline=f.attr("data-inline-errors");e.summary=f.attr("data-error-summary").toBool();e.instantFeedback=f.attr("data-instant-feedback").toBool();e.serverErrorMessage=f.attr("data-server-error-message");y=f.find(".form-section");k=y.find(".form-field");d=k.find("input, select, textarea");ht=f.find("[data-custom-regex]");at=f.find(".error-summary");for(var n=0;n<y.length;n+=1)u.segs.push(new t);b={};b.full=new Function;f.attr("data-id",u.id);i.find(".form-section").each(function(n){var t="batch_"+(n+1);$(this).attr("data-id",t);b[t]=new Function})},_status:{get:function(n,t){return u.segs[n][t]},set:function(n,t,i){if("undefined"!=typeof i)return void(u.segs[i][n]=t);for(var r in u.segs)u.segs[r][n]=t},setSubmitted:function(n,t){this.set("submit",n,t)},setValidity:function(n,t){this.set("valid",n,t)}},_dom:function(){ht.each(function(n){var t=$(this),r=new RegExp(t.data("custom-regex")),i=(n+1+(new Date).getTime()).toString().split("").sort(function(){return.5-Math.random()}).join("");u.customRules[i]=r;t.data("custom-regex",i)});y.each(function(){$(this).attr("data-section-id",arguments[0])})}},yt={complexObject:function(n){function r(n,t){for(var i in t)try{n[i]=t[i].constructor==Object?r(n[i],t[i]):t[i]}catch(u){n[i]=t[i]}return n}function u(n,t){for(var r={},i=0;i<n.length;i+=1)r[n[i]]=i===n.length-1?t:{},r=r[n[i]];return{}}var i={};for(var t in n)-1!==t.indexOf(".")?i=r(i,u(t.split("."),n[t])):i[t]=n[t];return i}},pt=function(){function s(){t=!0;setTimeout(function(){t=!1},100)}function h(n){t||(st=n,o="blur",u.disabledSegs=0,l.formSection(n.closest(".form-section")))}function i(n){o="partial";s();e._status.setSubmitted(!0,n.data("section-id"));u.disabledSegs=0;l.formSection(n)}function r(){o="full";ot=0;u.disabledSegs=y.filter(".disabled").length;e._status.setSubmitted(!0);l._formValid()}var n,t=!1;d.on({change:function(){h($(this))},focus:function(){u.activeSeg=$(this).closest(".form-section").data("section-id");n=$(this)},blur:function(){n=void 0}});f.find(".partial-submit").on({click:function(n){n.preventDefault();i($(this).closest(".form-section"))},mousedown:function(t){t.preventDefault();"undefined"!=typeof n&&n.blur();i($(this).closest(".form-section"))}});f.find(".full-submit").on({click:function(n){n.preventDefault();r()},mousedown:function(t){t.preventDefault();"undefined"!=typeof n&&n.blur();r()},focus:function(){u.activeSeg="complete"}});f.find(".form-clear").click(function(n){n.preventDefault();lt()});f.keydown(function(t){var i=$(t.target);(i.is('a[href="#"]')||"undefined"!=typeof n&&!n.is("textarea"))&&(13!==t.which||i.hasClass("form-clear")||i.closest(".actions").length||(t.preventDefault(),i.closest(".form-section").find(".full-submit, .partial-submit").click()))})},l={_formValid:function(){f.find(".form-section").each(function(){l.formSection($(this))})},formSection:function(n){var t;h=n||h;h.hasClass("disabled")?ct(h):(t=h.data(),nt=0,c=[],s=null,et=t.batchValidation,g=t.sectionId,h.find(".form-field").each(function(){l._formField($(this),t,!1,h.find(".form-field").length)}),null===s&&(l.endPointer(),ot+=1))},_formField:function(n,t,i,r){a._run(n,n.parents(".form-section"),r,t)},endPointer:function(){p?v._finalFormCheck(h):v._finalActions()}},a={_run:function(n,t,i,r){var f=nt===i-1,u=n.find("input, select, textarea").is(":disabled");if(u||(a._rules(n),a._clientResultHandler(ft.data,n),ft={data:[]}),nt+=1,!u){if(c.length>0||"blur"===o)return void(s=null);if(f&&null!==s&&t.data("batch-validation")===!0)return a._serverValidate(r.endpoint,s,t),nt=0,void(e.summary&&v._summaryErrorMessageHandler())}},_rules:function(t){var r,u,o="undefined"==typeof t.data("required")?!0:t.data("required"),f=("object"==typeof t.data("validation")?JSON.stringify(t.data("validation")):t.data("validation"))||"",e=t.data("type"),h=t.find(".field"),i;if("undefined"!=typeof e)if(r=n.safe(rt.dataValue[e],[h],{msg:"dataType",param:e}),(rt.rules.required(r)||o)&&""!=f)for(u=f.split("|"),i=0;i<u.length;i+=1)"server"!==u[i]?ft.data.push(n.safe(a._clientValidate,[u[i],r,t],{msg:"ruleConfig",param:u[i]})):(null===s&&(s={}),s[t.attr("data-field-id")]=r);else-1!==f.indexOf("server")&&(null===s&&(s={}),s[t.attr("data-field-id")]=r)},_clientValidate:function(n,t,i){var f,r={},u=i.data();return"{"===n.charAt(0)&&(r=$.parseJSON(n),n=r.rule,r=r.val),u.customRegex&&"regex"===n&&(r=u.customRegex),!u["for"]||"confirm"!==n&&"confirmStrict"!==n&&"different"!==n&&"differentStrict"!==n||(r.target=h.find("#"+u["for"]).val()),f=rt.rules[n](t,r,i),{state:f,rule:n}},_serverValidate:function(t,i,r){var f,u=r.attr("data-batch-name");return"undefined"==typeof u?(n.log(n.fact.Batchname),void a._serverResultHandler({Errors:[]},r)):(i=yt.complexObject(i),f="undefined"!=typeof FormValidation.Manifest.OutBound&&"undefined"!=typeof FormValidation.Manifest.OutBound[u]?FormValidation.Manifest.OutBound[u](i):i,""===t||"undefined"==typeof t?(n.log(n.fact.Endpoint),void a._serverResultHandler({Errors:[]},r)):void(tt||(tt=!0,r.addClass("pending"),$.ajax({url:t,data:JSON.stringify(f),cache:!1,type:"POST",contentType:"application/json"}).done(function(n){var t;tt=!1;it=n;w&&window.console&&console.log("server response:",it);r.removeClass("pending");"undefined"!=typeof FormValidation.Manifest.InBound&&(t="undefined"!=typeof FormValidation.Manifest.InBound[u]?FormValidation.Manifest.InBound[u](n):n,a._serverResultHandler(t,r),s=null)}).fail(function(){tt=!1;r.removeClass("pending");"undefined"==typeof e.serverErrorMessage?n.handle(n.fact.Server):a._serverResultHandler({Errors:[e.serverErrorMessage]},r)}))))},_clientResultHandler:function(n,t){var r=!0,i=0;if(0===n.length)return void v._clientErrorMessageHandler(t,!0);this.resultRulesEngine();do 0==n[i].state&&(c.push(n[i].rule),r=!1),v._clientErrorMessageHandler(t,n[i].state,n[i].rule),i+=1;while(i<n.length&&r===!0)},_serverResultHandler:function(n,t){var i=t.find(".form-section-errors"),r;if(this.resultRulesEngine(),i.empty(),n.Errors.length>0){for(r=0;r<n.Errors.length;r+=1)v._serverErrorMessageHandler(n.Errors[r],i),c.push("server");p&&i.addClass("errors")}else p&&i.removeClass("errors");l.endPointer()},resultRulesEngine:function(){et&&"blur"===o&&!u.segs[g].submit?(w&&ut("action result factors:","batch, blur, not submitted"),p=!1):(w&&!et&&"blur"===o&&u.segs[g].submit&&ut("action result factors:","not batch && isBlur, has submitted"),p=!0)}},v={_clientErrorMessageHandler:function(n,t,i){(p||e.instantFeedback===!0&&"blur"===o&&st.closest(".form-field")[0]===n[0])&&(n.removeClass("error"),"true"===e.inline&&(n.find(".err-msgs").children("div").hide(),t||(n.addClass("error"),"undefined"!=typeof i&&n.find(".err-msgs").children('div[data-validation="'+i+'"]').show())))},_serverErrorMessageHandler:function(n,t){p&&t.append("<div>"+n+"<\/div>")},_summaryErrorMessageHandler:function(){},_finalFormCheck:function(n){var i=0===c.length,t;for(e._status.setValidity(i,n.data("section-id")),n.toggleClass("errors",!i),u.form.valid=!0,t=0;t<u.segs.length;t+=1)if(u.segs[t].valid===!1){u.form.valid=!1;break}f.toggleClass("errors",!u.form.valid);this._finalActions()},_finalActions:function(){var t=0===c.length,n="full"===o,i=ot===y.length-1-u.disabledSegs;return t||"blur"===o||f.find('input[type="password"], [data-sensitive="true"] input').val(void 0),w&&ut("section: "+(h.data("section-id")+1)+", submit: ",o+", fails: "+c.length),n&&t&&i&&(c=[],w&&ut("form passed")),(!n||n&&i)&&(c=[]),n||"blur"===o?void(n&&i&&b.full(u.form.valid,f,it)):void b["batch_"+(g+1)](t,h,it)}},ct=function(n){e._status.setValidity(!0,n.data("section-id"));n.removeClass("errors");v._clientErrorMessageHandler(n.find(".form-field.error"),!0)},lt=function(){e._status.setSubmitted(!1);k.removeClass("error");y.removeClass("errors valid");f.removeClass("errors");v._clientErrorMessageHandler(k,!0);d.val(void 0);d.filter("select").each(function(){var n=!1;$(this).find("option").each(function(){if(this.defaultSelected)return(this.selected=!0,n=!0,!1)});n||($(this)[0].options[0].selected=!0);$(this).change()})},rt={dataValue:{hidden:function(n){return n.find("input").val()},number:function(n){return n.find("input").val()},text:function(n){return n.find("input").val()},multiline:function(n){return n.find("textarea").val()},email:function(n){return n.find("input").val()},radio:function(n){return n.find('input[type="radio"]:checked').index('input[type="radio"]')+1},select:function(n){return n.find("select").children("option:selected").data("value")},selectGroup:function(n){return n.find("select").find("option:selected").parent().data("group-id")},checkbox:function(n){return n.find('input[type="checkbox"]:checked').length},multi:function(n){var t="";return n.find("input").each(function(){t+=$(this).val()}),t}},dataValueFriendly:{number:function(n){return n.find("input").val()},text:function(n){return n.find("input").val()},multiline:function(n){return n.find("textarea").val()},email:function(n){return n.find("input").val()},radio:function(n){return n.find('input[type="radio"]:checked').length>0||""},select:function(n){return n.find("select").children("option:selected").text()},selectGroup:function(n){return n.find("select").find("option:selected").val()},checkbox:function(n){return n.find('input[type="checkbox"]:checked').length>0||""},multi:function(n){var t="";return n.find("input").each(function(){t+=$(this).val()}),t}},rules:{number:function(n){return"string"==typeof n&&-1!=n.indexOf(",")&&(n=n.replace(",",".")),!isNaN(parseFloat(n))&&isFinite(n)},minLength:function(n,t){return n.length>=t},maxLength:function(n,t){return n.length<=t},min:function(n,t){return n>=t},max:function(n,t){return t>=n},required:function(n){return""!=n&&-1!=n&&null!=n},alpha:function(n){return/^[a-zA-Z\s]+$/.test(n)},range:function(n,t){return n>=t.min&&n<=t.max},email:function(n){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)},match:function(n,t){return n==t},checked:function(n){return n>0},unchecked:function(n){return 0===n},confirm:function(n,t){return n.toLowerCase()==t.target.toLowerCase()},confirmStrict:function(n,t){return n==t.target},different:function(n,t){return n.toLowerCase()!=t.target.toLowerCase()},differentStrict:function(n,t){return n!=t.target},regex:function(n,t){return u.customRules[t].test(n)}}},ut=function(){var n=[];for(var t in arguments)n.push(arguments[t]);window.console&&console.log(n.join(""))};vt();this.id=u.id;this.api={events:b,validateBatch:function(n){return o="partial",l.formSection(n)},validateForm:function(){return o="submit",l._formValid()},clearForm:lt,clearSeg:ct,debug:function(n){"boolean"==typeof n&&(w=n)}}},r=function(){var n={};$(".mod-form").each(function(t){var r=new i($(this),t+=1);n[r.id]=r.api});window.FormValidation.Application.prototype.api=n},n={fact:{bootDependency:"FormValidation requires boot.js version 3.0.0 +",dataType:"data type does not exist for field",ruleConfig:"Validation rule configuration contains errors for field",Server:"Service error",Endpoint:"Invalid endpoint",Batchname:"Invalid batch-name",ruleExtension:"Invalid rule extension configuration in ",loadRuleExtensionFile:"FormValidation requires to load rules extension file",outBound:"OutBound Object Literal has property missing for batch name",inBound:"InBound Object Literal has property missing for batch name"},safe:function(n,t,i){try{return n.apply(this,t)}catch(r){this.handle(this.fact[i.msg]+": '"+(i.param||"")+"'")}},log:function(n){window.console&&console.info(n)},handle:function(n){throw new Error(n);}};this.init=function(){var t;return window.boot||window.toolkit.boot?(t=window.boot||window.toolkit.boot,t.config.FormValidation=FormValidation.Manifest.ExtensionPath,window.FormValidation.Manifest.OutBound===!0&&t.loadScript("extensions-outbound.js","FormValidation"),window.FormValidation.Manifest.InBound===!0&&t.loadScript("extensions-inbound.js","FormValidation"),void r(this)):void n.handle(n.fact.bootDependency)}};window.FormValidation.Manifest=function(n){function t(){this.manifest=[];this.register=function(n,t){this.manifest.push({className:n,filename:t})}}return window.formValidation=window.formValidation||new window.FormValidation.Application,n.init=window.formValidation.init,{Externals:new t,ExtensionPath:"",OutBound:!1,InBound:!1}}(window.FormValidation);$.ajaxPrefilter(function(n){var i,r,t;try{i="";r=n.url.toString().substring(0,n.url.toString().indexOf("?")>1?n.url.toString().indexOf("?"):n.url.toString().lenght);JSON.stringify(window.aa.salesJourneyApp.constants.api).indexOf(r)>1&&(t=sessionStorage.getItem("clientSessionKey"),t||(t="396e0c46-09e4-4b19-97db-bd423774a4b3"),i=n.url.indexOf("?")==-1?"?":"&",n.url=n.url+i+"ClientIdentifier="+t+"&TabIdentifier="+window.name.slice(0,100))}catch(u){}});window.aa||(window.aa={});window.aa.salesJourneyApp||(window.aa.salesJourneyApp={application:{},config:{viewRegistry:["PostcodePicker","AppHeader","ProgressBar","OneVrnModal","MultipleVrnModal","OfferModal","NotFoundVrnModal","UnknownDimensionsVrn","NotEligibleVrn","VrnDetails","ErrorModal","HelpMeChooseQuestion","OneVrnLookup","MultipleVrnLookup","PricingSummaryPromoMessage","OptionsPromoMessage","EligibilityPromoBanner","PaymentOptionsPromoMessage","PaymentOptionPrice","StartAgainModal","DirectDebitPayment","AdditionalVrn","VrnSearchCoverDetails","SmartBreakdownOneVrnModal","SmartBreakdownVehicleListItem","NotEligiblePngVrn"],partsAndGarageProductCode:"",basicCoverProductCode:"PRD_UK_0020",redirectionUrl:""},constants:{api:{VerifyClientSession:"/cms/ajax/api/SalesJourney/VerifyClientSession",HtmlTemplateHandlerUtility:"/cms/ajax/api/SalesJourney/GetHtmlTemplate",GetJourneyHeader:"/cms/ajax/api/SalesJourney/GetHeader",GetStepViewModel:"/cms/ajax/api/SalesJourney/GetStepViewModel",GetCurrentStepViewModel:"/cms/ajax/api/SalesJourney/GetCurrentStep",GetNextStepViewModel:"/cms/ajax/api/SalesJourney/GetNextStep",GetPreviousStepViewModel:"/cms/ajax/api/SalesJourney/GetPreviousStep",GetTaggingDataLayer:"/cms/ajax/api/SalesJourney/GetTaggingDataLayer",SaveCoverTypes:"/cms/ajax/api/SalesJourney/SaveCoverType",GetEligibleOffer:"/cms/ajax/api/SalesJourney/GetEligibleOffer",SaveOfferTypes:"/cms/ajax/api/SalesJourney/SaveOfferTypes",SaveCoverOptions:"/cms/ajax/api/SalesJourney/SaveCoverOptions",SaveCoverDetails:"/cms/ajax/api/SalesJourney/SaveCoverageDetails",SaveContactDetails:"/cms/ajax/api/SalesJourney/SaveContactDetails",SavePersonalDetails:"/cms/ajax/api/SalesJourney/SavePersonalDetails",SaveAdditionalMemberDetails:"/cms/ajax/api/SalesJourney/SaveAdditionalMemberDetails",SaveAdditionalDetails:"/cms/ajax/api/SalesJourney/SaveAdditionalDetails",SavePaymentFrequency:"/cms/ajax/api/SalesJourney/SavePaymentFrequency",SavePaymentOptions:"/cms/ajax/api/SalesJourney/SavePaymentOptions",SaveDirectDebitDetails:"/cms/ajax/api/SalesJourney/SaveDirectDebitDetails",SaveDirectDebitWithSignatureDetails:"/cms/ajax/api/SalesJourney/SaveDirectDebitWithSignatureDetails",SaveProceedPayment:"/cms/ajax/api/SalesJourney/SaveProceedPayment",SaveProceedWithSignaturePayment:"/cms/ajax/api/SalesJourney/SaveProceedPaymentWithSignature",SaveSurveyQuestion:"/cms/ajax/api/SalesJourney/SaveSurveyQuestion",SaveVehiclesList:"/cms/ajax/api/SalesJourney/SaveVehiclesList",SaveNeedsAssessment:"/cms/ajax/api/SalesJourney/SaveNeedsAssessment",SavePromotionalQuestion:"/cms/ajax/api/SalesJourney/SavePromotionalQuestion",SaveProductRecommendation:"/cms/ajax/api/SalesJourney/SaveProductRecommendation",FindVehicleDetails:"/cms/ajax/api/SalesJourney/FindVehicle",GetIndicativePrice:"/cms/ajax/api/SalesJourney/GetIndicativePrice",GetAllMakesAndModels:"/cms/ajax/api/SalesJourney/GetAllMakesAndModels",GetAddress:"/cms/ajax/api/SalesJourney/GetAddress",GetVrnBlockDisplayState:"/cms/ajax/api/SalesJourney/GetVrnLightboxDisplayState",StartAgain:"/cms/ajax/api/SalesJourney/StartAgain",CloseSession:"/cms/ajax/api/SalesJourney/CloseSession",GetTermAndCondition:"/cms/ajax/api/SalesJourney/GetTermAndCondition",SetAgentLocation:"/cms/ajax/api/SalesJourney/SetAgentLocation",SetCancelSale:"/cms/ajax/api/SalesJourney/SetCancelSale",saveMarketingPreferences:"/cms/ajax/api/SalesJourney/SaveMarketingPreferences",SaveSmartCoverOptions:"/cms/ajax/api/SalesJourney/SaveSmartCoverOptions",CheckCompatibility:"/cms/ajax/api/SalesJourney/CheckCompatibility",GetPatrolDetails:"/cms/ajax/api/SalesJourney/GetPatrolDetails",GetVehicleModelDiP:"/cms/ajax/api/SalesJourney/GetDIPModel",GetDipVehicleDetails:"/cms/ajax/api/SalesJourney/GetDipVehicleDetails",SavePaymentStatus:"/cms/ajax/api/SalesJourney/SavePaymentStatus",PollForMembershipNumber:"/cms/ajax/api/SalesJourney/PollForMembership"},regex:{alphanumeric:new RegExp(/^[a-zA-Z0-9\s]+$/),numeric:new RegExp(/^[0-9]*$/),numericWithDashes:new RegExp(/^[0-9-]*$/),numericWithCommas:new RegExp(/^[0-9,]*$/),days:new RegExp(/^(0[1-9]|[1-9]|[12][0-9]|3[01])$/),months:new RegExp(/^(0[1-9]|1[0-2]|[1-9])$/),dobyear:new RegExp(/^\d{4}$/),years:new RegExp(/(19|20)\d\d$/),postCode:new RegExp(/^[A-Z]{1,2}[0-9R][0-9A-Z]?[0-9][ABD-HJLNP-UW-Z]{2}|[A-Z]{1,2}[0-9R][0-9A-Z]?[0-9][ABD-HJLNP-UW-Z]{2}|[a-z]{1,2}[0-9r][0-9a-z]?[0-9][abd-hjlnp-uw-z]{2}|[a-z]{1,2}[0-9r][0-9a-z]?[0-9][abd-hjlnp-uw-z]{2}|[a-z]{1,2}[0-9r][0-9a-z]?[0-9][abd-hjlnp-uw-z]{2}|[aA-zZ]{1,2}[0-9rR][0-9aA-zZ]?[0-9][aAbBdD-hHjJlLnNpP-uUwW-zZ]{2}$|[aA-zZ]{1,2}[0-9rR][0-9aA-zZ]? [0-9][aAbBdD-hHjJlLnNpP-uUwW-zZ]/),registrationNumber:new RegExp(/^(([A-Za-z]{1,2}[ ]?[0-9]{1,4})|([A-Za-z]{3}[ ]?[0-9]{1,3})|([0-9]{1,3}[ ]?[A-Za-z]{3})|([0-9]{1,4}[ ]?[A-Za-z]{1,2})|([A-Za-z]{3}[ ]?[0-9]{1,3}[ ]?[A-Za-z])|([A-Za-z][ ]?[0-9]{1,3}[ ]?[A-Za-z]{3})|([A-Za-z]{2}[ ]?[0-9]{2}[ ]?[A-Za-z]{3})|([A-Za-z]{3}[ ]?[0-9]{4}))$/),telephoneNumber:new RegExp(/^(?!\s)[0-9()]+$/),telephoneNumberRegister:new RegExp(/^(?!\s)[0-9+]+$/),postcodeRegister:new RegExp(/^(?!\s)[0-9a-zA-Z0-9]*$/),fullName:new RegExp(/^[a-zA-Z\x2C\x2D\x2E\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/)}},cache:new function(){this.$main=window.aa.helpers.cache.cachedElements.$main;this.$blocks=this.$main.find("#blocks");this.$loader=this.$main.find("#loader");this.$modalScreen=this.$main.find("#modal-app-screen");this.$modalContentPlaceholder=this.$modalScreen.find("#modal-app-placeholder");this.$accordionItems=this.$main.find('div.accordion script[type="text/mustache"]');this.$accordionPlaceholder=this.$accordionItems.first().parentsUntil(this.$main,"div.row");this.scrollPosition=0;this.currentStep=0;this.activeStep=0;this.allowNextStepNavigation=!1;this.yearlyByCardPaymentOption=!1;this.saveBlockInProgress=!1;this.savingCompleted=!1;this.currentStepLoaded=!1;this.partAndGarageIsSet=!1;this.formsData=[];this.activeVrnFields=[];this.serviceError=!1;this.hidePricingLoader=!1;this.serviceRequest={};this.flag=!1;this.getResponseFromPrice=!1;this.PriceingService=undefined},cachedViewModels:[],loadedScripts:[],modules:{},models:{},views:{},helpers:{}});aa.salesJourneyApp.Application=function(){function u(r){function f(){u+=1;u===e&&typeof r=="function"&&r()}var e=t.find('[data-scripts-loaded="false"]').length,u=0;t.find('[data-scripts-loaded="false"]').each(function(){var r=JSON.parse($("#moduleScriptPath").val()),u=$(this),t=u.data("scripts"),o=JSON.stringify(r).length>2?r[t]:t+".js"+i(),e;u.attr("data-scripts-loaded","true");$.inArray(t,n.loadedScripts)===-1?(n.loadedScripts.push(t),e=JSON.stringify(r).length>2?"salesJourneyBundle":"salesJourneyApp",boot.loadScript(o,e,function(){f()})):f()})}function i(){var n;try{if(i.foundStr=i.foundStr==undefined?null:i.foundStr,i.foundStr!=null)return i.foundStr;var t="",u="",r=document.getElementsByTagName("script");for(n=0;n<r.length;n++)if(r[n].src.indexOf("roads-bundle")!=-1){t=r[n].src;break}return t!=""&&t.indexOf("?")!=-1?(u=t.split("?")[1],i.foundStr="?"+u,i.foundStr):(i.foundStr="",i.foundStr)}catch(f){return""}}function r(){t.addClass("loading");e.stop().fadeIn(500);$("#businessCoverLine")&&(window.aa.salesJourneyApp.cache.activeStep==0||window.aa.salesJourneyApp.cache.activeStep==1?$("#businessCoverLine").show():$("#businessCoverLine").hide())}function y(){var t=n.cache.$blocks.find(".payment-options"),i;t&&(i=$(t),i.find('input[type="radio"]').each(function(){var n=$(this).closest(".radio-field").find("label");n&&n.removeClass("checked");$(this).is(":checked")&&n&&n.addClass("checked")}))}function s(){window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).animate({scrollTop:window.aa.helpers.cache.cachedElements.$body.offset().top},100,function(){e.stop().fadeOut(500);t.removeClass("loading")})}function h(){n.cache.$main.find(".blocks-visible [data-namespace]").add(n.cache.$main.find(".progress-bar")).each(function(){var t=$(this).data("namespace"),n=window.aa.salesJourneyApp.modules[t];window.aa.salesJourneyApp.helpers.isDefined(n)&&window.aa.salesJourneyApp.helpers.isDefined(n.init)&&n.init()});stylishForms.update()}function c(n){n.removeClass("blocks-visible");t.find('[data-current-step="'+t.find("#app-progress-bar .step").filter(".active").data("id")+'"]').addClass("blocks-visible");window.aa.salesJourneyApp.helpers.hideShowBlocks()}function p(t,i){function e(t){var r,i,f,e;if(t.CurrentStep.HideBreakdownContactDetails==!0?$(".dispalyOnlyForSetSteps").hide():$(".dispalyOnlyForSetSteps").show(),t.CurrentStep.HideCallCentreContactDetails==!0?$(".ContactCentereVirtual").hide():$(".ContactCentereVirtual").show(),r=window.aa.salesJourneyApp.cache.$blocks,o.isDefined(t.CurrentStep)){for(r.append('<div class="sales-journey-blocks cf" />'),n.config.redirectionUrl=t.Error.RedirectionUrl,i=0;i<t.CurrentStep.Blocks.length;i+=1)r.children(".sales-journey-blocks").eq(n.cache.activeStep).append(Mustache.render(t.CurrentStep.ClientSideComponent[t.CurrentStep.Blocks[i].ClientSideComponentName],t.CurrentStep.Blocks[i])).attr("data-current-step",t.CurrentStep.Id).addClass(t.CurrentStep.Name.toLowerCase().replace(/\s+/g,"-"));$(".sales-journey-blocks.cf.details").attr("data-di-form-track","").attr("data-di-form-id","Cathie: Details-Step 3");f=n.cache.$blocks.find(".vrn-capture-box");e=$(".bottom-pricing-summary .cover-options").clone();n.cache.activeStep==0&&f.length>0&&(console.log("work done"),n.cache.$blocks.find(".detailed-pricing-summary .cover-type").append(e[0]));c(n.cache.$main.find(".sales-journey-blocks"));stylishForms.update();a();$(".equal-height").each(window.aa.helpers.panelHeight);u();s()}}function y(n){var i=Date.now(),t=0;do t=Date.now()-i;while(t<n)}var f=n.models.StepGuids[n.cache.activeStep],r;f&&(v=!0);let p=function(){for(var t=1,n="",i=window.aa.salesJourneyApp.models.AppHeader.pollingFrequency,r=window.aa.salesJourneyApp.models.AppHeader.pollingInterval,u=r/i;t<=u;){if($.ajax({method:"POST",url:aa.salesJourneyApp.constants.api.PollForMembershipNumber,async:!1}).done(function(t){n=t}),n.indexOf("-")<0&&n.length<32||n=="NoPolling")break;y(i);t=t+1}};typeof aa.salesJourneyApp.cache.serviceRequest["getCurrentStepBlocks"+t]!="undefined"&&aa.salesJourneyApp.cache.serviceRequest["getCurrentStepBlocks"+t].abort();r=n.cache.$main.find("div.journey-steps li.step:last-child");r.hasClass("active")&&window.aa.salesJourneyApp.models.AppHeader.isStoreAndForward&&p();aa.salesJourneyApp.cache.serviceRequest["getCurrentStepBlocks"+t]=$.ajax({method:"POST",url:aa.salesJourneyApp.constants.api[t]+"?includeMarkup="+v}).done(function(t){n.helpers.isDefined(t.CurrentStep.Blocks)&&!t.Error.Error?(l(t.CurrentStep.Blocks),l(t.CurrentStep.Lightboxes),l(t.CurrentStep.ErrorLightbox),e(t),n.helpers.updateTealiumTags(),h(),n.helpers.pushDataToHistory("step",n.cache.currentStep),typeof i=="function"&&i()):n.helpers.checkErrorsResponse(t)}).fail(function(t){t.status===500&&(window.location.href=aa.salesJourneyApp.config.redirectionUrl);t.statusText!=="abort"&&n.helpers.checkErrorsResponse(t)})}function w(){var t=$(this),r=t.find('input[type="text"]').add(t.find('input[type="tel"]')).add(t.find('input[type="email"]')),u=t.find('input[type="radio"]').add(t.find('input[type="checkBox"]')),i={};r.each(function(){var n=$(this);n.val().length&&(i[n.attr("id")]=n.val())});u.each(function(){var n=$(this);n.is(":checked")&&(i[n.attr("id")]="true")});(r.val().length||u.is(":checked"))&&n.cache.formsData.push(i)}function d(){function v(){function u(i){function tt(t){$('[id="'+n.cache.$blocks.find(".cover-type-options").data("default-cover")+'"]').closest(".radio-field").hasClass("highlighted")&&h.length&&o.eq(0).is(".completed")&&o.eq(1).is(".active")&&!nt?$.ajax({method:"POST",url:n.constants.api.FindVehicleDetails+"?vehicleNumber="+h.first().find(".vrn-label").html()}).done(function(i){n.helpers.isDefined(i.ViewModelData)&&!i.HasError?n.helpers.saveBlockData("SaveVehiclesList",n.models.CaptureVrnLightbox.Id,{Vehicles:[i.ViewModelData]},function(){typeof t=="function"&&t()}):n.helpers.checkErrorsResponse(i)}).fail(function(t){t.statusText!=="abort"&&n.helpers.checkErrorsResponse(t)}):typeof t=="function"&&t()}function it(){var t=n.cache.$main.find(".div-vrn-capture-inline"),i=t.find(".vrn-details-block"),r=t.parent().find(".desktop-description"),u=t.parent().find(".mobile-description");t.hide();i.hide();$(".vrn-capture-option").parent().parent().show();$(".up-arrow-show-hide").hide();window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.MOBILE_BREAKPOINT?r.show():u.show()}var k=t.find(".journey-steps"),o=t.find("#app-progress-bar .step"),h=n.cache.$blocks.find(".registered-vehicles li"),u=$(".sales-journey-blocks"),l=u.filter(".payment"),a,d=$("article.smart-breakdown"),g=d.find(".checkbox-field"),v=g.find('input[type="checkbox"]'),nt=v.length>0?v.prop("checked"):!1,e,p,b;aa.salesJourneyApp.cache.coverOptionsChanged=!0;window.aa.salesJourneyApp.cache.flag=!0;prevActiveStep=n.cache.activeStep;typeof i=="undefined"||i===null?n.cache.activeStep-=1:n.cache.activeStep=i.index();e=n.models.StepGuids[n.cache.activeStep];p=window.location.href.toLowerCase();n.cache.activeStep==0&&window.history.state&&(p.indexOf("uk-hmc")>=0||window.location.href.indexOf("uk-fst")>=0||window.location.href.indexOf("uk-fst-temp-dashboard")>=0)&&(e=$(window.aa.salesJourneyApp.models.AppHeader.NavigationItems.Cover).last().prop("Id"));$("#current-step").text(n.cache.activeStep+1);n.cache.allowNextStepNavigation=!0;a=u.eq(n.cache.activeStep+1).prev();f.data("active-step",n.cache.activeStep);k.each(function(){$(this).find(".step").removeClass("completed").removeClass("completed-no-pointer-bg").removeClass("active").eq(n.cache.activeStep).addClass("active").prevAll().addClass("completed")});n.modules.progressBar.init();n.cache.formsData=[];t.find(".blocks-visible .personal-details").add(t.find(".blocks-visible .additional-member-details")).add(t.find(".blocks-visible .contact-details")).each(w);r();$("#confirmation")&&($("#confirmation").prop("checked")==!0||$("#confirmation").prop("checked")=="checked")&&($("#confirmation").removeAttr("checked"),$("#confirmation").parent().find("span").removeClass());n.helpers.updatePromoMessages();u.eq(n.cache.activeStep).nextAll().hide();l.is(".blocks-visible")&&l.remove();u.eq(n.cache.activeStep-1).hide(function(){n.cache.currentStep=n.cache.activeStep+1;a.show(function(){tt(function(){n.helpers.getStepViewmodel("GetPreviousStepViewModel",e,function(){n.helpers.replaceDataToHistory("step",n.cache.currentStep);s();n.helpers.restoreFormData();y()})})})});c(n.cache.$main.find(".sales-journey-blocks"));aa.salesJourneyApp.helpers.updateAccordion();aa.salesJourneyApp.helpers.getIndicativePrice();b=$("#button-cover-agree").length>0;b&&it()}function v(){var t=$(this);t.filter("active").data("id")===n.models.StepGuids[i]&&t.addClass("active").removeClass("completed").removeClass("completed-no-pointer-bg");n.modules.progressBar.init()}var o=a.find(".step").length;t.off("keypress").on("keypress",".next-step",function(n){n.preventDefault();n.stopPropagation();n.stopImmediatePropagation()});t.off("keydown").on("keydown",".next-step",function(n){n.preventDefault();n.stopPropagation();n.stopImmediatePropagation()});t.off("keyup").on("keyup",".next-step",function(n){n.preventDefault();n.stopPropagation();n.stopImmediatePropagation()});t.off("click").on("click",".next-step",function(i){r();var u=n.cache.$blocks.find(".blocks-visible"),o=u.filter(".payment").length?u.find("[data-save-on-blur]").eq(0):u.find("[data-save-on-blur]").eq(-2),f=o.find("input, select");i.preventDefault();$(this).closest(".sales-journey-blocks").find(".errors").length&&(e.stop().fadeOut(500),t.removeClass("loading"));n.cache.$blocks.find(".sales-journey-blocks").eq(0).is(".blocks-visible:not(.details)")&&(window.aa.salesJourneyApp.cache.saveBlockInProgress=!1);window.aa.salesJourneyApp.cache.saveBlockInProgress||u.filter(".payment").length||$(this).closest(".sales-journey-blocks").find(".errors").length||u.find(".terms-not-accepted").length||(f.length&&f.change(),window.aa.helpers.cache.cachedElements.$body.addClass("load-step"),aa.salesJourneyApp.cache.currentStepLoaded||(aa.salesJourneyApp.cache.currentStepLoaded=!0,setTimeout(function(){window.aa.salesJourneyApp.application.goToNextStep()},500)))});if(i===2||n.cache.activeStep===o-1){l.add(a).each(v);h.find(".step").addClass("step-disabled");return}t.on("click",".completed",function(){l.last().hasClass("active")||u($(this))});window.aa.helpers.cache.cachedElements.$window.on("popstate",function(r){var f=t.find(".full-submit");if(n.helpers.isDefined(r.currentTarget.history.state)&&window.location.pathname===window.aa.helpers.cache.cachedElements.url){if(n.cache.activeStep>0||n.cache.$blocks.find(".cover-type-playback:visible").length===1?n.helpers.pushDataToHistory("step",n.cache.activeStep):n.helpers.isDefined(window.history.state.title)&&window.history.state.title.indexOf("question")>=0&&n.helpers.pushDataToHistory("question",window.aa.salesJourneyApp.cache.currentStep),n.cache.$main.find(".blocks-visible .start-again").length){n.helpers.pushDataToHistory("step",n.cache.currentStep);setTimeout(function(){n.cache.$main.find(".blocks-visible .start-again").length&&n.helpers.startAgainModal()},1e3);return}if(n.cache.activeStep===1&&n.cache.$main.find(".basic-cover").length&&n.cache.$main.find(".journey-steps").find(".step").filter(".disabled").length)return;if(n.helpers.isDefined(window.aa.salesJourneyApp.cache.currentStep)&&n.cache.activeStep>0&&i!==2&&n.cache.currentStep>=r.currentTarget.history.state.data&&!n.cache.$main.find("#app-progress-bar .step").filter(":last").is(".active")){window.aa.salesJourneyApp.cache.currentStep>0&&window.aa.salesJourneyApp.cache.currentStep--;u();return}!n.cache.$main.find(".cover-options").length&&n.helpers.isDefined(r.currentTarget.history.state)&&(n.helpers.isDefined(window.history.state.title)&&window.history.state.title.indexOf("step")>=0?n.helpers.initpopStateEvents(r.currentTarget.history.state.data):n.helpers.isDefined(window.history.state.title)&&window.history.state.title.indexOf("question")>=0&&(n.cache.$blocks.find(".vrn-lookup").length||n.cache.$blocks.find(".promotional-question").is(".current-question")||n.cache.$blocks.find(".product-recommendation").is(".current-question")||r.currentTarget.history.state.data>=2&&window.aa.salesJourneyApp.modules.needsAssessment.prevQuestion()))}})}var h=t.find(".journey-steps"),l=t.find("#app-progress-bar .step"),a=t.find("#step-navigation .step"),i=n.models.DeepLinking.indexOf(!0),u,o;if(i!==-1){if(n.cache.activeStep=i,n.cache.allowNextStepNavigation=!1,h.each(function(){$(this).find(".step").removeClass("active").eq(n.cache.activeStep).addClass("active").prevAll().addClass("completed")}),n.cache.activeStep>0)for(u=$("#app-progress-bar").find(".completed").length,$("#step-navigation").find("#current-step").text(u+1),o=0;o<u;o+=1)$("#blocks").prepend('<div class="sales-journey-blocks cf" />')}else n.cache.activeStep=0,f.data("active-step",n.cache.activeStep);p("GetCurrentStepViewModel");v()}function l(t){for(var i in t)n.models[t[i].ClientSideComponentName.replace(/\s/g,"")]=t[i]}function b(t){n.models.journeyId=window.salesJourneyAppData.journeyId;typeof aa.salesJourneyApp.cache.serviceRequest.GetJourneyHeader!="undefined"&&aa.salesJourneyApp.cache.serviceRequest.GetJourneyHeader.abort();var i=$("#getHeader");i.length&&i.html().trim().length?(n.models.AppHeader=JSON.parse(i.html().trim()),typeof t=="function"&&t()):aa.salesJourneyApp.cache.serviceRequest.GetJourneyHeader=$.ajax({url:n.constants.api.GetJourneyHeader+"?journeyId="+n.models.journeyId}).done(function(i){n.models.AppHeader=i;typeof t=="function"&&t()})}function a(){var i=t.find(".vrn-capture").data("product-code");n.config.partsAndGarageProductCode=i?i:"PRD_UK_0018";n.helpers.isDefined(FormValidation)&&(FormValidation.Manifest.ExtensionPath="/Assets/scripts/roads/",FormValidation.Manifest.Externals.register("CustomValidationRules","custom-validation-rules.js"),formValidation.init())}function k(){d()}function g(){window.aa.salesJourneyApp.helpers;window.aa.salesJourneyApp.helpers.registerViews(n.config.viewRegistry,function(){b(function(){n.models.StepGuids=[];n.models.AppHeader.NavItems=[];n.models.DeepLinking=[];for(var t in n.models.AppHeader.NavigationItems)n.models.AppHeader.NavigationItems.hasOwnProperty(t)&&t!==""&&(n.models.StepGuids.push(n.models.AppHeader.NavigationItems[t][0].Id),n.models.AppHeader.NavItems.push({Name:n.models.AppHeader.NavigationItems[t][0].Name,Id:n.models.AppHeader.NavigationItems[t][0].Id,IsStepHidden:n.models.AppHeader.NavigationItems[t][0].IsStepHidden}),n.models.DeepLinking.push(n.models.AppHeader.NavigationItems[t][0].IsDeepLinked));u(k)})})}var n=window.aa.salesJourneyApp,t=n.cache.$main,f=t.find("#sales-journey-header"),e=n.cache.$loader,o,v=!1;if(boot.config.salesJourneyApp="/Assets/scripts/roads/modules/",boot.config.salesJourneyBundle="/Assets/scripts/roads-modules/",this.init=function(){o=window.aa.salesJourneyApp.helpers;$.ajax({method:"POST",url:n.constants.api.VerifyClientSession+"?JourneyID="+window.salesJourneyAppData.journeyId}).done(function(n){n!=sessionStorage.getItem("clientSessionKey")&&sessionStorage.setItem("clientSessionKey",n);g();a();o.saveAllBlockData()})},this.goToNextStep=function(){function a(t){if(n.models.CaptureVrnLightbox.Id&&typeof t=="function"){t();return}$('[id="'+n.cache.$blocks.find(".cover-type-options").data("default-cover")+'"]').closest(".radio-field").hasClass("highlighted")&&l.length&&o.eq(0).is(".completed")&&o.eq(1).is(".active")?$.ajax({method:"POST",url:n.constants.api.FindVehicleDetails+"?vehicleNumber="+l.first().find(".vrn-label").html()}).done(function(i){n.helpers.isDefined(i.ViewModelData)&&!i.HasError?n.helpers.saveBlockData("SaveVehiclesList",n.models.CaptureVrnLightbox.Id,{Vehicles:[i.ViewModelData]},function(){typeof t=="function"&&t()}):n.helpers.checkErrorsResponse(i)}).fail(function(t){t.statusText!=="abort"&&n.helpers.checkErrorsResponse(t)}):typeof t=="function"&&t()}var v,e;r();var b=t.find(".journey-steps"),o=t.find("#app-progress-bar .step"),l=n.cache.$blocks.find(".registered-vehicles li"),i=$(".sales-journey-blocks"),u;n.cache.allowNextStepNavigation=!0;n.cache.activeStep+=1;u=i.eq(n.cache.activeStep-1).next();f.data("active-step",n.cache.activeStep);b.each(function(){$(this).find(".step").removeClass("active").removeClass("completed-no-pointer-bg").eq(n.cache.activeStep).addClass("active").prev().addClass("completed");$(this).is("#step-navigation")&&$(this).find(".step").eq(n.cache.activeStep).attr("data-IsStepHidden")?$(this).find(".step").eq(n.cache.activeStep).prev().addClass("hidden-step-active"):$(this).find(".step").eq(n.cache.activeStep).attr("data-IsStepHidden")&&$(this).find(".step").eq(n.cache.activeStep).prev().addClass("completed-no-pointer-bg")});n.modules.progressBar.init();n.cache.formsData=[];t.find(".blocks-visible .personal-details").add(t.find(".blocks-visible .additional-member-details")).add(t.find(".blocks-visible .contact-details")).each(w);r();u.length||u.data("current-step")?(i.eq(n.cache.activeStep-1).hide(function(){u.show(function(){a(function(){n.helpers.getStepViewmodel("GetNextStepViewModel",null,function(){n.helpers.replaceDataToHistory("step",n.cache.currentStep);s();h();n.helpers.restoreFormData();y()})})})}),r()):i.eq(n.cache.activeStep-1).hide(function(){a(function(){window.aa.helpers.cache.cachedElements.$body.removeClass("load-step");n.cache.currentStep+=1;p("GetNextStepViewModel",n.helpers.restoreFormData)})});v=n.cache.activeStep+1;e=0;$("#step-navigation").find(".step").each(function(n,t){n<=v&&$(t).attr("data-IsStepHidden")&&(e=e+1)});$("#current-step").text(n.cache.activeStep+1-e);c(i);aa.salesJourneyApp.helpers.updateAccordion();aa.salesJourneyApp.application.loadModuleScripts()},this.loadModuleScripts=function(n){u(n)},this.initBlockEvents=function(){h()},this.initValidation=function(){a()},window.history&&window.history.pushState)$(window).on("popstate",function(n){if(window.location.href.lastIndexOf("#")>0)return!1;if(aa.salesJourneyApp.helpers.isDefined($("#modal-app-placeholder"))&&aa.salesJourneyApp.helpers.isDefined($(".modal-close"))&&aa.salesJourneyApp.helpers.isDefined($("#modal-app-placeholder").html())&&$("#modal-app-placeholder").html().length>0){$(".modal-close").trigger("click");window.aa.salesJourneyApp.helpers.pushDataToHistory("step",window.aa.salesJourneyApp.cache.currentStep);n.preventDefault();n.stopImmediatePropagation();return}var t=window.location.href;if(window.aa.salesJourneyApp.helpers.isDefined(window.history.state))window.aa.salesJourneyApp.helpers.isDefined(history)&&window.aa.salesJourneyApp.helpers.isDefined(history.state)&&window.aa.salesJourneyApp.helpers.isDefined(history.state.step)&&history.state.step=="step-0"&&t.indexOf("/breakdown-cover/uk")>0&&window.aa.salesJourneyApp.cache.activeStep==0&&(history.state=null,this.window.history.back());else{if(window.aa.salesJourneyApp.cache.activeStep>0&&window.aa.salesJourneyApp.cache.currentStep>0){window.aa.salesJourneyApp.helpers.pushDataToHistory("step",window.aa.salesJourneyApp.cache.currentStep);return}t.indexOf("/breakdown-cover/uk")>0&&(document.referrer.indexOf(".do")>0&&window.location.href.indexOf("breakdown-cover/uk")>=0?(history.state=null,this.window.history.back()):window.aa.salesJourneyApp.helpers.isDefined(history)&&window.aa.salesJourneyApp.helpers.isDefined(history.state)&&window.aa.salesJourneyApp.helpers.isDefined(history.state.step)&&history.state.step=="step-0"?this.window.history.back():window.aa.salesJourneyApp.helpers.isDefined(history)&&(window.aa.salesJourneyApp.helpers.isDefined(history.state)==!1||window.aa.salesJourneyApp.helpers.isDefined(history.state.step)==!1||history.state.step=="step-0")&&(history.state=null,this.window.history.back()))}});$(window).on("keyup",function(t){n.helpers.isDefined($("#modal-app-placeholder"))&&n.helpers.isDefined($(".modal-close"))&&n.helpers.isDefined($("#modal-app-placeholder").html())&&$("#modal-app-placeholder").html().length==0&&$(t)[0]&&$(t)[0].target&&(n.helpers.isDefined($(t)[0].target)&&n.helpers.isDefined($(t)[0].target.id)&&$(t)[0].target.id.length>0?(window.aa.salesJourneyApp.cache.scrollPositionKeyId=$(t)[0].target.id,window.aa.salesJourneyApp.cache.scrollPosition=window.aa.helpers.cache.cachedElements.$window.scrollTop()):n.helpers.isDefined($(t)[0].target)&&n.helpers.isDefined($($(t)[0].target).parent())&&n.helpers.isDefined($($(t)[0].target).parent().parent())&&n.helpers.isDefined($($(t)[0].target).parent().parent().find("input"))&&$($(t)[0].target).parent().parent().find("input").length>0&&n.helpers.isDefined($($(t)[0].target).parent().parent().find("input")[0])&&n.helpers.isDefined($($(t)[0].target).parent().parent().find("input")[0].id)&&$($(t)[0].target).parent().parent().find("input")[0].id.length>0&&(window.aa.salesJourneyApp.cache.scrollPositionKeyId=$($(t)[0].target).parent().parent().find("input")[0].id,window.aa.salesJourneyApp.cache.scrollPosition=window.aa.helpers.cache.cachedElements.$window.scrollTop()))});$(window).on("mouseup",function(t){n.helpers.isDefined($("#modal-app-placeholder"))&&n.helpers.isDefined($(".modal-close"))&&n.helpers.isDefined($("#modal-app-placeholder").html())&&$("#modal-app-placeholder").html().length==0&&$(t)[0]&&$(t)[0].target&&(n.helpers.isDefined($(t)[0].target)&&n.helpers.isDefined($(t)[0].target.id)&&$(t)[0].target.id.length>0?(window.aa.salesJourneyApp.cache.scrollPositionKeyId=$(t)[0].target.id,window.aa.salesJourneyApp.cache.scrollPosition=window.aa.helpers.cache.cachedElements.$window.scrollTop()):$($(t)[0].target).is(":hidden")==!1&&$($(t)[0].target).is(":button")==!1&&n.helpers.isDefined($(t)[0].target)&&n.helpers.isDefined($($(t)[0].target).parent())&&n.helpers.isDefined($($(t)[0].target).parent().parent())&&n.helpers.isDefined($($(t)[0].target).parent().parent().find("input"))&&$($(t)[0].target).parent().parent().find("input").length>0&&n.helpers.isDefined($($(t)[0].target).parent().parent().find("input")[0])&&n.helpers.isDefined($($(t)[0].target).parent().parent().find("input")[0].id)&&$($(t)[0].target).parent().parent().find("input")[0].id.length>0&&(window.aa.salesJourneyApp.cache.scrollPositionKeyId=$($(t)[0].target).parent().parent().find("input")[0].id,window.aa.salesJourneyApp.cache.scrollPosition=window.aa.helpers.cache.cachedElements.$window.scrollTop()))});$(document).on("keyup",function(n){n.which===13&&(n.preventDefault(),setTimeout(function(){$("#app-progress-bar").find("li:focus").trigger("click")},150))})};window.aa.salesJourneyApp.application=new window.aa.salesJourneyApp.Application;window.FormValidation.Manifest.CustomValidationRules=function(){function u(n){var t=n.find(".dob-input"),r=parseInt(t.filter(".day-number").val(),10),u=parseInt(t.filter(".month-number").val(),10),f=parseInt(t.filter(".year-number").val()=="0"?"10"+t.filter(".year-number").val():t.filter(".year-number").val()=="00"?"1"+t.filter(".year-number").val():t.filter(".year-number").val().length==2?t.filter(".year-number").val()+"0":t.filter(".year-number").val().length==1?t.filter(".year-number").val()+"00":t.filter(".year-number").val(),10),i=new Date(f,u-1,r),e=new Date;this.isFutureDate=function(){return i>e};this.isValidLeapYear=function(){return i.getFullYear()===f&&i.getMonth()+1===u&&i.getDate()===r};isNaN(r)||isNaN(u)||isNaN(f)||!isNaN(this.isFutureDate)?this.isValid=function(){return!0}:(this.fullDateOfBirth=n.find('input[name="DateOfBirth"]').map(function(){return this.value}).get().join("/"),this.isValid=function(){return this.isValidLeapYear()&&!this.isFutureDate()});n.find(".date-of-birth").val(this.fullDateOfBirth)}function a(){var n=$(".account-holder").val(),t=/^[a-zA-Z\x2C\x2D\x2E\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/,i=String.fromCharCode(event.charCode?event.charCode:event.which);this.isValid=function(){return t.test(n)==!1?!1:!0}}function v(){var n=$(".first-name").val(),t=/^[a-zA-Z\x2C\x2D\x2E\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function y(){var n=$(".telephone-only").val(),t=/^(07[\d]{9}|9[\d]{2}|1[\d]{2}|01[\d]{5,9}|02[\d]{5,9}|03[\d]{5,9}|05[\d]{5,9}|08[\d]{5,9}|09[\d]{5,9})$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function p(){var n=$(".last-name").val(),t=/^[a-zA-Z\x2C\x2D\x2E\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function f(){var n=$(".memberFirst1").val(),t=/^[a-zA-Z\x2C\x2D\x2E\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function e(){var n=$(".memberFirst2").val(),t=/^[a-zA-Z\x2C\x2D\x2E\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function o(){var n=$(".memberFirst3").val(),t=/^[a-zA-Z\x2C\x2D\x2E\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function s(){var n=$(".memberLast1").val(),t=/^[a-zA-Z\x2C\x2D\x2E\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function h(){var n=$(".memberLast2").val(),t=/^[a-zA-Z\x2C\x2D\x2E\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function c(){var n=$(".memberLast3").val(),t=/^[a-zA-Z\x2C\x2D\x2E\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function w(){var n=$(".first-name").val(),t=/^[a-zA-Z\x2D\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function b(){var n=$(".last-name").val(),t=/^[a-zA-Z\x2D\x27\x20\x92\xC0-\xD6\xD8-\xF6\xF8-\xFF\u2019]*$/;this.isValid=function(){return t.test(n)==!1?!1:!0}}function k(){var n=/^([a-zA-Z](([0-9][0-9]?)|([a-zA-Z][0-9][0-9]?)|([a-z]?[0-9][a-zA-Z])) ?[0-9][ABD-HJLNP-UW-Zabd-hjlnp-uw-z]{2})$/;this.isValid=function(){return n.test(l)==!1?!1:!0}}function t(n){var t=!0,f=document.getElementById("First name").value.trim().toLowerCase(),e=document.getElementById("Last name").value.trim().toLowerCase(),o=new Date(document.getElementById("Date of birth-year").value.trim(),document.getElementById("Date of birth-month").value.trim()-1,document.getElementById("Date of birth-day").value.trim()),r=new Date(document.getElementById("Date of birth"+n.toString()+"-year").value.trim(),document.getElementById("Date of birth"+n.toString()+"-month").value.trim()-1,document.getElementById("Date of birth"+n.toString()+"-day").value.trim()),s=$.find(".blocks-visible .additional-member-details"),u;for($(".memberFirst"+n.toString()).val().trim().toLowerCase()==f&&$(".memberLast"+n.toString()).val().trim().toLowerCase()==e&&Number(o)==Number(r)&&(t=!1),i=1;i<=s.length;i++)i!==n&&(u=new Date(document.getElementById("Date of birth"+i.toString()+"-year").value,document.getElementById("Date of birth"+i.toString()+"-month").value-1,document.getElementById("Date of birth"+i.toString()+"-day").value),$(".memberFirst"+i.toString()).val().trim().toLowerCase()==$(".memberFirst"+n.toString()).val().trim().toLowerCase()&&$(".memberLast"+i.toString()).val().trim().toLowerCase()==$(".memberLast"+n.toString()).val().trim().toLowerCase()&&Number(r)==Number(u)&&$(".memberFirst"+i.toString()).val()!==""&&$(".memberFirst"+n.toString()).val()!=""&&$(".memberLast"+i.toString()).val()!==""&&$(".memberLast"+n.toString()).val()!=""&&(t=!1));this.isValid=function(){return t}}function d(){var t=$(".uasort-code:visible").val().replace(/\s/g,""),n=t.slice(0,2);this.isValid=function(){return parseInt(n)===01||parseInt(n)===07||parseInt(n)===11||parseInt(n)===12||parseInt(n)===15||parseInt(n)===16||parseInt(n)===17||parseInt(n)===19||parseInt(n)===30||parseInt(n)===77||parseInt(n)===80||parseInt(n)===87||parseInt(n)===50||parseInt(n)===51||parseInt(n)===52||parseInt(n)===53||parseInt(n)===54||parseInt(n)===55||parseInt(n)===56||parseInt(n)===57||parseInt(n)===58||parseInt(n)===59||parseInt(n)===60||parseInt(n)===61||parseInt(n)===62||parseInt(n)===63||parseInt(n)===64||parseInt(n)===65||parseInt(n)===66||parseInt(n)===83||parseInt(n)===84||parseInt(n)===86?!0:!1}}function g(){var n=$(".member-number1:visible").val();regexnumber=/^(?=.*[0-9])([a-zA-Z0-9 \/]+)$/;this.isValid=function(){return regexnumber.test(n)?!0:!1}}function nt(){this.isValid=function(){$("#membership").on({keydown:function(n){if(n.which===32)return!1},change:function(){this.value=this.value.replace(/\s/g,"")}});if($(".member-number:visible").val()===undefined)return!1;var t=$(".member-number:visible").val().replace(/\s/g,""),f=t.slice(0,6);if(parseInt(f)===parseInt(635601)){if(t.length>16)return!1;var e=t.slice(6,8),o=t.slice(8,15).replace(/^0+/,""),s=e+""+o,n=s.split("").reverse().join(""),r=[(parseInt(n[0])?parseInt(n[0]):0)*7+(parseInt(n[1])?parseInt(n[1]):0)*3+(parseInt(n[2])?parseInt(n[2]):0)*1+(parseInt(n[3])?parseInt(n[3]):0)*7+(parseInt(n[4])?parseInt(n[4]):0)*3+(parseInt(n[5])?parseInt(n[5]):0)*1+(parseInt(n[6])?parseInt(n[6]):0)*7+(parseInt(n[7])?parseInt(n[7]):0)*3+(parseInt(n[8])?parseInt(n[8]):0)*1],u=r.toString().length,h=r.toString().slice(u-1,u),c=t.slice(15,16),i=10-h;return i===10&&(i=0),i.toString()===c?!0:!1}return!1}}function tt(n){var t=n.find(".pass-one").val(),i=n.find(".pass-two").val();this.isValid=function(){return t!=i?!1:!0}}function it(n){var t=n.find(".pass-one").val();regexnumber=/[0-9]+/g;this.isValid=function(){return regexnumber.test(t)?!0:!1}}function rt(n){var t=n.find(".pass-one").val();regexnumber=/[A-Z]+/g;this.isValid=function(){return regexnumber.test(t)?!0:!1}}function ut(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[A-Z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10?!1:!0}}function ft(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[A-Z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10&&t?!1:!0}}function et(t){var i=t.find(".pass-two").val(),r=/[0-9]+/,u=/[A-Z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10&&t?!1:!0}}function ot(n){var t=n.find(".pass-one").val(),i=/[A-Z]+/g;this.isValid=function(){return i.test(t)==!1&&t.length<10?!1:!0}}function st(t){var i=t.find(".pass-one").val(),r=/[A-Z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&i.length<10&&t?!1:!0}}function ht(t){var i=t.find(".pass-two").val(),r=/[A-Z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&i.length<10&&t?!1:!0}}function ct(t){var i=t.find(".pass-one").val(),r=/[A-Z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&t?!1:!0}}function lt(t){var i=t.find(".pass-two").val(),r=/[A-Z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&t?!1:!0}}function at(t){var i=t.find(".pass-one").val(),r=/[0-9]+/;this.isValid=function(){var t=n(i);return r.test(i)==!1&&t?!1:!0}}function vt(t){var i=t.find(".pass-two").val(),r=/[0-9]+/;this.isValid=function(){var t=n(i);return r.test(i)==!1&&t?!1:!0}}function yt(t){var i=t.find(".pass-one").val();this.isValid=function(){var t=n(i);return i.length<10&&t?!1:!0}}function pt(t){var i=t.find(".pass-two").val();this.isValid=function(){var t=n(i);return i.length<10&&t?!1:!0}}function wt(t){var i=t.find(".pass-one").val(),r=/[0-9]+/;this.isValid=function(){var t=n(i);return r.test(i)==!1&&i.length<10&&t==!1?!1:!0}}function bt(t){var i=t.find(".pass-one").val(),r=/[0-9]+/;this.isValid=function(){var t=n(i);return r.test(i)==!1&&i.length<10&&t?!1:!0}}function kt(t){var i=t.find(".pass-two").val(),r=/[0-9]+/;this.isValid=function(){var t=n(i);return r.test(i)==!1&&i.length<10&&t?!1:!0}}function dt(t){var i=t.find(".pass-one").val();this.isValid=function(){var t=n(i);return t===!1&&i!=""?!0:!1}}function gt(t){var i=t.find(".pass-two").val();this.isValid=function(){var t=n(i);return t===!1&&i!=""?!0:!1}}function ni(n){var t=n.find(".pass-one").val(),i=/[0-9]+/,r=/[A-Z]+/g;this.isValid=function(){return i.test(t)==!1&&r.test(t)==!1?!1:!0}}function ti(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[A-Z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&t?!1:!0}}function ii(t){var i=t.find(".pass-two").val(),r=/[0-9]+/,u=/[A-Z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&t?!1:!0}}function ri(n){var t=n.find(".pass-two").val();regexnumber=/[0-9]+/g;this.isValid=function(){return regexnumber.test(t)?!0:!1}}function ui(n){var t=n.find(".pass-two").val();regexnumber=/[A-Z]+/g;this.isValid=function(){return regexnumber.test(t)?!0:!1}}function fi(n){var t=n.find(".pass-two").val(),i=/[0-9]+/,r=/[A-Z]+/g;this.isValid=function(){return i.test(t)==!1&&r.test(t)==!1&&t.length<10?!1:!0}}function ei(n){var t=n.find(".pass-two").val(),i=/[A-Z]+/g;this.isValid=function(){return i.test(t)==!1&&t.length<10?!1:!0}}function oi(n){var t=n.find(".pass-two").val(),i=/[0-9]+/;this.isValid=function(){return i.test(t)==!1&&t.length<10?!1:!0}}function si(n){var t=n.find(".pass-two").val(),i=/[0-9]+/,r=/[A-Z]+/g;this.isValid=function(){return i.test(t)==!1&&r.test(t)==!1?!1:!0}}function hi(){var t=$("#g-recaptcha-response"),n=grecaptcha.getResponse();this.isValid=function(){return n.length!=0?!0:!1}}function n(n){var t=n.toLowerCase();return password_check.indexOf(t)>-1?!0:!1}function ci(n,t){this.isValid=function(){var u,i,f;return n.find("input:radio[name=docPrefChannel]:checked").val().toLowerCase()==="post"?(i=t.find("input[type=email]"),u=$(i).val(),!u=="")?r.test(u)?!0:!1:(n.find(".emailReasonBlock").length&&n.find(".emailReasonBlock").find('input:radio[name="EmailReason"]').each(function(){return $(this).prop("checked",!0)?!0:!1}),!1):(i=t.find("input[type=email]"),f=i.val(),n.find("#emailReason").length)?!0:f==""?!1:r.test(f)?!0:!1}}function li(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[A-Z]+/g,f=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&f.test(i)==!1&&i.length<10&&t?!1:!0}}function ai(t){var i=t.find(".pass-one").val(),r=/[A-Z]+/g,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10&&t?!1:!0}}function vi(t){var i=t.find(".pass-one").val(),r=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&i.length<10&&t?!1:!0}}function yi(t){var i=t.find(".pass-one").val(),r=/[A-Z]+/g,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&t?!1:!0}}function pi(t){var i=t.find(".pass-one").val(),r=/[A-Z]+/g,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10?!1:!0}}function wi(t){var i=t.find(".pass-one").val(),r=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&t?!1:!0}}function bi(t){var i=t.find(".pass-one").val(),r=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&i.length<10?!1:!0}}function ki(t){var i=t.find(".pass-one").val(),r=/[A-Z]+/g,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1?!1:!0}}function di(t){var i=t.find(".pass-one").val(),r=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1?!1:!0}}function gi(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1?!1:!0}}function nr(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[A-Z]+/g,f=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&f.test(i)==!1?!1:!0}}function tr(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10?!1:!0}}function ir(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&t?!1:!0}}function rr(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[A-Z]+/g,f=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&f.test(i)==!1&&i.length<10?!1:!0}}function ur(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[A-Z]+/g,f=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&f.test(i)==!1&&t?!1:!0}}function fr(t){var i=t.find(".pass-one").val(),r=/[0-9]+/,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10&&t?!1:!0}}function er(t){var i=t.find(".pass-two").val(),r=/[0-9]+/,u=/[A-Z]+/g,f=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&f.test(i)==!1&&i.length<10&&t?!1:!0}}function or(t){var i=t.find(".pass-two").val(),r=/[A-Z]+/g,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10&&t?!1:!0}}function sr(t){var i=t.find(".pass-two").val(),r=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&i.length<10&&t?!1:!0}}function hr(t){var i=t.find(".pass-two").val(),r=/[A-Z]+/g,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&t?!1:!0}}function cr(t){var i=t.find(".pass-two").val(),r=/[A-Z]+/g,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10?!1:!0}}function lr(t){var i=t.find(".pass-two").val(),r=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&t?!1:!0}}function ar(t){var i=t.find(".pass-two").val(),r=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&i.length<10?!1:!0}}function vr(t){var i=t.find(".pass-two").val(),r=/[A-Z]+/g,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1?!1:!0}}function yr(t){var i=t.find(".pass-two").val(),r=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1?!1:!0}}function pr(t){var i=t.find(".pass-two").val(),r=/[0-9]+/,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1?!1:!0}}function wr(t){var i=t.find(".pass-two").val(),r=/[0-9]+/,u=/[A-Z]+/g,f=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&f.test(i)==!1?!1:!0}}function br(t){var i=t.find(".pass-two").val(),r=/[0-9]+/,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10?!1:!0}}function kr(t){var i=t.find(".pass-two").val(),r=/[0-9]+/,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&t?!1:!0}}function dr(t){var i=t.find(".pass-two").val(),r=/[0-9]+/,u=/[A-Z]+/g,f=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&f.test(i)==!1&&i.length<10?!1:!0}}function gr(t){var i=t.find(".pass-two").val(),r=/[0-9]+/,u=/[A-Z]+/g,f=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&f.test(i)==!1&&t?!1:!0}}function nu(t){var i=t.find(".pass-two").val(),r=/[0-9]+/,u=/[a-z]+/g;this.isValid=function(){var t=n(i);return r.test(i)==!1&&u.test(i)==!1&&i.length<10&&t?!1:!0}}var r=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,l;this.emailPattern=r;this.postCodePattern=/^([a-zA-Z](([0-9][0-9]?)|([a-zA-Z][0-9][0-9]?)|([A-Za-z]?[0-9][A-Za-z])) ?[0-9][ABD-HJLNP-UW-Zabd-hjlnp-uw-z]{2})$/;$(document).on("change",".postCode",function(){l=$(this).val()});this.isValidDateOfBirth=function(){var n=arguments[2].closest(".date-of-birth-group");return new u(n).isValid()};this.isValidDOB=function(n){return new u(n).isValid()};this.isValidYear=function(){return window.aa.salesJourneyApp.constants.regex.years.test(parseInt(arguments[2].closest(".date-of-birth-group").find(".dob-input").filter(".year-number").val(),10))};this.isValidDay=function(){return window.aa.salesJourneyApp.constants.regex.days.test(parseInt(arguments[2].closest(".date-of-birth-group").find(".dob-input").filter(".day-number").val(),10))};this.isValidMonth=function(){return window.aa.salesJourneyApp.constants.regex.months.test(parseInt(arguments[2].closest(".date-of-birth-group").find(".dob-input").filter(".month-number").val(),10))};this.isConfirmPassword=function(){var n=arguments[2].closest(".password-group");return new tt(n).isValid()};this.isCheckSumnumber=function(){var n=arguments[2].closest(".memshipNumber");return new nt(n).isValid()};this.isCheckPolicyNumber=function(){var n=arguments[2].closest(".memberNumber");return new g(n).isValid()};this.isBankfields=function(){var n=arguments[2].closest(".uasort-code");return new d(n).isValid()};this.isUniquePassword=function(){var n=arguments[2].closest(".password-group");return new dt(n).isValid()};this.isUniquePasswordConfirm=function(){var n=arguments[2].closest(".password-group");return new gt(n).isValid()};this.isPasswordCriteriaNum=function(){var n=arguments[2].closest(".password-group");return new it(n).isValid()};this.isPasswordCriteriaUpper=function(){var n=arguments[2].closest(".password-group");return new rt(n).isValid()};this.isPasswordCriteriaMinLenAndUnique=function(){var n=arguments[2].closest(".password-group");return new yt(n).isValid()};this.isPasswordCriteriaMinLenAndUniqueConfirm=function(){var n=arguments[2].closest(".password-group");return new pt(n).isValid()};this.isPassCriteriaAllWithUnique=function(){var n=arguments[2].closest(".password-group");return new ft(n).isValid()};this.isPassCriteriaAllWithUniqueConfirm=function(){var n=arguments[2].closest(".password-group");return new et(n).isValid()};this.isPasswordCriteriaCapitalAndUnique=function(){var n=arguments[2].closest(".password-group");return new ct(n).isValid()};this.isPasswordCriteriaCapitalAndUniqueConfirm=function(){var n=arguments[2].closest(".password-group");return new lt(n).isValid()};this.isPasswordCriteriaNumAndUnique=function(){var n=arguments[2].closest(".password-group");return new at(n).isValid()};this.isPasswordCriteriaNumAndUniqueConfirm=function(){var n=arguments[2].closest(".password-group");return new vt(n).isValid()};this.isPasswordCriteriaAll=function(){var n=arguments[2].closest(".password-group");return new ut(n).isValid()};this.isPasswordCriteriaCapitalAndNumber=function(){var n=arguments[2].closest(".password-group");return new ni(n).isValid()};this.isPasswordCriteriaCapitalNumberAndUnique=function(){var n=arguments[2].closest(".password-group");return new ti(n).isValid()};this.isPasswordCriteriaCapitalNumberAndUniqueConfirm=function(){var n=arguments[2].closest(".password-group");return new ii(n).isValid()};this.isPasswordCriteriaNumberAndMinLen=function(){var n=arguments[2].closest(".password-group");return new wt(n).isValid()};this.isPasswordCriteriaNumberMinLenAndUnique=function(){var n=arguments[2].closest(".password-group");return new bt(n).isValid()};this.isPasswordCriteriaNumberMinLenAndUniqueConfirm=function(){var n=arguments[2].closest(".password-group");return new kt(n).isValid()};this.isPasswordCriteriaCapitalAndMinLen=function(){var n=arguments[2].closest(".password-group");return new ot(n).isValid()};this.isPasswordCriteriaCapitalMinLenAndUnique=function(){var n=arguments[2].closest(".password-group");return new st(n).isValid()};this.isPasswordCriteriaCapitalMinLenAndUniqueConfirm=function(){var n=arguments[2].closest(".password-group");return new ht(n).isValid()};this.isRecaptchaSuccessfull=function(){var n=arguments[2].closest(".Recaptcha-group");return new hi(n).isValid()};this.isPasswordCriteriaNumConfirm=function(){var n=arguments[2].closest(".password-group");return new ri(n).isValid()};this.isPasswordCriteriaUpperConfirm=function(){var n=arguments[2].closest(".password-group");return new ui(n).isValid()};this.isPasswordCriteriaAllConfirm=function(){var n=arguments[2].closest(".password-group");return new fi(n).isValid()};this.isPasswordCriteriaCapitalAndNumberConfirm=function(){var n=arguments[2].closest(".password-group");return new si(n).isValid()};this.isPasswordCriteriaNumberAndMinLenConfirm=function(){var n=arguments[2].closest(".password-group");return new oi(n).isValid()};this.isPasswordCriteriaCapitalAndMinLenConfirm=function(){var n=arguments[2].closest(".password-group");return new ei(n).isValid()};this.isPasswordCriteriaAllWithLower=function(){var n=arguments[2].closest(".password-group");return new li(n).isValid()};this.isPasswordCriteriaCapMinUniAndLower=function(){var n=arguments[2].closest(".password-group");return new ai(n).isValid()};this.isPasswordCriteriaMinUniqueAndLower=function(){var n=arguments[2].closest(".password-group");return new vi(n).isValid()};this.isPasswordCriteriaCapitalUniAndLower=function(){var n=arguments[2].closest(".password-group");return new yi(n).isValid()};this.isPasswordCriteriaCapitalMinAndLower=function(){var n=arguments[2].closest(".password-group");return new pi(n).isValid()};this.isPasswordCriteriaUniAndLower=function(){var n=arguments[2].closest(".password-group");return new wi(n).isValid()};this.isPasswordCriteriaMinAndLower=function(){var n=arguments[2].closest(".password-group");return new bi(n).isValid()};this.isPasswordCriteriaCapitalAndLower=function(){var n=arguments[2].closest(".password-group");return new ki(n).isValid()};this.isPasswordCriteriaLower=function(){var n=arguments[2].closest(".password-group");return new di(n).isValid()};this.isPasswordCriteriaNumAndLower=function(){var n=arguments[2].closest(".password-group");return new gi(n).isValid()};this.isPasswordCriteriaNumCapitalAndLower=function(){var n=arguments[2].closest(".password-group");return new nr(n).isValid()};this.isPasswordCriteriaNumMinAndLower=function(){var n=arguments[2].closest(".password-group");return new tr(n).isValid()};this.isPasswordCriteriaNumUniqueAndLower=function(){var n=arguments[2].closest(".password-group");return new ir(n).isValid()};this.isPasswordCriteriaNumCapitalMinAndLower=function(){var n=arguments[2].closest(".password-group");return new rr(n).isValid()};this.isPasswordCriteriaNumCapitalUniAndLower=function(){var n=arguments[2].closest(".password-group");return new ur(n).isValid()};this.isPasswordCriteriaNumUniMinAndLower=function(){var n=arguments[2].closest(".password-group");return new fr(n).isValid()};this.isPasswordCriteriaAllWithLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new er(n).isValid()};this.isPasswordCriteriaCapMinUniAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new or(n).isValid()};this.isPasswordCriteriaMinUniqueAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new sr(n).isValid()};this.isPasswordCriteriaCapitalUniAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new hr(n).isValid()};this.isPasswordCriteriaCapitalMinAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new cr(n).isValid()};this.isPasswordCriteriaUniAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new lr(n).isValid()};this.isPasswordCriteriaMinAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new ar(n).isValid()};this.isPasswordCriteriaCapitalAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new vr(n).isValid()};this.isPasswordCriteriaLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new yr(n).isValid()};this.isPasswordCriteriaNumAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new pr(n).isValid()};this.isPasswordCriteriaNumCapitalAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new wr(n).isValid()};this.isPasswordCriteriaNumMinAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new br(n).isValid()};this.isPasswordCriteriaNumUniqueAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new kr(n).isValid()};this.isPasswordCriteriaNumCapitalMinAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new dr(n).isValid()};this.isPasswordCriteriaNumCapitalUniAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new gr(n).isValid()};this.isPasswordCriteriaNumUniMinAndLowerConfirm=function(){var n=arguments[2].closest(".password-group");return new nu(n).isValid()};this.byPostOptionalEmail=function(){var n=arguments[2].closest(".contact-details");return new ci(n,arguments[2]).isValid()};this.isAccountName=function(){var n=arguments[2].closest(".account-holder");return new a(n).isValid()};this.isValidFirstName=function(){var n;return n=arguments.length==0?$(".first-name-group-main"):arguments[2].closest(".first-name-group"),new v(n).isValid()};this.isValidPhoneNumber=function(){var n;return n=arguments.length==0?$(".contact-details"):arguments[2].closest(".contact-details"),new y(n).isValid()};this.isValidLastName=function(){var n;return n=arguments.length==0?$(".last-name-group-main"):arguments[2].closest(".last-name-group"),new p(n).isValid()};this.isValidFirstName1=function(){var n;return arguments.length==0?(new f).isValid():(n=arguments[2].closest(".memberFirst1"),new f(n).isValid())};this.isValidFirstName2=function(){var n;return arguments.length==0?(new e).isValid():(n=arguments[2].closest(".memberFirst2"),new e(n).isValid())};this.isValidFirstName3=function(){var n;return arguments.length==0?(new o).isValid():(n=arguments[2].closest(".memberFirst3"),new o(n).isValid())};this.isValidLastName1=function(){var n;return arguments.length==0?(new s).isValid():(n=arguments[2].closest(".memberLast1"),new s(n).isValid())};this.isValidLastName2=function(){var n;return arguments.length==0?(new h).isValid():(n=arguments[2].closest(".memberLast2"),new h(n).isValid())};this.isValidLastName3=function(){var n;return arguments.length==0?(new c).isValid():(n=arguments[2].closest(".memberLast3"),new c(n).isValid())};this.isValidPostcode=function(){var n=arguments[2].closest(".createAccountPostcode");return new k(n).isValid()};this.isDuplicate=function(n){return new t(n).isValid()};this.isDuplicate1=function(){return new t(1).isValid()};this.isDuplicate2=function(){return new t(2).isValid()};this.isDuplicate3=function(){return new t(3).isValid()};this.isValidUaFirstName=function(){var n=arguments[2].closest(".firstName");return new w(n).isValid()};this.isValidUaLastName=function(){var n=arguments[2].closest(".lastName");return new b(n).isValid()}};window.aa||(window.aa={});window.aa.salesJourneyApp.helpers={registerViews:function(n,t){function o(n){for(var r=0;r<n.length;r+=1)i.views[n[r].FileName]=n[r].HtmlString,r===s&&typeof t=="function"&&t()}for(var u,i=aa.salesJourneyApp,s=n.length-1,f=[],e=[],r=0;r<n.length;r++)u=$("div[id='HtmlTemplateHandlerUtility."+n[r]+"']").html(),u&&u.trim().length?f.push({HtmlString:u,FileName:n[r]}):e.push(n[r]);e.length?(typeof i.cache.serviceRequest.HtmlTemplateHandlerUtility!="undefined"&&i.cache.serviceRequest.HtmlTemplateHandlerUtility.abort(),i.cache.serviceRequest.HtmlTemplateHandlerUtility=$.ajax({method:"POST",url:i.constants.api.HtmlTemplateHandlerUtility,data:{FileNames:e,FilePath:"/Views/TheAA/SalesJourney/Partials/",JourneyID:window.salesJourneyAppData.journeyId}}).done(function(n){var t=n.concat(f);o(t)})):o(f)},initInputMasking:function(n,t){$(n).each(function(){var i=$(this),r=i.filter(".dob-input"),u=i.filter(".year-number"),n;i.off("input blur").on({input:function(f){var e,o,s;if(n=i.is(".postcode-field")?i.val():i.val(),e=n.split("-").join(""),i.removeClass("masked"),f.which!==37&&f.which!==38&&f.which!==39&&f.which!==40&&f.which!==9&&f.which!==13&&f.which!==16&&f.which!==46&&f.which!==32&&f.which!==8&&(f.which!==17||f.which!==86)&&(f.which!==17||f.which!==65))if(n!==""&&t.test(n))i.is(".sort-code")&&t.test(n)&&e.length>=6&&(s=e.replace(/-/g,"").substring(0,6),e=e.match(new RegExp(".{1,2}","g")).join("-"),i.val(s),sessionStorage.setItem("formattedValue",e),setTimeout("$('.sort-code').val(sessionStorage.getItem('formattedValue').substring(0, 8));",100));else{if(i.addClass("masked"),r.length&&r.val().charAt(0)==="0"&&!u.length&&(r.val()!=="00"||u.val()>0)){r.val().length>1&&!t.test(n.charAt(n.length-1))&&(n=n.slice(0,-1));i.val(n).removeClass("masked").focus();return}if(r.length&&!t.test(n)){i.val(n.slice(0,-1)).removeClass("masked").focus();return}for(o=0;o<n.length;o+=1)t.test(n[o])||(n=n.replace(n[o],""));i.val(n).removeClass("masked").focus()}},blur:function(){i.val(i.val().trim());var n=i.val()}})})},hideShowBlocks:function(){var n=window.aa.helpers.cache.cachedElements.$main;window.aa.salesJourneyApp.helpers.isDefined(n.find(".questions-block"))&&n.find(".questions-block").is(":visible")===!0?(window.aa.salesJourneyApp.helpers.isDefined(n.find(".service"))&&window.aa.salesJourneyApp.helpers.isDefined(n.find(".service").parents(".row"))&&n.find(".service").parents(".row").hide(),window.aa.salesJourneyApp.helpers.isDefined(n.find(".accordion.cf"))&&n.find(".accordion.cf").hide(),window.aa.salesJourneyApp.helpers.isDefined(n.find(".contact-wrapper"))&&window.aa.salesJourneyApp.helpers.isDefined(n.find(".contact-wrapper").parents(".row"))&&n.find(".contact-wrapper").parents(".row").hide()):window.aa.salesJourneyApp.helpers.isDefined(n.find(".questions-block"))&&n.find(".questions-block").is(":visible")===!1&&(window.aa.salesJourneyApp.helpers.isDefined(n.find(".service"))&&window.aa.salesJourneyApp.helpers.isDefined(n.find(".service").parents(".row"))&&n.find(".service").parents(".row").show(),window.aa.salesJourneyApp.helpers.isDefined(n.find(".accordion.cf"))&&n.find(".accordion.cf").show(),window.aa.salesJourneyApp.helpers.isDefined(n.find(".contact-wrapper"))&&window.aa.salesJourneyApp.helpers.isDefined(n.find(".contact-wrapper").parents(".row"))&&n.find(".contact-wrapper").parents(".row").show())},isDefined:function(n){return typeof n!="undefined"&&n!==null},ifVehicleSpec:function(n,t){return aa.salesJourneyApp.helpers.isDefined(t)?(n||"")+(t||""):""},isDuplicate:function(n){$(n).on("blur",function(n){var t=$(this),r=aa.salesJourneyApp.cache.$main,u=t.closest(".vrn-details").find(".duplicate-field-error"),i=t.val().toUpperCase().replace(/\s+/g,"");if(t.attr("value",i),($(".cover-type")==null||$(".cover-type").html()==null||$(".cover-type").html().indexOf("Vehicle cover")<0)&&r.find('.registration[value="'+i+'"]').not($(this)).length>0&&i.length>=2){if(r.find(".duplicate-field-error").is(":visible"))return;t.focus();u.show();n.stopImmediatePropagation()}else u.hide()})},checkRegistrationNumber:function(n,t){function a(){(n.val().length===0||n.val().length===1||!aa.salesJourneyApp.constants.regex.registrationNumber.test(n.val().replace(/ /g,""))||r.length&&r.find("#vehicle-reg").length&&r.find(".your-vehicles td").length===0)&&(i.length?i.add(u).addClass("errors"):e.add(u).addClass("errors"),o.addClass("error"),n.val().length&&!aa.salesJourneyApp.constants.regex.registrationNumber.test(n.val())&&f.show());switch(n.val().length){case 0:l.show();break;case 1:c.show();break;default:if(!f.is(":visible")){if(r.length&&r.find("#vehicle-reg").length&&!r.find(".your-vehicles td").length)return;aa.salesJourneyApp.helpers.isDefined(i)&&i.length?i.add(u).removeClass("errors"):e.add(u).removeClass("errors");o.removeClass("error")}}typeof t=="function"&&t()}var s=n.closest(".vehicle-reg"),i=n.closest(".additional-vrn"),h=n.closest(".optional.active"),c=i.length?i.find('[data-validation="minLength"]'):n.closest(".vrn-details").find('[data-validation="minLength"]'),f=i.length?i.find('[data-validation="regex"]'):n.closest(".vrn-details").find('[data-validation="regex"]'),l=s.find("[data-mandatory]"),r=n.closest(".cover-details-module"),e=r.length?n.closest(".vrn-search"):n.closest(".vrn-form"),u=n.closest(".form-module"),o=n.closest(".form-field");l.add(c).add(f).hide();o.removeClass("error");aa.salesJourneyApp.helpers.isDefined(i)&&i.length?i.add(u).removeClass("errors"):e.add(u).removeClass("errors");(s.hasClass("mandatory")||h.length&&h.find("input.registration").val().length||i.length&&n.closest(".additional-vrn").find(".registration-number").val().length)&&a()},radioCheckboxLabels:function(n){function t(){var t=$(this),i=t.closest(".radio-field, .checkbox-field"),n=i.find("label"),r=i.siblings().find("label");r.length?i.siblings().find("label").removeClass("checked"):n.removeClass("checked");n&&(n.removeClass("checked"),t.is(":checked")&&n.addClass("checked"));n&&(t.is(":checked")?(n.addClass("checked"),r.removeClass("checked")):n.removeClass("checked"))}n.each(t);n.on("change",t)},allowOnlyNumbers:function(n,t){$(n).each(function(){function f(){n.removeClass("error");u.add(r).hide()}var i=$(this),n=i.closest(".form-field"),r=n.find("[data-invalid]"),u=n.find("[data-minLength]");i.on("change",function(){var e=$(this).val();if(t.test(e)&&e.length<4){if(!e.length){f();return}n.addClass("error");i.focus();r.hide();u.show()}else t.test(e)?e.length===4&&t.test(e)&&f():(n.addClass("error"),i.focus(),u.hide(),r.show())})})},validatePostcodeField:function(n,t){$(n).each(function(){function f(n){u.toggle(!n.length)}var i=$(this),n=i.closest(".form-field"),r=n.find("[data-postcode-invalid]"),u=n.find('[data-validation="required"]');i.on("change",function(){var u=$(this).val();f(u);t.test(u)?(n.removeClass("error"),r.hide()):(n.addClass("error"),i.focus(),r.show())})})},getIndicativePrice:function(n){function r(n,t){return n=n.toString(),n.length<t?r("0"+n,t):n}function o(n){aa.salesJourneyApp.helpers.isDefined(n.MonthlyTotalDifference)&&(n.MonthlyTotalDifference<=0?($(".total-saving-btm.monthly").hide(),$(".total-saving-rhs.monthly").hide(),typeof removeMargin=="function"&&removeMargin()):($MonthlyTotalDifference=n.MonthlyTotalDifference,$(".total-saving-rhs.monthly span.yearly-saving").text().trim()?$(".total-saving-rhs.monthly span.saving-span").text(($MonthlyTotalDifference*12).toFixed(2)):$(".total-saving-rhs.monthly span.saving-span").text($MonthlyTotalDifference),$(".total-saving-btm.monthly span.yearly-saving").text().trim()?$(".total-saving-btm.monthly span.saving-span").text(($MonthlyTotalDifference*12).toFixed(2)):$(".total-saving-btm.monthly span.saving-span").text($MonthlyTotalDifference)));aa.salesJourneyApp.helpers.isDefined(n.YearlyTotalDifference)&&(n.MonthlyTotalDifference<=0?($(".total-saving-btm.yearly").hide(),$(".total-saving-rhs.yearly").hide(),typeof removeMargin=="function"&&removeMargin()):($YearlyTotalDifference=n.YearlyTotalDifference,$(".total-saving-btm.yearly span").text($YearlyTotalDifference),$(".total-saving-rhs.yearly span.saving-span").text($YearlyTotalDifference)))}function u(n,t,i,u,f){var e=n.siblings(".loading"),o=n.add(t).text(),s=aa.salesJourneyApp.helpers.isDefined(u)?i+"."+u:i;n.add(t).hide();o===s||aa.salesJourneyApp.cache.hidePricingLoader||e.stop().show();f?(n.text(i+"."),t.show().text(r(u,2)),n.add(t).removeAttr("style")):(n.text(i+""),t.text("").hide(),n.add(t).removeAttr("style"));aa.salesJourneyApp.cache.hidePricingLoader=!1}function f(n,i){var a=t.find(".blocks-visible .price"),nt=a.siblings(".chosen-options"),o=a.siblings(".chosen-payment-frequency"),tt=o.siblings(".chosen-options"),v=nt.find(".cover-options").find(".chosen"),f=t.find(".info").find(".pricing-summary-information-content1").find(".AvgQuotedPrice"),e=t.find(".info").find(".pricing-summary-information-content1").find(".DeltaAmount"),s=t.find(".info").find(".pricing-summary-information-content1").find(".SmartPrice"),d=t.find(".info").find(".pricing-summary-information-content1").find(".SmartPriceValue"),r=n.ViewModelData,y,p,w,b,g,h,c,k,l;if(v.length){for(c=0;c<r.CoverageOptions.length;c+=1)h=r.CoverageOptions[c],g=h===t.find(".vrn-capture").find("input").val(),g&&v.filter(":contains("+h+")").addClass("vrn").html(h+" <span />");if(r.SmartVehicles&&r.SmartVehicles.length)for(k=aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.SmartBreakdownCoverTitle,l=0;l<r.SmartVehicles.length;l++)if(r.SmartVehicles[l].isSmartSelected){v.filter(":contains("+k+")").addClass("smart-vrn").html(k+" <span />");break}}r&&(!r.SmartVehicles||!r.SmartVehicles.length)&&$(".smart-vrn").length&&$(".smart-vrn").remove();y=aa.salesJourneyApp.cache.$main.find(".vrn").find("span");p=aa.salesJourneyApp.cache.$main.find(".smart-vrn").find("span");w=aa.salesJourneyApp.cache.$main.find(".pg-vehicles > .vehicle-quote span");b=aa.salesJourneyApp.cache.$main.find(".smart-vehicles > .vehicle-quote span");a.each(function(){var l=aa.salesJourneyApp.cache.$blocks,k=$(this),g=k.find(".large"),nt=k.find(".small"),a="of your quote",v="of your quote",i=l.find('input[type="radio"]:checked').data("payment-frequency"),tt=l.find(".info").find(".pricing-summary-information-content1").find(".AvgQuotedPrice"),it=l.find(".info").find(".pricing-summary-information-content1").find(".DeltaAmount"),rt=l.find(".info").find(".pricing-summary-information-content1").find(".SmartPrice"),n=$(".intro-price"),t,h,c;if(aa.salesJourneyApp.helpers.isDefined(r)&&aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.models.PricingSummaryBlock)){h=aa.salesJourneyApp.models.PricingSummaryBlock.MonthlyPaymentFrequency;c=aa.salesJourneyApp.models.PricingSummaryBlock.YearlyPaymentFrequency;aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary=r;aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.Monthly)&&(monthlyAvgQuoted=aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.Monthly.AvgQuotedPrice,monthlyDeltaAmount=aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.Monthly.DeltaAmount*-1);aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.YearlyFromAccount)&&(yearlyAvgQuoted=aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.YearlyFromAccount.AvgQuotedPrice,yearlyDeltaAmount=aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.YearlyFromAccount.DeltaAmount*-1);function l(n){if(!n)return"";var t=n.split(".");return t[1]&&parseInt(t[1])>0?parseFloat(n).toFixed(2):parseFloat(n)}function it(){var it=r.PaymentOptions.Monthly.IsSmartBreakdownCover,u,c,g,i,k,nt;if(it?(t=r.PaymentOptions.Monthly.TotalWithSBC.split("."),d.text(parseFloat(aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.Monthly.MonthlyPrice)),s.show(),n.hide()):(t=r.PaymentOptions.Monthly.Total.split("."),s.hide(),n.show()),tt=r.PaymentOptions.Monthly.AvgQuotedPrice,o.length&&h&&o.text(h.Text),u="",f.length&&h&&(aa.salesJourneyApp.models.PricingSummaryBlock.DynamicContent.MonthlyFromAccount=!0,u=parseFloat(monthlyAvgQuoted),f.text(u),n.find("span").html("&pound;"+u),g=f.text().indexOf("."),g>-1&&(u=parseFloat(monthlyAvgQuoted).toFixed(2),f.text(u).text(),n.find("span").html("&pound;"+u))),c="",e.length&&h&&(aa.salesJourneyApp.models.PricingSummaryBlock.DynamicContent.MonthlyFromAccount=!0,c=parseFloat(monthlyDeltaAmount),e.text(c),g=e.text().indexOf("."),g>-1&&(c=parseFloat(monthlyDeltaAmount).toFixed(2),e.text(c).text())),isNaN(r.PaymentOptions.Monthly.PriceBreakdown.PRD_UK_0018)||(y.html("(&pound;"+parseFloat(r.PaymentOptions.Monthly.PriceBreakdown.PRD_UK_0018).toFixed(2)+" "+a+")"),w.html("(&pound;"+parseFloat(r.PaymentOptions.Monthly.PriceBreakdown.PRD_UK_0018).toFixed(2)+" "+a+")")),p.html("(&pound;"+l(r.PaymentOptions.Monthly.MonthlyPrice)+" "+v+")"),b.html("(&pound;"+l(r.PaymentOptions.Monthly.MonthlyPrice)+" "+v+")"),i=aa.salesJourneyApp.models,k=i.PricingSummaryBlock.PricingSummary.SmartVehicles,i.PricingSummaryBlock.DynamicContent.IsSmartBreakdownCover=!1,k&&k.length>0)for(nt=0;nt<k.length;nt++)if(k[nt].isSmartSelected){i.PricingSummaryBlock.DynamicContent.IsSmartBreakdownCover=!0;break}i.PricingSummaryBlock.DynamicContent.MonthlyPrice=r.PaymentOptions.Monthly.MonthlyPrice;i.PricingSummaryBlock.DynamicContent.AvgQuotedPrice=u;i.PricingSummaryBlock.DynamicContent.DeltaAmount=c;$block=aa.salesJourneyApp.cache.$blocks.find(".blocks-visible .pricing-summary");infotext=i.PricingSummaryBlock.CaveatText;$cavetTextblock=aa.salesJourneyApp.cache.$blocks.find(".pricing-summary-information-content1");aa.salesJourneyApp.helpers.renderDynamicMarkup(i,infotext,$cavetTextblock);monthlyDeltaAmount<=0?($(".DiscountSpan").hide(),n.hide()):($(".DiscountSpan").show(),it||n.show())}function k(){var it=r.PaymentOptions.YearlyFromAccount.IsSmartBreakdownCover,u,h,g,i,k,nt;if(it?(t=r.PaymentOptions.YearlyFromAccount.TotalWithSBC.split("."),d.text(parseFloat(aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.YearlyFromAccount.AnnualPrice)),s.show(),n.hide()):(t=r.PaymentOptions.YearlyFromAccount.Total.split("."),s.hide(),n.show()),tt=r.PaymentOptions.YearlyFromAccount.AvgQuotedPrice,o.length&&c&&o.text(c.Text),u="",f.length&&c&&(aa.salesJourneyApp.models.PricingSummaryBlock.DynamicContent.MonthlyFromAccount=!1,u=parseFloat(yearlyAvgQuoted),f.text(u),n.find("span").html("&pound;"+u),g=f.text().indexOf("."),g>-1&&(u=parseFloat(yearlyAvgQuoted).toFixed(2),f.text(u).text(),n.find("span").html("&pound;"+u))),h="",e.length&&c&&(aa.salesJourneyApp.models.PricingSummaryBlock.DynamicContent.MonthlyFromAccount=!1,h=parseFloat(yearlyDeltaAmount),e.text(h),g=e.text().indexOf("."),g>-1&&(h=parseFloat(yearlyDeltaAmount).toFixed(2),e.text(h).text())),isNaN(r.PaymentOptions.YearlyFromAccount.PriceBreakdown.PRD_UK_0018)||(y.html("(&pound;"+parseFloat(r.PaymentOptions.YearlyFromAccount.PriceBreakdown.PRD_UK_0018).toFixed(2)+" "+a+")"),w.html("(&pound;"+parseFloat(r.PaymentOptions.YearlyFromAccount.PriceBreakdown.PRD_UK_0018).toFixed(2)+" "+a+")")),p.html("(&pound;"+l(r.PaymentOptions.YearlyFromAccount.AnnualPrice)+" "+v+")"),b.html("(&pound;"+l(r.PaymentOptions.YearlyFromAccount.AnnualPrice)+" "+v+")"),i=aa.salesJourneyApp.models,k=i.PricingSummaryBlock.PricingSummary.SmartVehicles,i.PricingSummaryBlock.DynamicContent.IsSmartBreakdownCover=!1,k&&k.length>0)for(nt=0;nt<k.length;nt++)if(k[nt].isSmartSelected){i.PricingSummaryBlock.DynamicContent.IsSmartBreakdownCover=!0;break}i.PricingSummaryBlock.DynamicContent.AnnualPrice=r.PaymentOptions.YearlyFromAccount.AnnualPrice;i.PricingSummaryBlock.DynamicContent.AvgQuotedPrice=u;i.PricingSummaryBlock.DynamicContent.DeltaAmount=h;aa.salesJourneyApp.helpers.isDefined(r.PaymentOptions.Monthly)&&(i.PricingSummaryBlock.DynamicContent.MonthlyPrice=r.PaymentOptions.Monthly.MonthlyPrice);$block=aa.salesJourneyApp.cache.$blocks.find(".blocks-visible .pricing-summary");infotext=i.PricingSummaryBlock.CaveatText;$cavetTextblock=aa.salesJourneyApp.cache.$blocks.find(".pricing-summary-information-content1");aa.salesJourneyApp.helpers.renderDynamicMarkup(i,infotext,$cavetTextblock);yearlyDeltaAmount<=0?($(".DiscountSpan").hide(),n.hide()):($(".DiscountSpan").show(),it||n.show())}(aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.Monthly)||aa.salesJourneyApp.helpers.isDefined(r.PaymentOptions.Monthly))&&(i==="Monthly"&&aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.Monthly.Selected||r.PaymentOptions.Monthly.Selected)?it():(aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.YearlyFromAccount)||aa.salesJourneyApp.helpers.isDefined(r.PaymentOptions.YearlyFromAccount))&&i==="Yearly"&&aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.YearlyFromAccount.Selected||r.PaymentOptions.YearlyFromAccount.Selected||(aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.YearlyFromCard)||aa.salesJourneyApp.helpers.isDefined(r.PaymentOptions.YearlyFromCard))&&i==="Yearly"&&aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.YearlyFromCard.Selected||r.PaymentOptions.YearlyFromCard.Selected?k():((aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.SinglePaymentByCard)||aa.salesJourneyApp.helpers.isDefined(r.PaymentOptions.SinglePaymentByCard))&&i==="Yearly"&&aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.SinglePaymentByCard.Selected||r.PaymentOptions.SinglePaymentByCard.Selected||(aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.SinglePaymentByCard)||aa.salesJourneyApp.helpers.isDefined(r.PaymentOptions.SinglePaymentByCard))&&i==="Yearly"&&aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.PaymentOptions.SinglePaymentByCard.Selected||r.PaymentOptions.SinglePaymentByCard.Selected)&&k();typeof t!="undefined"&&(aa.salesJourneyApp.helpers.isDefined(t[1])&&parseInt(t[1])>0?u(g,nt,t[0],t[1],!0):u(g,nt,t[0],t[1],!1))}});typeof i=="function"&&i()}function e(n){function r(){function rt(n){var t='<li><span class="vrn-label">'+aa.salesJourneyApp.helpers.ifVehicleSpec("",n.Vrn)+"<\/span><span>"+aa.salesJourneyApp.helpers.ifVehicleSpec("",n.Make)+aa.salesJourneyApp.helpers.ifVehicleSpec(" ",n.Model)+"<\/span><\/li>";p.show();c.show().append(t);c.closest(".vehicle-list").show()}var u=t.find(".detailed-pricing-summary").find(".pg-vehicles").find(".registered-vehicles"),y,h=t.find(".vrn-capture").find(".pg-vehicles-display").find(".registered-vehicles"),l=t.find(".detailed-pricing-summary").find(".pg-vehicles"),k=t.find(".vrn-capture").find(".pg-vehicles-display"),ut=t.find(".vrn-capture").find(".no-modal-window"),d=t.find('.vrn-capture input[type="checkbox"]').is(":checked"),p=t.find(".detailed-pricing-summary").find(".smart-vehicles"),c=t.find(".detailed-pricing-summary").find(".smart-vehicles").find(".registered-vehicles"),g=t.find(".no-modal-window"),w=t.find(".no-modal-window #vrn-modal").find(".submit-buttons"),nt=w.find(".agree.inline-block"),tt=t.find(".no-modal-window #vrn-modal").find(".vrn-search"),a=t.find(".no-modal-window #vrn-modal").find("#vrn-number-title"),ft=t.find(".div-vrn-capture-inline"),v=["Main number plate","Second number plate","Third number plate","Fourth number plate"],it=$("#main").hasClass("help-me-choose-journey"),r,o=[],i,f,b,e,s;if(d=t.find('.vrn-capture input[type="checkbox"]').is(":checked"),it){if(aa.salesJourneyApp.helpers.isDefined(n)){for(i=0;i<n.Vehicles.length;i+=1){for(r=n.Vehicles[i],f=i+1;f<n.Vehicles.length;f+=1)n.Vehicles[i].Vrn===n.Vehicles[f].Vrn&&n.Vehicles.splice(n.Vehicles[i],1);aa.salesJourneyApp.helpers.isDefined(r.Vrn)&&(o.push('<li><span class="vrn-label" data-vrn-field="vrn-'+i+'">'+aa.salesJourneyApp.helpers.ifVehicleSpec("",r.Vrn)+"<\/span><span>"+aa.salesJourneyApp.helpers.ifVehicleSpec("",r.Make)+aa.salesJourneyApp.helpers.ifVehicleSpec(" ",r.Model)+"<\/span><\/li>"),l.show(),u.closest(".vehicle-list").show(),u.empty(),u.show().append(o.join("")),b=$("#button-cover-agree").length>0,b||aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.IsPartsAndGarageSelected||(aa.salesJourneyApp.cache.$main.find(".pg-vehicles > .vehicles-list").hide("slow"),aa.salesJourneyApp.cache.$main.find(".pg-vehicles").hide("slow"),u.closest(".vehicle-list").hide("slow"),u.empty()))}e=n.SmartVehicles}}else if(setTimeout(function(){y=window.aa.salesJourneyApp.models.PricingSummaryBlock.PricingSummary.CoverageOptions[0].indexOf("Vehicle")>-1},750),aa.salesJourneyApp.helpers.isDefined(n)){for(i=0;i<n.Vehicles.length;i+=1){for(r=n.Vehicles[i],f=i+1;f<n.Vehicles.length;f+=1)n.Vehicles[i].Vrn===n.Vehicles[f].Vrn&&n.Vehicles.splice(n.Vehicles[i],1);aa.salesJourneyApp.helpers.isDefined(r.Vrn)&&(v=a.val()==undefined||a.val()==""?v:a.val().split(","),o.push('<li><div class="vrn-title-number">'+v[i]+'<\/div><div class="vrn-number"><span class="vrn-label" data-vrn-field="vrn-'+i+'">'+aa.salesJourneyApp.helpers.ifVehicleSpec("",r.Vrn)+"<\/span><span>"+aa.salesJourneyApp.helpers.ifVehicleSpec(" - ",r.Make)+aa.salesJourneyApp.helpers.ifVehicleSpec(" ",r.Model)+"<\/span><\/div><\/li>"),typeof sleepForRedisFix=="function"&&sleepForRedisFix(),l.show(),l.find(".editVehicle").hide(),u.closest(".vehicle-list").hide(),h.closest(".vehicle-list").hide(),u.empty(),h.empty(),w.hide(),nt.prop("disabled",!1).removeClass("disabled processing"),u.hide().append(o.join("")),k.show(),h.closest(".vehicle-list").show(),h.show().append(o.join("")),y||($(".up-arrow-show-hide").hide(),$(".vrn-capture-option").parent().parent().show()),tt.hide(),g.empty())}e=n.SmartVehicles}if(c.empty(),c.hide(),p.hide(),e&&e.length>0)for(s=0;s<e.length;s++)if(e[s].isSmartSelected){rt(e[s]);break}}var i=window.location.href.toLowerCase();i.indexOf("uk-hmc")!=-1||i.indexOf("uk-fst")!=-1?setTimeout(r,700):r()}var t=aa.salesJourneyApp.cache.$blocks,i;if(aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.cache.fromSavePaymentFrequency)&&aa.salesJourneyApp.cache.fromSavePaymentFrequency===!0&&aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.cache.PriceingService)){i=aa.salesJourneyApp.cache.PriceingService;aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.cache.isYearly)&&aa.salesJourneyApp.cache.isYearly===!0?(aa.salesJourneyApp.helpers.isDefined(i.ViewModelData.PaymentOptions.Monthly)&&(i.ViewModelData.PaymentOptions.Monthly.Selected=!1),aa.salesJourneyApp.helpers.isDefined(i.ViewModelData.PaymentOptions.YearlyFromAccount)&&(i.ViewModelData.PaymentOptions.YearlyFromAccount.Selected=!0)):aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.cache.isMonthly)&&aa.salesJourneyApp.cache.isMonthly===!0&&(i.ViewModelData.PaymentOptions.Monthly.Selected=!0,i.ViewModelData.PaymentOptions.YearlyFromAccount.Selected=!1);aa.salesJourneyApp.cache.PriceingService=i;i=aa.salesJourneyApp.cache.PriceingService;f(i,e(i.ViewModelData));aa.salesJourneyApp.helpers.updateAccordion(i.ViewModelData);aa.salesJourneyApp.cache.getResponseFromPrice=!0;$(".full-submit").removeClass("disabled processing").attr("disabled",!1);typeof n=="function"&&n(i);aa.salesJourneyApp.cache.fromSavePaymentFrequency=null;aa.salesJourneyApp.helpers.isDefined($("span.large"))&&aa.salesJourneyApp.helpers.isDefined($("span.large").siblings(".loading"))&&$("span.large").siblings(".loading").stop().hide();return}aa.salesJourneyApp.cache.getResponseFromPrice=!1;$(".full-submit").addClass("disabled processing").attr("disabled",!0);aa.salesJourneyApp.cache.serviceRequest.GetIndicativePrice=$.ajax({method:"POST",timeout:15e3,url:aa.salesJourneyApp.constants.api.GetIndicativePrice+"?math="+(new Date).getTime()}).done(function(t){aa.salesJourneyApp.helpers.isDefined(t)&&(aa.salesJourneyApp.cache.PriceingService=t,f(t,e(t.ViewModelData)),o(t.ViewModelData),aa.salesJourneyApp.helpers.updateAccordion(t.ViewModelData),aa.salesJourneyApp.cache.getResponseFromPrice=!0,$(".full-submit").removeClass("disabled processing").attr("disabled",!1),typeof n=="function"&&n(t));aa.salesJourneyApp.helpers.isDefined($("span.large"))&&aa.salesJourneyApp.helpers.isDefined($("span.large").siblings(".loading"))&&$("span.large").siblings(".loading").stop().hide()})},getVrnBlockState:function(n){var i=aa.salesJourneyApp.cache.$blocks.find(".vrn-lookup"),t=aa.salesJourneyApp.cache.$blocks.find(".vrn-capture .option, .question").data("is-editing");aa.salesJourneyApp.cache.currentStep==1&&(t=!0);i.length&&(t=i.data("is-editing"));typeof aa.salesJourneyApp.cache.serviceRequest.GetVrnBlockDisplayState!="undefined"&&aa.salesJourneyApp.cache.serviceRequest.GetVrnBlockDisplayState.abort();aa.salesJourneyApp.cache.serviceRequest.GetVrnBlockDisplayState=$.ajax({method:"GET",url:aa.salesJourneyApp.constants.api.GetVrnBlockDisplayState,data:{isEditing:t}}).done(function(t){aa.salesJourneyApp.helpers.isDefined(t)&&n(t)})},getMakesAndModels:function(n){if($.inArray("MakesAndModelsList",aa.salesJourneyApp.cachedViewModels)===-1){aa.salesJourneyApp.cachedViewModels.push("MakesAndModelsList");aa.salesJourneyApp.models.MakesAndModelsList={};function t(n){$.each(n,function(t){var i=n[t].value.toUpperCase();aa.salesJourneyApp.models.MakesAndModelsList[i]=i})}aa.salesJourneyApp.cache.serviceRequest.GetAllMakesAndModels=$.ajax({method:"POST",url:aa.salesJourneyApp.constants.api.GetAllMakesAndModels}).done(function(i){aa.salesJourneyApp.helpers.isDefined(i)&&!i.HasError?(t(i.ViewModelData),aa.salesJourneyApp.helpers.isDefined(n)&&n(),aa.salesJourneyApp.cache.$loader.stop().fadeOut(1e3)):(aa.salesJourneyApp.helpers.checkErrorsResponse(i),aa.salesJourneyApp.cache.$loader.stop().fadeOut(1e3))}).fail(function(n){n.statusText!=="abort"&&aa.salesJourneyApp.helpers.checkErrorsResponse(n);aa.salesJourneyApp.cache.$loader.stop().fadeOut(1e3)})}else aa.salesJourneyApp.helpers.isDefined(n)&&n(),window.aa.salesJourneyApp.cache.$loader.stop().fadeOut(5e3)},openModal:function(n){function u(){var n=$("#modal-app-screen");n.on({scroll:function(){var n=$("#modal-app-placeholder aside > div:first-child").offset().left,i=$("#modal-app-placeholder aside > div:first-child").offset().top,t=$("#modal-app-placeholder aside > div:first-child").width();totalWidth=n+t;$(".modal-window .modal-close").css({left:totalWidth-53,top:220})},resize:function(){var n=$("#modal-app-placeholder aside > div:first-child").offset().left,i=$("#modal-app-placeholder aside > div:first-child").offset().top,t=$("#modal-app-placeholder aside > div:first-child").width();totalWidth=n+t;$(".modal-window .modal-close").css({left:totalWidth-53,top:220})}})}var t,i,r;aa.salesJourneyApp.cache.scrollPosition=aa.helpers.cache.cachedElements.$window.scrollTop();$(n)[0]&&$(n)[0].target&&aa.salesJourneyApp.helpers.isDefined($("#modal-app-placeholder"))&&aa.salesJourneyApp.helpers.isDefined($(".modal-close"))&&aa.salesJourneyApp.helpers.isDefined($("#modal-app-placeholder").html())&&$("#modal-app-placeholder").html().length==0&&$(n)[0]&&$(n)[0].target&&aa.salesJourneyApp.helpers.isDefined($(n)[0].target)&&aa.salesJourneyApp.helpers.isDefined($(n)[0].target.id)&&$(n)[0].target.id.length>0&&(window.aa.salesJourneyApp.cache.scrollPositionKeyId=$(n)[0].target.id);aa.helpers.cache.cachedElements.$html.addClass("modal-active");aa.salesJourneyApp.cache.$modalScreen.addClass("modal-open").focus();t=$("#button-cover-agree").length>0;window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.TABLET_BREAKPOINT&&(i=$("#modal-app-placeholder aside > div:first-child").offset().left,r=$("#modal-app-placeholder aside > div:first-child").width(),totalWidth=i+r,$(".modal-window .modal-close").css("left",totalWidth-53));t&&(window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.TABLET_BREAKPOINT&&setTimeout(function(){var n=$("#modal-app-placeholder aside > div:first-child").offset().left,t=$("#modal-app-placeholder aside > div:first-child").offset().top,i=$("#modal-app-placeholder aside > div:first-child").width();totalWidth=n+i;$(".modal-window .modal-close").css({left:totalWidth-53,top:t})},500),u());setTimeout(function(){aa.salesJourneyApp.cache.$modalScreen.addClass("no-transition")},650);client.IE9&&aa.salesJourneyApp.cache.$modalScreen.stop().fadeIn().css({bottom:"-100%"}).stop().animate({bottom:0},550);aa.helpers.cache.cachedElements.$document.on("keyup",function(n){$(n)[0]&&$(n)[0].target&&$("#modal-app-placeholder")&&$(".modal-close")&&$("#modal-app-placeholder").html().length==0&&$(n)[0]&&$(n)[0].target&&(aa.salesJourneyApp.helpers.isDefined($(n)[0].target)&&aa.salesJourneyApp.helpers.isDefined($(n)[0].target.id)&&$(n)[0].target.id.length>0?window.aa.salesJourneyApp.cache.scrollPositionKeyId=$(n)[0].target.id:$($(n)[0].target).is(":hidden")==!1&&$($(n)[0].target).is(":button")==!1&&aa.salesJourneyApp.helpers.isDefined($(n)[0].target)&&aa.salesJourneyApp.helpers.isDefined($($(n)[0].target).parent())&&aa.salesJourneyApp.helpers.isDefined($($(n)[0].target).parent().parent())&&aa.salesJourneyApp.helpers.isDefined($($(n)[0].target).parent().parent().find("input"))&&$($(n)[0].target).parent().parent().find("input").length>0&&aa.salesJourneyApp.helpers.isDefined($($(n)[0].target).parent().parent().find("input")[0])&&aa.salesJourneyApp.helpers.isDefined($($(n)[0].target).parent().parent().find("input")[0].id)&&$($(n)[0].target).parent().parent().find("input")[0].id.length>0&&(window.aa.salesJourneyApp.cache.scrollPositionKeyId=$($(n)[0].target).parent().parent().find("input")[0].id));n.which===27&&aa.salesJourneyApp.cache.$modalScreen.find(".unknown-dimensions").length===0&&aa.salesJourneyApp.cache.$modalScreen.find(".not-eligible").length===0&&aa.salesJourneyApp.helpers.destroyModal()})},destroyModal:function(){function n(){aa.helpers.cache.cachedElements.$html.removeClass("modal-active");setTimeout(function(){window.aa.helpers.cache.cachedElements.$window.scrollTop(window.aa.salesJourneyApp.cache.scrollPosition)},500);aa.salesJourneyApp.cache.$modalScreen.removeClass("modal-open no-transition");aa.salesJourneyApp.cache.$modalContentPlaceholder.empty()}function t(){client.IE9?aa.salesJourneyApp.cache.$modalScreen.fadeOut().css({bottom:0}).stop().animate({bottom:"-100%"},650,n):n()}t()},tooltip:function(n){function i(n){n.stop().slideUp(200,function(){$(this).removeClass("active")})}function r(n){n.stop().slideDown(200,function(){$(this).addClass("active")})}function t(n){var u=$(this),t=u.closest(".more-information").add(u.closest(".header").find(".more-information")).add(u.parent().find(".more-information"));n.preventDefault();n.stopPropagation();t.hasClass("active")?(i(t),t.hasClass("help-text-label")&&t.parent().find("span").removeClass("infoUp")):(r(t),t.hasClass("help-text-label")&&t.parent().find("span").addClass("infoUp"))}n.find(".more-information .ico.close, .ico.info, .tooltip-label, .ico.infoaro").on({keydown:function(n){var i=n.which;i!=9&&(i==13||i==32)&&(n.preventDefault(),t.bind(this)(n))},click:t})},saveAllBlockData:function(){function i(n){var i=n.keyCode||n.which,r;return(n.preventDefault(),t)?i:(t=!0,(i===13||i===32)&&(r=$(this),r.trigger("click"),r.addClass("disabled processing").attr("disabled",!0)),i)}function r(n){n.preventDefault();t=!1}function u(n){return n.preventDefault(),!1}function f(t){function v(n){n.each(function(){var n=$(this);if(n.parent().is(".hidden"))u=n.parent().siblings(".form-section").find("input").eq(0);else return u=n,!1})}function y(){f=r.closest(".sales-journey-blocks").find(".errors").find(".error");v(f);aa.salesJourneyApp.helpers.isDefined(u)||(u=f.first());i.find(".full-address-fields").find(".error").length?(i.find("#Postcode").val().length==0||i.find("#multiAddressSelect").is(":visible")||i.find(".addressLine1").is(":visible")||i.find(".PostCodeIsRequiredError").is(":visible")&&i.find(".PostCodeIsInvalidError").is(":visible")&&i.find(".non-uk-postcode").is(":visible")&&i.find(".no-address-found").is(":visible")||(i.find(".check-your-address-err").show(),$(".check-your-address-err p").show()),i.find(".find-address-trigger").addClass("err-msg-visible")):(i.find("#checkYourAddress").hide(),$("#checkYourAddress").hide());i.find(".confirm-address-trigger").is(".hidden")||(i.find(".confirm-your-address-err").show(),$(".confirm-your-address-err").show());$(".err-msgs #errDiv").parents(".field").removeClass("error");a.find(".selected .text")[0].innerText.indexOf("addresses found")>0&&($(".err-msgs #errDiv").parents(".field").addClass("error"),$(".err-msgs #errDiv").show(),u=$(".address-lookup-fields .field.error"));var n=0;n=u.hasClass("year")||u.hasClass("month")||u.hasClass("day")?u.parents(".date-of-birth-group").offset().top-$("#sales-journey-header").outerHeight()-parseFloat(f.css("margin-bottom")):u.offset().top-$("#sales-journey-header").outerHeight()-parseFloat(f.css("margin-bottom"));aa.helpers.cache.cachedElements.$html.add(aa.helpers.cache.cachedElements.$body).animate({scrollTop:n},100,function(){aa.salesJourneyApp.cache.$blocks.find(".error").eq(0).find("input").first()})}function p(n){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1, 3}\.[0-9]{1, 3}\.[0-9]{1, 3}\.[0-9]{1, 3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)}var e;t.preventDefault();var r=$(this),h=r.closest(".blocks-visible"),o=h.find(".form-module").not(".question"),s=o.filter(".additional-member-details").eq(2),c=o.filter(".cover-details-module"),i=aa.helpers.cache.cachedElements.$body.find(".address-lookup-fields"),a=aa.helpers.cache.cachedElements.$body.find("#multiAddressSelect"),l=c.find("#vehicle-reg"),w=h.find(".additional-vrn .registration-number"),b=o.filter("#marketing-preferences-block"),f,u;if(aa.salesJourneyApp.cache.coverOptionsChanged=!1,r.addClass("disabled processing"),setTimeout(function(){}),h.filter(".payment").length){r.removeClass("disabled processing").attr("disabled",!1);return}if(aa.salesJourneyApp.cache.$blocks.find(".blocks-visible .mod-form").each(function(){var n=$(this);if(!n.is(s)||s.find('input[type="text"]').val().length||s.find('input[type="radio"]').is(":checked")||s.find('input[type="checkbox"]').is(":checked")){if(n.is(".cover-details-module")){l.length&&c.find(".your-vehicles td").length===0&&aa.salesJourneyApp.helpers.checkRegistrationNumber(l);$("#checkYourAddress").is(".hidden")?($(".dynamic-address-fields").removeClass("error"),$("#checkYourAddress").hide()):$(".dynamic-address-fields").addClass("error");return}if(n.is(".additional-details")&&n.find(".additional-vrn").length){n.find(".additional-vrn").val().length&&aa.salesJourneyApp.helpers.checkRegistrationNumber(n.find(".additional-vrn").val());return}if(formValidation.api[n.data("id")].validateForm(),n.is(".contact-details")&&$(".emailReasonBlock").length){var t=$('*[data-transfer-model="Email"]'),r=$('*[data-transfer-model="DocChannelPref"]'),u=$(t).closest(".form-field"),i=!1;t.on("input",function(){$('input[name="EmailReason"]').prop("checked",function(){return this.getAttribute("checked")=="checked"});$('input[name="EmailReason"]').each(function(){$(this).parent().find("span").removeClass("checked");$(this).parent().parent().find("label").removeClass("checked")});$("#emailReason").hide()});$('input[name="EmailReason"]').change(function(){$("input[name='EmailReason']:checked").length>0?$("#EmailReasonErr").hide():$("#EmailReasonErr").show()});t.val().length==0?($("input[name^='EmailReason']:radio").each(function(){$(':radio[name="'+$(this).attr("name")+'"]:checked').length&&(i=!0)}),i?($("#EmailReasonErr").hide(),n.removeClass("errors"),t.removeClass("error"),n.find("form").removeClass("errors")):($("#emailReason").show(),$("#EmailReasonErr").show(),$("#emailError").hide(),$("#emailError>div").css("display","none"),n.addClass("errors"),t.addClass("error"),n.find("form").addClass("errors"),aa.helpers.cache.cachedElements.$html.add(aa.helpers.cache.cachedElements.$body).animate({scrollTop:$("input[type='email']").offset().top},100))):t.val().length&&p(t.val())==!1&&($("#emailError").show(),$("#emailError>div").css("display","block"),n.addClass("errors"),t.addClass("error"),n.find("form").addClass("errors"),aa.helpers.cache.cachedElements.$html.add(aa.helpers.cache.cachedElements.$body).animate({scrollTop:$("input[type='email']").offset().top},100))}}}),f=r.closest(".sales-journey-blocks").find(".errors"),o.each(function(){var t=$(this).data("namespace");!f.length&&aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.modules[t])&&$.inArray(t,n)===-1&&n.push(t)}),f.length){y();setTimeout(function(){r.removeClass("disabled processing").attr("disabled",!1);r.on("click")});o.find("input").on("change",function(){var n=$(this).closest(".mod-form");!n.length||n.hasClass("personal-details")||n.hasClass("contact-details")||formValidation.api[n.data("id")].validateForm()});return r.off("click"),!1}if(aa.salesJourneyApp.cache.$blocks.find(".blocks-visible .terms-not-accepted").length)return!1;for(e=0;e<n.length;e+=1)aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.modules[n[e]].saveAction)&&typeof aa.salesJourneyApp.modules[n[e]].saveAction=="function"&&(aa.salesJourneyApp.modules[n[e]].saveAction(),typeof sleepForRedisFix=="function"&&sleepForRedisFix(),aa.salesJourneyApp.cache.savingCompleted=!1);$(document).ajaxStop(function(){aa.salesJourneyApp.cache.savingCompleted||aa.salesJourneyApp.cache.coverOptionsChanged?(aa.salesJourneyApp.cache.currentStepLoaded=!1,r.removeClass("disabled processing").attr("disabled",!1)):(aa.salesJourneyApp.cache.savingCompleted=!0,aa.salesJourneyApp.cache.$main.find(".blocks-visible").find(".next-step").attr("disabled",!1),aa.salesJourneyApp.cache.saveBlockInProgress=!1,aa.salesJourneyApp.cache.currentStepLoaded||(window.aa.salesJourneyApp.application.goToNextStep(),aa.salesJourneyApp.cache.currentStepLoaded=!0));r.removeClass("disabled processing").attr("disabled",!1)})}var n=[],t=!1;aa.salesJourneyApp.cache.$blocks.off("click",f).on("click",".full-submit",f);aa.salesJourneyApp.cache.$blocks.off("keypress",u).on("keypress",".full-submit",u);aa.salesJourneyApp.cache.$blocks.off("keyup",r).on("keyup",".full-submit",r);aa.salesJourneyApp.cache.$blocks.off("keydown",i).on("keydown",".full-submit",i)},validateForm:function(n){var t=n.closest(".mod-form");t.hasClass("errors")&&formValidation.api[t.data("id")].validateForm()},showloader:function(){window.aa.salesJourneyApp.helpers.isDefined($("span.large"))&&window.aa.salesJourneyApp.helpers.isDefined($("span.large").siblings(".loading"))&&$("span.large").siblings(".loading").show()},hideloader:function(){window.aa.salesJourneyApp.helpers.isDefined($("span.large"))&&window.aa.salesJourneyApp.helpers.isDefined($("span.large").siblings(".loading"))&&$("span.large").siblings(".loading").fadeOut(100)},saveBlockData:function(n,t,i,r){aa.salesJourneyApp.cache.saveBlockInProgress=!0;n!=="SaveAdditionalMemberDetails"&&typeof aa.salesJourneyApp.cache.serviceRequest["saveBlockData"+n]!="undefined"&&aa.salesJourneyApp.cache.serviceRequest["saveBlockData"+n].abort();aa.salesJourneyApp.cache.saveBlockInProgress&&(aa.salesJourneyApp.cache.serviceRequest["saveBlockData"+n]=$.ajax({method:"POST",url:aa.salesJourneyApp.constants.api[n],data:JSON.stringify({BlockId:t,Data:i}),contentType:"application/json",dataType:"json"}).done(function(n){if(n.HasError){setTimeout(function(){$("#loader")&&($("#loader").stop().fadeOut(500),window.aa.salesJourneyApp.cache.$main.removeClass("loading"))},500);aa.salesJourneyApp.helpers.checkErrorsResponse(n);return}aa.salesJourneyApp.cache.saveBlockInProgress=!1;typeof r!="function"||aa.salesJourneyApp.cache.saveBlockInProgress||r(n)}).fail(function(n){n.statusText!=="abort"&&(setTimeout(function(){$("#loader")&&($("#loader").stop().fadeOut(500),window.aa.salesJourneyApp.cache.$main.removeClass("loading"))},500),aa.salesJourneyApp.helpers.checkErrorsResponse(n));n.status===500}))},saveProceedBlockData:function(n,t,i,r){typeof aa.salesJourneyApp.cache.serviceRequest["saveProceedBlockData"+n]!="undefined"&&aa.salesJourneyApp.cache.serviceRequest["saveProceedBlockData"+n].abort();var u=aa.salesJourneyApp.cache.$main.find("#card-payment");aa.salesJourneyApp.cache.serviceRequest["saveProceedBlockData"+n]=$.ajax({method:"POST",url:aa.salesJourneyApp.constants.api[n],data:JSON.stringify({BlockId:t,Data:i}),contentType:"application/json",dataType:"json",async:!1}).done(function(n){n.HasError&&n.ErrorAction==="NoAction"?(u.addClass("show-error-msg"),aa.helpers.cache.cachedElements.$html.add(aa.helpers.cache.cachedElements.$body).animate({scrollTop:u.offset().top-100},250)):typeof r!="function"||n.HasError?aa.salesJourneyApp.helpers.checkErrorsResponse(n):r()}).fail(function(n){aa.salesJourneyApp.helpers.checkErrorsResponse(n)})},saveProceedSignatureBlockData:function(n,t,i,r){$("#loader")&&$("#loader").show();n=aa.salesJourneyApp.constants.api[n];var u=aa.salesJourneyApp.cache.$main.find("#proceed-payment-signature");u.length&&$.ajax({method:"POST",url:n,data:JSON.stringify({BlockId:t,Data:i}),contentType:"application/json",dataType:"json",async:!1}).done(function(n){n.HasError&&n.ErrorAction!=="Redirection"?(u.addClass("show-error-msg"),aa.helpers.cache.cachedElements.$html.add(aa.helpers.cache.cachedElements.$body).animate({scrollTop:u.offset().top-100},250)):typeof r!="function"||n.HasError?aa.salesJourneyApp.helpers.checkErrorsResponse(n):r()}).fail(function(n){aa.salesJourneyApp.helpers.checkErrorsResponse(n)})},renderDynamicMarkup:function(n,t,i,r){aa.salesJourneyApp.helpers.isDefined(n)&&(i.html(Mustache.render(t,n)),typeof r=="function"&&r())},appendDynamicMarkup:function(n,t,i,r){aa.salesJourneyApp.helpers.isDefined(n)&&i.append(Mustache.render(t,n));typeof r=="function"&&r()},getStepViewmodel:function(n,t,i){function r(n){for(var t in n)aa.salesJourneyApp.models[n[t].ClientSideComponentName.replace(/\s/g,"")]=n[t]}var u=aa.salesJourneyApp.cache.$blocks.find("aside.top-pricing-summary"),f=aa.salesJourneyApp.helpers.isDefined(t)?aa.salesJourneyApp.constants.api[n]+"?id="+t+"&includeMarkup=true":aa.salesJourneyApp.constants.api[n]+"?includeMarkup=true";aa.salesJourneyApp.cache.serviceRequest["getStepViewmodel"+n]=$.ajax({method:"POST",url:f}).done(function(n){if(aa.salesJourneyApp.helpers.isDefined(n.CurrentStep)&&!n.CurrentStep.ShouldRedirectToServiceNotAvailableUrl){r(n.CurrentStep.Blocks);r(n.CurrentStep.Lightboxes);r(n.CurrentStep.ErrorLightbox);$(".bottom-summary").show();for(var t=0;t<n.CurrentStep.Blocks.length;t+=1)n.CurrentStep.Blocks[t].ClientSideComponentName==u.data("component-name")&&($(".bottom-summary").hide(),n.CurrentStep.Blocks);typeof i=="function"&&(i(n),aa.salesJourneyApp.cache.$loader.stop().fadeOut(1e3))}else window.location.href=n.ServiceNotAvailableUrl}).fail(function(n){n.statusText!=="abort"&&aa.salesJourneyApp.helpers.checkErrorsResponse(n);aa.salesJourneyApp.cache.$loader.stop().fadeOut(1e3)})},checkErrorsResponse:function(n){function i(n,t){aa.salesJourneyApp.cache.$blocks.find(".mod-form").filter(n).find("input").filter(t).closest(".form-field").addClass("error").find('[data-validation="minLength"]').show();$(document).find(".sales-journey-blocks").find(n).offset()!=undefined?aa.helpers.cache.cachedElements.$body.add(aa.helpers.cache.cachedElements.$html).animate({scrollTop:$(document).find(".sales-journey-blocks").find(t).offset().top-50},150,function(){$(document).find(".sales-journey-blocks").find(".year-number").focus()}):window.location.href=aa.salesJourneyApp.config.redirectionUrl}var r,f,t=aa.salesJourneyApp.helpers.isDefined(n.responseJSON)?aa.salesJourneyApp.helpers.isDefined(n.responseJSON.CurrentStep)?n.responseJSON.CurrentStep:n.responseJSON.Error:n,e,u;if(!aa.salesJourneyApp.helpers.isDefined(t)){aa.salesJourneyApp.cache.$main.find(".full-submit").removeClass("disabled processing").attr("disabled",!1);return}if(aa.salesJourneyApp.helpers.isDefined(t.RedirectionUrl)?aa.salesJourneyApp.config.redirectionUrl=t.RedirectionUrl:aa.salesJourneyApp.config.redirectionUrl===""&&(aa.salesJourneyApp.config.redirectionUrl="/"),aa.salesJourneyApp.helpers.isDefined(t.Errors)&&t.Errors.General!=undefined&&t.Errors.General.length&&t.Errors.General[0]==="InvalidAccountDetails"){r=aa.salesJourneyApp.cache.$blocks.find(".mod-form").filter(".direct-debit-payment");$accountNumber=r.find("input").filter(".account-number");r.add(r.find(".form-section")).addClass("errors");$accountNumber.closest(".form-field").addClass("error").find('[data-validation="minLength"]').show();r.siblings("#proceed-payment").find(".full-submit").prop("disabled",!1);aa.helpers.cache.cachedElements.$body.add(aa.helpers.cache.cachedElements.$html).animate({scrollTop:$accountNumber.offset().top-aa.helpers.cache.cachedElements.$body.find("#sales-journey-header").height()*2},150);return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors)&&t.Errors.General!=undefined&&t.Errors.General.length&&t.Errors.General[0]==="InvalidSortCode"){r=aa.salesJourneyApp.cache.$blocks.find(".mod-form").filter(".direct-debit-payment");f=r.find("input").filter(".sort-code");r.add(r.find(".form-section")).addClass("errors");f.closest(".form-field").addClass("error").find('[data-validation="minLength"]').show();r.siblings("#proceed-payment").find(".full-submit").prop("disabled",!1);aa.helpers.cache.cachedElements.$body.add(aa.helpers.cache.cachedElements.$html).animate({scrollTop:f.offset().top-aa.helpers.cache.cachedElements.$body.find("#sales-journey-header").height()*2},150);return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors)){if(t.Errors.General!=undefined&&t.Errors.General.length){if(t.Errors.General[0]==="InvalidTitle"){i(".personal-details",".radio-buttons-group");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(t.Errors.General[0]==="InvalidFirstName"){i(".personal-details",".first-name");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(t.Errors.General[0]==="InvalidLastName"){i(".personal-details",".last-name");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(t.Errors.General[0]==="InvalidDateOfBirth"){i(".personal-details",".year-number");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(t.Errors.General[0]==="InvalidFirstLine"){i(".personal-details","#Address line 1");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(t.Errors.General[0]==="InvalidSecondLine"){i(".personal-details","#Address line 2");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(t.Errors.General[0]==="InvalidPostCode"){i(".personal-details",".postcode-field");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(t.Errors.General[0]==="InvalidPhoneNumber"){i(".personal-details",".telephone-only");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(t.Errors.General[0]==="InvalidEmailId"){i(".personal-details","#Email");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(t.Errors.General[0]==="InvalidReason"){i(".personal-details","#emailReason");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}}if(aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.Prefix"])){i(".personal-details",".radio-buttons-group");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.FirstName"])){i(".personal-details",".first-name");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.LastName"])){i(".personal-details",".last-name");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.DateOfBirth"])){i(".personal-details",".year-number");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.FirstLine"])){i(".personal-details","#Address line 1");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.SecondLine"])){i(".personal-details","#Address line 2");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.PostCode"])){i(".personal-details",".postcode-field");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.Phone"])){i(".personal-details",".telephone-only");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.Email"])){i(".personal-details","#Email");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.ReasonForNotProvidingEmail"])){i(".personal-details","#emailReason");aa.salesJourneyApp.cache.currentStepLoaded=!0;return}}if(aa.salesJourneyApp.helpers.isDefined(t.Errors)&&aa.salesJourneyApp.helpers.isDefined(t.Errors["saveRequest.Data.SortCode"])&&t.Errors["saveRequest.Data.SortCode"].length){r=aa.salesJourneyApp.cache.$blocks.find(".mod-form").filter(".direct-debit-payment");f=r.find("input").filter(".sort-code");r.add(r.find(".form-section")).addClass("errors");f.closest(".form-field").addClass("error").find('[data-validation="minLength"]').show();r.siblings("#proceed-payment").find(".full-submit").prop("disabled",!1);aa.helpers.cache.cachedElements.$body.add(aa.helpers.cache.cachedElements.$html).animate({scrollTop:f.offset().top-aa.helpers.cache.cachedElements.$body.find("#sales-journey-header").height()*2},150);return}if(aa.salesJourneyApp.helpers.isDefined(n.responseJSON)&&(aa.salesJourneyApp.helpers.isDefined(n.responseJSON.CurrentStep)&&n.responseJSON.Error.Error==!0&&n.responseJSON.Error.ErrorAction==="Redirection"&&(window.location.href=aa.salesJourneyApp.config.redirectionUrl),aa.salesJourneyApp.helpers.isDefined(n.responseJSON.CurrentStep)&&n.responseJSON.CurrentStep.HasError==!0&&n.responseJSON.CurrentStep.ErrorAction==="Redirection"&&(window.location.href=aa.salesJourneyApp.config.redirectionUrl)),!aa.salesJourneyApp.helpers.isDefined(t.ErrorAction)||t.ErrorAction!=="NoAction"){if(aa.salesJourneyApp.helpers.isDefined(t.ErrorAction)&&(t.HasError||t.Error)&&t.ErrorAction==="Lightbox"){aa.salesJourneyApp.cache.serviceError=!1;aa.salesJourneyApp.cache.currentStepLoaded=!0;return}if(aa.salesJourneyApp.helpers.isDefined(t.ErrorAction)&&(t.HasError||t.Error)&&t.ErrorAction==="Redirection")try{u="breakdown-cover";e=aa.salesJourneyApp.config.redirectionUrl.replace(u,"").replace("//","");window.location.href=window.location.href.split(u)[0]+u+"/"+e}catch(o){window.location.href=aa.salesJourneyApp.config.redirectionUrl}else aa.salesJourneyApp.helpers.isDefined(t.ErrorAction)?(aa.salesJourneyApp.helpers.isDefined(t.ErrorAction)&&(t.HasError||t.Error)&&(t.ErrorAction!=="Lightbox"||t.ErrorAction!=="Redirection"),u="breakdown-cover",window.location.href=window.location.href.split(u)[0]+u+"/uk-error?ukberr=1001"):(u="breakdown-cover",window.location.href=window.location.href.split(u)[0]+u+"/uk-error?ukberr=1002");aa.salesJourneyApp.cache.$main.find(".full-submit").removeClass("disabled processing").attr("disabled",!1)}},updatePromoMessages:function(){function t(n,t,i,r){var u=Mustache.render(n,t);aa.salesJourneyApp.helpers.isDefined(i)&&$(u).insertAfter(r)}function n(n,t,i){var r=Mustache.render(n,t);aa.salesJourneyApp.helpers.isDefined(t)&&i.html(r)}typeof aa.salesJourneyApp.cache.serviceRequest.updatePromoMessages!="undefined"&&aa.salesJourneyApp.cache.serviceRequest.updatePromoMessages.abort();aa.salesJourneyApp.cache.serviceRequest.updatePromoMessages=$.ajax({method:"POST",url:aa.salesJourneyApp.constants.api.GetCurrentStepViewModel+"?includeMarkup=true"}).done(function(i){var h=aa.salesJourneyApp.cache.$blocks.find("article.cover-options"),o=aa.salesJourneyApp.cache.$blocks.find(".pricing-summary:visible").not(".detailed-pricing-summary"),c=aa.salesJourneyApp.cache.$blocks.find(".pricing-summary:visible").not(".bottom-pricing-summary"),e=aa.salesJourneyApp.cache.$blocks.find("#eligibility-promotion-message"),u=aa.salesJourneyApp.cache.$blocks.find(".payment-options"),y=aa.salesJourneyApp.cache.$blocks.find("article.contact-details"),v,s,r,f,l,a;if($detailTopPricingSummary=aa.salesJourneyApp.cache.$blocks.find("aside.top-pricing-summary"),v=!1,aa.salesJourneyApp.helpers.isDefined(i.CurrentStep.Blocks)&&!i.CurrentStep.ShouldRedirectToServiceNotAvailableUrl){for(s=!1,r=0;r<i.CurrentStep.Blocks.length;r+=1){e.length&&s==!1&&e.hide();switch(i.CurrentStep.Blocks[r].ClientSideComponentName){case h.data("component-name"):for(h.find(".inline-promo:visible").stop().fadeOut(250).remove(),f=0;f<i.CurrentStep.Blocks[r].Options.length;f+=1)aa.helpers.cache.cachedElements.$html.add(aa.helpers.cache.cachedElements.$body).find(".online-sales-journey").length?t(aa.salesJourneyApp.views.OptionsPromoMessage,i.CurrentStep.Blocks[r].Options[f],i.CurrentStep.Blocks[r].Options[f].PromoMessage,$("[data-option-id="+i.CurrentStep.Blocks[r].Options[f].Id+"] .mobile-description")):t(aa.salesJourneyApp.views.OptionsPromoMessage,i.CurrentStep.Blocks[r].Options[f],i.CurrentStep.Blocks[r].Options[f].PromoMessage,$("[data-option-id="+i.CurrentStep.Blocks[r].Options[f].Id+"] .option-details"));break;case o.data("component-name"):aa.salesJourneyApp.helpers.isDefined(i.CurrentStep.Blocks[r].PricingSummary)&&(o.find(".inline-promo").stop().fadeOut(250).remove(),t(aa.salesJourneyApp.views.PricingSummaryPromoMessage,i.CurrentStep.Blocks[r].PricingSummary,i.CurrentStep.Blocks[r].PricingSummary.PromoMessage,o.find(".chosen-options")),c.find(".inline-promo").stop().fadeOut(250).remove(),t(aa.salesJourneyApp.views.PricingSummaryPromoMessage,i.CurrentStep.Blocks[r].PricingSummary,i.CurrentStep.Blocks[r].PricingSummary.PromoMessage,c.find(".chosen-options")));break;case e.data("component-name"):e.show();s=!0;aa.salesJourneyApp.helpers.isDefined(i.CurrentStep.Blocks[r].PromoMessage)&&Mustache.render(aa.salesJourneyApp.views.EligibilityPromoBanner,i.CurrentStep.Blocks[r]);break;case u.data("component-name"):aa.salesJourneyApp.helpers.isDefined(i.CurrentStep.Blocks[r].MonthlyOption)&&(aa.salesJourneyApp.views.PaymentOptionPrice='<!--The contents in this item must be same as the contents in the PaymentOptions.html and if the htmlTemplateHandlerUtility is being used the corresponding item (eg./sitecore/content/TheAA/Global/Breakdown Cover Journey/Sales Journey Blocks/HtmlTemplateHandlerUtility/PaymentOptionPrice) must be in sync with the following html -->\r\n<span class="desc">{{Label}} <\/span><span class="price"> &pound;{{#Price}}{{.}}{{/Price}}<\/span>',n(aa.salesJourneyApp.views.PaymentOptionPrice,i.CurrentStep.Blocks[r].MonthlyOption,u.find("[data-monthly]").closest(".radio-field").find(".table-col").find(".freq-label")));aa.salesJourneyApp.helpers.isDefined(i.CurrentStep.Blocks[r].YearlyFromCard)&&(aa.salesJourneyApp.views.PaymentOptionPrice='<!--The contents in this item must be same as the contents in the PaymentOptions.html and if the htmlTemplateHandlerUtility is being used the corresponding item (eg./sitecore/content/TheAA/Global/Breakdown Cover Journey/Sales Journey Blocks/HtmlTemplateHandlerUtility/PaymentOptionPrice) must be in sync with the following html -->\r\n<span class="desc">{{Label}} <\/span><span class="price"> &pound;{{#Price}}{{.}}{{/Price}}<\/span>',n(aa.salesJourneyApp.views.PaymentOptionPrice,i.CurrentStep.Blocks[r].YearlyFromCard,u.find("[data-yearly-by-card]").closest(".radio-field").find(".table-col").find(".freq-label")));aa.salesJourneyApp.helpers.isDefined(i.CurrentStep.Blocks[r].YearlyFromAccount)&&(aa.salesJourneyApp.views.PaymentOptionPrice='<!--The contents in this item must be same as the contents in the PaymentOptions.html and if the htmlTemplateHandlerUtility is being used the corresponding item (eg./sitecore/content/TheAA/Global/Breakdown Cover Journey/Sales Journey Blocks/HtmlTemplateHandlerUtility/PaymentOptionPrice) must be in sync with the following html -->\r\n<span class="desc">{{Label}} <\/span><span class="price"> &pound;{{#Price}}{{.}}{{/Price}}<\/span>',n(aa.salesJourneyApp.views.PaymentOptionPrice,i.CurrentStep.Blocks[r].YearlyPayment,u.find("[data-yearly-from-account]").closest(".radio-field").find(".table-col").find(".freq-radio-label")),n(aa.salesJourneyApp.views.PaymentOptionPrice,i.CurrentStep.Blocks[r].YearlyFromAccount,u.find("[data-yearly-from-account]").closest(".radio-field").find(".table-col").find(".freq-label")));aa.salesJourneyApp.helpers.isDefined(i.CurrentStep.Blocks[r].MonthlyPayment)&&(aa.salesJourneyApp.views.PaymentOptionPrice='<!--The contents in this item must be same as the contents in the PaymentOptions.html and if the htmlTemplateHandlerUtility is being used the corresponding item (eg./sitecore/content/TheAA/Global/Breakdown Cover Journey/Sales Journey Blocks/HtmlTemplateHandlerUtility/PaymentOptionPrice) must be in sync with the following html -->\r\n<span class="desc">{{RadioLabel}} <\/span><span class="price"> &pound;{{#Price}}{{.}}{{/Price}}<\/span>',n(aa.salesJourneyApp.views.PaymentOptionPrice,i.CurrentStep.Blocks[r].MonthlyPayment,u.find("[data-monthly]").closest(".radio-field").find(".table-col").find(".freq-radio-label")));aa.salesJourneyApp.helpers.isDefined(i.CurrentStep.Blocks[r].YearlyPayment)&&(aa.salesJourneyApp.views.PaymentOptionPrice='<!--The contents in this item must be same as the contents in the PaymentOptions.html and if the htmlTemplateHandlerUtility is being used the corresponding item (eg./sitecore/content/TheAA/Global/Breakdown Cover Journey/Sales Journey Blocks/HtmlTemplateHandlerUtility/PaymentOptionPrice) must be in sync with the following html -->\r\n<span class="desc">{{RadioLabel}} <\/span><span class="price"> &pound;{{#Price}}{{.}}{{/Price}}<\/span>',n(aa.salesJourneyApp.views.PaymentOptionPrice,i.CurrentStep.Blocks[r].YearlyPayment,u.find("[data-yearly-from-account]").closest(".radio-field").find(".table-col").find(".freq-radio-label")));aa.salesJourneyApp.helpers.isDefined(i.CurrentStep.Blocks[r].PromoMessage)&&(u.find("aside.notes").stop().fadeOut(250).remove(),t(aa.salesJourneyApp.views.PaymentOptionsPromoMessage,i.CurrentStep.Blocks[r],i.CurrentStep.Blocks[r].PromoMessage,u.find(".form-section")));break;case $detailTopPricingSummary.data("component-name"):l='{{ #ProductSelection}}<li class="chosenproduct"><span class="bolder">{{ ProductTitle }}<\/span><br /><span class="unbold">{{ ProductDetail }}<\/span><\/li>{{/ ProductSelection}}';a=Mustache.render(l,i.CurrentStep.Blocks[r]);$(".cover-options-product").html(a)}}aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.modules.detailedPricing)&&aa.helpers.cache.cachedElements.$window.width()>aa.helpers.cache.constants.TABLET_LANDSCAPE&&aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.modules.detailedPricing.scrollingRightRail)&&aa.salesJourneyApp.modules.detailedPricing.scrollingRightRail(aa.helpers.cache.cachedElements.$window.scrollTop())}else window.location.href=i.ServiceNotAvailableUrl}).fail(function(n){n.statusText!=="abort"&&aa.salesJourneyApp.helpers.checkErrorsResponse(n)})},renderNextHelpMeChooseStep:function(n,t,i){aa.salesJourneyApp.cache.$loader.stop().fadeIn(500);aa.salesJourneyApp.helpers.getStepViewmodel("GetNextStepViewModel",null,function(r){var f=aa.salesJourneyApp.cache.$main.find(".questions-block"),e,u;if(aa.salesJourneyApp.helpers.isDefined(r.CurrentStep.ClientSideComponent)&&!r.CurrentStep.ShouldRedirectToServiceNotAvailableUrl){for(u=0;u<r.CurrentStep.Blocks.length;u+=1)e=Mustache.render(r.CurrentStep.ClientSideComponent[r.CurrentStep.Blocks[u].ClientSideComponentName],r.CurrentStep.Blocks[u]),f.hide().append(e),aa.salesJourneyApp.cache.$main.find(".current-question").removeClass("current-question");aa.salesJourneyApp.cache.$loader.stop().fadeOut(500);aa.helpers.cache.cachedElements.$html.add(aa.helpers.cache.cachedElements.$body).animate({scrollTop:aa.helpers.cache.cachedElements.$body.offset().top},100);aa.salesJourneyApp.helpers.isDefined(t)?aa.salesJourneyApp.helpers.replaceDataToHistory(n,t):aa.salesJourneyApp.helpers.pushDataToHistory(t);aa.salesJourneyApp.helpers.getIndicativePrice();aa.salesJourneyApp.application.loadModuleScripts();aa.salesJourneyApp.application.initBlockEvents();f.stop().fadeIn(250);$(".equal-height").each(aa.helpers.panelHeight);typeof i=="function"&&i()}else window.location.href=r.ServiceNotAvailableUrl})},getQuestionsBlock:function(n){for(var t=0;t<n.length;t+=1)if(aa.salesJourneyApp.helpers.isDefined(n[t].Answers))return n[t]},initpopStateEvents:function(n){function t(t,i){aa.salesJourneyApp.cache.currentStep>n?typeof t=="function"&&t():typeof i=="function"&&i()}var i=aa.salesJourneyApp.cache.$main.find(".questions-steps .next-question");if(aa.salesJourneyApp.cache.$main.find(".vrn-lookup").length&&aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.modules.vrnLookup)){aa.salesJourneyApp.helpers.isDefined(n)?t(aa.salesJourneyApp.modules.vrnLookup.prevStep):aa.salesJourneyApp.modules.vrnLookup.prevStep();return}if(aa.salesJourneyApp.cache.$main.find(".promotional-question.current-question").length&&aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.modules.promotionalQuestion)){aa.salesJourneyApp.helpers.isDefined(n)?t(aa.salesJourneyApp.modules.promotionalQuestion.prevStep,function(){aa.salesJourneyApp.helpers.replaceDataToHistory("question",aa.salesJourneyApp.cache.currentStep)}):aa.salesJourneyApp.modules.promotionalQuestion.prevStep();return}if(aa.salesJourneyApp.cache.$main.find(".product-recommendation.current-question").length&&aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.modules.productRecommendation)){aa.salesJourneyApp.helpers.isDefined(n)?t(aa.salesJourneyApp.modules.productRecommendation.prevStep,function(){aa.salesJourneyApp.helpers.replaceDataToHistory("question",aa.salesJourneyApp.cache.currentStep)}):aa.salesJourneyApp.modules.productRecommendation.prevStep();return}if(!aa.salesJourneyApp.cache.$main.find(".vrn-lookup").length&&!aa.salesJourneyApp.cache.$main.find(".start-again").hasClass("visible")&&aa.salesJourneyApp.helpers.isDefined(aa.salesJourneyApp.modules.needsAssessment)){aa.salesJourneyApp.helpers.isDefined(n)?t(function(){aa.salesJourneyApp.cache.$blocks.find(".question").filter(":first").hasClass("current-question")||aa.salesJourneyApp.modules.needsAssessment.prevQuestion()},function(){i.length&&i.trigger("click")}):aa.salesJourneyApp.cache.$blocks.find(".question").filter(":first").hasClass("current-question")||aa.salesJourneyApp.modules.needsAssessment.prevQuestion();return}},updateAccordion:function(n){function r(){return t.cache.$accordionItems.length>0}function u(){var n=t.cache.$main.find("div.journey-steps li.step:last-child");return n.hasClass("active")}function f(){function n(){function r(n){var r,i;if(t.helpers.isDefined(n)&&t.helpers.isDefined(n.PaymentOptions))for(i in n.PaymentOptions)n.PaymentOptions[i].Selected&&(r=n.PaymentOptions[i]);return r}function u(n){this.isMonthlyPayment=0;this.isBasicCover=t.helpers.isDefined(n.PriceBreakdown[t.config.basicCoverProductCode]);this.isFstJourney=n.IsFstJourney;this.isPartsAndGarageCover=t.helpers.isDefined(n.PriceBreakdown[t.config.partsAndGarageProductCode]);this.arrangementAndAdministrationFee=n.ArrangementFeeTotal;this.pgcArrangementAndAdministrationFee=n.ArrangementFee;this.partsAndGarageCoverFeeTotal=n.PriceBreakdown[t.config.partsAndGarageProductCode];this.partsAndGarageCoverFee=this.isPartsAndGarageCover?(this.partsAndGarageCoverFeeTotal-this.pgcArrangementAndAdministrationFee).toFixed(2):null;this.insurancePremiumFee=n.InsurancePremium;this.AnnualPrice=n.AnnualPrice;this.MonthlyPrice=n.MonthlyPrice;this.IsSmartBreakdownCover=n.IsSmartBreakdownCover;this.BaseCoverArrangementFeeTotal=n.BaseCoverArrangementFeeTotal;this.PartsAndGarrageAAFee=n.PartsAndGarrageAAFee;this.AvgQuotedPriceStartDate=n.AvgQuotedPriceStartDateString;this.AvgQuotedPriceEndDate=n.AvgQuotedPriceEndDateString}var n=r(i);return t.helpers.isDefined(n)?new u(n):null}t.cache.$accordionItems.each(function(){var i=$(this);t.helpers.renderDynamicMarkup(n(),i.html(),i.next())})}var t=aa.salesJourneyApp,i=t.helpers.isDefined(n)?n:t.models.PricingSummaryBlock.PricingSummary;if(r()){if(u()&&aa.salesJourneyApp.cache.$main.find(".payment.blocks-visible").length===0){t.cache.$accordionPlaceholder.hide();return}t.cache.$accordionPlaceholder.show();f()}},serviceErrorModal:function(){function r(){n.helpers.isDefined(i)===!1||n.helpers.isDefined(t)===!1||n.helpers.isDefined(t.Id)===!1||(n.cache.$modalScreen.find("#modal-app-placeholder").html(Mustache.render(i,t)),n.helpers.openModal());aa.salesJourneyApp.cache.$loader.stop().fadeOut(500);aa.salesJourneyApp.cache.serviceError=!0}var n=aa.salesJourneyApp,i=n.views.ErrorModal,t=n.models.ErrorLightbox;n.helpers.isDefined(t)&&r();$("#modal-app-screen").find(".modal-close").on("click",n.helpers.destroyModal);$("#blocks").find(".next-step").off("keypress").on("keypress",".next-step",function(n){n.preventDefault();n.stopPropagation();n.stopImmediatePropagation()});$("#blocks").find(".next-step").off("keydown").on("keydown",".next-step",function(n){n.preventDefault();n.stopPropagation();n.stopImmediatePropagation()});$("#blocks").find(".next-step").off("keyup").on("keyup",".next-step",function(n){n.preventDefault();n.stopPropagation();n.stopImmediatePropagation()});$("#blocks").find(".next-step").on("click",function(t){return t.preventDefault(),n.cache.serviceError?void 0:(r(),aa.salesJourneyApp.cache.serviceError=!1,!1)})},startAgainModal:function(){var n=aa.salesJourneyApp,t=n.cache.$modalScreen,i=n.cache.$main.find(".start-again"),r=n.views.StartAgainModal,u=n.models[i.data("model")];n.cache.$modalScreen.find("#modal-app-placeholder").html(Mustache.render(r,u));n.helpers.openModal();t.off("click").on("click",".accept",function(t){t.preventDefault();n.helpers.saveBlockData("StartAgain",i.data("block-id"),{},function(t){n.helpers.isDefined(t)&&window.location.reload()})});t.find(".modal-close").add(t.find(".cancel")).on("click",n.helpers.destroyModal)},pushDataToHistory:function(n,t){var i=n+"-"+t;isNaN(parseInt(t))||(aa.salesJourneyApp.cache.currentStep=t);aa.salesJourneyApp.helpers.isDefined(history.pushState)&&history.pushState({title:n,data:t,step:i},null,window.location.pathname)},replaceDataToHistory:function(n,t){var i=n+"-"+t;isNaN(parseInt(t))||(aa.salesJourneyApp.cache.currentStep=t);aa.salesJourneyApp.helpers.isDefined(history.replaceState)&&history.replaceState({title:n,data:t,step:i},null,window.location.pathname)},setActiveRadioField:function(n){var t=n.closest(".radio-field"),i=t.siblings(".radio-field");i.removeClass("highlighted");n.is(":checked")&&t.addClass("highlighted")},focusFormElement:function(n,t){n.on({focus:function(){$(this).removeClass("focused");$(this).find("input").is(":checked")||$(this).addClass("focused");$(this).find("input[name='HasBlueBadge']").is(":checked")?$(this).attr("aria-label","checked"):$(this).attr("aria-label","not checked")},blur:function(){$(this).removeClass("focused")},keypress:function(n){var i=$(this).find("input"),r=n.keyCode||n.which;n.stopPropagation();(r===13||r===32)&&n.target.id!="input-vrn-registration"&&($(this).removeClass("focused"),r===32&&n.target.id!="registration"&&n.target.className!="registration alphanumerical-only"&&(n.preventDefault(),(n.target.attributes[1].nodeValue=="PRD_UK_0003"||n.target.attributes[1].nodeValue=="PRD_UK_0004"||n.target.attributes[1].nodeValue=="PRD_UK_0005"||n.target.attributes[1].nodeValue=="PRD_UK_0018")&&i.trigger(t),n.target.className.includes("radio-field")&&i.trigger(t),n.target.className.includes("checkbox-field")&&i.trigger("click")))},click:function(){$(this).removeClass("focused");$(this).find("input[name='HasBlueBadge']").is(":checked")?$(this).attr("aria-label","checked"):$(this).attr("aria-label","not checked")}})},updateTealiumTags:function(){var n=aa.salesJourneyApp.cache.$blocks.find(".blocks-visible > .help-me-choose"),t=n.length&&!n.find(".last-question").length?aa.salesJourneyApp.constants.api.GetTaggingDataLayer+"?blockId="+n.data("block-id"):aa.salesJourneyApp.constants.api.GetTaggingDataLayer;aa.salesJourneyApp.helpers.isDefined(window.utag)&&(typeof aa.salesJourneyApp.cache.serviceRequest.GetTaggingDataLayer!="undefined"&&aa.salesJourneyApp.cache.serviceRequest.GetTaggingDataLayer.abort(),aa.salesJourneyApp.cache.serviceRequest.GetTaggingDataLayer=$.ajax({url:t}).done(function(n){window.utag.view(n.DataLayer)}))},restoreFormData:function(){var i,n,t;if(aa.salesJourneyApp.cache.formsData.length)for(n=0;n<aa.salesJourneyApp.cache.formsData.length;n+=1)for(t in aa.salesJourneyApp.cache.formsData[n])i=$('[id="'+t+'"]'),aa.salesJourneyApp.cache.formsData[n][t]==="true"?i.prop("checked",!0).parent().find("span").addClass("checked"):i.val(aa.salesJourneyApp.cache.formsData[n][t])},validateNotFoundVrnForm:function(n){function d(n){return new Date(Date.parse(n+" 1, "+f)).getMonth()}var i=n.find(".registration-year").closest(".form-field"),o=n.find("[data-minlength]"),s=n.find("[data-invalid]"),h=n.find(".make-select").closest(".form-field"),c=n.find(".select-make-group [data-required]"),l=n.find(".model-select").closest(".form-field"),a=n.find(".select-model-group [data-required]"),r=n.find(".fuelType-select").closest(".form-field"),v=n.find(".select-fuelType-group [data-required]"),u=n.find(".registration-year").val(),y=n.find(".make-select").val(),p=n.find(".model-select").val(),w=n.find(".fuelType-select").val(),t=parseInt(u,10),f=(new Date).getFullYear(),e,b=$(".not-found-vrn-select-month .selected .text")[0].innerText,k=(new Date).getMonth(),nt=$(".registration-year").val(),f=(new Date).getFullYear(),g=d(b);if(u.length===4&&y!=="-1"&&p!=="-1"&&aa.salesJourneyApp.constants.regex.years.test(t)&&t<f&&r&&w!=="-1"){n.removeClass("errors");n.find(".error").removeClass("error");n.find(".err-msgs div").hide();return}n.addClass("errors");u.length<4?(i.addClass("error"),o.show()):(i.removeClass("error"),o.hide());u.length!==0&&!aa.salesJourneyApp.constants.regex.years.test(t)||t>f||t==f&&g>k?(i.addClass("error"),s.show()):(i.removeClass("error"),s.hide(),n.find(".err-msgs div").hide());y==="-1"?(h.addClass("error"),c.show()):(h.removeClass("error"),c.hide());p==="-1"?(l.addClass("error"),a.show()):(l.removeClass("error"),a.hide());r&&(w==="-1"?(r.addClass("error"),v.show()):(r.removeClass("error"),v.hide()));n.find(".error").length==0&&(n.find(".error").removeClass("error"),n.removeClass("errors"));e=aa.salesJourneyApp.cache.$main.find(".error");e.length&&aa.helpers.cache.cachedElements.$html.add(aa.helpers.cache.cachedElements.$body).add(aa.salesJourneyApp.cache.$modalScreen).animate({scrollTop:e.eq(0).offset().top-$("#sales-journey-header").outerHeight()-parseFloat(n.find(".form-field").css("margin-bottom"))},100,function(){e.eq(0).find("input").focus()})},checkNotFoundVrnFormField:function(){var n=aa.salesJourneyApp.cache.$main.find(".vrn-detailed-search.vrn-not-found");n.find("input, select").on("change",function(){n.filter(".errors").length&&aa.salesJourneyApp.helpers.validateNotFoundVrnForm($(this).closest(".vrn-detailed-search"))})},closeSession:function(){typeof aa.salesJourneyApp.cache.serviceRequest.CloseSession!="undefined"&&aa.salesJourneyApp.cache.serviceRequest.CloseSession.abort();aa.salesJourneyApp.cache.serviceRequest.CloseSession=$.ajax({method:"POST",url:aa.salesJourneyApp.constants.api.CloseSession}).done(function(n){n.Success||aa.salesJourneyApp.helpers.serviceErrorModal()}).fail(aa.salesJourneyApp.helpers.serviceErrorModal)},restorePersonalDetails:function(n){function o(n,t){aa.salesJourneyApp.helpers.isDefined(n)&&n==="checked"?(t.prop("checked",!0).parent().find("span").addClass("checked"),t.find("label").addClass("checked")):aa.salesJourneyApp.helpers.isDefined(n)&&(t.eq(n).prop("checked",!0).parent().find("span").addClass("checked"),t.find("label").addClass("checked"))}var r=n.find(".date-of-birth-group"),t=n.find(".radio-buttons-group"),e=n.find(".first-name-group"),s=n.find(".last-name-group"),h=n.find(".checkbox-field").filter(".information"),u=r.data("selected-birth-date"),i=u.split("-").reverse(),f=$(".personal-details .radio-buttons-group .stylish-form .radio-field input:radio[name='Prefix']");f.on("click",function(){$selectedIndexMainPolicyHolderGrp=f.index(f.filter(":checked"));console.log($selectedIndexMainPolicyHolderGrp)});t&&t.length!=0||(t=n.find(".radio-buttons-group"));r.each(function(){if(u&&u!=="0001-01-01T00:00:00"){i[0]=i[0].replace("T00:00:00","");for(var n=0;n<i.length;n+=1)r.find(".dob-input").eq(n).val(i[n])}});h.each(function(){var n=$(this);o(n.data("blue-badge"),n.find('input[type="checkbox"]'))});e.length>0&&(e.find('input[type="text"]').val()!=""||s.find('input[type="text"]').val()!="")&&t.each(function(){var n=$(this);n.find('input[type="radio"]').each(function(){$(this).prop("checked",!1)});n.find('input[type="radio"]').each(function(){$(this).not(":checked")&&$(this).parent().find("span").removeClass("checked")});o($selectedIndexMainPolicyHolderGrp,n.find('input[type="radio"]'))})},genericAjax:function(n,t,i,r){var u=n=="GET"?$.param(i):i;$.ajax({method:n,url:t,data:u,contentType:"application/json",dataType:"json"}).done(function(n){r(n)}).fail(function(){console.error("Helper: genericAjax failed. Request:"+n+":"+t)})}};window.Responsive||(window.Responsive={});window.Responsive=function e(){"use strict";function t(){var i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=[],n=[],r=this;r.mode=0;var e=function(n){for(var t=0;t<n.methods.length;t++)"function"==typeof n.methods[t]&&n.methods[t].call(this,n.event)},u=function(u){var s,f;i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;s=0;for(f in n){if(f>=i||s===n.length-1){"undefined"!=typeof n[f]&&(t[f]||e({methods:n[f],event:u}),o(f));r.mode=f;break}s++}},f=function(){function t(){u("resize")}var n;window.onresize=function(){u("resize");clearTimeout(n);n=setTimeout(function(){t()},100)}},o=function(n){for(var i in t)t[i]=!1;t[n]=!0},s=function(){function f(t){for(var r=0;r<t.length;r++)n[i].push(t[r])}var u=arguments[0],i,r;for(i in u)r=u[i],"function"==typeof r&&(r=[r]),"undefined"!=typeof n[i]?f(r):(n[i]=r,t.push(i))};return f(),{register:s,trigger:f}}function i(){var i=[],r="undefined"!=typeof window.document.createElement("div").style.objectFit,u={container:function(){for(var t,n=this.parentNode;9!==n.nodeType;){if((" "+n.className+" ").indexOf(" image-fit-container ")>-1){t=n;break}n=n.parentNode}return t},objectFit:!0,useMargins:!1,resize:!0,checkOnResize:!1,onPreLoad:function(){},onCheck:function(){},onSet:function(){}},t={handleElems:function(n){var i=[],t;if("undefined"!=typeof n&&null!==n)if("undefined"==typeof n.length)i.push(n);else if(n.length)for(t=0;t<n.length;t+=1)i.push(n[t]);return i},checkCallback:function(n,t){"function"==typeof n&&n.call(t)},merge:function(){for(var n,i,r={},t=0;t<arguments.length;t+=1){n=arguments[t];for(i in n)n.hasOwnProperty(i)&&(r[i]=n[i])}return r},addClass:function(n,t){var f=" "+n.className+" ",r=t.split(" "),u="",i=0;for(i;i<r.length;i+=1)-1===f.indexOf(" "+r[i]+" ")&&""!==r[i]&&(u+=" "+r[i]);n.className+=u},removeClass:function(n,t){var r=" "+n.className+" ",u=t.split(" "),i=0;for(i;i<u.length;i+=1)r=r.replace(" "+u[i]+" "," ");n.className=r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},n={resize:{timer:void 0,bind:function(n,t){n.resize&&t&&i.push(n)},check:function(t){t.checkOnResize?n.run(t,!1):n.checkAndSet(t)},run:function(){i.length&&(n.resize.timer&&clearTimeout(n.resize.timer),n.resize.timer=setTimeout(function(){var t=0;for(t;t<i.length;t+=1)n.resize.check(i[t])},100))}},checkAndSet:function(n){t.removeClass(n.img,"fitted-tall fitted-wide");t.checkCallback(n.onCheck,n.img);var r=n.img.clientHeight/n.img.clientWidth*100,u=n.container.clientHeight/n.container.clientWidth*100,i=u>r?"fitted-tall":"fitted-wide";t.addClass(n.img,"fitted "+i);n.useMargins&&(t.addClass(n.img,"fitted-margins"),"fitted-tall"===i?(n.img.style.marginLeft=-(n.img.clientWidth/2)+"px",n.img.style.marginTop=""):(n.img.style.marginLeft="",n.img.style.marginTop=-(n.img.clientHeight/2)+"px"));t.checkCallback(n.onSet,n.img)},run:function(i,u){var f=new Image;return t.checkCallback(i.onPreLoad,i.img),i.objectFit&&r?(t.addClass(i.img,"fitted fitted-object-fit"),void(i.checkOnResize&&n.resize.bind(i,u))):(f.onload=function(){n.checkAndSet(i);n.resize.bind(i,u)},f.onerror=function(){t.addClass(i.img,"fitted-error")},void(f.src=i.img.currentSrc||i.img.src))},prep:function(i){"function"==typeof i.container&&(i.container=i.container.call(i.img));i.container=t.handleElems(i.container);i.container.length&&(i.container=i.container[0],i.img.imageFitData=i,n.run(i,!0))},init:function(i,r){var e="string"==typeof r&&"update"===r,f;for(i=t.handleElems(i),f=0;f<i.length;f+=1)e&&"undefined"!=typeof i[f].imageFitData?n.run(i[f].imageFitData,!1):n.prep(t.merge(u,r,{img:i[f]}))}};return"undefined"!=typeof addEventListener?window.addEventListener("resize",n.resize.run):window.attachEvent("onresize",n.resize.run),"undefined"!=typeof $&&null!==$&&($.fn.fluidImages=function(t){return n.init(this,t),this}),this.init=n.init,this}var n=new t,r=new i;return e.prototype.api={register:n.register,trigger:n.trigger,enableFluidImages:r.init},this};!function(n){window.serialise||(window.serialise={});window.serialise=new function(){var t=function(){},r=function(n){var i=[];for(var t in n)n.hasOwnProperty(t)&&i.push(encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return i.join("&")},u=function(n){for(var i,r={},u=-1!=n.indexOf("#")?n.split("#")[1].split("&"):n.split("?")[1].split("&"),t=0;t<u.length;t+=1)i=u[t].split("="),r[decodeURIComponent(i[0])]=decodeURIComponent(i[1]);return r},i=function(n){function r(n,t){for(var i in t)try{n[i]=t[i].constructor==Object?r(n[i],t[i]):t[i]}catch(u){n[i]=t[i]}return n}function e(n,t){for(var r,u=r={},i=0;i<n.length;i+=1)r=r[n[i]]=i===n.length-1?t:{};return u}var i={},t,u,f;for(t in n)-1!==t.indexOf(".")?(u=t.split("."),f=e(u,n[t]),i=r(i,f)):i[t]=n[t];return i};if("undefined"!=typeof jQuery)var f=function(){var i={},n=arguments[0].serializeArray();for(var t in n)void 0!==i[n[t].name]?(i[n[t].name].push||(i[n[t].name]=[i[n[t].name]]),i[n[t].name].push(n[t].value||"")):i[n[t].name]=n[t].value||"";return i},e=function(t,i){function f(t){return n.map(t.split("-"),function(n,t){return(t?n.charAt(0).toUpperCase():n.charAt(0))+n.slice(1).toLowerCase()}).join("")}function e(n,t){return""!==n&&void 0!==n&&null!==n||!t||(n=t),n}var r=this,u=f(i);return t.find("[data-"+i+"]").each(function(){var t=n(this),i=t.data();r[i[u]]=t.is("select")&&1==i.rawValue?t.children("option:selected").text():t.is(":checkbox")?t.is(":checked"):e(t.val(),t.data().sentinel);"number"===i.format&&(r[i[u]]=parseFloat(r[i[u]].replace(/,/g,"")))}),t.find("[data-"+i+"-group]").each(function(){var u=n(this),e=u.data(),t=[];u.children().each(function(){var r=n(this).find('input[type="checkbox"]:checked, input[type="radio"]:checked'),i=e.rawValue?r.attr("data-id"):r.attr("name");""!==i&&void 0!==i&&(r.is('input[type="radio"]')&&u.data("single-value")===!0?t=i:t.push(i))});t.length>0&&(r[e[f(i+"-group")]]=t)}),r},o=function(n,t){var r={},u=new e(n,t);for(var f in u)r[f]=u[f];return i(r)};return"undefined"!=typeof jQuery&&(t.prototype.jQueryObj=f,t.prototype.jQueryData=o),t.prototype.obj=r,t.prototype.url=u,t.prototype.complex=i,new t}}(jQuery);!function(n){window.stylishForms||(window.stylishForms={});window.stylishForms=new function(){var t=!1,i=function(i){var u=function(){i.find('input[type="text"], input[type="number"], input[type="password"], input[type="email"], input[type="tel"], textarea').each(function(){n(this).attr("tabindex",0).wrap('<div class="stylish-'+this.type+'" data-type="'+this.type+'" tabindex="-1" />').before("<span><\/span>");r.setFocusClass(n(this));r.disableField(n(this))});i.find("input.date").each(function(){n(this).parent().addClass("multidate").children("span").addClass("date");r.setFocusClass(n(this))})},f=function(){i.find("select").each(function(){n(this).wrap('<div class="stylish-select" data-type="'+this.type+'" tabindex="-1" />').css({opacity:0,position:"absolute",left:"-9999px"}).after('<span class="selected"><span class="text">'+n(this).find("option:selected").text()+'<\/span><span class="ico"><\/span><\/span><div class="dropdown-list" role="listbox"><div><\/div><\/div>');e(n(this));r.setFocusClass(n(this));r.disableField(n(this))})},e=function(t){var u,r=0,i="";return t.children().each(function(){n(this).is("optgroup")?(i+='<div class="dropdown-option group">',i+="<span>"+n(this).attr("label")+"<\/span>",i+="<ul>",n(this).children().each(function(){n(this).data("index",r);i+='<li class="dropdown-option" role="option" data-index="'+r+'" '+(n(this).is(":disabled")?'class="disabled"':"")+(n(this).is(":selected")?" option-selected":"")+">"+n(this).text()+"<\/li>";r+=1}),i+="<\/ul>",i+="<\/div>"):(n(this).data("index",r),i+='<div class="dropdown-option'+(n(this).is(":disabled")?" disabled":"")+(n(this).is(":selected")?" option-selected":"")+'" role="option" data-index="'+r+'">'+n(this).text()+"<\/div>",r+=1)}),u=t.closest(".stylish-select").find(".dropdown-list > div"),u.append(i),u.find(".dropdown-option").add(u.find(".dropdown-option")).not(".disabled, .group").attr("tabindex",0),i},o=function(){i.find('.dropdown-list[data-stylish-group="checkbox-dropdown"]').each(function(){n(this).wrap('<div class="stylish-select checkbox-dropdown" data-type="'+this.type+'" tabindex="-1" />').before('<span class="selected"><\/span>');s(n(this));r.setFocusClass(n(this))})},s=function(n){n.siblings(".selected").html('<span class="text">'+n.data("default-option-text")+'<\/span><span class="ico"><\/span>');n.find(".dropdown-option").attr("tabindex",0)},h=function(){i.find('input[type="checkbox"], input[type="radio"]').each(function(){r.dualStatesHelper(n(this),n(this).attr("type"));r.setFocusClass(n(this))})},c=function(){i.find('[data-type="range"]').each(function(){var i=n(this),t=i.data(),s=t.updateValue,e=t.inputfor,u=i.parent().find('[data-input-from="'+e+'"]'),f=i.parent().find('[data-input-to="'+e+'"]'),o=[u.val(),f.val()].filter(function(n){return void 0!==n});i.slider({range:o.length>1,values:o,step:t.precision,min:t.min,max:t.max,slide:function(n,t){var i=t.values[0],r=t.values[1];s&&(u&&u.val(i),f&&f.val(r))},start:r.hideDropdowns})})},r={checkboxDdSelected:function(t){var u=t.find('input[type="checkbox"]:checked, input[type="radio"]:checked'),i=t.find(".selected > span.text"),f=[],r="";0===u.length?i.html(t.find(".dropdown-list").data("default-option-text")):(u.each(function(){f.push(n('label[for="'+n(this).attr("id")+'"]').text())}),r=f.join(", "),i.html(r),i.attr("title",r))},setDropdownHeight:function(t){var i=t.offset(),u=n(window).scrollTop(),e=i.top+t.outerHeight(),r=n(window).height()+u,f=i.top-u,o=r-i.top;e>r?f>o?(t.css("max-height",.8*f),t.addClass("show-above")):(t.css("max-height",.8*(r-i.top)),t.removeClass("show-above")):(t.removeClass("show-above"),t.css("max-height",""))},hideDropdowns:function(t){0===n(t.target).closest(".stylish-select").length&&n("[data-stylish-form]").find(".stylish-select").removeClass("active").find(".dropdown-list").hide().css("max-height","").removeClass("show-above")},setFocusClass:function(n){n.on({focus:function(){n.parent().addClass("focus")},blur:function(){n.parent().removeClass("focus")}})},returnDefaultSelected:function(n){var t=n.find("option").filter(function(){return this.defaultSelected}),i=n.closest(".stylish-select").find(".dropdown-list .dropdown-option");return 0===t.length?(i.eq(0).addClass("option-selected"),i.eq(0)):(i.eq(t.index()).addClass("option-selected"),t)},returnDefaultChecked:function(n){var t=n.closest(".stylish-form").find('input:radio[name="'+n.attr("name")+'"]').filter(function(){return this.defaultChecked});t.prop("checked",!0).siblings("span").addClass("checked")},disableField:function(n){n.parent().toggleClass("disabled",n.is(":disabled"))},checkField:function(t){"radio"===t.attr("type")&&(t.closest(".stylish-form").find("input:radio").not(":checked").each(function(){n(this).attr("name")===t.attr("name")&&n(this).siblings("span").removeClass("checked")}),n('input:radio[name="'+t.attr("name")+'"]:checked').val()||r.returnDefaultChecked(t));t.siblings("span").toggleClass("checked",t.is(":checked"))},dualStatesHelper:function(n,t){n.wrap('<div class="stylish-ds" data-type="'+t+'" />').css({opacity:0,position:"absolute"}).before('<span class="'+(n.is(":checked")?"checked":"")+'"><span class="ico"><\/span><\/span>')},updateCheckboxSelected:function(n){n.closest(".stylish-select.checkbox-dropdown").length&&(r.checkboxDdSelected(n.closest(".stylish-select.checkbox-dropdown")),n.closest("li").toggleClass("checked"))}},l=function(){var e,u="",f=!1;i.on("change",'.stylish-ds input[type="checkbox"]',function(){n(this).siblings("span").toggleClass("checked");r.updateCheckboxSelected(n(this))});i.on("change",".stylish-ds input[type=radio]",function(){i.find('input[type="radio"][name="'+n(this).attr("name")+'"]').each(function(){n(this).siblings("span").removeClass("checked")});n(this).siblings("span").addClass("checked")});i.on("click",".stylish-select > .selected",function(t){var i=n(this).closest(".stylish-select").find(".dropdown-list"),u=n(this).closest(".stylish-select").siblings("select");t.stopPropagation();u.is(":disabled")||(n(".stylish-select .dropdown-list").not(i).hide().closest(".stylish-select").removeClass("active"),i.toggle(),i.is(":visible")?(i.closest(".stylish-select").addClass("active"),r.setDropdownHeight(i)):i.closest(".stylish-select").removeClass("active"),0===i.find(".option-selected").length&&r.returnDefaultSelected(u))});i.on("mouseover",".stylish-select:not(.checkbox-dropdown) .dropdown-option",function(){n(this).not(".disabled").addClass("option-selected").siblings(".option-selected").removeClass("option-selected")});i.on("click",".stylish-select:not(.checkbox-dropdown) .dropdown-option",function(t){var i=n(this);t.stopPropagation();i.is(":not(.group, .disabled)")&&(i.closest(".stylish-select").find(".dropdown-list").hide(),i.closest(".stylish-select").find("select").prop("selectedIndex",i.data("index")).change())});i.on("change",".stylish-select select",function(){var t=n(this),i=t.find("option:selected"),r=t.closest(".stylish-select").find(".dropdown-list");t.parent().find("span.selected > span.text").html(i.text());r.find(".dropdown-option[data-index]").removeClass("option-selected").eq(t.prop("selectedIndex")).addClass("option-selected")});i.on("keypress, keyup, keydown",".stylish-select select",function(t){var i=n(this),u=i.closest(".stylish-select"),f=u.find(".dropdown-list");switch(t.which){case 13:case 32:t.preventDefault();t.stopPropagation();u.hasClass("active")?r.hideDropdowns(i):(u.addClass("active"),f.show(),r.setDropdownHeight(f));i.blur();u.focus();i.trigger("change");break;case 27:case 9:i.trigger("change");r.hideDropdowns(i);break;case 38:case 40:i.trigger("change")}});i.on("keypress, keyup, keydown",".stylish-select.active",function(t){function l(){if(u===n(this).text().trim().substring(0,u.length).toLowerCase())return(i.removeClass("option-selected"),n(this).addClass("option-selected"),a=!0,!1)}var c=n(this),s=c.find("select"),h=c.find(".dropdown-list"),o=h.find(".dropdown-option:not(.disabled)"),i=o.filter(".option-selected"),a=!1;switch(t.which){case 13:case 32:case 27:case 9:t.preventDefault();s.find("option").eq(i.data("index")).prop("selected",!0);s.focus();c.blur().removeClass("active");s.trigger("change");r.hideDropdowns(s);break;case 38:t.preventDefault();i.length?i.index()&&(i.removeClass("option-selected").prevAll(".dropdown-option:not(.disabled)").first().addClass("option-selected"),h.scrollTop(o.filter(".option-selected").position().top)):o.last().addClass("option-selected");break;case 40:t.preventDefault();i.length?i.index()+1<o.length&&(i.removeClass("option-selected").nextAll(".dropdown-option:not(.disabled)").first().addClass("option-selected"),h.scrollTop(o.filter(".option-selected").position().top)):o.first().addClass("option-selected");break;default:(t.which>=48&&t.which<=57||t.which>=65&&t.which<=90)&&i.length&&(f?(clearTimeout(e),u+=String.fromCharCode(t.which).toLowerCase()):u=String.fromCharCode(t.which).toLowerCase(),f=!0,e=setTimeout(function(){f=!1},1e3),o.slice(i.index()+1).each(l),a||o.slice(0,i.index()).each(l),h.scrollTop(o.filter(".option-selected").position().top))}});t===!1&&(n(document).on("click touchend",r.hideDropdowns),t=!0)};i.off();void function(){i.addClass("stylish-form").attr("data-stylish-form","set");u();f();h();o();jQuery.ui&&c();l()}()};this.apply=function(){n('[data-stylish-form="true"]').each(function(){i(n(this))})};this.update=function(){this.apply()};this.refresh=function(n){_refresh(n)}}}(jQuery),function(n,t){typeof exports=="object"&&exports&&typeof exports.nodeName!="string"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(n.Mustache={},t(n.Mustache))}(this,function(n){function f(n){return typeof n=="function"}function l(n){return u(n)?"array":typeof n}function o(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function s(n,t){return n!=null&&typeof n=="object"&&t in n}function v(n,t){return a.call(n,t)}function p(n){return!v(y,n)}function b(n){return String(n).replace(/[&<>"'`=\/]/g,function(n){return w[n]})}function tt(t,i){function lt(){if(ft&&!w)while(y.length)delete a[y.pop()];else y=[];ft=!1;w=!1}function ht(n){if(typeof n=="string"&&(n=n.split(d,2)),!u(n)||n.length!==2)throw new Error("Invalid tags: "+n);et=new RegExp(o(n[0])+"\\s*");v=new RegExp("\\s*"+o(n[1]));st=new RegExp("\\s*"+o("}"+n[1]))}var et,v,st,f,c,e,s,b,ot,l,tt,ct;if(!t)return[];var ut=[],a=[],y=[],ft=!1,w=!1;for(ht(i||n.tags),f=new r(t);!f.eos();){if(c=f.pos,s=f.scanUntil(et),s)for(tt=0,ct=s.length;tt<ct;++tt)b=s.charAt(tt),p(b)?y.push(a.length):w=!0,a.push(["text",b,c,c+1]),c+=1,b==="\n"&&lt();if(!f.scan(et))break;if(ft=!0,e=f.scan(nt)||"name",f.scan(k),e==="="?(s=f.scanUntil(h),f.scan(h),f.scanUntil(v)):e==="{"?(s=f.scanUntil(st),f.scan(g),f.scanUntil(v),e="&"):s=f.scanUntil(v),!f.scan(v))throw new Error("Unclosed tag at "+f.pos);if(ot=[e,s,c,f.pos],a.push(ot),e==="#"||e==="^")ut.push(ot);else if(e==="/"){if(l=ut.pop(),!l)throw new Error('Unopened section "'+s+'" at '+c);if(l[1]!==s)throw new Error('Unclosed section "'+l[1]+'" at '+c);}else e==="name"||e==="{"||e==="&"?w=!0:e==="="&&ht(s)}if(l=ut.pop(),l)throw new Error('Unclosed section "'+l[1]+'" at '+f.pos);return rt(it(a))}function it(n){for(var u=[],t,i,r=0,f=n.length;r<f;++r)t=n[r],t&&(t[0]==="text"&&i&&i[0]==="text"?(i[1]+=t[1],i[3]=t[3]):(u.push(t),i=t));return u}function rt(n){for(var u=[],r=u,i=[],t,e,f=0,o=n.length;f<o;++f){t=n[f];switch(t[0]){case"#":case"^":r.push(t);i.push(t);r=t[4]=[];break;case"/":e=i.pop();e[5]=t[2];r=i.length>0?i[i.length-1][4]:u;break;default:r.push(t)}}return u}function r(n){this.string=n;this.tail=n;this.pos=0}function i(n,t){this.view=n;this.cache={".":this.view};this.parent=t}function t(){this.cache={}}var c=Object.prototype.toString,u=Array.isArray||function(n){return c.call(n)==="[object Array]"},a=RegExp.prototype.test,y=/\S/,w={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},k=/\s*/,d=/\s+/,h=/\s*=/,g=/\s*\}/,nt=/#|\^|\/|>|\{|&|=|!/,e;r.prototype.eos=function(){return this.tail===""};r.prototype.scan=function(n){var i=this.tail.match(n),t;return!i||i.index!==0?"":(t=i[0],this.tail=this.tail.substring(t.length),this.pos+=t.length,t)};r.prototype.scanUntil=function(n){var i=this.tail.search(n),t;switch(i){case-1:t=this.tail;this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,i);this.tail=this.tail.substring(i)}return this.pos+=t.length,t};i.prototype.push=function(n){return new i(n,this)};i.prototype.lookup=function(n){var o=this.cache,t,i,r,u,e;if(o.hasOwnProperty(n))t=o[n];else{for(i=this,e=!1;i;){if(n.indexOf(".")>0)for(t=i.view,r=n.split("."),u=0;t!=null&&u<r.length;)u===r.length-1&&(e=s(t,r[u])),t=t[r[u++]];else t=i.view[n],e=s(i.view,n);if(e)break;i=i.parent}o[n]=t}return f(t)&&(t=t.call(this.view)),t};t.prototype.clearCache=function(){this.cache={}};t.prototype.parse=function(n,t){var r=this.cache,i=r[n];return i==null&&(i=r[n]=tt(n,t)),i};t.prototype.render=function(n,t,r){var u=this.parse(n),f=t instanceof i?t:new i(t);return this.renderTokens(u,f,r,n)};t.prototype.renderTokens=function(n,t,i,r){for(var s="",f,e,u,o=0,h=n.length;o<h;++o)u=undefined,f=n[o],e=f[0],e==="#"?u=this.renderSection(f,t,i,r):e==="^"?u=this.renderInverted(f,t,i,r):e===">"?u=this.renderPartial(f,t,i,r):e==="&"?u=this.unescapedValue(f,t):e==="name"?u=this.escapedValue(f,t):e==="text"&&(u=this.rawValue(f)),u!==undefined&&(s+=u);return s};t.prototype.renderSection=function(n,t,i,r){function l(n){return c.render(n,t,i)}var c=this,o="",e=t.lookup(n[1]),s,h;if(e){if(u(e))for(s=0,h=e.length;s<h;++s)o+=this.renderTokens(n[4],t.push(e[s]),i,r);else if(typeof e=="object"||typeof e=="string"||typeof e=="number")o+=this.renderTokens(n[4],t.push(e),i,r);else if(f(e)){if(typeof r!="string")throw new Error("Cannot use higher-order sections without the original template");e=e.call(t.view,r.slice(n[3],n[5]),l);e!=null&&(o+=e)}else o+=this.renderTokens(n[4],t,i,r);return o}};t.prototype.renderInverted=function(n,t,i,r){var f=t.lookup(n[1]);if(!f||u(f)&&f.length===0)return this.renderTokens(n[4],t,i,r)};t.prototype.renderPartial=function(n,t,i){if(i){var r=f(i)?i(n[1]):i[n[1]];if(r!=null)return this.renderTokens(this.parse(r),t,i,r)}};t.prototype.unescapedValue=function(n,t){var i=t.lookup(n[1]);if(i!=null)return i};t.prototype.escapedValue=function(t,i){var r=i.lookup(t[1]);if(r!=null)return n.escape(r)};t.prototype.rawValue=function(n){return n[1]};n.name="mustache.js";n.version="2.2.1";n.tags=["{{","}}"];e=new t;n.clearCache=function(){return e.clearCache()};n.parse=function(n,t){return e.parse(n,t)};n.render=function(n,t,i){if(typeof n!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+l(n)+'" was given as the first argument for mustache#render(template, view, partials)');return e.render(n,t,i)};n.to_html=function(t,i,r,u){var e=n.render(t,i,r);if(f(u))u(e);else return e};n.escape=b;n.Scanner=r;n.Context=i;n.Writer=t}),function(n){function t(){function r(){t.stop().slideDown()}function u(){t.stop().slideUp()}var t=n(this),i=t.data("app-id");if(client.Mobile&&client.Android){window.aa.helpers.cache.registerCookie.check("AppInstalled")?n.inArray(i,window.aa.helpers.cache.registerCookie.check("AppInstalled").split(","))===-1&&r():r();t.find(".close").on("click",function(){var t=window.aa.helpers.cache.registerCookie.check("AppInstalled");t=t?t.split(","):[];n.inArray(i,t)===-1&&t.push(i);window.aa.helpers.cache.registerCookie.write("AppInstalled",t.join(","),14);u()})}}n(".app-banner").each(t)}(jQ);boot.config.libs="/Assets/scripts/libs/";window.aa.helpers.cache.cachedElements.$document.ready(function(){typeof FormValidation!="undefined"&&(FormValidation.Manifest.ExtensionPath="/Assets/scripts/roads/",FormValidation.Manifest.Externals.register("CustomValidationRules","custom-validation-rules.js"),formValidation.init(),$(".form-module, .form-section").each(initFormElements));$(".wffm-form-module").each(initWffmFormElements);setUrlBack()});$(document).find("#vehicleDetailsYes").on("click",function(){$("#dvVehicleDetails").hide();$("#dvVrnEntry").hide();$("#hiddenIsVehicleMatching").val()==="true"?($("#dvHaveMembership").show(),$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){n!==null&&utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/policyholder_question, forgerock_ID:"+n})}})):($("#dvVehicleNotCovered").show(),window.location.href=window.location.href+"#vrnfail")});$(document).find("#vehicleDetailsNo").on("click",function(){$("#dvVehicleDetails").hide();$("#dvVehicleNotFound").show();$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){n!==null&&utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/validate_plate_details, forgerock_ID:"+n})}});$("#vehicleNumber").text($("#hiddenVehicleNumber").val())});$(document).find("#vehicleNotFoundNo").on("click",function(){$("#dvVrnEntry").show();$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){n!==null&&utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/enter_number_plate, forgerock_ID:"+n})}});$("#dvVehicleNotFound").hide()});$(document).find("#vehicleNotFoundYes").on("click",function(){$("#dvVrnEntry").hide();$("#dvVehicleNotFound").hide();$("#dvVehicleNotCovered").show();$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){n!==null&&utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/vehicle_not_covered",error_message:"vehicle not covered, forgerock_ID:"+n})}});window.location.href=window.location.href+"#vrnfail"});$(document).find(".continue-yes-no").on("click",function(){if($("#haveMembershipYes").is(":checked")&&($("#dvVrnEntry").hide(),$("#dvHaveMembership").hide(),$("#dvMain").show(),$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){n!==null&&utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/vehicle_policyholder_not_found",error_message:"vehicle policyholder not found, forgerock_ID:"+n,event_category:"Vehicle Beneficiary",event_name:"Policyholder check - continue button clicked",event_label:"Yes"})}})),$("#haveMembershipNo").is(":checked")){$("#dvVrnEntry").hide();$("#dvHaveMembership").hide();$("#dvHaveMembershipNo").hide();$("#dvPostcodeEntry").show();var n=document.getElementById("HomePostcode1"),t=document.getElementById("txtPostcode");t.value=n.value;$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){n!==null&&utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/create_vehicle_beneficiary, forgerock_ID:"+n,event_category:"Vehicle Beneficiary",event_name:"Policyholder check - continue button clicked",event_label:"No"})}})}});$("#btnFindYourAddress").on("click",function(n){$("#btnFindYourAddress").addClass("disabled processing");$("#address-errmsgs").css("display","none");$("#dvVehicleDetails").hide();n.stopImmediatePropagation();var r=$(document).find("#txtFirstLineOfAddress").val(),t=$(document).find("#txtPostcode").val(),i=t.slice(0,2);if(t===""||i.toLowerCase()==="im"||i.toLowerCase()==="je"||i.toLowerCase()==="gy")return $("#btnFindYourAddress").removeClass("disabled processing"),$("#address-errmsgs").css("display","block"),!1;$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetAddress",dataType:"JSON",data:{Firstline:r,Postcode:t},success:function(n){var r,t,u,f,e,i;if(n.ViewModelData!==null){if($("#dvVrnEntry").hide(),$("#dvHaveMembership").hide(),$("#dvMain").hide(),$("#dvHaveMembershipNo").hide(),$("#dvPostcodeEntry").hide(),$("#dvContactDetails").show(),t=n.ViewModelData.Addresses,t.Length==0)return $("#dvPostcodeEntry").show(),!1;if(t.length>1){if(r=[],t=n.ViewModelData.Addresses,t.length>1){$("#single-address").hide();$.each(t,function(n,t){dropDownOption=t.Line1.indexOf("FLAT ")!=-1||t.Line1.indexOf("APARTMENT ")!=-1?t.Line1+", "+t.Line2+", "+t.Town+", "+t.PostCode:t.Line1+", "+t.Line2+", "+t.Town+", "+t.PostCode;r.push(' <option value="'+t.Line1+";"+t.Line2+";"+t.Town+";"+t.County+";"+t.PostCode+'">'+dropDownOption)+"<\/option>"});u=$("#multiple-address");f=$("#vbaddress");n(u,f,r);function n(n,t,i){selectDropdown=n.find(".stylish-select");selectDropdown.length&&(n.find(".dropdown-list").remove(),n.attr("data-stylish-form","true"),n.find(".selected").remove(),t.unwrap());n.attr("data-stylish-form","true");t.find("option.default").nextAll("option").remove();t.find("option.default").after(i);stylishForms.update();n.show()}$("#vbaddress").change(function(){var i=document.getElementById("vbaddress"),t=i.options[i.selectedIndex].text,n;if(t==="Choose")return!1;$("#multi-address").text(t);n=new Date;n.setTime(n.getTime()+6e5);expires="; expires="+n.toGMTString();document.cookie="vbaddress="+t+expires+"; path=/"})}}else $("#multiple-address").hide(),$("#addressline1").text(t[0].Line1),$("#addressline2").text(t[0].Line2),$("#addressline3").text(t[0].Line3),$("#town").text(t[0].Town),$("#postcode").text(t[0].PostCode),e=t[0].Line1+", "+t[0].Line2+", "+t[0].Town+", "+t[0].PostCode,i=new Date,i.setTime(i.getTime()+6e5),expires="; expires="+i.toGMTString(),document.cookie="vbaddress="+e+expires+"; path=/"}else return $("#btnFindYourAddress").removeClass("disabled processing"),$("#address-errmsgs").css("display","block"),!1}})});$("#btnUseNewEmailAddress").on("click",function(){$("#btnUseNewEmailAddress").addClass("disabled processing");$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/OverrideForgerockId",dataType:"html",success:function(n){n!==null&&($("#btnUseNewEmailAddress").removeClass("disabled processing"),window.location.replace("/products/"))}})});$("#btnAddressNext").on("click",function(n){function i(n){var i="; "+document.cookie,t=i.split("; "+n+"=");if(t.length==2)return t.pop().split(";").shift()}var t=i("vbaddress");if(t===null||t==="Choose"||t===undefined)return $("#dvPostcodeEntry").show(),$("#dvContactDetails").hide(),$("#btnFindYourAddress").removeClass("disabled processing"),$("#address-errmsgs").css("display","block"),!1;$("#dvVehicleDetails").hide();n.stopImmediatePropagation();$("#dvVrnEntry").hide();$("#dvHaveMembership").hide();$("#dvMain").hide();$("#dvPostcodeEntry").hide();$("#dvContactDetails").hide();$("#dvHaveMembershipNo").show();$.ajax({type:"POST",url:"/cms/ajax/fragment/AssociateAccount/GetForgerockId",dataType:"JSON",success:function(n){n!==null&&utag.view({site_section:"Your account",page_name:"/associateaccount/vehicle/create_vehicle_beneficiary, forgerock_ID:"+n,event_category:"Vehicle Beneficiary",event_name:"Policyholder check - continue button clicked",event_label:"No"})}})});$(document).on("click",".toggle-pass",function(n){n.preventDefault();$(this).parent().parent().find(".pass").val()&&($(this).parent().parent().find(".pass").attr("type")==="password"?($(this).parent().parent().find(".pass").attr("type","text"),$(this).text("Hide")):($(this).parent().parent().find(".pass").attr("type","password"),$(this).text("Show")))});formatter={number_format:function(n,t,i,r){"use strict";n=(n+"").replace(/[^0-9+\-Ee.]/g,"");var e=isFinite(+n)?+n:0,f=isFinite(+t)?Math.abs(t):0,o="undefined"==typeof r?",":r,s="undefined"==typeof i?".":i,h=function(n,t){var i=Math.pow(10,t);return""+(Math.round(n*i)/i).toFixed(t)},u=(f?h(e,f):""+Math.round(e)).split(".");return u[0].length>3&&(u[0]=u[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(u[1]||"").length<f&&(u[1]=u[1]||"",u[1]+=new Array(f-u[1].length+1).join("0")),u.join(s)}};validationSummaryMover=new ValidationSummaryMover;validationSummaryMover.init(),function(n){function y(){function u(){t.find(".text").removeClass("fade-in").stop().fadeOut(550);t.stop().slideUp(550)}function i(){window.aa.helpers.cache.registerCookie.write("aaCookie","aaCookiebar",t.data("expiry"));u()}var t=n("#cookie-bar"),r=t.find(".accept");window.aa.helpers.cache.registerCookie.check("aaCookie")||t.stop().slideDown(550);r.on({click:i,keypress:function(n){(n.keyCode===13||n.which===13)&&i()}})}function p(){window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT||(window.aa.helpers.cache.cachedElements.$window.scrollTop()>=c?(r.addClass("sticky"),i.addClass("hidden"),window.aa.helpers.cache.cachedElements.$main.css({paddingTop:c})):(r.removeClass("sticky"),i.removeClass("hidden"),client.Mobile?setTimeout(function(){window.aa.helpers.cache.cachedElements.$main.css({paddingTop:0})}):window.aa.helpers.cache.cachedElements.$main.css({paddingTop:0})),n(".my-account").removeClass("active"))}function w(){function nt(){var n=h.find("input").filter(":first");if(client.oldIE||client.IE9){s.stop().fadeOut(250);h.stop().fadeIn(500);n.focus();return}s.addClass("animated blur-out");h.stop().toggleClass("animated zoom-in");n.focus();e()}function k(){window.aa.helpers.cache.cachedElements.$body.removeClass("transition-off").addClass("transition-on");clearTimeout(b);b=setTimeout(function(){window.aa.helpers.cache.cachedElements.$body.removeClass("transition-on").addClass("transition-off")},550)}function a(){var n=i.find("input").filter(":first");i.hasClass("active")?(l=i.css({maxHeight:""}).outerHeight(),i.add(u).css({overflow:"hidden"}),k(),i.css({maxHeight:l}).stop().animate({maxHeight:0},550,function(){i.add(i.parent()).removeClass("active")})):(window.aa.helpers.cache.cachedElements.$window.scrollTop(0),i.add(i.parent()).addClass("active"),l||(l=i.outerHeight()),e(),k(),i.stop().animate({maxHeight:l},550,function(){n.focus();i.add(u).css({overflow:"visible"})}))}function p(n){var t=window.aa.helpers.cache.cachedElements.$body.find(".location-suggestions .place");o+=n;o>=t.length?o=0:o<0&&(o=t.length);window.aa.helpers.cache.cachedElements.$body.addClass("no-overflow");window.aa.helpers.cache.cachedElements.$body.find("#chosen-location").blur();t.removeClass("place-active").eq(o).addClass("place-active")}function v(){window.aa.helpers.cache.cachedElements.$body.removeClass("no-overflow");window.aa.helpers.cache.cachedElements.$main.find(".chosen-location").removeClass("active-search");window.aa.helpers.cache.cachedElements.$main.find(".location-suggestions").hide().empty()}function tt(){function s(n,t,i){d.val(n);g.val(t);window.aa.salesJourneyApp.helpers.isDefined(i)&&(e.val(i),e.data("chosen-location",i))}function ut(){navigator.geolocation?navigator.geolocation.getCurrentPosition(ft,et):s(c,l,h)}function ft(t){var i=t.coords.latitude,r=t.coords.longitude;n.ajax({method:"GET",url:"https://maps.googleapis.com/maps/api/geocode/json",data:{latlng:i+","+r}}).done(function(n){window.aa.salesJourneyApp.helpers.isDefined(n.results)?s(i,r,n.results[0].address_components[2].long_name):s(c,l,h)}).fail(window.aa.salesJourneyApp.helpers.serviceErrorModal)}function et(t){switch(t.code){case t.PERMISSION_DENIED:n("[data-location-off]").show();f();break;case t.POSITION_UNAVAILABLE:case t.TIMEOUT:case t.UNKNOWN_ERROR:s(c,l,h)}}function ot(i,r){var u=t.find(".input-loader");u.stop().fadeIn(250);i.blur();n.ajax({method:"GET",url:"/cms/ajax/api/RoutePlannerTrafficNews/GetSuggestedAddresses",data:{searchText:r}}).done(function(n){if(u.stop().fadeOut(250),v(),o=-1,window.aa.salesJourneyApp.helpers.isDefined(n.Result)){for(var t=0;t<n.Result.length;t+=1)a.append(Mustache.render(it,n.Result[t])).show(),y.addClass("active-search");i.removeClass("typing").focus()}else s(c,l,h)}).fail(window.aa.salesJourneyApp.helpers.serviceErrorModal)}function st(t){w.prop("disabled",!0).addClass("disabled");n.ajax({method:"GET",url:"/cms/ajax/api/RoutePlannerTrafficNews/GetPlace",data:{address:e.data("chosen-location")}}).done(function(n){w.prop("disabled",!1).removeClass("disabled");window.aa.salesJourneyApp.helpers.isDefined(n.Result)?s(n.Result.Latitude,n.Result.Longitude):s(c,l,h);typeof t=="function"&&t()}).fail(window.aa.salesJourneyApp.helpers.serviceErrorModal)}function ht(n){var t=new Date(n),i=t.getHours(),r=i>=12?"PM":"AM",u=t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes();return i+":"+u+r}function tt(n){var t=new Date(n),i=t.getDate(),r=t.getFullYear(),u=["Jan","Febr","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"][t.getMonth()];return i+" "+u+" "+r+", "+ht(n)}function b(){var u=t.find(".section-loader");w.prop("disabled",!0).addClass("disabled");u.stop().fadeIn(250);i.is(".active")||window.aa.salesJourneyApp.cache.$main.find("#aa-route-planner").prop("disabled",!0);n.ajax({method:"GET",url:"/cms/ajax/api/RoutePlannerTrafficNews/GetIncidentsInRadius",data:{coordinates:d.val()+"|"+g.val()}}).done(function(n){var i,o,s=Mustache.render(rt,n);w.prop("disabled",!1).removeClass("disabled");u.hide();window.aa.salesJourneyApp.helpers.isDefined(n)?(r.hide().empty(),k.hide(),r.append(s).show(),i=r.find(".incident-time"),o=r.find(".incident-description"),window.aa.salesJourneyApp.helpers.isDefined(n.Description)&&window.aa.salesJourneyApp.helpers.isDefined(n.IncidentSeverity)?(o.empty().html(n.Description.split(": ")[1]),i.html(tt(n.StartDate)+" ("+i.data("label")+")")):(r.find(".incident-title").remove(),(n.StartDate!==t.data("time-undefined")||window.aa.salesJourneyApp.helpers.isDefined(n.UpdatedDateTime))&&i.html(r.find(".report-details").data("last-update").replace("{time}",tt(n.UpdatedDateTime))),r.find(".road-icon").remove(),r.find(".report-details").addClass("report-not-available"),o.html(o.data("no-incidents"))),r.find(".current-location p").html(e.data("chosen-location").split(",",1)),f()):window.aa.salesJourneyApp.helpers.serviceErrorModal();window.aa.salesJourneyApp.cache.$main.find("#aa-route-planner").prop("disabled",!1)}).fail(window.aa.salesJourneyApp.helpers.serviceErrorModal)}var t=n(this),y=t.find(".chosen-location"),e=y.find("#chosen-location"),a=t.find(".location-suggestions"),r=t.find(".traffic-report"),k=t.find(".traffic-news"),w=t.find(".set-location"),d=t.find(".set-lat"),g=t.find(".set-long"),h=y.data("default-location"),c=y.data("default-lat"),l=y.data("default-long"),it=a.html(),rt=r.html(),nt;s(c,l,h);b();e.off("keyup").on("keyup",function(t){var i=n(this),r=i.val();if(t.which===40&&a.find(".place").length){p(0);return}clearTimeout(nt);i.hasClass("typing")&&r.length>=3&&t.which!==27?nt=setTimeout(function(){ot(i,r)},350):(v(),i.data("chosen-location",""))});a.off("click").on("click",".place",function(){var t=n(this).data("location-to-send");e.data("chosen-location",t);e.val(t.split(",",1));v()});r.off("click").on("click",".edit-location",function(n){n.preventDefault();r.hide().empty();k.show();e.focus();f()});u.find(".field-separator").off("click").on("click",function(){var n=u.find("#fromPlace-1"),t=u.find("#toPlace-1"),i=n.val(),r=t.val();n.val(r);t.val(i)});window.aa.helpers.cache.cachedElements.$document.on("mouseup touchend",function(n){a.is(n.target)||a.has(n.target).length!==0||v()});t.find(".my-location").off("click").on("click",function(n){n.preventDefault();ut()});w.off("click").on("click",function(n){if(n.preventDefault(),formValidation.api[t.data("id")].validateForm(),t.hasClass("errors")){f();t.find(".error").eq(0).find("input:first").focus();return}if(e.data("chosen-location")===""){s(c,l,h);b();return}st(b)})}function it(){var i=c.find("input").first();if(e(),client.oldIE||client.IE9){s.stop().fadeOut(250);c.stop().fadeIn(500);i.focus();return}if(i.focus(),c.stop().toggleClass("animated zoom-in"),window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT){t.is(":visible")&&(n("#navicon-close").addClass("hidden"),n("#navicon").removeClass("hidden"));window.aa.helpers.cache.cachedElements.$html.removeClass("no-overflow");e();return}s.addClass("animated blur-out")}function w(){if(client.oldIE||client.IE9){r.stop().fadeOut(250);s.stop().fadeIn(500);return}if(window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT){c.hasClass("zoom-in")&&r.removeClass("zoom-in").addClass("zoom-out");r.hasClass("zoom-out")&&setTimeout(function(){r.removeClass("animated zoom-out")},250);return}r.removeClass("zoom-in").addClass("zoom-out");r.hasClass("zoom-out")&&setTimeout(function(){s.removeClass("blur-out").addClass("blur-in");r.removeClass("animated zoom-out")},250)}var y=n(this),d=y.find(".close-takeover"),h=y.filter("#route-planner-takeover"),g=i.find(".aa-takeover-btn"),c=y.filter("#search-takeover"),r=c.add(h),s=n("#helpful-links").add("#top-level-nav"),b,l,o=-1;n("#search-icon").on({click:it});n("#route-planner").on({click:nt});n("#aa-route-planner").off("click").on({click:a});n(".traffic-info").each(tt);n("#search-takeover").find('input[type="text"]').on("keypress",function(){return/^[a-zA-Z0-9- ]*$/.test(n(this).val())});d.on({click:w,keypress:function(n){(n.which===13||n.keyCode===13)&&w()}});g.on({click:a,keypress:function(n){(n.which===13||n.keyCode===13)&&a()}});window.aa.helpers.cache.cachedElements.$document.on("keyup keypress",function(n){if(n.which===27&&(r.hasClass("zoom-in")&&w(),i.hasClass("active")&&a(),v()),window.aa.helpers.cache.cachedElements.$body.find(".location-suggestions").children().length){n.preventDefault();switch(n.which){case 13:case 32:window.aa.helpers.cache.cachedElements.$body.find(".location-suggestions").find(".place-active").trigger("click");break;case 40:case 9:p(1);break;case 38:p(-1)}}});window.aa.helpers.cache.cachedElements.$window.on("resize",function(){window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&(h.addClass("hidden"),i.hasClass("active")&&a())})}function a(){window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT?t.removeClass("desktop-nav").addClass("mobile-nav"):(t.removeClass("mobile-nav").addClass("desktop-nav"),t.find(".primary-item").removeClass("menu-item-clicked"))}function f(){if(i.hasClass("active")){var n=i.css({maxHeight:"100%"}).outerHeight();i.css({maxHeight:n})}}function e(){t.find(".active").removeClass("active");window.aa.helpers.cache.cachedElements.$body.add(t).removeClass("nav-open account-details-active");n("#navicon-close").addClass("hidden");n("#navicon").removeClass("hidden");s.parent("li").removeClass("active");window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&t.stop().slideUp(250)}function b(){function v(){var n=u.find(".secondary-item"),t=u.find(".nav-panels");i.hasClass("has-children")&&!i.hasClass("active")?(i.find(".my-aa-account").length&&s.addClass("open"),i.hasClass("account-link")&&window.aa.helpers.cache.cachedElements.$body.addClass("account-details-active"),window.aa.helpers.cache.cachedElements.$body.addClass("nav-open"),e.removeClass("active"),i.addClass("active"),window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&(n.removeClass("active"),n.filter(":first").addClass("active"),t.removeClass("open"),t.filter(":first-of-type").addClass("open"),window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.TABLET_BREAKPOINT&&f.show())):(window.aa.helpers.cache.cachedElements.$body.removeClass("nav-open account-details-active"),e.removeClass("active"))}function c(){clearTimeout(o);window.aa.helpers.cache.cachedElements.$body.removeClass("nav-open account-details-active");e.add(h).removeClass("active");s.removeClass("open")}function y(){c();u.css({height:"auto"})}var i=n(this),h=i.find(".secondary-item"),f=t.find(".second-level-nav-overlay"),e=window.aa.helpers.cache.cachedElements.$body.find(".primary-item"),u=i.find(".mega-menu"),s=i.find(".nav-panels"),p=s.find(".sub-component"),l=r.find("#component-my-account");u.css({maxWidth:window.aa.helpers.cache.cachedElements.$window.width()});l.length&&l.closest(".primary-item").addClass("account-link");u.length&&i.addClass("has-children");n(".editorial-panel").each(function(){n(this).closest(".nav-panels").addClass("editorial")});a();i.on({click:function(t){var r=n(this),f=r.filter(".active");return i.hasClass("active")?(f.is(t.target)||f.has(t.target).length!==0||y(),!0):!r.hasClass("has-children")||r.hasClass("menu-item-clicked")?!0:(v(),u.css({height:r.find(".second-level-navigation").height()}),n(this).siblings(".primary-item").find(".nav-panels").removeClass("open"),!1)}});h.on("mouseover click",function(t){t.stopPropagation();var i=n(this),r=i.data("secondary"),u=n("#"+r).find(".sub-component");return(n("#"+r).hasClass("open")&&window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&u.css({minHeight:window.aa.helpers.getTallestHeightHelper(u)}),i.hasClass("active"))?(window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.TABLET_BREAKPOINT&&f.show(),!0):(h.removeClass("active"),s.removeClass("open"),i.addClass("active"),n("#"+r).addClass("open"),!1)});f.off("mouseover").on("mouseover",function(){window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.TABLET_BREAKPOINT&&(clearTimeout(o),o=setTimeout(function(){f.hide()},250))});s.on("mouseover",function(){window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.TABLET_BREAKPOINT&&f.show()});u.siblings(".toggle").on("click",function(t){t.stopPropagation();n(this).parent("li").hasClass("active")?(c(),e.find(".nav-panels").removeClass("open")):v()});window.aa.helpers.cache.cachedElements.$document.on({click:function(n){var t=u.add(r);t.is(n.target)||t.has(n.target).length!==0||(c(),e.find(".nav-panels").removeClass("open"))}})}function v(){function h(){t.hasClass("nav-open")?v():y()}function v(){f.hasClass("active")?f.stop().slideDown(250):u.hasClass("active")&&u.stop().slideDown(250);t.stop().slideDown(250)}function y(){f.hasClass("active")?f.stop().slideUp(250,function(){t.stop().slideUp(250,function(){i.add(e).add(u).add(f).removeClass("active");n(this).css({left:"0"})})}):u.hasClass("active")?u.stop().slideUp(250,function(){t.stop().slideUp(250,function(){i.add(e).add(u).add(f).removeClass("active");n(this).css({left:"0"})})}):t.stop().slideUp(250,function(){i.add(e).add(u).add(f).removeClass("active");n(this).css({left:"0"})});window.aa.helpers.cache.cachedElements.$body.removeClass("account-details-active")}function o(n){u.add(f).removeClass("active");n.hasClass("has-children")&&n.hasClass("primary-item")?(t.stop().animate({left:"-100vw"},250),n.find(".my-aa-account").length?(n.find(".nav-panels").addClass("open").show(),t.stop().animate({left:"-200vw"},250)):(u.addClass("active").show(),n.addClass("menu-item-clicked").siblings().addClass("hide-items"),t.animate({left:"-100vw"},250))):n.hasClass("back-to-primary-link")?t.stop().animate({left:"0"},250,function(){window.aa.helpers.cache.cachedElements.$body.removeClass("account-details-active");n.find(".my-aa-account").length?n.find(".nav-panels").removeClass("open").hide():u.removeClass("active").hide()}):n.hasClass("secondary-item")?(t.animate({left:"-200vw"},250,function(){u.removeClass("active").hide()}),f.addClass("active").show()):n.hasClass("back-to-secondary-link")&&(t.stop().animate({left:"-100vw"},250,function(){f.removeClass("open").hide()}),u.addClass("active").show())}var s=n("#navicon, #navicon-close"),i=t.find(".primary-item"),e=i.find(".secondary-item"),u=i.find(".second-level-navigation"),f=i.find(".nav-panels"),c=i.find(".back-to-primary-link"),l=i.find(".back-to-secondary-link"),a=i.find(".mobile-toggle");s.on("click",function(n){n.stopImmediatePropagation();s.toggleClass("hidden");window.aa.helpers.cache.cachedElements.$body.add(t).toggleClass("nav-open");i.removeClass("menu-item-clicked").siblings().removeClass("hide-items");h()});a.on("click",function(){n(this).parent().removeClass("menu-item-clicked").siblings().removeClass("hide-items")});i.on("click",function(){o(n(this))});c.on("click",function(t){t.stopPropagation();i.removeClass("active menu-item-clicked").siblings().removeClass("hide-items");o(n(this))});e.on("click",function(){o(n(this))});l.on("click",function(t){t.stopPropagation();e.removeClass("active");o(n(this))});window.aa.helpers.cache.cachedElements.$document.on({click:function(n){!r.is(n.target)&&r.has(n.target).length===0&&window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&t.is(":visible")&&(s.toggleClass("hidden"),window.aa.helpers.cache.cachedElements.$body.add(t).removeClass("nav-open account-details-active"),h())}})}function k(){function e(){t.addClass("active");window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&i.stop().slideDown(500,function(){f.find("ul").stop().slideDown(250)});client.IE9&&i.stop().fadeIn(200)}function r(){t.add(t.find("h5")).removeClass("active");window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&i.add(i.find("ul")).stop().slideUp(500,function(){f.find("ul").stop().slideUp(250)});client.IE9&&i.stop().fadeOut(200)}function s(){var r=n(this);r.on("click",function(){r.parent().removeClass("active").siblings("ul").stop().slideUp(200);t.hasClass("active")||i.stop().slideUp(250)})}var t=n(this),o=t.find(".button"),i=t.find(".account-nav"),u=i.find("h5"),f=i.find(".col").last();i.find("li").click(r);window.aa.helpers.cache.cachedElements.$document.on("mouseup touchend",function(n){t.is(n.target)||t.has(n.target).length!==0||r()});if(window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT){u.siblings("ul").length&&u.addClass("has-children");o.on("click",function(){t.toggleClass("active");t.hasClass("active")?e():r()});u.children("a").on("click",function(t){var i=n(this).parent(),r=i.parent().siblings().children("h5");i.hasClass("active")||t.preventDefault();i.toggleClass("active").siblings("ul").stop().slideDown(250,function(){r.removeClass("active").siblings().stop().slideUp(250)})});t.find(".close").each(s);f.prependTo(i).find("h5").remove();return}t.hover(e,r);window.aa.helpers.cache.cachedElements.$document.on({keyup:function(n){(n.which===9||n.keyCode===9)&&(o.is(n.target)?e():r())}})}function d(){function o(){if(t.add(i).toggleClass("active"),client.IE9){t.add(i).stop().fadeToggle(250);return}r.find(".active").removeClass("active");window.aa.helpers.cache.cachedElements.$body.removeClass("nav-open account-details-active");u.removeClass("blur-in-half").toggleClass("blur-out-half");u.add(u.children().not(t,i)).attr("aria-hidden","true")}function e(){if(t.add(i).removeClass("active"),client.IE9){t.stop().fadeOut(250);i.stop().fadeOut(250);return}u.removeClass("blur-out-half").addClass("blur-in-half");u.add(u.children().not(t,i)).attr("aria-hidden","false")}var t=n("#sign-in-panel"),i=n("#sign-in-overlay"),f=t.closest("#main"),u=f.add(f.siblings("#site-footer"));n("#close-panel, .sign-in").on({click:function(n){n.preventDefault();o()}});window.aa.helpers.cache.cachedElements.$document.on({mouseup:function(n){t.is(n.target)||t.has(n.target).length!==0||n.target===window.aa.helpers.cache.cachedElements.$html.get(0)||e()},keyup:function(n){(n.which===27||n.keyCode===27)&&e()}})}var r=n("#site-header, #sales-journey-header"),t=r.find("#primary-navigation"),u=window.aa.helpers.cache.cachedElements.$body.find(".aa-route-planner-container"),i=window.aa.helpers.cache.cachedElements.$body.find("#aa-route-planner-takeover"),s=t.find(".mega-menu"),h,c=r.outerHeight(),l,o;window.aa.helpers.cache.cachedElements.$document.ready(function(){n("#cookie-bar").length&&y();n(".takeover, .aa-route-planner-container").each(w);n("#primary-navigation .container > ul").children(".primary-item").each(b);n("#navicon").length&&t.length&&window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&v();n(".sign-in").length&&d();n(".my-account").each(k)});window.aa.helpers.cache.cachedElements.$window.on({resize:function(){clearTimeout(l);l=setTimeout(function(){h=t.find(".primary-item.active .second-level-navigation");t.length&&a();window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&v();f();s.css({maxWidth:window.aa.helpers.cache.cachedElements.$window.width(),height:h.height()})},100)},scroll:function(){r.length&&(p(),n("#sales-journey-header").hasClass("sticky")&&n("#contact-cta").hasClass("dsf-view-none")?(n("#CancelSalesLabel").css("margin-right","13rem"),n("#BackToDashboard").css({"margin-right":"13rem","margin-left":"-30px"})):(n("#CancelSalesLabel").css("margin-right","2.5rem"),n("#BackToDashboard").css({"margin-right":"2.5rem","margin-left":"0px"})))}})}(jQ);!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n:n(jQuery)}(function(n){function u(r){var u=r||window.event,w=c.call(arguments,1),l=0,s=0,e=0,a=0,b=0,k=0,v,y,p;if(r=n.event.fix(u),r.type="mousewheel","detail"in u&&(e=-1*u.detail),"wheelDelta"in u&&(e=u.wheelDelta),"wheelDeltaY"in u&&(e=u.wheelDeltaY),"wheelDeltaX"in u&&(s=-1*u.wheelDeltaX),"axis"in u&&u.axis===u.HORIZONTAL_AXIS&&(s=-1*e,e=0),l=0===e?s:e,"deltaY"in u&&(e=-1*u.deltaY,l=e),"deltaX"in u&&(s=u.deltaX,0===e&&(l=-1*s)),0!==e||0!==s)return 1===u.deltaMode?(v=n.data(this,"mousewheel-line-height"),l*=v,e*=v,s*=v):2===u.deltaMode&&(y=n.data(this,"mousewheel-page-height"),l*=y,e*=y,s*=y),(a=Math.max(Math.abs(e),Math.abs(s)),(!t||t>a)&&(t=a,o(u,a)&&(t/=40)),o(u,a)&&(l/=40,s/=40,e/=40),l=Math[l>=1?"floor":"ceil"](l/t),s=Math[s>=1?"floor":"ceil"](s/t),e=Math[e>=1?"floor":"ceil"](e/t),i.settings.normalizeOffset&&this.getBoundingClientRect)&&(p=this.getBoundingClientRect(),b=r.clientX-p.left,k=r.clientY-p.top),r.deltaX=s,r.deltaY=e,r.deltaFactor=t,r.offsetX=b,r.offsetY=k,r.deltaMode=0,w.unshift(r,l,s,e),f&&clearTimeout(f),f=setTimeout(h,200),(n.event.dispatch||n.event.handle).apply(this,w)}function h(){t=null}function o(n,t){return i.settings.adjustOldDeltas&&"mousewheel"===n.type&&t%120==0}var f,t,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],c=Array.prototype.slice,e,i;if(n.event.fixHooks)for(e=s.length;e;)n.event.fixHooks[s[--e]]=n.event.mouseHooks;i=n.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=r.length;t;)this.addEventListener(r[--t],u,!1);else this.onmousewheel=u;n.data(this,"mousewheel-line-height",i.getLineHeight(this));n.data(this,"mousewheel-page-height",i.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=r.length;t;)this.removeEventListener(r[--t],u,!1);else this.onmousewheel=null;n.removeData(this,"mousewheel-line-height");n.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var r=n(t),i=r["offsetParent"in n.fn?"offsetParent":"parent"]();return i.length||(i=n("body")),parseInt(i.css("fontSize"),10)||parseInt(r.css("fontSize"),10)||16},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})});!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n:n(jQuery)}(function(n){function u(r){var u=r||window.event,w=c.call(arguments,1),l=0,s=0,e=0,a=0,b=0,k=0,v,y,p;if(r=n.event.fix(u),r.type="mousewheel","detail"in u&&(e=-1*u.detail),"wheelDelta"in u&&(e=u.wheelDelta),"wheelDeltaY"in u&&(e=u.wheelDeltaY),"wheelDeltaX"in u&&(s=-1*u.wheelDeltaX),"axis"in u&&u.axis===u.HORIZONTAL_AXIS&&(s=-1*e,e=0),l=0===e?s:e,"deltaY"in u&&(e=-1*u.deltaY,l=e),"deltaX"in u&&(s=u.deltaX,0===e&&(l=-1*s)),0!==e||0!==s)return 1===u.deltaMode?(v=n.data(this,"mousewheel-line-height"),l*=v,e*=v,s*=v):2===u.deltaMode&&(y=n.data(this,"mousewheel-page-height"),l*=y,e*=y,s*=y),(a=Math.max(Math.abs(e),Math.abs(s)),(!t||t>a)&&(t=a,o(u,a)&&(t/=40)),o(u,a)&&(l/=40,s/=40,e/=40),l=Math[l>=1?"floor":"ceil"](l/t),s=Math[s>=1?"floor":"ceil"](s/t),e=Math[e>=1?"floor":"ceil"](e/t),i.settings.normalizeOffset&&this.getBoundingClientRect)&&(p=this.getBoundingClientRect(),b=r.clientX-p.left,k=r.clientY-p.top),r.deltaX=s,r.deltaY=e,r.deltaFactor=t,r.offsetX=b,r.offsetY=k,r.deltaMode=0,w.unshift(r,l,s,e),f&&clearTimeout(f),f=setTimeout(h,200),(n.event.dispatch||n.event.handle).apply(this,w)}function h(){t=null}function o(n,t){return i.settings.adjustOldDeltas&&"mousewheel"===n.type&&t%120==0}var f,t,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],c=Array.prototype.slice,e,i;if(n.event.fixHooks)for(e=s.length;e;)n.event.fixHooks[s[--e]]=n.event.mouseHooks;i=n.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=r.length;t;)this.addEventListener(r[--t],u,!1);else this.onmousewheel=u;n.data(this,"mousewheel-line-height",i.getLineHeight(this));n.data(this,"mousewheel-page-height",i.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=r.length;t;)this.removeEventListener(r[--t],u,!1);else this.onmousewheel=null;n.removeData(this,"mousewheel-line-height");n.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var r=n(t),i=r["offsetParent"in n.fn?"offsetParent":"parent"]();return i.length||(i=n("body")),parseInt(i.css("fontSize"),10)||parseInt(r.css("fontSize"),10)||16},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})});!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"undefined"!=typeof module&&module.exports?module.exports=n:n(jQuery,window,document)}(function(n){!function(t){var i="function"==typeof define&&define.amd,r="undefined"!=typeof module&&module.exports,u="https:"==document.location.protocol?"https:":"http:";i||(r?require("jquery-mousewheel")(n):n.event.special.mousewheel||n("head").append(decodeURI("%3Cscript src="+u+"//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js%3E%3C/script%3E")));t()}(function(){var h,c="mCustomScrollbar",t="mCS",it=".mCustomScrollbar",ot={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},pt=0,b={},p=window.attachEvent&&!window.addEventListener?1:0,e=!1,i=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],s={init:function(r){var r=n.extend(!0,{},ot,r),e=v.call(this),u,f;if(r.live){if(u=r.liveSelector||this.selector||it,f=n(u),"off"===r.live)return void k(u);b[u]=setTimeout(function(){f.mCustomScrollbar(r);"once"===r.live&&f.length&&k(u)},500)}else k(u);return r.setWidth=r.set_width?r.set_width:r.setWidth,r.setHeight=r.set_height?r.set_height:r.setHeight,r.axis=r.horizontalScroll?"x":wt(r.axis),r.scrollInertia=r.scrollInertia>0&&r.scrollInertia<17?17:r.scrollInertia,"object"!=typeof r.mouseWheel&&1==r.mouseWheel&&(r.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),r.mouseWheel.scrollAmount=r.mouseWheelPixels?r.mouseWheelPixels:r.mouseWheel.scrollAmount,r.mouseWheel.normalizeDelta=r.advanced.normalizeMouseWheelDelta?r.advanced.normalizeMouseWheelDelta:r.mouseWheel.normalizeDelta,r.scrollButtons.scrollType=bt(r.scrollButtons.scrollType),st(r),n(e).each(function(){var u=n(this);if(!u.data(t)){u.data(t,{idx:++pt,opt:r,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:u.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var e=u.data(t),f=e.opt,o=u.data("mcs-axis"),h=u.data("mcs-scrollbar-position"),c=u.data("mcs-theme");o&&(f.axis=o);h&&(f.scrollbarPosition=h);c&&(f.theme=c,st(f));kt.call(this);e&&f.callbacks.onCreate&&"function"==typeof f.callbacks.onCreate&&f.callbacks.onCreate.call(this);n("#mCSB_"+e.idx+"_container img:not(."+i[2]+")").addClass(i[2]);s.update.call(null,u)}})},update:function(r,f){var e=r||v.call(this);return n(e).each(function(){var s=n(this),c;if(s.data(t)){var e=s.data(t),r=e.opt,h=n("#mCSB_"+e.idx+"_container"),a=n("#mCSB_"+e.idx),l=[n("#mCSB_"+e.idx+"_dragger_vertical"),n("#mCSB_"+e.idx+"_dragger_horizontal")];if(!h.length)return;e.tweenRunning&&o(s);f&&e&&r.callbacks.onBeforeUpdate&&"function"==typeof r.callbacks.onBeforeUpdate&&r.callbacks.onBeforeUpdate.call(this);s.hasClass(i[3])&&s.removeClass(i[3]);s.hasClass(i[4])&&s.removeClass(i[4]);a.css("max-height","none");a.height()!==s.height()&&a.css("max-height",s.height());dt.call(this);"y"===r.axis||r.advanced.autoExpandHorizontalScroll||h.css("width",ht(h));e.overflowed=ii.call(this);ct.call(this);r.autoDraggerLength&&ni.call(this);ti.call(this);ri.call(this);c=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)];"x"!==r.axis&&(e.overflowed[0]?l[0].height()>l[0].parent().height()?y.call(this):(u(s,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),e.contentReset.y=null):(y.call(this),"y"===r.axis?g.call(this):"yx"===r.axis&&e.overflowed[1]&&u(s,c[1].toString(),{dir:"x",dur:0,overwrite:"none"})));"y"!==r.axis&&(e.overflowed[1]?l[1].width()>l[1].parent().width()?y.call(this):(u(s,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),e.contentReset.x=null):(y.call(this),"x"===r.axis?g.call(this):"yx"===r.axis&&e.overflowed[0]&&u(s,c[0].toString(),{dir:"y",dur:0,overwrite:"none"})));f&&e&&(2===f&&r.callbacks.onImageLoad&&"function"==typeof r.callbacks.onImageLoad?r.callbacks.onImageLoad.call(this):3===f&&r.callbacks.onSelectorChange&&"function"==typeof r.callbacks.onSelectorChange?r.callbacks.onSelectorChange.call(this):r.callbacks.onUpdate&&"function"==typeof r.callbacks.onUpdate&&r.callbacks.onUpdate.call(this));et.call(this)}})},scrollTo:function(i,r){if("undefined"!=typeof i&&null!=i){var f=v.call(this);return n(f).each(function(){var s=n(this);if(s.data(t)){var o=s.data(t),h=o.opt,c={trigger:"external",scrollInertia:h.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},f=n.extend(!0,{},c,r),e=ft.call(this,i),l=f.scrollInertia>0&&f.scrollInertia<17?17:f.scrollInertia;e[0]=at.call(this,e[0],"y");e[1]=at.call(this,e[1],"x");f.moveDragger&&(e[0]*=o.scrollRatio.y,e[1]*=o.scrollRatio.x);f.dur=wi()?0:l;setTimeout(function(){null!==e[0]&&"undefined"!=typeof e[0]&&"x"!==h.axis&&o.overflowed[0]&&(f.dir="y",f.overwrite="all",u(s,e[0].toString(),f));null!==e[1]&&"undefined"!=typeof e[1]&&"y"!==h.axis&&o.overflowed[1]&&(f.dir="x",f.overwrite="none",u(s,e[1].toString(),f))},f.timeout)}})}},stop:function(){var i=v.call(this);return n(i).each(function(){var i=n(this);i.data(t)&&o(i)})},disable:function(r){var u=v.call(this);return n(u).each(function(){var u=n(this);u.data(t)&&(u.data(t),et.call(this,"remove"),g.call(this),r&&y.call(this),ct.call(this,!0),u.addClass(i[3]))})},destroy:function(){var r=v.call(this);return n(r).each(function(){var f=n(this);if(f.data(t)){var u=f.data(t),e=u.opt,s=n("#mCSB_"+u.idx),o=n("#mCSB_"+u.idx+"_container"),h=n(".mCSB_"+u.idx+"_scrollbar");e.live&&k(e.liveSelector||n(r).selector);et.call(this,"remove");g.call(this);y.call(this);f.removeData(t);a(this,"mcs");h.remove();o.find("img."+i[2]).removeClass(i[2]);s.replaceWith(o.contents());f.removeClass(c+" _"+t+"_"+u.idx+" "+i[6]+" "+i[7]+" "+i[5]+" "+i[3]).addClass(i[4])}})}},v=function(){return"object"!=typeof n(this)||n(this).length<1?it:this},st=function(t){t.autoDraggerLength=n.inArray(t.theme,["rounded","rounded-dark","rounded-dots","rounded-dots-dark"])>-1?!1:t.autoDraggerLength;t.autoExpandScrollbar=n.inArray(t.theme,["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"])>-1?!1:t.autoExpandScrollbar;t.scrollButtons.enable=n.inArray(t.theme,["minimal","minimal-dark"])>-1?!1:t.scrollButtons.enable;t.autoHideScrollbar=n.inArray(t.theme,["minimal","minimal-dark"])>-1?!0:t.autoHideScrollbar;t.scrollbarPosition=n.inArray(t.theme,["minimal","minimal-dark"])>-1?"outside":t.scrollbarPosition},k=function(n){b[n]&&(clearTimeout(b[n]),a(b,n))},wt=function(n){return"yx"===n||"xy"===n||"auto"===n?"yx":"x"===n||"horizontal"===n?"x":"y"},bt=function(n){return"stepped"===n||"pixels"===n||"step"===n||"click"===n?"stepped":"stepless"},kt=function(){var f=n(this),u=f.data(t),r=u.opt,l=r.autoExpandScrollbar?" "+i[1]+"_expand":"",o=["<div id='mCSB_"+u.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+u.idx+"_scrollbar mCS-"+r.theme+" mCSB_scrollTools_vertical"+l+"'><div class='"+i[12]+"'><div id='mCSB_"+u.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /><\/div><div class='mCSB_draggerRail' /><\/div><\/div>","<div id='mCSB_"+u.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+u.idx+"_scrollbar mCS-"+r.theme+" mCSB_scrollTools_horizontal"+l+"'><div class='"+i[12]+"'><div id='mCSB_"+u.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /><\/div><div class='mCSB_draggerRail' /><\/div><\/div>"],v="yx"===r.axis?"mCSB_vertical_horizontal":"x"===r.axis?"mCSB_horizontal":"mCSB_vertical",a="yx"===r.axis?o[0]+o[1]:"x"===r.axis?o[1]:o[0],y="yx"===r.axis?"<div id='mCSB_"+u.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",p=r.autoHideScrollbar?" "+i[6]:"",w="x"!==r.axis&&"rtl"===u.langDir?" "+i[7]:"",h,s,e;r.setWidth&&f.css("width",r.setWidth);r.setHeight&&f.css("height",r.setHeight);r.setLeft="y"!==r.axis&&"rtl"===u.langDir?"989999px":r.setLeft;f.addClass(c+" _"+t+"_"+u.idx+p+w).wrapInner("<div id='mCSB_"+u.idx+"' class='mCustomScrollBox mCS-"+r.theme+" "+v+"'><div id='mCSB_"+u.idx+"_container' class='mCSB_container' style='position:relative; top:"+r.setTop+"; left:"+r.setLeft+";' dir='"+u.langDir+"' /><\/div>");h=n("#mCSB_"+u.idx);s=n("#mCSB_"+u.idx+"_container");"y"===r.axis||r.advanced.autoExpandHorizontalScroll||s.css("width",ht(s));"outside"===r.scrollbarPosition?("static"===f.css("position")&&f.css("position","relative"),f.css("overflow","visible"),h.addClass("mCSB_outside").after(a)):(h.addClass("mCSB_inside").append(a),s.wrap(y));gt.call(this);e=[n("#mCSB_"+u.idx+"_dragger_vertical"),n("#mCSB_"+u.idx+"_dragger_horizontal")];e[0].css("min-height",e[0].height());e[1].css("min-width",e[1].width())},ht=function(t){var i=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return n(this).outerWidth(!0)}).get())],r=t.parent().width();return i[0]>r?i[0]:i[1]>r?i[1]:"100%"},dt=function(){var e=n(this),f=e.data(t),r=f.opt,i=n("#mCSB_"+f.idx+"_container"),u;r.advanced.autoExpandHorizontalScroll&&"y"!==r.axis&&(i.css({width:"auto","min-width":0,"overflow-x":"scroll"}),u=Math.ceil(i[0].scrollWidth),3===r.advanced.autoExpandHorizontalScroll||2!==r.advanced.autoExpandHorizontalScroll&&u>i.parent().width()?i.css({width:u,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap())},gt=function(){var s=n(this),o=s.data(t),u=o.opt,h=n(".mCSB_"+o.idx+"_scrollbar:first"),f=tt(u.scrollButtons.tabindex)?"tabindex='"+u.scrollButtons.tabindex+"'":"",r=["<a href='#' class='"+i[13]+"' "+f+" />","<a href='#' class='"+i[14]+"' "+f+" />","<a href='#' class='"+i[15]+"' "+f+" />","<a href='#' class='"+i[16]+"' "+f+" />"],e=["x"===u.axis?r[2]:r[0],"x"===u.axis?r[3]:r[1],r[2],r[3]];u.scrollButtons.enable&&h.prepend(e[0]).append(e[1]).next(".mCSB_scrollTools").prepend(e[2]).append(e[3])},ni=function(){var s=n(this),u=s.data(t),f=n("#mCSB_"+u.idx),e=n("#mCSB_"+u.idx+"_container"),r=[n("#mCSB_"+u.idx+"_dragger_vertical"),n("#mCSB_"+u.idx+"_dragger_horizontal")],o=[f.height()/e.outerHeight(!1),f.width()/e.outerWidth(!1)],i=[parseInt(r[0].css("min-height")),Math.round(o[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(o[1]*r[1].parent().width())],h=p&&i[1]<i[0]?i[0]:i[1],c=p&&i[3]<i[2]?i[2]:i[3];r[0].css({height:h,"max-height":r[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":i[0]+"px"});r[1].css({width:c,"max-width":r[1].parent().width()-10})},ti=function(){var s=n(this),i=s.data(t),u=n("#mCSB_"+i.idx),f=n("#mCSB_"+i.idx+"_container"),r=[n("#mCSB_"+i.idx+"_dragger_vertical"),n("#mCSB_"+i.idx+"_dragger_horizontal")],e=[f.outerHeight(!1)-u.height(),f.outerWidth(!1)-u.width()],o=[e[0]/(r[0].parent().height()-r[0].height()),e[1]/(r[1].parent().width()-r[1].width())];i.scrollRatio={y:o[0],x:o[1]}},d=function(n,t,r){var f=r?i[0]+"_expanded":"",u=n.closest(".mCSB_scrollTools");"active"===t?(n.toggleClass(i[0]+" "+f),u.toggleClass(i[1]),n[0]._draggable=n[0]._draggable?0:1):n[0]._draggable||("hide"===t?(n.removeClass(i[0]),u.removeClass(i[1])):(n.addClass(i[0]),u.addClass(i[1])))},ii=function(){var h=n(this),r=h.data(t),e=n("#mCSB_"+r.idx),i=n("#mCSB_"+r.idx+"_container"),u=null==r.overflowed?i.height():i.outerHeight(!1),f=null==r.overflowed?i.width():i.outerWidth(!1),o=i[0].scrollHeight,s=i[0].scrollWidth;return o>u&&(u=o),s>f&&(f=s),[u>e.height(),f>e.width()]},y=function(){var r=n(this),i=r.data(t),f=i.opt,c=n("#mCSB_"+i.idx),s=n("#mCSB_"+i.idx+"_container"),h=[n("#mCSB_"+i.idx+"_dragger_vertical"),n("#mCSB_"+i.idx+"_dragger_horizontal")],e;(o(r),("x"!==f.axis&&!i.overflowed[0]||"y"===f.axis&&i.overflowed[0])&&(h[0].add(s).css("top",0),u(r,"_resetY")),"y"!==f.axis&&!i.overflowed[1]||"x"===f.axis&&i.overflowed[1])&&(e=dx=0,"rtl"===i.langDir&&(e=c.width()-s.outerWidth(!1),dx=Math.abs(e/i.scrollRatio.x)),s.css("left",e),h[1].css("left",dx),u(r,"_resetX"))},ri=function(){function u(){e=setTimeout(function(){n.event.special.mousewheel?(clearTimeout(e),oi.call(f[0])):u()},100)}var f=n(this),r=f.data(t),i=r.opt,e;r.bindEvents||((ui.call(this),i.contentTouchScroll&&fi.call(this),ei.call(this),i.mouseWheel.enable)&&u(),hi.call(this),li.call(this),i.advanced.autoScrollOnFocus&&ci.call(this),i.scrollButtons.enable&&ai.call(this),i.keyboard.enable&&vi.call(this),r.bindEvents=!0)},g=function(){var f=n(this),r=f.data(t),u=r.opt,o=t+"_"+r.idx,s=".mCSB_"+r.idx+"_scrollbar",e=n("#mCSB_"+r.idx+",#mCSB_"+r.idx+"_container,#mCSB_"+r.idx+"_container_wrapper,"+s+" ."+i[12]+",#mCSB_"+r.idx+"_dragger_vertical,#mCSB_"+r.idx+"_dragger_horizontal,"+s+">a"),h=n("#mCSB_"+r.idx+"_container");u.advanced.releaseDraggableSelectors&&e.add(n(u.advanced.releaseDraggableSelectors));u.advanced.extraDraggableSelectors&&e.add(n(u.advanced.extraDraggableSelectors));r.bindEvents&&(n(document).add(n(!l()||top.document)).unbind("."+o),e.each(function(){n(this).unbind("."+o)}),clearTimeout(f[0]._focusTimeout),a(f[0],"_focusTimeout"),clearTimeout(r.sequential.step),a(r.sequential,"step"),clearTimeout(h[0].onCompleteTimeout),a(h[0],"onCompleteTimeout"),r.bindEvents=!1)},ct=function(r){var h=n(this),u=h.data(t),o=u.opt,c=n("#mCSB_"+u.idx+"_container_wrapper"),f=c.length?c:n("#mCSB_"+u.idx+"_container"),e=[n("#mCSB_"+u.idx+"_scrollbar_vertical"),n("#mCSB_"+u.idx+"_scrollbar_horizontal")],s=[e[0].find(".mCSB_dragger"),e[1].find(".mCSB_dragger")];"x"!==o.axis&&(u.overflowed[0]&&!r?(e[0].add(s[0]).add(e[0].children("a")).css("display","block"),f.removeClass(i[8]+" "+i[10])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&s[0].css("display","none"),f.removeClass(i[10])):(e[0].css("display","none"),f.addClass(i[10])),f.addClass(i[8])));"y"!==o.axis&&(u.overflowed[1]&&!r?(e[1].add(s[1]).add(e[1].children("a")).css("display","block"),f.removeClass(i[9]+" "+i[11])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&s[1].css("display","none"),f.removeClass(i[11])):(e[1].css("display","none"),f.addClass(i[11])),f.addClass(i[9])));u.overflowed[0]||u.overflowed[1]?h.removeClass(i[5]):h.addClass(i[5])},r=function(t){var e=t.type,i=t.target.ownerDocument!==document&&null!==frameElement?[n(frameElement).offset().top,n(frameElement).offset().left]:null,u=l()&&t.target.ownerDocument!==top.document&&null!==frameElement?[n(t.view.frameElement).offset().top,n(t.view.frameElement).offset().left]:[0,0],r,f;switch(e){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return i?[t.originalEvent.pageY-i[0]+u[0],t.originalEvent.pageX-i[1]+u[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":return r=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],f=t.originalEvent.touches.length||t.originalEvent.changedTouches.length,t.target.ownerDocument!==document?[r.screenY,r.screenX,f>1]:[r.pageY,r.pageX,f>1];default:return i?[t.pageY-i[0]+u[0],t.pageX-i[1]+u[1],!1]:[t.pageY,t.pageX,!1]}},ui=function(){function k(n,t,r,f){var e,o;(w[0].idleTimer=h.scrollInertia<233?250:0,i.attr("id")===y[1])?(e="x",o=(i[0].offsetLeft-t+f)*s.scrollRatio.x):(e="y",o=(i[0].offsetTop-n+r)*s.scrollRatio.y);u(v,o.toString(),{dir:e,drag:!0})}var i,c,a,v=n(this),s=v.data(t),h=s.opt,f=t+"_"+s.idx,y=["mCSB_"+s.idx+"_dragger_vertical","mCSB_"+s.idx+"_dragger_horizontal"],w=n("#mCSB_"+s.idx+"_container"),b=n("#"+y[0]+",#"+y[1]),g=h.advanced.releaseDraggableSelectors?b.add(n(h.advanced.releaseDraggableSelectors)):b,nt=h.advanced.extraDraggableSelectors?n(!l()||top.document).add(n(h.advanced.extraDraggableSelectors)):n(!l()||top.document);b.bind("contextmenu."+f,function(n){n.preventDefault()}).bind("mousedown."+f+" touchstart."+f+" pointerdown."+f+" MSPointerDown."+f,function(t){if(t.stopImmediatePropagation(),t.preventDefault(),yt(t)){e=!0;p&&(document.onselectstart=function(){return!1});lt.call(w,!1);o(v);i=n(this);var u=i.offset(),f=r(t)[0]-u.top,s=r(t)[1]-u.left,l=i.height()+u.top,y=i.width()+u.left;l>f&&f>0&&y>s&&s>0&&(c=f,a=s);d(i,"active",h.autoExpandScrollbar)}}).bind("touchmove."+f,function(n){n.stopImmediatePropagation();n.preventDefault();var t=i.offset(),u=r(n)[0]-t.top,f=r(n)[1]-t.left;k(c,a,u,f)});n(document).add(nt).bind("mousemove."+f+" pointermove."+f+" MSPointerMove."+f,function(n){if(i){var t=i.offset(),u=r(n)[0]-t.top,f=r(n)[1]-t.left;if(c===u&&a===f)return;k(c,a,u,f)}}).add(g).bind("mouseup."+f+" touchend."+f+" pointerup."+f+" MSPointerUp."+f,function(){i&&(d(i,"active",h.autoExpandScrollbar),i=null);e=!1;p&&(document.onselectstart=null);lt.call(w,!0)})},fi=function(){function at(n){if(!nt(n)||e||r(n)[2])return void(h=0);h=1;it=0;rt=0;st=1;g.removeClass("mCS_touch_action");var t=b.offset();k=r(n)[0]-t.top;d=r(n)[1]-t.left;v=[r(n)[0],r(n)[1]]}function vt(n){var c,l,a,y;if(nt(n)&&!e&&!r(n)[2]&&(f.documentTouchScroll||n.preventDefault(),n.stopImmediatePropagation(),(!rt||it)&&st)){gt=w();var o=ut.offset(),t=r(n)[0]-o.top,u=r(n)[1]-o.left,h="mcsLinearOut";(et.push(t),ot.push(u),v[2]=Math.abs(r(n)[0]-v[0]),v[3]=Math.abs(r(n)[1]-v[1]),i.overflowed[0])&&(c=ft[0].parent().height()-ft[0].height(),l=k-t>0&&t-k>-(c*i.scrollRatio.y)&&(2*v[3]<v[2]||"yx"===f.axis));i.overflowed[1]&&(a=ft[1].parent().width()-ft[1].width(),y=d-u>0&&u-d>-(a*i.scrollRatio.x)&&(2*v[2]<v[3]||"yx"===f.axis));l||y?(ii||n.preventDefault(),it=1):(rt=1,g.addClass("mCS_touch_action"));ii&&n.preventDefault();s="yx"===f.axis?[k-t,d-u]:"x"===f.axis?[null,d-u]:[k-t,null];b[0].idleTimer=250;i.overflowed[0]&&tt(s[0],ni,h,"y","all",!0);i.overflowed[1]&&tt(s[1],ni,h,"x",lt,!0)}}function yt(n){if(!nt(n)||e||r(n)[2])return void(h=0);h=1;n.stopImmediatePropagation();o(g);dt=w();var t=ut.offset();bt=r(n)[0]-t.top;kt=r(n)[1]-t.left;et=[];ot=[]}function pt(n){var t,u,h;if(nt(n)&&!e&&!r(n)[2]){st=0;n.stopImmediatePropagation();it=0;rt=0;ht=w();var l=ut.offset(),a=r(n)[0]-l.top,v=r(n)[1]-l.left;if(!(ht-gt>30)){c=1e3/(ht-dt);var p="mcsEaseOut",o=2.5>c,k=o?[et[et.length-2],ot[ot.length-2]]:[0,0];y=o?[a-k[0],v-k[1]]:[a-bt,v-kt];t=[Math.abs(y[0]),Math.abs(y[1])];c=o?[Math.abs(y[0]/4),Math.abs(y[1]/4)]:[c,c];u=[Math.abs(b[0].offsetTop)-y[0]*wt(t[0]/c[0],c[0]),Math.abs(b[0].offsetLeft)-y[1]*wt(t[1]/c[1],c[1])];s="yx"===f.axis?[u[0],u[1]]:"x"===f.axis?[null,u[1]]:[u[0],null];ct=[4*t[0]+f.scrollInertia,4*t[1]+f.scrollInertia];h=parseInt(f.contentTouchScroll)||0;s[0]=t[0]>h?s[0]:0;s[1]=t[1]>h?s[1]:0;i.overflowed[0]&&tt(s[0],ct[0],p,"y",lt,!1);i.overflowed[1]&&tt(s[1],ct[1],p,"x",lt,!1)}}}function wt(n,t){var i=[1.5*t,2*t,t/1.5,t/2];return n>90?t>4?i[0]:i[3]:n>60?t>3?i[3]:i[2]:n>30?t>8?i[1]:t>6?i[0]:t>4?t:i[2]:t>8?t:i[3]}function tt(n,t,i,r,f,e){n&&u(g,n.toString(),{dur:t,scrollEasing:i,dir:r,overwrite:f,drag:e})}var st,k,d,bt,kt,dt,gt,ht,y,c,s,ct,it,rt,g=n(this),i=g.data(t),f=i.opt,a=t+"_"+i.idx,ut=n("#mCSB_"+i.idx),b=n("#mCSB_"+i.idx+"_container"),ft=[n("#mCSB_"+i.idx+"_dragger_vertical"),n("#mCSB_"+i.idx+"_dragger_horizontal")],et=[],ot=[],ni=0,lt="yx"===f.axis?"none":"all",v=[],ti=b.find("iframe"),p=["touchstart."+a+" pointerdown."+a+" MSPointerDown."+a,"touchmove."+a+" pointermove."+a+" MSPointerMove."+a,"touchend."+a+" pointerup."+a+" MSPointerUp."+a],ii=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;b.bind(p[0],function(n){at(n)}).bind(p[1],function(n){vt(n)});ut.bind(p[0],function(n){yt(n)}).bind(p[2],function(n){pt(n)});ti.length&&ti.each(function(){n(this).bind("load",function(){l(this)&&n(this.contentDocument||this.contentWindow.document).bind(p[0],function(n){at(n);yt(n)}).bind(p[1],function(n){vt(n)}).bind(p[2],function(n){pt(n)})})})},ei=function(){function y(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function i(n,t,i){l.type=i&&u?"stepped":"stepless";l.scrollAmount=10;ut(a,n,t,"mcsLinearOut",i?60:null)}var u,a=n(this),f=a.data(t),v=f.opt,l=f.sequential,s=t+"_"+f.idx,o=n("#mCSB_"+f.idx+"_container"),c=o.parent();o.bind("mousedown."+s,function(){h||u||(u=1,e=!0)}).add(document).bind("mousemove."+s,function(n){if(!h&&u&&y()){var s=o.offset(),t=r(n)[0]-s.top+o[0].offsetTop,e=r(n)[1]-s.left+o[0].offsetLeft;t>0&&t<c.height()&&e>0&&e<c.width()?l.step&&i("off",null,"stepped"):("x"!==v.axis&&f.overflowed[0]&&(0>t?i("on",38):t>c.height()&&i("on",40)),"y"!==v.axis&&f.overflowed[1]&&(0>e?i("on",37):e>c.width()&&i("on",39)))}}).bind("mouseup."+s+" dragend."+s,function(){h||(u&&(u=0,i("off",null)),e=!1)})},oi=function(){function h(t,h){var a,v;if(o(s),!si(s,t.target)){if(a="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):p&&t.deltaFactor<100?100:t.deltaFactor||100,v=i.scrollInertia,"x"===i.axis||"x"===i.mouseWheel.axis)var y="x",l=[Math.round(a*r.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],w="auto"!==i.mouseWheel.scrollAmount?l[1]:l[0]>=e.width()?.9*e.width():l[0],k=Math.abs(n("#mCSB_"+r.idx+"_container")[0].offsetLeft),b=f[1][0].offsetLeft,d=f[1].parent().width()-f[1].width(),c="y"===i.mouseWheel.axis?t.deltaY||h:t.deltaX;else var y="y",l=[Math.round(a*r.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],w="auto"!==i.mouseWheel.scrollAmount?l[1]:l[0]>=e.height()?.9*e.height():l[0],k=Math.abs(n("#mCSB_"+r.idx+"_container")[0].offsetTop),b=f[0][0].offsetTop,d=f[0].parent().height()-f[0].height(),c=t.deltaY||h;("y"!==y||r.overflowed[0])&&("x"!==y||r.overflowed[1])&&((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(c=-c),i.mouseWheel.normalizeDelta&&(c=0>c?-1:1),(c>0&&0!==b||0>c&&b!==d||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<5&&!i.mouseWheel.normalizeDelta&&(w=t.deltaFactor,v=17),u(s,(k-c*w).toString(),{dir:y,dur:v}))}}if(n(this).data(t)){var s=n(this),r=s.data(t),i=r.opt,c=t+"_"+r.idx,e=n("#mCSB_"+r.idx),f=[n("#mCSB_"+r.idx+"_dragger_vertical"),n("#mCSB_"+r.idx+"_dragger_horizontal")],a=n("#mCSB_"+r.idx+"_container").find("iframe");a.length&&a.each(function(){n(this).bind("load",function(){l(this)&&n(this.contentDocument||this.contentWindow.document).bind("mousewheel."+c,function(n,t){h(n,t)})})});e.bind("mousewheel."+c,function(n,t){h(n,t)})}},rt={},l=function(t){var r=!1,i=!1,u=null,f;if(void 0===t?i="#empty":void 0!==n(t).attr("id")&&(i=n(t).attr("id")),i!==!1&&void 0!==rt[i])return rt[i];if(t){try{f=t.contentDocument||t.contentWindow.document;u=f.body.innerHTML}catch(e){}r=null!==u}else{try{f=top.document;u=f.body.innerHTML}catch(e){}r=null!==u}return i!==!1&&(rt[i]=r),r},lt=function(n){var t=this.find("iframe"),i;t.length&&(i=n?"auto":"none",t.css("pointer-events",i))},si=function(i,r){var u=r.nodeName.toLowerCase(),f=i.data(t).opt.mouseWheel.disableOver;return n.inArray(u,f)>-1&&!(n.inArray(u,["select","textarea"])>-1&&!n(r).is(":focus"))},hi=function(){var s,h=n(this),f=h.data(t),r=t+"_"+f.idx,c=n("#mCSB_"+f.idx+"_container"),l=c.parent(),a=n(".mCSB_"+f.idx+"_scrollbar ."+i[12]);a.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r,function(t){e=!0;n(t.target).hasClass("mCSB_dragger")||(s=1)}).bind("touchend."+r+" pointerup."+r+" MSPointerUp."+r,function(){e=!1}).bind("click."+r,function(t){var r,e;if(s&&(s=0,n(t.target).hasClass(i[12])||n(t.target).hasClass("mCSB_draggerRail"))){if(o(h),r=n(this),e=r.find(".mCSB_dragger"),r.parent(".mCSB_scrollTools_horizontal").length>0){if(!f.overflowed[1])return;var v="x",a=t.pageX>e.offset().left?-1:1,y=Math.abs(c[0].offsetLeft)-a*.9*l.width()}else{if(!f.overflowed[0])return;var v="y",a=t.pageY>e.offset().top?-1:1,y=Math.abs(c[0].offsetTop)-a*.9*l.height()}u(h,y.toString(),{dir:v,scrollEasing:"mcsEaseInOut"})}})},ci=function(){var i=n(this),s=i.data(t),e=s.opt,c=t+"_"+s.idx,r=n("#mCSB_"+s.idx+"_container"),h=r.parent();r.bind("focusin."+c,function(){var t=n(document.activeElement),c=r.find(".mCustomScrollBox").length,s=0;t.is(e.advanced.autoScrollOnFocus)&&(o(i),clearTimeout(i[0]._focusTimeout),i[0]._focusTimer=c?(s+17)*c:0,i[0]._focusTimeout=setTimeout(function(){var n=[f(t)[0],f(t)[1]],o=[r[0].offsetTop,r[0].offsetLeft],c=[o[0]+n[0]>=0&&o[0]+n[0]<h.height()-t.outerHeight(!1),o[1]+n[1]>=0&&o[0]+n[1]<h.width()-t.outerWidth(!1)],l="yx"!==e.axis||c[0]||c[1]?"all":"none";"x"===e.axis||c[0]||u(i,n[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:l,dur:s});"y"===e.axis||c[1]||u(i,n[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:l,dur:s})},i[0]._focusTimer))})},li=function(){var u=n(this),i=u.data(t),f=t+"_"+i.idx,r=n("#mCSB_"+i.idx+"_container").parent();r.bind("scroll."+f,function(){0===r.scrollTop()&&0===r.scrollLeft()||n(".mCSB_"+i.idx+"_scrollbar").css("visibility","hidden")})},ai=function(){var f=n(this),r=f.data(t),o=r.opt,u=r.sequential,i=t+"_"+r.idx,s=".mCSB_"+r.idx+"_scrollbar",h=n(s+">a");h.bind("contextmenu."+i,function(n){n.preventDefault()}).bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i+" mouseup."+i+" touchend."+i+" pointerup."+i+" MSPointerUp."+i+" mouseout."+i+" pointerout."+i+" MSPointerOut."+i+" click."+i,function(t){function i(n,t){u.scrollAmount=o.scrollButtons.scrollAmount;ut(f,n,t)}if(t.preventDefault(),yt(t)){var s=n(this).attr("class");switch(u.type=o.scrollButtons.scrollType,t.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===u.type)return;e=!0;r.tweenRunning=!1;i("on",s);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===u.type)return;e=!1;u.dir&&i("off",s);break;case"click":if("stepped"!==u.type||r.tweenRunning)return;i("on",s)}}})},vi=function(){function a(t){function w(n,t){s.type=r.keyboard.scrollType;s.scrollAmount=r.keyboard.scrollAmount;"stepped"===s.type&&i.tweenRunning||ut(e,n,t)}var c,y,p,l,a;switch(t.type){case"blur":i.tweenRunning&&s.dir&&w("off",null);break;case"keydown":case"keyup":if(c=t.keyCode?t.keyCode:t.which,y="on","x"!==r.axis&&(38===c||40===c)||"y"!==r.axis&&(37===c||39===c)){if((38===c||40===c)&&!i.overflowed[0]||(37===c||39===c)&&!i.overflowed[1])return;"keyup"===t.type&&(y="off");n(document.activeElement).is(v)||(t.preventDefault(),t.stopImmediatePropagation(),w(y,c))}else 33===c||34===c?((i.overflowed[0]||i.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)&&(o(e),p=34===c?-1:1,"x"===r.axis||"yx"===r.axis&&i.overflowed[1]&&!i.overflowed[0]?(l="x",a=Math.abs(f[0].offsetLeft)-p*.9*h.width()):(l="y",a=Math.abs(f[0].offsetTop)-p*.9*h.height()),u(e,a.toString(),{dir:l,scrollEasing:"mcsEaseInOut"})):35!==c&&36!==c||n(document.activeElement).is(v)||((i.overflowed[0]||i.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"!==t.type)||("x"===r.axis||"yx"===r.axis&&i.overflowed[1]&&!i.overflowed[0]?(l="x",a=35===c?Math.abs(h.width()-f.outerWidth(!1)):0):(l="y",a=35===c?Math.abs(h.height()-f.outerHeight(!1)):0),u(e,a.toString(),{dir:l,scrollEasing:"mcsEaseInOut"}))}}var e=n(this),i=e.data(t),r=i.opt,s=i.sequential,c=t+"_"+i.idx,w=n("#mCSB_"+i.idx),f=n("#mCSB_"+i.idx+"_container"),h=f.parent(),v="input,textarea,select,datalist,keygen,[contenteditable='true']",y=f.find("iframe"),p=["blur."+c+" keydown."+c+" keyup."+c];y.length&&y.each(function(){n(this).bind("load",function(){l(this)&&n(this.contentDocument||this.contentWindow.document).bind(p[0],function(n){a(n)})})});w.attr("tabindex","0").bind(p[0],function(n){a(n)})},ut=function(r,f,e,s,h){function y(n){l.snapAmount&&(c.scrollAmount=l.snapAmount instanceof Array?"x"===c.dir[0]?l.snapAmount[1]:l.snapAmount[0]:l.snapAmount);var i="stepped"!==c.type,f=h?h:n?i?k/1.5:d:1e3/60,e=n?i?7.5:40:2.5,t=[Math.abs(p[0].offsetTop),Math.abs(p[0].offsetLeft)],o=[v.scrollRatio.y>10?10:v.scrollRatio.y,v.scrollRatio.x>10?10:v.scrollRatio.x],w="x"===c.dir[0]?t[1]+c.dir[1]*o[1]*e:t[0]+c.dir[1]*o[0]*e,b="x"===c.dir[0]?t[1]+c.dir[1]*parseInt(c.scrollAmount):t[0]+c.dir[1]*parseInt(c.scrollAmount),a="auto"!==c.scrollAmount?b:w,g=s?s:n?i?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",nt=!!n;return n&&17>f&&(a="x"===c.dir[0]?t[1]:t[0]),u(r,a.toString(),{dir:c.dir[0],scrollEasing:g,dur:f,onComplete:nt}),n?void(c.dir=!1):(clearTimeout(c.step),void(c.step=setTimeout(function(){y()},f)))}function b(){clearTimeout(c.step);a(c,"step");o(r)}var v=r.data(t),l=v.opt,c=v.sequential,p=n("#mCSB_"+v.idx+"_container"),w="stepped"===c.type,k=l.scrollInertia<26?26:l.scrollInertia,d=l.scrollInertia<1?17:l.scrollInertia;switch(f){case"on":if(c.dir=[e===i[16]||e===i[15]||39===e||37===e?"x":"y",e===i[13]||e===i[15]||38===e||37===e?-1:1],o(r),tt(e)&&"stepped"===c.type)return;y(w);break;case"off":b();(w||v.tweenRunning&&c.dir)&&y(!0)}},ft=function(i){var u=n(this).data(t).opt,r=[];return"function"==typeof i&&(i=i()),i instanceof Array?r=i.length>1?[i[0],i[1]]:"x"===u.axis?[null,i[0]]:[i[0],null]:(r[0]=i.y?i.y:i.x||"x"===u.axis?null:i,r[1]=i.x?i.x:i.y||"y"===u.axis?null:i),"function"==typeof r[0]&&(r[0]=r[0]()),"function"==typeof r[1]&&(r[1]=r[1]()),r},at=function(i,r){var h,e;if(null!=i&&"undefined"!=typeof i){var c=n(this),l=c.data(t),v=l.opt,u=n("#mCSB_"+l.idx+"_container"),o=u.parent(),y=typeof i;r||(r="x"===v.axis?"x":"y");var p="x"===r?u.outerWidth(!1)-o.width():u.outerHeight(!1)-o.height(),a="x"===r?u[0].offsetLeft:u[0].offsetTop,w="x"===r?"left":"top";switch(y){case"function":return i();case"object":return(e=i.jquery?i:n(i),!e.length)?void 0:"x"===r?f(e)[1]:f(e)[0];case"string":case"number":return tt(i)?Math.abs(i):-1!==i.indexOf("%")?Math.abs(p*parseInt(i)/100):-1!==i.indexOf("-=")?Math.abs(a-parseInt(i.split("-=")[1])):-1!==i.indexOf("+=")?(h=a+parseInt(i.split("+=")[1]),h>=0?0:Math.abs(h)):-1!==i.indexOf("px")&&tt(i.split("px")[0])?Math.abs(i.split("px")[0]):"top"===i||"left"===i?0:"bottom"===i?Math.abs(o.height()-u.outerHeight(!1)):"right"===i?Math.abs(o.width()-u.outerWidth(!1)):"first"===i||"last"===i?(e=u.find(":"+i),"x"===r?f(e)[1]:f(e)[0]):n(i).length?"x"===r?f(n(i))[1]:f(n(i))[0]:(u.css(w,i),void s.update.call(null,c[0]))}}},et=function(r){function c(){return clearTimeout(e[0].autoUpdate),0===o.parents("html").length?void(o=null):void(e[0].autoUpdate=setTimeout(function(){return f.advanced.updateOnSelectorChange&&(u.poll.change.n=v(),u.poll.change.n!==u.poll.change.o)?(u.poll.change.o=u.poll.change.n,void h(3)):f.advanced.updateOnContentResize&&(u.poll.size.n=o[0].scrollHeight+o[0].scrollWidth+e[0].offsetHeight+o[0].offsetHeight+o[0].offsetWidth,u.poll.size.n!==u.poll.size.o)?(u.poll.size.o=u.poll.size.n,void h(1)):!f.advanced.updateOnImageLoad||"auto"===f.advanced.updateOnImageLoad&&"y"===f.axis||(u.poll.img.n=e.find("img").length,u.poll.img.n===u.poll.img.o)?void((f.advanced.updateOnSelectorChange||f.advanced.updateOnContentResize||f.advanced.updateOnImageLoad)&&c()):(u.poll.img.o=u.poll.img.n,void e.find("img").each(function(){l(this)}))},f.advanced.autoUpdateTimeout))}function l(t){function u(n,t){return function(){return t.apply(n,arguments)}}function f(){this.onload=null;n(t).addClass(i[2]);h(2)}if(n(t).hasClass(i[2]))return void h();var r=new Image;r.onload=u(r,f);r.src=t.src}function v(){f.advanced.updateOnSelectorChange===!0&&(f.advanced.updateOnSelectorChange="*");var n=0,t=e.find(f.advanced.updateOnSelectorChange);return f.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){n+=this.offsetHeight+this.offsetWidth}),n}function h(n){clearTimeout(e[0].autoUpdate);s.update.call(null,o[0],n)}var o=n(this),u=o.data(t),f=u.opt,e=n("#mCSB_"+u.idx+"_container");return r?(clearTimeout(e[0].autoUpdate),void a(e[0],"autoUpdate")):void c()},yi=function(n,t,i){return Math.round(n/t)*t-i},o=function(i){var r=i.data(t),u=n("#mCSB_"+r.idx+"_container,#mCSB_"+r.idx+"_container_wrapper,#mCSB_"+r.idx+"_dragger_vertical,#mCSB_"+r.idx+"_dragger_horizontal");u.each(function(){pi.call(this)})},u=function(i,r,u){function h(n){return f&&e.callbacks[n]&&"function"==typeof e.callbacks[n]}function rt(){return[e.callbacks.alwaysTriggerOffsets||w>=l[0]+v,e.callbacks.alwaysTriggerOffsets||-y>=w]}function a(){var n=[o[0].offsetTop,o[0].offsetLeft],t=[c[0].offsetTop,c[0].offsetLeft],r=[o.outerHeight(!1),o.outerWidth(!1)],f=[p.height(),p.width()];i[0].mcs={content:o,top:n[0],left:n[1],draggerTop:t[0],draggerLeft:t[1],topPct:Math.round(100*Math.abs(n[0])/(Math.abs(r[0])-f[0])),leftPct:Math.round(100*Math.abs(n[1])/(Math.abs(r[1])-f[1])),direction:u.dir}}var f=i.data(t),e=f.opt,ut={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:e.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},u=n.extend(ut,u),k=[u.dur,u.drag?0:u.dur],p=n("#mCSB_"+f.idx),o=n("#mCSB_"+f.idx+"_container"),b=o.parent(),g=e.callbacks.onTotalScrollOffset?ft.call(i,e.callbacks.onTotalScrollOffset):[0,0],nt=e.callbacks.onTotalScrollBackOffset?ft.call(i,e.callbacks.onTotalScrollBackOffset):[0,0],tt;if(f.trigger=u.trigger,0===b.scrollTop()&&0===b.scrollLeft()||(n(".mCSB_"+f.idx+"_scrollbar").css("visibility","visible"),b.scrollTop(0).scrollLeft(0)),"_resetY"!==r||f.contentReset.y||(h("onOverflowYNone")&&e.callbacks.onOverflowYNone.call(i[0]),f.contentReset.y=1),"_resetX"!==r||f.contentReset.x||(h("onOverflowXNone")&&e.callbacks.onOverflowXNone.call(i[0]),f.contentReset.x=1),"_resetY"!==r&&"_resetX"!==r){(!f.contentReset.y&&i[0].mcs||!f.overflowed[0]||(h("onOverflowY")&&e.callbacks.onOverflowY.call(i[0]),f.contentReset.x=null),!f.contentReset.x&&i[0].mcs||!f.overflowed[1]||(h("onOverflowX")&&e.callbacks.onOverflowX.call(i[0]),f.contentReset.x=null),e.snapAmount)&&(tt=e.snapAmount instanceof Array?"x"===u.dir?e.snapAmount[1]:e.snapAmount[0]:e.snapAmount,r=yi(r,tt,e.snapOffset));switch(u.dir){case"x":var c=n("#mCSB_"+f.idx+"_dragger_horizontal"),it="left",w=o[0].offsetLeft,l=[p.width()-o.outerWidth(!1),c.parent().width()-c.width()],s=[r,0===r?0:r/f.scrollRatio.x],v=g[1],y=nt[1],et=v>0?v/f.scrollRatio.x:0,ot=y>0?y/f.scrollRatio.x:0;break;case"y":var c=n("#mCSB_"+f.idx+"_dragger_vertical"),it="top",w=o[0].offsetTop,l=[p.height()-o.outerHeight(!1),c.parent().height()-c.height()],s=[r,0===r?0:r/f.scrollRatio.y],v=g[0],y=nt[0],et=v>0?v/f.scrollRatio.y:0,ot=y>0?y/f.scrollRatio.y:0}s[1]<0||0===s[0]&&0===s[1]?s=[0,0]:s[1]>=l[1]?s=[l[0],l[1]]:s[0]=-s[0];i[0].mcs||(a(),h("onInit")&&e.callbacks.onInit.call(i[0]));clearTimeout(o[0].onCompleteTimeout);vt(c[0],it,Math.round(s[1]),k[1],u.scrollEasing);!f.tweenRunning&&(0===w&&s[0]>=0||w===l[0]&&s[0]<=l[0])||vt(o[0],it,Math.round(s[0]),k[0],u.scrollEasing,u.overwrite,{onStart:function(){u.callbacks&&u.onStart&&!f.tweenRunning&&(h("onScrollStart")&&(a(),e.callbacks.onScrollStart.call(i[0])),f.tweenRunning=!0,d(c),f.cbOffsets=rt())},onUpdate:function(){u.callbacks&&u.onUpdate&&h("whileScrolling")&&(a(),e.callbacks.whileScrolling.call(i[0]))},onComplete:function(){if(u.callbacks&&u.onComplete){"yx"===e.axis&&clearTimeout(o[0].onCompleteTimeout);var n=o[0].idleTimer||0;o[0].onCompleteTimeout=setTimeout(function(){h("onScroll")&&(a(),e.callbacks.onScroll.call(i[0]));h("onTotalScroll")&&s[1]>=l[1]-et&&f.cbOffsets[0]&&(a(),e.callbacks.onTotalScroll.call(i[0]));h("onTotalScrollBack")&&s[1]<=ot&&f.cbOffsets[1]&&(a(),e.callbacks.onTotalScrollBack.call(i[0]));f.tweenRunning=!1;o[0].idleTimer=0;d(c,"hide")},n)}}})}},vt=function(n,t,i,r,u,f,e){function a(){o.stop||(s||g.call(),s=w()-it,v(),s>=o.time&&(o.time=s>o.time?s+h-(s-o.time):s+h-1,o.time<s+1&&(o.time=s+1)),o.time<r?o.id=c(a):tt.call())}function v(){r>0?(o.currVal=d(o.time,l,p,r,u),y[t]=Math.round(o.currVal)+"px"):y[t]=i+"px";nt.call()}function b(){h=1e3/60;o.time=s+h;c=window.requestAnimationFrame?window.requestAnimationFrame:function(n){return v(),setTimeout(n,.01)};o.id=c(a)}function k(){null!=o.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(o.id):clearTimeout(o.id),o.id=null)}function d(n,t,i,r,u){switch(u){case"linear":case"mcsLinear":return i*n/r+t;case"mcsLinearOut":return n/=r,n--,i*Math.sqrt(1-n*n)+t;case"easeInOutSmooth":return n/=r/2,1>n?i/2*n*n+t:(n--,-i/2*(n*(n-2)-1)+t);case"easeInOutStrong":return n/=r/2,1>n?i/2*Math.pow(2,10*(n-1))+t:(n--,i/2*(-Math.pow(2,-10*n)+2)+t);case"easeInOut":case"mcsEaseInOut":return n/=r/2,1>n?i/2*n*n*n+t:(n-=2,i/2*(n*n*n+2)+t);case"easeOutSmooth":return n/=r,n--,-i*(n*n*n*n-1)+t;case"easeOutStrong":return i*(-Math.pow(2,-10*n/r)+1)+t;case"easeOut":case"mcsEaseOut":default:var f=(n/=r)*n,e=f*n;return t+i*(.499999999999997*e*f+-2.5*f*f+5.5*e+-6.5*f+4*n)}}var p;n._mTween||(n._mTween={top:{},left:{}});var h,c,e=e||{},g=e.onStart||function(){},nt=e.onUpdate||function(){},tt=e.onComplete||function(){},it=w(),s=0,l=n.offsetTop,y=n.style,o=n._mTween[t];"left"===t&&(l=n.offsetLeft);p=i-l;o.stop=0;"none"!==f&&k();b()},w=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},pi=function(){var n=this,r,i,t;for(n._mTween||(n._mTween={top:{},left:{}}),r=["top","left"],i=0;i<r.length;i++)t=r[i],n._mTween[t].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(n._mTween[t].id):clearTimeout(n._mTween[t].id),n._mTween[t].id=null,n._mTween[t].stop=1)},a=function(n,t){try{delete n[t]}catch(i){n[t]=null}},yt=function(n){return!(n.which&&1!==n.which)},nt=function(n){var t=n.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},tt=function(n){return!isNaN(parseFloat(n))&&isFinite(n)},f=function(n){var t=n.parents(".mCSB_container");return[n.offset().top-t.offset().top,n.offset().left-t.offset().left]},wi=function(){function t(){var t=["webkit","moz","ms","o"],n;if("hidden"in document)return"hidden";for(n=0;n<t.length;n++)if(t[n]+"Hidden"in document)return t[n]+"Hidden";return null}var n=t();return n?document[n]:!1};n.fn[c]=function(t){return s[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void n.error("Method "+t+" does not exist"):s.init.apply(this,arguments)};n[c]=function(t){return s[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void n.error("Method "+t+" does not exist"):s.init.apply(this,arguments)};n[c].defaults=ot;window[c]=!0;n(window).bind("load",function(){n(it)[c]();n.extend(n.expr[":"],{mcsInView:n.expr[":"].mcsInView||function(t){var e,r,i=n(t),u=i.parents(".mCSB_container");if(u.length)return e=u.parent(),r=[u[0].offsetTop,u[0].offsetLeft],r[0]+f(i)[0]>=0&&r[0]+f(i)[0]<e.height()-i.outerHeight(!1)&&r[1]+f(i)[1]>=0&&r[1]+f(i)[1]<e.width()-i.outerWidth(!1)},mcsInSight:n.expr[":"].mcsInSight||function(t,i,r){var e,u,o,s,h=n(t),c=h.parents(".mCSB_container"),l="exact"===r[3]?[[1,0],[1,0]]:[[.9,.1],[.6,.4]];if(c.length)return e=[h.outerHeight(!1),h.outerWidth(!1)],o=[c[0].offsetTop+f(h)[0],c[0].offsetLeft+f(h)[1]],u=[c.parent()[0].offsetHeight,c.parent()[0].offsetWidth],s=[e[0]<u[0]?l[0]:l[1],e[1]<u[1]?l[0]:l[1]],o[0]-u[0]*s[0][0]<0&&o[0]+e[0]-u[0]*s[0][1]>=0&&o[1]-u[1]*s[1][0]<0&&o[1]+e[1]-u[1]*s[1][1]>=0},mcsOverflow:n.expr[":"].mcsOverflow||function(i){var r=n(i).data(t);if(r)return r.overflowed[0]||r.overflowed[1]}})})})}),function(n){"use strict";function k(n){var t={},i;return n.selectionStart===undefined?(n.focus(),i=document.selection.createRange(),t.length=i.text.length,i.moveStart("character",-n.value.length),t.end=i.text.length,t.start=t.end-t.length):(t.start=n.selectionStart,t.end=n.selectionEnd,t.length=t.end-t.start),t}function u(n,t,i){if(n.selectionStart===undefined){n.focus();var r=n.createTextRange();r.collapse(!0);r.moveEnd("character",i);r.moveStart("character",t);r.select()}else n.selectionStart=t,n.selectionEnd=i}function d(t,i){n.each(i,function(n,r){typeof r=="function"?i[n]=r(t,i,n):typeof t.autoNumeric[r]=="function"&&(i[n]=t.autoNumeric[r](t,i,n))})}function e(n,t){typeof n[t]=="string"&&(n[t]*=1)}function v(n,t){var i,r,f,o,u,s;return d(n,t),t.oEvent=null,t.tagList=["b","caption","cite","code","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","ins","kdb","label","li","output","p","q","s","sample","span","strong","td","th","u","var"],i=t.vMax.toString().split("."),r=!t.vMin&&t.vMin!==0?[]:t.vMin.toString().split("."),e(t,"vMax"),e(t,"vMin"),e(t,"mDec"),t.mDec=t.mRound==="CHF"?"2":t.mDec,t.allowLeading=!0,t.aNeg=t.vMin<0?"-":"",i[0]=i[0].replace("-",""),r[0]=r[0].replace("-",""),t.mInt=Math.max(i[0].length,r[0].length,1),t.mDec===null&&(f=0,o=0,i[1]&&(f=i[1].length),r[1]&&(o=r[1].length),t.mDec=Math.max(f,o)),t.altDec===null&&t.mDec>0&&(t.aDec==="."&&t.aSep!==","?t.altDec=",":t.aDec===","&&t.aSep!=="."&&(t.altDec=".")),u=t.aNeg?"([-\\"+t.aNeg+"]?)":"(-?)",t.aNegRegAutoStrip=u,t.skipFirstAutoStrip=new RegExp(u+"[^-"+(t.aNeg?"\\"+t.aNeg:"")+"\\"+t.aDec+"\\d].*?(\\d|\\"+t.aDec+"\\d)"),t.skipLastAutoStrip=new RegExp("(\\d\\"+t.aDec+"?)[^\\"+t.aDec+"\\d]\\D*$"),s="-"+t.aNum+"\\"+t.aDec,t.allowedAutoStrip=new RegExp("[^"+s+"]","gi"),t.numRegAutoStrip=new RegExp(u+"(?:\\"+t.aDec+"?(\\d+\\"+t.aDec+"\\d+)|(\\d*(?:\\"+t.aDec+"\\d*)?))"),t}function t(n,t,i){var u,r,e,f;if(t.aSign)while(n.indexOf(t.aSign)>-1)n=n.replace(t.aSign,"");return n=n.replace(t.skipFirstAutoStrip,"$1$2"),n=n.replace(t.skipLastAutoStrip,"$1"),n=n.replace(t.allowedAutoStrip,""),t.altDec&&(n=n.replace(t.altDec,t.aDec)),u=n.match(t.numRegAutoStrip),n=u?[u[1],u[2],u[3]].join(""):"",(t.lZero==="allow"||t.lZero==="keep")&&i!=="strip"&&(r=[],e="",r=n.split(t.aDec),r[0].indexOf("-")!==-1&&(e="-",r[0]=r[0].replace("-","")),r[0].length>t.mInt&&r[0].charAt(0)==="0"&&(r[0]=r[0].slice(1)),n=e+r.join(t.aDec)),(i&&t.lZero==="deny"||i&&t.lZero==="allow"&&t.allowLeading===!1)&&(f="^"+t.aNegRegAutoStrip+"0*(\\d"+(i==="leading"?")":"|$)"),f=new RegExp(f),n=n.replace(f,"$1$2")),n}function f(n,t,i){return t=t.split(","),i==="set"||i==="focusout"?(n=n.replace("-",""),n=t[0]+n+t[1]):(i==="get"||i==="focusin"||i==="pageLoad")&&n.charAt(0)===t[0]&&(n=n.replace(t[0],"-"),n=n.replace(t[1],"")),n}function y(n,t,i){if(t&&i){var r=n.split(t);r[1]&&r[1].length>i&&(i>0?(r[1]=r[1].substring(0,i),n=r.join(t)):n=r[0])}return n}function s(n,t,i){return t&&t!=="."&&(n=n.replace(t,".")),i&&i!=="-"&&(n=n.replace(i,"-")),n.match(/\d/)||(n+="0"),n}function p(n,t){var r,i;return n&&(r=+n,r<1e-6&&r>-1?(n=+n,n<1e-6&&n>0&&(n=(n+10).toString(),n=n.substring(1)),n<0&&n>-1&&(n=(n-10).toString(),n="-"+n.substring(2)),n=n.toString()):(i=n.split("."),i[1]!==undefined&&(+i[1]==0?n=i[0]:(i[1]=i[1].replace(/0*$/,""),n=i.join("."))))),t.lZero==="keep"?n:n.replace(/^0*(\d)/,"$1")}function w(n,t,i){return i&&i!=="-"&&(n=n.replace("-",i)),t&&t!=="."&&(n=n.replace(".",t)),n}function h(i,r){i=t(i,r);i=y(i,r.aDec,r.mDec);i=s(i,r.aDec,r.aNeg);var u=+i;return r.oEvent==="set"&&(u<r.vMin||u>r.vMax)&&n.error("The value ("+u+") from the 'set' method falls outside of the vMin / vMax range"),u>=r.vMin&&u<=r.vMax}function o(n,t,i){return n===""||n===t.aNeg?t.wEmpty==="zero"?n+"0":t.wEmpty==="sign"||i?n+t.aSign:n:null}function c(n,i){var h,s,e,r,u,c;if(n=t(n,i),h=n.replace(",","."),s=o(n,i,!0),s!==null)return s;if(e="",e=i.dGroup===2?/(\d)((\d)(\d{2}?)+)$/:i.dGroup===4?/(\d)((\d{4}?)+)$/:/(\d)((\d{3}?)+)$/,r=n.split(i.aDec),i.altDec&&r.length===1&&(r=n.split(i.altDec)),u=r[0],i.aSep)while(e.test(u))u=u.replace(e,"$1"+i.aSep+"$2");return i.mDec!==0&&r.length>1?(r[1].length>i.mDec&&(r[1]=r[1].substring(0,i.mDec)),n=u+i.aDec+r[1]):n=u,i.aSign&&(c=n.indexOf(i.aNeg)!==-1,n=n.replace(i.aNeg,""),n=i.pSign==="p"?i.aSign+n:n+i.aSign,c&&(n=i.aNeg+n)),i.oEvent==="set"&&h<0&&i.nBracket!==null&&(n=f(n,i.nBracket,i.oEvent)),n}function l(n,t){var v;n=n===""?"0":n.toString();e(t,"mDec");t.mRound==="CHF"&&(n=(Math.round(n*20)/20).toString());var i="",r=0,f="",s=typeof t.aPad=="boolean"||t.aPad===null?t.aPad?t.mDec:0:+t.aPad,p=function(n){var t=s===0?/(\.(?:\d*[1-9])?)0*$/:s===1?/(\.\d(?:\d*[1-9])?)0*$/:new RegExp("(\\.\\d{"+s+"}(?:\\d*[1-9])?)0*$");return n=n.replace(t,"$1"),s===0&&(n=n.replace(/\.$/,"")),n};n.charAt(0)==="-"&&(f="-",n=n.replace("-",""));n.match(/^\d/)||(n="0"+n);f==="-"&&+n==0&&(f="");(+n>0&&t.lZero!=="keep"||n.length>0&&t.lZero==="allow")&&(n=n.replace(/^0*(\d)/,"$1"));var a=n.lastIndexOf("."),w=a===-1?n.length-1:a,h=n.length-1-w;if(h<=t.mDec){if(i=n,h<s)for(a===-1&&(i+="."),v="000000";h<s;)v=v.substring(0,s-h),i+=v,h+=v.length;else h>s?i=p(i):h===0&&s===0&&(i=i.replace(/\.$/,""));if(t.mRound!=="CHF")return+i==0?i:f+i;t.mRound==="CHF"&&(a=i.lastIndexOf("."),n=i)}var c=a+t.mDec,o=+n.charAt(c+1),u=n.substring(0,c+1).split(""),y=n.charAt(c)==="."?n.charAt(c-1)%2:n.charAt(c)%2,l=!0;if(y!==1&&(y=y===0&&n.substring(c+2,n.length)>0?1:0),o>4&&t.mRound==="S"||o>4&&t.mRound==="A"&&f===""||o>5&&t.mRound==="A"&&f==="-"||o>5&&t.mRound==="s"||o>5&&t.mRound==="a"&&f===""||o>4&&t.mRound==="a"&&f==="-"||o>5&&t.mRound==="B"||o===5&&t.mRound==="B"&&y===1||o>0&&t.mRound==="C"&&f===""||o>0&&t.mRound==="F"&&f==="-"||o>0&&t.mRound==="U"||t.mRound==="CHF")for(r=u.length-1;r>=0;r-=1)if(u[r]!=="."){if(t.mRound==="CHF"&&u[r]<=2&&l){u[r]=0;l=!1;break}if(t.mRound==="CHF"&&u[r]<=7&&l){u[r]=5;l=!1;break}if(t.mRound==="CHF"&&l?(u[r]=10,l=!1):u[r]=+u[r]+1,u[r]<10)break;r>0&&(u[r]="0")}return u=u.slice(0,c+1),i=p(u.join("")),+i==0?i:f+i}function b(t,i){this.settings=i;this.that=t;this.$that=n(t);this.formatted=!1;this.settingsClone=v(this.$that,this.settings);this.value=t.value}function r(t){return typeof t=="string"&&(t=t.replace(/\[/g,"\\[").replace(/\]/g,"\\]"),t="#"+t.replace(/(:|\.)/g,"\\$1")),n(t)}function i(n,t,i){var r=n.data("autoNumeric"),u;return r||(r={},n.data("autoNumeric",r)),u=r.holder,(u===undefined&&t||i)&&(u=new b(n.get(0),t),r.holder=u),u}b.prototype={init:function(n){this.value=this.that.value;this.settingsClone=v(this.$that,this.settings);this.ctrlKey=n.ctrlKey;this.cmdKey=n.metaKey;this.shiftKey=n.shiftKey;this.selection=k(this.that);(n.type==="keydown"||n.type==="keyup")&&(this.kdCode=n.keyCode);this.which=n.which;this.processed=!1;this.formatted=!1},setSelection:function(n,t,i){n=Math.max(n,0);t=Math.min(t,this.that.value.length);this.selection={start:n,end:t,length:t-n};(i===undefined||i)&&u(this.that,n,t)},setPosition:function(n,t){this.setSelection(n,n,t)},getBeforeAfter:function(){var n=this.value,t=n.substring(0,this.selection.start),i=n.substring(this.selection.end,n.length);return[t,i]},getBeforeAfterStriped:function(){var n=this.getBeforeAfter();return n[0]=t(n[0],this.settingsClone),n[1]=t(n[1],this.settingsClone),n},normalizeParts:function(n,i){var r=this.settingsClone,e,u,f;return i=t(i,r),e=i.match(/^\d/)?!0:"leading",n=t(n,r,e),(n===""||n===r.aNeg)&&r.lZero==="deny"&&i>""&&(i=i.replace(/^0*(\d)/,"$1")),u=n+i,r.aDec&&(f=u.match(new RegExp("^"+r.aNegRegAutoStrip+"\\"+r.aDec)),f&&(n=n.replace(f[1],f[1]+"0"),u=n+i)),r.wEmpty==="zero"&&(u===r.aNeg||u==="")&&(n+="0"),[n,i]},setValueParts:function(n,t){var r=this.settingsClone,f=this.normalizeParts(n,t),i=f.join(""),u=f[0].length;return h(i,r)?(i=y(i,r.aDec,r.mDec),u>i.length&&(u=i.length),this.value=i,this.setPosition(u,!1),!0):!1},signPosition:function(){var n=this.settingsClone,u=n.aSign,i=this.that,t,f,r;return u?(t=u.length,n.pSign==="p")?(f=n.aNeg&&i.value&&i.value.charAt(0)===n.aNeg,f?[1,t+1]:[0,t]):(r=i.value.length,[r-t,r]):[1e3,-1]},expandSelectionOnSign:function(n){var t=this.signPosition(),i=this.selection;i.start<t[1]&&i.end>t[0]&&((i.start<t[0]||i.end>t[1])&&this.value.substring(Math.max(i.start,t[0]),Math.min(i.end,t[1])).match(/^\s*$/)?i.start<t[0]?this.setSelection(i.start,t[0],n):this.setSelection(t[1],i.end,n):this.setSelection(Math.min(i.start,t[0]),Math.max(i.end,t[1]),n))},checkPaste:function(){if(this.valuePartsBeforePaste!==undefined){var n=this.getBeforeAfter(),i=this.valuePartsBeforePaste;delete this.valuePartsBeforePaste;n[0]=n[0].substr(0,i[0].length)+t(n[0].substr(i[0].length),this.settingsClone);this.setValueParts(n[0],n[1])||(this.value=i.join(""),this.setPosition(i[0].length,!1))}},skipAllways:function(n){var t=this.kdCode,e=this.which,i=this.ctrlKey,r=this.cmdKey,s=this.shiftKey;if((i||r)&&n.type==="keyup"&&this.valuePartsBeforePaste!==undefined||s&&t===45)return this.checkPaste(),!1;if(t>=112&&t<=123||t>=91&&t<=93||t>=9&&t<=31||t<8&&(e===0||e===t)||t===144||t===145||t===45||(i||r)&&t===65)return!0;if((i||r)&&(t===67||t===86||t===88))return n.type==="keydown"&&this.expandSelectionOnSign(),(t===86||t===45)&&(n.type==="keydown"||n.type==="keypress"?this.valuePartsBeforePaste===undefined&&(this.valuePartsBeforePaste=this.getBeforeAfter()):this.checkPaste()),n.type==="keydown"||n.type==="keypress"||t===67;if(i||r)return!0;if(t===37||t===39){var f=this.settingsClone.aSep,u=this.selection.start,o=this.that.value;return n.type==="keydown"&&f&&!this.shiftKey&&(t===37&&o.charAt(u-2)===f?this.setPosition(u-1):t===39&&o.charAt(u+1)===f&&this.setPosition(u+1)),!0}return t>=34&&t<=40?!0:!1},processAllways:function(){var n;return this.kdCode===8||this.kdCode===46?(this.selection.length?(this.expandSelectionOnSign(!1),n=this.getBeforeAfterStriped(),this.setValueParts(n[0],n[1])):(n=this.getBeforeAfterStriped(),this.kdCode===8?n[0]=n[0].substring(0,n[0].length-1):n[1]=n[1].substring(1,n[1].length),this.setValueParts(n[0],n[1])),!0):!1},processKeypress:function(){var n=this.settingsClone,r=String.fromCharCode(this.which),u=this.getBeforeAfterStriped(),t=u[0],i=u[1];return r===n.aDec||n.altDec&&r===n.altDec||(r==="."||r===",")&&this.kdCode===110?!n.mDec||!n.aDec?!0:n.aNeg&&i.indexOf(n.aNeg)>-1?!0:t.indexOf(n.aDec)>-1?!0:i.indexOf(n.aDec)>0?!0:(i.indexOf(n.aDec)===0&&(i=i.substr(1)),this.setValueParts(t+n.aDec,i),!0):r==="-"||r==="+"?n.aNeg?(t===""&&i.indexOf(n.aNeg)>-1&&(t=n.aNeg,i=i.substring(1,i.length)),t=t.charAt(0)===n.aNeg?t.substring(1,t.length):r==="-"?n.aNeg+t:t,this.setValueParts(t,i),!0):!0:r>="0"&&r<="9"?(n.aNeg&&t===""&&i.indexOf(n.aNeg)>-1&&(t=n.aNeg,i=i.substring(1,i.length)),n.vMax<=0&&n.vMin<n.vMax&&this.value.indexOf(n.aNeg)===-1&&r!=="0"&&(t=n.aNeg+t),this.setValueParts(t+r,i),!0):!0},formatQuick:function(){var n=this.settingsClone,t=this.getBeforeAfterStriped(),o=this.value,f,s,i,r,e,u,l,h;if((n.aSep===""||n.aSep!==""&&o.indexOf(n.aSep)===-1)&&(n.aSign===""||n.aSign!==""&&o.indexOf(n.aSign)===-1)&&(f=[],s="",f=o.split(n.aDec),f[0].indexOf("-")>-1&&(s="-",f[0]=f[0].replace("-",""),t[0]=t[0].replace("-","")),f[0].length>n.mInt&&t[0].charAt(0)==="0"&&(t[0]=t[0].slice(1)),t[0]=s+t[0]),i=c(this.value,this.settingsClone),r=i.length,i){for(e=t[0].split(""),u=0,u;u<e.length;u+=1)e[u].match("\\d")||(e[u]="\\"+e[u]);l=new RegExp("^.*?"+e.join(".*?"));h=i.match(l);h?(r=h[0].length,(r===0&&i.charAt(0)!==n.aNeg||r===1&&i.charAt(0)===n.aNeg)&&n.aSign&&n.pSign==="p"&&(r=this.settingsClone.aSign.length+(i.charAt(0)==="-"?1:0))):n.aSign&&n.pSign==="s"&&(r-=n.aSign.length)}this.that.value=i;this.setPosition(r);this.formatted=!0}};var a={init:function(r){return this.each(function(){var e=n(this),a=e.data("autoNumeric"),b=e.data(),p,v,y;if(typeof a!="object"){if(p={aNum:"0123456789",aSep:",",dGroup:"3",aDec:".",altDec:null,aSign:"",pSign:"p",vMax:"9999999999999.99",vMin:"0.00",mDec:null,mRound:"S",aPad:!0,nBracket:null,wEmpty:"empty",lZero:"allow",aForm:!0,onSomeEvent:function(){}},a=n.extend({},p,b,r),a.aDec===a.aSep)return n.error("autoNumeric will not function properly when the decimal character aDec: '"+a.aDec+"' and thousand separator aSep: '"+a.aSep+"' are the same character"),this;e.data("autoNumeric",a)}else return this;if(a.runOnce=!1,v=i(e,a),n.inArray(e.prop("tagName").toLowerCase(),a.tagList)===-1&&e.prop("tagName").toLowerCase()!=="input")return n.error("The <"+e.prop("tagName").toLowerCase()+"> is not supported by autoNumeric()"),this;if(a.runOnce===!1&&a.aForm&&(e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])")&&(y=!0,e[0].value===""&&a.wEmpty==="empty"&&(e[0].value="",y=!1),e[0].value===""&&a.wEmpty==="sign"&&(e[0].value=a.aSign,y=!1),y&&e.autoNumeric("set",e.val())),n.inArray(e.prop("tagName").toLowerCase(),a.tagList)!==-1&&e.text()!==""&&e.autoNumeric("set",e.text())),a.runOnce=!0,e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])")){e.on("keydown.autoNumeric",function(t){return(v=i(e),v.settings.aDec===v.settings.aSep)?(n.error("autoNumeric will not function properly when the decimal character aDec: '"+v.settings.aDec+"' and thousand separator aSep: '"+v.settings.aSep+"' are the same character"),this):v.that.readOnly?(v.processed=!0,!0):(v.init(t),v.settings.oEvent="keydown",v.skipAllways(t))?(v.processed=!0,!0):v.processAllways()?(v.processed=!0,v.formatQuick(),t.preventDefault(),!1):(v.formatted=!1,!0)});e.on("keypress.autoNumeric",function(n){var t=i(e),r=t.processed;if(t.init(n),t.settings.oEvent="keypress",t.skipAllways(n))return!0;if(r)return n.preventDefault(),!1;if(t.processAllways()||t.processKeypress())return t.formatQuick(),n.preventDefault(),!1;t.formatted=!1});e.on("keyup.autoNumeric",function(n){var t=i(e),r;if((t.init(n),t.settings.oEvent="keyup",r=t.skipAllways(n),t.kdCode=0,delete t.valuePartsBeforePaste,e[0].value===t.settings.aSign&&(t.settings.pSign==="s"?u(this,0,0):u(this,t.settings.aSign.length,t.settings.aSign.length)),r)||this.value==="")return!0;t.formatted||t.formatQuick()});e.on("focusin.autoNumeric",function(){var n=i(e),r,t;n.settingsClone.oEvent="focusin";n.settingsClone.nBracket!==null&&(r=e.val(),e.val(f(r,n.settingsClone.nBracket,n.settingsClone.oEvent)));n.inVal=e.val();t=o(n.inVal,n.settingsClone,!0);t!==null&&(e.val(t),n.settings.pSign==="s"?u(this,0,0):u(this,n.settings.aSign.length,n.settings.aSign.length))});e.on("focusout.autoNumeric",function(){var a=i(e),n=a.settingsClone,r=e.val(),y=r,v,u;a.settingsClone.oEvent="focusout";v="";n.lZero==="allow"&&(n.allowLeading=!1,v="leading");r!==""&&(r=t(r,n,v),o(r,n)===null&&h(r,n,e[0])?(r=s(r,n.aDec,n.aNeg),r=l(r,n),r=w(r,n.aDec,n.aNeg)):r="");u=o(r,n,!1);u===null&&(u=c(r,n));u!==y&&e.val(u);u!==a.inVal&&(e.change(),delete a.inVal);n.nBracket!==null&&e.autoNumeric("get")<0&&(a.settingsClone.oEvent="focusout",e.val(f(e.val(),n.nBracket,n.oEvent)))})}})},destroy:function(){return n(this).each(function(){var t=n(this);t.off(".autoNumeric");t.removeData("autoNumeric")})},update:function(t){return n(this).each(function(){var f=r(n(this)),u=f.data("autoNumeric"),e;return typeof u!="object"?(n.error("You must initialize autoNumeric('init', {options}) prior to calling the 'update' method"),this):(e=f.autoNumeric("get"),u=n.extend(u,t),i(f,u,!0),u.aDec===u.aSep)?(n.error("autoNumeric will not function properly when the decimal character aDec: '"+u.aDec+"' and thousand separator aSep: '"+u.aSep+"' are the same character"),this):(f.data("autoNumeric",u),f.val()!==""||f.text()!=="")?f.autoNumeric("set",e):void 0})},set:function(i){if(i!==null)return n(this).each(function(){var o=r(n(this)),e=o.data("autoNumeric"),u=i.toString(),s=i.toString();return typeof e!="object"?(n.error("You must initialize autoNumeric('init', {options}) prior to calling the 'set' method"),this):(s!==o.attr("value")&&o.prop("tagName").toLowerCase()==="input"&&e.runOnce===!1&&(u=e.nBracket!==null?f(o.val(),e.nBracket,"pageLoad"):u,u=t(u,e)),(s===o.attr("value")||s===o.text())&&e.runOnce===!1&&(u=u.replace(",",".")),!n.isNumeric(+u))?"":(u=p(u,e),e.oEvent="set",u.toString(),u!==""&&(u=l(u,e)),u=w(u,e.aDec,e.aNeg),h(u,e)||(u=l("",e)),u=c(u,e),o.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])"))?o.val(u):n.inArray(o.prop("tagName").toLowerCase(),e.tagList)!==-1?o.text(u):(n.error("The <"+o.prop("tagName").toLowerCase()+"> is not supported by autoNumeric()"),!1)})},get:function(){var e=r(n(this)),i=e.data("autoNumeric"),u;if(typeof i!="object")return n.error("You must initialize autoNumeric('init', {options}) prior to calling the 'get' method"),this;if(i.oEvent="get",u="",e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])"))u=e.eq(0).val();else if(n.inArray(e.prop("tagName").toLowerCase(),i.tagList)!==-1)u=e.eq(0).text();else return n.error("The <"+e.prop("tagName").toLowerCase()+"> is not supported by autoNumeric()"),!1;return u===""&&i.wEmpty==="empty"||u===i.aSign&&(i.wEmpty==="sign"||i.wEmpty==="empty")?"":(i.nBracket!==null&&u!==""&&(u=f(u,i.nBracket,i.oEvent)),(i.runOnce||i.aForm===!1)&&(u=t(u,i)),u=s(u,i.aDec,i.aNeg),+u==0&&i.lZero!=="keep"&&(u="0"),i.lZero==="keep")?u:p(u,i)},getString:function(){var f=!1,e=r(n(this)),o=e.serialize(),i=o.split("&"),h=n("form").index(e),t=0;for(t;t<i.length;t+=1){var u=i[t].split("="),s=n("form:eq("+h+') input[name="'+decodeURIComponent(u[0])+'"]'),c=s.data("autoNumeric");typeof c=="object"&&u[1]!==null&&(u[1]=s.autoNumeric("get"),i[t]=u.join("="),f=!0)}return f===!0?i.join("&"):o},getArray:function(){var t=!1,i=r(n(this)),u=i.serializeArray(),f=n("form").index(i);return(n.each(u,function(i,r){var u=n("form:eq("+f+') input[name="'+decodeURIComponent(r.name)+'"]'),e=u.data("autoNumeric");typeof e=="object"&&(r.value!==""&&(r.value=u.autoNumeric("get").toString()),t=!0)}),t===!0)?u:this},getSettings:function(){var t=r(n(this));return t.eq(0).data("autoNumeric")}};n.fn.autoNumeric=function(t){if(a[t])return a[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return a.init.apply(this,arguments);n.error('Method "'+t+'" is not supported by autoNumeric()')}}(jQuery),function(n){function r(){!n(".no-results").length&&window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.MOBILE_BREAKPOINT?window.aa.helpers.cache.cachedElements.$main.css({paddingBottom:window.aa.helpers.cache.cachedElements.$footer.height()}):window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&window.aa.helpers.cache.cachedElements.$main.css({paddingBottom:0})}function b(){function e(){i.height(t.find(".table").innerHeight());i.width(u.innerWidth())}function c(){var n=t.find(".tag, .popular-bottom").not(".offer");n.css({width:n.parent(".popular").innerWidth()+4})}function o(){var u=n(this),f=r.find(".table");t.parent(".wrapper").addClass("comparison-table");u.css({height:f.innerHeight(),top:f.css("margin-top"),right:r.css("margin-right")});r.innerWidth()<r.get(0).scrollWidth?r.addClass("scrolling"):r.removeClass("scrolling");r.on("scroll",function(){var t=n(this),r=t.scrollLeft(),e=t.get(0).scrollWidth-t.parent().width(),f=i.add(i.find(".description").children());r>0?f.addClass("active"):f.removeClass("active");r>=e?u.hide():u.show()})}function s(){var t=i.find(".description > div"),f=i.find(".recommended-product-label, .tag"),e=[];f.length&&f.closest(".description").addClass("popular");t.height("");u.each(function(){e.push(n(this).outerHeight())});t.each(function(t){n(this).css("height",e[t])});i.css({left:r.css("margin-left")});c()}function h(r){var f=r.parent("div"),u=r.find(".information-inner"),o=r.siblings(".more-information"),e=0;if(f.prevAll().each(function(){e+=n(this).outerWidth()}),r.css({left:-e,width:t.find(".information-table").innerWidth()}),client.IE&&r.css({top:f.innerHeight()}),window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.TABLET_LANDSCAPE){u.width(window.aa.helpers.cache.cachedElements.$window.width()-30);t.find(".wrapper").on("scroll",function(){var f=n(this).scrollLeft(),e=t.find(".table-inner-shadow"),s=i.children("div");f>0?(r.hasClass("open")&&o.trigger("click"),u.css({left:f}),e.hide(),i.add(s).addClass("active")):(u.css({left:0}),e.show(),i.add(s).removeClass("active"))})}}function l(n){var i=n.parent("div"),t=n.siblings(".more-information");t.click(function(r){var u=i.siblings("div");r.preventDefault();u.length&&u.children(".information").removeClass("open").stop().slideUp(300);n.toggleClass("open").stop().slideToggle(300,function(){n.hasClass("open")?(t.addClass("active"),u.children(".more-information").removeClass("active")):t.removeClass("active")})})}var t=n(this).not(".filter-table"),r=t.find(".wrapper"),u=t.find(".description"),i=t.find(".fixed-column"),f;i.each(function(){u.clone().wrapInner("<div />").appendTo(this)});e();s();t.find(".information").each(function(){h(n(this));l(n(this))});t.find(".table-inner-shadow").each(o);window.aa.helpers.cache.cachedElements.$window.on("resize",function(){clearTimeout(f);f=setTimeout(function(){t.find(".information").each(function(){h(n(this))});e();s();t.find(".table-inner-shadow").each(o)})})}function k(){function h(){window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.TABLET_BREAKPOINT||r.parents("#search-takeover").length?r.val(""):r.val("Search");t.val()!==""&&r.attr("disabled",!1).parent().removeClass("disabled")}function o(){var n=i.find(".focus"),r=n.length?n.data("result"):t.val();t.val(r);s.trigger("submit");window.aa.helpers.cache.registerCookie.erase("SearchResultsPageOne")}function c(){n(this).stop().fadeOut(200);t.val("");r.attr("disabled",!0).parent().addClass("disabled")}var u=n(this),i=u.find(".results-container"),t=u.find('input[type="text"]'),r=u.find('input[type="submit"]'),l=u.find('input[type="hidden"]'),f=u.find(".button"),s=t.closest(u),e=u.find(".close");f.on({keypress:function(n){(n.keyCode===13||n.which===13)&&s.trigger("submit")}});t.on({keyup:function(){e.stop().fadeIn();r.attr("disabled",!1);f.removeClass("disabled")},blur:function(){t.val()?(e.show(),r.attr("disabled",!1),f.removeClass("disabled")):(r.attr("disabled",!0),f.addClass("disabled"),e.fadeOut())},keypress:function(n){n.keyCode===13&&o()},paste:function(n){return n.which===8?!0:/^[a-zA-Z0-9-',. ]*$/.test(n.originalEvent.clipboardData.getData("text"))}});e.on({click:c,keypress:function(n){(n.keyCode===13||n.which===13)&&c()}});window.aa.helpers.cache.cachedElements.$window.on("resize",function(){h()});h();i.length&&window.aa.helpers.autoComplete({$input:t,$loadingElem:t,$resultsContainer:i,characterCount:l.val(),url:"/cms/ajax/api/autocomplete/getautocompleteresults/{value}",onSuccess:function(r){var u=r.Results,e="",f;if(u!=="null"&&u.length){for(e+='<ul><span class="separator"><\/span>',f=0;f<u.length;f+=1)e+='<li data-result="'+u[f].Suggestion+'">'+u[f].Suggestion.replace(r.SearchText,"<b>$&<\/b>")+"<\/li>";e+="<\/ul>";i[0].innerHTML=e;i.find("li").on("click",function(){n(this).addClass("focus");o()});window.aa.helpers.showResults(i,t)}else window.aa.helpers.hideResults(i,t)},onEnter:function(){i[0].innerHTML!==""&&o()}})}function d(){function l(){var t=f.children(".wrapper");u.pg=2;n.ajax({url:"cms/ajax/fragment/search/searchresultarticles",data:u,type:"GET",dataType:"text"}).done(function(n){e.length>=i&&(s=!0,t.append(n),o.addClass("hidden"))}).fail(function(){s=!0;t.find("#search-no-results").removeClass("hidden")})}function a(){var t=f.parent("#search-results"),n=t.find("#alternative-results-option");!f.find(".result").length&&window.aa.helpers.cache.cachedElements.$body.height()<window.aa.helpers.cache.cachedElements.$window.height()&&n.css({height:n.innerHeight()+window.aa.helpers.cache.cachedElements.$window.height()-window.aa.helpers.cache.cachedElements.$body.height()})}var f=n("#search-results-listing"),o=f.find("#search-loading"),e=f.find(".result"),v=n("#results-pagination"),y=v.find("h5.button"),c=window.location.search,u={q:"",pg:"1"},s=!1,h;c!==""&&(h=serialise.url(c),u.q=h.q,u.pg=h.pg||"1");e.length<i&&o.addClass("hidden");e.length||window.aa.helpers.cache.cachedElements.$html.addClass("no-results");y.on("click",function(){var t=n(this).hasClass("left");u.pg==="3"?t?u.pg=1:u.pg++:t?u.pg--:u.pg++;window.aa.helpers.cache.registerCookie.write("SearchResultsPageOne",!0);window.location.search=serialise.obj(u)});if(u.pg==="1"){window.aa.helpers.cache.cachedElements.$window.on("scroll",function(){window.aa.helpers.cache.cachedElements.$window.scrollTop()===window.aa.helpers.cache.cachedElements.$document.height()-window.aa.helpers.cache.cachedElements.$window.height()&&s===!1&&e.length>=i&&l()});window.aa.helpers.cache.registerCookie.check("SearchResultsPageOne")&&l()}else o.addClass("hidden");a();window.aa.helpers.cache.cachedElements.$window.on({resize:function(){clearTimeout(t);t=setTimeout(function(){a();n("#site-footer").length&&r()},100)}})}function s(){var t=n(this).not(".journey-products"),i=t.closest(".two-column"),r=t.find("h2.alt"),u=t.find(".beam");window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.TABLET_BREAKPOINT?u.css("background-position",""+(r.width()+52)+"px -70px"):window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&u.css("background-position",""+(r.width()+35)/10+"rem -3.8rem");t.find(".popular").length||t.addClass("not-popular");i.find(".not-popular").length>1&&i.addClass("none-recommended")}function g(){if(client.IE9&&!window.aa.helpers.cache.cachedElements.isExperienceEditor){var i=n(this),u=i.filter(".one"),f=i.filter(".two"),e=i.filter(".three"),o=i.filter(".four"),r={opacity:"1"},t=300;u.delay(1200).animate(r,t);f.delay(1400).animate(r,t);e.delay(1600).animate(r,t);o.delay(1800).animate(r,t);i.delay(t).animate(r,t)}}function nt(){window.onYouTubePlayerAPIReady=function(){window.youTubePlayers={};n(".youtube-video").each(function(t){var i=n(this),r=i.find(".video-container").children("div");r.prop("id",r.prop("id")+t);tt(i)})}}function tt(t){function e(){i.find(".play-media").show().css("z-index","1");i.find(".play-media").on("click",function(){window.youTubePlayers[r].playVideo()})}function f(n){n.data===0?client.Mobile||t.is(".hero-video")||i.removeClass("enlarged"):n.data==YT.PlayerState.PLAYING&&(client.Mobile||t.is(".hero-video")||i.addClass("enlarged"),u.animate({opacity:1},800),i.find(".play-media").hide())}var i=t,u=i.find(".video-container"),r=i.data("videoid");n(".play-media").on("click",function(){});window.youTubePlayers[r]=new YT.Player(u.children("div").prop("id"),{height:"390",width:"640",videoId:r,events:{onReady:e,onStateChange:f,onClick:f}});n("#youtube-lightbox").length&&window.aa.helpers.youtubeLightbox()}function h(){var t=n(this),u=window.aa.helpers.cache.cachedElements.$body.find(".cinemagraph-container"),r=u.find(".desktop-tablet-view, .mobile-view"),i=t.data("src");r.addClass("visible");client.Mobile||client.OldIE||window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.TABLET_LANDSCAPE||!i.length?t.empty().hide():i.length&&(r.removeClass("visible"),t.html('<video autoplay loop><source src="'+i+'" type="video/mp4" /><\/video>').show())}function it(){window.utag_cfg_ovrd&&window.utag_cfg_ovrd.noview&&(window.utag?utag.view(window.utag_data):window.utag_cfg_ovrd.noview=!1)}function rt(){var t=n("#search-results"),i;t.length&&(i=t.find("#results-currentPage").text().trim(),i==="1"&&(utag_data.search_keyword=t.find("#alternative-results-option span").text(),utag_data.search_results=t.find("#results-count").text()));it()}function ut(){n(this).iFrameResize({heightCalculationMethod:client.IE?"max":"lowestElement"})}function c(){function r(){t.each(function(){i.push(n(this).height())});t.height(Math.max.apply(null,i))}var t=n(this).find(".module-content"),i=[];t.css("height","");window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.TABLET_BREAKPOINT?r():window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&(t.closest(".tweet-half-width").length||t.parent(".multi-product").length||t.closest(".related-results").length)&&r()}function ft(){function i(){$BV.configure("global",{productId:t.data("product-id")});$BV.ui("rr","show_reviews",{doShowContent:function(){}})}var t=n("#BVRRContainer");typeof $BV!="undefined"?i():n.ajax({url:t.data("bv-url"),cache:!0,dataType:"script",success:function(){n($BV.docReady);i()}})}function et(){function u(){var n=i.outerHeight();window.aa.helpers.cache.cachedElements.$body.css({paddingBottom:n})}function f(){setTimeout(function(){u()},2400);i.removeClass("slide-out-down").addClass("slide-in-up");client.IE9&&i.delay(240).animate({bottom:"0"},2400)}function e(){window.aa.helpers.cache.cachedElements.$body.css({paddingBottom:0});setTimeout(function(){i.removeClass("slide-in-up")},2400);i.addClass("slide-out-down");client.IE9&&i.animate({bottom:"-100%"},2400)}var i=n("#emergency-alert"),r=i.data("message-id");if(window.aa.helpers.cache.registerCookie.check("EmergencyAlert")?n.inArray(r,window.aa.helpers.cache.registerCookie.check("EmergencyAlert").split(","))===-1&&f():f(),!window.aa.helpers.cache.cachedElements.isExperienceEditor)i.find(".close").on("click",function(){var t=window.aa.helpers.cache.registerCookie.check("EmergencyAlert");t=t?t.split(","):[];n.inArray(r,t)===-1&&t.push(r);window.aa.helpers.cache.registerCookie.write("EmergencyAlert",t.join(","),14);e()});if(window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT)i.find("h6").on("click",function(){n(this).toggleClass("active");u()});window.aa.helpers.cache.cachedElements.$window.on("resize",function(){clearTimeout(t);t=setTimeout(function(){i.hasClass("slide-in-up")&&u()},100)})}function l(){var t=n(this),i=t.data("mobile");window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&typeof i!="undefined"&&t.css({"background-image":'url("'+i+'")'})}function u(){function f(){var n=t.find(".inner").innerHeight(),i=n==null?"":n;t.css({minHeight:i});t.find(".text").css({minHeight:i})}var t=n(this),i=t.parent(".col"),e=t.closest(".two-column"),r=i.siblings(".col"),o=r.find(".youtube-video"),u;t.css({minHeight:""});t.find(".text").css({minHeight:""});window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&!window.aa.helpers.cache.cachedElements.isExperienceEditor?i.length?(u=window.aa.helpers.getTallestHeightHelper(e.find(".inner").add(o)),t.css({minHeight:u}),t.find(".text").css({minHeight:r.find(".text").innerHeight()})):f():window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&!window.aa.helpers.cache.cachedElements.isExperienceEditor&&f()}function a(){n(this).closest(".row").addClass("hero-row")}function ot(){var i=n(this),t=i.parents(".row");t.prev(".row").find(".hero-image").length&&t.addClass("hero-service")}function v(){var t=n(this),r=t.find("img.responsive-image"),i=t.find(".text-overlay");r.length&&i.length&&t.css({height:t.find(".desktop-tablet-view").is(":visible")?r.get(0).naturalHeight:t.find(".mobile-view").find("img").get(0).naturalHeight+parseFloat(i.css("top"))+parseFloat(i.find("h2 + h2").find("span").css("margin-top"))+i.find(".button").innerHeight()})}function st(){n(this).not(".filter").closest(".wrapper").addClass("contact-wrapper")}function ht(){var i=n(this),t=i.closest(".wrapper");i.closest(".two-column").length||t.addClass("rich-text-wrapper");n(".rich-text-wrapper").find(".accordion").length&&t.removeClass("rich-text-wrapper");n(".rich-text-wrapper").find(".SchemaText").length&&(t.removeClass("rich-text-wrapper"),n(".SchemaText").hide())}function ct(){var i=n(this),t=i.find(".more, .less"),r=i.find("li:gt(8)");if(window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT){r.hide();i.find("li").length>9?t.not(".hidden").show():t.hide();t.on("click",function(n){n.preventDefault();t.toggleClass("hidden");r.stop().fadeToggle(300)})}}function lt(){var r=window.location.hash;try{var t=n(r.replace(/\//g,"")),i=t.closest(".accordion-item"),u=i.find(".accordion-header").outerHeight();function f(){window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).stop().animate({scrollTop:t.offset().top-e/2-u},750)}r&&t.length&&(i.length?i.hasClass("active")?f():(i.find(".accordion-header").trigger("click"),clearTimeout(o),o=setTimeout(function(){f()},250)):window.aa.helpers.cache.cachedElements.$html.add(window.aa.helpers.cache.cachedElements.$body).stop().animate({scrollTop:t.offset().top-e/1.5},750))}catch(f){console.log(f.message)}}function at(){function f(){var t=n(this);u.add(r.find(".tab-arrow")).hide();r.removeClass("current");n("#"+t.data("tab-id")).fadeIn(150,function(){t.addClass("current")});e.each(toolkit.equalHeight)}function o(){var i=r.eq(0),u=window.location.hash,t,e;if(u.length){e=u.split("#")[1];t=n('[data-nav-id="'+e+'"]');t.length?t.each(f):i.each(f);return}i.each(f)}var i=n(this),u=i.find(".product-tab"),e=i.find(".product-selector-tabs").find(".wrapper"),r=i.find(".product-tab-cta");if(u.each(function(){var t=n(this),i=t.find(".tab-col");t.hasClass("mid-grey-bg-color")?n('[data-tab-id="'+t.attr("id")+'"]').addClass("grey-arrow"):(t.addClass("white-bg-color"),n('[data-tab-id="'+t.attr("id")+'"]').addClass("white-arrow"));i.length===1&&i.addClass("single-item")}),r.length){u.addClass("inner-shadow-light");switch(r.length){case 1:i.addClass("single-cta-grid");break;case 2:i.addClass("two-cta-grid");break;case 3:i.addClass("three-cta-grid");break;case 4:i.addClass("four-cta-grid")}o()}(i.find(".product-selector-tabs").length===0||i.find(".product-tab-cta").length===0)&&(u.addClass("tab-visible alternate-styles"),u.length>1&&u.each(function(t){var i=n(this),r=i.find(".image-area"),u=i.find(".description-area");i.addClass("mid-grey-bg-color");t%2==0&&(i.removeClass("mid-grey-bg-color").addClass("white-bg-color"),r.length&&u.length&&r.detach().insertBefore(u))}));e.each(toolkit.equalHeight);toolkit.resizeTimer.push(function(){e.each(toolkit.equalHeight)});r.off("click",f).on("click",f);window.aa.helpers.cache.cachedElements.$window.on("orientationchange",function(){clearTimeout(t);t=setTimeout(function(){r.css({height:""});e.each(toolkit.equalHeight)},200)})}function vt(){var t=n(this),i=t.find(".apr-description"),r=t.find(".rate");i.length&&r.length===0||i.length===0&&r.length?t.addClass("single-rate-separator"):i.length===0&&r.length===0&&t.addClass("rate-separator-hidden");t.find(".feature-list").each(function(){var t=n(this),i=t.find("li");i.length&&i.length<3?t.addClass("two-col-group"):i.length===0&&t.closest(".feature-list-group").hide()})}function f(){function r(){t.each(function(){i.push(n(this).height())});t.height(Math.max.apply(null,i))}var t=n(this).find(".cover-level-table-col >.cover-level-table-content"),i=[];t.css("height","");window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.TABLET_LANDSCAPE?r():window.aa.helpers.cache.cachedElements.$window.width()>window.aa.helpers.cache.constants.TABLET_LANDSCAPE&&t.closest(".cover-level-table-wrap").length&&r()}var w=n("#site-header, #sales-journey-header"),e=w.outerHeight(),t,o,i=15,y,p;boot.config.local="/Assets/scripts/libs/codehouse-js/";boot.config.libs="/Assets/scripts/libs/";boot.config.global="/Assets/scripts/";client.domApply();n(".mid-grey-my-account-item").parent().addClass("mid-grey-my-account-item");window.aa.helpers.cache.cachedElements.$document.ready(function(){window.aa.helpers.cache.cachedElements.$html.removeClass("no-js");var t=new Responsive;n(".accordion").each(window.aa.helpers.accordions);n(".search").each(k);n("#results-pagination").length&&d();n("#site-footer").length&&r();n(".equal-height").each(window.aa.helpers.panelHeight);n(".module.youtube-video, .related-product, .app-promo, .campaign-promo, .contact-content, .related-links, .two-column .exchange-tool, .est-related-links").each(u);n(".fade-in").each(g);n(".product-detail").each(s);n(".youtube-video").length&&boot.loadScript("https://www.youtube.com/iframe_api","cdn",function(){nt()});typeof utag_data!="undefined"&&rt();n("#BVRRContainer").length&&ft();n(".iframe-container").length&&boot.loadScript("iframeResizer.min.js","libs",function(){n(".iframe").each(ut)});n("#emergency-alert").length&&et();n("#weather").length&&boot.loadScript("weather.js","global",function(){});n("#site-wrapper").length&&lt();n(".cinemagraph").each(h);n(".module").each(l);n(".hero-image").each(a);n(".ch-hero-image").each(a);n(".service").each(ot);n(".contact-content").each(st);n(".rich-text").each(ht);n(".module-accordion").each(window.aa.helpers.moduleAccordion);n(".related-links").each(ct);n(".financial-services-product-selector").each(at);n(".loan-product-detail").each(vt);n("#sales-journey-header").length&&typeof window.aa.salesJourneyApp!="undefined"&&window.aa.salesJourneyApp.application.init();n(".calculator-tool").length&&(boot.loadScript("tools.js","global",function(){}),window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT&&n(".calculator-tool").find(".calculation-result").removeClass("table"));stylishForms.apply()});window.aa.helpers.cache.cachedElements.$window.on({resize:function(){clearTimeout(t);t=setTimeout(function(){n(".equal-height").each(window.aa.helpers.panelHeight);n(".related-content, .content-article, .multi-product-container, .twitter-container").each(c);n(".module.youtube-video, .related-product, .app-promo, .campaign-promo, .contact-content, .related-links, .two-column .exchange-tool, .est-related-links").each(u);n(".module").each(l);n(".product-detail").each(s);n(".hero-image.member-benefits").each(v);n("#site-footer").length&&r();n(".cinemagraph").each(h);window.aa.helpers.cache.cachedElements.$window.width()<=window.aa.helpers.cache.constants.MOBILE_BREAKPOINT?n(".calculator-tool").find(".calculation-result").removeClass("table"):n(".calculator-tool").find(".calculation-result").addClass("table")},100)},load:function(){n(".module.youtube-video, .related-product, .app-promo, .campaign-promo, .contact-content, .related-links").each(u);n(".product-comparison, .table-component").each(b);n("#search-icon").on("click",function(){n("#search-takeover").find("input").first().focus()});n(".hero-image.member-benefits").each(v);n(".related-content, .content-article, .multi-product-container, .twitter-container, .related-results").each(c)}});window.aa.helpers.cache.cachedElements.$document.ready(function(){n(document).find(".desktop-btn-view .filter-link,.filter-close-btn .close-link").on("click",function(t){t.preventDefault();n(".offers-sidebar .offer-filter").slideToggle()});n("#offersModal").on("show.bs.modal",function(t){var i=n(t.relatedTarget).data("reward-id");n(t.currentTarget).find("#offer-url").attr("src",i)})});n(window).on("load",function(){n("#codeNotAvailableModal").modal("show")});n(document).ready(function(){n("#codeNotAvailableModal").on("hidden.bs.modal",function(){window.location=n("#codeNotAvailableModal").find(".modal-header").find("a").attr("href");n(this).parents(".row-with-sidebar").css("z-index","1");window.location="/member-benefits/all"});n("#codeNotAvailableModal").on("shown.bs.modal",function(){n(this).parents(".row-with-sidebar").css("z-index","inherit")})});n(".report-breakdown").click(function(){n(this).fadeOut(300);n(".modal-backdrop.fade.in").addClass("dark");n("#brokenDownModal").modal({backdrop:"static",keyboard:!1})});n("#brokenDownModal").on("shown.bs.modal",function(){});n("#brokenDownModal").on("hidden.bs.modal",function(){n(".report-breakdown").fadeIn(300)});y=n(".best-bundle-table");p=y.find(".best-bundle-content-item-head-title");n(p).on("click",function(t){t.preventDefault();n(this).parent().next(".best-bundle-content-item-description").slideToggle();n(this).parent().parent(".best-bundle-content-item").toggleClass("best-bundle-closed");n(this).parent().parent().siblings().find(".best-bundle-content-item-description").is(":visible")?n(this).parent().parent().siblings().find(".best-bundle-content-item-description").slideUp().parent(".best-bundle-content-item").addClass("best-bundle-closed"):n(this).parent().parent().parent().parent().siblings().find(".best-bundle-content-item-description").is(":visible")&&n(this).parent().parent().parent().parent().siblings().find(".best-bundle-content-item-description").slideUp().parent(".best-bundle-content-item").addClass("best-bundle-closed")});window.aa.helpers.cache.cachedElements.$window.on({resize:function(){n(".cover-level-table").length&&n(".cover-level-table-wrap").each(f)},load:function(){n(".cover-level-table").length&&n(".cover-level-table-wrap").each(f)}});n(".tab-content:first").show();n(".product-type-tabs a").click(function(t){t.preventDefault();n(".tab-content").hide();n(this).addClass("active");n(this).parent().siblings().find("a").removeClass("active");n("#"+n(this).attr("title")).show();n(".cover-level-table").length&&n(".cover-level-table-wrap").each(f)});n(".flex-product-block").each(function(){n(this).find(".product-image").length&&n(this).find(".product-brief").addClass("five-col-width")});n(".flex-product-block").length&&n(".flex-product-block > .product-brief").find(".prod-cta-links:empty")&&n(".prod-cta-links").remove()}(jQ);
//# sourceMappingURL=/Assets/essential-script-bundlemap
