jquery(function(a){function b(a,b){this.sitekey=a,this.element=b,this.captchaobj=null}function c(b,c,d){a('input[type="hidden"]',b).last().validationengine("showprompt",c,d,"inline")}var d={render:function(){},getresponse:function(){return!0},reset:function(){}};b.prototype.render=function(){var a=this;grecaptcha.ready(function(){a.captchaobj=grecaptcha.render(a.element,{sitekey:a.sitekey})})},b.prototype.getresponse=function(){return grecaptcha.getresponse(this.captchaobj)},b.prototype.reset=function(){grecaptcha.reset(this.captchaobj)},a.fn.dtinitcontactform=function(){return this.each(function(){var e=a(this),f="";f=e.hasclass("privacy-form")?'
":"";var g=d;dtlocal.captchasitekey&&(g=new b(dtlocal.captchasitekey,e.find(".the7-g-captcha")[0])),g.render(),e.validationengine({binded:!1,promptposition:"inline",scroll:!1,autohideprompt:!1,maxerrorsperfield:1,custom_error_messages:{required:{message:dtlocal.contactmessages.required+f}},fadeduration:500,addpromptclass:"run-animation",onajaxformcomplete:function(){},addsuccesscssclasstofield:"field-success",onbeforeajaxformvalidation:function(b,c){var d=a(b);d.find(".formerror").removeclass("first"),d.find("input").removeclass("error-field"),d.find("textarea").removeclass("error-field")},onfailure:function(b,c){var d=a(b);d.find(".formerror .close-message").length<=0&&d.find(".formerror").append('')},onvalidationcomplete:function(b,d){var e=a(b);if(e.find(".greenpopup").length>0&&e.find(".greenpopup").remove(),e.find(".formerror").removeclass("first"),e.find("input").removeclass("error-field"),e.find("textarea").removeclass("error-field"),e.find(".formerror").each(function(b,c){a(c).eq(b).addclass("first"),a(c).prev().addclass("error-field")}),a(".formerror .close-message").remove(),e.find(".formerror .close-message").length<=0&&e.find(".formerror").append(''),e.find("input.the7-form-terms").hasclass("field-success")&&e.find(".dt-privacy-message").addclass("hide-privacy-message"),d){var f=g.getresponse();if(!f)return void c(e,dtlocal.contactmessages.fillthecaptchaerror,"error");var h={widget_id:a('input[name="widget_id"]',e).val(),send_message:a('input[name="send_message"]',e).val(),security_token:a('input[name="security_token"]',e).val(),gcaptcha_token:f,fields:{}};e.find('input[type="text"], textarea').each(function(){var b=a(this);h.fields[b.attr("name")]=b.val()}),a.post(dtlocal.rest.baseurl+dtlocal.rest.endpoints.sendmail,h,function(d){var f,h=a(b),i=d.success?"pass":"error";c(h,d.errors,i),e.find(".formerror").addclass("field-success"),h.validationengine("showprompt","","","topright"),g.reset(),d.success&&(h.find('input[type="text"], textarea').val(""),h.find('input[type="checkbox"]').removeprop("checked"),e.find(".formerror .close-message").length<=0&&(e.find(".formerror").append(''),e.find(".formerror .close-message").on("click",function(){e.find(".greenpopup").remove(),cleartimeout(f)})),cleartimeout(f),f=settimeout(function(){e.find(".greenpopup").remove()},11e3))})}}}),e.find(".dt-btn.dt-btn-submit").on("click",function(b){b.preventdefault();var c=a(this).parents("form");c.submit()}),e.find(".clear-form").on("click",function(b){b.preventdefault();var c=a(this).parents("form");c.length>0&&(c.find('input[type="text"], textarea').val(""),c.validationengine("hide"))})})},a("form.dt-contact-form.dt-form").dtinitcontactform()});