@kalamba/sdk 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +82 -7
- package/dist/index.js +266 -60
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.ts +159 -33
- package/dist/plugins.js +1039 -879
- package/dist/wrapper.cjs +1 -1
- package/dist/wrapper.d.ts +65 -6
- package/dist/wrapper.js +4 -2
- package/package.json +9 -2
package/dist/plugins.js
CHANGED
|
@@ -2,60 +2,60 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
if (!
|
|
9
|
-
throw TypeError("Cannot " +
|
|
5
|
+
var Nt = Object.defineProperty;
|
|
6
|
+
var Ht = (i, e, t) => e in i ? Nt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
7
|
+
var p = (i, e, t) => (Ht(i, typeof e != "symbol" ? e + "" : e, t), t), ot = (i, e, t) => {
|
|
8
|
+
if (!e.has(i))
|
|
9
|
+
throw TypeError("Cannot " + t);
|
|
10
10
|
};
|
|
11
|
-
var y = (i,
|
|
12
|
-
if (
|
|
11
|
+
var y = (i, e, t) => (ot(i, e, "read from private field"), t ? t.call(i) : e.get(i)), E = (i, e, t) => {
|
|
12
|
+
if (e.has(i))
|
|
13
13
|
throw TypeError("Cannot add the same private member more than once");
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
import { a as
|
|
17
|
-
function
|
|
18
|
-
return (
|
|
19
|
-
console.log(`[%c${i}\x1B[m] %s`,
|
|
14
|
+
e instanceof WeakSet ? e.add(i) : e.set(i, t);
|
|
15
|
+
}, v = (i, e, t, n) => (ot(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t);
|
|
16
|
+
import { a as rt } from "./noop-3336849b.js";
|
|
17
|
+
function O(i, e) {
|
|
18
|
+
return (t, ...n) => {
|
|
19
|
+
console.log(`[%c${i}\x1B[m] %s`, e, t, ...n);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
+
function Ot(i, e) {
|
|
23
|
+
return Math.round(i * 100 / e);
|
|
24
|
+
}
|
|
22
25
|
class $ {
|
|
23
|
-
constructor(
|
|
24
|
-
|
|
25
|
-
this.config =
|
|
26
|
+
constructor(e) {
|
|
27
|
+
p(this, "config");
|
|
28
|
+
this.config = e;
|
|
26
29
|
}
|
|
27
|
-
on(
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
+
on(e, t, n) {
|
|
31
|
+
const a = function(s) {
|
|
32
|
+
s.data.message !== `kalamba:wrapper-casino:${e}` && s.data.message !== `kalamba:wrapper:${e}` || t(s.data.payload);
|
|
30
33
|
};
|
|
31
|
-
window.addEventListener("message",
|
|
34
|
+
window.addEventListener("message", a, n);
|
|
32
35
|
}
|
|
33
|
-
send(
|
|
36
|
+
send(e, ...[t]) {
|
|
34
37
|
window.postMessage({
|
|
35
|
-
message: `kalamba:casino:${
|
|
36
|
-
payload:
|
|
38
|
+
message: `kalamba:casino:${e}`,
|
|
39
|
+
payload: t
|
|
37
40
|
});
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class xi extends $ {
|
|
45
|
-
constructor(...t) {
|
|
46
|
-
super(...t), this.registerToSdkEvents(), this.registerFromSdkEvents(), Ht("configured");
|
|
43
|
+
const Vt = O("BasicPlugin", "color:#000000;font-weight:bold;");
|
|
44
|
+
class Oi extends $ {
|
|
45
|
+
constructor(...e) {
|
|
46
|
+
super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), Vt("configured");
|
|
47
47
|
}
|
|
48
48
|
registerToSdkEvents() {
|
|
49
|
-
window.addEventListener("message", (
|
|
49
|
+
window.addEventListener("message", (e) => {
|
|
50
50
|
try {
|
|
51
|
-
const { type:
|
|
52
|
-
switch (
|
|
51
|
+
const { type: t, payload: n } = e.data;
|
|
52
|
+
switch (t) {
|
|
53
53
|
case "doAudioSettings":
|
|
54
|
-
this.send("settings", { music:
|
|
54
|
+
this.send("settings", { music: n == null ? void 0 : n.musicEnabled, sounds: n == null ? void 0 : n.soundEnabled });
|
|
55
55
|
return;
|
|
56
56
|
case "doBalanceUpdate":
|
|
57
|
-
const { currency:
|
|
58
|
-
|
|
57
|
+
const { currency: a, coinValueInCents: c } = this.config.api;
|
|
58
|
+
n.currency === a && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance: Ot(n.balanceInCurrency, c) }) : (n.balanceInCoins, this.send("balance", { balance: n.balanceInCoins }));
|
|
59
59
|
return;
|
|
60
60
|
case "doGamePause":
|
|
61
61
|
this.send("freeze");
|
|
@@ -90,50 +90,50 @@ class xi extends $ {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
const k =
|
|
94
|
-
class
|
|
95
|
-
constructor(...
|
|
96
|
-
super(...
|
|
93
|
+
const k = O("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), zt = O("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
|
|
94
|
+
class Li extends $ {
|
|
95
|
+
constructor(...e) {
|
|
96
|
+
super(...e), this.registerDebugToSdkEvents(), this.registerSdkToDebugEvents();
|
|
97
97
|
}
|
|
98
98
|
// TODO add types
|
|
99
99
|
registerDebugToSdkEvents() {
|
|
100
100
|
window.DebuggingPlugin = {
|
|
101
|
-
balance: (
|
|
102
|
-
bet: (
|
|
103
|
-
choice: (
|
|
104
|
-
close: (
|
|
105
|
-
help: (
|
|
106
|
-
history: (
|
|
107
|
-
freeze: (
|
|
108
|
-
paytable: (
|
|
109
|
-
settings: (
|
|
110
|
-
suspend: (
|
|
111
|
-
unfreeze: (
|
|
101
|
+
balance: (e) => this._send("balance", e),
|
|
102
|
+
bet: (e) => this._send("bet", e),
|
|
103
|
+
choice: (e) => this._send("choice", e),
|
|
104
|
+
close: (e) => this._send("close", e),
|
|
105
|
+
help: (e) => this._send("help", e),
|
|
106
|
+
history: (e) => this._send("history", e),
|
|
107
|
+
freeze: (e) => this._send("freeze", e),
|
|
108
|
+
paytable: (e) => this._send("paytable", e),
|
|
109
|
+
settings: (e) => this._send("settings", e),
|
|
110
|
+
suspend: (e) => this._send("suspend", e),
|
|
111
|
+
unfreeze: (e) => this._send("unfreeze", e)
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
registerSdkToDebugEvents() {
|
|
115
|
-
this.on("autoplay", (
|
|
115
|
+
this.on("autoplay", (e) => k("autoplay", e)), this.on("balance", (e) => k("balance", e)), this.on("bet", (e) => k("bet", e)), this.on("cashier", (e) => k("cashier", e)), this.on("choice", (e) => k("choice", e)), this.on("close", (e) => k("close", e)), this.on("error", (e) => k("error", e)), this.on("loadEnd", (e) => k("loadEnd", e)), this.on("loadProgress", (e) => k("loadProgress", e)), this.on("loadStart", (e) => k("loadStart", e)), this.on("playCycleStart", (e) => k("playCycleStart", e)), this.on("playCycleEnd", (e) => k("playCycleEnd", e)), this.on("playEnd", (e) => k("playEnd", e)), this.on("playError", (e) => k("playError", e)), this.on("playReady", (e) => k("playReady", e)), this.on("playStart", (e) => k("playStart", e)), this.on("settings", (e) => k("settings", e));
|
|
116
116
|
}
|
|
117
|
-
_send(...
|
|
118
|
-
zt(...
|
|
117
|
+
_send(...e) {
|
|
118
|
+
zt(...e), this.send(...e);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
class
|
|
123
|
-
constructor(...
|
|
124
|
-
super(...
|
|
121
|
+
const qt = O("GigPlugin", "color:#000000;font-weight:bold;");
|
|
122
|
+
class Bi extends $ {
|
|
123
|
+
constructor(...e) {
|
|
124
|
+
super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), qt("configured");
|
|
125
125
|
}
|
|
126
|
-
postMessage(
|
|
127
|
-
const
|
|
128
|
-
event:
|
|
126
|
+
postMessage(e) {
|
|
127
|
+
const t = {
|
|
128
|
+
event: e
|
|
129
129
|
};
|
|
130
|
-
window.top.postMessage(
|
|
130
|
+
window.top.postMessage(t, "*");
|
|
131
131
|
}
|
|
132
132
|
registerToSdkEvents() {
|
|
133
|
-
window.addEventListener("message", (
|
|
133
|
+
window.addEventListener("message", (e) => {
|
|
134
134
|
try {
|
|
135
|
-
const { data:
|
|
136
|
-
switch (
|
|
135
|
+
const { data: t } = e;
|
|
136
|
+
switch (t) {
|
|
137
137
|
case "STOP_AUTO_PLAY":
|
|
138
138
|
this.send("suspend");
|
|
139
139
|
return;
|
|
@@ -169,18 +169,18 @@ class Oi extends $ {
|
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
class
|
|
174
|
-
constructor(...
|
|
175
|
-
super(...
|
|
172
|
+
const Gt = O("OryxPlugin", "color:#000000;font-weight:bold;");
|
|
173
|
+
class Fi extends $ {
|
|
174
|
+
constructor(...e) {
|
|
175
|
+
super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), Gt("configured");
|
|
176
176
|
}
|
|
177
177
|
registerToSdkEvents() {
|
|
178
|
-
window.addEventListener("message", (
|
|
178
|
+
window.addEventListener("message", (e) => {
|
|
179
179
|
try {
|
|
180
|
-
const { type:
|
|
181
|
-
switch (
|
|
180
|
+
const { type: t, param: n } = e.data;
|
|
181
|
+
switch (t) {
|
|
182
182
|
case "doBalanceUpdate":
|
|
183
|
-
this.send("balance", { balance:
|
|
183
|
+
this.send("balance", { balance: n });
|
|
184
184
|
return;
|
|
185
185
|
case "doGamePause":
|
|
186
186
|
this.send("freeze");
|
|
@@ -199,11 +199,11 @@ class Li extends $ {
|
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
registerFromSdkEvents() {
|
|
202
|
-
let
|
|
202
|
+
let e = 0;
|
|
203
203
|
this.on("close", () => {
|
|
204
204
|
window.top.postMessage({ wpgaction: "close" }, "*"), window.parent.postMessage({ wpgaction: "close.parent" }, "*");
|
|
205
|
-
}), this.on("balance", ({ balance:
|
|
206
|
-
|
|
205
|
+
}), this.on("balance", ({ balance: t }) => {
|
|
206
|
+
e !== t && (e = t, window.top.postMessage({ param: {}, wpgaction: "balance" }, "*"), window.parent.postMessage({ param: {}, wpgaction: "balance.parent" }, "*"));
|
|
207
207
|
}), this.on("loadStart", () => {
|
|
208
208
|
window.top.postMessage({ wpgaction: "loadStart" }, "*"), window.parent.postMessage({ wpgaction: "loadStart.parent" }, "*");
|
|
209
209
|
}), this.on("loadEnd", () => {
|
|
@@ -212,8 +212,8 @@ class Li extends $ {
|
|
|
212
212
|
window.top.postMessage({ wpgaction: "gameSpinStart" }, "*"), window.parent.postMessage({ wpgaction: "gameSpinStart.parent" }, "*");
|
|
213
213
|
}), this.on("playEnd", () => {
|
|
214
214
|
window.top.postMessage({ wpgaction: "gameSpinEnd" }, "*"), window.parent.postMessage({ wpgaction: "gameSpinEnd.parent" }, "*");
|
|
215
|
-
}), this.on("cashier", ({ type:
|
|
216
|
-
switch (
|
|
215
|
+
}), this.on("cashier", ({ type: t }) => {
|
|
216
|
+
switch (t) {
|
|
217
217
|
case "BALANCE_LOW":
|
|
218
218
|
window.top.postMessage({ wpgaction: "cashier" }, "*"), window.parent.postMessage({ wpgaction: "cashier.parent" }, "*");
|
|
219
219
|
break;
|
|
@@ -224,35 +224,35 @@ class Li extends $ {
|
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
const
|
|
228
|
-
function
|
|
227
|
+
const ct = O("PariplayPlugin", "color:#000000;font-weight:bold;");
|
|
228
|
+
function He(i) {
|
|
229
229
|
try {
|
|
230
230
|
window.top.location = i;
|
|
231
231
|
} catch {
|
|
232
232
|
window.location = i;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
return new Promise(function(
|
|
235
|
+
function Ve(i, e) {
|
|
236
|
+
return new Promise(function(n, a) {
|
|
237
237
|
const c = new XMLHttpRequest();
|
|
238
238
|
c.onload = function() {
|
|
239
|
-
c.status >= 200 && c.status < 300 ?
|
|
240
|
-
}, c.open(i,
|
|
239
|
+
c.status >= 200 && c.status < 300 ? n(c.responseText) : a(c.responseText);
|
|
240
|
+
}, c.open(i, e), c.send();
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function ze() {
|
|
244
244
|
}
|
|
245
245
|
function Wt(i) {
|
|
246
|
-
return i.filter(function(
|
|
247
|
-
return
|
|
246
|
+
return i.filter(function(t) {
|
|
247
|
+
return t.messageType.toUpperCase() === "DATA";
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
return i.filter(function(
|
|
252
|
-
return ["NOTIFICATION", "POPUP"].includes(
|
|
250
|
+
function qe(i) {
|
|
251
|
+
return i.filter(function(t) {
|
|
252
|
+
return ["NOTIFICATION", "POPUP"].includes(t.messageType.toUpperCase());
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function Lt(i) {
|
|
256
256
|
try {
|
|
257
257
|
return JSON.parse(i.text);
|
|
258
258
|
} catch {
|
|
@@ -260,56 +260,56 @@ function xt(i) {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
function $t(i) {
|
|
263
|
-
return i.map(
|
|
264
|
-
return
|
|
263
|
+
return i.map(Lt).filter(Boolean).find(function(t) {
|
|
264
|
+
return t.betId != null && t.winId != null;
|
|
265
265
|
}) || {};
|
|
266
266
|
}
|
|
267
267
|
function jt(i) {
|
|
268
|
-
return i.map(
|
|
269
|
-
return
|
|
268
|
+
return i.map(Lt).filter(Boolean).find(function(t) {
|
|
269
|
+
return t.TotalBet != null && t.TotalWin != null;
|
|
270
270
|
}) || {};
|
|
271
271
|
}
|
|
272
272
|
class _i extends $ {
|
|
273
|
-
constructor(...
|
|
274
|
-
super(...
|
|
273
|
+
constructor(...e) {
|
|
274
|
+
super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), ct("configured");
|
|
275
275
|
}
|
|
276
|
-
postMessage(
|
|
277
|
-
const
|
|
276
|
+
postMessage(e, t) {
|
|
277
|
+
const n = {
|
|
278
278
|
lang: this.config.ui.language,
|
|
279
279
|
sender: this.config.api.game,
|
|
280
|
-
type:
|
|
280
|
+
type: e
|
|
281
281
|
};
|
|
282
|
-
|
|
282
|
+
t != null && (n.data = t), ct("postMessage", n), window.parent.postMessage(n, "*");
|
|
283
283
|
}
|
|
284
|
-
coinsToCurrency(
|
|
285
|
-
return
|
|
284
|
+
coinsToCurrency(e) {
|
|
285
|
+
return e * this.config.api.coinValueInCents / 100;
|
|
286
286
|
}
|
|
287
|
-
handleContinueButton(
|
|
288
|
-
|
|
287
|
+
handleContinueButton(e, t) {
|
|
288
|
+
e.link && Ve("GET", e.link), t();
|
|
289
289
|
}
|
|
290
|
-
handleLinkButton(
|
|
291
|
-
switch (
|
|
290
|
+
handleLinkButton(e, t) {
|
|
291
|
+
switch (e.linkType.toUpperCase()) {
|
|
292
292
|
case "AJAX":
|
|
293
|
-
|
|
293
|
+
Ve("GET", e.link), t();
|
|
294
294
|
return;
|
|
295
295
|
case "AJAXRESPONSE":
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
Ve("GET", e.link).then(() => {
|
|
297
|
+
t();
|
|
298
298
|
});
|
|
299
299
|
return;
|
|
300
300
|
case "REDIRECT":
|
|
301
|
-
|
|
301
|
+
He(e.link), t();
|
|
302
302
|
return;
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
handleQuitButton(
|
|
306
|
-
this.send("close"),
|
|
305
|
+
handleQuitButton(e, t) {
|
|
306
|
+
this.send("close"), t();
|
|
307
307
|
}
|
|
308
|
-
handleCashierButton(
|
|
309
|
-
this.send("cashier", { type: "ON_DEMAND" }),
|
|
308
|
+
handleCashierButton(e, t) {
|
|
309
|
+
this.send("cashier", { type: "ON_DEMAND" }), t();
|
|
310
310
|
}
|
|
311
|
-
handleHistoryButton(
|
|
312
|
-
this.send("history", { source: "casino" }),
|
|
311
|
+
handleHistoryButton(e, t) {
|
|
312
|
+
this.send("history", { source: "casino" }), t();
|
|
313
313
|
}
|
|
314
314
|
get buttonActions() {
|
|
315
315
|
return {
|
|
@@ -320,24 +320,24 @@ class _i extends $ {
|
|
|
320
320
|
QUIT: this.handleQuitButton
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
-
processInfoUiMessages(
|
|
324
|
-
return
|
|
325
|
-
Object.assign({},
|
|
326
|
-
buttons:
|
|
323
|
+
processInfoUiMessages(e) {
|
|
324
|
+
return e.reduce((t, n) => t.then(() => new Promise((a) => {
|
|
325
|
+
Object.assign({}, n, {
|
|
326
|
+
buttons: n.buttons.filter((c) => c.action.toUpperCase() === "CASHIER" ? !!this.config.api.cashierUrl : !0).map((c) => Object.assign({}, c, {
|
|
327
327
|
onRelease: () => {
|
|
328
|
-
const
|
|
329
|
-
h ? h(c,
|
|
328
|
+
const s = n.messageType.toUpperCase() === "POPUP" ? ze : a, h = this.buttonActions[c.action.toUpperCase()];
|
|
329
|
+
h ? h(c, s) : s();
|
|
330
330
|
}
|
|
331
331
|
}))
|
|
332
332
|
});
|
|
333
|
-
}).catch(
|
|
334
|
-
}).catch(
|
|
333
|
+
}).catch(ze)), Promise.resolve()).then(() => {
|
|
334
|
+
}).catch(ze);
|
|
335
335
|
}
|
|
336
336
|
registerToSdkEvents() {
|
|
337
|
-
window.addEventListener("message", (
|
|
337
|
+
window.addEventListener("message", (e) => {
|
|
338
338
|
try {
|
|
339
|
-
const { type:
|
|
340
|
-
switch (
|
|
339
|
+
const { type: t } = e.data;
|
|
340
|
+
switch (t) {
|
|
341
341
|
case "pause":
|
|
342
342
|
case "disableSpin":
|
|
343
343
|
this.send("freeze");
|
|
@@ -357,34 +357,34 @@ class _i extends $ {
|
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
359
|
registerFromSdkEvents() {
|
|
360
|
-
let
|
|
361
|
-
this.on("openGameResponse", (
|
|
362
|
-
let
|
|
360
|
+
let e = 0;
|
|
361
|
+
this.on("openGameResponse", (t) => {
|
|
362
|
+
let n;
|
|
363
363
|
try {
|
|
364
|
-
const
|
|
364
|
+
const a = JSON.parse(
|
|
365
365
|
JSON.parse(atob(this.config.api.integrationData.token.split(".")[1])).token
|
|
366
|
-
), c = JSON.parse(
|
|
367
|
-
|
|
368
|
-
ClientToken:
|
|
369
|
-
CurrencyCode:
|
|
370
|
-
PlayerTokenId:
|
|
366
|
+
), c = JSON.parse(a.integrationSpecificAttributes.sessionData || "{}");
|
|
367
|
+
n = {
|
|
368
|
+
ClientToken: a.integrationSpecificAttributes.clientToken,
|
|
369
|
+
CurrencyCode: a.currency,
|
|
370
|
+
PlayerTokenId: a.user,
|
|
371
371
|
SessionData: c
|
|
372
372
|
};
|
|
373
373
|
} catch {
|
|
374
|
-
|
|
374
|
+
n = void 0;
|
|
375
375
|
}
|
|
376
376
|
this.postMessage("gameDataLoaded", {
|
|
377
|
-
LoadGameData:
|
|
377
|
+
LoadGameData: n,
|
|
378
378
|
success: !0
|
|
379
379
|
});
|
|
380
380
|
try {
|
|
381
|
-
const
|
|
382
|
-
this.processInfoUiMessages(
|
|
381
|
+
const a = qe(t.data.uiMessages);
|
|
382
|
+
this.processInfoUiMessages(a);
|
|
383
383
|
} catch {
|
|
384
384
|
}
|
|
385
|
-
}), this.on("balance", ({ balance:
|
|
386
|
-
|
|
387
|
-
amount: this.coinsToCurrency(
|
|
385
|
+
}), this.on("balance", ({ balance: t }) => {
|
|
386
|
+
e !== t && (e = t, this.postMessage("balance", {
|
|
387
|
+
amount: this.coinsToCurrency(t)
|
|
388
388
|
}));
|
|
389
389
|
}), this.on("close", () => {
|
|
390
390
|
if (this.config.api.homeUrl)
|
|
@@ -395,63 +395,63 @@ class _i extends $ {
|
|
|
395
395
|
window.history.back();
|
|
396
396
|
}
|
|
397
397
|
else
|
|
398
|
-
this.config.api.homeUrl === "(api)" ? this.postMessage("quit") :
|
|
399
|
-
}), this.on("playEnd", (
|
|
398
|
+
this.config.api.homeUrl === "(api)" ? this.postMessage("quit") : He(this.config.api.homeUrl);
|
|
399
|
+
}), this.on("playEnd", (t) => {
|
|
400
400
|
this.postMessage("roundEnded", {
|
|
401
|
-
balanceAfter: this.coinsToCurrency(
|
|
402
|
-
win: this.coinsToCurrency(
|
|
401
|
+
balanceAfter: this.coinsToCurrency(t.balance),
|
|
402
|
+
win: this.coinsToCurrency(t.data.gameRoundResult.win)
|
|
403
403
|
});
|
|
404
404
|
try {
|
|
405
|
-
const
|
|
406
|
-
this.processInfoUiMessages(
|
|
405
|
+
const n = qe(t.data.uiMessages);
|
|
406
|
+
this.processInfoUiMessages(n);
|
|
407
407
|
} catch {
|
|
408
408
|
}
|
|
409
|
-
}), this.on("playError", (
|
|
409
|
+
}), this.on("playError", (t) => {
|
|
410
410
|
this.postMessage("ticketReceived", {
|
|
411
|
-
ErrorCode:
|
|
412
|
-
ErrorMessage:
|
|
411
|
+
ErrorCode: t.data.data.data.operatorSpecificErrorCode,
|
|
412
|
+
ErrorMessage: t.data.data.data.operatorSpecificErrorMessage,
|
|
413
413
|
Status: {
|
|
414
|
-
ErrCode:
|
|
414
|
+
ErrCode: t.data.data.data.operatorSpecificErrorCode
|
|
415
415
|
}
|
|
416
416
|
});
|
|
417
|
-
}), this.on("playResponse", (
|
|
417
|
+
}), this.on("playResponse", (t) => {
|
|
418
418
|
this.postMessage("roundStarted", {
|
|
419
|
-
balanceBefore: this.coinsToCurrency(
|
|
419
|
+
balanceBefore: this.coinsToCurrency(t.balance + t.data.gameState.totalBetFromCurrentGameCycle)
|
|
420
420
|
});
|
|
421
|
-
const
|
|
421
|
+
const n = t.data.gameState.stateTypeThisRound === "BaseGame", a = Wt(t.data.uiMessages), c = qe(t.data.uiMessages), s = $t(a), h = jt(a);
|
|
422
422
|
this.postMessage("ticketReceived", {
|
|
423
|
-
Balance: this.coinsToCurrency(
|
|
424
|
-
BetAmount:
|
|
425
|
-
CreditTransactionId:
|
|
426
|
-
DebitTransactionId:
|
|
423
|
+
Balance: this.coinsToCurrency(t.balance),
|
|
424
|
+
BetAmount: n ? this.coinsToCurrency(t.data.gameState.totalBetFromCurrentGameCycle) : 0,
|
|
425
|
+
CreditTransactionId: s.betId,
|
|
426
|
+
DebitTransactionId: s.winId,
|
|
427
427
|
Message: c,
|
|
428
428
|
SessionData: h,
|
|
429
429
|
Status: {
|
|
430
430
|
ErrCode: 0
|
|
431
431
|
},
|
|
432
|
-
WinAmount: this.coinsToCurrency(
|
|
432
|
+
WinAmount: this.coinsToCurrency(t.data.gameRoundResult.win)
|
|
433
433
|
});
|
|
434
|
-
}), this.on("playStart", (
|
|
435
|
-
|
|
436
|
-
totalBet: this.coinsToCurrency(
|
|
434
|
+
}), this.on("playStart", (t) => {
|
|
435
|
+
t.bet && this.postMessage("roundStart", {
|
|
436
|
+
totalBet: this.coinsToCurrency(t.bet.base * t.bet.multiplier)
|
|
437
437
|
});
|
|
438
438
|
}), this.on("loadEnd", () => {
|
|
439
439
|
this.postMessage("gameReady");
|
|
440
440
|
}), this.on("loadStart", () => {
|
|
441
441
|
this.postMessage("onAppFrameReady");
|
|
442
442
|
}), this.on("cashier", () => {
|
|
443
|
-
this.config.api.cashierUrl && (this.config.api.cashierUrl === "(api)" ? this.postMessage("cashier") :
|
|
443
|
+
this.config.api.cashierUrl && (this.config.api.cashierUrl === "(api)" ? this.postMessage("cashier") : He(this.config.api.cashierUrl));
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
const
|
|
448
|
-
class
|
|
449
|
-
constructor(...
|
|
450
|
-
super(...
|
|
451
|
-
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
|
|
447
|
+
const ue = O("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
|
|
448
|
+
class Di extends $ {
|
|
449
|
+
constructor(...t) {
|
|
450
|
+
super(...t);
|
|
451
|
+
p(this, "VERSION", "1.15.0");
|
|
452
|
+
const n = document.createElement("script");
|
|
453
|
+
n.src = `https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`, n.onload = () => {
|
|
454
|
+
ue("loaded"), window.FEIM.configure({
|
|
455
455
|
p2pConfig: {
|
|
456
456
|
currency: this.config.api.currency,
|
|
457
457
|
launchParams: {
|
|
@@ -459,21 +459,21 @@ class Fi extends $ {
|
|
|
459
459
|
homeurl: "homeUrl"
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
}),
|
|
463
|
-
}, document.body.appendChild(
|
|
462
|
+
}), ue("configured"), this.registerToSdkEvents(), this.registerFromSdkEvents();
|
|
463
|
+
}, document.body.appendChild(n);
|
|
464
464
|
}
|
|
465
465
|
registerToSdkEvents() {
|
|
466
|
-
window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() =>
|
|
466
|
+
window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() => ue("!!! NOT IMPLEMENTED: exitingGame !!!")), window.FEIM.on.freeze(() => this.send("freeze")), window.FEIM.on.initialized(() => ue("!!! NOT IMPLEMENTED: initialized !!!")), window.FEIM.on.pauseAutoPlay(() => this.send("suspend")), window.FEIM.on.refreshBalance(() => ue("!!! NOT IMPLEMENTED: refreshBalance !!!")), window.FEIM.on.toggleGameHelp(() => {
|
|
467
467
|
this.send("help", {});
|
|
468
468
|
}), window.FEIM.on.togglePaytable(() => {
|
|
469
469
|
this.send("paytable", {});
|
|
470
470
|
}), window.FEIM.on.unfreeze(() => this.send("unfreeze")), window.FEIM.on.updateSettings(
|
|
471
|
-
({ payload: [
|
|
471
|
+
({ payload: [t] }) => this.send("settings", { sounds: t.sounds, fastPlay: t.fastPlay })
|
|
472
472
|
);
|
|
473
473
|
}
|
|
474
474
|
registerFromSdkEvents() {
|
|
475
|
-
this.on("autoplay", ({ action:
|
|
476
|
-
switch (
|
|
475
|
+
this.on("autoplay", ({ action: t }) => {
|
|
476
|
+
switch (t) {
|
|
477
477
|
case "start":
|
|
478
478
|
window.FEIM.send.autoPlayStarted();
|
|
479
479
|
break;
|
|
@@ -481,76 +481,71 @@ class Fi extends $ {
|
|
|
481
481
|
window.FEIM.send.autoPlayFinished();
|
|
482
482
|
break;
|
|
483
483
|
}
|
|
484
|
-
}), this.on("balance", ({ balance:
|
|
485
|
-
window.FEIM.send.balanceUpdate(
|
|
486
|
-
}), this.on("bet", ({ base:
|
|
487
|
-
window.FEIM.send.betUpdate(
|
|
488
|
-
}), this.on("error", ({ message:
|
|
489
|
-
window.FEIM.send.errorMessage(
|
|
484
|
+
}), this.on("balance", ({ balance: t }) => {
|
|
485
|
+
window.FEIM.send.balanceUpdate(t);
|
|
486
|
+
}), this.on("bet", ({ base: t, multiplier: n }) => {
|
|
487
|
+
window.FEIM.send.betUpdate(t * n);
|
|
488
|
+
}), this.on("error", ({ message: t }) => {
|
|
489
|
+
window.FEIM.send.errorMessage(t);
|
|
490
490
|
}), this.on("close", () => {
|
|
491
491
|
window.FEIM.send.exitGame();
|
|
492
492
|
}), this.on("loadEnd", () => {
|
|
493
493
|
window.FEIM.send.gameLoadCompleted();
|
|
494
|
-
}), this.on("loadProgress", ({ progress:
|
|
495
|
-
window.FEIM.send.gameLoadProgress(
|
|
494
|
+
}), this.on("loadProgress", ({ progress: t }) => {
|
|
495
|
+
window.FEIM.send.gameLoadProgress(t);
|
|
496
496
|
}), this.on("loadStart", () => {
|
|
497
497
|
window.FEIM.send.gameLoadStarted();
|
|
498
498
|
}), this.on("cashier", () => {
|
|
499
499
|
window.FEIM.send.openQuickDeposit();
|
|
500
|
-
}), this.on("playCycleEnd", (
|
|
501
|
-
const
|
|
502
|
-
balance:
|
|
503
|
-
|
|
504
|
-
// Current implementation works only with Kalamba RGS
|
|
505
|
-
bet: e.data.gameState.totalBetFromCurrentGameCycle,
|
|
500
|
+
}), this.on("playCycleEnd", (t) => {
|
|
501
|
+
const n = {
|
|
502
|
+
balance: t.contract.balance.coins,
|
|
503
|
+
bet: t.contract.bet.lastPaid.base * t.contract.bet.lastPaid.multiplier,
|
|
506
504
|
win: {
|
|
507
|
-
win:
|
|
505
|
+
win: t.contract.win.total
|
|
508
506
|
}
|
|
509
507
|
};
|
|
510
|
-
window.FEIM.send.roundFinished(
|
|
511
|
-
}), this.on("playResponse", (
|
|
512
|
-
const
|
|
513
|
-
balance:
|
|
514
|
-
playResponse:
|
|
508
|
+
window.FEIM.send.roundFinished(n);
|
|
509
|
+
}), this.on("playResponse", (t) => {
|
|
510
|
+
const n = {
|
|
511
|
+
balance: t.contract.balance.coins,
|
|
512
|
+
playResponse: t.data
|
|
515
513
|
};
|
|
516
|
-
window.FEIM.send.roundStarted(
|
|
514
|
+
window.FEIM.send.roundStarted(n);
|
|
517
515
|
}), this.on("history", () => {
|
|
518
516
|
window.FEIM.send.showHistory();
|
|
519
|
-
}), this.on("settings", (
|
|
520
|
-
window.FEIM.send.updateSettings(
|
|
517
|
+
}), this.on("settings", (t) => {
|
|
518
|
+
window.FEIM.send.updateSettings(t);
|
|
521
519
|
});
|
|
522
520
|
}
|
|
523
521
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
s.onreadystatechange = function() {
|
|
540
|
-
s.readyState === XMLHttpRequest.DONE && (s.status === 0 || s.status >= 200 && s.status < 400 ? Ve("ping ok", s) : Ve("ping error", s));
|
|
541
|
-
}, s.open("GET", e), s.send();
|
|
522
|
+
const Ge = O("TukoPlugin", "color:#000000;font-weight:bold;");
|
|
523
|
+
class Ri extends $ {
|
|
524
|
+
constructor(...t) {
|
|
525
|
+
super(...t);
|
|
526
|
+
p(this, "PING_INTERVAL", 1e4);
|
|
527
|
+
const a = new URLSearchParams(window.location.search).get("pingCallbackUrl");
|
|
528
|
+
a && window.setInterval(() => {
|
|
529
|
+
this.ping(a);
|
|
530
|
+
}, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(), Ge("configured");
|
|
531
|
+
}
|
|
532
|
+
ping(t) {
|
|
533
|
+
const n = new XMLHttpRequest();
|
|
534
|
+
n.onreadystatechange = function() {
|
|
535
|
+
n.readyState === XMLHttpRequest.DONE && (n.status === 0 || n.status >= 200 && n.status < 400 ? Ge("ping ok", n) : Ge("ping error", n));
|
|
536
|
+
}, n.open("GET", t), n.send();
|
|
542
537
|
}
|
|
543
538
|
registerToSdkEvents() {
|
|
544
|
-
window.addEventListener("message", (
|
|
539
|
+
window.addEventListener("message", (t) => {
|
|
545
540
|
try {
|
|
546
|
-
const { type:
|
|
547
|
-
switch (
|
|
541
|
+
const { type: n, payload: a } = t.data;
|
|
542
|
+
switch (n) {
|
|
548
543
|
case "doAudioSettings":
|
|
549
|
-
this.send("settings", { music:
|
|
544
|
+
this.send("settings", { music: a == null ? void 0 : a.musicEnabled, sounds: a == null ? void 0 : a.soundEnabled });
|
|
550
545
|
return;
|
|
551
546
|
case "doBalanceUpdate":
|
|
552
|
-
const { currency: c, coinValueInCents:
|
|
553
|
-
|
|
547
|
+
const { currency: c, coinValueInCents: s } = this.config.api;
|
|
548
|
+
a.currency === c && typeof a.balanceInCurrency == "number" ? this.send("balance", { balance: Ot(a.balanceInCurrency, s) }) : (a.balanceInCoins, this.send("balance", { balance: a.balanceInCoins }));
|
|
554
549
|
return;
|
|
555
550
|
case "doGamePause":
|
|
556
551
|
this.send("freeze");
|
|
@@ -585,105 +580,120 @@ class Di extends $ {
|
|
|
585
580
|
});
|
|
586
581
|
}
|
|
587
582
|
}
|
|
583
|
+
class Qt {
|
|
584
|
+
constructor(e) {
|
|
585
|
+
p(this, "config");
|
|
586
|
+
this.config = e;
|
|
587
|
+
}
|
|
588
|
+
on(e, t, n) {
|
|
589
|
+
const a = function(s) {
|
|
590
|
+
s.data.message !== `kalamba:wrapper-rgs:${e}` && s.data.message !== `kalamba:wrapper:${e}` || t(s.data.payload);
|
|
591
|
+
};
|
|
592
|
+
window.addEventListener("message", a, n);
|
|
593
|
+
}
|
|
594
|
+
send(e, ...[t]) {
|
|
595
|
+
window.postMessage({
|
|
596
|
+
message: `kalamba:rgs:${e}`,
|
|
597
|
+
payload: t
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
}
|
|
588
601
|
class Xt {
|
|
589
|
-
constructor(
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
602
|
+
constructor(e) {
|
|
603
|
+
p(this, "socket", null);
|
|
604
|
+
p(this, "webSocketUrl");
|
|
605
|
+
p(this, "eventListeners", {
|
|
593
606
|
close: [],
|
|
594
607
|
error: [],
|
|
595
608
|
message: []
|
|
596
609
|
});
|
|
597
|
-
|
|
598
|
-
const
|
|
599
|
-
return
|
|
600
|
-
|
|
601
|
-
this.handleOpen(
|
|
610
|
+
p(this, "connect", () => {
|
|
611
|
+
const e = new WebSocket(this.webSocketUrl);
|
|
612
|
+
return e.addEventListener("message", this.handleMessage), new Promise((t) => {
|
|
613
|
+
e.addEventListener("open", (n) => {
|
|
614
|
+
this.handleOpen(n), t(this.socket);
|
|
602
615
|
});
|
|
603
616
|
});
|
|
604
617
|
});
|
|
605
|
-
|
|
618
|
+
p(this, "send", (e) => {
|
|
606
619
|
if (this.socket == null)
|
|
607
620
|
throw new Error("Cannot send message, the WebSocket connection is not open");
|
|
608
|
-
this.socket.send(
|
|
621
|
+
this.socket.send(e);
|
|
609
622
|
});
|
|
610
|
-
|
|
623
|
+
p(this, "close", () => {
|
|
611
624
|
if (this.socket == null)
|
|
612
625
|
throw new Error("Cannot close the WebSocket connection that is not open");
|
|
613
|
-
this.socket.close(), this.addEventListener("error", (
|
|
614
|
-
console.log(
|
|
626
|
+
this.socket.close(), this.addEventListener("error", (e) => {
|
|
627
|
+
console.log(e);
|
|
615
628
|
});
|
|
616
629
|
});
|
|
617
|
-
|
|
618
|
-
this.eventListeners.close.forEach((
|
|
619
|
-
e
|
|
630
|
+
p(this, "handleClose", (e) => {
|
|
631
|
+
this.eventListeners.close.forEach((t) => {
|
|
632
|
+
t(e);
|
|
620
633
|
});
|
|
621
634
|
});
|
|
622
|
-
|
|
623
|
-
this.eventListeners.error.forEach((
|
|
624
|
-
e
|
|
635
|
+
p(this, "handleError", (e) => {
|
|
636
|
+
this.eventListeners.error.forEach((t) => {
|
|
637
|
+
t(e);
|
|
625
638
|
});
|
|
626
639
|
});
|
|
627
|
-
|
|
628
|
-
this.eventListeners.message.forEach((
|
|
629
|
-
e
|
|
640
|
+
p(this, "handleMessage", (e) => {
|
|
641
|
+
this.eventListeners.message.forEach((t) => {
|
|
642
|
+
t(e);
|
|
630
643
|
});
|
|
631
644
|
});
|
|
632
|
-
|
|
633
|
-
const
|
|
634
|
-
|
|
645
|
+
p(this, "handleOpen", (e) => {
|
|
646
|
+
const t = e.target;
|
|
647
|
+
t.addEventListener("close", this.handleClose), t.addEventListener("error", this.handleError), this.socket = t;
|
|
635
648
|
});
|
|
636
|
-
this.webSocketUrl =
|
|
649
|
+
this.webSocketUrl = e;
|
|
637
650
|
}
|
|
638
|
-
addEventListener(
|
|
639
|
-
this.eventListeners[
|
|
651
|
+
addEventListener(e, t) {
|
|
652
|
+
this.eventListeners[e].push(t);
|
|
640
653
|
}
|
|
641
|
-
removeEventListener(
|
|
642
|
-
const
|
|
643
|
-
|
|
654
|
+
removeEventListener(e, t) {
|
|
655
|
+
const n = this.eventListeners[e].indexOf(t);
|
|
656
|
+
n !== -1 && this.eventListeners[e].splice(n, 1);
|
|
644
657
|
}
|
|
645
658
|
}
|
|
646
|
-
function
|
|
659
|
+
function Ce(i) {
|
|
647
660
|
try {
|
|
648
661
|
return JSON.parse(i == null ? void 0 : i.data);
|
|
649
|
-
} catch (
|
|
650
|
-
return console.error("fakap",
|
|
662
|
+
} catch (e) {
|
|
663
|
+
return console.error("fakap", e), null;
|
|
651
664
|
}
|
|
652
665
|
}
|
|
653
|
-
function
|
|
654
|
-
var
|
|
655
|
-
return ((
|
|
666
|
+
function be(i) {
|
|
667
|
+
var e;
|
|
668
|
+
return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "GameEvent";
|
|
656
669
|
}
|
|
657
670
|
function Kt(i) {
|
|
658
|
-
return
|
|
671
|
+
return be(i) && i.body.event === "OPEN_GAME";
|
|
659
672
|
}
|
|
660
673
|
function Jt(i) {
|
|
661
|
-
return
|
|
674
|
+
return be(i) && i.body.event === "SPIN_ERROR";
|
|
662
675
|
}
|
|
663
676
|
function Yt(i) {
|
|
664
|
-
return
|
|
677
|
+
return be(i) && i.body.event.includes("_RESULT");
|
|
665
678
|
}
|
|
666
679
|
function Zt(i) {
|
|
667
|
-
|
|
680
|
+
var e;
|
|
681
|
+
return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "OpenGame";
|
|
668
682
|
}
|
|
669
683
|
function ei(i) {
|
|
670
|
-
var
|
|
671
|
-
return ((
|
|
672
|
-
}
|
|
673
|
-
function ti(i) {
|
|
674
|
-
var t;
|
|
675
|
-
return ((t = i == null ? void 0 : i.header) == null ? void 0 : t.name) === "Ping";
|
|
684
|
+
var e;
|
|
685
|
+
return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "Ping";
|
|
676
686
|
}
|
|
677
|
-
function
|
|
678
|
-
var
|
|
679
|
-
return ((
|
|
687
|
+
function dt(i) {
|
|
688
|
+
var e;
|
|
689
|
+
return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "RealityCheck";
|
|
680
690
|
}
|
|
681
691
|
var Z, ye;
|
|
682
|
-
class
|
|
683
|
-
constructor(
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
super(
|
|
692
|
+
class ti extends Xt {
|
|
693
|
+
constructor(t, n) {
|
|
694
|
+
const a = new URL(t.apiUrl);
|
|
695
|
+
a.searchParams.set("cageCode", t.cageCode), a.searchParams.set("gameCode", t.gameCode), a.searchParams.set("operatorCode", t.operatorCode), a.searchParams.set("playMode", t.playMode), a.searchParams.set("token", t.token), a.searchParams.set("username", t.username);
|
|
696
|
+
super(a.toString());
|
|
687
697
|
/*
|
|
688
698
|
* Correlation ID. Used in Request and Response types.
|
|
689
699
|
* ----
|
|
@@ -694,7 +704,7 @@ class ii extends Xt {
|
|
|
694
704
|
* request sent. Client and server independently maintain their own
|
|
695
705
|
* correlation id counter.
|
|
696
706
|
*/
|
|
697
|
-
|
|
707
|
+
p(this, "cId", 0);
|
|
698
708
|
// Initial values for header
|
|
699
709
|
/*
|
|
700
710
|
* Increasing message ID
|
|
@@ -706,146 +716,295 @@ class ii extends Xt {
|
|
|
706
716
|
* received out of sync).
|
|
707
717
|
*/
|
|
708
718
|
// TODO make sure messages are processed in order
|
|
709
|
-
|
|
719
|
+
p(this, "mId", 0);
|
|
710
720
|
// Initial values for body
|
|
711
721
|
/*
|
|
712
722
|
* Sequence ID. Action/Event correlation.
|
|
713
723
|
*/
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
const
|
|
720
|
-
(
|
|
724
|
+
p(this, "seqId", 10);
|
|
725
|
+
p(this, "gameCode");
|
|
726
|
+
E(this, Z, void 0);
|
|
727
|
+
E(this, ye, void 0);
|
|
728
|
+
p(this, "onMessage", (t) => {
|
|
729
|
+
const n = Ce(t);
|
|
730
|
+
(be(n) || ei(n) || dt(n)) && this.sendAcknowledgement(n), dt(n) && this.handleRealityCheck(n);
|
|
721
731
|
});
|
|
722
|
-
this.eventListeners.realityCheck = [], this.gameCode =
|
|
732
|
+
this.eventListeners.realityCheck = [], this.gameCode = t.gameCode, v(this, Z, n.requestTimeoutMs), v(this, ye, n.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
|
|
723
733
|
}
|
|
724
|
-
handleRealityCheck(
|
|
725
|
-
this.eventListeners.realityCheck.forEach((
|
|
726
|
-
|
|
734
|
+
handleRealityCheck(t) {
|
|
735
|
+
this.eventListeners.realityCheck.forEach((n) => {
|
|
736
|
+
n(t.body);
|
|
727
737
|
});
|
|
728
738
|
}
|
|
729
|
-
addEventListener(
|
|
730
|
-
super.addEventListener(
|
|
739
|
+
addEventListener(t, n) {
|
|
740
|
+
super.addEventListener(t, n);
|
|
731
741
|
}
|
|
732
|
-
removeEventListener(
|
|
733
|
-
super.removeEventListener(
|
|
742
|
+
removeEventListener(t, n) {
|
|
743
|
+
super.removeEventListener(t, n);
|
|
734
744
|
}
|
|
735
|
-
buildHeader(
|
|
745
|
+
buildHeader(t, n = null) {
|
|
736
746
|
return {
|
|
737
747
|
// Assign new cId if it is not provided
|
|
738
|
-
cId:
|
|
739
|
-
code:
|
|
748
|
+
cId: n ?? ++this.cId,
|
|
749
|
+
code: n !== null ? 1 : void 0,
|
|
740
750
|
mId: ++this.mId,
|
|
741
|
-
name:
|
|
751
|
+
name: t
|
|
742
752
|
};
|
|
743
753
|
}
|
|
744
754
|
// TODO infer body from header
|
|
745
|
-
buildPayload(
|
|
755
|
+
buildPayload(t, n) {
|
|
746
756
|
return JSON.stringify({
|
|
747
|
-
body:
|
|
748
|
-
header:
|
|
757
|
+
body: n,
|
|
758
|
+
header: t
|
|
749
759
|
});
|
|
750
760
|
}
|
|
751
|
-
getBodyExtras(
|
|
761
|
+
getBodyExtras(t) {
|
|
752
762
|
return {
|
|
753
|
-
action:
|
|
763
|
+
action: t,
|
|
754
764
|
seqId: ++this.seqId
|
|
755
765
|
};
|
|
756
766
|
}
|
|
757
|
-
request(
|
|
758
|
-
const
|
|
759
|
-
return new Promise((c,
|
|
760
|
-
setTimeout(() =>
|
|
761
|
-
const h = (
|
|
762
|
-
const
|
|
767
|
+
request(t, n) {
|
|
768
|
+
const a = this.buildPayload(t, n);
|
|
769
|
+
return new Promise((c, s) => {
|
|
770
|
+
setTimeout(() => s({ request: { body: n, header: t }, type: "timeout" }), y(this, Z));
|
|
771
|
+
const h = (g) => {
|
|
772
|
+
const w = Ce(g);
|
|
763
773
|
try {
|
|
764
|
-
|
|
774
|
+
t.cId === (w == null ? void 0 : w.header.cId) && (this.removeEventListener("message", h), w.header.code === 1 ? c(w) : s({ response: w, type: "response" }));
|
|
765
775
|
} catch {
|
|
766
|
-
|
|
776
|
+
s({ response: w, type: "error" });
|
|
767
777
|
}
|
|
768
778
|
};
|
|
769
|
-
this.addEventListener("message", h), this.send(
|
|
779
|
+
this.addEventListener("message", h), this.send(a);
|
|
770
780
|
});
|
|
771
781
|
}
|
|
772
|
-
activateFreeRound(
|
|
773
|
-
const
|
|
782
|
+
activateFreeRound(t) {
|
|
783
|
+
const n = this.buildHeader("ActivateFreeRound");
|
|
774
784
|
return this.request(
|
|
775
|
-
|
|
776
|
-
|
|
785
|
+
n,
|
|
786
|
+
t
|
|
777
787
|
);
|
|
778
788
|
}
|
|
779
|
-
authenticate(
|
|
780
|
-
const
|
|
789
|
+
authenticate(t = !1) {
|
|
790
|
+
const n = this.buildHeader("Authenticate"), a = {
|
|
781
791
|
clientType: 3,
|
|
782
792
|
version: y(this, ye),
|
|
783
|
-
reconnect:
|
|
793
|
+
reconnect: t
|
|
784
794
|
};
|
|
785
795
|
return this.request(
|
|
786
|
-
|
|
787
|
-
|
|
796
|
+
n,
|
|
797
|
+
a
|
|
788
798
|
).then((c) => c.body);
|
|
789
799
|
}
|
|
790
800
|
openGame() {
|
|
791
|
-
const
|
|
801
|
+
const t = this.buildHeader("OpenGame"), n = {
|
|
792
802
|
gameCode: this.gameCode
|
|
793
803
|
};
|
|
794
|
-
return new Promise((
|
|
795
|
-
const
|
|
796
|
-
const
|
|
797
|
-
Kt(
|
|
804
|
+
return new Promise((a, c) => {
|
|
805
|
+
const s = (h) => {
|
|
806
|
+
const g = Ce(h);
|
|
807
|
+
Kt(g) && (this.removeEventListener("message", s), a(g.body));
|
|
798
808
|
};
|
|
799
|
-
this.addEventListener("message",
|
|
800
|
-
|
|
809
|
+
this.addEventListener("message", s), this.request(t, n).catch((h) => {
|
|
810
|
+
Zt(h.response) && c(h), c(h);
|
|
801
811
|
});
|
|
802
812
|
});
|
|
803
813
|
}
|
|
804
|
-
sendAcknowledgement(
|
|
805
|
-
const { name:
|
|
806
|
-
this.send(
|
|
814
|
+
sendAcknowledgement(t) {
|
|
815
|
+
const { name: n, cId: a } = t.header, c = this.buildHeader(n, a), s = this.buildPayload(c, {});
|
|
816
|
+
this.send(s);
|
|
807
817
|
}
|
|
808
|
-
sendAction(
|
|
809
|
-
const
|
|
810
|
-
...this.getBodyExtras(
|
|
811
|
-
data:
|
|
818
|
+
sendAction(t, n) {
|
|
819
|
+
const a = this.buildHeader("GameAction"), c = {
|
|
820
|
+
...this.getBodyExtras(t),
|
|
821
|
+
data: n
|
|
812
822
|
};
|
|
813
|
-
return new Promise((
|
|
814
|
-
const
|
|
815
|
-
const
|
|
816
|
-
|
|
823
|
+
return new Promise((s, h) => {
|
|
824
|
+
const g = (w) => {
|
|
825
|
+
const m = Ce(w);
|
|
826
|
+
be(m) && c.seqId === m.body.correlationSeqId && (this.removeEventListener("message", g), Yt(m) ? s(m.body) : Jt(m) && h(m.body));
|
|
817
827
|
};
|
|
818
|
-
this.addEventListener("message",
|
|
819
|
-
(
|
|
820
|
-
h(
|
|
828
|
+
this.addEventListener("message", g), this.request(a, c).catch(
|
|
829
|
+
(w) => {
|
|
830
|
+
h(w);
|
|
821
831
|
}
|
|
822
832
|
);
|
|
823
833
|
});
|
|
824
834
|
}
|
|
825
|
-
setRequestTimeoutMs(
|
|
826
|
-
|
|
835
|
+
setRequestTimeoutMs(t) {
|
|
836
|
+
v(this, Z, t);
|
|
827
837
|
}
|
|
828
838
|
}
|
|
829
839
|
Z = new WeakMap(), ye = new WeakMap();
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
840
|
+
function ii(i) {
|
|
841
|
+
return i.contract ? {
|
|
842
|
+
contract: {
|
|
843
|
+
balance: {
|
|
844
|
+
coins: i.contract.balance,
|
|
845
|
+
version: i.contract.balanceVersion
|
|
846
|
+
},
|
|
847
|
+
coinValueInCents: i.contract.coinValueInCents,
|
|
848
|
+
country: i.contract.countryCode,
|
|
849
|
+
currency: i.contract.currencyCode,
|
|
850
|
+
jurisdiction: i.contract.jurisdictionCode,
|
|
851
|
+
uiMessages: i.contract.uiMessages,
|
|
852
|
+
username: i.contract.username
|
|
853
|
+
}
|
|
854
|
+
} : {
|
|
855
|
+
contract: {
|
|
856
|
+
balance: {
|
|
857
|
+
coins: i.balance,
|
|
858
|
+
version: i.balanceVersion
|
|
859
|
+
},
|
|
860
|
+
coinValueInCents: i.coinValueInCents,
|
|
861
|
+
country: i.countryCode,
|
|
862
|
+
currency: i.currencyCode,
|
|
863
|
+
jurisdiction: i.jurisdictionCode,
|
|
864
|
+
uiMessages: i.uiMessages,
|
|
865
|
+
username: i.username
|
|
866
|
+
}
|
|
867
|
+
};
|
|
847
868
|
}
|
|
848
|
-
|
|
869
|
+
function ni(i, e) {
|
|
870
|
+
return e.contract ? {
|
|
871
|
+
contract: {
|
|
872
|
+
bet: {
|
|
873
|
+
available: e.contract.availableMultipliersPerBaseBet,
|
|
874
|
+
default: {
|
|
875
|
+
base: e.contract.defaultBet.baseBet,
|
|
876
|
+
multiplier: e.contract.defaultBet.betMultiplier
|
|
877
|
+
},
|
|
878
|
+
max: e.contract.maxBetInCoins,
|
|
879
|
+
last: e.contract.lastBet ? {
|
|
880
|
+
base: e.contract.lastBet.baseBet,
|
|
881
|
+
multiplier: e.contract.lastBet.betMultiplier
|
|
882
|
+
} : null,
|
|
883
|
+
lastPaid: e.contract.lastMainGameBet ? {
|
|
884
|
+
base: e.contract.lastMainGameBet.baseBet,
|
|
885
|
+
multiplier: e.contract.lastMainGameBet.betMultiplier
|
|
886
|
+
} : null
|
|
887
|
+
},
|
|
888
|
+
balance: {
|
|
889
|
+
coins: e.contract.balanceInCoins,
|
|
890
|
+
version: e.contract.balanceVersion
|
|
891
|
+
},
|
|
892
|
+
gameModel: e.contract.gameModelFile,
|
|
893
|
+
metaData: e.contract.metaData,
|
|
894
|
+
serverTime: e.contract.serverTime,
|
|
895
|
+
sessionId: e.contract.sessionId,
|
|
896
|
+
stateType: {
|
|
897
|
+
thisRound: e.contract.stateTypeThisRound,
|
|
898
|
+
nextRound: e.contract.stateTypeNextRound
|
|
899
|
+
},
|
|
900
|
+
uiMessages: i.contract.uiMessages.concat(e.contract.uiMessages),
|
|
901
|
+
win: {
|
|
902
|
+
round: e.contract.roundWin,
|
|
903
|
+
total: e.contract.totalWin
|
|
904
|
+
}
|
|
905
|
+
},
|
|
906
|
+
data: e.opaqueGameServerToUi
|
|
907
|
+
} : {
|
|
908
|
+
contract: {
|
|
909
|
+
bet: {
|
|
910
|
+
available: e.data.additionalConfigData.availableMultipliersPerBaseBet,
|
|
911
|
+
default: {
|
|
912
|
+
base: e.data.additionalConfigData.defaultBet.baseBet,
|
|
913
|
+
multiplier: e.data.additionalConfigData.defaultBet.betMultiplier
|
|
914
|
+
},
|
|
915
|
+
max: e.data.additionalConfigData.maxAllowedOverallBetInCoins,
|
|
916
|
+
last: e.data.gameState.betFromCurrentRound ? {
|
|
917
|
+
base: e.data.gameState.betFromCurrentRound.baseBet,
|
|
918
|
+
multiplier: e.data.gameState.betFromCurrentRound.betMultiplier
|
|
919
|
+
} : null,
|
|
920
|
+
lastPaid: e.data.gameState.lastPlacedMainGameBet ? {
|
|
921
|
+
base: e.data.gameState.lastPlacedMainGameBet.baseBet,
|
|
922
|
+
multiplier: e.data.gameState.lastPlacedMainGameBet.betMultiplier
|
|
923
|
+
} : null
|
|
924
|
+
},
|
|
925
|
+
balance: {
|
|
926
|
+
coins: e.balance,
|
|
927
|
+
version: e.balanceVersion
|
|
928
|
+
},
|
|
929
|
+
gameModel: e.data.additionalConfigData.gameModelFile,
|
|
930
|
+
metaData: e.data.gameConfigData.metaData,
|
|
931
|
+
serverTime: e.balanceVersion,
|
|
932
|
+
sessionId: e.data.gameState.sessionId,
|
|
933
|
+
stateType: {
|
|
934
|
+
thisRound: e.data.gameState.stateTypeThisRound,
|
|
935
|
+
nextRound: e.data.gameState.stateTypeNextRound
|
|
936
|
+
},
|
|
937
|
+
uiMessages: i.uiMessages,
|
|
938
|
+
win: {
|
|
939
|
+
round: e.data.gameState.totalWinFromCurrentRound,
|
|
940
|
+
total: e.data.gameState.totalWinFromCurrentGameCycle
|
|
941
|
+
}
|
|
942
|
+
},
|
|
943
|
+
data: e.data
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
function ai(i) {
|
|
947
|
+
return i.contract ? {
|
|
948
|
+
contract: {
|
|
949
|
+
bet: {
|
|
950
|
+
last: i.contract.lastBet ? {
|
|
951
|
+
base: i.contract.lastBet.baseBet,
|
|
952
|
+
multiplier: i.contract.lastBet.betMultiplier
|
|
953
|
+
} : null,
|
|
954
|
+
lastPaid: {
|
|
955
|
+
base: i.contract.lastMainGameBet.baseBet,
|
|
956
|
+
multiplier: i.contract.lastMainGameBet.betMultiplier
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
balance: {
|
|
960
|
+
coins: i.contract.balanceInCoins,
|
|
961
|
+
version: i.contract.balanceVersion
|
|
962
|
+
},
|
|
963
|
+
serverTime: i.contract.serverTime,
|
|
964
|
+
roundId: i.contract.roundId,
|
|
965
|
+
stateType: {
|
|
966
|
+
thisRound: i.contract.stateTypeThisRound,
|
|
967
|
+
nextRound: i.contract.stateTypeNextRound
|
|
968
|
+
},
|
|
969
|
+
uiMessages: i.contract.uiMessages,
|
|
970
|
+
win: {
|
|
971
|
+
round: i.contract.roundWin,
|
|
972
|
+
total: i.contract.totalWin
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
data: i.opaqueGameServerToUi
|
|
976
|
+
} : {
|
|
977
|
+
contract: {
|
|
978
|
+
bet: {
|
|
979
|
+
last: i.data.gameState.betFromCurrentRound ? {
|
|
980
|
+
base: i.data.gameState.betFromCurrentRound.baseBet,
|
|
981
|
+
multiplier: i.data.gameState.betFromCurrentRound.betMultiplier
|
|
982
|
+
} : null,
|
|
983
|
+
lastPaid: {
|
|
984
|
+
base: i.data.gameState.lastPlacedMainGameBet.baseBet,
|
|
985
|
+
multiplier: i.data.gameState.lastPlacedMainGameBet.betMultiplier
|
|
986
|
+
}
|
|
987
|
+
},
|
|
988
|
+
balance: {
|
|
989
|
+
coins: i.balance,
|
|
990
|
+
version: i.balanceVersion
|
|
991
|
+
},
|
|
992
|
+
serverTime: i.balanceVersion,
|
|
993
|
+
roundId: i.data.gameState.cycleId,
|
|
994
|
+
stateType: {
|
|
995
|
+
thisRound: i.data.gameState.stateTypeThisRound,
|
|
996
|
+
nextRound: i.data.gameState.stateTypeNextRound
|
|
997
|
+
},
|
|
998
|
+
uiMessages: i.data.uiMessages,
|
|
999
|
+
win: {
|
|
1000
|
+
round: i.data.gameState.totalWinFromCurrentRound,
|
|
1001
|
+
total: i.data.gameState.totalWinFromCurrentGameCycle
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
data: i.data
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
const si = {
|
|
849
1008
|
bul: "bg",
|
|
850
1009
|
chi: "zh",
|
|
851
1010
|
zho: "zh",
|
|
@@ -877,167 +1036,168 @@ const ni = {
|
|
|
877
1036
|
tur: "tr",
|
|
878
1037
|
ukr: "uk",
|
|
879
1038
|
vie: "vi"
|
|
880
|
-
},
|
|
881
|
-
var
|
|
882
|
-
class
|
|
883
|
-
constructor(...
|
|
884
|
-
super(...
|
|
1039
|
+
}, oi = O("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
|
|
1040
|
+
var ve;
|
|
1041
|
+
class Ni extends Qt {
|
|
1042
|
+
constructor(...t) {
|
|
1043
|
+
super(...t);
|
|
885
1044
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
886
1045
|
// @ts-ignore
|
|
887
|
-
|
|
888
|
-
|
|
1046
|
+
p(this, "socket");
|
|
1047
|
+
E(this, ve, "");
|
|
889
1048
|
this.on("openGame", async () => {
|
|
890
1049
|
try {
|
|
891
|
-
const
|
|
892
|
-
this.send("openGameResponse",
|
|
893
|
-
} catch (
|
|
894
|
-
this.send("openGameError",
|
|
1050
|
+
const n = await this.openGame();
|
|
1051
|
+
this.send("openGameResponse", n);
|
|
1052
|
+
} catch (n) {
|
|
1053
|
+
this.send("openGameError", n);
|
|
895
1054
|
}
|
|
896
|
-
}), this.on("play", async (
|
|
1055
|
+
}), this.on("play", async (n) => {
|
|
897
1056
|
try {
|
|
898
|
-
const
|
|
899
|
-
this.send("playResponse",
|
|
900
|
-
} catch (
|
|
901
|
-
this.send("playError",
|
|
1057
|
+
const a = await this.play(n);
|
|
1058
|
+
this.send("playResponse", a);
|
|
1059
|
+
} catch (a) {
|
|
1060
|
+
this.send("playError", a);
|
|
902
1061
|
}
|
|
903
|
-
}), this.on("state", ({ version:
|
|
904
|
-
|
|
905
|
-
}), this.on("configured", (
|
|
906
|
-
this.socket.setRequestTimeoutMs(
|
|
1062
|
+
}), this.on("state", ({ version: n }) => {
|
|
1063
|
+
v(this, ve, n);
|
|
1064
|
+
}), this.on("configured", (n) => {
|
|
1065
|
+
this.socket.setRequestTimeoutMs(n.ui.requestTimeoutMs);
|
|
907
1066
|
}), this.registerFromSdkEvents();
|
|
908
1067
|
}
|
|
909
|
-
initialize(
|
|
910
|
-
this.socket = new
|
|
911
|
-
gameVersion: y(this,
|
|
1068
|
+
initialize(t) {
|
|
1069
|
+
this.socket = new ti(t, {
|
|
1070
|
+
gameVersion: y(this, ve),
|
|
912
1071
|
requestTimeoutMs: this.config.ui.requestTimeoutMs
|
|
913
|
-
}), this.socket.addEventListener("close", (
|
|
914
|
-
|
|
1072
|
+
}), this.socket.addEventListener("close", (n) => {
|
|
1073
|
+
n.code === 1006 && this.reconnect(t);
|
|
915
1074
|
}), document.addEventListener("visibilitychange", () => {
|
|
916
|
-
document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(
|
|
917
|
-
}), this.socket.addEventListener("error", (
|
|
918
|
-
this.send("realityCheck",
|
|
1075
|
+
document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(t);
|
|
1076
|
+
}), this.socket.addEventListener("error", (n) => oi("error", n)), this.socket.addEventListener("realityCheck", (n) => {
|
|
1077
|
+
this.send("realityCheck", n);
|
|
919
1078
|
});
|
|
920
1079
|
}
|
|
921
|
-
async reconnect(
|
|
922
|
-
this.initialize(
|
|
1080
|
+
async reconnect(t) {
|
|
1081
|
+
this.initialize(t), await this.socket.connect(), await this.socket.authenticate(!0), await this.socket.openGame();
|
|
923
1082
|
}
|
|
924
1083
|
async openGame() {
|
|
925
|
-
const
|
|
926
|
-
this.initialize({ apiUrl:
|
|
927
|
-
const
|
|
1084
|
+
const t = new URLSearchParams(window.location.search), n = t.get("apiUrl"), a = t.get("cageCode"), c = t.get("gameCode"), s = t.get("operatorCode"), h = t.get("playMode"), g = t.get("token"), w = t.get("username"), m = t.get("gameHistoryUrl"), A = t.get("homeUrl") ?? void 0, R = t.get("cashierUrl") ?? void 0;
|
|
1085
|
+
this.initialize({ apiUrl: n, cageCode: a, gameCode: c, operatorCode: s, playMode: h, token: g, username: w }), await this.socket.connect();
|
|
1086
|
+
const de = await this.socket.authenticate(), le = await this.socket.openGame(), L = ii(de), Se = ni(de, le);
|
|
928
1087
|
this.config.api = {
|
|
929
|
-
brand:
|
|
1088
|
+
brand: a,
|
|
930
1089
|
game: c,
|
|
931
|
-
integration:
|
|
932
|
-
jurisdiction:
|
|
1090
|
+
integration: s,
|
|
1091
|
+
jurisdiction: L.contract.jurisdiction,
|
|
933
1092
|
playMode: h,
|
|
934
|
-
user:
|
|
1093
|
+
user: L.contract.username,
|
|
935
1094
|
integrationData: {
|
|
936
|
-
token:
|
|
1095
|
+
token: g
|
|
937
1096
|
},
|
|
938
|
-
country:
|
|
939
|
-
currency:
|
|
940
|
-
coinValueInCents:
|
|
941
|
-
gameHistoryUrl:
|
|
1097
|
+
country: L.contract.country,
|
|
1098
|
+
currency: L.contract.currency,
|
|
1099
|
+
coinValueInCents: L.contract.coinValueInCents,
|
|
1100
|
+
gameHistoryUrl: m,
|
|
942
1101
|
homeUrl: A,
|
|
943
|
-
cashierUrl:
|
|
1102
|
+
cashierUrl: R,
|
|
1103
|
+
sessionId: Se.contract.sessionId
|
|
944
1104
|
};
|
|
945
|
-
const
|
|
946
|
-
return
|
|
1105
|
+
const x = t.get("languageCode");
|
|
1106
|
+
return x && (this.config.ui.language = x.length === 3 ? si[x] ?? x : x), Se;
|
|
947
1107
|
}
|
|
948
|
-
|
|
949
|
-
play(e) {
|
|
1108
|
+
async play(t) {
|
|
950
1109
|
const {
|
|
951
|
-
contract: { bet:
|
|
1110
|
+
contract: { bet: n, ...a },
|
|
952
1111
|
extra: c,
|
|
953
|
-
actionType:
|
|
954
|
-
} =
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
...
|
|
958
|
-
|
|
959
|
-
});
|
|
1112
|
+
actionType: s
|
|
1113
|
+
} = t, h = await this.socket.sendAction(s, {
|
|
1114
|
+
bet: n ? { baseBet: n.base, betMultiplier: n.multiplier } : void 0,
|
|
1115
|
+
// TODO: get rid of contractRest - it' a legacy from old RGS
|
|
1116
|
+
...a,
|
|
1117
|
+
opaqueUiToGameServer: c
|
|
1118
|
+
}), g = ai(h);
|
|
1119
|
+
return this.config.api.lastRoundId = g.contract.roundId, g;
|
|
960
1120
|
}
|
|
961
1121
|
registerFromSdkEvents() {
|
|
962
1122
|
this.on("history", () => {
|
|
963
1123
|
const {
|
|
964
|
-
api: { game:
|
|
965
|
-
ui: { language:
|
|
966
|
-
} = this.config,
|
|
967
|
-
|
|
1124
|
+
api: { game: t, integration: n, integrationData: a, jurisdiction: c, user: s, gameHistoryUrl: h },
|
|
1125
|
+
ui: { language: g }
|
|
1126
|
+
} = this.config, w = s.replace(/^user_/, "").replace(new RegExp(`_${n}$`), ""), m = new URL(h);
|
|
1127
|
+
m.searchParams.set("gameCode", t), m.searchParams.set("jurisdiction", c), m.searchParams.set("operatorCode", n), m.searchParams.set("token", a.token), m.searchParams.set("username", w), m.searchParams.set("languageCode", g), window.open(m.toString(), "_blank");
|
|
968
1128
|
});
|
|
969
1129
|
}
|
|
970
1130
|
}
|
|
971
|
-
|
|
972
|
-
var
|
|
973
|
-
var
|
|
974
|
-
for (var
|
|
975
|
-
|
|
976
|
-
return e;
|
|
977
|
-
}, Be = function(i) {
|
|
978
|
-
for (var t = {}, e = 0; e < i.length; e++)
|
|
979
|
-
t[i[e].toUpperCase()] = i[e];
|
|
1131
|
+
ve = new WeakMap();
|
|
1132
|
+
var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re = "object", Ye = "string", me = "major", d = "model", o = "name", l = "type", u = "vendor", r = "version", S = "architecture", K = "console", b = "mobile", f = "tablet", I = "smarttv", X = "wearable", Ze = "embedded", ut = "user-agent", et = 500, nt = "brands", G = "formFactor", at = "fullVersionList", J = "platform", st = "platformVersion", Re = "bitness", q = "sec-ch-ua", ci = q + "-full-version-list", di = q + "-arch", li = q + "-" + Re, ui = q + "-form-factor", hi = q + "-" + b, gi = q + "-" + d, Bt = q + "-" + J, wi = Bt + "-version", Ft = [nt, at, b, d, J, st, S, G, Re], T = "browser", B = "cpu", U = "device", F = "engine", P = "os", Y = "result", Ie = "Amazon", he = "Apple", ht = "ASUS", gt = "BlackBerry", Te = "Google", wt = "Huawei", pt = "Lenovo", We = "LG", Le = "Microsoft", bt = "Motorola", Ae = "Samsung", mt = "Sharp", Pe = "Sony", $e = "Xiaomi", je = "Zebra", j = "Mobile ", Q = " Browser", xe = "Chrome", pi = "Edge", ge = "Firefox", we = "Opera", ft = "Facebook", yt = "Sogou", tt = "Windows", bi = typeof window !== V, C = bi && window.navigator ? window.navigator : void 0, N = C && C.userAgentData ? C.userAgentData : void 0, mi = function(i, e) {
|
|
1133
|
+
var t = {};
|
|
1134
|
+
for (var n in i)
|
|
1135
|
+
t[n] = e[n] && e[n].length % 2 === 0 ? e[n].concat(i[n]) : i[n];
|
|
980
1136
|
return t;
|
|
981
|
-
},
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1137
|
+
}, Ne = function(i) {
|
|
1138
|
+
for (var e = {}, t = 0; t < i.length; t++)
|
|
1139
|
+
e[i[t].toUpperCase()] = i[t];
|
|
1140
|
+
return e;
|
|
1141
|
+
}, it = function(i, e) {
|
|
1142
|
+
if (typeof i === re && i.length > 0) {
|
|
1143
|
+
for (var t in i)
|
|
1144
|
+
if (z(i[t]) == z(e))
|
|
985
1145
|
return !0;
|
|
986
1146
|
return !1;
|
|
987
1147
|
}
|
|
988
|
-
return
|
|
989
|
-
},
|
|
990
|
-
for (var
|
|
991
|
-
return /^(browser|cpu|device|engine|os)$/.test(
|
|
992
|
-
},
|
|
993
|
-
return typeof i ===
|
|
994
|
-
},
|
|
1148
|
+
return ce(i) ? z(e).indexOf(z(i)) !== -1 : !1;
|
|
1149
|
+
}, vt = function(i) {
|
|
1150
|
+
for (var e in i)
|
|
1151
|
+
return /^(browser|cpu|device|engine|os)$/.test(e);
|
|
1152
|
+
}, ce = function(i) {
|
|
1153
|
+
return typeof i === Ye;
|
|
1154
|
+
}, Qe = function(i) {
|
|
995
1155
|
if (i) {
|
|
996
|
-
for (var
|
|
997
|
-
if (
|
|
998
|
-
var
|
|
999
|
-
|
|
1156
|
+
for (var e = [], t = W(/\\?\"/g, i).split(","), n = 0; n < t.length; n++)
|
|
1157
|
+
if (t[n].indexOf(";") > -1) {
|
|
1158
|
+
var a = fe(t[n]).split(";v=");
|
|
1159
|
+
e[n] = { brand: a[0], version: a[1] };
|
|
1000
1160
|
} else
|
|
1001
|
-
|
|
1002
|
-
return
|
|
1161
|
+
e[n] = fe(t[n]);
|
|
1162
|
+
return e;
|
|
1003
1163
|
}
|
|
1004
1164
|
}, z = function(i) {
|
|
1005
|
-
return
|
|
1006
|
-
},
|
|
1007
|
-
return
|
|
1165
|
+
return ce(i) ? i.toLowerCase() : i;
|
|
1166
|
+
}, Xe = function(i) {
|
|
1167
|
+
return ce(i) ? W(/[^\d\.]/g, i).split(".")[0] : void 0;
|
|
1008
1168
|
}, _ = function(i) {
|
|
1009
|
-
for (var
|
|
1010
|
-
var
|
|
1011
|
-
typeof
|
|
1169
|
+
for (var e in i) {
|
|
1170
|
+
var t = i[e];
|
|
1171
|
+
typeof t == re && t.length == 2 ? this[t[0]] = t[1] : this[t] = void 0;
|
|
1012
1172
|
}
|
|
1013
1173
|
return this;
|
|
1014
|
-
}, W = function(i,
|
|
1015
|
-
return
|
|
1016
|
-
},
|
|
1174
|
+
}, W = function(i, e) {
|
|
1175
|
+
return ce(e) ? e.replace(i, oe) : e;
|
|
1176
|
+
}, pe = function(i) {
|
|
1017
1177
|
return W(/\\?\"/g, i);
|
|
1018
|
-
},
|
|
1019
|
-
if (
|
|
1020
|
-
return i = W(/^\s\s*/, i), typeof
|
|
1021
|
-
}, Et = function(i,
|
|
1022
|
-
if (!(!i || !
|
|
1023
|
-
for (var
|
|
1024
|
-
var
|
|
1025
|
-
for (
|
|
1026
|
-
if (h =
|
|
1027
|
-
for (c = 0; c <
|
|
1028
|
-
|
|
1029
|
-
|
|
1178
|
+
}, fe = function(i, e) {
|
|
1179
|
+
if (ce(i))
|
|
1180
|
+
return i = W(/^\s\s*/, i), typeof e === V ? i : i.substring(0, et);
|
|
1181
|
+
}, Et = function(i, e) {
|
|
1182
|
+
if (!(!i || !e))
|
|
1183
|
+
for (var t = 0, n, a, c, s, h, g; t < e.length && !h; ) {
|
|
1184
|
+
var w = e[t], m = e[t + 1];
|
|
1185
|
+
for (n = a = 0; n < w.length && !h && w[n]; )
|
|
1186
|
+
if (h = w[n++].exec(i), h)
|
|
1187
|
+
for (c = 0; c < m.length; c++)
|
|
1188
|
+
g = h[++a], s = m[c], typeof s === re && s.length > 0 ? s.length === 2 ? typeof s[1] == Je ? this[s[0]] = s[1].call(this, g) : this[s[0]] = s[1] : s.length === 3 ? typeof s[1] === Je && !(s[1].exec && s[1].test) ? this[s[0]] = g ? s[1].call(this, g, s[2]) : void 0 : this[s[0]] = g ? g.replace(s[1], s[2]) : void 0 : s.length === 4 && (this[s[0]] = g ? s[3].call(this, g.replace(s[1], s[2])) : void 0) : this[s] = g || void 0;
|
|
1189
|
+
t += 2;
|
|
1030
1190
|
}
|
|
1031
|
-
},
|
|
1032
|
-
for (var
|
|
1033
|
-
if (typeof t
|
|
1034
|
-
for (var
|
|
1035
|
-
if (
|
|
1036
|
-
return
|
|
1037
|
-
} else if (
|
|
1038
|
-
return
|
|
1039
|
-
return
|
|
1040
|
-
},
|
|
1191
|
+
}, Be = function(i, e) {
|
|
1192
|
+
for (var t in e)
|
|
1193
|
+
if (typeof e[t] === re && e[t].length > 0) {
|
|
1194
|
+
for (var n = 0; n < e[t].length; n++)
|
|
1195
|
+
if (it(e[t][n], i))
|
|
1196
|
+
return t === lt ? void 0 : t;
|
|
1197
|
+
} else if (it(e[t], i))
|
|
1198
|
+
return t === lt ? void 0 : t;
|
|
1199
|
+
return e.hasOwnProperty("*") ? e["*"] : i;
|
|
1200
|
+
}, kt = {
|
|
1041
1201
|
ME: "4.90",
|
|
1042
1202
|
"NT 3.11": "NT3.51",
|
|
1043
1203
|
"NT 4.0": "NT4.0",
|
|
@@ -1049,7 +1209,7 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1049
1209
|
"8.1": "NT 6.3",
|
|
1050
1210
|
10: ["NT 6.4", "NT 10.0"],
|
|
1051
1211
|
RT: "ARM"
|
|
1052
|
-
},
|
|
1212
|
+
}, Mt = {
|
|
1053
1213
|
embedded: "Automotive",
|
|
1054
1214
|
mobile: "Mobile",
|
|
1055
1215
|
tablet: ["Tablet", "EInk"],
|
|
@@ -1152,7 +1312,7 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1152
1312
|
/slbrowser\/([\w\.]+)/i
|
|
1153
1313
|
// Smart Lenovo Browser
|
|
1154
1314
|
],
|
|
1155
|
-
[r, [o, "Smart " +
|
|
1315
|
+
[r, [o, "Smart " + pt + Q]],
|
|
1156
1316
|
[
|
|
1157
1317
|
/(avast|avg)\/([\w\.]+)/i
|
|
1158
1318
|
// Avast/AVG Secure Browser
|
|
@@ -1207,7 +1367,7 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1207
1367
|
/samsungbrowser\/([\w\.]+)/i
|
|
1208
1368
|
// Samsung Internet
|
|
1209
1369
|
],
|
|
1210
|
-
[r, [o,
|
|
1370
|
+
[r, [o, Ae + " Internet"]],
|
|
1211
1371
|
[
|
|
1212
1372
|
/(comodo_dragon)\/([\w\.]+)/i
|
|
1213
1373
|
// Comodo Dragon
|
|
@@ -1217,12 +1377,12 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1217
1377
|
/metasr[\/ ]?([\d\.]+)/i
|
|
1218
1378
|
// Sogou Explorer
|
|
1219
1379
|
],
|
|
1220
|
-
[r, [o,
|
|
1380
|
+
[r, [o, yt + " Explorer"]],
|
|
1221
1381
|
[
|
|
1222
1382
|
/(sogou)mo\w+\/([\d\.]+)/i
|
|
1223
1383
|
// Sogou Mobile
|
|
1224
1384
|
],
|
|
1225
|
-
[[o,
|
|
1385
|
+
[[o, yt + " Mobile"], r],
|
|
1226
1386
|
[
|
|
1227
1387
|
/(electron)\/([\w\.]+) safari/i,
|
|
1228
1388
|
// Electron-based App
|
|
@@ -1276,12 +1436,12 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1276
1436
|
/headlesschrome(?:\/([\w\.]+)| )/i
|
|
1277
1437
|
// Chrome Headless
|
|
1278
1438
|
],
|
|
1279
|
-
[r, [o,
|
|
1439
|
+
[r, [o, xe + " Headless"]],
|
|
1280
1440
|
[
|
|
1281
1441
|
/ wv\).+(chrome)\/([\w\.]+)/i
|
|
1282
1442
|
// Chrome WebView
|
|
1283
1443
|
],
|
|
1284
|
-
[[o,
|
|
1444
|
+
[[o, xe + " WebView"], r],
|
|
1285
1445
|
[
|
|
1286
1446
|
/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
|
|
1287
1447
|
// Android Browser
|
|
@@ -1362,51 +1522,51 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1362
1522
|
/(cobalt)\/([\w\.]+)/i
|
|
1363
1523
|
// Cobalt
|
|
1364
1524
|
],
|
|
1365
|
-
[o, [r, /[^\d\.]+./,
|
|
1525
|
+
[o, [r, /[^\d\.]+./, oe]]
|
|
1366
1526
|
],
|
|
1367
1527
|
cpu: [
|
|
1368
1528
|
[
|
|
1369
1529
|
/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i
|
|
1370
1530
|
// AMD64 (x64)
|
|
1371
1531
|
],
|
|
1372
|
-
[[
|
|
1532
|
+
[[S, "amd64"]],
|
|
1373
1533
|
[
|
|
1374
1534
|
/(ia32(?=;))/i,
|
|
1375
1535
|
// IA32 (quicktime)
|
|
1376
1536
|
/((?:i[346]|x)86)[;\)]/i
|
|
1377
1537
|
// IA32 (x86)
|
|
1378
1538
|
],
|
|
1379
|
-
[[
|
|
1539
|
+
[[S, "ia32"]],
|
|
1380
1540
|
[
|
|
1381
1541
|
/\b(aarch64|arm(v?8e?l?|_?64))\b/i
|
|
1382
1542
|
// ARM64
|
|
1383
1543
|
],
|
|
1384
|
-
[[
|
|
1544
|
+
[[S, "arm64"]],
|
|
1385
1545
|
[
|
|
1386
1546
|
/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
|
|
1387
1547
|
// ARMHF
|
|
1388
1548
|
],
|
|
1389
|
-
[[
|
|
1549
|
+
[[S, "armhf"]],
|
|
1390
1550
|
[
|
|
1391
1551
|
// PocketPC mistakenly identified as PowerPC
|
|
1392
1552
|
/windows (ce|mobile); ppc;/i
|
|
1393
1553
|
],
|
|
1394
|
-
[[
|
|
1554
|
+
[[S, "arm"]],
|
|
1395
1555
|
[
|
|
1396
1556
|
/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
|
|
1397
1557
|
// PowerPC
|
|
1398
1558
|
],
|
|
1399
|
-
[[
|
|
1559
|
+
[[S, /ower/, oe, z]],
|
|
1400
1560
|
[
|
|
1401
1561
|
/(sun4\w)[;\)]/i
|
|
1402
1562
|
// SPARC
|
|
1403
1563
|
],
|
|
1404
|
-
[[
|
|
1564
|
+
[[S, "sparc"]],
|
|
1405
1565
|
[
|
|
1406
1566
|
/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
|
|
1407
1567
|
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
|
|
1408
1568
|
],
|
|
1409
|
-
[[
|
|
1569
|
+
[[S, z]]
|
|
1410
1570
|
],
|
|
1411
1571
|
device: [
|
|
1412
1572
|
[
|
|
@@ -1416,45 +1576,45 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1416
1576
|
// Samsung
|
|
1417
1577
|
/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
|
|
1418
1578
|
],
|
|
1419
|
-
[d, [u,
|
|
1579
|
+
[d, [u, Ae], [l, f]],
|
|
1420
1580
|
[
|
|
1421
1581
|
/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
|
|
1422
1582
|
/samsung[- ]([-\w]+)/i,
|
|
1423
1583
|
/sec-(sgh\w+)/i
|
|
1424
1584
|
],
|
|
1425
|
-
[d, [u,
|
|
1585
|
+
[d, [u, Ae], [l, b]],
|
|
1426
1586
|
[
|
|
1427
1587
|
// Apple
|
|
1428
1588
|
/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
|
|
1429
1589
|
// iPod/iPhone
|
|
1430
1590
|
],
|
|
1431
|
-
[d, [u,
|
|
1591
|
+
[d, [u, he], [l, b]],
|
|
1432
1592
|
[
|
|
1433
1593
|
/\((ipad);[-\w\),; ]+apple/i,
|
|
1434
1594
|
// iPad
|
|
1435
1595
|
/applecoremedia\/[\w\.]+ \((ipad)/i,
|
|
1436
1596
|
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
|
|
1437
1597
|
],
|
|
1438
|
-
[d, [u,
|
|
1598
|
+
[d, [u, he], [l, f]],
|
|
1439
1599
|
[
|
|
1440
1600
|
/(macintosh);/i
|
|
1441
1601
|
],
|
|
1442
|
-
[d, [u,
|
|
1602
|
+
[d, [u, he]],
|
|
1443
1603
|
[
|
|
1444
1604
|
// Sharp
|
|
1445
1605
|
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i
|
|
1446
1606
|
],
|
|
1447
|
-
[d, [u, mt], [l,
|
|
1607
|
+
[d, [u, mt], [l, b]],
|
|
1448
1608
|
[
|
|
1449
1609
|
// Huawei
|
|
1450
1610
|
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
|
|
1451
1611
|
],
|
|
1452
|
-
[d, [u,
|
|
1612
|
+
[d, [u, wt], [l, f]],
|
|
1453
1613
|
[
|
|
1454
1614
|
/(?:huawei|honor)([-\w ]+)[;\)]/i,
|
|
1455
1615
|
/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
|
|
1456
1616
|
],
|
|
1457
|
-
[d, [u,
|
|
1617
|
+
[d, [u, wt], [l, b]],
|
|
1458
1618
|
[
|
|
1459
1619
|
// Xiaomi
|
|
1460
1620
|
/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
|
|
@@ -1470,92 +1630,92 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1470
1630
|
/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
|
|
1471
1631
|
// Xiaomi Mi
|
|
1472
1632
|
],
|
|
1473
|
-
[[d, /_/g, " "], [u,
|
|
1633
|
+
[[d, /_/g, " "], [u, $e], [l, b]],
|
|
1474
1634
|
[
|
|
1475
1635
|
/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
|
|
1476
1636
|
// Redmi Pad
|
|
1477
1637
|
/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
|
|
1478
1638
|
// Mi Pad tablets
|
|
1479
1639
|
],
|
|
1480
|
-
[[d, /_/g, " "], [u,
|
|
1640
|
+
[[d, /_/g, " "], [u, $e], [l, f]],
|
|
1481
1641
|
[
|
|
1482
1642
|
// OPPO
|
|
1483
1643
|
/; (\w+) bui.+ oppo/i,
|
|
1484
1644
|
/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
|
|
1485
1645
|
],
|
|
1486
|
-
[d, [u, "OPPO"], [l,
|
|
1646
|
+
[d, [u, "OPPO"], [l, b]],
|
|
1487
1647
|
[
|
|
1488
1648
|
// Vivo
|
|
1489
1649
|
/vivo (\w+)(?: bui|\))/i,
|
|
1490
1650
|
/\b(v[12]\d{3}\w?[at])(?: bui|;)/i
|
|
1491
1651
|
],
|
|
1492
|
-
[d, [u, "Vivo"], [l,
|
|
1652
|
+
[d, [u, "Vivo"], [l, b]],
|
|
1493
1653
|
[
|
|
1494
1654
|
// Realme
|
|
1495
1655
|
/\b(rmx[1-3]\d{3})(?: bui|;|\))/i
|
|
1496
1656
|
],
|
|
1497
|
-
[d, [u, "Realme"], [l,
|
|
1657
|
+
[d, [u, "Realme"], [l, b]],
|
|
1498
1658
|
[
|
|
1499
1659
|
// Motorola
|
|
1500
1660
|
/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
|
|
1501
1661
|
/\bmot(?:orola)?[- ](\w*)/i,
|
|
1502
1662
|
/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
|
|
1503
1663
|
],
|
|
1504
|
-
[d, [u,
|
|
1664
|
+
[d, [u, bt], [l, b]],
|
|
1505
1665
|
[
|
|
1506
1666
|
/\b(mz60\d|xoom[2 ]{0,2}) build\//i
|
|
1507
1667
|
],
|
|
1508
|
-
[d, [u,
|
|
1668
|
+
[d, [u, bt], [l, f]],
|
|
1509
1669
|
[
|
|
1510
1670
|
// LG
|
|
1511
1671
|
/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
|
|
1512
1672
|
],
|
|
1513
|
-
[d, [u,
|
|
1673
|
+
[d, [u, We], [l, f]],
|
|
1514
1674
|
[
|
|
1515
1675
|
/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
|
|
1516
1676
|
/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
|
|
1517
1677
|
/\blg-?([\d\w]+) bui/i
|
|
1518
1678
|
],
|
|
1519
|
-
[d, [u,
|
|
1679
|
+
[d, [u, We], [l, b]],
|
|
1520
1680
|
[
|
|
1521
1681
|
// Lenovo
|
|
1522
1682
|
/(ideatab[-\w ]+)/i,
|
|
1523
1683
|
/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
|
|
1524
1684
|
],
|
|
1525
|
-
[d, [u,
|
|
1685
|
+
[d, [u, pt], [l, f]],
|
|
1526
1686
|
[
|
|
1527
1687
|
// Nokia
|
|
1528
1688
|
/(?:maemo|nokia).*(n900|lumia \d+)/i,
|
|
1529
1689
|
/nokia[-_ ]?([-\w\.]*)/i
|
|
1530
1690
|
],
|
|
1531
|
-
[[d, /_/g, " "], [u, "Nokia"], [l,
|
|
1691
|
+
[[d, /_/g, " "], [u, "Nokia"], [l, b]],
|
|
1532
1692
|
[
|
|
1533
1693
|
// Google
|
|
1534
1694
|
/(pixel c)\b/i
|
|
1535
1695
|
// Google Pixel C
|
|
1536
1696
|
],
|
|
1537
|
-
[d, [u,
|
|
1697
|
+
[d, [u, Te], [l, f]],
|
|
1538
1698
|
[
|
|
1539
1699
|
/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
|
|
1540
1700
|
// Google Pixel
|
|
1541
1701
|
],
|
|
1542
|
-
[d, [u,
|
|
1702
|
+
[d, [u, Te], [l, b]],
|
|
1543
1703
|
[
|
|
1544
1704
|
// Sony
|
|
1545
1705
|
/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
|
|
1546
1706
|
],
|
|
1547
|
-
[d, [u,
|
|
1707
|
+
[d, [u, Pe], [l, b]],
|
|
1548
1708
|
[
|
|
1549
1709
|
/sony tablet [ps]/i,
|
|
1550
1710
|
/\b(?:sony)?sgp\w+(?: bui|\))/i
|
|
1551
1711
|
],
|
|
1552
|
-
[[d, "Xperia Tablet"], [u,
|
|
1712
|
+
[[d, "Xperia Tablet"], [u, Pe], [l, f]],
|
|
1553
1713
|
[
|
|
1554
1714
|
// OnePlus
|
|
1555
1715
|
/ (kb2005|in20[12]5|be20[12][59])\b/i,
|
|
1556
1716
|
/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
|
|
1557
1717
|
],
|
|
1558
|
-
[d, [u, "OnePlus"], [l,
|
|
1718
|
+
[d, [u, "OnePlus"], [l, b]],
|
|
1559
1719
|
[
|
|
1560
1720
|
// Amazon
|
|
1561
1721
|
/(alexa)webm/i,
|
|
@@ -1564,39 +1724,39 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1564
1724
|
/(kf[a-z]+)( bui|\)).+silk\//i
|
|
1565
1725
|
// Kindle Fire HD
|
|
1566
1726
|
],
|
|
1567
|
-
[d, [u,
|
|
1727
|
+
[d, [u, Ie], [l, f]],
|
|
1568
1728
|
[
|
|
1569
1729
|
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
|
|
1570
1730
|
// Fire Phone
|
|
1571
1731
|
],
|
|
1572
|
-
[[d, /(.+)/g, "Fire Phone $1"], [u,
|
|
1732
|
+
[[d, /(.+)/g, "Fire Phone $1"], [u, Ie], [l, b]],
|
|
1573
1733
|
[
|
|
1574
1734
|
// BlackBerry
|
|
1575
1735
|
/(playbook);[-\w\),; ]+(rim)/i
|
|
1576
1736
|
// BlackBerry PlayBook
|
|
1577
1737
|
],
|
|
1578
|
-
[d, u, [l,
|
|
1738
|
+
[d, u, [l, f]],
|
|
1579
1739
|
[
|
|
1580
1740
|
/\b((?:bb[a-f]|st[hv])100-\d)/i,
|
|
1581
1741
|
/\(bb10; (\w+)/i
|
|
1582
1742
|
// BlackBerry 10
|
|
1583
1743
|
],
|
|
1584
|
-
[d, [u,
|
|
1744
|
+
[d, [u, gt], [l, b]],
|
|
1585
1745
|
[
|
|
1586
1746
|
// Asus
|
|
1587
1747
|
/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
|
|
1588
1748
|
],
|
|
1589
|
-
[d, [u,
|
|
1749
|
+
[d, [u, ht], [l, f]],
|
|
1590
1750
|
[
|
|
1591
1751
|
/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
|
|
1592
1752
|
],
|
|
1593
|
-
[d, [u,
|
|
1753
|
+
[d, [u, ht], [l, b]],
|
|
1594
1754
|
[
|
|
1595
1755
|
// HTC
|
|
1596
1756
|
/(nexus 9)/i
|
|
1597
1757
|
// HTC Nexus 9
|
|
1598
1758
|
],
|
|
1599
|
-
[d, [u, "HTC"], [l,
|
|
1759
|
+
[d, [u, "HTC"], [l, f]],
|
|
1600
1760
|
[
|
|
1601
1761
|
/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
|
|
1602
1762
|
// HTC
|
|
@@ -1605,23 +1765,23 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1605
1765
|
/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
|
|
1606
1766
|
// Alcatel/GeeksPhone/Nexian/Panasonic/Sony
|
|
1607
1767
|
],
|
|
1608
|
-
[u, [d, /_/g, " "], [l,
|
|
1768
|
+
[u, [d, /_/g, " "], [l, b]],
|
|
1609
1769
|
[
|
|
1610
1770
|
// Acer
|
|
1611
1771
|
/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
|
|
1612
1772
|
],
|
|
1613
|
-
[d, [u, "Acer"], [l,
|
|
1773
|
+
[d, [u, "Acer"], [l, f]],
|
|
1614
1774
|
[
|
|
1615
1775
|
// Meizu
|
|
1616
1776
|
/droid.+; (m[1-5] note) bui/i,
|
|
1617
1777
|
/\bmz-([-\w]{2,})/i
|
|
1618
1778
|
],
|
|
1619
|
-
[d, [u, "Meizu"], [l,
|
|
1779
|
+
[d, [u, "Meizu"], [l, b]],
|
|
1620
1780
|
[
|
|
1621
1781
|
// Ulefone
|
|
1622
1782
|
/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
|
|
1623
1783
|
],
|
|
1624
|
-
[d, [u, "Ulefone"], [l,
|
|
1784
|
+
[d, [u, "Ulefone"], [l, b]],
|
|
1625
1785
|
[
|
|
1626
1786
|
// MIXED
|
|
1627
1787
|
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
|
|
@@ -1639,7 +1799,7 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1639
1799
|
/(oppo) ?([\w ]+) bui/i
|
|
1640
1800
|
// OPPO
|
|
1641
1801
|
],
|
|
1642
|
-
[u, d, [l,
|
|
1802
|
+
[u, d, [l, b]],
|
|
1643
1803
|
[
|
|
1644
1804
|
/(kobo)\s(ereader|touch)/i,
|
|
1645
1805
|
// Kobo
|
|
@@ -1650,41 +1810,41 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1650
1810
|
/(kindle)\/([\w\.]+)/i
|
|
1651
1811
|
// Kindle
|
|
1652
1812
|
],
|
|
1653
|
-
[u, d, [l,
|
|
1813
|
+
[u, d, [l, f]],
|
|
1654
1814
|
[
|
|
1655
1815
|
/(surface duo)/i
|
|
1656
1816
|
// Surface Duo
|
|
1657
1817
|
],
|
|
1658
|
-
[d, [u,
|
|
1818
|
+
[d, [u, Le], [l, f]],
|
|
1659
1819
|
[
|
|
1660
1820
|
/droid [\d\.]+; (fp\du?)(?: b|\))/i
|
|
1661
1821
|
// Fairphone
|
|
1662
1822
|
],
|
|
1663
|
-
[d, [u, "Fairphone"], [l,
|
|
1823
|
+
[d, [u, "Fairphone"], [l, b]],
|
|
1664
1824
|
[
|
|
1665
1825
|
/(shield[\w ]+) b/i
|
|
1666
1826
|
// Nvidia Shield Tablets
|
|
1667
1827
|
],
|
|
1668
|
-
[d, [u, "Nvidia"], [l,
|
|
1828
|
+
[d, [u, "Nvidia"], [l, f]],
|
|
1669
1829
|
[
|
|
1670
1830
|
/(sprint) (\w+)/i
|
|
1671
1831
|
// Sprint Phones
|
|
1672
1832
|
],
|
|
1673
|
-
[u, d, [l,
|
|
1833
|
+
[u, d, [l, b]],
|
|
1674
1834
|
[
|
|
1675
1835
|
/(kin\.[onetw]{3})/i
|
|
1676
1836
|
// Microsoft Kin
|
|
1677
1837
|
],
|
|
1678
|
-
[[d, /\./g, " "], [u,
|
|
1838
|
+
[[d, /\./g, " "], [u, Le], [l, b]],
|
|
1679
1839
|
[
|
|
1680
1840
|
/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
|
|
1681
1841
|
// Zebra
|
|
1682
1842
|
],
|
|
1683
|
-
[d, [u,
|
|
1843
|
+
[d, [u, je], [l, f]],
|
|
1684
1844
|
[
|
|
1685
1845
|
/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
|
|
1686
1846
|
],
|
|
1687
|
-
[d, [u,
|
|
1847
|
+
[d, [u, je], [l, b]],
|
|
1688
1848
|
[
|
|
1689
1849
|
///////////////////
|
|
1690
1850
|
// SMARTTVS
|
|
@@ -1696,27 +1856,27 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1696
1856
|
[
|
|
1697
1857
|
/hbbtv.+maple;(\d+)/i
|
|
1698
1858
|
],
|
|
1699
|
-
[[d, /^/, "SmartTV"], [u,
|
|
1859
|
+
[[d, /^/, "SmartTV"], [u, Ae], [l, I]],
|
|
1700
1860
|
[
|
|
1701
1861
|
/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
|
|
1702
1862
|
// LG SmartTV
|
|
1703
1863
|
],
|
|
1704
|
-
[[u,
|
|
1864
|
+
[[u, We], [l, I]],
|
|
1705
1865
|
[
|
|
1706
1866
|
/(apple) ?tv/i
|
|
1707
1867
|
// Apple TV
|
|
1708
1868
|
],
|
|
1709
|
-
[u, [d,
|
|
1869
|
+
[u, [d, he + " TV"], [l, I]],
|
|
1710
1870
|
[
|
|
1711
1871
|
/crkey/i
|
|
1712
1872
|
// Google Chromecast
|
|
1713
1873
|
],
|
|
1714
|
-
[[d,
|
|
1874
|
+
[[d, xe + "cast"], [u, Te], [l, I]],
|
|
1715
1875
|
[
|
|
1716
1876
|
/droid.+aft(\w+)( bui|\))/i
|
|
1717
1877
|
// Fire TV
|
|
1718
1878
|
],
|
|
1719
|
-
[d, [u,
|
|
1879
|
+
[d, [u, Ie], [l, I]],
|
|
1720
1880
|
[
|
|
1721
1881
|
/\(dtv[\);].+(aquos)/i,
|
|
1722
1882
|
/(aquos-tv[\w ]+)\)/i
|
|
@@ -1727,12 +1887,12 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1727
1887
|
/(bravia[\w ]+)( bui|\))/i
|
|
1728
1888
|
// Sony
|
|
1729
1889
|
],
|
|
1730
|
-
[d, [u,
|
|
1890
|
+
[d, [u, Pe], [l, I]],
|
|
1731
1891
|
[
|
|
1732
1892
|
/(mitv-\w{5}) bui/i
|
|
1733
1893
|
// Xiaomi
|
|
1734
1894
|
],
|
|
1735
|
-
[d, [u,
|
|
1895
|
+
[d, [u, $e], [l, I]],
|
|
1736
1896
|
[
|
|
1737
1897
|
/Hbbtv.*(technisat) (.*);/i
|
|
1738
1898
|
// TechniSAT
|
|
@@ -1744,7 +1904,7 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1744
1904
|
/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
|
|
1745
1905
|
// HbbTV devices
|
|
1746
1906
|
],
|
|
1747
|
-
[[u,
|
|
1907
|
+
[[u, fe], [d, fe], [l, I]],
|
|
1748
1908
|
[
|
|
1749
1909
|
/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
|
|
1750
1910
|
// SmartTV from Unidentified Vendors
|
|
@@ -1769,12 +1929,12 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1769
1929
|
/(playstation \w+)/i
|
|
1770
1930
|
// Playstation
|
|
1771
1931
|
],
|
|
1772
|
-
[d, [u,
|
|
1932
|
+
[d, [u, Pe], [l, K]],
|
|
1773
1933
|
[
|
|
1774
1934
|
/\b(xbox(?: one)?(?!; xbox))[\); ]/i
|
|
1775
1935
|
// Microsoft Xbox
|
|
1776
1936
|
],
|
|
1777
|
-
[d, [u,
|
|
1937
|
+
[d, [u, Le], [l, K]],
|
|
1778
1938
|
[
|
|
1779
1939
|
///////////////////
|
|
1780
1940
|
// WEARABLES
|
|
@@ -1787,16 +1947,16 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1787
1947
|
/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
|
|
1788
1948
|
// Apple Watch
|
|
1789
1949
|
],
|
|
1790
|
-
[d, [u,
|
|
1950
|
+
[d, [u, he], [l, X]],
|
|
1791
1951
|
[
|
|
1792
1952
|
/droid.+; (glass) \d/i
|
|
1793
1953
|
// Google Glass
|
|
1794
1954
|
],
|
|
1795
|
-
[d, [u,
|
|
1955
|
+
[d, [u, Te], [l, X]],
|
|
1796
1956
|
[
|
|
1797
1957
|
/droid.+; (wt63?0{2,3})\)/i
|
|
1798
1958
|
],
|
|
1799
|
-
[d, [u,
|
|
1959
|
+
[d, [u, je], [l, X]],
|
|
1800
1960
|
[
|
|
1801
1961
|
/(quest( 2| pro)?)/i
|
|
1802
1962
|
// Oculus Quest
|
|
@@ -1809,12 +1969,12 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1809
1969
|
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
|
|
1810
1970
|
// Tesla
|
|
1811
1971
|
],
|
|
1812
|
-
[u, [l,
|
|
1972
|
+
[u, [l, Ze]],
|
|
1813
1973
|
[
|
|
1814
1974
|
/(aeobc)\b/i
|
|
1815
1975
|
// Echo Dot
|
|
1816
1976
|
],
|
|
1817
|
-
[d, [u,
|
|
1977
|
+
[d, [u, Ie], [l, Ze]],
|
|
1818
1978
|
[
|
|
1819
1979
|
////////////////////
|
|
1820
1980
|
// MIXED (GENERIC)
|
|
@@ -1822,22 +1982,22 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1822
1982
|
/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
|
|
1823
1983
|
// Android Phones from Unidentified Vendors
|
|
1824
1984
|
],
|
|
1825
|
-
[d, [l,
|
|
1985
|
+
[d, [l, b]],
|
|
1826
1986
|
[
|
|
1827
1987
|
/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
|
|
1828
1988
|
// Android Tablets from Unidentified Vendors
|
|
1829
1989
|
],
|
|
1830
|
-
[d, [l,
|
|
1990
|
+
[d, [l, f]],
|
|
1831
1991
|
[
|
|
1832
1992
|
/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
|
|
1833
1993
|
// Unidentifiable Tablet
|
|
1834
1994
|
],
|
|
1835
|
-
[[l,
|
|
1995
|
+
[[l, f]],
|
|
1836
1996
|
[
|
|
1837
1997
|
/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
|
|
1838
1998
|
// Unidentifiable Mobile
|
|
1839
1999
|
],
|
|
1840
|
-
[[l,
|
|
2000
|
+
[[l, b]],
|
|
1841
2001
|
[
|
|
1842
2002
|
/(android[-\w\. ]{0,9});.+buil/i
|
|
1843
2003
|
// Generic Android Device
|
|
@@ -1849,7 +2009,7 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1849
2009
|
/windows.+ edge\/([\w\.]+)/i
|
|
1850
2010
|
// EdgeHTML
|
|
1851
2011
|
],
|
|
1852
|
-
[r, [o,
|
|
2012
|
+
[r, [o, pi + "HTML"]],
|
|
1853
2013
|
[
|
|
1854
2014
|
/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
|
|
1855
2015
|
// Blink
|
|
@@ -1886,14 +2046,14 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1886
2046
|
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
|
|
1887
2047
|
// Windows Phone
|
|
1888
2048
|
],
|
|
1889
|
-
[o, [r,
|
|
2049
|
+
[o, [r, Be, kt]],
|
|
1890
2050
|
[
|
|
1891
2051
|
/windows nt 6\.2; (arm)/i,
|
|
1892
2052
|
// Windows RT
|
|
1893
2053
|
/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
|
|
1894
2054
|
/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
|
|
1895
2055
|
],
|
|
1896
|
-
[[r,
|
|
2056
|
+
[[r, Be, kt], [o, tt]],
|
|
1897
2057
|
[
|
|
1898
2058
|
// iOS/macOS
|
|
1899
2059
|
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
|
|
@@ -1929,7 +2089,7 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1929
2089
|
/\(bb(10);/i
|
|
1930
2090
|
// BlackBerry 10
|
|
1931
2091
|
],
|
|
1932
|
-
[r, [o,
|
|
2092
|
+
[r, [o, gt]],
|
|
1933
2093
|
[
|
|
1934
2094
|
/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
|
|
1935
2095
|
// Symbian
|
|
@@ -1956,7 +2116,7 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
1956
2116
|
/crkey\/([\d\.]+)/i
|
|
1957
2117
|
// Google Chromecast
|
|
1958
2118
|
],
|
|
1959
|
-
[r, [o,
|
|
2119
|
+
[r, [o, xe + "cast"]],
|
|
1960
2120
|
[
|
|
1961
2121
|
/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
|
|
1962
2122
|
// Chromium OS
|
|
@@ -2011,253 +2171,253 @@ var oi = "2.0.0-beta.2", re = "", dt = "?", Ke = "function", H = "undefined", ce
|
|
|
2011
2171
|
],
|
|
2012
2172
|
[o, r]
|
|
2013
2173
|
]
|
|
2014
|
-
},
|
|
2174
|
+
}, Ue = function() {
|
|
2015
2175
|
var i = { init: {}, isIgnore: {}, isIgnoreRgx: {}, toString: {} };
|
|
2016
2176
|
return _.call(i.init, [
|
|
2017
|
-
[T, [o, r,
|
|
2018
|
-
[
|
|
2019
|
-
[
|
|
2020
|
-
[
|
|
2021
|
-
[
|
|
2177
|
+
[T, [o, r, me]],
|
|
2178
|
+
[B, [S]],
|
|
2179
|
+
[U, [l, d, u]],
|
|
2180
|
+
[F, [o, r]],
|
|
2181
|
+
[P, [o, r]]
|
|
2022
2182
|
]), _.call(i.isIgnore, [
|
|
2023
|
-
[T, [r,
|
|
2024
|
-
[
|
|
2025
|
-
[
|
|
2183
|
+
[T, [r, me]],
|
|
2184
|
+
[F, [r]],
|
|
2185
|
+
[P, [r]]
|
|
2026
2186
|
]), _.call(i.isIgnoreRgx, [
|
|
2027
2187
|
[T, / ?browser$/i],
|
|
2028
|
-
[
|
|
2188
|
+
[P, / ?os$/i]
|
|
2029
2189
|
]), _.call(i.toString, [
|
|
2030
2190
|
[T, [o, r]],
|
|
2031
|
-
[
|
|
2032
|
-
[
|
|
2033
|
-
[
|
|
2034
|
-
[
|
|
2191
|
+
[B, [S]],
|
|
2192
|
+
[U, [u, d]],
|
|
2193
|
+
[F, [o, r]],
|
|
2194
|
+
[P, [o, r]]
|
|
2035
2195
|
]), i;
|
|
2036
|
-
}(), fi = function(i,
|
|
2037
|
-
var
|
|
2038
|
-
function
|
|
2039
|
-
_.call(this,
|
|
2196
|
+
}(), fi = function(i, e) {
|
|
2197
|
+
var t = Ue.init[e], n = Ue.isIgnore[e] || 0, a = Ue.isIgnoreRgx[e] || 0, c = Ue.toString[e] || 0;
|
|
2198
|
+
function s() {
|
|
2199
|
+
_.call(this, t);
|
|
2040
2200
|
}
|
|
2041
|
-
return
|
|
2201
|
+
return s.prototype.getItem = function() {
|
|
2042
2202
|
return i;
|
|
2043
|
-
},
|
|
2044
|
-
return
|
|
2045
|
-
return i.setCH(new
|
|
2203
|
+
}, s.prototype.withClientHints = function() {
|
|
2204
|
+
return N ? N.getHighEntropyValues(Ft).then(function(h) {
|
|
2205
|
+
return i.setCH(new _t(h, !1)).parseCH().get();
|
|
2046
2206
|
}) : i.parseCH().get();
|
|
2047
|
-
},
|
|
2207
|
+
}, s.prototype.withFeatureCheck = function() {
|
|
2048
2208
|
return i.detectFeature().get();
|
|
2049
|
-
},
|
|
2050
|
-
var
|
|
2051
|
-
for (var
|
|
2052
|
-
if (this.hasOwnProperty(
|
|
2053
|
-
if (
|
|
2209
|
+
}, e != Y && (s.prototype.is = function(h) {
|
|
2210
|
+
var g = !1;
|
|
2211
|
+
for (var w in this)
|
|
2212
|
+
if (this.hasOwnProperty(w) && !it(n, w) && z(a ? W(a, this[w]) : this[w]) == z(a ? W(a, h) : h)) {
|
|
2213
|
+
if (g = !0, h != V)
|
|
2054
2214
|
break;
|
|
2055
|
-
} else if (h ==
|
|
2056
|
-
|
|
2215
|
+
} else if (h == V && g) {
|
|
2216
|
+
g = !g;
|
|
2057
2217
|
break;
|
|
2058
2218
|
}
|
|
2059
|
-
return
|
|
2060
|
-
},
|
|
2061
|
-
var h =
|
|
2062
|
-
for (var
|
|
2063
|
-
typeof this[c[
|
|
2064
|
-
return h ||
|
|
2065
|
-
}),
|
|
2066
|
-
var
|
|
2067
|
-
for (var A in
|
|
2068
|
-
|
|
2219
|
+
return g;
|
|
2220
|
+
}, s.prototype.toString = function() {
|
|
2221
|
+
var h = oe;
|
|
2222
|
+
for (var g in c)
|
|
2223
|
+
typeof this[c[g]] !== V && (h += (h ? " " : oe) + this[c[g]]);
|
|
2224
|
+
return h || V;
|
|
2225
|
+
}), N || (s.prototype.then = function(h) {
|
|
2226
|
+
var g = this, w = function() {
|
|
2227
|
+
for (var A in g)
|
|
2228
|
+
g.hasOwnProperty(A) && (this[A] = g[A]);
|
|
2069
2229
|
};
|
|
2070
|
-
|
|
2071
|
-
is:
|
|
2072
|
-
toString:
|
|
2230
|
+
w.prototype = {
|
|
2231
|
+
is: s.prototype.is,
|
|
2232
|
+
toString: s.prototype.toString
|
|
2073
2233
|
};
|
|
2074
|
-
var
|
|
2075
|
-
return h(
|
|
2076
|
-
}), new
|
|
2234
|
+
var m = new w();
|
|
2235
|
+
return h(m), m;
|
|
2236
|
+
}), new s();
|
|
2077
2237
|
};
|
|
2078
|
-
function
|
|
2079
|
-
if (i = i || {}, _.call(this,
|
|
2238
|
+
function _t(i, e) {
|
|
2239
|
+
if (i = i || {}, _.call(this, Ft), e)
|
|
2080
2240
|
_.call(this, [
|
|
2081
|
-
[
|
|
2082
|
-
[
|
|
2083
|
-
[
|
|
2084
|
-
[d,
|
|
2085
|
-
[J,
|
|
2086
|
-
[
|
|
2087
|
-
[
|
|
2088
|
-
[
|
|
2089
|
-
[
|
|
2241
|
+
[nt, Qe(i[q])],
|
|
2242
|
+
[at, Qe(i[ci])],
|
|
2243
|
+
[b, /\?1/.test(i[hi])],
|
|
2244
|
+
[d, pe(i[gi])],
|
|
2245
|
+
[J, pe(i[Bt])],
|
|
2246
|
+
[st, pe(i[wi])],
|
|
2247
|
+
[S, pe(i[di])],
|
|
2248
|
+
[G, Qe(i[ui])],
|
|
2249
|
+
[Re, pe(i[li])]
|
|
2090
2250
|
]);
|
|
2091
2251
|
else
|
|
2092
|
-
for (var
|
|
2093
|
-
this.hasOwnProperty(
|
|
2252
|
+
for (var t in i)
|
|
2253
|
+
this.hasOwnProperty(t) && typeof i[t] !== V && (this[t] = i[t]);
|
|
2094
2254
|
}
|
|
2095
|
-
function
|
|
2096
|
-
return this.get = function(
|
|
2097
|
-
return
|
|
2098
|
-
}, this.set = function(
|
|
2099
|
-
return this.data[
|
|
2100
|
-
}, this.setCH = function(
|
|
2101
|
-
return this.uaCH =
|
|
2255
|
+
function Ct(i, e, t, n) {
|
|
2256
|
+
return this.get = function(a) {
|
|
2257
|
+
return a ? this.data.hasOwnProperty(a) ? this.data[a] : void 0 : this.data;
|
|
2258
|
+
}, this.set = function(a, c) {
|
|
2259
|
+
return this.data[a] = c, this;
|
|
2260
|
+
}, this.setCH = function(a) {
|
|
2261
|
+
return this.uaCH = a, this;
|
|
2102
2262
|
}, this.detectFeature = function() {
|
|
2103
2263
|
if (C && C.userAgent == this.ua)
|
|
2104
2264
|
switch (this.itemType) {
|
|
2105
2265
|
case T:
|
|
2106
|
-
C.brave && typeof C.brave.isBrave ==
|
|
2266
|
+
C.brave && typeof C.brave.isBrave == Je && this.set(o, "Brave");
|
|
2107
2267
|
break;
|
|
2108
|
-
case
|
|
2109
|
-
!this.get(l) &&
|
|
2268
|
+
case U:
|
|
2269
|
+
!this.get(l) && N && N[b] && this.set(l, b), this.get(d) == "Macintosh" && C && typeof C.standalone !== V && C.maxTouchPoints && C.maxTouchPoints > 2 && this.set(d, "iPad").set(l, f);
|
|
2110
2270
|
break;
|
|
2111
|
-
case
|
|
2112
|
-
!this.get(o) &&
|
|
2271
|
+
case P:
|
|
2272
|
+
!this.get(o) && N && N[J] && this.set(o, N[J]);
|
|
2113
2273
|
break;
|
|
2114
2274
|
case Y:
|
|
2115
|
-
var
|
|
2116
|
-
return
|
|
2275
|
+
var a = this.data, c = function(s) {
|
|
2276
|
+
return a[s].getItem().detectFeature().get();
|
|
2117
2277
|
};
|
|
2118
|
-
this.set(T, c(T)).set(
|
|
2278
|
+
this.set(T, c(T)).set(B, c(B)).set(U, c(U)).set(F, c(F)).set(P, c(P));
|
|
2119
2279
|
}
|
|
2120
2280
|
return this;
|
|
2121
2281
|
}, this.parseUA = function() {
|
|
2122
|
-
return this.itemType != Y && Et.call(this.data, this.ua, this.rgxMap), this.itemType == T && this.set(
|
|
2282
|
+
return this.itemType != Y && Et.call(this.data, this.ua, this.rgxMap), this.itemType == T && this.set(me, Xe(this.get(r))), this;
|
|
2123
2283
|
}, this.parseCH = function() {
|
|
2124
|
-
var
|
|
2284
|
+
var a = this.uaCH, c = this.rgxMap;
|
|
2125
2285
|
switch (this.itemType) {
|
|
2126
2286
|
case T:
|
|
2127
|
-
var
|
|
2128
|
-
if (
|
|
2129
|
-
for (var
|
|
2130
|
-
var
|
|
2131
|
-
!/not.a.brand/i.test(
|
|
2287
|
+
var s = a[at] || a[nt], h;
|
|
2288
|
+
if (s)
|
|
2289
|
+
for (var g in s) {
|
|
2290
|
+
var w = W(/(Google|Microsoft) /, s[g].brand || s[g]), m = s[g].version;
|
|
2291
|
+
!/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(o, w).set(r, m).set(me, Xe(m)), h = w);
|
|
2132
2292
|
}
|
|
2133
2293
|
break;
|
|
2134
|
-
case
|
|
2135
|
-
var A =
|
|
2136
|
-
A && (A &&
|
|
2294
|
+
case B:
|
|
2295
|
+
var A = a[S];
|
|
2296
|
+
A && (A && a[Re] == "64" && (A += "64"), Et.call(this.data, A + ";", c));
|
|
2137
2297
|
break;
|
|
2138
|
-
case
|
|
2139
|
-
if (
|
|
2140
|
-
var
|
|
2141
|
-
if (typeof
|
|
2142
|
-
for (var
|
|
2143
|
-
|
|
2298
|
+
case U:
|
|
2299
|
+
if (a[b] && this.set(l, b), a[d] && this.set(d, a[d]), a[d] == "Xbox" && this.set(l, K).set(u, Le), a[G]) {
|
|
2300
|
+
var R;
|
|
2301
|
+
if (typeof a[G] != "string")
|
|
2302
|
+
for (var de = 0; !R && de < a[G].length; )
|
|
2303
|
+
R = Be(a[G][de++], Mt);
|
|
2144
2304
|
else
|
|
2145
|
-
|
|
2146
|
-
this.set(l,
|
|
2305
|
+
R = Be(a[G], Mt);
|
|
2306
|
+
this.set(l, R);
|
|
2147
2307
|
}
|
|
2148
2308
|
break;
|
|
2149
|
-
case
|
|
2150
|
-
var le =
|
|
2309
|
+
case P:
|
|
2310
|
+
var le = a[J];
|
|
2151
2311
|
if (le) {
|
|
2152
|
-
var
|
|
2153
|
-
le ==
|
|
2312
|
+
var L = a[st];
|
|
2313
|
+
le == tt && (L = parseInt(Xe(L), 10) >= 13 ? "11" : "10"), this.set(o, le).set(r, L);
|
|
2154
2314
|
}
|
|
2155
|
-
this.get(o) ==
|
|
2315
|
+
this.get(o) == tt && a[d] == "Xbox" && this.set(o, "Xbox").set(r, void 0);
|
|
2156
2316
|
break;
|
|
2157
2317
|
case Y:
|
|
2158
|
-
var
|
|
2159
|
-
return
|
|
2318
|
+
var Se = this.data, x = function(Rt) {
|
|
2319
|
+
return Se[Rt].getItem().setCH(a).parseCH().get();
|
|
2160
2320
|
};
|
|
2161
|
-
this.set(T,
|
|
2321
|
+
this.set(T, x(T)).set(B, x(B)).set(U, x(U)).set(F, x(F)).set(P, x(P));
|
|
2162
2322
|
}
|
|
2163
2323
|
return this;
|
|
2164
2324
|
}, _.call(this, [
|
|
2165
2325
|
["itemType", i],
|
|
2166
|
-
["ua",
|
|
2167
|
-
["uaCH",
|
|
2168
|
-
["rgxMap",
|
|
2326
|
+
["ua", e],
|
|
2327
|
+
["uaCH", n],
|
|
2328
|
+
["rgxMap", t],
|
|
2169
2329
|
["data", fi(this, i)]
|
|
2170
2330
|
]), this;
|
|
2171
2331
|
}
|
|
2172
|
-
function
|
|
2173
|
-
if (typeof i ===
|
|
2174
|
-
return new
|
|
2175
|
-
var
|
|
2332
|
+
function D(i, e, t) {
|
|
2333
|
+
if (typeof i === re ? (vt(i) ? (typeof e === re && (t = e), e = i) : (t = i, e = void 0), i = void 0) : typeof i === Ye && !vt(e) && (t = e, e = void 0), !(this instanceof D))
|
|
2334
|
+
return new D(i, e, t).getResult();
|
|
2335
|
+
var n = typeof i === Ye ? i : (
|
|
2176
2336
|
// Passed user-agent string
|
|
2177
2337
|
C && C.userAgent ? C.userAgent : (
|
|
2178
2338
|
// navigator.userAgent
|
|
2179
|
-
|
|
2339
|
+
t && t[ut] ? t[ut] : (
|
|
2180
2340
|
// User-Agent from passed headers
|
|
2181
|
-
|
|
2341
|
+
oe
|
|
2182
2342
|
)
|
|
2183
2343
|
)
|
|
2184
|
-
),
|
|
2344
|
+
), a = new _t(t, !0), c = e ? mi(St, e) : St, s = function(h) {
|
|
2185
2345
|
return h == Y ? function() {
|
|
2186
|
-
return new
|
|
2346
|
+
return new Ct(h, n, c, a).set("ua", n).set(T, this.getBrowser()).set(B, this.getCPU()).set(U, this.getDevice()).set(F, this.getEngine()).set(P, this.getOS()).get();
|
|
2187
2347
|
} : function() {
|
|
2188
|
-
return new
|
|
2348
|
+
return new Ct(h, n, c[h], a).parseUA().get();
|
|
2189
2349
|
};
|
|
2190
2350
|
};
|
|
2191
2351
|
return _.call(this, [
|
|
2192
|
-
["getBrowser",
|
|
2193
|
-
["getCPU",
|
|
2194
|
-
["getDevice",
|
|
2195
|
-
["getEngine",
|
|
2196
|
-
["getOS",
|
|
2197
|
-
["getResult",
|
|
2352
|
+
["getBrowser", s(T)],
|
|
2353
|
+
["getCPU", s(B)],
|
|
2354
|
+
["getDevice", s(U)],
|
|
2355
|
+
["getEngine", s(F)],
|
|
2356
|
+
["getOS", s(P)],
|
|
2357
|
+
["getResult", s(Y)],
|
|
2198
2358
|
["getUA", function() {
|
|
2199
|
-
return
|
|
2359
|
+
return n;
|
|
2200
2360
|
}],
|
|
2201
2361
|
["setUA", function(h) {
|
|
2202
|
-
return
|
|
2362
|
+
return ce(h) && (n = h.length > et ? fe(h, et) : h), this;
|
|
2203
2363
|
}]
|
|
2204
|
-
]).setUA(
|
|
2364
|
+
]).setUA(n), this;
|
|
2205
2365
|
}
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
class
|
|
2212
|
-
constructor(
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
this.trackers =
|
|
2216
|
-
}
|
|
2217
|
-
on(
|
|
2218
|
-
const
|
|
2219
|
-
|
|
2366
|
+
D.VERSION = ri;
|
|
2367
|
+
D.BROWSER = Ne([o, r, me]);
|
|
2368
|
+
D.CPU = Ne([S]);
|
|
2369
|
+
D.DEVICE = Ne([d, u, l, K, b, I, f, X, Ze]);
|
|
2370
|
+
D.ENGINE = D.OS = Ne([o, r]);
|
|
2371
|
+
class yi {
|
|
2372
|
+
constructor(e, t) {
|
|
2373
|
+
p(this, "trackers");
|
|
2374
|
+
p(this, "config");
|
|
2375
|
+
this.trackers = e, this.config = t;
|
|
2376
|
+
}
|
|
2377
|
+
on(e, t, n) {
|
|
2378
|
+
const a = function(s) {
|
|
2379
|
+
s.data.message !== `kalamba:wrapper-telemetry:${e}` && s.data.message !== `kalamba:wrapper:${e}` || t(s.data.payload);
|
|
2220
2380
|
};
|
|
2221
|
-
window.addEventListener("message",
|
|
2381
|
+
window.addEventListener("message", a, n);
|
|
2222
2382
|
}
|
|
2223
|
-
track(
|
|
2224
|
-
this.trackers.forEach((
|
|
2383
|
+
track(e, t) {
|
|
2384
|
+
this.trackers.forEach((n) => n.track(e, t));
|
|
2225
2385
|
}
|
|
2226
2386
|
}
|
|
2227
|
-
function
|
|
2228
|
-
return i.reduce((
|
|
2387
|
+
function It(i) {
|
|
2388
|
+
return i.reduce((e, t) => e + t, 0);
|
|
2229
2389
|
}
|
|
2230
|
-
function
|
|
2231
|
-
const
|
|
2232
|
-
return Math.sqrt(
|
|
2390
|
+
function vi(i) {
|
|
2391
|
+
const e = i.length, t = It(i) / e, n = i.map((c) => Math.pow(c - t, 2)), a = It(n) / e;
|
|
2392
|
+
return Math.sqrt(a);
|
|
2233
2393
|
}
|
|
2234
|
-
class
|
|
2394
|
+
class Tt {
|
|
2235
2395
|
constructor() {
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
const
|
|
2242
|
-
return this.frames.map((
|
|
2396
|
+
p(this, "rafId", -1);
|
|
2397
|
+
p(this, "startTime", 0);
|
|
2398
|
+
p(this, "stopTime", 0);
|
|
2399
|
+
p(this, "frames", []);
|
|
2400
|
+
p(this, "calculateFPS", () => {
|
|
2401
|
+
const e = Math.floor((this.stopTime - this.startTime) / 1e3);
|
|
2402
|
+
return this.frames.map((t) => Math.floor((t - this.startTime) / 1e3)).reduce((t, n, a, c) => (c[a] !== c[a - 1] ? t.push(1) : t[t.length - 1]++, t), []).slice(0, e);
|
|
2243
2403
|
});
|
|
2244
|
-
|
|
2245
|
-
const
|
|
2246
|
-
return { fpsAvg:
|
|
2404
|
+
p(this, "getReport", () => {
|
|
2405
|
+
const e = this.calculateFPS(), t = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), n = e.length > 0 ? Math.max(...e) : t, a = e.length > 0 ? Math.min(...e) : t, c = e.length > 0 ? vi(e) : 0;
|
|
2406
|
+
return { fpsAvg: t, fpsMax: n, fpsMin: a, fpsStdDev: c };
|
|
2247
2407
|
});
|
|
2248
|
-
|
|
2249
|
-
this.startTime = Date.now(), this.trackFrames();
|
|
2408
|
+
p(this, "start", () => {
|
|
2409
|
+
this.startTime = Date.now(), this.frames = [], this.trackFrames();
|
|
2250
2410
|
});
|
|
2251
|
-
|
|
2411
|
+
p(this, "stop", () => {
|
|
2252
2412
|
cancelAnimationFrame(this.rafId), this.stopTime = Date.now();
|
|
2253
2413
|
});
|
|
2254
|
-
|
|
2414
|
+
p(this, "trackFrames", () => {
|
|
2255
2415
|
this.frames.push(Date.now()), this.rafId = requestAnimationFrame(this.trackFrames);
|
|
2256
2416
|
});
|
|
2257
2417
|
}
|
|
2258
2418
|
}
|
|
2259
|
-
const Ei = "landscape",
|
|
2260
|
-
function
|
|
2419
|
+
const Ei = "landscape", ki = "portrait";
|
|
2420
|
+
function Mi() {
|
|
2261
2421
|
try {
|
|
2262
2422
|
const i = document.createElement("canvas");
|
|
2263
2423
|
return !!window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")) instanceof WebGLRenderingContext;
|
|
@@ -2268,65 +2428,65 @@ function ki() {
|
|
|
2268
2428
|
async function Si() {
|
|
2269
2429
|
if (!window.createImageBitmap)
|
|
2270
2430
|
return !1;
|
|
2271
|
-
const
|
|
2431
|
+
const t = await (await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();
|
|
2272
2432
|
try {
|
|
2273
|
-
return await createImageBitmap(
|
|
2433
|
+
return await createImageBitmap(t), !0;
|
|
2274
2434
|
} catch {
|
|
2275
2435
|
return !1;
|
|
2276
2436
|
}
|
|
2277
2437
|
}
|
|
2278
|
-
function
|
|
2279
|
-
return window.innerWidth >= window.innerHeight ? Ei :
|
|
2438
|
+
function Ke() {
|
|
2439
|
+
return window.innerWidth >= window.innerHeight ? Ei : ki;
|
|
2280
2440
|
}
|
|
2281
|
-
var
|
|
2282
|
-
class
|
|
2283
|
-
constructor(...
|
|
2284
|
-
super(...
|
|
2285
|
-
|
|
2441
|
+
var Fe, ee, te, ie, Ee, _e, ke, De;
|
|
2442
|
+
class Hi extends yi {
|
|
2443
|
+
constructor(...t) {
|
|
2444
|
+
super(...t);
|
|
2445
|
+
p(this, "FPS_SAMPLE_INTERVAL", 1e4);
|
|
2286
2446
|
// wrapper state
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
}), this.on("autoplay", ({ action:
|
|
2298
|
-
["start", "resume"].includes(
|
|
2299
|
-
}), this.on("settings", ({ fastPlay:
|
|
2300
|
-
|
|
2447
|
+
E(this, Fe, 0);
|
|
2448
|
+
E(this, ee, "");
|
|
2449
|
+
E(this, te, void 0);
|
|
2450
|
+
E(this, ie, void 0);
|
|
2451
|
+
E(this, Ee, !1);
|
|
2452
|
+
E(this, _e, !1);
|
|
2453
|
+
E(this, ke, "");
|
|
2454
|
+
E(this, De, []);
|
|
2455
|
+
v(this, te, {}), v(this, ie, this.deviceInfo()), this.on("state", ({ balance: n, version: a }) => {
|
|
2456
|
+
v(this, ee, a), v(this, Fe, n);
|
|
2457
|
+
}), this.on("autoplay", ({ action: n }) => {
|
|
2458
|
+
["start", "resume"].includes(n) ? v(this, Ee, !0) : v(this, Ee, !1);
|
|
2459
|
+
}), this.on("settings", ({ fastPlay: n }) => {
|
|
2460
|
+
n !== void 0 && v(this, _e, n);
|
|
2301
2461
|
}), this.registerEvents();
|
|
2302
2462
|
}
|
|
2303
2463
|
async registerEvents() {
|
|
2304
|
-
y(this, ie).then((
|
|
2305
|
-
this.track("Device Information",
|
|
2464
|
+
y(this, ie).then((t) => {
|
|
2465
|
+
this.track("Device Information", t);
|
|
2306
2466
|
}), this.on("loadStart", () => {
|
|
2307
2467
|
this.track("Game Loading", { progress: 0, step: "initial" });
|
|
2308
|
-
}), this.on("loadProgress", (
|
|
2309
|
-
this.track("Game Loading", { progress:
|
|
2468
|
+
}), this.on("loadProgress", (t) => {
|
|
2469
|
+
this.track("Game Loading", { progress: t.progress });
|
|
2310
2470
|
}), this.on("loadEnd", () => {
|
|
2311
2471
|
this.track("Game Loading", { progress: 100, step: "complete" });
|
|
2312
|
-
}), this.on("error", (
|
|
2472
|
+
}), this.on("error", (t) => {
|
|
2313
2473
|
this.track("System Message", {
|
|
2314
|
-
systemMessageText:
|
|
2315
|
-
systemMessageType:
|
|
2474
|
+
systemMessageText: t.messageKey,
|
|
2475
|
+
systemMessageType: t.type
|
|
2316
2476
|
});
|
|
2317
|
-
}), this.on("openGameResponse", async (
|
|
2318
|
-
|
|
2319
|
-
balanceInCoins:
|
|
2477
|
+
}), this.on("openGameResponse", async (t) => {
|
|
2478
|
+
v(this, ke, t.contract.stateType.nextRound), v(this, te, {
|
|
2479
|
+
balanceInCoins: t.contract.balance.coins,
|
|
2320
2480
|
clientVersion: y(this, ee),
|
|
2321
2481
|
coinValueInCents: this.config.api.coinValueInCents,
|
|
2322
2482
|
coinValueInCentsFloat: this.config.api.coinValueInCents,
|
|
2323
2483
|
currency: this.config.api.currency,
|
|
2324
|
-
defaultBaseBet:
|
|
2325
|
-
defaultBetMultiplier:
|
|
2484
|
+
defaultBaseBet: t.contract.bet.default.base,
|
|
2485
|
+
defaultBetMultiplier: t.contract.bet.default.multiplier,
|
|
2326
2486
|
environment: "release",
|
|
2327
2487
|
gameCode: this.config.api.game,
|
|
2328
2488
|
gameCodeServer: this.config.api.game,
|
|
2329
|
-
gameModelFile:
|
|
2489
|
+
gameModelFile: t.contract.gameModel,
|
|
2330
2490
|
jurisdiction: this.config.api.jurisdiction,
|
|
2331
2491
|
languageCode: this.config.ui.language,
|
|
2332
2492
|
operatorName: "kalamba",
|
|
@@ -2337,15 +2497,15 @@ class Gi extends bi {
|
|
|
2337
2497
|
referrer: window.location.hostname,
|
|
2338
2498
|
// rootTrackingSessionID: 'unknown',
|
|
2339
2499
|
// rtpVariant: 'unknown',
|
|
2340
|
-
serverVersion:
|
|
2500
|
+
serverVersion: t.contract.metaData.version
|
|
2341
2501
|
// testVariants: '',
|
|
2342
2502
|
}), this.track("Game Open", y(this, te));
|
|
2343
|
-
}), this.on("playCycleEnd", async (
|
|
2344
|
-
const
|
|
2503
|
+
}), this.on("playCycleEnd", async (t) => {
|
|
2504
|
+
const n = await y(this, ie), { base: a, multiplier: c, specialAction: s } = t.contract.bet.lastPaid ?? {}, h = t.contract.balance.coins, g = t.contract.bet.lastPaid.base * t.contract.bet.lastPaid.multiplier, w = t.contract.win.total, m = w - g, A = s || "spin", R = t.contract.roundId;
|
|
2345
2505
|
this.track("Betting Activity", {
|
|
2346
|
-
balance: h -
|
|
2506
|
+
balance: h - m,
|
|
2347
2507
|
balanceAfter: h,
|
|
2348
|
-
baseBet:
|
|
2508
|
+
baseBet: a,
|
|
2349
2509
|
// baseBetIndex,
|
|
2350
2510
|
betMultiplier: c,
|
|
2351
2511
|
betType: A,
|
|
@@ -2356,26 +2516,26 @@ class Gi extends bi {
|
|
|
2356
2516
|
environment: "release",
|
|
2357
2517
|
gameCode: this.config.api.game,
|
|
2358
2518
|
gameCodeServer: this.config.api.game,
|
|
2359
|
-
isMobile:
|
|
2360
|
-
netResult:
|
|
2519
|
+
isMobile: n.isMobile,
|
|
2520
|
+
netResult: m,
|
|
2361
2521
|
operatorName: "kalamba",
|
|
2362
|
-
orientation:
|
|
2522
|
+
orientation: Ke(),
|
|
2363
2523
|
partnerId: this.config.api.brand,
|
|
2364
2524
|
partnerParentId: this.config.api.integration,
|
|
2365
2525
|
platform: "WEB",
|
|
2366
2526
|
playMode: this.config.api.playMode,
|
|
2367
|
-
roundId:
|
|
2527
|
+
roundId: R,
|
|
2368
2528
|
// TODO: uncomment when tracking TrackingEvent.GameSpin is implemented
|
|
2369
2529
|
// roundTypes: [...this.#roundTypes],
|
|
2370
2530
|
roundTypes: ["BaseGame"],
|
|
2371
|
-
totalBet:
|
|
2372
|
-
totalWin:
|
|
2373
|
-
}),
|
|
2374
|
-
}), this.on("telemetry.click", (
|
|
2531
|
+
totalBet: g,
|
|
2532
|
+
totalWin: w
|
|
2533
|
+
}), v(this, De, []);
|
|
2534
|
+
}), this.on("telemetry.click", (t) => {
|
|
2375
2535
|
this.track("UI Interaction", {
|
|
2376
2536
|
action: "click",
|
|
2377
2537
|
...this.getExtraUiInteractionData(),
|
|
2378
|
-
...
|
|
2538
|
+
...t
|
|
2379
2539
|
});
|
|
2380
2540
|
}), this.on("telemetry.orientationChange", () => {
|
|
2381
2541
|
this.track("UI Interaction", {
|
|
@@ -2385,47 +2545,47 @@ class Gi extends bi {
|
|
|
2385
2545
|
}), this.reportFpsSample(), this.reportFpsRound();
|
|
2386
2546
|
}
|
|
2387
2547
|
reportFpsSample() {
|
|
2388
|
-
const
|
|
2389
|
-
|
|
2390
|
-
const c =
|
|
2391
|
-
this.track("FPS Performance", { ...c, fpsType: "sample" }),
|
|
2392
|
-
},
|
|
2393
|
-
|
|
2548
|
+
const t = new Tt(), n = () => {
|
|
2549
|
+
t.stop();
|
|
2550
|
+
const c = t.getReport();
|
|
2551
|
+
this.track("FPS Performance", { ...c, fpsType: "sample" }), a();
|
|
2552
|
+
}, a = async () => {
|
|
2553
|
+
t.start(), setTimeout(n, this.FPS_SAMPLE_INTERVAL);
|
|
2394
2554
|
};
|
|
2395
|
-
|
|
2555
|
+
a();
|
|
2396
2556
|
}
|
|
2397
2557
|
reportFpsRound() {
|
|
2398
|
-
const
|
|
2558
|
+
const t = new Tt();
|
|
2399
2559
|
this.on("playCycleStart", () => {
|
|
2400
|
-
|
|
2560
|
+
t.start();
|
|
2401
2561
|
}), this.on("playCycleEnd", () => {
|
|
2402
|
-
|
|
2403
|
-
const
|
|
2404
|
-
this.track("FPS Performance", { ...
|
|
2562
|
+
t.stop();
|
|
2563
|
+
const n = t.getReport();
|
|
2564
|
+
this.track("FPS Performance", { ...n, fpsType: "playCycleStart->playCycleEnd" });
|
|
2405
2565
|
});
|
|
2406
2566
|
}
|
|
2407
2567
|
getExtraUiInteractionData() {
|
|
2408
2568
|
return {
|
|
2409
|
-
orientation:
|
|
2569
|
+
orientation: Ke(),
|
|
2410
2570
|
stateType: y(this, ke)
|
|
2411
2571
|
};
|
|
2412
2572
|
}
|
|
2413
2573
|
async deviceInfo() {
|
|
2414
|
-
var
|
|
2415
|
-
const
|
|
2574
|
+
var g;
|
|
2575
|
+
const t = new D(navigator.userAgent), n = Mi(), a = await Si(), c = t.getBrowser(), s = t.getDevice(), h = t.getOS();
|
|
2416
2576
|
return {
|
|
2417
2577
|
browserName: c.name,
|
|
2418
2578
|
browserVersion: c.version,
|
|
2419
|
-
connection: (
|
|
2420
|
-
deviceName:
|
|
2421
|
-
deviceType:
|
|
2422
|
-
isMobile: ["mobile", "tablet"].includes(
|
|
2423
|
-
isWebGLSupported:
|
|
2424
|
-
isWebPSupported:
|
|
2425
|
-
manufacturer:
|
|
2579
|
+
connection: (g = navigator.connection) == null ? void 0 : g.effectiveType,
|
|
2580
|
+
deviceName: s.model,
|
|
2581
|
+
deviceType: s.type,
|
|
2582
|
+
isMobile: ["mobile", "tablet"].includes(s.type ?? ""),
|
|
2583
|
+
isWebGLSupported: n,
|
|
2584
|
+
isWebPSupported: a,
|
|
2585
|
+
manufacturer: s.vendor,
|
|
2426
2586
|
operatingSystem: h.name,
|
|
2427
2587
|
operatingSystemVersion: h.version,
|
|
2428
|
-
orientation:
|
|
2588
|
+
orientation: Ke(),
|
|
2429
2589
|
pixelRatio: window.devicePixelRatio,
|
|
2430
2590
|
screenHeight: window.screen.height,
|
|
2431
2591
|
screenSize: `${window.screen.width}x${window.screen.height}`,
|
|
@@ -2437,123 +2597,123 @@ class Gi extends bi {
|
|
|
2437
2597
|
};
|
|
2438
2598
|
}
|
|
2439
2599
|
}
|
|
2440
|
-
|
|
2441
|
-
let
|
|
2442
|
-
const
|
|
2443
|
-
function
|
|
2444
|
-
if (!
|
|
2600
|
+
Fe = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), ie = new WeakMap(), Ee = new WeakMap(), _e = new WeakMap(), ke = new WeakMap(), De = new WeakMap();
|
|
2601
|
+
let Oe;
|
|
2602
|
+
const Ci = new Uint8Array(16);
|
|
2603
|
+
function Ii() {
|
|
2604
|
+
if (!Oe && (Oe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Oe))
|
|
2445
2605
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2446
|
-
return
|
|
2606
|
+
return Oe(Ci);
|
|
2447
2607
|
}
|
|
2448
|
-
const
|
|
2608
|
+
const M = [];
|
|
2449
2609
|
for (let i = 0; i < 256; ++i)
|
|
2450
|
-
|
|
2451
|
-
function
|
|
2452
|
-
return
|
|
2610
|
+
M.push((i + 256).toString(16).slice(1));
|
|
2611
|
+
function Ti(i, e = 0) {
|
|
2612
|
+
return M[i[e + 0]] + M[i[e + 1]] + M[i[e + 2]] + M[i[e + 3]] + "-" + M[i[e + 4]] + M[i[e + 5]] + "-" + M[i[e + 6]] + M[i[e + 7]] + "-" + M[i[e + 8]] + M[i[e + 9]] + "-" + M[i[e + 10]] + M[i[e + 11]] + M[i[e + 12]] + M[i[e + 13]] + M[i[e + 14]] + M[i[e + 15]];
|
|
2453
2613
|
}
|
|
2454
|
-
const
|
|
2455
|
-
randomUUID:
|
|
2614
|
+
const Ai = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), At = {
|
|
2615
|
+
randomUUID: Ai
|
|
2456
2616
|
};
|
|
2457
|
-
function
|
|
2458
|
-
if (
|
|
2459
|
-
return
|
|
2617
|
+
function Pt(i, e, t) {
|
|
2618
|
+
if (At.randomUUID && !e && !i)
|
|
2619
|
+
return At.randomUUID();
|
|
2460
2620
|
i = i || {};
|
|
2461
|
-
const
|
|
2462
|
-
if (
|
|
2463
|
-
|
|
2464
|
-
for (let
|
|
2465
|
-
t
|
|
2466
|
-
return
|
|
2467
|
-
}
|
|
2468
|
-
return
|
|
2621
|
+
const n = i.random || (i.rng || Ii)();
|
|
2622
|
+
if (n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, e) {
|
|
2623
|
+
t = t || 0;
|
|
2624
|
+
for (let a = 0; a < 16; ++a)
|
|
2625
|
+
e[t + a] = n[a];
|
|
2626
|
+
return e;
|
|
2627
|
+
}
|
|
2628
|
+
return Ti(n);
|
|
2469
2629
|
}
|
|
2470
|
-
class
|
|
2471
|
-
constructor(
|
|
2472
|
-
|
|
2473
|
-
this.config =
|
|
2630
|
+
class Dt {
|
|
2631
|
+
constructor(e) {
|
|
2632
|
+
p(this, "config");
|
|
2633
|
+
this.config = e;
|
|
2474
2634
|
}
|
|
2475
2635
|
}
|
|
2476
|
-
const
|
|
2477
|
-
var
|
|
2478
|
-
class
|
|
2479
|
-
constructor(...
|
|
2480
|
-
super(...
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2636
|
+
const xt = 25, Ut = 1e4;
|
|
2637
|
+
var ne, ae, se, H, Me;
|
|
2638
|
+
class Vi extends Dt {
|
|
2639
|
+
constructor(...t) {
|
|
2640
|
+
super(...t);
|
|
2641
|
+
E(this, ne, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
|
|
2642
|
+
E(this, ae, void 0);
|
|
2643
|
+
E(this, se, void 0);
|
|
2644
|
+
E(this, H, []);
|
|
2645
|
+
E(this, Me, void 0);
|
|
2646
|
+
p(this, "processQueueForced");
|
|
2647
|
+
v(this, ae, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime()), v(this, H, []), v(this, Me, Pt()), this.processQueueForced = this.processQueue.bind(this, !0), this.schedule(), fetch(y(this, ne), {
|
|
2488
2648
|
method: "OPTIONS"
|
|
2489
|
-
}).catch(
|
|
2649
|
+
}).catch(rt), this.subscribe();
|
|
2490
2650
|
}
|
|
2491
2651
|
subscribe() {
|
|
2492
2652
|
window.addEventListener("beforeunload", this.processQueueForced, !1), window.addEventListener("pagehide", this.processQueueForced, !1), window.addEventListener("visibilitychange", this.processQueueForced, !1);
|
|
2493
2653
|
}
|
|
2494
2654
|
schedule() {
|
|
2495
|
-
y(this,
|
|
2655
|
+
y(this, se) && clearTimeout(y(this, se)), v(this, se, window.setTimeout(() => this.processQueue(), Ut));
|
|
2496
2656
|
}
|
|
2497
|
-
send(
|
|
2498
|
-
|
|
2657
|
+
send(t) {
|
|
2658
|
+
v(this, ae, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime());
|
|
2499
2659
|
try {
|
|
2500
|
-
navigator.sendBeacon(y(this,
|
|
2660
|
+
navigator.sendBeacon(y(this, ne), JSON.stringify(t));
|
|
2501
2661
|
} catch {
|
|
2502
|
-
fetch(y(this,
|
|
2503
|
-
body: JSON.stringify(
|
|
2662
|
+
fetch(y(this, ne), {
|
|
2663
|
+
body: JSON.stringify(t),
|
|
2504
2664
|
method: "POST",
|
|
2505
2665
|
headers: {
|
|
2506
2666
|
"Content-Type": "application/json"
|
|
2507
2667
|
},
|
|
2508
2668
|
keepalive: !0
|
|
2509
|
-
}).catch(
|
|
2669
|
+
}).catch(rt);
|
|
2510
2670
|
}
|
|
2511
2671
|
this.schedule();
|
|
2512
2672
|
}
|
|
2513
|
-
addToQueue(
|
|
2514
|
-
y(this,
|
|
2673
|
+
addToQueue(t) {
|
|
2674
|
+
y(this, H).push(t), this.processQueue();
|
|
2515
2675
|
}
|
|
2516
|
-
processQueue(
|
|
2517
|
-
if (!(this.config == null || !this.config.ui.feature.allowTelemetry) && !(!
|
|
2518
|
-
for (; y(this,
|
|
2519
|
-
const
|
|
2520
|
-
...
|
|
2521
|
-
sessionID: y(this,
|
|
2676
|
+
processQueue(t = !1) {
|
|
2677
|
+
if (!(this.config == null || !this.config.ui.feature.allowTelemetry) && !(!t && y(this, H).length < xt && /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime() - y(this, ae) < Ut))
|
|
2678
|
+
for (; y(this, H).length; ) {
|
|
2679
|
+
const n = y(this, H).splice(0, xt).map((a) => ({
|
|
2680
|
+
...a,
|
|
2681
|
+
sessionID: y(this, Me),
|
|
2522
2682
|
userID: this.config.api.user
|
|
2523
2683
|
}));
|
|
2524
|
-
this.send(
|
|
2684
|
+
this.send(n);
|
|
2525
2685
|
}
|
|
2526
2686
|
}
|
|
2527
|
-
track(
|
|
2687
|
+
track(t, n) {
|
|
2528
2688
|
this.addToQueue({
|
|
2529
|
-
eventName:
|
|
2530
|
-
eventParams:
|
|
2689
|
+
eventName: t,
|
|
2690
|
+
eventParams: n,
|
|
2531
2691
|
eventTimestamp: /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime(),
|
|
2532
|
-
eventUUID:
|
|
2692
|
+
eventUUID: Pt()
|
|
2533
2693
|
});
|
|
2534
2694
|
}
|
|
2535
2695
|
}
|
|
2536
|
-
|
|
2537
|
-
const
|
|
2538
|
-
class
|
|
2539
|
-
track(
|
|
2540
|
-
|
|
2696
|
+
ne = new WeakMap(), ae = new WeakMap(), se = new WeakMap(), H = new WeakMap(), Me = new WeakMap();
|
|
2697
|
+
const Pi = O("LoggingTracker", "color:#000000;font-weight:bold;");
|
|
2698
|
+
class zi extends Dt {
|
|
2699
|
+
track(e, t) {
|
|
2700
|
+
Pi(`@${this.config.api.user}`, `[${e}]`, t);
|
|
2541
2701
|
}
|
|
2542
2702
|
}
|
|
2543
2703
|
export {
|
|
2544
|
-
|
|
2704
|
+
Oi as BasicPlugin,
|
|
2545
2705
|
$ as CasinoPlugin,
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2706
|
+
Li as DebuggingPlugin,
|
|
2707
|
+
Bi as GigPlugin,
|
|
2708
|
+
Ni as KalambaBullseyePlugin,
|
|
2709
|
+
Hi as KalambaStargazerPlugin,
|
|
2710
|
+
Vi as KalambaStargazerTracker,
|
|
2711
|
+
zi as LoggingTracker,
|
|
2712
|
+
Fi as OryxPlugin,
|
|
2553
2713
|
_i as PariplayPlugin,
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2714
|
+
Di as RelaxFEIMPlugin,
|
|
2715
|
+
Qt as RgsPlygin,
|
|
2716
|
+
yi as TelemetryPlugin,
|
|
2717
|
+
Dt as Tracker,
|
|
2718
|
+
Ri as TukoPlugin
|
|
2559
2719
|
};
|