$((function(){"use strict";window.Theme=window.Theme||{},window.Theme.isRtl=function(){return"rtl"===document.body.getAttribute("dir")},$(document).on("submit",".newsletter-form",(function(e){e.preventDefault(),e.stopPropagation();var t=$(e.target),o=t.find('button[type="submit"]');$.ajax({type:"POST",cache:!1,url:t.closest("form").prop("action"),data:new FormData(t.closest("form")[0]),contentType:!1,processData:!1,beforeSend:function(){o.addClass("button-loading"),o.attr("disable")},success:function(e){e.error?Theme.handleError(e.message):(t.closest("form").find("input[type=email]").val(""),Theme.showSuccess(e.message))},error:function(e){Theme.handleError(e)},complete:function(){"undefined"!=typeof refreshRecaptcha&&refreshRecaptcha(),o.removeClass("button-loading"),o.removeAttr("disable")}})})),$(document).on("submit",".cons-contact-form",(function(e){var t=this;e.preventDefault(),e.stopPropagation();var o=$(this).find('button[type="submit"]');$.ajax({type:"POST",cache:!1,url:$(this).closest("form").prop("action"),data:new FormData($(this).closest("form")[0]),contentType:!1,processData:!1,beforeSend:function(){o.addClass("button-loading"),o.prop("disabled",!0)},success:function(e){var o=e.error,n=e.message;o?Theme.showError(n):($(t).closest("form").find("input[type=text]").val(""),$(t).closest("form").find("input[type=email]").val(""),$(t).closest("form").find("textarea").val(""),Theme.showSuccess(n))},error:function(e){Theme.handleError(e)},complete:function(){"undefined"!=typeof refreshRecaptcha&&refreshRecaptcha(),o.removeClass("button-loading"),o.prop("disabled",!1)}})})),$(document).on("submit","#request-quote-form",(function(e){e.preventDefault();var t=$(this),o=$(this).find('button[type="submit"]');$.ajax({url:t.prop("action"),method:"POST",data:t.serialize(),beforeSend:function(){o.addClass("button-loading")},success:function(e){var o=e.error,n=e.message;o?Theme.showError(n):(Theme.showSuccess(n),t.find('input[type="text"], input[type="number"], input[type="email"], select, textarea').val(""))},error:function(e){Theme.handleError(e)},complete:function(){o.removeClass("button-loading")}})}))}));