PageSourceSearch

https://casinosanalyzer.ca/build/midori/assets/js/popups/wheelsExitPopup.min.js?v=5801963

js casinosanalyzer.ca collected 2026-09-25 23:52:26 UTC 19,390 bytes, 1 lines download raw bytes

1import BonusesPopup from"bonusesPopup";import{brevoUtmData as wheelsBrevoUtmData,eventID,navAff as WheelsExitPopupNavAff,utmParams as wheelsExitPopupUtmParams}from"globals";import{authPopup}from"authPopup";import{__translate as __wep_translate}from"translate";class WheelsExitPopup extends BonusesPopup{constructor(e,t,s){super(),this.data=e,this.loc=t,this.localCountry=s,this.wheelsExitPopupShown=!1,this.wheelsExitPopupStorage=storage.getWheelsExitPopup(),this.wheelsExitPopupLimit=6,this.selector=document.querySelector('.bonusesPopup[data-type="wheelsExitPopup"]'),this.authWheelPopup=document.getElementById("authWheelPopup"),this.eventCat="w_website_wheels_exit_popup",this.formResize=!0,this.formSuccess=!1,this.formFulfilled=!1,this.mobileWidth=992}translate(e,t=!1){return __wep_translate(e,this.localCountry||"en",t)||e}exitPopupInit(){this.selector&&this.exitPopupTrigger()}exitPopupTrigger(){document.body.addEventListener("mouseleave",e=>{let t=document.getElementById("authWheelPopup");if(!this.wheelsExitPopupShown&&!t){window.innerWidth>
1this.mobileWidth&&this.wheelsPopupTriggerRender(e)}});let e,t=0,s=!1;const i=Math.round(document.body.offsetHeight/10);window.addEventListener("scroll",()=>{if(!this.wheelsExitPopupShown&&window.innerWidth<this.mobileWidth){let o=document.documentElement.scrollTop;if(o<t){s||(s=!0,e=o),e-o>=i&&(s=!1,this.wheelsPopupTriggerRender())}else s=!1;t=o}})}wheelsPopupTriggerRender(e){const t=document.querySelector("#emailPopup"),s=document.querySelector("#authPopup"),i=document.querySelector("#userReviewPopup"),o=t&&t.classList.contains("show"),n=document.querySelector("#questPopup"),r=n&&n.classList.contains("questPopup--show"),a=document.querySelector("#bonusVault.active"),l=document.querySelector('[data-element="reactionsFeedbackPopup"]'),c=document.querySelector("#requiredDayPopup");if((!e||!e.toElement&&!e.relatedTarget)&&!this.wheelsExitPopupShown&&!this.wheelsExitPopupStorage&&!o&&!s&&!i&&!r&&!a&&!l&&!c&&0===this.selector.children.length){const e={widgetTitle:"Wheels Exit Popup",eventCat:this.eventCat,eventName:"open",widgetPref:"showBlock",clickAffLinkVersion:30,showWidgetVersion:31,casinos:this.data};this.generatePopup(this.data),setTimeout(()=>{this.renderSibLinks()},100),setTimeout(()=>{document.body.classList.add("bonusesPopup__show"),document.body.dataset.popupType="wheelsExitPopup",this.selector.classList.add("show"),this.resizePopup()},500),setTimeout(()=>{this.showBlockAmplitude(e)},0)}}resizePopup(){if(window.addEventListener("resize",()=>{const e=document.querySelector(".wheels__wrapper"),t=document.querySelector(".wheels__form--text"),s=document.querySelector(".wheels__form--text .wheels__wrapper"),i=document.querySelector(".wheels__card:first-of-type");this.formResize&&(window.innerWidth<this.mobileWidth?(e&&e.remove(),t&&t.append(e)):(s&&s.remove(),i&&i.append(e)))}),this.formResize&&window.innerWidth<this.mobileWidth){const e=document.querySelector(".wheels__wrapper"),t=document.querySelector(".wheels__form--text");document.querySelector(".wheels__form--text .wheels__wrapper");e&&e.remove(),t.append(e)}}resizeSuccessPopup(){if(window.addEventListener("resize",()=>{const e=document.querySelector(".wheels__wrapper"),t=document.querySelector(".wheels__form--text"),s=document.querySelector(".wheels__form--text .wheels__wrapper"),i=document.querySelector(".wheels__form");this.formSuccess&&(window.innerWidth<this.mobileWidth?(e&&e.remove(),t.append(e),e.classList.add("formSuccess"),i&&i.classList.add("hide")):(s&&s.remove(),document.querySelector(".wheels__card:first-of-type").append(e),e.classList.remove("formSuccess"),i&&i.classList.remove("hide")))}),this.formSuccess&&window.innerWidth<this.mobileWidth){const e=document.querySelector(".wheels__wrapper"),t=document.querySelector(".wheels__form--text"),s=document.querySelector(".wheels__form");e&&e.remove(),t.append(e),e.classList.add("formSuccess"),s&&s.classList.add("hide")}}resizeFulfilledPopup(){if(window.addEventListener("resize",()=>{const e=document.querySelector(".wheels__win"),t=document.querySelector(".wheels__form--text"),s=document.querySelector(".wheels__form--text .wheels__win"),i=document.querySelector(".wheels__card:nth-child(2)"),o=document.querySelector(".wheels__card:first-of-type");this.formFulfilled&&(window.innerWidth<this.mobileWidth?(e.remove(),t.append(e),i.classList.add("formFulfilled")):(s&&s.remove(),o&&o.append(e),i.classList.remove("formFulfilled")))}),this.formFulfilled&&window.innerWidth<this.mobileWidth){const e=document.querySelector(".wheels__win"),t=document.querySelector(".wheels__form--text"),s=document.querySelector(".wheels__card:nth-child(2)");e.remove(),t.append(e),s.classList.add("formFulfilled")}}generatePopup(e){let t=document.createElement("div");t.className="wheelsExitPopup__wrapper",t.addEventListener("click",e=>e.stopPropagation());const s=document.createElement("div");s.className="wheels__card",s.append(this.generateWheel());const i=document.createElement("div");i.className="wheels__card",i.append(this.generatePopupCloseBtn(),this.generateForm()),t.append(s,i),this.selector.append(t);const o=this.selector.querySelector("#wheels-sib-form");o&&o.addEventListener("submit",t=>{t.preventDefault();const s=o.querySelector(".sib-input input"),i=s.value.trim(),n=o.querySelector(".sib-form-block__button-with-loader"),r=this.selector.querySelector(".wheels__form--title"),a=this.selector.querySelector(".wheels__form--description"),l=o.querySelector(".entry__error");
1this.isValidEmail(i)?(this.showFormError(l,""),this.loadingPending(s,i,n,r,a),this.submitSubscription(o),this.startSpin(s,i,n,r,a,e)):this.showFormError(l,this.translate("Invalid email format. Please try again"))});const n=document.querySelector(".wheelsExitPopup__wrapper .wheels__spin-btn");n&&n.addEventListener("click",t=>{t.preventDefault();const s=document.querySelector(".wheels__form--title"),i=document.querySelector(".wheels__form--description");this.formResize=!1,this.formSuccess=!0;const o=this.getWinnerBonus();n.classList.add("loading"),this.loadingSuccessWithoutForm(s,i,o);const r={widgetTitle:"Wheels Exit Popup",eventCat:"w_website_wheels_exit_popup",eventName:"submit",widgetPref:"click",clickAffLinkVersion:30,showWidgetVersion:31,casinos:e,authorized:"true"};setTimeout(()=>{this.showBlockAmplitude(r)},0),setTimeout(()=>{this.formSuccess=!1,this.formFulfilled=!0,n.remove(),this.loadingFulfilledWithoutForm(s,i,o)},3500)}),this.selector.addEventListener("click",e=>{e.target===this.selector&&this.closePopup()})}loadingPending(e,t,s,i,o){s.classList.add("loading"),s.setAttribute("disabled",!0),e.placeholder=t}loadingSuccess(e,t,s,i,o,n){s&&s.setAttribute("disabled",!0),e&&(e.value=t,e.setAttribute("disabled",!0)),this.loadingSuccessWithoutForm(i,o,n)}loadingSuccessWithoutForm(e,t,s){let i;switch(e&&(e.innerHTML=this.translate("Wild!")),t&&(t.innerHTML=this.translate("Your reward is loading...")),s){case 1:i="spinSecond";break;case 2:i="spinThird";break;case 3:i="spinFourth";break;default:i="spinFirst"}const o=document.querySelector(".wheels__content");o.classList.add("rotation"),o.classList.add(i);const n=document.querySelector(".wheels__labels");n.classList.add("rotation"),n.classList.add(i),this.resizeSuccessPopup()}loadingFulfilled(e,t,s){const i=document.querySelector(".wheels__form");i&&i.remove(),this.loadingFulfilledWithoutForm(e,t,s)}loadingFulfilledWithoutForm(e,t,s){e&&(e.innerHTML=this.translate("Boom!")),t&&(t.innerHTML=this.translate("Look who’s on fire!"));const i=document.querySelector(".wheels__wrapper");i&&i.remove();const o=document.createElement("div");o.className="wheels__win",i&&i.append(o),setTimeout(()=>{o.classList.add("show")},100);const n=document.querySelector(".wheels__card:first-of-type");n&&n.append(o);const r=this.generateBonus(s),a=document.querySelector(".wheels__form--wrapper");r&&a&&a.append(r),this.resizeFulfilledPopup()}getWinnerBonus(){let e=0;if(this.wheelsExitPopupLimit){let t=this.wheelsExitPopupLimit;t=t>this.data.length?this.data.length:t;const s=Math.floor(t);e=Math.floor(Math.random()*s)}return e}generateBonus(e){const t=(storage.getKeitaro()??[])[0],s=(storage.getAlternativeSponsoredOffers()??[]).filter(e=>!!e.sponsored),i=s.length>0?s[Math.floor(Math.random()*s.length)]:t;if(!i)return null;const o=i.casino.domain+"?bonus="+i.id,n=document.createElement("div");return n.className="wheels__bonus",n.innerHTML=`<div class="wheels__bonus--info">\n\t\t\t<div class="logo" style="background-color: #${i.casino.background}">\n\t\t\t\t<img src="${i.casino.logo}" alt="${i.casino.name}">\n\t\t\t</div>\n\t\t\t<div class="text">\n\t\t\t\t<p class="label">${this.translate("You won!")}</p>\n\t\t\t\t<p class="title">${this.translate(i.titleShort,!0)}</p>\n\t\t\t</div>\n\t\t</div>\n\t\t<button class="wheels__bonus--btn">${this.translate("Claim my bonus")}</button>`,n.addEventListener("click",()=>{WheelsExitPopupNavAff(o,!0,null,"",i.affiliateUrl?i.affiliateUrl:o);const t={widgetTitle:"Wheels Exit Popup",eventCat:this.eventCat,casinos:this.data,casino:this.data[e],btnText:this.translate("Claim my bonus"),widgetPref:"clickAffLink",clickAffLinkVersion:81,showWidgetVersion:82,eventAffClickName:"casino_visit"};setTimeout(()=>{this.clickAffLinkAmplitude(t,++this.widgetAffLinkClickIndex)},0),this.closePopup()}),n}generateWheel(){const e=document.createElement("div");e.className="wheels__wrapper";const t=document.createElement("div");t.className="wheels__circle";const s=document.createElement("div");s.className="wheels__circle--inner";const i=this.generateWheelLabel(),o=this.generateWheelSectors(),n=this.generateWheelCenterPin();return s.append(...o,...n),t.append(s),e.append(t,...i),e}generateWheelLabel(){const e=document.createElement("div");e.className="wheels__label--down";const t=document.createElement("div");return t.className="wheels__label--up",[e,t]}generateWheelSectors(){const e=document.createElement("div");e.className="wheels__content";const t=this.translate("Next Time"),s=this.translate("No Luck"),i=this.data&&this.data[0]?this.translate(this.data[0].titleShort,!0):t,o=s,n=this.data&&this.data[1]?this.translate(this.data[1].titleShort,!0):t,r=this.data&&this.data[2]?this.translate(this.data[2].titleShort,!0):s,a=t,l=this.data&&this.data[3]?this.translate(this.data[3].titleShort,!0):s,c=[i,o,n,r,a,l,i,o,n,r,a,l];
1c.forEach((t,s)=>{const i=document.createElement("div");i.className="wheels__sector",e.append(i)});const d=document.createElement("div");return d.className="wheels__labels",c.forEach((e,t)=>{const s=document.createElement("p");s.innerHTML=`<span>${e}</span>`,d.append(s)}),[e,d]}generateWheelCenterPin(){const e=document.createElement("div");e.className="wheels__center";const t=document.createElement("div");return t.className="wheels__center--pin",[e,t]}generatePopupCloseBtn(){const e=document.createElement("button");return e.className="wheels__close",e.addEventListener("click",()=>this.closePopup()),e}generateForm(){const e=document.body.dataset.userId??null,t=document.createElement("div");t.className="wheels__form--wrapper";const s=document.createElement("div");s.className="wheels__form--text";const i=document.createElement("p");i.className="wheels__form--title",i.innerHTML=this.translate("Ready to win?");const o=document.createElement("p");if(o.className="wheels__form--description",o.innerHTML=this.translate("One spin = instant bonus!"),s.append(i,o),e){const e=document.createElement("div");e.className="wheels__spin-btn",e.innerHTML=`<svg class="icon loader-icon" viewBox="0 0 512 512">\n                                        <path d="M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z" />\n                                    </svg>\n                                    <span>${this.translate("Spin to win!")}</span>`,t.append(s,e)}else{const e=document.createElement("div");e.className="wheels__form sib-form",e.innerHTML=this.renderEmailPopup(),t.append(s,e)}return t}renderSibLinks(){const e=document.body.dataset.userId??null,t=document.getElementsByTagName("head")[0],s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.href="https://sibforms.com/forms/end-form/build/sib-styles.css",s.media="all",e||t.appendChild(s)}renderEmailPopup(){const e=document.body.dataset.geo,t=document.body.dataset.localeLang||"en",s=wheelsBrevoUtmData();let i="";if(s)for(const[e,t]of Object.entries(s))i+=`<input type="hidden" id="${e.toUpperCase()}" name="${e.toUpperCase()}" autocomplete="off" value="${t}" />\n`;return`<div id="sib-form-container" class="sib-form-container">\n        <div id="error-message" class="sib-form-message-panel">\n            <div class="sib-form-message-panel__text sib-form-message-panel__text--center">\n                <span class="sib-form-message-panel__inner-text"></span>\n            </div>\n        </div>\n        <div></div>\n        <div id="success-message" class="sib-form-message-panel">\n            <div class="sib-form-message-panel__text sib-form-message-panel__text--center">\n                <span class="sib-form-message-panel__inner-text"></span>\n            </div>\n        </div>\n        <div id="sib-container">\n            <form id="wheels-sib-form" method="POST" action="https://3f7bc7e1.sibforms.com/serve/MUIFAOHtaJSFFL67u-h896XVr6otAeQkC_mxfnb12Fenkj2EU4YQDHVyVz0duha9jXlCq4nZiG0wm9PmJ6974wqwHpxKh7pKVSzkJs6byCYYUUaDuZDmYVMX5pSmrRTsQOjxNfof65DApkKx8i1EnEF3KtQUfh5dHZe1Wk-GoGLj3ZVhrtjUOli6j7o0pHc3CQMrbPu4SYegIqWY" data-type="subscription" autocomplete="off">\n                <div class="sib-input sib-form-block">\n                    <div class="form__entry entry_block">\n                        <div class="form__label-row">\n                            <div class="entry__field">\n                                <input class="input" type="text" id="wheels-EMAIL" name="EMAIL" role="presentation" autocomplete="off" placeholder="${this.translate("Email")}" data-required="true" required />\n                            </div>\n                        </div>\n                        <label class="entry__error entry__error--primary"></label>\n                    </div>\n                </div>\n                <input type="hidden" id="COUNTRY" name="COUNTRY" autocomplete="off" value="${e}" />\n                <input type="hidden" id="DOMAIN" name="DOMAIN" autocomplete="off" value="${document.location.host}" />\n                ${i}\n                <div>\n                    <div class="sib-form-block">\n                        <button class="sib-form-block__button sib-form-block__button-with-loader" type="submit">\n                            <svg class="icon clickable__icon progress-indicator__icon sib-hide-loader-icon" viewB
1ox="0 0 512 512">\n                                <path d="M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z" />\n                            </svg>\n                            <span>${this.translate("Spin to win!")}</span>\n                        </button>\n                    </div>\n                </div>\n\n                <input type="text" name="email_address_check" value="" class="input--hidden">\n                <input type="hidden" name="locale" value="${t}">\n            </form>\n        </div>\n    </div>`}isValidEmail(e){return/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.trim())}showFormError(e,t){e&&(e.textContent=t,e.style.display=t?"block":"none")}submitSubscription(e){fetch(e.action,{method:"POST",mode:"no-cors",body:new FormData(e)}).catch(()=>{})}startSpin(e,t,s,i,o,n){const r=this.getWinnerBonus();this.formResize=!1,this.formSuccess=!0,this.loadingSuccess(e,t,s,i,o,r);const a={widgetTitle:"Wheels Exit Popup",eventCat:"w_website_wheels_exit_popup",eventName:"submit",widgetPref:"click",clickAffLinkVersion:30,showWidgetVersion:31,casinos:n,authorized:"false"};setTimeout(()=>{this.showBlockAmplitude(a)},0),setTimeout(()=>{this.formSuccess=!1,this.formFulfilled=!0,this.loadingFulfilled(i,o,r)},3500)}closePopup(){this.selector.classList.remove("show"),document.body.classList.remove("bonusesPopup__show"),this.selector.innerHTML="",storage.setWheelsExitPopup(!0),this.wheelsExitPopupShown=!0,this.formFulfilled=!1;storage.getShowAuthWheels()&&authPopup.showBannerBySpecialTime(0)}showBlockAmplitude(e){const{casinos:t=[],widgetTitle:s,eventCat:i,eventName:o,widgetPref:n,showWidgetVersion:r,authorized:a}=e,l=t.map(e=>e.casino.domain),c=t.slice(0,10).filter(e=>e&&e.code).length,d=l.filter((e,t,s)=>s.indexOf(e)===t).length,u=t.filter(e=>!e.affiliateUrl).length,h=t.slice(0,10).filter(e=>e&&!e.affiliateUrl).length,m=t.filter(e=>e.code).length,p=t.slice(0,10).filter(e=>e).reduce((e,t)=>e+t.score,0),_=p?(p/t.slice(0,10).filter(e=>e).length).toFixed(1):0,f=t.slice(0,10).filter(e=>e&&5===e.score).length,w=t.slice(0,10).filter(e=>e&&e.score>4.5&&e.score<=4.9).length,g=t.slice(0,10).filter(e=>e&&e.score>4&&e.score<=4.5).length,y=t.slice(0,10).filter(e=>e&&e.score<=4).length,b=document.location.pathname,v=document.location.origin+document.location.pathname,S=document.location.href,P=document.body.dataset.routeBonus,E=document.body.dataset.routeId,L=eventID.findIndex(e=>e===P),x=(L>-1||eventID.length,L>-1?eventID[L]:eventID[eventID.length-1]),N=(document.body.dataset.localeLang,document.body.dataset.websiteEnv,document.body.dataset.localeCountry,document.body.dataset.geo);"undefined"!=typeof dataLayer&&Array.isArray(dataLayer)&&dataLayer.push(Object.assign({authorized:a,event:`addEvents_${n}`,event_id:`d-v${document.body.dataset.amplitudeVersion}-e${r}`,event_cat:i,event_name:o,page_current_path:JSON.stringify(b),page_url:JSON.stringify(v),page_url_full:JSON.stringify(S),page_group:JSON.stringify(x),widget_title:JSON.stringify(s),widget_id:JSON.stringify(null),page_route_id:JSON.stringify(E),widget_handler:JSON.stringify(null),casino_bonus_short:JSON.stringify(!1),casino_list_user_country:JSON.stringify(N),casino_user_country:JSON.stringify(N),casino_list_for_geo:JSON.stringify(!1),casino_id_list:JSON.stringify(t.map(e=>e.casino.casinoId)),casino_domain_list:JSON.stringify(l),casino_bonus_id_list:JSON.stringify(t.map(e=>e.id)),casino_domain_bonus_id_list:JSON.stringify(t.map(e=>`${e.casino.domain}_${e.id}`)),casino_list_count:JSON.stringify(t.length),casino_list_code_top10_count:JSON.stringify(c),casino_list_casino_unique_count:JSON.stringify(d),casino_list_noafflink_count:JSON.stringify(u),casino_list_noafflink_top10_count:JSON.stringify(h),casino_list_code_count:JSON.stringify(m),casino_score_geo_top10_median:JSON.stringify(_),casino_score_geo_a_top10_count:JSON.stringify(f),casino_score_geo_b_top10_count:JSON.stringify(w),casino_score_geo_c_top10_count:JSON.stringify(g),casino_score_geo_d_top10_count:JSON.stringify(y),website_domain:JSON.stringify(document.location.hostname)},wheelsExitPopupUtmParams()))}}export{WheelsExitPopup};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.