!function(){"use strict";(0,window.ctFrontend.registerDynamicChunk)("blocksy_ext_newsletter_subscribe",{mount:function(e,s){var r=s.event.target;"mailchimp"===r.dataset.provider&&function(e){if(e.querySelector('[type="email"]').value.trim()){if(document.getElementById("js-validate-robot")&&""!==document.getElementById("js-validate-robot").value)return!1;for(var s=e.action.replace("subscribe","subscribe/post-json"),r="",t="mailchimpCallback",c=e.querySelectorAll("input"),i=0;i<c.length;i++)r+="&"+c[i].name+"="+encodeURIComponent(c[i].value);r+="&c=".concat(t);var n=document.createElement("script");n.src=s+r,document.body.appendChild(n),e.classList.remove("subscribe-error","subscribe-success"),e.classList.add("subscribe-loading"),window[t]=function(s){delete window[t],document.body.removeChild(n),e.classList.remove("subscribe-loading"),s&&(e.classList.add("error"===s.result?"subscribe-error":"subscribe-success"),e.querySelector(".ct-newsletter-subscribe-message").innerHTML=s.msg.replace("0 - ",""))}}}(r),r.dataset.provider.indexOf("mailerlite")>-1&&function(e){var s=new FormData(e);s.append("action","blc_newsletter_subscribe_process_mailerlite_subscribe"),s.append("GROUP",e.dataset.provider.split(":")[1]),e.classList.remove("subscribe-error","subscribe-success"),e.classList.add("subscribe-loading"),fetch(ct_localizations.ajax_url,{method:"POST",body:s}).then((function(e){return e.json()})).then((function(s){s.success;var r=s.data;e.classList.remove("subscribe-loading"),e.classList.add("no"===r.result?"subscribe-error":"subscribe-success"),e.querySelector(".ct-newsletter-subscribe-message").innerHTML=r.message}))}(r)}})}();