!function(e){"use strict";e(document).ready((function(){e(document.body).on("submit",".ekit-mailChimpForm",(function(s){s.preventDefault();var t=e(this),a=t.serialize(),r=t.attr("data-listed"),i=t.attr("data-success-message"),d=t.attr("data-success-opt-in-message"),c=t.children(".ekit-mail-message"),n=t.attr("data-nonce");e.ajax({data:a,type:"get",url:window.elementskit.resturl+"widget/mailchimp/sendmail/?listed="+r,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",n)},success:function(e){if(c.show().removeClass("success error").empty(),e.error&&e.error.length>0)c.html(e.error).addClass("error");else{var s=JSON.parse(e.success.body||"{}");"subscribed"!==s.status?"pending"!==s.status?c.html(s.title||"").addClass("error"):c.html(d).addClass("success"):c.html(i).addClass("success")}}})}))}))}(jQuery);