"use strict";function toggleModal(){$("#scrim").fadeToggle(),"none"==$(".modal_container").css("display")?($(".modal_container").fadeIn().css("display","flex"),$("html").addClass("no-scroll"),$("body").addClass("no-scroll")):($(".modal_container").fadeOut(),$("html").removeClass("no-scroll"),$("body").removeClass("no-scroll")),$("html").hasClass("no-scroll")?($(this).css("overflow","hidden"),$("body").css("overflow","hidden")):($(this).css("overflow","initial"),$("body").css("overflow","initial"))}$(function(){$('a[href^="#"]').bind("click.smoothscroll",function(e){e.preventDefault();var a=this.hash,t=$(a);$("html, body").stop().animate({scrollTop:t.offset().top},900,"swing",function(){window.location.hash=a})}),$("[name=propertyValue]").maskMoney({prefix:"£",precision:0,allowNegative:!1}),$(".not-sure button").click(function(){$(this).fadeOut(),$(".details").slideDown()}),$(".retrieve-estimated-value").click(function(){$(".calculate .loading").css("height","0"),$(".calculate .loading").css("width","0"),$(".property_info .loading").css("transform","scale(1)"),axios.post("/retrieve-property-value",{postcode:$("[name=postcode]").val(),bedroomCount:$("[name=bedroomCount]").val(),propertyType:$("[name=propertyType]").val()}).then(function(e){$(".details").slideUp(),$("[name=propertyValue]").maskMoney("mask",e.data.data.average)})}),$("#guide-form").submit(function(e){e.preventDefault(),$(this).find("button[type=submit]").prop("disabled",!0);var a=this,t=$("[name=propertyValue]").val().replace(/\D/g,"");$("[name=propertyValue]").maskMoney("destroy"),$("[name=propertyValue]").val(t),this.submit()})}),axios.interceptors.request.use(function(e){$(".loading").fadeIn().css("display","inline-block"),setTimeout(function(){$(".result_loading").fadeIn()},400);var a=window.localStorage.token;return a&&(e.headers.Authorization="token ".concat(a)),e},function(e){return Promise.reject(e)}),axios.interceptors.response.use(function(e){return $(".result_loading").fadeOut(),$(".loading").fadeOut(),e},function(e){return Promise.reject(e)}),$(function(){$("[name=property_value]").maskMoney({prefix:"£",precision:0,allowNegative:!1}),$("input").change(function(){$(this).parent().removeClass("error"),$(this).parent().children(".message").remove(),$(this).parent().children("br").remove()}),$(".property_value button").click(function(){$(this).fadeOut(),$(".property_info .property_info").slideDown()}),$(".retrieve_estimated_value").click(function(){axios.post("/retrieve-property-value",{postcode:$("[name=address]").val(),bedroom_count:$("[name=bedroom_count]").val(),property_type:$("[name=property_type]").val()}).then(function(e){$("[name=property_value]").maskMoney("mask",e.data.data.average)})}),$(".calculate_button button").click(function(){var e=[];e.propertyValue=$("[name=propertyValue]").val().replace(/\D/g,""),e.postcode=$("[name=postcode]").val(),e.firstName=$("[name=firstName]").val(),e.lastName=$("[name=lastName]").val(),e.age=$("[name=age]").val(),e.contactNumber=$("[name=contactNumber]").val(),e.emailAddress=$("[name=emailAddress]").val(),$(".result").fadeOut(),axios.post("/retrieve-calculation",{property_value:e.property_value,address:e.address,full_name:e.full_name,date_of_birth:e.date_of_birth,contact_number:e.contact_number,email_address:e.email_address}).then(function(e){setTimeout(function(){$(".calculate_button button").html("Recalculate"),$("#calculate .value").html(e.data.maximumLoanAmount).simpleMoneyFormat(),$("#calculate .value").prepend("£"),$(".result").fadeIn()},400)}).catch(function(e){$("span .message").remove(),$(".loading").css("display","none"),_.forEach(e.response.data.errors,function(e,a){$("[name="+a+"]").parent().append(''+e+"")})})})}); //# sourceMappingURL=themeA.min.js.map