var a=i(0),o=n(a),r=i(2),s=n(r);(0,o.default)(document).ready(function(){(0,o.default)(".st_news_letter_popup_wrap").each(function(){var t=(0,o.default)(this);t.data("hide_on_mobile")&&t.on("show.bs.modal",function(t){if(sttheme.responsive&&(0,o.default)(window).width()<992)return!1}),t.data("delay_popup")?setTimeout(function(){t.modal("show")},1e3*t.data("delay_popup")):t.modal("show");var e=t.data("id_st"),i=t.data("show_popup"),n=t.data("cookies_time");(0,o.default)(".st_news_letter_do_not_show").change(function(){(0,o.default)(this).is(":checked")?s.default.set("st_popup_do_not_show_"+e,i,{expires:n||30,domain:sttheme.cookie_domain,path:sttheme.cookie_path}):s.default.set("st_popup_do_not_show_"+e,i,{expires:-1,domain:sttheme.cookie_domain,path:sttheme.cookie_path})}),2==i&&s.default.set("st_popup_do_not_show_"+e,i,{expires:n||30,domain:sttheme.cookie_domain,path:sttheme.cookie_path})}),(0,o.default)("form.st_news_letter_form").submit(function(){var t=(0,o.default)(this);return/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,10}$/.test((0,o.default)(this).find(".st_news_letter_input").val())?(!(0,o.default)(this).hasClass("is_newsletter_form")||void 0!==(0,o.default)(this).data("chas")&&!(0,o.default)(this).find('input[name="email"]').hasClass("st_needs_reset"))&&(o.default.ajax({type:"POST",url:t.attr("action"),data:t.serialize(),dataType:"json",cache:!1,success:function(e){if(t.closest(".st_news_letter_box").find(".alert-danger, .alert-success").addClass("hidden"),e.hasError)t.closest(".st_news_letter_box").find(".alert-danger").html(e.hasError).removeClass("hidden");else{t.closest(".st_news_letter_box").find(".alert-success").html(e.message).removeClass("hidden");var i=t.closest(".st_news_letter_popup_wrap");i.length&&s.default.set("st_popup_do_not_show_"+i.data("id_st"),i.data("show_popup"),{domain:sttheme.cookie_domain,path:sttheme.cookie_path})}}}),!1):(t.closest(".st_news_letter_box").find(".alert-danger").html(wrongemailaddress_stnewsletter).removeClass("hidden"),!1)})})},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}