@jetthai/cuora 1.1.15 → 1.1.17
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/CHANGELOG.md +16 -0
- package/dist/bundle.mjs +667 -35
- package/package.json +1 -1
- package/src/api/payment.js +11 -0
- package/src/machine/deposit/crypto_button.js +137 -9
- package/src/machine/deposit/loadcard_vn.js +142 -13
- package/src/machine/deposit/qrcode_v2.js +168 -12
- package/src/machine/index.js +2 -0
- package/src/machine/promotions.js +155 -0
- package/src/machine/reward.js +59 -1
package/dist/bundle.mjs
CHANGED
|
@@ -3845,6 +3845,17 @@ var payment = {
|
|
|
3845
3845
|
method: 'post',
|
|
3846
3846
|
params: { transferType: 'WITHDRAW', amount },
|
|
3847
3847
|
}),
|
|
3848
|
+
getPromotionsList: () => ({ url: `payment/v2/bankWallet/promotions`, method: 'get' }),
|
|
3849
|
+
getWithdrawRulePreview: ({ applyType, applyNo, amount }) => ({
|
|
3850
|
+
url: `payment/v2/bankWallet/promotion/preview`,
|
|
3851
|
+
method: 'post',
|
|
3852
|
+
params: { applyType, applyNo, amount },
|
|
3853
|
+
}),
|
|
3854
|
+
applyPromotions: ({ promotionsNo, amount }) => ({
|
|
3855
|
+
url: `payment/v2/bankWallet/promotion/apply`,
|
|
3856
|
+
method: 'post',
|
|
3857
|
+
params: { promotionsNo, amount },
|
|
3858
|
+
}),
|
|
3848
3859
|
};
|
|
3849
3860
|
|
|
3850
3861
|
var user = {
|
|
@@ -12998,6 +13009,15 @@ function reward (request) {
|
|
|
12998
13009
|
otherRewardList: [],
|
|
12999
13010
|
pointsRewardList: [],
|
|
13000
13011
|
rewardList: [],
|
|
13012
|
+
activityNo: null,
|
|
13013
|
+
receiveNo: null,
|
|
13014
|
+
turnoverLimitStatus: 'NEW',
|
|
13015
|
+
originalTurnoverLimit: 0,
|
|
13016
|
+
originalMaxWithdrawAmount: 0,
|
|
13017
|
+
originalLimitGameDetail: [],
|
|
13018
|
+
newTurnoverLimit: 0,
|
|
13019
|
+
newMaxWithdrawAmount: 0,
|
|
13020
|
+
newLimitGameDetail: [],
|
|
13001
13021
|
callback: () => {},
|
|
13002
13022
|
},
|
|
13003
13023
|
states: {
|
|
@@ -13033,6 +13053,10 @@ function reward (request) {
|
|
|
13033
13053
|
states: {
|
|
13034
13054
|
idle: {
|
|
13035
13055
|
on: {
|
|
13056
|
+
FETCH_WITHDRAW_RULE: {
|
|
13057
|
+
target: 'fetching',
|
|
13058
|
+
actions: 'setRewardData',
|
|
13059
|
+
},
|
|
13036
13060
|
RECEIVE_REWARD: {
|
|
13037
13061
|
target: 'receiving',
|
|
13038
13062
|
actions: 'setCallback',
|
|
@@ -13043,11 +13067,33 @@ function reward (request) {
|
|
|
13043
13067
|
},
|
|
13044
13068
|
},
|
|
13045
13069
|
},
|
|
13070
|
+
fetching: {
|
|
13071
|
+
invoke: {
|
|
13072
|
+
src: 'fetchWithdrawRulePreview',
|
|
13073
|
+
onDone: {
|
|
13074
|
+
target: 'pending',
|
|
13075
|
+
actions: 'setWithdrawRulePreview',
|
|
13076
|
+
},
|
|
13077
|
+
onError: {
|
|
13078
|
+
target: 'idle',
|
|
13079
|
+
},
|
|
13080
|
+
},
|
|
13081
|
+
},
|
|
13082
|
+
pending: {
|
|
13083
|
+
on: {
|
|
13084
|
+
RECEIVE_REWARD: {
|
|
13085
|
+
target: 'receiving',
|
|
13086
|
+
},
|
|
13087
|
+
BACK: {
|
|
13088
|
+
target: 'idle',
|
|
13089
|
+
},
|
|
13090
|
+
},
|
|
13091
|
+
},
|
|
13046
13092
|
receiving: {
|
|
13047
13093
|
invoke: {
|
|
13048
13094
|
src: 'receiveReward',
|
|
13049
13095
|
onDone: {
|
|
13050
|
-
target: '
|
|
13096
|
+
target: 'received',
|
|
13051
13097
|
actions: [send({ type: 'REFRESH' }), 'doCallback'],
|
|
13052
13098
|
},
|
|
13053
13099
|
onError: {
|
|
@@ -13055,6 +13101,11 @@ function reward (request) {
|
|
|
13055
13101
|
},
|
|
13056
13102
|
},
|
|
13057
13103
|
},
|
|
13104
|
+
received: {
|
|
13105
|
+
0: {
|
|
13106
|
+
target: 'idle',
|
|
13107
|
+
},
|
|
13108
|
+
},
|
|
13058
13109
|
allPointsReceiving: {
|
|
13059
13110
|
invoke: {
|
|
13060
13111
|
src: 'receiveAllPoints',
|
|
@@ -13080,6 +13131,13 @@ function reward (request) {
|
|
|
13080
13131
|
rewardList: event.data[2]?.data || [],
|
|
13081
13132
|
}
|
|
13082
13133
|
}),
|
|
13134
|
+
setRewardData: assign((context, event) => {
|
|
13135
|
+
const { activityNo, receiveNo } = event.data;
|
|
13136
|
+
return {
|
|
13137
|
+
activityNo,
|
|
13138
|
+
receiveNo,
|
|
13139
|
+
}
|
|
13140
|
+
}),
|
|
13083
13141
|
setCallback: assign((context, event) => {
|
|
13084
13142
|
return {
|
|
13085
13143
|
callback: event.data?.callback || (() => {}),
|
|
@@ -13088,6 +13146,11 @@ function reward (request) {
|
|
|
13088
13146
|
doCallback: (context, event) => {
|
|
13089
13147
|
context.callback();
|
|
13090
13148
|
},
|
|
13149
|
+
setWithdrawRulePreview: (context, event) => {
|
|
13150
|
+
return {
|
|
13151
|
+
...event.data,
|
|
13152
|
+
}
|
|
13153
|
+
},
|
|
13091
13154
|
},
|
|
13092
13155
|
services: {
|
|
13093
13156
|
fetchRewardList: async (context, event) => {
|
|
@@ -13097,6 +13160,11 @@ function reward (request) {
|
|
|
13097
13160
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI]);
|
|
13098
13161
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
13099
13162
|
},
|
|
13163
|
+
fetchWithdrawRulePreview: async (context, event) => {
|
|
13164
|
+
const { receiveNo } = context;
|
|
13165
|
+
const { data } = await request.send(payment.getWithdrawRulePreview({ applyType: 'activity', applyNo: receiveNo, amount: null }));
|
|
13166
|
+
return data
|
|
13167
|
+
},
|
|
13100
13168
|
receiveReward: async (context, event) => {
|
|
13101
13169
|
const { activityNo, receiveNo, attended } = event.data;
|
|
13102
13170
|
return await request.send(activity$2.getReward({ activityNo, receiveNo, appSecret, attended }))
|
|
@@ -16274,11 +16342,13 @@ function manual_vn (request) {
|
|
|
16274
16342
|
}
|
|
16275
16343
|
|
|
16276
16344
|
function loadcard_vn (request) {
|
|
16345
|
+
const { appSecret } = request.config;
|
|
16277
16346
|
return createMachine(
|
|
16278
16347
|
{
|
|
16279
16348
|
id: 'loadcard',
|
|
16280
16349
|
initial: 'loading',
|
|
16281
16350
|
context: {
|
|
16351
|
+
siteConfig: null,
|
|
16282
16352
|
cards: [],
|
|
16283
16353
|
options: [],
|
|
16284
16354
|
|
|
@@ -16289,7 +16359,7 @@ function loadcard_vn (request) {
|
|
|
16289
16359
|
|
|
16290
16360
|
calculation: null,
|
|
16291
16361
|
|
|
16292
|
-
|
|
16362
|
+
paymentDetail: [],
|
|
16293
16363
|
currentCategory: 'loadcard',
|
|
16294
16364
|
currentMethod: null,
|
|
16295
16365
|
currentPayment: null,
|
|
@@ -16299,15 +16369,127 @@ function loadcard_vn (request) {
|
|
|
16299
16369
|
invoke: {
|
|
16300
16370
|
src: 'fetchInitData',
|
|
16301
16371
|
onDone: {
|
|
16302
|
-
target: '
|
|
16303
|
-
actions: 'setInitData',
|
|
16372
|
+
target: 'checking',
|
|
16373
|
+
actions: ['setInitData', 'preset'],
|
|
16304
16374
|
},
|
|
16305
16375
|
onError: {
|
|
16306
16376
|
target: 'fail',
|
|
16307
16377
|
},
|
|
16308
16378
|
},
|
|
16309
16379
|
},
|
|
16310
|
-
|
|
16380
|
+
checking: {
|
|
16381
|
+
always: [{ target: 'promotionApplyMode', cond: 'isPromotionApplyMode' }, { target: 'defaultMode' }],
|
|
16382
|
+
},
|
|
16383
|
+
promotionApplyMode: {
|
|
16384
|
+
initial: 'loaded',
|
|
16385
|
+
states: {
|
|
16386
|
+
loaded: {
|
|
16387
|
+
entry: 'reset',
|
|
16388
|
+
on: {
|
|
16389
|
+
SELECT_CARD: {
|
|
16390
|
+
actions: 'setCard',
|
|
16391
|
+
},
|
|
16392
|
+
SELECT_AMOUNT: {
|
|
16393
|
+
target: 'submittable',
|
|
16394
|
+
actions: 'setAmount',
|
|
16395
|
+
},
|
|
16396
|
+
},
|
|
16397
|
+
},
|
|
16398
|
+
submittable: {
|
|
16399
|
+
on: {
|
|
16400
|
+
SELECT_AMOUNT: {
|
|
16401
|
+
actions: 'setAmount',
|
|
16402
|
+
},
|
|
16403
|
+
CONFIRM: {
|
|
16404
|
+
target: 'debouncing',
|
|
16405
|
+
},
|
|
16406
|
+
BACK: {
|
|
16407
|
+
target: 'loaded',
|
|
16408
|
+
},
|
|
16409
|
+
},
|
|
16410
|
+
},
|
|
16411
|
+
debouncing: {
|
|
16412
|
+
on: {
|
|
16413
|
+
SELECT_AMOUNT: {
|
|
16414
|
+
target: 'debouncing',
|
|
16415
|
+
actions: 'setAmount',
|
|
16416
|
+
},
|
|
16417
|
+
BACK: {
|
|
16418
|
+
target: 'loaded',
|
|
16419
|
+
},
|
|
16420
|
+
},
|
|
16421
|
+
after: {
|
|
16422
|
+
1000: {
|
|
16423
|
+
target: 'calculating',
|
|
16424
|
+
},
|
|
16425
|
+
},
|
|
16426
|
+
},
|
|
16427
|
+
calculable: {
|
|
16428
|
+
entry: 'clearCalculation',
|
|
16429
|
+
on: {
|
|
16430
|
+
SELECT_AMOUNT: {
|
|
16431
|
+
target: 'debouncing',
|
|
16432
|
+
actions: 'setAmount',
|
|
16433
|
+
},
|
|
16434
|
+
CALCULATE: {
|
|
16435
|
+
target: 'debouncing',
|
|
16436
|
+
},
|
|
16437
|
+
BACK: {
|
|
16438
|
+
target: 'loaded',
|
|
16439
|
+
},
|
|
16440
|
+
},
|
|
16441
|
+
},
|
|
16442
|
+
calculating: {
|
|
16443
|
+
invoke: {
|
|
16444
|
+
src: 'fetchCalculation',
|
|
16445
|
+
onDone: {
|
|
16446
|
+
target: 'cardInfo',
|
|
16447
|
+
actions: 'setCalculation',
|
|
16448
|
+
},
|
|
16449
|
+
onError: {
|
|
16450
|
+
target: 'calculable',
|
|
16451
|
+
},
|
|
16452
|
+
},
|
|
16453
|
+
},
|
|
16454
|
+
cardInfo: {
|
|
16455
|
+
on: {
|
|
16456
|
+
INPUT_CARD_NUMBER: {
|
|
16457
|
+
actions: 'setCardNumber',
|
|
16458
|
+
},
|
|
16459
|
+
INPUT_SERIAL_NUMBER: {
|
|
16460
|
+
actions: 'setSerialNumber',
|
|
16461
|
+
},
|
|
16462
|
+
SUBMIT: {
|
|
16463
|
+
target: 'submitting',
|
|
16464
|
+
cond: 'isSubmittable',
|
|
16465
|
+
},
|
|
16466
|
+
SELECT_CARD: {
|
|
16467
|
+
target: 'loaded',
|
|
16468
|
+
actions: 'setCard',
|
|
16469
|
+
},
|
|
16470
|
+
},
|
|
16471
|
+
},
|
|
16472
|
+
submitting: {
|
|
16473
|
+
invoke: {
|
|
16474
|
+
src: 'submitDeposit',
|
|
16475
|
+
onDone: {
|
|
16476
|
+
target: 'submitted',
|
|
16477
|
+
},
|
|
16478
|
+
onError: {
|
|
16479
|
+
target: 'cardInfo',
|
|
16480
|
+
},
|
|
16481
|
+
},
|
|
16482
|
+
},
|
|
16483
|
+
submitted: {
|
|
16484
|
+
on: {
|
|
16485
|
+
BACK: {
|
|
16486
|
+
target: 'loaded',
|
|
16487
|
+
},
|
|
16488
|
+
},
|
|
16489
|
+
},
|
|
16490
|
+
},
|
|
16491
|
+
},
|
|
16492
|
+
defaultMode: {
|
|
16311
16493
|
entry: 'reset',
|
|
16312
16494
|
on: {
|
|
16313
16495
|
SELECT_CARD: {
|
|
@@ -16326,7 +16508,7 @@ function loadcard_vn (request) {
|
|
|
16326
16508
|
actions: 'setAmount',
|
|
16327
16509
|
},
|
|
16328
16510
|
BACK: {
|
|
16329
|
-
target: '
|
|
16511
|
+
target: 'defaultMode',
|
|
16330
16512
|
},
|
|
16331
16513
|
},
|
|
16332
16514
|
after: {
|
|
@@ -16347,7 +16529,7 @@ function loadcard_vn (request) {
|
|
|
16347
16529
|
target: 'debouncing',
|
|
16348
16530
|
},
|
|
16349
16531
|
BACK: {
|
|
16350
|
-
target: '
|
|
16532
|
+
target: 'defaultMode',
|
|
16351
16533
|
},
|
|
16352
16534
|
},
|
|
16353
16535
|
},
|
|
@@ -16373,7 +16555,7 @@ function loadcard_vn (request) {
|
|
|
16373
16555
|
target: 'cardInfo',
|
|
16374
16556
|
},
|
|
16375
16557
|
BACK: {
|
|
16376
|
-
target: '
|
|
16558
|
+
target: 'defaultMode',
|
|
16377
16559
|
},
|
|
16378
16560
|
CLEAR_CALCULATION: {
|
|
16379
16561
|
target: 'debouncing',
|
|
@@ -16394,7 +16576,7 @@ function loadcard_vn (request) {
|
|
|
16394
16576
|
cond: 'isSubmittable',
|
|
16395
16577
|
},
|
|
16396
16578
|
SELECT_CARD: {
|
|
16397
|
-
target: '
|
|
16579
|
+
target: 'defaultMode',
|
|
16398
16580
|
actions: 'setCard',
|
|
16399
16581
|
},
|
|
16400
16582
|
},
|
|
@@ -16413,7 +16595,7 @@ function loadcard_vn (request) {
|
|
|
16413
16595
|
submitted: {
|
|
16414
16596
|
on: {
|
|
16415
16597
|
BACK: {
|
|
16416
|
-
target: '
|
|
16598
|
+
target: 'defaultMode',
|
|
16417
16599
|
},
|
|
16418
16600
|
},
|
|
16419
16601
|
},
|
|
@@ -16430,16 +16612,22 @@ function loadcard_vn (request) {
|
|
|
16430
16612
|
}
|
|
16431
16613
|
}),
|
|
16432
16614
|
setInitData: assign((context, event) => {
|
|
16433
|
-
const
|
|
16434
|
-
const cards =
|
|
16615
|
+
const { paymentDetail } = event.data;
|
|
16616
|
+
const cards = paymentDetail.filter((element) => element.category === context.currentCategory);
|
|
16435
16617
|
return {
|
|
16436
|
-
|
|
16618
|
+
paymentDetail,
|
|
16437
16619
|
cards,
|
|
16438
16620
|
selectedCard: cards[0],
|
|
16439
16621
|
currentMethod: cards[0].method,
|
|
16440
16622
|
options: cards[0].optional,
|
|
16441
16623
|
}
|
|
16442
16624
|
}),
|
|
16625
|
+
preset: assign((context, event) => {
|
|
16626
|
+
const { siteConfig } = event.data;
|
|
16627
|
+
return {
|
|
16628
|
+
siteConfig,
|
|
16629
|
+
}
|
|
16630
|
+
}),
|
|
16443
16631
|
setCard: assign((context, event) => {
|
|
16444
16632
|
return {
|
|
16445
16633
|
selectedCard: event.data,
|
|
@@ -16472,6 +16660,9 @@ function loadcard_vn (request) {
|
|
|
16472
16660
|
}),
|
|
16473
16661
|
},
|
|
16474
16662
|
guards: {
|
|
16663
|
+
isPromotionApplyMode: (context, event) => {
|
|
16664
|
+
return context.siteConfig?.promotionApplyMode === '1'
|
|
16665
|
+
},
|
|
16475
16666
|
isSubmittable: (context, event) => {
|
|
16476
16667
|
const { cardNumber, serialNumber } = context;
|
|
16477
16668
|
return cardNumber && serialNumber
|
|
@@ -16479,7 +16670,12 @@ function loadcard_vn (request) {
|
|
|
16479
16670
|
},
|
|
16480
16671
|
services: {
|
|
16481
16672
|
fetchInitData: async (context, event) => {
|
|
16482
|
-
|
|
16673
|
+
const [{ config }, paymentDetail = []] = await Promise.all([
|
|
16674
|
+
request.send(common$1.getConfig({ appSecret })),
|
|
16675
|
+
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
16676
|
+
]);
|
|
16677
|
+
const siteConfig = JSON.parse(window.atob(config));
|
|
16678
|
+
return { siteConfig, paymentDetail }
|
|
16483
16679
|
},
|
|
16484
16680
|
fetchCalculation: async (context, event) => {
|
|
16485
16681
|
const { currentMethod, selectedAmount } = context;
|
|
@@ -16712,11 +16908,13 @@ function qrcode_vn (request) {
|
|
|
16712
16908
|
}
|
|
16713
16909
|
|
|
16714
16910
|
function qrcode_v2 (request) {
|
|
16911
|
+
const { appSecret } = request.config;
|
|
16715
16912
|
return createMachine(
|
|
16716
16913
|
{
|
|
16717
16914
|
id: 'qrcode',
|
|
16718
16915
|
initial: 'loading',
|
|
16719
16916
|
context: {
|
|
16917
|
+
siteConfig: null,
|
|
16720
16918
|
qrcodes: null,
|
|
16721
16919
|
options: null,
|
|
16722
16920
|
|
|
@@ -16725,7 +16923,7 @@ function qrcode_v2 (request) {
|
|
|
16725
16923
|
|
|
16726
16924
|
calculation: null,
|
|
16727
16925
|
|
|
16728
|
-
|
|
16926
|
+
paymentDetail: [],
|
|
16729
16927
|
currentCategory: 'qrcode',
|
|
16730
16928
|
currentMethod: null,
|
|
16731
16929
|
|
|
@@ -16738,15 +16936,152 @@ function qrcode_v2 (request) {
|
|
|
16738
16936
|
invoke: {
|
|
16739
16937
|
src: 'fetchInitData',
|
|
16740
16938
|
onDone: {
|
|
16741
|
-
target: '
|
|
16742
|
-
actions: 'setInitData',
|
|
16939
|
+
target: 'checking',
|
|
16940
|
+
actions: ['setInitData', 'preset'],
|
|
16743
16941
|
},
|
|
16744
16942
|
onError: {
|
|
16745
16943
|
target: 'fail',
|
|
16746
16944
|
},
|
|
16747
16945
|
},
|
|
16748
16946
|
},
|
|
16749
|
-
|
|
16947
|
+
checking: {
|
|
16948
|
+
always: [{ target: 'promotionApplyMode', cond: 'isPromotionApplyMode' }, { target: 'defaultMode' }],
|
|
16949
|
+
},
|
|
16950
|
+
promotionApplyMode: {
|
|
16951
|
+
initial: 'loaded',
|
|
16952
|
+
states: {
|
|
16953
|
+
loaded: {
|
|
16954
|
+
entry: 'reset',
|
|
16955
|
+
on: {
|
|
16956
|
+
SELECT_QRCODE: {
|
|
16957
|
+
actions: 'setQrcode',
|
|
16958
|
+
},
|
|
16959
|
+
SELECT_AMOUNT: [
|
|
16960
|
+
{
|
|
16961
|
+
target: 'submittable',
|
|
16962
|
+
actions: 'addAmount',
|
|
16963
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
16964
|
+
},
|
|
16965
|
+
{
|
|
16966
|
+
target: 'submittable',
|
|
16967
|
+
actions: 'setAmount',
|
|
16968
|
+
},
|
|
16969
|
+
],
|
|
16970
|
+
KEY_IN: {
|
|
16971
|
+
actions: 'setAmount',
|
|
16972
|
+
},
|
|
16973
|
+
},
|
|
16974
|
+
},
|
|
16975
|
+
submittable: {
|
|
16976
|
+
on: {
|
|
16977
|
+
SELECT_AMOUNT: [
|
|
16978
|
+
{
|
|
16979
|
+
actions: 'addAmount',
|
|
16980
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
16981
|
+
},
|
|
16982
|
+
{
|
|
16983
|
+
actions: 'setAmount',
|
|
16984
|
+
},
|
|
16985
|
+
],
|
|
16986
|
+
KEY_IN: {
|
|
16987
|
+
actions: 'setAmount',
|
|
16988
|
+
},
|
|
16989
|
+
CONFIRM: {
|
|
16990
|
+
target: 'debouncing',
|
|
16991
|
+
},
|
|
16992
|
+
BACK: {
|
|
16993
|
+
target: 'loaded',
|
|
16994
|
+
},
|
|
16995
|
+
},
|
|
16996
|
+
},
|
|
16997
|
+
debouncing: {
|
|
16998
|
+
on: {
|
|
16999
|
+
SELECT_AMOUNT: [
|
|
17000
|
+
{
|
|
17001
|
+
target: 'debouncing',
|
|
17002
|
+
actions: 'addAmount',
|
|
17003
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
17004
|
+
},
|
|
17005
|
+
{
|
|
17006
|
+
target: 'debouncing',
|
|
17007
|
+
actions: 'setAmount',
|
|
17008
|
+
},
|
|
17009
|
+
],
|
|
17010
|
+
KEY_IN: {
|
|
17011
|
+
target: 'debouncing',
|
|
17012
|
+
actions: 'setAmount',
|
|
17013
|
+
},
|
|
17014
|
+
BACK: {
|
|
17015
|
+
target: 'loaded',
|
|
17016
|
+
},
|
|
17017
|
+
},
|
|
17018
|
+
after: {
|
|
17019
|
+
1000: {
|
|
17020
|
+
target: 'calculating',
|
|
17021
|
+
},
|
|
17022
|
+
},
|
|
17023
|
+
},
|
|
17024
|
+
calculable: {
|
|
17025
|
+
entry: 'clearCalculation',
|
|
17026
|
+
on: {
|
|
17027
|
+
SELECT_AMOUNT: [
|
|
17028
|
+
{
|
|
17029
|
+
target: 'debouncing',
|
|
17030
|
+
actions: 'addAmount',
|
|
17031
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
17032
|
+
},
|
|
17033
|
+
{
|
|
17034
|
+
target: 'debouncing',
|
|
17035
|
+
actions: 'setAmount',
|
|
17036
|
+
},
|
|
17037
|
+
],
|
|
17038
|
+
KEY_IN: {
|
|
17039
|
+
target: 'debouncing',
|
|
17040
|
+
actions: 'setAmount',
|
|
17041
|
+
},
|
|
17042
|
+
CALCULATE: {
|
|
17043
|
+
target: 'debouncing',
|
|
17044
|
+
},
|
|
17045
|
+
BACK: {
|
|
17046
|
+
target: 'loaded',
|
|
17047
|
+
},
|
|
17048
|
+
},
|
|
17049
|
+
},
|
|
17050
|
+
calculating: {
|
|
17051
|
+
invoke: {
|
|
17052
|
+
src: 'fetchCalculation',
|
|
17053
|
+
onDone: {
|
|
17054
|
+
target: 'submitting',
|
|
17055
|
+
actions: 'setCalculation',
|
|
17056
|
+
},
|
|
17057
|
+
onError: {
|
|
17058
|
+
target: 'calculable',
|
|
17059
|
+
},
|
|
17060
|
+
},
|
|
17061
|
+
},
|
|
17062
|
+
submitting: {
|
|
17063
|
+
invoke: {
|
|
17064
|
+
src: 'submitDeposit',
|
|
17065
|
+
onDone: {
|
|
17066
|
+
target: 'submitted',
|
|
17067
|
+
actions: 'setResult',
|
|
17068
|
+
},
|
|
17069
|
+
onError: {
|
|
17070
|
+
target: 'submittable',
|
|
17071
|
+
},
|
|
17072
|
+
},
|
|
17073
|
+
},
|
|
17074
|
+
submitted: {
|
|
17075
|
+
on: {
|
|
17076
|
+
SELECT_QRCODE: {
|
|
17077
|
+
target: 'loaded',
|
|
17078
|
+
actions: 'setQrcode',
|
|
17079
|
+
},
|
|
17080
|
+
},
|
|
17081
|
+
},
|
|
17082
|
+
},
|
|
17083
|
+
},
|
|
17084
|
+
defaultMode: {
|
|
16750
17085
|
entry: 'reset',
|
|
16751
17086
|
on: {
|
|
16752
17087
|
SELECT_QRCODE: {
|
|
@@ -16787,7 +17122,7 @@ function qrcode_v2 (request) {
|
|
|
16787
17122
|
actions: 'setAmount',
|
|
16788
17123
|
},
|
|
16789
17124
|
BACK: {
|
|
16790
|
-
target: '
|
|
17125
|
+
target: 'defaultMode',
|
|
16791
17126
|
},
|
|
16792
17127
|
},
|
|
16793
17128
|
after: {
|
|
@@ -16819,7 +17154,7 @@ function qrcode_v2 (request) {
|
|
|
16819
17154
|
target: 'debouncing',
|
|
16820
17155
|
},
|
|
16821
17156
|
BACK: {
|
|
16822
|
-
target: '
|
|
17157
|
+
target: 'defaultMode',
|
|
16823
17158
|
},
|
|
16824
17159
|
},
|
|
16825
17160
|
},
|
|
@@ -16856,7 +17191,7 @@ function qrcode_v2 (request) {
|
|
|
16856
17191
|
target: 'submitting',
|
|
16857
17192
|
},
|
|
16858
17193
|
BACK: {
|
|
16859
|
-
target: '
|
|
17194
|
+
target: 'defaultMode',
|
|
16860
17195
|
},
|
|
16861
17196
|
CLEAR_CALCULATION: {
|
|
16862
17197
|
target: 'debouncing',
|
|
@@ -16879,7 +17214,7 @@ function qrcode_v2 (request) {
|
|
|
16879
17214
|
submitted: {
|
|
16880
17215
|
on: {
|
|
16881
17216
|
SELECT_QRCODE: {
|
|
16882
|
-
target: '
|
|
17217
|
+
target: 'defaultMode',
|
|
16883
17218
|
actions: 'setQrcode',
|
|
16884
17219
|
},
|
|
16885
17220
|
},
|
|
@@ -16895,11 +17230,11 @@ function qrcode_v2 (request) {
|
|
|
16895
17230
|
}
|
|
16896
17231
|
}),
|
|
16897
17232
|
setInitData: assign((context, event) => {
|
|
16898
|
-
const
|
|
16899
|
-
const qrcodes =
|
|
17233
|
+
const { paymentDetail } = event.data;
|
|
17234
|
+
const qrcodes = paymentDetail.filter((element) => element.category === context.currentCategory);
|
|
16900
17235
|
|
|
16901
17236
|
return {
|
|
16902
|
-
|
|
17237
|
+
paymentDetail,
|
|
16903
17238
|
qrcodes,
|
|
16904
17239
|
selectedQrcode: qrcodes[0],
|
|
16905
17240
|
currentMethod: qrcodes[0].method,
|
|
@@ -16907,6 +17242,12 @@ function qrcode_v2 (request) {
|
|
|
16907
17242
|
grandTotalEnable: qrcodes[0].grandTotalEnable,
|
|
16908
17243
|
}
|
|
16909
17244
|
}),
|
|
17245
|
+
preset: assign((context, event) => {
|
|
17246
|
+
const { siteConfig } = event.data;
|
|
17247
|
+
return {
|
|
17248
|
+
siteConfig,
|
|
17249
|
+
}
|
|
17250
|
+
}),
|
|
16910
17251
|
setQrcode: assign((context, event) => {
|
|
16911
17252
|
return {
|
|
16912
17253
|
selectedQrcode: event.data,
|
|
@@ -16937,9 +17278,19 @@ function qrcode_v2 (request) {
|
|
|
16937
17278
|
}
|
|
16938
17279
|
}),
|
|
16939
17280
|
},
|
|
17281
|
+
guards: {
|
|
17282
|
+
isPromotionApplyMode: (context, event) => {
|
|
17283
|
+
return context.siteConfig?.promotionApplyMode === '1'
|
|
17284
|
+
},
|
|
17285
|
+
},
|
|
16940
17286
|
services: {
|
|
16941
17287
|
fetchInitData: async (context, event) => {
|
|
16942
|
-
|
|
17288
|
+
const [{ config }, paymentDetail = []] = await Promise.all([
|
|
17289
|
+
request.send(common$1.getConfig({ appSecret })),
|
|
17290
|
+
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
17291
|
+
]);
|
|
17292
|
+
const siteConfig = JSON.parse(window.atob(config));
|
|
17293
|
+
return { siteConfig, paymentDetail }
|
|
16943
17294
|
},
|
|
16944
17295
|
fetchCalculation: async (context, event) => {
|
|
16945
17296
|
const { currentMethod, selectedAmount } = context;
|
|
@@ -17833,11 +18184,13 @@ function crypto (request) {
|
|
|
17833
18184
|
}
|
|
17834
18185
|
|
|
17835
18186
|
function crypto_button (request) {
|
|
18187
|
+
const { appSecret } = request.config;
|
|
17836
18188
|
return createMachine(
|
|
17837
18189
|
{
|
|
17838
18190
|
id: 'crypro_button',
|
|
17839
18191
|
initial: 'loading',
|
|
17840
18192
|
context: {
|
|
18193
|
+
siteConfig: null,
|
|
17841
18194
|
paymentDetails: [],
|
|
17842
18195
|
|
|
17843
18196
|
channels: [],
|
|
@@ -17861,17 +18214,127 @@ function crypto_button (request) {
|
|
|
17861
18214
|
states: {
|
|
17862
18215
|
loading: {
|
|
17863
18216
|
invoke: {
|
|
17864
|
-
src: '
|
|
18217
|
+
src: 'fetchInitData',
|
|
17865
18218
|
onDone: {
|
|
17866
|
-
target: '
|
|
17867
|
-
actions: '
|
|
18219
|
+
target: 'checking',
|
|
18220
|
+
actions: ['setInitData', 'preset'],
|
|
17868
18221
|
},
|
|
17869
18222
|
onError: {
|
|
17870
18223
|
target: 'fail',
|
|
17871
18224
|
},
|
|
17872
18225
|
},
|
|
17873
18226
|
},
|
|
17874
|
-
|
|
18227
|
+
checking: {
|
|
18228
|
+
always: [{ target: 'promotionApplyMode', cond: 'isPromotionApplyMode' }, { target: 'defaultMode' }],
|
|
18229
|
+
},
|
|
18230
|
+
promotionApplyMode: {
|
|
18231
|
+
initial: 'loaded',
|
|
18232
|
+
states: {
|
|
18233
|
+
loaded: {
|
|
18234
|
+
entry: 'reset',
|
|
18235
|
+
on: {
|
|
18236
|
+
SET_CHANNEL: {
|
|
18237
|
+
actions: 'setChannel',
|
|
18238
|
+
},
|
|
18239
|
+
SET_CRYPTO: {
|
|
18240
|
+
actions: 'setCrypto',
|
|
18241
|
+
},
|
|
18242
|
+
SET_NETWORK: {
|
|
18243
|
+
actions: 'setNetwork',
|
|
18244
|
+
},
|
|
18245
|
+
SET_ADDRESS: {
|
|
18246
|
+
actions: 'setAddress',
|
|
18247
|
+
},
|
|
18248
|
+
CONFIRM: {
|
|
18249
|
+
target: 'selecting',
|
|
18250
|
+
cond: 'isConfirmable',
|
|
18251
|
+
},
|
|
18252
|
+
},
|
|
18253
|
+
},
|
|
18254
|
+
selecting: {
|
|
18255
|
+
entry: 'reset',
|
|
18256
|
+
on: {
|
|
18257
|
+
SELECT_AMOUNT: [
|
|
18258
|
+
{
|
|
18259
|
+
actions: 'addAmount',
|
|
18260
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
18261
|
+
},
|
|
18262
|
+
{
|
|
18263
|
+
actions: 'setAmount',
|
|
18264
|
+
},
|
|
18265
|
+
],
|
|
18266
|
+
KEY_IN: {
|
|
18267
|
+
actions: 'setAmount',
|
|
18268
|
+
},
|
|
18269
|
+
SUBMIT: {
|
|
18270
|
+
target: 'debouncing',
|
|
18271
|
+
},
|
|
18272
|
+
BACK: {
|
|
18273
|
+
target: 'loaded',
|
|
18274
|
+
},
|
|
18275
|
+
CLEAR_ALL: {
|
|
18276
|
+
actions: 'reset',
|
|
18277
|
+
},
|
|
18278
|
+
},
|
|
18279
|
+
},
|
|
18280
|
+
debouncing: {
|
|
18281
|
+
on: {
|
|
18282
|
+
SELECT_AMOUNT: [
|
|
18283
|
+
{
|
|
18284
|
+
target: 'debouncing',
|
|
18285
|
+
actions: 'addAmount',
|
|
18286
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
18287
|
+
},
|
|
18288
|
+
{
|
|
18289
|
+
target: 'debouncing',
|
|
18290
|
+
actions: 'setAmount',
|
|
18291
|
+
},
|
|
18292
|
+
],
|
|
18293
|
+
KEY_IN: {
|
|
18294
|
+
target: 'debouncing',
|
|
18295
|
+
actions: 'setAmount',
|
|
18296
|
+
},
|
|
18297
|
+
BACK: {
|
|
18298
|
+
target: 'loaded',
|
|
18299
|
+
},
|
|
18300
|
+
CLEAR_ALL: {
|
|
18301
|
+
actions: 'reset',
|
|
18302
|
+
},
|
|
18303
|
+
},
|
|
18304
|
+
after: {
|
|
18305
|
+
1000: {
|
|
18306
|
+
target: 'calculating',
|
|
18307
|
+
},
|
|
18308
|
+
},
|
|
18309
|
+
},
|
|
18310
|
+
calculating: {
|
|
18311
|
+
invoke: {
|
|
18312
|
+
src: 'fetchCalculation',
|
|
18313
|
+
onDone: {
|
|
18314
|
+
target: 'submitting',
|
|
18315
|
+
actions: 'setCalculation',
|
|
18316
|
+
},
|
|
18317
|
+
onError: {
|
|
18318
|
+
target: 'selecting',
|
|
18319
|
+
actions: 'reset',
|
|
18320
|
+
},
|
|
18321
|
+
},
|
|
18322
|
+
},
|
|
18323
|
+
submitting: {
|
|
18324
|
+
invoke: {
|
|
18325
|
+
src: 'submitDeposit',
|
|
18326
|
+
onDone: {
|
|
18327
|
+
target: '#crypro_button.submitted',
|
|
18328
|
+
actions: 'setResult',
|
|
18329
|
+
},
|
|
18330
|
+
onError: {
|
|
18331
|
+
target: 'selecting',
|
|
18332
|
+
},
|
|
18333
|
+
},
|
|
18334
|
+
},
|
|
18335
|
+
},
|
|
18336
|
+
},
|
|
18337
|
+
defaultMode: {
|
|
17875
18338
|
on: {
|
|
17876
18339
|
SET_CHANNEL: {
|
|
17877
18340
|
actions: 'setChannel',
|
|
@@ -17911,7 +18374,7 @@ function crypto_button (request) {
|
|
|
17911
18374
|
actions: 'setAmount',
|
|
17912
18375
|
},
|
|
17913
18376
|
BACK: {
|
|
17914
|
-
target: '
|
|
18377
|
+
target: 'defaultMode',
|
|
17915
18378
|
},
|
|
17916
18379
|
},
|
|
17917
18380
|
},
|
|
@@ -18006,8 +18469,9 @@ function crypto_button (request) {
|
|
|
18006
18469
|
calculation: null,
|
|
18007
18470
|
}
|
|
18008
18471
|
}),
|
|
18009
|
-
|
|
18010
|
-
const
|
|
18472
|
+
setInitData: assign((context, event) => {
|
|
18473
|
+
const { paymentDetail } = event.data;
|
|
18474
|
+
const cryptos = paymentDetail?.map?.((crypto) => ({ ...crypto, label: crypto.channel, value: crypto.method, icon: crypto.channel })) || [];
|
|
18011
18475
|
const currentPayment = cryptos.find((element) => element.category === context.currentCategory);
|
|
18012
18476
|
const channels = cryptos.map((item, i) => ({ ...item, label: `Channel ${padStart_1(String(i + 1), 2, '0')}`, icon: 'channel' }));
|
|
18013
18477
|
const defaultNetworks =
|
|
@@ -18031,6 +18495,12 @@ function crypto_button (request) {
|
|
|
18031
18495
|
options,
|
|
18032
18496
|
}
|
|
18033
18497
|
}),
|
|
18498
|
+
preset: assign((context, event) => {
|
|
18499
|
+
const { siteConfig } = event.data;
|
|
18500
|
+
return {
|
|
18501
|
+
siteConfig,
|
|
18502
|
+
}
|
|
18503
|
+
}),
|
|
18034
18504
|
setChannel: assign((context, event) => {
|
|
18035
18505
|
const { cryptos } = context;
|
|
18036
18506
|
const selectedCrypto = cryptos.find((crypto) => crypto.method === event.data.value);
|
|
@@ -18110,6 +18580,9 @@ function crypto_button (request) {
|
|
|
18110
18580
|
}),
|
|
18111
18581
|
},
|
|
18112
18582
|
guards: {
|
|
18583
|
+
isPromotionApplyMode: (context, event) => {
|
|
18584
|
+
return context.siteConfig?.promotionApplyMode === '1'
|
|
18585
|
+
},
|
|
18113
18586
|
isConfirmable: (context, event) => {
|
|
18114
18587
|
const { selectedCrypto, selectedNetwork } = context;
|
|
18115
18588
|
return selectedCrypto && selectedNetwork
|
|
@@ -18120,8 +18593,13 @@ function crypto_button (request) {
|
|
|
18120
18593
|
},
|
|
18121
18594
|
},
|
|
18122
18595
|
services: {
|
|
18123
|
-
|
|
18124
|
-
|
|
18596
|
+
fetchInitData: async (context, event) => {
|
|
18597
|
+
const [{ config }, paymentDetail = []] = await Promise.all([
|
|
18598
|
+
request.send(common$1.getConfig({ appSecret })),
|
|
18599
|
+
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
18600
|
+
]);
|
|
18601
|
+
const siteConfig = JSON.parse(window.atob(config));
|
|
18602
|
+
return { siteConfig, paymentDetail }
|
|
18125
18603
|
},
|
|
18126
18604
|
fetchCalculation: async (context, event) => {
|
|
18127
18605
|
const { selectedCrypto, selectedAmount } = context;
|
|
@@ -19693,6 +20171,159 @@ function vip_table (request) {
|
|
|
19693
20171
|
)
|
|
19694
20172
|
}
|
|
19695
20173
|
|
|
20174
|
+
function promotions (request) {
|
|
20175
|
+
return createMachine(
|
|
20176
|
+
{
|
|
20177
|
+
id: 'promotions',
|
|
20178
|
+
initial: 'loading',
|
|
20179
|
+
context: {
|
|
20180
|
+
noBonus: {
|
|
20181
|
+
promotionsNo: 'No Bonus',
|
|
20182
|
+
title: 'No Bonus',
|
|
20183
|
+
adSmallUrl: [
|
|
20184
|
+
{
|
|
20185
|
+
url: '~/assets/images/deposit/deposit_img_nobonus_normal.png',
|
|
20186
|
+
name: 'No Bonus',
|
|
20187
|
+
},
|
|
20188
|
+
],
|
|
20189
|
+
descrip: 'no_bonus',
|
|
20190
|
+
minimumAmount: 0,
|
|
20191
|
+
turnoverLimitMultiple: 1,
|
|
20192
|
+
promotionDetail: [],
|
|
20193
|
+
withdrawLimitDetail: [],
|
|
20194
|
+
limitGameDetail: [],
|
|
20195
|
+
},
|
|
20196
|
+
turnoverLimitStatus: '',
|
|
20197
|
+
originalTurnoverLimit: 0,
|
|
20198
|
+
originalMaxWithdrawAmount: 0,
|
|
20199
|
+
originalLimitGameDetail: [],
|
|
20200
|
+
newTurnoverLimit: 0,
|
|
20201
|
+
newMaxWithdrawAmount: 0,
|
|
20202
|
+
newLimitGameDetail: [],
|
|
20203
|
+
promotionsList: [],
|
|
20204
|
+
selectedPromo: {},
|
|
20205
|
+
},
|
|
20206
|
+
states: {
|
|
20207
|
+
loading: {
|
|
20208
|
+
invoke: {
|
|
20209
|
+
src: 'fetchInitData',
|
|
20210
|
+
onDone: {
|
|
20211
|
+
target: 'loaded',
|
|
20212
|
+
actions: 'setInitData',
|
|
20213
|
+
},
|
|
20214
|
+
onError: {
|
|
20215
|
+
target: 'fail',
|
|
20216
|
+
},
|
|
20217
|
+
},
|
|
20218
|
+
},
|
|
20219
|
+
loaded: {
|
|
20220
|
+
on: {
|
|
20221
|
+
SELECT_PROMO: {
|
|
20222
|
+
actions: ['reset', 'setSelectedPromo'],
|
|
20223
|
+
},
|
|
20224
|
+
SET_AMOUNT: {
|
|
20225
|
+
actions: 'setAmount',
|
|
20226
|
+
},
|
|
20227
|
+
JOIN: {
|
|
20228
|
+
target: 'fetching',
|
|
20229
|
+
cond: 'isValidAmount',
|
|
20230
|
+
},
|
|
20231
|
+
},
|
|
20232
|
+
},
|
|
20233
|
+
fetching: {
|
|
20234
|
+
invoke: {
|
|
20235
|
+
src: 'fetchWithdrawRulePreview',
|
|
20236
|
+
onDone: {
|
|
20237
|
+
target: 'pending',
|
|
20238
|
+
actions: 'setWithdrawRulePreview',
|
|
20239
|
+
},
|
|
20240
|
+
onError: {
|
|
20241
|
+
target: 'loaded',
|
|
20242
|
+
},
|
|
20243
|
+
},
|
|
20244
|
+
},
|
|
20245
|
+
pending: {
|
|
20246
|
+
on: {
|
|
20247
|
+
CONFIRM: {
|
|
20248
|
+
target: 'joinning',
|
|
20249
|
+
},
|
|
20250
|
+
BACK: {
|
|
20251
|
+
target: 'loaded',
|
|
20252
|
+
},
|
|
20253
|
+
},
|
|
20254
|
+
},
|
|
20255
|
+
joinning: {
|
|
20256
|
+
invoke: {
|
|
20257
|
+
src: 'applyPromotion',
|
|
20258
|
+
onDone: {
|
|
20259
|
+
target: 'joined',
|
|
20260
|
+
},
|
|
20261
|
+
onError: {
|
|
20262
|
+
target: 'fail',
|
|
20263
|
+
},
|
|
20264
|
+
},
|
|
20265
|
+
},
|
|
20266
|
+
joined: {},
|
|
20267
|
+
fail: {},
|
|
20268
|
+
},
|
|
20269
|
+
},
|
|
20270
|
+
{
|
|
20271
|
+
actions: {
|
|
20272
|
+
setInitData: assign((context, event) => {
|
|
20273
|
+
const { promotionsList } = event.data;
|
|
20274
|
+
const { noBonus } = context;
|
|
20275
|
+
return {
|
|
20276
|
+
promotionsList,
|
|
20277
|
+
selectedPromo: noBonus,
|
|
20278
|
+
}
|
|
20279
|
+
}),
|
|
20280
|
+
setSelectedPromo: assign((context, event) => {
|
|
20281
|
+
return {
|
|
20282
|
+
selectedPromo: event.data,
|
|
20283
|
+
}
|
|
20284
|
+
}),
|
|
20285
|
+
setAmount: assign((context, event) => {
|
|
20286
|
+
return {
|
|
20287
|
+
amount: event.data,
|
|
20288
|
+
}
|
|
20289
|
+
}),
|
|
20290
|
+
setWithdrawRulePreview: assign((context, event) => {
|
|
20291
|
+
return {
|
|
20292
|
+
...event.data,
|
|
20293
|
+
}
|
|
20294
|
+
}),
|
|
20295
|
+
reset: assign((context, event) => {
|
|
20296
|
+
return {
|
|
20297
|
+
amount: null,
|
|
20298
|
+
}
|
|
20299
|
+
}),
|
|
20300
|
+
},
|
|
20301
|
+
guards: {
|
|
20302
|
+
isValidAmount: (context, event) => {
|
|
20303
|
+
const { selectedPromo, amount } = context;
|
|
20304
|
+
return selectedPromo.minimumAmount <= amount
|
|
20305
|
+
},
|
|
20306
|
+
},
|
|
20307
|
+
services: {
|
|
20308
|
+
fetchInitData: async (context, event) => {
|
|
20309
|
+
return await request.send(payment.getPromotionsList())
|
|
20310
|
+
},
|
|
20311
|
+
fetchWithdrawRulePreview: async (context, event) => {
|
|
20312
|
+
const { selectedPromo, amount } = context;
|
|
20313
|
+
const { data } = await request.send(
|
|
20314
|
+
payment.getWithdrawRulePreview({ applyType: 'promotions', applyNo: selectedPromo.promotionsNo, amount: parseFloat(amount) })
|
|
20315
|
+
);
|
|
20316
|
+
return data
|
|
20317
|
+
},
|
|
20318
|
+
applyPromotion: async (context, event) => {
|
|
20319
|
+
const { selectedPromo, amount } = context;
|
|
20320
|
+
return await request.send(payment.applyPromotions({ promotionsNo: selectedPromo.promotionsNo, amount: parseFloat(amount) }))
|
|
20321
|
+
},
|
|
20322
|
+
},
|
|
20323
|
+
}
|
|
20324
|
+
)
|
|
20325
|
+
}
|
|
20326
|
+
|
|
19696
20327
|
var index$1 = {
|
|
19697
20328
|
...activity,
|
|
19698
20329
|
auth,
|
|
@@ -19730,6 +20361,7 @@ var index$1 = {
|
|
|
19730
20361
|
auth_otp_v2,
|
|
19731
20362
|
auth_otp_v3,
|
|
19732
20363
|
vip_table,
|
|
20364
|
+
promotions,
|
|
19733
20365
|
};
|
|
19734
20366
|
|
|
19735
20367
|
// const pickBy = require('lodash/pickBy')
|