!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)
        return;
    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()
}
);
$( () => {
    const n = 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))
                }
            }
        }
        )
    }
    ;
    window.copyAccountNumberOptions && n(window.copyAccountNumberOptions)
}
);
/**
 * 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(n, t) {
    "use strict";
    function e(n) {
        var t = this;
        t.stc = n
    }
    function o(n) {
        var t = this;
        t.stc = n
    }
    function s(n) {
        var t = this;
        t.stc = n
    }
    function h(t) {
        var i = this;
        i.$tabsContainer = t;
        i.instanceId = n.fn.scrollingTabs.nextInstanceId++;
        i.movableContainerLeftPos = 0;
        i.scrollArrowsVisible = !1;
        i.scrollToTabEdge = !1;
        i.disableScrollArrowsOnFullyScrolled = !1;
        i.reverseScroll = !1;
        i.widthMultiplier = 1;
        i.scrollMovement = new s(i);
        i.eventHandlers = new o(i);
        i.elementsHandler = new e(i)
    }
    function l(t, i, f) {
        var e = i.tabs, s = {
            paneId: i.propPaneId,
            title: i.propTitle,
            active: i.propActive,
            disabled: i.propDisabled,
            content: i.propContent
        }, h = i.ignoreTabPanes, l = e.length && e[0][s.content] !== undefined, a = r.getNewElNavTabs(), v = r.getNewElTabContent(), o, y = h ? null : function() {
            o.after(v)
        }
        ;
        if (e.length)
            return e.forEach(function(n, t) {
                var u = {
                    forceActiveTab: !0,
                    tabLiContent: i.tabsLiContent && i.tabsLiContent[t],
                    tabPostProcessor: i.tabsPostProcessors && i.tabsPostProcessors[t]
                };
                r.getNewElTabLi(n, s, u).appendTo(a);
                !h && l && r.getNewElTabPane(n, s, u).appendTo(v)
            }),
            o = c(a, i, f, y),
            o.appendTo(t),
            t.data({
                scrtabs: {
                    tabs: e,
                    propNames: s,
                    ignoreTabPanes: h,
                    hasTabContent: l,
                    tabsLiContent: i.tabsLiContent,
                    tabsPostProcessors: i.tabsPostProcessors,
                    scroller: o
                }
            }),
            o.find(".nav-tabs > li").each(function(t) {
                u.storeDataOnLiEl(n(this), e, t)
            }),
            t
    }
    function c(n, t, i, u) {
        var f = r.getNewElScrollerElementWrappingNavTabsInstance(n.clone(!0), t)
          , e = new h(f)
          , o = n.data("scrtabs");
        return o ? o.scroller = f : n.data("scrtabs", {
            scroller: f
        }),
        n.replaceWith(f.css("visibility", "hidden")),
        t.tabClickHandler && typeof t.tabClickHandler == "function" && (f.hasTabClickHandler = !0,
        e.tabClickHandler = t.tabClickHandler),
        f.initTabs = function() {
            e.initTabs(t, f, i, u)
        }
        ,
        f.scrollToActiveTab = function() {
            e.scrollToActiveTab(t)
        }
        ,
        f.initTabs(),
        b(f, e),
        f
    }
    function a(n) {
        var o = n.updatedTabsArray
          , h = n.updatedTabsLiContent || []
          , c = n.updatedTabsPostProcessors || []
          , t = n.propNames
          , f = n.ignoreTabPanes
          , i = n.options
          , e = n.$currTabLis
          , l = n.$navTabs
          , a = f ? null : n.$currTabContentPanesContainer
          , v = f ? null : n.$currTabContentPanes
          , s = !1;
        return o.forEach(function(n, y) {
            var p = e.find('a[href="#' + n[t.paneId] + '"]'), b = y >= e.length, w;
            p.length || (s = !0,
            i.tabLiContent = h[y],
            i.tabPostProcessor = c[y],
            p = r.getNewElTabLi(n, t, i),
            u.storeDataOnLiEl(p, o, y),
            b ? p.appendTo(l) : p.insertBefore(e.eq(y)),
            f || n[t.content] === undefined || (w = r.getNewElTabPane(n, t, i),
            b ? w.appendTo(a) : w.insertBefore(v.eq(y))))
        }),
        s
    }
    function v(n) {
        var e = n.tabLi
          , s = n.ignoreTabPanes
          , u = e.$li
          , o = e.$contentPane
          , r = e.origTabData
          , i = e.newTabData
          , t = n.propNames
          , f = !1;
        return r[t.title] !== i[t.title] && (u.find('a[role="tab"]').html(r[t.title] = i[t.title]),
        f = !0),
        r[t.disabled] !== i[t.disabled] && (i[t.disabled] ? (u.addClass("disabled"),
        u.find('a[role="tab"]').attr("data-bs-toggle", "")) : (u.removeClass("disabled"),
        u.find('a[role="tab"]').attr("data-bs-toggle", "tab")),
        r[t.disabled] = i[t.disabled],
        f = !0),
        n.options.forceActiveTab && (u.find('a[role="tab"]')[i[t.active] ? "addClass" : "removeClass"]("active"),
        o[i[t.active] ? "addClass" : "removeClass"]("active"),
        r[t.active] = i[t.active],
        f = !0),
        s || r[t.content] === i[t.content] || (o.html(r[t.content] = i[t.content]),
        f = !0),
        f
    }
    function y(n) {
        var t = n.tabLi, r = n.ignoreTabPanes, f = t.$li, i;
        return t.newIdx !== -1 ? !1 : (f.hasClass("active") && (i = u.getIndexOfClosestEnabledTab(n.$currTabLis, t.currDomIdx),
        i > -1 && (n.$currTabLis.eq(i).addClass("active"),
        r || n.$currTabContentPanes.eq(i).addClass("active"))),
        f.remove(),
        r || t.$contentPane.remove(),
        !0)
    }
    function p(t) {
        var r = t.$currTabLis
          , f = t.updatedTabsArray
          , e = t.propNames
          , i = t.ignoreTabPanes
          , o = []
          , s = i ? null : [];
        return u.didTabOrderChange(r, f, e) ? (f.forEach(function(t) {
            var u = t[e.paneId];
            o.push(r.find('a[role="tab"][href="#' + u + '"]').parent("li"));
            i || s.push(n("#" + u))
        }),
        t.$navTabs.append(o),
        i || t.$currTabContentPanesContainer.append(s),
        !0) : !1
    }
    function w(t) {
        var o = t.$currTabLis
          , f = t.updatedTabsArray
          , e = t.propNames
          , i = !1;
        return o.each(function(o) {
            var s = n(this)
              , c = s.data("tab")
              , h = u.getTabIndexByPaneId(f, e.paneId, c[e.paneId])
              , l = h > -1 ? f[h] : null;
            if (t.tabLi = {
                $li: s,
                currDomIdx: o,
                newIdx: h,
                $contentPane: r.getElTabPaneForLi(s),
                origTabData: c,
                newTabData: l
            },
            y(t)) {
                i = !0;
                return
            }
            v(t) && (i = !0)
        }),
        i
    }
    function b(t, r) {
        function f(t) {
            n(t.target).append(u.off(i.EVENTS.CLICK))
        }
        function e(f) {
            function a() {
                var i = n(this)
                  , r = i.parent("li")
                  , u = r.parent(".dropdown-menu")
                  , f = i.attr("href");
                i.hasClass("active") || (t.find("li > a.active").not(e.children("a")).add(u.find("li > a.active")).removeClass("active"),
                e.children("a").add(i).addClass("active"),
                n(".tab-content .tab-pane.active").removeClass("active"),
                n(f).addClass("active"))
            }
            var e = n(f.target), o = e.offset(), l = t.find('li[role="presentation"] > a.active').parent(), s, h, c;
            u = e.find(".dropdown-menu").attr("data-" + i.DATA_KEY_DDMENU_MODIFIED, !0);
            l[0] !== e[0] && u.find("li > a.active").removeClass("active");
            u.on(i.EVENTS.CLICK, 'a[role="tab"]', a);
            n("body").append(u);
            s = u.width() + o.left;
            h = t.width() - (r.$slideRightArrow.outerWidth() + 1);
            c = o.left;
            s > h && (c -= s - h);
            u.css({
                display: "block",
                top: o.top + e.outerHeight() - 2,
                left: c
            })
        }
        var u;
        t.on(i.EVENTS.DROPDOWN_MENU_SHOW, e).on(i.EVENTS.DROPDOWN_MENU_HIDE, f)
    }
    function k(n, t) {
        var i = n.data().scrtabs
          , o = i.scroller
          , f = n.find(".scrtabs-tab-container .nav-tabs")
          , e = n.find(".tab-content")
          , r = !1
          , u = {
            options: t,
            updatedTabsArray: i.tabs,
            updatedTabsLiContent: i.tabsLiContent,
            updatedTabsPostProcessors: i.tabsPostProcessors,
            propNames: i.propNames,
            ignoreTabPanes: i.ignoreTabPanes,
            $navTabs: f,
            $currTabLis: f.find("> li"),
            $currTabContentPanesContainer: e,
            $currTabContentPanes: e.find(".tab-pane")
        };
        return a(u) && (r = !0),
        p(u) && (r = !0),
        w(u) && (r = !0),
        r && o.initTabs(),
        r
    }
    function d(t, r) {
        t.data("scrtabs") && (t.data("scrtabs").isWrapperOnly || !k(t, r)) && n("body").trigger(i.EVENTS.FORCE_REFRESH)
    }
    function g() {
        var i = n(this)
          , t = i.data("scrtabs");
        t && t.scroller.scrollToActiveTab()
    }
    function nt() {
        var u = n(this), r = u.data("scrtabs"), f;
        if (r) {
            for (r.enableSwipingElement === "self" ? u.removeClass(i.CSS_CLASSES.ALLOW_SCROLLBAR) : r.enableSwipingElement === "parent" && u.closest(".scrtabs-tab-container").parent().removeClass(i.CSS_CLASSES.ALLOW_SCROLLBAR),
            r.scroller.off(i.EVENTS.DROPDOWN_MENU_SHOW).off(i.EVENTS.DROPDOWN_MENU_HIDE),
            r.scroller.find("[data-" + i.DATA_KEY_DDMENU_MODIFIED + "]").css({
                display: "",
                left: "",
                top: ""
            }).off(i.EVENTS.CLICK).removeAttr("data-" + i.DATA_KEY_DDMENU_MODIFIED),
            r.scroller.hasTabClickHandler && u.find('a[data-bs-toggle="tab"]').off(".scrtabs"),
            r.isWrapperOnly ? (f = u.parents(".scrtabs-tab-container"),
            f.length && f.replaceWith(u)) : (r.scroller && r.scroller.initTabs && (r.scroller.initTabs = null),
            u.find(".scrtabs-tab-container").add(".tab-content").remove()),
            u.removeData("scrtabs"); --n.fn.scrollingTabs.nextInstanceId >= 0; )
                n(t).off(i.EVENTS.WINDOW_RESIZE + n.fn.scrollingTabs.nextInstanceId);
            n("body").off(i.EVENTS.FORCE_REFRESH)
        }
    }
    var i = {
        CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL: 50,
        SCROLL_OFFSET_FRACTION: 6,
        DATA_KEY_DDMENU_MODIFIED: "scrtabsddmenumodified",
        DATA_KEY_IS_MOUSEDOWN: "scrtabsismousedown",
        CSS_CLASSES: {
            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"
        }
    }, r, u, f;
    (function(t) {
        var r = function(n, t, i) {
            var r;
            return function() {
                function e() {
                    i || n.apply(u, f);
                    r = null
                }
                var u = this
                  , f = arguments;
                r ? clearTimeout(r) : i && n.apply(u, f);
                r = setTimeout(e, t || 100)
            }
        };
        n.fn[t] = function(n, u) {
            var f = u || i.EVENTS.WINDOW_RESIZE;
            return n ? this.bind(f, r(n)) : this.trigger(t)
        }
    }
    )("smartresizeScrtabs"),
    function(r) {
        r.initElements = function(n) {
            var t = this;
            t.setElementReferences(n);
            t.setEventListeners(n)
        }
        ;
        r.listenForTouchEvents = function() {
            var s = this, n = s.stc, r = n.scrollMovement, u = i.EVENTS, f = !1, e, o, t;
            n.$movableContainer.on(u.TOUCH_START, function(t) {
                f = !0;
                o = n.movableContainerLeftPos;
                e = t.originalEvent.changedTouches[0].pageX
            }).on(u.TOUCH_END, function() {
                f = !1
            }).on(u.TOUCH_MOVE, function(i) {
                var h, u, s, c;
                f && (h = i.originalEvent.changedTouches[0].pageX,
                u = h - e,
                n.rtl && (u = -u),
                t = o + u,
                t > 0 ? t = 0 : (s = r.getMinPos(),
                t < s && (t = s)),
                n.movableContainerLeftPos = t,
                c = n.rtl ? "right" : "left",
                n.$movableContainer.css(c, r.getMovableContainerCssLeftVal()),
                r.refreshScrollArrowsDisabledState())
            })
        }
        ;
        r.refreshAllElementSizes = function() {
            var r = this, n = r.stc, t = n.scrollMovement, e = n.scrollArrowsVisible, u = {
                didScrollToActiveTab: !1
            }, f = !1, i;
            return r.setElementWidths(),
            r.setScrollArrowVisibility(),
            n.scrollArrowsVisible ? (i = t.getMinPos(),
            f = t.scrollToActiveTab({
                isOnWindowResize: !0
            }),
            f || (t.refreshScrollArrowsDisabledState(),
            n.rtl ? n.movableContainerRightPos < i && t.incrementMovableContainerLeft(i) : n.movableContainerLeftPos < i && t.incrementMovableContainerRight(i)),
            u.didScrollToActiveTab = !0) : e && (n.movableContainerLeftPos = 0,
            t.slideMovableContainerToLeftPos()),
            u
        }
        ;
        r.setElementReferences = function(r) {
            var c = this, u = c.stc, h = u.$tabsContainer, f, e, o, s;
            u.isNavPills = !1;
            u.rtl && h.addClass(i.CSS_CLASSES.RTL);
            u.$fixedContainer = h.find(".scrtabs-tabs-fixed-container");
            f = u.$fixedContainer.prev();
            e = u.$fixedContainer.next();
            r.leftArrowContent && (o = f.find("." + i.CSS_CLASSES.SCROLL_ARROW_CLICK_TARGET));
            r.rightArrowContent && (s = e.find("." + i.CSS_CLASSES.SCROLL_ARROW_CLICK_TARGET));
            o && o.length ? f.addClass(i.CSS_CLASSES.SCROLL_ARROW_WITH_CLICK_TARGET) : o = f;
            s && s.length ? e.addClass(i.CSS_CLASSES.SCROLL_ARROW_WITH_CLICK_TARGET) : s = e;
            u.$movableContainer = h.find(".scrtabs-tabs-movable-container");
            u.$tabsUl = h.find(".nav-tabs");
            u.$tabsUl.length || (u.$tabsUl = h.find(".nav-pills"),
            u.$tabsUl.length && (u.isNavPills = !0));
            u.$tabsLiCollection = u.$tabsUl.find("> li");
            u.$slideLeftArrow = u.reverseScroll ? f : e;
            u.$slideLeftArrowClickTarget = u.reverseScroll ? o : s;
            u.$slideRightArrow = u.reverseScroll ? e : f;
            u.$slideRightArrowClickTarget = u.reverseScroll ? s : o;
            u.$scrollArrows = u.$slideLeftArrow.add(u.$slideRightArrow);
            u.$win = n(t)
        }
        ;
        r.setElementWidths = function() {
            var t = this
              , n = t.stc;
            n.winWidth = n.$win.width();
            n.scrollArrowsCombinedWidth = n.$slideLeftArrow.outerWidth() + n.$slideRightArrow.outerWidth();
            t.setFixedContainerWidth();
            t.setMovableContainerWidth()
        }
        ;
        r.setEventListeners = function(t) {
            var e = this
              , u = e.stc
              , r = u.eventHandlers
              , f = i.EVENTS
              , o = f.WINDOW_RESIZE + u.instanceId;
            t.enableSwiping && e.listenForTouchEvents();
            u.$slideLeftArrowClickTarget.off(".scrtabs").on(f.MOUSEDOWN, function(n) {
                r.handleMousedownOnSlideMovContainerLeftArrow.call(r, n)
            }).on(f.MOUSEUP, function(n) {
                r.handleMouseupOnSlideMovContainerLeftArrow.call(r, n)
            }).on(f.CLICK, function(n) {
                r.handleClickOnSlideMovContainerLeftArrow.call(r, n)
            });
            u.$slideRightArrowClickTarget.off(".scrtabs").on(f.MOUSEDOWN, function(n) {
                r.handleMousedownOnSlideMovContainerRightArrow.call(r, n)
            }).on(f.MOUSEUP, function(n) {
                r.handleMouseupOnSlideMovContainerRightArrow.call(r, n)
            }).on(f.CLICK, function(n) {
                r.handleClickOnSlideMovContainerRightArrow.call(r, n)
            });
            if (u.tabClickHandler)
                u.$tabsLiCollection.find('a[data-bs-toggle="tab"]').off(f.CLICK).on(f.CLICK, u.tabClickHandler);
            u.$win.off(o).smartresizeScrtabs(function(n) {
                r.handleWindowResize.call(r, n)
            }, o);
            n("body").on(i.EVENTS.FORCE_REFRESH, u.elementsHandler.refreshAllElementSizes.bind(u.elementsHandler))
        }
        ;
        r.setFixedContainerWidth = function() {
            var i = this
              , n = i.stc
              , t = n.$tabsContainer.get(0).getBoundingClientRect();
            n.fixedContainerWidth = t.width || t.right - t.left;
            n.fixedContainerWidth = n.fixedContainerWidth * n.widthMultiplier;
            n.$fixedContainer.width(n.fixedContainerWidth)
        }
        ;
        r.setFixedContainerWidthForHiddenScrollArrows = function() {
            var t = this
              , n = t.stc;
            n.$fixedContainer.width(n.fixedContainerWidth)
        }
        ;
        r.setFixedContainerWidthForVisibleScrollArrows = function() {
            var t = this
              , n = t.stc;
            n.$fixedContainer.width(n.fixedContainerWidth - n.scrollArrowsCombinedWidth)
        }
        ;
        r.setMovableContainerWidth = function() {
            var r = this
              , t = r.stc
              , i = t.$tabsUl.find("> li");
            t.movableContainerWidth = 0;
            i.length && (i.each(function() {
                var i = n(this)
                  , r = 0;
                t.isNavPills && (r = parseInt(i.css("margin-left"), 10) + parseInt(i.css("margin-right"), 10));
                t.movableContainerWidth += i.outerWidth() + r
            }),
            t.movableContainerWidth += 1,
            t.movableContainerWidth < t.fixedContainerWidth && (t.movableContainerWidth = t.fixedContainerWidth));
            t.$movableContainer.width(t.movableContainerWidth)
        }
        ;
        r.setScrollArrowVisibility = function() {
            var t = this
              , n = t.stc
              , i = n.movableContainerWidth > n.fixedContainerWidth;
            i && !n.scrollArrowsVisible ? (n.$scrollArrows.show(),
            n.scrollArrowsVisible = !0) : !i && n.scrollArrowsVisible && (n.$scrollArrows.hide(),
            n.scrollArrowsVisible = !1);
            n.scrollArrowsVisible ? t.setFixedContainerWidthForVisibleScrollArrows() : t.setFixedContainerWidthForHiddenScrollArrows()
        }
    }(e.prototype),
    function(n) {
        n.handleClickOnSlideMovContainerLeftArrow = function() {
            var n = this
              , t = n.stc;
            t.scrollMovement.incrementMovableContainerLeft()
        }
        ;
        n.handleClickOnSlideMovContainerRightArrow = function() {
            var n = this
              , t = n.stc;
            t.scrollMovement.incrementMovableContainerRight()
        }
        ;
        n.handleMousedownOnSlideMovContainerLeftArrow = function() {
            var t = this
              , n = t.stc;
            n.$slideLeftArrowClickTarget.data(i.DATA_KEY_IS_MOUSEDOWN, !0);
            n.scrollMovement.continueSlideMovableContainerLeft()
        }
        ;
        n.handleMousedownOnSlideMovContainerRightArrow = function() {
            var t = this
              , n = t.stc;
            n.$slideRightArrowClickTarget.data(i.DATA_KEY_IS_MOUSEDOWN, !0);
            n.scrollMovement.continueSlideMovableContainerRight()
        }
        ;
        n.handleMouseupOnSlideMovContainerLeftArrow = function() {
            var n = this
              , t = n.stc;
            t.$slideLeftArrowClickTarget.data(i.DATA_KEY_IS_MOUSEDOWN, !1)
        }
        ;
        n.handleMouseupOnSlideMovContainerRightArrow = function() {
            var n = this
              , t = n.stc;
            t.$slideRightArrowClickTarget.data(i.DATA_KEY_IS_MOUSEDOWN, !1)
        }
        ;
        n.handleWindowResize = function() {
            var i = this
              , n = i.stc
              , t = n.$win.width();
            if (t === n.winWidth)
                return !1;
            n.winWidth = t;
            n.elementsHandler.refreshAllElementSizes()
        }
    }(o.prototype),
    function(t) {
        t.continueSlideMovableContainerLeft = function() {
            var n = this
              , t = n.stc;
            setTimeout(function() {
                t.movableContainerLeftPos <= n.getMinPos() || !t.$slideLeftArrowClickTarget.data(i.DATA_KEY_IS_MOUSEDOWN) || n.incrementMovableContainerLeft() || n.continueSlideMovableContainerLeft()
            }, i.CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL)
        }
        ;
        t.continueSlideMovableContainerRight = function() {
            var n = this
              , t = n.stc;
            setTimeout(function() {
                t.movableContainerLeftPos >= 0 || !t.$slideRightArrowClickTarget.data(i.DATA_KEY_IS_MOUSEDOWN) || n.incrementMovableContainerRight() || n.continueSlideMovableContainerRight()
            }, i.CONTINUOUS_SCROLLING_TIMEOUT_INTERVAL)
        }
        ;
        t.decrementMovableContainerLeftPos = function(n) {
            var r = this
              , t = r.stc;
            t.movableContainerLeftPos -= t.fixedContainerWidth / i.SCROLL_OFFSET_FRACTION;
            t.movableContainerLeftPos < n ? t.movableContainerLeftPos = n : t.scrollToTabEdge && (r.setMovableContainerLeftPosToTabEdge(i.SLIDE_DIRECTION.LEFT),
            t.movableContainerLeftPos < n && (t.movableContainerLeftPos = n))
        }
        ;
        t.disableSlideLeftArrow = function() {
            var t = this
              , n = t.stc;
            n.disableScrollArrowsOnFullyScrolled && n.scrollArrowsVisible && n.$slideLeftArrow.addClass(i.CSS_CLASSES.SCROLL_ARROW_DISABLE)
        }
        ;
        t.disableSlideRightArrow = function() {
            var t = this
              , n = t.stc;
            n.disableScrollArrowsOnFullyScrolled && n.scrollArrowsVisible && n.$slideRightArrow.addClass(i.CSS_CLASSES.SCROLL_ARROW_DISABLE)
        }
        ;
        t.enableSlideLeftArrow = function() {
            var t = this
              , n = t.stc;
            n.disableScrollArrowsOnFullyScrolled && n.scrollArrowsVisible && n.$slideLeftArrow.removeClass(i.CSS_CLASSES.SCROLL_ARROW_DISABLE)
        }
        ;
        t.enableSlideRightArrow = function() {
            var t = this
              , n = t.stc;
            n.disableScrollArrowsOnFullyScrolled && n.scrollArrowsVisible && n.$slideRightArrow.removeClass(i.CSS_CLASSES.SCROLL_ARROW_DISABLE)
        }
        ;
        t.getMinPos = function() {
            var t = this
              , n = t.stc;
            return n.scrollArrowsVisible ? n.fixedContainerWidth - n.movableContainerWidth - n.scrollArrowsCombinedWidth : 0
        }
        ;
        t.getMovableContainerCssLeftVal = function() {
            var t = this
              , n = t.stc;
            return n.movableContainerLeftPos === 0 ? "0" : n.movableContainerLeftPos + "px"
        }
        ;
        t.incrementMovableContainerLeft = function() {
            var n = this
              , i = n.stc
              , t = n.getMinPos();
            return n.decrementMovableContainerLeftPos(t),
            n.slideMovableContainerToLeftPos(),
            n.enableSlideRightArrow(),
            i.movableContainerLeftPos === t
        }
        ;
        t.incrementMovableContainerRight = function(n) {
            var r = this
              , t = r.stc;
            return n ? t.movableContainerLeftPos = n : (t.movableContainerLeftPos += t.fixedContainerWidth / i.SCROLL_OFFSET_FRACTION,
            t.movableContainerLeftPos > 0 ? t.movableContainerLeftPos = 0 : t.scrollToTabEdge && r.setMovableContainerLeftPosToTabEdge(i.SLIDE_DIRECTION.RIGHT)),
            r.slideMovableContainerToLeftPos(),
            r.enableSlideLeftArrow(),
            t.movableContainerLeftPos === 0
        }
        ;
        t.refreshScrollArrowsDisabledState = function() {
            var n = this
              , t = n.stc;
            if (t.disableScrollArrowsOnFullyScrolled && t.scrollArrowsVisible) {
                if (t.movableContainerLeftPos >= 0) {
                    n.disableSlideRightArrow();
                    n.enableSlideLeftArrow();
                    return
                }
                if (t.movableContainerLeftPos <= n.getMinPos()) {
                    n.disableSlideLeftArrow();
                    n.enableSlideRightArrow();
                    return
                }
                n.enableSlideLeftArrow();
                n.enableSlideRightArrow()
            }
        }
        ;
        t.scrollToActiveTab = function() {
            var i = this, n = i.stc, r, h, t, u, f, e, c, o, l, s;
            if (n.scrollArrowsVisible && (h = n.$tabsUl.find('li > a[data-bs-toggle="tab"].active'),
            h.length && (r = h.parent()),
            r && r.length)) {
                if (s = n.$slideRightArrow.outerWidth(),
                e = r.outerWidth(),
                t = r.offset().left - n.$fixedContainer.offset().left,
                u = t + e,
                f = n.fixedContainerWidth - s,
                n.rtl) {
                    if (l = n.$slideLeftArrow.outerWidth(),
                    t < 0)
                        return n.movableContainerLeftPos += t,
                        i.slideMovableContainerToLeftPos(),
                        !0;
                    if (u > f)
                        return n.movableContainerLeftPos += u - f + 2 * s,
                        i.slideMovableContainerToLeftPos(),
                        !0
                } else {
                    if (u > f)
                        return c = u - f + s,
                        o = n.fixedContainerWidth / 2,
                        c += o - e / 2,
                        n.movableContainerLeftPos -= c,
                        i.slideMovableContainerToLeftPos(),
                        !0;
                    if (l = n.$slideLeftArrow.outerWidth(),
                    t < 0)
                        return o = n.fixedContainerWidth / 2,
                        n.movableContainerLeftPos += -t + o - e / 2,
                        i.slideMovableContainerToLeftPos(),
                        !0
                }
                return !1
            }
        }
        ;
        t.setMovableContainerLeftPosToTabEdge = function(t) {
            var f = this
              , u = f.stc
              , e = -u.movableContainerLeftPos
              , r = 0;
            u.$tabsLiCollection.each(function() {
                var f = n(this).width();
                return r += f,
                r > e ? (u.movableContainerLeftPos = t === i.SLIDE_DIRECTION.RIGHT ? -(r - f) : -r,
                !1) : void 0
            })
        }
        ;
        t.slideMovableContainerToLeftPos = function() {
            var n = this, t = n.stc, u = n.getMinPos(), r, i;
            t.movableContainerLeftPos > 0 ? t.movableContainerLeftPos = 0 : t.movableContainerLeftPos < u && (t.movableContainerLeftPos = u);
            t.movableContainerLeftPos = t.movableContainerLeftPos / 1;
            r = n.getMovableContainerCssLeftVal();
            n.performingSlideAnim = !0;
            i = t.rtl ? {
                right: r
            } : {
                left: r
            };
            t.$movableContainer.stop().animate(i, "slow", function() {
                var r = n.getMinPos();
                n.performingSlideAnim = !1;
                t.movableContainerLeftPos < r ? (n.decrementMovableContainerLeftPos(r),
                i = t.rtl ? {
                    right: n.getMovableContainerCssLeftVal()
                } : {
                    left: n.getMovableContainerCssLeftVal()
                },
                t.$movableContainer.stop().animate(i, "fast", function() {
                    n.refreshScrollArrowsDisabledState()
                })) : n.refreshScrollArrowsDisabledState()
            })
        }
    }(s.prototype),
    function(t) {
        t.initTabs = function(t, i, r, u) {
            function s() {
                var n;
                i.find(".nav-tabs").show();
                o.initElements(t);
                n = o.refreshAllElementSizes();
                i.css("visibility", "visible");
                u && u();
                r && r()
            }
            var f = this, o = f.elementsHandler, e;
            t.enableRtlSupport && n("html").attr("dir") === "rtl" && (f.rtl = !0);
            t.scrollToTabEdge && (f.scrollToTabEdge = !0);
            t.disableScrollArrowsOnFullyScrolled && (f.disableScrollArrowsOnFullyScrolled = !0);
            t.reverseScroll && (f.reverseScroll = !0);
            t.widthMultiplier !== 1 && (e = Number(t.widthMultiplier),
            isNaN(e) || (f.widthMultiplier = e));
            setTimeout(s, 100)
        }
        ;
        t.scrollToActiveTab = function(n) {
            var t = this
              , i = t.scrollMovement;
            i.scrollToActiveTab(n)
        }
    }(h.prototype);
    r = function() {
        function r(t) {
            return n(t.find("a").attr("href"))
        }
        function u() {
            return n('<ul class="nav nav-tabs" role="tablist"><\/ul>')
        }
        function f(t, r) {
            var e = n('<div class="scrtabs-tab-container"><\/div>')
              , o = r.leftArrowContent || '<div class="scrtabs-tab-scroll-arrow scrtabs-tab-scroll-arrow-left"><span class="' + r.cssClassLeftArrow + '"><\/span><\/div>'
              , u = n(o)
              , s = r.rightArrowContent || '<div class="scrtabs-tab-scroll-arrow scrtabs-tab-scroll-arrow-right"><span class="' + r.cssClassRightArrow + '"><\/span><\/div>'
              , f = n(s)
              , h = n('<div class="scrtabs-tabs-fixed-container"><\/div>')
              , c = n('<div class="scrtabs-tabs-movable-container"><\/div>');
            return r.disableScrollArrowsOnFullyScrolled && u.add(f).addClass(i.CSS_CLASSES.SCROLL_ARROW_DISABLE),
            e.append(u, h.append(c.append(t)), f)
        }
        function t(t, i) {
            return n('<a role="tab" data-bs-toggle="tab"><\/a>').attr("href", "#" + t[i.paneId]).html(t[i.title])
        }
        function e() {
            return n('<div class="tab-content"><\/div>')
        }
        function o(i, r, u) {
            var o = u.tabLiContent || '<li role="presentation" class=""><\/li>'
              , f = n(o)
              , e = t(i, r).appendTo(f);
            return i[r.disabled] ? (f.addClass("disabled"),
            e.attr("data-bs-toggle", "")) : u.forceActiveTab && i[r.active] && e.addClass("active"),
            u.tabPostProcessor && u.tabPostProcessor(f, e),
            f
        }
        function s(t, i, r) {
            var u = n('<div role="tabpanel" class="tab-pane"><\/div>').attr("id", t[i.paneId]).html(t[i.content]);
            return r.forceActiveTab && t[i.active] && u.addClass("active"),
            u
        }
        return {
            getElTabPaneForLi: r,
            getNewElNavTabs: u,
            getNewElScrollerElementWrappingNavTabsInstance: f,
            getNewElTabAnchor: t,
            getNewElTabContent: e,
            getNewElTabLi: o,
            getNewElTabPane: s
        }
    }();
    u = function() {
        function i(i, r, u) {
            var f = !1;
            return i.each(function(i) {
                var e = t(r, u.paneId, n(this).data("tab")[u.paneId]);
                if (e > -1 && e !== i)
                    return f = !0,
                    !1
            }),
            f
        }
        function r(n, t) {
            for (var f = n.length - 1, r = -1, u = 0, i = 0; r === -1 && i >= 0; )
                ((i = t + ++u) <= f && !n.eq(i).hasClass("disabled") || (i = t - u) >= 0 && !n.eq(i).hasClass("disabled")) && (r = i);
            return r
        }
        function t(n, t, i) {
            var r = -1;
            return n.some(function(n, u) {
                if (n[t] === i)
                    return r = u,
                    !0
            }),
            r
        }
        function u(t, i, r) {
            t.data({
                tab: n.extend({}, i[r]),
                index: r
            })
        }
        return {
            didTabOrderChange: i,
            getIndexOfClosestEnabledTab: r,
            getTabIndexByPaneId: t,
            storeDataOnLiEl: u
        }
    }();
    f = {
        destroy: function() {
            var n = this;
            return n.each(nt)
        },
        init: function(t) {
            var r = this
              , f = r.length - 1
              , u = n.extend({}, n.fn.scrollingTabs.defaults, t || {});
            return u.tabs ? r.each(function(t) {
                var e = n(this)
                  , o = t < f ? null : function() {
                    r.trigger(i.EVENTS.TABS_READY)
                }
                ;
                l(e, u, o)
            }) : r.each(function(t) {
                var e = n(this).data({
                    scrtabs: {
                        isWrapperOnly: !0
                    }
                })
                  , o = t < f ? null : function() {
                    r.trigger(i.EVENTS.TABS_READY)
                }
                ;
                c(e, u, o)
            })
        },
        refresh: function(t) {
            var i = this
              , r = n.extend({}, n.fn.scrollingTabs.defaults, t || {});
            return i.each(function() {
                d(n(this), r)
            })
        },
        scrollToActiveTab: function() {
            return this.each(g)
        }
    };
    n.fn.scrollingTabs = function(t) {
        if (f[t])
            return f[t].apply(this, Array.prototype.slice.call(arguments, 1));
        if (t && typeof t != "object")
            n.error("Method " + t + " does not exist on $.scrollingTabs.");
        else
            return f.init.apply(this, arguments)
    }
    ;
    n.fn.scrollingTabs.nextInstanceId = 0;
    n.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: "bi bi-chevron-left",
        cssClassRightArrow: "bi bi-chevron-right",
        leftArrowContent: "",
        rightArrowContent: "",
        tabsLiContent: null,
        tabsPostProcessors: null,
        enableSwiping: !1,
        enableRtlSupport: !1
    }
}
)(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
                })
            })
        }
    })
}
;
$( () => {
    const s = document.querySelector("#announcement_list");
    s && s.childElementCount > 0 && $(s).endlessRiver();
    const f = document.querySelector("#popular_providers");
    if (f) {
        const n = f.querySelector('[data-bs-toggle="tab"]');
        n && bootstrap.Tab.getOrCreateInstance(n).show();
        $(f).scrollingTabs({
            enableSwiping: !0,
            scrollToTabEdge: !0,
            disableScrollArrowsOnFullyScrolled: !0
        }).on("ready.scrtabs", () => {
            n && $(f).scrollingTabs("scrollToActiveTab")
        }
        );
        f.addEventListener("shown.bs.tab", () => {
            $(f).scrollingTabs("scrollToActiveTab")
        }
        )
    }
    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: !0,
            prevArrow: $(".main-prev"),
            nextArrow: $(".main-next"),
            adaptiveHeight: !1
        });
        const n = document.querySelectorAll(".banner-group-vertical");
        Array.from(n).forEach(n => {
            const t = n.closest(".vertical-wrapper");
            let i = !1
              , r = !1;
            t && (i = t.querySelector(".sub-up"),
            r = t.querySelector(".sub-down"));
            $(n).slick({
                slidesToShow: 1,
                slidesToScroll: 1,
                dots: !0,
                dotsClass: "carousel-indicators",
                infinite: !0,
                autoplay: !0,
                autoplaySpeed: 3e3,
                adaptiveHeight: !1,
                vertical: !0,
                verticalSwiping: !0,
                arrows: !0,
                prevArrow: i,
                nextArrow: r
            });
            $(n).on("touchend mouseover mouseout", function() {
                $("#banner_carousel").slick("slickSetOption", "swipe", !0, !1)
            })
        }
        )
    }
    const u = document.querySelector(".prediction-list")
      , e = document.querySelector(".nav-arrow .prev")
      , o = document.querySelector(".nav-arrow .next");
    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 ? (e.style.backgroundColor = "#989898",
        e.style.pointerEvents = "none") : (e.style.backgroundColor = "",
        e.style.pointerEvents = "auto");
        u.scrollLeft >= n - 1 ? (o.style.backgroundColor = "#989898",
        o.style.pointerEvents = "none") : (o.style.backgroundColor = "",
        o.style.pointerEvents = "auto")
    }
    e && e.addEventListener("click", () => {
        const n = c();
        u.scrollBy({
            left: -n,
            behavior: "smooth"
        })
    }
    );
    o && o.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")
      , i = document.querySelector("#starting_date")
      , r = document.querySelector("#ending_date")
      , t = "DD-MMM-YYYY";
    n && ($(n).dateRangePicker({
        format: t,
        separator: " " + n.dataset.separator + " "
    }).bind("datepicker-change", function(n, u) {
        i.value = moment(u.date1).format(t);
        r.value = moment(u.date2).format(t)
    }),
    $(n).data("dateRangePicker").setDateRange(i.value, r.value));
    const u = document.querySelector(".grid_table")
      , f = document.querySelector("#totals_template");
    u && f && u.appendChild(f.content.cloneNode(!0));
    const o = document.querySelectorAll(".pending_transaction");
    Array.prototype.slice.call(o).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 s = document.querySelectorAll(".copy_ticket_button");
    s.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 h = document.querySelectorAll(".row_attributes");
    h.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")
        }
    }
}
);
