if(void 0===$)var $=jQuery;$(window).on("load",function(){wpPath?dmmCaptcha.init(wpPath):console.error("ERROR: Variable wpPath has not been properly defined.")});var addAriaToGoogleCaptcha=function(){setTimeout(function(){$(".g-recaptcha-response").each(function(){$(this).attr("aria-hidden","true"),$(this).attr("aria-label","do not use"),$(this).attr("aria-readonly","true")})},1e3)},dmmCaptcha=function(){var recaptchaObject="grecaptcha",dmmRecaptcha=".dmm-recaptcha",$errorClass=$(".recaptcha-message"),recaptchaWidgets=[],adminPath,translatedMessages,translateCaptchaMessages=function(){$.ajax({url:adminPath+"/admin-ajax.php",data:{action:"translate_captcha_error"},async:!0,success:function(a){translatedMessages=$.parseJSON(a)},error:function(a){console.log(a)}})},getCaptchaObject=function(){return eval(recaptchaObject)},renderCaptcha=function(){var a=getCaptchaObject();0<$(dmmRecaptcha).length&&($(dmmRecaptcha).each(function(){$(this).find("iframe").length||(recaptchaWidgets[$(this).attr("id")]=a.render($(this).attr("id"),{sitekey:$(this).attr("data-sitekey")}))}),$errorClass.each(function(){$(this).mouseover(dmmCaptcha.resetError)}),translateCaptchaMessages())};return{init:function(){adminPath=wpPath,renderCaptcha()},refresh:function(a){getCaptchaObject().reset(recaptchaWidgets[a])},resetError:function(){""!==getCaptchaObject().getResponse(recaptchaWidgets["g-recaptcha_cf-"+$(this).attr("data-id")])&&$(this).text("")},error:function(a,t,e){this.refresh(a);var r=a.split("-"),c=r[r.length-1];$("#g-recaptcha-error-"+c).text(translatedMessages[t[0]]),e.resetProcessing(c)},validate:function(a,t,e,r){var c="g-recaptcha_cf-"+a,s=getCaptchaObject().getResponse(recaptchaWidgets[c]);if(""===s)void 0===r&&(r=dmmContactForm),this.error(c,["default"],r);else{var n={action:"validate_captcha",data:s};$.ajax({url:adminPath+"/admin-ajax.php",data:n,async:!1,success:function(a){void 0!==a&&(!0===(a=$.parseJSON(a)).success?e(t):dmmCaptcha.error(c,a["error-codes"]))},error:function(a){console.log(a)}})}}}}();