! function() {
    define("splash", [], function() {
        function e(e) {
            var t, a = window.location.search.match(/&?language=((\w|-)+)&?/)[1].toLowerCase(),
                o = window.location.search.match(/&?skincode=(\w+)&?/)[1];
            n("i18n/" + a + ".json", function(n) {
                var i = n.target;
                if (404 !== i.status) {
                    var l = JSON.parse(i.responseText),
                        s = l[a];
                    t = s.indexOf(a + "/" + o + ".json") > -1 ? "i18n/" + a + "/" + o : "i18n/" + a + "/default"
                }
                e(t)
            })
        }

        function t(t, a) {
            var o = "assetPacks/" + t;
            e(function(e) {
                n(e + ".json", function(i) {
                    var l = i.target;
                    if (404 !== l.status) {
                        var s = JSON.parse(l.responseText);
                        if (s.assetPacks) {
                            var r = e.substring(e.lastIndexOf("/") + 1);
                            s.assetPacks.indexOf(r + "/assetPacks/" + f + ".json") > -1 && n(e + "/assetPacks/" + f + ".json", function(n) {
                                var i = n.target;
                                if (404 !== i.status) {
                                    var l = JSON.parse(i.responseText);
                                    for (var s in l)
                                        if (l[s].indexOf(t) > -1) {
                                            o = e + "/assetPacks/" + t;
                                            break
                                        }
                                }
                                a(o)
                            })
                        } else a(o)
                    }
                })
            })
        }

        function n(e, t) {
            var n = new XMLHttpRequest;
            n.withCredentials = !0, n.addEventListener("load", function(e) {
                t(e)
            }), n.open("GET", e), n.send()
        }

        function a(e) {
            n(e, function(e) {
                var t = e.target;
                if (404 !== t.status) {
                    var n = JSON.parse(t.responseText);
                    Object.freeze(n), x = n.splashScreen.footer.shortVersion, g = n.splashScreen.loadingpic["EXPLORE THE RICHES OF"], v = n.splashScreen.loadingpic.FEATURING, F = n.splashScreen.loadingpic["TUMBLING REELS"]
                }
            })
        }

        function o() {
            w.beginPath(), w.fillStyle = "#666666", w.moveTo(279 * p, 422 * p), w.lineTo(681 * p, 422 * p), w.arcTo(685 * p, 422 * p, 685 * p, 426 * p, 4 * p), w.arcTo(685 * p, 430 * p, 681 * p, 430 * p, 4 * p), w.lineTo(279 * p, 430 * p), w.arcTo(275 * p, 430 * p, 275 * p, 426 * p, 4 * p), w.arcTo(275 * p, 422 * p, 279 * p, 422 * p, 4 * p), w.closePath(), w.fill()
        }

        function i() {
            var e = 4 * m;
            w.beginPath();
            var t = w.createLinearGradient(280 * p, 424 * p, (280 + e) * p, 424 * p);
            t.addColorStop(0, "#FFD900"), t.addColorStop(.25, "#FF9900"), t.addColorStop(.5, "#FF3300"), t.addColorStop(.75, "#FF9900"), t.addColorStop(1, "#FFD900"), w.fillStyle = t, w.moveTo(280 * p, 424 * p), w.lineTo((280 + e) * p, 424 * p), w.arcTo((280 + e + 2) * p, 424 * p, (280 + e + 2) * p, 426 * p, 2 * p), w.arcTo((280 + e + 2) * p, 428 * p, (280 + e) * p, 428 * p, 2 * p), w.lineTo(280 * p, 428 * p), w.arcTo(278 * p, 428 * p, 278 * p, 426 * p, 2 * p), w.arcTo(278 * p, 424 * p, 280 * p, 424 * p, 2 * p), w.closePath(), w.fill()
        }

        function l() {
            h && (w.drawImage(h, 220 * p, 50 * p, 520 * p, 350 * p), h = null, u.style.backgroundColor = "black")
        }

        function s() {
            x && (w.save(), w.textBaseline = "middle", w.textAlign = "center", w.font = 16 * p + "px Arial", w.fillStyle = "#FFFFFF", w.fillText(x, 480 * p, 450 * p), w.restore(), x = null), g && (w.save(), w.textBaseline = "middle", w.textAlign = "center", w.font = 22 * p + "px Arial", w.fillStyle = "#FFFFFF", w.fillText(g, 480 * p, 100 * p, 460 * p), w.restore(), g = null), v && (w.save(), w.textBaseline = "middle", w.textAlign = "center", w.font = 18 * p + "px Arial", w.fillStyle = "#FFFFFF", w.fillText(v, 380 * p, 190 * p), w.restore(), v = null), F && (w.save(), w.textBaseline = "middle", w.textAlign = "center", w.font = "bold " + 22 * p + "px Arial", w.fillStyle = "#53A6F9", w.fillText(F, 540 * p, 190 * p), w.restore(), F = null)
        }

        function r() {
            l(), s(), o(), i(), m < 100 && c(r)
        }

        function c(e) {
            window.requestAnimationFrame ? requestAnimationFrame(e) : setTimeout(e, 100)
        }

        function d() {
            var e, t = Number(document.documentElement.clientWidth),
                n = Number(document.documentElement.clientHeight),
                a = u.style;
            n / t > .5625 ? (e = t / 1920, a.width = t + "px", a.height = Math.floor(1080 * e) + "px", a.top = Math.floor((n - 1080 * e) / 2) + "px", a.left = "0px") : (e = n / 1080, a.width = Math.floor(1920 * e) + "px", a.height = n + "px", a.top = "0px", a.left = Math.floor((t - 1920 * e) / 2) + "px")
        }
        var f = window.location.search.match(/&?assetPack=(\w+)&?/)[1],
            u = document.getElementById("loadingCanvas"),
            p = 1;
        "desktop" === f && (u.width = 1920, u.height = 1080, p = 2);
        var h, x, g, v, F, w = u.getContext("2d"),
            m = 0,
            T = window._cacheFlag.queryStr;
        ! function() {
            var e = new Image;
            e.onload = function() {
                h = e, c(r)
            }, t(f + "/splash/loading.png", function(t) {
                e.src = t + T
            })
        }(),
        function() {
            var e = window.location.search.match(/&?language=(\w+)&?/)[1],
                t = window.location.search.match(/&?skincode=(\w+)&?/)[1];
            n("i18n/" + e + ".json" + T, function(n) {
                var o = n.target;
                if (404 !== o.status) {
                    for (var i = "i18n/" + e + "/default/splash.json" + T, l = JSON.parse(o.responseText), s = l[e], r = 0; r < s.length; r++)
                        if (s[r].indexOf(e + "/" + t + ".json") > -1) {
                            i = "i18n/" + e + "/" + t + "/splash.json" + T;
                            break
                        }
                    a(i)
                }
            })
        }(), window.addEventListener("message", function(e) {
            var t = e.data.loaded || null;
            null !== t && (m = Number(t))
        }, !1), d(), window.addEventListener("load", d), window.addEventListener("resize", d)
    })
}();