@jetthai/cuora 1.1.81 → 1.1.83-cash
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 +24 -0
- package/dist/bundle.mjs +194 -868
- package/package.json +1 -1
- package/src/machine/activity/deposit_activity.js +2 -2
- package/src/machine/activity/diamond_shop_activity_cash.js +215 -0
- package/src/machine/activity/fafafa_activity.js +35 -11
- package/src/machine/activity/index.js +4 -0
- package/src/machine/activity/otp_verified_activity.js +74 -0
- package/src/machine/activity/ranking_activity.js +31 -2
- package/src/machine/activity/specify_bets_activity.js +44 -3
- package/src/machine/activity/specify_turnover_activity.js +44 -3
- package/src/machine/deposit/index.js +2 -0
- package/src/machine/deposit/qrcode_v_cash.js +280 -0
- package/src/machine/game_favorite_v2.js +6 -2
- package/src/machine/game_v2_1.js +37 -10
- package/src/machine/index.js +2 -6
- package/src/machine/reward_cash.js +220 -0
- package/src/machine/user_info.js +8 -2
- package/src/machine/withdraw/withdraw_activity.js +383 -0
- package/src/request/request.js +9 -5
- package/src/util/index.js +2 -1
- package/src/util/math.js +4 -0
- package/src/machine/game.js +0 -285
- package/src/machine/game_favorite.js +0 -123
- package/src/machine/game_v2.js +0 -381
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 = {
|
|
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
|
|
3937
|
+
var index$2 = { activity: api, auth: auth$1, common: common$1, game, mailbox, payment, user, form };
|
|
3938
3938
|
|
|
3939
3939
|
/*! *****************************************************************************
|
|
3940
3940
|
Copyright (c) Microsoft Corporation.
|
|
@@ -9196,6 +9196,78 @@ function activity$1 (request) {
|
|
|
9196
9196
|
)
|
|
9197
9197
|
}
|
|
9198
9198
|
|
|
9199
|
+
function otp_verified_activity (request) {
|
|
9200
|
+
const { appSecret } = request.config;
|
|
9201
|
+
return createMachine(
|
|
9202
|
+
{
|
|
9203
|
+
id: 'otp_verified_activity',
|
|
9204
|
+
context: {
|
|
9205
|
+
activityNo: null,
|
|
9206
|
+
activityDetail: null,
|
|
9207
|
+
stages: [],
|
|
9208
|
+
currentStage: {},
|
|
9209
|
+
receiveNo: null,
|
|
9210
|
+
rewardType: '',
|
|
9211
|
+
callback: () => {},
|
|
9212
|
+
},
|
|
9213
|
+
initial: 'idle',
|
|
9214
|
+
states: {
|
|
9215
|
+
idle: {
|
|
9216
|
+
on: {
|
|
9217
|
+
SET_ACTIVITY_NO: {
|
|
9218
|
+
target: 'loading',
|
|
9219
|
+
actions: 'setActivityNo',
|
|
9220
|
+
},
|
|
9221
|
+
},
|
|
9222
|
+
},
|
|
9223
|
+
loading: {
|
|
9224
|
+
invoke: {
|
|
9225
|
+
src: 'fetchActivityDetail',
|
|
9226
|
+
onDone: {
|
|
9227
|
+
target: 'loaded',
|
|
9228
|
+
actions: 'setActivityDetail',
|
|
9229
|
+
},
|
|
9230
|
+
onError: {
|
|
9231
|
+
target: 'idle',
|
|
9232
|
+
},
|
|
9233
|
+
},
|
|
9234
|
+
},
|
|
9235
|
+
loaded: {
|
|
9236
|
+
always: [{ target: 'received', cond: 'isReceived' }],
|
|
9237
|
+
},
|
|
9238
|
+
received: {},
|
|
9239
|
+
},
|
|
9240
|
+
},
|
|
9241
|
+
{
|
|
9242
|
+
actions: {
|
|
9243
|
+
setActivityNo: assign((context, event) => {
|
|
9244
|
+
return {
|
|
9245
|
+
activityNo: event.data,
|
|
9246
|
+
}
|
|
9247
|
+
}),
|
|
9248
|
+
setActivityDetail: assign((context, event) => {
|
|
9249
|
+
return {
|
|
9250
|
+
activityDetail: event.data,
|
|
9251
|
+
}
|
|
9252
|
+
}),
|
|
9253
|
+
},
|
|
9254
|
+
guards: {
|
|
9255
|
+
isReceived: (context, event) => {
|
|
9256
|
+
const { receiveStatus } = context.activityDetail;
|
|
9257
|
+
return receiveStatus === 1
|
|
9258
|
+
},
|
|
9259
|
+
},
|
|
9260
|
+
services: {
|
|
9261
|
+
fetchActivityDetail: async (context, event) => {
|
|
9262
|
+
const { activityNo } = context;
|
|
9263
|
+
const { data } = await request.send(api.getActivityDetail({ activityNo, appSecret }));
|
|
9264
|
+
return data
|
|
9265
|
+
},
|
|
9266
|
+
},
|
|
9267
|
+
}
|
|
9268
|
+
)
|
|
9269
|
+
}
|
|
9270
|
+
|
|
9199
9271
|
var activity = {
|
|
9200
9272
|
continue_deposit_activity,
|
|
9201
9273
|
deposit_activity,
|
|
@@ -9213,6 +9285,7 @@ var activity = {
|
|
|
9213
9285
|
mini_game_activity,
|
|
9214
9286
|
roulette_activity_v2,
|
|
9215
9287
|
activity: activity$1,
|
|
9288
|
+
otp_verified_activity,
|
|
9216
9289
|
};
|
|
9217
9290
|
|
|
9218
9291
|
var urlJoin = {exports: {}};
|
|
@@ -17029,724 +17102,65 @@ function error () {
|
|
|
17029
17102
|
},
|
|
17030
17103
|
},
|
|
17031
17104
|
error: {
|
|
17032
|
-
initial: 'unknown',
|
|
17033
|
-
states: {
|
|
17034
|
-
unknown: {
|
|
17035
|
-
always: [
|
|
17036
|
-
{ target: 'logout', cond: 'isLogout' },
|
|
17037
|
-
{ target: 'deposit', cond: 'isNoBalance' },
|
|
17038
|
-
{ target: 'unfinishedGame', cond: 'isUnfinishedGame', actions: 'setUnfinishedGame' },
|
|
17039
|
-
// { target: 'hall' },
|
|
17040
|
-
],
|
|
17041
|
-
},
|
|
17042
|
-
logout: {},
|
|
17043
|
-
deposit: {},
|
|
17044
|
-
unfinishedGame: {},
|
|
17045
|
-
// hall: {},
|
|
17046
|
-
},
|
|
17047
|
-
},
|
|
17048
|
-
},
|
|
17049
|
-
on: {
|
|
17050
|
-
SOLVE: {
|
|
17051
|
-
target: 'normal',
|
|
17052
|
-
actions: 'solveError',
|
|
17053
|
-
},
|
|
17054
|
-
},
|
|
17055
|
-
},
|
|
17056
|
-
{
|
|
17057
|
-
actions: {
|
|
17058
|
-
setError: assign((context, event) => {
|
|
17059
|
-
return { error: event.data }
|
|
17060
|
-
}),
|
|
17061
|
-
solveError: assign({ error: null }),
|
|
17062
|
-
setUnfinishedGame: assign((context, event) => {
|
|
17063
|
-
return {
|
|
17064
|
-
gameCode: context.error.extend.split(/_(.+)/)[1],
|
|
17065
|
-
}
|
|
17066
|
-
}),
|
|
17067
|
-
},
|
|
17068
|
-
guards: {
|
|
17069
|
-
isLogout: (context, event) => {
|
|
17070
|
-
return ['ERR_A201', 'ERR_A204', 'ERR_A103', 'ERR_A104', 'ERR_A108', 'ERR_F108', 'ERR_A113'].includes(context.error.code)
|
|
17071
|
-
},
|
|
17072
|
-
isNoBalance: (context, event) => {
|
|
17073
|
-
return context.error.code === 'ERR_G106'
|
|
17074
|
-
},
|
|
17075
|
-
isUnfinishedGame: (context, event) => {
|
|
17076
|
-
return context.error.extend?.includes?.('unfinished_')
|
|
17077
|
-
},
|
|
17078
|
-
},
|
|
17079
|
-
services: {},
|
|
17080
|
-
}
|
|
17081
|
-
)
|
|
17082
|
-
}
|
|
17083
|
-
|
|
17084
|
-
// const UAParser = require('ua-parser-js')
|
|
17085
|
-
|
|
17086
|
-
function game (request) {
|
|
17087
|
-
return createMachine(
|
|
17088
|
-
{
|
|
17089
|
-
id: 'game',
|
|
17090
|
-
type: 'parallel',
|
|
17091
|
-
context: {
|
|
17092
|
-
roomId: null,
|
|
17093
|
-
room: null,
|
|
17094
|
-
list: [],
|
|
17095
|
-
gameList: [],
|
|
17096
|
-
// play params
|
|
17097
|
-
game: {
|
|
17098
|
-
provider: null,
|
|
17099
|
-
game_id: null,
|
|
17100
|
-
game_type: null,
|
|
17101
|
-
mapping_id: null,
|
|
17102
|
-
portrait: null,
|
|
17103
|
-
},
|
|
17104
|
-
lang: 'en_US',
|
|
17105
|
-
isMobile: new UAParser().getResult().device.type,
|
|
17106
|
-
gameURL: null,
|
|
17107
|
-
// game database
|
|
17108
|
-
sha: {
|
|
17109
|
-
category: null,
|
|
17110
|
-
status: null,
|
|
17111
|
-
},
|
|
17112
|
-
isCategoryChanged: false,
|
|
17113
|
-
isStatusChanged: false,
|
|
17114
|
-
statusMap: {},
|
|
17115
|
-
optionMap: {},
|
|
17116
|
-
},
|
|
17117
|
-
states: {
|
|
17118
|
-
flow: {
|
|
17119
|
-
initial: 'idle',
|
|
17120
|
-
states: {
|
|
17121
|
-
idle: {
|
|
17122
|
-
enter: 'clearGameInfo',
|
|
17123
|
-
on: {
|
|
17124
|
-
SET_ROOM: {
|
|
17125
|
-
target: 'loading',
|
|
17126
|
-
actions: 'setRoom',
|
|
17127
|
-
cond: (context, event) => {
|
|
17128
|
-
return context.room?.id !== event.data?.id
|
|
17129
|
-
},
|
|
17130
|
-
},
|
|
17131
|
-
ENTER_GAME: {
|
|
17132
|
-
target: 'connecting',
|
|
17133
|
-
actions: ['setGameInfo', 'setLang'],
|
|
17134
|
-
},
|
|
17135
|
-
},
|
|
17136
|
-
},
|
|
17137
|
-
loading: {
|
|
17138
|
-
invoke: {
|
|
17139
|
-
src: 'getRoomItems',
|
|
17140
|
-
onDone: {
|
|
17141
|
-
target: 'idle',
|
|
17142
|
-
actions: 'setList',
|
|
17143
|
-
},
|
|
17144
|
-
onError: {
|
|
17145
|
-
target: 'idle',
|
|
17146
|
-
actions: assign({ list: [] }),
|
|
17147
|
-
},
|
|
17148
|
-
},
|
|
17149
|
-
},
|
|
17150
|
-
connecting: {
|
|
17151
|
-
invoke: {
|
|
17152
|
-
src: 'connectGame',
|
|
17153
|
-
onDone: {
|
|
17154
|
-
target: 'playing',
|
|
17155
|
-
actions: 'setGameURL',
|
|
17156
|
-
},
|
|
17157
|
-
onError: {
|
|
17158
|
-
target: 'idle',
|
|
17159
|
-
},
|
|
17160
|
-
},
|
|
17161
|
-
},
|
|
17162
|
-
playing: {
|
|
17163
|
-
on: {
|
|
17164
|
-
EXIT_GAME: {
|
|
17165
|
-
target: 'disconnect',
|
|
17166
|
-
},
|
|
17167
|
-
},
|
|
17168
|
-
},
|
|
17169
|
-
disconnect: {
|
|
17170
|
-
invoke: {
|
|
17171
|
-
src: 'disconnectGame',
|
|
17172
|
-
onDone: {
|
|
17173
|
-
target: 'idle',
|
|
17174
|
-
},
|
|
17175
|
-
onError: {
|
|
17176
|
-
target: 'idle',
|
|
17177
|
-
},
|
|
17178
|
-
},
|
|
17179
|
-
},
|
|
17180
|
-
},
|
|
17181
|
-
},
|
|
17182
|
-
timer: {
|
|
17183
|
-
initial: 'fetchingGameSHA',
|
|
17184
|
-
states: {
|
|
17185
|
-
fetchingGameSHA: {
|
|
17186
|
-
invoke: {
|
|
17187
|
-
src: 'fetchGameSHA',
|
|
17188
|
-
onDone: {
|
|
17189
|
-
target: 'checking',
|
|
17190
|
-
actions: 'setGameSHA',
|
|
17191
|
-
},
|
|
17192
|
-
onError: {
|
|
17193
|
-
target: 'pending',
|
|
17194
|
-
},
|
|
17195
|
-
},
|
|
17196
|
-
},
|
|
17197
|
-
checking: {
|
|
17198
|
-
always: [
|
|
17199
|
-
{ target: 'updatingStatus', cond: 'isStatusChanged' },
|
|
17200
|
-
{ target: 'updatingCategory', cond: 'isCategoryChanged' },
|
|
17201
|
-
{ target: 'pending' },
|
|
17202
|
-
],
|
|
17203
|
-
},
|
|
17204
|
-
updatingStatus: {
|
|
17205
|
-
invoke: {
|
|
17206
|
-
src: 'fetchStatus',
|
|
17207
|
-
onDone: {
|
|
17208
|
-
target: 'updatingOption',
|
|
17209
|
-
actions: ['setStatus'],
|
|
17210
|
-
},
|
|
17211
|
-
onError: {
|
|
17212
|
-
target: 'pending',
|
|
17213
|
-
},
|
|
17214
|
-
},
|
|
17215
|
-
},
|
|
17216
|
-
updatingOption: {
|
|
17217
|
-
invoke: {
|
|
17218
|
-
src: 'fetchOption',
|
|
17219
|
-
onDone: {
|
|
17220
|
-
target: 'updatingCategory',
|
|
17221
|
-
actions: 'mergeOption',
|
|
17222
|
-
},
|
|
17223
|
-
onError: {
|
|
17224
|
-
target: 'pending',
|
|
17225
|
-
},
|
|
17226
|
-
},
|
|
17227
|
-
},
|
|
17228
|
-
updatingCategory: {
|
|
17229
|
-
invoke: {
|
|
17230
|
-
src: 'getRoomItems',
|
|
17231
|
-
onDone: {
|
|
17232
|
-
target: 'pending',
|
|
17233
|
-
actions: 'setList',
|
|
17234
|
-
},
|
|
17235
|
-
onError: {
|
|
17236
|
-
target: 'pending',
|
|
17237
|
-
},
|
|
17238
|
-
},
|
|
17239
|
-
},
|
|
17240
|
-
pending: {
|
|
17241
|
-
after: {
|
|
17242
|
-
20000: {
|
|
17243
|
-
target: 'fetchingGameSHA',
|
|
17244
|
-
},
|
|
17245
|
-
},
|
|
17246
|
-
},
|
|
17247
|
-
},
|
|
17248
|
-
},
|
|
17249
|
-
},
|
|
17250
|
-
},
|
|
17251
|
-
{
|
|
17252
|
-
actions: {
|
|
17253
|
-
setRoomId: assign((context, event) => {
|
|
17254
|
-
return { roomId: event.roomId }
|
|
17255
|
-
}),
|
|
17256
|
-
setRoom: assign((context, event) => {
|
|
17257
|
-
return {
|
|
17258
|
-
room: event.data,
|
|
17259
|
-
roomId: event.data.id,
|
|
17260
|
-
}
|
|
17261
|
-
}),
|
|
17262
|
-
setList: assign((context, event) => {
|
|
17263
|
-
const { statusMap, optionMap } = context;
|
|
17264
|
-
const { list = [] } = event.data;
|
|
17265
|
-
const gameList = list
|
|
17266
|
-
.map((item) => {
|
|
17267
|
-
if (item.id) {
|
|
17268
|
-
item.room = true;
|
|
17269
|
-
return item
|
|
17270
|
-
}
|
|
17271
|
-
|
|
17272
|
-
const code = item.g;
|
|
17273
|
-
if (!code || !optionMap[code]) {
|
|
17274
|
-
return
|
|
17275
|
-
}
|
|
17276
|
-
|
|
17277
|
-
return {
|
|
17278
|
-
...optionMap[code],
|
|
17279
|
-
code,
|
|
17280
|
-
system_enable: statusMap[code][0],
|
|
17281
|
-
}
|
|
17282
|
-
})
|
|
17283
|
-
.filter((item) => item && !item.header)
|
|
17284
|
-
.sort((a, b) => a.system_enable - b.system_enable);
|
|
17285
|
-
return { list, gameList }
|
|
17286
|
-
}),
|
|
17287
|
-
setGameURL: assign({
|
|
17288
|
-
gameURL: (context, event) => {
|
|
17289
|
-
return event.data.gameURL
|
|
17290
|
-
},
|
|
17291
|
-
}),
|
|
17292
|
-
clearGameInfo: assign((context, event) => {
|
|
17293
|
-
return { game: { provider: null, game_id: null, game_type: null, mapping_id: null } }
|
|
17294
|
-
}),
|
|
17295
|
-
setGameInfo: assign((context, event) => {
|
|
17296
|
-
const { provider, game_id, game_type, mapping_id, portrait } = event.data.game;
|
|
17297
|
-
return { game: { provider, game_id, game_type, mapping_id, portrait } }
|
|
17298
|
-
}),
|
|
17299
|
-
setLang: assign((context, event) => {
|
|
17300
|
-
const lang = event.data.locale.replace('-', '_');
|
|
17301
|
-
return { lang }
|
|
17302
|
-
}),
|
|
17303
|
-
setGameSHA: assign((context, event) => {
|
|
17304
|
-
const { sha } = context;
|
|
17305
|
-
const newSha = event.data;
|
|
17306
|
-
return {
|
|
17307
|
-
sha: newSha,
|
|
17308
|
-
isCategoryChanged: !sha.category || sha.category !== newSha.category,
|
|
17309
|
-
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17310
|
-
}
|
|
17311
|
-
}),
|
|
17312
|
-
setStatus: assign((context, event) => {
|
|
17313
|
-
return {
|
|
17314
|
-
statusMap: event.data,
|
|
17315
|
-
}
|
|
17316
|
-
}),
|
|
17317
|
-
mergeOption: assign((context, event) => {
|
|
17318
|
-
const { optionMap } = context;
|
|
17319
|
-
return {
|
|
17320
|
-
optionMap: { ...optionMap, ...event.data },
|
|
17321
|
-
}
|
|
17322
|
-
}),
|
|
17323
|
-
},
|
|
17324
|
-
guards: {
|
|
17325
|
-
isCategoryChanged: (context, event) => context.isCategoryChanged,
|
|
17326
|
-
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17327
|
-
},
|
|
17328
|
-
services: {
|
|
17329
|
-
getRoomItems: async (context, event) => {
|
|
17330
|
-
return await request.send(game$1.getGameCategory({ id: context.roomId }))
|
|
17331
|
-
},
|
|
17332
|
-
connectGame: async (context, event) => {
|
|
17333
|
-
const { lang, isMobile } = context;
|
|
17334
|
-
const { provider, game_id, game_type, mapping_id } = context.game;
|
|
17335
|
-
const params = {
|
|
17336
|
-
provider_id: provider,
|
|
17337
|
-
game_id: game_id,
|
|
17338
|
-
gametype_id: game_type,
|
|
17339
|
-
mapping_id: mapping_id,
|
|
17340
|
-
is_demo: false,
|
|
17341
|
-
is_mobile: isMobile,
|
|
17342
|
-
lang,
|
|
17343
|
-
return_url: window.location.href,
|
|
17344
|
-
};
|
|
17345
|
-
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17346
|
-
return { gameURL: redirect_url }
|
|
17347
|
-
},
|
|
17348
|
-
disconnectGame: async (context, event) => {
|
|
17349
|
-
const uid_site = event.data;
|
|
17350
|
-
return await request.send(game$1.logoutGame({ uid_site, provider_id: context.game.provider }))
|
|
17351
|
-
},
|
|
17352
|
-
fetchOption: async (context, event) => {
|
|
17353
|
-
return await request.send(game$1.getOptionMap())
|
|
17354
|
-
},
|
|
17355
|
-
fetchGameSHA: async (context, event) => {
|
|
17356
|
-
return await request.send(game$1.getGameSHA())
|
|
17357
|
-
},
|
|
17358
|
-
fetchStatus: async (context, event) => {
|
|
17359
|
-
return await request.send(game$1.getGameStatus())
|
|
17360
|
-
},
|
|
17361
|
-
},
|
|
17362
|
-
}
|
|
17363
|
-
)
|
|
17364
|
-
}
|
|
17365
|
-
|
|
17366
|
-
const MY_FAVORITE = 'MyFavorite';
|
|
17367
|
-
const GAME_SEARCH = 'GameSearch';
|
|
17368
|
-
|
|
17369
|
-
var constant = /*#__PURE__*/Object.freeze({
|
|
17370
|
-
__proto__: null,
|
|
17371
|
-
MY_FAVORITE: MY_FAVORITE,
|
|
17372
|
-
GAME_SEARCH: GAME_SEARCH
|
|
17373
|
-
});
|
|
17374
|
-
|
|
17375
|
-
function game_v2 (request) {
|
|
17376
|
-
return createMachine(
|
|
17377
|
-
{
|
|
17378
|
-
id: 'game',
|
|
17379
|
-
type: 'parallel',
|
|
17380
|
-
context: {
|
|
17381
|
-
room: null,
|
|
17382
|
-
index: 0,
|
|
17383
|
-
content: {
|
|
17384
|
-
data: [],
|
|
17385
|
-
timestamp: null,
|
|
17386
|
-
parentCategoryId: null,
|
|
17387
|
-
totalPage: 1,
|
|
17388
|
-
},
|
|
17389
|
-
addition: {
|
|
17390
|
-
data: [],
|
|
17391
|
-
timestamp: null,
|
|
17392
|
-
totalPage: 1,
|
|
17393
|
-
},
|
|
17394
|
-
// play params
|
|
17395
|
-
game: {
|
|
17396
|
-
providerId: null,
|
|
17397
|
-
gameId: null,
|
|
17398
|
-
gameTypeId: null,
|
|
17399
|
-
mappingId: null,
|
|
17400
|
-
portrait: null,
|
|
17401
|
-
},
|
|
17402
|
-
lang: 'en_US',
|
|
17403
|
-
isMobile: new UAParser().getResult().device.type,
|
|
17404
|
-
gameURL: null,
|
|
17405
|
-
...oldContext$1,
|
|
17406
|
-
},
|
|
17407
|
-
states: {
|
|
17408
|
-
flow: {
|
|
17409
|
-
initial: 'idle',
|
|
17410
|
-
states: {
|
|
17411
|
-
idle: {
|
|
17412
|
-
enter: 'clearGameInfo',
|
|
17413
|
-
on: {
|
|
17414
|
-
ENTER_ROOM: {
|
|
17415
|
-
target: 'loading',
|
|
17416
|
-
cond: 'isDifferentRoom',
|
|
17417
|
-
actions: ['setRoom', 'resetContent'],
|
|
17418
|
-
},
|
|
17419
|
-
NEXT_PAGE: {
|
|
17420
|
-
target: 'loading',
|
|
17421
|
-
cond: 'hasNext',
|
|
17422
|
-
actions: 'increaseIndex',
|
|
17423
|
-
},
|
|
17424
|
-
ENTER_GAME: {
|
|
17425
|
-
target: 'connecting',
|
|
17426
|
-
actions: ['setGameInfo', 'setLang'],
|
|
17427
|
-
},
|
|
17428
|
-
},
|
|
17429
|
-
},
|
|
17430
|
-
loading: {
|
|
17431
|
-
invoke: {
|
|
17432
|
-
src: 'getPageContent',
|
|
17433
|
-
onDone: {
|
|
17434
|
-
target: 'idle',
|
|
17435
|
-
actions: 'appendContent',
|
|
17436
|
-
},
|
|
17437
|
-
onError: {
|
|
17438
|
-
target: 'idle',
|
|
17439
|
-
},
|
|
17440
|
-
},
|
|
17441
|
-
},
|
|
17442
|
-
connecting: {
|
|
17443
|
-
invoke: {
|
|
17444
|
-
src: 'connectGame',
|
|
17445
|
-
onDone: {
|
|
17446
|
-
target: 'playing',
|
|
17447
|
-
actions: 'setGameURL',
|
|
17448
|
-
},
|
|
17449
|
-
onError: {
|
|
17450
|
-
target: 'idle',
|
|
17451
|
-
},
|
|
17452
|
-
},
|
|
17453
|
-
},
|
|
17454
|
-
playing: {
|
|
17455
|
-
on: {
|
|
17456
|
-
EXIT_GAME: {
|
|
17457
|
-
target: 'disconnect',
|
|
17458
|
-
},
|
|
17459
|
-
},
|
|
17460
|
-
},
|
|
17461
|
-
disconnect: {
|
|
17462
|
-
invoke: {
|
|
17463
|
-
src: 'disconnectGame',
|
|
17464
|
-
onDone: {
|
|
17465
|
-
target: 'idle',
|
|
17466
|
-
},
|
|
17467
|
-
onError: {
|
|
17468
|
-
target: 'idle',
|
|
17469
|
-
},
|
|
17470
|
-
},
|
|
17471
|
-
},
|
|
17472
|
-
},
|
|
17473
|
-
},
|
|
17474
|
-
timer: {
|
|
17475
|
-
initial: 'pending',
|
|
17476
|
-
states: {
|
|
17477
|
-
pending: {
|
|
17478
|
-
after: {
|
|
17479
|
-
20000: [
|
|
17480
|
-
{
|
|
17481
|
-
target: 'updating',
|
|
17482
|
-
cond: 'hasRoom',
|
|
17483
|
-
},
|
|
17484
|
-
{
|
|
17485
|
-
target: 'pending',
|
|
17486
|
-
},
|
|
17487
|
-
],
|
|
17488
|
-
},
|
|
17489
|
-
},
|
|
17490
|
-
updating: {
|
|
17491
|
-
invoke: {
|
|
17492
|
-
src: 'updatePageContent',
|
|
17493
|
-
onDone: {
|
|
17494
|
-
target: 'pending',
|
|
17495
|
-
actions: 'swapContent',
|
|
17496
|
-
},
|
|
17497
|
-
onError: {
|
|
17498
|
-
target: 'pending',
|
|
17499
|
-
},
|
|
17500
|
-
},
|
|
17501
|
-
},
|
|
17502
|
-
},
|
|
17503
|
-
},
|
|
17504
|
-
oldTimer: {
|
|
17505
|
-
initial: 'fetchingGameSHA',
|
|
17506
|
-
states: {
|
|
17507
|
-
fetchingGameSHA: {
|
|
17508
|
-
invoke: {
|
|
17509
|
-
src: 'fetchGameSHA',
|
|
17510
|
-
onDone: {
|
|
17511
|
-
target: 'checking',
|
|
17512
|
-
actions: 'setGameSHA',
|
|
17513
|
-
},
|
|
17514
|
-
onError: {
|
|
17515
|
-
target: 'pending',
|
|
17516
|
-
},
|
|
17517
|
-
},
|
|
17518
|
-
},
|
|
17519
|
-
checking: {
|
|
17520
|
-
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17521
|
-
},
|
|
17522
|
-
updatingStatus: {
|
|
17523
|
-
invoke: {
|
|
17524
|
-
src: 'fetchStatus',
|
|
17525
|
-
onDone: {
|
|
17526
|
-
target: 'updatingOption',
|
|
17527
|
-
actions: ['setStatus'],
|
|
17528
|
-
},
|
|
17529
|
-
onError: {
|
|
17530
|
-
target: 'pending',
|
|
17531
|
-
},
|
|
17532
|
-
},
|
|
17533
|
-
},
|
|
17534
|
-
updatingOption: {
|
|
17535
|
-
invoke: {
|
|
17536
|
-
src: 'fetchOption',
|
|
17537
|
-
onDone: {
|
|
17538
|
-
target: 'pending',
|
|
17539
|
-
actions: 'mergeOption',
|
|
17540
|
-
},
|
|
17541
|
-
onError: {
|
|
17542
|
-
target: 'pending',
|
|
17543
|
-
},
|
|
17544
|
-
},
|
|
17545
|
-
},
|
|
17546
|
-
pending: {
|
|
17547
|
-
after: {
|
|
17548
|
-
20000: {
|
|
17549
|
-
target: 'fetchingGameSHA',
|
|
17550
|
-
},
|
|
17551
|
-
},
|
|
17552
|
-
},
|
|
17553
|
-
},
|
|
17554
|
-
},
|
|
17555
|
-
},
|
|
17556
|
-
},
|
|
17557
|
-
{
|
|
17558
|
-
actions: {
|
|
17559
|
-
setFavoriteList: assign((context, event) => {
|
|
17560
|
-
return {
|
|
17561
|
-
favoriteList: event.data.data || [],
|
|
17562
|
-
}
|
|
17563
|
-
}),
|
|
17564
|
-
setRoom: assign((context, event) => {
|
|
17565
|
-
return {
|
|
17566
|
-
room: event.data,
|
|
17567
|
-
}
|
|
17568
|
-
}),
|
|
17569
|
-
resetContent: assign((context, event) => {
|
|
17570
|
-
return {
|
|
17571
|
-
index: 0,
|
|
17572
|
-
content: {
|
|
17573
|
-
data: [],
|
|
17574
|
-
timestamp: null,
|
|
17575
|
-
parentCategoryId: null,
|
|
17576
|
-
totalPage: 1,
|
|
17577
|
-
},
|
|
17578
|
-
addition: {
|
|
17579
|
-
data: [],
|
|
17580
|
-
timestamp: null,
|
|
17581
|
-
totalPage: 1,
|
|
17582
|
-
},
|
|
17583
|
-
}
|
|
17584
|
-
}),
|
|
17585
|
-
appendContent: assign((context, event) => {
|
|
17586
|
-
const { room, favoriteList } = context;
|
|
17587
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17588
|
-
return
|
|
17589
|
-
} else {
|
|
17590
|
-
const [content, addition] = event.data;
|
|
17591
|
-
return {
|
|
17592
|
-
content: {
|
|
17593
|
-
...context.content,
|
|
17594
|
-
...content,
|
|
17595
|
-
data: context.content.data.concat(content.data),
|
|
17596
|
-
},
|
|
17597
|
-
addition: {
|
|
17598
|
-
...context.addition,
|
|
17599
|
-
...addition,
|
|
17600
|
-
data: context.addition.data.concat(addition.data),
|
|
17601
|
-
},
|
|
17602
|
-
}
|
|
17603
|
-
}
|
|
17604
|
-
}),
|
|
17605
|
-
swapContent: assign((context, event) => {
|
|
17606
|
-
const [content, addition] = event.data;
|
|
17607
|
-
let result = {};
|
|
17608
|
-
if (content?.data?.length) {
|
|
17609
|
-
result.content = content;
|
|
17610
|
-
}
|
|
17611
|
-
if (addition?.data?.length) {
|
|
17612
|
-
result.addition = addition;
|
|
17613
|
-
}
|
|
17614
|
-
return result
|
|
17105
|
+
initial: 'unknown',
|
|
17106
|
+
states: {
|
|
17107
|
+
unknown: {
|
|
17108
|
+
always: [
|
|
17109
|
+
{ target: 'logout', cond: 'isLogout' },
|
|
17110
|
+
{ target: 'deposit', cond: 'isNoBalance' },
|
|
17111
|
+
{ target: 'unfinishedGame', cond: 'isUnfinishedGame', actions: 'setUnfinishedGame' },
|
|
17112
|
+
// { target: 'hall' },
|
|
17113
|
+
],
|
|
17114
|
+
},
|
|
17115
|
+
logout: {},
|
|
17116
|
+
deposit: {},
|
|
17117
|
+
unfinishedGame: {},
|
|
17118
|
+
// hall: {},
|
|
17119
|
+
},
|
|
17120
|
+
},
|
|
17121
|
+
},
|
|
17122
|
+
on: {
|
|
17123
|
+
SOLVE: {
|
|
17124
|
+
target: 'normal',
|
|
17125
|
+
actions: 'solveError',
|
|
17126
|
+
},
|
|
17127
|
+
},
|
|
17128
|
+
},
|
|
17129
|
+
{
|
|
17130
|
+
actions: {
|
|
17131
|
+
setError: assign((context, event) => {
|
|
17132
|
+
return { error: event.data }
|
|
17615
17133
|
}),
|
|
17616
|
-
|
|
17134
|
+
solveError: assign({ error: null }),
|
|
17135
|
+
setUnfinishedGame: assign((context, event) => {
|
|
17617
17136
|
return {
|
|
17618
|
-
|
|
17137
|
+
gameCode: context.error.extend.split(/_(.+)/)[1],
|
|
17619
17138
|
}
|
|
17620
17139
|
}),
|
|
17621
|
-
setGameURL: assign({
|
|
17622
|
-
gameURL: (context, event) => {
|
|
17623
|
-
return event.data.gameURL
|
|
17624
|
-
},
|
|
17625
|
-
}),
|
|
17626
|
-
clearGameInfo: assign((context, event) => {
|
|
17627
|
-
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
17628
|
-
}),
|
|
17629
|
-
setGameInfo: assign((context, event) => {
|
|
17630
|
-
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
17631
|
-
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
17632
|
-
}),
|
|
17633
|
-
setLang: assign((context, event) => {
|
|
17634
|
-
const lang = event.data.locale.replace('-', '_');
|
|
17635
|
-
return { lang }
|
|
17636
|
-
}),
|
|
17637
|
-
...oldActions$1,
|
|
17638
17140
|
},
|
|
17639
17141
|
guards: {
|
|
17640
|
-
|
|
17641
|
-
|
|
17642
|
-
hasRoom: (context, event) => context.room?.categoryId,
|
|
17643
|
-
...oldGuards$1,
|
|
17644
|
-
},
|
|
17645
|
-
services: {
|
|
17646
|
-
getPageContent: async (context, event) => {
|
|
17647
|
-
const { room, index } = context;
|
|
17648
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17649
|
-
return
|
|
17650
|
-
} else {
|
|
17651
|
-
const param = { categoryId: room.categoryId, index };
|
|
17652
|
-
return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
|
|
17653
|
-
}
|
|
17654
|
-
},
|
|
17655
|
-
updatePageContent: async (context, event) => {
|
|
17656
|
-
const { room, content, index } = context;
|
|
17657
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17658
|
-
return
|
|
17659
|
-
} else {
|
|
17660
|
-
return await Promise.all([
|
|
17661
|
-
request.send(
|
|
17662
|
-
game$1.getListCategoryByRange({
|
|
17663
|
-
categoryId: room.categoryId,
|
|
17664
|
-
end: index,
|
|
17665
|
-
timestamp: content.timestamp,
|
|
17666
|
-
})
|
|
17667
|
-
),
|
|
17668
|
-
request.send(
|
|
17669
|
-
game$1.getListAdditionByRange({
|
|
17670
|
-
categoryId: room.categoryId,
|
|
17671
|
-
end: index,
|
|
17672
|
-
timestamp: content.timestamp,
|
|
17673
|
-
})
|
|
17674
|
-
),
|
|
17675
|
-
])
|
|
17676
|
-
}
|
|
17142
|
+
isLogout: (context, event) => {
|
|
17143
|
+
return ['ERR_A201', 'ERR_A204', 'ERR_A103', 'ERR_A104', 'ERR_A108', 'ERR_F108', 'ERR_A113'].includes(context.error.code)
|
|
17677
17144
|
},
|
|
17678
|
-
|
|
17679
|
-
|
|
17680
|
-
const { providerId, gameId, gameTypeId, mappingId } = context.game;
|
|
17681
|
-
const params = {
|
|
17682
|
-
provider_id: providerId,
|
|
17683
|
-
game_id: gameId,
|
|
17684
|
-
gametype_id: gameTypeId,
|
|
17685
|
-
mapping_id: mappingId,
|
|
17686
|
-
is_demo: false,
|
|
17687
|
-
is_mobile: isMobile,
|
|
17688
|
-
lang,
|
|
17689
|
-
return_url: window.location.href,
|
|
17690
|
-
};
|
|
17691
|
-
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17692
|
-
return { gameURL: redirect_url }
|
|
17145
|
+
isNoBalance: (context, event) => {
|
|
17146
|
+
return context.error.code === 'ERR_G106'
|
|
17693
17147
|
},
|
|
17694
|
-
|
|
17695
|
-
|
|
17696
|
-
const provider_id = context.game.providerId;
|
|
17697
|
-
return await request.send(game$1.logoutGame({ uid_site, provider_id }))
|
|
17148
|
+
isUnfinishedGame: (context, event) => {
|
|
17149
|
+
return context.error.extend?.includes?.('unfinished_')
|
|
17698
17150
|
},
|
|
17699
|
-
...oldServices$1(request),
|
|
17700
17151
|
},
|
|
17152
|
+
services: {},
|
|
17701
17153
|
}
|
|
17702
17154
|
)
|
|
17703
17155
|
}
|
|
17704
17156
|
|
|
17705
|
-
const
|
|
17706
|
-
|
|
17707
|
-
status: null,
|
|
17708
|
-
},
|
|
17709
|
-
isStatusChanged: false,
|
|
17710
|
-
statusMap: {},
|
|
17711
|
-
optionMap: {},
|
|
17712
|
-
};
|
|
17713
|
-
|
|
17714
|
-
const oldActions$1 = {
|
|
17715
|
-
setGameSHA: assign((context, event) => {
|
|
17716
|
-
const { sha } = context;
|
|
17717
|
-
const newSha = event.data;
|
|
17718
|
-
return {
|
|
17719
|
-
sha: newSha,
|
|
17720
|
-
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17721
|
-
}
|
|
17722
|
-
}),
|
|
17723
|
-
setStatus: assign((context, event) => {
|
|
17724
|
-
return {
|
|
17725
|
-
statusMap: event.data,
|
|
17726
|
-
}
|
|
17727
|
-
}),
|
|
17728
|
-
mergeOption: assign((context, event) => {
|
|
17729
|
-
const { optionMap } = context;
|
|
17730
|
-
return {
|
|
17731
|
-
optionMap: { ...optionMap, ...event.data },
|
|
17732
|
-
}
|
|
17733
|
-
}),
|
|
17734
|
-
};
|
|
17735
|
-
|
|
17736
|
-
const oldGuards$1 = {
|
|
17737
|
-
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17738
|
-
};
|
|
17157
|
+
const MY_FAVORITE = 'MyFavorite';
|
|
17158
|
+
const GAME_SEARCH = 'GameSearch';
|
|
17739
17159
|
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
fetchGameSHA: async (context, event) => {
|
|
17745
|
-
return await request.send(game$1.getGameSHA())
|
|
17746
|
-
},
|
|
17747
|
-
fetchStatus: async (context, event) => {
|
|
17748
|
-
return await request.send(game$1.getGameStatus())
|
|
17749
|
-
},
|
|
17160
|
+
var constant = /*#__PURE__*/Object.freeze({
|
|
17161
|
+
__proto__: null,
|
|
17162
|
+
MY_FAVORITE: MY_FAVORITE,
|
|
17163
|
+
GAME_SEARCH: GAME_SEARCH
|
|
17750
17164
|
});
|
|
17751
17165
|
|
|
17752
17166
|
// 對應 intersectionObserver 版本
|
|
@@ -17772,6 +17186,7 @@ function game_v2_1 (request) {
|
|
|
17772
17186
|
timestamp: null,
|
|
17773
17187
|
totalPage: 0,
|
|
17774
17188
|
},
|
|
17189
|
+
staticData: [],
|
|
17775
17190
|
// play params
|
|
17776
17191
|
game: {
|
|
17777
17192
|
providerId: null,
|
|
@@ -17792,6 +17207,9 @@ function game_v2_1 (request) {
|
|
|
17792
17207
|
idle: {
|
|
17793
17208
|
enter: 'clearGameInfo',
|
|
17794
17209
|
on: {
|
|
17210
|
+
SET_STATIC_DATA: {
|
|
17211
|
+
actions: 'setStaticData',
|
|
17212
|
+
},
|
|
17795
17213
|
SET_ADDITION_ENABLE: {
|
|
17796
17214
|
actions: 'setAdditionEnable',
|
|
17797
17215
|
},
|
|
@@ -17951,6 +17369,11 @@ function game_v2_1 (request) {
|
|
|
17951
17369
|
},
|
|
17952
17370
|
{
|
|
17953
17371
|
actions: {
|
|
17372
|
+
setStaticData: assign((context, event) => {
|
|
17373
|
+
return {
|
|
17374
|
+
staticData: event.data,
|
|
17375
|
+
}
|
|
17376
|
+
}),
|
|
17954
17377
|
setAdditionEnable: assign((context, event) => {
|
|
17955
17378
|
return {
|
|
17956
17379
|
additionEnable: event.data,
|
|
@@ -17967,17 +17390,13 @@ function game_v2_1 (request) {
|
|
|
17967
17390
|
isLastPage: index >= content?.totalPage - 1,
|
|
17968
17391
|
}
|
|
17969
17392
|
}),
|
|
17970
|
-
setFavoriteList: assign((context, event) => {
|
|
17971
|
-
return {
|
|
17972
|
-
favoriteList: event.data.data || [],
|
|
17973
|
-
}
|
|
17974
|
-
}),
|
|
17975
17393
|
setRoom: assign((context, event) => {
|
|
17976
17394
|
return {
|
|
17977
17395
|
room: event.data,
|
|
17978
17396
|
}
|
|
17979
17397
|
}),
|
|
17980
17398
|
resetContent: assign((context, event) => {
|
|
17399
|
+
console.log('resetContent');
|
|
17981
17400
|
return {
|
|
17982
17401
|
loadable: false,
|
|
17983
17402
|
isLastPage: false,
|
|
@@ -18069,32 +17488,44 @@ function game_v2_1 (request) {
|
|
|
18069
17488
|
},
|
|
18070
17489
|
services: {
|
|
18071
17490
|
getPageContent: async (context, event) => {
|
|
18072
|
-
const { room, index, additionEnable } = context;
|
|
17491
|
+
const { room, index, additionEnable, staticData } = context;
|
|
18073
17492
|
if (room.categoryId === GAME_SEARCH) {
|
|
18074
17493
|
return
|
|
17494
|
+
} else if (!request.getToken()) {
|
|
17495
|
+
const list = staticData.find((data) => data.category == room.categoryId)?.info || [];
|
|
17496
|
+
|
|
17497
|
+
return [
|
|
17498
|
+
{
|
|
17499
|
+
data: list.slice(index * 20, (index + 1) * 20),
|
|
17500
|
+
totalPage: Math.ceil(list.length / 20),
|
|
17501
|
+
timestamp: Math.floor(Date.now() / 1000),
|
|
17502
|
+
},
|
|
17503
|
+
]
|
|
18075
17504
|
} else if (additionEnable) {
|
|
18076
17505
|
const param = { categoryId: room.categoryId, index };
|
|
18077
|
-
return await Promise.all([request.send(game
|
|
17506
|
+
return await Promise.all([request.send(game.getListCategory(param)), request.send(game.getListAddition(param))])
|
|
18078
17507
|
} else {
|
|
18079
17508
|
const param = { categoryId: room.categoryId, index };
|
|
18080
|
-
return await Promise.all([request.send(game
|
|
17509
|
+
return await Promise.all([request.send(game.getListCategory(param))])
|
|
18081
17510
|
}
|
|
18082
17511
|
},
|
|
18083
17512
|
updatePageContent: async (context, event) => {
|
|
18084
17513
|
const { room, content, index, additionEnable } = context;
|
|
18085
17514
|
if (room.categoryId === GAME_SEARCH) {
|
|
18086
17515
|
return
|
|
17516
|
+
} else if (!request.getToken()) {
|
|
17517
|
+
return []
|
|
18087
17518
|
} else if (additionEnable) {
|
|
18088
17519
|
return await Promise.all([
|
|
18089
17520
|
request.send(
|
|
18090
|
-
game
|
|
17521
|
+
game.getListCategoryByRange({
|
|
18091
17522
|
categoryId: room.categoryId,
|
|
18092
17523
|
end: index,
|
|
18093
17524
|
timestamp: content.timestamp,
|
|
18094
17525
|
})
|
|
18095
17526
|
),
|
|
18096
17527
|
request.send(
|
|
18097
|
-
game
|
|
17528
|
+
game.getListAdditionByRange({
|
|
18098
17529
|
categoryId: room.categoryId,
|
|
18099
17530
|
end: index,
|
|
18100
17531
|
timestamp: content.timestamp,
|
|
@@ -18104,7 +17535,7 @@ function game_v2_1 (request) {
|
|
|
18104
17535
|
} else {
|
|
18105
17536
|
return await Promise.all([
|
|
18106
17537
|
request.send(
|
|
18107
|
-
game
|
|
17538
|
+
game.getListCategoryByRange({
|
|
18108
17539
|
categoryId: room.categoryId,
|
|
18109
17540
|
end: index,
|
|
18110
17541
|
timestamp: content.timestamp,
|
|
@@ -18114,6 +17545,7 @@ function game_v2_1 (request) {
|
|
|
18114
17545
|
}
|
|
18115
17546
|
},
|
|
18116
17547
|
connectGame: async (context, event) => {
|
|
17548
|
+
const returnProviders = ['RSG', 'KP', 'EPICWIN', 'KA', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG'];
|
|
18117
17549
|
const { lang, isMobile } = context;
|
|
18118
17550
|
const { providerId, gameId, gameTypeId, mappingId } = context.game;
|
|
18119
17551
|
const params = {
|
|
@@ -18124,15 +17556,15 @@ function game_v2_1 (request) {
|
|
|
18124
17556
|
is_demo: false,
|
|
18125
17557
|
is_mobile: isMobile,
|
|
18126
17558
|
lang,
|
|
18127
|
-
return_url: window.location.href,
|
|
17559
|
+
return_url: returnProviders.includes(providerId) ? `${window.location.origin}/return` : window.location.href, // For providers to return.
|
|
18128
17560
|
};
|
|
18129
|
-
const { redirect_url } = await request.send(game
|
|
17561
|
+
const { redirect_url } = await request.send(game.playGame(params));
|
|
18130
17562
|
return { gameURL: redirect_url }
|
|
18131
17563
|
},
|
|
18132
17564
|
disconnectGame: async (context, event) => {
|
|
18133
17565
|
const uid_site = event.data;
|
|
18134
17566
|
const provider_id = context.game.providerId;
|
|
18135
|
-
return await request.send(game
|
|
17567
|
+
return await request.send(game.logoutGame({ uid_site, provider_id }))
|
|
18136
17568
|
},
|
|
18137
17569
|
...oldServices(request),
|
|
18138
17570
|
},
|
|
@@ -18177,137 +17609,26 @@ const oldGuards = {
|
|
|
18177
17609
|
|
|
18178
17610
|
const oldServices = (request) => ({
|
|
18179
17611
|
fetchOption: async (context, event) => {
|
|
18180
|
-
|
|
17612
|
+
if (request.getToken()) {
|
|
17613
|
+
return await request.send(game.getOptionMap())
|
|
17614
|
+
}
|
|
18181
17615
|
},
|
|
18182
17616
|
fetchGameSHA: async (context, event) => {
|
|
18183
|
-
|
|
17617
|
+
if (request.getToken()) {
|
|
17618
|
+
return await request.send(game.getGameSHA())
|
|
17619
|
+
} else {
|
|
17620
|
+
return {
|
|
17621
|
+
status: null,
|
|
17622
|
+
}
|
|
17623
|
+
}
|
|
18184
17624
|
},
|
|
18185
17625
|
fetchStatus: async (context, event) => {
|
|
18186
|
-
|
|
17626
|
+
if (request.getToken()) {
|
|
17627
|
+
return await request.send(game.getGameStatus())
|
|
17628
|
+
}
|
|
18187
17629
|
},
|
|
18188
17630
|
});
|
|
18189
17631
|
|
|
18190
|
-
function game_favorite (request) {
|
|
18191
|
-
return createMachine(
|
|
18192
|
-
{
|
|
18193
|
-
id: 'favorite',
|
|
18194
|
-
type: 'parallel',
|
|
18195
|
-
context: {
|
|
18196
|
-
list: [],
|
|
18197
|
-
},
|
|
18198
|
-
states: {
|
|
18199
|
-
fetching: {
|
|
18200
|
-
initial: 'disable',
|
|
18201
|
-
states: {
|
|
18202
|
-
disable: {},
|
|
18203
|
-
enable: {
|
|
18204
|
-
invoke: {
|
|
18205
|
-
src: 'fetchList',
|
|
18206
|
-
onDone: {
|
|
18207
|
-
actions: 'setList',
|
|
18208
|
-
},
|
|
18209
|
-
onError: {
|
|
18210
|
-
actions: assign({ list: [] }),
|
|
18211
|
-
},
|
|
18212
|
-
},
|
|
18213
|
-
},
|
|
18214
|
-
},
|
|
18215
|
-
},
|
|
18216
|
-
adding: {
|
|
18217
|
-
initial: 'disable',
|
|
18218
|
-
states: {
|
|
18219
|
-
disable: {},
|
|
18220
|
-
enable: {
|
|
18221
|
-
invoke: {
|
|
18222
|
-
src: 'add',
|
|
18223
|
-
onDone: {},
|
|
18224
|
-
onError: {
|
|
18225
|
-
actions: 'removeFromList',
|
|
18226
|
-
},
|
|
18227
|
-
},
|
|
18228
|
-
},
|
|
18229
|
-
},
|
|
18230
|
-
},
|
|
18231
|
-
removing: {
|
|
18232
|
-
initial: 'disable',
|
|
18233
|
-
states: {
|
|
18234
|
-
disable: {},
|
|
18235
|
-
enable: {
|
|
18236
|
-
invoke: {
|
|
18237
|
-
src: 'remove',
|
|
18238
|
-
onDone: {},
|
|
18239
|
-
onError: {
|
|
18240
|
-
actions: 'addToList',
|
|
18241
|
-
},
|
|
18242
|
-
},
|
|
18243
|
-
},
|
|
18244
|
-
},
|
|
18245
|
-
},
|
|
18246
|
-
},
|
|
18247
|
-
on: {
|
|
18248
|
-
FETCH_LIST: {
|
|
18249
|
-
target: 'fetching.enable',
|
|
18250
|
-
},
|
|
18251
|
-
ADD: {
|
|
18252
|
-
target: 'adding.enable',
|
|
18253
|
-
actions: 'addToList',
|
|
18254
|
-
cond: 'isNotExist',
|
|
18255
|
-
},
|
|
18256
|
-
REMOVE: {
|
|
18257
|
-
target: 'removing.enable',
|
|
18258
|
-
actions: 'removeFromList',
|
|
18259
|
-
cond: 'isExist',
|
|
18260
|
-
},
|
|
18261
|
-
},
|
|
18262
|
-
},
|
|
18263
|
-
{
|
|
18264
|
-
actions: {
|
|
18265
|
-
setList: assign((context, event) => {
|
|
18266
|
-
return {
|
|
18267
|
-
list: event.data,
|
|
18268
|
-
}
|
|
18269
|
-
}),
|
|
18270
|
-
addToList: assign((context, event) => {
|
|
18271
|
-
return {
|
|
18272
|
-
list: [...context.list, event.data],
|
|
18273
|
-
}
|
|
18274
|
-
}),
|
|
18275
|
-
removeFromList: assign((context, event) => {
|
|
18276
|
-
return {
|
|
18277
|
-
list: context.list.filter((item) => item !== event.data),
|
|
18278
|
-
}
|
|
18279
|
-
}),
|
|
18280
|
-
},
|
|
18281
|
-
guards: {
|
|
18282
|
-
isExist: (context, event) => context.list.includes(event.data),
|
|
18283
|
-
isNotExist: (context, event) => !context.list.includes(event.data),
|
|
18284
|
-
},
|
|
18285
|
-
services: {
|
|
18286
|
-
add: async (context, event) => {
|
|
18287
|
-
try {
|
|
18288
|
-
return await request.send(game$1.addFavoriteGame(event.data))
|
|
18289
|
-
} catch (error) {
|
|
18290
|
-
throw event.data
|
|
18291
|
-
}
|
|
18292
|
-
},
|
|
18293
|
-
remove: async (context, event) => {
|
|
18294
|
-
try {
|
|
18295
|
-
return await request.send(game$1.removeFavoriteGame(event.data))
|
|
18296
|
-
} catch (error) {
|
|
18297
|
-
throw event.data
|
|
18298
|
-
}
|
|
18299
|
-
},
|
|
18300
|
-
fetchList: async (context, event) => {
|
|
18301
|
-
const main = await request.send(game$1.getGameCategory({}));
|
|
18302
|
-
const room = main.list.find((item) => item.category === 'SYSTEM_MY_FAVORITE');
|
|
18303
|
-
const favorite = await request.send(game$1.getGameCategory({ id: room.id }));
|
|
18304
|
-
return favorite.list.map((item) => item.g)
|
|
18305
|
-
},
|
|
18306
|
-
},
|
|
18307
|
-
}
|
|
18308
|
-
)
|
|
18309
|
-
}
|
|
18310
|
-
|
|
18311
17632
|
function game_favorite_v2 (request) {
|
|
18312
17633
|
return createMachine(
|
|
18313
17634
|
{
|
|
@@ -18402,7 +17723,7 @@ function game_favorite_v2 (request) {
|
|
|
18402
17723
|
services: {
|
|
18403
17724
|
add: async (context, event) => {
|
|
18404
17725
|
try {
|
|
18405
|
-
await request.send(game
|
|
17726
|
+
await request.send(game.addListFavorite(event.data.gameCode));
|
|
18406
17727
|
return event.data
|
|
18407
17728
|
} catch (error) {
|
|
18408
17729
|
throw event.data
|
|
@@ -18410,15 +17731,19 @@ function game_favorite_v2 (request) {
|
|
|
18410
17731
|
},
|
|
18411
17732
|
remove: async (context, event) => {
|
|
18412
17733
|
try {
|
|
18413
|
-
await request.send(game
|
|
17734
|
+
await request.send(game.removeListFavorite(event.data.gameCode));
|
|
18414
17735
|
return event.data
|
|
18415
17736
|
} catch (error) {
|
|
18416
17737
|
throw event.data
|
|
18417
17738
|
}
|
|
18418
17739
|
},
|
|
18419
17740
|
fetchList: async (context, event) => {
|
|
18420
|
-
|
|
18421
|
-
|
|
17741
|
+
if (request.getToken()) {
|
|
17742
|
+
const { data } = await request.send(game.getListMyFavorite());
|
|
17743
|
+
return data
|
|
17744
|
+
} else {
|
|
17745
|
+
return []
|
|
17746
|
+
}
|
|
18422
17747
|
},
|
|
18423
17748
|
},
|
|
18424
17749
|
}
|
|
@@ -18650,17 +17975,17 @@ function game_search (request) {
|
|
|
18650
17975
|
services: {
|
|
18651
17976
|
fetchTags: async (context, event) => {
|
|
18652
17977
|
const { keyword } = context;
|
|
18653
|
-
const { result } = await request.send(game
|
|
17978
|
+
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
18654
17979
|
return result
|
|
18655
17980
|
},
|
|
18656
17981
|
fetchGames: async (context, event) => {
|
|
18657
17982
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
18658
|
-
const { traceId, result } = await request.send(game
|
|
17983
|
+
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18659
17984
|
return { traceId, result }
|
|
18660
17985
|
},
|
|
18661
17986
|
sendTrace: async (context, event) => {
|
|
18662
17987
|
const { traceId, tagId, tagIndex, gameCode, gameCodeIndex, keyword: query, click, clickDefault } = context;
|
|
18663
|
-
return await request.send(game
|
|
17988
|
+
return await request.send(game.setGameSearchTrace({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }))
|
|
18664
17989
|
},
|
|
18665
17990
|
},
|
|
18666
17991
|
}
|
|
@@ -18993,16 +18318,16 @@ function game_search_v2 (request) {
|
|
|
18993
18318
|
services: {
|
|
18994
18319
|
fetchTags: async (context, event) => {
|
|
18995
18320
|
const { keyword } = context;
|
|
18996
|
-
const { result } = await request.send(game
|
|
18321
|
+
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
18997
18322
|
return result
|
|
18998
18323
|
},
|
|
18999
18324
|
fetchInitialData: async (context, event) => {
|
|
19000
|
-
const data = await request.send(game
|
|
18325
|
+
const data = await request.send(game.getGameSearchHome());
|
|
19001
18326
|
return data
|
|
19002
18327
|
},
|
|
19003
18328
|
fetchGames: async (context, event) => {
|
|
19004
18329
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
19005
|
-
const { traceId, result } = await request.send(game
|
|
18330
|
+
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
19006
18331
|
return { traceId, result }
|
|
19007
18332
|
},
|
|
19008
18333
|
sendTrace: async (context, event) => {
|
|
@@ -19024,7 +18349,7 @@ function game_search_v2 (request) {
|
|
|
19024
18349
|
id = null;
|
|
19025
18350
|
}
|
|
19026
18351
|
return await request.send(
|
|
19027
|
-
game
|
|
18352
|
+
game.setGameSearchTrace({
|
|
19028
18353
|
traceId,
|
|
19029
18354
|
tagId: id,
|
|
19030
18355
|
tagIndex,
|
|
@@ -19105,12 +18430,12 @@ function game_hot_new (request) {
|
|
|
19105
18430
|
},
|
|
19106
18431
|
services: {
|
|
19107
18432
|
getRoomItems: async (context, event) => {
|
|
19108
|
-
return await request.send(game
|
|
18433
|
+
return await request.send(game.getGameCategory({ id: context.roomId }))
|
|
19109
18434
|
},
|
|
19110
18435
|
getGames: async (context, event) => {
|
|
19111
18436
|
const [resHot, resNew] = await Promise.all([
|
|
19112
|
-
request.send(game
|
|
19113
|
-
request.send(game
|
|
18437
|
+
request.send(game.getGameCategory({ id: context.hot.id })),
|
|
18438
|
+
request.send(game.getGameCategory({ id: context.new.id })),
|
|
19114
18439
|
]);
|
|
19115
18440
|
const hotGames = resHot?.list?.map?.((item) => item.g);
|
|
19116
18441
|
const newGames = resNew?.list?.map?.((item) => item.g);
|
|
@@ -19950,7 +19275,7 @@ function side (request) {
|
|
|
19950
19275
|
},
|
|
19951
19276
|
services: {
|
|
19952
19277
|
getRoomItems: async (context, event) => {
|
|
19953
|
-
return await request.send(game
|
|
19278
|
+
return await request.send(game.getGameCategory({ id: context.room?.id }))
|
|
19954
19279
|
},
|
|
19955
19280
|
},
|
|
19956
19281
|
}
|
|
@@ -20114,10 +19439,10 @@ function side_v2 (request) {
|
|
|
20114
19439
|
},
|
|
20115
19440
|
services: {
|
|
20116
19441
|
getMenu: async (context, event) => {
|
|
20117
|
-
return await request.send(game
|
|
19442
|
+
return await request.send(game.getListRoot())
|
|
20118
19443
|
},
|
|
20119
19444
|
fetchUpdateMenu: async (context, event) => {
|
|
20120
|
-
return await request.send(game
|
|
19445
|
+
return await request.send(game.getListRoot({ timestamp: context.menu.timestamp }))
|
|
20121
19446
|
},
|
|
20122
19447
|
},
|
|
20123
19448
|
}
|
|
@@ -27703,9 +27028,6 @@ var index$1 = {
|
|
|
27703
27028
|
common,
|
|
27704
27029
|
deposit,
|
|
27705
27030
|
error,
|
|
27706
|
-
game,
|
|
27707
|
-
game_v2,
|
|
27708
|
-
game_favorite,
|
|
27709
27031
|
game_favorite_v2,
|
|
27710
27032
|
game_search,
|
|
27711
27033
|
game_search_v2,
|
|
@@ -27759,8 +27081,8 @@ class Request {
|
|
|
27759
27081
|
this.axios.interceptors.request.use((axiosConfig) => {
|
|
27760
27082
|
axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version;
|
|
27761
27083
|
axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform;
|
|
27762
|
-
if (
|
|
27763
|
-
axiosConfig.headers.Authorization =
|
|
27084
|
+
if (this.getToken()) {
|
|
27085
|
+
axiosConfig.headers.Authorization = this.getToken();
|
|
27764
27086
|
}
|
|
27765
27087
|
return axiosConfig
|
|
27766
27088
|
});
|
|
@@ -27788,7 +27110,7 @@ class Request {
|
|
|
27788
27110
|
async send(req, customToken) {
|
|
27789
27111
|
try {
|
|
27790
27112
|
const cancelToken = customToken || this.source.token;
|
|
27791
|
-
this._checkToken(req
|
|
27113
|
+
this._checkToken(req);
|
|
27792
27114
|
const requestConfig = this._createConfig(req, cancelToken);
|
|
27793
27115
|
const { data } = await this.axios.request(requestConfig);
|
|
27794
27116
|
return data
|
|
@@ -27834,12 +27156,16 @@ class Request {
|
|
|
27834
27156
|
}
|
|
27835
27157
|
}
|
|
27836
27158
|
|
|
27837
|
-
_checkToken(req
|
|
27838
|
-
if (!req.isPublic && !
|
|
27159
|
+
_checkToken(req) {
|
|
27160
|
+
if (!req.isPublic && !this.getToken()) {
|
|
27839
27161
|
console.error(req);
|
|
27840
27162
|
throw { code: 'ERR_A103', url: req.url }
|
|
27841
27163
|
}
|
|
27842
27164
|
}
|
|
27165
|
+
|
|
27166
|
+
getToken() {
|
|
27167
|
+
return storage.get(this.key)
|
|
27168
|
+
}
|
|
27843
27169
|
}
|
|
27844
27170
|
|
|
27845
27171
|
// const urljoin = require('url-join')
|