const CONFIG={oldCookieName:""};function getCookie(e){if(!e)return"";const t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):""}function handleSpinClick(){const e=document.querySelector(".main__wheel-layout"),t=document.querySelector("#counter_spin"),o=parseInt(t.innerText.replace(/\D/g,""),10);t.innerText="("+(o-1)+")",e.classList.contains("stage-2")&&e.classList.contains("stage-1-complete")?(e.classList.add("spin-to-stage-three"),e.classList.remove("stage-2"),document.querySelector(".main__achievements").classList.add("hide"),document.querySelector(".main__achievements-bonus").classList.add("hide"),setTimeout(function(){e.classList.remove("spin-to-stage-three"),e.classList.add("stage-3"),document.querySelector(".modal").classList.remove("hide"),document.querySelector(".modal__wrapper").classList.remove("hide"),document.querySelector("body").classList.add("modal_shown"),"function"==typeof aft&&aft("send")},3600)):e.classList.contains("stage-1")&&(e.classList.add("spin-to-stage-two"),e.classList.remove("stage-1"),CONFIG.attempts&&(t.innerText="("+(o-1)+")"),setTimeout(function(){e.classList.remove("spin-to-stage-two"),e.classList.add("stage-2"),e.classList.add("stage-1-complete"),document.querySelector(".main__achievements").classList.remove("hide"),document.querySelector(".main__achievements-bonus").classList.remove("hide")},3600))}function setResponsiveHeight(){document.body.clientWidth<479?(document.querySelector("body").style.minHeight=window.innerHeight+"px",document.querySelector(".main").style.minHeight=window.innerHeight+"px"):(document.querySelector("body").style.minHeight="100vh",document.querySelector(".main").style.minHeight="100vh")}document.addEventListener("DOMContentLoaded",function(){const e=document.getElementById("parallaxContainer");e&&document.addEventListener("mousemove",function(t){const o=e.getBoundingClientRect(),n=t.clientX-o.left,s=t.clientY-o.top;e.querySelectorAll(".paralax-item").forEach(function(e,t){const i=(t+1)*(n-o.width/2)/20,c=(t+1)*(s-o.height/2)/20;e.style.transform="translate("+i+"px, "+c+"px)"})});const t=new URLSearchParams(window.location.search).get("lang");let o;o=t||navigator.language,console.log("Browser language:",o);let n=window.location.search;""===n?n="?show_popup_reg=1&lp=cr_wheel":n+="&show_popup_reg=1&lp=cr_wheel";const s="https://"+window.location.hostname.replace("promo.","")+n,i=document.querySelector(".action_button");i.href=s,i.addEventListener("click",function(){document.cookie="offer_last_point="+n+"; max-age=2592000"})});const oldCookieName=CONFIG.oldCookieName;(getCookie("formWasShown")||getCookie(oldCookieName+"_spinned"))&&(document.querySelector(".modal").classList.remove("hide"),document.querySelector(".modal__wrapper").classList.remove("hide"),document.querySelector("body").classList.add("modal_shown")),window.addEventListener("resize",function(){setResponsiveHeight()}),document.addEventListener("click",function(e){const t=document.querySelectorAll(".exclude");let o=!0;t.forEach(function(t){t.contains(e.target)&&(o=!1)}),o&&handleSpinClick()}),setResponsiveHeight();