 !function(i) {
    i.fn.easyTicker=function(n) {
        n=i.extend( {
            direction:"up", easing:"swing", speed:"slow", interval:2e3, height:"auto", visible:0, mousePause:0, controls: {
                up: "", down:"", toggle:""
            }
        }
        , n);
        var t=0,
        e=i("body"),
        s=i(n.controls.up),
        o=i(n.controls.down),
        c=i(n.controls.toggle),
        a=function(t, e, s) {
            if(t.is(":visible")) {
                if("up"==s)var o=":first-child",
                c="-=",
                a="appendTo";
                else o=":last-child",
                c="+=",
                a="prependTo";
                var r=i(e).children(o),
                u=r.outerHeight();
                i(e).stop( !0,  !0).animate( {
                    top: c+u+"px"
                }
                , n.speed, n.easing, function() {
                    r.hide()[a](e).fadeIn(), i(e).css("top", 0), 0 !=n.visible&&"auto"==n.height&&l(t, e)
                }
                )
            }
        }
        ,
        r=function(i, s) {
            (0==c.length||c.hasClass("et-run"))&&(t=setInterval(function() {
                1==e.attr("data-focus")&&a(i, s, n.direction)
            }
            , n.interval))
        }
        ,
        u=function(i) {
            clearInterval(t)
        }
        ,
        l=function(t, e) {
            var s=0;
            i(e).children(":lt("+n.visible+")").each(function() {
                s+=i(this).outerHeight()
            }
            ),
            t.stop( !0,  !0).animate( {
                height: s
            }
            , n.speed)
        }
        ,
        h=function(n, t) {
            var e=0,
            s=n.css("display");
            return n.css("display", "block"),
            i(t).children().each(function() {
                e+=i(this).outerHeight()
            }
            ),
            n.css("display", s),
            e
        }
        ;
        function d() {
            e.attr("data-focus", 0)
        }
        function f() {
            e.attr("data-focus", 1)
        }
        return i(window).bind("focus mouseover", f),
        i(window).bind("blur", d),
        this.each(function() {
            var t=i(this), e=t.children(":first-child");
             !function(i, t) {
                t.children().css("margin", 0).children().css("margin", 0), i.css( {
                    position: "relative", height:"auto"==n.height?h(i, t):n.height, overflow:"hidden"
                }
                ), t.css( {
                    position: "absolute", margin:0
                }
                ).children().css("margin", 0), 0 !=n.visible&&"auto"==n.height&&l(i, t), c.addClass("et-run"), r(i, t)
            }
            (t, e), 1==n.mousePause&&t.mouseover(function() {
                u()
            }
            ).mouseleave(function() {
                r(t, e)
            }
            ), c.on("click", function() {
                i(this).hasClass("et-run")?(u(), i(this).removeClass("et-run")): (i(this).addClass("et-run"), r(t, e))
            }
            ), s.on("click", function() {
                a(t, e, "up")
            }
            ), o.on("click", function() {
                a(t, e, "down")
            }
            )
        }
        )
    }
}

(jQuery);
$(()=> {
    const i=document.querySelector("#progressive_jackpot");
    if(i&&i.dataset.progressiveJackpotUrl) {
        const t= {
            refresh: 4e3, update:500
        }
        , n= {
            current: null, gap:.05
        }
        , r=async()=> {
            await window.$.ajax( {
                type: "GET", url:i.dataset.progressiveJackpotUrl+"/progressive-jackpot", contentType:"application/json; charset=utf-8", dataType:"json", success:i=> {
                    if(isFinite(i) != !1&& !(i<=0)) {
                        if(n.current===null) {
                            n.current=i-n.gap*(t.refresh/t.update);
                            return
                        }
                        n.gap=(i-n.current)/(t.refresh/t.update)
                    }
                }
                , complete:()=> {
                    setTimeout(r, t.refresh)
                }
            }
            )
        }
        ;
        r();
        const u=()=> {
            let r="UPDATING";
            n.current !==null&&(n.current+=n.gap, r=n.current.toLocaleString(undefined, {
                minimumFractionDigits: 0, maximumFractionDigits:0
            }
            ));
            i.innerText=r;
            setTimeout(u, t.update)
        }
        ;
        u()
    }
}

);
$(()=> {
    $("#winners_ticker").easyTicker()
}

);
$(()=> {
    const n=document.querySelector("#download_apk");
    if(n) {
        const t=n.querySelector(":scope > div:first-child"), i=n.querySelector(":scope > div:last-child"), f=()=> {
            const i=n.getBoundingClientRect(), t=1-i.top/window.innerHeight;
            return t>1?1-t: t
        }
        , r=()=> {
            const n=f();
            n>.4&&(t.style.transform=`translateX(0%)`, i.style.transform=`translateX(0%)`, t.style.opacity=1, i.style.opacity=1)
        }
        , u=document.querySelector("#scroll_container");
        if(u) {
            u.addEventListener("scroll", r);
            return
        }
        window.addEventListener("scroll", r)
    }
}

);
$(()=> {
    const n=document.getElementById("game_list"), t=()=> {
        n&&(n.onclick=n=> {
            if(n.target.className==="favourite-game-btn") {
                let t="";
                t=n.target.checked?"/game/new-favourite": "/game/remove-favourite";
                $.ajax( {
                    type:"POST", data:JSON.stringify( {
                        Provider: n.target.dataset.provider, GameCode:n.target.value
                    }
                    ), url:t, contentType:"application/json; charset=utf-8", dataType:"json", success:t=> {
                        t.errorCode !=0&&(n.target.checked= !n.target.checked, registerPopup( {
                            content:`Unable to update favourite game. $ {
                                t.message
                            }
                            `
                        }
                        ))
                    }
                    , error:()=> {
                        n.target.checked= !n.target.checked, registerPopup( {
                            content: "Unable to update favourite game."
                        }
                        )
                    }
                }
                )
            }
        }
        )
    }
    ;
    t()
}

);
$(()=> {
    window.initializeCopyAccountNumber=n=> {
        const t=document.querySelectorAll(".copy_account_number_button");
        t.forEach(t=> {
            $(t).popover( {
                content: n.translations.copied, placement:"top", trigger:"manual"
            }
            ), t.onclick=()=> {
                if(navigator.clipboard) {
                    const n=t.previousElementSibling;
                    navigator.clipboard.writeText(n.innerText.replaceAll("-", "")).then(()=> {
                        const n=$(t);
                        n.popover("show");
                        setTimeout(()=>n.popover("hide"), 500)
                    }
                    ).catch(n=>console.log("Error when copying account number: "+n))
                }
            }
        }
        )
    }
}

);
/**
 * jquery-bootstrap-scrolling-tabs
 * @version v2.4.0
 * @link https://github.com/mikejacobson/jquery-bootstrap-scrolling-tabs
 * @author Mike Jacobson <michaeljjacobson1@gmail.com>
 * @license MIT License, http://www.opensource.org/licenses/MIT
 */

 !function(e, t) {
    "use strict";
    function n(e) {
        this.stc=e
    }
    function r(e) {
        this.stc=e
    }
    function a(e) {
        this.stc=e
    }
    function o(t) {
        var o=this;
        o.$tabsContainer=t,
        o.instanceId=e.fn.scrollingTabs.nextInstanceId++,
        o.movableContainerLeftPos=0,
        o.scrollArrowsVisible= !1,
        o.scrollToTabEdge= !1,
        o.disableScrollArrowsOnFullyScrolled= !1,
        o.reverseScroll= !1,
        o.widthMultiplier=1,
        o.scrollMovement=new a(o),
        o.eventHandlers=new r(o),
        o.elementsHandler=new n(o)
    }
    function i(t, n, r) {
        var a,
        o=n.tabs,
        i= {
            paneId: n.propPaneId, title:n.propTitle, active:n.propActive, disabled:n.propDisabled, content:n.propContent
        }
        ,
        l=n.ignoreTabPanes,
        c=o.length&&void 0 !==o[0][i.content],
        d=A.getNewElNavTabs(),
        b=A.getNewElTabContent(),
        f=l?null:function() {
            a.after(b)
        }
        ;
        if(o.length)return o.forEach(function(e, t) {
            var r= {
                forceActiveTab:  !0, tabLiContent:n.tabsLiContent&&n.tabsLiContent[t], tabPostProcessor:n.tabsPostProcessors&&n.tabsPostProcessors[t]
            }
            ;
            A.getNewElTabLi(e, i, r).appendTo(d),  !l&&c&&A.getNewElTabPane(e, i, r).appendTo(b)
        }
        ),
        a=s(d, n, r, f),
        a.appendTo(t),
        t.data( {
            scrtabs: {
                tabs: o, propNames:i, ignoreTabPanes:l, hasTabContent:c, tabsLiContent:n.tabsLiContent, tabsPostProcessors:n.tabsPostProcessors, scroller:a
            }
        }
        ),
        a.find(".nav-tabs > li").each(function(t) {
            L.storeDataOnLiEl(e(this), o, t)
        }
        ),
        t
    }
    function s(e, t, n, r) {
        var a=A.getNewElScrollerElementWrappingNavTabsInstance(e.clone( !0), t),
        i=new o(a),
        s=e.data("scrtabs");
        return s?s.scroller=a:e.data("scrtabs", {
            scroller: a
        }
        ),
        e.replaceWith(a.css("visibility", "hidden")),
        t.tabClickHandler&&"function"==typeof t.tabClickHandler&&(a.hasTabClickHandler= !0, i.tabClickHandler=t.tabClickHandler),
        a.initTabs=function() {
            i.initTabs(t, a, n, r)
        }
        ,
        a.scrollToActiveTab=function() {
            i.scrollToActiveTab(t)
        }
        ,
        a.initTabs(),
        C(a, i),
        a
    }
    function l(e) {
        var t=e.updatedTabsArray,
        n=e.updatedTabsLiContent||[],
        r=e.updatedTabsPostProcessors||[],
        a=e.propNames,
        o=e.ignoreTabPanes,
        i=e.options,
        s=e.$currTabLis,
        l=e.$navTabs,
        c=o?null: e.$currTabContentPanesContainer, d=o?null:e.$currTabContentPanes, b= !1;
        return t.forEach(function(e, f) {
            var C, v=s.find('a[href="#'+e[a.paneId]+'"]'), u=f>=s.length;
            v.length||(b= !0, i.tabLiContent=n[f], i.tabPostProcessor=r[f], v=A.getNewElTabLi(e, a, i), L.storeDataOnLiEl(v, t, f), u?v.appendTo(l): v.insertBefore(s.eq(f)), o||void 0===e[a.content]||(C=A.getNewElTabPane(e, a, i), u?C.appendTo(c):C.insertBefore(d.eq(f))))
        }
        ),
        b
    }
    function c(e) {
        var t=e.tabLi,
        n=e.ignoreTabPanes,
        r=t.$li,
        a=t.$contentPane,
        o=t.origTabData,
        i=t.newTabData,
        s=e.propNames,
        l= !1;
        return o[s.title] !==i[s.title]&&(r.find('a[role="tab"]').html(o[s.title]=i[s.title]), l= !0),
        o[s.disabled] !==i[s.disabled]&&(i[s.disabled]?(r.addClass("disabled"), r.find('a[role="tab"]').attr("data-toggle", "")): (r.removeClass("disabled"), r.find('a[role="tab"]').attr("data-toggle", "tab")), o[s.disabled]=i[s.disabled], l= !0), e.options.forceActiveTab&&(r[i[s.active]?"addClass":"removeClass"]("active"), a[i[s.active]?"addClass":"removeClass"]("active"), o[s.active]=i[s.active], l= !0), n||o[s.content]===i[s.content]||(a.html(o[s.content]=i[s.content]), l= !0), l
    }
    function d(e) {
        var t,
        n=e.tabLi,
        r=e.ignoreTabPanes,
        a=n.$li;
        return-1===n.newIdx&&(a.hasClass("active")&&(t=L.getIndexOfClosestEnabledTab(e.$currTabLis, n.currDomIdx))>-1&&(e.$currTabLis.eq(t).addClass("active"), r||e.$currTabContentPanes.eq(t).addClass("active")), a.remove(), r||n.$contentPane.remove(),  !0)
    }
    function b(t) {
        var n=t.$currTabLis,
        r=t.updatedTabsArray,
        a=t.propNames,
        o=t.ignoreTabPanes,
        i=[],
        s=o?null: [];
        return ! !L.didTabOrderChange(n, r, a)&&(r.forEach(function(t) {
            var r=t[a.paneId];
            i.push(n.find('a[role="tab"][href="#'+r+'"]').parent("li")), o||s.push(e("#"+r))
        }
        ), t.$navTabs.append(i), o||t.$currTabContentPanesContainer.append(s),  !0)
    }
    function f(t) {
        var n=t.$currTabLis,
        r=t.updatedTabsArray,
        a=t.propNames,
        o= !1;
        return n.each(function(n) {
            var i=e(this), s=i.data("tab"), l=L.getTabIndexByPaneId(r, a.paneId, s[a.paneId]), b=l>-1?r[l]: null;
            if(t.tabLi= {
                $li: i, currDomIdx:n, newIdx:l, $contentPane:A.getElTabPaneForLi(i), origTabData:s, newTabData:b
            }
            , d(t))return void(o= !0);
            c(t)&&(o= !0)
        }
        ),
        o
    }
    function C(t, n) {
        function r(t) {
            e(t.target).append(o.off(T.EVENTS.CLICK))
        }
        function a(r) {
            function a() {
                var n=e(this),
                r=n.parent("li"),
                a=r.parent(".dropdown-menu"),
                o=n.attr("href");
                r.hasClass("active")||(t.find("li.active").not(c).add(a.find("li.active")).removeClass("active"), c.add(r).addClass("active"), e(".tab-content .tab-pane.active").removeClass("active"), e(o).addClass("active"))
            }
            var i,
            s,
            l,
            c=e(r.target),
            d=c.offset(),
            b=t.find('li[role="presentation"].active');
            o=c.find(".dropdown-menu").attr("data-"+T.DATA_KEY_DDMENU_MODIFIED,  !0),
            b[0] !==c[0]&&o.find("li.active").removeClass("active"),
            o.on(T.EVENTS.CLICK, 'a[role="tab"]', a),
            e("body").append(o),
            i=o.width()+d.left,
            s=t.width()-(n.$slideRightArrow.outerWidth()+1),
            l=d.left,
            i>s&&(l-=i-s),
            o.css( {
                display: "block", top:d.top+c.outerHeight()-2, left:l
            }
            )
        }
        var o;
        t.on(T.EVENTS.DROPDOWN_MENU_SHOW, a).on(T.EVENTS.DROPDOWN_MENU_HIDE, r)
    }
    function v(e, t) {
        var n=e.data().scrtabs,
        r=n.scroller,
        a=e.find(".scrtabs-tab-container .nav-tabs"),
        o=e.find(".tab-content"),
        i= !1,
        s= {
            options: t, updatedTabsArray:n.tabs, updatedTabsLiContent:n.tabsLiContent, updatedTabsPostProcessors:n.tabsPostProcessors, propNames:n.propNames, ignoreTabPanes:n.ignoreTabPanes, $navTabs:a, $currTabLis:a.find("> li"), $currTabContentPanesContainer:o, $currTabContentPanes:o.find(".tab-pane")
        }
        ;
        return l(s)&&(i= !0),
        b(s)&&(i= !0),
        f(s)&&(i= !0),
        i&&r.initTabs(),
        i
    }
    function u(t, n) {
        t.data("scrtabs")&&( !t.data("scrtabs").isWrapperOnly&&v(t, n)||e("body").trigger(T.EVENTS.FORCE_REFRESH))
    }
    function h() {
        var t=e(this),
        n=t.data("scrtabs");
        n&&n.scroller.scrollToActiveTab()
    }
    function S() {
        var n,
        r=e(this),
        a=r.data("scrtabs");
        if(a) {
            for("self"===a.enableSwipingElement?r.removeClass(T.CSS_CLASSES.ALLOW_SCROLLBAR):"parent"===a.enableSwipingElement&&r.closest(".scrtabs-tab-container").parent().removeClass(T.CSS_CLASSES.ALLOW_SCROLLBAR), a.scroller.off(T.EVENTS.DROPDOWN_MENU_SHOW).off(T.EVENTS.DROPDOWN_MENU_HIDE), a.scroller.find("[data-"+T.DATA_KEY_DDMENU_MODIFIED+"]").css( {
                display: "", left:"", top:""
            }
            ).off(T.EVENTS.CLICK).removeAttr("data-"+T.DATA_KEY_DDMENU_MODIFIED), a.scroller.hasTabClickHandler&&r.find('a[data-toggle="tab"]').off(".scrtabs"), a.isWrapperOnly?(n=r.parents(".scrtabs-tab-container"), n.length&&n.replaceWith(r)):(a.scroller&&a.scroller.initTabs&&(a.scroller.initTabs=null), r.find(".scrtabs-tab-container").add(".tab-content").remove()), r.removeData("scrtabs");
            --e.fn.scrollingTabs.nextInstanceId>=0;
            )e(t).off(T.EVENTS.WINDOW_RESIZE+e.fn.scrollingTabs.nextInstanceId);
            e("body").off(T.EVENTS.FORCE_REFRESH)
        }
    }
    var T= {
        CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL:50,
        SCROLL_OFFSET_FRACTION:6,
        DATA_KEY_DDMENU_MODIFIED:"scrtabsddmenumodified",
        DATA_KEY_IS_MOUSEDOWN:"scrtabsismousedown",
        CSS_CLASSES: {
            BOOTSTRAP4: "scrtabs-bootstrap4", RTL:"scrtabs-rtl", SCROLL_ARROW_CLICK_TARGET:"scrtabs-click-target", SCROLL_ARROW_DISABLE:"scrtabs-disable", SCROLL_ARROW_WITH_CLICK_TARGET:"scrtabs-with-click-target"
        }
        ,
        SLIDE_DIRECTION: {
            LEFT: 1, RIGHT:2
        }
        ,
        EVENTS: {
            CLICK: "click.scrtabs", DROPDOWN_MENU_HIDE:"hide.bs.dropdown.scrtabs", DROPDOWN_MENU_SHOW:"show.bs.dropdown.scrtabs", FORCE_REFRESH:"forcerefresh.scrtabs", MOUSEDOWN:"mousedown.scrtabs", MOUSEUP:"mouseup.scrtabs", TABS_READY:"ready.scrtabs", TOUCH_END:"touchend.scrtabs", TOUCH_MOVE:"touchmove.scrtabs", TOUCH_START:"touchstart.scrtabs", WINDOW_RESIZE:"resize.scrtabs"
        }
    }
    ;
     !function(t) {
        var n=function(e, t, n) {
            var r;
            return function() {
                function a() {
                    n||e.apply(o, i),
                    r=null
                }
                var o=this,
                i=arguments;
                r?clearTimeout(r):n&&e.apply(o, i),
                r=setTimeout(a, t||100)
            }
        }
        ;
        e.fn[t]=function(e, r) {
            var a=r||T.EVENTS.WINDOW_RESIZE;
            return e?this.bind(a, n(e)): this.trigger(t)
        }
    }
    ("smartresizeScrtabs"),
    function(n) {
        n.initElements=function(e) {
            var t=this;
            t.setElementReferences(e),
            t.setEventListeners(e)
        }
        ,
        n.listenForTouchEvents=function() {
            var e,
            t,
            n,
            r=this,
            a=r.stc,
            o=a.scrollMovement,
            i=T.EVENTS,
            s= !1;
            a.$movableContainer.on(i.TOUCH_START, function(n) {
                s= !0, t=a.movableContainerLeftPos, e=n.originalEvent.changedTouches[0].pageX
            }
            ).on(i.TOUCH_END, function() {
                s= !1
            }
            ).on(i.TOUCH_MOVE, function(r) {
                if(s) {
                    var i=r.originalEvent.changedTouches[0].pageX, l=i-e;
                    a.rtl&&(l=-l);
                    var c;
                    n=t+l, n>0?n=0: (c=o.getMinPos(), n<c&&(n=c)), a.movableContainerLeftPos=n;
                    var d=a.rtl?"right": "left";
                    a.$movableContainer.css(d, o.getMovableContainerCssLeftVal()), o.refreshScrollArrowsDisabledState()
                }
            }
            )
        }
        ,
        n.refreshAllElementSizes=function() {
            var e,
            t=this,
            n=t.stc,
            r=n.scrollMovement,
            a=n.scrollArrowsVisible,
            o= {
                didScrollToActiveTab:  !1
            }
            ,
            i= !1;
            return t.setElementWidths(),
            t.setScrollArrowVisibility(),
            n.scrollArrowsVisible?(e=r.getMinPos(), i=r.scrollToActiveTab( {
                isOnWindowResize:  !0
            }
            ), i||(r.refreshScrollArrowsDisabledState(), n.rtl?n.movableContainerRightPos<e&&r.incrementMovableContainerLeft(e):n.movableContainerLeftPos<e&&r.incrementMovableContainerRight(e)), o.didScrollToActiveTab= !0):a&&(n.movableContainerLeftPos=0, r.slideMovableContainerToLeftPos()),
            o
        }
        ,
        n.setElementReferences=function(n) {
            var r,
            a,
            o,
            i,
            s=this,
            l=s.stc,
            c=l.$tabsContainer;
            l.isNavPills= !1,
            l.rtl&&c.addClass(T.CSS_CLASSES.RTL),
            l.usingBootstrap4&&c.addClass(T.CSS_CLASSES.BOOTSTRAP4),
            l.$fixedContainer=c.find(".scrtabs-tabs-fixed-container"),
            r=l.$fixedContainer.prev(),
            a=l.$fixedContainer.next(),
            n.leftArrowContent&&(o=r.find("."+T.CSS_CLASSES.SCROLL_ARROW_CLICK_TARGET)),
            n.rightArrowContent&&(i=a.find("."+T.CSS_CLASSES.SCROLL_ARROW_CLICK_TARGET)),
            o&&o.length?r.addClass(T.CSS_CLASSES.SCROLL_ARROW_WITH_CLICK_TARGET): o=r, i&&i.length?a.addClass(T.CSS_CLASSES.SCROLL_ARROW_WITH_CLICK_TARGET):i=a, l.$movableContainer=c.find(".scrtabs-tabs-movable-container"), l.$tabsUl=c.find(".nav-tabs"), l.$tabsUl.length||(l.$tabsUl=c.find(".nav-pills"), l.$tabsUl.length&&(l.isNavPills= !0)), l.$tabsLiCollection=l.$tabsUl.find("> li"), l.$slideLeftArrow=l.reverseScroll?r:a, l.$slideLeftArrowClickTarget=l.reverseScroll?o:i, l.$slideRightArrow=l.reverseScroll?a:r, l.$slideRightArrowClickTarget=l.reverseScroll?i:o, l.$scrollArrows=l.$slideLeftArrow.add(l.$slideRightArrow), l.$win=e(t)
        }
        ,
        n.setElementWidths=function() {
            var e=this,
            t=e.stc;
            t.winWidth=t.$win.width(),
            t.scrollArrowsCombinedWidth=t.$slideLeftArrow.outerWidth()+t.$slideRightArrow.outerWidth(),
            e.setFixedContainerWidth(),
            e.setMovableContainerWidth()
        }
        ,
        n.setEventListeners=function(t) {
            var n=this,
            r=n.stc,
            a=r.eventHandlers,
            o=T.EVENTS,
            i=o.WINDOW_RESIZE+r.instanceId;
            t.enableSwiping&&n.listenForTouchEvents(),
            r.$slideLeftArrowClickTarget.off(".scrtabs").on(o.MOUSEDOWN, function(e) {
                a.handleMousedownOnSlideMovContainerLeftArrow.call(a, e)
            }
            ).on(o.MOUSEUP, function(e) {
                a.handleMouseupOnSlideMovContainerLeftArrow.call(a, e)
            }
            ).on(o.CLICK, function(e) {
                a.handleClickOnSlideMovContainerLeftArrow.call(a, e)
            }
            ),
            r.$slideRightArrowClickTarget.off(".scrtabs").on(o.MOUSEDOWN, function(e) {
                a.handleMousedownOnSlideMovContainerRightArrow.call(a, e)
            }
            ).on(o.MOUSEUP, function(e) {
                a.handleMouseupOnSlideMovContainerRightArrow.call(a, e)
            }
            ).on(o.CLICK, function(e) {
                a.handleClickOnSlideMovContainerRightArrow.call(a, e)
            }
            ),
            r.tabClickHandler&&r.$tabsLiCollection.find('a[data-toggle="tab"]').off(o.CLICK).on(o.CLICK, r.tabClickHandler),
            r.$win.off(i).smartresizeScrtabs(function(e) {
                a.handleWindowResize.call(a, e)
            }
            , i),
            e("body").on(T.EVENTS.FORCE_REFRESH, r.elementsHandler.refreshAllElementSizes.bind(r.elementsHandler))
        }
        ,
        n.setFixedContainerWidth=function() {
            var e=this,
            t=e.stc,
            n=t.$tabsContainer.get(0).getBoundingClientRect();
            t.fixedContainerWidth=n.width||n.right-n.left,
            t.fixedContainerWidth=t.fixedContainerWidth*t.widthMultiplier,
            t.$fixedContainer.width(t.fixedContainerWidth)
        }
        ,
        n.setFixedContainerWidthForHiddenScrollArrows=function() {
            var e=this,
            t=e.stc;
            t.$fixedContainer.width(t.fixedContainerWidth)
        }
        ,
        n.setFixedContainerWidthForVisibleScrollArrows=function() {
            var e=this,
            t=e.stc;
            t.$fixedContainer.width(t.fixedContainerWidth-t.scrollArrowsCombinedWidth)
        }
        ,
        n.setMovableContainerWidth=function() {
            var t=this,
            n=t.stc,
            r=n.$tabsUl.find("> li");
            n.movableContainerWidth=0,
            r.length&&(r.each(function() {
                var t=e(this), r=0;
                n.isNavPills&&(r=parseInt(t.css("margin-left"), 10)+parseInt(t.css("margin-right"), 10)), n.movableContainerWidth+=t.outerWidth()+r
            }
            ), n.movableContainerWidth+=1, n.movableContainerWidth<n.fixedContainerWidth&&(n.movableContainerWidth=n.fixedContainerWidth)),
            n.$movableContainer.width(n.movableContainerWidth)
        }
        ,
        n.setScrollArrowVisibility=function() {
            var e=this,
            t=e.stc,
            n=t.movableContainerWidth>t.fixedContainerWidth;
            n&& !t.scrollArrowsVisible?(t.$scrollArrows.show(), t.scrollArrowsVisible= !0):  !n&&t.scrollArrowsVisible&&(t.$scrollArrows.hide(), t.scrollArrowsVisible= !1), t.scrollArrowsVisible?e.setFixedContainerWidthForVisibleScrollArrows():e.setFixedContainerWidthForHiddenScrollArrows()
        }
    }
    (n.prototype),
    function(e) {
        e.handleClickOnSlideMovContainerLeftArrow=function() {
            this.stc.scrollMovement.incrementMovableContainerLeft()
        }
        ,
        e.handleClickOnSlideMovContainerRightArrow=function() {
            this.stc.scrollMovement.incrementMovableContainerRight()
        }
        ,
        e.handleMousedownOnSlideMovContainerLeftArrow=function() {
            var e=this,
            t=e.stc;
            t.$slideLeftArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN,  !0),
            t.scrollMovement.continueSlideMovableContainerLeft()
        }
        ,
        e.handleMousedownOnSlideMovContainerRightArrow=function() {
            var e=this,
            t=e.stc;
            t.$slideRightArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN,  !0),
            t.scrollMovement.continueSlideMovableContainerRight()
        }
        ,
        e.handleMouseupOnSlideMovContainerLeftArrow=function() {
            this.stc.$slideLeftArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN,  !1)
        }
        ,
        e.handleMouseupOnSlideMovContainerRightArrow=function() {
            this.stc.$slideRightArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN,  !1)
        }
        ,
        e.handleWindowResize=function() {
            var e=this,
            t=e.stc,
            n=t.$win.width();
            if(n===t.winWidth)return !1;
            t.winWidth=n,
            t.elementsHandler.refreshAllElementSizes()
        }
    }
    (r.prototype),
    function(t) {
        t.continueSlideMovableContainerLeft=function() {
            var e=this,
            t=e.stc;
            setTimeout(function() {
                t.movableContainerLeftPos<=e.getMinPos()|| !t.$slideLeftArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN)||e.incrementMovableContainerLeft()||e.continueSlideMovableContainerLeft()
            }
            , T.CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL)
        }
        ,
        t.continueSlideMovableContainerRight=function() {
            var e=this,
            t=e.stc;
            setTimeout(function() {
                t.movableContainerLeftPos>=0|| !t.$slideRightArrowClickTarget.data(T.DATA_KEY_IS_MOUSEDOWN)||e.incrementMovableContainerRight()||e.continueSlideMovableContainerRight()
            }
            , T.CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL)
        }
        ,
        t.decrementMovableContainerLeftPos=function(e) {
            var t=this,
            n=t.stc;
            n.movableContainerLeftPos-=n.fixedContainerWidth/T.SCROLL_OFFSET_FRACTION,
            n.movableContainerLeftPos<e?n.movableContainerLeftPos=e: n.scrollToTabEdge&&(t.setMovableContainerLeftPosToTabEdge(T.SLIDE_DIRECTION.LEFT), n.movableContainerLeftPos<e&&(n.movableContainerLeftPos=e))
        }
        ,
        t.disableSlideLeftArrow=function() {
            var e=this,
            t=e.stc;
            t.disableScrollArrowsOnFullyScrolled&&t.scrollArrowsVisible&&t.$slideLeftArrow.addClass(T.CSS_CLASSES.SCROLL_ARROW_DISABLE)
        }
        ,
        t.disableSlideRightArrow=function() {
            var e=this,
            t=e.stc;
            t.disableScrollArrowsOnFullyScrolled&&t.scrollArrowsVisible&&t.$slideRightArrow.addClass(T.CSS_CLASSES.SCROLL_ARROW_DISABLE)
        }
        ,
        t.enableSlideLeftArrow=function() {
            var e=this,
            t=e.stc;
            t.disableScrollArrowsOnFullyScrolled&&t.scrollArrowsVisible&&t.$slideLeftArrow.removeClass(T.CSS_CLASSES.SCROLL_ARROW_DISABLE)
        }
        ,
        t.enableSlideRightArrow=function() {
            var e=this,
            t=e.stc;
            t.disableScrollArrowsOnFullyScrolled&&t.scrollArrowsVisible&&t.$slideRightArrow.removeClass(T.CSS_CLASSES.SCROLL_ARROW_DISABLE)
        }
        ,
        t.getMinPos=function() {
            var e=this,
            t=e.stc;
            return t.scrollArrowsVisible?t.fixedContainerWidth-t.movableContainerWidth-t.scrollArrowsCombinedWidth: 0
        }
        ,
        t.getMovableContainerCssLeftVal=function() {
            var e=this,
            t=e.stc;
            return 0===t.movableContainerLeftPos?"0": t.movableContainerLeftPos+"px"
        }
        ,
        t.incrementMovableContainerLeft=function() {
            var e=this,
            t=e.stc,
            n=e.getMinPos();
            return e.decrementMovableContainerLeftPos(n),
            e.slideMovableContainerToLeftPos(),
            e.enableSlideRightArrow(),
            t.movableContainerLeftPos===n
        }
        ,
        t.incrementMovableContainerRight=function(e) {
            var t=this,
            n=t.stc;
            return e?n.movableContainerLeftPos=e: (n.movableContainerLeftPos+=n.fixedContainerWidth/T.SCROLL_OFFSET_FRACTION, n.movableContainerLeftPos>0?n.movableContainerLeftPos=0:n.scrollToTabEdge&&t.setMovableContainerLeftPosToTabEdge(T.SLIDE_DIRECTION.RIGHT)), t.slideMovableContainerToLeftPos(), t.enableSlideLeftArrow(), 0===n.movableContainerLeftPos
        }
        ,
        t.refreshScrollArrowsDisabledState=function() {
            var e=this,
            t=e.stc;
            if(t.disableScrollArrowsOnFullyScrolled&&t.scrollArrowsVisible) {
                if(t.movableContainerLeftPos>=0)return e.disableSlideRightArrow(),
                void e.enableSlideLeftArrow();
                if(t.movableContainerLeftPos<=e.getMinPos())return e.disableSlideLeftArrow(),
                void e.enableSlideRightArrow();
                e.enableSlideLeftArrow(),
                e.enableSlideRightArrow()
            }
        }
        ,
        t.scrollToActiveTab=function() {
            var e,
            t,
            n,
            r,
            a,
            o,
            i,
            s=this,
            l=s.stc;
            if(l.scrollArrowsVisible&&(l.usingBootstrap4?(t=l.$tabsUl.find("li > .nav-link.active"), t.length&&(e=t.parent())): e=l.$tabsUl.find("li.active"), e&&e.length)) {
                if(i=l.$slideRightArrow.outerWidth(), n=e.offset().left-l.$fixedContainer.offset().left, r=n+e.outerWidth(), a=l.fixedContainerWidth-i, l.rtl) {
                    if(o=l.$slideLeftArrow.outerWidth(), n<0)return l.movableContainerLeftPos+=n, s.slideMovableContainerToLeftPos(),  !0;
                    if(r>a)return l.movableContainerLeftPos+=r-a+2*i,
                    s.slideMovableContainerToLeftPos(),
                     !0
                }
                else {
                    if(r>a)return l.movableContainerLeftPos-=r-a+i,
                    s.slideMovableContainerToLeftPos(),
                     !0;
                    if(o=l.$slideLeftArrow.outerWidth(), n<o)return l.movableContainerLeftPos+=o-n,
                    s.slideMovableContainerToLeftPos(),
                     !0
                }
                return !1
            }
        }
        ,
        t.setMovableContainerLeftPosToTabEdge=function(t) {
            var n=this,
            r=n.stc,
            a=-r.movableContainerLeftPos,
            o=0;
            r.$tabsLiCollection.each(function() {
                var n=e(this).width();
                if((o+=n)>a)return r.movableContainerLeftPos=t===T.SLIDE_DIRECTION.RIGHT?-(o-n): -o,  !1
            }
            )
        }
        ,
        t.slideMovableContainerToLeftPos=function() {
            var e,
            t=this,
            n=t.stc,
            r=t.getMinPos();
            n.movableContainerLeftPos>0?n.movableContainerLeftPos=0: n.movableContainerLeftPos<r&&(n.movableContainerLeftPos=r), n.movableContainerLeftPos=n.movableContainerLeftPos/1, e=t.getMovableContainerCssLeftVal(), t.performingSlideAnim= !0;
            var a=n.rtl? {
                right: e
            }
            : {
                left: e
            }
            ;
            n.$movableContainer.stop().animate(a, "slow", function() {
                var e=t.getMinPos();
                t.performingSlideAnim= !1, n.movableContainerLeftPos<e?(t.decrementMovableContainerLeftPos(e), a=n.rtl? {
                    right: t.getMovableContainerCssLeftVal()
                }
                : {
                    left: t.getMovableContainerCssLeftVal()
                }
                , n.$movableContainer.stop().animate(a, "fast", function() {
                    t.refreshScrollArrowsDisabledState()
                }
                )):t.refreshScrollArrowsDisabledState()
            }
            )
        }
    }
    (a.prototype),
    function(t) {
        t.initTabs=function(t, n, r, a) {
            function o() {
                n.find(".nav-tabs").show(),
                l.initElements(t),
                l.refreshAllElementSizes(),
                n.css("visibility", "visible"),
                a&&a(),
                r&&r()
            }
            var i,
            s=this,
            l=s.elementsHandler;
            t.enableRtlSupport&&"rtl"===e("html").attr("dir")&&(s.rtl= !0),
            t.scrollToTabEdge&&(s.scrollToTabEdge= !0),
            t.disableScrollArrowsOnFullyScrolled&&(s.disableScrollArrowsOnFullyScrolled= !0),
            t.reverseScroll&&(s.reverseScroll= !0),
            1 !==t.widthMultiplier&&(i=Number(t.widthMultiplier), isNaN(i)||(s.widthMultiplier=i)),
            "4"===t.bootstrapVersion.toString().charAt(0)&&(s.usingBootstrap4= !0),
            setTimeout(o, 100)
        }
        ,
        t.scrollToActiveTab=function(e) {
            this.scrollMovement.scrollToActiveTab(e)
        }
    }
    (o.prototype);
    var A=function() {
        function t(t) {
            return e(t.find("a").attr("href"))
        }
        function n() {
            return e('<ul class="nav nav-tabs" role="tablist"></ul>')
        }
        function r(t, n) {
            var r=e('<div class="scrtabs-tab-container"></div>'),
            a=n.leftArrowContent||'<div class="scrtabs-tab-scroll-arrow scrtabs-tab-scroll-arrow-left"><span class="'+n.cssClassLeftArrow+'"></span></div>',
            o=e(a),
            i=n.rightArrowContent||'<div class="scrtabs-tab-scroll-arrow scrtabs-tab-scroll-arrow-right"><span class="'+n.cssClassRightArrow+'"></span></div>',
            s=e(i),
            l=e('<div class="scrtabs-tabs-fixed-container"></div>'),
            c=e('<div class="scrtabs-tabs-movable-container"></div>');
            return n.disableScrollArrowsOnFullyScrolled&&o.add(s).addClass(T.CSS_CLASSES.SCROLL_ARROW_DISABLE),
            r.append(o, l.append(c.append(t)), s)
        }
        function a(t, n) {
            return e('<a role="tab" data-toggle="tab"></a>').attr("href", "#"+t[n.paneId]).html(t[n.title])
        }
        function o() {
            return e('<div class="tab-content"></div>')
        }
        function i(t, n, r) {
            var o=r.tabLiContent||'<li role="presentation" class=""></li>',
            i=e(o),
            s=a(t, n).appendTo(i);
            return t[n.disabled]?(i.addClass("disabled"), s.attr("data-toggle", "")): r.forceActiveTab&&t[n.active]&&i.addClass("active"), r.tabPostProcessor&&r.tabPostProcessor(i, s), i
        }
        function s(t, n, r) {
            var a=e('<div role="tabpanel" class="tab-pane"></div>').attr("id", t[n.paneId]).html(t[n.content]);
            return r.forceActiveTab&&t[n.active]&&a.addClass("active"),
            a
        }
        return {
            getElTabPaneForLi: t, getNewElNavTabs:n, getNewElScrollerElementWrappingNavTabsInstance:r, getNewElTabAnchor:a, getNewElTabContent:o, getNewElTabLi:i, getNewElTabPane:s
        }
    }
    (),
    L=function() {
        function t(t, n, a) {
            var o= !1;
            return t.each(function(t) {
                var i=r(n, a.paneId, e(this).data("tab")[a.paneId]);
                if(i>-1&&i !==t)return o= !0,  !1
            }
            ),
            o
        }
        function n(e, t) {
            for(var n=e.length-1, r=-1, a=0, o=0;
            -1===r&&o>=0;
            )((o=t+ ++a)<=n&& !e.eq(o).hasClass("disabled")||(o=t-a)>=0&& !e.eq(o).hasClass("disabled"))&&(r=o);
            return r
        }
        function r(e, t, n) {
            var r=-1;
            return e.some(function(e, a) {
                if(e[t]===n)return r=a,  !0
            }
            ),
            r
        }
        function a(t, n, r) {
            t.data( {
                tab:e.extend( {}
                , n[r]), index: r
            }
            )
        }
        return {
            didTabOrderChange: t, getIndexOfClosestEnabledTab:n, getTabIndexByPaneId:r, storeDataOnLiEl:a
        }
    }
    (),
    E= {
        destroy:function() {
            return this.each(S)
        }
        ,
        init:function(t) {
            var n=this,
            r=n.length-1,
            a=e.extend( {}
            , e.fn.scrollingTabs.defaults, t|| {}
            );
            return a.tabs?n.each(function(t) {
                i(e(this), a, t<r?null:function() {
                    n.trigger(T.EVENTS.TABS_READY)
                }
                )
            }
            ):n.each(function(t) {
                var o= {
                    isWrapperOnly:  !0
                }
                ;
                s(e(this).data( {
                    scrtabs: o
                }
                ), a, t<r?null:function() {
                    n.trigger(T.EVENTS.TABS_READY)
                }
                )
            }
            )
        }
        ,
        refresh:function(t) {
            var n=this,
            r=e.extend( {}
            , e.fn.scrollingTabs.defaults, t|| {}
            );
            return n.each(function() {
                u(e(this), r)
            }
            )
        }
        ,
        scrollToActiveTab:function() {
            return this.each(h)
        }
    }
    ;
    e.fn.scrollingTabs=function(t) {
        return E[t]?E[t].apply(this, Array.prototype.slice.call(arguments, 1)): t&&"object" !=typeof t?void e.error("Method "+t+" does not exist on $.scrollingTabs."):E.init.apply(this, arguments)
    }
    ,
    e.fn.scrollingTabs.nextInstanceId=0,
    e.fn.scrollingTabs.defaults= {
        tabs: null, propPaneId:"paneId", propTitle:"title", propActive:"active", propDisabled:"disabled", propContent:"content", ignoreTabPanes: !1, scrollToTabEdge: !1, disableScrollArrowsOnFullyScrolled: !1, forceActiveTab: !1, reverseScroll: !1, widthMultiplier:1, tabClickHandler:null, cssClassLeftArrow:"glyphicon glyphicon-chevron-left", cssClassRightArrow:"glyphicon glyphicon-chevron-right", leftArrowContent:"", rightArrowContent:"", tabsLiContent:null, tabsPostProcessors:null, enableSwiping: !1, enableRtlSupport: !1, bootstrapVersion:3
    }
}

(jQuery, window);
jQuery.fn.endlessRiver=function(n) {
    return n=jQuery.extend( {
        speed: 30, pause: !0, buttons: !1
    }
    , n),
    this.each(function() {
        function h(n, i) {
            t.animate( {
                left: "-="+n
            }
            , i, "linear", function() {
                t.children("li:first").appendTo(t);
                t.css("left", 0);
                u=t.children("li:first").outerWidth( !0);
                o=i/n*u;
                r&&h(u, o)
            }
            )
        }
        function a() {
            t.hover(b, k)
        }
        function b() {
            r= !1;
            t.stop()
        }
        function k() {
            r= !0;
            var i=t.offset().left, n=i+t.children("li:first").outerWidth( !0)-c, f=o/u*n;
            h(n, f)
        }
        var i=jQuery, t=i(this), f="ER_"+(new Date).getTime(), v, e;
        t.wrap('<div id="'+f+'"><\/div>');
        t.css( {
            margin: "0 !important", padding:"0 !important"
        }
        );
        var u, o, r= !0, c=t.offset().left, s=1;
        t.children("li.tick-clones").remove();
        t.addClass("newsticker");
        for(var d=t.wrap("<div class='mask'><\/div>"), l=t.parent().wrap("<div class='tickercontainer'><\/div>"), y=t.children("li"), p=function() {
            s=1;
            t.append(y.clone( !0).addClass("tick-clones"));
            t.children("li").each(function(n) {
                s+=i(this, n).outerWidth( !0)
            }
            )
        }
        , w=l.outerWidth( !0);
        s<w;
        )p();
        if(t.width(s), u=t.children("li:first").outerWidth( !0), o=u/n.speed*1e3, h(u, o), n.pause&&a(), n.buttons) {
            v=i('<ul class="er-controls"><li class="prev glyphicon glyphicon-chevron-left"><\/li><li class="pause glyphicon glyphicon-pause"><\/li><li class="next glyphicon glyphicon-chevron-right"><\/li><\/ul>');
            v.insertAfter(l);
            i("body").on("click", "#"+f+" .er-controls > .pause", function() {
                if( !r)return !1;
                i(this).toggleClass("pause glyphicon-pause play glyphicon-play");
                t.unbind("mouseenter mouseleave");
                r= !1
            }
            );
            i("body").on("click", "#"+f+" .er-controls > .play", function() {
                if(r)return !1;
                i(this).toggleClass("pause glyphicon-pause play glyphicon-play");
                r= !0;
                a();
                var f=t.offset().left, n=f+t.children("li:first").outerWidth( !0)-c, e=o/u*n;
                h(n, e)
            }
            );
            e= !1;
            i("body").on("click", "#"+f+" .er-controls > .next", function() {
                if(r) {
                    i("#"+f+" .er-controls > .pause").toggleClass("pause glyphicon-pause play glyphicon-play");
                    r= !1;
                    return
                }
                if(e)return !1;
                var u=t.children("li:first").outerWidth( !0), o=u/n.speed*1e3;
                e= !0;
                t.stop( !0,  !0).animate( {
                    left: "-="+u
                }
                , o, "linear", function() {
                    t.children("li:first").appendTo(t);
                    t.css("left", 0);
                    e= !1
                }
                )
            }
            );
            i("body").on("click", "#"+f+" .er-controls > .prev", function() {
                var u, o;
                if(r) {
                    i("#"+f+" .er-controls > .pause").toggleClass("pause glyphicon-pause play glyphicon-play");
                    r= !1;
                    return
                }
                if(e)return !1;
                u=t.children("li:last").outerWidth( !0);
                t.css("left", "-"+u+"px");
                t.children("li:last").prependTo(t);
                o=u/n.speed*1e3;
                e= !0;
                t.stop( !0,  !0).animate( {
                    left: "+="+u
                }
                , o, "linear", function() {
                    e= !1
                }
                )
            }
            )
        }
    }
    )
}

;
$(()=> {
    function c() {
        const n=u.querySelectorAll(".prediction-item");
        return n.length>=2?n[1].offsetLeft-n[0].offsetLeft: n.length===1?n[0].offsetWidth:void 0
    }
    function l() {
        const n=u.scrollWidth-u.clientWidth;
        u.scrollLeft<=0?(f.style.backgroundColor="#989898", f.style.pointerEvents="none"): (f.style.backgroundColor="", f.style.pointerEvents="auto");
        u.scrollLeft>=n-1?(e.style.backgroundColor="#989898", e.style.pointerEvents="none"): (e.style.backgroundColor="", e.style.pointerEvents="auto")
    }
    const o=document.querySelector("#announcement_list");
    o&&o.childElementCount>0&&$(o).endlessRiver();
    const s=document.querySelector("#popular_providers");
    if(s) {
        $(s).scrollingTabs( {
            enableSwiping:  !0, scrollToTabEdge: !0, disableScrollArrowsOnFullyScrolled: !0
        }
        );
        const n=document.querySelector('#popular_providers [data-toggle="tab"]');
        n&&n.click()
    }
    const n=document.querySelector("#featured_games");
    if(n) {
        const i=document.querySelector("#previous_new_featured_game"), r=document.querySelector("#next_new_featured_game"), t=250;
        i.onclick=()=> {
            const i=Math.ceil(n.querySelector("a").clientWidth), r=Math.ceil(n.scrollLeft/i)-1, u=Math.floor(n.scrollWidth/i), f=Math.ceil(r*i);
            if(r<0) {
                $(n).animate( {
                    scrollLeft: u*i
                }
                , t);
                return
            }
            if(u-r==1&&n.scrollLeft-f<i) {
                $(n).animate( {
                    scrollLeft: Math.ceil((r-1)*i)
                }
                , t);
                return
            }
            $(n).animate( {
                scrollLeft: f
            }
            , t)
        }
        ;
        r.onclick=()=> {
            const i=Math.ceil(n.querySelector("a").clientWidth), r=Math.ceil(n.scrollLeft/i)+1, f=Math.floor(n.scrollWidth/i), u=Math.ceil(r*i);
            if(r>=f) {
                $(n).animate( {
                    scrollLeft: 0
                }
                , t);
                return
            }
            if(n.scrollWidth-n.scrollLeft<=n.clientWidth&&n.scrollWidth-u<n.clientWidth) {
                $(n).animate( {
                    scrollLeft: 0
                }
                , t);
                return
            }
            $(n).animate( {
                scrollLeft: u
            }
            , t)
        }
    }
    const t=document.querySelector(".favourite_games");
    if(t) {
        const i=document.querySelector("#previous_favourite_game"), r=document.querySelector("#next_favourite_game"), n=250;
        i.onclick=()=> {
            const i=Math.ceil(t.querySelector(".game-item").clientWidth)*2, r=Math.ceil(t.scrollLeft/i)-1, u=Math.floor(t.scrollWidth/i), f=Math.ceil(r*i);
            if(r<0) {
                $(t).animate( {
                    scrollLeft: u*i
                }
                , n);
                return
            }
            if(u-r==1&&t.scrollLeft-f<i) {
                $(t).animate( {
                    scrollLeft: Math.ceil((r-1)*i)
                }
                , n);
                return
            }
            $(t).animate( {
                scrollLeft: f
            }
            , n)
        }
        ;
        r.onclick=()=> {
            const i=Math.ceil(t.querySelector(".game-item").clientWidth)*2, r=Math.ceil(t.scrollLeft/i)+1, f=Math.floor(t.scrollWidth/i), u=Math.ceil(r*i);
            if(r>=f) {
                $(t).animate( {
                    scrollLeft: 0
                }
                , n);
                return
            }
            if(t.scrollWidth-t.scrollLeft<=t.clientWidth&&t.scrollWidth-u<t.clientWidth) {
                $(t).animate( {
                    scrollLeft: 0
                }
                , n);
                return
            }
            $(t).animate( {
                scrollLeft: u
            }
            , n)
        }
    }
    const i=document.querySelector("#recent_games");
    if(i) {
        const t=document.querySelector("#previous_recent_game"), r=document.querySelector("#next_recent_game"), n=250;
        t.onclick=()=> {
            const t=Math.ceil(i.querySelector(".game-item").clientWidth)*2, r=Math.ceil(i.scrollLeft/t)-1, u=Math.floor(i.scrollWidth/t), f=Math.ceil(r*t);
            if(r<0) {
                $(i).animate( {
                    scrollLeft: u*t
                }
                , n);
                return
            }
            if(u-r==1&&i.scrollLeft-f<t) {
                $(i).animate( {
                    scrollLeft: Math.ceil((r-1)*t)
                }
                , n);
                return
            }
            $(i).animate( {
                scrollLeft: f
            }
            , n)
        }
        ;
        r.onclick=()=> {
            const t=Math.ceil(i.querySelector(".game-item").clientWidth)*2, r=Math.ceil(i.scrollLeft/t)+1, f=Math.floor(i.scrollWidth/t), u=Math.ceil(r*t);
            if(r>=f) {
                $(i).animate( {
                    scrollLeft: 0
                }
                , n);
                return
            }
            if(i.scrollWidth-i.scrollLeft<=i.clientWidth&&i.scrollWidth-u<i.clientWidth) {
                $(i).animate( {
                    scrollLeft: 0
                }
                , n);
                return
            }
            $(i).animate( {
                scrollLeft: u
            }
            , n)
        }
    }
    const a=document.querySelector("#rotate_slider");
    a&&$("#rotate_slider").rotateSlider();
    window.top !==window&&window.top.location.reload();
    const r=document.querySelector(".popular_games");
    if(r) {
        const t=document.querySelector("#previous_popular_game"), i=document.querySelector("#next_popular_game"), n=250;
        t.onclick=()=> {
            const t=Math.ceil(r.querySelector(".game-item").clientWidth), i=Math.ceil(r.scrollLeft/t)-1, u=Math.floor(r.scrollWidth/t), f=Math.ceil(i*t);
            if(i<0) {
                $(r).animate( {
                    scrollLeft: u*t
                }
                , n);
                return
            }
            if(u-i==1&&r.scrollLeft-f<t) {
                $(r).animate( {
                    scrollLeft: Math.ceil((i-1)*t)
                }
                , n);
                return
            }
            $(r).animate( {
                scrollLeft: f
            }
            , n)
        }
        ;
        i.onclick=()=> {
            const t=Math.ceil(r.querySelector(".game-item").clientWidth), i=Math.ceil(r.scrollLeft/t)+1, f=Math.floor(r.scrollWidth/t), u=Math.ceil(i*t);
            if(i>=f) {
                $(r).animate( {
                    scrollLeft: 0
                }
                , n);
                return
            }
            if(r.scrollWidth-r.scrollLeft<=r.clientWidth&&r.scrollWidth-u<r.clientWidth) {
                $(r).animate( {
                    scrollLeft: 0
                }
                , n);
                return
            }
            $(r).animate( {
                scrollLeft: u
            }
            , n)
        }
    }
    const h=document.querySelector("#banner_carousel");
    if(h) {
        $(h).slick( {
            slidesToShow: 1, slidesToScroll:1, dots: !0, dotsClass:"carousel-indicators", infinite: !0, autoplay: !0, autoplaySpeed:5e3, arrows: !1, adaptiveHeight: !1
        }
        );
        const n=document.querySelectorAll("#banner_carousel .banner-group-vertical");
        if(n) {
            $(n).slick( {
                slidesToShow: 1, slidesToScroll:1, dots: !0, dotsClass:"carousel-indicators", infinite: !0, autoplay: !0, autoplaySpeed:3e3, arrows: !1, adaptiveHeight: !1, vertical: !0, verticalSwiping: !0
            }
            );
            $(n).on("touchend mouseover mouseout", function() {
                $("#banner_carousel").slick("slickSetOption", "swipe",  !0,  !1)
            }
            )
        }
    }
    const u=document.querySelector(".prediction-list"), f=document.querySelector(".nav-arrow .prev"), e=document.querySelector(".nav-arrow .next");
    f&&f.addEventListener("click", ()=> {
        const n=c();
        u.scrollBy( {
            left: -n, behavior:"smooth"
        }
        )
    }
    );
    e&&e.addEventListener("click", ()=> {
        const n=c();
        u.scrollBy( {
            left: n, behavior:"smooth"
        }
        )
    }
    );
    u&&(u.addEventListener("scroll", l), window.addEventListener("load", l))
}

);
window.initializeReportingOverlayItemEvent=n=> {
    n.onclick||n.addEventListener("click", function(t) {
        if(t.target.closest(["a", "button", ".copy_account_number_button", ".copy-btn"])) {
            t.stopPropagation();
            return
        }
        const r=n.dataset.identifier, i=document.querySelector(`[data-reporting-detail][data-identifier="${r}"]`);
        if(i) {
            document.body.classList.add("no-scroll");
            i.classList.add("open");
            const n=i.querySelector(".close_reporting_detail_button");
            n&&(n.onclick=()=> {
                document.body.classList.remove("no-scroll"), i.classList.remove("open")
            }
            )
        }
    }
    )
}

;
window.initializeReportingPopupItemEvent=n=> {
    n.onclick||(n.onclick=()=> {
        const i=n.dataset.identifier, t=document.querySelector(`[data-reporting-detail-popup][data-identifier="${i}"]`);
        if(t) {
            t.classList.add("open");
            const n=t.querySelector(".close_reporting_detail_popup");
            n&&(n.onclick=()=> {
                t.classList.remove("open")
            }
            )
        }
    }
    )
}

;
window.initializePendingTransactionDetail=()=> {
    const n=document.querySelectorAll("[data-pending-transaction-info-header]");
    n&&n.length>0&&(Array.from(n).forEach(n=> {
        n.onclick||(n.onclick=()=> {
            n.parentElement.classList.toggle("open")
        }
        )
    }
    ), initializeCopyButton())
}

;
window.addEventListener("DOMContentLoaded", ()=> {
    const n=document.querySelectorAll("[data-reporting-item]");
    n&&n.length>0&&Array.from(n).forEach(n=> {
        window.initializeReportingOverlayItemEvent(n)
    }
    );
    const t=document.querySelectorAll("[data-reporting-row]");
    t&&t.length>0&&Array.from(t).forEach(n=> {
        initializeReportingPopupItemEvent(n)
    }
    );
    initializePendingTransactionDetail()
}

);
$(()=> {
    const n=document.querySelector("#date_range_picker"), t=document.querySelector("#starting_date"), i=document.querySelector("#ending_date"), r="DD-MMM-YYYY";
    n&&($(n).dateRangePicker( {
        format: r, separator:" "+n.dataset.separator+" "
    }
    ).bind("datepicker-change", function(n, u) {
        t.value=moment(u.date1).format(r);
        i.value=moment(u.date2).format(r)
    }
    ), $(n).data("dateRangePicker").setDateRange(t.value, i.value));
    const o=document.querySelectorAll(".table tfoot a");
    Array.prototype.slice.apply(o).forEach(n=> {
        n.href.includes("startingDate")=== !1&&(n.href+=`&startingDate=$ {
            t.value
        }
        `), n.href.includes("endingDate")=== !1&&(n.href+=`&endingDate=$ {
            i.value
        }
        `)
    }
    );
    const u=document.querySelector(".grid_table"), f=document.querySelector("#totals_template");
    u&&f&&u.appendChild(f.content.cloneNode( !0));
    const s=document.querySelectorAll(".pending_transaction");
    Array.prototype.slice.call(s).forEach(n=> {
        n.onclick=()=> {
            $.ajax( {
                type:"POST", data:JSON.stringify( {
                    ticketNumber: n.dataset.ticketNumber
                }
                ), url:"/reporting/pending-transaction", contentType:"application/json; charset=utf-8", dataType:"html", success:n=> {
                     !n||registerPopup( {
                        content: n, cssClass:"concise-transaction-popup"
                    }
                    )
                }
            }
            )
        }
    }
    );
    const h=document.querySelectorAll(".copy_ticket_button");
    h.forEach(n=> {
        $(n).popover( {
            content: n.dataset.popoverText, placement:"top", trigger:"manual"
        }
        ), n.onclick=()=> {
            if(navigator.clipboard) {
                const t=n.previousElementSibling;
                navigator.clipboard.writeText(t.innerText.replaceAll("-", "")).then(()=> {
                    const t=$(n);
                    t.popover("show");
                    setTimeout(()=>t.popover("hide"), 500)
                }
                ).catch(n=>console.log("Error when copying account number: "+n))
            }
        }
    }
    );
    const c=document.querySelectorAll(".row_attributes");
    c.forEach(n=> {
        const t=n.parentElement.parentElement;
        Object.assign(t.dataset, n.dataset);
        window.initializeReportingPopupItemEvent(t)
    }
    );
    const e=document.querySelector(".reporting_table");
    if(e) {
        const n=e.querySelector("tfoot tr");
        if(n) {
            const t=n.querySelector("td");
            t.classList.add("pagination-section")
        }
    }
}

);