@obb871001/api-integration-sdk 1.0.58 → 1.0.59
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 +7 -7
- package/dist/index.js +754 -742
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import me, { createContext as
|
|
2
|
-
import { QueryClient as
|
|
3
|
-
import
|
|
4
|
-
import { find as $e, isEmpty as
|
|
5
|
-
import
|
|
6
|
-
function
|
|
1
|
+
import me, { createContext as _t, useContext as St, useMemo as Ve, useCallback as oe, useRef as _r, useEffect as Pe } from "react";
|
|
2
|
+
import { QueryClient as ht, QueryClientProvider as bt, useQueries as Ur, useQuery as fe } from "@tanstack/react-query";
|
|
3
|
+
import gt from "axios";
|
|
4
|
+
import { find as $e, isEmpty as F, isArray as de, isObject as jr, flatMap as Ke, map as Ye, get as Ie } from "lodash";
|
|
5
|
+
import mt from "react-dom";
|
|
6
|
+
function pt(e) {
|
|
7
7
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
8
8
|
}
|
|
9
|
-
var
|
|
9
|
+
var ke = { exports: {} }, Se = {};
|
|
10
10
|
var Sr;
|
|
11
|
-
function
|
|
11
|
+
function Ot() {
|
|
12
12
|
if (Sr) return Se;
|
|
13
13
|
Sr = 1;
|
|
14
|
-
var e = me,
|
|
15
|
-
function
|
|
16
|
-
var u,
|
|
17
|
-
|
|
18
|
-
for (u in o)
|
|
19
|
-
if (
|
|
20
|
-
return { $$typeof:
|
|
14
|
+
var e = me, s = Symbol.for("react.element"), h = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, f = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
15
|
+
function _(v, o, l) {
|
|
16
|
+
var u, t = {}, i = null, n = null;
|
|
17
|
+
l !== void 0 && (i = "" + l), o.key !== void 0 && (i = "" + o.key), o.ref !== void 0 && (n = o.ref);
|
|
18
|
+
for (u in o) d.call(o, u) && !y.hasOwnProperty(u) && (t[u] = o[u]);
|
|
19
|
+
if (v && v.defaultProps) for (u in o = v.defaultProps, o) t[u] === void 0 && (t[u] = o[u]);
|
|
20
|
+
return { $$typeof: s, type: v, key: i, ref: n, props: t, _owner: f.current };
|
|
21
21
|
}
|
|
22
|
-
return Se.Fragment =
|
|
22
|
+
return Se.Fragment = h, Se.jsx = _, Se.jsxs = _, Se;
|
|
23
23
|
}
|
|
24
24
|
var he = {};
|
|
25
25
|
var hr;
|
|
26
|
-
function
|
|
26
|
+
function Tt() {
|
|
27
27
|
return hr || (hr = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
28
|
-
var e = me,
|
|
29
|
-
function
|
|
28
|
+
var e = me, s = Symbol.for("react.element"), h = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), v = Symbol.for("react.context"), o = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), t = Symbol.for("react.memo"), i = Symbol.for("react.lazy"), n = Symbol.for("react.offscreen"), a = Symbol.iterator, S = "@@iterator";
|
|
29
|
+
function b(r) {
|
|
30
30
|
if (r === null || typeof r != "object")
|
|
31
31
|
return null;
|
|
32
|
-
var
|
|
33
|
-
return typeof
|
|
32
|
+
var E = a && r[a] || r[S];
|
|
33
|
+
return typeof E == "function" ? E : null;
|
|
34
34
|
}
|
|
35
35
|
var c = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
36
36
|
function g(r) {
|
|
37
37
|
{
|
|
38
|
-
for (var
|
|
38
|
+
for (var E = arguments.length, m = new Array(E > 1 ? E - 1 : 0), p = 1; p < E; p++)
|
|
39
39
|
m[p - 1] = arguments[p];
|
|
40
40
|
R("error", r, m);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function R(r,
|
|
43
|
+
function R(r, E, m) {
|
|
44
44
|
{
|
|
45
45
|
var p = c.ReactDebugCurrentFrame, w = p.getStackAddendum();
|
|
46
|
-
w !== "" && (
|
|
46
|
+
w !== "" && (E += "%s", m = m.concat([w]));
|
|
47
47
|
var I = m.map(function(C) {
|
|
48
48
|
return String(C);
|
|
49
49
|
});
|
|
50
|
-
I.unshift("Warning: " +
|
|
50
|
+
I.unshift("Warning: " + E), Function.prototype.apply.call(console[r], console, I);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
var P = !1, O = !1, A = !1,
|
|
53
|
+
var P = !1, O = !1, A = !1, k = !1, ve = !1, Ee;
|
|
54
54
|
Ee = Symbol.for("react.module.reference");
|
|
55
55
|
function De(r) {
|
|
56
|
-
return !!(typeof r == "string" || typeof r == "function" || r ===
|
|
56
|
+
return !!(typeof r == "string" || typeof r == "function" || r === d || r === y || ve || r === f || r === l || r === u || k || r === n || P || O || A || typeof r == "object" && r !== null && (r.$$typeof === i || r.$$typeof === t || r.$$typeof === _ || r.$$typeof === v || r.$$typeof === o || // 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.
|
|
60
60
|
r.$$typeof === Ee || r.getModuleId !== void 0));
|
|
61
61
|
}
|
|
62
|
-
function pe(r,
|
|
62
|
+
function pe(r, E, m) {
|
|
63
63
|
var p = r.displayName;
|
|
64
64
|
if (p)
|
|
65
65
|
return p;
|
|
66
|
-
var w =
|
|
66
|
+
var w = E.displayName || E.name || "";
|
|
67
67
|
return w !== "" ? m + "(" + w + ")" : m;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function B(r) {
|
|
70
70
|
return r.displayName || "Context";
|
|
71
71
|
}
|
|
72
72
|
function L(r) {
|
|
@@ -77,30 +77,30 @@ function gt() {
|
|
|
77
77
|
if (typeof r == "string")
|
|
78
78
|
return r;
|
|
79
79
|
switch (r) {
|
|
80
|
-
case
|
|
80
|
+
case d:
|
|
81
81
|
return "Fragment";
|
|
82
|
-
case
|
|
82
|
+
case h:
|
|
83
83
|
return "Portal";
|
|
84
|
-
case
|
|
84
|
+
case y:
|
|
85
85
|
return "Profiler";
|
|
86
86
|
case f:
|
|
87
87
|
return "StrictMode";
|
|
88
|
-
case
|
|
88
|
+
case l:
|
|
89
89
|
return "Suspense";
|
|
90
90
|
case u:
|
|
91
91
|
return "SuspenseList";
|
|
92
92
|
}
|
|
93
93
|
if (typeof r == "object")
|
|
94
94
|
switch (r.$$typeof) {
|
|
95
|
-
case
|
|
96
|
-
var
|
|
97
|
-
return
|
|
98
|
-
case
|
|
95
|
+
case v:
|
|
96
|
+
var E = r;
|
|
97
|
+
return B(E) + ".Consumer";
|
|
98
|
+
case _:
|
|
99
99
|
var m = r;
|
|
100
|
-
return
|
|
100
|
+
return B(m._context) + ".Provider";
|
|
101
101
|
case o:
|
|
102
102
|
return pe(r, r.render, "ForwardRef");
|
|
103
|
-
case
|
|
103
|
+
case t:
|
|
104
104
|
var p = r.displayName || null;
|
|
105
105
|
return p !== null ? p : L(r.type) || "Memo";
|
|
106
106
|
case i: {
|
|
@@ -177,7 +177,7 @@ function gt() {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
var ce = c.ReactCurrentDispatcher, Y;
|
|
180
|
-
function ie(r,
|
|
180
|
+
function ie(r, E, m) {
|
|
181
181
|
{
|
|
182
182
|
if (Y === void 0)
|
|
183
183
|
try {
|
|
@@ -192,10 +192,10 @@ function gt() {
|
|
|
192
192
|
}
|
|
193
193
|
var re = !1, Re;
|
|
194
194
|
{
|
|
195
|
-
var
|
|
196
|
-
Re = new
|
|
195
|
+
var Vr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
196
|
+
Re = new Vr();
|
|
197
197
|
}
|
|
198
|
-
function rr(r,
|
|
198
|
+
function rr(r, E) {
|
|
199
199
|
if (!r || re)
|
|
200
200
|
return "";
|
|
201
201
|
{
|
|
@@ -210,7 +210,7 @@ function gt() {
|
|
|
210
210
|
var I;
|
|
211
211
|
I = ce.current, ce.current = null, X();
|
|
212
212
|
try {
|
|
213
|
-
if (
|
|
213
|
+
if (E) {
|
|
214
214
|
var C = function() {
|
|
215
215
|
throw Error();
|
|
216
216
|
};
|
|
@@ -245,18 +245,18 @@ function gt() {
|
|
|
245
245
|
if (W && p && typeof W.stack == "string") {
|
|
246
246
|
for (var T = W.stack.split(`
|
|
247
247
|
`), j = p.stack.split(`
|
|
248
|
-
`),
|
|
248
|
+
`), N = T.length - 1, M = j.length - 1; N >= 1 && M >= 0 && T[N] !== j[M]; )
|
|
249
249
|
M--;
|
|
250
|
-
for (;
|
|
251
|
-
if (T[
|
|
252
|
-
if (
|
|
250
|
+
for (; N >= 1 && M >= 0; N--, M--)
|
|
251
|
+
if (T[N] !== j[M]) {
|
|
252
|
+
if (N !== 1 || M !== 1)
|
|
253
253
|
do
|
|
254
|
-
if (
|
|
255
|
-
var
|
|
256
|
-
` + T[
|
|
257
|
-
return r.displayName &&
|
|
254
|
+
if (N--, M--, M < 0 || T[N] !== j[M]) {
|
|
255
|
+
var G = `
|
|
256
|
+
` + T[N].replace(" at new ", " at ");
|
|
257
|
+
return r.displayName && G.includes("<anonymous>") && (G = G.replace("<anonymous>", r.displayName)), typeof r == "function" && Re.set(r, G), G;
|
|
258
258
|
}
|
|
259
|
-
while (
|
|
259
|
+
while (N >= 1 && M >= 0);
|
|
260
260
|
break;
|
|
261
261
|
}
|
|
262
262
|
}
|
|
@@ -266,22 +266,22 @@ function gt() {
|
|
|
266
266
|
var le = r ? r.displayName || r.name : "", te = le ? ie(le) : "";
|
|
267
267
|
return typeof r == "function" && Re.set(r, te), te;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function $r(r, E, m) {
|
|
270
270
|
return rr(r, !1);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
var
|
|
274
|
-
return !!(
|
|
272
|
+
function Kr(r) {
|
|
273
|
+
var E = r.prototype;
|
|
274
|
+
return !!(E && E.isReactComponent);
|
|
275
275
|
}
|
|
276
|
-
function we(r,
|
|
276
|
+
function we(r, E, m) {
|
|
277
277
|
if (r == null)
|
|
278
278
|
return "";
|
|
279
279
|
if (typeof r == "function")
|
|
280
|
-
return rr(r,
|
|
280
|
+
return rr(r, Kr(r));
|
|
281
281
|
if (typeof r == "string")
|
|
282
282
|
return ie(r);
|
|
283
283
|
switch (r) {
|
|
284
|
-
case
|
|
284
|
+
case l:
|
|
285
285
|
return ie("Suspense");
|
|
286
286
|
case u:
|
|
287
287
|
return ie("SuspenseList");
|
|
@@ -289,13 +289,13 @@ function gt() {
|
|
|
289
289
|
if (typeof r == "object")
|
|
290
290
|
switch (r.$$typeof) {
|
|
291
291
|
case o:
|
|
292
|
-
return
|
|
293
|
-
case
|
|
294
|
-
return we(r.type,
|
|
292
|
+
return $r(r.render);
|
|
293
|
+
case t:
|
|
294
|
+
return we(r.type, E, m);
|
|
295
295
|
case i: {
|
|
296
296
|
var p = r, w = p._payload, I = p._init;
|
|
297
297
|
try {
|
|
298
|
-
return we(I(w),
|
|
298
|
+
return we(I(w), E, m);
|
|
299
299
|
} catch {
|
|
300
300
|
}
|
|
301
301
|
}
|
|
@@ -305,12 +305,12 @@ function gt() {
|
|
|
305
305
|
var _e = Object.prototype.hasOwnProperty, tr = {}, nr = c.ReactDebugCurrentFrame;
|
|
306
306
|
function Ae(r) {
|
|
307
307
|
if (r) {
|
|
308
|
-
var
|
|
308
|
+
var E = r._owner, m = we(r.type, r._source, E ? E.type : null);
|
|
309
309
|
nr.setExtraStackFrame(m);
|
|
310
310
|
} else
|
|
311
311
|
nr.setExtraStackFrame(null);
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Yr(r, E, m, p, w) {
|
|
314
314
|
{
|
|
315
315
|
var I = Function.call.bind(_e);
|
|
316
316
|
for (var C in r)
|
|
@@ -321,25 +321,25 @@ function gt() {
|
|
|
321
321
|
var j = Error((p || "React class") + ": " + m + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
322
322
|
throw j.name = "Invariant Violation", j;
|
|
323
323
|
}
|
|
324
|
-
T = r[C](
|
|
325
|
-
} catch (
|
|
326
|
-
T =
|
|
324
|
+
T = r[C](E, C, p, m, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
325
|
+
} catch (N) {
|
|
326
|
+
T = N;
|
|
327
327
|
}
|
|
328
328
|
T && !(T instanceof Error) && (Ae(w), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", m, C, typeof T), Ae(null)), T instanceof Error && !(T.message in tr) && (tr[T.message] = !0, Ae(w), g("Failed %s type: %s", m, T.message), Ae(null));
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
var
|
|
332
|
+
var xr = Array.isArray;
|
|
333
333
|
function Le(r) {
|
|
334
|
-
return
|
|
334
|
+
return xr(r);
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Qr(r) {
|
|
337
337
|
{
|
|
338
|
-
var
|
|
338
|
+
var E = typeof Symbol == "function" && Symbol.toStringTag, m = E && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
339
339
|
return m;
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function zr(r) {
|
|
343
343
|
try {
|
|
344
344
|
return ar(r), !1;
|
|
345
345
|
} catch {
|
|
@@ -350,38 +350,38 @@ function gt() {
|
|
|
350
350
|
return "" + r;
|
|
351
351
|
}
|
|
352
352
|
function ur(r) {
|
|
353
|
-
if (
|
|
354
|
-
return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
353
|
+
if (zr(r))
|
|
354
|
+
return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qr(r)), ar(r);
|
|
355
355
|
}
|
|
356
|
-
var or = c.ReactCurrentOwner,
|
|
356
|
+
var or = c.ReactCurrentOwner, Xr = {
|
|
357
357
|
key: !0,
|
|
358
358
|
ref: !0,
|
|
359
359
|
__self: !0,
|
|
360
360
|
__source: !0
|
|
361
361
|
}, cr, ir;
|
|
362
|
-
function
|
|
362
|
+
function Zr(r) {
|
|
363
363
|
if (_e.call(r, "ref")) {
|
|
364
|
-
var
|
|
365
|
-
if (
|
|
364
|
+
var E = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
365
|
+
if (E && E.isReactWarning)
|
|
366
366
|
return !1;
|
|
367
367
|
}
|
|
368
368
|
return r.ref !== void 0;
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function et(r) {
|
|
371
371
|
if (_e.call(r, "key")) {
|
|
372
|
-
var
|
|
373
|
-
if (
|
|
372
|
+
var E = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
373
|
+
if (E && E.isReactWarning)
|
|
374
374
|
return !1;
|
|
375
375
|
}
|
|
376
376
|
return r.key !== void 0;
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function rt(r, E) {
|
|
379
379
|
typeof r.ref == "string" && or.current;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function tt(r, E) {
|
|
382
382
|
{
|
|
383
383
|
var m = function() {
|
|
384
|
-
cr || (cr = !0, g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
384
|
+
cr || (cr = !0, g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", E));
|
|
385
385
|
};
|
|
386
386
|
m.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
387
387
|
get: m,
|
|
@@ -389,10 +389,10 @@ function gt() {
|
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function nt(r, E) {
|
|
393
393
|
{
|
|
394
394
|
var m = function() {
|
|
395
|
-
ir || (ir = !0, g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
395
|
+
ir || (ir = !0, g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", E));
|
|
396
396
|
};
|
|
397
397
|
m.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
|
398
398
|
get: m,
|
|
@@ -400,13 +400,13 @@ function gt() {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
var
|
|
403
|
+
var at = function(r, E, m, p, w, I, C) {
|
|
404
404
|
var T = {
|
|
405
405
|
// This tag allows us to uniquely identify this as a React Element
|
|
406
|
-
$$typeof:
|
|
406
|
+
$$typeof: s,
|
|
407
407
|
// Built-in properties that belong on the element
|
|
408
408
|
type: r,
|
|
409
|
-
key:
|
|
409
|
+
key: E,
|
|
410
410
|
ref: m,
|
|
411
411
|
props: C,
|
|
412
412
|
// Record the component responsible for creating this element.
|
|
@@ -429,28 +429,28 @@ function gt() {
|
|
|
429
429
|
value: w
|
|
430
430
|
}), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
|
|
431
431
|
};
|
|
432
|
-
function
|
|
432
|
+
function ut(r, E, m, p, w) {
|
|
433
433
|
{
|
|
434
434
|
var I, C = {}, T = null, j = null;
|
|
435
|
-
m !== void 0 && (ur(m), T = "" + m),
|
|
436
|
-
for (I in
|
|
437
|
-
_e.call(
|
|
435
|
+
m !== void 0 && (ur(m), T = "" + m), et(E) && (ur(E.key), T = "" + E.key), Zr(E) && (j = E.ref, rt(E, w));
|
|
436
|
+
for (I in E)
|
|
437
|
+
_e.call(E, I) && !Xr.hasOwnProperty(I) && (C[I] = E[I]);
|
|
438
438
|
if (r && r.defaultProps) {
|
|
439
|
-
var
|
|
440
|
-
for (I in
|
|
441
|
-
C[I] === void 0 && (C[I] =
|
|
439
|
+
var N = r.defaultProps;
|
|
440
|
+
for (I in N)
|
|
441
|
+
C[I] === void 0 && (C[I] = N[I]);
|
|
442
442
|
}
|
|
443
443
|
if (T || j) {
|
|
444
444
|
var M = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
445
|
-
T &&
|
|
445
|
+
T && tt(C, M), j && nt(C, M);
|
|
446
446
|
}
|
|
447
|
-
return
|
|
447
|
+
return at(r, T, j, w, p, or.current, C);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
var Ue = c.ReactCurrentOwner, sr = c.ReactDebugCurrentFrame;
|
|
451
451
|
function se(r) {
|
|
452
452
|
if (r) {
|
|
453
|
-
var
|
|
453
|
+
var E = r._owner, m = we(r.type, r._source, E ? E.type : null);
|
|
454
454
|
sr.setExtraStackFrame(m);
|
|
455
455
|
} else
|
|
456
456
|
sr.setExtraStackFrame(null);
|
|
@@ -458,7 +458,7 @@ function gt() {
|
|
|
458
458
|
var je;
|
|
459
459
|
je = !1;
|
|
460
460
|
function We(r) {
|
|
461
|
-
return typeof r == "object" && r !== null && r.$$typeof ===
|
|
461
|
+
return typeof r == "object" && r !== null && r.$$typeof === s;
|
|
462
462
|
}
|
|
463
463
|
function lr() {
|
|
464
464
|
{
|
|
@@ -472,28 +472,28 @@ Check the render method of \`` + r + "`.";
|
|
|
472
472
|
return "";
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function ot(r) {
|
|
476
476
|
return "";
|
|
477
477
|
}
|
|
478
478
|
var fr = {};
|
|
479
|
-
function
|
|
479
|
+
function ct(r) {
|
|
480
480
|
{
|
|
481
|
-
var
|
|
482
|
-
if (!
|
|
481
|
+
var E = lr();
|
|
482
|
+
if (!E) {
|
|
483
483
|
var m = typeof r == "string" ? r : r.displayName || r.name;
|
|
484
|
-
m && (
|
|
484
|
+
m && (E = `
|
|
485
485
|
|
|
486
486
|
Check the top-level render call using <` + m + ">.");
|
|
487
487
|
}
|
|
488
|
-
return
|
|
488
|
+
return E;
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
-
function dr(r,
|
|
491
|
+
function dr(r, E) {
|
|
492
492
|
{
|
|
493
493
|
if (!r._store || r._store.validated || r.key != null)
|
|
494
494
|
return;
|
|
495
495
|
r._store.validated = !0;
|
|
496
|
-
var m =
|
|
496
|
+
var m = ct(E);
|
|
497
497
|
if (fr[m])
|
|
498
498
|
return;
|
|
499
499
|
fr[m] = !0;
|
|
@@ -501,54 +501,54 @@ Check the top-level render call using <` + m + ">.");
|
|
|
501
501
|
r && r._owner && r._owner !== Ue.current && (p = " It was passed a child from " + L(r._owner.type) + "."), se(r), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', m, p), se(null);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
function vr(r,
|
|
504
|
+
function vr(r, E) {
|
|
505
505
|
{
|
|
506
506
|
if (typeof r != "object")
|
|
507
507
|
return;
|
|
508
508
|
if (Le(r))
|
|
509
509
|
for (var m = 0; m < r.length; m++) {
|
|
510
510
|
var p = r[m];
|
|
511
|
-
We(p) && dr(p,
|
|
511
|
+
We(p) && dr(p, E);
|
|
512
512
|
}
|
|
513
513
|
else if (We(r))
|
|
514
514
|
r._store && (r._store.validated = !0);
|
|
515
515
|
else if (r) {
|
|
516
|
-
var w =
|
|
516
|
+
var w = b(r);
|
|
517
517
|
if (typeof w == "function" && w !== r.entries)
|
|
518
518
|
for (var I = w.call(r), C; !(C = I.next()).done; )
|
|
519
|
-
We(C.value) && dr(C.value,
|
|
519
|
+
We(C.value) && dr(C.value, E);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function it(r) {
|
|
524
524
|
{
|
|
525
|
-
var
|
|
526
|
-
if (
|
|
525
|
+
var E = r.type;
|
|
526
|
+
if (E == null || typeof E == "string")
|
|
527
527
|
return;
|
|
528
528
|
var m;
|
|
529
|
-
if (typeof
|
|
530
|
-
m =
|
|
531
|
-
else if (typeof
|
|
529
|
+
if (typeof E == "function")
|
|
530
|
+
m = E.propTypes;
|
|
531
|
+
else if (typeof E == "object" && (E.$$typeof === o || // Note: Memo only checks outer props here.
|
|
532
532
|
// Inner props are checked in the reconciler.
|
|
533
|
-
|
|
534
|
-
m =
|
|
533
|
+
E.$$typeof === t))
|
|
534
|
+
m = E.propTypes;
|
|
535
535
|
else
|
|
536
536
|
return;
|
|
537
537
|
if (m) {
|
|
538
|
-
var p = L(
|
|
539
|
-
|
|
540
|
-
} else if (
|
|
538
|
+
var p = L(E);
|
|
539
|
+
Yr(m, r.props, "prop", p, r);
|
|
540
|
+
} else if (E.PropTypes !== void 0 && !je) {
|
|
541
541
|
je = !0;
|
|
542
|
-
var w = L(
|
|
542
|
+
var w = L(E);
|
|
543
543
|
g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", w || "Unknown");
|
|
544
544
|
}
|
|
545
|
-
typeof
|
|
545
|
+
typeof E.getDefaultProps == "function" && !E.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function st(r) {
|
|
549
549
|
{
|
|
550
|
-
for (var
|
|
551
|
-
var p =
|
|
550
|
+
for (var E = Object.keys(r.props), m = 0; m < E.length; m++) {
|
|
551
|
+
var p = E[m];
|
|
552
552
|
if (p !== "children" && p !== "key") {
|
|
553
553
|
se(r), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), se(null);
|
|
554
554
|
break;
|
|
@@ -558,99 +558,99 @@ Check the top-level render call using <` + m + ">.");
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
var Er = {};
|
|
561
|
-
function yr(r,
|
|
561
|
+
function yr(r, E, m, p, w, I) {
|
|
562
562
|
{
|
|
563
563
|
var C = De(r);
|
|
564
564
|
if (!C) {
|
|
565
565
|
var T = "";
|
|
566
566
|
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
567
|
-
var j =
|
|
567
|
+
var j = ot();
|
|
568
568
|
j ? T += j : T += lr();
|
|
569
|
-
var
|
|
570
|
-
r === null ?
|
|
569
|
+
var N;
|
|
570
|
+
r === null ? N = "null" : Le(r) ? N = "array" : r !== void 0 && r.$$typeof === s ? (N = "<" + (L(r.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : N = typeof r, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, T);
|
|
571
571
|
}
|
|
572
|
-
var M =
|
|
572
|
+
var M = ut(r, E, m, w, I);
|
|
573
573
|
if (M == null)
|
|
574
574
|
return M;
|
|
575
575
|
if (C) {
|
|
576
|
-
var
|
|
577
|
-
if (
|
|
576
|
+
var G = E.children;
|
|
577
|
+
if (G !== void 0)
|
|
578
578
|
if (p)
|
|
579
|
-
if (Le(
|
|
580
|
-
for (var le = 0; le <
|
|
581
|
-
vr(
|
|
582
|
-
Object.freeze && Object.freeze(
|
|
579
|
+
if (Le(G)) {
|
|
580
|
+
for (var le = 0; le < G.length; le++)
|
|
581
|
+
vr(G[le], r);
|
|
582
|
+
Object.freeze && Object.freeze(G);
|
|
583
583
|
} else
|
|
584
584
|
g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
585
585
|
else
|
|
586
|
-
vr(
|
|
586
|
+
vr(G, r);
|
|
587
587
|
}
|
|
588
|
-
if (_e.call(
|
|
589
|
-
var te = L(r), W = Object.keys(
|
|
590
|
-
return
|
|
588
|
+
if (_e.call(E, "key")) {
|
|
589
|
+
var te = L(r), W = Object.keys(E).filter(function(yt) {
|
|
590
|
+
return yt !== "key";
|
|
591
591
|
}), Fe = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
592
592
|
if (!Er[te + Fe]) {
|
|
593
|
-
var
|
|
593
|
+
var Et = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
|
|
594
594
|
g(`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} />`, Fe, te,
|
|
599
|
+
<%s key={someKey} {...props} />`, Fe, te, Et, te), Er[te + Fe] = !0;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
return r ===
|
|
602
|
+
return r === d ? st(M) : it(M), M;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
return yr(r,
|
|
605
|
+
function lt(r, E, m) {
|
|
606
|
+
return yr(r, E, m, !0);
|
|
607
607
|
}
|
|
608
|
-
function
|
|
609
|
-
return yr(r,
|
|
608
|
+
function ft(r, E, m) {
|
|
609
|
+
return yr(r, E, m, !1);
|
|
610
610
|
}
|
|
611
|
-
var
|
|
612
|
-
he.Fragment =
|
|
611
|
+
var dt = ft, vt = lt;
|
|
612
|
+
he.Fragment = d, he.jsx = dt, he.jsxs = vt;
|
|
613
613
|
})()), he;
|
|
614
614
|
}
|
|
615
615
|
var br;
|
|
616
|
-
function
|
|
617
|
-
return br || (br = 1, process.env.NODE_ENV === "production" ?
|
|
616
|
+
function Ct() {
|
|
617
|
+
return br || (br = 1, process.env.NODE_ENV === "production" ? ke.exports = Ot() : ke.exports = Tt()), ke.exports;
|
|
618
618
|
}
|
|
619
|
-
var gr =
|
|
620
|
-
const Wr =
|
|
621
|
-
const e =
|
|
619
|
+
var gr = Ct();
|
|
620
|
+
const Wr = _t(null), Me = () => {
|
|
621
|
+
const e = St(Wr);
|
|
622
622
|
if (!e)
|
|
623
623
|
throw new Error("useApiContext must be used within ApiProvider");
|
|
624
624
|
return e;
|
|
625
625
|
};
|
|
626
|
-
function
|
|
626
|
+
function Rt({
|
|
627
627
|
baseURL: e,
|
|
628
|
-
getToken:
|
|
629
|
-
timeoutMs:
|
|
630
|
-
lng:
|
|
628
|
+
getToken: s,
|
|
629
|
+
timeoutMs: h = 15e3,
|
|
630
|
+
lng: d = "tw",
|
|
631
631
|
store: f,
|
|
632
|
-
onError:
|
|
632
|
+
onError: y
|
|
633
633
|
} = {}) {
|
|
634
|
-
const
|
|
634
|
+
const _ = gt.create({
|
|
635
635
|
baseURL: e,
|
|
636
|
-
timeout:
|
|
636
|
+
timeout: h,
|
|
637
637
|
headers: { "Content-Type": "application/json" }
|
|
638
638
|
});
|
|
639
|
-
return
|
|
640
|
-
if (
|
|
641
|
-
const
|
|
642
|
-
|
|
639
|
+
return _.interceptors.request.use(async (v) => {
|
|
640
|
+
if (v.headers = v.headers || {}, s) {
|
|
641
|
+
const l = await s();
|
|
642
|
+
l && (v.headers.Authorization = `Bearer ${l}`);
|
|
643
643
|
}
|
|
644
644
|
const o = f?.getState()?.isWalletCurrency;
|
|
645
|
-
return
|
|
646
|
-
}),
|
|
647
|
-
(
|
|
648
|
-
(
|
|
649
|
-
),
|
|
645
|
+
return v.headers.Currency = o, v.headers["currency-code"] = o, v.headers.lang = d, v;
|
|
646
|
+
}), _.interceptors.response.use(
|
|
647
|
+
(v) => v.data,
|
|
648
|
+
(v) => y ? y(v, { instance: _ }) : Promise.reject(v)
|
|
649
|
+
), _;
|
|
650
650
|
}
|
|
651
|
-
function
|
|
652
|
-
const
|
|
653
|
-
() => new
|
|
651
|
+
function $t({ children: e, ...s }) {
|
|
652
|
+
const h = Ve(() => Rt(s), [s]), f = Ve(
|
|
653
|
+
() => new ht({
|
|
654
654
|
defaultOptions: {
|
|
655
655
|
queries: {
|
|
656
656
|
refetchOnWindowFocus: !1,
|
|
@@ -660,185 +660,191 @@ function Vt({ children: e, ...l }) {
|
|
|
660
660
|
}),
|
|
661
661
|
[]
|
|
662
662
|
);
|
|
663
|
-
return /* @__PURE__ */ gr.jsx(
|
|
663
|
+
return /* @__PURE__ */ gr.jsx(bt, { client: f, children: /* @__PURE__ */ gr.jsx(Wr.Provider, { value: { client: h, ...s }, children: e }) });
|
|
664
664
|
}
|
|
665
|
-
const
|
|
666
|
-
const e = (
|
|
665
|
+
const Kt = () => {
|
|
666
|
+
const e = (d, f) => !d && !f, s = (d) => d.startsWith("pc.");
|
|
667
667
|
return {
|
|
668
668
|
executeLogout: ({
|
|
669
|
-
isCallBackInvalid:
|
|
669
|
+
isCallBackInvalid: d = !1,
|
|
670
670
|
hostname: f = "",
|
|
671
|
-
shouldRedirect:
|
|
672
|
-
onShowError:
|
|
673
|
-
onCleanup:
|
|
671
|
+
shouldRedirect: y,
|
|
672
|
+
onShowError: _,
|
|
673
|
+
onCleanup: v,
|
|
674
674
|
onRemoveToken: o,
|
|
675
|
-
onRedirect:
|
|
675
|
+
onRedirect: l,
|
|
676
676
|
onGoogleLogout: u
|
|
677
677
|
}) => {
|
|
678
|
-
const
|
|
679
|
-
e(
|
|
678
|
+
const t = s(f);
|
|
679
|
+
e(d, t) && _?.(), v?.(), o?.(), y && l?.("/"), u?.();
|
|
680
680
|
},
|
|
681
681
|
shouldShowErrorNotice: e,
|
|
682
|
-
isMachineDomain:
|
|
682
|
+
isMachineDomain: s
|
|
683
683
|
};
|
|
684
|
-
},
|
|
684
|
+
}, Fr = (e = [], s) => $e(e, { gameTypeName: s })?.gameTypeUid, qr = (e = [], s) => $e(e, { platform: s })?.platformUid, Gr = (e = [], s) => $e(e, { SubPlatformEnum: s }), Jr = (e = [], s, h) => F(e) ? [] : e.filter((d) => h ? String(d?.SubPlatformEnumUid) === String(h?.SubPlatformEnumUid) : String(d.platformUid) === String(s)), wt = (e = []) => F(e) ? {} : e.reduce((s, h) => {
|
|
685
|
+
const d = h?.game_subtype || "UNKNOWN";
|
|
686
|
+
return s[d] || (s[d] = []), s[d].push(h), s;
|
|
687
|
+
}, {}), At = ({
|
|
685
688
|
gameTypeName: e,
|
|
686
|
-
platforms:
|
|
687
|
-
gameList:
|
|
688
|
-
allGameTypes:
|
|
689
|
+
platforms: s,
|
|
690
|
+
gameList: h,
|
|
691
|
+
allGameTypes: d,
|
|
689
692
|
allPlatforms: f
|
|
690
693
|
}) => {
|
|
691
|
-
const
|
|
692
|
-
return
|
|
693
|
-
const o =
|
|
694
|
+
const y = Fr(d, e);
|
|
695
|
+
return y ? s.reduce((_, v) => {
|
|
696
|
+
const o = qr(f, v), l = Gr(f, v), u = h[y] || [], t = Jr(
|
|
694
697
|
u,
|
|
695
698
|
o,
|
|
696
|
-
|
|
699
|
+
l
|
|
697
700
|
);
|
|
698
|
-
return
|
|
701
|
+
return F(t) || (_[v] = t), _;
|
|
699
702
|
}, {}) : {};
|
|
700
|
-
},
|
|
703
|
+
}, Pt = ({
|
|
704
|
+
platformName: e,
|
|
705
|
+
gamesOfType: s = [],
|
|
706
|
+
allPlatforms: h = []
|
|
707
|
+
}) => {
|
|
708
|
+
const d = qr(h, e), f = Gr(h, e), y = Jr(
|
|
709
|
+
s,
|
|
710
|
+
d,
|
|
711
|
+
f
|
|
712
|
+
);
|
|
713
|
+
return wt(y);
|
|
714
|
+
}, Yt = ({
|
|
701
715
|
gameTypes: e = [],
|
|
702
|
-
platforms:
|
|
703
|
-
gameList:
|
|
704
|
-
allGameTypes:
|
|
716
|
+
platforms: s = [],
|
|
717
|
+
gameList: h = {},
|
|
718
|
+
allGameTypes: d = [],
|
|
705
719
|
allPlatforms: f = []
|
|
706
|
-
}) => !de(e) || !de(
|
|
707
|
-
const
|
|
708
|
-
gameTypeName:
|
|
709
|
-
platforms:
|
|
710
|
-
gameList:
|
|
711
|
-
allGameTypes:
|
|
720
|
+
}) => !de(e) || !de(s) ? {} : F(h) ? {} : e.reduce((y, _) => {
|
|
721
|
+
const v = At({
|
|
722
|
+
gameTypeName: _,
|
|
723
|
+
platforms: s,
|
|
724
|
+
gameList: h,
|
|
725
|
+
allGameTypes: d,
|
|
712
726
|
allPlatforms: f
|
|
713
727
|
});
|
|
714
|
-
return
|
|
715
|
-
}, {}),
|
|
728
|
+
return F(v) || (y[_] = v), y;
|
|
729
|
+
}, {}), xt = (e = {}) => !jr(e) || F(e) ? [] : Ke(e), Qt = (e = []) => !de(e) || F(e) ? [] : Ye(e, "platform"), zt = (e = []) => !de(e) || F(e) ? [] : Ye(e, "gameTypeName"), Xt = (e = []) => !de(e) || F(e) ? [] : Ye(e, "game_subtype"), Zt = (e = {}) => !jr(e) || F(e) ? [] : Ke(e), en = ({
|
|
716
730
|
types: e = [],
|
|
717
|
-
platforms:
|
|
718
|
-
allGameType:
|
|
719
|
-
allGamePlatform:
|
|
731
|
+
platforms: s = [],
|
|
732
|
+
allGameType: h = [],
|
|
733
|
+
allGamePlatform: d = [],
|
|
720
734
|
allGameList: f = {}
|
|
721
|
-
} = {}) => !Array.isArray(e) || !Array.isArray(
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
)
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
)
|
|
730
|
-
|
|
731
|
-
), a = (i || []).reduce(
|
|
732
|
-
(t, _) => {
|
|
733
|
-
const h = _?.game_subtype ?? "UNKNOWN";
|
|
734
|
-
return t[h] || (t[h] = []), t[h].push(_), t;
|
|
735
|
-
},
|
|
736
|
-
{}
|
|
737
|
-
);
|
|
738
|
-
return (i || []).length ? { ...s, [u]: a } : s;
|
|
735
|
+
} = {}) => !Array.isArray(e) || !Array.isArray(s) ? {} : e.reduce((y, _) => {
|
|
736
|
+
const v = Fr(h, _);
|
|
737
|
+
if (!v) return y;
|
|
738
|
+
const o = f[v] || [], l = s.reduce((u, t) => {
|
|
739
|
+
const i = Pt({
|
|
740
|
+
platformName: t,
|
|
741
|
+
gamesOfType: o,
|
|
742
|
+
allPlatforms: d
|
|
743
|
+
});
|
|
744
|
+
return F(i) ? u : { ...u, [t]: i };
|
|
739
745
|
}, {});
|
|
740
|
-
return
|
|
741
|
-
}, {}),
|
|
742
|
-
...
|
|
743
|
-
...
|
|
744
|
-
platform:
|
|
745
|
-
platformEnum:
|
|
746
|
+
return F(l) || (y[_] = l), y;
|
|
747
|
+
}, {}), rn = (e = []) => !de(e) || F(e) ? [] : Ke(e, (s) => F(s.SubPlatformEnum) ? s : s.SubPlatformEnum.map((h) => ({
|
|
748
|
+
...s,
|
|
749
|
+
...h,
|
|
750
|
+
platform: h.SubPlatformEnum,
|
|
751
|
+
platformEnum: h.SubPlatformEnum
|
|
746
752
|
}))), xe = () => {
|
|
747
|
-
const { client: e } = Me(),
|
|
748
|
-
async (
|
|
749
|
-
const { mac_address:
|
|
750
|
-
mac_address:
|
|
753
|
+
const { client: e } = Me(), s = oe(
|
|
754
|
+
async (_) => {
|
|
755
|
+
const { mac_address: v = "", app_version: o = "", anydesk_id: l = "" } = _, { data: u } = await e.post("/cash-register/login", {
|
|
756
|
+
mac_address: v,
|
|
751
757
|
app_version: o,
|
|
752
|
-
anydesk_id:
|
|
758
|
+
anydesk_id: l
|
|
753
759
|
});
|
|
754
760
|
return u;
|
|
755
761
|
},
|
|
756
762
|
[e]
|
|
757
|
-
),
|
|
763
|
+
), h = oe(async () => e.get("/member/getMemberInfo"), [e]), d = oe(async () => await e.get("member/getGameList"), [e]), f = oe(async () => await e.get("/member/getNowCurrencyExchange"), [e]), y = oe(async () => await e.get("member/getFavoriteGame"), [e]);
|
|
758
764
|
return {
|
|
759
|
-
machineLoginApi:
|
|
760
|
-
userInfoApi:
|
|
761
|
-
userGameListApi:
|
|
762
|
-
userFavoriteGameApi:
|
|
765
|
+
machineLoginApi: s,
|
|
766
|
+
userInfoApi: h,
|
|
767
|
+
userGameListApi: d,
|
|
768
|
+
userFavoriteGameApi: y,
|
|
763
769
|
userCurrencyExchangeApi: f
|
|
764
770
|
};
|
|
765
|
-
},
|
|
766
|
-
const { userCurrencyExchangeApi:
|
|
771
|
+
}, tn = ({ otherQueryKey: e = [], options: s = {} } = {}) => {
|
|
772
|
+
const { userCurrencyExchangeApi: h } = xe(), { getToken: d } = Me(), { enabled: f, ...y } = s, _ = !!d && (f ? f.every((v) => v) : !0);
|
|
767
773
|
return Ur({
|
|
768
774
|
queries: [
|
|
769
775
|
{
|
|
770
776
|
queryKey: ["userCurrencyExchange", ...e],
|
|
771
|
-
queryFn: () =>
|
|
772
|
-
enabled:
|
|
777
|
+
queryFn: () => h(),
|
|
778
|
+
enabled: _,
|
|
773
779
|
// ← 使用合併後的條件
|
|
774
|
-
...
|
|
780
|
+
...y
|
|
775
781
|
// ← 不包含 enabled
|
|
776
782
|
}
|
|
777
783
|
]
|
|
778
784
|
});
|
|
779
|
-
},
|
|
785
|
+
}, nn = ({
|
|
780
786
|
refetchInterval: e = 5e4,
|
|
781
|
-
trigger:
|
|
782
|
-
enabled:
|
|
787
|
+
trigger: s = [],
|
|
788
|
+
enabled: h = !0
|
|
783
789
|
} = {}) => {
|
|
784
|
-
const { getToken:
|
|
790
|
+
const { getToken: d } = Me(), { userInfoApi: f } = xe(), y = Ur({
|
|
785
791
|
queries: [
|
|
786
792
|
{
|
|
787
|
-
queryKey: ["getMemberInfo", ...
|
|
793
|
+
queryKey: ["getMemberInfo", ...s],
|
|
788
794
|
queryFn: async () => await f(),
|
|
789
795
|
refetchInterval: e,
|
|
790
|
-
enabled: !!
|
|
796
|
+
enabled: !!d && h
|
|
791
797
|
}
|
|
792
798
|
]
|
|
793
|
-
}), { data:
|
|
794
|
-
return { data:
|
|
795
|
-
},
|
|
799
|
+
}), { data: _, isFetching: v, error: o } = y[0] || {};
|
|
800
|
+
return { data: _, isFetching: v, error: o };
|
|
801
|
+
}, an = ({ enabled: e = !0 } = {}) => {
|
|
796
802
|
const {
|
|
797
|
-
userInfoApi:
|
|
798
|
-
userFavoriteGameApi:
|
|
799
|
-
userGameListApi:
|
|
803
|
+
userInfoApi: s,
|
|
804
|
+
userFavoriteGameApi: h,
|
|
805
|
+
userGameListApi: d,
|
|
800
806
|
userCurrencyExchangeApi: f
|
|
801
|
-
} = xe(),
|
|
807
|
+
} = xe(), y = fe({
|
|
802
808
|
queryKey: ["getMemInfo"],
|
|
803
|
-
queryFn: async () =>
|
|
809
|
+
queryFn: async () => s(),
|
|
804
810
|
enabled: e
|
|
805
|
-
}),
|
|
811
|
+
}), _ = fe({
|
|
806
812
|
queryKey: ["getFavoriteGame"],
|
|
807
|
-
queryFn: async () =>
|
|
808
|
-
enabled: e &&
|
|
809
|
-
}),
|
|
813
|
+
queryFn: async () => h(),
|
|
814
|
+
enabled: e && y.isSuccess
|
|
815
|
+
}), v = fe({
|
|
810
816
|
queryKey: ["getUserGameList"],
|
|
811
|
-
queryFn: async () =>
|
|
812
|
-
enabled: e &&
|
|
817
|
+
queryFn: async () => d(),
|
|
818
|
+
enabled: e && y.isSuccess && _.isSuccess
|
|
813
819
|
}), o = fe({
|
|
814
820
|
queryKey: ["getUserCurrencyExchange"],
|
|
815
821
|
queryFn: async () => f(),
|
|
816
|
-
enabled: e &&
|
|
822
|
+
enabled: e && y.isSuccess && _.isSuccess && v.isSuccess
|
|
817
823
|
});
|
|
818
824
|
return [
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
825
|
+
y,
|
|
826
|
+
_,
|
|
827
|
+
v,
|
|
822
828
|
o
|
|
823
829
|
];
|
|
824
830
|
};
|
|
825
|
-
var qe = {},
|
|
826
|
-
function
|
|
831
|
+
var qe = {}, q = {}, Ge = {}, mr;
|
|
832
|
+
function V() {
|
|
827
833
|
return mr || (mr = 1, (function(e) {
|
|
828
834
|
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;
|
|
829
|
-
var
|
|
835
|
+
var s = 1, h = 1e3 * s;
|
|
830
836
|
e.DEFAULT_OPTIONS = {}, e.EMPTY_EVENT_HANDLERS = {}, e.DEFAULT_EVENT_SOURCE_OPTIONS = {
|
|
831
837
|
withCredentials: !1,
|
|
832
838
|
events: e.EMPTY_EVENT_HANDLERS
|
|
833
|
-
}, e.SOCKET_IO_PING_INTERVAL = 25 *
|
|
839
|
+
}, e.SOCKET_IO_PING_INTERVAL = 25 * h, 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 = {
|
|
834
840
|
message: "ping",
|
|
835
841
|
timeout: 6e4,
|
|
836
842
|
interval: 25e3
|
|
837
843
|
};
|
|
838
|
-
var
|
|
839
|
-
(function(
|
|
840
|
-
|
|
841
|
-
})(
|
|
844
|
+
var d;
|
|
845
|
+
(function(y) {
|
|
846
|
+
y[y.UNINSTANTIATED = -1] = "UNINSTANTIATED", y[y.CONNECTING = 0] = "CONNECTING", y[y.OPEN = 1] = "OPEN", y[y.CLOSING = 2] = "CLOSING", y[y.CLOSED = 3] = "CLOSED";
|
|
847
|
+
})(d || (e.ReadyState = d = {}));
|
|
842
848
|
var f = function() {
|
|
843
849
|
try {
|
|
844
850
|
return "EventSource" in globalThis;
|
|
@@ -853,348 +859,348 @@ var be = {}, Je = {}, pr;
|
|
|
853
859
|
function Qe() {
|
|
854
860
|
return pr || (pr = 1, (function(e) {
|
|
855
861
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetWebSockets = e.sharedWebSockets = void 0, e.sharedWebSockets = {};
|
|
856
|
-
var
|
|
857
|
-
if (
|
|
858
|
-
delete e.sharedWebSockets[
|
|
862
|
+
var s = function(h) {
|
|
863
|
+
if (h && e.sharedWebSockets.hasOwnProperty(h))
|
|
864
|
+
delete e.sharedWebSockets[h];
|
|
859
865
|
else
|
|
860
|
-
for (var
|
|
861
|
-
e.sharedWebSockets.hasOwnProperty(
|
|
866
|
+
for (var d in e.sharedWebSockets)
|
|
867
|
+
e.sharedWebSockets.hasOwnProperty(d) && delete e.sharedWebSockets[d];
|
|
862
868
|
};
|
|
863
|
-
e.resetWebSockets =
|
|
869
|
+
e.resetWebSockets = s;
|
|
864
870
|
})(Je)), Je;
|
|
865
871
|
}
|
|
866
872
|
var ne = {}, x = {}, Or;
|
|
867
873
|
function ze() {
|
|
868
874
|
if (Or) return x;
|
|
869
875
|
Or = 1, Object.defineProperty(x, "__esModule", { value: !0 }), x.setUpSocketIOPing = x.appendQueryParams = x.parseSocketIOUrl = void 0;
|
|
870
|
-
var e =
|
|
876
|
+
var e = V(), s = function(f) {
|
|
871
877
|
if (f) {
|
|
872
|
-
var
|
|
873
|
-
return "".concat(o, "://").concat(
|
|
878
|
+
var y = /^https|wss/.test(f), _ = f.replace(/^(https?|wss?)(:\/\/)?/, ""), v = _.replace(/\/$/, ""), o = y ? "wss" : "ws";
|
|
879
|
+
return "".concat(o, "://").concat(v).concat(e.SOCKET_IO_PATH);
|
|
874
880
|
} else if (f === "") {
|
|
875
|
-
var
|
|
876
|
-
return "".concat(o, "://").concat(window.location.hostname).concat(
|
|
881
|
+
var y = /^https/.test(window.location.protocol), o = y ? "wss" : "ws", l = window.location.port ? ":".concat(window.location.port) : "";
|
|
882
|
+
return "".concat(o, "://").concat(window.location.hostname).concat(l).concat(e.SOCKET_IO_PATH);
|
|
877
883
|
}
|
|
878
884
|
return f;
|
|
879
885
|
};
|
|
880
|
-
x.parseSocketIOUrl =
|
|
881
|
-
var
|
|
882
|
-
|
|
883
|
-
var
|
|
884
|
-
var
|
|
885
|
-
return
|
|
886
|
+
x.parseSocketIOUrl = s;
|
|
887
|
+
var h = function(f, y) {
|
|
888
|
+
y === void 0 && (y = {});
|
|
889
|
+
var _ = /\?([\w]+=[\w]+)/, v = _.test(f), o = "".concat(Object.entries(y).reduce(function(l, u) {
|
|
890
|
+
var t = u[0], i = u[1];
|
|
891
|
+
return l + "".concat(t, "=").concat(i, "&");
|
|
886
892
|
}, "").slice(0, -1));
|
|
887
|
-
return "".concat(f).concat(
|
|
893
|
+
return "".concat(f).concat(v ? "&" : "?").concat(o);
|
|
888
894
|
};
|
|
889
|
-
x.appendQueryParams =
|
|
890
|
-
var
|
|
891
|
-
|
|
892
|
-
var
|
|
895
|
+
x.appendQueryParams = h;
|
|
896
|
+
var d = function(f, y) {
|
|
897
|
+
y === void 0 && (y = e.SOCKET_IO_PING_INTERVAL);
|
|
898
|
+
var _ = function() {
|
|
893
899
|
return f(e.SOCKET_IO_PING_CODE);
|
|
894
900
|
};
|
|
895
|
-
return window.setInterval(
|
|
901
|
+
return window.setInterval(_, y);
|
|
896
902
|
};
|
|
897
|
-
return x.setUpSocketIOPing =
|
|
903
|
+
return x.setUpSocketIOPing = d, x;
|
|
898
904
|
}
|
|
899
|
-
var
|
|
900
|
-
function
|
|
901
|
-
if (Tr) return
|
|
902
|
-
Tr = 1, Object.defineProperty(
|
|
903
|
-
var e =
|
|
904
|
-
function
|
|
905
|
-
return Array.isArray(
|
|
906
|
-
return f.current >
|
|
907
|
-
}).current :
|
|
905
|
+
var Ne = {}, Tr;
|
|
906
|
+
function Br() {
|
|
907
|
+
if (Tr) return Ne;
|
|
908
|
+
Tr = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.heartbeat = h;
|
|
909
|
+
var e = V();
|
|
910
|
+
function s(d) {
|
|
911
|
+
return Array.isArray(d) ? d.reduce(function(f, y) {
|
|
912
|
+
return f.current > y.current ? f : y;
|
|
913
|
+
}).current : d.current;
|
|
908
914
|
}
|
|
909
|
-
function
|
|
910
|
-
var
|
|
911
|
-
var
|
|
912
|
-
if (c + u <=
|
|
913
|
-
console.warn("Heartbeat timed out, closing connection, last message received ".concat(
|
|
914
|
-
else if (c + o <=
|
|
915
|
+
function h(d, f, y) {
|
|
916
|
+
var _ = y || {}, v = _.interval, o = v === void 0 ? e.DEFAULT_HEARTBEAT.interval : v, l = _.timeout, u = l === void 0 ? e.DEFAULT_HEARTBEAT.timeout : l, t = _.message, i = t === void 0 ? e.DEFAULT_HEARTBEAT.message : t, n = Math.max(100, o / 10), a = Date.now(), S = setInterval(function() {
|
|
917
|
+
var b = Date.now(), c = s(f);
|
|
918
|
+
if (c + u <= b)
|
|
919
|
+
console.warn("Heartbeat timed out, closing connection, last message received ".concat(b - c, "ms ago, last ping sent ").concat(b - a, "ms ago")), d.close();
|
|
920
|
+
else if (c + o <= b && a + o <= b)
|
|
915
921
|
try {
|
|
916
|
-
typeof i == "function" ?
|
|
922
|
+
typeof i == "function" ? d.send(i()) : d.send(i), a = b;
|
|
917
923
|
} catch (g) {
|
|
918
|
-
console.error("Heartbeat failed, closing connection", g instanceof Error ? g.message : g),
|
|
924
|
+
console.error("Heartbeat failed, closing connection", g instanceof Error ? g.message : g), d.close();
|
|
919
925
|
}
|
|
920
|
-
},
|
|
921
|
-
return
|
|
922
|
-
clearInterval(
|
|
926
|
+
}, n);
|
|
927
|
+
return d.addEventListener("close", function() {
|
|
928
|
+
clearInterval(S);
|
|
923
929
|
}), function() {
|
|
924
930
|
};
|
|
925
931
|
}
|
|
926
|
-
return
|
|
932
|
+
return Ne;
|
|
927
933
|
}
|
|
928
|
-
var ge = {},
|
|
934
|
+
var ge = {}, Be = {}, Cr;
|
|
929
935
|
function Xe() {
|
|
930
936
|
return Cr || (Cr = 1, (function(e) {
|
|
931
937
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetSubscribers = e.removeSubscriber = e.addSubscriber = e.hasSubscribers = e.getSubscribers = void 0;
|
|
932
|
-
var
|
|
933
|
-
return (0, e.hasSubscribers)(o) ? Array.from(
|
|
938
|
+
var s = {}, h = [], d = function(o) {
|
|
939
|
+
return (0, e.hasSubscribers)(o) ? Array.from(s[o]) : h;
|
|
934
940
|
};
|
|
935
|
-
e.getSubscribers =
|
|
941
|
+
e.getSubscribers = d;
|
|
936
942
|
var f = function(o) {
|
|
937
|
-
var
|
|
938
|
-
return ((
|
|
943
|
+
var l;
|
|
944
|
+
return ((l = s[o]) === null || l === void 0 ? void 0 : l.size) > 0;
|
|
939
945
|
};
|
|
940
946
|
e.hasSubscribers = f;
|
|
941
|
-
var
|
|
942
|
-
|
|
947
|
+
var y = function(o, l) {
|
|
948
|
+
s[o] = s[o] || /* @__PURE__ */ new Set(), s[o].add(l);
|
|
943
949
|
};
|
|
944
|
-
e.addSubscriber =
|
|
945
|
-
var
|
|
946
|
-
|
|
950
|
+
e.addSubscriber = y;
|
|
951
|
+
var _ = function(o, l) {
|
|
952
|
+
s[o].delete(l);
|
|
947
953
|
};
|
|
948
|
-
e.removeSubscriber =
|
|
949
|
-
var
|
|
950
|
-
if (o &&
|
|
951
|
-
delete
|
|
954
|
+
e.removeSubscriber = _;
|
|
955
|
+
var v = function(o) {
|
|
956
|
+
if (o && s.hasOwnProperty(o))
|
|
957
|
+
delete s[o];
|
|
952
958
|
else
|
|
953
|
-
for (var
|
|
954
|
-
|
|
959
|
+
for (var l in s)
|
|
960
|
+
s.hasOwnProperty(l) && delete s[l];
|
|
955
961
|
};
|
|
956
|
-
e.resetSubscribers =
|
|
957
|
-
})(
|
|
962
|
+
e.resetSubscribers = v;
|
|
963
|
+
})(Be)), Be;
|
|
958
964
|
}
|
|
959
965
|
var Rr;
|
|
960
966
|
function Ze() {
|
|
961
967
|
if (Rr) return ge;
|
|
962
|
-
Rr = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.assertIsWebSocket =
|
|
963
|
-
var e = Qe(),
|
|
964
|
-
function
|
|
965
|
-
if (!
|
|
968
|
+
Rr = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.assertIsWebSocket = h, ge.resetGlobalState = d;
|
|
969
|
+
var e = Qe(), s = Xe();
|
|
970
|
+
function h(f, y) {
|
|
971
|
+
if (!y && !(f instanceof WebSocket))
|
|
966
972
|
throw new Error("");
|
|
967
973
|
}
|
|
968
|
-
function
|
|
969
|
-
(0,
|
|
974
|
+
function d(f) {
|
|
975
|
+
(0, s.resetSubscribers)(f), (0, e.resetWebSockets)(f);
|
|
970
976
|
}
|
|
971
977
|
return ge;
|
|
972
978
|
}
|
|
973
979
|
var wr;
|
|
974
|
-
function
|
|
980
|
+
function It() {
|
|
975
981
|
if (wr) return ne;
|
|
976
982
|
wr = 1;
|
|
977
983
|
var e = ne && ne.__assign || function() {
|
|
978
984
|
return e = Object.assign || function(u) {
|
|
979
|
-
for (var
|
|
980
|
-
|
|
981
|
-
for (var
|
|
985
|
+
for (var t, i = 1, n = arguments.length; i < n; i++) {
|
|
986
|
+
t = arguments[i];
|
|
987
|
+
for (var a in t) Object.prototype.hasOwnProperty.call(t, a) && (u[a] = t[a]);
|
|
982
988
|
}
|
|
983
989
|
return u;
|
|
984
990
|
}, e.apply(this, arguments);
|
|
985
991
|
};
|
|
986
992
|
Object.defineProperty(ne, "__esModule", { value: !0 }), ne.attachListeners = void 0;
|
|
987
|
-
var
|
|
988
|
-
u.onmessage = function(
|
|
989
|
-
var
|
|
990
|
-
|
|
993
|
+
var s = ze(), h = Br(), d = V(), f = Ze(), y = function(u, t, i, n) {
|
|
994
|
+
u.onmessage = function(a) {
|
|
995
|
+
var S;
|
|
996
|
+
t.current.onMessage && t.current.onMessage(a), typeof n?.current == "number" && (n.current = Date.now()), !(typeof t.current.filter == "function" && t.current.filter(a) !== !0) && (t.current.heartbeat && typeof t.current.heartbeat != "boolean" && ((S = t.current.heartbeat) === null || S === void 0 ? void 0 : S.returnMessage) === a.data || i(a));
|
|
991
997
|
};
|
|
992
|
-
},
|
|
993
|
-
u.onopen = function(
|
|
994
|
-
if (
|
|
995
|
-
var
|
|
996
|
-
|
|
998
|
+
}, _ = function(u, t, i, n, a) {
|
|
999
|
+
u.onopen = function(S) {
|
|
1000
|
+
if (t.current.onOpen && t.current.onOpen(S), n.current = 0, i(d.ReadyState.OPEN), t.current.heartbeat && u instanceof WebSocket) {
|
|
1001
|
+
var b = typeof t.current.heartbeat == "boolean" ? void 0 : t.current.heartbeat;
|
|
1002
|
+
a.current = Date.now(), (0, h.heartbeat)(u, a, b);
|
|
997
1003
|
}
|
|
998
1004
|
};
|
|
999
|
-
},
|
|
1000
|
-
if (
|
|
1005
|
+
}, v = function(u, t, i, n, a) {
|
|
1006
|
+
if (d.isEventSourceSupported && u instanceof EventSource)
|
|
1001
1007
|
return function() {
|
|
1002
1008
|
};
|
|
1003
|
-
(0, f.assertIsWebSocket)(u,
|
|
1004
|
-
var
|
|
1005
|
-
return u.onclose = function(
|
|
1009
|
+
(0, f.assertIsWebSocket)(u, t.current.skipAssert);
|
|
1010
|
+
var S;
|
|
1011
|
+
return u.onclose = function(b) {
|
|
1006
1012
|
var c;
|
|
1007
|
-
if (
|
|
1008
|
-
var g = (c =
|
|
1009
|
-
if (
|
|
1010
|
-
var R = typeof
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
}, R ??
|
|
1013
|
+
if (t.current.onClose && t.current.onClose(b), i(d.ReadyState.CLOSED), t.current.shouldReconnect && t.current.shouldReconnect(b)) {
|
|
1014
|
+
var g = (c = t.current.reconnectAttempts) !== null && c !== void 0 ? c : d.DEFAULT_RECONNECT_LIMIT;
|
|
1015
|
+
if (a.current < g) {
|
|
1016
|
+
var R = typeof t.current.reconnectInterval == "function" ? t.current.reconnectInterval(a.current) : t.current.reconnectInterval;
|
|
1017
|
+
S = window.setTimeout(function() {
|
|
1018
|
+
a.current++, n();
|
|
1019
|
+
}, R ?? d.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
1014
1020
|
} else
|
|
1015
|
-
|
|
1021
|
+
t.current.onReconnectStop && t.current.onReconnectStop(g), console.warn("Max reconnect attempts of ".concat(g, " exceeded"));
|
|
1016
1022
|
}
|
|
1017
1023
|
}, function() {
|
|
1018
|
-
return
|
|
1024
|
+
return S && window.clearTimeout(S);
|
|
1019
1025
|
};
|
|
1020
|
-
}, o = function(u,
|
|
1021
|
-
var
|
|
1022
|
-
return u.onerror = function(
|
|
1026
|
+
}, o = function(u, t, i, n, a) {
|
|
1027
|
+
var S;
|
|
1028
|
+
return u.onerror = function(b) {
|
|
1023
1029
|
var c;
|
|
1024
|
-
if (
|
|
1025
|
-
if (
|
|
1026
|
-
var g = typeof
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
}, g ??
|
|
1030
|
+
if (t.current.onError && t.current.onError(b), d.isEventSourceSupported && u instanceof EventSource && (t.current.onClose && t.current.onClose(e(e({}, b), { code: 1006, reason: "An error occurred with the EventSource: ".concat(b), wasClean: !1 })), i(d.ReadyState.CLOSED), u.close()), t.current.retryOnError)
|
|
1031
|
+
if (a.current < ((c = t.current.reconnectAttempts) !== null && c !== void 0 ? c : d.DEFAULT_RECONNECT_LIMIT)) {
|
|
1032
|
+
var g = typeof t.current.reconnectInterval == "function" ? t.current.reconnectInterval(a.current) : t.current.reconnectInterval;
|
|
1033
|
+
S = window.setTimeout(function() {
|
|
1034
|
+
a.current++, n();
|
|
1035
|
+
}, g ?? d.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
1030
1036
|
} else
|
|
1031
|
-
|
|
1037
|
+
t.current.onReconnectStop && t.current.onReconnectStop(t.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(t.current.reconnectAttempts, " exceeded"));
|
|
1032
1038
|
}, function() {
|
|
1033
|
-
return
|
|
1039
|
+
return S && window.clearTimeout(S);
|
|
1034
1040
|
};
|
|
1035
|
-
},
|
|
1036
|
-
var c =
|
|
1037
|
-
return i.current.fromSocketIO && (R = (0,
|
|
1038
|
-
g(
|
|
1041
|
+
}, l = function(u, t, i, n, a, S, b) {
|
|
1042
|
+
var c = t.setLastMessage, g = t.setReadyState, R, P, O;
|
|
1043
|
+
return i.current.fromSocketIO && (R = (0, s.setUpSocketIOPing)(b)), y(u, i, c, S), _(u, i, g, a, S), P = v(u, i, g, n, a), O = o(u, i, g, n, a), function() {
|
|
1044
|
+
g(d.ReadyState.CLOSING), P(), O(), u.close(), R && clearInterval(R);
|
|
1039
1045
|
};
|
|
1040
1046
|
};
|
|
1041
|
-
return ne.attachListeners =
|
|
1047
|
+
return ne.attachListeners = l, ne;
|
|
1042
1048
|
}
|
|
1043
1049
|
var ae = {}, Ar;
|
|
1044
|
-
function
|
|
1050
|
+
function kt() {
|
|
1045
1051
|
if (Ar) return ae;
|
|
1046
1052
|
Ar = 1;
|
|
1047
1053
|
var e = ae && ae.__assign || function() {
|
|
1048
|
-
return e = Object.assign || function(
|
|
1049
|
-
for (var i,
|
|
1050
|
-
i = arguments[
|
|
1051
|
-
for (var
|
|
1054
|
+
return e = Object.assign || function(t) {
|
|
1055
|
+
for (var i, n = 1, a = arguments.length; n < a; n++) {
|
|
1056
|
+
i = arguments[n];
|
|
1057
|
+
for (var S in i) Object.prototype.hasOwnProperty.call(i, S) && (t[S] = i[S]);
|
|
1052
1058
|
}
|
|
1053
|
-
return
|
|
1059
|
+
return t;
|
|
1054
1060
|
}, e.apply(this, arguments);
|
|
1055
1061
|
};
|
|
1056
1062
|
Object.defineProperty(ae, "__esModule", { value: !0 }), ae.attachSharedListeners = void 0;
|
|
1057
|
-
var
|
|
1058
|
-
|
|
1059
|
-
(0,
|
|
1060
|
-
var
|
|
1061
|
-
|
|
1063
|
+
var s = Qe(), h = V(), d = Xe(), f = ze(), y = Br(), _ = function(t, i, n) {
|
|
1064
|
+
t.onmessage = function(a) {
|
|
1065
|
+
(0, d.getSubscribers)(i).forEach(function(S) {
|
|
1066
|
+
var b;
|
|
1067
|
+
S.optionsRef.current.onMessage && S.optionsRef.current.onMessage(a), typeof ((b = S?.lastMessageTime) === null || b === void 0 ? void 0 : b.current) == "number" && (S.lastMessageTime.current = Date.now()), !(typeof S.optionsRef.current.filter == "function" && S.optionsRef.current.filter(a) !== !0) && (n && typeof n != "boolean" && n?.returnMessage === a.data || S.setLastMessage(a));
|
|
1062
1068
|
});
|
|
1063
1069
|
};
|
|
1064
|
-
},
|
|
1065
|
-
|
|
1066
|
-
var
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
}),
|
|
1070
|
-
return
|
|
1071
|
-
}), typeof
|
|
1070
|
+
}, v = function(t, i, n) {
|
|
1071
|
+
t.onopen = function(a) {
|
|
1072
|
+
var S = (0, d.getSubscribers)(i);
|
|
1073
|
+
S.forEach(function(b) {
|
|
1074
|
+
b.reconnectCount.current = 0, b.optionsRef.current.onOpen && b.optionsRef.current.onOpen(a), b.setReadyState(h.ReadyState.OPEN), n && t instanceof WebSocket && (b.lastMessageTime.current = Date.now());
|
|
1075
|
+
}), n && t instanceof WebSocket && (0, y.heartbeat)(t, S.map(function(b) {
|
|
1076
|
+
return b.lastMessageTime;
|
|
1077
|
+
}), typeof n == "boolean" ? void 0 : n);
|
|
1072
1078
|
};
|
|
1073
|
-
}, o = function(
|
|
1074
|
-
|
|
1075
|
-
(0,
|
|
1076
|
-
|
|
1077
|
-
}), delete
|
|
1078
|
-
var
|
|
1079
|
-
if (
|
|
1080
|
-
var
|
|
1081
|
-
if (
|
|
1082
|
-
var c = typeof
|
|
1079
|
+
}, o = function(t, i) {
|
|
1080
|
+
t instanceof WebSocket && (t.onclose = function(n) {
|
|
1081
|
+
(0, d.getSubscribers)(i).forEach(function(a) {
|
|
1082
|
+
a.optionsRef.current.onClose && a.optionsRef.current.onClose(n), a.setReadyState(h.ReadyState.CLOSED);
|
|
1083
|
+
}), delete s.sharedWebSockets[i], (0, d.getSubscribers)(i).forEach(function(a) {
|
|
1084
|
+
var S;
|
|
1085
|
+
if (a.optionsRef.current.shouldReconnect && a.optionsRef.current.shouldReconnect(n)) {
|
|
1086
|
+
var b = (S = a.optionsRef.current.reconnectAttempts) !== null && S !== void 0 ? S : h.DEFAULT_RECONNECT_LIMIT;
|
|
1087
|
+
if (a.reconnectCount.current < b) {
|
|
1088
|
+
var c = typeof a.optionsRef.current.reconnectInterval == "function" ? a.optionsRef.current.reconnectInterval(a.reconnectCount.current) : a.optionsRef.current.reconnectInterval;
|
|
1083
1089
|
setTimeout(function() {
|
|
1084
|
-
|
|
1085
|
-
}, c ??
|
|
1090
|
+
a.reconnectCount.current++, a.reconnect.current();
|
|
1091
|
+
}, c ?? h.DEFAULT_RECONNECT_INTERVAL_MS);
|
|
1086
1092
|
} else
|
|
1087
|
-
|
|
1093
|
+
a.optionsRef.current.onReconnectStop && a.optionsRef.current.onReconnectStop(a.optionsRef.current.reconnectAttempts), console.warn("Max reconnect attempts of ".concat(b, " exceeded"));
|
|
1088
1094
|
}
|
|
1089
1095
|
});
|
|
1090
1096
|
});
|
|
1091
|
-
},
|
|
1092
|
-
|
|
1093
|
-
(0,
|
|
1094
|
-
|
|
1095
|
-
}),
|
|
1097
|
+
}, l = function(t, i) {
|
|
1098
|
+
t.onerror = function(n) {
|
|
1099
|
+
(0, d.getSubscribers)(i).forEach(function(a) {
|
|
1100
|
+
a.optionsRef.current.onError && a.optionsRef.current.onError(n), h.isEventSourceSupported && t instanceof EventSource && (a.optionsRef.current.onClose && a.optionsRef.current.onClose(e(e({}, n), { code: 1006, reason: "An error occurred with the EventSource: ".concat(n), wasClean: !1 })), a.setReadyState(h.ReadyState.CLOSED));
|
|
1101
|
+
}), h.isEventSourceSupported && t instanceof EventSource && t.close();
|
|
1096
1102
|
};
|
|
1097
|
-
}, u = function(
|
|
1098
|
-
var
|
|
1099
|
-
return
|
|
1100
|
-
|
|
1103
|
+
}, u = function(t, i, n, a) {
|
|
1104
|
+
var S;
|
|
1105
|
+
return n.current.fromSocketIO && (S = (0, f.setUpSocketIOPing)(a)), _(t, i, n.current.heartbeat), o(t, i), v(t, i, n.current.heartbeat), l(t, i), function() {
|
|
1106
|
+
S && clearInterval(S);
|
|
1101
1107
|
};
|
|
1102
1108
|
};
|
|
1103
1109
|
return ae.attachSharedListeners = u, ae;
|
|
1104
1110
|
}
|
|
1105
1111
|
var Pr;
|
|
1106
|
-
function
|
|
1112
|
+
function Nt() {
|
|
1107
1113
|
if (Pr) return be;
|
|
1108
1114
|
Pr = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.createOrJoinSocket = void 0;
|
|
1109
|
-
var e = Qe(),
|
|
1115
|
+
var e = Qe(), s = V(), h = It(), d = kt(), f = Xe(), y = function(v, o, l, u, t) {
|
|
1110
1116
|
return function() {
|
|
1111
|
-
if ((0, f.removeSubscriber)(
|
|
1117
|
+
if ((0, f.removeSubscriber)(v, o), !(0, f.hasSubscribers)(v)) {
|
|
1112
1118
|
try {
|
|
1113
|
-
var i = e.sharedWebSockets[
|
|
1114
|
-
i instanceof WebSocket && (i.onclose = function(
|
|
1115
|
-
|
|
1119
|
+
var i = e.sharedWebSockets[v];
|
|
1120
|
+
i instanceof WebSocket && (i.onclose = function(n) {
|
|
1121
|
+
l.current.onClose && l.current.onClose(n), u(s.ReadyState.CLOSED);
|
|
1116
1122
|
}), i.close();
|
|
1117
1123
|
} catch {
|
|
1118
1124
|
}
|
|
1119
|
-
|
|
1125
|
+
t && t(), delete e.sharedWebSockets[v];
|
|
1120
1126
|
}
|
|
1121
1127
|
};
|
|
1122
|
-
},
|
|
1123
|
-
if (!
|
|
1124
|
-
throw
|
|
1128
|
+
}, _ = function(v, o, l, u, t, i, n, a, S) {
|
|
1129
|
+
if (!s.isEventSourceSupported && u.current.eventSourceOptions)
|
|
1130
|
+
throw s.isReactNative ? new Error("EventSource is not supported in ReactNative") : new Error("EventSource is not supported");
|
|
1125
1131
|
if (u.current.share) {
|
|
1126
|
-
var
|
|
1127
|
-
e.sharedWebSockets[o] === void 0 ? (e.sharedWebSockets[o] = u.current.eventSourceOptions ? new EventSource(o, u.current.eventSourceOptions) : new WebSocket(o, u.current.protocols),
|
|
1132
|
+
var b = null;
|
|
1133
|
+
e.sharedWebSockets[o] === void 0 ? (e.sharedWebSockets[o] = u.current.eventSourceOptions ? new EventSource(o, u.current.eventSourceOptions) : new WebSocket(o, u.current.protocols), v.current = e.sharedWebSockets[o], l(s.ReadyState.CONNECTING), b = (0, d.attachSharedListeners)(e.sharedWebSockets[o], o, u, S)) : (v.current = e.sharedWebSockets[o], l(e.sharedWebSockets[o].readyState));
|
|
1128
1134
|
var c = {
|
|
1129
|
-
setLastMessage:
|
|
1130
|
-
setReadyState:
|
|
1135
|
+
setLastMessage: t,
|
|
1136
|
+
setReadyState: l,
|
|
1131
1137
|
optionsRef: u,
|
|
1132
|
-
reconnectCount:
|
|
1133
|
-
lastMessageTime:
|
|
1138
|
+
reconnectCount: n,
|
|
1139
|
+
lastMessageTime: a,
|
|
1134
1140
|
reconnect: i
|
|
1135
1141
|
};
|
|
1136
|
-
return (0, f.addSubscriber)(o, c),
|
|
1142
|
+
return (0, f.addSubscriber)(o, c), y(o, c, u, l, b);
|
|
1137
1143
|
} else {
|
|
1138
|
-
if (
|
|
1144
|
+
if (v.current = u.current.eventSourceOptions ? new EventSource(o, u.current.eventSourceOptions) : new WebSocket(o, u.current.protocols), l(s.ReadyState.CONNECTING), !v.current)
|
|
1139
1145
|
throw new Error("WebSocket failed to be created");
|
|
1140
|
-
return (0,
|
|
1141
|
-
setLastMessage:
|
|
1142
|
-
setReadyState:
|
|
1143
|
-
}, u, i.current,
|
|
1146
|
+
return (0, h.attachListeners)(v.current, {
|
|
1147
|
+
setLastMessage: t,
|
|
1148
|
+
setReadyState: l
|
|
1149
|
+
}, u, i.current, n, a, S);
|
|
1144
1150
|
}
|
|
1145
1151
|
};
|
|
1146
|
-
return be.createOrJoinSocket =
|
|
1152
|
+
return be.createOrJoinSocket = _, be;
|
|
1147
1153
|
}
|
|
1148
1154
|
var Q = {}, Ir;
|
|
1149
|
-
function
|
|
1155
|
+
function Mt() {
|
|
1150
1156
|
return Ir || (Ir = 1, (function(e) {
|
|
1151
|
-
var
|
|
1152
|
-
function i(
|
|
1153
|
-
return
|
|
1154
|
-
|
|
1157
|
+
var s = Q && Q.__awaiter || function(o, l, u, t) {
|
|
1158
|
+
function i(n) {
|
|
1159
|
+
return n instanceof u ? n : new u(function(a) {
|
|
1160
|
+
a(n);
|
|
1155
1161
|
});
|
|
1156
1162
|
}
|
|
1157
|
-
return new (u || (u = Promise))(function(
|
|
1158
|
-
function
|
|
1163
|
+
return new (u || (u = Promise))(function(n, a) {
|
|
1164
|
+
function S(g) {
|
|
1159
1165
|
try {
|
|
1160
|
-
c(
|
|
1166
|
+
c(t.next(g));
|
|
1161
1167
|
} catch (R) {
|
|
1162
|
-
|
|
1168
|
+
a(R);
|
|
1163
1169
|
}
|
|
1164
1170
|
}
|
|
1165
|
-
function
|
|
1171
|
+
function b(g) {
|
|
1166
1172
|
try {
|
|
1167
|
-
c(
|
|
1173
|
+
c(t.throw(g));
|
|
1168
1174
|
} catch (R) {
|
|
1169
|
-
|
|
1175
|
+
a(R);
|
|
1170
1176
|
}
|
|
1171
1177
|
}
|
|
1172
1178
|
function c(g) {
|
|
1173
|
-
g.done ?
|
|
1179
|
+
g.done ? n(g.value) : i(g.value).then(S, b);
|
|
1174
1180
|
}
|
|
1175
|
-
c((
|
|
1181
|
+
c((t = t.apply(o, l || [])).next());
|
|
1176
1182
|
});
|
|
1177
|
-
},
|
|
1183
|
+
}, h = Q && Q.__generator || function(o, l) {
|
|
1178
1184
|
var u = { label: 0, sent: function() {
|
|
1179
|
-
if (
|
|
1180
|
-
return
|
|
1181
|
-
}, trys: [], ops: [] },
|
|
1182
|
-
return
|
|
1185
|
+
if (n[0] & 1) throw n[1];
|
|
1186
|
+
return n[1];
|
|
1187
|
+
}, trys: [], ops: [] }, t, i, n, a = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
1188
|
+
return a.next = S(0), a.throw = S(1), a.return = S(2), typeof Symbol == "function" && (a[Symbol.iterator] = function() {
|
|
1183
1189
|
return this;
|
|
1184
|
-
}),
|
|
1185
|
-
function
|
|
1190
|
+
}), a;
|
|
1191
|
+
function S(c) {
|
|
1186
1192
|
return function(g) {
|
|
1187
|
-
return
|
|
1193
|
+
return b([c, g]);
|
|
1188
1194
|
};
|
|
1189
1195
|
}
|
|
1190
|
-
function
|
|
1191
|
-
if (
|
|
1192
|
-
for (;
|
|
1193
|
-
if (
|
|
1194
|
-
switch (i = 0,
|
|
1196
|
+
function b(c) {
|
|
1197
|
+
if (t) throw new TypeError("Generator is already executing.");
|
|
1198
|
+
for (; a && (a = 0, c[0] && (u = 0)), u; ) try {
|
|
1199
|
+
if (t = 1, i && (n = c[0] & 2 ? i.return : c[0] ? i.throw || ((n = i.return) && n.call(i), 0) : i.next) && !(n = n.call(i, c[1])).done) return n;
|
|
1200
|
+
switch (i = 0, n && (c = [c[0] & 2, n.value]), c[0]) {
|
|
1195
1201
|
case 0:
|
|
1196
1202
|
case 1:
|
|
1197
|
-
|
|
1203
|
+
n = c;
|
|
1198
1204
|
break;
|
|
1199
1205
|
case 4:
|
|
1200
1206
|
return u.label++, { value: c[1], done: !1 };
|
|
@@ -1205,64 +1211,64 @@ function Nt() {
|
|
|
1205
1211
|
c = u.ops.pop(), u.trys.pop();
|
|
1206
1212
|
continue;
|
|
1207
1213
|
default:
|
|
1208
|
-
if (
|
|
1214
|
+
if (n = u.trys, !(n = n.length > 0 && n[n.length - 1]) && (c[0] === 6 || c[0] === 2)) {
|
|
1209
1215
|
u = 0;
|
|
1210
1216
|
continue;
|
|
1211
1217
|
}
|
|
1212
|
-
if (c[0] === 3 && (!
|
|
1218
|
+
if (c[0] === 3 && (!n || c[1] > n[0] && c[1] < n[3])) {
|
|
1213
1219
|
u.label = c[1];
|
|
1214
1220
|
break;
|
|
1215
1221
|
}
|
|
1216
|
-
if (c[0] === 6 && u.label <
|
|
1217
|
-
u.label =
|
|
1222
|
+
if (c[0] === 6 && u.label < n[1]) {
|
|
1223
|
+
u.label = n[1], n = c;
|
|
1218
1224
|
break;
|
|
1219
1225
|
}
|
|
1220
|
-
if (
|
|
1221
|
-
u.label =
|
|
1226
|
+
if (n && u.label < n[2]) {
|
|
1227
|
+
u.label = n[2], u.ops.push(c);
|
|
1222
1228
|
break;
|
|
1223
1229
|
}
|
|
1224
|
-
|
|
1230
|
+
n[2] && u.ops.pop(), u.trys.pop();
|
|
1225
1231
|
continue;
|
|
1226
1232
|
}
|
|
1227
|
-
c =
|
|
1233
|
+
c = l.call(o, u);
|
|
1228
1234
|
} catch (g) {
|
|
1229
1235
|
c = [6, g], i = 0;
|
|
1230
1236
|
} finally {
|
|
1231
|
-
|
|
1237
|
+
t = n = 0;
|
|
1232
1238
|
}
|
|
1233
1239
|
if (c[0] & 5) throw c[1];
|
|
1234
1240
|
return { value: c[0] ? c[1] : void 0, done: !0 };
|
|
1235
1241
|
}
|
|
1236
|
-
},
|
|
1237
|
-
if (u || arguments.length === 2) for (var
|
|
1238
|
-
(
|
|
1239
|
-
return o.concat(
|
|
1242
|
+
}, d = Q && Q.__spreadArray || function(o, l, u) {
|
|
1243
|
+
if (u || arguments.length === 2) for (var t = 0, i = l.length, n; t < i; t++)
|
|
1244
|
+
(n || !(t in l)) && (n || (n = Array.prototype.slice.call(l, 0, t)), n[t] = l[t]);
|
|
1245
|
+
return o.concat(n || Array.prototype.slice.call(l));
|
|
1240
1246
|
};
|
|
1241
1247
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.getUrl = void 0;
|
|
1242
|
-
var f = ze(),
|
|
1243
|
-
return new Promise(function(
|
|
1244
|
-
return window.setTimeout(
|
|
1248
|
+
var f = ze(), y = V(), _ = function(o) {
|
|
1249
|
+
return new Promise(function(l) {
|
|
1250
|
+
return window.setTimeout(l, o);
|
|
1245
1251
|
});
|
|
1246
|
-
},
|
|
1247
|
-
for (var u = [],
|
|
1248
|
-
u[
|
|
1249
|
-
return
|
|
1250
|
-
var
|
|
1251
|
-
return
|
|
1252
|
-
switch (
|
|
1252
|
+
}, v = function(o, l) {
|
|
1253
|
+
for (var u = [], t = 2; t < arguments.length; t++)
|
|
1254
|
+
u[t - 2] = arguments[t];
|
|
1255
|
+
return s(void 0, d([o, l], u, !0), void 0, function(i, n, a) {
|
|
1256
|
+
var S, b, c, g, R, P, O, A;
|
|
1257
|
+
return a === void 0 && (a = 0), h(this, function(k) {
|
|
1258
|
+
switch (k.label) {
|
|
1253
1259
|
case 0:
|
|
1254
1260
|
if (typeof i != "function") return [3, 10];
|
|
1255
|
-
|
|
1261
|
+
k.label = 1;
|
|
1256
1262
|
case 1:
|
|
1257
|
-
return
|
|
1263
|
+
return k.trys.push([1, 3, , 9]), [4, i()];
|
|
1258
1264
|
case 2:
|
|
1259
|
-
return
|
|
1265
|
+
return S = k.sent(), [3, 9];
|
|
1260
1266
|
case 3:
|
|
1261
|
-
return
|
|
1267
|
+
return k.sent(), n.current.retryOnError ? (b = (P = n.current.reconnectAttempts) !== null && P !== void 0 ? P : y.DEFAULT_RECONNECT_LIMIT, a < b ? (c = typeof n.current.reconnectInterval == "function" ? n.current.reconnectInterval(a) : n.current.reconnectInterval, [4, _(c ?? y.DEFAULT_RECONNECT_INTERVAL_MS)]) : [3, 5]) : [3, 7];
|
|
1262
1268
|
case 4:
|
|
1263
|
-
return
|
|
1269
|
+
return k.sent(), [2, (0, e.getUrl)(i, n, a + 1)];
|
|
1264
1270
|
case 5:
|
|
1265
|
-
return (A = (O =
|
|
1271
|
+
return (A = (O = n.current).onReconnectStop) === null || A === void 0 || A.call(O, a), [2, null];
|
|
1266
1272
|
case 6:
|
|
1267
1273
|
return [3, 8];
|
|
1268
1274
|
case 7:
|
|
@@ -1272,78 +1278,78 @@ function Nt() {
|
|
|
1272
1278
|
case 9:
|
|
1273
1279
|
return [3, 11];
|
|
1274
1280
|
case 10:
|
|
1275
|
-
|
|
1281
|
+
S = i, k.label = 11;
|
|
1276
1282
|
case 11:
|
|
1277
|
-
return g =
|
|
1283
|
+
return g = n.current.fromSocketIO ? (0, f.parseSocketIOUrl)(S) : S, R = n.current.queryParams ? (0, f.appendQueryParams)(g, n.current.queryParams) : g, [2, R];
|
|
1278
1284
|
}
|
|
1279
1285
|
});
|
|
1280
1286
|
});
|
|
1281
1287
|
};
|
|
1282
|
-
e.getUrl =
|
|
1288
|
+
e.getUrl = v;
|
|
1283
1289
|
})(Q)), Q;
|
|
1284
1290
|
}
|
|
1285
|
-
var
|
|
1286
|
-
function
|
|
1287
|
-
return
|
|
1291
|
+
var He = {}, kr;
|
|
1292
|
+
function Dt() {
|
|
1293
|
+
return kr || (kr = 1, (function(e) {
|
|
1288
1294
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.websocketWrapper = void 0;
|
|
1289
|
-
var
|
|
1290
|
-
return new Proxy(
|
|
1291
|
-
get: function(f,
|
|
1292
|
-
var
|
|
1293
|
-
return
|
|
1294
|
-
}) :
|
|
1295
|
+
var s = function(h, d) {
|
|
1296
|
+
return new Proxy(h, {
|
|
1297
|
+
get: function(f, y) {
|
|
1298
|
+
var _ = f[y];
|
|
1299
|
+
return y === "reconnect" ? d : typeof _ == "function" ? (console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."), function() {
|
|
1300
|
+
}) : _;
|
|
1295
1301
|
},
|
|
1296
|
-
set: function(f,
|
|
1297
|
-
return /^on/.test(
|
|
1302
|
+
set: function(f, y, _) {
|
|
1303
|
+
return /^on/.test(y) ? (console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."), !1) : (f[y] = _, !0);
|
|
1298
1304
|
}
|
|
1299
1305
|
});
|
|
1300
1306
|
};
|
|
1301
|
-
e.websocketWrapper =
|
|
1302
|
-
})(
|
|
1307
|
+
e.websocketWrapper = s, e.default = e.websocketWrapper;
|
|
1308
|
+
})(He)), He;
|
|
1303
1309
|
}
|
|
1304
|
-
var
|
|
1310
|
+
var Nr;
|
|
1305
1311
|
function er() {
|
|
1306
|
-
if (
|
|
1307
|
-
|
|
1308
|
-
var e =
|
|
1312
|
+
if (Nr) return q;
|
|
1313
|
+
Nr = 1;
|
|
1314
|
+
var e = q && q.__assign || function() {
|
|
1309
1315
|
return e = Object.assign || function(i) {
|
|
1310
|
-
for (var
|
|
1311
|
-
|
|
1312
|
-
for (var
|
|
1316
|
+
for (var n, a = 1, S = arguments.length; a < S; a++) {
|
|
1317
|
+
n = arguments[a];
|
|
1318
|
+
for (var b in n) Object.prototype.hasOwnProperty.call(n, b) && (i[b] = n[b]);
|
|
1313
1319
|
}
|
|
1314
1320
|
return i;
|
|
1315
1321
|
}, e.apply(this, arguments);
|
|
1316
|
-
},
|
|
1317
|
-
function
|
|
1318
|
-
return c instanceof
|
|
1322
|
+
}, s = q && q.__awaiter || function(i, n, a, S) {
|
|
1323
|
+
function b(c) {
|
|
1324
|
+
return c instanceof a ? c : new a(function(g) {
|
|
1319
1325
|
g(c);
|
|
1320
1326
|
});
|
|
1321
1327
|
}
|
|
1322
|
-
return new (
|
|
1328
|
+
return new (a || (a = Promise))(function(c, g) {
|
|
1323
1329
|
function R(A) {
|
|
1324
1330
|
try {
|
|
1325
|
-
O(
|
|
1326
|
-
} catch (
|
|
1327
|
-
g(
|
|
1331
|
+
O(S.next(A));
|
|
1332
|
+
} catch (k) {
|
|
1333
|
+
g(k);
|
|
1328
1334
|
}
|
|
1329
1335
|
}
|
|
1330
1336
|
function P(A) {
|
|
1331
1337
|
try {
|
|
1332
|
-
O(
|
|
1333
|
-
} catch (
|
|
1334
|
-
g(
|
|
1338
|
+
O(S.throw(A));
|
|
1339
|
+
} catch (k) {
|
|
1340
|
+
g(k);
|
|
1335
1341
|
}
|
|
1336
1342
|
}
|
|
1337
1343
|
function O(A) {
|
|
1338
|
-
A.done ? c(A.value) :
|
|
1344
|
+
A.done ? c(A.value) : b(A.value).then(R, P);
|
|
1339
1345
|
}
|
|
1340
|
-
O((
|
|
1346
|
+
O((S = S.apply(i, n || [])).next());
|
|
1341
1347
|
});
|
|
1342
|
-
},
|
|
1343
|
-
var
|
|
1348
|
+
}, h = q && q.__generator || function(i, n) {
|
|
1349
|
+
var a = { label: 0, sent: function() {
|
|
1344
1350
|
if (c[0] & 1) throw c[1];
|
|
1345
1351
|
return c[1];
|
|
1346
|
-
}, trys: [], ops: [] },
|
|
1352
|
+
}, trys: [], ops: [] }, S, b, c, g = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
1347
1353
|
return g.next = R(0), g.throw = R(1), g.return = R(2), typeof Symbol == "function" && (g[Symbol.iterator] = function() {
|
|
1348
1354
|
return this;
|
|
1349
1355
|
}), g;
|
|
@@ -1353,109 +1359,109 @@ function er() {
|
|
|
1353
1359
|
};
|
|
1354
1360
|
}
|
|
1355
1361
|
function P(O) {
|
|
1356
|
-
if (
|
|
1357
|
-
for (; g && (g = 0, O[0] && (
|
|
1358
|
-
if (
|
|
1359
|
-
switch (
|
|
1362
|
+
if (S) throw new TypeError("Generator is already executing.");
|
|
1363
|
+
for (; g && (g = 0, O[0] && (a = 0)), a; ) try {
|
|
1364
|
+
if (S = 1, b && (c = O[0] & 2 ? b.return : O[0] ? b.throw || ((c = b.return) && c.call(b), 0) : b.next) && !(c = c.call(b, O[1])).done) return c;
|
|
1365
|
+
switch (b = 0, c && (O = [O[0] & 2, c.value]), O[0]) {
|
|
1360
1366
|
case 0:
|
|
1361
1367
|
case 1:
|
|
1362
1368
|
c = O;
|
|
1363
1369
|
break;
|
|
1364
1370
|
case 4:
|
|
1365
|
-
return
|
|
1371
|
+
return a.label++, { value: O[1], done: !1 };
|
|
1366
1372
|
case 5:
|
|
1367
|
-
|
|
1373
|
+
a.label++, b = O[1], O = [0];
|
|
1368
1374
|
continue;
|
|
1369
1375
|
case 7:
|
|
1370
|
-
O =
|
|
1376
|
+
O = a.ops.pop(), a.trys.pop();
|
|
1371
1377
|
continue;
|
|
1372
1378
|
default:
|
|
1373
|
-
if (c =
|
|
1374
|
-
|
|
1379
|
+
if (c = a.trys, !(c = c.length > 0 && c[c.length - 1]) && (O[0] === 6 || O[0] === 2)) {
|
|
1380
|
+
a = 0;
|
|
1375
1381
|
continue;
|
|
1376
1382
|
}
|
|
1377
1383
|
if (O[0] === 3 && (!c || O[1] > c[0] && O[1] < c[3])) {
|
|
1378
|
-
|
|
1384
|
+
a.label = O[1];
|
|
1379
1385
|
break;
|
|
1380
1386
|
}
|
|
1381
|
-
if (O[0] === 6 &&
|
|
1382
|
-
|
|
1387
|
+
if (O[0] === 6 && a.label < c[1]) {
|
|
1388
|
+
a.label = c[1], c = O;
|
|
1383
1389
|
break;
|
|
1384
1390
|
}
|
|
1385
|
-
if (c &&
|
|
1386
|
-
|
|
1391
|
+
if (c && a.label < c[2]) {
|
|
1392
|
+
a.label = c[2], a.ops.push(O);
|
|
1387
1393
|
break;
|
|
1388
1394
|
}
|
|
1389
|
-
c[2] &&
|
|
1395
|
+
c[2] && a.ops.pop(), a.trys.pop();
|
|
1390
1396
|
continue;
|
|
1391
1397
|
}
|
|
1392
|
-
O =
|
|
1398
|
+
O = n.call(i, a);
|
|
1393
1399
|
} catch (A) {
|
|
1394
|
-
O = [6, A],
|
|
1400
|
+
O = [6, A], b = 0;
|
|
1395
1401
|
} finally {
|
|
1396
|
-
|
|
1402
|
+
S = c = 0;
|
|
1397
1403
|
}
|
|
1398
1404
|
if (O[0] & 5) throw O[1];
|
|
1399
1405
|
return { value: O[0] ? O[1] : void 0, done: !0 };
|
|
1400
1406
|
}
|
|
1401
|
-
},
|
|
1407
|
+
}, d = q && q.__importDefault || function(i) {
|
|
1402
1408
|
return i && i.__esModule ? i : { default: i };
|
|
1403
1409
|
};
|
|
1404
|
-
Object.defineProperty(
|
|
1405
|
-
var f = me,
|
|
1406
|
-
|
|
1407
|
-
var
|
|
1408
|
-
if (!
|
|
1410
|
+
Object.defineProperty(q, "__esModule", { value: !0 }), q.useWebSocket = void 0;
|
|
1411
|
+
var f = me, y = mt, _ = V(), v = Nt(), o = Mt(), l = d(Dt()), u = Ze(), t = function(i, n, a) {
|
|
1412
|
+
n === void 0 && (n = _.DEFAULT_OPTIONS), a === void 0 && (a = !0);
|
|
1413
|
+
var S = (0, f.useState)(null), b = S[0], c = S[1], g = (0, f.useState)({}), R = g[0], P = g[1], O = (0, f.useMemo)(function() {
|
|
1414
|
+
if (!n.disableJson && b)
|
|
1409
1415
|
try {
|
|
1410
|
-
return JSON.parse(
|
|
1416
|
+
return JSON.parse(b.data);
|
|
1411
1417
|
} catch {
|
|
1412
|
-
return
|
|
1418
|
+
return _.UNPARSABLE_JSON_OBJECT;
|
|
1413
1419
|
}
|
|
1414
1420
|
return null;
|
|
1415
|
-
}, [
|
|
1416
|
-
}), Ee = (0, f.useRef)(0), De = (0, f.useRef)(Date.now()), pe = (0, f.useRef)([]),
|
|
1417
|
-
L.current =
|
|
1418
|
-
var J = A.current && R[A.current] !== void 0 ? R[A.current] : i !== null &&
|
|
1421
|
+
}, [b, n.disableJson]), A = (0, f.useRef)(null), k = (0, f.useRef)(null), ve = (0, f.useRef)(function() {
|
|
1422
|
+
}), Ee = (0, f.useRef)(0), De = (0, f.useRef)(Date.now()), pe = (0, f.useRef)([]), B = (0, f.useRef)(null), L = (0, f.useRef)(n);
|
|
1423
|
+
L.current = n;
|
|
1424
|
+
var J = A.current && R[A.current] !== void 0 ? R[A.current] : i !== null && a === !0 ? _.ReadyState.CONNECTING : _.ReadyState.UNINSTANTIATED, Z = n.queryParams ? JSON.stringify(n.queryParams) : null, $ = (0, f.useCallback)(function(D, U) {
|
|
1419
1425
|
var K;
|
|
1420
|
-
if (U === void 0 && (U = !0),
|
|
1426
|
+
if (U === void 0 && (U = !0), _.isEventSourceSupported && k.current instanceof EventSource) {
|
|
1421
1427
|
console.warn("Unable to send a message from an eventSource");
|
|
1422
1428
|
return;
|
|
1423
1429
|
}
|
|
1424
|
-
((K =
|
|
1430
|
+
((K = k.current) === null || K === void 0 ? void 0 : K.readyState) === _.ReadyState.OPEN ? ((0, u.assertIsWebSocket)(k.current, L.current.skipAssert), k.current.send(D)) : U && pe.current.push(D);
|
|
1425
1431
|
}, []), Oe = (0, f.useCallback)(function(D, U) {
|
|
1426
1432
|
U === void 0 && (U = !0), $(JSON.stringify(D), U);
|
|
1427
1433
|
}, [$]), Te = (0, f.useCallback)(function() {
|
|
1428
|
-
return L.current.share !== !0 ||
|
|
1434
|
+
return L.current.share !== !0 || _.isEventSourceSupported && k.current instanceof EventSource ? k.current : (B.current === null && k.current && ((0, u.assertIsWebSocket)(k.current, L.current.skipAssert), B.current = (0, l.default)(k.current, ve)), B.current);
|
|
1429
1435
|
}, []);
|
|
1430
1436
|
return (0, f.useEffect)(function() {
|
|
1431
|
-
if (i !== null &&
|
|
1437
|
+
if (i !== null && a === !0) {
|
|
1432
1438
|
var D, U = !1, K = !0, ye = function() {
|
|
1433
|
-
return
|
|
1439
|
+
return s(void 0, void 0, void 0, function() {
|
|
1434
1440
|
var ee, X, Ce;
|
|
1435
|
-
return
|
|
1441
|
+
return h(this, function(ce) {
|
|
1436
1442
|
switch (ce.label) {
|
|
1437
1443
|
case 0:
|
|
1438
1444
|
return ee = A, [4, (0, o.getUrl)(i, L)];
|
|
1439
1445
|
case 1:
|
|
1440
|
-
return ee.current = ce.sent(), A.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), A.current = "ABORTED", (0,
|
|
1446
|
+
return ee.current = ce.sent(), A.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), A.current = "ABORTED", (0, y.flushSync)(function() {
|
|
1441
1447
|
return P(function(Y) {
|
|
1442
|
-
return e(e({}, Y), { ABORTED:
|
|
1448
|
+
return e(e({}, Y), { ABORTED: _.ReadyState.CLOSED });
|
|
1443
1449
|
});
|
|
1444
1450
|
}), [
|
|
1445
1451
|
2
|
|
1446
1452
|
/*return*/
|
|
1447
1453
|
]) : (X = function(Y) {
|
|
1448
|
-
U || (0,
|
|
1454
|
+
U || (0, y.flushSync)(function() {
|
|
1449
1455
|
return c(Y);
|
|
1450
1456
|
});
|
|
1451
1457
|
}, Ce = function(Y) {
|
|
1452
|
-
U || (0,
|
|
1458
|
+
U || (0, y.flushSync)(function() {
|
|
1453
1459
|
return P(function(ie) {
|
|
1454
1460
|
var re;
|
|
1455
1461
|
return e(e({}, ie), A.current && (re = {}, re[A.current] = Y, re));
|
|
1456
1462
|
});
|
|
1457
1463
|
});
|
|
1458
|
-
}, K && (D = (0,
|
|
1464
|
+
}, K && (D = (0, v.createOrJoinSocket)(k, A.current, Ce, L, X, ve, Ee, De, $)), [
|
|
1459
1465
|
2
|
|
1460
1466
|
/*return*/
|
|
1461
1467
|
]);
|
|
@@ -1464,146 +1470,146 @@ function er() {
|
|
|
1464
1470
|
});
|
|
1465
1471
|
};
|
|
1466
1472
|
return ve.current = function() {
|
|
1467
|
-
U || (
|
|
1473
|
+
U || (B.current && (B.current = null), D?.(), ye());
|
|
1468
1474
|
}, ye(), function() {
|
|
1469
|
-
U = !0, K = !1,
|
|
1475
|
+
U = !0, K = !1, B.current && (B.current = null), D?.(), c(null);
|
|
1470
1476
|
};
|
|
1471
|
-
} else (i === null ||
|
|
1477
|
+
} else (i === null || a === !1) && (Ee.current = 0, P(function(ee) {
|
|
1472
1478
|
var X;
|
|
1473
|
-
return e(e({}, ee), A.current && (X = {}, X[A.current] =
|
|
1479
|
+
return e(e({}, ee), A.current && (X = {}, X[A.current] = _.ReadyState.CLOSED, X));
|
|
1474
1480
|
}));
|
|
1475
|
-
}, [i,
|
|
1476
|
-
J ===
|
|
1481
|
+
}, [i, a, Z, $]), (0, f.useEffect)(function() {
|
|
1482
|
+
J === _.ReadyState.OPEN && pe.current.splice(0).forEach(function(D) {
|
|
1477
1483
|
$(D);
|
|
1478
1484
|
});
|
|
1479
1485
|
}, [J]), {
|
|
1480
1486
|
sendMessage: $,
|
|
1481
1487
|
sendJsonMessage: Oe,
|
|
1482
|
-
lastMessage:
|
|
1488
|
+
lastMessage: b,
|
|
1483
1489
|
lastJsonMessage: O,
|
|
1484
1490
|
readyState: J,
|
|
1485
1491
|
getWebSocket: Te
|
|
1486
1492
|
};
|
|
1487
1493
|
};
|
|
1488
|
-
return
|
|
1494
|
+
return q.useWebSocket = t, q;
|
|
1489
1495
|
}
|
|
1490
1496
|
var ue = {}, Mr;
|
|
1491
|
-
function
|
|
1497
|
+
function Lt() {
|
|
1492
1498
|
if (Mr) return ue;
|
|
1493
1499
|
Mr = 1;
|
|
1494
1500
|
var e = ue && ue.__assign || function() {
|
|
1495
|
-
return e = Object.assign || function(
|
|
1496
|
-
for (var o,
|
|
1497
|
-
o = arguments[
|
|
1498
|
-
for (var
|
|
1501
|
+
return e = Object.assign || function(v) {
|
|
1502
|
+
for (var o, l = 1, u = arguments.length; l < u; l++) {
|
|
1503
|
+
o = arguments[l];
|
|
1504
|
+
for (var t in o) Object.prototype.hasOwnProperty.call(o, t) && (v[t] = o[t]);
|
|
1499
1505
|
}
|
|
1500
|
-
return
|
|
1506
|
+
return v;
|
|
1501
1507
|
}, e.apply(this, arguments);
|
|
1502
1508
|
};
|
|
1503
1509
|
Object.defineProperty(ue, "__esModule", { value: !0 }), ue.useSocketIO = void 0;
|
|
1504
|
-
var
|
|
1510
|
+
var s = me, h = er(), d = V(), f = {
|
|
1505
1511
|
type: "empty",
|
|
1506
1512
|
payload: null
|
|
1507
|
-
},
|
|
1508
|
-
if (!
|
|
1513
|
+
}, y = function(v) {
|
|
1514
|
+
if (!v || !v.data)
|
|
1509
1515
|
return f;
|
|
1510
|
-
var o =
|
|
1516
|
+
var o = v.data.match(/\[.*]/);
|
|
1511
1517
|
if (!o)
|
|
1512
1518
|
return f;
|
|
1513
|
-
var
|
|
1514
|
-
return !Array.isArray(
|
|
1515
|
-
type:
|
|
1516
|
-
payload:
|
|
1519
|
+
var l = JSON.parse(o);
|
|
1520
|
+
return !Array.isArray(l) || !l[1] ? f : {
|
|
1521
|
+
type: l[0],
|
|
1522
|
+
payload: l[1]
|
|
1517
1523
|
};
|
|
1518
|
-
},
|
|
1519
|
-
o === void 0 && (o =
|
|
1520
|
-
var u = (0,
|
|
1524
|
+
}, _ = function(v, o, l) {
|
|
1525
|
+
o === void 0 && (o = d.DEFAULT_OPTIONS), l === void 0 && (l = !0);
|
|
1526
|
+
var u = (0, s.useMemo)(function() {
|
|
1521
1527
|
return e(e({}, o), { fromSocketIO: !0 });
|
|
1522
|
-
}, []),
|
|
1523
|
-
return
|
|
1524
|
-
}, [
|
|
1528
|
+
}, []), t = (0, h.useWebSocket)(v, u, l), i = t.sendMessage, n = t.sendJsonMessage, a = t.lastMessage, S = t.readyState, b = t.getWebSocket, c = (0, s.useMemo)(function() {
|
|
1529
|
+
return y(a);
|
|
1530
|
+
}, [a]);
|
|
1525
1531
|
return {
|
|
1526
1532
|
sendMessage: i,
|
|
1527
|
-
sendJsonMessage:
|
|
1533
|
+
sendJsonMessage: n,
|
|
1528
1534
|
lastMessage: c,
|
|
1529
1535
|
lastJsonMessage: c,
|
|
1530
|
-
readyState:
|
|
1531
|
-
getWebSocket:
|
|
1536
|
+
readyState: S,
|
|
1537
|
+
getWebSocket: b
|
|
1532
1538
|
};
|
|
1533
1539
|
};
|
|
1534
|
-
return ue.useSocketIO =
|
|
1540
|
+
return ue.useSocketIO = _, ue;
|
|
1535
1541
|
}
|
|
1536
1542
|
var z = {}, Dr;
|
|
1537
|
-
function
|
|
1543
|
+
function Ut() {
|
|
1538
1544
|
if (Dr) return z;
|
|
1539
1545
|
Dr = 1;
|
|
1540
1546
|
var e = z && z.__assign || function() {
|
|
1541
|
-
return e = Object.assign || function(
|
|
1542
|
-
for (var
|
|
1543
|
-
|
|
1544
|
-
for (var u in
|
|
1547
|
+
return e = Object.assign || function(_) {
|
|
1548
|
+
for (var v, o = 1, l = arguments.length; o < l; o++) {
|
|
1549
|
+
v = arguments[o];
|
|
1550
|
+
for (var u in v) Object.prototype.hasOwnProperty.call(v, u) && (_[u] = v[u]);
|
|
1545
1551
|
}
|
|
1546
|
-
return
|
|
1552
|
+
return _;
|
|
1547
1553
|
}, e.apply(this, arguments);
|
|
1548
|
-
},
|
|
1554
|
+
}, s = z && z.__rest || function(_, v) {
|
|
1549
1555
|
var o = {};
|
|
1550
|
-
for (var
|
|
1551
|
-
if (
|
|
1552
|
-
for (var u = 0,
|
|
1553
|
-
|
|
1556
|
+
for (var l in _) Object.prototype.hasOwnProperty.call(_, l) && v.indexOf(l) < 0 && (o[l] = _[l]);
|
|
1557
|
+
if (_ != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1558
|
+
for (var u = 0, l = Object.getOwnPropertySymbols(_); u < l.length; u++)
|
|
1559
|
+
v.indexOf(l[u]) < 0 && Object.prototype.propertyIsEnumerable.call(_, l[u]) && (o[l[u]] = _[l[u]]);
|
|
1554
1560
|
return o;
|
|
1555
1561
|
};
|
|
1556
1562
|
Object.defineProperty(z, "__esModule", { value: !0 }), z.useEventSource = void 0;
|
|
1557
|
-
var
|
|
1558
|
-
|
|
1559
|
-
var
|
|
1563
|
+
var h = me, d = er(), f = V(), y = function(_, v, o) {
|
|
1564
|
+
v === void 0 && (v = f.DEFAULT_EVENT_SOURCE_OPTIONS);
|
|
1565
|
+
var l = v.withCredentials, u = v.events, t = s(v, ["withCredentials", "events"]);
|
|
1560
1566
|
o === void 0 && (o = !0);
|
|
1561
|
-
var i = e(e({},
|
|
1562
|
-
withCredentials:
|
|
1563
|
-
} }),
|
|
1564
|
-
u && (
|
|
1565
|
-
var
|
|
1566
|
-
return (0,
|
|
1567
|
-
|
|
1567
|
+
var i = e(e({}, t), { eventSourceOptions: {
|
|
1568
|
+
withCredentials: l
|
|
1569
|
+
} }), n = (0, h.useRef)(f.EMPTY_EVENT_HANDLERS);
|
|
1570
|
+
u && (n.current = u);
|
|
1571
|
+
var a = (0, d.useWebSocket)(_, i, o), S = a.lastMessage, b = a.readyState, c = a.getWebSocket;
|
|
1572
|
+
return (0, h.useEffect)(function() {
|
|
1573
|
+
S?.type && Object.entries(n.current).forEach(function(g) {
|
|
1568
1574
|
var R = g[0], P = g[1];
|
|
1569
|
-
R ===
|
|
1575
|
+
R === S.type && P(S);
|
|
1570
1576
|
});
|
|
1571
|
-
}, [
|
|
1572
|
-
lastEvent:
|
|
1573
|
-
readyState:
|
|
1577
|
+
}, [S]), {
|
|
1578
|
+
lastEvent: S,
|
|
1579
|
+
readyState: b,
|
|
1574
1580
|
getEventSource: c
|
|
1575
1581
|
};
|
|
1576
1582
|
};
|
|
1577
|
-
return z.useEventSource =
|
|
1583
|
+
return z.useEventSource = y, z;
|
|
1578
1584
|
}
|
|
1579
1585
|
var Lr;
|
|
1580
|
-
function
|
|
1586
|
+
function jt() {
|
|
1581
1587
|
return Lr || (Lr = 1, (function(e) {
|
|
1582
1588
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.resetGlobalState = e.useEventSource = e.ReadyState = e.useSocketIO = e.default = void 0;
|
|
1583
|
-
var
|
|
1589
|
+
var s = er();
|
|
1584
1590
|
Object.defineProperty(e, "default", { enumerable: !0, get: function() {
|
|
1585
|
-
return
|
|
1591
|
+
return s.useWebSocket;
|
|
1586
1592
|
} });
|
|
1587
|
-
var
|
|
1593
|
+
var h = Lt();
|
|
1588
1594
|
Object.defineProperty(e, "useSocketIO", { enumerable: !0, get: function() {
|
|
1589
|
-
return
|
|
1595
|
+
return h.useSocketIO;
|
|
1590
1596
|
} });
|
|
1591
|
-
var
|
|
1597
|
+
var d = V();
|
|
1592
1598
|
Object.defineProperty(e, "ReadyState", { enumerable: !0, get: function() {
|
|
1593
|
-
return
|
|
1599
|
+
return d.ReadyState;
|
|
1594
1600
|
} });
|
|
1595
|
-
var f =
|
|
1601
|
+
var f = Ut();
|
|
1596
1602
|
Object.defineProperty(e, "useEventSource", { enumerable: !0, get: function() {
|
|
1597
1603
|
return f.useEventSource;
|
|
1598
1604
|
} });
|
|
1599
|
-
var
|
|
1605
|
+
var y = Ze();
|
|
1600
1606
|
Object.defineProperty(e, "resetGlobalState", { enumerable: !0, get: function() {
|
|
1601
|
-
return
|
|
1607
|
+
return y.resetGlobalState;
|
|
1602
1608
|
} });
|
|
1603
1609
|
})(qe)), qe;
|
|
1604
1610
|
}
|
|
1605
|
-
var
|
|
1606
|
-
const
|
|
1611
|
+
var Wt = jt();
|
|
1612
|
+
const Ft = /* @__PURE__ */ pt(Wt), H = {
|
|
1607
1613
|
DEPOSIT: "deposit",
|
|
1608
1614
|
TRANS_CODE: "transCode",
|
|
1609
1615
|
ERROR: "error",
|
|
@@ -1614,138 +1620,144 @@ const jt = /* @__PURE__ */ ht(Ut), V = {
|
|
|
1614
1620
|
TRANSFER_IN_GAME: "transfer_in_game",
|
|
1615
1621
|
CHECK_REQUEST: "CHECK_RREQUEST",
|
|
1616
1622
|
CASH_REGISTER_LIMIT: "cash_register_limit"
|
|
1617
|
-
},
|
|
1623
|
+
}, qt = 3e4, un = ({
|
|
1618
1624
|
socketUrl: e,
|
|
1619
|
-
socketHandlers:
|
|
1620
|
-
options:
|
|
1625
|
+
socketHandlers: s = {},
|
|
1626
|
+
options: h = {}
|
|
1621
1627
|
}) => {
|
|
1622
|
-
const
|
|
1623
|
-
sendMessage:
|
|
1628
|
+
const d = _r(!1), f = _r(s), {
|
|
1629
|
+
sendMessage: y,
|
|
1624
1630
|
// 發送普通訊息
|
|
1625
|
-
sendJsonMessage:
|
|
1631
|
+
sendJsonMessage: _,
|
|
1626
1632
|
// 發送 JSON 訊息
|
|
1627
|
-
lastMessage:
|
|
1633
|
+
lastMessage: v,
|
|
1628
1634
|
// 最後接收到的訊息
|
|
1629
1635
|
// lastJsonMessage, // 最後接收到的 JSON 訊息
|
|
1630
1636
|
readyState: o
|
|
1631
1637
|
// WebSocket 連線狀態
|
|
1632
1638
|
// getWebSocket, // 獲取 WebSocket 實例
|
|
1633
|
-
} =
|
|
1639
|
+
} = Ft(e, {
|
|
1634
1640
|
queryParams: { key: "wsky" },
|
|
1635
1641
|
onOpen: () => console.log("連線成功"),
|
|
1636
|
-
shouldReconnect: () =>
|
|
1642
|
+
shouldReconnect: () => d.current === !1,
|
|
1637
1643
|
reconnectAttempts: 9999,
|
|
1638
1644
|
reconnectInterval: 1e3,
|
|
1639
|
-
...
|
|
1640
|
-
}),
|
|
1645
|
+
...h
|
|
1646
|
+
}), l = Ve(() => {
|
|
1641
1647
|
try {
|
|
1642
|
-
return JSON.parse(
|
|
1648
|
+
return JSON.parse(v?.data);
|
|
1643
1649
|
} catch {
|
|
1644
1650
|
return null;
|
|
1645
1651
|
}
|
|
1646
|
-
}, [
|
|
1652
|
+
}, [v?.data]);
|
|
1647
1653
|
return Pe(() => {
|
|
1648
1654
|
const u = setInterval(
|
|
1649
|
-
() =>
|
|
1650
|
-
|
|
1655
|
+
() => y("ping"),
|
|
1656
|
+
qt
|
|
1651
1657
|
);
|
|
1652
1658
|
return () => clearInterval(u);
|
|
1653
|
-
}, [
|
|
1654
|
-
f.current =
|
|
1655
|
-
}, [
|
|
1656
|
-
if (!
|
|
1659
|
+
}, [y]), Pe(() => {
|
|
1660
|
+
f.current = s;
|
|
1661
|
+
}, [s]), Pe(() => {
|
|
1662
|
+
if (!l) return;
|
|
1657
1663
|
const {
|
|
1658
1664
|
onDeposit: u,
|
|
1659
|
-
onTransCode:
|
|
1665
|
+
onTransCode: t,
|
|
1660
1666
|
onError: i,
|
|
1661
|
-
onUpdateMember:
|
|
1662
|
-
onMaintainNotice:
|
|
1663
|
-
onMaintainNoticeMember:
|
|
1664
|
-
onReload:
|
|
1667
|
+
onUpdateMember: n,
|
|
1668
|
+
onMaintainNotice: a,
|
|
1669
|
+
onMaintainNoticeMember: S,
|
|
1670
|
+
onReload: b,
|
|
1665
1671
|
onTransferInGame: c,
|
|
1666
1672
|
onCashRegisterLimit: g
|
|
1667
|
-
} = f.current, R = Ie(
|
|
1668
|
-
memberInfoUid: Ie(
|
|
1669
|
-
data: Ie(
|
|
1670
|
-
memo: Ie(
|
|
1673
|
+
} = f.current, R = Ie(l, "type", ""), P = {
|
|
1674
|
+
memberInfoUid: Ie(l, "member_info_uid", null),
|
|
1675
|
+
data: Ie(l, "data", null),
|
|
1676
|
+
memo: Ie(l, "memo", null)
|
|
1671
1677
|
};
|
|
1672
1678
|
switch (R) {
|
|
1673
|
-
case
|
|
1679
|
+
case H.DEPOSIT:
|
|
1674
1680
|
u?.(P);
|
|
1675
1681
|
break;
|
|
1676
|
-
case
|
|
1677
|
-
|
|
1682
|
+
case H.TRANS_CODE:
|
|
1683
|
+
t?.(P);
|
|
1678
1684
|
break;
|
|
1679
|
-
case
|
|
1685
|
+
case H.ERROR:
|
|
1680
1686
|
i?.(P);
|
|
1681
1687
|
break;
|
|
1682
|
-
case
|
|
1683
|
-
|
|
1688
|
+
case H.UPDATE_MEMBER:
|
|
1689
|
+
n?.(P);
|
|
1684
1690
|
break;
|
|
1685
|
-
case
|
|
1686
|
-
|
|
1691
|
+
case H.MAINTAIN_NOTICE:
|
|
1692
|
+
a?.(P);
|
|
1687
1693
|
break;
|
|
1688
|
-
case
|
|
1689
|
-
|
|
1694
|
+
case H.MAINTAIN_NOTICE_MEMBER:
|
|
1695
|
+
S?.(P);
|
|
1690
1696
|
break;
|
|
1691
|
-
case
|
|
1692
|
-
|
|
1697
|
+
case H.RELOAD:
|
|
1698
|
+
b?.(P);
|
|
1693
1699
|
break;
|
|
1694
|
-
case
|
|
1695
|
-
case
|
|
1700
|
+
case H.TRANSFER_IN_GAME:
|
|
1701
|
+
case H.CHECK_REQUEST:
|
|
1696
1702
|
c?.(P);
|
|
1697
1703
|
break;
|
|
1698
|
-
case
|
|
1704
|
+
case H.CASH_REGISTER_LIMIT:
|
|
1699
1705
|
g?.(P);
|
|
1700
1706
|
break;
|
|
1701
1707
|
default:
|
|
1702
1708
|
console.warn("Unknown socket type:", R);
|
|
1703
1709
|
break;
|
|
1704
1710
|
}
|
|
1705
|
-
}, [
|
|
1706
|
-
sendMessage:
|
|
1707
|
-
sendJsonMessage:
|
|
1711
|
+
}, [l]), Pe(() => () => d.current = !0, []), {
|
|
1712
|
+
sendMessage: y,
|
|
1713
|
+
sendJsonMessage: _,
|
|
1708
1714
|
readyState: o
|
|
1709
1715
|
// WebSocket 連線狀態
|
|
1710
1716
|
};
|
|
1711
|
-
},
|
|
1712
|
-
const { client: e } = Me(),
|
|
1713
|
-
const { data:
|
|
1714
|
-
return
|
|
1715
|
-
}, [e]),
|
|
1716
|
-
return { commonCarouselApi:
|
|
1717
|
-
},
|
|
1718
|
-
const { commonCarouselApi: e } =
|
|
1717
|
+
}, Hr = () => {
|
|
1718
|
+
const { client: e } = Me(), s = oe(async () => {
|
|
1719
|
+
const { data: d } = await e.get("/carousels");
|
|
1720
|
+
return d;
|
|
1721
|
+
}, [e]), h = oe(async () => await e.get("/marquees"), [e]);
|
|
1722
|
+
return { commonCarouselApi: s, commonMarqueeApi: h };
|
|
1723
|
+
}, on = () => {
|
|
1724
|
+
const { commonCarouselApi: e } = Hr();
|
|
1719
1725
|
return fe({
|
|
1720
1726
|
queryKey: ["getCarouselList"],
|
|
1721
1727
|
queryFn: async () => await e()
|
|
1722
1728
|
});
|
|
1723
|
-
},
|
|
1724
|
-
const { commonMarqueeApi: e } =
|
|
1729
|
+
}, cn = () => {
|
|
1730
|
+
const { commonMarqueeApi: e } = Hr();
|
|
1725
1731
|
return fe({
|
|
1726
1732
|
queryKey: ["getMarqueeList"],
|
|
1727
1733
|
queryFn: async () => e(),
|
|
1728
|
-
select: (
|
|
1734
|
+
select: (s) => s.Marquees
|
|
1729
1735
|
});
|
|
1730
1736
|
};
|
|
1731
1737
|
export {
|
|
1732
1738
|
Wr as ApiCtx,
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1739
|
+
$t as ApiProvider,
|
|
1740
|
+
At as buildPlatformDataForType,
|
|
1741
|
+
Pt as buildPlatformGamesGroupedBySubType,
|
|
1742
|
+
Yt as constructGameList,
|
|
1743
|
+
Kt as createLogoutHandler,
|
|
1744
|
+
Xt as extractGameSubTypeNames,
|
|
1745
|
+
zt as extractGameTypeNames,
|
|
1746
|
+
Qt as extractPlatformNames,
|
|
1747
|
+
Jr as filterGamesByPlatform,
|
|
1748
|
+
Fr as findGameTypeUid,
|
|
1749
|
+
qr as findPlatformUid,
|
|
1750
|
+
Gr as findSubPlatform,
|
|
1751
|
+
xt as flattenAllGames,
|
|
1752
|
+
Zt as flattenFavoriteGames,
|
|
1753
|
+
wt as groupGamesBySubType,
|
|
1754
|
+
rn as processPlatformData,
|
|
1755
|
+
en as sortGamesByTypeAndPlatform,
|
|
1744
1756
|
Me as useApiContext,
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1757
|
+
tn as useBalanceGetter,
|
|
1758
|
+
un as useClientWebSocket,
|
|
1759
|
+
on as useGetCarouseList,
|
|
1760
|
+
cn as useGetMarquee,
|
|
1761
|
+
nn as useGetMemberInfo,
|
|
1762
|
+
an as useInitializeWithToken
|
|
1751
1763
|
};
|