var gameJack,hvrJackpot,gameJackElem,gameJackXhttp,GamesCommon=GamesCommon||function(){return{init:function(e){$.extend(this,e)}}}(),getCumulativeJackpotLock=!0,allowClick=!0,imgSortIndex=0;function GetGamesByGroup(e,t,n){$.ajax({type:"POST",data:n,url:"/DynamicLobbyHelper/GetGamesByGroup",success:function(s){for(let a=0;a0?(drawGames("js_lobby_group_"+s[a].GroupId,s[a].GamesOutput,e,"",l,d,c=="true"?r:void 0),t<=r?$(i).addClass("lca-most-liked-no-slider d-flex"):($(i).parent().find(".js_slider_prev").removeClass("hidden"),$(i).parent().find(".js_slider_next").removeClass("hidden"),new Swiper("#js_mlkd_widget",{loop:!1,slidesPerView:c=="true"?1:r,slidesPerGroup:c=="true"?1:r,preloadImages:!1,autoplay:!1,spaceBetween:r==4?8:12,navigation:{nextEl:".js_slider_next",prevEl:".js_slider_prev"},on:{transitionEnd:function(e){if(e.isEnd){let e=i.dataset.hasNext,s=Number(i.dataset.page);if(e=="true"){i.dataset.hasNext=!1;var t={GroupId:i.dataset.id,GroupTypeId:i.dataset.typeId,TakeCount:r,Page:s+1,LobbyUrl:i.dataset.lobbyurl};i.dataset.page=t.Page,n.input=[],n.input.push(t),GetGamesByGroup(!1,!0,n)}}}}}))):i&&i.parentNode&&i.parentNode.classList.add("hidden")}}}})}function getLandingWidgetGames(e,t){$.ajax({type:"POST",data:e,url:"/DynamicLobbyHelper/GetGamesByGroup",success:function(n){for(var s of n){let o=e.input.filter(function(e){return e.GroupId==s.GroupId}),i=document.getElementById("js_lg_ws_"+o[0].WidgetId);i.querySelector(".js_lg_w_names.active").dataset.hasNext=s.HasNext,typeof i.swiper=="undefined"?new Swiper(i,{loop:!1,slidesPerView:1,slidesPerGroup:1,navigation:{nextEl:"#js_lg_w_next_"+o[0].WidgetId,prevEl:"#js_lg_w_prev_"+o[0].WidgetId},virtual:{enabled:!0,slides:createMinInfoGameCardArr(s.GamesOutput,o[0].LobbyUrl,!0,o[0].TakeCount)},on:{slideChange:function(t){let n=t.$el[0].querySelector(".js_lg_w_names.active");if(t.isEnd){let t=n.dataset.hasNext,s=Number(n.dataset.page);if(t=="true"){n.dataset.hasNext=!1;let t={GroupId:n.dataset.id,WidgetId:n.dataset.widgetId,GroupTypeId:n.dataset.typeId,TakeCount:n.dataset.takeCount,Page:s+1,LobbyUrl:n.dataset.lobbyurl};n.dataset.page=t.Page,e.input=[],e.input.push(t),getLandingWidgetGames(e)}}}}}):(t&&i.swiper.virtual.removeAllSlides(),i.swiper.virtual.appendSlide(createMinInfoGameCardArr(s.GamesOutput,o[0].LobbyUrl,t,o[0].TakeCount)))}}})}function createMinInfoGameCardArr(e,t,n,s){let o=e.length;const a=[],r=s-o;if(r>0){for(let t=0;t=o/2&&(o=o/2,n=!1)}let i="";for(let s=0;s`;let n="",i="",s=t!="undefined"&&t!=""?`${e.URL}-${t}`:e.URL,a=e.UseRmCdn?GamesCommon.RmCdnUrl:GamesCommon.cdnUrl;for(var o=0;o`;return n=`
${e.Description}`+`
`,e.Badges&&(n+=e.Badges),n+=`
${i}
`,e.ContributionPercent!=void 0&&e.ContributionPercent!=null&&(n+=`

${e.ContributionPercent}%

`),(e.MinMaxLimits[0]!="0"&&e.MinMaxLimits[1]!="0"||e.MinMaxLimits[2]!="0")&&(n+=``),n+=`
${e.Description}
`+`
0?n+=`href="/${GamesCommon.language}/play/real/${s}">`:n+=`data-href="/${GamesCommon.language}/play/real/${s}">`,e.HasDemo&&(n+=`${GamesCommon.trns.Demo}`),n+=`
`,n}function createGameHtml(e,t,n,s,o,i){for(var c,l,d,u,h,m,f,r="",a=0;a'),e[a].IsFavorite&&(f="active"),e[a].IsLiked&&(h="active");for(l=0;l';(t==2||t==4)&&(imgSortIndex++,d=getImgType(t),d=="horizontal"?(c+="lca-card-w2",u=e[a].HorizontalImage):d=="vertical"&&(c+="lca-card-h2",u=e[a].VerticalImage)),e[a].HasJackpot?r+='
':r+='
',r+=''+e[a].Description+'
'+m+'
'+e[a].Badges+"
",e[a].MinMaxLimits[2]>"0"?r+='
'+e[a].MinMaxLimits[2]+"
":r+="
",s!="2"&&(r+='':r+='
'+e[a].MinMaxLimits[0]+" - "+e[a].MinMaxLimits[1]+'
'),r+='
'+e[a].Description+'
0?r+='href = "/'+GamesCommon.language+"/play/real/"+e[a].URL+"-"+n+'" > '+GamesCommon.trns.Play+" ":r+='data-href = "/'+GamesCommon.language+"/play/real/"+e[a].URL+"-"+n+'" > '+GamesCommon.trns.Play+" ",e[a].HasDemo&&(r+=''+GamesCommon.trns.Demo+""),s=="2"?(e[a].MinMaxLimits[0]=="0"&&e[a].MinMaxLimits[1]=="0"?r+='
':r+='
'+e[a].MinMaxLimits[0]+" - "+e[a].MinMaxLimits[1]+'
',r+='
",o!=null&&((a+1)%o==0||e.length")}return r}function createGameHtmlSpec(e,t,n,s,o,i){for(var c,l,d,u,h,m,f,r="",a=0;a'),e[a].IsFavorite&&(f="active"),e[a].IsLiked&&(h="active");for(l=0;l';(t==2||t==4)&&(imgSortIndex++,d=getImgType(t),d=="horizontal"?(c+="lca-card-w2",u=e[a].HorizontalImage):d=="vertical"&&(c+="lca-card-h2",u=e[a].VerticalImage)),e[a].HasJackpot?r+='
':r+='
',r+=''+e[a].Description+'
'+m+'
'+e[a].Badges+"
",s!="2"&&(r+='":r+="
"):(r+='
'+e[a].MinMaxLimits[0]+" - "+e[a].MinMaxLimits[1]+'
',e[a].MinMaxLimits[2]>"0"?r+='
'+e[a].MinMaxLimits[2]+"
":r+="
")),r+='
',e[a].HasJackpot&&(r+=''),r+='
'+e[a].LikesCount+'
',e[a].MinMaxLimits[0]>0&&e[a].MinMaxLimits[1]>0&&(r+='
'+e[a].MinMaxLimits[0]+" - "+e[a].MinMaxLimits[1]+'
'),r+='
'+e[a].Description+'
'+e[a].CatName+'
0?r+='href = "/'+GamesCommon.language+"/play/real/"+e[a].URL+"-"+n+'" > '+GamesCommon.trns.Play+" ":r+='data-href = "/'+GamesCommon.language+"/play/real/"+e[a].URL+"-"+n+'" > '+GamesCommon.trns.Play+" ",e[a].HasDemo&&(r+=''+GamesCommon.trns.Demo+""),r+="
",o!=null&&((a+1)%o==0||e.length")}return r}function drawGames(e,t,n,s,o,i,a){var r="";let c=$("#"+e).hasClass("swiper-wrapper");t.length>0?GamesCommon.gameCardType==4?r+=createGameHtmlSpec(t,s,o,i,a,c):r+=createGamesHtmlV1(t,s,o,i,c):gamesData.SearchText!=""?r+='

'+GamesCommon.trns.NoSearchResults+' "'+gamesData.SearchText+'"

':gamesData.GroupTypeId==GamesCommon.favoriteGroupType?r+='

'+GamesCommon.trns.YouHaveNoFavoriteGames+"

"+GamesCommon.trns.ToAddFavGames+"
":gamesData.GroupTypeId==GamesCommon.lastPlayedGroupType?r+='

'+GamesCommon.trns.YouHaveNoLastPlayedGames+"
":r+='

'+GamesCommon.trns.NoSuchGameFound+"

",n?$("#"+e).append(dlAnimate(r)):$("#"+e).html(dlAnimate(r))}function createGamesHtmlV1(e,t,n,s,o){let i="",a="";const r=e.length;for(let c=0;c
${e[c].Description}
`+`
${f} ${createMaxWin(e[c])} ${createLanguages(e[c])}
`,s!="2"&&(i+=createCardFooter(e[c])),i+=`
`+`${e[c].LikesCount}
`,e[c].HasDemo&&(i+=`${GamesCommon.trns.Demo}`),GamesCommon.userId>0?i+=`${GamesCommon.trns.Play}`:i+=`${GamesCommon.trns.Play}`,i+=`
`,e[c].HasJackpot&&(i+=`
`+`
`),s=="2"&&e[c].MinMaxLimits[0]!="0"&&e[c].MinMaxLimits[1]!="0"&&(i+=`
${e[c].MinMaxLimits[0]} - ${e[c].MinMaxLimits[1]}
`),i+=`
`}return i}function getImgType(e){return e==2?gridArrangeWithMosaic1():gridArrangeWithMosaic2()}function gridArrangeWithMosaic1(){if(allGamesCount>=25){{if(imgSortIndex==1||imgSortIndex==5||imgSortIndex==17)return"vertical";if(imgSortIndex==13||imgSortIndex==25)return imgSortIndex==25&&(imgSortIndex=0),"horizontal"}}else if(allGamesCount>=15){{if(imgSortIndex==1||imgSortIndex==5)return"vertical";if(imgSortIndex==13)return"horizontal"}}else if(allGamesCount>=10&&(imgSortIndex==1||imgSortIndex==5))return"vertical";return""}function gridArrangeWithMosaic2(){if(allGamesCount>=14){if(imgSortIndex==6||imgSortIndex==20)return"vertical";if(imgSortIndex==1||imgSortIndex==15||imgSortIndex==23)return"horizontal";imgSortIndex==30&&(imgSortIndex=0)}return""}function startAction(e){gameJackElem=e,getCumulativeJackpotLock&&(getCumulativeJackpotLock=!1,getData("/Common/GetCumulativeJackpot",startAnim),hvrJackpot=setInterval(()=>{getData("/Common/GetCumulativeJackpot",updateAnim)},30050))}function getData(e,t){gameJackXhttp=new XMLHttpRequest,gameJackXhttp.onreadystatechange=function(){if(this.readyState==4&&this.status==200)try{var e=JSON.parse(this.responseText);t(e)}catch{console.error("Invalid JSON format")}},gameJackXhttp.open("POST",e,!0),gameJackXhttp.send()}function startAnim(e){gameJack instanceof FlipJackpotNumbers&&gameJack.destroy(),gameJack=new FlipJackpotNumbers({node:gameJackElem.querySelector(".js_game_jackpot"),from:e.OldSumJackPot,seperateOnly:e.DigitsAfterpoint}),gameJack.flipTo({to:e.NewSumJackPot,direct:!1})}function updateAnim(e,t){t instanceof FlipJackpotNumbers&&(e.OldSumJackPot>e.NewSumJackPot?(gameJack.destroy(),gameJack=new FlipJackpotNumbers({node:t.node,from:e.NewSumJackPot,seperateOnly:e.DigitsAfterpoint}),gameJack.flipTo({to:e.OldSumJackPot,direct:!1})):t.flipTo({to:e.NewSumJackPot,direct:!1}))}function stopAction(){gameJack instanceof FlipJackpotNumbers&&gameJack.destroy(),clearInterval(hvrJackpot),gameJackXhttp.abort(),getCumulativeJackpotLock=!0}function CreateBadges(e){let t="";for(var n=0;n0?createToast("error","Error",e.Message):$('div[data-game-id="'+t+'"] .js_game_fav').removeClass("active"),allowClick=!0}}):$.ajax({url:"/DynamicLobbyHelper/AddToFavList",type:"POST",data:{gameId:t},datatype:"json",success:function(e){e.Code>0?createToast("error","Error",e.Message):$('div[data-game-id="'+t+'"] .js_game_fav').addClass("active"),allowClick=!0}})}}),$(document).on("click",".js_game_like",function(e){if(e.stopPropagation(),GamesCommon.userId==0){openLogin();return}if(allowClick){allowClick=!1;var n=GamesCommon.gameCardType==4?$(this).children(".js_game_like_icon"):$(this),t=$(this).parents(".js_dl_games_cont").attr("data-game-id");$(n).hasClass("active")?$.ajax({url:"/DynamicLobbyHelper/RemoveLike",type:"POST",data:{gameId:t},datatype:"json",success:function(e){if(e.Code>0)createToast("error","Error",e.Message);else{var s=0;GamesCommon.gameCardType==4?(s=$(n).siblings(".js_game_likes_count").text(),$('div[data-game-id="'+t+'"] .js_game_like_icon').removeClass("active")):(s=$(n).children(".js_game_likes_count").text(),$('div[data-game-id="'+t+'"] .js_game_like').removeClass("active")),$('div[data-game-id="'+t+'"] .js_game_likes_count').html(Number(s)-1)}allowClick=!0}}):$.ajax({url:"/DynamicLobbyHelper/AddLike",type:"POST",data:{gameId:t},datatype:"json",success:function(e){if(e.Code>0)createToast("error","Error",e.Message);else{var s=0;GamesCommon.gameCardType==4?(s=$(n).siblings(".js_game_likes_count").text(),$('div[data-game-id="'+t+'"] .js_game_like_icon').addClass("active")):(s=$(n).children(".js_game_likes_count").text(),$('div[data-game-id="'+t+'"] .js_game_like').addClass("active")),$('div[data-game-id="'+t+'"] .js_game_likes_count').html(Number(s)+1)}allowClick=!0}})}}),$(document).on("click",".js_dl_play",function(e){if(e.preventDefault(),GamesCommon.userId>0){let t=$(this).attr("href");typeof CheckClientVerificationInfo=="function"&&(GamesCommon.isMobileVerified.toLowerCase()=="false"||GamesCommon.isDocumentVerified.toLowerCase()=="false")?CheckClientVerificationInfo():typeof insFoundsCheck=="function"?insFoundsCheck(e)&&(document.location.href=t):document.location.href=t}else{let e=$(this).attr("data-href");openLogin(e)}}),$(document).on("click",".js_dl_play_demo",function(e){e.preventDefault();var t=$(this).attr("href");document.location.href=t})