define("clientservice/errorhandler/ErrorCodeList", [], function() {
    "use strict";

    function e(e) {
        if (e && "string" == typeof e && (e = e.toUpperCase(), r[e])) return r[e].action
    }

    function t(e) {
        if (e && "string" == typeof e) {
            var t = e.substring(0, 2).toUpperCase();
            switch (t) {
                case "JP":
                case "HE":
                case "TS":
                case "CM":
                case "GS":
                case "CD":
                    return "communicator";
                case "GM":
                    return "game";
                case "CO":
                    return "console";
                case "CS":
                    return "consoleservice";
                case "FT":
                    return "fatal";
                default:
                    console.warn("Unknown error type: " + t + ", full code: " + e)
            }
        }
    }

    function n(e) {
        if (e && "string" == typeof e) return e = e.toUpperCase(), r[e] && r[e].message ? i[r[e].message] || i.errGameError : i.errGameError
    }

    function o(e) {
        i = e.config.stringsConfig
    }
    var i = {},
        r = {
            "CD-001": {
                action: "abort",
                message: "errConnection"
            },
            "CD-002": {
                action: "abort",
                message: "errConnection"
            },
            "CD-003": {
                action: "close",
                message: "errGameError"
            },
            "CD-004": {
                action: "abort",
                message: "errGameError"
            },
            "CD-005": {
                action: "abort",
                message: "errGameError"
            },
            "CD-006": {
                action: "reload",
                message: "errConnection"
            },
            "CD-007": {
                action: "close",
                message: "errConnection"
            },
            "CD-008": {
                action: "close",
                message: "errOffline"
            },
            "CD-009": {
                action: "reload",
                message: "errConnection"
            },
            "CD-010": {
                action: "reload",
                message: "errConnection"
            },
            "CD-100": {
                action: "rgs"
            },
            "CD-101": {
                action: "rgs"
            },
            "CD-102": {
                action: "rgs"
            },
            "CD-103": {
                action: "rgs"
            },
            "CD-104": {
                action: "reload",
                message: "errGameError"
            },
            "CD-106": {
                action: "rgs",
                message: "errGeoPermission"
            },
            "CD-107": {
                action: "rgs"
            },
            "CD-108": {
                action: "rgs"
            },
            "CD-109": {
                action: "abort"
            },
            "CD-111": {
                action: "abort"
            },
            "CD-200": {
                action: "continue",
                message: "errUnknown"
            },
            "CD-201": {
                action: "rgs"
            },
            "CD-202": {
                action: "rgs"
            },
            "CD-203": {
                action: "reload"
            },
            "CD-205": {
                action: "continue",
                message: "autoSpinStop"
            },
            "CD-204": {
                action: "abort"
            },
            "GM-001": {
                action: "ignore"
            },
            "GM-002": {
                action: "ignore"
            },
            "GM-003": {
                action: "ignore"
            },
            "GM-004": {
                action: "ignore"
            },
            "GM-005": {
                action: "ignore"
            },
            "GM-006": {
                action: "ignore"
            },
            "GM-012": {
                action: "rgs"
            },
            "CO-001": {
                action: "close",
                message: "errFreespinsFail"
            },
            "CO-002": {
                action: "close",
                message: "errFreespinsFail"
            },
            "CO-003": {
                action: "close",
                message: "errFreespinsEnd"
            },
            "CO-004": {
                action: "close",
                message: "errGameError"
            },
            "CO-005": {
                action: "close",
                message: "errGameError"
            },
            "CO-006": {
                action: "continue",
                message: "errGameError"
            },
            "CO-007": {
                action: "close",
                message: "errGameError"
            },
            "CO-008": {
                action: "continue",
                message: "errDepositFail"
            },
            "CS-001": {
                action: "close",
                message: "errGameError"
            },
            "CS-002": {
                action: "close",
                message: "errGameError"
            },
            "CS-003": {
                action: "close",
                message: "errGameError"
            },
            "JP-104": {
                action: "close"
            },
            "JP-103": {
                action: "close"
            },
            "JP-101": {
                action: "reload"
            },
            "JP-106": {
                action: "close"
            },
            "JP-107": {
                action: "log"
            },
            "JP-108": {
                action: "close"
            },
            "HE-002": {
                action: "close",
                message: "errConnection"
            },
            "HE-004": {
                action: "close",
                message: "errConnection"
            },
            "HE-005": {
                action: "close",
                message: "errConnection"
            },
            "FT-001": {
                action: "reload",
                message: "errConnection"
            },
            "FT-002": {
                action: "reload",
                message: "errConnection"
            },
            "FT-003": {
                action: "reload",
                message: "errConnection"
            },
            "FT-004": {
                action: "reload",
                message: "errConnection"
            },
            "FT-005": {
                action: "reload",
                message: "errConnection"
            },
            "FT-006": {
                action: "reload",
                message: "errConnection"
            },
            "FT-007": {
                action: "reload",
                message: "errConnection"
            },
            "FT-008": {
                action: "reload",
                message: "errConnection"
            },
            "FT-012": {
                action: "ignore"
            },
            "WT-001": {
                action: "ignore"
            },
            "WT-002": {
                action: "ignore"
            },
            "WT-003": {
                action: "ignore"
            },
            "TS-001": {
                action: "close",
                message: "errTournamentError"
            },
            "TS-002": {
                action: "rgs"
            },
            "TS-003": {
                action: "rgs"
            },
            "CM-001": {
                action: "continue"
            },
            "CM-002": {
                action: "continue"
            },
            "GS-001": {
                action: "close",
                message: "errBOJOffline"
            },
            "GS-002": {
                action: "reload",
                message: "errBOJConnection"
            },
            "GS-003": {
                action: "continue"
            },
            "GS-004": {
                action: "abort",
                message: "errBOJOptIn"
            },
            "GS-005": {
                action: "close",
                message: "errBOJEnded"
            },
            "GS-006": {
                action: "continue",
                message: "errBOJNetworkUnstable"
            },
            "GS-007": {
                action: "reload",
                message: "errConnection"
            },
            "GS-008": {
                action: "close",
                message: "errConnection"
            },
            "GS-009": {
                action: "ignore"
            },
            "GS-010": {
                action: "ignore"
            },
            "GS-011": {
                action: "ignore"
            }
        };
    return function() {
        return {
            init: o,
            getAction: e,
            getType: t,
            getMessage: n
        }
    }
}), define("clientservice/errorhandler/ActionRunner", [], function() {
    "use strict";

    function e(e, t) {
        L = t, T = e.config.serverConfig || {}, E = e.config.consoleConfig || {}, R = e.bus, G = e.logger
    }

    function t() {
        L.opener ? L.close() : l()
    }

    function n(e) {
        function t(e, t) {
            try {
                t = decodeURIComponent(t)
            } catch (e) {}
            var n = document.createElement("input");
            n.type = "hidden", n.name = e, n.value = t, i.appendChild(n)
        }

        function n(e, t) {
            s[e] = t
        }

        function o(e, t) {
            a.push([encodeURIComponent(e), encodeURIComponent(t)].join("="))
        }
        var i = document.createElement("form"),
            r = e || {},
            a = [],
            s = {};
        r.playMode = r.playMode || T.playMode || "real", i.method = r.launchMethod || T.launchMethod || "post", i.style.display = "none";
        var c = [];
        r.hasOwnProperty("playMode") && "real" !== r.playMode || (c = ["freespin_tokenID", "campaignId", "freespin_bet", "freespin_lines", "freespin_num", "freespin_remain", "freespinBetInCurrency", "freespinBalanceInCurrency", "tournamentId", "playMode", "playModeChoice"]), T.paramPost && Object.keys(T.paramPost).forEach(function(e) {
            if (!(c.indexOf(e) >= 0) || r.hasOwnProperty(e)) {
                var t = r.hasOwnProperty(e) ? r[e] : T.paramPost[e];
                s[e] = t
            }
        }), T.reloadWithGet && (i.method = "get");
        var l = "post" === i.method.toLowerCase() ? o : n;
        T.paramGet && Object.keys(T.paramGet).forEach(function(e) {
            if (!(c.indexOf(e) >= 0) || r.hasOwnProperty(e)) {
                var t = r.hasOwnProperty(e) ? r[e] : T.paramGet[e];
                l(e, t), delete r[e]
            }
        }), Object.keys(s).forEach(function(e) {
            t(e, s[e]), r.hasOwnProperty(e) && delete r[e]
        }), Object.keys(r).forEach(function(e) {
            t(e, r[e])
        }), a && a.length > 0 && (i.action = "?" + a.join("&")), h(i)
    }

    function o(e) {
        w(function() {
            var t = "real",
                n = T.paramRGS.SWITCH_MODE;
            "WAGER_TO_PFS" === n ? t = "freespin" : "PFS_TO_WAGER" === n && (t = "real");
            var o = {
                paramGame: {
                    playMode: t
                }
            };
            e && e.currencycode && (o.paramGame.currencycode = e.currencycode), R.publish({
                channel: "ClientService",
                topic: "Game.SwitchPlayMode",
                data: o
            })
        }, function() {
            R.publish({
                channel: "ClientService",
                topic: "ErrorHandler.Throw",
                data: {
                    errorCode: "CD-006",
                    priority: 0
                }
            })
        }, {
            params: {},
            forceXHR: !0
        })
    }

    function i(e, t) {
        var n = e || {
            url: "",
            closeGame: !1
        };
        n.closeGame && "string" == typeof n.closeGame && "YES" === n.closeGame.toUpperCase() && w ? w(function() {
            t()
        }, function() {
            t()
        }) : t()
    }

    function r(e) {
        var t = e || {
            url: "",
            closeGame: !1
        };
        t.closeGame && "string" == typeof t.closeGame && "YES" === t.closeGame.toUpperCase() ? L.top.location.href = t.url : L.open(t.url)
    }

    function a(e) {
        E.lobbyUrl ? l(E.lobbyUrl) : n(e)
    }

    function s(e) {
        R.publish({
            channel: "ClientService",
            topic: "ErrorHandler.Notify",
            data: {
                action: "abort"
            }
        }), e && e.cmd && x ? x({
            "@name": e.cmd.name || "abort",
            Param: e.cmd.params
        }, b) : b()
    }

    function c() {
        R.publish({
            channel: "ClientService",
            topic: "ErrorHandler.Notify",
            data: {
                action: "continue"
            }
        }), b()
    }

    function l(e) {
        I && I.postBackToLobby(), e ? L.top.location.href = e : E.lobbyUrl && (L.top.location.href = E.lobbyUrl)
    }

    function u() {
        R.publish({
            channel: "ClientService",
            topic: "ErrorHandler.Notify",
            data: {
                action: "topup"
            }
        }), b()
    }

    function p(e) {
        e.cmd && m(e.cmd.name, e.cmd.params, function() {
            x ? x({
                "@name": e.cmd.name,
                Param: e.cmd.params
            }, y) : y(e.cmd.name, e.cmd.params)
        })
    }

    function d(e) {
        L.open(e.url, e.name ? e.name : "_blank")
    }

    function m(e, t, n) {
        switch (e) {
            case "reloadGame":
            case "gameInProgressReload":
                R.publish({
                    channel: "ClientService",
                    topic: "ClientService.SuspendLoadProgressTimeout",
                    data: {
                        ifSuspend: !0
                    }
                }), n();
                break;
            case "closeGame":
                R.publish({
                    channel: "ClientService",
                    topic: "ClientService.SuspendLoadProgressTimeout",
                    data: {
                        ifSuspend: !0
                    }
                }), w ? w(n, n) : (G && G.warn ? G.warn("Direct link to close game server call function not added!") : console.warn("Direct link to close game server call function not added!"), n());
                break;
            case "viewAccountHistory":
                i(t, n);
                break;
            default:
                n()
        }
    }

    function f(e) {
        w = e
    }

    function g(e) {
        I = e
    }

    function y(e, i) {
        switch (e) {
            case "backToLobby":
                l();
                break;
            case "closeGame":
                m(e, i, function() {
                    i ? x({
                        "@name": e,
                        Param: i
                    }, t) : t()
                });
                break;
            case "reloadGame":
                n(i);
                break;
            case "recommendedGameReload":
                I && I.postRecommendedGameReload(i), n(i);
                break;
            case "gameInProgressReload":
                var a = v(i);
                n(a);
                break;
            case "switchToCashPlay":
                var a = {
                    playMode: "real"
                };
                n(a);
                break;
            case "pfsReload":
            case "switchWagerToPFS":
                var a = v(i, T.paramRGS.hasOwnProperty("SWITCH_MODE") ? {
                    SWITCH_MODE: T.paramRGS.SWITCH_MODE
                } : {});
                k && k.switchPlayModeSupport && "false" !== k.switchPlayModeSupport ? o(a) : n(a);
                break;
            case "multipleGIPReload":
                n(i);
                break;
            case "insufficientFundsNotification":
                u();
                break;
            case "viewAccountHistory":
                i && r(i), b();
                break;
            case "requestHelp":
                i ? (i.target && i.url && window.open(i.url, i.target), p({
                    cmd: {
                        name: "closeGame"
                    }
                })) : p({
                    cmd: {
                        name: "ignore"
                    }
                });
                break;
            default:
                b()
        }
    }

    function v(e, t) {
        var n = {},
            o = e || {};
        Object.keys(o).forEach(function(e) {
            n[e] = o[e]
        });
        var i = t || {};
        return Object.keys(i).forEach(function(e) {
            n[e] = i[e]
        }), n
    }

    function h(e) {
        L && !L.noSubmit && (e.style.display = "none", document.body.appendChild(e), HTMLFormElement.prototype.submit.call(e))
    }

    function C(e) {
        x = e
    }

    function b() {
        R.request({
            channel: "ClientService",
            topic: "MessageBox.processMessageQueue",
            data: {}
        }, function() {}, function() {})
    }

    function S(e) {
        e && "object" == typeof e && (k = Object.freeze(JSON.parse(JSON.stringify(e))))
    }
    var x, w, k, I, T = {},
        E = {},
        R = {},
        L = {},
        G = {};
    return function() {
        return {
            init: e,
            doClose: t,
            doReload: n,
            doResync: a,
            doAbort: s,
            doContinue: c,
            doLobby: l,
            doTopup: u,
            doRGS: p,
            doOpenWindow: d,
            setErrorFlowHandler: C,
            doRGSAfterConsole: y,
            setDirectCloseGame: f,
            updateGameCapabilities: S,
            setCECCommand: g
        }
    }
}), define("clientservice/errorhandler/Reporter", [], function() {
    "use strict";

    function e(e, t) {
        return r.hasOwnProperty(e) ? "off" === r[e] ? void 0 : r[e] : t || void 0
    }

    function t(e, t) {
        var n = e.config;
        o = t.Sentry, i.enabled = n.kernelConfig.sentryEnabled && !!o || !1, l = {
            nscode: n.serverConfig.nscode,
            skincode: n.serverConfig.skincode,
            uniqueid: n.serverConfig.uniqueid
        }, n.kernelConfig.reportLevels && Object.keys(n.kernelConfig.reportLevels).forEach(function(e) {
            r[e] = n.kernelConfig.reportLevels[e]
        }), i.enabled ? Sentry.onLoad(function() {
            Sentry.init({
                replaysSessionSampleRate: 0,
                replaysOnErrorSampleRate: 0,
                environment: n.widgetConfig ? n.widgetConfig.dcid : window.location.hostname
            }), Sentry.setTag("igt_skincode", l.skincode), Sentry.setUser({
                id: l.skincode + "_" + l.uniqueid,
                username: l.uniqueid
            })
        }) : i.enabled = !1, a = c[n.kernelConfig.loglevel || "NONE"]
    }

    function n(t) {
        if (!i.enabled || !o || !t) return void(t && console.log("Reporter", "not reporting", t));
        var n = e(t);
        s[n] >= 0 && o.captureMessage("Error Code: " + t, {
            level: "always" === n ? "error" : n,
            extra: l
        })
    }
    var o = {},
        i = {
            enabled: !1
        },
        r = {},
        a = 0,
        s = {
            always: 50,
            error: 4,
            warning: 3,
            info: -1,
            debug: -1,
            off: -1
        },
        c = {
            ALL: 0,
            DEBUG: 1,
            INFO: 2,
            WARN: 3,
            ERROR: 4,
            FATAL: 4,
            NONE: 10
        },
        l = {};
    return function() {
        return {
            init: t,
            reportErrorCode: n
        }
    }
}), define("kernel/logger/Logger", [], function() {
    "use strict";

    function e(e) {
        console.log("initialising to level " + e.logLevel), e && e.hasOwnProperty("logLevel") && c(e.logLevel)
    }

    function t(e, t) {
        var n = Array.prototype.slice.call(t);
        return [e, "[" + (new Date).toISOString() + "]"].concat(n)
    }

    function n() {
        if (!(p < u.FATAL)) return m.error.apply(null, t("FATAL", arguments))
    }

    function o() {
        if (!(p < u.ERROR)) return m.error.apply(null, t("ERROR", arguments))
    }

    function i() {
        if (!(p < u.WARN)) return m.warn.apply(null, t("WARN", arguments))
    }

    function r() {
        if (!(p < u.INFO)) return m.info.apply(null, t("INFO", arguments))
    }

    function a() {
        if (!(p < u.DEBUG)) return m.debug.apply(null, t("DEBUG", arguments))
    }

    function s() {
        if (!(p < u.DEBUG)) return m.log.apply(null, t("LOG", arguments))
    }

    function c(e) {
        switch (u.hasOwnProperty(e) ? (p = u[e], d = e) : (p = u.FATAL, d = "FATAL"), console.log = f, console.debug = f, console.info = f, console.warn = f, console.error = f, d) {
            case "ALL":
            case "DEBUG":
                console.log = m.log, console.debug = m.debug;
            case "INFO":
                console.info = m.info;
            case "WARN":
                console.warn = m.warn;
            case "ERROR":
            case "FATAL":
                console.error = m.error
        }
    }

    function l() {
        return d
    }
    var u = {
            ALL: 10,
            DEBUG: 5,
            INFO: 4,
            WARN: 3,
            ERROR: 2,
            FATAL: 1,
            NONE: 0
        },
        p = u.FATAL,
        d = "FATAL",
        m = {
            log: console.log,
            debug: console.debug,
            info: console.info,
            warn: console.warn,
            error: console.error
        },
        f = function() {};
    return console.log = f, console.debug = f, console.info = f, console.warn = f, console.error = f,
        function() {
            return Object.freeze({
                init: e,
                setLevel: c,
                getLevel: l,
                debug: a,
                error: o,
                fatal: n,
                info: r,
                warn: i,
                log: s
            })
        }()
}), define("clientservice/errorhandler/ErrorHandler", ["require", "clientservice/errorhandler/ErrorCodeList", "clientservice/errorhandler/ActionRunner", "clientservice/errorhandler/Reporter", "kernel/logger/Logger"], function(e) {
    "use strict";

    function t() {
        Object.keys(C).forEach(function(e) {
            clearTimeout(C[e]), delete C[e]
        }), C = {}
    }

    function n(e, t) {
        e.errorCode && (e.priority >= 0 ? m(e.errorCode, null, null, e.priority) : m(e.errorCode))
    }

    function o(e, t) {
        return {
            cmd: {
                name: e,
                params: t
            }
        }
    }

    function i(e, t) {
        switch (e) {
            case "close":
                y.doRGS(o("closeGame"));
                break;
            case "lobby":
                y.doLobby();
                break;
            case "topup":
                y.doTopup();
                break;
            case "reload":
                y.doRGS(o("reloadGame"));
                break;
            case "resync":
                y.doResync();
                break;
            case "abort":
                y.doAbort(t);
                break;
            case "continue":
                y.doContinue();
                break;
            case "rgs":
                y.doRGS(t);
                break;
            case "openWindow":
                y.doOpenWindow(t);
                break;
            default:
                h.warn("ErrorHandler: skipping unknown action [" + e + "]")
        }
    }

    function r(e, t, n) {
        return {
            Message: e,
            Buttons: {
                Button: {
                    Text: f.config.stringsConfig.btnOk,
                    Cmd: {
                        "@name": t || "",
                        Param: n || {}
                    }
                }
            }
        }
    }

    function a() {
        return {
            cmd: {
                name: "continue",
                params: {}
            }
        }
    }

    function s(e, t, n, o) {
        t || (t = r(g.getMessage(e), g.getAction(e), {}), t.Id = e), Array.isArray(t) || (t = [t]), t.forEach(function(t) {
            var r = d();
            b[r] = function(t, n) {
                C[t] && (clearTimeout(C[t]), delete C[t]), i(g.getAction(e), n)
            }, S[r] = function(e) {
                n && n(e)
            };
            var a = function() {
                    C[r] && (clearTimeout(C[r]), delete C[r]), "CD-101" !== e && "CD-205" !== e && "TS-003" !== e && "CM-002" !== e && f.bus.request({
                        channel: "ClientService",
                        topic: "MessageBox.processMessageQueue",
                        data: {}
                    }, function() {}, function() {})
                },
                s = {
                    messageID: r,
                    message: t
                };
            "number" == typeof o && (s.priority = o), v.reportErrorCode(s.message.Id), f.bus.request({
                channel: "ClientService",
                topic: "MessageBox.DisplayMessage",
                data: s
            }, a, function() {})
        })
    }

    function c(e) {
        var t = d();
        b[t] = function(t) {
            C[t] && (clearTimeout(C[t]), delete C[t]), i(g.getAction(e))
        }, C[t] = setTimeout(function() {
            b[t](t)
        }, 3e3);
        var n = function() {
                C[t] && (clearTimeout(C[t]), delete C[t])
            },
            o = r(g.getMessage(e), g.getAction(e), {});
        o.Id = e, v.reportErrorCode(e), f.bus.request({
            channel: "ClientService",
            topic: "MessageBox.DisplayMessage",
            data: {
                messageID: t,
                message: o
            }
        }, n, function() {})
    }

    function l(e) {
        var t = d();
        b[t] = function(t) {
            C[t] && (clearTimeout(C[t]), delete C[t]), i(g.getAction(e))
        }, C[t] = setTimeout(function() {
            b[t](t)
        }, 3e3);
        var n = function() {
                C[t] && (clearTimeout(C[t]), delete C[t])
            },
            o = r(g.getMessage(e), g.getAction(e), {});
        o.Id = e, v.reportErrorCode(e), f.bus.request({
            channel: "ClientService",
            topic: "MessageBox.DisplayMessage",
            data: {
                messageID: t,
                message: o
            }
        }, n, function() {})
    }

    function u(e, t) {
        var n = r(g.getMessage(e), g.getAction(e), {});
        n.Id = e;
        var o = d();
        b[o] = function(t, n) {
            C[t] && (clearTimeout(C[t]), delete C[t]), i(g.getAction(e), n)
        };
        var s = function() {
            C[o] && (clearTimeout(C[o]), delete C[o]), f.bus.request({
                channel: "ClientService",
                topic: "MessageBox.processMessageQueue",
                data: {}
            }, function() {}, function() {})
        };
        C[o] = setTimeout(function() {
            b[o](o, a())
        }, 3e3);
        var c = {
            messageID: o,
            message: n
        };
        "number" == typeof t && (c.priority = t), v.reportErrorCode(c.message.Id), f.bus.request({
            channel: "ClientService",
            topic: "MessageBox.DisplayMessage",
            data: c
        }, s, function() {})
    }

    function p(e, t) {
        var n = d();
        b[n] = function(t, n) {
            C[t] && (clearTimeout(C[t]), delete C[t]), i(g.getAction(e), n)
        }, S[n] = function(e) {
            t && t(e)
        };
        var o = function() {
            C[n] && (clearTimeout(C[n]), delete C[n])
        };
        C[n] = setTimeout(function() {
            b[n](n)
        }, 3e3);
        var a = r(g.getMessage(e), g.getAction(e), {});
        a.Id = e, v.reportErrorCode(e), f.bus.request({
            channel: "ClientService",
            topic: "MessageBox.DisplayMessage",
            data: {
                messageID: n,
                message: a
            }
        }, o, function() {})
    }

    function d() {
        return k += 1
    }

    function m(e, t, n, o) {
        if ("ignore" === g.getAction(e)) return void v.reportErrorCode(e);
        if ("log" === g.getAction(e)) return void(n ? h.warn(JSON.stringify(n), e) : h.warn("Unknown exception.", e));
        switch (g.getType(e)) {
            case "communicator":
                s(e, n, t, o);
                break;
            case "game":
                c(e);
                break;
            case "console":
                l(e);
                break;
            case "consoleservice":
                p(e, t);
                break;
            case "fatal":
                u(e, o);
                break;
            default:
                h.warn("ErrorHandler: unknown error code type [" + g.getType(e) + "], code: [" + e + "]")
        }
    }
    var f, g = e("clientservice/errorhandler/ErrorCodeList")(),
        y = e("clientservice/errorhandler/ActionRunner")(),
        v = e("clientservice/errorhandler/Reporter")(),
        h = e("kernel/logger/Logger"),
        C = {},
        b = {},
        S = {},
        x = {},
        w = {},
        k = 0;
    return function(e) {
        return t(), f = e, y.init(f, window), g.init(f), v.init(f, window), k = 0, f.bus.subscribe({
            channel: "ClientService",
            topic: "ErrorHandler.Throw",
            callback: n
        }), f.bus.subscribe({
            channel: "ConsoleService",
            topic: "ErrorHandler.Throw",
            callback: n
        }), f.bus.subscribe({
            channel: "Kernel",
            topic: "ErrorHandler.Throw",
            callback: n
        }), f.bus.subscribe({
            channel: "GameService",
            topic: "ErrorHandler.Throw",
            callback: n
        }), f.bus.subscribe({
            channel: "Game",
            topic: "ErrorHandler.Throw",
            callback: n
        }), x = f.bus.subscribe({
            channel: "ConsoleService",
            topic: "MessageBox.Close",
            callback: function(e, t) {
                b[e.messageID] && b[e.messageID](e.messageID, e)
            }
        }), w = f.bus.subscribe({
            channel: "ConsoleService",
            topic: "MessageBox.Done",
            callback: function(e, t) {
                b[e.messageID] && delete b[e.messageID], S[e.messageID] && (S[e.messageID](e), delete S[e.messageID])
            }
        }), f.bus.subscribe({
            channel: "Kernel",
            topic: "Game.Capabilities",
            callback: function(e) {
                y.updateGameCapabilities(e)
            }
        }), Object.freeze({
            throwError: m,
            setErrorFlowHandler: y.setErrorFlowHandler,
            doRGSAfterConsole: y.doRGSAfterConsole,
            setDirectCloseGame: y.setDirectCloseGame,
            setCECCommand: y.setCECCommand,
            doRGS: y.doRGS
        })
    }
}), define("clientservice/preloader/AssetPreLoader", ["require"], function(e) {
    "use strict";
    var t = {
            PROMOSPIN: {
                desktop: [],
                tablet: [],
                mobile: [],
                all: ["welcome.png", "end.png", "stars.png"]
            },
            TOURNAMENT: {
                desktop: [],
                tablet: [],
                mobile: [],
                all: []
            }
        },
        n = e.toUrl("./asset"),
        o = n.split("/js/clientservice")[0] + "/asset/",
        i = "?" + n.split("?")[1],
        r = function(e, t) {
            var n = new Image;
            n.src = e, n.onload = function() {
                n = null
            }
        };
    return function() {
        function e(e, n) {
            var a = t[e];
            a[n].length > 0 && a[n].forEach(function(t) {
                r(o + e.toLowerCase() + "/" + n + "/" + t + i)
            }), a.all.length > 0 && a.all.forEach(function(t) {
                r(o + e.toLowerCase() + "/all/" + t + i)
            })
        }
        return {
            preLoadAsset: e
        }
    }
}), define("clientservice/transformer/RgsDataTransformer", ["require"], function(e) {
    "use strict";

    function t(e) {
        return JSON.stringify(e)
    }

    function n(e) {
        return JSON.stringify(e)
    }

    function o(e) {
        return JSON.stringify(e)
    }

    function i(e) {
        return JSON.stringify(e)
    }

    function r(e) {
        return f(e)
    }

    function a(e) {
        return f(e)
    }

    function s(e) {
        return f(e)
    }

    function c(e) {
        return f(e)
    }

    function l(e) {
        return f(e)
    }

    function u(e) {
        return f(e)
    }

    function p(e) {
        return f(e)
    }

    function d(e) {
        return f(e)
    }

    function m(e) {
        return f(e)
    }

    function f(e) {
        return e.RGSResponse || e.Exception ? e : {
            RGSResponse: e
        }
    }

    function g(e, t) {
        if (!e) return "";
        var n = function(e) {
            var t = Number(e) || (new Date).getTime(),
                n = 60 * -Math.round(new Date(t).getTimezoneOffset()) * 1e3;
            return new Date(t + n)
        }(e);
        return t ? function(e) {
            var t = e.match(/[a-zA-Z]+/g),
                n = e.match(/[^a-zA-Z]+/g),
                o = {
                    y: 0,
                    M: 1,
                    d: 2,
                    H: 3,
                    m: 4,
                    s: 5
                };
            return function(e) {
                var i = e.match(/\d+/g);
                return i.pop(), t.map(function(e) {
                    var t = o[e.split("")[0]];
                    return i[t]
                }).reduce(function(e, t, o) {
                    return e + n[o - 1] + t
                })
            }
        }(t)(n.toISOString()) : new Date(Number(e)).toLocaleString()
    }
    return function() {
        return {
            transformAuthenticateRequestData: i,
            transformPaytableResponseData: s,
            transformPlayRequestData: t,
            transformPlayResponseData: r,
            transformClientConfigRequestData: n,
            transformInitstateResponseData: c,
            transformCurrencyResponseData: l,
            transformCloseResponseData: u,
            transformPlayerBalanceResponseData: p,
            transformAuthenticateResponseData: d,
            transformUKRCNotifyResponseData: m,
            transformNormalRequestData: o,
            transformReplayResponseData: a,
            transformUTC2LocalWithFormatter: g
        }
    }
}), define("clientservice/communicator/WebWorker", ["require"], function(e) {
    "use strict";
    return {
        create: function(e) {
            var t, n = {},
                o = 0;
            return window.URL ? (t = e instanceof Function ? new Worker(function(e) {
                var t = "function () {onmessage = function(e) {var invokeFunction = FUNCTIONGOESHERE; postMessage({id:e.data.id, result:invokeFunction(e.data.data)});};}",
                    n = t.replace("FUNCTIONGOESHERE", e.toString());
                return window.URL.createObjectURL(new Blob(["(", n, ")()"], {
                    type: "application/javascript"
                }))
            }(e)) : new Worker(e), t.onmessage = function(e) {
                n[e.data.id](e.data.result), n[e.data.id] = void 0, delete n[e.data.id]
            }) : t = {
                onerror: function(e) {},
                postMessage: function(o) {
                    try {
                        n[o.id](e(o.data))
                    } catch (e) {
                        t.onerror(e)
                    }
                    n[o.id] = void 0, delete n[o.id]
                },
                terminate: function() {}
            }, {
                work: function(e, i, r) {
                    o += 1, n[o] = i, t.onerror = function() {
                        r("CD-104")
                    }, t.postMessage({
                        id: o,
                        data: e
                    })
                },
                terminate: function() {
                    t.terminate()
                }
            }
        }
    }
}), define("clientservice/communicator/DataAdapter", ["require", "kernel/logger/Logger", "clientservice/communicator/WebWorker"], function(e) {
    function t(e, t, n) {
        var o = e;
        if (n && (0 !== n.indexOf(";") && (o += ";"), o += n), null !== t && void 0 !== t) {
            if (o.indexOf("?") < 0 ? o += "?" : o += "&", "object" != typeof t) o += encodeURIComponent(t);
            else
                for (var i in t) o += encodeURIComponent(i), o += "=", o += encodeURIComponent(t[i]), o += "&";
            null !== o.match(/[&\?]$/) && (o = o.substring(0, o.length - 1))
        }
        return o
    }

    function n(e, n, o, i) {
        var r, a = new XMLHttpRequest,
            c = !!i.isRestful,
            u = {},
            d = function(e) {
                var t = e.target;
                if (i.networkMonitor && (u.responseTime = (new Date).getTime() - u.requestTimeStamp.getTime()), 200 === t.status || c && t.status < 500) {
                    var r = t.getAllResponseHeaders(),
                        a = r.trim().split(/[\r\n]+/),
                        s = a.reduce(function(e, t, n) {
                            var o = t.split(": ");
                            return e[String.prototype.toLowerCase.call(o[0])] = o[1], e
                        }, {}),
                        d = null;
                    if (i.accept)
                        if ("xml" === i.accept) d = t.responseXML;
                        else if ("json" === i.accept) try {
                        return void(d = p.work(t.responseText, function(e) {
                            n(e, {
                                networkMonitor: u,
                                headers: s
                            })
                        }, o))
                    } catch (e) {
                        return void o("CD-104")
                    } else d = t.responseText;
                    else d = t.responseText;
                    n(d, {
                        networkMonitor: u,
                        headers: s
                    })
                } else l.error("Http request fails for " + t.status, "DataAdapter"), o(t.status < 400 ? "HE-002" : t.status < 500 ? "HE-004" : "HE-005")
            },
            m = function(e) {
                var t = (new Date).getTime() - r;
                o(void 0 === navigator.onLine ? t > 30 ? "CD-006" : "CD-002" : navigator.onLine && t > 30 ? "CD-006" : "CD-002")
            },
            f = function(e) {
                o("CD-001")
            };
        if (a.addEventListener("load", d), a.addEventListener("error", m), a.addEventListener("timeout", f), i.networkMonitor && (u.requestTimeStamp = new Date), i.async ? a.open(i.method ? i.method : "GET", t(e, i.paramMap, i.sessionId), !0) : a.open(i.method ? i.method : "GET", t(e, i.paramMap, i.sessionId)), i.withCredentials && (a.withCredentials = !0), i.timeout > 0 && (a.timeout = i.timeout), "string" == typeof i.method && "POST" === i.method.toUpperCase() && (i.headerMap && i.headerMap["Content-Type"] || a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")), i.accept && (i.headerMap && i.headerMap.Accept || ("xml" === i.accept ? a.setRequestHeader("Accept", "application/xml") : "json" === i.accept ? a.setRequestHeader("Accept", "application/json") : a.setRequestHeader("Accept", "text/plain"))), i.headerMap)
            for (var g in i.headerMap) a.setRequestHeader(g, i.headerMap[g]);
        return s(a), a.send(i.payloadStr), r = (new Date).getTime(), {
            abort: function() {
                a.removeEventListener("load", d), a.removeEventListener("error", m), a.removeEventListener("timeout", f), a.abort()
            }
        }
    }

    function o(e, t, i, r, a) {
        var s = r.retry;
        if (s > 0 == !1 && (s = 1), a < s) return n(e, t, function(n) {
            a + 1 < s ? o(e, t, i, r, a + 1) : i(n)
        }, r)
    }

    function i(e, n, o, i) {
        if (navigator && navigator.sendBeacon) {
            if (i.payloadStr) {
                var r;
                r = "json" === i.contentType ? new Blob([i.payloadStr], {
                    type: "application/json; charset=UTF-8"
                }) : new Blob([i.payloadStr], {
                    type: "text/plain; charset=UTF-8"
                }), navigator.sendBeacon(t(e, i.paramMap, i.sessionId), r)
            } else navigator.sendBeacon(t(e, i.paramMap, i.sessionId));
            n()
        } else o()
    }

    function r(e, t, n, i) {
        return void 0 !== i && null !== i && "object" == typeof i || (i = {}), "function" != typeof t && (t = function() {}), "function" != typeof n && (n = function() {}), o(e, t, n, i, 0)
    }

    function a(e) {
        if ("object" == typeof e && e) {
            for (var t in e) a(e[t]);
            Object.freeze(e)
        }
    }

    function s(e) {
        var t = c(16);
        e.setRequestHeader("X-B3-TraceId", t), e.setRequestHeader("X-B3-SpanId", t)
    }

    function c(e) {
        for (var t = "", n = 0; n < e; n++) t += Math.floor(Math.random() * e).toString(16);
        return t
    }
    var l = e("kernel/logger/Logger"),
        u = e("clientservice/communicator/WebWorker"),
        p = u.create(function(e) {
            return JSON.parse(e)
        });
    return function() {
        return {
            beaconCall: i,
            httpCall: r,
            deepFreezeJsonObj: a
        }
    }
}), define("clientservice/communicator/RgsCommunicator", ["require", "clientservice/transformer/RgsDataTransformer", "clientservice/communicator/DataAdapter"], function(e) {
    "use strict";
    var t = e("clientservice/transformer/RgsDataTransformer")(),
        n = e("clientservice/communicator/DataAdapter")();
    return function(e) {
        function o(t) {
            var n = JSON.parse(JSON.stringify(e.serverConfig.paramGet));
            if (t && t.payloadStr) {
                var o = JSON.parse(t.payloadStr);
                n.fetchmode !== o.fetchmode && (n.fetchmode = o.fetchmode)
            }
            var i = {
                timeout: Number(e.serverConfig.requestTimeout),
                paramMap: n,
                payloadStr: null,
                retry: Number(e.serverConfig.requestRetries) || 1,
                withCredentials: !0,
                accept: "json",
                headerMap: {
                    "Content-Type": "application/json;charset=utf-8"
                },
                sessionId: e.serverConfig.IGTJSESSIONID
            };
            e.serverConfig.instrumentUrl && (i.networkMonitor = !0);
            var r = "GET";
            if (t && "string" == typeof t.method && "POST" === t.method.toUpperCase()) {
                r = "POST";
                var a = {};
                Object.keys(e.serverConfig.paramRGS).forEach(function(t) {
                    i.paramMap && i.paramMap[t] ? i.paramMap[t] = e.serverConfig.paramRGS[t] : a[t] = e.serverConfig.paramRGS[t]
                }), Object.keys(a).length > 0 && (t.payloadStr ? t.payloadReadOnly || (t.payloadStr = JSON.parse(t.payloadStr), Object.keys(a).forEach(function(e) {
                    t.payloadStr[e] = a[e]
                }), t.payloadStr = JSON.stringify(t.payloadStr)) : t.payloadStr = JSON.stringify(a))
            }
            if (t)
                for (var s in t) i[s] = t[s];
            return e.forceGetParamNames && e.forceGetParamNames.forEach(function(t) {
                i.paramMap[t] = e.serverConfig.paramRGS[t]
            }), i.method = r, i
        }

        function i(i, r) {
            n.httpCall(e.serverConfig.server + "/paytable", function(e, o) {
                var r = t.transformPaytableResponseData(e);
                n.deepFreezeJsonObj(r), i(r, o)
            }, r, o({
                method: "POST"
            }))
        }

        function r(i, r, a) {
            i = i || {};
            var s;
            if (e.serverConfig.paramGet)
                for (s in e.serverConfig.paramGet) i[s] = e.serverConfig.paramGet[s];
            if (e.serverConfig.paramPost)
                for (s in e.serverConfig.paramPost) i[s] = e.serverConfig.paramPost[s];
            for (s in e.serverConfig.paramRGS) i[s] = e.serverConfig.paramRGS[s];
            var c;
            e.forceGetParamNames && (c = {}, e.forceGetParamNames.forEach(function(t) {
                c[t] = e.serverConfig.paramRGS[t]
            })), n.httpCall(e.serverConfig.server + "/authenticate", function(e, o) {
                var i = t.transformAuthenticateResponseData(e);
                n.deepFreezeJsonObj(i), r(i, o)
            }, a, o({
                method: "POST",
                paramMap: c,
                payloadStr: t.transformAuthenticateRequestData(i)
            }))
        }

        function a(i, r) {
            n.httpCall(e.serverConfig.server + "/initstate", function(e, o) {
                var r = t.transformInitstateResponseData(e);
                n.deepFreezeJsonObj(r), i(r, o)
            }, r, o({
                method: "POST"
            }))
        }

        function s(i, r, a) {
            i.gamePayload && (i.gamePayload = JSON.stringify(i.gamePayload)), n.httpCall(e.serverConfig.server + "/play", function(e, o) {
                var i = t.transformPlayResponseData(e);
                n.deepFreezeJsonObj(i), r(i, o)
            }, a, o({
                method: "POST",
                payloadStr: t.transformPlayRequestData(i),
                retry: 1
            }))
        }

        function c(i, r, a) {
            n.httpCall(e.serverConfig.server + "/replay", function(e) {
                var o = t.transformReplayResponseData(e);
                n.deepFreezeJsonObj(o), r(o)
            }, a, o({
                method: "POST",
                payloadStr: t.transformNormalRequestData(i),
                retry: 1
            }))
        }

        function l(t, i, r) {
            n.httpCall(e.serverConfig.server + "/replayshareurl", function(e) {
                n.deepFreezeJsonObj(e), i(e)
            }, r, o({
                method: "GET"
            }))
        }

        function u(i, r, a) {
            if ("replay" === e.serverConfig.playMode) return void i();
            var s = o({
                method: "POST"
            });
            a && a.forceXHR ? s.timeout = 0 : s.timeout = 200, !navigator || !navigator.sendBeacon || a && a.forceXHR ? n.httpCall(e.serverConfig.server + "/close", function(e, o) {
                var r = t.transformCloseResponseData(e);
                n.deepFreezeJsonObj(r), i(r, o)
            }, r, s) : n.beaconCall(e.serverConfig.server + "/close", i, r, s)
        }

        function p(i, r) {
            n.httpCall(e.serverConfig.server + "/playerbalance", function(e, o) {
                var r = t.transformPlayerBalanceResponseData(e);
                n.deepFreezeJsonObj(r), i(r, o)
            }, r, o({
                method: "POST"
            }))
        }

        function d(i, r, a) {
            var s = {
                paramMap: {
                    currencycode: a || e.serverConfig.paramRGS.currencycode,
                    language: e.serverConfig.paramRGS.language,
                    skincode: e.serverConfig.paramRGS.skincode,
                    nscode: e.serverConfig.paramRGS.nscode
                }
            };
            e.serverConfig.paramRGS.wagerType && (s.paramMap.wagerType = e.serverConfig.paramRGS.wagerType), n.httpCall(e.serverConfig.server + "/currency", function(e, o) {
                var r = t.transformCurrencyResponseData(e);
                n.deepFreezeJsonObj(r), i(r, o)
            }, r, o({
                method: "POST",
                payloadStr: t.transformNormalRequestData(s.paramMap)
            }))
        }

        function m(i, r, a) {
            n.httpCall(e.serverConfig.server + "/clientConfig", function(e, o) {
                var i = t.transformPlayResponseData(e);
                n.deepFreezeJsonObj(i), r(i, o)
            }, function(e) {
                a(e)
            }, o({
                method: "POST",
                payloadStr: t.transformClientConfigRequestData(i),
                retry: 1
            }))
        }

        function f(i, r, a) {
            var s = o({
                method: "POST",
                retry: 2
            });
            if ("object" != typeof s.paramMap) s.paramMap = {};
            else {
                var c = {};
                for (var l in s.paramMap) c[l] = s.paramMap[l];
                s.paramMap = c
            }
            if (i)
                for (var u in i) s.paramMap[u] = i[u];
            n.httpCall(e.serverConfig.server + "/notify", function(e, o) {
                var i = t.transformUKRCNotifyResponseData(e);
                n.deepFreezeJsonObj(i), r(i, o)
            }, a, s)
        }

        function g(t, i, r, a) {
            "string" != typeof t && (t = JSON.stringify(t));
            var s = {
                method: "POST",
                retry: Number(e.serverConfig.requestRetries) || 1,
                headerMap: {
                    "Content-Type": "application/json;charset=utf-8"
                },
                paramMap: {
                    nscode: e.serverConfig.paramRGS.nscode,
                    skincode: e.serverConfig.paramRGS.skincode,
                    uniqueid: e.serverConfig.paramRGS.uniqueid,
                    softwareid: e.serverConfig.paramRGS.softwareid,
                    securetoken: e.serverConfig.paramRGS.securetoken,
                    channel: e.serverConfig.paramRGS.channel,
                    presenttype: e.serverConfig.paramRGS.presenttype,
                    technology: e.serverConfig.paramRGS.technology,
                    currencycode: e.serverConfig.paramRGS.currencycode,
                    countrycode: e.serverConfig.paramRGS.countrycode
                },
                payloadStr: JSON.stringify({
                    gamePayload: t
                }),
                payloadReadOnly: !0
            };
            a && navigator && navigator.sendBeacon && "Google Inc." !== navigator.vendor ? n.beaconCall(e.serverConfig.server + "/additionalgameinfo", i, r, s) : n.httpCall(e.serverConfig.server + "/additionalgameinfo", function(e) {
                n.deepFreezeJsonObj(e), i(e.RGSResponse ? e.RGSResponse : e)
            }, r, o(s))
        }
        return {
            requestPaytableData: i,
            requestAuthentication: r,
            requestInitstate: a,
            requestPlay: s,
            requestReplay: c,
            requestReplayShareUrl: l,
            requestCloseGame: u,
            requestPlayerBalance: p,
            requestCurrencyData: d,
            requestClientConfig: m,
            requestNotify: f,
            sendGameInfo: g
        }
    }
}), define("clientservice/authenticator/Authenticator", ["require"], function(e) {
    "use strict";

    function t(e, t, o, i) {
        var r = e;
        ! function e(a) {
            function s(e) {
                if (e.Buttons && e.Buttons.Button && e.Buttons.Button.Cmd && e.Buttons.Button.Cmd.Param)
                    for (var t = e.Buttons.Button.Cmd.Param, n = 0; n < t.length; n++) {
                        var o = t[n];
                        if ("Y" === o["#text"] && "multiGip" === o["@name"]) return !0
                    }
                return !1
            }
            r.requestAuthentication(a || {}, function(r, a) {
                var c = a ? a.headers : {},
                    l = {};
                if ("ExtraInfo" in r && (l = r.ExtraInfo), "RGSResponse" in r && (r = r.RGSResponse), "Authentication" in r) {
                    var u = r.Authentication.Status;
                    "Success" === u || "Pending_PlayMode" === u ? r.Authentication.Messages ? t(r.Authentication.Messages, r.Authentication.gsInfo, c, l) : r.Authentication.extra ? t(r.Authentication.extra, r.Authentication.gsInfo, c, l) : t(null, r.Authentication.gsInfo, c, l) : "Pending_GPS" === u ? i ? i(function() {
                        n(e, o)
                    }) : n(e, o) : o && o("CD-003")
                } else if ("Exception" in r) {
                    var p = r.Exception;
                    "1115" === p.Id || "1116" === p.Id || "1118" === p.Id || s(p) ? t(r.Exception) : o("CD-100", p)
                } else o && o("CD-003")
            }, function(e) {
                o("CD-002" === e ? "CD-006" : e)
            })
        }()
    }

    function n(e, t, n) {
        var i = {
            enableHighAccuracy: !0,
            maximumAge: 0
        };
        o && o.geolocation ? e(o.geolocation) : "geolocation" in navigator ? navigator.geolocation.getCurrentPosition(function(t) {
            var n = {};
            t.coords && (n.latitude = t.coords.latitude.toString(), n.longitude = t.coords.longitude.toString()), n.locationstatus = (t.code || 0).toString(), n.locationmessage = t.message || "", e(n)
        }, function() {
            t("CD-106")
        }, i) : t && t("CD-106")
    }
    var o = {};
    return function(e) {
        if (!e) throw new Error("Authenticator initialize error: config parameter required");
        var i;
        if (o = e, !("rgsCommunicator" in e && null !== e.rgsCommunicator)) throw new Error("Authenticator: RgsCommunicator param is required");
        return i = e.rgsCommunicator, Object.freeze({
            authenticate: function(e, n, o) {
                t(i, e, n, o)
            },
            requestGeolocation: n
        })
    }
}), define("clientservice/communicator/InstrumentationCommunicator", ["require", "clientservice/communicator/DataAdapter"], function(e) {
    "use strict";
    return function(t) {
        function n(e, t, n) {
            a.payloadStr = JSON.stringify(e);
            var o = function() {
                r.httpCall(s, function(e) {
                    t(e)
                }, n, a)
            };
            e.action.indexOf("close") > -1 ? r.beaconCall(s, t, o, {
                paramMap: a.payloadStr
            }) : o()
        }

        function o() {}

        function i(e) {
            if (c.push(e), c.length >= l || "close" === e.action) {
                for (var i = {
                        version: "1.0",
                        requestTimeStamp: [],
                        softwareId: t.serverConfig.softwareid,
                        skinCode: t.serverConfig.skincode,
                        uniqueId: t.serverConfig.uniqueid,
                        requestTxnId: [],
                        responseTxnId: [],
                        channel: t.serverConfig.channel,
                        presentType: t.serverConfig.presenttype,
                        gameTitle: t.gameConfig.gameTitle,
                        language: t.gameConfig.language,
                        responseTime: [],
                        action: [],
                        countryCode: t.serverConfig.countrycode
                    }, r = 0; r < c.length; r++) i.requestTimeStamp.push(c[r].requestTimeStamp), i.requestTxnId.push(c[r].requestTxnId),
                    i.responseTxnId.push(c[r].responseTxnId), i.responseTime.push(c[r].responseTime), i.action.push(c[r].action);
                c = [], n(i, o, o)
            }
        }
        var r = e("clientservice/communicator/DataAdapter")(),
            a = {
                method: "POST",
                headerMap: {
                    "Content-Type": "application/json;charset=utf-8"
                },
                timeout: Number(t.serverConfig.requestTimeout),
                retry: Number(t.serverConfig.requestRetries)
            },
            s = t.serverConfig.instrumentUrl;
        ! function() {
            "/" === s.charAt(s.length - 1) && (s = s.slice(0, s.length - 1)), s.lastIndexOf("/") > 0 && (s.lastIndexOf("/") > 7 ? s = s.substring(0, s.lastIndexOf("/")) + "/RGSInstrument/clientLog" + s.substring(s.lastIndexOf("/")) : s += "/RGSInstrument/clientLog")
        }();
        var c = [],
            l = 10;
        return {
            feed: i
        }
    }
}), define("clientservice/commands/GameInfoCommand", ["require", "clientservice/communicator/RgsCommunicator"], function(e) {
    "use strict";
    return function(t, n, o) {
        function i() {
            u && (r(u), u = null), setTimeout(function() {
                i()
            }, p)
        }

        function r(e) {
            l.sendGameInfo(e, s, function(t) {
                d.warn("Fail to send GameInfo " + e.data + " for " + t)
            })
        }

        function a(e) {
            e.sendImmediate ? l.sendGameInfo(e.data, s, function(t) {
                d.warn("Fail to send GameInfo " + e.data + " for " + t)
            }) : u = e.data ? e.data : e
        }

        function s(e) {
            return e.Exception ? void d.warn("Fail to send GameInfo " + e + " for " + e.Exception.Message) : "Success" === e.AdditionalGameInfo.Status ? void d.debug("Success to push GameInfo to RGS.") : "Failure" === e.AdditionalGameInfo.Status ? void d.warn("Fail to send GameInfo " + e + " for unknown reason.") : void 0
        }

        function c() {
            u && (l.sendGameInfo(u, s, function(e) {
                d.warn("Fail to send GameInfo " + e + " for " + e)
            }, !0), u = null)
        }
        var l, u, p, d = n.logger;
        return l = e("clientservice/communicator/RgsCommunicator")(t), t.serverConfig.gameInfoInterval && t.serverConfig.gameInfoInterval > 0 ? (p = t.serverConfig.gameInfoInterval, o.subscribe({
            channel: "Game",
            topic: "Game.GameInfo",
            callback: a
        }), setTimeout(function() {
            i()
        }, p)) : o.subscribe({
            channel: "Game",
            topic: "Game.GameInfo",
            callback: r
        }), {
            close: c
        }
    }
}), define("clientservice/commands/RgsCommand", ["require", "clientservice/preloader/AssetPreLoader", "clientservice/preloader/AssetPreLoader", "clientservice/communicator/RgsCommunicator", "clientservice/authenticator/Authenticator", "clientservice/communicator/InstrumentationCommunicator", "clientservice/commands/GameInfoCommand"], function(e) {
    "use strict";
    return function(t, n, o) {
        function i(e, t) {
            "replay" === o.serverConfig.playMode && Q > 0 && (Y.sendMessage("replayUpdate", {
                currentRound: Q - 1
            }), Z = !0), n.throwError(e, null, t, 1)
        }

        function r(e, t) {
            t ? i(e, t) : i("CD-006", t)
        }

        function a(e, t) {
            if (V.publish({
                    channel: "ClientService",
                    topic: "ClientService.SuspendLoadProgressTimeout",
                    data: {
                        ifSuspend: !0
                    }
                }), "CD-001" === e && (e = "CD-006"), "CD-106" === e) {
                var i = o.stringsConfig.errGeoPermission ? o.stringsConfig.errGeoPermission : "Unable to access location data. Enable location services for {0}, or switch to Wifi.";
                if ("en" === o.serverConfig.paramRGS.language && "INT" !== o.serverConfig.paramRGS.channel) {
                    var r = {
                        Id: "GEO",
                        Reference: "CD-107",
                        Message: i.replace("{0}", window.location.host),
                        Buttons: {
                            Button: [{
                                Text: o.stringsConfig.btnHelp ? o.stringsConfig.btnHelp : "Help",
                                Cmd: {
                                    "@name": "requestHelp",
                                    Param: [{
                                        "@name": "url",
                                        "#text": window.location.pathname + "/1.4.0/support/en/index.html"
                                    }, {
                                        "@name": "target",
                                        "#text": "_blank"
                                    }]
                                }
                            }, {
                                Text: o.stringsConfig.btnClose ? o.stringsConfig.btnClose : "btnClose",
                                Cmd: {
                                    "@name": "closeGame"
                                }
                            }]
                        }
                    };
                    n.throwError("CD-107", null, r, 1)
                } else {
                    var a = {
                        Id: "GEO",
                        Reference: "CD-106",
                        Message: i.replace("{0}", window.location.host),
                        Buttons: {
                            Button: [{
                                Text: o.stringsConfig.btnClose ? o.stringsConfig.btnClose : "btnClose",
                                Cmd: {
                                    "@name": "closeGame"
                                }
                            }]
                        }
                    };
                    n.throwError("CD-106", null, a, 1)
                }
            } else n.throwError(e, null, t, 1)
        }

        function s(e, t) {
            return e.Exception ? (e.Exception.Id && "1005" === e.Exception.Id ? n.throwError("CD-111", null, e.Exception) : (!e.Exception.Id || "1801" !== e.Exception.Id && "1803" !== e.Exception.Id || (V.publish({
                channel: "ClientService",
                topic: "ReplayExpired",
                data: {}
            }), Y.sendMessage("replayExpired", {})), n.throwError("CD-100", null, e.Exception)), !1) : (e.RGSResponse && (e = e.RGSResponse), t || (t = "CD-101"), e.GameLogicResponse && e.GameLogicResponse.Messages && n.throwError(t, null, e.GameLogicResponse.Messages.Message), !0)
        }

        function c(e, t, n) {
            if (o.serverConfig.instrumentUrl && "replay" !== o.serverConfig.playMode) {
                var i = "";
                t.GameLogicResponse && t.GameLogicResponse.TransactionId && (i = t.GameLogicResponse.TransactionId);
                var r = "";
                t.GameLogicResponse && t.GameLogicResponse.OutcomeDetail && t.GameLogicResponse.OutcomeDetail.TransactionId && (r = t.GameLogicResponse.OutcomeDetail.TransactionId);
                var a = {
                    requestTimeStamp: n ? n.networkMonitor.requestTimeStamp.toUTCString() : (new Date).toUTCString(),
                    requestTxnId: i,
                    responseTxnId: r,
                    responseTime: n ? n.networkMonitor.responseTime : "",
                    action: e
                };
                N.feed(a)
            }
        }

        function l(e) {
            M.requestPaytableData(function(t, o) {
                s(t) && (t.RGSResponse.PaytableResponse ? (e(t), c("paytable", t, o)) : n.throwError("CD-004"))
            }, r)
        }

        function u(e, t) {
            var i = e;
            t && (i = function(n) {
                M.requestCurrencyData(function(t, o) {
                    t.CURRENCIES ? (e([n, t.CURRENCIES]), c("currency", t, o)) : e(n)
                }, function() {
                    e(n)
                }, t)
            }), M.requestCurrencyData(function(e, t) {
                s(e) && (e.RGSResponse.CURRENCIES ? (K.init(e.RGSResponse.CURRENCIES, o.serverConfig.denomamount), i(e), c("currency", e, t)) : n.throwError("CD-004"))
            }, r)
        }

        function p(e) {
            M.requestInitstate(function(t, o) {
                var i = t.RGSResponse;
                i && i.hasOwnProperty("GameLogicResponse") && q.setGameLogicResponse(i.GameLogicResponse), s(t, "CD-101") && (i.GameLogicResponse ? (i.GameLogicResponse.OutcomeDetail && (F = i.GameLogicResponse.OutcomeDetail.TransactionId), e(t), c("initstate", t, o)) : n.throwError("CD-004"))
            }, r)
        }

        function d(e) {
            e.InitGameLogicResponse && e.PaytableResponse && e.CURRENCIES && V.publish({
                channel: "ClientService",
                topic: "ClientService.InitDone",
                data: {}
            })
        }

        function m(t, i, r, s) {
            ie = !1, g(), B.authenticate(function(n, a, c, m) {
                if (s || (V.publish({
                        channel: "ClientService",
                        topic: "ClientService.SuspendLoadProgressTimeout",
                        data: {
                            ifSuspend: !0
                        }
                    }), s = function(e) {
                        V.publish({
                            channel: "ClientService",
                            topic: "ClientService.SuspendLoadProgressTimeout",
                            data: {
                                ifSuspend: !1
                            }
                        });
                        var n = {};
                        y(), e && (n.paramGame = e, H = e), p(function(e) {
                            n.InitGameLogicResponse = e.RGSResponse.GameLogicResponse, z = e.RGSResponse.GameLogicResponse, f(e.ExtraInfo), d(n)
                        }), l(function(e) {
                            n.PaytableResponse = e.RGSResponse.PaytableResponse, j = e.RGSResponse.PaytableResponse, f(e.ExtraInfo), d(n)
                        }), u(function(e) {
                            n.CURRENCIES = e.RGSResponse.CURRENCIES, J = e.RGSResponse.CURRENCIES, f(e.ExtraInfo), d(n)
                        }, t ? t.jackpotBaseCurrency : void 0), i && "function" == typeof i && i()
                    }), n && n.Message && "PLAY_MODE_CHOICE" === n.Message["@type"]) {
                    e("clientservice/preloader/AssetPreLoader")().preLoadAsset("PROMOSPIN", o.serverConfig.paramGame.assetPack), r(n, a, c, null, m)
                } else ee.start(m ? m.geoInfoIntervalMinutes : -1), r(n, a, c, s, m)
            }, a, function(e) {
                var t = o.stringsConfig.errGeoWarn ? o.stringsConfig.errGeoWarn : "Location confirmation required for regulatory purposes. When {0} asks for access to your location, select “allow”.";
                t = t.replace("{0}", window.location.host);
                var i = {
                    Id: "GEO",
                    Reference: "CD-108",
                    Message: t,
                    Buttons: {
                        Button: [{
                            Text: o.stringsConfig.btnOk,
                            Cmd: {
                                "@name": "continue"
                            }
                        }]
                    }
                };
                navigator.permissions && navigator.permissions.query ? navigator.permissions.query({
                    name: "geolocation"
                }).then(function(t) {
                    "prompt" === t.state ? n.throwError("CD-108", e, i) : e()
                }) : n.throwError("CD-108", e, i)
            })
        }

        function f(e) {
            e && Object.keys(e).length > 0 && X.push(e)
        }

        function g() {
            X = []
        }

        function y() {
            var e = o.serverConfig.paramRGS;
            e && (e.hasOwnProperty("gamechk") && delete e.gamechk, e.hasOwnProperty("skbchk") && delete e.skbchk);
            var t = o.serverConfig.paramGet;
            t && (t.hasOwnProperty("gamechk") && delete t.gamechk, t.hasOwnProperty("skbchk") && delete t.skbchk);
            var n = o.serverConfig.paramPost;
            n && (n.hasOwnProperty("gamechk") && delete n.gamechk, n.hasOwnProperty("skbchk") && delete n.skbchk)
        }

        function v(e, t) {
            e.InitGameLogicResponse && e.PaytableResponse && e.CURRENCIES && t()
        }

        function h(t, n, i) {
            ie = !1, g(), B.authenticate(function(r, a, s, c) {
                var d = function() {
                    var e = {};
                    p(function(t) {
                        z = t.RGSResponse.GameLogicResponse, e.InitGameLogicResponse = t.RGSResponse.GameLogicResponse, f(t.ExtraInfo), v(e, n)
                    }), j = null, l(function(t) {
                        j = t.RGSResponse.PaytableResponse, e.PaytableResponse = t.RGSResponse.PaytableResponse, f(t.ExtraInfo), v(e, n)
                    }), u(function(t, o) {
                        J = t.RGSResponse.CURRENCIES, e.CURRENCIES = t.RGSResponse.CURRENCIES, f(t.ExtraInfo), v(e, n)
                    }, i ? i.jackpotBaseCurrency : void 0), q.reInit()
                };
                if (r && r.Message && "PLAY_MODE_CHOICE" === r.Message["@type"]) {
                    e("clientservice/preloader/AssetPreLoader")().preLoadAsset("PROMOSPIN", o.serverConfig.paramGame.assetPack), t(r, a, s, null, c, n)
                } else ee.start(c ? c.geoInfoIntervalMinutes : -1), t(r, a, s, d, c, n)
            }, r)
        }

        function C(e) {
            var t = {
                gamelogicresponse: z,
                paytableresponse: j,
                currencyresponse: J
            };
            H && (t.paramGame = H), X.length > 0 && (t.extraInfo = X), e(t)
        }

        function b(e) {
            ee.isTimeToGeoCheck() ? B.requestGeolocation(function(t) {
                x(function(t) {
                    e(t)
                }, t), ee.reset()
            }, function() {}) : x(function(t) {
                e(t)
            })
        }

        function S(e, t) {
            var o = {},
                r = _;
            r.GameLogicRequest || (r = {
                GameLogicRequest: _
            }), o.gamePayload = r, t && Object.keys(t).forEach(function(e) {
                o[e] = t[e]
            }), oe && (ne = new Date);
            var a = Date.now();
            o.gamePayload.GameLogicRequest.TransactionId = F, M.requestPlay(o, function(t, o) {
                var i = t.RGSResponse || t;
                s(t) && (i.GameLogicResponse ? (i.GameLogicResponse.OutcomeDetail && (F = i.GameLogicResponse.OutcomeDetail.TransactionId), i.GameLogicResponse.Balances && (W = i.GameLogicResponse.Balances["@totalBalance"], re = !1), e(t), q.setGameLogicResponse(i.GameLogicResponse), q.postPlayEvent(a), c("play", i, o), oe && i.GameLogicResponse.OutcomeDetail && "Start" === i.GameLogicResponse.OutcomeDetail.GameStatus && (te = ne)) : n.throwError("CD-104"))
            }, i)
        }

        function x(e, t) {
            if (oe)
                if (te) {
                    var n = (new Date).getTime() - te.getTime();
                    oe <= n ? S(e, t) : setTimeout(function() {
                        S(e, t)
                    }, oe - n)
                } else S(e, t);
            else S(e, t)
        }

        function w(e, t) {
            var r = {};
            Q = t, Z = !1, r.currentRound = t, o.serverConfig && (o.serverConfig.replayToken && (r.token = o.serverConfig.replayToken), o.serverConfig.playMode && (r.playMode = o.serverConfig.playMode)), M.requestReplay(r, function(t) {
                var o = t.RGSResponse || t;
                s(t) && (o.GameLogicResponse ? (o.GameLogicResponse.OutcomeDetail && (F = o.GameLogicResponse.OutcomeDetail.TransactionId), o.GameLogicResponse.Balances && (W = o.GameLogicResponse.Balances["@totalBalance"], re = !1), e(t)) : n.throwError("CD-104"))
            }, i)
        }

        function k() {
            return Z
        }

        function I(e) {
            var t = {};
            "replay" === o.serverConfig.playMode && (o.serverConfig && o.serverConfig.replayToken && (t.token = o.serverConfig.replayToken), t.playMode = "replay", M.requestReplayShareUrl(t, function(t) {
                s(t) && e(t)
            }, i))
        }

        function T() {
            ie || (ie = !0, q && q.postCloseEvent(), U.close(), M.requestCloseGame(function(e, t) {
                V.publish({
                    channel: "ClientService",
                    topic: "Game.Close",
                    data: e && e.Close ? e.Close : null
                }), c("close", {
                    action: "close"
                }, t)
            }, function() {}))
        }

        function E(e, t, n) {
            if (ie) return void e();
            ie = !0, q && q.postCloseEvent(), U.close(), M.requestCloseGame(e, t, n)
        }

        function R() {
            n.doRGSAfterConsole("closeGame")
        }

        function L(e, t, o, i) {
            M.requestNotify({
                messageid: e,
                cmdname: t
            }, function(e, t) {
                e.Exception ? (n.throwError("CD-100", null, e.Exception, 1), i("CD-100", e.Exception)) : (e = e.RGSResponse || e, e.Notify && e.Notify.Status && "Success" === e.Notify.Status ? o() : i())
            }, function(e) {
                n.throwError("CD-007", null, null, 1), i(e)
            })
        }

        function G(e) {
            re || (re = !0, M.requestPlayerBalance(function(t, n) {
                if (re && s(t) && t && t.RGSResponse && t.RGSResponse.Balances) {
                    t = t.RGSResponse;
                    var o = t.Balances["@totalBalance"];
                    c("balance", t, n), e(o, t.Balances.Balance)
                }
                re = !1
            }, function() {
                re = !1
            }))
        }

        function D(e, t) {
            M.requestPlayerBalance(function(t, n) {
                s(t) && t && t.RGSResponse && t.RGSResponse.Balances && (t = t.RGSResponse, c("balance", t, n), e(t.Balances))
            }, function() {
                $ && $.error ? $.error("Get Player Balance fail") : console.error("Get Player Balance fail"), t()
            })
        }

        function O(e) {
            V.publish({
                channel: "ClientService",
                topic: "Account.Balances",
                data: e
            })
        }

        function A(e) {
            _ = e
        }

        function P(e) {
            q = e, n.setCECCommand(q)
        }
        var M, N, B, W, F, z, H, U, q, _ = {},
            j = {},
            J = {},
            X = [],
            K = t.currency,
            V = t.bus,
            Y = t.consoleconnect,
            Q = 0,
            Z = !1,
            $ = t.logger,
            ee = function() {
                function e(e) {
                    c = !1, e = parseInt(e), s = isNaN(e) ? -1 : e, l = 0, 0 === s ? c = !0 : s > 0 && (l = 6e4 * s)
                }

                function t() {
                    !c && l > 0 && (a = setTimeout(function() {
                        c = !0
                    }, l))
                }

                function n(n) {
                    a && clearTimeout(a), e(n), t()
                }

                function i(e) {
                    u = !!e
                }

                function r() {
                    var e = "T" === o.gameConfig.gameType;
                    return c && (e || !u)
                }
                var a, s = -1,
                    c = !1,
                    l = 0,
                    u = !1;
                return {
                    start: n,
                    reset: function() {
                        n(s)
                    },
                    isTimeToGeoCheck: r,
                    setGameInProgress: i
                }
            }(),
            te = null,
            ne = null,
            oe = null,
            ie = !1,
            re = !1;
        M = e("clientservice/communicator/RgsCommunicator")(o), n.setDirectCloseGame(E);
        var ae = {
            rgsCommunicator: M
        };
        return o.kernelConfig.localgame && o.serverConfig.paramGet && o.serverConfig.paramGet.hasOwnProperty("native_lat") && (ae.geolocation = {
            latitude: o.serverConfig.paramGet.native_lat,
            longitude: o.serverConfig.paramGet.native_long,
            locationstatus: "0",
            locationmessage: ""
        }), B = e("clientservice/authenticator/Authenticator")(ae), o.serverConfig.instrumentUrl && "replay" !== o.serverConfig.playMode && (N = e("clientservice/communicator/InstrumentationCommunicator")(o)), U = e("clientservice/commands/GameInfoCommand")(o, t, V), V.subscribe({
            channel: "Game",
            topic: "Close",
            callback: R
        }), V.subscribe({
            channel: "ConsoleService",
            topic: "BalanceUpdate",
            callback: function(e, t) {
                e && e.balance && !isNaN(e.balanceValue) && O(e)
            }
        }), V.subscribe({
            channel: "ConsoleService",
            topic: "UKRCNotify",
            callback: function(e, t) {
                L(e.messageId, e.cmdName, function() {
                    t.reply(null, {})
                }, function(e, n) {
                    t.reply({
                        errorCode: e,
                        data: n
                    })
                })
            }
        }), window.onbeforeunload = T, window.onunload = T, {
            launch: m,
            play: b,
            replay: w,
            setBalance: O,
            silentBalanceUpdate: G,
            getPlayerBalance: D,
            setRequestData: A,
            init: C,
            reLaunch: h,
            setCECCommand: P,
            setGameInProgress: ee.setGameInProgress,
            replayShareUrl: I,
            getFailFlag: k
        }
    }
}), define("clientservice/domcontainer/DOMContainer", ["require"], function(e) {
    "use strict";
    return function(e) {
        function t(e, t) {
            Object.keys(t).forEach(function(n) {
                e.style[n] = t[n]
            })
        }

        function n() {
            r && (c.some(function(e) {
                return e.visible
            }) ? r.style.visibility = "inherit" : r.style.visibility = "hidden")
        }

        function o() {
            setTimeout(i, 250)
        }

        function i() {
            var e = r.offsetWidth,
                n = r.offsetHeight;
            c.forEach(function(o) {
                var i = Number((e / o.width).toFixed(3)),
                    r = Number((n / o.height).toFixed(3)),
                    c = Math.min(i, r);
                i === o.scaleH && r === o.scaleH && e === a && n === s || (t(o.element, {
                    webkitTransformOrigin: "0 0 ",
                    transformOrigin: "0 0",
                    transform: "translate(" + Math.floor((e - o.width * c) / 2) + "px, " + Math.floor((n - o.height * c) / 2) + "px) scale(" + c + ")"
                }), o.scale = c, o.scaleW = i, o.scaleH = r)
            }), a = e, s = n
        }
        var r = document.createElement("div");
        t(r, {
            position: "absolute",
            top: "0",
            left: "0",
            width: "100%",
            height: "100%",
            overflow: "hidden",
            visibility: "hidden"
        }), e.appendChild(r);
        var a, s, c = [];
        return window.addEventListener("resize", o), {
            addElement: function(e, o, a) {
                var s = document.createElement("div"),
                    l = {
                        element: s,
                        visible: !1,
                        width: o,
                        height: a,
                        scale: 1,
                        scaleW: 1,
                        scaleH: 1
                    };
                return t(s, {
                    position: "absolute",
                    top: "0",
                    left: "0",
                    width: o + "px",
                    height: a + "px",
                    visibility: "hidden",
                    zIndex: 2
                }), s.appendChild(e), r.appendChild(s), c.push(l), i(), {
                    removeElement: function() {
                        r.removeChild(s), n()
                    },
                    showElement: function() {
                        s.style.visibility = "inherit", l.visible = !0, n()
                    },
                    hideElement: function() {
                        s.style.visibility = "hidden", l.visible = !1, n()
                    },
                    updateSize: function(e, n) {
                        l.width = e, l.height = n, t(s, {
                            width: e + "px",
                            height: n + "px"
                        }), i()
                    },
                    elementData: function() {
                        return l
                    }
                }
            },
            removeContainer: function() {
                for (; r.childElementCount > 0;) r.removeChild(r.firstElementChild);
                return e.removeChild(r), r = void 0, window.removeEventListener("resize", o), r
            },
            setStyles: function(e) {
                t(r, e)
            },
            reflow: function() {
                o && o()
            }
        }
    }
}), define("clientservice/autospin/ui/DOMDesktopStandardUI", ["require", "clientservice/domcontainer/DOMContainer"], function(e) {
    "use strict";
    var t, n, o, i, r, a = {
            SPIN: "SPIN",
            WIN: "WIN",
            LOSS: "LOSS",
            START: "START",
            CANCEL: "CANCEL"
        },
        s = function(e, t) {
            Array.prototype.slice.call(e, 0).forEach(t)
        };
    return function(c) {
        function l() {
            return !n.autospin.hasOwnProperty("version") || 1 === Number(n.autospin.version)
        }

        function u() {}

        function p(e, t) {
            var u, p, g, y, h, C, b;
            i = document.createElement("div"), i.id = "overlay", i.style.position = "absolute", i.style.top = 0, i.style.left = 0, i.style.display = "flex", i.style.alignItems = "center", i.style.justifyContent = "center", i.style.width = "100%", i.style.height = "100%", i.style.minHeight = "100%", i.style.minWidth = "100%", i.style.textAlign = "center", i.style.fontFamily = "Arial, Helvetica, sans-serif", i.style.zIndex = "9998", r = document.createElement("div"), r.style.position = "relative", r.style.backgroundColor = "rgba(255, 255, 255, 0.96)", r.style.borderRadius = "20px", r.style.border = "2px solid black", r.style.boxShadow = "4px 4px 10px #000", r.style.width = "610px", r.style.userSelect = "none", r.addEventListener("click", function(n) {
                u = n.target.getAttribute("name"), "LABEL" !== (g = n.target.nodeName) && "SPAN" !== g || ("LABEL" === g && (u = n.target.getAttribute("name"), p = Number(n.target.getAttribute("value")), y = n.target), "SPAN" === g && (u = n.target.parentNode.getAttribute("name"), p = Number(n.target.parentNode.getAttribute("value")), y = n.target.parentNode));
                var o = function(e) {
                        var t = e.getAttribute("clicked");
                        return "true" === t || "false" !== t && void 0
                    },
                    r = function() {
                        e.setWinLimit(void 0), R.style.backgroundColor = "#cccccc", s(w.getElementsByTagName("LABEL"), function(e) {
                            e.style.color = "#cccccc", o(e) && e.setAttribute("clicked", !1), e.style.border = "", e.style.cursor = "auto"
                        })
                    },
                    l = function() {
                        o(y) ? (y.style.border = "1px", y.style.borderStyle = "normal", y.style.borderColor = "#bbbbbb", y.removeAttribute("clicked"), R.style.backgroundColor = "#cccccc", u === a.SPIN && (h = !1, b = !1, w && r()), u === a.LOSS && (C = !1, b = !1, w && r())) : (s(y.parentNode.childNodes, function(e) {
                            e.style.border = "1px", e.style.borderStyle = "normal", e.style.borderColor = "#bbbbbb", e.removeAttribute("clicked")
                        }), y.style.border = "2px", y.style.borderStyle = "solid", y.style.borderColor = "#ef6c00", y.setAttribute("clicked", !0))
                    };
                u === a.SPIN && (l(), y.getAttribute("clicked") && (e.setSteps(p), h = !0), n.stopPropagation()), u === a.LOSS && (l(), y.getAttribute("clicked") && (e.setLossLimit(p), C = !0), n.stopPropagation()), u === a.WIN && (S && h || !S) && ((x && C || !x) && (e.setWinLimit(p), l(), u = ""), n.stopPropagation()), (S && h || !S) && ("L" === c.gameConfig.gameType || x && C || !x) && (R.style.backgroundColor = "#ef6c00", b = !0, w && s(w.getElementsByTagName("LABEL"), function(e) {
                    e.style.color = "#111111", e.style.cursor = "pointer"
                })), u === a.CANCEL && (e.resetAutoSpin(), t({
                    cancelAutoSpin: !0
                }), v()), u === a.START && b && (i.style.display = "none", t(), v())
            }), r.addEventListener("mouseover", function(e) {
                g = e.target.nodeName;
                var t = function() {
                    s(y.parentNode.childNodes, function(e) {
                        e.getAttribute("clicked") || (e.style.border = "1px", e.style.borderStyle = "normal", e.style.borderColor = "#bbbbbb")
                    }), y.getAttribute("clicked") || (y.style.border = "2px", y.style.borderStyle = "solid", y.style.borderColor = "#1b9ddb")
                };
                "LABEL" !== g && "SPAN" !== g || ("LABEL" === g && (u = e.target.getAttribute("name"), y = e.target), "SPAN" === g && (u = e.target.parentNode.getAttribute("name"), y = e.target.parentNode), u !== a.SPIN && u !== a.LOSS || t()), (S && h || !S) && (x && C || !x) && u === a.WIN && (t(), u = "")
            }), r.addEventListener("mouseout", function(e) {
                if ("LABEL" === e.target.nodeName || "SPAN" === e.target.nodeName) {
                    var t;
                    t = "LABEL" === e.target.nodeName ? e.target.parentNode.childNodes : e.target.parentNode.parentNode.childNodes, Array.prototype.slice.call(t, 0).forEach(function(e) {
                        e.getAttribute("clicked") || (e.style.border = "1px", e.style.borderStyle = "normal", e.style.borderColor = "#bbbbbb")
                    })
                }
                e.stopPropagation()
            });
            var S, x, w, k;
            n.autospin.steps && !e.getSteps() && (S = d(n.autospin.steps)), l() || !n.autospin.lossLimit || e.getLossLimit() || (x = m(n.autospin.lossLimit)), l() || !n.autospin.winLimit || e.getWinLimit() || (w = f(n.autospin.winLimit), k = document.createElement("div"), k.style.width = "100%", k.style.height = "100%", k.style.position = "absolute", k.style.top = 0, k.style.left = 0);
            var I = document.createElement("div");
            I.innerHTML = o.autoSpinStop, I.style.textAlign = "center", I.style.fontWeight = "normal", I.style.fontSize = "14px", I.style.color = "#111111";
            var T = document.createElement("div");
            T.style.textAlign = "center", T.style.width = "100%", T.style.marginTop = "10px", T.style.marginBottom = "20px";
            var E = document.createElement("div");
            E.innerHTML = "X", E.setAttribute("name", a.CANCEL);
            var R = document.createElement("div");
            R.disabled = !0, R.setAttribute("name", a.START);
            for (var L = [E, R], G = 0; G < 2; G++) L[G].style.borderRadius = "4px", L[G].style.height = "38px", L[G].style.width = "106px", L[G].style.display = "inline-block", L[G].style.lineHeight = "38px", L[G].style.verticalAlign = "middle", L[G].style.cursor = "pointer";
            E.style.backgroundColor = "#1b9ddb", E.style.color = "white", E.style.fontWeight = "blod", E.style.fontSize = "18px", R.style.backgroundColor = "#cccccc", R.style.marginLeft = "10px", R.style.position = "relative";
            var D = document.createElement("div");
            D.setAttribute("name", a.START), D.style.width = 0, D.style.height = 0, D.style.borderStyle = "solid", D.style.borderWidth = "10px 0 10px 17.3px", D.style.borderColor = "transparent transparent transparent white", D.style.position = "absolute", D.style.top = "50%", D.style.left = "50%", D.style.transform = "translate(-50%, -50%)", R.appendChild(D), T.appendChild(E), T.appendChild(R);
            var O = document.createElement("div");
            S && O.appendChild(S), x && O.appendChild(x), w && O.appendChild(w), r.appendChild(O), r.appendChild(I), r.appendChild(T), i.appendChild(r)
        }

        function d(e) {
            return g(e, {
                info: o.nbrOfAutoSpin,
                name: a.SPIN
            })
        }

        function m(e) {
            return g(e, {
                info: o.lossLimit,
                name: a.LOSS,
                unit: " " + o.btnBet
            })
        }

        function f(e) {
            return g(e, {
                info: o.stopSingleWinReachCeiling,
                name: a.WIN,
                unit: " " + o.btnBet
            })
        }

        function g(e, t) {
            var n = document.createElement("div");
            n.style.position = "relative";
            var o = document.createElement("div");
            o.innerHTML = t.info, o.style.textAlign = "center", o.style.fontWeight = "bold", o.style.color = "#111111", o.style.fontSize = "16px", o.style.marginTop = "15px";
            var i = document.createElement("div");
            i.style.width = "570px", i.style.margin = "0 auto", i.style.display = "flex", i.style.justifyContent = "space-evenly", i.style.marginTop = "10px", e.forEach(function(e) {
                var n = document.createElement("label");
                if (n.style.borderRadius = "2px", n.style.backgroundColor = "#eeeeee", n.style.width = "104px", n.style.borderWidth = "1px", n.style.borderColor = "#bbbbbb", n.style.display = "flex", n.style.justifyContent = "center", n.style.alignItems = "center", n.style.lineHeight = "inherit", n.style.textAlign = "center", n.style.lineHeight = "36px", n.style.height = "36px", n.style.boxSizing = "border-box", n.style.fontWeight = "bold", n.style.fontSize = "14px", n.style.cursor = "pointer", t.name === a.SPIN ? n.innerHTML = e : n.innerHTML = e + "x", t.name === a.WIN ? (n.style.color = "#777777", n.style.cursor = "auto") : n.style.color = "#111111", t.unit) {
                    var o = document.createElement("span");
                    o.innerHTML = t.unit, o.style.color = "#777777", o.style.fontSize = "14px", S(n, o) && (n.style.lineHeight = "normal"), n.appendChild(o)
                }
                n.setAttribute("name", t.name), n.setAttribute("value", e), i.appendChild(n)
            });
            var r = document.createElement("hr");
            return r.style.height = "1px", r.style.width = "570px", r.style.backgroundColor = "#e3e3e3", r.style.border = "none", r.style.marginTop = "14px", n.appendChild(o), n.appendChild(i), n.appendChild(r), n
        }

        function y() {
            C = x(t), b = C.addElement(i, 800, 600), C.setStyles({
                zIndex: 2
            }), b.showElement()
        }

        function v() {
            b.hideElement(), b.removeElement(), C = C.removeContainer(), i = null
        }

        function h() {
            C && C.reflow()
        }
        n = c.serverConfig, o = c.strings, t = c.gameRoot || c.root;
        var C, b, S = function(e, t) {
                return e.textContent.length + t.textContent.length > 11
            },
            x = e("clientservice/domcontainer/DOMContainer");
        return Object.freeze({
            preload: u,
            render: p,
            destroy: v,
            append: y,
            resize: h
        })
    }
}), define("clientservice/autospin/ui/DOMMobileStandardUI", ["require", "clientservice/domcontainer/DOMContainer"], function(e) {
    "use strict";
    var t, n, o, i, r, a, s, c, l, u, p, d, m = document.createElement("div"),
        f = {
            SPIN: "SPIN",
            WIN: "WIN",
            LOSS: "LOSS",
            START: "START",
            CANCEL: "CANCEL"
        },
        g = function(e, t) {
            Array.prototype.slice.call(e, 0).forEach(t)
        };
    return function(y) {
        function v(e) {
            M = e, M.game && (W = M.game.left, N = 0 === M.game.top ? "40" : M.game.top, H = M.game.width + "px", z = (0 === M.game.top ? M.game.height - 40 : M.game.height) + "px", Y && R(Y, {
                position: "absolute",
                top: N + "px",
                left: W + "px",
                width: H,
                height: z
            })), K && K.reflow()
        }

        function h() {
            return !n.autospin.hasOwnProperty("version") || 1 === Number(n.autospin.version)
        }

        function C() {
            j && clearTimeout(j), j = setTimeout(function() {
                b(), j = void 0, m && (G(), x(q, _), L())
            }, 500)
        }

        function b() {
            if (M && M.game) return void(M.game.width > M.game.height ? (d = !1, U = J) : (d = !0, U = X));
            window.innerHeight > window.innerWidth ? (d = !0, U = X) : (d = !1, U = J)
        }

        function S() {}

        function x(e, t) {
            q = e, _ = t;
            var d, v, C, b;
            m || (m = document.createElement("div")), m.id = "overlay", m.style.fontSize = "12px", m.style.position = "absolute", m.style.top = 0, m.style.left = 0, m.style.display = "flex", m.style.alignItems = "center", m.style.justifyContent = "center", m.style.width = "100%", m.style.height = "100%", m.style.minHeight = "100%", m.style.minWidth = "100%", m.style.textAlign = "center", m.style.fontFamily = "Arial, Helvetica, sans-serif", m.style.zIndex = "9998", !1 === r && (m.style.visibility = "hidden"), i = document.createElement("div"), i.style.position = "relative", i.style.backgroundColor = "rgba(255, 255, 255, 0.96)", i.style.borderRadius = "20px", i.style.border = "2px solid black", i.style.boxShadow = "2px 2px 8px #000", i.style.width = U.containerWidth, i.style.userSelect = "none", i.style["-webkit-tap-highlight-color"] = "rgba(0,0,0,0)", i.style["-webkit-tap-highlight-color"] = "transparent", i.style["-webkit-text-size-adjust"] = "100%", i.addEventListener("click", function(n) {
                d = n.target.getAttribute("name"), "LABEL" !== (C = n.target.nodeName) && "SPAN" !== C || ("LABEL" === C && (d = n.target.getAttribute("name"), v = Number(n.target.getAttribute("value")), b = n.target), "SPAN" === C && (d = n.target.parentNode.getAttribute("name"), v = Number(n.target.parentNode.getAttribute("value")), b = n.target.parentNode));
                var o = function(e) {
                        var t = e.getAttribute("clicked");
                        return "true" === t || "false" !== t && void 0
                    },
                    i = function() {
                        e.setWinLimit(void 0), O.style.backgroundColor = "#cccccc", g(T.getElementsByTagName("LABEL"), function(e) {
                            e.style.color = "#cccccc", o(e) && e.setAttribute("clicked", !1), e.style.border = "", e.style.cursor = "auto"
                        })
                    },
                    r = function() {
                        o(b) ? (b.style.border = "1px", b.style.borderStyle = "normal", b.style.borderColor = "#bbbbbb", b.removeAttribute("clicked"), O.style.backgroundColor = "#cccccc", d === f.SPIN && (l = !1, p = !1, T && i()), d === f.LOSS && (u = !1, p = !1, T && i())) : (g(b.parentNode.childNodes, function(e) {
                            e.style.border = "1px", e.style.borderStyle = "normal", e.style.borderColor = "#bbbbbb", e.removeAttribute("clicked")
                        }), b.style.border = "2px", b.style.borderStyle = "solid", b.style.borderColor = "#ef6c00", b.setAttribute("clicked", !0))
                    };
                d === f.SPIN && (r(), b.getAttribute("clicked") && (e.setSteps(v), l = !0, s && e.getLossLimit() ? p = !0 : s || (p = !0)), n.stopPropagation()), d === f.LOSS && (r(), b.getAttribute("clicked") && (e.setLossLimit(v), u = !0, a && e.getSteps() ? p = !0 : a || (p = !0)), n.stopPropagation()), d === f.WIN && (S && l || !S) && ((x && u || !x) && (e.setWinLimit(v), r(), d = ""), n.stopPropagation()), (S && l || !S) && ("L" === y.gameConfig.gameType || x && u || !x) && (O.style.backgroundColor = "#ef6c00", p = !0, T && g(T.getElementsByTagName("LABEL"), function(e) {
                    e.style.color = "#111111"
                })), d === f.CANCEL && (e.resetAutoSpin(), t({
                    cancelAutoSpin: !0
                }), D(), G()), d === f.START && p && (D(), G(), t())
            });
            var S, x, T;
            n.autospin.steps && (e.getSteps() ? a && (S = w(n.autospin.steps, e.getSteps())) : (S = w(n.autospin.steps), a = !0)), !h() && n.autospin.lossLimit && (e.getLossLimit() ? s && (x = k(n.autospin.lossLimit, e.getLossLimit())) : (x = k(n.autospin.lossLimit), s = !0)), !h() && n.autospin.winLimit && (e.getWinLimit() ? c && (T = I(n.autospin.winLimit, e.getWinLimit())) : (T = I(n.autospin.winLimit), c = !0), p && g(T.getElementsByTagName("LABEL"), function(e) {
                e.style.color = "#111111"
            }));
            var E = document.createElement("div");
            E.innerHTML = o.autoSpinStop, E.style.textAlign = "center", E.style.fontWeight = "normal", E.style.fontSize = "1em", E.style.color = "#111111";
            var R = document.createElement("div");
            R.style.textAlign = "center", R.style.width = "100%", R.style.marginTop = "10px", R.style.marginBottom = "20px";
            var L = document.createElement("div");
            L.innerHTML = "X", L.setAttribute("name", f.CANCEL);
            var O = document.createElement("div");
            O.disabled = !0, O.setAttribute("name", f.START);
            for (var A = [L, O], P = 0; P < 2; P++) A[P].style.borderRadius = "4px", A[P].style.height = U.actionButtonHeight, A[P].style.width = U.actionButtonWidth, A[P].style.display = "inline-block", A[P].style.lineHeight = U.actionButtonLineHeight, A[P].style.verticalAlign = "middle", A[P].style.cursor = "pointer";
            L.style.backgroundColor = "#1b9ddb", L.style.color = "white", L.style.fontWeight = "blod", L.style.fontSize = "1em", O.style.backgroundColor = "#cccccc", O.style.marginLeft = "10px", O.style.position = "relative", p && (O.style.backgroundColor = "#ef6c00", O.disabled = !1);
            var M = document.createElement("div");
            M.setAttribute("name", f.START), M.style.width = 0, M.style.height = 0, M.style.borderStyle = "solid", M.style.borderWidth = "10px 0 10px 17.3px", M.style.borderColor = "transparent transparent transparent white", M.style.position = "absolute", M.style.top = "50%", M.style.left = "50%", M.style.transform = "translate(-50%, -50%)", O.appendChild(M), R.appendChild(L), R.appendChild(O);
            var N = document.createElement("div");
            S && N.appendChild(S), x && N.appendChild(x), T && N.appendChild(T), i.appendChild(N), i.appendChild(E), i.appendChild(R), m.appendChild(i)
        }

        function w(e, t) {
            return T(e, {
                info: o.nbrOfAutoSpin,
                name: f.SPIN,
                selected: t
            })
        }

        function k(e, t) {
            return T(e, {
                info: o.lossLimit,
                name: f.LOSS,
                unit: " " + o.btnBet,
                selected: t
            })
        }

        function I(e, t) {
            return T(e, {
                info: o.stopSingleWinReachCeiling,
                name: f.WIN,
                unit: " " + o.btnBet,
                selected: t
            })
        }

        function T(e, t) {
            var n = document.createElement("div");
            n.style.position = "relative";
            var o = document.createElement("div");
            o.innerHTML = t.info, o.style.textAlign = "center", o.style.fontWeight = "bold", o.style.color = "#111111", o.style.fontSize = "13.5px", o.style.marginTop = "0.9375em";
            var i = document.createElement("div");
            i.style.width = U.templateListWidth, i.style.margin = "0 auto", i.style.display = "flex", i.style.justifyContent = "space-evenly", i.style.marginTop = "0.625em", e.forEach(function(e) {
                var n = document.createElement("label");
                if (n.style.borderRadius = "2px", n.style.backgroundColor = "#eeeeee", n.style.width = U.labelWidth, n.style.borderWidth = "1px", n.style.borderColor = "#bbbbbb", n.style.display = "flex", n.style.justifyContent = "center", n.style.alignItems = "center", n.style.lineHeight = "inherit", n.style.textAlign = "center", n.style.lineHeight = "inherit", n.style.height = U.labelHeigth, n.style.boxSizing = "border-box", n.style.fontWeight = "bold", n.style.fontSize = "1em", n.style.cursor = "pointer", t.name === f.SPIN ? n.innerHTML = e : n.innerHTML = e + "x", t.name === f.WIN ? n.style.color = "#777777" : n.style.color = "#111111", t.unit) {
                    var o = document.createElement("span");
                    o.innerHTML = t.unit, o.style.color = "#777777", E(o, t.unit), d && (n.style.flexDirection = "column"), n.appendChild(o)
                }
                t.selected === e && (n.style.border = "2px", n.style.borderStyle = "solid", n.style.borderColor = "#ef6c00", n.setAttribute("clicked", !0)), n.setAttribute("name", t.name), n.setAttribute("value", e), i.appendChild(n)
            });
            var r = document.createElement("hr");
            return r.style.height = "1px", r.style.width = U.hrWidth, r.style.backgroundColor = "#e3e3e3", r.style.border = "none", r.style.marginTop = U.hrMarginTop, n.appendChild(o), n.appendChild(i), n.appendChild(r), n
        }

        function E(e, t) {
            t.trim().length > 8 && (e.style.fontSize = "0.8em")
        }

        function R(e, t) {
            Object.keys(t).forEach(function(n) {
                e.style[n] = t[n]
            })
        }

        function L() {
            Y || (Y = document.createElement("div"), R(Y, {
                position: "absolute",
                top: N + "px",
                left: W + "px",
                width: H,
                height: z
            }), t.appendChild(Y)), K = $(Y), U === J ? (Q = 480, Z = 320) : (Q = 320, Z = 480), V = K.addElement(m, Q, Z), K.setStyles({
                zIndex: 99
            }), V.showElement()
        }

        function G() {
            m && (V.hideElement(), V.removeElement(), K = K.removeContainer(), m = null, t.removeChild(Y), Y = void 0)
        }

        function D() {
            p = !1, l = !1, u = !1
        }

        function O() {
            r = !0, m && (m.style.visibility = "visible", Y.style.visibility = "visible")
        }

        function A() {
            r = !1, m && (m.style.visibility = "hidden", Y.style.visibility = "hidden")
        }
        n = y.serverConfig, o = y.strings, t = y.root;
        var P = y.consoleConfig,
            M = y.sizingData,
            N = parseInt(P.TCustomView ? P.TCustomView.height : 0),
            B = parseInt(P.BCustomView ? P.BCustomView.height : 0),
            W = parseInt(P.LCustomView ? P.LCustomView.width : 0),
            F = parseInt(P.RCustomView ? P.RCustomView.width : 0),
            z = "calc(100% - " + (N + B) + "px)",
            H = "calc(100% - " + (W + F) + "px)";
        M && M.game && (W = M.game.left, N = 0 === M.game.top ? "40" : M.game.top, H = M.game.width + "px", z = (0 === M.game.top ? M.game.height - 40 : M.game.height) + "px");
        var U, q, _, j, J = {
                containerWidth: "100%",
                containerHeight: "100%",
                actionButtonWidth: "7.615em",
                actionButtonHeight: "2.375em",
                actionButtonLineHeight: "2.375em",
                templateListWidth: "90%",
                labelWidth: "18%",
                labelHeigth: "2em",
                labelMarginRight: "0.5em",
                hrWidth: "90%",
                hrMarginTop: "0.9375em",
                startIconMarginTop: "0.5em"
            },
            X = {
                containerWidth: "90%",
                containerHeight: "75%",
                actionButtonWidth: "7.5em",
                actionButtonHeight: "3.5em",
                actionButtonLineHeight: "3.5em",
                templateListWidth: "90%",
                labelWidth: "18%",
                labelHeigth: "4.375em",
                labelMarginRight: "5px",
                hrWidth: "90%",
                hrMarginTop: "10px",
                startIconMarginTop: "15px"
            };
        b(), window.addEventListener("orientationchange", C);
        var K, V, Y, Q = 480,
            Z = 320,
            $ = e("clientservice/domcontainer/DOMContainer");
        return Object.freeze({
            preload: S,
            render: x,
            destroy: G,
            append: L,
            show: O,
            hide: A,
            resize: v
        })
    }
}), define("clientservice/autospin/ui/DOMTabletStandardUI", ["require", "clientservice/domcontainer/DOMContainer"], function(e) {
    "use strict";
    var t, n, o, i, r, a, s = {
            SPIN: "SPIN",
            WIN: "WIN",
            LOSS: "LOSS",
            START: "START",
            CANCEL: "CANCEL"
        },
        c = function(e, t) {
            Array.prototype.slice.call(e, 0).forEach(t)
        };
    return function(l) {
        function u() {
            return !n.autospin.hasOwnProperty("version") || 1 === Number(n.autospin.version)
        }

        function p() {}

        function d(e, t) {
            var p, d, y, v, C, b, S;
            i = document.createElement("div"), i.id = "overlay", i.style.position = "absolute", i.style.top = 0, i.style.left = 0, i.style.display = "flex", i.style.alignItems = "center", i.style.justifyContent = "center", i.style.width = "100%", i.style.height = "100%", i.style.minHeight = "100%", i.style.minWidth = "100%", i.style.textAlign = "center", i.style.fontFamily = "Arial, Helvetica, sans-serif", i.style.zIndex = "9998", !1 === a && (i.style.visibility = "hidden"), r = document.createElement("div"), r.style.position = "relative", r.style.backgroundColor = "rgba(255, 255, 255, 0.96)", r.style.borderRadius = "20px", r.style.border = "2px solid black", r.style.boxShadow = "2px 2px 8px #000", r.style.width = "610px", r.style.userSelect = "none", r.style["-webkit-tap-highlight-color"] = "rgba(0,0,0,0)", r.style["-webkit-tap-highlight-color"] = "transparent", r.style["-webkit-text-size-adjust"] = "100%", r.addEventListener("click", function(n) {
                p = n.target.getAttribute("name"), "LABEL" !== (y = n.target.nodeName) && "SPAN" !== y || ("LABEL" === y && (p = n.target.getAttribute("name"), d = Number(n.target.getAttribute("value")), v = n.target), "SPAN" === y && (p = n.target.parentNode.getAttribute("name"), d = Number(n.target.parentNode.getAttribute("value")), v = n.target.parentNode));
                var o = function(e) {
                        var t = e.getAttribute("clicked");
                        return "true" === t || "false" !== t && void 0
                    },
                    r = function() {
                        e.setWinLimit(void 0), L.style.backgroundColor = "#cccccc", c(k.getElementsByTagName("LABEL"), function(e) {
                            e.style.color = "#cccccc", o(e) && e.setAttribute("clicked", !1), e.style.border = "", e.style.cursor = "auto"
                        })
                    },
                    a = function() {
                        o(v) ? (v.style.border = "1px", v.style.borderStyle = "normal", v.style.borderColor = "#bbbbbb", v.removeAttribute("clicked"), L.style.backgroundColor = "#cccccc", p === s.SPIN && (C = !1, S = !1, k && r()), p === s.LOSS && (b = !1, S = !1, k && r())) : (c(v.parentNode.childNodes, function(e) {
                            e.style.border = "1px", e.style.borderStyle = "normal", e.style.borderColor = "#bbbbbb", e.removeAttribute("clicked")
                        }), v.style.border = "2px", v.style.borderStyle = "solid", v.style.borderColor = "#ef6c00", v.setAttribute("clicked", !0))
                    };
                p === s.SPIN && (a(), v.getAttribute("clicked") && (e.setSteps(d), C = !0), n.stopPropagation()), p === s.LOSS && (a(), v.getAttribute("clicked") && (e.setLossLimit(d), b = !0), n.stopPropagation()), p === s.WIN && (x && C || !x) && ((w && b || !w) && (e.setWinLimit(d), a(), p = ""), n.stopPropagation()), (x && C || !x) && ("L" === l.gameConfig.gameType || w && b || !w) && (L.style.backgroundColor = "#ef6c00", S = !0, k && c(k.getElementsByTagName("LABEL"), function(e) {
                    e.style.color = "#111111"
                })), p === s.CANCEL && (e.resetAutoSpin(), t({
                    cancelAutoSpin: !0
                }), h()), p === s.START && S && (i.style.display = "none", t(), h())
            }), r.addEventListener("mouseover", function(e) {
                y = e.target.nodeName;
                var t = function() {
                    c(v.parentNode.childNodes, function(e) {
                        e.getAttribute("clicked") || (e.style.border = "1px", e.style.borderStyle = "normal", e.style.borderColor = "#bbbbbb")
                    }), v.getAttribute("clicked") || (v.style.border = "2px", v.style.borderStyle = "solid", v.style.borderColor = "#1b9ddb")
                };
                "LABEL" !== y && "SPAN" !== y || ("LABEL" === y && (p = e.target.getAttribute("name"), v = e.target), "SPAN" === y && (p = e.target.parentNode.getAttribute("name"), v = e.target.parentNode), p !== s.SPIN && p !== s.LOSS || t()), (x && C || !x) && (w && b || !w) && p === s.WIN && (t(), p = "")
            }), r.addEventListener("mouseout", function(e) {
                "LABEL" === e.target.nodeName && Array.prototype.slice.call(e.target.parentNode.childNodes, 0).forEach(function(e) {
                    e.getAttribute("clicked") || (e.style.border = "1px", e.style.borderStyle = "normal", e.style.borderColor = "#bbbbbb")
                }), e.stopPropagation()
            });
            var x, w, k, I;
            n.autospin.steps && !e.getSteps() && (x = m(n.autospin.steps)), u() || !n.autospin.lossLimit || e.getLossLimit() || (w = f(n.autospin.lossLimit)), u() || !n.autospin.winLimit || e.getWinLimit() || (k = g(n.autospin.winLimit), I = document.createElement("div"), I.style.width = "100%", I.style.height = "100%", I.style.position = "absolute", I.style.top = 0, I.style.left = 0);
            var T = document.createElement("div");
            T.innerHTML = o.autoSpinStop, T.style.textAlign = "center", T.style.fontWeight = "normal", T.style.fontSize = "14px", T.style.color = "#111111";
            var E = document.createElement("div");
            E.style.textAlign = "center", E.style.width = "100%", E.style.marginTop = "10px", E.style.marginBottom = "20px";
            var R = document.createElement("div");
            R.innerHTML = "X", R.setAttribute("name", s.CANCEL);
            var L = document.createElement("div");
            L.disabled = !0, L.setAttribute("name", s.START);
            for (var G = [R, L], D = 0; D < 2; D++) G[D].style.borderRadius = "4px", G[D].style.height = "38px", G[D].style.width = "106px", G[D].style.display = "inline-block", G[D].style.lineHeight = "38px", G[D].style.verticalAlign = "middle", G[D].style.cursor = "pointer";
            R.style.backgroundColor = "#1b9ddb", R.style.color = "white", R.style.fontWeight = "blod", R.style.fontSize = "18px", L.style.backgroundColor = "#cccccc", L.style.marginLeft = "10px", L.style.position = "relative";
            var O = document.createElement("div");
            O.setAttribute("name", s.START), O.style.width = 0, O.style.height = 0, O.style.borderStyle = "solid", O.style.borderWidth = "10px 0 10px 17.3px", O.style.borderColor = "transparent transparent transparent white", O.style.position = "absolute", O.style.top = "50%", O.style.left = "50%", O.style.transform = "translate(-50%, -50%)", L.appendChild(O), E.appendChild(R), E.appendChild(L);
            var A = document.createElement("div");
            x && A.appendChild(x), w && A.appendChild(w), k && A.appendChild(k), r.appendChild(A), r.appendChild(T), r.appendChild(E), i.appendChild(r)
        }

        function m(e) {
            return y(e, {
                info: o.nbrOfAutoSpin,
                name: s.SPIN
            })
        }

        function f(e) {
            return y(e, {
                info: o.lossLimit,
                name: s.LOSS,
                unit: " " + o.btnBet
            })
        }

        function g(e) {
            return y(e, {
                info: o.stopSingleWinReachCeiling,
                name: s.WIN,
                unit: " " + o.btnBet
            })
        }

        function y(e, t) {
            var n = document.createElement("div");
            n.style.position = "relative";
            var o = document.createElement("div");
            o.innerHTML = t.info, o.style.textAlign = "center", o.style.fontWeight = "bold", o.style.color = "#111111", o.style.fontSize = "16px", o.style.marginTop = "15px";
            var i = document.createElement("div");
            i.style.width = "570px", i.style.margin = "0 auto", i.style.display = "flex", i.style.justifyContent = "space-evenly", i.style.marginTop = "10px", e.forEach(function(e) {
                var n = document.createElement("label");
                if (n.style.borderRadius = "2px", n.style.backgroundColor = "#eeeeee", n.style.width = "104px", n.style.borderWidth = "1px", n.style.borderColor = "#bbbbbb", n.style.display = "flex", n.style.justifyContent = "center", n.style.alignItems = "center", n.style.textAlign = "center", n.style.lineHeight = "36px", n.style.height = "36px", n.style.boxSizing = "border-box", n.style.fontWeight = "bold", n.style.fontSize = "14px", n.style.cursor = "pointer", t.name === s.SPIN ? n.innerHTML = e : n.innerHTML = e + "x", t.name === s.WIN ? n.style.color = "#777777" : n.style.color = "#111111", t.unit) {
                    var o = document.createElement("span");
                    o.innerHTML = t.unit, o.style.color = "#777777", o.style.fontSize = "14px", n.appendChild(o)
                }
                n.setAttribute("name", t.name), n.setAttribute("value", e), i.appendChild(n)
            });
            var r = document.createElement("hr");
            return r.style.height = "1px", r.style.width = "570px", r.style.backgroundColor = "#e3e3e3", r.style.border = "none", r.style.marginTop = "14px", n.appendChild(o), n.appendChild(i), n.appendChild(r), n
        }

        function v() {
            x = T(t), k = 800, I = 600, w = x.addElement(i, k, I), x.setStyles({
                zIndex: 99
            }), w.showElement()
        }

        function h() {
            w.hideElement(), w.removeElement(), x = x.removeContainer(), i = null
        }

        function C() {
            a = !0, i && (i.style.visibility = "visible")
        }

        function b() {
            a = !1, i && (i.style.visibility = "hidden")
        }

        function S() {
            x && x.reflow()
        }
        n = l.serverConfig, o = l.strings, t = l.gameRoot || l.root;
        var x, w, k = 800,
            I = 600,
            T = e("clientservice/domcontainer/DOMContainer");
        return Object.freeze({
            preload: p,
            render: d,
            destroy: h,
            append: v,
            show: C,
            hide: b,
            resize: S
        })
    }
}), define("clientservice/autospin/ui/AutoSpinUI", ["require", "clientservice/autospin/ui/DOMDesktopStandardUI", "clientservice/autospin/ui/DOMMobileStandardUI", "clientservice/autospin/ui/DOMTabletStandardUI"], function(e) {
    "use strict";
    return function(t) {
        function n(e, t) {
            l.render(e, t)
        }

        function o() {
            l.append()
        }

        function i(e, t) {
            l.showStopMessage(e, t)
        }

        function r() {}

        function a(e) {
            l.resize && l.resize(e)
        }

        function s() {
            l.show()
        }

        function c() {
            l.hide()
        }
        var l, u = t.serverConfig.channel.toLowerCase(),
            p = t.serverConfig.presenttype.toLowerCase();
        if ("int" === u) "std" === p && (l = e("clientservice/autospin/ui/DOMDesktopStandardUI")(t));
        else if ("mob" === u) "std" === p && (l = e("clientservice/autospin/ui/DOMMobileStandardUI")(t));
        else {
            if ("tab" !== u) throw new Error("AutoSpinUI initialize error: not support channel or presenttype");
            "std" === p && (l = e("clientservice/autospin/ui/DOMTabletStandardUI")(t))
        }
        return Object.freeze({
            create: n,
            show: o,
            showStopMessage: i,
            update: r,
            resize: a,
            display: s,
            hide: c
        })
    }
}), define("clientservice/autospin/AutoSpinController", ["require", "clientservice/autospin/ui/AutoSpinUI"], function(e) {
    "use strict";
    return function(t) {
        function n(e) {
            d = e.bus, m = e.serverConfig, y = e.stringsConfig, f = e.gameConfig
        }

        function o() {
            I.startAutoSpin(), R.reset(), E.reset()
        }

        function i(e) {
            var t;
            e && e.stopReason && (t = e.stopReason), I.getOriginalSteps() && u.postAutoSpinStopEvent(T || t, I), S = !0, b || r()
        }

        function r() {
            I.resetAutoSpin(), R.reset()
        }

        function a() {
            I.isAutoSpinStarted() && (m.autospin.hasOwnProperty("version") && 1 !== Number(m.autospin.version) ? s(!0, !0) : s(!1, !0))
        }

        function s(e, t) {
            C ? b && r() : (d.publish({
                channel: "ClientService",
                topic: "Game.StopAutoSpin",
                data: {}
            }), C = !0, b = b || !!t), t && !e && I.resetAutoSpin()
        }

        function c(e) {
            return R.checkResponse(e) ? void s(!0) : E.checkResponse(e) ? void s(!0) : void 0
        }

        function l(e) {
            u = e
        }
        var u, p, d = t.bus,
            m = t.serverConfig,
            f = t.gameConfig,
            g = t.consoleConfig,
            y = t.stringsConfig,
            v = t.errorHandler,
            h = {},
            C = !1,
            b = !1,
            S = !1,
            x = void 0,
            w = void 0,
            k = .01,
            I = function() {
                var e = {
                        originalSteps: void 0,
                        steps: void 0,
                        lossLimit: void 0,
                        winLimit: void 0,
                        isAutoSpinStarted: !1
                    },
                    t = function() {
                        e = {
                            originalSteps: void 0,
                            steps: void 0,
                            lossLimit: void 0,
                            winLimit: void 0,
                            isAutoSpinStarted: !1
                        }, C = !1, b = !1, S = !1
                    },
                    n = function() {
                        if (w = !1, m.paramRGS.hasOwnProperty("denomamount") && (k = m.paramRGS.denomamount), m.hasOwnProperty("tierThresholdAmt")) {
                            if (x = Number(m.tierThresholdAmt), m.autospin.hasOwnProperty("stopAtTierThreshold")) {
                                var e = m.autospin.stopAtTierThreshold.toUpperCase();
                                "Y" === e && (w = !0)
                            }
                        } else x = void 0;
                        return "L" === f.gameType
                    };
                return {
                    setSteps: function(t) {
                        e.originalSteps = t, e.steps = t
                    },
                    getSteps: function() {
                        return e.steps
                    },
                    reduceSteps: function() {
                        e.steps -= 1
                    },
                    setLossLimit: function(t) {
                        e.lossLimit = t
                    },
                    getLossLimit: function() {
                        return e.lossLimit
                    },
                    setWinLimit: function(t) {
                        e.winLimit === t ? e.winLimit = void 0 : e.winLimit = t
                    },
                    getWinLimit: function() {
                        return e.winLimit
                    },
                    startAutoSpin: function() {
                        e.isAutoSpinStarted = !0
                    },
                    isAutoSpinStarted: function() {
                        return e.isAutoSpinStarted
                    },
                    getOriginalSteps: function() {
                        return e.originalSteps
                    },
                    resetAutoSpin: t,
                    isIWAutoSpinCheck: n
                }
            }(),
            T = "ManualStop",
            E = function() {
                var e, t = {
                        "@notification": "Y",
                        "@type": "",
                        Id: "",
                        Message: "",
                        Buttons: {
                            Button: {
                                Text: y.btnOk ? y.btnOk : "OK",
                                Cmd: {
                                    "@name": ""
                                }
                            }
                        }
                    },
                    n = 0,
                    o = 0,
                    i = function() {
                        n = 0, o = 0, e = void 0
                    };
                return {
                    checkResponse: function(r) {
                        if (!C) {
                            if (I.isIWAutoSpinCheck()) {
                                if (b && S) return !0;
                                if ("Start" === r.OutcomeDetail.GameStatus && (I.reduceSteps(), 0 === I.getSteps())) return i(), T = "AutoStop", !0;
                                var a = Number(r.OutcomeDetail.Payout) * k,
                                    s = Number(r.OutcomeDetail.Payout);
                                if (n += Number(r.OutcomeDetail.Payout), o += Number(r.OutcomeDetail.Settled), e || 0 !== (e = Number(r.OutcomeDetail.Settled) || Number(r.OutcomeDetail.Pending))) {
                                    if (void 0 !== x && w && a >= x) return i(), t["@type"] = "SINGLE_WIN_STOP_AUTO_PLAY", t.Id = "9032", t.Message = y.winLimitHitStopAutoplay ? y.winLimitHitStopAutoplay : "Single win limit reached. Auto Play stopped. ", v.throwError("CD-205", null, t, 1), T = "WinLimitStop", !0;
                                    if (m.hasOwnProperty("autospin")) {
                                        if (void 0 !== I.getLossLimit() && I.getLossLimit() > 0 && o - n >= I.getLossLimit() * e) return i(), t["@type"] = "UK_AUTO_SPIN_LOSS_STOP", t.Id = "9030", t.Message = y.spinTimeHit && y.lossLimitHit ? y.spinTimeHit + "\n" + y.lossLimitHit : "Auto Spins stopped\nLoss limit reached", v.throwError("CD-205", null, t, 1), T = "LossLimitStop", !0;
                                        if (void 0 !== I.getWinLimit() && I.getWinLimit() > 0 && s >= I.getWinLimit() * e) return i(), t["@type"] = "UK_AUTO_SPIN_WIN_STOP", t.Id = "9031", t.Message = y.spinTimeHit && y.winLimitHit ? y.spinTimeHit + "\n" + y.winLimitHit : "Auto Spins stopped\nSingle win limit reached", v.throwError("CD-205", null, t, 1), T = "WinLimitStop", !0
                                    }(r.Exception || r.Messages && "1601" === r.Messages.Message.Id) && (T = "ErrorStop"), r.JackpotOutcome && r.JackpotOutcome.Jackpot && r.JackpotOutcome.Jackpot["@value"] && (T = "JackpotStop")
                                }
                            }
                        }
                    },
                    reset: i
                }
            }(),
            R = function() {
                var e, t = 0,
                    n = 0,
                    o = function() {
                        t = 0, n = 0, e = void 0
                    },
                    i = {
                        "@notification": "Y",
                        "@type": "",
                        Id: "",
                        Message: "",
                        Buttons: {
                            Button: {
                                Text: y.btnOk ? y.btnOk : "OK",
                                Cmd: {
                                    "@name": ""
                                }
                            }
                        }
                    };
                return {
                    checkResponse: function(r) {
                        if (!I.isIWAutoSpinCheck()) {
                            if (b && S) return !0;
                            if (m.autospin.hasOwnProperty("version") && 1 !== Number(m.autospin.version)) {
                                var a = Number(r.OutcomeDetail.Payout);
                                if (t += a, n += Number(r.OutcomeDetail.Settled), e || 0 !== (e = Number(r.OutcomeDetail.Settled) || Number(r.OutcomeDetail.Pending))) {
                                    if ("Start" === r.OutcomeDetail.GameStatus) {
                                        if (I.reduceSteps(), 0 === I.getSteps()) return o(), T = "AutoStop", !0;
                                        if (void 0 !== I.getLossLimit() && I.getLossLimit() > 0 && n - t >= I.getLossLimit() * e) return o(), i["@type"] = "UK_AUTO_SPIN_LOSS_STOP", i.Id = "9030", i.Message = y.spinTimeHit && y.lossLimitHit ? y.spinTimeHit + "\n" + y.lossLimitHit : "Auto Spins stopped\nLoss limit reached", v.throwError("CD-205", null, i, 1), T = "LossLimitStop", !0;
                                        if (void 0 !== I.getWinLimit() && I.getWinLimit() > 0 && a >= I.getWinLimit() * e) return o(), i["@type"] = "UK_AUTO_SPIN_WIN_STOP", i.Id = "9031", i.Message = y.spinTimeHit && y.winLimitHit ? y.spinTimeHit + "\n" + y.winLimitHit : "Auto Spins stopped\nSingle win limit reached", v.throwError("CD-205", null, i, 1), T = "WinLimitStop", !0
                                    }(r.Exception || r.Messages && "1601" === r.Messages.Message.Id) && (T = "ErrorStop"), r.JackpotOutcome && r.JackpotOutcome.Jackpot && r.JackpotOutcome.Jackpot["@value"] && (T = "JackpotStop")
                                }
                            }
                        }
                    },
                    reset: o
                }
            }(),
            L = function(e, t) {
                return !(!e.autospin.steps || t.getSteps()) || "L" !== f.gameType && !(!e.autospin.lossLimit || t.getLossLimit())
            };
        return d.subscribe({
            channel: "Game",
            topic: "Game.AutoSpinOption",
            callback: function(n, o) {
                I.resetAutoSpin(), n.hasOwnProperty("steps") && void 0 !== n.steps && I.setSteps(n.steps), n.hasOwnProperty("lossLimit") && void 0 !== n.lossLimit && I.setLossLimit(n.lossLimit), n.hasOwnProperty("winLimit") && void 0 !== n.winLimit && I.setWinLimit(n.winLimit), L(m, I) ? (p = e("clientservice/autospin/ui/AutoSpinUI")({
                    serverConfig: m,
                    consoleConfig: g,
                    gameConfig: f,
                    strings: y,
                    root: t.root,
                    gameRoot: t.gameRoot,
                    sizingData: h
                }), p.create(I, function(e) {
                    var t = {
                        action: "play"
                    };
                    e && e.cancelAutoSpin ? t.action = "cancel" : (I.startAutoSpin(), I.getSteps() && (t.steps = I.getSteps()), I.getLossLimit() && (t.lossLimit = I.getLossLimit()), I.getWinLimit() && (t.winLimit = I.getWinLimit()), u.postAutoSpinExecutionEvent(I)), o.reply(null, t)
                }), p.show()) : (I.startAutoSpin(), u.postAutoSpinExecutionEvent(I), o.reply(null, {}))
            }
        }), d.subscribe({
            channel: "Game",
            topic: "Game.AutoSpinStart",
            callback: o
        }), d.subscribe({
            channel: "Game",
            topic: "Game.AutoSpinStopped",
            callback: i
        }), d.subscribe({
            channel: "ConsoleService",
            topic: "Game.AutoSpinStop",
            callback: a
        }), d.subscribe({
            channel: "GameService",
            topic: "Game.AutoSpinStop",
            callback: a
        }), d.subscribe({
            channel: "Game",
            topic: "Game.Capabilities",
            callback: function(e) {
                e && e.screen && e.screen.hasOwnProperty("display") && (e.screen.display ? p.display() : e.screen.display || p.hide())
            }
        }), d.subscribe({
            channel: "Kernel",
            topic: "System.Resize",
            callback: function(e) {
                h = e, p && p.resize(e)
            }
        }), Object.freeze({
            init: n,
            checkAutoSpinLimits: c,
            isAutoSpinStarted: function() {
                return I.isAutoSpinStarted()
            },
            setCECCommand: l
        })
    }
}), define("clientservice/transformer/JpsDataTransformer", ["require"], function(e) {
    "use strict";

    function t(e) {
        return e
    }

    function n(e) {
        return e
    }
    return function() {
        return {
            transformMeterResponseData: t,
            transformMessageResponseData: n
        }
    }
}), define("clientservice/communicator/JpsCommunicator", ["require", "clientservice/transformer/JpsDataTransformer", "clientservice/communicator/DataAdapter"], function(e) {
    "use strict";
    return function(t) {
        function n(e, t, o) {
            var r = c(),
                l = r.retry;
            l <= 0 && (l = 1), o || (o = 0), s.httpCall(i, function(i) {
                var r = a.transformMeterResponseData(i);
                s.deepFreezeJsonObj(r), r.exception ? o < l - 1 ? n(e, t, o + 1) : t(r.exception) : e(r)
            }, t, r)
        }

        function o(e, n, i) {
            var l = c({
                    language: t.serverConfig.paramRGS.language
                }),
                u = l.retry;
            u <= 0 && (u = 1), i || (i = 0), s.httpCall(r, function(t) {
                var r = a.transformMessageResponseData(t);
                s.deepFreezeJsonObj(r), r.exception ? i < u - 1 ? o(e, n, i + 1) : n(r.exception) : e(r)
            }, n, l)
        }
        var i = t.serverConfig.jackpotMeterUrl,
            r = t.serverConfig.jackpotWinsUrl,
            a = e("clientservice/transformer/JpsDataTransformer")(t),
            s = e("clientservice/communicator/DataAdapter")(),
            c = function(e) {
                var n = {
                    method: "GET",
                    timeout: Number(t.serverConfig.requestTimeout),
                    retry: Number(t.serverConfig.requestRetries),
                    accept: "json",
                    headerMap: {
                        "Content-Type": "application/json"
                    },
                    paramMap: {
                        currencycode: t.serverConfig.paramRGS.currencycode
                    }
                };
                if (e)
                    for (var o in e) n.paramMap[o] = e[o];
                return n
            };
        return {
            requestJackpotMeterResponse: n,
            requestPlayerAwarenessResponse: o
        }
    }
}), define("clientservice/commands/JpsCommand", ["require", "clientservice/communicator/JpsCommunicator", "kernel/logger/Logger"], function(e) {
    "use strict";
    return function(t, n, o, i) {
        function r(e) {
            if (!e) return o.pauseGame(), void n.throwError("CD-006", function() {
                o.unPauseGame()
            });
            if (!e.id) return void n.throwError(e);
            var t = function() {};
            switch (e.id) {
                case 1003:
                    return void n.throwError("JP-103", t);
                case 1004:
                    return void n.throwError("JP-104", t);
                case 1006:
                    return void n.throwError("JP-106", t);
                case 1007:
                    return void n.throwError("JP-107", t);
                case 1008:
                    return void n.throwError("JP-108", t);
                default:
                    n.throwError("JP-101", t)
            }
        }

        function a(e) {
            v.requestJackpotMeterResponse(function(n) {
                if (n.exception) return void r(n.exception);
                if (n.jackpots && void 0 !== n.messageId) {
                    if (e && "function" == typeof e) {
                        var o = s(n);
                        e({
                            jackpotCurrencyCode: o
                        })
                    }
                    t.publish({
                        channel: "ClientService",
                        topic: "Jackpot.MeterUpdate",
                        data: n
                    }), f !== n.messageId && (f = n.messageId, c())
                } else r("CD-006")
            }, function(e) {
                "CD-001" === e ? r() : m(e)
            })
        }

        function s(e) {
            var t, n;
            return e && e.jackpots && (t = e.jackpots.jackpot, t && Array.isArray(t) && (t = t[0]), n = t.currency), n
        }

        function c(e) {
            v.requestPlayerAwarenessResponse(function(n) {
                if (n.exception) return void r(n.exception);
                e && "function" == typeof e && e(), n.playerMessage ? t.publish({
                    channel: "ClientService",
                    topic: "Jackpot.PlayerMessageUpdate",
                    data: n
                }) : r("CD-006")
            }, function(e) {
                "CD-001" === e ? r() : m(e)
            })
        }

        function l(e) {
            i.serverConfig.jackpotMeterUrl && a(function(n) {
                S++, e && "function" == typeof e && e(n), g = i.serverConfig.jackpotMeterRequestDelay ? setInterval(a, i.serverConfig.jackpotMeterRequestDelay) : setInterval(a, C), t.subscribe({
                    channel: "Game",
                    topic: "Jackpot.MeterRequest",
                    callback: function(e) {
                        a()
                    }
                })
            })
        }

        function u(e) {
            clearInterval(g)
        }

        function p(e) {
            i.serverConfig.jackpotWinsUrl && c(function() {
                S++, y = i.serverConfig.jackpotPlayerMessageRequestDelay ? setInterval(c, i.serverConfig.jackpotPlayerMessageRequestDelay) : setInterval(c, b), t.subscribe({
                    channel: "Game",
                    topic: "Jackpot.PlayerMessageRequest",
                    callback: function(e) {
                        c()
                    }
                })
            })
        }

        function d(e) {
            clearInterval(y)
        }

        function m(e) {
            if (h.log("JPS meter request fails for" + e, "JpsCommand"), "CD-002" === e || "CD-006" === e) {
                if (0 === S) return S++, void r("CD-006")
            } else r(e)
        }
        var f, g, y, v = e("clientservice/communicator/JpsCommunicator")(i),
            h = e("kernel/logger/Logger"),
            C = 15e3,
            b = 6e4,
            S = 0;
        return {
            startJackpot: function(e) {
                l(e), p(e)
            },
            stopJackpot: function(e) {
                u(e), d(e)
            }
        }
    }
}), define("clientservice/promospin/ui2/dialogFactory/Element", [], function() {
    "use strict";

    function e(e) {
        this.element = document.createElement(e)
    }
    return e.prototype.applyStyles = function(e) {
        for (var t in e) this.element.style[t] = e[t]
    }, e
}), define("clientservice/promospin/ui2/dialogFactory/Dialog", ["./Element"], function(e) {
    "use strict";

    function t(t, n) {
        e.call(this, "DIALOG"), this.layoutStyles = t, this._layout = n, "desktop" === this._layout && window.addEventListener("resize", this.handleResizer.call(this))
    }
    return t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t.prototype.show = function() {
        this.element.show(), "desktop" === this._layout && this.handleResize()
    }, t.prototype.showModal = function() {
        this.element.showModal(), this._reduceFontSize(), "desktop" === this._layout && this.handleResize()
    }, t.prototype.handleResizer = function() {
        return this.debounce(function() {
            this.handleResize()
        }, 250)
    }, t.prototype.handleResize = function() {
        if (this.element && this.element.open) {
            var e = document.getElementById("container"),
                t = e.offsetHeight,
                n = e.offsetWidth,
                o = parseInt(this.layoutStyles[this._layout].width),
                i = parseInt(this.layoutStyles[this._layout].height),
                r = t / n,
                a = i / o,
                s = (n / o).toFixed(3),
                c = (t / i).toFixed(3),
                l = 1;
            l = r > a ? s >= 1 ? 1 : s : c >= 1 ? 1 : c, this.applyStyles({
                webkitTransformOrigin: "0 0",
                transformOrigin: "0 0",
                margin: "0",
                transform: "translate(" + Math.floor((n - o * l) / 2) + "px, " + Math.floor((t - i * l) / 2) + "px) scale(" + l + ")"
            })
        }
    }, t.prototype.debounce = function(e, t, n) {
        var o, i, r, a, s = this,
            c = function() {
                var l = +new Date - r;
                l < t && l > 0 ? o = setTimeout(c, t - l) : (o = null, n || (a = e.apply(s, i), o || (i = null)))
            };
        return function(i) {
            r = +new Date;
            var l = n && !o;
            return o || (o = setTimeout(c, t)), l && (a = e.apply(s, i), i = null), a
        }
    }, t.prototype._reduceFontSize = function() {
        var e = function(e, t) {
                var n = parseFloat(e.style.fontSize || window.getComputedStyle(e, null).getPropertyValue("font-size"));
                return !(n > 9) || (e.style.fontSize = n - t + "px", !1)
            },
            t = function(t) {
                if (t.scrollWidth && t.offsetWidth && t.scrollHeight && t.offsetHeight)
                    for (; t.scrollWidth > t.offsetWidth || t.scrollHeight > t.offsetHeight;) {
                        var n = e(t, 1);
                        if (n) break
                    }
            },
            n = this.element.querySelectorAll(".need_reduce_font_size, button");
        n && n.length > 0 && Array.from(n).forEach(function(e) {
            t(e)
        })
    }, t.prototype.close = function() {
        this.element.close(arguments), "desktop" === this._layout && window.removeEventListener("resize", this.handleResizer.call(this))
    }, t.prototype.fillHTMLContent = function(e) {
        this.element.innerHTML = e
    }, t.prototype.addCloseListener = function(e) {
        var t = this.element;
        t.addEventListener("close", function() {
            var n = t.returnValue;
            e(n)
        }, !1)
    }, t
}), define("clientservice/promospin/ui2/dialogFactory/Button", ["./Element"], function(e) {
    "use strict";

    function t(t) {
        e.call(this, "BUTTON"), this.element.innerHTML = t, this.element.style.borderColor = "transparent", this.element.style.outline = "none"
    }
    return t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t
}), define("clientservice/promospin/ui2/dialogFactory/PFSButton", ["./Button"], function(e) {
    "use strict";

    function t(t, n, o) {
        e.call(this, t), this._setCommon(), this._setTheme(n), this._setSize(o)
    }
    return t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t.prototype._setCommon = function() {
        var e = {
            color: "#714011",
            borderRadius: "8px",
            fontWeight: "bold",
            letterSpacing: "-0.77px",
            textAlign: "center"
        };
        this.applyStyles(e)
    }, t.prototype._setTheme = function(e) {
        var t = {
            borderWidth: "2px",
            borderStyle: "solid",
            borderColor: "#fec52e",
            boxSizing: "border-box"
        };
        switch (e) {
            case "primary":
                t.backgroundColor = "#fec52e", t.fontWeight = "700";
                break;
            default:
                t.backgroundColor = "#ffffff", t.fontWeight = "600"
        }
        this.applyStyles(t)
    }, t.prototype._setSize = function(e) {
        var t = {};
        switch (e) {
            case "mobile":
                t.width = "100px", t.height = "28px", t.fontSize = "8px";
                break;
            default:
                t.width = "200px", t.height = "56px", t.fontSize = "16px"
        }
        this.applyStyles(t)
    }, t
}), define("clientservice/promospin/ui2/dialogFactory/PFSDialog", ["./Element", "./Dialog", "./PFSButton", "./Button"], function(e, t, n, o) {
    "use strict";

    function i(e, n, o) {
        t.call(this, i.layoutStyles, e), this._layout = e, this._setStyle(), this._fillContent(n)
    }
    return i.layoutStyles = {
        desktop: {
            width: "696px",
            height: "464px"
        },
        mobile: {
            width: "340px",
            height: "216px"
        }
    }, i.prototype = Object.create(t.prototype), i.prototype.constructor = i, i.prototype._setStyle = function() {
        var e = {
            zIndex: 9999,
            position: "relative",
            overflow: "hidden",
            padding: "0",
            boxSizing: "border-box",
            borderRadius: "16px",
            borderWidth: "0",
            boxShadow: "0 0 24px 0 rgba(0, 0, 0, 0.4)",
            background: "linear-gradient(65deg, #e6e6e6 3%, #fff 70%, #fff 89%)",
            maxWidth: "none",
            maxHeight: "none"
        };
        Object.assign(e, i.layoutStyles[this._layout]), this.applyStyles(e)
    }, i.prototype._fillContent = function(e) {
        var t, n = this._createHeader(e.headerInfo),
            o = this._createBody(e.bodyContent),
            i = this._createFooter(e.footerContent);
        e.irregularFooterContent && (t = this._createIrregularFooter(e.irregularFooterContent)), this.element.appendChild(n), this.element.appendChild(o), this.element.appendChild(i), t && this.element.appendChild(t)
    }, i.prototype._createHeader = function(t) {
        var n = new e("DIV"),
            o = "mobile" === this._layout ? "52px" : "120px",
            i = this._convertImageUrl(t.image);
        n.applyStyles({
            width: "100%",
            height: o,
            boxShadow: "0 2px 8px 0 rgba(0, 0, 0, 0.5)",
            backgroundRepeat: "no-repeat",
            backgroundPosition: "center center",
            backgroundSize: "cover",
            backgroundImage: "url(" + i + ")",
            backgroundColor: t.color,
            display: "flex",
            alignItems: "center",
            justifyContent: "center"
        });
        var r = new e("DIV");
        r.applyStyles({
            width: "calc(100% - 10px)",
            height: "calc(100% - 10px)",
            border: "1px dashed " + t.color,
            borderRadius: "16px 16px 0 0"
        });
        var a = n.element,
            s = r.element;
        return a.appendChild(s), a
    }, i.prototype._createBody = function(t) {
        var n = new e("DIV"),
            o = n.element;
        return n.applyStyles({
            width: "100%",
            padding: "0 10px",
            boxSizing: "border-box"
        }), o.innerHTML = t, o
    }, i.prototype._createFooter = function(t) {
        var o = new e("DIV"),
            i = o.element,
            r = {
                width: "100%",
                display: "flex",
                flexDirection: t.flexDirection ? t.flexDirection : "column",
                alignItems: "center"
            };
        "row" === r.flexDirection && (r.justifyContent = "space-evenly"), o.applyStyles(r);
        var a = this,
            s = this._layout;
        return t.buttons.forEach(function(e) {
            var t = new n(e.Text, e.type, s),
                o = {};
            "column" === r.flexDirection && (o.marginBottom = "mobile" === s ? "7px" : "16px", o.width = "50%"), "mobile" === s && /^<strong>\d+/.test(e.Text) && (o.width = "160px"), t.applyStyles(o);
            var c = t.element;
            c.addEventListener("click", function() {
                "Cmd" in e == !1 && (e.Cmd = {}), e.callback(e.Cmd["@name"], e.Cmd.Param), a.close()
            }, !1), i.appendChild(c)
        }), i
    }, i.prototype._createIrregularFooter = function(t) {
        var n = this,
            i = this._layout,
            r = new e("DIV"),
            a = r.element,
            s = {
                width: "100%",
                textAlign: "center",
                height: "102px"
            };
        return "mobile" === i && (s.height = "40px"), r.applyStyles(s), t.buttons.forEach(function(e) {
            var t = new o(e.Text),
                r = {
                    background: "transparent",
                    textDecorationLine: "underline",
                    color: "#005da8",
                    fontSize: "16px",
                    marginTop: "38px",
                    wordWrap: "break-word"
                };
            "mobile" === i && (r.fontSize = "8px", r.marginTop = "12px"), t.applyStyles(r);
            var s = t.element;
            s.addEventListener("click", function() {
                "Cmd" in e == !1 && (e.Cmd = {}), e.callback(e.Cmd["@name"], e.Cmd.Param), n.close()
            }, !1), a.appendChild(s)
        }), a
    }, i.prototype._convertImageUrl = function(e) {
        var t = require.toUrl("./asset");
        return t.split("js")[0] + "asset/promospin/ui2/" + e + "?" + t.split("?")[1]
    }, i
}), define("clientservice/promospin/ui2/dialogStore/congratulationDialog", ["../dialogFactory/PFSDialog"], function(e) {
    "use strict";
    return function(t, n, o) {
        var i = {
                image: "mobile" === t ? "headerCongratsMobile.png" : "headerCongratsDesktop.png",
                color: "#00a8ff"
            },
            r = {
                mobile: ["min-height: 80px; margin-bottom: 10px; ", "display:block; height: 29px; margin: 6px auto 0; font-size: 26px;", "display:block; height: 18px; margin: 1px auto 0; font-size: 16px;", "display:block; height: 12px; margin: 4px auto 0; font-size: 11px;", "not support terms and conditions text in mobile", "display:block; height: 13px; margin: 8px auto 0; font-size: 12px;"],
                desktop: ["min-height: 160px; margin-bottom: 10px; ", "display:block; height: 44px; margin: 14px auto 0; font-size: 40px;", "display:block; height: 36px; margin: 3px auto 0; font-size: 32px;", "display:block; height: 17px; margin: 11px auto 0; font-size: 16px;", "max-height: 42px; margin: 17px auto 0; font-size: 12px;", "display:block; height: 17px; margin: 16px auto 39px; font-size: 16px;"]
            },
            a = "" !== n.expireTime ? "<div class='need_reduce_font_size' style='" + r[t][3] + "width: 100%; font-family: Arial; letter-spacing: -0.77px; text-align: center; color: #888;'>" + n.expireTime + "</div>" : "",
            s = "<div style='" + r[t][0] + "'><div class='need_reduce_font_size' style='" + r[t][1] + "width: 100%; font-family: Arial; font-weight: bold; letter-spacing: -1.92px; text-align: center; color: #005da8;'>" + n.congratulations + "</div><div class='need_reduce_font_size' style='" + r[t][2] + "width: 100%; font-family: Arial; letter-spacing: -1.54px; text-align: center; color: #005da8;'>" + n.youGetSomething + "</div>" + a;
        if (n.tcText && "desktop" === t) {
            s += "<div style='" + r[t][4] + "width: 86%; font-family: Arial; letter-spacing: -0.77px; text-align: center; color: #707070;'>" + n.tcText + "</div>"
        }
        if (n.tcLink) {
            s += "<a class='need_reduce_font_size'  href='" + n.tcLink + "' target='_blank' style='" + r[t][5] + "width: 86%; font-family: Arial; letter-spacing: -0.58px; text-align: center; color: #1b87cd; display: block; outline: none; text-decoration: underline; '>" + n.tcLinkShowText + "</a>"
        }
        return s += "</div>", new e(t, {
            headerInfo: i,
            bodyContent: s,
            footerContent: {
                flexDirection: "row",
                buttons: o.filter(function(e) {
                    return "Decline" !== e.Cmd["@name"]
                })
            },
            irregularFooterContent: {
                buttons: o.filter(function(e) {
                    return "Decline" === e.Cmd["@name"]
                })
            }
        })
    }
}), define("clientservice/promospin/ui2/dialogStore/tableOfferDialog", ["../dialogFactory/PFSDialog"], function(e) {
    "use strict";
    return function(t, n, o) {
        return new e(t, {
            headerInfo: {
                image: "mobile" === t ? "headerCongratsMobile.png" : "headerCongratsDesktop.png",
                color: "#00a8ff"
            },
            bodyContent: "<div style='" + {
                mobile: ["height: 44px; font-size: 20px; letter-spacing: -0.96px;"],
                desktop: ["height: 73px; font-size: 32px; letter-spacing: -1.54px;"]
            }[t] + "width: 100%; margin: 36px auto 27px; font-family: Arial; font-weight: 500; text-align: center; color: #005da8;'>" + n + "</div>",
            footerContent: {
                buttons: o
            }
        })
    }
}), define("clientservice/promospin/ui2/dialogStore/tableWarnDialog", ["../dialogFactory/PFSDialog"], function(e) {
    "use strict";
    return function(t, n, o) {
        var i = {
                image: "mobile" === t ? "headerWarningMobile.png" : "headerWarningDesktop.png",
                color: "#ffdd00"
            },
            r = {
                mobile: ["height: 62px; font-size: 13px; margin: 21px auto 21px; letter-spacing: -0.62px;"],
                desktop: ["height: 111px; font-size: 24px; margin: 32px auto 69px; letter-spacing: -1.15px;"]
            },
            a = "<div style='" + r[t] + "width: 100%; box-sizing: border-box; font-family: Arial; font-weight: 500; text-align: center; color: #005da8;'><span>" + n[0] + "<span><br/><br/><span>" + n[1] + "</span></div>";
        return new e(t, {
            headerInfo: i,
            bodyContent: a,
            footerContent: {
                buttons: o
            }
        })
    }
}), define("clientservice/promospin/ui2/dialogStore/slotOfferDialog", ["../dialogFactory/PFSDialog"], function(e) {
    "use strict";
    return function(t, n, o) {
        return new e(t, {
            headerInfo: {
                image: "mobile" === t ? "headerQuestionMobile.png" : "headerQuestionDesktop.png",
                color: "#00a8ff"
            },
            bodyContent: "<div class='need_reduce_font_size' style='" + {
                mobile: ["height: 18px; font-size: 16px; margin: 10px auto; letter-spacing: -0.78px;"],
                desktop: ["display:block; height: 36px; font-size: 32px; margin: 32px auto; letter-spacing: -1.54px;"]
            }[t] + "width: 100%; font-family: Arial; font-weight: 500; text-align: center; color: #005da8;'>" + n + "</div>",
            footerContent: {
                buttons: o
            }
        })
    }
}), define("clientservice/promospin/ui2/dialogStore/completeDialog", ["../dialogFactory/PFSDialog"], function(e) {
    "use strict";
    return function(t, n, o) {
        var i = {
                image: "mobile" === t ? "headerCongratsMobile.png" : "headerCongratsDesktop.png",
                color: "#00a8ff"
            },
            r = {
                mobile: ["display:block; height: 30px; font-size: 26px;", "height: 45px; margin: 8px auto 16px; font-size: 20px;"],
                desktop: ["display:block; height: 44px; font-size: 40px;", "height: 73px; margin: 24px auto 39px; font-size: 32px;"]
            };
        n.winTip ? (r.desktop[0] += "margin: 32px auto 0;", r.mobile[0] += "margin: 8px auto 0;") : (r.desktop[0] += "margin: 40px auto 70px;", r.mobile[0] += "margin: 14px auto 26px;");
        var a = "<div class='need_reduce_font_size' style='" + r[t][0] + "width: 100%; font-family: Arial; font-weight: bold; letter-spacing: -1.92px; text-align: center; color: #005da8;'>" + n.complete + "</div>";
        return n.winTip && (a += "<div style='" + r[t][1] + "width: 100%;  font-family: Arial; letter-spacing: -1.54px; text-align: center; color: #005da8;'>" + n.winTip + "</div>"), new e(t, {
            headerInfo: i,
            bodyContent: a,
            footerContent: {
                buttons: o
            }
        })
    }
}), define("clientservice/promospin/ui2/dialogStore/gipDialog", ["../dialogFactory/PFSDialog"], function(e) {
    "use strict";
    return function(t, n, o) {
        var i = {
                image: "mobile" === t ? "headerWarningMobile.png" : "headerWarningDesktop.png",
                color: "#00a8ff"
            },
            r = {
                mobile: ["display: flex; height: 93px; padding: 2px 10px 0 10px; flex-direction: column; font-size: 24px; letter-spacing: -1.25px;", "height: 50%; display: flex; align-items: center;", "height: 50%; display: flex; align-items: center;"],
                desktop: ["display: flex; height: 192px; padding: 0 42px; flex-direction: column; font-size: 24px;", "height: 50%; display: flex; align-items: center;", "height: 50%; display: flex; align-items: center;"]
            },
            a = r[t],
            s = "<div style='" + a[0] + "'><div class='need_reduce_font_size' style='" + (a[1] ? a[1] : "") + "width: 100%; font-family: Arial; letter-spacing: -1.15px; text-align: center; color: #005da8;'>" + n[0] + "</div><div class='need_reduce_font_size' style='" + (a[2] ? a[2] : "") + "width: 100%; font-family: Arial; letter-spacing: -1.15px; text-align: center; color: #005da8;'>" + n[1] + "</div></div>";
        return new e(t, {
            headerInfo: i,
            bodyContent: s,
            footerContent: {
                flexDirection: "column",
                buttons: o
            }
        })
    }
}), define("clientservice/promospin/ui2/dialogStore/errorDialog", ["../dialogFactory/PFSDialog"], function(e) {
    "use strict";
    return function(t, n, o) {
        var i = {
                image: "mobile" === t ? "headerWarningMobile.png" : "headerWarningDesktop.png",
                color: "#00a8ff"
            },
            r = {
                mobile: ["display: flex; height: 122px; padding: 2px 10px 0 10px; flex-direction: column; font-size: 24px; letter-spacing: -1.25px;", "height: 50%; display: flex; align-items: center;", "height: 50%; display: flex; align-items: center;"],
                desktop: ["display: flex; height: 232px; padding: 0 72px; flex-direction: column; font-size: 24px;", "height: 50%; display: flex; align-items: center;", "height: 50%; display: flex; align-items: center;"]
            },
            a = r[t],
            s = "<div style='" + a[0] + "'><div class='need_reduce_font_size' style='" + (a[1] ? a[1] : "") + "width: 100%; font-family: Arial; letter-spacing: -1.25px; text-align: center; color: #005da8;'>" + n[0] + "</div><div class='need_reduce_font_size' style='" + (a[2] ? a[2] : "") + "width: 100%; font-family: Arial; letter-spacing: -1.25px; text-align: center; color: #005da8;'>" + n[1] + "</div></div>";
        return new e(t, {
            headerInfo: i,
            bodyContent: s,
            footerContent: {
                flexDirection: "row",
                buttons: o
            }
        })
    }
}), define("clientservice/promospin/ui2/DOMStandardUI", ["require", "clientservice/transformer/RgsDataTransformer", "./dialogStore/congratulationDialog", "./dialogStore/tableOfferDialog", "./dialogStore/tableWarnDialog", "./dialogStore/slotOfferDialog", "./dialogStore/completeDialog", "./dialogStore/gipDialog", "./dialogStore/errorDialog"], function(e) {
    "use strict";
    return function(t) {
        function n(n, o) {
            if ("PLAY_MODE_CHOICE" === n["@type"]) {
                var i = t.serverConfig.dateFormatter ? t.serverConfig.dateFormatter.dateFormatterLong : void 0,
                    r = m.transformUTC2LocalWithFormatter(n.extraInfo.freespinExpiredTime, i),
                    a = {
                        congratulations: f.congratulations,
                        youGetSomething: n.Message,
                        expireTime: r ? f.freespinExpiredTime.replace("{0}", r) : "",
                        tcText: n.extraInfo.termsAndConditionsText,
                        tcLink: n.extraInfo.termsAndConditionsLink,
                        tcLinkShowText: f.terms
                    },
                    s = n.Buttons.Button,
                    c = s.map(function(e) {
                        return {
                            Text: e.Text,
                            Cmd: e.Cmd,
                            callback: o
                        }
                    });
                c[0].type = "default", c[1].type = "primary";
                var l = e("./dialogStore/congratulationDialog"),
                    u = l(d, a, c);
                g.appendChild(u.element), p(u, h.congrats)
            }
        }

        function o(t, n) {
            var o = u(f.freeSpinOptionTable, t[0].freespinBalanceInCurrency),
                i = [{
                    type: "primary",
                    Text: f.btnOk,
                    Cmd: {
                        "@name": 0
                    },
                    callback: n
                }],
                r = e("./dialogStore/tableOfferDialog"),
                a = r(d, o, i);
            g.appendChild(a.element), p(a, h.congrats)
        }

        function i(t, n) {
            var o = t.Message.split("\n"),
                i = t.Buttons.Button,
                r = i.map(function(e) {
                    return {
                        type: "primary",
                        Text: e.Text,
                        Cmd: e.Cmd,
                        callback: n
                    }
                }),
                a = e("./dialogStore/tableWarnDialog"),
                s = a(d, o, r);
            g.appendChild(s.element), p(s, h.congrats)
        }

        function r(t, n) {
            var o = f.freeSpinOptionReminder,
                i = t.map(function(e, t) {
                    return {
                        type: "primary",
                        Text: "<strong>" + e.freespin_num + "</strong><span style='font-weight: 500'> " + f.offerFormat + " </span><strong>" + e.freespinBetInCurrency + "</strong>",
                        Cmd: {
                            "@name": t
                        },
                        callback: n
                    }
                }),
                r = e("./dialogStore/slotOfferDialog"),
                a = r(d, o, i);
            g.appendChild(a.element), p(a, h.question)
        }

        function a(t, n) {
            if ("FREESPIN_CONGRATULATION" === t["@type"] || "FREESPIN_CONGRATULATION_NOT_WIN" === t["@type"]) {
                var o;
                "FREESPIN_CONGRATULATION" === t["@type"] && (o = {
                    complete: f.freespinComplete,
                    winTip: l(t.Message)
                }), "FREESPIN_CONGRATULATION_NOT_WIN" === t["@type"] && (o = {
                    complete: f.freespinComplete || t.Message
                });
                var i = Array.isArray(t.Buttons.Button) ? t.Buttons.Button : [t.Buttons.Button],
                    r = i.map(function(e) {
                        return {
                            type: "primary",
                            Text: e.Text,
                            Cmd: e.Cmd,
                            callback: n
                        }
                    }),
                    a = e("./dialogStore/completeDialog"),
                    s = a(d, o, r);
                g.appendChild(s.element), p(s, h.congrats)
            }
        }

        function s(t, n) {
            var o = t.Message ? t.Message.split("\n") : [],
                i = t.Buttons.Button,
                r = i.map(function(e) {
                    return {
                        Text: e.Text,
                        Cmd: e.Cmd,
                        callback: n
                    }
                });
            r[0].type = "primary", r[1].type = "default";
            var a = e("./dialogStore/gipDialog"),
                s = a(d, o, r);
            g.appendChild(s.element), p(s, h.warning)
        }

        function c(t, n) {
            var o = t.Message ? t.Message.split("\n") : [],
                i = Array.isArray(t.Buttons.Button) ? t.Buttons.Button : [t.Buttons.Button],
                r = i.map(function(e) {
                    return {
                        type: "primary",
                        Text: e.Text,
                        Cmd: e.Cmd,
                        callback: n
                    }
                }),
                a = e("./dialogStore/errorDialog"),
                s = a(d, o, r);
            g.appendChild(s.element), p(s, h.question)
        }

        function l(e) {
            var t = e.match(/{(.*)}/);
            if (t) {
                return "<span>" + e.replace(t[0], "") + "</span><br/><strong>" + t[1] + "</strong>"
            }
            return e
        }

        function u(e, t) {
            var n = e.match(/{(.*)}/);
            if (n) {
                var o = e.split(n[0]);
                return "<span>" + o[0] + "</span><strong>" + t + "</strong><span>" + o[1] + "</span>"
            }
            return e
        }

        function p(e, t) {
            t ? e.showModal() : setTimeout(function() {
                e.showModal()
            }, 1e3)
        }
        var d, m = e("clientservice/transformer/RgsDataTransformer")(),
            f = t.stringsConfig,
            g = t.root,
            y = t.serverConfig.channel.toLowerCase(),
            v = t.serverConfig.presenttype.toLowerCase();
        "int" === y ? "std" === v && (d = "desktop") : "mob" === y ? "std" === v && (d = "mobile") : "tab" === y && "std" === v && (d = "desktop");
        var h = {
            congrats: !1,
            question: !1,
            warning: !1
        };
        return function() {
            var t = {
                desktop: ["headerCongratsDesktop.png", "headerQuestionDesktop.png", "headerWarningDesktop.png"],
                mobile: ["headerCongratsMobile.png", "headerQuestionMobile.png", "headerWarningMobile.png"]
            };
            t = t[d], t.forEach(function(t) {
                var n = new Image,
                    o = e.toUrl("./asset"),
                    i = o.split("/js/clientservice")[0] + "/asset/",
                    r = "?" + o.split("?")[1];
                n.src = i + "promospin/ui2/" + t + r, n.onload = function() {
                    n = null;
                    var e = t.replace(/header(.*)(Desktop|Mobile)\.png/gi, "$1");
                    h[e] = !0
                }
            })
        }(), Object.freeze({
            showPlayModeChoiceDialog: n,
            showTableOfferDialog: o,
            showDefaultOfferDialog: r,
            showCompleteDialog: a,
            showTableWarnDialog: i,
            showGIPDialog: s,
            showErrorDialog: c
        })
    }
}), define("clientservice/promospin/ui2/PromoSpinUI", ["require", "clientservice/promospin/ui2/DOMStandardUI"], function(e) {
    "use strict";
    return function(t) {
        function n(e, t, n) {
            "T" === t ? c.showTableOfferDialog(e, n) : c.showDefaultOfferDialog(e, n)
        }

        function o(e, t) {
            c.showPlayModeChoiceDialog(e, t)
        }

        function i(e, t) {
            c.showCompleteDialog(e, t)
        }

        function r(e, t) {
            c.showTableWarnDialog(e, t)
        }

        function a(e, t) {
            c.showGIPDialog(e, t)
        }

        function s(e, t) {
            c.showErrorDialog(e, t)
        }
        var c = e("clientservice/promospin/ui2/DOMStandardUI")(t);
        return Object.freeze({
            createOffers: n,
            createPromotionalFreeSpinAndWagerChoose: o,
            createCongratulationUI: i,
            createPFSTableWarnUI: r,
            createGIP: a,
            createErrorUI: s
        })
    }
}), define("clientservice/promospin/PromoSpinController", ["require", "clientservice/promospin/ui2/PromoSpinUI", "clientservice/promospin/ui2/PromoSpinUI", "clientservice/promospin/ui2/PromoSpinUI", "clientservice/promospin/ui2/PromoSpinUI", "clientservice/promospin/ui2/PromoSpinUI", "clientservice/promospin/ui2/PromoSpinUI"], function(e) {
    "use strict";
    var t, n, o, i;
    return function(r) {
        function a(e, n, o) {
            t.showMessage(e, function(t) {
                t ? o(t) : r && r.widgetConfig && r.serverConfig.widgetsEnabled ? i.request({
                    channel: "GameService",
                    topic: "Widgets.FromIXF",
                    data: {
                        messageType: "displayMessage",
                        messageData: e
                    }
                }, function(e) {
                    e ? o(e) : n()
                }) : n()
            })
        }

        function s(t, n) {
            a(t, function() {
                o = e("clientservice/promospin/ui2/PromoSpinUI")(r), o.createPromotionalFreeSpinAndWagerChoose(t, n)
            }, function(e) {
                var t = e["@name"];
                n(t)
            })
        }

        function c(e, t) {
            var o = {
                    Text: "",
                    Cmd: {
                        "@name": "",
                        Param: {
                            value: void 0
                        }
                    }
                },
                i = {
                    "@notification": "Y",
                    "@type": "CHOOSE_OFFER",
                    Id: "9010",
                    Message: 1 === e.length ? n.freeSpinReminder : n.freeSpinOptionReminder,
                    Buttons: {
                        Button: []
                    },
                    extraInfo: {
                        freespinOffers: []
                    }
                };
            return e.forEach(function(e, r) {
                var a = "T" === t,
                    s = e.freespinBalanceInCurrency + " " + n.lblFreeSpins,
                    c = e.freespin_num + " " + n.offerFormat + " " + e.freespinBetInCurrency;
                o.Text = a ? s : c, o.Cmd.Param.value = r, i.Buttons.Button.push(JSON.parse(JSON.stringify(o))), i.extraInfo.freespinOffers.push({
                    lines: e.freespin_lines,
                    bet: e.freespin_bet,
                    number: e.freespin_num,
                    betInCurrency: e.freespinBetInCurrency
                })
            }), i
        }

        function l(t, n, i) {
            a(c(t, n), function() {
                o || (o = e("clientservice/promospin/ui2/PromoSpinUI")(r)), o.createOffers(t, n, i)
            }, function(e) {
                var t = e.Param.value;
                i(t)
            })
        }

        function u(t, n) {
            a(t, function() {
                o || (o = e("clientservice/promospin/ui2/PromoSpinUI")(r)), o.createGIP(t, n)
            }, function(e) {
                n(e["@name"], e.Param)
            })
        }
        return t = r.consoleconnect, n = r.stringsConfig, i = r.bus, i.subscribe({
            channel: "ConsoleService",
            topic: "MessageBox.PFSCONGRATULATION",
            callback: function(t, n) {
                var a = function() {
                        o || (o = e("clientservice/promospin/ui2/PromoSpinUI")(r)), o.createCongratulationUI(t.message, function() {
                            n.reply(null, t.message.Buttons.Button.Cmd["@name"])
                        })
                    },
                    s = function(e) {
                        e ? n.reply(null, e["@name"]) : a()
                    };
                r && r.widgetConfig && r.serverConfig.widgetsEnabled ? i.request({
                    channel: "GameService",
                    topic: "Widgets.FromIXF",
                    data: {
                        messageType: "displayMessage",
                        messageData: t.message
                    }
                }, s) : a()
            }
        }), i.subscribe({
            channel: "ConsoleService",
            topic: "MessageBox.PFSTABLEBETWARN",
            callback: function(t, n) {
                var a = function() {
                        o || (o = e("clientservice/promospin/ui2/PromoSpinUI")(r)), o.createPFSTableWarnUI(t.message, function(e, t) {
                            n.reply(null, e, t)
                        })
                    },
                    s = function(e) {
                        e ? n.reply(null, e["@name"], e.Param.value) : a()
                    };
                r && r.widgetConfig && r.serverConfig.widgetsEnabled ? i.request({
                    channel: "GameService",
                    topic: "Widgets.FromIXF",
                    data: {
                        messageType: "displayMessage",
                        messageData: t.message
                    }
                }, s) : a()
            }
        }), i.subscribe({
            channel: "ConsoleService",
            topic: "MessageBox.PFSISBLOADINGERROR",
            callback: function(t, n) {
                o || (o = e("clientservice/promospin/ui2/PromoSpinUI")(r)), o.createErrorUI(t.message, function() {
                    n.reply(null, t.message.Buttons.Button.Cmd["@name"]), i.publish({
                        channel: "ClientService",
                        topic: "UpdateClientConfigForISB",
                        data: {
                            serverConfig: {
                                playMode: "real"
                            }
                        }
                    })
                })
            }
        }), Object.freeze({
            showPromoSpinOffers: l,
            showPromotionalFreeSpinAndWagerChoose: s,
            showGIPChoose: u
        })
    }
}), define("clientservice/multiplegip/ui/DOMDesktopStandardUI", ["require"], function(e) {
    "use strict";
    var t, n, o, i, r, a = e.toUrl("./asset");
    a.split("/js/clientservice")[0], a.split("?")[1];
    return function(e) {
        function a(e, n, a) {
            o = c({
                style: "position: absolute;top: 0;left: 0;width: 100%;height: 100%;z-index: 9999; visibility: visible; background:#383838;color: white; overflow-y: scroll; text-align: center; cursor: pointer;",
                id: "multipleGIPoverlay"
            });
            var l = c({
                    style: "font-size: 22px;margin: 0 auto;padding-top: 50px;",
                    id: "reminderInfo",
                    text: e.Message
                }),
                d = c({
                    style: "font-size: 24px; margin: 0 auto; padding-top: 25px;",
                    id: "chooseInfo",
                    text: e.extraInfo.translateInfos.labelChoose
                }),
                m = c({
                    style: "position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; width: 40%; min-width: 600px; margin: 0 auto; margin-bottom: 20px;",
                    id: "gameList"
                }),
                f = 0;
            e.Buttons.Button.forEach(function(t, o) {
                if ("multipleGIPRedirect" === t.Cmd["@name"]) {
                    var l = {};
                    t.Cmd.Param.forEach(function(e) {
                        l[e["@name"]] = e["#text"]
                    });
                    var d = c({
                            style: "background: #FF671F; width: 296px; height: 58px; border-radius: 30px; margin-top: 25px;",
                            id: "gameButton"
                        }),
                        g = c({
                            style: "padding-top:10px; font-size: 18px; margin: 0 auto; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding-left: 3px;",
                            id: "gameName",
                            text: p(t.Text)
                        });
                    g.title = p(t.Text);
                    var y = c({
                            style: "font-size: 13px; margin: 0 auto;",
                            id: "time"
                        }),
                        v = c({
                            tag: "span",
                            style: "",
                            id: "lastPlayText",
                            text: e.extraInfo.translateInfos.labelLastPlayed + " " + u(l.txnupdatetime)
                        });
                    y.appendChild(v), d.appendChild(g), d.appendChild(y), d.addEventListener("click", function(e) {
                        return function() {
                            a(e)
                        }
                    }(o)), m.appendChild(d), f++
                }
                if ("" === t.Cmd["@name"] || "continue" === t.Cmd["@name"]) {
                    i = c({
                        style: "font-size: 24px; margin: 0 auto; padding-top: 25px;",
                        id: "or",
                        text: e.extraInfo.translateInfos.labelOr
                    });
                    r = c({
                        style: "background: #27A1DC; width: 296px; height: 58px; border-radius: 30px; margin: 0 auto; font-size: 20px; margin-top: 25px; margin-bottom: 25px; line-height: 58px;",
                        id: "continue",
                        text: e.extraInfo.translateInfos.btnContinue
                    }), r.addEventListener("click", function() {
                        s(), n()
                    })
                }
            }), 1 === f && (m.style.justifyContent = "space-around"), o.appendChild(l), o.appendChild(d), o.appendChild(m), i && r && (o.appendChild(i), o.appendChild(r)), t.appendChild(o)
        }
        e.stringsConfig;
        t = e.root, n = e.gameRoot;
        var s = function() {
                o.innerHTML = "", o.parentNode.removeChild(o), o = null
            },
            c = function(e) {
                var t = l(e.tag ? e.tag : "div", e.style, e.className, e.id);
                return e.text && (t.innerText = e.text), t
            },
            l = function(e, t, n, o) {
                var i = document.createElement(e);
                if (t) {
                    t.trim().split(";").forEach(function(e) {
                        if ("" !== e) {
                            var t = e.split(/:(.+)?/);
                            i.style[t[0].trim()] = t[1].trim()
                        }
                    })
                }
                return n && (i.class = n), o && (i.id = o), i
            },
            u = function(e) {
                var t = new Date(Number(e)),
                    n = t.getMinutes() < 10 ? "0" + t.getMinutes() : t.getMinutes();
                return t.getFullYear() + "/" + (t.getMonth() + 1) + "/" + t.getDate() + "  " + t.getHours() + ":" + n
            },
            p = function(e) {
                return e.indexOf("WLA") > -1 ? e.split("WLA")[0].trim() : e.indexOf("COM") > -1 ? e.split("COM")[0].trim() : e
            };
        return Object.freeze({
            render: a
        })
    }
}), define("clientservice/multiplegip/ui/DOMDesktopMiniUI", ["require"], function(e) {
    "use strict";
    var t, n, o, i, r, a = e.toUrl("./asset");
    a.split("/js/clientservice")[0], a.split("?")[1];
    return function(e) {
        function a(e, n, a) {
            o = c({
                style: "position: absolute;top: 0;left: 0;width: 100%;height: 100%;z-index: 9999; visibility: visible; background:#383838;color: white; overflow-y: scroll; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center",
                id: "multipleGIPoverlay"
            });
            var l = c({
                    style: "font-size: 22px; padding-top: 50px;",
                    id: "reminderInfo",
                    text: e.Message
                }),
                d = c({
                    style: "font-size: 24px; padding-top: 25px;",
                    id: "chooseInfo",
                    text: e.extraInfo.translateInfos.labelChoose
                }),
                m = c({
                    style: "position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; width: 40%; min-width: 296px; margin-bottom: 20px;",
                    id: "gameList"
                }),
                f = 0;
            e.Buttons.Button.forEach(function(t, o) {
                if ("multipleGIPRedirect" === t.Cmd["@name"]) {
                    var l = {};
                    t.Cmd.Param.forEach(function(e) {
                        l[e["@name"]] = e["#text"]
                    });
                    var d = c({
                            style: "background: #FF671F; width: 296px; height: 58px; border-radius: 30px; margin-top: 25px;",
                            id: "gameButton"
                        }),
                        g = c({
                            style: "padding-top:10px; font-size: 18px; margin: 0 auto; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding-left: 3px;",
                            id: "gameName",
                            text: p(t.Text)
                        });
                    g.title = p(t.Text);
                    var y = c({
                            style: "font-size: 13px; margin: 0 auto;",
                            id: "time"
                        }),
                        v = c({
                            tag: "span",
                            style: "",
                            id: "lastPlayText",
                            text: e.extraInfo.translateInfos.labelLastPlayed + " " + u(l.txnupdatetime)
                        });
                    y.appendChild(v), d.appendChild(g), d.appendChild(y), d.addEventListener("click", function(e) {
                        return function() {
                            a(e)
                        }
                    }(o)), m.appendChild(d), f++
                }
                if ("" === t.Cmd["@name"] || "continue" === t.Cmd["@name"]) {
                    i = c({
                        style: "font-size: 24px; margin: 0 auto; padding-top: 25px;",
                        id: "or",
                        text: e.extraInfo.translateInfos.labelOr
                    });
                    r = c({
                        style: "background: #27A1DC; width: 296px; height: 58px; border-radius: 30px; margin: 0 auto; font-size: 20px; margin-top: 25px; margin-bottom: 25px; line-height: 58px;",
                        id: "continue",
                        text: e.extraInfo.translateInfos.btnContinue
                    }), r.addEventListener("click", function() {
                        s(), n()
                    })
                }
            }), 1 === f && (m.style.justifyContent = "space-around"), o.appendChild(l), o.appendChild(d), o.appendChild(m), i && r && (o.appendChild(i), o.appendChild(r)), t.appendChild(o)
        }
        e.stringsConfig;
        t = e.root, n = e.gameRoot;
        var s = function() {
                o.innerHTML = "", o.parentNode.removeChild(o), o = null
            },
            c = function(e) {
                var t = l(e.tag ? e.tag : "div", e.style, e.className, e.id);
                return e.text && (t.innerText = e.text), t
            },
            l = function(e, t, n, o) {
                var i = document.createElement(e);
                if (t) {
                    t.trim().split(";").forEach(function(e) {
                        if ("" !== e) {
                            var t = e.split(/:(.+)?/);
                            i.style[t[0].trim()] = t[1].trim()
                        }
                    })
                }
                return n && (i.class = n), o && (i.id = o), i
            },
            u = function(e) {
                var t = new Date(Number(e)),
                    n = t.getMinutes() < 10 ? "0" + t.getMinutes() : t.getMinutes();
                return t.getFullYear() + "/" + (t.getMonth() + 1) + "/" + t.getDate() + "  " + t.getHours() + ":" + n
            },
            p = function(e) {
                return e.indexOf("WLA") > -1 ? e.split("WLA")[0].trim() : e.indexOf("COM") > -1 ? e.split("COM")[0].trim() : e
            };
        return Object.freeze({
            render: a
        })
    }
}), define("clientservice/multiplegip/ui/DOMMobileStandardUI", ["require"], function(e) {
    "use strict";
    var t, n, o, i, r, a, s = e.toUrl("./asset");
    s.split("/js/clientservice")[0], s.split("?")[1];
    return function(e) {
        function s(e, n, s) {
            o = u({
                style: "position: absolute;top: 0;left: 0;width: 100%;height: 100%;z-index: 9999; visibility: visible; background:#383838;color: white; overflow-y: scroll; text-align: center; cursor: pointer;",
                id: "multipleGIPoverlay"
            });
            var p = u({
                    style: "font-size: 22px;margin: 0 auto;padding-top: 50px;",
                    id: "reminderInfo",
                    text: e.Message
                }),
                f = u({
                    style: "font-size: 24px; margin: 0 auto; padding-top: 25px;",
                    id: "chooseInfo",
                    text: e.extraInfo.translateInfos.labelChoose
                }),
                g = u({
                    style: "position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; width: 90%; margin: 0 auto; margin-bottom: 20px;",
                    id: "gameList"
                }),
                y = 0;
            e.Buttons.Button.forEach(function(t, o) {
                if ("multipleGIPRedirect" === t.Cmd["@name"]) {
                    var a = {};
                    t.Cmd.Param.forEach(function(e) {
                        a[e["@name"]] = e["#text"]
                    });
                    var c = u({
                            style: "background: #FF671F; width: 296px; height: 58px; border-radius: 30px; margin-top: 25px;",
                            id: "gameButton"
                        }),
                        p = u({
                            style: "padding-top:10px; font-size: 18px; margin: 0 auto; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding-left: 3px;",
                            id: "gameName",
                            text: m(t.Text)
                        });
                    p.title = m(t.Text);
                    var f = u({
                            style: "font-size: 13px; margin: 0 auto;",
                            id: "time"
                        }),
                        v = u({
                            tag: "span",
                            style: "",
                            id: "lastPlayText",
                            text: e.extraInfo.translateInfos.labelLastPlayed + " " + d(a.txnupdatetime)
                        });
                    f.appendChild(v), c.appendChild(p), c.appendChild(f), c.addEventListener("click", function(e) {
                        return function() {
                            s(e)
                        }
                    }(o)), g.appendChild(c), y++
                }
                if ("" === t.Cmd["@name"] || "continue" === t.Cmd["@name"]) {
                    i = u({
                        style: "font-size: 24px; margin: 0 auto; padding-top: 25px;",
                        id: "or",
                        text: e.extraInfo.translateInfos.labelOr
                    });
                    r = u({
                        style: "background: #27A1DC; width: 296px; height: 58px; border-radius: 30px; margin: 0 auto; font-size: 20px; margin-top: 25px; margin-bottom: 25px; line-height: 58px;",
                        id: "continue",
                        text: e.extraInfo.translateInfos.btnContinue
                    }), r.addEventListener("click", function() {
                        l(), n()
                    })
                }
            }), c(), (1 === y || a) && (g.style.justifyContent = "space-around"), o.appendChild(p), o.appendChild(f), o.appendChild(g), i && r && (o.appendChild(i), o.appendChild(r)), t.appendChild(o);
            var v = function() {
                c(), g.style.justifyContent = 1 === y || a ? "space-around" : "space-between"
            };
            window.addEventListener("orientationchange", v), window.addEventListener("resize", v)
        }

        function c() {
            a = !!window.matchMedia("(orientation: portrait)").matches
        }
        e.stringsConfig;
        t = e.root, n = e.gameRoot;
        var l = function() {
                o.innerHTML = "", o.parentNode.removeChild(o), o = null
            },
            u = function(e) {
                var t = p(e.tag ? e.tag : "div", e.style, e.className, e.id);
                return e.text && (t.innerText = e.text), t
            },
            p = function(e, t, n, o) {
                var i = document.createElement(e);
                if (t) {
                    t.trim().split(";").forEach(function(e) {
                        if ("" !== e) {
                            var t = e.split(/:(.+)?/);
                            i.style[t[0].trim()] = t[1].trim()
                        }
                    })
                }
                return n && (i.class = n), o && (i.id = o), i
            },
            d = function(e) {
                var t = new Date(Number(e)),
                    n = t.getMinutes() < 10 ? "0" + t.getMinutes() : t.getMinutes();
                return t.getFullYear() + "/" + (t.getMonth() + 1) + "/" + t.getDate() + "  " + t.getHours() + ":" + n
            },
            m = function(e) {
                return e.indexOf("WLA") > -1 ? e.split("WLA")[0].trim() : e.indexOf("COM") > -1 ? e.split("COM")[0].trim() : e
            };
        return Object.freeze({
            render: s
        })
    }
}), define("clientservice/multiplegip/ui/DOMTabletStandardUI", ["require"], function(e) {
    "use strict";
    var t, n, o, i, r, a, s = e.toUrl("./asset");
    s.split("/js/clientservice")[0], s.split("?")[1];
    return function(e) {
        function s(e, n, a) {
            o = u({
                style: "position: absolute;top: 0;left: 0;width: 100%;height: 100%;z-index: 9999; visibility: visible; background:#383838;color: white; overflow-y: scroll; text-align: center; cursor: pointer;",
                id: "multipleGIPoverlay"
            });
            var s = u({
                    style: "font-size: 22px;margin: 0 auto;padding-top: 50px;",
                    id: "reminderInfo",
                    text: e.Message
                }),
                p = u({
                    style: "font-size: 24px; margin: 0 auto; padding-top: 25px;",
                    id: "chooseInfo",
                    text: e.extraInfo.translateInfos.labelChoose
                }),
                f = u({
                    style: "position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; width: 90%; max-width: 800px; margin: 0 auto; margin-bottom: 20px;",
                    id: "gameList"
                }),
                g = 0;
            e.Buttons.Button.forEach(function(t, o) {
                if ("multipleGIPRedirect" === t.Cmd["@name"]) {
                    var s = {};
                    t.Cmd.Param.forEach(function(e) {
                        s[e["@name"]] = e["#text"]
                    });
                    var c = u({
                            style: "background: #FF671F; width: 296px; height: 58px; border-radius: 30px; margin-top: 25px;",
                            id: "gameButton"
                        }),
                        p = u({
                            style: "padding-top:10px; font-size: 18px; margin: 0 auto; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding-left: 3px;",
                            id: "gameName",
                            text: m(t.Text)
                        });
                    p.title = m(t.Text);
                    var y = u({
                            style: "font-size: 13px; margin: 0 auto;",
                            id: "time"
                        }),
                        v = u({
                            tag: "span",
                            style: "",
                            id: "lastPlayText",
                            text: e.extraInfo.translateInfos.labelLastPlayed + " " + d(s.txnupdatetime)
                        });
                    y.appendChild(v), c.appendChild(p), c.appendChild(y), c.addEventListener("click", function(e) {
                        return function() {
                            a(e)
                        }
                    }(o)), f.appendChild(c), g++
                }
                if ("" === t.Cmd["@name"] || "continue" === t.Cmd["@name"]) {
                    i = u({
                        style: "font-size: 24px; margin: 0 auto; padding-top: 25px;",
                        id: "or",
                        text: e.extraInfo.translateInfos.labelOr
                    });
                    r = u({
                        style: "background: #27A1DC; width: 296px; height: 58px; border-radius: 30px; margin: 0 auto; font-size: 20px; margin-top: 25px; margin-bottom: 25px; line-height: 58px;",
                        id: "continue",
                        text: e.extraInfo.translateInfos.btnContinue
                    }), r.addEventListener("click", function() {
                        l(), n()
                    })
                }
            }), c(), 1 === g && (f.style.justifyContent = "space-around"), o.appendChild(s), o.appendChild(p), o.appendChild(f), i && r && (o.appendChild(i), o.appendChild(r)), t.appendChild(o), window.addEventListener("orientationchange", function() {
                c(), f.style.justifyContent = 1 === g ? "space-around" : "space-between"
            })
        }

        function c() {
            a = !!window.matchMedia("(orientation: portrait)").matches
        }
        e.stringsConfig;
        t = e.root, n = e.gameRoot;
        var l = function() {
                o.innerHTML = "", o.parentNode.removeChild(o), o = null
            },
            u = function(e) {
                var t = p(e.tag ? e.tag : "div", e.style, e.className, e.id);
                return e.text && (t.innerText = e.text), t
            },
            p = function(e, t, n, o) {
                var i = document.createElement(e);
                if (t) {
                    t.trim().split(";").forEach(function(e) {
                        if ("" !== e) {
                            var t = e.split(/:(.+)?/);
                            i.style[t[0].trim()] = t[1].trim()
                        }
                    })
                }
                return n && (i.class = n), o && (i.id = o), i
            },
            d = function(e) {
                var t = new Date(Number(e)),
                    n = t.getMinutes() < 10 ? "0" + t.getMinutes() : t.getMinutes();
                return t.getFullYear() + "/" + (t.getMonth() + 1) + "/" + t.getDate() + "  " + t.getHours() + ":" + n
            },
            m = function(e) {
                return e.indexOf("WLA") > -1 ? e.split("WLA")[0].trim() : e.indexOf("COM") > -1 ? e.split("COM")[0].trim() : e
            };
        return Object.freeze({
            render: s
        })
    }
}), define("clientservice/multiplegip/ui/MultipleGIPUI", ["require", "clientservice/multiplegip/ui/DOMDesktopStandardUI", "clientservice/multiplegip/ui/DOMDesktopMiniUI", "clientservice/multiplegip/ui/DOMMobileStandardUI", "clientservice/multiplegip/ui/DOMTabletStandardUI"], function(e) {
    "use strict";
    return function(t) {
        function n(e, t, n) {
            a.render(e, t, n)
        }

        function o() {
            a.append()
        }

        function i() {
            a.show()
        }

        function r() {
            a.hide()
        }
        var a, s = t.serverConfig.channel.toLowerCase(),
            c = t.serverConfig.presenttype.toLowerCase();
        return "int" === s ? ("std" === c && (a = e("clientservice/multiplegip/ui/DOMDesktopStandardUI")(t)), "min" === c && (a = e("clientservice/multiplegip/ui/DOMDesktopMiniUI")(t))) : "mob" === s ? "std" === c && (a = e("clientservice/multiplegip/ui/DOMMobileStandardUI")(t)) : "tab" === s && (a = e("clientservice/multiplegip/ui/DOMTabletStandardUI")(t)), Object.freeze({
            createMultipleGIP: n,
            show: o,
            display: i,
            hide: r
        })
    }
}), define("clientservice/multiplegip/MultipleGIPController", ["require", "clientservice/multiplegip/ui/MultipleGIPUI"], function(e) {
    "use strict";
    var t, n, o, i = {};
    return function(r) {
        function a(e) {
            i && i.log ? i.log(e) : console.log(e)
        }

        function s(e, n, o) {
            var i = l(e),
                r = function(e) {
                    if (e)
                        if ("multipleGIPRedirect" === e["@name"]) {
                            var t = {};
                            e.Param.forEach(function(e) {
                                t[e["@name"]] = e["#text"]
                            }), o(t)
                        } else n();
                    else c(i, n, function(e) {
                        a(i.Buttons.Button[e]);
                        var t = {};
                        i.Buttons.Button[e].Cmd.Param.forEach(function(e) {
                            t[e["@name"]] = e["#text"]
                        }), "MULTIPLE_GIP_NO_REDIRECTION" === t.actiontype ? a("MULTIPLE_GIP_NO_REDIRECTION") : o(t)
                    })
                };
            t.displayLaunchOptions(i, r)
        }

        function c(t, n, i) {
            o || (o = e("clientservice/multiplegip/ui/MultipleGIPUI")(r)), o.createMultipleGIP(t, n, i)
        }

        function l(e) {
            var t = function() {
                    return {
                        Text: "",
                        Cmd: {
                            "@name": "",
                            Param: []
                        }
                    }
                },
                n = {
                    "@notification": "Y",
                    "@type": "MULTIPLE_GIP_CHOOSE",
                    Id: e.Id,
                    Message: e.Message,
                    Buttons: {
                        Button: []
                    },
                    extraInfo: {
                        translateInfos: {}
                    }
                },
                o = e.Buttons.Button.Cmd.Param,
                i = u(o);
            if (o.forEach(function(e) {
                    "extraInfo" === e["@name"] ? (n.extraInfo.translateInfos = e["#text"], i && (n.Message = i.mappingMsg, n.Id = i.mappingCode)) : "gipList" === e["@name"] && e["#text"].forEach(function(e) {
                        var o = t();
                        o.Text = e.gametitle, Object.keys(e).forEach(function(t) {
                            o.Cmd.Param.push({
                                "@name": t,
                                "#text": e[t]
                            })
                        }), o.Cmd["@name"] = "multipleGIPRedirect", n.Buttons.Button.push(JSON.parse(JSON.stringify(o)))
                    })
                }), "multipleGIPContinue" === e.Buttons.Button.Cmd["@name"]) {
                var r = t();
                r.Text = n.extraInfo.translateInfos.btnContinue, r.Cmd["@name"] = "continue", n.Buttons.Button.push(JSON.parse(JSON.stringify(r)))
            }
            return n
        }

        function u(e) {
            var t;
            return e.forEach(function(e) {
                "mappingInfo" === e["@name"] && (t = e["#text"])
            }), t
        }
        return t = r.consoleconnect, n = r.stringsConfig, i = r.logger, Object.freeze({
            showMultipleGIP: s
        })
    }
}), define("clientservice/transformer/CompetitionDataTransformer", ["require"], function(e) {
    "use strict";
    return function(e) {
        function t(e) {
            return e
        }

        function n(e) {
            return JSON.stringify(e)
        }

        function o(e) {
            return e
        }

        function i(e) {
            var t = JSON.parse(JSON.stringify(e));
            return t.prizeDrawTickets && Object.keys(t.prizeDrawTickets).forEach(function(e) {
                Object.keys(t.prizeDrawTickets[e]).forEach(function(n) {
                    t.prizeDrawTickets[e][n].prizeType && "CASH" === t.prizeDrawTickets[e][n].prizeType && (t.prizeDrawTickets[e][n].prizeValue = r.formatFloat(parseFloat(t.prizeDrawTickets[e][n].prizeValue)))
                })
            }), t.prizeDrawTickets
        }
        var r = e.currency;
        return Object.freeze({
            transformCompetitionRegistrationData: t,
            transformCompetitionRegistrationRequestPayload: n,
            transformCompetitionPreviousCashPlayResults: o,
            transformPrizeDrawDrawnTickets: i
        })
    }
}), define("clientservice/communicator/CompetitionCommunicator", ["require", "clientservice/transformer/CompetitionDataTransformer", "clientservice/communicator/DataAdapter"], function(e) {
    "use strict";
    return function(t) {
        function n(e, n, o, i) {
            var r = t.serverConfig.server.replace("/skb", ""),
                l = [r, "/extern/v1/competitions/", e, "/players"].join(""),
                u = c({}, a.transformCompetitionRegistrationRequestPayload(n));
            s.httpCall(l, function(e, t) {
                var n = a.transformCompetitionRegistrationData(e);
                if ("SUCCESS" === n.status) o(n);
                else switch (n.status) {
                    case "BAD_NICKNAME":
                    case "NICKNAME_EXISTED":
                        i(n.status, n.message, !0);
                        break;
                    case "FAILURE":
                    case "SESSION_VALIDATE_FAIL":
                    case "CPT_ERROR":
                    case "COMPETITION_REGISTERED_IN_OTHER_CURRENCY":
                        i(n.status, n.message)
                }
            }, function(e) {
                i(e)
            }, u)
        }

        function o(e, n, o, i) {
            var r = t.serverConfig.server.replace("/skb", ""),
                l = [r, "/extern/v1/competitions/", e, "/optout"].join(""),
                u = c({}, a.transformCompetitionRegistrationRequestPayload(n));
            s.httpCall(l, function(e, t) {
                var n = a.transformCompetitionRegistrationData(e);
                if ("SUCCESS" === n.status) o(n);
                else switch (n.status) {
                    case "FAILURE":
                    case "SESSION_VALIDATE_FAIL":
                    case "CPT_ERROR":
                        i(n.status, n.message)
                }
            }, function(e) {
                i(e)
            }, u)
        }

        function i(e, n, o) {
            var i = t.serverConfig.server.replace("/skb", ""),
                r = [i, "/extern/v1/competitions/previousLeaderBoardResulted/", e.nscode, "/", e.skincode].join(""),
                l = c({
                    uniqueid: e.uniqueid,
                    language: e.language,
                    page: e.page,
                    size: e.size
                });
            l.method = "GET", s.httpCall(r, function(e, t) {
                var i = a.transformCompetitionPreviousCashPlayResults(e);
                "SUCCESS" === i.status ? n(i) : o(i.status, i.message)
            }, function(e) {
                o(e)
            }, l)
        }

        function r(e, n, o) {
            var i = t.serverConfig.server.replace("/skb", ""),
                r = [i, "/extern/v1/competitions/prizeDrawTickets/", e.competitionToken, "?registrationId=" + e.registrationId, "&language=" + e.language].join("");
            e = {};
            var l = c({
                method: "GET"
            });
            s.httpCall(r, function(e) {
                if ("SUCCESS" === e.status) {
                    var t = a.transformPrizeDrawDrawnTickets(e);
                    n(t)
                } else o(e.status, e.message)
            }, function(e) {
                o(e)
            }, l)
        }
        var a = e("clientservice/transformer/CompetitionDataTransformer")(t),
            s = e("clientservice/communicator/DataAdapter")(),
            c = function(e, n) {
                var o = {
                    method: e.method || "POST",
                    timeout: Number(t.serverConfig.requestTimeout) || 15e3,
                    retry: Number(t.serverConfig.requestRetries) || 1,
                    accept: "json",
                    headerMap: {
                        "Content-Type": "application/json;charset=utf-8"
                    },
                    paramMap: {},
                    payloadStr: null,
                    withCredentials: !0,
                    sessionId: t.serverConfig.IGTJSESSIONID
                };
                if (e)
                    for (var i in e) o.paramMap[i] = e[i];
                return n && (o.payloadStr = n), o
            };
        return {
            registerCompetiton: n,
            optOutCompetition: o,
            viewPreviousCashPlayResults: i,
            viewPrizeDrawDrawnTickets: r
        }
    }
}), define("clientservice/competition/CompetitionController", ["require", "clientservice/communicator/DataAdapter", "clientservice/communicator/CompetitionCommunicator"], function(e) {
    "use strict";
    var t = e("clientservice/communicator/DataAdapter")();
    return function(n) {
        function o(e, t) {
            v.debug("request join competition: " + e.competitionId), w.registerCompetiton(e.competitionId, {
                softwareid: S.softwareid,
                securetoken: S.securetoken,
                uniqueid: S.uniqueid,
                skincode: S.skincode,
                nscode: S.nscode,
                channel: S.channel,
                currencycode: S.paramRGS.currencycode,
                presenttype: S.presenttype,
                language: S.paramRGS.language,
                nickname: e.nickname
            }, function(e) {
                if (v.debug("register the competition successfully"), h) {
                    var n = S.paramRGS.competitionTokens ? S.paramRGS.competitionTokens.split(",") : [];
                    n = Array.from(new Set(n));
                    var o = e.competitiontoken;
                    o && -1 === n.indexOf(o) && n.push(o), h(u(o, n))
                }
                t.reply(null, {
                    status: "success",
                    competitionId: e.competitiontoken,
                    nickname: e.nickname,
                    registrationId: e.registrationId,
                    newReBuyRegister: e.newReBuyRegister,
                    leaderBoardReBuyUsedNumber: e.leaderBoardReBuyUsedNumber
                })
            }, function(e, n, o) {
                v.debug("fail register the competition"), "SESSION_VALIDATE_FAIL" === e ? b.throwError("CD-100", function() {}, f()) : o ? t.reply({
                    status: "retry",
                    code: e,
                    message: n
                }) : t.reply({
                    status: "error",
                    code: e,
                    message: n
                })
            })
        }

        function i(e, t) {
            v.debug("request opt out competition: " + e.competitionId), w.optOutCompetition(e.competitionId, {
                softwareid: S.softwareid,
                securetoken: S.securetoken,
                uniqueid: S.uniqueid,
                skincode: S.skincode,
                nscode: S.nscode,
                channel: S.channel,
                currencycode: S.paramRGS.currencycode,
                presenttype: S.presenttype,
                language: S.paramRGS.language
            }, function(n) {
                v.debug("opt out the competition successfully");
                var o = n.competitiontoken || e.competitionId;
                r(o), t.reply(null, {
                    status: "success",
                    competitionId: o
                })
            }, function(e, n) {
                v.debug("fail opt out the competition"), "SESSION_VALIDATE_FAIL" === e ? b.throwError("CD-100", function() {}, f()) : t.reply({
                    status: "error",
                    code: e,
                    message: n
                })
            })
        }

        function r(e) {
            if (h) {
                var t = S.paramRGS.competitionTokens ? S.paramRGS.competitionTokens.split(",") : [],
                    n = t.filter(function(t) {
                        return t !== e
                    });
                h(u("", n))
            }
        }

        function a(e) {
            if (!e || !Array.isArray(e.competitionViewLBResultsBO) || 0 === e.competitionViewLBResultsBO.length) return e;
            var t = e.competitionViewLBResultsBO.map(function(e) {
                return Object.values(e).forEach(function(e) {
                    var t = Object.prototype.toString.call(e);
                    "[object Object]" === t && e.prize && "CASH" === e.prize.category ? e.prize.award = x.formatFloat(parseFloat(e.prize.award)) : "[object Array]" === t && e.forEach(function(e) {
                        e && e.prize && "CASH" === e.prize.category && (e.prize.award = x.formatFloat(parseFloat(e.prize.award)))
                    })
                }), e
            });
            return e.competitionViewLBResultsBO = t, e
        }

        function s(e) {
            function t(e) {
                e.formatterAward = x.formatFloat(parseFloat(e.award)), "FREESPIN" === e.category && e.additionalInfo && e.additionalInfo.offers && e.additionalInfo.offers.forEach(function(e) {
                    e.betAmount && (e.formatterBetAmount = x.formatFloat(parseFloat(e.betAmount)))
                })
            }

            function n(e) {
                e.forEach(function(e) {
                    !e.category || "CASH" !== e.category && "FREESPIN" !== e.category || t(e)
                })
            }
            var o = JSON.parse(JSON.stringify(e));
            return o.forEach(function(e) {
                e.ruleGroupsDescription && (e.ruleGroupsDescription.forEach(function(e) {
                    if (e.rules && e.rules.CONDITION && e.rules.CONDITION[0] && e.rules.CONDITION[0].parameters) {
                        var t = e.rules.CONDITION[0].parameters;
                        Object.keys(t).forEach(function(e) {
                            ["amount", "winAmount", "loseAmount"].indexOf(e) > -1 && (t[e] = x.formatFloat(parseFloat(t[e])))
                        })
                    }
                }), e.ruleGroupsDescription.forEach(function(e) {
                    if (e.exclusiveAward) {
                        var n = e.exclusiveAward;
                        !n.category || "CASH" !== n.category && "FREESPIN" !== n.category || t(n)
                    }
                })), e.leaderBoard && (n(e.leaderBoard.levels), e.leaderBoard.hasOwnProperty("totalPrize") && (e.leaderBoard.totalPrize = x.formatFloat(parseFloat(e.leaderBoard.totalPrize)))), e.prizePool && n(e.prizePool.prizes), e.prizePools && e.prizePools.forEach(function(e) {
                    n(e.prizes)
                })
            }), o
        }

        function c(e, t) {
            w.viewPreviousCashPlayResults({
                uniqueid: S.uniqueid,
                skincode: S.skincode,
                nscode: S.nscode,
                language: S.paramRGS.language
            }, function(t) {
                y.publish({
                    channel: "GameService",
                    topic: "Widgets.FromIXF",
                    data: {
                        messageType: "Competition.History",
                        messageSubType: "LeaderboardHistory",
                        messageData: a(t),
                        messageExtraData: {
                            competitionId: e.competitionToken
                        }
                    }
                })
            }, function(t, n) {
                var o = {
                    status: "error",
                    code: t,
                    message: n
                };
                y.publish({
                    channel: "GameService",
                    topic: "Widgets.FromIXF",
                    data: {
                        messageType: "Competition.History",
                        messageSubType: "LeaderboardHistory",
                        messageData: o,
                        messageExtraData: {
                            competitionId: e.competitionToken
                        }
                    }
                })
            })
        }

        function l(e, t) {
            w.viewPrizeDrawDrawnTickets(e, function(t) {
                y.publish({
                    channel: "GameService",
                    topic: "Widgets.FromIXF",
                    data: {
                        messageType: "Competition.History",
                        messageSubType: "PrizeDrawDrawnTickets",
                        messageData: t,
                        messageExtraData: {
                            competitionId: e.competitionToken
                        }
                    }
                })
            }, function(t, n) {
                var o = {
                    status: "error",
                    code: t,
                    message: n
                };
                y.publish({
                    channel: "GameService",
                    topic: "Widgets.FromIXF",
                    data: {
                        messageType: "Competition.History",
                        messageSubType: "PrizeDrawDrawnTickets",
                        messageData: o,
                        messageExtraData: {
                            competitionId: e.competitionToken
                        }
                    }
                })
            })
        }

        function u(e, t) {
            return {
                serverConfig: {
                    paramRGS: {
                        competitiontoken: e,
                        competitionTokens: t.join(",")
                    }
                }
            }
        }

        function p(e) {
            if ("isb" !== S.thirdPartyCode || I && !k && "freespin" !== S.playMode) {
                k = !0;
                var n = null;
                t.httpCall(S.server.split("/skb")[0] + "/extern/v1/competitions/visibleCpt", function(t, o) {
                    n = o ? o.headers : {};
                    try {
                        t ? d(e, t, n) : d(e, null, n)
                    } catch (t) {
                        d(e, null, n)
                    }
                }, function(t, o) {
                    n = o ? o.headers : {}, d(e, null, n)
                }, {
                    timeout: Number(S.requestTimeout) || 15e3,
                    paramMap: {
                        presenttype: S.presenttype,
                        softwareid: S.softwareid,
                        skincode: S.skincode,
                        channel: S.channel,
                        currencycode: S.paramRGS.currencycode,
                        language: S.paramRGS.language,
                        nscode: S.nscode,
                        uniqueid: S.uniqueid,
                        securetoken: S.securetoken
                    },
                    payloadStr: null,
                    withCredentials: !0,
                    accept: "json",
                    headerMap: {
                        "Content-Type": "application/json;charset=utf-8"
                    },
                    sessionId: S.IGTJSESSIONID
                }), t.httpCall(S.server.split("/skb")[0] + "/extern/v1/competitions/publishCpt", function(e, t) {
                    "SUCCESS" === e.status && y.publish({
                        channel: "ClientService",
                        topic: "Competition.Published",
                        data: s(e.visibleCompetitions)
                    })
                }, function(e, t) {
                    v.debug("publishCpt call error: " + e)
                }, {
                    timeout: Number(S.requestTimeout) || 15e3,
                    paramMap: {
                        presenttype: S.presenttype,
                        skincode: S.skincode,
                        channel: S.channel,
                        currencycode: S.paramRGS.currencycode,
                        language: S.paramRGS.language,
                        nscode: S.nscode,
                        uniqueid: S.uniqueid,
                        securetoken: S.securetoken
                    },
                    payloadStr: null,
                    withCredentials: !0,
                    accept: "json",
                    headerMap: {
                        "Content-Type": "application/json;charset=utf-8"
                    },
                    sessionId: S.IGTJSESSIONID
                })
            }
        }

        function d(e, t, n) {
            var o;
            if (n && n.date) {
                var i = new Date(n.date);
                o = [i.getUTCDate().toString().padStart(2, "0"), "/", (i.getUTCMonth() + 1).toString().padStart(2, "0"), "/", i.getUTCFullYear(), " ", i.getUTCHours().toString().padStart(2, "0"), ":", i.getUTCMinutes().toString().padStart(2, "0"), ":", i.getUTCSeconds().toString().padStart(2, "0"), " UTC"].join("")
            }
            var r = !1,
                a = e ? e.playerInfo : null,
                s = "",
                c = [],
                l = null;
            if (t) {
                if (t.visibleCompetitions && t.visibleCompetitions.length > 0) {
                    if (l = t.visibleCompetitions, t.player) {
                        if (t.player.buffer && t.player.buffer.length > 0) a = {
                            buffer: t.player.buffer,
                            nickname: t.player.nickname,
                            nicknameAutoGen: t.player.nicknameAutoGen,
                            uniqueId: t.player.uniqueId
                        };
                        else if (l && 1 === l.length) {
                            var p = l[0].competitionToken;
                            a = {
                                buffer: [{
                                    cptToken: p,
                                    progress: t.player.progress,
                                    registered: t.player.registered,
                                    registrationId: t.player.registrationId
                                }],
                                nickname: t.player.nickname,
                                nicknameAutoGen: t.player.nicknameAutoGen,
                                uniqueId: t.player.uniqueId
                            }
                        }
                        a && a.buffer && a.buffer.length > 0 && (a.buffer.forEach(function(e) {
                            !0 === e.registered && (r = !0, c.push(e.cptToken))
                        }), 1 === a.buffer.length && a.buffer[0].registered && (s = a.buffer[0].cptToken))
                    }
                } else t.player && (a = {
                    buffer: t.player.buffer,
                    nickname: t.player.nickname,
                    nicknameAutoGen: t.player.nicknameAutoGen,
                    uniqueId: t.player.uniqueId
                });
                r && (s || c.length > 0) && h(u(s, c))
            }
            setTimeout(function() {
                y.publish({
                    channel: "ClientService",
                    topic: "GameService.CompetitionInit",
                    data: {
                        GSPWidget: {
                            player: a,
                            competitions: l,
                            serverTime: o
                        }
                    }
                })
            }, 0)
        }

        function m(e, t) {
            if (v.debug("on finished competition: " + e.competitionId), h) {
                var n = S.paramRGS.competitionTokens ? S.paramRGS.competitionTokens.split(",") : [],
                    o = n.filter(function(t) {
                        return t !== e.competitionId
                    });
                h(u("", o))
            }
        }

        function f() {
            var e = {
                Text: C.btnOk ? C.btnOk : "OK",
                Cmd: {
                    "@name": "reloadGame",
                    Param: {}
                }
            };
            return {
                "@notification": "N",
                Id: "4014",
                Reference: "SKB-4014",
                Message: C.errSessionExpired ? C.errSessionExpired : "Expired session. Dismiss this message to re-launch the game.",
                Buttons: {
                    Button: [e]
                }
            }
        }

        function g(e) {
            if (e || e.historyType || e.competitionId || e.registrationId) {
                var t = {
                    competitionToken: e.competitionId,
                    registrationId: e.registrationId,
                    language: S.paramRGS.language
                };
                switch (e.historyType) {
                    case "History":
                        c(t);
                        break;
                    case "Tickets":
                        l(t)
                }
            }
        }
        var y = n.bus,
            v = n.logger,
            h = n.updateClientConfigHandler,
            C = n.stringsConfig,
            b = n.errorHandler,
            S = n.serverConfig,
            x = n.currency,
            w = e("clientservice/communicator/CompetitionCommunicator")(n),
            k = !1;
        if ("isb" === S.thirdPartyCode) var I = "isb" !== S.thirdPartyCode,
            T = y.subscribe({
                channel: "Game",
                topic: "Game.GameOutcome",
                callback: function(e) {
                    I = !0, e && e.outcome && !1 === e.outcome.promoExclude && p(e.gsInfo), y.unsubscribe(T)
                }
            });
        return y.subscribe({
            channel: "GameService",
            topic: "GameService.JoinCompetition",
            callback: o
        }), y.subscribe({
            channel: "GameService",
            topic: "GameService.OptOutCompetition",
            callback: i
        }), y.subscribe({
            channel: "GameService",
            topic: "Competition.OptedOut",
            callback: r
        }), y.subscribe({
            channel: "GameService",
            topic: "Competition.Completed",
            callback: m
        }), y.subscribe({
            channel: "GameService",
            topic: "Competition.Cancelled",
            callback: m
        }), y.subscribe({
            channel: "GameService",
            topic: "Competition.RequestHistory",
            callback: g
        }), Object.freeze({
            ready: p
        })
    }
}), define("clientservice/replaycontroller/ReplayController", ["require"], function(e) {
    "use strict";
    return function(e, t, n, o) {
        function i() {
            return c
        }

        function r() {
            return !(!s || c !== s)
        }

        function a() {
            l || (o.getFailFlag() || c++, t.sendMessage("replayUpdate", {
                currentRound: c
            })), l = !1
        }
        var s, c = 0,
            l = !1;
        return n.totalRounds && (s = Number(n.totalRounds)), e.subscribe({
            channel: "Game",
            topic: "Game.ReplayData",
            callback: function(e, n) {
                e.replayAction && "next" === e.replayAction && (o.getFailFlag() || c++, t.sendMessage("replayUpdate", {
                    currentRound: c
                })), l = !0
            }
        }), t.addConsoleEvent("shareReplayClicked", function(e, n) {
            o.replayShareUrl(function(e) {
                e.RGSResponse && e.RGSResponse.replayShareURL && t.sendMessage("replayShareUrl", e.RGSResponse.replayShareURL)
            })
        }), {
            getCurrentRound: i,
            replayUpdate: a,
            isReplayEnd: r
        }
    }
}), define("clientservice/widgets/WidgetMessageQueue", [], function() {
    "use strict";
    return function(e) {
        function t(e, t) {
            if (r.log("ISB", "error", e.messageType, e.messageData), e.messageData && e.messageData.action) switch (e.messageData.action) {
                case "reload":
                    i.publish({
                        channel: "ClientService",
                        topic: "ErrorHandler.Throw",
                        data: {
                            errorCode: "GS-007",
                            priority: 0
                        }
                    });
                    break;
                case "fatal":
                    i.publish({
                        channel: "ClientService",
                        topic: "ErrorHandler.Throw",
                        data: {
                            errorCode: "GS-008",
                            priority: 0
                        }
                    });
                    break;
                case "none":
                    if (e.messageData.message) {
                        var n = e.messageData.message.error,
                            o = e.messageData.message.widget,
                            a = (e.messageData.message.reason, {
                                igtWrapperFailed: "WT-002",
                                genericWidgetFailed: "WT-003"
                            });
                        switch (n) {
                            case "igtWrapperFailed":
                                t.setNoWaitWidgetsFlag(!0);
                                break;
                            case "genericWidgetFailed":
                                o && "displayMessageWidget" === o && t.setNoWaitWidgetsFlag(!0)
                        }
                        var s = a[n];
                        s ? i.publish({
                            channel: "ClientService",
                            topic: "ErrorHandler.Throw",
                            data: {
                                errorCode: s,
                                priority: 0
                            }
                        }) : i.publish({
                            channel: "ClientService",
                            topic: "ErrorHandler.Throw",
                            data: {
                                errorCode: "GS-009",
                                priority: 0
                            }
                        })
                    } else i.publish({
                        channel: "ClientService",
                        topic: "ErrorHandler.Throw",
                        data: {
                            errorCode: "GS-009",
                            priority: 0
                        }
                    })
            } else i.publish({
                channel: "ClientService",
                topic: "ErrorHandler.Throw",
                data: {
                    errorCode: "GS-007",
                    priority: 0
                }
            })
        }

        function n(e) {
            a.push(e)
        }

        function o() {
            if (Array.isArray(a)) {
                Object.defineProperty(a, "length", {
                    writable: !1,
                    configurable: !1
                });
                for (var e = 0; e < a.length; e++) {
                    var t = a[e];
                    t && i.publish({
                        channel: "GameService",
                        topic: "Widgets.ToIXF",
                        data: t
                    })
                }
            }
            a = null
        }
        var i = e.bus,
            r = e.logger,
            a = [];
        return i.subscribe({
            channel: "Kernel",
            topic: "System.InternalInit",
            callback: function() {
                o()
            }
        }), {
            errorCaseHandler: t,
            bufferCaseHandler: n
        }
    }
}), define("clientservice/widgets/IXFMessageQueue", [], function() {
    "use strict";
    return function(e) {
        function t(e) {
            e.data && Array.isArray(u) && u.push({
                data: e.data,
                envelope: e.envelope
            })
        }

        function n() {
            if (Array.isArray(u) && u.length > 0) {
                Object.defineProperty(u, "length", {
                    writable: !1,
                    configurable: !1
                });
                for (var e = 0; e < u.length; e++) {
                    var t = u[e];
                    t && ("success" === d && a(t.data, t.envelope), "failed" === d && "displayMessage" === t.data.messageType && t.envelope && t.envelope.reply && t.envelope.reply(null, null))
                }
                u = null
            }
        }

        function o(e) {
            "boolean" == typeof e && (p = e)
        }

        function i(e, t) {
            d = e, m = t, n()
        }

        function r(e, n) {
            if (e) switch (d) {
                case "pending":
                    t({
                        data: e,
                        envelope: n
                    });
                    break;
                case "success":
                    a(e, n);
                    break;
                case "failed":
                    "displayMessage" === e.messageType && n && n.reply && n.reply(null, null)
            }
        }

        function a(e, t) {
            if (e) {
                switch (e.messageType) {
                    case "displayMessage":
                    case "reveal":
                        f || (l.style.visibility = "inherit", m.sendMessage({
                            messageType: "visible",
                            messageData: !0
                        }), c.log("IXF sendMessage to Widget: ", {
                            messageType: "visible",
                            messageData: !0
                        }), m.sendMessage({
                            messageType: "resize"
                        }), c.log("IXF sendMessage to Widget: ", {
                            messageType: "resize"
                        }), f = !0);
                        break;
                    case "hide":
                        l.style.visibility = "hidden", f = !1, s.publish({
                            channel: "GameService",
                            topic: "Widgets.ToIXF",
                            data: {
                                messageType: "muteGame",
                                messageData: !1
                            }
                        }), s.publish({
                            channel: "GameService",
                            topic: "Widgets.ToIXF",
                            data: {
                                messageType: "pauseGame",
                                messageData: !1
                            }
                        })
                }
                if (f || "hide" === e.messageType) t && t.reply ? p ? "displayMessage" === e.messageType && t && t.reply && t.reply(null, null) : m.requestMessage ? (m.requestMessage(e, function(e) {
                    null !== e && void 0 !== e ? t.reply(null, e) : t.reply(null, null)
                }), c.log("IXF requestMessage to Widget: ", e)) : t.reply(null, null) : (m.sendMessage(e), c.log("IXF sendMessage to Widget: ", e));
                else if ("sessionReady" === e.messageType) {
                    m.sendMessage(e);
                    var n = new Date,
                        o = {
                            hour: "2-digit",
                            minute: "2-digit",
                            second: "2-digit",
                            hour12: !1
                        },
                        i = n.toLocaleTimeString("ZH", o);
                    c.log("IXF sendMessage to Widget: ", e, i)
                }
            }
        }
        var s = e.bus,
            c = e.logger,
            l = e.widgetContainer,
            u = [],
            p = !1,
            d = "pending",
            m = null,
            f = !1;
        return s.subscribe({
            channel: "GameService",
            topic: "Widgets.FromIXF",
            callback: r
        }), s.subscribe({
            channel: "Kernel",
            topic: "System.Resize",
            callback: function() {
                f && r({
                    messageType: "resize"
                })
            }
        }), s.subscribe({
            channel: "ClientService",
            topic: "ServerSessionReady",
            callback: function() {
                r({
                    messageType: "sessionReady"
                })
            }
        }), {
            setNoWaitWidgetsFlag: o,
            setWidgetAccessReady: i
        }
    }
}), define("clientservice/widgets/WidgetController", ["require", "kernel/logger/Logger", "clientservice/widgets/WidgetMessageQueue", "clientservice/widgets/IXFMessageQueue"], function(e) {
    "use strict";

    function t(e) {
        return Object.keys(e).forEach(function(t) {
            this.style[t] = e[t]
        }, this), this
    }
    var n, o, i, r = !1,
        a = e("kernel/logger/Logger");
    return function(s) {
        i = s.bus, o = s.widgetRoot, t.call(o, {
            pointerEvents: "none"
        });
        var c = e("clientservice/widgets/WidgetMessageQueue")({
                bus: i,
                logger: a
            }),
            l = e("clientservice/widgets/IXFMessageQueue")({
                bus: i,
                logger: a,
                widgetContainer: o
            }),
            u = function(e) {
                a.log("ISB", "Widget", "Widget->IXF", e), e && ("error" === e.messageType ? c.errorCaseHandler(e, l) : r ? i.publish({
                    channel: "GameService",
                    topic: "Widgets.ToIXF",
                    data: e
                }) : c.bufferCaseHandler(e))
            },
            p = s.widgetConfig.connectorUrl;
        a.log("libLocation", p);
        var d = {
                INT: "desktop",
                MOB: "mobile",
                TAB: "tablet"
            },
            m = {
                skincode: s.serverConfig.skincode,
                nscode: s.serverConfig.nscode,
                lang: s.serverConfig.paramRGS.language,
                cur: s.serverConfig.paramRGS.currencycode,
                funMode: "FPY" === s.serverConfig.paramRGS.currencycode || s.serverConfig.paramRGS.playMode && "demo" === s.serverConfig.paramRGS.playMode,
                country: s.serverConfig.countrycode,
                environment_domain: s.widgetConfig.dcid,
                username: s.serverConfig.uniqueid,
                deviceType: d[s.serverConfig.channel],
                channel: s.serverConfig.channel,
                softwareId: s.serverConfig.softwareid,
                rgsSecureToken: s.serverConfig.paramRGS.securetoken || s.serverConfig.securetoken,
                widgetsActive: s.serverConfig.widgetsEnabled,
                checkSessionReady: !0
            };
        i.subscribe({
            channel: "ClientService",
            topic: "ClientConfig.Updated",
            callback: function(e) {
                m = {
                    rgsPlayMode: e.serverConfig.paramRGS.playMode
                }, n && n.sendMessage({
                    messageType: "updateParams",
                    messageData: m
                })
            }
        }), i.subscribe({
            channel: "Kernel",
            topic: "System.InternalInit",
            callback: function() {
                r = !0
            }
        }), n = void 0, e([p], function(e) {
            n = e.PublicApi.init(m, o, u), l.setWidgetAccessReady("success", n)
        }, function(e) {
            l.setWidgetAccessReady("failed", null), a.error("IGTOverlayWrapper did not load from [" + p + "]"), i.publish({
                channel: "ClientService",
                topic: "ErrorHandler.Throw",
                data: {
                    errorCode: "WT-001",
                    priority: 0
                }
            })
        })
    }
}), define("clientservice/flowcontroller/FlowController", ["require", "clientservice/errorhandler/ErrorHandler", "clientservice/commands/RgsCommand", "clientservice/autospin/AutoSpinController", "clientservice/commands/JpsCommand", "clientservice/promospin/PromoSpinController", "clientservice/multiplegip/MultipleGIPController", "clientservice/competition/CompetitionController", "clientservice/replaycontroller/ReplayController", "clientservice/widgets/WidgetController"], function(e) {
    "use strict";
    return function(t, n) {
        function o(n, o) {
            if (F = n.serverConfig, z = n.stringsConfig, H = n.kernelConfig, U = n.consoleConfig, q = n.gameServiceConfig, ie = n.widgetConfig, _ = n.gameConfig, ce = !!q, B = e("clientservice/commands/RgsCommand")(t, re, n), V = e("clientservice/replaycontroller/ReplayController")(te, Q, F, B), ce && (X = e("clientservice/competition/CompetitionController")({
                    stringsConfig: z,
                    serverConfig: F,
                    bus: te,
                    currency: t.currency,
                    logger: ne,
                    errorHandler: re,
                    updateClientConfigHandler: function(e, t) {
                        f(e, t)
                    }
                })), te.publish({
                    channel: "ClientService",
                    topic: "System.ErrorHandlerReady",
                    data: {}
                }), n.Exception) return void re.throwError("CD-100", null, n.Exception);
            n.serverConfig.autospin && (j = e("clientservice/autospin/AutoSpinController")({
                stringsConfig: n.stringsConfig,
                serverConfig: n.serverConfig,
                consoleConfig: n.consoleConfig,
                gameConfig: n.gameConfig,
                bus: te,
                root: t.root,
                currency: t.currency,
                errorHandler: re,
                gameRoot: t.gameRoot,
                consoleconnect: Q
            })), n.serverConfig.jackpotMeterUrl ? (W = e("clientservice/commands/JpsCommand")(te, re, Q, n), W.startJackpot(function(e) {
                e && e.jackpotCurrencyCode && e.jackpotCurrencyCode.toLowerCase() !== n.serverConfig.paramRGS.currencycode.toLowerCase() && (ae.jackpotBaseCurrency = e.jackpotCurrencyCode), se = !0, d()
            })) : d()
        }

        function i(e, t) {
            le = !0
        }

        function r() {
            Y.init({
                serverConfig: F,
                stringsConfig: z,
                kernelConfig: H,
                consoleConfig: U,
                gameServiceConfig: q,
                gameConfig: _
            }), B.setCECCommand(Y), j && j.setCECCommand(Y)
        }

        function a() {
            te.publish({
                channel: "ClientService",
                topic: "GameService.PFSNotificationInit",
                data: {}
            })
        }

        function s(e) {
            te.publish({
                channel: "ClientService",
                topic: "GameService.CPTNotificationInit",
                data: e
            })
        }

        function c() {
            ee || (te.publish({
                channel: "ClientService",
                topic: "ServerSessionReady",
                data: null
            }), ee = !0)
        }

        function l(e) {
            te.publish({
                channel: "ClientService",
                topic: "ClientService.ConfigUpdate",
                data: e
            })
        }

        function u(e, t) {
            l(), c();
            var n = Boolean(e && e.playerInfo && e.playerInfo.promoExclude);
            te.publish({
                channel: "ClientService",
                topic: "ClientService.PromoExclude",
                data: n
            }), "freespin" !== F.playMode && (a(), !1 === n && (s(e && e.playerInfo), X && X.ready(e))), t && t()
        }

        function p(n, o, i, a, s, d) {
            if (n)
                if (n.Message && n.Message.Id) {
                    var g = n.Message.Id;
                    if ("1612" === g) {
                        J || (J = e("clientservice/promospin/PromoSpinController")({
                            consoleconnect: Q,
                            kernelConfig: H,
                            stringsConfig: z,
                            serverConfig: F,
                            widgetConfig: ie,
                            bus: te,
                            root: t.root,
                            gameRoot: t.gameRoot
                        }));
                        var y = function(e) {
                            var t = n.Message.Buttons.Button;
                            Array.isArray(t) || (t = [t]);
                            for (var o = 0; o < t.length; o++)
                                if (e === t[o].Cmd["@name"]) {
                                    K = t[o].Cmd["@name"].toLowerCase();
                                    break
                                }
                            f({
                                playModeChoice: K
                            }), le ? B.reLaunch(p, function() {
                                d()
                            }, ae) : B.launch(ae, r, p)
                        };
                        J.showPromotionalFreeSpinAndWagerChoose(n.Message, y)
                    } else ne.log("Error: message " + g + " not support yet"), u(o, a)
                } else if ("OFFER_FREESPIN" === n.type) {
                var v = function(e) {
                    var t, o = n.clientConfig.serverConfig.paramGame,
                        i = JSON.parse(JSON.stringify(n)),
                        r = {
                            freespin_lines: i.config[e].freespin_lines,
                            freespin_bet: i.config[e].freespin_bet,
                            freespin_num: i.config[e].freespin_num,
                            freespin_remain: i.config[e].freespin_remain
                        };
                    i.clientConfig.gameConfig && i.clientConfig.gameConfig.minbet && (t = i.clientConfig.gameConfig.minbet), le || l({
                        paramGame: o,
                        minbet: t,
                        freespin: {
                            freespin_lines: r.freespin_lines,
                            freespin_bet: r.freespin_bet
                        }
                    }), i.clientConfig || (i.clientConfig = {});
                    var s = {
                        paramRGS: r
                    };
                    m(s, r), m(i.clientConfig, {
                        serverConfig: s
                    }), f(i.clientConfig), c(), a({
                        paramGame: o
                    })
                };
                J || (J = e("clientservice/promospin/PromoSpinController")({
                    consoleconnect: Q,
                    kernelConfig: H,
                    stringsConfig: z,
                    serverConfig: F,
                    widgetConfig: ie,
                    bus: te,
                    root: t.root,
                    gameRoot: t.gameRoot
                })), Array.isArray(n.config) && "freespin" === K ? J.showPromoSpinOffers(n.config, n.gameType, function(e) {
                    v(e)
                }) : v(0)
            } else if ("1115" === n.Id || "1116" === n.Id || "1118" === n.Id || M(n)) {
                var h = e("clientservice/multiplegip/MultipleGIPController")({
                        consoleconnect: Q,
                        kernelConfig: H,
                        stringsConfig: z,
                        serverConfig: F,
                        bus: te,
                        root: t.root,
                        gameRoot: t.gameRoot
                    }),
                    C = function(e) {
                        var t = {
                                actiontype: "MULTIPLE_GIP_REDIRECTION",
                                multipleGIPContinue: !0
                            },
                            n = {
                                serverConfig: {
                                    paramPost: t,
                                    paramRGS: t
                                }
                            };
                        f(n), le ? B.reLaunch(p, function() {
                            f(n, !0), d && d()
                        }, ae) : B.launch(ae, r, p, function() {
                            f(n, !0), a && a()
                        })
                    },
                    b = function(e) {
                        re.doRGS({
                            cmd: {
                                name: "gameInProgressReload",
                                params: e
                            }
                        })
                    };
                h.showMultipleGIP(n, C, b)
            } else n.clientConfig ? (f(n.clientConfig), u(o, a)) : u(o, a);
            else u(o, a)
        }

        function d() {
            Z && (W && se || !W) && (ce && !$ || B && B.launch(ae, r, p))
        }

        function m(e, t, n) {
            for (var o in t)
                if ("object" == typeof t[o]) e[o] || (e[o] = {}), m(e[o], t[o], n);
                else if (n) delete e[o];
            else {
                if ("object" != typeof e) throw new Error("Cannot merge object to " + typeof e);
                e[o] = t[o]
            }
        }

        function f(e, n) {
            e.gameConfig && e.gameConfig.wagerType && (F.paramRGS.wagerType = e.gameConfig.wagerType, F.paramGet.wagerType && (F.paramGet.wagerType = e.gameConfig.wagerType)), e.playModeChoice && (F.paramRGS.playModeChoice = e.playModeChoice);
            for (var o in e) switch (o) {
                case "serverConfig":
                    m(F, e[o], n);
                    break;
                case "stringsConfig":
                    m(z, e[o], n);
                    break;
                case "kernelConfig":
                    m(H, e[o], n);
                    break;
                case "consoleConfig":
                    m(U, e[o], n);
                    break;
                case "gameServiceConfig":
                    m(q, e[o], n);
                    break;
                case "gameConfig":
                    m(_, e[o], n);
                    break;
                case "widgetConfig":
                    ie ? m(ie, e[o], n) : ie = e.widgetConfig
            }
            te.publish({
                channel: "ClientService",
                topic: "ClientConfig.Updated",
                data: {
                    gameConfig: _,
                    gameServiceConfig: q,
                    kernelConfig: H,
                    consoleConfig: U,
                    serverConfig: F,
                    stringsConfig: z,
                    widgetConfig: ie
                }
            }), t.consoleconnect.updateClientConfig(e, n)
        }

        function g(e, t) {
            f({
                serverConfig: {
                    paramRGS: e
                }
            }, t)
        }

        function y() {
            return F.paramRGS.SWITCH_MODE
        }

        function v(e, t) {
            g({
                SWITCH_MODE: e
            });
            var n = ["freespin_tokenID", "campaignId", "freespin_bet", "freespin_lines", "freespin_num", "freespin_remain", "playModeChoice"],
                o = ["currencycode"],
                i = t.playMode ? t.playMode : "real";
            switch (e) {
                case "PFS_TO_WAGER":
                    F.playMode = i, F.paramRGS.playMode = i, F.paramGame.playMode = i;
                    for (var r = 0; r < n.length; r++)[F, F.paramRGS, F.paramGet, F.paramPost].forEach(function(e) {
                        e && e.hasOwnProperty(n[r]) && delete e[n[r]]
                    });
                    for (var r = 0; r < o.length; r++) t.hasOwnProperty(o[r]) && (F[o[r]] = t[o[r]], F.paramRGS[o[r]] = t[o[r]]);
                    F.paramGame.playModeChoice && delete F.paramGame.playModeChoice;
                    break;
                case "WAGER_TO_PFS":
                    F.playMode = i, F.paramRGS.playMode = i, F.paramGame.playMode = i;
                    for (var r = 0; r < n.length; r++) t.hasOwnProperty(n[r]) && (F[n[r]] = t[n[r]], F.paramRGS[n[r]] = t[n[r]]);
                    for (var r = 0; r < o.length; r++) t.hasOwnProperty(o[r]) && (F[o[r]] = t[o[r]], F.paramRGS[o[r]] = t[o[r]]);
                    F.playModeChoice = "freespin", F.paramRGS.playModeChoice = "freespin", F.paramGame.hasOwnProperty("playModeChoice") && (F.paramGame.playModeChoice = "freespin")
            }
        }

        function h() {
            var e = {
                SWITCH_MODE: ""
            };
            f({
                serverConfig: {
                    paramRGS: e,
                    paramGet: e,
                    paramPost: e
                }
            }, !0)
        }

        function C(e) {
            Z = !0, d()
        }

        function b(e) {
            $ = !0, d()
        }

        function S(e) {
            B.setRequestData(e)
        }

        function x(e) {
            B.init(e)
        }

        function w(e) {
            B.reLaunch(p, e)
        }

        function k(e) {
            function t(t) {
                j && j.isAutoSpinStarted() && j.checkAutoSpinLimits(t.RGSResponse.GameLogicResponse), e(t)
            }
            if (F.playMode && "replay" === F.playMode) {
                V.replayUpdate();
                var n = V.getCurrentRound();
                B.replay(t, n)
            } else B.play(t)
        }

        function I() {
            return F.playMode && "replay" === F.playMode && V.isReplayEnd()
        }

        function T(e) {
            B.setBalance(e)
        }

        function E(e) {
            B.silentBalanceUpdate(e)
        }

        function R(e, t) {
            B.getPlayerBalance(e, t)
        }

        function L(e, t) {
            t()
        }

        function G(e) {
            var t = {
                Id: "GM-012",
                Reference: "GM-012",
                Message: z.soundPromptMessage || "Enable Sound?",
                Buttons: {
                    Button: [{
                        Text: z.btnNo || "NO",
                        Cmd: {
                            "@name": "startMuted"
                        }
                    }, {
                        Text: z.btnYes || "YES",
                        Cmd: {
                            "@name": "continue"
                        }
                    }]
                }
            };
            re.throwError("CD-100", function(t) {
                e(t && t.cmd && "startMuted" === t.cmd.name ? !1 : !0)
            }, t)
        }

        function D(e) {
            var t = {
                    Text: "abort",
                    Cmd: {
                        "@name": "abort",
                        Param: {
                            value: void 0
                        }
                    }
                },
                n = {
                    "@notification": "Y",
                    "@type": "InsufficientFound",
                    Id: "9050",
                    Message: z.errInsufficientFund,
                    Buttons: {
                        Button: [t]
                    }
                };
            re.throwError("CD-109", function() {}, n)
        }

        function O() {
            var e = {
                    Text: z.btnOk,
                    Cmd: {
                        "@name": "abort",
                        Param: {
                            value: void 0
                        }
                    }
                },
                t = {
                    "@notification": "Y",
                    "@type": "FREESPIN_TABLE_BET_WARN",
                    Id: "9051",
                    Message: z.errInsufficientFundTable,
                    Buttons: {
                        Button: [e]
                    }
                };
            re.throwError("CD-109", function() {}, t)
        }

        function A(e) {
            B.setGameInProgress(e)
        }

        function P(e, t) {
            e()
        }

        function M(e) {
            if (e.Buttons && e.Buttons.Button && e.Buttons.Button.Cmd && e.Buttons.Button.Cmd.Param)
                for (var t = e.Buttons.Button.Cmd.Param, n = 0; n < t.length; n++) {
                    var o = t[n];
                    if ("Y" === o["#text"] && "multiGip" === o["@name"]) return !0
                }
            return !1
        }

        function N() {
            te.publish({
                channel: "ClientService",
                topic: "Game.Focus",
                data: {}
            })
        }
        var B, W, F, z, H, U, q, _, j, J, X, K, V, Y = t.cecCommand,
            Q = t.consoleconnect,
            Z = !1,
            $ = !1,
            ee = !1,
            te = t.bus,
            ne = t.logger,
            oe = t.clientConfig,
            ie = oe.widgetConfig,
            re = e("clientservice/errorhandler/ErrorHandler")({
                bus: te,
                config: oe
            }),
            ae = {},
            se = !1,
            ce = !1,
            le = !1;
        oe && oe.widgetConfig && oe.serverConfig.widgetsEnabled && e("clientservice/widgets/WidgetController")({
            bus: te,
            serverConfig: oe.serverConfig,
            widgetConfig: oe.widgetConfig,
            gameServiceConfig: oe.gameServiceConfig,
            gameRoot: t.gameRoot,
            widgetRoot: t.widgetRoot
        }), te.subscribe({
            channel: "Kernel",
            topic: "System.InternalInit",
            callback: o
        }), te.subscribe({
            channel: "Kernel",
            topic: "System.Init",
            callback: i
        }), te.subscribe({
            channel: "ConsoleService",
            topic: "ConsoleService.InitDone",
            callback: C
        }), te.subscribe({
            channel: "GameService",
            topic: "GameService.InitDone",
            callback: b
        }), te.subscribe({
            channel: "Game",
            topic: "Game.PlayData",
            callback: function(e, t) {
                S(e)
            }
        }), te.subscribe({
            channel: "GameService",
            topic: "GameService.LaunchGame",
            callback: function(e) {
                re && re.doRGS({
                    cmd: {
                        name: "reloadGame",
                        params: e
                    }
                })
            }
        }), te.subscribe({
            channel: "Kernel",
            topic: "Kernel.UpdateConfig",
            callback: function(e, t) {
                f(e), te.publish({
                    channel: "Kernel",
                    topic: "Kernel.UpdateConfig.Ack",
                    data: {
                        success: "ClientService"
                    }
                })
            }
        }), te.subscribe({
            channel: "Kernel",
            topic: "Game.TakeFocus",
            callback: N
        }), te.subscribe({
            channel: "GameService",
            topic: "Game.TakeFocus",
            callback: N
        }), n({
            initrequest: x,
            playrequest: k,
            showMessages: L,
            setBalance: T,
            silentBalanceUpdate: E,
            getPlayerBalance: R,
            reLaunchrequest: w,
            getSwitchPlayMode: y,
            setSwitchPlayMode: v,
            clearSwitchPlayMode: h,
            throwInsufficientFoundError: D,
            checkSound: G,
            getErrorHandler: function() {
                return re
            },
            setGameInProgress: A,
            checkPlayPermitted: P,
            isReplayEnd: I,
            throwPFSTableBetWarn: O
        })
    }
}), define("clientservice/transformer/CECDataTransformer", ["require"], function(e) {
    "use strict";

    function t(e, t, n) {
        n || (n = {});
        var o = {};
        o.token = e, o.time = Date.now() + i + "";
        for (var r in n) {
            var a = n[r].properties;
            for (var s in a) "timestamp" === a[s].key ? a[s].value = parseInt(a[s].value) + i + "" : a[s].value = a[s].value + ""
        }
        return o.events = n, {
            method: "POST",
            accept: "json",
            headerMap: {
                "Content-Type": "application/json;charset=utf-8",
                "Access-Control-Allow-Origin": "*"
            },
            withCredentials: !0,
            retry: t,
            payloadStr: JSON.stringify(o)
        }
    }

    function n(e, t) {
        return {
            method: "POST",
            accept: "json",
            headerMap: {
                "Content-Type": "application/json;charset=utf-8",
                "Access-Control-Allow-Origin": "*"
            },
            withCredentials: !0,
            retry: e,
            payloadStr: JSON.stringify(t)
        }
    }

    function o(e) {
        i = e
    }
    var i = 0;
    return function() {
        return {
            transformRegisterEvent: n,
            transformPostEvent: t,
            setTimeTune: o
        }
    }
}), define("clientservice/communicator/CECCommunicator", ["require", "clientservice/communicator/DataAdapter", "clientservice/transformer/CECDataTransformer"], function(e) {
    "use strict";
    var t, n, o, i = e("clientservice/communicator/DataAdapter")(),
        r = e("clientservice/transformer/CECDataTransformer")(),
        a = 2e3,
        s = 6e4,
        c = 0,
        l = 0;
    return function(e) {
        function u(e) {
            var s = {};
            s.secureToken = h.serverConfig.securetoken, s.nsCode = h.serverConfig.nscode, s.game = {
                softwareId: h.serverConfig.softwareid,
                channel: h.serverConfig.channel,
                presentation: h.serverConfig.presenttype,
                technology: h.serverConfig.paramRGS.technology,
                language: h.serverConfig.paramGame.language,
                currency: h.serverConfig.paramGame.currencycode,
                denom: h.serverConfig.denomamount,
                nscode: h.serverConfig.nscode
            };
            var u = r.transformRegisterEvent(b, s);
            i.httpCall(t, function(e) {
                if (e.errorId) return void w.warn("fail to register cec session for " + e.code + ": " + e.message);
                e.serverTime && (c = e.serverTime - Date.now(), r.setTimeTune(c)), e.next && (C = e.next.token, l = e.next.time - c);
                var t = e.sessionId;
                S = e.maxEventBatchSize, n = h.serverConfig.cecServerUrl + "/v1/cec/events/" + encodeURIComponent(h.serverConfig.skincode) + "/" + encodeURIComponent(h.serverConfig.uniqueid) + "/" + t, o = n + "/close", x = setTimeout(function() {
                    d()
                }, a)
            }, function(t) {
                e(t)
            }, u)
        }

        function p(e) {
            I = I.concat(e);
            for (var t in e)
                if ("CloseGame" === e[t].name) return void m()
        }

        function d() {
            if (l > Date.now()) return void(x = setTimeout(function() {
                d()
            }, l - Date.now() + 1e3));
            if (0 === I.length) return void(x = setTimeout(function() {
                d()
            }, a));
            if (I.length > 0) {
                var e = I.length > S ? S : I.length,
                    t = I.slice(0, e),
                    o = r.transformPostEvent(C, b, t);
                i.httpCall(n, function(t) {
                    t.errorId ? w.warn("fail to post cec event for " + t.errorId + ": " + t.message + ".") : (C = t.next.token, l = t.next.time - c), I = I.splice(e), d()
                }, function(t) {
                    f(t, e)
                }, o)
            }
        }

        function m() {
            if (o) {
                var e = r.transformPostEvent(C, b, I);
                e.async = !0, e.contentType = "json", navigator && navigator.sendBeacon && "Google Inc." !== navigator.vendor ? i.beaconCall(o, function() {
                    I = [], w.debug("cec session is closed!")
                }, function() {
                    I = [], w.warn("fail to close cec session.")
                }, e) : i.httpCall(o, function() {
                    I = [], w.debug("cec session is closed!")
                }, function(e) {
                    I = [], w.warn("fail to close cec session with http call" + e), w.warn("fail to close cec session.")
                }, e), o = void 0, n = void 0, x && clearTimeout(x)
            }
        }

        function f(e, t) {
            w.warn("fail to post cec event for " + e), "CD-002" === e || "CD-006" === e ? x = setTimeout(function() {
                d()
            }, s) : (I = I.slice(t), d())
        }

        function g(e) {
            for (var t in e)
                if ("CloseGame" === e[t].name) return w.warn("cec bus receives closeGame event."), I = I.concat(e), void m();
            p(e)
        }

        function y(e) {
            h = e, b = h.serverConfig.requestRetries ? h.serverConfig.requestRetries : 1, h.serverConfig.cecServerUrl && (t = h.serverConfig.cecServerUrl + "/v1/cec/events/" + encodeURIComponent(h.serverConfig.skincode) + "/" + encodeURIComponent(h.serverConfig.uniqueid) + "/register", u(function(e) {
                w.warn("fail to register cec session: " + e)
            }), k.subscribe({
                channel: "ClientService",
                topic: "CECEvent",
                callback: function(e, t) {
                    w.info("CEC event is from SKB."), g(e)
                }
            }), k.subscribe({
                channel: "Game",
                topic: "Game.CECEvent",
                callback: function(e, t) {
                    w.info("CEC event is from game."), g(e)
                }
            }))
        }

        function v() {
            t && u(function(e) {
                w.warn("fail to register cec session: " + e)
            })
        }
        var h, C, b, S, x, w = e.logger,
            k = e.bus,
            I = [];
        return e.clientConfig.serverConfig.cecServerUrl ? Object.freeze({
            init: y,
            postCECEvent: p,
            reInit: v
        }) : Object.freeze({
            init: function() {},
            postCECEvent: function() {},
            reInit: function() {}
        })
    }
}), define("clientservice/commands/CECCommand", ["require", "clientservice/communicator/CECCommunicator"], function(e) {
    "use strict";
    var t, n = Date.now();
    return function(o) {
        function i(e) {
            if ("replay" !== A) {
                var t = p(),
                    n = T.OutcomeDetail.Payout,
                    o = T.OutcomeDetail.TransactionId;
                r();
                var i = function() {
                    r()
                };
                window.addEventListener("orientationchange", i), window.addEventListener("resize", i);
                var a, s = "";
                switch (O) {
                    case "S":
                        var c = T.PatternSliderInput.BetPerPattern,
                            l = T.PatternSliderInput.PatternsBet;
                        s = T.OutcomeDetail.Settled;
                        var u = [{
                            key: "timestamp",
                            value: Date.now()
                        }, {
                            key: "betPerPattern",
                            value: c
                        }, {
                            key: "patternsBet",
                            value: l
                        }, {
                            key: "time",
                            value: Date.now() - e
                        }, {
                            key: "gameType",
                            value: "S"
                        }, {
                            key: "outcomeId",
                            value: o
                        }, {
                            key: "playBalance",
                            value: t
                        }, {
                            key: "payout",
                            value: n
                        }, {
                            key: "orientation",
                            value: E
                        }, {
                            key: "deviceScreenHeight",
                            value: R
                        }, {
                            key: "deviceScreenWidth",
                            value: L
                        }, {
                            key: "gameScreenHeight",
                            value: G
                        }, {
                            key: "gameScreenWidth",
                            value: D
                        }];
                        "0" !== s && (u = u.concat({
                            key: "wager",
                            value: s
                        })), a = [{
                            name: "Play",
                            properties: u
                        }];
                        break;
                    case "L":
                        s = 0, T.WagerInput && T.WagerInput.Wager["#text"] && (s = T.WagerInput.Wager["#text"]), a = [{
                            name: "Play",
                            properties: [{
                                key: "timestamp",
                                value: Date.now()
                            }, {
                                key: "wager",
                                value: s
                            }, {
                                key: "time",
                                value: Date.now() - e
                            }, {
                                key: "gameStatus",
                                value: T.OutcomeDetail.GameStatus
                            }, {
                                key: "nextStage",
                                value: T.OutcomeDetail.NextStage
                            }, {
                                key: "gameType",
                                value: "L"
                            }, {
                                key: "outcomeId",
                                value: o
                            }, {
                                key: "playBalance",
                                value: t
                            }, {
                                key: "payout",
                                value: n
                            }, {
                                key: "orientation",
                                value: E
                            }, {
                                key: "deviceScreenHeight",
                                value: R
                            }, {
                                key: "deviceScreenWidth",
                                value: L
                            }, {
                                key: "gameScreenHeight",
                                value: G
                            }, {
                                key: "gameScreenWidth",
                                value: D
                            }]
                        }];
                        break;
                    case "V":
                    case "T":
                        if (s = "", T.hasOwnProperty("WagerInput"))
                            if (T.WagerInput.Wager instanceof Array) {
                                for (var d = T.WagerInput.Wager, m = 0; m < d.length; m++) s = s + "{" + d[m]["@name"] + ":" + d[m]["#text"] + "},";
                                s = s.substring(0, s.length - 1)
                            } else s = "{" + T.WagerInput.Wager["@name"] + ":" + T.WagerInput.Wager["#text"] + "}";
                        a = [{
                            name: "Play",
                            properties: [{
                                key: "timestamp",
                                value: Date.now()
                            }, {
                                key: "wager",
                                value: s
                            }, {
                                key: "time",
                                value: Date.now() - e
                            }, {
                                key: "gameStatus",
                                value: T.OutcomeDetail.GameStatus
                            }, {
                                key: "nextStage",
                                value: T.OutcomeDetail.NextStage
                            }, {
                                key: "gameType",
                                value: O
                            }, {
                                key: "outcomeId",
                                value: o
                            }, {
                                key: "playBalance",
                                value: t
                            }, {
                                key: "payout",
                                value: n
                            }, {
                                key: "orientation",
                                value: E
                            }, {
                                key: "deviceScreenHeight",
                                value: R
                            }, {
                                key: "deviceScreenWidth",
                                value: L
                            }, {
                                key: "gameScreenHeight",
                                value: G
                            }, {
                                key: "gameScreenWidth",
                                value: D
                            }]
                        }];
                        break;
                    default:
                        a = [{
                            name: "Play",
                            properties: [{
                                key: "timestamp",
                                value: Date.now()
                            }, {
                                key: "wager",
                                value: s
                            }, {
                                key: "time",
                                value: Date.now() - e
                            }, {
                                key: "gameStatus",
                                value: T.OutcomeDetail.GameStatus
                            }, {
                                key: "nextStage",
                                value: T.OutcomeDetail.NextStage
                            }, {
                                key: "gameType",
                                value: O
                            }, {
                                key: "outcomeId",
                                value: o
                            }, {
                                key: "playBalance",
                                value: t
                            }, {
                                key: "payout",
                                value: n
                            }, {
                                key: "orientation",
                                value: E
                            }, {
                                key: "deviceScreenHeight",
                                value: R
                            }, {
                                key: "deviceScreenWidth",
                                value: L
                            }, {
                                key: "gameScreenHeight",
                                value: G
                            }, {
                                key: "gameScreenWidth",
                                value: D
                            }]
                        }]
                }
                S(a)
            }
        }

        function r() {
            R = window.screen.height, L = window.screen.width, G = window.innerHeight, D = window.innerWidth, E = G > D ? "portrait" : "landScape"
        }

        function a(e) {
            if ("replay" !== A) {
                var t = p(),
                    n = [{
                        key: "timestamp",
                        value: Date.now()
                    }, {
                        key: "step",
                        value: e.getSteps()
                    }];
                e.getLossLimit() && (n = n.concat({
                    key: "lossLimit",
                    value: e.getLossLimit()
                })), e.getWinLimit() && (n = n.concat({
                    key: "winLimit",
                    value: e.getWinLimit()
                })), n = n.concat({
                    key: "autoSpinBalance",
                    value: t
                });
                S([{
                    name: "AutoSpinExecution",
                    properties: n
                }])
            }
        }

        function s(e, t) {
            if ("replay" !== A) {
                var n = p();
                S([{
                    name: "AutoSpinStop",
                    properties: [{
                        key: "timestamp",
                        value: Date.now()
                    }, {
                        key: "completedNumber",
                        value: t.getOriginalSteps() - t.getSteps()
                    }, {
                        key: "originalNumber",
                        value: t.getOriginalSteps()
                    }, {
                        key: "stopReason",
                        value: e
                    }, {
                        key: "autoSpinStopBalance",
                        value: n
                    }]
                }])
            }
        }

        function c(e, t) {
            if ("replay" !== A) {
                S([{
                    name: "ErrorMessage",
                    properties: [{
                        key: "timestamp",
                        value: Date.now()
                    }, {
                        key: "errorCode",
                        value: e
                    }, {
                        key: "languageCode",
                        value: t
                    }]
                }])
            }
        }

        function l(e, t) {
            if ("replay" !== A) {
                var n = [{
                    name: "OpenRecommendedGame",
                    properties: [{
                        key: "context",
                        value: "default"
                    }, {
                        key: "softwareId",
                        value: e.softwareid ? e.softwareid : ""
                    }, {
                        key: "timestamp",
                        value: Date.now()
                    }]
                }];
                t && !isNaN(Number(t)) && n[0].properties.push({
                    key: "recPosition",
                    value: Number(t)
                }), S(n)
            }
        }

        function u() {
            if ("replay" !== A) {
                var e = p();
                S([{
                    name: "CloseGame",
                    properties: [{
                        key: "timestamp",
                        value: Date.now()
                    }, {
                        key: "sessionClosingBalance",
                        value: e
                    }]
                }])
            }
        }

        function p() {
            var e = "";
            return T && T.hasOwnProperty("Balances") && (e = T.Balances["@totalBalance"]), e
        }

        function d(e) {
            if ("replay" !== A) {
                var t = p();
                S([{
                    name: "GameLaunched",
                    properties: [{
                        key: "timestamp",
                        value: Date.now()
                    }, {
                        key: "denomamount",
                        value: e
                    }, {
                        key: "startingLaunchBalance",
                        value: t
                    }]
                }])
            }
        }

        function m() {
            if ("replay" !== A) {
                S([{
                    name: "BackToLobby",
                    properties: [{
                        key: "context",
                        value: "default"
                    }, {
                        key: "timestamp",
                        value: Date.now()
                    }]
                }])
            }
        }

        function f(e) {
            if ("replay" !== A) {
                S([{
                    name: "FullScreen",
                    properties: [{
                        key: "timestamp",
                        value: Date.now()
                    }, {
                        key: "value",
                        value: e
                    }]
                }])
            }
        }

        function g(e) {
            if (null != e && "replay" !== A) {
                var t = [];
                for (var n in e) t.push({
                    key: n,
                    value: e[n]
                });
                S([{
                    name: "PlayerActCashTournament",
                    properties: t
                }])
            }
        }

        function y(e) {
            if (null != e && "replay" !== A) {
                var t = [{
                    name: "PlayerEndCashTournament",
                    properties: [{
                        key: "tournamentId",
                        value: e.competitionId
                    }, {
                        key: "action",
                        value: e.action
                    }, {
                        key: "interrupt",
                        value: e.interrupt
                    }, {
                        key: "timestamp",
                        value: e.timestamp
                    }, {
                        key: "tournamentStatus",
                        value: e.tournamentStatus
                    }]
                }];
                0 !== e.spinLeft && t[0].properties.push({
                    key: "spinLeft",
                    value: e.spinLeft
                }), 0 !== e.lbPosition && t[0].properties.push({
                    key: "lbPosition",
                    value: e.lbPosition
                }), S(t)
            }
        }

        function v(e) {
            if (null != e && "replay" !== A) {
                S([{
                    name: "CashTournamentHitPrize",
                    properties: [{
                        key: "tournamentId",
                        value: e.competitionId
                    }, {
                        key: "prizeType",
                        value: e.prizeType
                    }, {
                        key: "prizeLevel",
                        value: e.prizeLevel
                    }, {
                        key: "prizeAmount",
                        value: e.prizeAmount
                    }, {
                        key: "action",
                        value: "continue"
                    }, {
                        key: "timestamp",
                        value: Date.now()
                    }]
                }])
            }
        }

        function h(e) {
            if (null != e && "replay" !== A) {
                S([{
                    name: e.name,
                    properties: [{
                        key: "context",
                        value: e.context
                    }, {
                        key: "contextId",
                        value: e.contextId
                    }, {
                        key: "itemName",
                        value: e.itemName
                    }, {
                        key: "timestamp",
                        value: Date.now()
                    }]
                }])
            }
        }

        function C(e) {
            if ("replay" !== A && (e && ("SystemReady" === e.event ? M = e.systemLoadEndTimestamp - n : "GameLoadComplete" === e.event && (N = e.gameLoadedElapse)), !(M < 0 || N < 0))) {
                S([{
                    name: "LaunchTimes",
                    properties: [{
                        key: "timestamp",
                        value: Date.now()
                    }, {
                        key: "gameAssetsLoadTime",
                        value: N
                    }, {
                        key: "launchTime",
                        value: M
                    }]
                }])
            }
        }

        function b(e) {
            if ("replay" !== A) {
                var t = p();
                S([{
                    name: "Rebuy",
                    properties: [{
                        key: "timestamp",
                        value: Date.now()
                    }, {
                        key: "previousBalance",
                        value: t
                    }, {
                        key: "updatedBalance",
                        value: e
                    }]
                }])
            }
        }

        function S(e) {
            "replay" !== A && t.postCECEvent(e)
        }

        function x(e) {
            I = e, O = I.gameConfig.gameType, P && t.init(e)
        }

        function w() {
            t.reInit()
        }

        function k(e) {
            T = e
        }
        var I, T, E, R, L, G, D, O = o.clientConfig.gameConfig.gameType,
            A = A,
            P = o.clientConfig.serverConfig && o.clientConfig.serverConfig.cecServerUrl && o.clientConfig.serverConfig.paramGame && o.clientConfig.serverConfig.paramGame.currencycode && "FPY" !== o.clientConfig.serverConfig.paramGame.currencycode.toUpperCase(),
            M = -1,
            N = -1;
        return t = e("clientservice/communicator/CECCommunicator")(o), P ? Object.freeze({
            init: x,
            reInit: w,
            setGameLogicResponse: k,
            postCECEvent: S,
            postPlayEvent: i,
            postCloseEvent: u,
            postAutoSpinExecutionEvent: a,
            postAutoSpinStopEvent: s,
            postErrorEvent: c,
            postGameLaunched: d,
            postFullscreenEvent: f,
            postRecommendedGameReload: l,
            postBackToLobby: m,
            postPlayerActCashTournament: g,
            postPlayerEndCashTournament: y,
            postCashTournamentHitPrize: v,
            postItemBeenClicked: h,
            postLaunchTimes: C,
            postRebuy: b
        }) : Object.freeze({
            init: function() {},
            reInit: function() {},
            setGameLogicResponse: function() {},
            postCECEvent: function() {},
            postPlayEvent: function() {},
            postCloseEvent: function() {},
            postAutoSpinExecutionEvent: function() {},
            postAutoSpinStopEvent: function() {},
            postErrorEvent: function() {},
            postGameLaunched: function() {},
            postFullscreenEvent: function() {},
            postRecommendedGameReload: function() {},
            postBackToLobby: function() {},
            postPlayerActCashTournament: function() {},
            postPlayerEndCashTournament: function() {},
            postCashTournamentHitPrize: function() {},
            postItemBeenClicked: function() {},
            postLaunchTimes: function() {},
            postRebuy: function() {}
        })
    }
}), define("clientservice/main", ["require", "clientservice/flowcontroller/FlowController", "clientservice/commands/CECCommand"], function(e) {
    var t = e("clientservice/flowcontroller/FlowController"),
        n = {};
    return function() {
        function o(o, i) {
            o.bus = o.bus(), s = o.bus, s.publish({
                channel: "Kernel",
                topic: "LoadProgress",
                data: {
                    id: "clientservice",
                    items: "10",
                    current: "1",
                    complete: !1
                }
            }), n = e("clientservice/commands/CECCommand")(o), t({
                bus: s,
                currency: o.currency,
                root: o.root,
                gameRoot: o.gameRoot,
                widgetRoot: o.widgetRoot,
                logger: o.logger,
                consoleconnect: o.consoleconnect,
                clientConfig: o.clientConfig,
                cecCommand: n
            }, function(e) {
                c = e, a(i)
            })
        }

        function i() {
            return c
        }

        function r() {
            return n
        }

        function a(e) {
            s.publish({
                channel: "Kernel",
                topic: "LoadProgress",
                data: {
                    id: "clientservice",
                    items: "10",
                    current: "10",
                    complete: !0
                }
            }), e()
        }
        var s, c;
        return Object.freeze({
            load: o,
            controller: i,
            getCECCommand: r
        })
    }
});
//# sourceMappingURL=clientservice.js.map