@jetthai/cuora 1.1.94-cash-5 → 1.1.94
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/.husky/pre-commit +1 -1
- package/CHANGELOG.md +0 -20
- package/dist/bundle.mjs +827 -79
- package/package.json +1 -1
- package/src/api/activity.js +1 -13
- package/src/api/payment.js +4 -12
- package/src/machine/activity/deposit_activity.js +4 -13
- package/src/machine/activity/fafafa_activity.js +15 -26
- package/src/machine/activity/index.js +0 -2
- package/src/machine/activity/ranking_activity.js +2 -11
- package/src/machine/activity/specify_bets_activity.js +3 -25
- package/src/machine/activity/specify_turnover_activity.js +3 -25
- package/src/machine/activity/time_bomb_activity.js +2 -11
- package/src/machine/deposit/index.js +0 -12
- package/src/machine/game.js +285 -0
- package/src/machine/game_favorite.js +123 -0
- package/src/machine/game_favorite_v2.js +2 -6
- package/src/machine/game_v2.js +381 -0
- package/src/machine/game_v2_1.js +9 -35
- package/src/machine/index.js +6 -6
- package/src/request/request.js +5 -9
- package/src/util/index.js +1 -2
- package/src/machine/activity/diamond_shop_activity_cash.js +0 -214
- package/src/machine/deposit/crypto_cash.js +0 -243
- package/src/machine/deposit/direct_cash.js +0 -236
- package/src/machine/deposit/loadcard_cash.js +0 -227
- package/src/machine/deposit/manual_cash.js +0 -321
- package/src/machine/deposit/qrcode_cash.js +0 -227
- package/src/machine/deposit/usdt_cash.js +0 -140
- package/src/machine/reward_cash.js +0 -220
- package/src/machine/side_cash.js +0 -110
- package/src/machine/withdraw/crypto_cash.js +0 -313
- package/src/machine/withdraw/index.js +0 -4
- package/src/machine/withdraw/manual_cash.js +0 -267
- package/src/util/math.js +0 -4
package/dist/bundle.mjs
CHANGED
|
@@ -3614,7 +3614,7 @@ var common$1 = {
|
|
|
3614
3614
|
getAnnouncements: () => ({ url: 'getAnnouncements', method: 'get', isPublic: true }),
|
|
3615
3615
|
};
|
|
3616
3616
|
|
|
3617
|
-
var game = {
|
|
3617
|
+
var game$1 = {
|
|
3618
3618
|
getGameSHA: () => ({ method: 'get', url: 'game/list/v2/sha' }),
|
|
3619
3619
|
getOptionMap: (code) => ({ method: 'get', url: 'game/list/v2/options', params: { code } }),
|
|
3620
3620
|
getGameStatus: () => ({ method: 'get', url: 'game/list/v2/status' }),
|
|
@@ -3934,7 +3934,7 @@ var form = {
|
|
|
3934
3934
|
upload: (formData) => ({ url: 'upload', method: 'post', params: formData, isFormData: true }),
|
|
3935
3935
|
};
|
|
3936
3936
|
|
|
3937
|
-
var index$2 = { activity: api, auth: auth$1, common: common$1, game, mailbox, payment, user, form };
|
|
3937
|
+
var index$2 = { activity: api, auth: auth$1, common: common$1, game: game$1, mailbox, payment, user, form };
|
|
3938
3938
|
|
|
3939
3939
|
/*! *****************************************************************************
|
|
3940
3940
|
Copyright (c) Microsoft Corporation.
|
|
@@ -17132,13 +17132,672 @@ function error () {
|
|
|
17132
17132
|
)
|
|
17133
17133
|
}
|
|
17134
17134
|
|
|
17135
|
+
// const UAParser = require('ua-parser-js')
|
|
17136
|
+
|
|
17137
|
+
function game (request) {
|
|
17138
|
+
return createMachine(
|
|
17139
|
+
{
|
|
17140
|
+
id: 'game',
|
|
17141
|
+
type: 'parallel',
|
|
17142
|
+
context: {
|
|
17143
|
+
roomId: null,
|
|
17144
|
+
room: null,
|
|
17145
|
+
list: [],
|
|
17146
|
+
gameList: [],
|
|
17147
|
+
// play params
|
|
17148
|
+
game: {
|
|
17149
|
+
provider: null,
|
|
17150
|
+
game_id: null,
|
|
17151
|
+
game_type: null,
|
|
17152
|
+
mapping_id: null,
|
|
17153
|
+
portrait: null,
|
|
17154
|
+
},
|
|
17155
|
+
lang: 'en_US',
|
|
17156
|
+
isMobile: new UAParser().getResult().device.type,
|
|
17157
|
+
gameURL: null,
|
|
17158
|
+
// game database
|
|
17159
|
+
sha: {
|
|
17160
|
+
category: null,
|
|
17161
|
+
status: null,
|
|
17162
|
+
},
|
|
17163
|
+
isCategoryChanged: false,
|
|
17164
|
+
isStatusChanged: false,
|
|
17165
|
+
statusMap: {},
|
|
17166
|
+
optionMap: {},
|
|
17167
|
+
},
|
|
17168
|
+
states: {
|
|
17169
|
+
flow: {
|
|
17170
|
+
initial: 'idle',
|
|
17171
|
+
states: {
|
|
17172
|
+
idle: {
|
|
17173
|
+
enter: 'clearGameInfo',
|
|
17174
|
+
on: {
|
|
17175
|
+
SET_ROOM: {
|
|
17176
|
+
target: 'loading',
|
|
17177
|
+
actions: 'setRoom',
|
|
17178
|
+
cond: (context, event) => {
|
|
17179
|
+
return context.room?.id !== event.data?.id
|
|
17180
|
+
},
|
|
17181
|
+
},
|
|
17182
|
+
ENTER_GAME: {
|
|
17183
|
+
target: 'connecting',
|
|
17184
|
+
actions: ['setGameInfo', 'setLang'],
|
|
17185
|
+
},
|
|
17186
|
+
},
|
|
17187
|
+
},
|
|
17188
|
+
loading: {
|
|
17189
|
+
invoke: {
|
|
17190
|
+
src: 'getRoomItems',
|
|
17191
|
+
onDone: {
|
|
17192
|
+
target: 'idle',
|
|
17193
|
+
actions: 'setList',
|
|
17194
|
+
},
|
|
17195
|
+
onError: {
|
|
17196
|
+
target: 'idle',
|
|
17197
|
+
actions: assign({ list: [] }),
|
|
17198
|
+
},
|
|
17199
|
+
},
|
|
17200
|
+
},
|
|
17201
|
+
connecting: {
|
|
17202
|
+
invoke: {
|
|
17203
|
+
src: 'connectGame',
|
|
17204
|
+
onDone: {
|
|
17205
|
+
target: 'playing',
|
|
17206
|
+
actions: 'setGameURL',
|
|
17207
|
+
},
|
|
17208
|
+
onError: {
|
|
17209
|
+
target: 'idle',
|
|
17210
|
+
},
|
|
17211
|
+
},
|
|
17212
|
+
},
|
|
17213
|
+
playing: {
|
|
17214
|
+
on: {
|
|
17215
|
+
EXIT_GAME: {
|
|
17216
|
+
target: 'disconnect',
|
|
17217
|
+
},
|
|
17218
|
+
},
|
|
17219
|
+
},
|
|
17220
|
+
disconnect: {
|
|
17221
|
+
invoke: {
|
|
17222
|
+
src: 'disconnectGame',
|
|
17223
|
+
onDone: {
|
|
17224
|
+
target: 'idle',
|
|
17225
|
+
},
|
|
17226
|
+
onError: {
|
|
17227
|
+
target: 'idle',
|
|
17228
|
+
},
|
|
17229
|
+
},
|
|
17230
|
+
},
|
|
17231
|
+
},
|
|
17232
|
+
},
|
|
17233
|
+
timer: {
|
|
17234
|
+
initial: 'fetchingGameSHA',
|
|
17235
|
+
states: {
|
|
17236
|
+
fetchingGameSHA: {
|
|
17237
|
+
invoke: {
|
|
17238
|
+
src: 'fetchGameSHA',
|
|
17239
|
+
onDone: {
|
|
17240
|
+
target: 'checking',
|
|
17241
|
+
actions: 'setGameSHA',
|
|
17242
|
+
},
|
|
17243
|
+
onError: {
|
|
17244
|
+
target: 'pending',
|
|
17245
|
+
},
|
|
17246
|
+
},
|
|
17247
|
+
},
|
|
17248
|
+
checking: {
|
|
17249
|
+
always: [
|
|
17250
|
+
{ target: 'updatingStatus', cond: 'isStatusChanged' },
|
|
17251
|
+
{ target: 'updatingCategory', cond: 'isCategoryChanged' },
|
|
17252
|
+
{ target: 'pending' },
|
|
17253
|
+
],
|
|
17254
|
+
},
|
|
17255
|
+
updatingStatus: {
|
|
17256
|
+
invoke: {
|
|
17257
|
+
src: 'fetchStatus',
|
|
17258
|
+
onDone: {
|
|
17259
|
+
target: 'updatingOption',
|
|
17260
|
+
actions: ['setStatus'],
|
|
17261
|
+
},
|
|
17262
|
+
onError: {
|
|
17263
|
+
target: 'pending',
|
|
17264
|
+
},
|
|
17265
|
+
},
|
|
17266
|
+
},
|
|
17267
|
+
updatingOption: {
|
|
17268
|
+
invoke: {
|
|
17269
|
+
src: 'fetchOption',
|
|
17270
|
+
onDone: {
|
|
17271
|
+
target: 'updatingCategory',
|
|
17272
|
+
actions: 'mergeOption',
|
|
17273
|
+
},
|
|
17274
|
+
onError: {
|
|
17275
|
+
target: 'pending',
|
|
17276
|
+
},
|
|
17277
|
+
},
|
|
17278
|
+
},
|
|
17279
|
+
updatingCategory: {
|
|
17280
|
+
invoke: {
|
|
17281
|
+
src: 'getRoomItems',
|
|
17282
|
+
onDone: {
|
|
17283
|
+
target: 'pending',
|
|
17284
|
+
actions: 'setList',
|
|
17285
|
+
},
|
|
17286
|
+
onError: {
|
|
17287
|
+
target: 'pending',
|
|
17288
|
+
},
|
|
17289
|
+
},
|
|
17290
|
+
},
|
|
17291
|
+
pending: {
|
|
17292
|
+
after: {
|
|
17293
|
+
20000: {
|
|
17294
|
+
target: 'fetchingGameSHA',
|
|
17295
|
+
},
|
|
17296
|
+
},
|
|
17297
|
+
},
|
|
17298
|
+
},
|
|
17299
|
+
},
|
|
17300
|
+
},
|
|
17301
|
+
},
|
|
17302
|
+
{
|
|
17303
|
+
actions: {
|
|
17304
|
+
setRoomId: assign((context, event) => {
|
|
17305
|
+
return { roomId: event.roomId }
|
|
17306
|
+
}),
|
|
17307
|
+
setRoom: assign((context, event) => {
|
|
17308
|
+
return {
|
|
17309
|
+
room: event.data,
|
|
17310
|
+
roomId: event.data.id,
|
|
17311
|
+
}
|
|
17312
|
+
}),
|
|
17313
|
+
setList: assign((context, event) => {
|
|
17314
|
+
const { statusMap, optionMap } = context;
|
|
17315
|
+
const { list = [] } = event.data;
|
|
17316
|
+
const gameList = list
|
|
17317
|
+
.map((item) => {
|
|
17318
|
+
if (item.id) {
|
|
17319
|
+
item.room = true;
|
|
17320
|
+
return item
|
|
17321
|
+
}
|
|
17322
|
+
|
|
17323
|
+
const code = item.g;
|
|
17324
|
+
if (!code || !optionMap[code]) {
|
|
17325
|
+
return
|
|
17326
|
+
}
|
|
17327
|
+
|
|
17328
|
+
return {
|
|
17329
|
+
...optionMap[code],
|
|
17330
|
+
code,
|
|
17331
|
+
system_enable: statusMap[code][0],
|
|
17332
|
+
}
|
|
17333
|
+
})
|
|
17334
|
+
.filter((item) => item && !item.header)
|
|
17335
|
+
.sort((a, b) => a.system_enable - b.system_enable);
|
|
17336
|
+
return { list, gameList }
|
|
17337
|
+
}),
|
|
17338
|
+
setGameURL: assign({
|
|
17339
|
+
gameURL: (context, event) => {
|
|
17340
|
+
return event.data.gameURL
|
|
17341
|
+
},
|
|
17342
|
+
}),
|
|
17343
|
+
clearGameInfo: assign((context, event) => {
|
|
17344
|
+
return { game: { provider: null, game_id: null, game_type: null, mapping_id: null } }
|
|
17345
|
+
}),
|
|
17346
|
+
setGameInfo: assign((context, event) => {
|
|
17347
|
+
const { provider, game_id, game_type, mapping_id, portrait } = event.data.game;
|
|
17348
|
+
return { game: { provider, game_id, game_type, mapping_id, portrait } }
|
|
17349
|
+
}),
|
|
17350
|
+
setLang: assign((context, event) => {
|
|
17351
|
+
const lang = event.data.locale.replace('-', '_');
|
|
17352
|
+
return { lang }
|
|
17353
|
+
}),
|
|
17354
|
+
setGameSHA: assign((context, event) => {
|
|
17355
|
+
const { sha } = context;
|
|
17356
|
+
const newSha = event.data;
|
|
17357
|
+
return {
|
|
17358
|
+
sha: newSha,
|
|
17359
|
+
isCategoryChanged: !sha.category || sha.category !== newSha.category,
|
|
17360
|
+
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17361
|
+
}
|
|
17362
|
+
}),
|
|
17363
|
+
setStatus: assign((context, event) => {
|
|
17364
|
+
return {
|
|
17365
|
+
statusMap: event.data,
|
|
17366
|
+
}
|
|
17367
|
+
}),
|
|
17368
|
+
mergeOption: assign((context, event) => {
|
|
17369
|
+
const { optionMap } = context;
|
|
17370
|
+
return {
|
|
17371
|
+
optionMap: { ...optionMap, ...event.data },
|
|
17372
|
+
}
|
|
17373
|
+
}),
|
|
17374
|
+
},
|
|
17375
|
+
guards: {
|
|
17376
|
+
isCategoryChanged: (context, event) => context.isCategoryChanged,
|
|
17377
|
+
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17378
|
+
},
|
|
17379
|
+
services: {
|
|
17380
|
+
getRoomItems: async (context, event) => {
|
|
17381
|
+
return await request.send(game$1.getGameCategory({ id: context.roomId }))
|
|
17382
|
+
},
|
|
17383
|
+
connectGame: async (context, event) => {
|
|
17384
|
+
const { lang, isMobile } = context;
|
|
17385
|
+
const { provider, game_id, game_type, mapping_id } = context.game;
|
|
17386
|
+
const params = {
|
|
17387
|
+
provider_id: provider,
|
|
17388
|
+
game_id: game_id,
|
|
17389
|
+
gametype_id: game_type,
|
|
17390
|
+
mapping_id: mapping_id,
|
|
17391
|
+
is_demo: false,
|
|
17392
|
+
is_mobile: isMobile,
|
|
17393
|
+
lang,
|
|
17394
|
+
return_url: window.location.href,
|
|
17395
|
+
};
|
|
17396
|
+
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17397
|
+
return { gameURL: redirect_url }
|
|
17398
|
+
},
|
|
17399
|
+
disconnectGame: async (context, event) => {
|
|
17400
|
+
const uid_site = event.data;
|
|
17401
|
+
return await request.send(game$1.logoutGame({ uid_site, provider_id: context.game.provider }))
|
|
17402
|
+
},
|
|
17403
|
+
fetchOption: async (context, event) => {
|
|
17404
|
+
return await request.send(game$1.getOptionMap())
|
|
17405
|
+
},
|
|
17406
|
+
fetchGameSHA: async (context, event) => {
|
|
17407
|
+
return await request.send(game$1.getGameSHA())
|
|
17408
|
+
},
|
|
17409
|
+
fetchStatus: async (context, event) => {
|
|
17410
|
+
return await request.send(game$1.getGameStatus())
|
|
17411
|
+
},
|
|
17412
|
+
},
|
|
17413
|
+
}
|
|
17414
|
+
)
|
|
17415
|
+
}
|
|
17416
|
+
|
|
17135
17417
|
const MY_FAVORITE = 'MyFavorite';
|
|
17136
17418
|
const GAME_SEARCH = 'GameSearch';
|
|
17137
17419
|
|
|
17138
|
-
var constant = /*#__PURE__*/Object.freeze({
|
|
17139
|
-
__proto__: null,
|
|
17140
|
-
MY_FAVORITE: MY_FAVORITE,
|
|
17141
|
-
GAME_SEARCH: GAME_SEARCH
|
|
17420
|
+
var constant = /*#__PURE__*/Object.freeze({
|
|
17421
|
+
__proto__: null,
|
|
17422
|
+
MY_FAVORITE: MY_FAVORITE,
|
|
17423
|
+
GAME_SEARCH: GAME_SEARCH
|
|
17424
|
+
});
|
|
17425
|
+
|
|
17426
|
+
function game_v2 (request) {
|
|
17427
|
+
return createMachine(
|
|
17428
|
+
{
|
|
17429
|
+
id: 'game',
|
|
17430
|
+
type: 'parallel',
|
|
17431
|
+
context: {
|
|
17432
|
+
room: null,
|
|
17433
|
+
index: 0,
|
|
17434
|
+
content: {
|
|
17435
|
+
data: [],
|
|
17436
|
+
timestamp: null,
|
|
17437
|
+
parentCategoryId: null,
|
|
17438
|
+
totalPage: 1,
|
|
17439
|
+
},
|
|
17440
|
+
addition: {
|
|
17441
|
+
data: [],
|
|
17442
|
+
timestamp: null,
|
|
17443
|
+
totalPage: 1,
|
|
17444
|
+
},
|
|
17445
|
+
// play params
|
|
17446
|
+
game: {
|
|
17447
|
+
providerId: null,
|
|
17448
|
+
gameId: null,
|
|
17449
|
+
gameTypeId: null,
|
|
17450
|
+
mappingId: null,
|
|
17451
|
+
portrait: null,
|
|
17452
|
+
},
|
|
17453
|
+
lang: 'en_US',
|
|
17454
|
+
isMobile: new UAParser().getResult().device.type,
|
|
17455
|
+
gameURL: null,
|
|
17456
|
+
...oldContext$1,
|
|
17457
|
+
},
|
|
17458
|
+
states: {
|
|
17459
|
+
flow: {
|
|
17460
|
+
initial: 'idle',
|
|
17461
|
+
states: {
|
|
17462
|
+
idle: {
|
|
17463
|
+
enter: 'clearGameInfo',
|
|
17464
|
+
on: {
|
|
17465
|
+
ENTER_ROOM: {
|
|
17466
|
+
target: 'loading',
|
|
17467
|
+
cond: 'isDifferentRoom',
|
|
17468
|
+
actions: ['setRoom', 'resetContent'],
|
|
17469
|
+
},
|
|
17470
|
+
NEXT_PAGE: {
|
|
17471
|
+
target: 'loading',
|
|
17472
|
+
cond: 'hasNext',
|
|
17473
|
+
actions: 'increaseIndex',
|
|
17474
|
+
},
|
|
17475
|
+
ENTER_GAME: {
|
|
17476
|
+
target: 'connecting',
|
|
17477
|
+
actions: ['setGameInfo', 'setLang'],
|
|
17478
|
+
},
|
|
17479
|
+
},
|
|
17480
|
+
},
|
|
17481
|
+
loading: {
|
|
17482
|
+
invoke: {
|
|
17483
|
+
src: 'getPageContent',
|
|
17484
|
+
onDone: {
|
|
17485
|
+
target: 'idle',
|
|
17486
|
+
actions: 'appendContent',
|
|
17487
|
+
},
|
|
17488
|
+
onError: {
|
|
17489
|
+
target: 'idle',
|
|
17490
|
+
},
|
|
17491
|
+
},
|
|
17492
|
+
},
|
|
17493
|
+
connecting: {
|
|
17494
|
+
invoke: {
|
|
17495
|
+
src: 'connectGame',
|
|
17496
|
+
onDone: {
|
|
17497
|
+
target: 'playing',
|
|
17498
|
+
actions: 'setGameURL',
|
|
17499
|
+
},
|
|
17500
|
+
onError: {
|
|
17501
|
+
target: 'idle',
|
|
17502
|
+
},
|
|
17503
|
+
},
|
|
17504
|
+
},
|
|
17505
|
+
playing: {
|
|
17506
|
+
on: {
|
|
17507
|
+
EXIT_GAME: {
|
|
17508
|
+
target: 'disconnect',
|
|
17509
|
+
},
|
|
17510
|
+
},
|
|
17511
|
+
},
|
|
17512
|
+
disconnect: {
|
|
17513
|
+
invoke: {
|
|
17514
|
+
src: 'disconnectGame',
|
|
17515
|
+
onDone: {
|
|
17516
|
+
target: 'idle',
|
|
17517
|
+
},
|
|
17518
|
+
onError: {
|
|
17519
|
+
target: 'idle',
|
|
17520
|
+
},
|
|
17521
|
+
},
|
|
17522
|
+
},
|
|
17523
|
+
},
|
|
17524
|
+
},
|
|
17525
|
+
timer: {
|
|
17526
|
+
initial: 'pending',
|
|
17527
|
+
states: {
|
|
17528
|
+
pending: {
|
|
17529
|
+
after: {
|
|
17530
|
+
20000: [
|
|
17531
|
+
{
|
|
17532
|
+
target: 'updating',
|
|
17533
|
+
cond: 'hasRoom',
|
|
17534
|
+
},
|
|
17535
|
+
{
|
|
17536
|
+
target: 'pending',
|
|
17537
|
+
},
|
|
17538
|
+
],
|
|
17539
|
+
},
|
|
17540
|
+
},
|
|
17541
|
+
updating: {
|
|
17542
|
+
invoke: {
|
|
17543
|
+
src: 'updatePageContent',
|
|
17544
|
+
onDone: {
|
|
17545
|
+
target: 'pending',
|
|
17546
|
+
actions: 'swapContent',
|
|
17547
|
+
},
|
|
17548
|
+
onError: {
|
|
17549
|
+
target: 'pending',
|
|
17550
|
+
},
|
|
17551
|
+
},
|
|
17552
|
+
},
|
|
17553
|
+
},
|
|
17554
|
+
},
|
|
17555
|
+
oldTimer: {
|
|
17556
|
+
initial: 'fetchingGameSHA',
|
|
17557
|
+
states: {
|
|
17558
|
+
fetchingGameSHA: {
|
|
17559
|
+
invoke: {
|
|
17560
|
+
src: 'fetchGameSHA',
|
|
17561
|
+
onDone: {
|
|
17562
|
+
target: 'checking',
|
|
17563
|
+
actions: 'setGameSHA',
|
|
17564
|
+
},
|
|
17565
|
+
onError: {
|
|
17566
|
+
target: 'pending',
|
|
17567
|
+
},
|
|
17568
|
+
},
|
|
17569
|
+
},
|
|
17570
|
+
checking: {
|
|
17571
|
+
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17572
|
+
},
|
|
17573
|
+
updatingStatus: {
|
|
17574
|
+
invoke: {
|
|
17575
|
+
src: 'fetchStatus',
|
|
17576
|
+
onDone: {
|
|
17577
|
+
target: 'updatingOption',
|
|
17578
|
+
actions: ['setStatus'],
|
|
17579
|
+
},
|
|
17580
|
+
onError: {
|
|
17581
|
+
target: 'pending',
|
|
17582
|
+
},
|
|
17583
|
+
},
|
|
17584
|
+
},
|
|
17585
|
+
updatingOption: {
|
|
17586
|
+
invoke: {
|
|
17587
|
+
src: 'fetchOption',
|
|
17588
|
+
onDone: {
|
|
17589
|
+
target: 'pending',
|
|
17590
|
+
actions: 'mergeOption',
|
|
17591
|
+
},
|
|
17592
|
+
onError: {
|
|
17593
|
+
target: 'pending',
|
|
17594
|
+
},
|
|
17595
|
+
},
|
|
17596
|
+
},
|
|
17597
|
+
pending: {
|
|
17598
|
+
after: {
|
|
17599
|
+
20000: {
|
|
17600
|
+
target: 'fetchingGameSHA',
|
|
17601
|
+
},
|
|
17602
|
+
},
|
|
17603
|
+
},
|
|
17604
|
+
},
|
|
17605
|
+
},
|
|
17606
|
+
},
|
|
17607
|
+
},
|
|
17608
|
+
{
|
|
17609
|
+
actions: {
|
|
17610
|
+
setFavoriteList: assign((context, event) => {
|
|
17611
|
+
return {
|
|
17612
|
+
favoriteList: event.data.data || [],
|
|
17613
|
+
}
|
|
17614
|
+
}),
|
|
17615
|
+
setRoom: assign((context, event) => {
|
|
17616
|
+
return {
|
|
17617
|
+
room: event.data,
|
|
17618
|
+
}
|
|
17619
|
+
}),
|
|
17620
|
+
resetContent: assign((context, event) => {
|
|
17621
|
+
return {
|
|
17622
|
+
index: 0,
|
|
17623
|
+
content: {
|
|
17624
|
+
data: [],
|
|
17625
|
+
timestamp: null,
|
|
17626
|
+
parentCategoryId: null,
|
|
17627
|
+
totalPage: 1,
|
|
17628
|
+
},
|
|
17629
|
+
addition: {
|
|
17630
|
+
data: [],
|
|
17631
|
+
timestamp: null,
|
|
17632
|
+
totalPage: 1,
|
|
17633
|
+
},
|
|
17634
|
+
}
|
|
17635
|
+
}),
|
|
17636
|
+
appendContent: assign((context, event) => {
|
|
17637
|
+
const { room, favoriteList } = context;
|
|
17638
|
+
if (room.categoryId === GAME_SEARCH) {
|
|
17639
|
+
return
|
|
17640
|
+
} else {
|
|
17641
|
+
const [content, addition] = event.data;
|
|
17642
|
+
return {
|
|
17643
|
+
content: {
|
|
17644
|
+
...context.content,
|
|
17645
|
+
...content,
|
|
17646
|
+
data: context.content.data.concat(content.data),
|
|
17647
|
+
},
|
|
17648
|
+
addition: {
|
|
17649
|
+
...context.addition,
|
|
17650
|
+
...addition,
|
|
17651
|
+
data: context.addition.data.concat(addition.data),
|
|
17652
|
+
},
|
|
17653
|
+
}
|
|
17654
|
+
}
|
|
17655
|
+
}),
|
|
17656
|
+
swapContent: assign((context, event) => {
|
|
17657
|
+
const [content, addition] = event.data;
|
|
17658
|
+
let result = {};
|
|
17659
|
+
if (content?.data?.length) {
|
|
17660
|
+
result.content = content;
|
|
17661
|
+
}
|
|
17662
|
+
if (addition?.data?.length) {
|
|
17663
|
+
result.addition = addition;
|
|
17664
|
+
}
|
|
17665
|
+
return result
|
|
17666
|
+
}),
|
|
17667
|
+
increaseIndex: assign((context, event) => {
|
|
17668
|
+
return {
|
|
17669
|
+
index: context.index + 1,
|
|
17670
|
+
}
|
|
17671
|
+
}),
|
|
17672
|
+
setGameURL: assign({
|
|
17673
|
+
gameURL: (context, event) => {
|
|
17674
|
+
return event.data.gameURL
|
|
17675
|
+
},
|
|
17676
|
+
}),
|
|
17677
|
+
clearGameInfo: assign((context, event) => {
|
|
17678
|
+
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
17679
|
+
}),
|
|
17680
|
+
setGameInfo: assign((context, event) => {
|
|
17681
|
+
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
17682
|
+
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
17683
|
+
}),
|
|
17684
|
+
setLang: assign((context, event) => {
|
|
17685
|
+
const lang = event.data.locale.replace('-', '_');
|
|
17686
|
+
return { lang }
|
|
17687
|
+
}),
|
|
17688
|
+
...oldActions$1,
|
|
17689
|
+
},
|
|
17690
|
+
guards: {
|
|
17691
|
+
isDifferentRoom: (context, event) => context.room?.categoryId !== event.data?.categoryId,
|
|
17692
|
+
hasNext: (context, event) => context.index < context?.content?.totalPage - 1,
|
|
17693
|
+
hasRoom: (context, event) => context.room?.categoryId,
|
|
17694
|
+
...oldGuards$1,
|
|
17695
|
+
},
|
|
17696
|
+
services: {
|
|
17697
|
+
getPageContent: async (context, event) => {
|
|
17698
|
+
const { room, index } = context;
|
|
17699
|
+
if (room.categoryId === GAME_SEARCH) {
|
|
17700
|
+
return
|
|
17701
|
+
} else {
|
|
17702
|
+
const param = { categoryId: room.categoryId, index };
|
|
17703
|
+
return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
|
|
17704
|
+
}
|
|
17705
|
+
},
|
|
17706
|
+
updatePageContent: async (context, event) => {
|
|
17707
|
+
const { room, content, index } = context;
|
|
17708
|
+
if (room.categoryId === GAME_SEARCH) {
|
|
17709
|
+
return
|
|
17710
|
+
} else {
|
|
17711
|
+
return await Promise.all([
|
|
17712
|
+
request.send(
|
|
17713
|
+
game$1.getListCategoryByRange({
|
|
17714
|
+
categoryId: room.categoryId,
|
|
17715
|
+
end: index,
|
|
17716
|
+
timestamp: content.timestamp,
|
|
17717
|
+
})
|
|
17718
|
+
),
|
|
17719
|
+
request.send(
|
|
17720
|
+
game$1.getListAdditionByRange({
|
|
17721
|
+
categoryId: room.categoryId,
|
|
17722
|
+
end: index,
|
|
17723
|
+
timestamp: content.timestamp,
|
|
17724
|
+
})
|
|
17725
|
+
),
|
|
17726
|
+
])
|
|
17727
|
+
}
|
|
17728
|
+
},
|
|
17729
|
+
connectGame: async (context, event) => {
|
|
17730
|
+
const { lang, isMobile } = context;
|
|
17731
|
+
const { providerId, gameId, gameTypeId, mappingId } = context.game;
|
|
17732
|
+
const params = {
|
|
17733
|
+
provider_id: providerId,
|
|
17734
|
+
game_id: gameId,
|
|
17735
|
+
gametype_id: gameTypeId,
|
|
17736
|
+
mapping_id: mappingId,
|
|
17737
|
+
is_demo: false,
|
|
17738
|
+
is_mobile: isMobile,
|
|
17739
|
+
lang,
|
|
17740
|
+
return_url: window.location.href,
|
|
17741
|
+
};
|
|
17742
|
+
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17743
|
+
return { gameURL: redirect_url }
|
|
17744
|
+
},
|
|
17745
|
+
disconnectGame: async (context, event) => {
|
|
17746
|
+
const uid_site = event.data;
|
|
17747
|
+
const provider_id = context.game.providerId;
|
|
17748
|
+
return await request.send(game$1.logoutGame({ uid_site, provider_id }))
|
|
17749
|
+
},
|
|
17750
|
+
...oldServices$1(request),
|
|
17751
|
+
},
|
|
17752
|
+
}
|
|
17753
|
+
)
|
|
17754
|
+
}
|
|
17755
|
+
|
|
17756
|
+
const oldContext$1 = {
|
|
17757
|
+
sha: {
|
|
17758
|
+
status: null,
|
|
17759
|
+
},
|
|
17760
|
+
isStatusChanged: false,
|
|
17761
|
+
statusMap: {},
|
|
17762
|
+
optionMap: {},
|
|
17763
|
+
};
|
|
17764
|
+
|
|
17765
|
+
const oldActions$1 = {
|
|
17766
|
+
setGameSHA: assign((context, event) => {
|
|
17767
|
+
const { sha } = context;
|
|
17768
|
+
const newSha = event.data;
|
|
17769
|
+
return {
|
|
17770
|
+
sha: newSha,
|
|
17771
|
+
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17772
|
+
}
|
|
17773
|
+
}),
|
|
17774
|
+
setStatus: assign((context, event) => {
|
|
17775
|
+
return {
|
|
17776
|
+
statusMap: event.data,
|
|
17777
|
+
}
|
|
17778
|
+
}),
|
|
17779
|
+
mergeOption: assign((context, event) => {
|
|
17780
|
+
const { optionMap } = context;
|
|
17781
|
+
return {
|
|
17782
|
+
optionMap: { ...optionMap, ...event.data },
|
|
17783
|
+
}
|
|
17784
|
+
}),
|
|
17785
|
+
};
|
|
17786
|
+
|
|
17787
|
+
const oldGuards$1 = {
|
|
17788
|
+
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17789
|
+
};
|
|
17790
|
+
|
|
17791
|
+
const oldServices$1 = (request) => ({
|
|
17792
|
+
fetchOption: async (context, event) => {
|
|
17793
|
+
return await request.send(game$1.getOptionMap())
|
|
17794
|
+
},
|
|
17795
|
+
fetchGameSHA: async (context, event) => {
|
|
17796
|
+
return await request.send(game$1.getGameSHA())
|
|
17797
|
+
},
|
|
17798
|
+
fetchStatus: async (context, event) => {
|
|
17799
|
+
return await request.send(game$1.getGameStatus())
|
|
17800
|
+
},
|
|
17142
17801
|
});
|
|
17143
17802
|
|
|
17144
17803
|
// 對應 intersectionObserver 版本
|
|
@@ -17165,7 +17824,6 @@ function game_v2_1 (request) {
|
|
|
17165
17824
|
timestamp: null,
|
|
17166
17825
|
totalPage: 0,
|
|
17167
17826
|
},
|
|
17168
|
-
staticData: [],
|
|
17169
17827
|
// play params
|
|
17170
17828
|
game: {
|
|
17171
17829
|
providerId: null,
|
|
@@ -17186,9 +17844,6 @@ function game_v2_1 (request) {
|
|
|
17186
17844
|
idle: {
|
|
17187
17845
|
enter: 'clearGameInfo',
|
|
17188
17846
|
on: {
|
|
17189
|
-
SET_STATIC_DATA: {
|
|
17190
|
-
actions: 'setStaticData',
|
|
17191
|
-
},
|
|
17192
17847
|
SET_ADDITION_ENABLE: {
|
|
17193
17848
|
actions: 'setAdditionEnable',
|
|
17194
17849
|
},
|
|
@@ -17348,11 +18003,6 @@ function game_v2_1 (request) {
|
|
|
17348
18003
|
},
|
|
17349
18004
|
{
|
|
17350
18005
|
actions: {
|
|
17351
|
-
setStaticData: assign((context, event) => {
|
|
17352
|
-
return {
|
|
17353
|
-
staticData: event.data,
|
|
17354
|
-
}
|
|
17355
|
-
}),
|
|
17356
18006
|
setAdditionEnable: assign((context, event) => {
|
|
17357
18007
|
return {
|
|
17358
18008
|
additionEnable: event.data,
|
|
@@ -17369,13 +18019,17 @@ function game_v2_1 (request) {
|
|
|
17369
18019
|
isLastPage: index >= content?.totalPage - 1,
|
|
17370
18020
|
}
|
|
17371
18021
|
}),
|
|
18022
|
+
setFavoriteList: assign((context, event) => {
|
|
18023
|
+
return {
|
|
18024
|
+
favoriteList: event.data.data || [],
|
|
18025
|
+
}
|
|
18026
|
+
}),
|
|
17372
18027
|
setRoom: assign((context, event) => {
|
|
17373
18028
|
return {
|
|
17374
18029
|
room: event.data,
|
|
17375
18030
|
}
|
|
17376
18031
|
}),
|
|
17377
18032
|
resetContent: assign((context, event) => {
|
|
17378
|
-
console.log('resetContent');
|
|
17379
18033
|
return {
|
|
17380
18034
|
loadable: false,
|
|
17381
18035
|
isLastPage: false,
|
|
@@ -17467,44 +18121,32 @@ function game_v2_1 (request) {
|
|
|
17467
18121
|
},
|
|
17468
18122
|
services: {
|
|
17469
18123
|
getPageContent: async (context, event) => {
|
|
17470
|
-
const { room, index, additionEnable
|
|
18124
|
+
const { room, index, additionEnable } = context;
|
|
17471
18125
|
if (room.categoryId === GAME_SEARCH) {
|
|
17472
18126
|
return
|
|
17473
|
-
} else if (!request.getToken()) {
|
|
17474
|
-
const list = staticData.find((data) => data.category == room.categoryId)?.info || [];
|
|
17475
|
-
|
|
17476
|
-
return [
|
|
17477
|
-
{
|
|
17478
|
-
data: list.slice(index * 20, (index + 1) * 20),
|
|
17479
|
-
totalPage: Math.ceil(list.length / 20),
|
|
17480
|
-
timestamp: Math.floor(Date.now() / 1000),
|
|
17481
|
-
},
|
|
17482
|
-
]
|
|
17483
18127
|
} else if (additionEnable) {
|
|
17484
18128
|
const param = { categoryId: room.categoryId, index };
|
|
17485
|
-
return await Promise.all([request.send(game.getListCategory(param)), request.send(game.getListAddition(param))])
|
|
18129
|
+
return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
|
|
17486
18130
|
} else {
|
|
17487
18131
|
const param = { categoryId: room.categoryId, index };
|
|
17488
|
-
return await Promise.all([request.send(game.getListCategory(param))])
|
|
18132
|
+
return await Promise.all([request.send(game$1.getListCategory(param))])
|
|
17489
18133
|
}
|
|
17490
18134
|
},
|
|
17491
18135
|
updatePageContent: async (context, event) => {
|
|
17492
18136
|
const { room, content, index, additionEnable } = context;
|
|
17493
18137
|
if (room.categoryId === GAME_SEARCH) {
|
|
17494
18138
|
return
|
|
17495
|
-
} else if (!request.getToken()) {
|
|
17496
|
-
return []
|
|
17497
18139
|
} else if (additionEnable) {
|
|
17498
18140
|
return await Promise.all([
|
|
17499
18141
|
request.send(
|
|
17500
|
-
game.getListCategoryByRange({
|
|
18142
|
+
game$1.getListCategoryByRange({
|
|
17501
18143
|
categoryId: room.categoryId,
|
|
17502
18144
|
end: index,
|
|
17503
18145
|
timestamp: content.timestamp,
|
|
17504
18146
|
})
|
|
17505
18147
|
),
|
|
17506
18148
|
request.send(
|
|
17507
|
-
game.getListAdditionByRange({
|
|
18149
|
+
game$1.getListAdditionByRange({
|
|
17508
18150
|
categoryId: room.categoryId,
|
|
17509
18151
|
end: index,
|
|
17510
18152
|
timestamp: content.timestamp,
|
|
@@ -17514,7 +18156,7 @@ function game_v2_1 (request) {
|
|
|
17514
18156
|
} else {
|
|
17515
18157
|
return await Promise.all([
|
|
17516
18158
|
request.send(
|
|
17517
|
-
game.getListCategoryByRange({
|
|
18159
|
+
game$1.getListCategoryByRange({
|
|
17518
18160
|
categoryId: room.categoryId,
|
|
17519
18161
|
end: index,
|
|
17520
18162
|
timestamp: content.timestamp,
|
|
@@ -17537,13 +18179,13 @@ function game_v2_1 (request) {
|
|
|
17537
18179
|
lang,
|
|
17538
18180
|
return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
|
|
17539
18181
|
};
|
|
17540
|
-
const { redirect_url } = await request.send(game.playGame(params));
|
|
18182
|
+
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17541
18183
|
return { gameURL: redirect_url }
|
|
17542
18184
|
},
|
|
17543
18185
|
disconnectGame: async (context, event) => {
|
|
17544
18186
|
const uid_site = event.data;
|
|
17545
18187
|
const provider_id = context.game.providerId;
|
|
17546
|
-
return await request.send(game.logoutGame({ uid_site, provider_id }))
|
|
18188
|
+
return await request.send(game$1.logoutGame({ uid_site, provider_id }))
|
|
17547
18189
|
},
|
|
17548
18190
|
...oldServices(request),
|
|
17549
18191
|
},
|
|
@@ -17588,26 +18230,137 @@ const oldGuards = {
|
|
|
17588
18230
|
|
|
17589
18231
|
const oldServices = (request) => ({
|
|
17590
18232
|
fetchOption: async (context, event) => {
|
|
17591
|
-
|
|
17592
|
-
return await request.send(game.getOptionMap())
|
|
17593
|
-
}
|
|
18233
|
+
return await request.send(game$1.getOptionMap())
|
|
17594
18234
|
},
|
|
17595
18235
|
fetchGameSHA: async (context, event) => {
|
|
17596
|
-
|
|
17597
|
-
return await request.send(game.getGameSHA())
|
|
17598
|
-
} else {
|
|
17599
|
-
return {
|
|
17600
|
-
status: null,
|
|
17601
|
-
}
|
|
17602
|
-
}
|
|
18236
|
+
return await request.send(game$1.getGameSHA())
|
|
17603
18237
|
},
|
|
17604
18238
|
fetchStatus: async (context, event) => {
|
|
17605
|
-
|
|
17606
|
-
return await request.send(game.getGameStatus())
|
|
17607
|
-
}
|
|
18239
|
+
return await request.send(game$1.getGameStatus())
|
|
17608
18240
|
},
|
|
17609
18241
|
});
|
|
17610
18242
|
|
|
18243
|
+
function game_favorite (request) {
|
|
18244
|
+
return createMachine(
|
|
18245
|
+
{
|
|
18246
|
+
id: 'favorite',
|
|
18247
|
+
type: 'parallel',
|
|
18248
|
+
context: {
|
|
18249
|
+
list: [],
|
|
18250
|
+
},
|
|
18251
|
+
states: {
|
|
18252
|
+
fetching: {
|
|
18253
|
+
initial: 'disable',
|
|
18254
|
+
states: {
|
|
18255
|
+
disable: {},
|
|
18256
|
+
enable: {
|
|
18257
|
+
invoke: {
|
|
18258
|
+
src: 'fetchList',
|
|
18259
|
+
onDone: {
|
|
18260
|
+
actions: 'setList',
|
|
18261
|
+
},
|
|
18262
|
+
onError: {
|
|
18263
|
+
actions: assign({ list: [] }),
|
|
18264
|
+
},
|
|
18265
|
+
},
|
|
18266
|
+
},
|
|
18267
|
+
},
|
|
18268
|
+
},
|
|
18269
|
+
adding: {
|
|
18270
|
+
initial: 'disable',
|
|
18271
|
+
states: {
|
|
18272
|
+
disable: {},
|
|
18273
|
+
enable: {
|
|
18274
|
+
invoke: {
|
|
18275
|
+
src: 'add',
|
|
18276
|
+
onDone: {},
|
|
18277
|
+
onError: {
|
|
18278
|
+
actions: 'removeFromList',
|
|
18279
|
+
},
|
|
18280
|
+
},
|
|
18281
|
+
},
|
|
18282
|
+
},
|
|
18283
|
+
},
|
|
18284
|
+
removing: {
|
|
18285
|
+
initial: 'disable',
|
|
18286
|
+
states: {
|
|
18287
|
+
disable: {},
|
|
18288
|
+
enable: {
|
|
18289
|
+
invoke: {
|
|
18290
|
+
src: 'remove',
|
|
18291
|
+
onDone: {},
|
|
18292
|
+
onError: {
|
|
18293
|
+
actions: 'addToList',
|
|
18294
|
+
},
|
|
18295
|
+
},
|
|
18296
|
+
},
|
|
18297
|
+
},
|
|
18298
|
+
},
|
|
18299
|
+
},
|
|
18300
|
+
on: {
|
|
18301
|
+
FETCH_LIST: {
|
|
18302
|
+
target: 'fetching.enable',
|
|
18303
|
+
},
|
|
18304
|
+
ADD: {
|
|
18305
|
+
target: 'adding.enable',
|
|
18306
|
+
actions: 'addToList',
|
|
18307
|
+
cond: 'isNotExist',
|
|
18308
|
+
},
|
|
18309
|
+
REMOVE: {
|
|
18310
|
+
target: 'removing.enable',
|
|
18311
|
+
actions: 'removeFromList',
|
|
18312
|
+
cond: 'isExist',
|
|
18313
|
+
},
|
|
18314
|
+
},
|
|
18315
|
+
},
|
|
18316
|
+
{
|
|
18317
|
+
actions: {
|
|
18318
|
+
setList: assign((context, event) => {
|
|
18319
|
+
return {
|
|
18320
|
+
list: event.data,
|
|
18321
|
+
}
|
|
18322
|
+
}),
|
|
18323
|
+
addToList: assign((context, event) => {
|
|
18324
|
+
return {
|
|
18325
|
+
list: [...context.list, event.data],
|
|
18326
|
+
}
|
|
18327
|
+
}),
|
|
18328
|
+
removeFromList: assign((context, event) => {
|
|
18329
|
+
return {
|
|
18330
|
+
list: context.list.filter((item) => item !== event.data),
|
|
18331
|
+
}
|
|
18332
|
+
}),
|
|
18333
|
+
},
|
|
18334
|
+
guards: {
|
|
18335
|
+
isExist: (context, event) => context.list.includes(event.data),
|
|
18336
|
+
isNotExist: (context, event) => !context.list.includes(event.data),
|
|
18337
|
+
},
|
|
18338
|
+
services: {
|
|
18339
|
+
add: async (context, event) => {
|
|
18340
|
+
try {
|
|
18341
|
+
return await request.send(game$1.addFavoriteGame(event.data))
|
|
18342
|
+
} catch (error) {
|
|
18343
|
+
throw event.data
|
|
18344
|
+
}
|
|
18345
|
+
},
|
|
18346
|
+
remove: async (context, event) => {
|
|
18347
|
+
try {
|
|
18348
|
+
return await request.send(game$1.removeFavoriteGame(event.data))
|
|
18349
|
+
} catch (error) {
|
|
18350
|
+
throw event.data
|
|
18351
|
+
}
|
|
18352
|
+
},
|
|
18353
|
+
fetchList: async (context, event) => {
|
|
18354
|
+
const main = await request.send(game$1.getGameCategory({}));
|
|
18355
|
+
const room = main.list.find((item) => item.category === 'SYSTEM_MY_FAVORITE');
|
|
18356
|
+
const favorite = await request.send(game$1.getGameCategory({ id: room.id }));
|
|
18357
|
+
return favorite.list.map((item) => item.g)
|
|
18358
|
+
},
|
|
18359
|
+
},
|
|
18360
|
+
}
|
|
18361
|
+
)
|
|
18362
|
+
}
|
|
18363
|
+
|
|
17611
18364
|
function game_favorite_v2 (request) {
|
|
17612
18365
|
return createMachine(
|
|
17613
18366
|
{
|
|
@@ -17702,7 +18455,7 @@ function game_favorite_v2 (request) {
|
|
|
17702
18455
|
services: {
|
|
17703
18456
|
add: async (context, event) => {
|
|
17704
18457
|
try {
|
|
17705
|
-
await request.send(game.addListFavorite(event.data.gameCode));
|
|
18458
|
+
await request.send(game$1.addListFavorite(event.data.gameCode));
|
|
17706
18459
|
return event.data
|
|
17707
18460
|
} catch (error) {
|
|
17708
18461
|
throw event.data
|
|
@@ -17710,19 +18463,15 @@ function game_favorite_v2 (request) {
|
|
|
17710
18463
|
},
|
|
17711
18464
|
remove: async (context, event) => {
|
|
17712
18465
|
try {
|
|
17713
|
-
await request.send(game.removeListFavorite(event.data.gameCode));
|
|
18466
|
+
await request.send(game$1.removeListFavorite(event.data.gameCode));
|
|
17714
18467
|
return event.data
|
|
17715
18468
|
} catch (error) {
|
|
17716
18469
|
throw event.data
|
|
17717
18470
|
}
|
|
17718
18471
|
},
|
|
17719
18472
|
fetchList: async (context, event) => {
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
return data
|
|
17723
|
-
} else {
|
|
17724
|
-
return []
|
|
17725
|
-
}
|
|
18473
|
+
const { data } = await request.send(game$1.getListMyFavorite());
|
|
18474
|
+
return data
|
|
17726
18475
|
},
|
|
17727
18476
|
},
|
|
17728
18477
|
}
|
|
@@ -17954,17 +18703,17 @@ function game_search (request) {
|
|
|
17954
18703
|
services: {
|
|
17955
18704
|
fetchTags: async (context, event) => {
|
|
17956
18705
|
const { keyword } = context;
|
|
17957
|
-
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
18706
|
+
const { result } = await request.send(game$1.getGameTags({ q: keyword }));
|
|
17958
18707
|
return result
|
|
17959
18708
|
},
|
|
17960
18709
|
fetchGames: async (context, event) => {
|
|
17961
18710
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
17962
|
-
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18711
|
+
const { traceId, result } = await request.send(game$1.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
17963
18712
|
return { traceId, result }
|
|
17964
18713
|
},
|
|
17965
18714
|
sendTrace: async (context, event) => {
|
|
17966
18715
|
const { traceId, tagId, tagIndex, gameCode, gameCodeIndex, keyword: query, click, clickDefault } = context;
|
|
17967
|
-
return await request.send(game.setGameSearchTrace({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }))
|
|
18716
|
+
return await request.send(game$1.setGameSearchTrace({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }))
|
|
17968
18717
|
},
|
|
17969
18718
|
},
|
|
17970
18719
|
}
|
|
@@ -18297,16 +19046,16 @@ function game_search_v2 (request) {
|
|
|
18297
19046
|
services: {
|
|
18298
19047
|
fetchTags: async (context, event) => {
|
|
18299
19048
|
const { keyword } = context;
|
|
18300
|
-
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
19049
|
+
const { result } = await request.send(game$1.getGameTags({ q: keyword }));
|
|
18301
19050
|
return result
|
|
18302
19051
|
},
|
|
18303
19052
|
fetchInitialData: async (context, event) => {
|
|
18304
|
-
const data = await request.send(game.getGameSearchHome());
|
|
19053
|
+
const data = await request.send(game$1.getGameSearchHome());
|
|
18305
19054
|
return data
|
|
18306
19055
|
},
|
|
18307
19056
|
fetchGames: async (context, event) => {
|
|
18308
19057
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
18309
|
-
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
19058
|
+
const { traceId, result } = await request.send(game$1.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18310
19059
|
return { traceId, result }
|
|
18311
19060
|
},
|
|
18312
19061
|
sendTrace: async (context, event) => {
|
|
@@ -18328,7 +19077,7 @@ function game_search_v2 (request) {
|
|
|
18328
19077
|
id = null;
|
|
18329
19078
|
}
|
|
18330
19079
|
return await request.send(
|
|
18331
|
-
game.setGameSearchTrace({
|
|
19080
|
+
game$1.setGameSearchTrace({
|
|
18332
19081
|
traceId,
|
|
18333
19082
|
tagId: id,
|
|
18334
19083
|
tagIndex,
|
|
@@ -18409,12 +19158,12 @@ function game_hot_new (request) {
|
|
|
18409
19158
|
},
|
|
18410
19159
|
services: {
|
|
18411
19160
|
getRoomItems: async (context, event) => {
|
|
18412
|
-
return await request.send(game.getGameCategory({ id: context.roomId }))
|
|
19161
|
+
return await request.send(game$1.getGameCategory({ id: context.roomId }))
|
|
18413
19162
|
},
|
|
18414
19163
|
getGames: async (context, event) => {
|
|
18415
19164
|
const [resHot, resNew] = await Promise.all([
|
|
18416
|
-
request.send(game.getGameCategory({ id: context.hot.id })),
|
|
18417
|
-
request.send(game.getGameCategory({ id: context.new.id })),
|
|
19165
|
+
request.send(game$1.getGameCategory({ id: context.hot.id })),
|
|
19166
|
+
request.send(game$1.getGameCategory({ id: context.new.id })),
|
|
18418
19167
|
]);
|
|
18419
19168
|
const hotGames = resHot?.list?.map?.((item) => item.g);
|
|
18420
19169
|
const newGames = resNew?.list?.map?.((item) => item.g);
|
|
@@ -19254,7 +20003,7 @@ function side (request) {
|
|
|
19254
20003
|
},
|
|
19255
20004
|
services: {
|
|
19256
20005
|
getRoomItems: async (context, event) => {
|
|
19257
|
-
return await request.send(game.getGameCategory({ id: context.room?.id }))
|
|
20006
|
+
return await request.send(game$1.getGameCategory({ id: context.room?.id }))
|
|
19258
20007
|
},
|
|
19259
20008
|
},
|
|
19260
20009
|
}
|
|
@@ -19418,10 +20167,10 @@ function side_v2 (request) {
|
|
|
19418
20167
|
},
|
|
19419
20168
|
services: {
|
|
19420
20169
|
getMenu: async (context, event) => {
|
|
19421
|
-
return await request.send(game.getListRoot())
|
|
20170
|
+
return await request.send(game$1.getListRoot())
|
|
19422
20171
|
},
|
|
19423
20172
|
fetchUpdateMenu: async (context, event) => {
|
|
19424
|
-
return await request.send(game.getListRoot({ timestamp: context.menu.timestamp }))
|
|
20173
|
+
return await request.send(game$1.getListRoot({ timestamp: context.menu.timestamp }))
|
|
19425
20174
|
},
|
|
19426
20175
|
},
|
|
19427
20176
|
}
|
|
@@ -27525,6 +28274,9 @@ var index$1 = {
|
|
|
27525
28274
|
common,
|
|
27526
28275
|
deposit,
|
|
27527
28276
|
error,
|
|
28277
|
+
game,
|
|
28278
|
+
game_v2,
|
|
28279
|
+
game_favorite,
|
|
27528
28280
|
game_favorite_v2,
|
|
27529
28281
|
game_search,
|
|
27530
28282
|
game_search_v2,
|
|
@@ -27579,8 +28331,8 @@ class Request {
|
|
|
27579
28331
|
this.axios.interceptors.request.use((axiosConfig) => {
|
|
27580
28332
|
axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version;
|
|
27581
28333
|
axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform;
|
|
27582
|
-
if (this.
|
|
27583
|
-
axiosConfig.headers.Authorization = this.
|
|
28334
|
+
if (storage.get(this.key)) {
|
|
28335
|
+
axiosConfig.headers.Authorization = storage.get(this.key);
|
|
27584
28336
|
}
|
|
27585
28337
|
return axiosConfig
|
|
27586
28338
|
});
|
|
@@ -27608,7 +28360,7 @@ class Request {
|
|
|
27608
28360
|
async send(req, customToken) {
|
|
27609
28361
|
try {
|
|
27610
28362
|
const cancelToken = customToken || this.source.token;
|
|
27611
|
-
this._checkToken(req);
|
|
28363
|
+
this._checkToken(req, storage.get(this.key));
|
|
27612
28364
|
const requestConfig = this._createConfig(req, cancelToken);
|
|
27613
28365
|
const { data } = await this.axios.request(requestConfig);
|
|
27614
28366
|
return data
|
|
@@ -27654,16 +28406,12 @@ class Request {
|
|
|
27654
28406
|
}
|
|
27655
28407
|
}
|
|
27656
28408
|
|
|
27657
|
-
_checkToken(req) {
|
|
27658
|
-
if (!req.isPublic && !
|
|
28409
|
+
_checkToken(req, token) {
|
|
28410
|
+
if (!req.isPublic && !token) {
|
|
27659
28411
|
console.error(req);
|
|
27660
28412
|
throw { code: 'ERR_A103', url: req.url }
|
|
27661
28413
|
}
|
|
27662
28414
|
}
|
|
27663
|
-
|
|
27664
|
-
getToken() {
|
|
27665
|
-
return storage.get(this.key)
|
|
27666
|
-
}
|
|
27667
28415
|
}
|
|
27668
28416
|
|
|
27669
28417
|
// const urljoin = require('url-join')
|