var botiga=botiga||{};botiga.popup={domReady:function(e){if("function"==typeof e)return"interactive"===document.readyState||"complete"===document.readyState?e():void document.addEventListener("DOMContentLoaded",e,!1)},init:function(){var o=this,n=document.querySelectorAll(".has-popup");if(!n.length)return!1;for(var e=document.querySelector(".botiga-popup-wrapper .woocommerce-notices-wrapper .woocommerce-error"),i=(null!==e&&(e=e.closest(".botiga-popup").getAttribute("id"),e=document.getElementById(e),this.openPopup(e)),0);i{var e=n[i],t=document.getElementById(e.getAttribute("data-popup-id"));e.addEventListener("click",function(e){e.preventDefault(),o.openPopup(t)}),"true"===e.getAttribute("data-auto-open")&&("string"==typeof(e=e.getAttribute("data-auto-open-delay"))?setTimeout(function(){o.openPopup(t)},1e3*parseInt(e)):o.openPopup(t))})();for(var t=document.querySelectorAll(".botiga-popup-wrapper__close-button"),a=0;a{var e=o[n];!t&&parseInt(e.getAttribute("data-cookie"))&&botiga.helpers.setCookie(e.getAttribute("data-cookie-name"),1,e.getAttribute("data-cookie-expiration")),e.classList.remove("transition-effect"),setTimeout(function(){e.classList.remove("show"),document.body.classList.remove("disable-scroll"),window.dispatchEvent(new Event("botiga.popup.closed"))},300)})()}},botiga.popup.domReady(function(){botiga.popup.init()});