@jetthai/cuora 1.1.92 → 1.1.93-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 +18 -0
- package/dist/bundle.mjs +529 -1269
- package/package.json +1 -1
- package/src/api/activity.js +13 -1
- package/src/machine/activity/deposit_activity.js +2 -2
- package/src/machine/activity/diamond_shop_activity_cash.js +214 -0
- package/src/machine/activity/fafafa_activity.js +35 -11
- package/src/machine/activity/index.js +2 -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 +6 -0
- package/src/machine/deposit/manual_cash.js +321 -0
- package/src/machine/deposit/qrcode_cash.js +258 -0
- package/src/machine/deposit/usdt_cash.js +138 -0
- package/src/machine/game_favorite_v2.js +6 -2
- package/src/machine/game_v2_1.js +35 -9
- package/src/machine/index.js +4 -6
- package/src/machine/reward_cash.js +220 -0
- package/src/machine/side_cash.js +110 -0
- package/src/machine/user_info.js +8 -2
- package/src/machine/withdraw/withdraw_activity.js +383 -0
- package/src/machine/withdraw_vn.js +1 -1
- package/src/machine/withdraw_vn2.js +1 -1
- 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,79 +3934,79 @@ 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
|
|
3938
|
-
|
|
3939
|
-
/*! *****************************************************************************
|
|
3940
|
-
Copyright (c) Microsoft Corporation.
|
|
3941
|
-
|
|
3942
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
3943
|
-
purpose with or without fee is hereby granted.
|
|
3944
|
-
|
|
3945
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3946
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3947
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3948
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3949
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3950
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3951
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
3952
|
-
***************************************************************************** */
|
|
3953
|
-
|
|
3954
|
-
var __assign = function() {
|
|
3955
|
-
__assign = Object.assign || function __assign(t) {
|
|
3956
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3957
|
-
s = arguments[i];
|
|
3958
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3959
|
-
}
|
|
3960
|
-
return t;
|
|
3961
|
-
};
|
|
3962
|
-
return __assign.apply(this, arguments);
|
|
3963
|
-
};
|
|
3964
|
-
|
|
3965
|
-
function __rest(s, e) {
|
|
3966
|
-
var t = {};
|
|
3967
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3968
|
-
t[p] = s[p];
|
|
3969
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3970
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3971
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3972
|
-
t[p[i]] = s[p[i]];
|
|
3973
|
-
}
|
|
3974
|
-
return t;
|
|
3975
|
-
}
|
|
3976
|
-
|
|
3977
|
-
function __values(o) {
|
|
3978
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3979
|
-
if (m) return m.call(o);
|
|
3980
|
-
if (o && typeof o.length === "number") return {
|
|
3981
|
-
next: function () {
|
|
3982
|
-
if (o && i >= o.length) o = void 0;
|
|
3983
|
-
return { value: o && o[i++], done: !o };
|
|
3984
|
-
}
|
|
3985
|
-
};
|
|
3986
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
3987
|
-
}
|
|
3988
|
-
|
|
3989
|
-
function __read(o, n) {
|
|
3990
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3991
|
-
if (!m) return o;
|
|
3992
|
-
var i = m.call(o), r, ar = [], e;
|
|
3993
|
-
try {
|
|
3994
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
3995
|
-
}
|
|
3996
|
-
catch (error) { e = { error: error }; }
|
|
3997
|
-
finally {
|
|
3998
|
-
try {
|
|
3999
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
4000
|
-
}
|
|
4001
|
-
finally { if (e) throw e.error; }
|
|
4002
|
-
}
|
|
4003
|
-
return ar;
|
|
4004
|
-
}
|
|
4005
|
-
|
|
4006
|
-
function __spreadArray(to, from) {
|
|
4007
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
4008
|
-
to[j] = from[i];
|
|
4009
|
-
return to;
|
|
3937
|
+
var index$2 = { activity: api, auth: auth$1, common: common$1, game, mailbox, payment, user, form };
|
|
3938
|
+
|
|
3939
|
+
/*! *****************************************************************************
|
|
3940
|
+
Copyright (c) Microsoft Corporation.
|
|
3941
|
+
|
|
3942
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
3943
|
+
purpose with or without fee is hereby granted.
|
|
3944
|
+
|
|
3945
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3946
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3947
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3948
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3949
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3950
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3951
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
3952
|
+
***************************************************************************** */
|
|
3953
|
+
|
|
3954
|
+
var __assign = function() {
|
|
3955
|
+
__assign = Object.assign || function __assign(t) {
|
|
3956
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3957
|
+
s = arguments[i];
|
|
3958
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3959
|
+
}
|
|
3960
|
+
return t;
|
|
3961
|
+
};
|
|
3962
|
+
return __assign.apply(this, arguments);
|
|
3963
|
+
};
|
|
3964
|
+
|
|
3965
|
+
function __rest(s, e) {
|
|
3966
|
+
var t = {};
|
|
3967
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3968
|
+
t[p] = s[p];
|
|
3969
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3970
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3971
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3972
|
+
t[p[i]] = s[p[i]];
|
|
3973
|
+
}
|
|
3974
|
+
return t;
|
|
3975
|
+
}
|
|
3976
|
+
|
|
3977
|
+
function __values(o) {
|
|
3978
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3979
|
+
if (m) return m.call(o);
|
|
3980
|
+
if (o && typeof o.length === "number") return {
|
|
3981
|
+
next: function () {
|
|
3982
|
+
if (o && i >= o.length) o = void 0;
|
|
3983
|
+
return { value: o && o[i++], done: !o };
|
|
3984
|
+
}
|
|
3985
|
+
};
|
|
3986
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
3987
|
+
}
|
|
3988
|
+
|
|
3989
|
+
function __read(o, n) {
|
|
3990
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3991
|
+
if (!m) return o;
|
|
3992
|
+
var i = m.call(o), r, ar = [], e;
|
|
3993
|
+
try {
|
|
3994
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
3995
|
+
}
|
|
3996
|
+
catch (error) { e = { error: error }; }
|
|
3997
|
+
finally {
|
|
3998
|
+
try {
|
|
3999
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
4000
|
+
}
|
|
4001
|
+
finally { if (e) throw e.error; }
|
|
4002
|
+
}
|
|
4003
|
+
return ar;
|
|
4004
|
+
}
|
|
4005
|
+
|
|
4006
|
+
function __spreadArray(to, from) {
|
|
4007
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
4008
|
+
to[j] = from[i];
|
|
4009
|
+
return to;
|
|
4010
4010
|
}
|
|
4011
4011
|
|
|
4012
4012
|
var STATE_DELIMITER = '.';
|
|
@@ -4143,9 +4143,9 @@ function mapFilterValues(collection, iteratee, predicate) {
|
|
|
4143
4143
|
|
|
4144
4144
|
return result;
|
|
4145
4145
|
}
|
|
4146
|
-
/**
|
|
4147
|
-
* Retrieves a value at the given path.
|
|
4148
|
-
* @param props The deep path to the prop of the desired value
|
|
4146
|
+
/**
|
|
4147
|
+
* Retrieves a value at the given path.
|
|
4148
|
+
* @param props The deep path to the prop of the desired value
|
|
4149
4149
|
*/
|
|
4150
4150
|
|
|
4151
4151
|
var path = function (props) {
|
|
@@ -4174,9 +4174,9 @@ var path = function (props) {
|
|
|
4174
4174
|
return result;
|
|
4175
4175
|
};
|
|
4176
4176
|
};
|
|
4177
|
-
/**
|
|
4178
|
-
* Retrieves a value at the given path via the nested accessor prop.
|
|
4179
|
-
* @param props The deep path to the prop of the desired value
|
|
4177
|
+
/**
|
|
4178
|
+
* Retrieves a value at the given path via the nested accessor prop.
|
|
4179
|
+
* @param props The deep path to the prop of the desired value
|
|
4180
4180
|
*/
|
|
4181
4181
|
|
|
4182
4182
|
function nestedPath(props, accessorProp) {
|
|
@@ -4624,11 +4624,11 @@ function toActivityDefinition(action) {
|
|
|
4624
4624
|
type: actionObject.type
|
|
4625
4625
|
});
|
|
4626
4626
|
}
|
|
4627
|
-
/**
|
|
4628
|
-
* Raises an event. This places the event in the internal event queue, so that
|
|
4629
|
-
* the event is immediately consumed by the machine in the current step.
|
|
4630
|
-
*
|
|
4631
|
-
* @param eventType The event to raise.
|
|
4627
|
+
/**
|
|
4628
|
+
* Raises an event. This places the event in the internal event queue, so that
|
|
4629
|
+
* the event is immediately consumed by the machine in the current step.
|
|
4630
|
+
*
|
|
4631
|
+
* @param eventType The event to raise.
|
|
4632
4632
|
*/
|
|
4633
4633
|
|
|
4634
4634
|
function raise(event) {
|
|
@@ -4649,15 +4649,15 @@ function resolveRaise(action) {
|
|
|
4649
4649
|
_event: toSCXMLEvent(action.event)
|
|
4650
4650
|
};
|
|
4651
4651
|
}
|
|
4652
|
-
/**
|
|
4653
|
-
* Sends an event. This returns an action that will be read by an interpreter to
|
|
4654
|
-
* send the event in the next step, after the current step is finished executing.
|
|
4655
|
-
*
|
|
4656
|
-
* @param event The event to send.
|
|
4657
|
-
* @param options Options to pass into the send event:
|
|
4658
|
-
* - `id` - The unique send event identifier (used with `cancel()`).
|
|
4659
|
-
* - `delay` - The number of milliseconds to delay the sending of the event.
|
|
4660
|
-
* - `to` - The target of this event (by default, the machine the event was sent from).
|
|
4652
|
+
/**
|
|
4653
|
+
* Sends an event. This returns an action that will be read by an interpreter to
|
|
4654
|
+
* send the event in the next step, after the current step is finished executing.
|
|
4655
|
+
*
|
|
4656
|
+
* @param event The event to send.
|
|
4657
|
+
* @param options Options to pass into the send event:
|
|
4658
|
+
* - `id` - The unique send event identifier (used with `cancel()`).
|
|
4659
|
+
* - `delay` - The number of milliseconds to delay the sending of the event.
|
|
4660
|
+
* - `to` - The target of this event (by default, the machine the event was sent from).
|
|
4661
4661
|
*/
|
|
4662
4662
|
|
|
4663
4663
|
function send(event, options) {
|
|
@@ -4699,12 +4699,12 @@ var resolveLog = function (action, ctx, _event) {
|
|
|
4699
4699
|
})
|
|
4700
4700
|
});
|
|
4701
4701
|
};
|
|
4702
|
-
/**
|
|
4703
|
-
* Cancels an in-flight `send(...)` action. A canceled sent action will not
|
|
4704
|
-
* be executed, nor will its event be sent, unless it has already been sent
|
|
4705
|
-
* (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).
|
|
4706
|
-
*
|
|
4707
|
-
* @param sendId The `id` of the `send(...)` action to cancel.
|
|
4702
|
+
/**
|
|
4703
|
+
* Cancels an in-flight `send(...)` action. A canceled sent action will not
|
|
4704
|
+
* be executed, nor will its event be sent, unless it has already been sent
|
|
4705
|
+
* (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).
|
|
4706
|
+
*
|
|
4707
|
+
* @param sendId The `id` of the `send(...)` action to cancel.
|
|
4708
4708
|
*/
|
|
4709
4709
|
|
|
4710
4710
|
var cancel = function (sendId) {
|
|
@@ -4713,10 +4713,10 @@ var cancel = function (sendId) {
|
|
|
4713
4713
|
sendId: sendId
|
|
4714
4714
|
};
|
|
4715
4715
|
};
|
|
4716
|
-
/**
|
|
4717
|
-
* Starts an activity.
|
|
4718
|
-
*
|
|
4719
|
-
* @param activity The activity to start.
|
|
4716
|
+
/**
|
|
4717
|
+
* Starts an activity.
|
|
4718
|
+
*
|
|
4719
|
+
* @param activity The activity to start.
|
|
4720
4720
|
*/
|
|
4721
4721
|
|
|
4722
4722
|
function start(activity) {
|
|
@@ -4727,10 +4727,10 @@ function start(activity) {
|
|
|
4727
4727
|
exec: undefined
|
|
4728
4728
|
};
|
|
4729
4729
|
}
|
|
4730
|
-
/**
|
|
4731
|
-
* Stops an activity.
|
|
4732
|
-
*
|
|
4733
|
-
* @param actorRef The activity to stop.
|
|
4730
|
+
/**
|
|
4731
|
+
* Stops an activity.
|
|
4732
|
+
*
|
|
4733
|
+
* @param actorRef The activity to stop.
|
|
4734
4734
|
*/
|
|
4735
4735
|
|
|
4736
4736
|
function stop(actorRef) {
|
|
@@ -4752,10 +4752,10 @@ function resolveStop(action, context, _event) {
|
|
|
4752
4752
|
};
|
|
4753
4753
|
return actionObject;
|
|
4754
4754
|
}
|
|
4755
|
-
/**
|
|
4756
|
-
* Updates the current context of the machine.
|
|
4757
|
-
*
|
|
4758
|
-
* @param assignment An object that represents the partial context to update.
|
|
4755
|
+
/**
|
|
4756
|
+
* Updates the current context of the machine.
|
|
4757
|
+
*
|
|
4758
|
+
* @param assignment An object that represents the partial context to update.
|
|
4759
4759
|
*/
|
|
4760
4760
|
|
|
4761
4761
|
var assign = function (assignment) {
|
|
@@ -4764,24 +4764,24 @@ var assign = function (assignment) {
|
|
|
4764
4764
|
assignment: assignment
|
|
4765
4765
|
};
|
|
4766
4766
|
};
|
|
4767
|
-
/**
|
|
4768
|
-
* Returns an event type that represents an implicit event that
|
|
4769
|
-
* is sent after the specified `delay`.
|
|
4770
|
-
*
|
|
4771
|
-
* @param delayRef The delay in milliseconds
|
|
4772
|
-
* @param id The state node ID where this event is handled
|
|
4767
|
+
/**
|
|
4768
|
+
* Returns an event type that represents an implicit event that
|
|
4769
|
+
* is sent after the specified `delay`.
|
|
4770
|
+
*
|
|
4771
|
+
* @param delayRef The delay in milliseconds
|
|
4772
|
+
* @param id The state node ID where this event is handled
|
|
4773
4773
|
*/
|
|
4774
4774
|
|
|
4775
4775
|
function after(delayRef, id) {
|
|
4776
4776
|
var idSuffix = id ? "#" + id : '';
|
|
4777
4777
|
return ActionTypes.After + "(" + delayRef + ")" + idSuffix;
|
|
4778
4778
|
}
|
|
4779
|
-
/**
|
|
4780
|
-
* Returns an event that represents that a final state node
|
|
4781
|
-
* has been reached in the parent state node.
|
|
4782
|
-
*
|
|
4783
|
-
* @param id The final state node's parent state node `id`
|
|
4784
|
-
* @param data The data to pass into the event
|
|
4779
|
+
/**
|
|
4780
|
+
* Returns an event that represents that a final state node
|
|
4781
|
+
* has been reached in the parent state node.
|
|
4782
|
+
*
|
|
4783
|
+
* @param id The final state node's parent state node `id`
|
|
4784
|
+
* @param data The data to pass into the event
|
|
4785
4785
|
*/
|
|
4786
4786
|
|
|
4787
4787
|
function done(id, data) {
|
|
@@ -4797,14 +4797,14 @@ function done(id, data) {
|
|
|
4797
4797
|
|
|
4798
4798
|
return eventObject;
|
|
4799
4799
|
}
|
|
4800
|
-
/**
|
|
4801
|
-
* Returns an event that represents that an invoked service has terminated.
|
|
4802
|
-
*
|
|
4803
|
-
* An invoked service is terminated when it has reached a top-level final state node,
|
|
4804
|
-
* but not when it is canceled.
|
|
4805
|
-
*
|
|
4806
|
-
* @param id The final state node ID
|
|
4807
|
-
* @param data The data to pass into the event
|
|
4800
|
+
/**
|
|
4801
|
+
* Returns an event that represents that an invoked service has terminated.
|
|
4802
|
+
*
|
|
4803
|
+
* An invoked service is terminated when it has reached a top-level final state node,
|
|
4804
|
+
* but not when it is canceled.
|
|
4805
|
+
*
|
|
4806
|
+
* @param id The final state node ID
|
|
4807
|
+
* @param data The data to pass into the event
|
|
4808
4808
|
*/
|
|
4809
4809
|
|
|
4810
4810
|
function doneInvoke(id, data) {
|
|
@@ -5215,17 +5215,17 @@ var State =
|
|
|
5215
5215
|
|
|
5216
5216
|
/** @class */
|
|
5217
5217
|
function () {
|
|
5218
|
-
/**
|
|
5219
|
-
* Creates a new State instance.
|
|
5220
|
-
* @param value The state value
|
|
5221
|
-
* @param context The extended state
|
|
5222
|
-
* @param historyValue The tree representing historical values of the state nodes
|
|
5223
|
-
* @param history The previous state
|
|
5224
|
-
* @param actions An array of action objects to execute as side-effects
|
|
5225
|
-
* @param activities A mapping of activities and whether they are started (`true`) or stopped (`false`).
|
|
5226
|
-
* @param meta
|
|
5227
|
-
* @param events Internal event queue. Should be empty with run-to-completion semantics.
|
|
5228
|
-
* @param configuration
|
|
5218
|
+
/**
|
|
5219
|
+
* Creates a new State instance.
|
|
5220
|
+
* @param value The state value
|
|
5221
|
+
* @param context The extended state
|
|
5222
|
+
* @param historyValue The tree representing historical values of the state nodes
|
|
5223
|
+
* @param history The previous state
|
|
5224
|
+
* @param actions An array of action objects to execute as side-effects
|
|
5225
|
+
* @param activities A mapping of activities and whether they are started (`true`) or stopped (`false`).
|
|
5226
|
+
* @param meta
|
|
5227
|
+
* @param events Internal event queue. Should be empty with run-to-completion semantics.
|
|
5228
|
+
* @param configuration
|
|
5229
5229
|
*/
|
|
5230
5230
|
function State(config) {
|
|
5231
5231
|
var _this = this;
|
|
@@ -5261,10 +5261,10 @@ function () {
|
|
|
5261
5261
|
}
|
|
5262
5262
|
});
|
|
5263
5263
|
}
|
|
5264
|
-
/**
|
|
5265
|
-
* Creates a new State instance for the given `stateValue` and `context`.
|
|
5266
|
-
* @param stateValue
|
|
5267
|
-
* @param context
|
|
5264
|
+
/**
|
|
5265
|
+
* Creates a new State instance for the given `stateValue` and `context`.
|
|
5266
|
+
* @param stateValue
|
|
5267
|
+
* @param context
|
|
5268
5268
|
*/
|
|
5269
5269
|
|
|
5270
5270
|
|
|
@@ -5308,19 +5308,19 @@ function () {
|
|
|
5308
5308
|
children: {}
|
|
5309
5309
|
});
|
|
5310
5310
|
};
|
|
5311
|
-
/**
|
|
5312
|
-
* Creates a new State instance for the given `config`.
|
|
5313
|
-
* @param config The state config
|
|
5311
|
+
/**
|
|
5312
|
+
* Creates a new State instance for the given `config`.
|
|
5313
|
+
* @param config The state config
|
|
5314
5314
|
*/
|
|
5315
5315
|
|
|
5316
5316
|
|
|
5317
5317
|
State.create = function (config) {
|
|
5318
5318
|
return new State(config);
|
|
5319
5319
|
};
|
|
5320
|
-
/**
|
|
5321
|
-
* Creates a new `State` instance for the given `stateValue` and `context` with no actions (side-effects).
|
|
5322
|
-
* @param stateValue
|
|
5323
|
-
* @param context
|
|
5320
|
+
/**
|
|
5321
|
+
* Creates a new `State` instance for the given `stateValue` and `context` with no actions (side-effects).
|
|
5322
|
+
* @param stateValue
|
|
5323
|
+
* @param context
|
|
5324
5324
|
*/
|
|
5325
5325
|
|
|
5326
5326
|
|
|
@@ -5347,10 +5347,10 @@ function () {
|
|
|
5347
5347
|
|
|
5348
5348
|
return State.from(stateValue, context);
|
|
5349
5349
|
};
|
|
5350
|
-
/**
|
|
5351
|
-
* Returns an array of all the string leaf state node paths.
|
|
5352
|
-
* @param stateValue
|
|
5353
|
-
* @param delimiter The character(s) that separate each subpath in the string state node path.
|
|
5350
|
+
/**
|
|
5351
|
+
* Returns an array of all the string leaf state node paths.
|
|
5352
|
+
* @param stateValue
|
|
5353
|
+
* @param delimiter The character(s) that separate each subpath in the string state node path.
|
|
5354
5354
|
*/
|
|
5355
5355
|
|
|
5356
5356
|
|
|
@@ -5389,28 +5389,28 @@ function () {
|
|
|
5389
5389
|
tags: Array.from(tags)
|
|
5390
5390
|
});
|
|
5391
5391
|
};
|
|
5392
|
-
/**
|
|
5393
|
-
* Whether the current state value is a subset of the given parent state value.
|
|
5394
|
-
* @param parentStateValue
|
|
5392
|
+
/**
|
|
5393
|
+
* Whether the current state value is a subset of the given parent state value.
|
|
5394
|
+
* @param parentStateValue
|
|
5395
5395
|
*/
|
|
5396
5396
|
|
|
5397
5397
|
|
|
5398
5398
|
State.prototype.matches = function (parentStateValue) {
|
|
5399
5399
|
return matchesState(parentStateValue, this.value);
|
|
5400
5400
|
};
|
|
5401
|
-
/**
|
|
5402
|
-
* Whether the current state configuration has a state node with the specified `tag`.
|
|
5403
|
-
* @param tag
|
|
5401
|
+
/**
|
|
5402
|
+
* Whether the current state configuration has a state node with the specified `tag`.
|
|
5403
|
+
* @param tag
|
|
5404
5404
|
*/
|
|
5405
5405
|
|
|
5406
5406
|
|
|
5407
5407
|
State.prototype.hasTag = function (tag) {
|
|
5408
5408
|
return this.tags.has(tag);
|
|
5409
5409
|
};
|
|
5410
|
-
/**
|
|
5411
|
-
* Determines whether sending the `event` will cause a transition.
|
|
5412
|
-
* @param event The event to test
|
|
5413
|
-
* @returns Whether the event will cause a transition
|
|
5410
|
+
/**
|
|
5411
|
+
* Determines whether sending the `event` will cause a transition.
|
|
5412
|
+
* @param event The event to test
|
|
5413
|
+
* @returns Whether the event will cause a transition
|
|
5414
5414
|
*/
|
|
5415
5415
|
|
|
5416
5416
|
|
|
@@ -5427,9 +5427,9 @@ function () {
|
|
|
5427
5427
|
return State;
|
|
5428
5428
|
}();
|
|
5429
5429
|
|
|
5430
|
-
/**
|
|
5431
|
-
* Maintains a stack of the current service in scope.
|
|
5432
|
-
* This is used to provide the correct service to spawn().
|
|
5430
|
+
/**
|
|
5431
|
+
* Maintains a stack of the current service in scope.
|
|
5432
|
+
* This is used to provide the correct service to spawn().
|
|
5433
5433
|
*/
|
|
5434
5434
|
var provide = function (service, fn) {
|
|
5435
5435
|
var result = fn(service);
|
|
@@ -5459,11 +5459,11 @@ function createNullActor(id) {
|
|
|
5459
5459
|
}
|
|
5460
5460
|
};
|
|
5461
5461
|
}
|
|
5462
|
-
/**
|
|
5463
|
-
* Creates a deferred actor that is able to be invoked given the provided
|
|
5464
|
-
* invocation information in its `.meta` value.
|
|
5465
|
-
*
|
|
5466
|
-
* @param invokeDefinition The meta information needed to invoke the actor.
|
|
5462
|
+
/**
|
|
5463
|
+
* Creates a deferred actor that is able to be invoked given the provided
|
|
5464
|
+
* invocation information in its `.meta` value.
|
|
5465
|
+
*
|
|
5466
|
+
* @param invokeDefinition The meta information needed to invoke the actor.
|
|
5467
5467
|
*/
|
|
5468
5468
|
|
|
5469
5469
|
function createInvocableActor(invokeDefinition, machine, context, _event) {
|
|
@@ -5554,12 +5554,12 @@ var StateNode =
|
|
|
5554
5554
|
/** @class */
|
|
5555
5555
|
function () {
|
|
5556
5556
|
function StateNode(
|
|
5557
|
-
/**
|
|
5558
|
-
* The raw config used to create the machine.
|
|
5557
|
+
/**
|
|
5558
|
+
* The raw config used to create the machine.
|
|
5559
5559
|
*/
|
|
5560
5560
|
config, options,
|
|
5561
|
-
/**
|
|
5562
|
-
* The initial extended state
|
|
5561
|
+
/**
|
|
5562
|
+
* The initial extended state
|
|
5563
5563
|
*/
|
|
5564
5564
|
_context // TODO: this is unsafe, but we're removing it in v5 anyway
|
|
5565
5565
|
) {
|
|
@@ -5573,8 +5573,8 @@ function () {
|
|
|
5573
5573
|
|
|
5574
5574
|
this.config = config;
|
|
5575
5575
|
this._context = _context;
|
|
5576
|
-
/**
|
|
5577
|
-
* The order this state node appears. Corresponds to the implicit SCXML document order.
|
|
5576
|
+
/**
|
|
5577
|
+
* The order this state node appears. Corresponds to the implicit SCXML document order.
|
|
5578
5578
|
*/
|
|
5579
5579
|
|
|
5580
5580
|
this.order = -1;
|
|
@@ -5709,11 +5709,11 @@ function () {
|
|
|
5709
5709
|
return stateNode.on;
|
|
5710
5710
|
});
|
|
5711
5711
|
};
|
|
5712
|
-
/**
|
|
5713
|
-
* Clones this state machine with custom options and context.
|
|
5714
|
-
*
|
|
5715
|
-
* @param options Options (actions, guards, activities, services) to recursively merge with the existing options.
|
|
5716
|
-
* @param context Custom context (will override predefined context)
|
|
5712
|
+
/**
|
|
5713
|
+
* Clones this state machine with custom options and context.
|
|
5714
|
+
*
|
|
5715
|
+
* @param options Options (actions, guards, activities, services) to recursively merge with the existing options.
|
|
5716
|
+
* @param context Custom context (will override predefined context)
|
|
5717
5717
|
*/
|
|
5718
5718
|
|
|
5719
5719
|
|
|
@@ -5732,10 +5732,10 @@ function () {
|
|
|
5732
5732
|
delays: __assign(__assign({}, delays), options.delays)
|
|
5733
5733
|
}, context !== null && context !== void 0 ? context : this.context);
|
|
5734
5734
|
};
|
|
5735
|
-
/**
|
|
5736
|
-
* Clones this state machine with custom context.
|
|
5737
|
-
*
|
|
5738
|
-
* @param context Custom context (will override predefined context, not recursive)
|
|
5735
|
+
/**
|
|
5736
|
+
* Clones this state machine with custom context.
|
|
5737
|
+
*
|
|
5738
|
+
* @param context Custom context (will override predefined context, not recursive)
|
|
5739
5739
|
*/
|
|
5740
5740
|
|
|
5741
5741
|
|
|
@@ -5751,8 +5751,8 @@ function () {
|
|
|
5751
5751
|
configurable: true
|
|
5752
5752
|
});
|
|
5753
5753
|
Object.defineProperty(StateNode.prototype, "definition", {
|
|
5754
|
-
/**
|
|
5755
|
-
* The well-structured state node definition.
|
|
5754
|
+
/**
|
|
5755
|
+
* The well-structured state node definition.
|
|
5756
5756
|
*/
|
|
5757
5757
|
get: function () {
|
|
5758
5758
|
return {
|
|
@@ -5786,8 +5786,8 @@ function () {
|
|
|
5786
5786
|
};
|
|
5787
5787
|
|
|
5788
5788
|
Object.defineProperty(StateNode.prototype, "on", {
|
|
5789
|
-
/**
|
|
5790
|
-
* The mapping of events to transitions.
|
|
5789
|
+
/**
|
|
5790
|
+
* The mapping of events to transitions.
|
|
5791
5791
|
*/
|
|
5792
5792
|
get: function () {
|
|
5793
5793
|
if (this.__cache.on) {
|
|
@@ -5812,8 +5812,8 @@ function () {
|
|
|
5812
5812
|
configurable: true
|
|
5813
5813
|
});
|
|
5814
5814
|
Object.defineProperty(StateNode.prototype, "transitions", {
|
|
5815
|
-
/**
|
|
5816
|
-
* All the transitions that can be taken from this state node.
|
|
5815
|
+
/**
|
|
5816
|
+
* All the transitions that can be taken from this state node.
|
|
5817
5817
|
*/
|
|
5818
5818
|
get: function () {
|
|
5819
5819
|
return this.__cache.transitions || (this.__cache.transitions = this.formatTransitions(), this.__cache.transitions);
|
|
@@ -5836,8 +5836,8 @@ function () {
|
|
|
5836
5836
|
this.__cache.candidates[eventName] = candidates;
|
|
5837
5837
|
return candidates;
|
|
5838
5838
|
};
|
|
5839
|
-
/**
|
|
5840
|
-
* All delayed transitions from the config.
|
|
5839
|
+
/**
|
|
5840
|
+
* All delayed transitions from the config.
|
|
5841
5841
|
*/
|
|
5842
5842
|
|
|
5843
5843
|
|
|
@@ -5889,10 +5889,10 @@ function () {
|
|
|
5889
5889
|
});
|
|
5890
5890
|
});
|
|
5891
5891
|
};
|
|
5892
|
-
/**
|
|
5893
|
-
* Returns the state nodes represented by the current state value.
|
|
5894
|
-
*
|
|
5895
|
-
* @param state The state value or State instance
|
|
5892
|
+
/**
|
|
5893
|
+
* Returns the state nodes represented by the current state value.
|
|
5894
|
+
*
|
|
5895
|
+
* @param state The state value or State instance
|
|
5896
5896
|
*/
|
|
5897
5897
|
|
|
5898
5898
|
|
|
@@ -5923,10 +5923,10 @@ function () {
|
|
|
5923
5923
|
return allSubStateNodes.concat(subStateNode);
|
|
5924
5924
|
}, []));
|
|
5925
5925
|
};
|
|
5926
|
-
/**
|
|
5927
|
-
* Returns `true` if this state node explicitly handles the given event.
|
|
5928
|
-
*
|
|
5929
|
-
* @param event The event in question
|
|
5926
|
+
/**
|
|
5927
|
+
* Returns `true` if this state node explicitly handles the given event.
|
|
5928
|
+
*
|
|
5929
|
+
* @param event The event in question
|
|
5930
5930
|
*/
|
|
5931
5931
|
|
|
5932
5932
|
|
|
@@ -5934,12 +5934,12 @@ function () {
|
|
|
5934
5934
|
var eventType = getEventType(event);
|
|
5935
5935
|
return this.events.includes(eventType);
|
|
5936
5936
|
};
|
|
5937
|
-
/**
|
|
5938
|
-
* Resolves the given `state` to a new `State` instance relative to this machine.
|
|
5939
|
-
*
|
|
5940
|
-
* This ensures that `.events` and `.nextEvents` represent the correct values.
|
|
5941
|
-
*
|
|
5942
|
-
* @param state The state to resolve
|
|
5937
|
+
/**
|
|
5938
|
+
* Resolves the given `state` to a new `State` instance relative to this machine.
|
|
5939
|
+
*
|
|
5940
|
+
* This ensures that `.events` and `.nextEvents` represent the correct values.
|
|
5941
|
+
*
|
|
5942
|
+
* @param state The state to resolve
|
|
5943
5943
|
*/
|
|
5944
5944
|
|
|
5945
5945
|
|
|
@@ -6157,9 +6157,9 @@ function () {
|
|
|
6157
6157
|
|
|
6158
6158
|
return nodes;
|
|
6159
6159
|
};
|
|
6160
|
-
/**
|
|
6161
|
-
* Whether the given state node "escapes" this state node. If the `stateNode` is equal to or the parent of
|
|
6162
|
-
* this state node, it does not escape.
|
|
6160
|
+
/**
|
|
6161
|
+
* Whether the given state node "escapes" this state node. If the `stateNode` is equal to or the parent of
|
|
6162
|
+
* this state node, it does not escape.
|
|
6163
6163
|
*/
|
|
6164
6164
|
|
|
6165
6165
|
|
|
@@ -6284,12 +6284,12 @@ function () {
|
|
|
6284
6284
|
var actions = toActionObjects(exitActions.concat(transition.actions).concat(entryActions), this.machine.options.actions);
|
|
6285
6285
|
return actions;
|
|
6286
6286
|
};
|
|
6287
|
-
/**
|
|
6288
|
-
* Determines the next state given the current `state` and sent `event`.
|
|
6289
|
-
*
|
|
6290
|
-
* @param state The current State instance or state value
|
|
6291
|
-
* @param event The event that was sent at the current state
|
|
6292
|
-
* @param context The current context (extended state) of the current state
|
|
6287
|
+
/**
|
|
6288
|
+
* Determines the next state given the current `state` and sent `event`.
|
|
6289
|
+
*
|
|
6290
|
+
* @param state The current State instance or state value
|
|
6291
|
+
* @param event The event that was sent at the current state
|
|
6292
|
+
* @param context The current context (extended state) of the current state
|
|
6293
6293
|
*/
|
|
6294
6294
|
|
|
6295
6295
|
|
|
@@ -6482,8 +6482,8 @@ function () {
|
|
|
6482
6482
|
})));
|
|
6483
6483
|
return maybeNextState;
|
|
6484
6484
|
};
|
|
6485
|
-
/**
|
|
6486
|
-
* Returns the child state node from its relative `stateKey`, or throws.
|
|
6485
|
+
/**
|
|
6486
|
+
* Returns the child state node from its relative `stateKey`, or throws.
|
|
6487
6487
|
*/
|
|
6488
6488
|
|
|
6489
6489
|
|
|
@@ -6504,10 +6504,10 @@ function () {
|
|
|
6504
6504
|
|
|
6505
6505
|
return result;
|
|
6506
6506
|
};
|
|
6507
|
-
/**
|
|
6508
|
-
* Returns the state node with the given `stateId`, or throws.
|
|
6509
|
-
*
|
|
6510
|
-
* @param stateId The state ID. The prefix "#" is removed.
|
|
6507
|
+
/**
|
|
6508
|
+
* Returns the state node with the given `stateId`, or throws.
|
|
6509
|
+
*
|
|
6510
|
+
* @param stateId The state ID. The prefix "#" is removed.
|
|
6511
6511
|
*/
|
|
6512
6512
|
|
|
6513
6513
|
|
|
@@ -6526,10 +6526,10 @@ function () {
|
|
|
6526
6526
|
|
|
6527
6527
|
return stateNode;
|
|
6528
6528
|
};
|
|
6529
|
-
/**
|
|
6530
|
-
* Returns the relative state node from the given `statePath`, or throws.
|
|
6531
|
-
*
|
|
6532
|
-
* @param statePath The string or string array relative path to the state node.
|
|
6529
|
+
/**
|
|
6530
|
+
* Returns the relative state node from the given `statePath`, or throws.
|
|
6531
|
+
*
|
|
6532
|
+
* @param statePath The string or string array relative path to the state node.
|
|
6533
6533
|
*/
|
|
6534
6534
|
|
|
6535
6535
|
|
|
@@ -6557,10 +6557,10 @@ function () {
|
|
|
6557
6557
|
|
|
6558
6558
|
return currentStateNode;
|
|
6559
6559
|
};
|
|
6560
|
-
/**
|
|
6561
|
-
* Resolves a partial state value with its full representation in this machine.
|
|
6562
|
-
*
|
|
6563
|
-
* @param stateValue The partial state value to resolve.
|
|
6560
|
+
/**
|
|
6561
|
+
* Resolves a partial state value with its full representation in this machine.
|
|
6562
|
+
*
|
|
6563
|
+
* @param stateValue The partial state value to resolve.
|
|
6564
6564
|
*/
|
|
6565
6565
|
|
|
6566
6566
|
|
|
@@ -6664,9 +6664,9 @@ function () {
|
|
|
6664
6664
|
};
|
|
6665
6665
|
|
|
6666
6666
|
Object.defineProperty(StateNode.prototype, "initialState", {
|
|
6667
|
-
/**
|
|
6668
|
-
* The initial State instance, which includes all actions to be executed from
|
|
6669
|
-
* entering the initial state.
|
|
6667
|
+
/**
|
|
6668
|
+
* The initial State instance, which includes all actions to be executed from
|
|
6669
|
+
* entering the initial state.
|
|
6670
6670
|
*/
|
|
6671
6671
|
get: function () {
|
|
6672
6672
|
this._init(); // TODO: this should be in the constructor (see note in constructor)
|
|
@@ -6684,9 +6684,9 @@ function () {
|
|
|
6684
6684
|
configurable: true
|
|
6685
6685
|
});
|
|
6686
6686
|
Object.defineProperty(StateNode.prototype, "target", {
|
|
6687
|
-
/**
|
|
6688
|
-
* The target state value of the history state node, if it exists. This represents the
|
|
6689
|
-
* default state value to transition to if no history value exists yet.
|
|
6687
|
+
/**
|
|
6688
|
+
* The target state value of the history state node, if it exists. This represents the
|
|
6689
|
+
* default state value to transition to if no history value exists yet.
|
|
6690
6690
|
*/
|
|
6691
6691
|
get: function () {
|
|
6692
6692
|
var target;
|
|
@@ -6706,12 +6706,12 @@ function () {
|
|
|
6706
6706
|
enumerable: false,
|
|
6707
6707
|
configurable: true
|
|
6708
6708
|
});
|
|
6709
|
-
/**
|
|
6710
|
-
* Returns the leaf nodes from a state path relative to this state node.
|
|
6711
|
-
*
|
|
6712
|
-
* @param relativeStateId The relative state path to retrieve the state nodes
|
|
6713
|
-
* @param history The previous state to retrieve history
|
|
6714
|
-
* @param resolve Whether state nodes should resolve to initial child state nodes
|
|
6709
|
+
/**
|
|
6710
|
+
* Returns the leaf nodes from a state path relative to this state node.
|
|
6711
|
+
*
|
|
6712
|
+
* @param relativeStateId The relative state path to retrieve the state nodes
|
|
6713
|
+
* @param history The previous state to retrieve history
|
|
6714
|
+
* @param resolve Whether state nodes should resolve to initial child state nodes
|
|
6715
6715
|
*/
|
|
6716
6716
|
|
|
6717
6717
|
StateNode.prototype.getRelativeStateNodes = function (relativeStateId, historyValue, resolve) {
|
|
@@ -6744,11 +6744,11 @@ function () {
|
|
|
6744
6744
|
enumerable: false,
|
|
6745
6745
|
configurable: true
|
|
6746
6746
|
});
|
|
6747
|
-
/**
|
|
6748
|
-
* Retrieves state nodes from a relative path to this state node.
|
|
6749
|
-
*
|
|
6750
|
-
* @param relativePath The relative path from this state node
|
|
6751
|
-
* @param historyValue
|
|
6747
|
+
/**
|
|
6748
|
+
* Retrieves state nodes from a relative path to this state node.
|
|
6749
|
+
*
|
|
6750
|
+
* @param relativePath The relative path from this state node
|
|
6751
|
+
* @param historyValue
|
|
6752
6752
|
*/
|
|
6753
6753
|
|
|
6754
6754
|
StateNode.prototype.getFromRelativePath = function (relativePath) {
|
|
@@ -6796,11 +6796,11 @@ function () {
|
|
|
6796
6796
|
})
|
|
6797
6797
|
};
|
|
6798
6798
|
};
|
|
6799
|
-
/**
|
|
6800
|
-
* Resolves to the historical value(s) of the parent state node,
|
|
6801
|
-
* represented by state nodes.
|
|
6802
|
-
*
|
|
6803
|
-
* @param historyValue
|
|
6799
|
+
/**
|
|
6800
|
+
* Resolves to the historical value(s) of the parent state node,
|
|
6801
|
+
* represented by state nodes.
|
|
6802
|
+
*
|
|
6803
|
+
* @param historyValue
|
|
6804
6804
|
*/
|
|
6805
6805
|
|
|
6806
6806
|
|
|
@@ -6832,8 +6832,8 @@ function () {
|
|
|
6832
6832
|
};
|
|
6833
6833
|
|
|
6834
6834
|
Object.defineProperty(StateNode.prototype, "stateIds", {
|
|
6835
|
-
/**
|
|
6836
|
-
* All the state node IDs of this state node and its descendant state nodes.
|
|
6835
|
+
/**
|
|
6836
|
+
* All the state node IDs of this state node and its descendant state nodes.
|
|
6837
6837
|
*/
|
|
6838
6838
|
get: function () {
|
|
6839
6839
|
var _this = this;
|
|
@@ -6847,8 +6847,8 @@ function () {
|
|
|
6847
6847
|
configurable: true
|
|
6848
6848
|
});
|
|
6849
6849
|
Object.defineProperty(StateNode.prototype, "events", {
|
|
6850
|
-
/**
|
|
6851
|
-
* All the event types accepted by this state node and its descendants.
|
|
6850
|
+
/**
|
|
6851
|
+
* All the event types accepted by this state node and its descendants.
|
|
6852
6852
|
*/
|
|
6853
6853
|
get: function () {
|
|
6854
6854
|
var e_7, _a, e_8, _b;
|
|
@@ -6904,10 +6904,10 @@ function () {
|
|
|
6904
6904
|
configurable: true
|
|
6905
6905
|
});
|
|
6906
6906
|
Object.defineProperty(StateNode.prototype, "ownEvents", {
|
|
6907
|
-
/**
|
|
6908
|
-
* All the events that have transitions directly from this state node.
|
|
6909
|
-
*
|
|
6910
|
-
* Excludes any inert events.
|
|
6907
|
+
/**
|
|
6908
|
+
* All the events that have transitions directly from this state node.
|
|
6909
|
+
*
|
|
6910
|
+
* Excludes any inert events.
|
|
6911
6911
|
*/
|
|
6912
6912
|
get: function () {
|
|
6913
6913
|
var events = new Set(this.transitions.filter(function (transition) {
|
|
@@ -15944,7 +15944,7 @@ var uaParser = {exports: {}};
|
|
|
15944
15944
|
|
|
15945
15945
|
(function (module, exports) {
|
|
15946
15946
|
/////////////////////////////////////////////////////////////////////////////////
|
|
15947
|
-
/* UAParser.js v0.7.
|
|
15947
|
+
/* UAParser.js v0.7.35
|
|
15948
15948
|
Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
|
|
15949
15949
|
MIT License *//*
|
|
15950
15950
|
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
|
|
@@ -15960,7 +15960,7 @@ var uaParser = {exports: {}};
|
|
|
15960
15960
|
/////////////
|
|
15961
15961
|
|
|
15962
15962
|
|
|
15963
|
-
var LIBVERSION = '0.7.
|
|
15963
|
+
var LIBVERSION = '0.7.35',
|
|
15964
15964
|
EMPTY = '',
|
|
15965
15965
|
UNKNOWN = '?',
|
|
15966
15966
|
FUNC_TYPE = 'function',
|
|
@@ -16178,8 +16178,9 @@ var uaParser = {exports: {}};
|
|
|
16178
16178
|
/(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer
|
|
16179
16179
|
|
|
16180
16180
|
// Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
|
|
16181
|
-
/(flock|rockmelt|midori|epiphany|silk|skyfire|
|
|
16181
|
+
/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
|
|
16182
16182
|
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
|
|
16183
|
+
/(heytap|ovi)browser\/([\d\.]+)/i, // Heytap/Ovi
|
|
16183
16184
|
/(weibo)__([\d\.]+)/i // Weibo
|
|
16184
16185
|
], [NAME, VERSION], [
|
|
16185
16186
|
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
|
|
@@ -16193,7 +16194,7 @@ var uaParser = {exports: {}};
|
|
|
16193
16194
|
], [VERSION, [NAME, 'Konqueror']], [
|
|
16194
16195
|
/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11
|
|
16195
16196
|
], [VERSION, [NAME, 'IE']], [
|
|
16196
|
-
/
|
|
16197
|
+
/ya(?:search)?browser\/([\w\.]+)/i // Yandex
|
|
16197
16198
|
], [VERSION, [NAME, 'Yandex']], [
|
|
16198
16199
|
/(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
|
|
16199
16200
|
], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [
|
|
@@ -16237,6 +16238,8 @@ var uaParser = {exports: {}};
|
|
|
16237
16238
|
], [NAME, VERSION], [
|
|
16238
16239
|
/\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS
|
|
16239
16240
|
], [VERSION, [NAME, 'GSA']], [
|
|
16241
|
+
/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok
|
|
16242
|
+
], [VERSION, [NAME, 'TikTok']], [
|
|
16240
16243
|
|
|
16241
16244
|
/headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless
|
|
16242
16245
|
], [VERSION, [NAME, CHROME+' Headless']], [
|
|
@@ -16332,7 +16335,7 @@ var uaParser = {exports: {}};
|
|
|
16332
16335
|
], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [
|
|
16333
16336
|
|
|
16334
16337
|
// Apple
|
|
16335
|
-
|
|
16338
|
+
/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i // iPod/iPhone
|
|
16336
16339
|
], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [
|
|
16337
16340
|
/\((ipad);[-\w\),; ]+apple/i, // iPad
|
|
16338
16341
|
/applecoremedia\/[\w\.]+ \((ipad)/i,
|
|
@@ -16422,7 +16425,7 @@ var uaParser = {exports: {}};
|
|
|
16422
16425
|
|
|
16423
16426
|
// Amazon
|
|
16424
16427
|
/(alexa)webm/i,
|
|
16425
|
-
/(kf[a-z]{2}wi)( bui|\))/i,
|
|
16428
|
+
/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, // Kindle Fire without Silk / Echo Show
|
|
16426
16429
|
/(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD
|
|
16427
16430
|
], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [
|
|
16428
16431
|
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone
|
|
@@ -16607,6 +16610,8 @@ var uaParser = {exports: {}};
|
|
|
16607
16610
|
|
|
16608
16611
|
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i // Tesla
|
|
16609
16612
|
], [VENDOR, [TYPE, EMBEDDED]], [
|
|
16613
|
+
/(aeobc)\b/i // Echo Dot
|
|
16614
|
+
], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [
|
|
16610
16615
|
|
|
16611
16616
|
////////////////////
|
|
16612
16617
|
// MIXED (GENERIC)
|
|
@@ -16636,7 +16641,8 @@ var uaParser = {exports: {}};
|
|
|
16636
16641
|
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
|
|
16637
16642
|
/ekioh(flow)\/([\w\.]+)/i, // Flow
|
|
16638
16643
|
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links
|
|
16639
|
-
/(icab)[\/ ]([23]\.[\d\.]+)/i
|
|
16644
|
+
/(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab
|
|
16645
|
+
/\b(libweb)/i
|
|
16640
16646
|
], [NAME, VERSION], [
|
|
16641
16647
|
|
|
16642
16648
|
/rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko
|
|
@@ -16657,6 +16663,7 @@ var uaParser = {exports: {}};
|
|
|
16657
16663
|
|
|
16658
16664
|
// iOS/macOS
|
|
16659
16665
|
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
|
|
16666
|
+
/ios;fbsv\/([\d\.]+)/i,
|
|
16660
16667
|
/cfnetwork\/.+darwin/i
|
|
16661
16668
|
], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [
|
|
16662
16669
|
/(mac os x) ?([\w\. ]*)/i,
|
|
@@ -16713,7 +16720,7 @@ var uaParser = {exports: {}};
|
|
|
16713
16720
|
], [[NAME, 'Solaris'], VERSION], [
|
|
16714
16721
|
/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris
|
|
16715
16722
|
/(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX
|
|
16716
|
-
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,
|
|
16723
|
+
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS
|
|
16717
16724
|
/(unix) ?([\w\.]*)/i // UNIX
|
|
16718
16725
|
], [NAME, VERSION]
|
|
16719
16726
|
]
|
|
@@ -16738,6 +16745,7 @@ var uaParser = {exports: {}};
|
|
|
16738
16745
|
var _ua = ua || ((_navigator && _navigator.userAgent) ? _navigator.userAgent : EMPTY);
|
|
16739
16746
|
var _uach = (_navigator && _navigator.userAgentData) ? _navigator.userAgentData : undefined$1;
|
|
16740
16747
|
var _rgxmap = extensions ? extend(regexes, extensions) : regexes;
|
|
16748
|
+
var _isSelfNav = _navigator && _navigator.userAgent == _ua;
|
|
16741
16749
|
|
|
16742
16750
|
this.getBrowser = function () {
|
|
16743
16751
|
var _browser = {};
|
|
@@ -16746,7 +16754,7 @@ var uaParser = {exports: {}};
|
|
|
16746
16754
|
rgxMapper.call(_browser, _ua, _rgxmap.browser);
|
|
16747
16755
|
_browser[MAJOR] = majorize(_browser[VERSION]);
|
|
16748
16756
|
// Brave-specific detection
|
|
16749
|
-
if (_navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
|
|
16757
|
+
if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
|
|
16750
16758
|
_browser[NAME] = 'Brave';
|
|
16751
16759
|
}
|
|
16752
16760
|
return _browser;
|
|
@@ -16763,11 +16771,11 @@ var uaParser = {exports: {}};
|
|
|
16763
16771
|
_device[MODEL] = undefined$1;
|
|
16764
16772
|
_device[TYPE] = undefined$1;
|
|
16765
16773
|
rgxMapper.call(_device, _ua, _rgxmap.device);
|
|
16766
|
-
if (!_device[TYPE] && _uach && _uach.mobile) {
|
|
16774
|
+
if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) {
|
|
16767
16775
|
_device[TYPE] = MOBILE;
|
|
16768
16776
|
}
|
|
16769
16777
|
// iPadOS-specific detection: identified as Mac, but has some iOS-only properties
|
|
16770
|
-
if (_device[MODEL] == 'Macintosh' && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
|
|
16778
|
+
if (_isSelfNav && _device[MODEL] == 'Macintosh' && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
|
|
16771
16779
|
_device[MODEL] = 'iPad';
|
|
16772
16780
|
_device[TYPE] = TABLET;
|
|
16773
16781
|
}
|
|
@@ -16785,7 +16793,7 @@ var uaParser = {exports: {}};
|
|
|
16785
16793
|
_os[NAME] = undefined$1;
|
|
16786
16794
|
_os[VERSION] = undefined$1;
|
|
16787
16795
|
rgxMapper.call(_os, _ua, _rgxmap.os);
|
|
16788
|
-
if (!_os[NAME] && _uach && _uach.platform != 'Unknown') {
|
|
16796
|
+
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != 'Unknown') {
|
|
16789
16797
|
_os[NAME] = _uach.platform
|
|
16790
16798
|
.replace(/chrome os/i, CHROMIUM_OS)
|
|
16791
16799
|
.replace(/macos/i, MAC_OS); // backward compatibility
|
|
@@ -17154,38 +17162,52 @@ function error () {
|
|
|
17154
17162
|
)
|
|
17155
17163
|
}
|
|
17156
17164
|
|
|
17157
|
-
|
|
17165
|
+
const MY_FAVORITE = 'MyFavorite';
|
|
17166
|
+
const GAME_SEARCH = 'GameSearch';
|
|
17167
|
+
|
|
17168
|
+
var constant = /*#__PURE__*/Object.freeze({
|
|
17169
|
+
__proto__: null,
|
|
17170
|
+
MY_FAVORITE: MY_FAVORITE,
|
|
17171
|
+
GAME_SEARCH: GAME_SEARCH
|
|
17172
|
+
});
|
|
17158
17173
|
|
|
17159
|
-
|
|
17174
|
+
// 對應 intersectionObserver 版本
|
|
17175
|
+
function game_v2_1 (request) {
|
|
17160
17176
|
return createMachine(
|
|
17161
17177
|
{
|
|
17162
17178
|
id: 'game',
|
|
17163
17179
|
type: 'parallel',
|
|
17164
17180
|
context: {
|
|
17165
|
-
|
|
17181
|
+
base: '/',
|
|
17182
|
+
loadable: false,
|
|
17183
|
+
isLastPage: false,
|
|
17166
17184
|
room: null,
|
|
17167
|
-
|
|
17168
|
-
|
|
17185
|
+
index: -1,
|
|
17186
|
+
content: {
|
|
17187
|
+
data: [],
|
|
17188
|
+
timestamp: null,
|
|
17189
|
+
parentCategoryId: null,
|
|
17190
|
+
totalPage: 0,
|
|
17191
|
+
},
|
|
17192
|
+
additionEnable: false,
|
|
17193
|
+
addition: {
|
|
17194
|
+
data: [],
|
|
17195
|
+
timestamp: null,
|
|
17196
|
+
totalPage: 0,
|
|
17197
|
+
},
|
|
17198
|
+
staticData: [],
|
|
17169
17199
|
// play params
|
|
17170
17200
|
game: {
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
|
|
17201
|
+
providerId: null,
|
|
17202
|
+
gameId: null,
|
|
17203
|
+
gameTypeId: null,
|
|
17204
|
+
mappingId: null,
|
|
17175
17205
|
portrait: null,
|
|
17176
17206
|
},
|
|
17177
17207
|
lang: 'en_US',
|
|
17178
17208
|
isMobile: new UAParser().getResult().device.type,
|
|
17179
17209
|
gameURL: null,
|
|
17180
|
-
|
|
17181
|
-
sha: {
|
|
17182
|
-
category: null,
|
|
17183
|
-
status: null,
|
|
17184
|
-
},
|
|
17185
|
-
isCategoryChanged: false,
|
|
17186
|
-
isStatusChanged: false,
|
|
17187
|
-
statusMap: {},
|
|
17188
|
-
optionMap: {},
|
|
17210
|
+
...oldContext,
|
|
17189
17211
|
},
|
|
17190
17212
|
states: {
|
|
17191
17213
|
flow: {
|
|
@@ -17194,12 +17216,19 @@ function game (request) {
|
|
|
17194
17216
|
idle: {
|
|
17195
17217
|
enter: 'clearGameInfo',
|
|
17196
17218
|
on: {
|
|
17219
|
+
SET_STATIC_DATA: {
|
|
17220
|
+
actions: 'setStaticData',
|
|
17221
|
+
},
|
|
17222
|
+
SET_ADDITION_ENABLE: {
|
|
17223
|
+
actions: 'setAdditionEnable',
|
|
17224
|
+
},
|
|
17225
|
+
LOAD: {
|
|
17226
|
+
target: 'routing',
|
|
17227
|
+
actions: 'setLoadable',
|
|
17228
|
+
},
|
|
17197
17229
|
SET_ROOM: {
|
|
17198
|
-
|
|
17199
|
-
actions: 'setRoom',
|
|
17200
|
-
cond: (context, event) => {
|
|
17201
|
-
return context.room?.id !== event.data?.id
|
|
17202
|
-
},
|
|
17230
|
+
cond: 'isDifferentRoom',
|
|
17231
|
+
actions: ['setRoom', 'resetContent'],
|
|
17203
17232
|
},
|
|
17204
17233
|
ENTER_GAME: {
|
|
17205
17234
|
target: 'connecting',
|
|
@@ -17208,17 +17237,29 @@ function game (request) {
|
|
|
17208
17237
|
},
|
|
17209
17238
|
},
|
|
17210
17239
|
loading: {
|
|
17240
|
+
entry: 'increaseIndex',
|
|
17211
17241
|
invoke: {
|
|
17212
|
-
src: '
|
|
17242
|
+
src: 'getPageContent',
|
|
17213
17243
|
onDone: {
|
|
17214
|
-
target: '
|
|
17215
|
-
actions: '
|
|
17244
|
+
target: 'routing',
|
|
17245
|
+
actions: ['appendContent', 'setLastPage'],
|
|
17216
17246
|
},
|
|
17217
17247
|
onError: {
|
|
17218
17248
|
target: 'idle',
|
|
17219
|
-
actions: assign({ list: [] }),
|
|
17220
17249
|
},
|
|
17221
17250
|
},
|
|
17251
|
+
on: {
|
|
17252
|
+
LOAD: { actions: 'setLoadable' },
|
|
17253
|
+
},
|
|
17254
|
+
},
|
|
17255
|
+
routing: {
|
|
17256
|
+
always: [
|
|
17257
|
+
{
|
|
17258
|
+
target: 'loading',
|
|
17259
|
+
cond: 'hasNext',
|
|
17260
|
+
},
|
|
17261
|
+
{ target: 'idle' },
|
|
17262
|
+
],
|
|
17222
17263
|
},
|
|
17223
17264
|
connecting: {
|
|
17224
17265
|
invoke: {
|
|
@@ -17253,6 +17294,36 @@ function game (request) {
|
|
|
17253
17294
|
},
|
|
17254
17295
|
},
|
|
17255
17296
|
timer: {
|
|
17297
|
+
initial: 'pending',
|
|
17298
|
+
states: {
|
|
17299
|
+
pending: {
|
|
17300
|
+
after: {
|
|
17301
|
+
20000: [
|
|
17302
|
+
{
|
|
17303
|
+
target: 'updating',
|
|
17304
|
+
cond: 'hasRoom',
|
|
17305
|
+
},
|
|
17306
|
+
{
|
|
17307
|
+
target: 'pending',
|
|
17308
|
+
},
|
|
17309
|
+
],
|
|
17310
|
+
},
|
|
17311
|
+
},
|
|
17312
|
+
updating: {
|
|
17313
|
+
invoke: {
|
|
17314
|
+
src: 'updatePageContent',
|
|
17315
|
+
onDone: {
|
|
17316
|
+
target: 'pending',
|
|
17317
|
+
actions: 'swapContent',
|
|
17318
|
+
},
|
|
17319
|
+
onError: {
|
|
17320
|
+
target: 'pending',
|
|
17321
|
+
},
|
|
17322
|
+
},
|
|
17323
|
+
},
|
|
17324
|
+
},
|
|
17325
|
+
},
|
|
17326
|
+
oldTimer: {
|
|
17256
17327
|
initial: 'fetchingGameSHA',
|
|
17257
17328
|
states: {
|
|
17258
17329
|
fetchingGameSHA: {
|
|
@@ -17268,11 +17339,7 @@ function game (request) {
|
|
|
17268
17339
|
},
|
|
17269
17340
|
},
|
|
17270
17341
|
checking: {
|
|
17271
|
-
always: [
|
|
17272
|
-
{ target: 'updatingStatus', cond: 'isStatusChanged' },
|
|
17273
|
-
{ target: 'updatingCategory', cond: 'isCategoryChanged' },
|
|
17274
|
-
{ target: 'pending' },
|
|
17275
|
-
],
|
|
17342
|
+
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17276
17343
|
},
|
|
17277
17344
|
updatingStatus: {
|
|
17278
17345
|
invoke: {
|
|
@@ -17289,21 +17356,9 @@ function game (request) {
|
|
|
17289
17356
|
updatingOption: {
|
|
17290
17357
|
invoke: {
|
|
17291
17358
|
src: 'fetchOption',
|
|
17292
|
-
onDone: {
|
|
17293
|
-
target: 'updatingCategory',
|
|
17294
|
-
actions: 'mergeOption',
|
|
17295
|
-
},
|
|
17296
|
-
onError: {
|
|
17297
|
-
target: 'pending',
|
|
17298
|
-
},
|
|
17299
|
-
},
|
|
17300
|
-
},
|
|
17301
|
-
updatingCategory: {
|
|
17302
|
-
invoke: {
|
|
17303
|
-
src: 'getRoomItems',
|
|
17304
17359
|
onDone: {
|
|
17305
17360
|
target: 'pending',
|
|
17306
|
-
actions: '
|
|
17361
|
+
actions: 'mergeOption',
|
|
17307
17362
|
},
|
|
17308
17363
|
onError: {
|
|
17309
17364
|
target: 'pending',
|
|
@@ -17323,39 +17378,95 @@ function game (request) {
|
|
|
17323
17378
|
},
|
|
17324
17379
|
{
|
|
17325
17380
|
actions: {
|
|
17326
|
-
|
|
17327
|
-
return {
|
|
17381
|
+
setStaticData: assign((context, event) => {
|
|
17382
|
+
return {
|
|
17383
|
+
staticData: event.data,
|
|
17384
|
+
}
|
|
17385
|
+
}),
|
|
17386
|
+
setAdditionEnable: assign((context, event) => {
|
|
17387
|
+
return {
|
|
17388
|
+
additionEnable: event.data,
|
|
17389
|
+
}
|
|
17390
|
+
}),
|
|
17391
|
+
setLoadable: assign((context, event) => {
|
|
17392
|
+
return {
|
|
17393
|
+
loadable: event.data,
|
|
17394
|
+
}
|
|
17395
|
+
}),
|
|
17396
|
+
setLastPage: assign((context, event) => {
|
|
17397
|
+
const { index, content } = context;
|
|
17398
|
+
return {
|
|
17399
|
+
isLastPage: index >= content?.totalPage - 1,
|
|
17400
|
+
}
|
|
17328
17401
|
}),
|
|
17329
17402
|
setRoom: assign((context, event) => {
|
|
17330
17403
|
return {
|
|
17331
17404
|
room: event.data,
|
|
17332
|
-
roomId: event.data.id,
|
|
17333
17405
|
}
|
|
17334
17406
|
}),
|
|
17335
|
-
|
|
17336
|
-
|
|
17337
|
-
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17344
|
-
|
|
17345
|
-
|
|
17346
|
-
|
|
17347
|
-
|
|
17348
|
-
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
|
|
17352
|
-
|
|
17353
|
-
|
|
17354
|
-
|
|
17355
|
-
|
|
17356
|
-
|
|
17357
|
-
|
|
17358
|
-
|
|
17407
|
+
resetContent: assign((context, event) => {
|
|
17408
|
+
console.log('resetContent');
|
|
17409
|
+
return {
|
|
17410
|
+
loadable: false,
|
|
17411
|
+
isLastPage: false,
|
|
17412
|
+
index: -1,
|
|
17413
|
+
content: {
|
|
17414
|
+
data: [],
|
|
17415
|
+
timestamp: null,
|
|
17416
|
+
parentCategoryId: null,
|
|
17417
|
+
totalPage: 0,
|
|
17418
|
+
},
|
|
17419
|
+
addition: {
|
|
17420
|
+
data: [],
|
|
17421
|
+
timestamp: null,
|
|
17422
|
+
totalPage: 0,
|
|
17423
|
+
},
|
|
17424
|
+
}
|
|
17425
|
+
}),
|
|
17426
|
+
appendContent: assign((context, event) => {
|
|
17427
|
+
const { room, additionEnable } = context;
|
|
17428
|
+
if (room.categoryId === GAME_SEARCH) {
|
|
17429
|
+
return
|
|
17430
|
+
} else if (additionEnable) {
|
|
17431
|
+
const [content, addition] = event.data;
|
|
17432
|
+
return {
|
|
17433
|
+
content: {
|
|
17434
|
+
...context.content,
|
|
17435
|
+
...content,
|
|
17436
|
+
data: context.content.data.concat(content.data),
|
|
17437
|
+
},
|
|
17438
|
+
addition: {
|
|
17439
|
+
...context.addition,
|
|
17440
|
+
...addition,
|
|
17441
|
+
data: context.addition.data.concat(addition.data),
|
|
17442
|
+
},
|
|
17443
|
+
}
|
|
17444
|
+
} else {
|
|
17445
|
+
const [content] = event.data;
|
|
17446
|
+
return {
|
|
17447
|
+
content: {
|
|
17448
|
+
...context.content,
|
|
17449
|
+
...content,
|
|
17450
|
+
data: context.content.data.concat(content.data),
|
|
17451
|
+
},
|
|
17452
|
+
}
|
|
17453
|
+
}
|
|
17454
|
+
}),
|
|
17455
|
+
swapContent: assign((context, event) => {
|
|
17456
|
+
const [content, addition] = event.data;
|
|
17457
|
+
let result = {};
|
|
17458
|
+
if (content?.data?.length) {
|
|
17459
|
+
result.content = content;
|
|
17460
|
+
}
|
|
17461
|
+
if (addition?.data?.length) {
|
|
17462
|
+
result.addition = addition;
|
|
17463
|
+
}
|
|
17464
|
+
return result
|
|
17465
|
+
}),
|
|
17466
|
+
increaseIndex: assign((context, event) => {
|
|
17467
|
+
return {
|
|
17468
|
+
index: context.index + 1,
|
|
17469
|
+
}
|
|
17359
17470
|
}),
|
|
17360
17471
|
setGameURL: assign({
|
|
17361
17472
|
gameURL: (context, event) => {
|
|
@@ -17363,768 +17474,11 @@ function game (request) {
|
|
|
17363
17474
|
},
|
|
17364
17475
|
}),
|
|
17365
17476
|
clearGameInfo: assign((context, event) => {
|
|
17366
|
-
return { game: {
|
|
17477
|
+
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
17367
17478
|
}),
|
|
17368
17479
|
setGameInfo: assign((context, event) => {
|
|
17369
|
-
const {
|
|
17370
|
-
return { game: {
|
|
17371
|
-
}),
|
|
17372
|
-
setLang: assign((context, event) => {
|
|
17373
|
-
const lang = event.data.locale.replace('-', '_');
|
|
17374
|
-
return { lang }
|
|
17375
|
-
}),
|
|
17376
|
-
setGameSHA: assign((context, event) => {
|
|
17377
|
-
const { sha } = context;
|
|
17378
|
-
const newSha = event.data;
|
|
17379
|
-
return {
|
|
17380
|
-
sha: newSha,
|
|
17381
|
-
isCategoryChanged: !sha.category || sha.category !== newSha.category,
|
|
17382
|
-
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17383
|
-
}
|
|
17384
|
-
}),
|
|
17385
|
-
setStatus: assign((context, event) => {
|
|
17386
|
-
return {
|
|
17387
|
-
statusMap: event.data,
|
|
17388
|
-
}
|
|
17389
|
-
}),
|
|
17390
|
-
mergeOption: assign((context, event) => {
|
|
17391
|
-
const { optionMap } = context;
|
|
17392
|
-
return {
|
|
17393
|
-
optionMap: { ...optionMap, ...event.data },
|
|
17394
|
-
}
|
|
17395
|
-
}),
|
|
17396
|
-
},
|
|
17397
|
-
guards: {
|
|
17398
|
-
isCategoryChanged: (context, event) => context.isCategoryChanged,
|
|
17399
|
-
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17400
|
-
},
|
|
17401
|
-
services: {
|
|
17402
|
-
getRoomItems: async (context, event) => {
|
|
17403
|
-
return await request.send(game$1.getGameCategory({ id: context.roomId }))
|
|
17404
|
-
},
|
|
17405
|
-
connectGame: async (context, event) => {
|
|
17406
|
-
const { lang, isMobile } = context;
|
|
17407
|
-
const { provider, game_id, game_type, mapping_id } = context.game;
|
|
17408
|
-
const params = {
|
|
17409
|
-
provider_id: provider,
|
|
17410
|
-
game_id: game_id,
|
|
17411
|
-
gametype_id: game_type,
|
|
17412
|
-
mapping_id: mapping_id,
|
|
17413
|
-
is_demo: false,
|
|
17414
|
-
is_mobile: isMobile,
|
|
17415
|
-
lang,
|
|
17416
|
-
return_url: window.location.href,
|
|
17417
|
-
};
|
|
17418
|
-
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17419
|
-
return { gameURL: redirect_url }
|
|
17420
|
-
},
|
|
17421
|
-
disconnectGame: async (context, event) => {
|
|
17422
|
-
const uid_site = event.data;
|
|
17423
|
-
return await request.send(game$1.logoutGame({ uid_site, provider_id: context.game.provider }))
|
|
17424
|
-
},
|
|
17425
|
-
fetchOption: async (context, event) => {
|
|
17426
|
-
return await request.send(game$1.getOptionMap())
|
|
17427
|
-
},
|
|
17428
|
-
fetchGameSHA: async (context, event) => {
|
|
17429
|
-
return await request.send(game$1.getGameSHA())
|
|
17430
|
-
},
|
|
17431
|
-
fetchStatus: async (context, event) => {
|
|
17432
|
-
return await request.send(game$1.getGameStatus())
|
|
17433
|
-
},
|
|
17434
|
-
},
|
|
17435
|
-
}
|
|
17436
|
-
)
|
|
17437
|
-
}
|
|
17438
|
-
|
|
17439
|
-
const MY_FAVORITE = 'MyFavorite';
|
|
17440
|
-
const GAME_SEARCH = 'GameSearch';
|
|
17441
|
-
|
|
17442
|
-
var constant = /*#__PURE__*/Object.freeze({
|
|
17443
|
-
__proto__: null,
|
|
17444
|
-
MY_FAVORITE: MY_FAVORITE,
|
|
17445
|
-
GAME_SEARCH: GAME_SEARCH
|
|
17446
|
-
});
|
|
17447
|
-
|
|
17448
|
-
function game_v2 (request) {
|
|
17449
|
-
return createMachine(
|
|
17450
|
-
{
|
|
17451
|
-
id: 'game',
|
|
17452
|
-
type: 'parallel',
|
|
17453
|
-
context: {
|
|
17454
|
-
room: null,
|
|
17455
|
-
index: 0,
|
|
17456
|
-
content: {
|
|
17457
|
-
data: [],
|
|
17458
|
-
timestamp: null,
|
|
17459
|
-
parentCategoryId: null,
|
|
17460
|
-
totalPage: 1,
|
|
17461
|
-
},
|
|
17462
|
-
addition: {
|
|
17463
|
-
data: [],
|
|
17464
|
-
timestamp: null,
|
|
17465
|
-
totalPage: 1,
|
|
17466
|
-
},
|
|
17467
|
-
// play params
|
|
17468
|
-
game: {
|
|
17469
|
-
providerId: null,
|
|
17470
|
-
gameId: null,
|
|
17471
|
-
gameTypeId: null,
|
|
17472
|
-
mappingId: null,
|
|
17473
|
-
portrait: null,
|
|
17474
|
-
},
|
|
17475
|
-
lang: 'en_US',
|
|
17476
|
-
isMobile: new UAParser().getResult().device.type,
|
|
17477
|
-
gameURL: null,
|
|
17478
|
-
...oldContext$1,
|
|
17479
|
-
},
|
|
17480
|
-
states: {
|
|
17481
|
-
flow: {
|
|
17482
|
-
initial: 'idle',
|
|
17483
|
-
states: {
|
|
17484
|
-
idle: {
|
|
17485
|
-
enter: 'clearGameInfo',
|
|
17486
|
-
on: {
|
|
17487
|
-
ENTER_ROOM: {
|
|
17488
|
-
target: 'loading',
|
|
17489
|
-
cond: 'isDifferentRoom',
|
|
17490
|
-
actions: ['setRoom', 'resetContent'],
|
|
17491
|
-
},
|
|
17492
|
-
NEXT_PAGE: {
|
|
17493
|
-
target: 'loading',
|
|
17494
|
-
cond: 'hasNext',
|
|
17495
|
-
actions: 'increaseIndex',
|
|
17496
|
-
},
|
|
17497
|
-
ENTER_GAME: {
|
|
17498
|
-
target: 'connecting',
|
|
17499
|
-
actions: ['setGameInfo', 'setLang'],
|
|
17500
|
-
},
|
|
17501
|
-
},
|
|
17502
|
-
},
|
|
17503
|
-
loading: {
|
|
17504
|
-
invoke: {
|
|
17505
|
-
src: 'getPageContent',
|
|
17506
|
-
onDone: {
|
|
17507
|
-
target: 'idle',
|
|
17508
|
-
actions: 'appendContent',
|
|
17509
|
-
},
|
|
17510
|
-
onError: {
|
|
17511
|
-
target: 'idle',
|
|
17512
|
-
},
|
|
17513
|
-
},
|
|
17514
|
-
},
|
|
17515
|
-
connecting: {
|
|
17516
|
-
invoke: {
|
|
17517
|
-
src: 'connectGame',
|
|
17518
|
-
onDone: {
|
|
17519
|
-
target: 'playing',
|
|
17520
|
-
actions: 'setGameURL',
|
|
17521
|
-
},
|
|
17522
|
-
onError: {
|
|
17523
|
-
target: 'idle',
|
|
17524
|
-
},
|
|
17525
|
-
},
|
|
17526
|
-
},
|
|
17527
|
-
playing: {
|
|
17528
|
-
on: {
|
|
17529
|
-
EXIT_GAME: {
|
|
17530
|
-
target: 'disconnect',
|
|
17531
|
-
},
|
|
17532
|
-
},
|
|
17533
|
-
},
|
|
17534
|
-
disconnect: {
|
|
17535
|
-
invoke: {
|
|
17536
|
-
src: 'disconnectGame',
|
|
17537
|
-
onDone: {
|
|
17538
|
-
target: 'idle',
|
|
17539
|
-
},
|
|
17540
|
-
onError: {
|
|
17541
|
-
target: 'idle',
|
|
17542
|
-
},
|
|
17543
|
-
},
|
|
17544
|
-
},
|
|
17545
|
-
},
|
|
17546
|
-
},
|
|
17547
|
-
timer: {
|
|
17548
|
-
initial: 'pending',
|
|
17549
|
-
states: {
|
|
17550
|
-
pending: {
|
|
17551
|
-
after: {
|
|
17552
|
-
20000: [
|
|
17553
|
-
{
|
|
17554
|
-
target: 'updating',
|
|
17555
|
-
cond: 'hasRoom',
|
|
17556
|
-
},
|
|
17557
|
-
{
|
|
17558
|
-
target: 'pending',
|
|
17559
|
-
},
|
|
17560
|
-
],
|
|
17561
|
-
},
|
|
17562
|
-
},
|
|
17563
|
-
updating: {
|
|
17564
|
-
invoke: {
|
|
17565
|
-
src: 'updatePageContent',
|
|
17566
|
-
onDone: {
|
|
17567
|
-
target: 'pending',
|
|
17568
|
-
actions: 'swapContent',
|
|
17569
|
-
},
|
|
17570
|
-
onError: {
|
|
17571
|
-
target: 'pending',
|
|
17572
|
-
},
|
|
17573
|
-
},
|
|
17574
|
-
},
|
|
17575
|
-
},
|
|
17576
|
-
},
|
|
17577
|
-
oldTimer: {
|
|
17578
|
-
initial: 'fetchingGameSHA',
|
|
17579
|
-
states: {
|
|
17580
|
-
fetchingGameSHA: {
|
|
17581
|
-
invoke: {
|
|
17582
|
-
src: 'fetchGameSHA',
|
|
17583
|
-
onDone: {
|
|
17584
|
-
target: 'checking',
|
|
17585
|
-
actions: 'setGameSHA',
|
|
17586
|
-
},
|
|
17587
|
-
onError: {
|
|
17588
|
-
target: 'pending',
|
|
17589
|
-
},
|
|
17590
|
-
},
|
|
17591
|
-
},
|
|
17592
|
-
checking: {
|
|
17593
|
-
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17594
|
-
},
|
|
17595
|
-
updatingStatus: {
|
|
17596
|
-
invoke: {
|
|
17597
|
-
src: 'fetchStatus',
|
|
17598
|
-
onDone: {
|
|
17599
|
-
target: 'updatingOption',
|
|
17600
|
-
actions: ['setStatus'],
|
|
17601
|
-
},
|
|
17602
|
-
onError: {
|
|
17603
|
-
target: 'pending',
|
|
17604
|
-
},
|
|
17605
|
-
},
|
|
17606
|
-
},
|
|
17607
|
-
updatingOption: {
|
|
17608
|
-
invoke: {
|
|
17609
|
-
src: 'fetchOption',
|
|
17610
|
-
onDone: {
|
|
17611
|
-
target: 'pending',
|
|
17612
|
-
actions: 'mergeOption',
|
|
17613
|
-
},
|
|
17614
|
-
onError: {
|
|
17615
|
-
target: 'pending',
|
|
17616
|
-
},
|
|
17617
|
-
},
|
|
17618
|
-
},
|
|
17619
|
-
pending: {
|
|
17620
|
-
after: {
|
|
17621
|
-
20000: {
|
|
17622
|
-
target: 'fetchingGameSHA',
|
|
17623
|
-
},
|
|
17624
|
-
},
|
|
17625
|
-
},
|
|
17626
|
-
},
|
|
17627
|
-
},
|
|
17628
|
-
},
|
|
17629
|
-
},
|
|
17630
|
-
{
|
|
17631
|
-
actions: {
|
|
17632
|
-
setFavoriteList: assign((context, event) => {
|
|
17633
|
-
return {
|
|
17634
|
-
favoriteList: event.data.data || [],
|
|
17635
|
-
}
|
|
17636
|
-
}),
|
|
17637
|
-
setRoom: assign((context, event) => {
|
|
17638
|
-
return {
|
|
17639
|
-
room: event.data,
|
|
17640
|
-
}
|
|
17641
|
-
}),
|
|
17642
|
-
resetContent: assign((context, event) => {
|
|
17643
|
-
return {
|
|
17644
|
-
index: 0,
|
|
17645
|
-
content: {
|
|
17646
|
-
data: [],
|
|
17647
|
-
timestamp: null,
|
|
17648
|
-
parentCategoryId: null,
|
|
17649
|
-
totalPage: 1,
|
|
17650
|
-
},
|
|
17651
|
-
addition: {
|
|
17652
|
-
data: [],
|
|
17653
|
-
timestamp: null,
|
|
17654
|
-
totalPage: 1,
|
|
17655
|
-
},
|
|
17656
|
-
}
|
|
17657
|
-
}),
|
|
17658
|
-
appendContent: assign((context, event) => {
|
|
17659
|
-
const { room, favoriteList } = context;
|
|
17660
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17661
|
-
return
|
|
17662
|
-
} else {
|
|
17663
|
-
const [content, addition] = event.data;
|
|
17664
|
-
return {
|
|
17665
|
-
content: {
|
|
17666
|
-
...context.content,
|
|
17667
|
-
...content,
|
|
17668
|
-
data: context.content.data.concat(content.data),
|
|
17669
|
-
},
|
|
17670
|
-
addition: {
|
|
17671
|
-
...context.addition,
|
|
17672
|
-
...addition,
|
|
17673
|
-
data: context.addition.data.concat(addition.data),
|
|
17674
|
-
},
|
|
17675
|
-
}
|
|
17676
|
-
}
|
|
17677
|
-
}),
|
|
17678
|
-
swapContent: assign((context, event) => {
|
|
17679
|
-
const [content, addition] = event.data;
|
|
17680
|
-
let result = {};
|
|
17681
|
-
if (content?.data?.length) {
|
|
17682
|
-
result.content = content;
|
|
17683
|
-
}
|
|
17684
|
-
if (addition?.data?.length) {
|
|
17685
|
-
result.addition = addition;
|
|
17686
|
-
}
|
|
17687
|
-
return result
|
|
17688
|
-
}),
|
|
17689
|
-
increaseIndex: assign((context, event) => {
|
|
17690
|
-
return {
|
|
17691
|
-
index: context.index + 1,
|
|
17692
|
-
}
|
|
17693
|
-
}),
|
|
17694
|
-
setGameURL: assign({
|
|
17695
|
-
gameURL: (context, event) => {
|
|
17696
|
-
return event.data.gameURL
|
|
17697
|
-
},
|
|
17698
|
-
}),
|
|
17699
|
-
clearGameInfo: assign((context, event) => {
|
|
17700
|
-
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
17701
|
-
}),
|
|
17702
|
-
setGameInfo: assign((context, event) => {
|
|
17703
|
-
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
17704
|
-
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
17705
|
-
}),
|
|
17706
|
-
setLang: assign((context, event) => {
|
|
17707
|
-
const lang = event.data.locale.replace('-', '_');
|
|
17708
|
-
return { lang }
|
|
17709
|
-
}),
|
|
17710
|
-
...oldActions$1,
|
|
17711
|
-
},
|
|
17712
|
-
guards: {
|
|
17713
|
-
isDifferentRoom: (context, event) => context.room?.categoryId !== event.data?.categoryId,
|
|
17714
|
-
hasNext: (context, event) => context.index < context?.content?.totalPage - 1,
|
|
17715
|
-
hasRoom: (context, event) => context.room?.categoryId,
|
|
17716
|
-
...oldGuards$1,
|
|
17717
|
-
},
|
|
17718
|
-
services: {
|
|
17719
|
-
getPageContent: async (context, event) => {
|
|
17720
|
-
const { room, index } = context;
|
|
17721
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17722
|
-
return
|
|
17723
|
-
} else {
|
|
17724
|
-
const param = { categoryId: room.categoryId, index };
|
|
17725
|
-
return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
|
|
17726
|
-
}
|
|
17727
|
-
},
|
|
17728
|
-
updatePageContent: async (context, event) => {
|
|
17729
|
-
const { room, content, index } = context;
|
|
17730
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17731
|
-
return
|
|
17732
|
-
} else {
|
|
17733
|
-
return await Promise.all([
|
|
17734
|
-
request.send(
|
|
17735
|
-
game$1.getListCategoryByRange({
|
|
17736
|
-
categoryId: room.categoryId,
|
|
17737
|
-
end: index,
|
|
17738
|
-
timestamp: content.timestamp,
|
|
17739
|
-
})
|
|
17740
|
-
),
|
|
17741
|
-
request.send(
|
|
17742
|
-
game$1.getListAdditionByRange({
|
|
17743
|
-
categoryId: room.categoryId,
|
|
17744
|
-
end: index,
|
|
17745
|
-
timestamp: content.timestamp,
|
|
17746
|
-
})
|
|
17747
|
-
),
|
|
17748
|
-
])
|
|
17749
|
-
}
|
|
17750
|
-
},
|
|
17751
|
-
connectGame: async (context, event) => {
|
|
17752
|
-
const { lang, isMobile } = context;
|
|
17753
|
-
const { providerId, gameId, gameTypeId, mappingId } = context.game;
|
|
17754
|
-
const params = {
|
|
17755
|
-
provider_id: providerId,
|
|
17756
|
-
game_id: gameId,
|
|
17757
|
-
gametype_id: gameTypeId,
|
|
17758
|
-
mapping_id: mappingId,
|
|
17759
|
-
is_demo: false,
|
|
17760
|
-
is_mobile: isMobile,
|
|
17761
|
-
lang,
|
|
17762
|
-
return_url: window.location.href,
|
|
17763
|
-
};
|
|
17764
|
-
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17765
|
-
return { gameURL: redirect_url }
|
|
17766
|
-
},
|
|
17767
|
-
disconnectGame: async (context, event) => {
|
|
17768
|
-
const uid_site = event.data;
|
|
17769
|
-
const provider_id = context.game.providerId;
|
|
17770
|
-
return await request.send(game$1.logoutGame({ uid_site, provider_id }))
|
|
17771
|
-
},
|
|
17772
|
-
...oldServices$1(request),
|
|
17773
|
-
},
|
|
17774
|
-
}
|
|
17775
|
-
)
|
|
17776
|
-
}
|
|
17777
|
-
|
|
17778
|
-
const oldContext$1 = {
|
|
17779
|
-
sha: {
|
|
17780
|
-
status: null,
|
|
17781
|
-
},
|
|
17782
|
-
isStatusChanged: false,
|
|
17783
|
-
statusMap: {},
|
|
17784
|
-
optionMap: {},
|
|
17785
|
-
};
|
|
17786
|
-
|
|
17787
|
-
const oldActions$1 = {
|
|
17788
|
-
setGameSHA: assign((context, event) => {
|
|
17789
|
-
const { sha } = context;
|
|
17790
|
-
const newSha = event.data;
|
|
17791
|
-
return {
|
|
17792
|
-
sha: newSha,
|
|
17793
|
-
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17794
|
-
}
|
|
17795
|
-
}),
|
|
17796
|
-
setStatus: assign((context, event) => {
|
|
17797
|
-
return {
|
|
17798
|
-
statusMap: event.data,
|
|
17799
|
-
}
|
|
17800
|
-
}),
|
|
17801
|
-
mergeOption: assign((context, event) => {
|
|
17802
|
-
const { optionMap } = context;
|
|
17803
|
-
return {
|
|
17804
|
-
optionMap: { ...optionMap, ...event.data },
|
|
17805
|
-
}
|
|
17806
|
-
}),
|
|
17807
|
-
};
|
|
17808
|
-
|
|
17809
|
-
const oldGuards$1 = {
|
|
17810
|
-
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17811
|
-
};
|
|
17812
|
-
|
|
17813
|
-
const oldServices$1 = (request) => ({
|
|
17814
|
-
fetchOption: async (context, event) => {
|
|
17815
|
-
return await request.send(game$1.getOptionMap())
|
|
17816
|
-
},
|
|
17817
|
-
fetchGameSHA: async (context, event) => {
|
|
17818
|
-
return await request.send(game$1.getGameSHA())
|
|
17819
|
-
},
|
|
17820
|
-
fetchStatus: async (context, event) => {
|
|
17821
|
-
return await request.send(game$1.getGameStatus())
|
|
17822
|
-
},
|
|
17823
|
-
});
|
|
17824
|
-
|
|
17825
|
-
// 對應 intersectionObserver 版本
|
|
17826
|
-
function game_v2_1 (request) {
|
|
17827
|
-
return createMachine(
|
|
17828
|
-
{
|
|
17829
|
-
id: 'game',
|
|
17830
|
-
type: 'parallel',
|
|
17831
|
-
context: {
|
|
17832
|
-
base: '/',
|
|
17833
|
-
loadable: false,
|
|
17834
|
-
isLastPage: false,
|
|
17835
|
-
room: null,
|
|
17836
|
-
index: -1,
|
|
17837
|
-
content: {
|
|
17838
|
-
data: [],
|
|
17839
|
-
timestamp: null,
|
|
17840
|
-
parentCategoryId: null,
|
|
17841
|
-
totalPage: 0,
|
|
17842
|
-
},
|
|
17843
|
-
additionEnable: false,
|
|
17844
|
-
addition: {
|
|
17845
|
-
data: [],
|
|
17846
|
-
timestamp: null,
|
|
17847
|
-
totalPage: 0,
|
|
17848
|
-
},
|
|
17849
|
-
// play params
|
|
17850
|
-
game: {
|
|
17851
|
-
providerId: null,
|
|
17852
|
-
gameId: null,
|
|
17853
|
-
gameTypeId: null,
|
|
17854
|
-
mappingId: null,
|
|
17855
|
-
portrait: null,
|
|
17856
|
-
},
|
|
17857
|
-
lang: 'en_US',
|
|
17858
|
-
isMobile: new UAParser().getResult().device.type,
|
|
17859
|
-
gameURL: null,
|
|
17860
|
-
...oldContext,
|
|
17861
|
-
},
|
|
17862
|
-
states: {
|
|
17863
|
-
flow: {
|
|
17864
|
-
initial: 'idle',
|
|
17865
|
-
states: {
|
|
17866
|
-
idle: {
|
|
17867
|
-
enter: 'clearGameInfo',
|
|
17868
|
-
on: {
|
|
17869
|
-
SET_ADDITION_ENABLE: {
|
|
17870
|
-
actions: 'setAdditionEnable',
|
|
17871
|
-
},
|
|
17872
|
-
LOAD: {
|
|
17873
|
-
target: 'routing',
|
|
17874
|
-
actions: 'setLoadable',
|
|
17875
|
-
},
|
|
17876
|
-
SET_ROOM: {
|
|
17877
|
-
cond: 'isDifferentRoom',
|
|
17878
|
-
actions: ['setRoom', 'resetContent'],
|
|
17879
|
-
},
|
|
17880
|
-
ENTER_GAME: {
|
|
17881
|
-
target: 'connecting',
|
|
17882
|
-
actions: ['setGameInfo', 'setLang'],
|
|
17883
|
-
},
|
|
17884
|
-
},
|
|
17885
|
-
},
|
|
17886
|
-
loading: {
|
|
17887
|
-
entry: 'increaseIndex',
|
|
17888
|
-
invoke: {
|
|
17889
|
-
src: 'getPageContent',
|
|
17890
|
-
onDone: {
|
|
17891
|
-
target: 'routing',
|
|
17892
|
-
actions: ['appendContent', 'setLastPage'],
|
|
17893
|
-
},
|
|
17894
|
-
onError: {
|
|
17895
|
-
target: 'idle',
|
|
17896
|
-
},
|
|
17897
|
-
},
|
|
17898
|
-
on: {
|
|
17899
|
-
LOAD: { actions: 'setLoadable' },
|
|
17900
|
-
},
|
|
17901
|
-
},
|
|
17902
|
-
routing: {
|
|
17903
|
-
always: [
|
|
17904
|
-
{
|
|
17905
|
-
target: 'loading',
|
|
17906
|
-
cond: 'hasNext',
|
|
17907
|
-
},
|
|
17908
|
-
{ target: 'idle' },
|
|
17909
|
-
],
|
|
17910
|
-
},
|
|
17911
|
-
connecting: {
|
|
17912
|
-
invoke: {
|
|
17913
|
-
src: 'connectGame',
|
|
17914
|
-
onDone: {
|
|
17915
|
-
target: 'playing',
|
|
17916
|
-
actions: 'setGameURL',
|
|
17917
|
-
},
|
|
17918
|
-
onError: {
|
|
17919
|
-
target: 'idle',
|
|
17920
|
-
},
|
|
17921
|
-
},
|
|
17922
|
-
},
|
|
17923
|
-
playing: {
|
|
17924
|
-
on: {
|
|
17925
|
-
EXIT_GAME: {
|
|
17926
|
-
target: 'disconnect',
|
|
17927
|
-
},
|
|
17928
|
-
},
|
|
17929
|
-
},
|
|
17930
|
-
disconnect: {
|
|
17931
|
-
invoke: {
|
|
17932
|
-
src: 'disconnectGame',
|
|
17933
|
-
onDone: {
|
|
17934
|
-
target: 'idle',
|
|
17935
|
-
},
|
|
17936
|
-
onError: {
|
|
17937
|
-
target: 'idle',
|
|
17938
|
-
},
|
|
17939
|
-
},
|
|
17940
|
-
},
|
|
17941
|
-
},
|
|
17942
|
-
},
|
|
17943
|
-
timer: {
|
|
17944
|
-
initial: 'pending',
|
|
17945
|
-
states: {
|
|
17946
|
-
pending: {
|
|
17947
|
-
after: {
|
|
17948
|
-
20000: [
|
|
17949
|
-
{
|
|
17950
|
-
target: 'updating',
|
|
17951
|
-
cond: 'hasRoom',
|
|
17952
|
-
},
|
|
17953
|
-
{
|
|
17954
|
-
target: 'pending',
|
|
17955
|
-
},
|
|
17956
|
-
],
|
|
17957
|
-
},
|
|
17958
|
-
},
|
|
17959
|
-
updating: {
|
|
17960
|
-
invoke: {
|
|
17961
|
-
src: 'updatePageContent',
|
|
17962
|
-
onDone: {
|
|
17963
|
-
target: 'pending',
|
|
17964
|
-
actions: 'swapContent',
|
|
17965
|
-
},
|
|
17966
|
-
onError: {
|
|
17967
|
-
target: 'pending',
|
|
17968
|
-
},
|
|
17969
|
-
},
|
|
17970
|
-
},
|
|
17971
|
-
},
|
|
17972
|
-
},
|
|
17973
|
-
oldTimer: {
|
|
17974
|
-
initial: 'fetchingGameSHA',
|
|
17975
|
-
states: {
|
|
17976
|
-
fetchingGameSHA: {
|
|
17977
|
-
invoke: {
|
|
17978
|
-
src: 'fetchGameSHA',
|
|
17979
|
-
onDone: {
|
|
17980
|
-
target: 'checking',
|
|
17981
|
-
actions: 'setGameSHA',
|
|
17982
|
-
},
|
|
17983
|
-
onError: {
|
|
17984
|
-
target: 'pending',
|
|
17985
|
-
},
|
|
17986
|
-
},
|
|
17987
|
-
},
|
|
17988
|
-
checking: {
|
|
17989
|
-
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17990
|
-
},
|
|
17991
|
-
updatingStatus: {
|
|
17992
|
-
invoke: {
|
|
17993
|
-
src: 'fetchStatus',
|
|
17994
|
-
onDone: {
|
|
17995
|
-
target: 'updatingOption',
|
|
17996
|
-
actions: ['setStatus'],
|
|
17997
|
-
},
|
|
17998
|
-
onError: {
|
|
17999
|
-
target: 'pending',
|
|
18000
|
-
},
|
|
18001
|
-
},
|
|
18002
|
-
},
|
|
18003
|
-
updatingOption: {
|
|
18004
|
-
invoke: {
|
|
18005
|
-
src: 'fetchOption',
|
|
18006
|
-
onDone: {
|
|
18007
|
-
target: 'pending',
|
|
18008
|
-
actions: 'mergeOption',
|
|
18009
|
-
},
|
|
18010
|
-
onError: {
|
|
18011
|
-
target: 'pending',
|
|
18012
|
-
},
|
|
18013
|
-
},
|
|
18014
|
-
},
|
|
18015
|
-
pending: {
|
|
18016
|
-
after: {
|
|
18017
|
-
20000: {
|
|
18018
|
-
target: 'fetchingGameSHA',
|
|
18019
|
-
},
|
|
18020
|
-
},
|
|
18021
|
-
},
|
|
18022
|
-
},
|
|
18023
|
-
},
|
|
18024
|
-
},
|
|
18025
|
-
},
|
|
18026
|
-
{
|
|
18027
|
-
actions: {
|
|
18028
|
-
setAdditionEnable: assign((context, event) => {
|
|
18029
|
-
return {
|
|
18030
|
-
additionEnable: event.data,
|
|
18031
|
-
}
|
|
18032
|
-
}),
|
|
18033
|
-
setLoadable: assign((context, event) => {
|
|
18034
|
-
return {
|
|
18035
|
-
loadable: event.data,
|
|
18036
|
-
}
|
|
18037
|
-
}),
|
|
18038
|
-
setLastPage: assign((context, event) => {
|
|
18039
|
-
const { index, content } = context;
|
|
18040
|
-
return {
|
|
18041
|
-
isLastPage: index >= content?.totalPage - 1,
|
|
18042
|
-
}
|
|
18043
|
-
}),
|
|
18044
|
-
setFavoriteList: assign((context, event) => {
|
|
18045
|
-
return {
|
|
18046
|
-
favoriteList: event.data.data || [],
|
|
18047
|
-
}
|
|
18048
|
-
}),
|
|
18049
|
-
setRoom: assign((context, event) => {
|
|
18050
|
-
return {
|
|
18051
|
-
room: event.data,
|
|
18052
|
-
}
|
|
18053
|
-
}),
|
|
18054
|
-
resetContent: assign((context, event) => {
|
|
18055
|
-
return {
|
|
18056
|
-
loadable: false,
|
|
18057
|
-
isLastPage: false,
|
|
18058
|
-
index: -1,
|
|
18059
|
-
content: {
|
|
18060
|
-
data: [],
|
|
18061
|
-
timestamp: null,
|
|
18062
|
-
parentCategoryId: null,
|
|
18063
|
-
totalPage: 0,
|
|
18064
|
-
},
|
|
18065
|
-
addition: {
|
|
18066
|
-
data: [],
|
|
18067
|
-
timestamp: null,
|
|
18068
|
-
totalPage: 0,
|
|
18069
|
-
},
|
|
18070
|
-
}
|
|
18071
|
-
}),
|
|
18072
|
-
appendContent: assign((context, event) => {
|
|
18073
|
-
const { room, additionEnable } = context;
|
|
18074
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
18075
|
-
return
|
|
18076
|
-
} else if (additionEnable) {
|
|
18077
|
-
const [content, addition] = event.data;
|
|
18078
|
-
return {
|
|
18079
|
-
content: {
|
|
18080
|
-
...context.content,
|
|
18081
|
-
...content,
|
|
18082
|
-
data: context.content.data.concat(content.data),
|
|
18083
|
-
},
|
|
18084
|
-
addition: {
|
|
18085
|
-
...context.addition,
|
|
18086
|
-
...addition,
|
|
18087
|
-
data: context.addition.data.concat(addition.data),
|
|
18088
|
-
},
|
|
18089
|
-
}
|
|
18090
|
-
} else {
|
|
18091
|
-
const [content] = event.data;
|
|
18092
|
-
return {
|
|
18093
|
-
content: {
|
|
18094
|
-
...context.content,
|
|
18095
|
-
...content,
|
|
18096
|
-
data: context.content.data.concat(content.data),
|
|
18097
|
-
},
|
|
18098
|
-
}
|
|
18099
|
-
}
|
|
18100
|
-
}),
|
|
18101
|
-
swapContent: assign((context, event) => {
|
|
18102
|
-
const [content, addition] = event.data;
|
|
18103
|
-
let result = {};
|
|
18104
|
-
if (content?.data?.length) {
|
|
18105
|
-
result.content = content;
|
|
18106
|
-
}
|
|
18107
|
-
if (addition?.data?.length) {
|
|
18108
|
-
result.addition = addition;
|
|
18109
|
-
}
|
|
18110
|
-
return result
|
|
18111
|
-
}),
|
|
18112
|
-
increaseIndex: assign((context, event) => {
|
|
18113
|
-
return {
|
|
18114
|
-
index: context.index + 1,
|
|
18115
|
-
}
|
|
18116
|
-
}),
|
|
18117
|
-
setGameURL: assign({
|
|
18118
|
-
gameURL: (context, event) => {
|
|
18119
|
-
return event.data.gameURL
|
|
18120
|
-
},
|
|
18121
|
-
}),
|
|
18122
|
-
clearGameInfo: assign((context, event) => {
|
|
18123
|
-
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
18124
|
-
}),
|
|
18125
|
-
setGameInfo: assign((context, event) => {
|
|
18126
|
-
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
18127
|
-
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
17480
|
+
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
17481
|
+
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
18128
17482
|
}),
|
|
18129
17483
|
setLang: assign((context, event) => {
|
|
18130
17484
|
const lang = event.data.locale.replace('-', '_');
|
|
@@ -18143,32 +17497,44 @@ function game_v2_1 (request) {
|
|
|
18143
17497
|
},
|
|
18144
17498
|
services: {
|
|
18145
17499
|
getPageContent: async (context, event) => {
|
|
18146
|
-
const { room, index, additionEnable } = context;
|
|
17500
|
+
const { room, index, additionEnable, staticData } = context;
|
|
18147
17501
|
if (room.categoryId === GAME_SEARCH) {
|
|
18148
17502
|
return
|
|
17503
|
+
} else if (!request.getToken()) {
|
|
17504
|
+
const list = staticData.find((data) => data.category == room.categoryId)?.info || [];
|
|
17505
|
+
|
|
17506
|
+
return [
|
|
17507
|
+
{
|
|
17508
|
+
data: list.slice(index * 20, (index + 1) * 20),
|
|
17509
|
+
totalPage: Math.ceil(list.length / 20),
|
|
17510
|
+
timestamp: Math.floor(Date.now() / 1000),
|
|
17511
|
+
},
|
|
17512
|
+
]
|
|
18149
17513
|
} else if (additionEnable) {
|
|
18150
17514
|
const param = { categoryId: room.categoryId, index };
|
|
18151
|
-
return await Promise.all([request.send(game
|
|
17515
|
+
return await Promise.all([request.send(game.getListCategory(param)), request.send(game.getListAddition(param))])
|
|
18152
17516
|
} else {
|
|
18153
17517
|
const param = { categoryId: room.categoryId, index };
|
|
18154
|
-
return await Promise.all([request.send(game
|
|
17518
|
+
return await Promise.all([request.send(game.getListCategory(param))])
|
|
18155
17519
|
}
|
|
18156
17520
|
},
|
|
18157
17521
|
updatePageContent: async (context, event) => {
|
|
18158
17522
|
const { room, content, index, additionEnable } = context;
|
|
18159
17523
|
if (room.categoryId === GAME_SEARCH) {
|
|
18160
17524
|
return
|
|
17525
|
+
} else if (!request.getToken()) {
|
|
17526
|
+
return []
|
|
18161
17527
|
} else if (additionEnable) {
|
|
18162
17528
|
return await Promise.all([
|
|
18163
17529
|
request.send(
|
|
18164
|
-
game
|
|
17530
|
+
game.getListCategoryByRange({
|
|
18165
17531
|
categoryId: room.categoryId,
|
|
18166
17532
|
end: index,
|
|
18167
17533
|
timestamp: content.timestamp,
|
|
18168
17534
|
})
|
|
18169
17535
|
),
|
|
18170
17536
|
request.send(
|
|
18171
|
-
game
|
|
17537
|
+
game.getListAdditionByRange({
|
|
18172
17538
|
categoryId: room.categoryId,
|
|
18173
17539
|
end: index,
|
|
18174
17540
|
timestamp: content.timestamp,
|
|
@@ -18178,7 +17544,7 @@ function game_v2_1 (request) {
|
|
|
18178
17544
|
} else {
|
|
18179
17545
|
return await Promise.all([
|
|
18180
17546
|
request.send(
|
|
18181
|
-
game
|
|
17547
|
+
game.getListCategoryByRange({
|
|
18182
17548
|
categoryId: room.categoryId,
|
|
18183
17549
|
end: index,
|
|
18184
17550
|
timestamp: content.timestamp,
|
|
@@ -18201,13 +17567,13 @@ function game_v2_1 (request) {
|
|
|
18201
17567
|
lang,
|
|
18202
17568
|
return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
|
|
18203
17569
|
};
|
|
18204
|
-
const { redirect_url } = await request.send(game
|
|
17570
|
+
const { redirect_url } = await request.send(game.playGame(params));
|
|
18205
17571
|
return { gameURL: redirect_url }
|
|
18206
17572
|
},
|
|
18207
17573
|
disconnectGame: async (context, event) => {
|
|
18208
17574
|
const uid_site = event.data;
|
|
18209
17575
|
const provider_id = context.game.providerId;
|
|
18210
|
-
return await request.send(game
|
|
17576
|
+
return await request.send(game.logoutGame({ uid_site, provider_id }))
|
|
18211
17577
|
},
|
|
18212
17578
|
...oldServices(request),
|
|
18213
17579
|
},
|
|
@@ -18252,137 +17618,26 @@ const oldGuards = {
|
|
|
18252
17618
|
|
|
18253
17619
|
const oldServices = (request) => ({
|
|
18254
17620
|
fetchOption: async (context, event) => {
|
|
18255
|
-
|
|
17621
|
+
if (request.getToken()) {
|
|
17622
|
+
return await request.send(game.getOptionMap())
|
|
17623
|
+
}
|
|
18256
17624
|
},
|
|
18257
17625
|
fetchGameSHA: async (context, event) => {
|
|
18258
|
-
|
|
17626
|
+
if (request.getToken()) {
|
|
17627
|
+
return await request.send(game.getGameSHA())
|
|
17628
|
+
} else {
|
|
17629
|
+
return {
|
|
17630
|
+
status: null,
|
|
17631
|
+
}
|
|
17632
|
+
}
|
|
18259
17633
|
},
|
|
18260
17634
|
fetchStatus: async (context, event) => {
|
|
18261
|
-
|
|
17635
|
+
if (request.getToken()) {
|
|
17636
|
+
return await request.send(game.getGameStatus())
|
|
17637
|
+
}
|
|
18262
17638
|
},
|
|
18263
17639
|
});
|
|
18264
17640
|
|
|
18265
|
-
function game_favorite (request) {
|
|
18266
|
-
return createMachine(
|
|
18267
|
-
{
|
|
18268
|
-
id: 'favorite',
|
|
18269
|
-
type: 'parallel',
|
|
18270
|
-
context: {
|
|
18271
|
-
list: [],
|
|
18272
|
-
},
|
|
18273
|
-
states: {
|
|
18274
|
-
fetching: {
|
|
18275
|
-
initial: 'disable',
|
|
18276
|
-
states: {
|
|
18277
|
-
disable: {},
|
|
18278
|
-
enable: {
|
|
18279
|
-
invoke: {
|
|
18280
|
-
src: 'fetchList',
|
|
18281
|
-
onDone: {
|
|
18282
|
-
actions: 'setList',
|
|
18283
|
-
},
|
|
18284
|
-
onError: {
|
|
18285
|
-
actions: assign({ list: [] }),
|
|
18286
|
-
},
|
|
18287
|
-
},
|
|
18288
|
-
},
|
|
18289
|
-
},
|
|
18290
|
-
},
|
|
18291
|
-
adding: {
|
|
18292
|
-
initial: 'disable',
|
|
18293
|
-
states: {
|
|
18294
|
-
disable: {},
|
|
18295
|
-
enable: {
|
|
18296
|
-
invoke: {
|
|
18297
|
-
src: 'add',
|
|
18298
|
-
onDone: {},
|
|
18299
|
-
onError: {
|
|
18300
|
-
actions: 'removeFromList',
|
|
18301
|
-
},
|
|
18302
|
-
},
|
|
18303
|
-
},
|
|
18304
|
-
},
|
|
18305
|
-
},
|
|
18306
|
-
removing: {
|
|
18307
|
-
initial: 'disable',
|
|
18308
|
-
states: {
|
|
18309
|
-
disable: {},
|
|
18310
|
-
enable: {
|
|
18311
|
-
invoke: {
|
|
18312
|
-
src: 'remove',
|
|
18313
|
-
onDone: {},
|
|
18314
|
-
onError: {
|
|
18315
|
-
actions: 'addToList',
|
|
18316
|
-
},
|
|
18317
|
-
},
|
|
18318
|
-
},
|
|
18319
|
-
},
|
|
18320
|
-
},
|
|
18321
|
-
},
|
|
18322
|
-
on: {
|
|
18323
|
-
FETCH_LIST: {
|
|
18324
|
-
target: 'fetching.enable',
|
|
18325
|
-
},
|
|
18326
|
-
ADD: {
|
|
18327
|
-
target: 'adding.enable',
|
|
18328
|
-
actions: 'addToList',
|
|
18329
|
-
cond: 'isNotExist',
|
|
18330
|
-
},
|
|
18331
|
-
REMOVE: {
|
|
18332
|
-
target: 'removing.enable',
|
|
18333
|
-
actions: 'removeFromList',
|
|
18334
|
-
cond: 'isExist',
|
|
18335
|
-
},
|
|
18336
|
-
},
|
|
18337
|
-
},
|
|
18338
|
-
{
|
|
18339
|
-
actions: {
|
|
18340
|
-
setList: assign((context, event) => {
|
|
18341
|
-
return {
|
|
18342
|
-
list: event.data,
|
|
18343
|
-
}
|
|
18344
|
-
}),
|
|
18345
|
-
addToList: assign((context, event) => {
|
|
18346
|
-
return {
|
|
18347
|
-
list: [...context.list, event.data],
|
|
18348
|
-
}
|
|
18349
|
-
}),
|
|
18350
|
-
removeFromList: assign((context, event) => {
|
|
18351
|
-
return {
|
|
18352
|
-
list: context.list.filter((item) => item !== event.data),
|
|
18353
|
-
}
|
|
18354
|
-
}),
|
|
18355
|
-
},
|
|
18356
|
-
guards: {
|
|
18357
|
-
isExist: (context, event) => context.list.includes(event.data),
|
|
18358
|
-
isNotExist: (context, event) => !context.list.includes(event.data),
|
|
18359
|
-
},
|
|
18360
|
-
services: {
|
|
18361
|
-
add: async (context, event) => {
|
|
18362
|
-
try {
|
|
18363
|
-
return await request.send(game$1.addFavoriteGame(event.data))
|
|
18364
|
-
} catch (error) {
|
|
18365
|
-
throw event.data
|
|
18366
|
-
}
|
|
18367
|
-
},
|
|
18368
|
-
remove: async (context, event) => {
|
|
18369
|
-
try {
|
|
18370
|
-
return await request.send(game$1.removeFavoriteGame(event.data))
|
|
18371
|
-
} catch (error) {
|
|
18372
|
-
throw event.data
|
|
18373
|
-
}
|
|
18374
|
-
},
|
|
18375
|
-
fetchList: async (context, event) => {
|
|
18376
|
-
const main = await request.send(game$1.getGameCategory({}));
|
|
18377
|
-
const room = main.list.find((item) => item.category === 'SYSTEM_MY_FAVORITE');
|
|
18378
|
-
const favorite = await request.send(game$1.getGameCategory({ id: room.id }));
|
|
18379
|
-
return favorite.list.map((item) => item.g)
|
|
18380
|
-
},
|
|
18381
|
-
},
|
|
18382
|
-
}
|
|
18383
|
-
)
|
|
18384
|
-
}
|
|
18385
|
-
|
|
18386
17641
|
function game_favorite_v2 (request) {
|
|
18387
17642
|
return createMachine(
|
|
18388
17643
|
{
|
|
@@ -18477,7 +17732,7 @@ function game_favorite_v2 (request) {
|
|
|
18477
17732
|
services: {
|
|
18478
17733
|
add: async (context, event) => {
|
|
18479
17734
|
try {
|
|
18480
|
-
await request.send(game
|
|
17735
|
+
await request.send(game.addListFavorite(event.data.gameCode));
|
|
18481
17736
|
return event.data
|
|
18482
17737
|
} catch (error) {
|
|
18483
17738
|
throw event.data
|
|
@@ -18485,15 +17740,19 @@ function game_favorite_v2 (request) {
|
|
|
18485
17740
|
},
|
|
18486
17741
|
remove: async (context, event) => {
|
|
18487
17742
|
try {
|
|
18488
|
-
await request.send(game
|
|
17743
|
+
await request.send(game.removeListFavorite(event.data.gameCode));
|
|
18489
17744
|
return event.data
|
|
18490
17745
|
} catch (error) {
|
|
18491
17746
|
throw event.data
|
|
18492
17747
|
}
|
|
18493
17748
|
},
|
|
18494
17749
|
fetchList: async (context, event) => {
|
|
18495
|
-
|
|
18496
|
-
|
|
17750
|
+
if (request.getToken()) {
|
|
17751
|
+
const { data } = await request.send(game.getListMyFavorite());
|
|
17752
|
+
return data
|
|
17753
|
+
} else {
|
|
17754
|
+
return []
|
|
17755
|
+
}
|
|
18497
17756
|
},
|
|
18498
17757
|
},
|
|
18499
17758
|
}
|
|
@@ -18725,17 +17984,17 @@ function game_search (request) {
|
|
|
18725
17984
|
services: {
|
|
18726
17985
|
fetchTags: async (context, event) => {
|
|
18727
17986
|
const { keyword } = context;
|
|
18728
|
-
const { result } = await request.send(game
|
|
17987
|
+
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
18729
17988
|
return result
|
|
18730
17989
|
},
|
|
18731
17990
|
fetchGames: async (context, event) => {
|
|
18732
17991
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
18733
|
-
const { traceId, result } = await request.send(game
|
|
17992
|
+
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18734
17993
|
return { traceId, result }
|
|
18735
17994
|
},
|
|
18736
17995
|
sendTrace: async (context, event) => {
|
|
18737
17996
|
const { traceId, tagId, tagIndex, gameCode, gameCodeIndex, keyword: query, click, clickDefault } = context;
|
|
18738
|
-
return await request.send(game
|
|
17997
|
+
return await request.send(game.setGameSearchTrace({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }))
|
|
18739
17998
|
},
|
|
18740
17999
|
},
|
|
18741
18000
|
}
|
|
@@ -19068,16 +18327,16 @@ function game_search_v2 (request) {
|
|
|
19068
18327
|
services: {
|
|
19069
18328
|
fetchTags: async (context, event) => {
|
|
19070
18329
|
const { keyword } = context;
|
|
19071
|
-
const { result } = await request.send(game
|
|
18330
|
+
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
19072
18331
|
return result
|
|
19073
18332
|
},
|
|
19074
18333
|
fetchInitialData: async (context, event) => {
|
|
19075
|
-
const data = await request.send(game
|
|
18334
|
+
const data = await request.send(game.getGameSearchHome());
|
|
19076
18335
|
return data
|
|
19077
18336
|
},
|
|
19078
18337
|
fetchGames: async (context, event) => {
|
|
19079
18338
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
19080
|
-
const { traceId, result } = await request.send(game
|
|
18339
|
+
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
19081
18340
|
return { traceId, result }
|
|
19082
18341
|
},
|
|
19083
18342
|
sendTrace: async (context, event) => {
|
|
@@ -19099,7 +18358,7 @@ function game_search_v2 (request) {
|
|
|
19099
18358
|
id = null;
|
|
19100
18359
|
}
|
|
19101
18360
|
return await request.send(
|
|
19102
|
-
game
|
|
18361
|
+
game.setGameSearchTrace({
|
|
19103
18362
|
traceId,
|
|
19104
18363
|
tagId: id,
|
|
19105
18364
|
tagIndex,
|
|
@@ -19180,12 +18439,12 @@ function game_hot_new (request) {
|
|
|
19180
18439
|
},
|
|
19181
18440
|
services: {
|
|
19182
18441
|
getRoomItems: async (context, event) => {
|
|
19183
|
-
return await request.send(game
|
|
18442
|
+
return await request.send(game.getGameCategory({ id: context.roomId }))
|
|
19184
18443
|
},
|
|
19185
18444
|
getGames: async (context, event) => {
|
|
19186
18445
|
const [resHot, resNew] = await Promise.all([
|
|
19187
|
-
request.send(game
|
|
19188
|
-
request.send(game
|
|
18446
|
+
request.send(game.getGameCategory({ id: context.hot.id })),
|
|
18447
|
+
request.send(game.getGameCategory({ id: context.new.id })),
|
|
19189
18448
|
]);
|
|
19190
18449
|
const hotGames = resHot?.list?.map?.((item) => item.g);
|
|
19191
18450
|
const newGames = resNew?.list?.map?.((item) => item.g);
|
|
@@ -20025,7 +19284,7 @@ function side (request) {
|
|
|
20025
19284
|
},
|
|
20026
19285
|
services: {
|
|
20027
19286
|
getRoomItems: async (context, event) => {
|
|
20028
|
-
return await request.send(game
|
|
19287
|
+
return await request.send(game.getGameCategory({ id: context.room?.id }))
|
|
20029
19288
|
},
|
|
20030
19289
|
},
|
|
20031
19290
|
}
|
|
@@ -20189,10 +19448,10 @@ function side_v2 (request) {
|
|
|
20189
19448
|
},
|
|
20190
19449
|
services: {
|
|
20191
19450
|
getMenu: async (context, event) => {
|
|
20192
|
-
return await request.send(game
|
|
19451
|
+
return await request.send(game.getListRoot())
|
|
20193
19452
|
},
|
|
20194
19453
|
fetchUpdateMenu: async (context, event) => {
|
|
20195
|
-
return await request.send(game
|
|
19454
|
+
return await request.send(game.getListRoot({ timestamp: context.menu.timestamp }))
|
|
20196
19455
|
},
|
|
20197
19456
|
},
|
|
20198
19457
|
}
|
|
@@ -21876,7 +21135,7 @@ function withdraw_vn (request) {
|
|
|
21876
21135
|
submitWithdraw: async (context, event) => {
|
|
21877
21136
|
const { bank, amount } = context;
|
|
21878
21137
|
const { method } = context.paymentDetail[0];
|
|
21879
|
-
const branchTemp = bank.bankCode
|
|
21138
|
+
const branchTemp = ['GCASH', 'PAYM'].includes(bank.bankCode) ? '' : bank.branch;
|
|
21880
21139
|
return await request.send(
|
|
21881
21140
|
payment.submitWithdrawTransactionVN({
|
|
21882
21141
|
method,
|
|
@@ -22361,7 +21620,7 @@ function withdraw_vn2 (request) {
|
|
|
22361
21620
|
submitWithdraw: async (context, event) => {
|
|
22362
21621
|
const { bank, amount } = context;
|
|
22363
21622
|
const { method } = context.paymentDetail[0];
|
|
22364
|
-
const branchTemp = bank.bankCode
|
|
21623
|
+
const branchTemp = ['GCASH', 'PAYM'].includes(bank.bankCode) ? '' : bank.branch;
|
|
22365
21624
|
return await request.send(
|
|
22366
21625
|
payment.submitWithdrawTransactionVN({
|
|
22367
21626
|
method,
|
|
@@ -28263,9 +27522,6 @@ var index$1 = {
|
|
|
28263
27522
|
common,
|
|
28264
27523
|
deposit,
|
|
28265
27524
|
error,
|
|
28266
|
-
game,
|
|
28267
|
-
game_v2,
|
|
28268
|
-
game_favorite,
|
|
28269
27525
|
game_favorite_v2,
|
|
28270
27526
|
game_search,
|
|
28271
27527
|
game_search_v2,
|
|
@@ -28320,8 +27576,8 @@ class Request {
|
|
|
28320
27576
|
this.axios.interceptors.request.use((axiosConfig) => {
|
|
28321
27577
|
axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version;
|
|
28322
27578
|
axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform;
|
|
28323
|
-
if (
|
|
28324
|
-
axiosConfig.headers.Authorization =
|
|
27579
|
+
if (this.getToken()) {
|
|
27580
|
+
axiosConfig.headers.Authorization = this.getToken();
|
|
28325
27581
|
}
|
|
28326
27582
|
return axiosConfig
|
|
28327
27583
|
});
|
|
@@ -28349,7 +27605,7 @@ class Request {
|
|
|
28349
27605
|
async send(req, customToken) {
|
|
28350
27606
|
try {
|
|
28351
27607
|
const cancelToken = customToken || this.source.token;
|
|
28352
|
-
this._checkToken(req
|
|
27608
|
+
this._checkToken(req);
|
|
28353
27609
|
const requestConfig = this._createConfig(req, cancelToken);
|
|
28354
27610
|
const { data } = await this.axios.request(requestConfig);
|
|
28355
27611
|
return data
|
|
@@ -28395,12 +27651,16 @@ class Request {
|
|
|
28395
27651
|
}
|
|
28396
27652
|
}
|
|
28397
27653
|
|
|
28398
|
-
_checkToken(req
|
|
28399
|
-
if (!req.isPublic && !
|
|
27654
|
+
_checkToken(req) {
|
|
27655
|
+
if (!req.isPublic && !this.getToken()) {
|
|
28400
27656
|
console.error(req);
|
|
28401
27657
|
throw { code: 'ERR_A103', url: req.url }
|
|
28402
27658
|
}
|
|
28403
27659
|
}
|
|
27660
|
+
|
|
27661
|
+
getToken() {
|
|
27662
|
+
return storage.get(this.key)
|
|
27663
|
+
}
|
|
28404
27664
|
}
|
|
28405
27665
|
|
|
28406
27666
|
// const urljoin = require('url-join')
|