@obb871001/api-integration-sdk 1.0.66 → 1.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.js +470 -458
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ve, { createContext as Fa, useContext as Wa, useCallback as
|
|
1
|
+
import ve, { createContext as Fa, useContext as Wa, useCallback as X, useMemo as Qe, useEffect as Ce, useRef as ya } from "react";
|
|
2
2
|
import { useQuery as oe, QueryClient as Ti, QueryClientProvider as Ci, useQueries as Ja } from "@tanstack/react-query";
|
|
3
3
|
import vi from "axios";
|
|
4
|
-
import { find as je, isEmpty as O, isObject as xe, flatMap as Ye, isArray as
|
|
4
|
+
import { find as je, isEmpty as O, isObject as xe, flatMap as Ye, isArray as ee, map as qe, get as Ge } from "lodash";
|
|
5
5
|
import hi from "react-dom";
|
|
6
6
|
function ki(e) {
|
|
7
7
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -11,21 +11,21 @@ var ba;
|
|
|
11
11
|
function Si() {
|
|
12
12
|
if (ba) return Ue;
|
|
13
13
|
ba = 1;
|
|
14
|
-
var e = ve,
|
|
15
|
-
function U(_,
|
|
16
|
-
var n, i = {},
|
|
17
|
-
|
|
18
|
-
for (n in
|
|
19
|
-
if (_ && _.defaultProps) for (n in
|
|
20
|
-
return { $$typeof:
|
|
14
|
+
var e = ve, r = Symbol.for("react.element"), c = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
15
|
+
function U(_, m, d) {
|
|
16
|
+
var n, i = {}, p = null, l = null;
|
|
17
|
+
d !== void 0 && (p = "" + d), m.key !== void 0 && (p = "" + m.key), m.ref !== void 0 && (l = m.ref);
|
|
18
|
+
for (n in m) o.call(m, n) && !g.hasOwnProperty(n) && (i[n] = m[n]);
|
|
19
|
+
if (_ && _.defaultProps) for (n in m = _.defaultProps, m) i[n] === void 0 && (i[n] = m[n]);
|
|
20
|
+
return { $$typeof: r, type: _, key: p, ref: l, props: i, _owner: s.current };
|
|
21
21
|
}
|
|
22
|
-
return Ue.Fragment =
|
|
22
|
+
return Ue.Fragment = c, Ue.jsx = U, Ue.jsxs = U, Ue;
|
|
23
23
|
}
|
|
24
24
|
var ye = {};
|
|
25
25
|
var Ta;
|
|
26
26
|
function Ni() {
|
|
27
27
|
return Ta || (Ta = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
28
|
-
var e = ve,
|
|
28
|
+
var e = ve, r = Symbol.for("react.element"), c = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), U = Symbol.for("react.provider"), _ = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), i = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), l = Symbol.for("react.offscreen"), t = Symbol.iterator, y = "@@iterator";
|
|
29
29
|
function b(a) {
|
|
30
30
|
if (a === null || typeof a != "object")
|
|
31
31
|
return null;
|
|
@@ -53,7 +53,7 @@ function Ni() {
|
|
|
53
53
|
var D = !1, h = !1, L = !1, M = !1, de = !1, ce;
|
|
54
54
|
ce = Symbol.for("react.module.reference");
|
|
55
55
|
function we(a) {
|
|
56
|
-
return !!(typeof a == "string" || typeof a == "function" || a ===
|
|
56
|
+
return !!(typeof a == "string" || typeof a == "function" || a === o || a === g || de || a === s || a === d || a === n || M || a === l || D || h || L || typeof a == "object" && a !== null && (a.$$typeof === p || a.$$typeof === i || a.$$typeof === U || a.$$typeof === _ || a.$$typeof === m || // This needs to include all possible module reference object
|
|
57
57
|
// types supported by any Flight configuration anywhere since
|
|
58
58
|
// we don't know which Flight build this will end up being used
|
|
59
59
|
// with.
|
|
@@ -77,15 +77,15 @@ function Ni() {
|
|
|
77
77
|
if (typeof a == "string")
|
|
78
78
|
return a;
|
|
79
79
|
switch (a) {
|
|
80
|
-
case
|
|
80
|
+
case o:
|
|
81
81
|
return "Fragment";
|
|
82
|
-
case
|
|
82
|
+
case c:
|
|
83
83
|
return "Portal";
|
|
84
|
-
case
|
|
84
|
+
case g:
|
|
85
85
|
return "Profiler";
|
|
86
86
|
case s:
|
|
87
87
|
return "StrictMode";
|
|
88
|
-
case
|
|
88
|
+
case d:
|
|
89
89
|
return "Suspense";
|
|
90
90
|
case n:
|
|
91
91
|
return "SuspenseList";
|
|
@@ -98,12 +98,12 @@ function Ni() {
|
|
|
98
98
|
case U:
|
|
99
99
|
var C = a;
|
|
100
100
|
return V(C._context) + ".Provider";
|
|
101
|
-
case
|
|
101
|
+
case m:
|
|
102
102
|
return he(a, a.render, "ForwardRef");
|
|
103
103
|
case i:
|
|
104
104
|
var v = a.displayName || null;
|
|
105
105
|
return v !== null ? v : H(a.type) || "Memo";
|
|
106
|
-
case
|
|
106
|
+
case p: {
|
|
107
107
|
var E = a, G = E._payload, S = E._init;
|
|
108
108
|
try {
|
|
109
109
|
return H(S(G));
|
|
@@ -114,18 +114,18 @@ function Ni() {
|
|
|
114
114
|
}
|
|
115
115
|
return null;
|
|
116
116
|
}
|
|
117
|
-
var Z = Object.assign,
|
|
118
|
-
function
|
|
117
|
+
var Z = Object.assign, ae = 0, B, ke, Se, x, w, K, _e;
|
|
118
|
+
function ie() {
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
function
|
|
120
|
+
ie.__reactDisabledLog = !0;
|
|
121
|
+
function $() {
|
|
122
122
|
{
|
|
123
|
-
if (
|
|
123
|
+
if (ae === 0) {
|
|
124
124
|
B = console.log, ke = console.info, Se = console.warn, x = console.error, w = console.group, K = console.groupCollapsed, _e = console.groupEnd;
|
|
125
125
|
var a = {
|
|
126
126
|
configurable: !0,
|
|
127
127
|
enumerable: !0,
|
|
128
|
-
value:
|
|
128
|
+
value: ie,
|
|
129
129
|
writable: !0
|
|
130
130
|
};
|
|
131
131
|
Object.defineProperties(console, {
|
|
@@ -138,12 +138,12 @@ function Ni() {
|
|
|
138
138
|
groupEnd: a
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
ae++;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
function Ne() {
|
|
145
145
|
{
|
|
146
|
-
if (
|
|
146
|
+
if (ae--, ae === 0) {
|
|
147
147
|
var a = {
|
|
148
148
|
configurable: !0,
|
|
149
149
|
enumerable: !0,
|
|
@@ -173,7 +173,7 @@ function Ni() {
|
|
|
173
173
|
})
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
ae < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
var se = u.ReactCurrentDispatcher, Q;
|
|
@@ -190,13 +190,13 @@ function Ni() {
|
|
|
190
190
|
` + Q + a;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
var
|
|
193
|
+
var le = !1, De;
|
|
194
194
|
{
|
|
195
195
|
var ja = typeof WeakMap == "function" ? WeakMap : Map;
|
|
196
196
|
De = new ja();
|
|
197
197
|
}
|
|
198
198
|
function la(a, f) {
|
|
199
|
-
if (!a ||
|
|
199
|
+
if (!a || le)
|
|
200
200
|
return "";
|
|
201
201
|
{
|
|
202
202
|
var C = De.get(a);
|
|
@@ -204,11 +204,11 @@ function Ni() {
|
|
|
204
204
|
return C;
|
|
205
205
|
}
|
|
206
206
|
var v;
|
|
207
|
-
|
|
207
|
+
le = !0;
|
|
208
208
|
var E = Error.prepareStackTrace;
|
|
209
209
|
Error.prepareStackTrace = void 0;
|
|
210
210
|
var G;
|
|
211
|
-
G = se.current, se.current = null,
|
|
211
|
+
G = se.current, se.current = null, $();
|
|
212
212
|
try {
|
|
213
213
|
if (f) {
|
|
214
214
|
var S = function() {
|
|
@@ -261,10 +261,10 @@ function Ni() {
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
} finally {
|
|
264
|
-
|
|
264
|
+
le = !1, se.current = G, Ne(), Error.prepareStackTrace = E;
|
|
265
265
|
}
|
|
266
|
-
var ge = a ? a.displayName || a.name : "",
|
|
267
|
-
return typeof a == "function" && De.set(a,
|
|
266
|
+
var ge = a ? a.displayName || a.name : "", te = ge ? ue(ge) : "";
|
|
267
|
+
return typeof a == "function" && De.set(a, te), te;
|
|
268
268
|
}
|
|
269
269
|
function Ya(a, f, C) {
|
|
270
270
|
return la(a, !1);
|
|
@@ -281,18 +281,18 @@ function Ni() {
|
|
|
281
281
|
if (typeof a == "string")
|
|
282
282
|
return ue(a);
|
|
283
283
|
switch (a) {
|
|
284
|
-
case
|
|
284
|
+
case d:
|
|
285
285
|
return ue("Suspense");
|
|
286
286
|
case n:
|
|
287
287
|
return ue("SuspenseList");
|
|
288
288
|
}
|
|
289
289
|
if (typeof a == "object")
|
|
290
290
|
switch (a.$$typeof) {
|
|
291
|
-
case
|
|
291
|
+
case m:
|
|
292
292
|
return Ya(a.render);
|
|
293
293
|
case i:
|
|
294
294
|
return Ee(a.type, f, C);
|
|
295
|
-
case
|
|
295
|
+
case p: {
|
|
296
296
|
var v = a, E = v._payload, G = v._init;
|
|
297
297
|
try {
|
|
298
298
|
return Ee(G(E), f, C);
|
|
@@ -403,7 +403,7 @@ function Ni() {
|
|
|
403
403
|
var oi = function(a, f, C, v, E, G, S) {
|
|
404
404
|
var k = {
|
|
405
405
|
// This tag allows us to uniquely identify this as a React Element
|
|
406
|
-
$$typeof:
|
|
406
|
+
$$typeof: r,
|
|
407
407
|
// Built-in properties that belong on the element
|
|
408
408
|
type: a,
|
|
409
409
|
key: f,
|
|
@@ -458,7 +458,7 @@ function Ni() {
|
|
|
458
458
|
var Je;
|
|
459
459
|
Je = !1;
|
|
460
460
|
function ze(a) {
|
|
461
|
-
return typeof a == "object" && a !== null && a.$$typeof ===
|
|
461
|
+
return typeof a == "object" && a !== null && a.$$typeof === r;
|
|
462
462
|
}
|
|
463
463
|
function ga() {
|
|
464
464
|
{
|
|
@@ -528,7 +528,7 @@ Check the top-level render call using <` + C + ">.");
|
|
|
528
528
|
var C;
|
|
529
529
|
if (typeof f == "function")
|
|
530
530
|
C = f.propTypes;
|
|
531
|
-
else if (typeof f == "object" && (f.$$typeof ===
|
|
531
|
+
else if (typeof f == "object" && (f.$$typeof === m || // Note: Memo only checks outer props here.
|
|
532
532
|
// Inner props are checked in the reconciler.
|
|
533
533
|
f.$$typeof === i))
|
|
534
534
|
C = f.propTypes;
|
|
@@ -567,7 +567,7 @@ Check the top-level render call using <` + C + ">.");
|
|
|
567
567
|
var F = ui();
|
|
568
568
|
F ? k += F : k += ga();
|
|
569
569
|
var R;
|
|
570
|
-
a === null ? R = "null" : Fe(a) ? R = "array" : a !== void 0 && a.$$typeof ===
|
|
570
|
+
a === null ? R = "null" : Fe(a) ? R = "array" : a !== void 0 && a.$$typeof === r ? (R = "<" + (H(a.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : R = typeof a, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, k);
|
|
571
571
|
}
|
|
572
572
|
var P = si(a, f, C, E, G);
|
|
573
573
|
if (P == null)
|
|
@@ -586,20 +586,20 @@ Check the top-level render call using <` + C + ">.");
|
|
|
586
586
|
_a(z, a);
|
|
587
587
|
}
|
|
588
588
|
if (fe.call(f, "key")) {
|
|
589
|
-
var
|
|
589
|
+
var te = H(a), W = Object.keys(f).filter(function(bi) {
|
|
590
590
|
return bi !== "key";
|
|
591
591
|
}), Ze = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
592
|
-
if (!fa[
|
|
592
|
+
if (!fa[te + Ze]) {
|
|
593
593
|
var yi = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
|
|
594
594
|
T(`A props object containing a "key" prop is being spread into JSX:
|
|
595
595
|
let props = %s;
|
|
596
596
|
<%s {...props} />
|
|
597
597
|
React keys must be passed directly to JSX without using spread:
|
|
598
598
|
let props = %s;
|
|
599
|
-
<%s key={someKey} {...props} />`, Ze,
|
|
599
|
+
<%s key={someKey} {...props} />`, Ze, te, yi, te), fa[te + Ze] = !0;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
return a ===
|
|
602
|
+
return a === o ? di(P) : gi(P), P;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
function ci(a, f, C) {
|
|
@@ -609,7 +609,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
609
609
|
return Ua(a, f, C, !1);
|
|
610
610
|
}
|
|
611
611
|
var fi = _i, Ui = ci;
|
|
612
|
-
ye.Fragment =
|
|
612
|
+
ye.Fragment = o, ye.jsx = fi, ye.jsxs = Ui;
|
|
613
613
|
})()), ye;
|
|
614
614
|
}
|
|
615
615
|
var Ca;
|
|
@@ -625,27 +625,27 @@ const za = Fa(null), Oe = () => {
|
|
|
625
625
|
};
|
|
626
626
|
function Ei({
|
|
627
627
|
baseURL: e,
|
|
628
|
-
getToken:
|
|
629
|
-
timeoutMs:
|
|
630
|
-
lng:
|
|
628
|
+
getToken: r,
|
|
629
|
+
timeoutMs: c = 15e3,
|
|
630
|
+
lng: o = "tw",
|
|
631
631
|
store: s,
|
|
632
|
-
onError:
|
|
632
|
+
onError: g
|
|
633
633
|
} = {}) {
|
|
634
634
|
const U = vi.create({
|
|
635
635
|
baseURL: e,
|
|
636
|
-
timeout:
|
|
636
|
+
timeout: c,
|
|
637
637
|
headers: { "Content-Type": "application/json" }
|
|
638
638
|
});
|
|
639
639
|
return U.interceptors.request.use(async (_) => {
|
|
640
|
-
if (_.headers = _.headers || {},
|
|
641
|
-
const
|
|
642
|
-
|
|
640
|
+
if (_.headers = _.headers || {}, r) {
|
|
641
|
+
const d = await r();
|
|
642
|
+
d && (_.headers.Authorization = `Bearer ${d}`);
|
|
643
643
|
}
|
|
644
|
-
const
|
|
645
|
-
return _.headers.Currency =
|
|
644
|
+
const m = s?.getState()?.isWalletCurrency;
|
|
645
|
+
return _.headers.Currency = m, _.headers["currency-code"] = m, _.headers.lang = o, _;
|
|
646
646
|
}), U.interceptors.response.use(
|
|
647
647
|
(_) => _.data,
|
|
648
|
-
(_) =>
|
|
648
|
+
(_) => g ? g(_, { instance: U }) : Promise.reject(_)
|
|
649
649
|
), U;
|
|
650
650
|
}
|
|
651
651
|
const Za = Fa(null), rl = () => {
|
|
@@ -656,128 +656,128 @@ const Za = Fa(null), rl = () => {
|
|
|
656
656
|
);
|
|
657
657
|
return e;
|
|
658
658
|
}, ol = () => {
|
|
659
|
-
const e = (
|
|
659
|
+
const e = (o, s) => !o && !s, r = (o) => o.startsWith("pc.");
|
|
660
660
|
return {
|
|
661
661
|
executeLogout: ({
|
|
662
|
-
isCallBackInvalid:
|
|
662
|
+
isCallBackInvalid: o = !1,
|
|
663
663
|
hostname: s = "",
|
|
664
|
-
shouldRedirect:
|
|
664
|
+
shouldRedirect: g,
|
|
665
665
|
onShowError: U,
|
|
666
666
|
onCleanup: _,
|
|
667
|
-
onRemoveToken:
|
|
668
|
-
onRedirect:
|
|
667
|
+
onRemoveToken: m,
|
|
668
|
+
onRedirect: d,
|
|
669
669
|
onGoogleLogout: n
|
|
670
670
|
}) => {
|
|
671
|
-
const i =
|
|
672
|
-
e(
|
|
671
|
+
const i = r(s);
|
|
672
|
+
e(o, i) && U?.(), _?.(), m?.(), g && d?.("/"), n?.();
|
|
673
673
|
},
|
|
674
674
|
shouldShowErrorNotice: e,
|
|
675
|
-
isMachineDomain:
|
|
675
|
+
isMachineDomain: r
|
|
676
676
|
};
|
|
677
|
-
}, Va = (e = [],
|
|
678
|
-
const
|
|
679
|
-
return
|
|
677
|
+
}, Va = (e = [], r) => je(e, { gameTypeName: r })?.gameTypeUid, Ia = (e = [], r) => je(e, { platform: r })?.platformUid, Aa = (e = [], r) => je(e, { SubPlatformEnum: r }), Ba = (e = [], r, c) => O(e) ? [] : e.filter((o) => c ? String(o?.SubPlatformEnumUid) === String(c?.SubPlatformEnumUid) : String(o.platformUid) === String(r)), Li = (e = []) => O(e) ? {} : e.reduce((r, c) => {
|
|
678
|
+
const o = c?.game_subtype || "UNKNOWN";
|
|
679
|
+
return r[o] || (r[o] = []), r[o].push(c), r;
|
|
680
680
|
}, {}), Gi = ({
|
|
681
681
|
gameTypeName: e,
|
|
682
|
-
platforms:
|
|
683
|
-
gameList:
|
|
684
|
-
allGameTypes:
|
|
682
|
+
platforms: r,
|
|
683
|
+
gameList: c,
|
|
684
|
+
allGameTypes: o,
|
|
685
685
|
allPlatforms: s
|
|
686
686
|
}) => {
|
|
687
|
-
const
|
|
688
|
-
return
|
|
689
|
-
const
|
|
687
|
+
const g = Va(o, e);
|
|
688
|
+
return g ? r.reduce((U, _) => {
|
|
689
|
+
const m = Ia(s, _), d = Aa(s, _), n = c[g] || [], i = Ba(
|
|
690
690
|
n,
|
|
691
|
-
|
|
692
|
-
|
|
691
|
+
m,
|
|
692
|
+
d
|
|
693
693
|
);
|
|
694
694
|
return O(i) || (U[_] = i), U;
|
|
695
695
|
}, {}) : {};
|
|
696
696
|
}, Mi = ({
|
|
697
697
|
platformName: e,
|
|
698
|
-
gamesOfType:
|
|
699
|
-
allPlatforms:
|
|
698
|
+
gamesOfType: r = [],
|
|
699
|
+
allPlatforms: c = []
|
|
700
700
|
}) => {
|
|
701
|
-
const
|
|
702
|
-
m,
|
|
701
|
+
const o = Ia(c, e), s = Aa(c, e), g = Ba(
|
|
703
702
|
r,
|
|
703
|
+
o,
|
|
704
704
|
s
|
|
705
705
|
);
|
|
706
|
-
return Li(
|
|
707
|
-
}, Ri = (e = {}) => !xe(e) || O(e) ? [] : Ye(e), va = (e = []) =>
|
|
708
|
-
const s =
|
|
709
|
-
return s.forEach((
|
|
710
|
-
|
|
711
|
-
}), s.includes(
|
|
706
|
+
return Li(g);
|
|
707
|
+
}, Ri = (e = {}) => !xe(e) || O(e) ? [] : Ye(e), va = (e = []) => !ee(e) || O(e) ? [] : qe(e, "platform"), Pi = (e = []) => !ee(e) || O(e) ? [] : qe(e, "gameTypeName"), xi = (e = []) => !ee(e) || O(e) ? [] : qe(e, "game_subtype"), Oi = (e = {}) => !xe(e) || O(e) ? [] : Ye(e), Hi = (e = [], r = []) => !ee(e) || O(e) ? {} : !ee(r) || O(r) ? {} : e.reduce((c, o) => {
|
|
708
|
+
const s = r.map((g) => g.game_subtype);
|
|
709
|
+
return s.forEach((g) => {
|
|
710
|
+
c[g] = c[g] || [];
|
|
711
|
+
}), s.includes(o.game_subtype) && c[o.game_subtype].push(o), c;
|
|
712
712
|
}, {}), wi = ({
|
|
713
713
|
gameTypes: e = [],
|
|
714
|
-
platforms:
|
|
715
|
-
gameList:
|
|
716
|
-
allGameTypes:
|
|
714
|
+
platforms: r = [],
|
|
715
|
+
gameList: c = {},
|
|
716
|
+
allGameTypes: o = [],
|
|
717
717
|
allPlatforms: s = []
|
|
718
|
-
}) =>
|
|
718
|
+
}) => !ee(e) || !ee(r) ? {} : O(c) ? {} : e.reduce((g, U) => {
|
|
719
719
|
const _ = Gi({
|
|
720
720
|
gameTypeName: U,
|
|
721
|
-
platforms:
|
|
722
|
-
gameList:
|
|
723
|
-
allGameTypes:
|
|
721
|
+
platforms: r,
|
|
722
|
+
gameList: c,
|
|
723
|
+
allGameTypes: o,
|
|
724
724
|
allPlatforms: s
|
|
725
725
|
});
|
|
726
|
-
return O(_) || (
|
|
726
|
+
return O(_) || (g[U] = _), g;
|
|
727
727
|
}, {}), sl = ({
|
|
728
728
|
types: e = [],
|
|
729
|
-
platforms:
|
|
730
|
-
allGameType:
|
|
731
|
-
allGamePlatform:
|
|
729
|
+
platforms: r = [],
|
|
730
|
+
allGameType: c = [],
|
|
731
|
+
allGamePlatform: o = [],
|
|
732
732
|
allGameList: s = {}
|
|
733
|
-
} = {}) => !Array.isArray(e) || !Array.isArray(
|
|
734
|
-
const _ = Va(
|
|
735
|
-
if (!_) return
|
|
736
|
-
const
|
|
737
|
-
const
|
|
733
|
+
} = {}) => !Array.isArray(e) || !Array.isArray(r) ? {} : e.reduce((g, U) => {
|
|
734
|
+
const _ = Va(c, U);
|
|
735
|
+
if (!_) return g;
|
|
736
|
+
const m = s[_] || [], d = r.reduce((n, i) => {
|
|
737
|
+
const p = Mi({
|
|
738
738
|
platformName: i,
|
|
739
|
-
gamesOfType:
|
|
740
|
-
allPlatforms:
|
|
739
|
+
gamesOfType: m,
|
|
740
|
+
allPlatforms: o
|
|
741
741
|
});
|
|
742
|
-
return O(
|
|
742
|
+
return O(p) ? n : { ...n, [i]: p };
|
|
743
743
|
}, {});
|
|
744
|
-
return O(
|
|
745
|
-
}, {}), Fi = (e = {}) => !xe(e) || O(e) ? {} : Object.values(e).reduce((
|
|
746
|
-
|
|
747
|
-
}),
|
|
744
|
+
return O(d) || (g[U] = d), g;
|
|
745
|
+
}, {}), Fi = (e = {}) => !xe(e) || O(e) ? {} : Object.values(e).reduce((c, o) => (Object.entries(o).forEach(([s, g]) => {
|
|
746
|
+
c[s] ? c[s] = [...c[s], ...g] : c[s] = g;
|
|
747
|
+
}), c), {}), Wi = (e = {}) => {
|
|
748
748
|
if (!xe(e) || O(e)) return {};
|
|
749
|
-
const
|
|
750
|
-
for (const [
|
|
751
|
-
|
|
752
|
-
for (const s of
|
|
753
|
-
const
|
|
754
|
-
|
|
749
|
+
const r = {};
|
|
750
|
+
for (const [c, o] of Object.entries(e)) {
|
|
751
|
+
r[c] = {};
|
|
752
|
+
for (const s of o) {
|
|
753
|
+
const g = s.game_subtype;
|
|
754
|
+
r[c][g] || (r[c][g] = []), r[c][g].push(s);
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
return
|
|
757
|
+
return r;
|
|
758
758
|
}, Ji = ({
|
|
759
759
|
allGameList: e = {},
|
|
760
|
-
allGamePlatform:
|
|
761
|
-
allGameType:
|
|
762
|
-
allGame_subtype:
|
|
760
|
+
allGamePlatform: r = [],
|
|
761
|
+
allGameType: c = [],
|
|
762
|
+
allGame_subtype: o = [],
|
|
763
763
|
allNewGameList: s = [],
|
|
764
|
-
allTopGameList:
|
|
764
|
+
allTopGameList: g = [],
|
|
765
765
|
randomlySelectedGames: U = [],
|
|
766
766
|
userFavoriteGame: _ = {},
|
|
767
|
-
exclusiveBrandGames:
|
|
768
|
-
highlightGames:
|
|
767
|
+
exclusiveBrandGames: m = [],
|
|
768
|
+
highlightGames: d = [],
|
|
769
769
|
originPlatform: n = []
|
|
770
770
|
}) => {
|
|
771
|
-
const i = Ri(e),
|
|
771
|
+
const i = Ri(e), p = va(r), l = Pi(c), t = xi(o), y = va(n), b = Oi(_), u = wi({
|
|
772
772
|
gameTypes: l,
|
|
773
|
-
platforms:
|
|
773
|
+
platforms: p,
|
|
774
774
|
gameList: e,
|
|
775
|
-
allGameTypes:
|
|
776
|
-
allPlatforms:
|
|
777
|
-
}), T = Hi(i,
|
|
775
|
+
allGameTypes: c,
|
|
776
|
+
allPlatforms: r
|
|
777
|
+
}), T = Hi(i, o), N = Fi(u), D = Wi(N);
|
|
778
778
|
return {
|
|
779
779
|
platform: {
|
|
780
|
-
all:
|
|
780
|
+
all: p,
|
|
781
781
|
origin: y
|
|
782
782
|
},
|
|
783
783
|
type: {
|
|
@@ -787,10 +787,10 @@ const Za = Fa(null), rl = () => {
|
|
|
787
787
|
gameList: {
|
|
788
788
|
all: i,
|
|
789
789
|
new: s,
|
|
790
|
-
top:
|
|
790
|
+
top: g,
|
|
791
791
|
favorite: b,
|
|
792
|
-
highlight:
|
|
793
|
-
exclusiveBrand:
|
|
792
|
+
highlight: d,
|
|
793
|
+
exclusiveBrand: m,
|
|
794
794
|
randomlySelected: U
|
|
795
795
|
},
|
|
796
796
|
categorized: {
|
|
@@ -802,29 +802,41 @@ const Za = Fa(null), rl = () => {
|
|
|
802
802
|
favorite: b
|
|
803
803
|
}
|
|
804
804
|
};
|
|
805
|
-
}, ul = (e = []) =>
|
|
806
|
-
...
|
|
807
|
-
...
|
|
808
|
-
platform:
|
|
809
|
-
platformEnum:
|
|
805
|
+
}, ul = (e = []) => !ee(e) || O(e) ? [] : Ye(e, (r) => O(r.SubPlatformEnum) ? r : r.SubPlatformEnum.map((c) => ({
|
|
806
|
+
...r,
|
|
807
|
+
...c,
|
|
808
|
+
platform: c.SubPlatformEnum,
|
|
809
|
+
platformEnum: c.SubPlatformEnum
|
|
810
810
|
}))), He = () => {
|
|
811
|
-
const { client: e } = Oe(),
|
|
812
|
-
async (
|
|
813
|
-
const { mac_address:
|
|
814
|
-
mac_address:
|
|
815
|
-
app_version:
|
|
816
|
-
anydesk_id:
|
|
811
|
+
const { client: e } = Oe(), r = X(
|
|
812
|
+
async (m) => {
|
|
813
|
+
const { mac_address: d = "", app_version: n = "", anydesk_id: i = "" } = m, { data: p } = await e.post("/cash-register/login", {
|
|
814
|
+
mac_address: d,
|
|
815
|
+
app_version: n,
|
|
816
|
+
anydesk_id: i
|
|
817
817
|
});
|
|
818
|
-
return
|
|
818
|
+
return p;
|
|
819
819
|
},
|
|
820
820
|
[e]
|
|
821
|
-
),
|
|
821
|
+
), c = X(async () => e.get("/member/getMemberInfo"), [e]), o = X(async () => await e.get("member/getGameList"), [e]), s = X(async () => await e.get("/member/getNowCurrencyExchange"), [e]), g = X(async () => await e.get("member/getFavoriteGame"), [e]), U = X(
|
|
822
|
+
async (m) => {
|
|
823
|
+
const { account: d, password: n, trans_code: i } = m;
|
|
824
|
+
return await e.post("/login", {
|
|
825
|
+
mdmId: d,
|
|
826
|
+
passwd: n,
|
|
827
|
+
trans_code: i
|
|
828
|
+
});
|
|
829
|
+
},
|
|
830
|
+
[e]
|
|
831
|
+
), _ = X(async () => await e.post("/logout"), [e]);
|
|
822
832
|
return {
|
|
823
|
-
machineLoginApi:
|
|
824
|
-
userInfoApi:
|
|
825
|
-
userGameListApi:
|
|
826
|
-
userFavoriteGameApi:
|
|
827
|
-
userCurrencyExchangeApi: s
|
|
833
|
+
machineLoginApi: r,
|
|
834
|
+
userInfoApi: c,
|
|
835
|
+
userGameListApi: o,
|
|
836
|
+
userFavoriteGameApi: g,
|
|
837
|
+
userCurrencyExchangeApi: s,
|
|
838
|
+
userLoginApi: U,
|
|
839
|
+
userLogoutApi: _
|
|
828
840
|
};
|
|
829
841
|
}, zi = {
|
|
830
842
|
platform: { all: [], origin: [] },
|
|
@@ -845,10 +857,10 @@ const Za = Fa(null), rl = () => {
|
|
|
845
857
|
},
|
|
846
858
|
user: { favorite: [] }
|
|
847
859
|
}, Zi = ({ enabled: e = !0 } = {}) => {
|
|
848
|
-
const { userFavoriteGameApi:
|
|
860
|
+
const { userFavoriteGameApi: r } = He(), { data: c, isLoading: o, error: s, refetch: g } = oe({
|
|
849
861
|
queryKey: ["gamesInfo"],
|
|
850
862
|
queryFn: async () => {
|
|
851
|
-
const U = await
|
|
863
|
+
const U = await r();
|
|
852
864
|
return Ji({
|
|
853
865
|
allGameList: window.gameTypeGroup || {},
|
|
854
866
|
allGamePlatform: window.platforms || [],
|
|
@@ -872,10 +884,10 @@ const Za = Fa(null), rl = () => {
|
|
|
872
884
|
refetchOnWindowFocus: !1
|
|
873
885
|
});
|
|
874
886
|
return {
|
|
875
|
-
gamesInfo:
|
|
876
|
-
isLoading:
|
|
887
|
+
gamesInfo: c || zi,
|
|
888
|
+
isLoading: o,
|
|
877
889
|
error: s,
|
|
878
|
-
refetch:
|
|
890
|
+
refetch: g
|
|
879
891
|
};
|
|
880
892
|
}, Vi = (e = !1) => {
|
|
881
893
|
!e && window.gameTypeGroup || (e || !window.gameTypeGroup) && (window.gameTypeGroup = window.gameTypeGroup || {
|
|
@@ -27402,22 +27414,22 @@ const Za = Fa(null), rl = () => {
|
|
|
27402
27414
|
});
|
|
27403
27415
|
}, Ii = ({
|
|
27404
27416
|
children: e,
|
|
27405
|
-
autoFetch:
|
|
27406
|
-
mockData:
|
|
27417
|
+
autoFetch: r = !1,
|
|
27418
|
+
mockData: c = !1
|
|
27407
27419
|
}) => {
|
|
27408
27420
|
Ce(() => {
|
|
27409
|
-
|
|
27410
|
-
}, [
|
|
27411
|
-
const
|
|
27412
|
-
return /* @__PURE__ */ Pe.jsx(Za.Provider, { value:
|
|
27421
|
+
c && Vi(!0);
|
|
27422
|
+
}, [c]);
|
|
27423
|
+
const o = Zi({ enabled: r });
|
|
27424
|
+
return /* @__PURE__ */ Pe.jsx(Za.Provider, { value: o, children: e });
|
|
27413
27425
|
};
|
|
27414
27426
|
function pl({
|
|
27415
27427
|
children: e,
|
|
27416
|
-
autoFetchGamesInfo:
|
|
27417
|
-
useMockData:
|
|
27418
|
-
...
|
|
27428
|
+
autoFetchGamesInfo: r = !1,
|
|
27429
|
+
useMockData: c = !1,
|
|
27430
|
+
...o
|
|
27419
27431
|
}) {
|
|
27420
|
-
const s = Qe(() => Ei(
|
|
27432
|
+
const s = Qe(() => Ei(o), [o]), U = Qe(
|
|
27421
27433
|
() => new Ti({
|
|
27422
27434
|
defaultOptions: {
|
|
27423
27435
|
queries: {
|
|
@@ -27428,85 +27440,85 @@ function pl({
|
|
|
27428
27440
|
}),
|
|
27429
27441
|
[]
|
|
27430
27442
|
);
|
|
27431
|
-
return /* @__PURE__ */ Pe.jsx(Ci, { client: U, children: /* @__PURE__ */ Pe.jsx(za.Provider, { value: { client: s, ...
|
|
27443
|
+
return /* @__PURE__ */ Pe.jsx(Ci, { client: U, children: /* @__PURE__ */ Pe.jsx(za.Provider, { value: { client: s, ...o }, children: /* @__PURE__ */ Pe.jsx(Ii, { autoFetch: r, mockData: c, children: e }) }) });
|
|
27432
27444
|
}
|
|
27433
|
-
const gl = ({ otherQueryKey: e = [], options:
|
|
27434
|
-
const { userCurrencyExchangeApi:
|
|
27445
|
+
const gl = ({ otherQueryKey: e = [], options: r = {} } = {}) => {
|
|
27446
|
+
const { userCurrencyExchangeApi: c } = He(), { getToken: o } = Oe(), { enabled: s, ...g } = r, U = !!o && (s ? s.every((_) => _) : !0);
|
|
27435
27447
|
return Ja({
|
|
27436
27448
|
queries: [
|
|
27437
27449
|
{
|
|
27438
27450
|
queryKey: ["userCurrencyExchange", ...e],
|
|
27439
|
-
queryFn: () =>
|
|
27451
|
+
queryFn: () => c(),
|
|
27440
27452
|
enabled: U,
|
|
27441
27453
|
// ← 使用合併後的條件
|
|
27442
|
-
...
|
|
27454
|
+
...g
|
|
27443
27455
|
// ← 不包含 enabled
|
|
27444
27456
|
}
|
|
27445
27457
|
]
|
|
27446
27458
|
});
|
|
27447
27459
|
}, dl = ({
|
|
27448
27460
|
refetchInterval: e = 5e4,
|
|
27449
|
-
trigger:
|
|
27450
|
-
enabled:
|
|
27461
|
+
trigger: r = [],
|
|
27462
|
+
enabled: c = !0
|
|
27451
27463
|
} = {}) => {
|
|
27452
|
-
const { getToken:
|
|
27464
|
+
const { getToken: o } = Oe(), { userInfoApi: s } = He(), g = Ja({
|
|
27453
27465
|
queries: [
|
|
27454
27466
|
{
|
|
27455
|
-
queryKey: ["getMemberInfo", ...
|
|
27467
|
+
queryKey: ["getMemberInfo", ...r],
|
|
27456
27468
|
queryFn: async () => await s(),
|
|
27457
27469
|
refetchInterval: e,
|
|
27458
|
-
enabled: !!
|
|
27470
|
+
enabled: !!o && c
|
|
27459
27471
|
}
|
|
27460
27472
|
]
|
|
27461
|
-
}), { data: U, isFetching: _, error:
|
|
27462
|
-
return { data: U, isFetching: _, error:
|
|
27473
|
+
}), { data: U, isFetching: _, error: m } = g[0] || {};
|
|
27474
|
+
return { data: U, isFetching: _, error: m };
|
|
27463
27475
|
}, cl = ({ enabled: e = !0 } = {}) => {
|
|
27464
27476
|
const {
|
|
27465
|
-
userInfoApi:
|
|
27466
|
-
userFavoriteGameApi:
|
|
27467
|
-
userGameListApi:
|
|
27477
|
+
userInfoApi: r,
|
|
27478
|
+
userFavoriteGameApi: c,
|
|
27479
|
+
userGameListApi: o,
|
|
27468
27480
|
userCurrencyExchangeApi: s
|
|
27469
|
-
} = He(),
|
|
27481
|
+
} = He(), g = oe({
|
|
27470
27482
|
queryKey: ["getMemInfo"],
|
|
27471
|
-
queryFn: async () =>
|
|
27483
|
+
queryFn: async () => r(),
|
|
27472
27484
|
enabled: e
|
|
27473
27485
|
}), U = oe({
|
|
27474
27486
|
queryKey: ["getFavoriteGame"],
|
|
27475
|
-
queryFn: async () =>
|
|
27476
|
-
enabled: e &&
|
|
27487
|
+
queryFn: async () => c(),
|
|
27488
|
+
enabled: e && g.isSuccess
|
|
27477
27489
|
}), _ = oe({
|
|
27478
27490
|
queryKey: ["getUserGameList"],
|
|
27479
|
-
queryFn: async () =>
|
|
27480
|
-
enabled: e &&
|
|
27481
|
-
}),
|
|
27491
|
+
queryFn: async () => o(),
|
|
27492
|
+
enabled: e && g.isSuccess && U.isSuccess
|
|
27493
|
+
}), m = oe({
|
|
27482
27494
|
queryKey: ["getUserCurrencyExchange"],
|
|
27483
27495
|
queryFn: async () => s(),
|
|
27484
|
-
enabled: e &&
|
|
27496
|
+
enabled: e && g.isSuccess && U.isSuccess && _.isSuccess
|
|
27485
27497
|
});
|
|
27486
27498
|
return [
|
|
27487
|
-
|
|
27499
|
+
g,
|
|
27488
27500
|
U,
|
|
27489
27501
|
_,
|
|
27490
|
-
|
|
27502
|
+
m
|
|
27491
27503
|
];
|
|
27492
27504
|
};
|
|
27493
27505
|
var Ve = {}, J = {}, Ie = {}, ha;
|
|
27494
27506
|
function A() {
|
|
27495
27507
|
return ha || (ha = 1, (function(e) {
|
|
27496
27508
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.isEventSourceSupported = e.isReactNative = e.ReadyState = e.DEFAULT_HEARTBEAT = e.UNPARSABLE_JSON_OBJECT = e.DEFAULT_RECONNECT_INTERVAL_MS = e.DEFAULT_RECONNECT_LIMIT = e.SOCKET_IO_PING_CODE = e.SOCKET_IO_PATH = e.SOCKET_IO_PING_INTERVAL = e.DEFAULT_EVENT_SOURCE_OPTIONS = e.EMPTY_EVENT_HANDLERS = e.DEFAULT_OPTIONS = void 0;
|
|
27497
|
-
var
|
|
27509
|
+
var r = 1, c = 1e3 * r;
|
|
27498
27510
|
e.DEFAULT_OPTIONS = {}, e.EMPTY_EVENT_HANDLERS = {}, e.DEFAULT_EVENT_SOURCE_OPTIONS = {
|
|
27499
27511
|
withCredentials: !1,
|
|
27500
27512
|
events: e.EMPTY_EVENT_HANDLERS
|
|
27501
|
-
}, e.SOCKET_IO_PING_INTERVAL = 25 *
|
|
27513
|
+
}, e.SOCKET_IO_PING_INTERVAL = 25 * c, e.SOCKET_IO_PATH = "/socket.io/?EIO=3&transport=websocket", e.SOCKET_IO_PING_CODE = "2", e.DEFAULT_RECONNECT_LIMIT = 20, e.DEFAULT_RECONNECT_INTERVAL_MS = 5e3, e.UNPARSABLE_JSON_OBJECT = {}, e.DEFAULT_HEARTBEAT = {
|
|
27502
27514
|
message: "ping",
|
|
27503
27515
|
timeout: 6e4,
|
|
27504
27516
|
interval: 25e3
|
|
27505
27517
|
};
|
|
27506
|
-
var
|
|
27507
|
-
(function(
|
|
27508
|
-
|
|
27509
|
-
})(
|
|
27518
|
+
var o;
|
|
27519
|
+
(function(g) {
|
|
27520
|
+
g[g.UNINSTANTIATED = -1] = "UNINSTANTIATED", g[g.CONNECTING = 0] = "CONNECTING", g[g.OPEN = 1] = "OPEN", g[g.CLOSING = 2] = "CLOSING", g[g.CLOSED = 3] = "CLOSED";
|
|
27521
|
+
})(o || (e.ReadyState = o = {}));
|
|
27510
27522
|
var s = function() {
|
|
27511
27523
|
try {
|
|
27512
27524
|
return "EventSource" in globalThis;
|
|
@@ -27521,72 +27533,72 @@ var be = {}, Ae = {}, ka;
|
|
|
27521
27533
|
function Xe() {
|
|
27522
27534
|
return ka || (ka = 1, (function(e) {
|
|
27523
27535
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetWebSockets = e.sharedWebSockets = void 0, e.sharedWebSockets = {};
|
|
27524
|
-
var
|
|
27525
|
-
if (
|
|
27526
|
-
delete e.sharedWebSockets[
|
|
27536
|
+
var r = function(c) {
|
|
27537
|
+
if (c && e.sharedWebSockets.hasOwnProperty(c))
|
|
27538
|
+
delete e.sharedWebSockets[c];
|
|
27527
27539
|
else
|
|
27528
|
-
for (var
|
|
27529
|
-
e.sharedWebSockets.hasOwnProperty(
|
|
27540
|
+
for (var o in e.sharedWebSockets)
|
|
27541
|
+
e.sharedWebSockets.hasOwnProperty(o) && delete e.sharedWebSockets[o];
|
|
27530
27542
|
};
|
|
27531
|
-
e.resetWebSockets =
|
|
27543
|
+
e.resetWebSockets = r;
|
|
27532
27544
|
})(Ae)), Ae;
|
|
27533
27545
|
}
|
|
27534
|
-
var
|
|
27546
|
+
var ne = {}, j = {}, Sa;
|
|
27535
27547
|
function $e() {
|
|
27536
27548
|
if (Sa) return j;
|
|
27537
27549
|
Sa = 1, Object.defineProperty(j, "__esModule", { value: !0 }), j.setUpSocketIOPing = j.appendQueryParams = j.parseSocketIOUrl = void 0;
|
|
27538
|
-
var e = A(),
|
|
27550
|
+
var e = A(), r = function(s) {
|
|
27539
27551
|
if (s) {
|
|
27540
|
-
var
|
|
27541
|
-
return "".concat(
|
|
27552
|
+
var g = /^https|wss/.test(s), U = s.replace(/^(https?|wss?)(:\/\/)?/, ""), _ = U.replace(/\/$/, ""), m = g ? "wss" : "ws";
|
|
27553
|
+
return "".concat(m, "://").concat(_).concat(e.SOCKET_IO_PATH);
|
|
27542
27554
|
} else if (s === "") {
|
|
27543
|
-
var
|
|
27544
|
-
return "".concat(
|
|
27555
|
+
var g = /^https/.test(window.location.protocol), m = g ? "wss" : "ws", d = window.location.port ? ":".concat(window.location.port) : "";
|
|
27556
|
+
return "".concat(m, "://").concat(window.location.hostname).concat(d).concat(e.SOCKET_IO_PATH);
|
|
27545
27557
|
}
|
|
27546
27558
|
return s;
|
|
27547
27559
|
};
|
|
27548
|
-
j.parseSocketIOUrl =
|
|
27549
|
-
var
|
|
27550
|
-
|
|
27551
|
-
var U = /\?([\w]+=[\w]+)/, _ = U.test(s),
|
|
27552
|
-
var i = n[0],
|
|
27553
|
-
return
|
|
27560
|
+
j.parseSocketIOUrl = r;
|
|
27561
|
+
var c = function(s, g) {
|
|
27562
|
+
g === void 0 && (g = {});
|
|
27563
|
+
var U = /\?([\w]+=[\w]+)/, _ = U.test(s), m = "".concat(Object.entries(g).reduce(function(d, n) {
|
|
27564
|
+
var i = n[0], p = n[1];
|
|
27565
|
+
return d + "".concat(i, "=").concat(p, "&");
|
|
27554
27566
|
}, "").slice(0, -1));
|
|
27555
|
-
return "".concat(s).concat(_ ? "&" : "?").concat(
|
|
27567
|
+
return "".concat(s).concat(_ ? "&" : "?").concat(m);
|
|
27556
27568
|
};
|
|
27557
|
-
j.appendQueryParams =
|
|
27558
|
-
var
|
|
27559
|
-
|
|
27569
|
+
j.appendQueryParams = c;
|
|
27570
|
+
var o = function(s, g) {
|
|
27571
|
+
g === void 0 && (g = e.SOCKET_IO_PING_INTERVAL);
|
|
27560
27572
|
var U = function() {
|
|
27561
27573
|
return s(e.SOCKET_IO_PING_CODE);
|
|
27562
27574
|
};
|
|
27563
|
-
return window.setInterval(U,
|
|
27575
|
+
return window.setInterval(U, g);
|
|
27564
27576
|
};
|
|
27565
|
-
return j.setUpSocketIOPing =
|
|
27577
|
+
return j.setUpSocketIOPing = o, j;
|
|
27566
27578
|
}
|
|
27567
27579
|
var Re = {}, Na;
|
|
27568
27580
|
function Ka() {
|
|
27569
27581
|
if (Na) return Re;
|
|
27570
|
-
Na = 1, Object.defineProperty(Re, "__esModule", { value: !0 }), Re.heartbeat =
|
|
27582
|
+
Na = 1, Object.defineProperty(Re, "__esModule", { value: !0 }), Re.heartbeat = c;
|
|
27571
27583
|
var e = A();
|
|
27572
|
-
function
|
|
27573
|
-
return Array.isArray(
|
|
27574
|
-
return s.current >
|
|
27575
|
-
}).current :
|
|
27584
|
+
function r(o) {
|
|
27585
|
+
return Array.isArray(o) ? o.reduce(function(s, g) {
|
|
27586
|
+
return s.current > g.current ? s : g;
|
|
27587
|
+
}).current : o.current;
|
|
27576
27588
|
}
|
|
27577
|
-
function
|
|
27578
|
-
var U =
|
|
27579
|
-
var b = Date.now(), u =
|
|
27589
|
+
function c(o, s, g) {
|
|
27590
|
+
var U = g || {}, _ = U.interval, m = _ === void 0 ? e.DEFAULT_HEARTBEAT.interval : _, d = U.timeout, n = d === void 0 ? e.DEFAULT_HEARTBEAT.timeout : d, i = U.message, p = i === void 0 ? e.DEFAULT_HEARTBEAT.message : i, l = Math.max(100, m / 10), t = Date.now(), y = setInterval(function() {
|
|
27591
|
+
var b = Date.now(), u = r(s);
|
|
27580
27592
|
if (u + n <= b)
|
|
27581
|
-
console.warn("Heartbeat timed out, closing connection, last message received ".concat(b - u, "ms ago, last ping sent ").concat(b - t, "ms ago")),
|
|
27582
|
-
else if (u +
|
|
27593
|
+
console.warn("Heartbeat timed out, closing connection, last message received ".concat(b - u, "ms ago, last ping sent ").concat(b - t, "ms ago")), o.close();
|
|
27594
|
+
else if (u + m <= b && t + m <= b)
|
|
27583
27595
|
try {
|
|
27584
|
-
typeof
|
|
27596
|
+
typeof p == "function" ? o.send(p()) : o.send(p), t = b;
|
|
27585
27597
|
} catch (T) {
|
|
27586
|
-
console.error("Heartbeat failed, closing connection", T instanceof Error ? T.message : T),
|
|
27598
|
+
console.error("Heartbeat failed, closing connection", T instanceof Error ? T.message : T), o.close();
|
|
27587
27599
|
}
|
|
27588
27600
|
}, l);
|
|
27589
|
-
return
|
|
27601
|
+
return o.addEventListener("close", function() {
|
|
27590
27602
|
clearInterval(y);
|
|
27591
27603
|
}), function() {
|
|
27592
27604
|
};
|
|
@@ -27597,29 +27609,29 @@ var Te = {}, Be = {}, Da;
|
|
|
27597
27609
|
function ea() {
|
|
27598
27610
|
return Da || (Da = 1, (function(e) {
|
|
27599
27611
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetSubscribers = e.removeSubscriber = e.addSubscriber = e.hasSubscribers = e.getSubscribers = void 0;
|
|
27600
|
-
var
|
|
27601
|
-
return (0, e.hasSubscribers)(
|
|
27612
|
+
var r = {}, c = [], o = function(m) {
|
|
27613
|
+
return (0, e.hasSubscribers)(m) ? Array.from(r[m]) : c;
|
|
27602
27614
|
};
|
|
27603
|
-
e.getSubscribers =
|
|
27604
|
-
var s = function(
|
|
27605
|
-
var
|
|
27606
|
-
return ((
|
|
27615
|
+
e.getSubscribers = o;
|
|
27616
|
+
var s = function(m) {
|
|
27617
|
+
var d;
|
|
27618
|
+
return ((d = r[m]) === null || d === void 0 ? void 0 : d.size) > 0;
|
|
27607
27619
|
};
|
|
27608
27620
|
e.hasSubscribers = s;
|
|
27609
|
-
var
|
|
27610
|
-
m
|
|
27621
|
+
var g = function(m, d) {
|
|
27622
|
+
r[m] = r[m] || /* @__PURE__ */ new Set(), r[m].add(d);
|
|
27611
27623
|
};
|
|
27612
|
-
e.addSubscriber =
|
|
27613
|
-
var U = function(
|
|
27614
|
-
m
|
|
27624
|
+
e.addSubscriber = g;
|
|
27625
|
+
var U = function(m, d) {
|
|
27626
|
+
r[m].delete(d);
|
|
27615
27627
|
};
|
|
27616
27628
|
e.removeSubscriber = U;
|
|
27617
|
-
var _ = function(
|
|
27618
|
-
if (
|
|
27619
|
-
delete m
|
|
27629
|
+
var _ = function(m) {
|
|
27630
|
+
if (m && r.hasOwnProperty(m))
|
|
27631
|
+
delete r[m];
|
|
27620
27632
|
else
|
|
27621
|
-
for (var
|
|
27622
|
-
|
|
27633
|
+
for (var d in r)
|
|
27634
|
+
r.hasOwnProperty(d) && delete r[d];
|
|
27623
27635
|
};
|
|
27624
27636
|
e.resetSubscribers = _;
|
|
27625
27637
|
})(Be)), Be;
|
|
@@ -27627,188 +27639,188 @@ function ea() {
|
|
|
27627
27639
|
var Ea;
|
|
27628
27640
|
function aa() {
|
|
27629
27641
|
if (Ea) return Te;
|
|
27630
|
-
Ea = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.assertIsWebSocket =
|
|
27631
|
-
var e = Xe(),
|
|
27632
|
-
function
|
|
27633
|
-
if (!
|
|
27642
|
+
Ea = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.assertIsWebSocket = c, Te.resetGlobalState = o;
|
|
27643
|
+
var e = Xe(), r = ea();
|
|
27644
|
+
function c(s, g) {
|
|
27645
|
+
if (!g && !(s instanceof WebSocket))
|
|
27634
27646
|
throw new Error("");
|
|
27635
27647
|
}
|
|
27636
|
-
function
|
|
27637
|
-
(0,
|
|
27648
|
+
function o(s) {
|
|
27649
|
+
(0, r.resetSubscribers)(s), (0, e.resetWebSockets)(s);
|
|
27638
27650
|
}
|
|
27639
27651
|
return Te;
|
|
27640
27652
|
}
|
|
27641
27653
|
var La;
|
|
27642
27654
|
function Ai() {
|
|
27643
|
-
if (La) return
|
|
27655
|
+
if (La) return ne;
|
|
27644
27656
|
La = 1;
|
|
27645
|
-
var e =
|
|
27657
|
+
var e = ne && ne.__assign || function() {
|
|
27646
27658
|
return e = Object.assign || function(n) {
|
|
27647
|
-
for (var i,
|
|
27648
|
-
i = arguments[
|
|
27659
|
+
for (var i, p = 1, l = arguments.length; p < l; p++) {
|
|
27660
|
+
i = arguments[p];
|
|
27649
27661
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && (n[t] = i[t]);
|
|
27650
27662
|
}
|
|
27651
27663
|
return n;
|
|
27652
27664
|
}, e.apply(this, arguments);
|
|
27653
27665
|
};
|
|
27654
|
-
Object.defineProperty(
|
|
27655
|
-
var
|
|
27666
|
+
Object.defineProperty(ne, "__esModule", { value: !0 }), ne.attachListeners = void 0;
|
|
27667
|
+
var r = $e(), c = Ka(), o = A(), s = aa(), g = function(n, i, p, l) {
|
|
27656
27668
|
n.onmessage = function(t) {
|
|
27657
27669
|
var y;
|
|
27658
|
-
i.current.onMessage && i.current.onMessage(t), typeof l?.current == "number" && (l.current = Date.now()), !(typeof i.current.filter == "function" && i.current.filter(t) !== !0) && (i.current.heartbeat && typeof i.current.heartbeat != "boolean" && ((y = i.current.heartbeat) === null || y === void 0 ? void 0 : y.returnMessage) === t.data ||
|
|
27670
|
+
i.current.onMessage && i.current.onMessage(t), typeof l?.current == "number" && (l.current = Date.now()), !(typeof i.current.filter == "function" && i.current.filter(t) !== !0) && (i.current.heartbeat && typeof i.current.heartbeat != "boolean" && ((y = i.current.heartbeat) === null || y === void 0 ? void 0 : y.returnMessage) === t.data || p(t));
|
|
27659
27671
|
};
|
|
27660
|
-
}, U = function(n, i,
|
|
27672
|
+
}, U = function(n, i, p, l, t) {
|
|
27661
27673
|
n.onopen = function(y) {
|
|
27662
|
-
if (i.current.onOpen && i.current.onOpen(y), l.current = 0,
|
|
27674
|
+
if (i.current.onOpen && i.current.onOpen(y), l.current = 0, p(o.ReadyState.OPEN), i.current.heartbeat && n instanceof WebSocket) {
|
|
27663
27675
|
var b = typeof i.current.heartbeat == "boolean" ? void 0 : i.current.heartbeat;
|
|
27664
|
-
t.current = Date.now(), (0,
|
|
27676
|
+
t.current = Date.now(), (0, c.heartbeat)(n, t, b);
|
|
27665
27677
|
}
|
|
27666
27678
|
};
|
|
27667
|
-
}, _ = function(n, i,
|
|
27668
|
-
if (
|
|
27679
|
+
}, _ = function(n, i, p, l, t) {
|
|
27680
|
+
if (o.isEventSourceSupported && n instanceof EventSource)
|
|
27669
27681
|
return function() {
|
|
27670
27682
|
};
|
|
27671
27683
|
(0, s.assertIsWebSocket)(n, i.current.skipAssert);
|
|
27672
27684
|
var y;
|
|
27673
27685
|
return n.onclose = function(b) {
|
|
27674
27686
|
var u;
|
|
27675
|
-
if (i.current.onClose && i.current.onClose(b),
|
|
27676
|
-
var T = (u = i.current.reconnectAttempts) !== null && u !== void 0 ? u :
|
|
27687
|
+
if (i.current.onClose && i.current.onClose(b), p(o.ReadyState.CLOSED), i.current.shouldReconnect && i.current.shouldReconnect(b)) {
|
|
27688
|
+
var T = (u = i.current.reconnectAttempts) !== null && u !== void 0 ? u : o.DEFAULT_RECONNECT_LIMIT;
|
|
27677
27689
|
if (t.current < T) {
|
|
27678
27690
|
var N = typeof i.current.reconnectInterval == "function" ? i.current.reconnectInterval(t.current) : i.current.reconnectInterval;
|
|
27679
27691
|
y = window.setTimeout(function() {
|
|
27680
27692
|
t.current++, l();
|
|
27681
|
-
}, N ??
|
|
27693
|
+
}, N ?? o.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
27682
27694
|
} else
|
|
27683
27695
|
i.current.onReconnectStop && i.current.onReconnectStop(T), console.warn("Max reconnect attempts of ".concat(T, " exceeded"));
|
|
27684
27696
|
}
|
|
27685
27697
|
}, function() {
|
|
27686
27698
|
return y && window.clearTimeout(y);
|
|
27687
27699
|
};
|
|
27688
|
-
},
|
|
27700
|
+
}, m = function(n, i, p, l, t) {
|
|
27689
27701
|
var y;
|
|
27690
27702
|
return n.onerror = function(b) {
|
|
27691
27703
|
var u;
|
|
27692
|
-
if (i.current.onError && i.current.onError(b),
|
|
27693
|
-
if (t.current < ((u = i.current.reconnectAttempts) !== null && u !== void 0 ? u :
|
|
27704
|
+
if (i.current.onError && i.current.onError(b), o.isEventSourceSupported && n instanceof EventSource && (i.current.onClose && i.current.onClose(e(e({}, b), { code: 1006, reason: "An error occurred with the EventSource: ".concat(b), wasClean: !1 })), p(o.ReadyState.CLOSED), n.close()), i.current.retryOnError)
|
|
27705
|
+
if (t.current < ((u = i.current.reconnectAttempts) !== null && u !== void 0 ? u : o.DEFAULT_RECONNECT_LIMIT)) {
|
|
27694
27706
|
var T = typeof i.current.reconnectInterval == "function" ? i.current.reconnectInterval(t.current) : i.current.reconnectInterval;
|
|
27695
27707
|
y = window.setTimeout(function() {
|
|
27696
27708
|
t.current++, l();
|
|
27697
|
-
}, T ??
|
|
27709
|
+
}, T ?? o.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
27698
27710
|
} else
|
|
27699
27711
|
i.current.onReconnectStop && i.current.onReconnectStop(i.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(i.current.reconnectAttempts, " exceeded"));
|
|
27700
27712
|
}, function() {
|
|
27701
27713
|
return y && window.clearTimeout(y);
|
|
27702
27714
|
};
|
|
27703
|
-
},
|
|
27715
|
+
}, d = function(n, i, p, l, t, y, b) {
|
|
27704
27716
|
var u = i.setLastMessage, T = i.setReadyState, N, D, h;
|
|
27705
|
-
return
|
|
27706
|
-
T(
|
|
27717
|
+
return p.current.fromSocketIO && (N = (0, r.setUpSocketIOPing)(b)), g(n, p, u, y), U(n, p, T, t, y), D = _(n, p, T, l, t), h = m(n, p, T, l, t), function() {
|
|
27718
|
+
T(o.ReadyState.CLOSING), D(), h(), n.close(), N && clearInterval(N);
|
|
27707
27719
|
};
|
|
27708
27720
|
};
|
|
27709
|
-
return
|
|
27721
|
+
return ne.attachListeners = d, ne;
|
|
27710
27722
|
}
|
|
27711
|
-
var
|
|
27723
|
+
var me = {}, Ga;
|
|
27712
27724
|
function Bi() {
|
|
27713
|
-
if (Ga) return
|
|
27725
|
+
if (Ga) return me;
|
|
27714
27726
|
Ga = 1;
|
|
27715
|
-
var e =
|
|
27727
|
+
var e = me && me.__assign || function() {
|
|
27716
27728
|
return e = Object.assign || function(i) {
|
|
27717
|
-
for (var
|
|
27718
|
-
|
|
27719
|
-
for (var y in
|
|
27729
|
+
for (var p, l = 1, t = arguments.length; l < t; l++) {
|
|
27730
|
+
p = arguments[l];
|
|
27731
|
+
for (var y in p) Object.prototype.hasOwnProperty.call(p, y) && (i[y] = p[y]);
|
|
27720
27732
|
}
|
|
27721
27733
|
return i;
|
|
27722
27734
|
}, e.apply(this, arguments);
|
|
27723
27735
|
};
|
|
27724
|
-
Object.defineProperty(
|
|
27725
|
-
var
|
|
27736
|
+
Object.defineProperty(me, "__esModule", { value: !0 }), me.attachSharedListeners = void 0;
|
|
27737
|
+
var r = Xe(), c = A(), o = ea(), s = $e(), g = Ka(), U = function(i, p, l) {
|
|
27726
27738
|
i.onmessage = function(t) {
|
|
27727
|
-
(0,
|
|
27739
|
+
(0, o.getSubscribers)(p).forEach(function(y) {
|
|
27728
27740
|
var b;
|
|
27729
27741
|
y.optionsRef.current.onMessage && y.optionsRef.current.onMessage(t), typeof ((b = y?.lastMessageTime) === null || b === void 0 ? void 0 : b.current) == "number" && (y.lastMessageTime.current = Date.now()), !(typeof y.optionsRef.current.filter == "function" && y.optionsRef.current.filter(t) !== !0) && (l && typeof l != "boolean" && l?.returnMessage === t.data || y.setLastMessage(t));
|
|
27730
27742
|
});
|
|
27731
27743
|
};
|
|
27732
|
-
}, _ = function(i,
|
|
27744
|
+
}, _ = function(i, p, l) {
|
|
27733
27745
|
i.onopen = function(t) {
|
|
27734
|
-
var y = (0,
|
|
27746
|
+
var y = (0, o.getSubscribers)(p);
|
|
27735
27747
|
y.forEach(function(b) {
|
|
27736
|
-
b.reconnectCount.current = 0, b.optionsRef.current.onOpen && b.optionsRef.current.onOpen(t), b.setReadyState(
|
|
27737
|
-
}), l && i instanceof WebSocket && (0,
|
|
27748
|
+
b.reconnectCount.current = 0, b.optionsRef.current.onOpen && b.optionsRef.current.onOpen(t), b.setReadyState(c.ReadyState.OPEN), l && i instanceof WebSocket && (b.lastMessageTime.current = Date.now());
|
|
27749
|
+
}), l && i instanceof WebSocket && (0, g.heartbeat)(i, y.map(function(b) {
|
|
27738
27750
|
return b.lastMessageTime;
|
|
27739
27751
|
}), typeof l == "boolean" ? void 0 : l);
|
|
27740
27752
|
};
|
|
27741
|
-
},
|
|
27753
|
+
}, m = function(i, p) {
|
|
27742
27754
|
i instanceof WebSocket && (i.onclose = function(l) {
|
|
27743
|
-
(0,
|
|
27744
|
-
t.optionsRef.current.onClose && t.optionsRef.current.onClose(l), t.setReadyState(
|
|
27745
|
-
}), delete
|
|
27755
|
+
(0, o.getSubscribers)(p).forEach(function(t) {
|
|
27756
|
+
t.optionsRef.current.onClose && t.optionsRef.current.onClose(l), t.setReadyState(c.ReadyState.CLOSED);
|
|
27757
|
+
}), delete r.sharedWebSockets[p], (0, o.getSubscribers)(p).forEach(function(t) {
|
|
27746
27758
|
var y;
|
|
27747
27759
|
if (t.optionsRef.current.shouldReconnect && t.optionsRef.current.shouldReconnect(l)) {
|
|
27748
|
-
var b = (y = t.optionsRef.current.reconnectAttempts) !== null && y !== void 0 ? y :
|
|
27760
|
+
var b = (y = t.optionsRef.current.reconnectAttempts) !== null && y !== void 0 ? y : c.DEFAULT_RECONNECT_LIMIT;
|
|
27749
27761
|
if (t.reconnectCount.current < b) {
|
|
27750
27762
|
var u = typeof t.optionsRef.current.reconnectInterval == "function" ? t.optionsRef.current.reconnectInterval(t.reconnectCount.current) : t.optionsRef.current.reconnectInterval;
|
|
27751
27763
|
setTimeout(function() {
|
|
27752
27764
|
t.reconnectCount.current++, t.reconnect.current();
|
|
27753
|
-
}, u ??
|
|
27765
|
+
}, u ?? c.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
27754
27766
|
} else
|
|
27755
27767
|
t.optionsRef.current.onReconnectStop && t.optionsRef.current.onReconnectStop(t.optionsRef.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(b, " exceeded"));
|
|
27756
27768
|
}
|
|
27757
27769
|
});
|
|
27758
27770
|
});
|
|
27759
|
-
},
|
|
27771
|
+
}, d = function(i, p) {
|
|
27760
27772
|
i.onerror = function(l) {
|
|
27761
|
-
(0,
|
|
27762
|
-
t.optionsRef.current.onError && t.optionsRef.current.onError(l),
|
|
27763
|
-
}),
|
|
27773
|
+
(0, o.getSubscribers)(p).forEach(function(t) {
|
|
27774
|
+
t.optionsRef.current.onError && t.optionsRef.current.onError(l), c.isEventSourceSupported && i instanceof EventSource && (t.optionsRef.current.onClose && t.optionsRef.current.onClose(e(e({}, l), { code: 1006, reason: "An error occurred with the EventSource: ".concat(l), wasClean: !1 })), t.setReadyState(c.ReadyState.CLOSED));
|
|
27775
|
+
}), c.isEventSourceSupported && i instanceof EventSource && i.close();
|
|
27764
27776
|
};
|
|
27765
|
-
}, n = function(i,
|
|
27777
|
+
}, n = function(i, p, l, t) {
|
|
27766
27778
|
var y;
|
|
27767
|
-
return l.current.fromSocketIO && (y = (0, s.setUpSocketIOPing)(t)), U(i,
|
|
27779
|
+
return l.current.fromSocketIO && (y = (0, s.setUpSocketIOPing)(t)), U(i, p, l.current.heartbeat), m(i, p), _(i, p, l.current.heartbeat), d(i, p), function() {
|
|
27768
27780
|
y && clearInterval(y);
|
|
27769
27781
|
};
|
|
27770
27782
|
};
|
|
27771
|
-
return
|
|
27783
|
+
return me.attachSharedListeners = n, me;
|
|
27772
27784
|
}
|
|
27773
27785
|
var Ma;
|
|
27774
27786
|
function Ki() {
|
|
27775
27787
|
if (Ma) return be;
|
|
27776
27788
|
Ma = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.createOrJoinSocket = void 0;
|
|
27777
|
-
var e = Xe(),
|
|
27789
|
+
var e = Xe(), r = A(), c = Ai(), o = Bi(), s = ea(), g = function(_, m, d, n, i) {
|
|
27778
27790
|
return function() {
|
|
27779
|
-
if ((0, s.removeSubscriber)(_,
|
|
27791
|
+
if ((0, s.removeSubscriber)(_, m), !(0, s.hasSubscribers)(_)) {
|
|
27780
27792
|
try {
|
|
27781
|
-
var
|
|
27782
|
-
|
|
27783
|
-
|
|
27784
|
-
}),
|
|
27793
|
+
var p = e.sharedWebSockets[_];
|
|
27794
|
+
p instanceof WebSocket && (p.onclose = function(l) {
|
|
27795
|
+
d.current.onClose && d.current.onClose(l), n(r.ReadyState.CLOSED);
|
|
27796
|
+
}), p.close();
|
|
27785
27797
|
} catch {
|
|
27786
27798
|
}
|
|
27787
27799
|
i && i(), delete e.sharedWebSockets[_];
|
|
27788
27800
|
}
|
|
27789
27801
|
};
|
|
27790
|
-
}, U = function(_,
|
|
27791
|
-
if (!
|
|
27792
|
-
throw
|
|
27802
|
+
}, U = function(_, m, d, n, i, p, l, t, y) {
|
|
27803
|
+
if (!r.isEventSourceSupported && n.current.eventSourceOptions)
|
|
27804
|
+
throw r.isReactNative ? new Error("EventSource is not supported in ReactNative") : new Error("EventSource is not supported");
|
|
27793
27805
|
if (n.current.share) {
|
|
27794
27806
|
var b = null;
|
|
27795
|
-
e.sharedWebSockets[
|
|
27807
|
+
e.sharedWebSockets[m] === void 0 ? (e.sharedWebSockets[m] = n.current.eventSourceOptions ? new EventSource(m, n.current.eventSourceOptions) : new WebSocket(m, n.current.protocols), _.current = e.sharedWebSockets[m], d(r.ReadyState.CONNECTING), b = (0, o.attachSharedListeners)(e.sharedWebSockets[m], m, n, y)) : (_.current = e.sharedWebSockets[m], d(e.sharedWebSockets[m].readyState));
|
|
27796
27808
|
var u = {
|
|
27797
27809
|
setLastMessage: i,
|
|
27798
|
-
setReadyState:
|
|
27810
|
+
setReadyState: d,
|
|
27799
27811
|
optionsRef: n,
|
|
27800
27812
|
reconnectCount: l,
|
|
27801
27813
|
lastMessageTime: t,
|
|
27802
|
-
reconnect:
|
|
27814
|
+
reconnect: p
|
|
27803
27815
|
};
|
|
27804
|
-
return (0, s.addSubscriber)(
|
|
27816
|
+
return (0, s.addSubscriber)(m, u), g(m, u, n, d, b);
|
|
27805
27817
|
} else {
|
|
27806
|
-
if (_.current = n.current.eventSourceOptions ? new EventSource(
|
|
27818
|
+
if (_.current = n.current.eventSourceOptions ? new EventSource(m, n.current.eventSourceOptions) : new WebSocket(m, n.current.protocols), d(r.ReadyState.CONNECTING), !_.current)
|
|
27807
27819
|
throw new Error("WebSocket failed to be created");
|
|
27808
|
-
return (0,
|
|
27820
|
+
return (0, c.attachListeners)(_.current, {
|
|
27809
27821
|
setLastMessage: i,
|
|
27810
|
-
setReadyState:
|
|
27811
|
-
}, n,
|
|
27822
|
+
setReadyState: d
|
|
27823
|
+
}, n, p.current, l, t, y);
|
|
27812
27824
|
}
|
|
27813
27825
|
};
|
|
27814
27826
|
return be.createOrJoinSocket = U, be;
|
|
@@ -27816,8 +27828,8 @@ function Ki() {
|
|
|
27816
27828
|
var Y = {}, Ra;
|
|
27817
27829
|
function Qi() {
|
|
27818
27830
|
return Ra || (Ra = 1, (function(e) {
|
|
27819
|
-
var
|
|
27820
|
-
function
|
|
27831
|
+
var r = Y && Y.__awaiter || function(m, d, n, i) {
|
|
27832
|
+
function p(l) {
|
|
27821
27833
|
return l instanceof n ? l : new n(function(t) {
|
|
27822
27834
|
t(l);
|
|
27823
27835
|
});
|
|
@@ -27838,15 +27850,15 @@ function Qi() {
|
|
|
27838
27850
|
}
|
|
27839
27851
|
}
|
|
27840
27852
|
function u(T) {
|
|
27841
|
-
T.done ? l(T.value) :
|
|
27853
|
+
T.done ? l(T.value) : p(T.value).then(y, b);
|
|
27842
27854
|
}
|
|
27843
|
-
u((i = i.apply(
|
|
27855
|
+
u((i = i.apply(m, d || [])).next());
|
|
27844
27856
|
});
|
|
27845
|
-
},
|
|
27857
|
+
}, c = Y && Y.__generator || function(m, d) {
|
|
27846
27858
|
var n = { label: 0, sent: function() {
|
|
27847
27859
|
if (l[0] & 1) throw l[1];
|
|
27848
27860
|
return l[1];
|
|
27849
|
-
}, trys: [], ops: [] }, i,
|
|
27861
|
+
}, trys: [], ops: [] }, i, p, l, t = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
27850
27862
|
return t.next = y(0), t.throw = y(1), t.return = y(2), typeof Symbol == "function" && (t[Symbol.iterator] = function() {
|
|
27851
27863
|
return this;
|
|
27852
27864
|
}), t;
|
|
@@ -27858,8 +27870,8 @@ function Qi() {
|
|
|
27858
27870
|
function b(u) {
|
|
27859
27871
|
if (i) throw new TypeError("Generator is already executing.");
|
|
27860
27872
|
for (; t && (t = 0, u[0] && (n = 0)), n; ) try {
|
|
27861
|
-
if (i = 1,
|
|
27862
|
-
switch (
|
|
27873
|
+
if (i = 1, p && (l = u[0] & 2 ? p.return : u[0] ? p.throw || ((l = p.return) && l.call(p), 0) : p.next) && !(l = l.call(p, u[1])).done) return l;
|
|
27874
|
+
switch (p = 0, l && (u = [u[0] & 2, l.value]), u[0]) {
|
|
27863
27875
|
case 0:
|
|
27864
27876
|
case 1:
|
|
27865
27877
|
l = u;
|
|
@@ -27867,7 +27879,7 @@ function Qi() {
|
|
|
27867
27879
|
case 4:
|
|
27868
27880
|
return n.label++, { value: u[1], done: !1 };
|
|
27869
27881
|
case 5:
|
|
27870
|
-
n.label++,
|
|
27882
|
+
n.label++, p = u[1], u = [0];
|
|
27871
27883
|
continue;
|
|
27872
27884
|
case 7:
|
|
27873
27885
|
u = n.ops.pop(), n.trys.pop();
|
|
@@ -27892,43 +27904,43 @@ function Qi() {
|
|
|
27892
27904
|
l[2] && n.ops.pop(), n.trys.pop();
|
|
27893
27905
|
continue;
|
|
27894
27906
|
}
|
|
27895
|
-
u =
|
|
27907
|
+
u = d.call(m, n);
|
|
27896
27908
|
} catch (T) {
|
|
27897
|
-
u = [6, T],
|
|
27909
|
+
u = [6, T], p = 0;
|
|
27898
27910
|
} finally {
|
|
27899
27911
|
i = l = 0;
|
|
27900
27912
|
}
|
|
27901
27913
|
if (u[0] & 5) throw u[1];
|
|
27902
27914
|
return { value: u[0] ? u[1] : void 0, done: !0 };
|
|
27903
27915
|
}
|
|
27904
|
-
},
|
|
27905
|
-
if (n || arguments.length === 2) for (var i = 0,
|
|
27906
|
-
(l || !(i in
|
|
27907
|
-
return
|
|
27916
|
+
}, o = Y && Y.__spreadArray || function(m, d, n) {
|
|
27917
|
+
if (n || arguments.length === 2) for (var i = 0, p = d.length, l; i < p; i++)
|
|
27918
|
+
(l || !(i in d)) && (l || (l = Array.prototype.slice.call(d, 0, i)), l[i] = d[i]);
|
|
27919
|
+
return m.concat(l || Array.prototype.slice.call(d));
|
|
27908
27920
|
};
|
|
27909
27921
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.getUrl = void 0;
|
|
27910
|
-
var s = $e(),
|
|
27911
|
-
return new Promise(function(
|
|
27912
|
-
return window.setTimeout(
|
|
27922
|
+
var s = $e(), g = A(), U = function(m) {
|
|
27923
|
+
return new Promise(function(d) {
|
|
27924
|
+
return window.setTimeout(d, m);
|
|
27913
27925
|
});
|
|
27914
|
-
}, _ = function(
|
|
27926
|
+
}, _ = function(m, d) {
|
|
27915
27927
|
for (var n = [], i = 2; i < arguments.length; i++)
|
|
27916
27928
|
n[i - 2] = arguments[i];
|
|
27917
|
-
return
|
|
27929
|
+
return r(void 0, o([m, d], n, !0), void 0, function(p, l, t) {
|
|
27918
27930
|
var y, b, u, T, N, D, h, L;
|
|
27919
|
-
return t === void 0 && (t = 0),
|
|
27931
|
+
return t === void 0 && (t = 0), c(this, function(M) {
|
|
27920
27932
|
switch (M.label) {
|
|
27921
27933
|
case 0:
|
|
27922
|
-
if (typeof
|
|
27934
|
+
if (typeof p != "function") return [3, 10];
|
|
27923
27935
|
M.label = 1;
|
|
27924
27936
|
case 1:
|
|
27925
|
-
return M.trys.push([1, 3, , 9]), [4,
|
|
27937
|
+
return M.trys.push([1, 3, , 9]), [4, p()];
|
|
27926
27938
|
case 2:
|
|
27927
27939
|
return y = M.sent(), [3, 9];
|
|
27928
27940
|
case 3:
|
|
27929
|
-
return M.sent(), l.current.retryOnError ? (b = (D = l.current.reconnectAttempts) !== null && D !== void 0 ? D :
|
|
27941
|
+
return M.sent(), l.current.retryOnError ? (b = (D = l.current.reconnectAttempts) !== null && D !== void 0 ? D : g.DEFAULT_RECONNECT_LIMIT, t < b ? (u = typeof l.current.reconnectInterval == "function" ? l.current.reconnectInterval(t) : l.current.reconnectInterval, [4, U(u ?? g.DEFAULT_RECONNECT_INTERVAL_MS)]) : [3, 5]) : [3, 7];
|
|
27930
27942
|
case 4:
|
|
27931
|
-
return M.sent(), [2, (0, e.getUrl)(
|
|
27943
|
+
return M.sent(), [2, (0, e.getUrl)(p, l, t + 1)];
|
|
27932
27944
|
case 5:
|
|
27933
27945
|
return (L = (h = l.current).onReconnectStop) === null || L === void 0 || L.call(h, t), [2, null];
|
|
27934
27946
|
case 6:
|
|
@@ -27940,7 +27952,7 @@ function Qi() {
|
|
|
27940
27952
|
case 9:
|
|
27941
27953
|
return [3, 11];
|
|
27942
27954
|
case 10:
|
|
27943
|
-
y =
|
|
27955
|
+
y = p, M.label = 11;
|
|
27944
27956
|
case 11:
|
|
27945
27957
|
return T = l.current.fromSocketIO ? (0, s.parseSocketIOUrl)(y) : y, N = l.current.queryParams ? (0, s.appendQueryParams)(T, l.current.queryParams) : T, [2, N];
|
|
27946
27958
|
}
|
|
@@ -27954,19 +27966,19 @@ var Ke = {}, Pa;
|
|
|
27954
27966
|
function ji() {
|
|
27955
27967
|
return Pa || (Pa = 1, (function(e) {
|
|
27956
27968
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.websocketWrapper = void 0;
|
|
27957
|
-
var
|
|
27958
|
-
return new Proxy(
|
|
27959
|
-
get: function(s,
|
|
27960
|
-
var U = s[
|
|
27961
|
-
return
|
|
27969
|
+
var r = function(c, o) {
|
|
27970
|
+
return new Proxy(c, {
|
|
27971
|
+
get: function(s, g) {
|
|
27972
|
+
var U = s[g];
|
|
27973
|
+
return g === "reconnect" ? o : typeof U == "function" ? (console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."), function() {
|
|
27962
27974
|
}) : U;
|
|
27963
27975
|
},
|
|
27964
|
-
set: function(s,
|
|
27965
|
-
return /^on/.test(
|
|
27976
|
+
set: function(s, g, U) {
|
|
27977
|
+
return /^on/.test(g) ? (console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."), !1) : (s[g] = U, !0);
|
|
27966
27978
|
}
|
|
27967
27979
|
});
|
|
27968
27980
|
};
|
|
27969
|
-
e.websocketWrapper =
|
|
27981
|
+
e.websocketWrapper = r, e.default = e.websocketWrapper;
|
|
27970
27982
|
})(Ke)), Ke;
|
|
27971
27983
|
}
|
|
27972
27984
|
var xa;
|
|
@@ -27974,14 +27986,14 @@ function ia() {
|
|
|
27974
27986
|
if (xa) return J;
|
|
27975
27987
|
xa = 1;
|
|
27976
27988
|
var e = J && J.__assign || function() {
|
|
27977
|
-
return e = Object.assign || function(
|
|
27989
|
+
return e = Object.assign || function(p) {
|
|
27978
27990
|
for (var l, t = 1, y = arguments.length; t < y; t++) {
|
|
27979
27991
|
l = arguments[t];
|
|
27980
|
-
for (var b in l) Object.prototype.hasOwnProperty.call(l, b) && (
|
|
27992
|
+
for (var b in l) Object.prototype.hasOwnProperty.call(l, b) && (p[b] = l[b]);
|
|
27981
27993
|
}
|
|
27982
|
-
return
|
|
27994
|
+
return p;
|
|
27983
27995
|
}, e.apply(this, arguments);
|
|
27984
|
-
},
|
|
27996
|
+
}, r = J && J.__awaiter || function(p, l, t, y) {
|
|
27985
27997
|
function b(u) {
|
|
27986
27998
|
return u instanceof t ? u : new t(function(T) {
|
|
27987
27999
|
T(u);
|
|
@@ -28005,9 +28017,9 @@ function ia() {
|
|
|
28005
28017
|
function h(L) {
|
|
28006
28018
|
L.done ? u(L.value) : b(L.value).then(N, D);
|
|
28007
28019
|
}
|
|
28008
|
-
h((y = y.apply(
|
|
28020
|
+
h((y = y.apply(p, l || [])).next());
|
|
28009
28021
|
});
|
|
28010
|
-
},
|
|
28022
|
+
}, c = J && J.__generator || function(p, l) {
|
|
28011
28023
|
var t = { label: 0, sent: function() {
|
|
28012
28024
|
if (u[0] & 1) throw u[1];
|
|
28013
28025
|
return u[1];
|
|
@@ -28057,7 +28069,7 @@ function ia() {
|
|
|
28057
28069
|
u[2] && t.ops.pop(), t.trys.pop();
|
|
28058
28070
|
continue;
|
|
28059
28071
|
}
|
|
28060
|
-
h = l.call(
|
|
28072
|
+
h = l.call(p, t);
|
|
28061
28073
|
} catch (L) {
|
|
28062
28074
|
h = [6, L], b = 0;
|
|
28063
28075
|
} finally {
|
|
@@ -28066,11 +28078,11 @@ function ia() {
|
|
|
28066
28078
|
if (h[0] & 5) throw h[1];
|
|
28067
28079
|
return { value: h[0] ? h[1] : void 0, done: !0 };
|
|
28068
28080
|
}
|
|
28069
|
-
},
|
|
28070
|
-
return
|
|
28081
|
+
}, o = J && J.__importDefault || function(p) {
|
|
28082
|
+
return p && p.__esModule ? p : { default: p };
|
|
28071
28083
|
};
|
|
28072
28084
|
Object.defineProperty(J, "__esModule", { value: !0 }), J.useWebSocket = void 0;
|
|
28073
|
-
var s = ve,
|
|
28085
|
+
var s = ve, g = hi, U = A(), _ = Ki(), m = Qi(), d = o(ji()), n = aa(), i = function(p, l, t) {
|
|
28074
28086
|
l === void 0 && (l = U.DEFAULT_OPTIONS), t === void 0 && (t = !0);
|
|
28075
28087
|
var y = (0, s.useState)(null), b = y[0], u = y[1], T = (0, s.useState)({}), N = T[0], D = T[1], h = (0, s.useMemo)(function() {
|
|
28076
28088
|
if (!l.disableJson && b)
|
|
@@ -28083,7 +28095,7 @@ function ia() {
|
|
|
28083
28095
|
}, [b, l.disableJson]), L = (0, s.useRef)(null), M = (0, s.useRef)(null), de = (0, s.useRef)(function() {
|
|
28084
28096
|
}), ce = (0, s.useRef)(0), we = (0, s.useRef)(Date.now()), he = (0, s.useRef)([]), V = (0, s.useRef)(null), H = (0, s.useRef)(l);
|
|
28085
28097
|
H.current = l;
|
|
28086
|
-
var Z = L.current && N[L.current] !== void 0 ? N[L.current] :
|
|
28098
|
+
var Z = L.current && N[L.current] !== void 0 ? N[L.current] : p !== null && t === !0 ? U.ReadyState.CONNECTING : U.ReadyState.UNINSTANTIATED, ae = l.queryParams ? JSON.stringify(l.queryParams) : null, B = (0, s.useCallback)(function(x, w) {
|
|
28087
28099
|
var K;
|
|
28088
28100
|
if (w === void 0 && (w = !0), U.isEventSourceSupported && M.current instanceof EventSource) {
|
|
28089
28101
|
console.warn("Unable to send a message from an eventSource");
|
|
@@ -28093,37 +28105,37 @@ function ia() {
|
|
|
28093
28105
|
}, []), ke = (0, s.useCallback)(function(x, w) {
|
|
28094
28106
|
w === void 0 && (w = !0), B(JSON.stringify(x), w);
|
|
28095
28107
|
}, [B]), Se = (0, s.useCallback)(function() {
|
|
28096
|
-
return H.current.share !== !0 || U.isEventSourceSupported && M.current instanceof EventSource ? M.current : (V.current === null && M.current && ((0, n.assertIsWebSocket)(M.current, H.current.skipAssert), V.current = (0,
|
|
28108
|
+
return H.current.share !== !0 || U.isEventSourceSupported && M.current instanceof EventSource ? M.current : (V.current === null && M.current && ((0, n.assertIsWebSocket)(M.current, H.current.skipAssert), V.current = (0, d.default)(M.current, de)), V.current);
|
|
28097
28109
|
}, []);
|
|
28098
28110
|
return (0, s.useEffect)(function() {
|
|
28099
|
-
if (
|
|
28111
|
+
if (p !== null && t === !0) {
|
|
28100
28112
|
var x, w = !1, K = !0, _e = function() {
|
|
28101
|
-
return
|
|
28102
|
-
var
|
|
28103
|
-
return
|
|
28113
|
+
return r(void 0, void 0, void 0, function() {
|
|
28114
|
+
var ie, $, Ne;
|
|
28115
|
+
return c(this, function(se) {
|
|
28104
28116
|
switch (se.label) {
|
|
28105
28117
|
case 0:
|
|
28106
|
-
return
|
|
28118
|
+
return ie = L, [4, (0, m.getUrl)(p, H)];
|
|
28107
28119
|
case 1:
|
|
28108
|
-
return
|
|
28120
|
+
return ie.current = se.sent(), L.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), L.current = "ABORTED", (0, g.flushSync)(function() {
|
|
28109
28121
|
return D(function(Q) {
|
|
28110
28122
|
return e(e({}, Q), { ABORTED: U.ReadyState.CLOSED });
|
|
28111
28123
|
});
|
|
28112
28124
|
}), [
|
|
28113
28125
|
2
|
|
28114
28126
|
/*return*/
|
|
28115
|
-
]) : (
|
|
28116
|
-
w || (0,
|
|
28127
|
+
]) : ($ = function(Q) {
|
|
28128
|
+
w || (0, g.flushSync)(function() {
|
|
28117
28129
|
return u(Q);
|
|
28118
28130
|
});
|
|
28119
28131
|
}, Ne = function(Q) {
|
|
28120
|
-
w || (0,
|
|
28132
|
+
w || (0, g.flushSync)(function() {
|
|
28121
28133
|
return D(function(ue) {
|
|
28122
|
-
var
|
|
28123
|
-
return e(e({}, ue), L.current && (
|
|
28134
|
+
var le;
|
|
28135
|
+
return e(e({}, ue), L.current && (le = {}, le[L.current] = Q, le));
|
|
28124
28136
|
});
|
|
28125
28137
|
});
|
|
28126
|
-
}, K && (x = (0, _.createOrJoinSocket)(M, L.current, Ne, H,
|
|
28138
|
+
}, K && (x = (0, _.createOrJoinSocket)(M, L.current, Ne, H, $, de, ce, we, B)), [
|
|
28127
28139
|
2
|
|
28128
28140
|
/*return*/
|
|
28129
28141
|
]);
|
|
@@ -28136,11 +28148,11 @@ function ia() {
|
|
|
28136
28148
|
}, _e(), function() {
|
|
28137
28149
|
w = !0, K = !1, V.current && (V.current = null), x?.(), u(null);
|
|
28138
28150
|
};
|
|
28139
|
-
} else (
|
|
28140
|
-
var
|
|
28141
|
-
return e(e({},
|
|
28151
|
+
} else (p === null || t === !1) && (ce.current = 0, D(function(ie) {
|
|
28152
|
+
var $;
|
|
28153
|
+
return e(e({}, ie), L.current && ($ = {}, $[L.current] = U.ReadyState.CLOSED, $));
|
|
28142
28154
|
}));
|
|
28143
|
-
}, [
|
|
28155
|
+
}, [p, t, ae, B]), (0, s.useEffect)(function() {
|
|
28144
28156
|
Z === U.ReadyState.OPEN && he.current.splice(0).forEach(function(x) {
|
|
28145
28157
|
B(x);
|
|
28146
28158
|
});
|
|
@@ -28155,43 +28167,43 @@ function ia() {
|
|
|
28155
28167
|
};
|
|
28156
28168
|
return J.useWebSocket = i, J;
|
|
28157
28169
|
}
|
|
28158
|
-
var
|
|
28170
|
+
var re = {}, Oa;
|
|
28159
28171
|
function Yi() {
|
|
28160
|
-
if (Oa) return
|
|
28172
|
+
if (Oa) return re;
|
|
28161
28173
|
Oa = 1;
|
|
28162
|
-
var e =
|
|
28174
|
+
var e = re && re.__assign || function() {
|
|
28163
28175
|
return e = Object.assign || function(_) {
|
|
28164
|
-
for (var
|
|
28165
|
-
|
|
28166
|
-
for (var i in
|
|
28176
|
+
for (var m, d = 1, n = arguments.length; d < n; d++) {
|
|
28177
|
+
m = arguments[d];
|
|
28178
|
+
for (var i in m) Object.prototype.hasOwnProperty.call(m, i) && (_[i] = m[i]);
|
|
28167
28179
|
}
|
|
28168
28180
|
return _;
|
|
28169
28181
|
}, e.apply(this, arguments);
|
|
28170
28182
|
};
|
|
28171
|
-
Object.defineProperty(
|
|
28172
|
-
var
|
|
28183
|
+
Object.defineProperty(re, "__esModule", { value: !0 }), re.useSocketIO = void 0;
|
|
28184
|
+
var r = ve, c = ia(), o = A(), s = {
|
|
28173
28185
|
type: "empty",
|
|
28174
28186
|
payload: null
|
|
28175
|
-
},
|
|
28187
|
+
}, g = function(_) {
|
|
28176
28188
|
if (!_ || !_.data)
|
|
28177
28189
|
return s;
|
|
28178
|
-
var
|
|
28179
|
-
if (!
|
|
28190
|
+
var m = _.data.match(/\[.*]/);
|
|
28191
|
+
if (!m)
|
|
28180
28192
|
return s;
|
|
28181
|
-
var
|
|
28182
|
-
return !Array.isArray(
|
|
28183
|
-
type:
|
|
28184
|
-
payload:
|
|
28193
|
+
var d = JSON.parse(m);
|
|
28194
|
+
return !Array.isArray(d) || !d[1] ? s : {
|
|
28195
|
+
type: d[0],
|
|
28196
|
+
payload: d[1]
|
|
28185
28197
|
};
|
|
28186
|
-
}, U = function(_,
|
|
28187
|
-
|
|
28188
|
-
var n = (0,
|
|
28189
|
-
return e(e({},
|
|
28190
|
-
}, []), i = (0,
|
|
28191
|
-
return
|
|
28198
|
+
}, U = function(_, m, d) {
|
|
28199
|
+
m === void 0 && (m = o.DEFAULT_OPTIONS), d === void 0 && (d = !0);
|
|
28200
|
+
var n = (0, r.useMemo)(function() {
|
|
28201
|
+
return e(e({}, m), { fromSocketIO: !0 });
|
|
28202
|
+
}, []), i = (0, c.useWebSocket)(_, n, d), p = i.sendMessage, l = i.sendJsonMessage, t = i.lastMessage, y = i.readyState, b = i.getWebSocket, u = (0, r.useMemo)(function() {
|
|
28203
|
+
return g(t);
|
|
28192
28204
|
}, [t]);
|
|
28193
28205
|
return {
|
|
28194
|
-
sendMessage:
|
|
28206
|
+
sendMessage: p,
|
|
28195
28207
|
sendJsonMessage: l,
|
|
28196
28208
|
lastMessage: u,
|
|
28197
28209
|
lastJsonMessage: u,
|
|
@@ -28199,7 +28211,7 @@ function Yi() {
|
|
|
28199
28211
|
getWebSocket: b
|
|
28200
28212
|
};
|
|
28201
28213
|
};
|
|
28202
|
-
return
|
|
28214
|
+
return re.useSocketIO = U, re;
|
|
28203
28215
|
}
|
|
28204
28216
|
var q = {}, Ha;
|
|
28205
28217
|
function qi() {
|
|
@@ -28207,31 +28219,31 @@ function qi() {
|
|
|
28207
28219
|
Ha = 1;
|
|
28208
28220
|
var e = q && q.__assign || function() {
|
|
28209
28221
|
return e = Object.assign || function(U) {
|
|
28210
|
-
for (var _,
|
|
28211
|
-
_ = arguments[
|
|
28222
|
+
for (var _, m = 1, d = arguments.length; m < d; m++) {
|
|
28223
|
+
_ = arguments[m];
|
|
28212
28224
|
for (var n in _) Object.prototype.hasOwnProperty.call(_, n) && (U[n] = _[n]);
|
|
28213
28225
|
}
|
|
28214
28226
|
return U;
|
|
28215
28227
|
}, e.apply(this, arguments);
|
|
28216
|
-
},
|
|
28217
|
-
var
|
|
28218
|
-
for (var
|
|
28228
|
+
}, r = q && q.__rest || function(U, _) {
|
|
28229
|
+
var m = {};
|
|
28230
|
+
for (var d in U) Object.prototype.hasOwnProperty.call(U, d) && _.indexOf(d) < 0 && (m[d] = U[d]);
|
|
28219
28231
|
if (U != null && typeof Object.getOwnPropertySymbols == "function")
|
|
28220
|
-
for (var n = 0,
|
|
28221
|
-
_.indexOf(
|
|
28222
|
-
return
|
|
28232
|
+
for (var n = 0, d = Object.getOwnPropertySymbols(U); n < d.length; n++)
|
|
28233
|
+
_.indexOf(d[n]) < 0 && Object.prototype.propertyIsEnumerable.call(U, d[n]) && (m[d[n]] = U[d[n]]);
|
|
28234
|
+
return m;
|
|
28223
28235
|
};
|
|
28224
28236
|
Object.defineProperty(q, "__esModule", { value: !0 }), q.useEventSource = void 0;
|
|
28225
|
-
var
|
|
28237
|
+
var c = ve, o = ia(), s = A(), g = function(U, _, m) {
|
|
28226
28238
|
_ === void 0 && (_ = s.DEFAULT_EVENT_SOURCE_OPTIONS);
|
|
28227
|
-
var
|
|
28228
|
-
|
|
28229
|
-
var
|
|
28230
|
-
withCredentials:
|
|
28231
|
-
} }), l = (0,
|
|
28239
|
+
var d = _.withCredentials, n = _.events, i = r(_, ["withCredentials", "events"]);
|
|
28240
|
+
m === void 0 && (m = !0);
|
|
28241
|
+
var p = e(e({}, i), { eventSourceOptions: {
|
|
28242
|
+
withCredentials: d
|
|
28243
|
+
} }), l = (0, c.useRef)(s.EMPTY_EVENT_HANDLERS);
|
|
28232
28244
|
n && (l.current = n);
|
|
28233
|
-
var t = (0,
|
|
28234
|
-
return (0,
|
|
28245
|
+
var t = (0, o.useWebSocket)(U, p, m), y = t.lastMessage, b = t.readyState, u = t.getWebSocket;
|
|
28246
|
+
return (0, c.useEffect)(function() {
|
|
28235
28247
|
y?.type && Object.entries(l.current).forEach(function(T) {
|
|
28236
28248
|
var N = T[0], D = T[1];
|
|
28237
28249
|
N === y.type && D(y);
|
|
@@ -28242,31 +28254,31 @@ function qi() {
|
|
|
28242
28254
|
getEventSource: u
|
|
28243
28255
|
};
|
|
28244
28256
|
};
|
|
28245
|
-
return q.useEventSource =
|
|
28257
|
+
return q.useEventSource = g, q;
|
|
28246
28258
|
}
|
|
28247
28259
|
var wa;
|
|
28248
28260
|
function Xi() {
|
|
28249
28261
|
return wa || (wa = 1, (function(e) {
|
|
28250
28262
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetGlobalState = e.useEventSource = e.ReadyState = e.useSocketIO = e.default = void 0;
|
|
28251
|
-
var
|
|
28263
|
+
var r = ia();
|
|
28252
28264
|
Object.defineProperty(e, "default", { enumerable: !0, get: function() {
|
|
28253
|
-
return
|
|
28265
|
+
return r.useWebSocket;
|
|
28254
28266
|
} });
|
|
28255
|
-
var
|
|
28267
|
+
var c = Yi();
|
|
28256
28268
|
Object.defineProperty(e, "useSocketIO", { enumerable: !0, get: function() {
|
|
28257
|
-
return
|
|
28269
|
+
return c.useSocketIO;
|
|
28258
28270
|
} });
|
|
28259
|
-
var
|
|
28271
|
+
var o = A();
|
|
28260
28272
|
Object.defineProperty(e, "ReadyState", { enumerable: !0, get: function() {
|
|
28261
|
-
return
|
|
28273
|
+
return o.ReadyState;
|
|
28262
28274
|
} });
|
|
28263
28275
|
var s = qi();
|
|
28264
28276
|
Object.defineProperty(e, "useEventSource", { enumerable: !0, get: function() {
|
|
28265
28277
|
return s.useEventSource;
|
|
28266
28278
|
} });
|
|
28267
|
-
var
|
|
28279
|
+
var g = aa();
|
|
28268
28280
|
Object.defineProperty(e, "resetGlobalState", { enumerable: !0, get: function() {
|
|
28269
|
-
return
|
|
28281
|
+
return g.resetGlobalState;
|
|
28270
28282
|
} });
|
|
28271
28283
|
})(Ve)), Ve;
|
|
28272
28284
|
}
|
|
@@ -28284,28 +28296,28 @@ const el = /* @__PURE__ */ ki($i), I = {
|
|
|
28284
28296
|
CASH_REGISTER_LIMIT: "cash_register_limit"
|
|
28285
28297
|
}, al = 3e4, _l = ({
|
|
28286
28298
|
socketUrl: e,
|
|
28287
|
-
socketHandlers:
|
|
28288
|
-
options:
|
|
28299
|
+
socketHandlers: r = {},
|
|
28300
|
+
options: c = {}
|
|
28289
28301
|
}) => {
|
|
28290
|
-
const
|
|
28291
|
-
sendMessage:
|
|
28302
|
+
const o = ya(!1), s = ya(r), {
|
|
28303
|
+
sendMessage: g,
|
|
28292
28304
|
// 發送普通訊息
|
|
28293
28305
|
sendJsonMessage: U,
|
|
28294
28306
|
// 發送 JSON 訊息
|
|
28295
28307
|
lastMessage: _,
|
|
28296
28308
|
// 最後接收到的訊息
|
|
28297
28309
|
// lastJsonMessage, // 最後接收到的 JSON 訊息
|
|
28298
|
-
readyState:
|
|
28310
|
+
readyState: m
|
|
28299
28311
|
// WebSocket 連線狀態
|
|
28300
28312
|
// getWebSocket, // 獲取 WebSocket 實例
|
|
28301
28313
|
} = el(e, {
|
|
28302
28314
|
queryParams: { key: "wsky" },
|
|
28303
28315
|
onOpen: () => console.log("連線成功"),
|
|
28304
|
-
shouldReconnect: () =>
|
|
28316
|
+
shouldReconnect: () => o.current === !1,
|
|
28305
28317
|
reconnectAttempts: 9999,
|
|
28306
28318
|
reconnectInterval: 1e3,
|
|
28307
|
-
...
|
|
28308
|
-
}),
|
|
28319
|
+
...c
|
|
28320
|
+
}), d = Qe(() => {
|
|
28309
28321
|
try {
|
|
28310
28322
|
return JSON.parse(_?.data);
|
|
28311
28323
|
} catch {
|
|
@@ -28314,28 +28326,28 @@ const el = /* @__PURE__ */ ki($i), I = {
|
|
|
28314
28326
|
}, [_?.data]);
|
|
28315
28327
|
return Ce(() => {
|
|
28316
28328
|
const n = setInterval(
|
|
28317
|
-
() =>
|
|
28329
|
+
() => g("ping"),
|
|
28318
28330
|
al
|
|
28319
28331
|
);
|
|
28320
28332
|
return () => clearInterval(n);
|
|
28321
|
-
}, [
|
|
28322
|
-
s.current =
|
|
28323
|
-
}, [
|
|
28324
|
-
if (!
|
|
28333
|
+
}, [g]), Ce(() => {
|
|
28334
|
+
s.current = r;
|
|
28335
|
+
}, [r]), Ce(() => {
|
|
28336
|
+
if (!d) return;
|
|
28325
28337
|
const {
|
|
28326
28338
|
onDeposit: n,
|
|
28327
28339
|
onTransCode: i,
|
|
28328
|
-
onError:
|
|
28340
|
+
onError: p,
|
|
28329
28341
|
onUpdateMember: l,
|
|
28330
28342
|
onMaintainNotice: t,
|
|
28331
28343
|
onMaintainNoticeMember: y,
|
|
28332
28344
|
onReload: b,
|
|
28333
28345
|
onTransferInGame: u,
|
|
28334
28346
|
onCashRegisterLimit: T
|
|
28335
|
-
} = s.current, N = Ge(
|
|
28336
|
-
memberInfoUid: Ge(
|
|
28337
|
-
data: Ge(
|
|
28338
|
-
memo: Ge(
|
|
28347
|
+
} = s.current, N = Ge(d, "type", ""), D = {
|
|
28348
|
+
memberInfoUid: Ge(d, "member_info_uid", null),
|
|
28349
|
+
data: Ge(d, "data", null),
|
|
28350
|
+
memo: Ge(d, "memo", null)
|
|
28339
28351
|
};
|
|
28340
28352
|
switch (N) {
|
|
28341
28353
|
case I.DEPOSIT:
|
|
@@ -28345,7 +28357,7 @@ const el = /* @__PURE__ */ ki($i), I = {
|
|
|
28345
28357
|
i?.(D);
|
|
28346
28358
|
break;
|
|
28347
28359
|
case I.ERROR:
|
|
28348
|
-
|
|
28360
|
+
p?.(D);
|
|
28349
28361
|
break;
|
|
28350
28362
|
case I.UPDATE_MEMBER:
|
|
28351
28363
|
l?.(D);
|
|
@@ -28370,18 +28382,18 @@ const el = /* @__PURE__ */ ki($i), I = {
|
|
|
28370
28382
|
console.warn("Unknown socket type:", N);
|
|
28371
28383
|
break;
|
|
28372
28384
|
}
|
|
28373
|
-
}, [
|
|
28374
|
-
sendMessage:
|
|
28385
|
+
}, [d]), Ce(() => () => o.current = !0, []), {
|
|
28386
|
+
sendMessage: g,
|
|
28375
28387
|
sendJsonMessage: U,
|
|
28376
|
-
readyState:
|
|
28388
|
+
readyState: m
|
|
28377
28389
|
// WebSocket 連線狀態
|
|
28378
28390
|
};
|
|
28379
28391
|
}, Qa = () => {
|
|
28380
|
-
const { client: e } = Oe(),
|
|
28381
|
-
const { data:
|
|
28382
|
-
return
|
|
28383
|
-
}, [e]),
|
|
28384
|
-
return { commonCarouselApi:
|
|
28392
|
+
const { client: e } = Oe(), r = X(async () => {
|
|
28393
|
+
const { data: o } = await e.get("/carousels");
|
|
28394
|
+
return o;
|
|
28395
|
+
}, [e]), c = X(async () => await e.get("/marquees"), [e]);
|
|
28396
|
+
return { commonCarouselApi: r, commonMarqueeApi: c };
|
|
28385
28397
|
}, fl = () => {
|
|
28386
28398
|
const { commonCarouselApi: e } = Qa();
|
|
28387
28399
|
return oe({
|
|
@@ -28393,7 +28405,7 @@ const el = /* @__PURE__ */ ki($i), I = {
|
|
|
28393
28405
|
return oe({
|
|
28394
28406
|
queryKey: ["getMarqueeList"],
|
|
28395
28407
|
queryFn: async () => e(),
|
|
28396
|
-
select: (
|
|
28408
|
+
select: (r) => r.Marquees
|
|
28397
28409
|
});
|
|
28398
28410
|
};
|
|
28399
28411
|
export {
|