window.addEventListener("load",(()=>{const e=document.querySelector(".popup-builder-modal");if(e){const t=JSON.parse(e.getAttribute("data-settings")),{entrAnimation:s,exitAnimation:i,animationDuration:o,outsideClose:a}=t||{},d=e.querySelector(".popup-builder-container"),r=e.querySelector(".popup-builder-close"),n=()=>{e.classList.add("popup-builder-modal--open"),s&&(d.classList.add(`${s}`),d.style.setProperty("--gkit-popup-animate-duration",`${o}s`),setTimeout((()=>{d.classList.remove(`${s}`)}),1e3*o)),r&&r.addEventListener("click",(()=>l())),a&&(e.addEventListener("click",(()=>l())),document.addEventListener("keydown",(function(e){"Escape"===e.key&&l()})))},l=()=>{d.classList.remove(`${s}`),d.classList.add(`${i}`),d.classList.add("reverse"),setTimeout((()=>{e.classList.remove("popup-builder-modal--open"),d.classList.remove(`${i}`),d.classList.remove("reverse")}),1e3*o)};setTimeout((()=>{n()}),1e3)}}));