@obb871001/api-integration-sdk 1.0.52 → 1.0.54
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 +6 -6
- package/dist/index.js +377 -366
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import be, { createContext as
|
|
2
|
-
import { QueryClient as
|
|
3
|
-
import
|
|
4
|
-
import { get as Ae } from "lodash";
|
|
5
|
-
import
|
|
6
|
-
function
|
|
1
|
+
import be, { createContext as ct, useContext as it, useMemo as He, useCallback as ue, useRef as fr, useEffect as we } from "react";
|
|
2
|
+
import { QueryClient as st, QueryClientProvider as lt, useQueries as Nr, useQuery as le } from "@tanstack/react-query";
|
|
3
|
+
import ft from "axios";
|
|
4
|
+
import { isArray as vt, isEmpty as vr, flatMap as dt, get as Ae } from "lodash";
|
|
5
|
+
import Et from "react-dom";
|
|
6
|
+
function _t(r) {
|
|
7
7
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
8
8
|
}
|
|
9
9
|
var Pe = { exports: {} }, _e = {};
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
var r = be,
|
|
15
|
-
function
|
|
10
|
+
var dr;
|
|
11
|
+
function yt() {
|
|
12
|
+
if (dr) return _e;
|
|
13
|
+
dr = 1;
|
|
14
|
+
var r = be, y = Symbol.for("react.element"), O = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, f = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
15
|
+
function S(v, c, s) {
|
|
16
16
|
var u, a = {}, i = null, t = null;
|
|
17
17
|
s !== void 0 && (i = "" + s), c.key !== void 0 && (i = "" + c.key), c.ref !== void 0 && (t = c.ref);
|
|
18
18
|
for (u in c) E.call(c, u) && !_.hasOwnProperty(u) && (a[u] = c[u]);
|
|
19
19
|
if (v && v.defaultProps) for (u in c = v.defaultProps, c) a[u] === void 0 && (a[u] = c[u]);
|
|
20
|
-
return { $$typeof:
|
|
20
|
+
return { $$typeof: y, type: v, key: i, ref: t, props: a, _owner: f.current };
|
|
21
21
|
}
|
|
22
|
-
return _e.Fragment = O, _e.jsx =
|
|
22
|
+
return _e.Fragment = O, _e.jsx = S, _e.jsxs = S, _e;
|
|
23
23
|
}
|
|
24
24
|
var ye = {};
|
|
25
|
-
var
|
|
26
|
-
function
|
|
27
|
-
return
|
|
28
|
-
var r = be,
|
|
25
|
+
var Er;
|
|
26
|
+
function St() {
|
|
27
|
+
return Er || (Er = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
28
|
+
var r = be, y = Symbol.for("react.element"), O = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), S = Symbol.for("react.provider"), v = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), a = Symbol.for("react.memo"), i = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), n = Symbol.iterator, d = "@@iterator";
|
|
29
29
|
function h(e) {
|
|
30
30
|
if (e === null || typeof e != "object")
|
|
31
31
|
return null;
|
|
@@ -35,14 +35,14 @@ function Et() {
|
|
|
35
35
|
var o = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
36
36
|
function b(e) {
|
|
37
37
|
{
|
|
38
|
-
for (var l = arguments.length, g = new Array(l > 1 ? l - 1 : 0),
|
|
39
|
-
g[
|
|
38
|
+
for (var l = arguments.length, g = new Array(l > 1 ? l - 1 : 0), m = 1; m < l; m++)
|
|
39
|
+
g[m - 1] = arguments[m];
|
|
40
40
|
R("error", e, g);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
function R(e, l, g) {
|
|
44
44
|
{
|
|
45
|
-
var
|
|
45
|
+
var m = o.ReactDebugCurrentFrame, w = m.getStackAddendum();
|
|
46
46
|
w !== "" && (l += "%s", g = g.concat([w]));
|
|
47
47
|
var I = g.map(function(C) {
|
|
48
48
|
return String(C);
|
|
@@ -50,19 +50,19 @@ function Et() {
|
|
|
50
50
|
I.unshift("Warning: " + l), Function.prototype.apply.call(console[e], console, I);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
var P = !1,
|
|
53
|
+
var P = !1, p = !1, A = !1, k = !1, fe = !1, ve;
|
|
54
54
|
ve = Symbol.for("react.module.reference");
|
|
55
55
|
function Ne(e) {
|
|
56
|
-
return !!(typeof e == "string" || typeof e == "function" || e === E || e === _ || fe || e === f || e === s || e === u || k || e === t || P ||
|
|
56
|
+
return !!(typeof e == "string" || typeof e == "function" || e === E || e === _ || fe || e === f || e === s || e === u || k || e === t || P || p || A || typeof e == "object" && e !== null && (e.$$typeof === i || e.$$typeof === a || e.$$typeof === S || e.$$typeof === v || e.$$typeof === c || // 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
|
e.$$typeof === ve || e.getModuleId !== void 0));
|
|
61
61
|
}
|
|
62
62
|
function ge(e, l, g) {
|
|
63
|
-
var
|
|
64
|
-
if (
|
|
65
|
-
return
|
|
63
|
+
var m = e.displayName;
|
|
64
|
+
if (m)
|
|
65
|
+
return m;
|
|
66
66
|
var w = l.displayName || l.name || "";
|
|
67
67
|
return w !== "" ? g + "(" + w + ")" : g;
|
|
68
68
|
}
|
|
@@ -95,14 +95,14 @@ function Et() {
|
|
|
95
95
|
case v:
|
|
96
96
|
var l = e;
|
|
97
97
|
return J(l) + ".Consumer";
|
|
98
|
-
case
|
|
98
|
+
case S:
|
|
99
99
|
var g = e;
|
|
100
100
|
return J(g._context) + ".Provider";
|
|
101
101
|
case c:
|
|
102
102
|
return ge(e, e.render, "ForwardRef");
|
|
103
103
|
case a:
|
|
104
|
-
var
|
|
105
|
-
return
|
|
104
|
+
var m = e.displayName || null;
|
|
105
|
+
return m !== null ? m : D(e.type) || "Memo";
|
|
106
106
|
case i: {
|
|
107
107
|
var w = e, I = w._payload, C = w._init;
|
|
108
108
|
try {
|
|
@@ -114,14 +114,14 @@ function Et() {
|
|
|
114
114
|
}
|
|
115
115
|
return null;
|
|
116
116
|
}
|
|
117
|
-
var G = Object.assign, X = 0, $, Oe,
|
|
117
|
+
var G = Object.assign, X = 0, $, Oe, me, L, j, B, de;
|
|
118
118
|
function Z() {
|
|
119
119
|
}
|
|
120
120
|
Z.__reactDisabledLog = !0;
|
|
121
121
|
function z() {
|
|
122
122
|
{
|
|
123
123
|
if (X === 0) {
|
|
124
|
-
$ = console.log, Oe = console.info,
|
|
124
|
+
$ = console.log, Oe = console.info, me = console.warn, L = console.error, j = console.group, B = console.groupCollapsed, de = console.groupEnd;
|
|
125
125
|
var e = {
|
|
126
126
|
configurable: !0,
|
|
127
127
|
enumerable: !0,
|
|
@@ -141,7 +141,7 @@ function Et() {
|
|
|
141
141
|
X++;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function pe() {
|
|
145
145
|
{
|
|
146
146
|
if (X--, X === 0) {
|
|
147
147
|
var e = {
|
|
@@ -157,7 +157,7 @@ function Et() {
|
|
|
157
157
|
value: Oe
|
|
158
158
|
}),
|
|
159
159
|
warn: G({}, e, {
|
|
160
|
-
value:
|
|
160
|
+
value: me
|
|
161
161
|
}),
|
|
162
162
|
error: G({}, e, {
|
|
163
163
|
value: L
|
|
@@ -183,8 +183,8 @@ function Et() {
|
|
|
183
183
|
try {
|
|
184
184
|
throw Error();
|
|
185
185
|
} catch (w) {
|
|
186
|
-
var
|
|
187
|
-
K =
|
|
186
|
+
var m = w.stack.trim().match(/\n( *(at )?)/);
|
|
187
|
+
K = m && m[1] || "";
|
|
188
188
|
}
|
|
189
189
|
return `
|
|
190
190
|
` + K + e;
|
|
@@ -192,8 +192,8 @@ function Et() {
|
|
|
192
192
|
}
|
|
193
193
|
var ee = !1, Te;
|
|
194
194
|
{
|
|
195
|
-
var
|
|
196
|
-
Te = new
|
|
195
|
+
var jr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
196
|
+
Te = new jr();
|
|
197
197
|
}
|
|
198
198
|
function Qe(e, l) {
|
|
199
199
|
if (!e || ee)
|
|
@@ -203,7 +203,7 @@ function Et() {
|
|
|
203
203
|
if (g !== void 0)
|
|
204
204
|
return g;
|
|
205
205
|
}
|
|
206
|
-
var
|
|
206
|
+
var m;
|
|
207
207
|
ee = !0;
|
|
208
208
|
var w = Error.prepareStackTrace;
|
|
209
209
|
Error.prepareStackTrace = void 0;
|
|
@@ -222,14 +222,14 @@ function Et() {
|
|
|
222
222
|
try {
|
|
223
223
|
Reflect.construct(C, []);
|
|
224
224
|
} catch (W) {
|
|
225
|
-
|
|
225
|
+
m = W;
|
|
226
226
|
}
|
|
227
227
|
Reflect.construct(e, [], C);
|
|
228
228
|
} else {
|
|
229
229
|
try {
|
|
230
230
|
C.call();
|
|
231
231
|
} catch (W) {
|
|
232
|
-
|
|
232
|
+
m = W;
|
|
233
233
|
}
|
|
234
234
|
e.call(C.prototype);
|
|
235
235
|
}
|
|
@@ -237,14 +237,14 @@ function Et() {
|
|
|
237
237
|
try {
|
|
238
238
|
throw Error();
|
|
239
239
|
} catch (W) {
|
|
240
|
-
|
|
240
|
+
m = W;
|
|
241
241
|
}
|
|
242
242
|
e();
|
|
243
243
|
}
|
|
244
244
|
} catch (W) {
|
|
245
|
-
if (W &&
|
|
245
|
+
if (W && m && typeof W.stack == "string") {
|
|
246
246
|
for (var T = W.stack.split(`
|
|
247
|
-
`), U =
|
|
247
|
+
`), U = m.stack.split(`
|
|
248
248
|
`), N = T.length - 1, M = U.length - 1; N >= 1 && M >= 0 && T[N] !== U[M]; )
|
|
249
249
|
M--;
|
|
250
250
|
for (; N >= 1 && M >= 0; N--, M--)
|
|
@@ -261,15 +261,15 @@ function Et() {
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
} finally {
|
|
264
|
-
ee = !1, oe.current = I,
|
|
264
|
+
ee = !1, oe.current = I, pe(), Error.prepareStackTrace = w;
|
|
265
265
|
}
|
|
266
266
|
var se = e ? e.displayName || e.name : "", re = se ? ce(se) : "";
|
|
267
267
|
return typeof e == "function" && Te.set(e, re), re;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function Ur(e, l, g) {
|
|
270
270
|
return Qe(e, !1);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Wr(e) {
|
|
273
273
|
var l = e.prototype;
|
|
274
274
|
return !!(l && l.isReactComponent);
|
|
275
275
|
}
|
|
@@ -277,7 +277,7 @@ function Et() {
|
|
|
277
277
|
if (e == null)
|
|
278
278
|
return "";
|
|
279
279
|
if (typeof e == "function")
|
|
280
|
-
return Qe(e,
|
|
280
|
+
return Qe(e, Wr(e));
|
|
281
281
|
if (typeof e == "string")
|
|
282
282
|
return ce(e);
|
|
283
283
|
switch (e) {
|
|
@@ -289,11 +289,11 @@ function Et() {
|
|
|
289
289
|
if (typeof e == "object")
|
|
290
290
|
switch (e.$$typeof) {
|
|
291
291
|
case c:
|
|
292
|
-
return
|
|
292
|
+
return Ur(e.render);
|
|
293
293
|
case a:
|
|
294
294
|
return Ce(e.type, l, g);
|
|
295
295
|
case i: {
|
|
296
|
-
var
|
|
296
|
+
var m = e, w = m._payload, I = m._init;
|
|
297
297
|
try {
|
|
298
298
|
return Ce(I(w), l, g);
|
|
299
299
|
} catch {
|
|
@@ -310,7 +310,7 @@ function Et() {
|
|
|
310
310
|
} else
|
|
311
311
|
Xe.setExtraStackFrame(null);
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Fr(e, l, g, m, w) {
|
|
314
314
|
{
|
|
315
315
|
var I = Function.call.bind(Ee);
|
|
316
316
|
for (var C in e)
|
|
@@ -318,28 +318,28 @@ function Et() {
|
|
|
318
318
|
var T = void 0;
|
|
319
319
|
try {
|
|
320
320
|
if (typeof e[C] != "function") {
|
|
321
|
-
var U = Error((
|
|
321
|
+
var U = Error((m || "React class") + ": " + g + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
322
322
|
throw U.name = "Invariant Violation", U;
|
|
323
323
|
}
|
|
324
|
-
T = e[C](l, C,
|
|
324
|
+
T = e[C](l, C, m, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
325
325
|
} catch (N) {
|
|
326
326
|
T = N;
|
|
327
327
|
}
|
|
328
|
-
T && !(T instanceof Error) && (Re(w), b("%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).",
|
|
328
|
+
T && !(T instanceof Error) && (Re(w), b("%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).", m || "React class", g, C, typeof T), Re(null)), T instanceof Error && !(T.message in ze) && (ze[T.message] = !0, Re(w), b("Failed %s type: %s", g, T.message), Re(null));
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
var
|
|
332
|
+
var qr = Array.isArray;
|
|
333
333
|
function Me(e) {
|
|
334
|
-
return
|
|
334
|
+
return qr(e);
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Gr(e) {
|
|
337
337
|
{
|
|
338
338
|
var l = typeof Symbol == "function" && Symbol.toStringTag, g = l && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
339
339
|
return g;
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function Jr(e) {
|
|
343
343
|
try {
|
|
344
344
|
return Ze(e), !1;
|
|
345
345
|
} catch {
|
|
@@ -350,16 +350,16 @@ function Et() {
|
|
|
350
350
|
return "" + e;
|
|
351
351
|
}
|
|
352
352
|
function er(e) {
|
|
353
|
-
if (
|
|
354
|
-
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
353
|
+
if (Jr(e))
|
|
354
|
+
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Gr(e)), Ze(e);
|
|
355
355
|
}
|
|
356
|
-
var rr = o.ReactCurrentOwner,
|
|
356
|
+
var rr = o.ReactCurrentOwner, Hr = {
|
|
357
357
|
key: !0,
|
|
358
358
|
ref: !0,
|
|
359
359
|
__self: !0,
|
|
360
360
|
__source: !0
|
|
361
361
|
}, tr, nr;
|
|
362
|
-
function
|
|
362
|
+
function Vr(e) {
|
|
363
363
|
if (Ee.call(e, "ref")) {
|
|
364
364
|
var l = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
365
365
|
if (l && l.isReactWarning)
|
|
@@ -367,7 +367,7 @@ function Et() {
|
|
|
367
367
|
}
|
|
368
368
|
return e.ref !== void 0;
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function $r(e) {
|
|
371
371
|
if (Ee.call(e, "key")) {
|
|
372
372
|
var l = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
373
373
|
if (l && l.isReactWarning)
|
|
@@ -375,10 +375,10 @@ function Et() {
|
|
|
375
375
|
}
|
|
376
376
|
return e.key !== void 0;
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function Br(e, l) {
|
|
379
379
|
typeof e.ref == "string" && rr.current;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function Kr(e, l) {
|
|
382
382
|
{
|
|
383
383
|
var g = function() {
|
|
384
384
|
tr || (tr = !0, b("%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)", l));
|
|
@@ -389,7 +389,7 @@ function Et() {
|
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Yr(e, l) {
|
|
393
393
|
{
|
|
394
394
|
var g = function() {
|
|
395
395
|
nr || (nr = !0, b("%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)", l));
|
|
@@ -400,10 +400,10 @@ function Et() {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
var
|
|
403
|
+
var xr = function(e, l, g, m, 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: y,
|
|
407
407
|
// Built-in properties that belong on the element
|
|
408
408
|
type: e,
|
|
409
409
|
key: l,
|
|
@@ -421,7 +421,7 @@ function Et() {
|
|
|
421
421
|
configurable: !1,
|
|
422
422
|
enumerable: !1,
|
|
423
423
|
writable: !1,
|
|
424
|
-
value:
|
|
424
|
+
value: m
|
|
425
425
|
}), Object.defineProperty(T, "_source", {
|
|
426
426
|
configurable: !1,
|
|
427
427
|
enumerable: !1,
|
|
@@ -429,12 +429,12 @@ function Et() {
|
|
|
429
429
|
value: w
|
|
430
430
|
}), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
|
|
431
431
|
};
|
|
432
|
-
function
|
|
432
|
+
function Qr(e, l, g, m, w) {
|
|
433
433
|
{
|
|
434
434
|
var I, C = {}, T = null, U = null;
|
|
435
|
-
g !== void 0 && (er(g), T = "" + g),
|
|
435
|
+
g !== void 0 && (er(g), T = "" + g), $r(l) && (er(l.key), T = "" + l.key), Vr(l) && (U = l.ref, Br(l, w));
|
|
436
436
|
for (I in l)
|
|
437
|
-
Ee.call(l, I) && !
|
|
437
|
+
Ee.call(l, I) && !Hr.hasOwnProperty(I) && (C[I] = l[I]);
|
|
438
438
|
if (e && e.defaultProps) {
|
|
439
439
|
var N = e.defaultProps;
|
|
440
440
|
for (I in N)
|
|
@@ -442,9 +442,9 @@ function Et() {
|
|
|
442
442
|
}
|
|
443
443
|
if (T || U) {
|
|
444
444
|
var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
445
|
-
T &&
|
|
445
|
+
T && Kr(C, M), U && Yr(C, M);
|
|
446
446
|
}
|
|
447
|
-
return
|
|
447
|
+
return xr(e, T, U, w, m, rr.current, C);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
var Le = o.ReactCurrentOwner, ar = o.ReactDebugCurrentFrame;
|
|
@@ -458,7 +458,7 @@ function Et() {
|
|
|
458
458
|
var De;
|
|
459
459
|
De = !1;
|
|
460
460
|
function je(e) {
|
|
461
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
461
|
+
return typeof e == "object" && e !== null && e.$$typeof === y;
|
|
462
462
|
}
|
|
463
463
|
function ur() {
|
|
464
464
|
{
|
|
@@ -472,11 +472,11 @@ Check the render method of \`` + e + "`.";
|
|
|
472
472
|
return "";
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function zr(e) {
|
|
476
476
|
return "";
|
|
477
477
|
}
|
|
478
478
|
var or = {};
|
|
479
|
-
function
|
|
479
|
+
function Xr(e) {
|
|
480
480
|
{
|
|
481
481
|
var l = ur();
|
|
482
482
|
if (!l) {
|
|
@@ -493,12 +493,12 @@ Check the top-level render call using <` + g + ">.");
|
|
|
493
493
|
if (!e._store || e._store.validated || e.key != null)
|
|
494
494
|
return;
|
|
495
495
|
e._store.validated = !0;
|
|
496
|
-
var g =
|
|
496
|
+
var g = Xr(l);
|
|
497
497
|
if (or[g])
|
|
498
498
|
return;
|
|
499
499
|
or[g] = !0;
|
|
500
|
-
var
|
|
501
|
-
e && e._owner && e._owner !== Le.current && (
|
|
500
|
+
var m = "";
|
|
501
|
+
e && e._owner && e._owner !== Le.current && (m = " It was passed a child from " + D(e._owner.type) + "."), ie(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, m), ie(null);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
function ir(e, l) {
|
|
@@ -507,8 +507,8 @@ Check the top-level render call using <` + g + ">.");
|
|
|
507
507
|
return;
|
|
508
508
|
if (Me(e))
|
|
509
509
|
for (var g = 0; g < e.length; g++) {
|
|
510
|
-
var
|
|
511
|
-
je(
|
|
510
|
+
var m = e[g];
|
|
511
|
+
je(m) && cr(m, l);
|
|
512
512
|
}
|
|
513
513
|
else if (je(e))
|
|
514
514
|
e._store && (e._store.validated = !0);
|
|
@@ -520,7 +520,7 @@ Check the top-level render call using <` + g + ">.");
|
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function Zr(e) {
|
|
524
524
|
{
|
|
525
525
|
var l = e.type;
|
|
526
526
|
if (l == null || typeof l == "string")
|
|
@@ -535,8 +535,8 @@ Check the top-level render call using <` + g + ">.");
|
|
|
535
535
|
else
|
|
536
536
|
return;
|
|
537
537
|
if (g) {
|
|
538
|
-
var
|
|
539
|
-
|
|
538
|
+
var m = D(l);
|
|
539
|
+
Fr(g, e.props, "prop", m, e);
|
|
540
540
|
} else if (l.PropTypes !== void 0 && !De) {
|
|
541
541
|
De = !0;
|
|
542
542
|
var w = D(l);
|
|
@@ -545,12 +545,12 @@ Check the top-level render call using <` + g + ">.");
|
|
|
545
545
|
typeof l.getDefaultProps == "function" && !l.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function et(e) {
|
|
549
549
|
{
|
|
550
550
|
for (var l = Object.keys(e.props), g = 0; g < l.length; g++) {
|
|
551
|
-
var
|
|
552
|
-
if (
|
|
553
|
-
ie(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
|
|
551
|
+
var m = l[g];
|
|
552
|
+
if (m !== "children" && m !== "key") {
|
|
553
|
+
ie(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), ie(null);
|
|
554
554
|
break;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
@@ -558,24 +558,24 @@ Check the top-level render call using <` + g + ">.");
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
var sr = {};
|
|
561
|
-
function lr(e, l, g,
|
|
561
|
+
function lr(e, l, g, m, w, I) {
|
|
562
562
|
{
|
|
563
563
|
var C = Ne(e);
|
|
564
564
|
if (!C) {
|
|
565
565
|
var T = "";
|
|
566
566
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).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 U =
|
|
567
|
+
var U = zr();
|
|
568
568
|
U ? T += U : T += ur();
|
|
569
569
|
var N;
|
|
570
|
-
e === null ? N = "null" : Me(e) ? N = "array" : e !== void 0 && e.$$typeof ===
|
|
570
|
+
e === null ? N = "null" : Me(e) ? N = "array" : e !== void 0 && e.$$typeof === y ? (N = "<" + (D(e.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e, b("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 = Qr(e, l, g, w, I);
|
|
573
573
|
if (M == null)
|
|
574
574
|
return M;
|
|
575
575
|
if (C) {
|
|
576
576
|
var q = l.children;
|
|
577
577
|
if (q !== void 0)
|
|
578
|
-
if (
|
|
578
|
+
if (m)
|
|
579
579
|
if (Me(q)) {
|
|
580
580
|
for (var se = 0; se < q.length; se++)
|
|
581
581
|
ir(q[se], e);
|
|
@@ -586,71 +586,71 @@ Check the top-level render call using <` + g + ">.");
|
|
|
586
586
|
ir(q, e);
|
|
587
587
|
}
|
|
588
588
|
if (Ee.call(l, "key")) {
|
|
589
|
-
var re = D(e), W = Object.keys(l).filter(function(
|
|
590
|
-
return
|
|
589
|
+
var re = D(e), W = Object.keys(l).filter(function(ot) {
|
|
590
|
+
return ot !== "key";
|
|
591
591
|
}), Ue = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
592
592
|
if (!sr[re + Ue]) {
|
|
593
|
-
var
|
|
593
|
+
var ut = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
|
|
594
594
|
b(`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} />`, Ue, re,
|
|
599
|
+
<%s key={someKey} {...props} />`, Ue, re, ut, re), sr[re + Ue] = !0;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
return e === E ?
|
|
602
|
+
return e === E ? et(M) : Zr(M), M;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function rt(e, l, g) {
|
|
606
606
|
return lr(e, l, g, !0);
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function tt(e, l, g) {
|
|
609
609
|
return lr(e, l, g, !1);
|
|
610
610
|
}
|
|
611
|
-
var
|
|
612
|
-
ye.Fragment = E, ye.jsx =
|
|
611
|
+
var nt = tt, at = rt;
|
|
612
|
+
ye.Fragment = E, ye.jsx = nt, ye.jsxs = at;
|
|
613
613
|
})()), ye;
|
|
614
614
|
}
|
|
615
|
-
var
|
|
616
|
-
function
|
|
617
|
-
return
|
|
615
|
+
var _r;
|
|
616
|
+
function ht() {
|
|
617
|
+
return _r || (_r = 1, process.env.NODE_ENV === "production" ? Pe.exports = yt() : Pe.exports = St()), Pe.exports;
|
|
618
618
|
}
|
|
619
|
-
var
|
|
620
|
-
const
|
|
621
|
-
const r =
|
|
619
|
+
var yr = ht();
|
|
620
|
+
const Mr = ct(null), ke = () => {
|
|
621
|
+
const r = it(Mr);
|
|
622
622
|
if (!r)
|
|
623
623
|
throw new Error("useApiContext must be used within ApiProvider");
|
|
624
624
|
return r;
|
|
625
625
|
};
|
|
626
|
-
function
|
|
626
|
+
function bt({
|
|
627
627
|
baseURL: r,
|
|
628
|
-
getToken:
|
|
628
|
+
getToken: y,
|
|
629
629
|
timeoutMs: O = 15e3,
|
|
630
630
|
lng: E = "tw",
|
|
631
631
|
store: f,
|
|
632
632
|
onError: _
|
|
633
633
|
} = {}) {
|
|
634
|
-
const
|
|
634
|
+
const S = ft.create({
|
|
635
635
|
baseURL: r,
|
|
636
636
|
timeout: O,
|
|
637
637
|
headers: { "Content-Type": "application/json" }
|
|
638
638
|
});
|
|
639
|
-
return
|
|
640
|
-
if (v.headers = v.headers || {},
|
|
641
|
-
const s = await
|
|
639
|
+
return S.interceptors.request.use(async (v) => {
|
|
640
|
+
if (v.headers = v.headers || {}, y) {
|
|
641
|
+
const s = await y();
|
|
642
642
|
s && (v.headers.Authorization = `Bearer ${s}`);
|
|
643
643
|
}
|
|
644
644
|
const c = f?.getState()?.isWalletCurrency;
|
|
645
645
|
return v.headers.Currency = c, v.headers["currency-code"] = c, v.headers.lang = E, v;
|
|
646
|
-
}),
|
|
646
|
+
}), S.interceptors.response.use(
|
|
647
647
|
(v) => v.data,
|
|
648
|
-
(v) => _ ? _(v, { instance:
|
|
649
|
-
),
|
|
648
|
+
(v) => _ ? _(v, { instance: S }) : Promise.reject(v)
|
|
649
|
+
), S;
|
|
650
650
|
}
|
|
651
|
-
function
|
|
652
|
-
const O = He(() =>
|
|
653
|
-
() => new
|
|
651
|
+
function jt({ children: r, ...y }) {
|
|
652
|
+
const O = He(() => bt(y), [y]), f = He(
|
|
653
|
+
() => new st({
|
|
654
654
|
defaultOptions: {
|
|
655
655
|
queries: {
|
|
656
656
|
refetchOnWindowFocus: !1,
|
|
@@ -660,31 +660,36 @@ function Mt({ children: r, ...S }) {
|
|
|
660
660
|
}),
|
|
661
661
|
[]
|
|
662
662
|
);
|
|
663
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ yr.jsx(lt, { client: f, children: /* @__PURE__ */ yr.jsx(Mr.Provider, { value: { client: O, ...y }, children: r }) });
|
|
664
664
|
}
|
|
665
|
-
const
|
|
666
|
-
const r = (E, f) => !E && !f,
|
|
665
|
+
const Ut = () => {
|
|
666
|
+
const r = (E, f) => !E && !f, y = (E) => E.startsWith("pc.");
|
|
667
667
|
return {
|
|
668
668
|
executeLogout: ({
|
|
669
669
|
isCallBackInvalid: E = !1,
|
|
670
670
|
hostname: f = "",
|
|
671
671
|
shouldRedirect: _,
|
|
672
|
-
onShowError:
|
|
672
|
+
onShowError: S,
|
|
673
673
|
onCleanup: v,
|
|
674
674
|
onRemoveToken: c,
|
|
675
675
|
onRedirect: s,
|
|
676
676
|
onGoogleLogout: u
|
|
677
677
|
}) => {
|
|
678
|
-
const a =
|
|
679
|
-
r(E, a) &&
|
|
678
|
+
const a = y(f);
|
|
679
|
+
r(E, a) && S?.(), v?.(), c?.(), _ && s?.("/"), u?.();
|
|
680
680
|
},
|
|
681
681
|
shouldShowErrorNotice: r,
|
|
682
|
-
isMachineDomain:
|
|
682
|
+
isMachineDomain: y
|
|
683
683
|
};
|
|
684
|
-
},
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
684
|
+
}, Wt = (r = []) => vt(r) ? vr(r) ? [] : dt(r, (y) => vr(y.SubPlatformEnum) ? y : y.SubPlatformEnum.map((O) => ({
|
|
685
|
+
...y,
|
|
686
|
+
...O,
|
|
687
|
+
platform: O.SubPlatformEnum,
|
|
688
|
+
platformEnum: O.SubPlatformEnum
|
|
689
|
+
}))) : [], Ve = () => {
|
|
690
|
+
const { client: r } = ke(), y = ue(
|
|
691
|
+
async (S) => {
|
|
692
|
+
const { mac_address: v = "", app_version: c = "", anydesk_id: s = "" } = S, { data: u } = await r.post("/cash-register/login", {
|
|
688
693
|
mac_address: v,
|
|
689
694
|
app_version: c,
|
|
690
695
|
anydesk_id: s
|
|
@@ -694,32 +699,77 @@ const Lt = () => {
|
|
|
694
699
|
[r]
|
|
695
700
|
), O = ue(async () => r.get("/member/getMemberInfo"), [r]), E = ue(async () => await r.get("member/getGameList"), [r]), f = ue(async () => await r.get("/member/getNowCurrencyExchange"), [r]), _ = ue(async () => await r.get("member/getFavoriteGame"), [r]);
|
|
696
701
|
return {
|
|
697
|
-
machineLoginApi:
|
|
702
|
+
machineLoginApi: y,
|
|
698
703
|
userInfoApi: O,
|
|
699
704
|
userGameListApi: E,
|
|
700
705
|
userFavoriteGameApi: _,
|
|
701
706
|
userCurrencyExchangeApi: f
|
|
702
707
|
};
|
|
703
|
-
},
|
|
704
|
-
const { userCurrencyExchangeApi: O } = Ve(), { getToken: E } = ke(), { enabled: f, ..._ } =
|
|
705
|
-
return
|
|
708
|
+
}, Ft = ({ otherQueryKey: r = [], options: y = {} } = {}) => {
|
|
709
|
+
const { userCurrencyExchangeApi: O } = Ve(), { getToken: E } = ke(), { enabled: f, ..._ } = y, S = !!E && (f ? f.every((v) => v) : !0);
|
|
710
|
+
return Nr({
|
|
706
711
|
queries: [
|
|
707
712
|
{
|
|
708
713
|
queryKey: ["userCurrencyExchange", ...r],
|
|
709
714
|
queryFn: () => O(),
|
|
710
|
-
enabled:
|
|
715
|
+
enabled: S,
|
|
711
716
|
// ← 使用合併後的條件
|
|
712
717
|
..._
|
|
713
718
|
// ← 不包含 enabled
|
|
714
719
|
}
|
|
715
720
|
]
|
|
716
721
|
});
|
|
722
|
+
}, qt = ({
|
|
723
|
+
refetchInterval: r = 5e4,
|
|
724
|
+
trigger: y = [],
|
|
725
|
+
enabled: O = !0
|
|
726
|
+
} = {}) => {
|
|
727
|
+
const { getToken: E } = ke(), { userInfoApi: f } = Ve(), _ = Nr({
|
|
728
|
+
queries: [
|
|
729
|
+
{
|
|
730
|
+
queryKey: ["getMemberInfo", ...y],
|
|
731
|
+
queryFn: async () => await f(),
|
|
732
|
+
refetchInterval: r,
|
|
733
|
+
enabled: !!E && O
|
|
734
|
+
}
|
|
735
|
+
]
|
|
736
|
+
}), { data: S, isFetching: v, error: c } = _[0] || {};
|
|
737
|
+
return { data: S, isFetching: v, error: c };
|
|
738
|
+
}, Gt = ({ enabled: r = !0 } = {}) => {
|
|
739
|
+
const {
|
|
740
|
+
userInfoApi: y,
|
|
741
|
+
userFavoriteGameApi: O,
|
|
742
|
+
userGameListApi: E,
|
|
743
|
+
userCurrencyExchangeApi: f
|
|
744
|
+
} = Ve(), _ = le({
|
|
745
|
+
queryKey: ["getMemInfo"],
|
|
746
|
+
queryFn: async () => y(),
|
|
747
|
+
enabled: r
|
|
748
|
+
}), S = le({
|
|
749
|
+
queryKey: ["getFavoriteGame"],
|
|
750
|
+
queryFn: async () => O(),
|
|
751
|
+
enabled: r && _.isSuccess
|
|
752
|
+
}), v = le({
|
|
753
|
+
queryKey: ["getUserGameList"],
|
|
754
|
+
queryFn: async () => E(),
|
|
755
|
+
enabled: r && _.isSuccess && S.isSuccess
|
|
756
|
+
}), c = le({
|
|
757
|
+
queryKey: ["getUserCurrencyExchange"],
|
|
758
|
+
queryFn: async () => f(),
|
|
759
|
+
enabled: r && _.isSuccess && S.isSuccess && v.isSuccess
|
|
760
|
+
});
|
|
761
|
+
return [
|
|
762
|
+
_,
|
|
763
|
+
S,
|
|
764
|
+
v,
|
|
765
|
+
c
|
|
766
|
+
];
|
|
717
767
|
};
|
|
718
|
-
var We = {}, F = {}, Fe = {},
|
|
768
|
+
var We = {}, F = {}, Fe = {}, Sr;
|
|
719
769
|
function V() {
|
|
720
|
-
return
|
|
770
|
+
return Sr || (Sr = 1, (function(r) {
|
|
721
771
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.isEventSourceSupported = r.isReactNative = r.ReadyState = r.DEFAULT_HEARTBEAT = r.UNPARSABLE_JSON_OBJECT = r.DEFAULT_RECONNECT_INTERVAL_MS = r.DEFAULT_RECONNECT_LIMIT = r.SOCKET_IO_PING_CODE = r.SOCKET_IO_PATH = r.SOCKET_IO_PING_INTERVAL = r.DEFAULT_EVENT_SOURCE_OPTIONS = r.EMPTY_EVENT_HANDLERS = r.DEFAULT_OPTIONS = void 0;
|
|
722
|
-
var
|
|
772
|
+
var y = 1, O = 1e3 * y;
|
|
723
773
|
r.DEFAULT_OPTIONS = {}, r.EMPTY_EVENT_HANDLERS = {}, r.DEFAULT_EVENT_SOURCE_OPTIONS = {
|
|
724
774
|
withCredentials: !1,
|
|
725
775
|
events: r.EMPTY_EVENT_HANDLERS
|
|
@@ -742,27 +792,27 @@ function V() {
|
|
|
742
792
|
r.isReactNative = typeof navigator < "u" && navigator.product === "ReactNative", r.isEventSourceSupported = !r.isReactNative && f();
|
|
743
793
|
})(Fe)), Fe;
|
|
744
794
|
}
|
|
745
|
-
var Se = {}, qe = {},
|
|
795
|
+
var Se = {}, qe = {}, hr;
|
|
746
796
|
function $e() {
|
|
747
|
-
return
|
|
797
|
+
return hr || (hr = 1, (function(r) {
|
|
748
798
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.resetWebSockets = r.sharedWebSockets = void 0, r.sharedWebSockets = {};
|
|
749
|
-
var
|
|
799
|
+
var y = function(O) {
|
|
750
800
|
if (O && r.sharedWebSockets.hasOwnProperty(O))
|
|
751
801
|
delete r.sharedWebSockets[O];
|
|
752
802
|
else
|
|
753
803
|
for (var E in r.sharedWebSockets)
|
|
754
804
|
r.sharedWebSockets.hasOwnProperty(E) && delete r.sharedWebSockets[E];
|
|
755
805
|
};
|
|
756
|
-
r.resetWebSockets =
|
|
806
|
+
r.resetWebSockets = y;
|
|
757
807
|
})(qe)), qe;
|
|
758
808
|
}
|
|
759
|
-
var te = {}, Y = {},
|
|
809
|
+
var te = {}, Y = {}, br;
|
|
760
810
|
function Be() {
|
|
761
|
-
if (
|
|
762
|
-
|
|
763
|
-
var r = V(),
|
|
811
|
+
if (br) return Y;
|
|
812
|
+
br = 1, Object.defineProperty(Y, "__esModule", { value: !0 }), Y.setUpSocketIOPing = Y.appendQueryParams = Y.parseSocketIOUrl = void 0;
|
|
813
|
+
var r = V(), y = function(f) {
|
|
764
814
|
if (f) {
|
|
765
|
-
var _ = /^https|wss/.test(f),
|
|
815
|
+
var _ = /^https|wss/.test(f), S = f.replace(/^(https?|wss?)(:\/\/)?/, ""), v = S.replace(/\/$/, ""), c = _ ? "wss" : "ws";
|
|
766
816
|
return "".concat(c, "://").concat(v).concat(r.SOCKET_IO_PATH);
|
|
767
817
|
} else if (f === "") {
|
|
768
818
|
var _ = /^https/.test(window.location.protocol), c = _ ? "wss" : "ws", s = window.location.port ? ":".concat(window.location.port) : "";
|
|
@@ -770,10 +820,10 @@ function Be() {
|
|
|
770
820
|
}
|
|
771
821
|
return f;
|
|
772
822
|
};
|
|
773
|
-
Y.parseSocketIOUrl =
|
|
823
|
+
Y.parseSocketIOUrl = y;
|
|
774
824
|
var O = function(f, _) {
|
|
775
825
|
_ === void 0 && (_ = {});
|
|
776
|
-
var
|
|
826
|
+
var S = /\?([\w]+=[\w]+)/, v = S.test(f), c = "".concat(Object.entries(_).reduce(function(s, u) {
|
|
777
827
|
var a = u[0], i = u[1];
|
|
778
828
|
return s + "".concat(a, "=").concat(i, "&");
|
|
779
829
|
}, "").slice(0, -1));
|
|
@@ -782,26 +832,26 @@ function Be() {
|
|
|
782
832
|
Y.appendQueryParams = O;
|
|
783
833
|
var E = function(f, _) {
|
|
784
834
|
_ === void 0 && (_ = r.SOCKET_IO_PING_INTERVAL);
|
|
785
|
-
var
|
|
835
|
+
var S = function() {
|
|
786
836
|
return f(r.SOCKET_IO_PING_CODE);
|
|
787
837
|
};
|
|
788
|
-
return window.setInterval(
|
|
838
|
+
return window.setInterval(S, _);
|
|
789
839
|
};
|
|
790
840
|
return Y.setUpSocketIOPing = E, Y;
|
|
791
841
|
}
|
|
792
|
-
var Ie = {},
|
|
793
|
-
function
|
|
794
|
-
if (
|
|
795
|
-
|
|
842
|
+
var Ie = {}, gr;
|
|
843
|
+
function Lr() {
|
|
844
|
+
if (gr) return Ie;
|
|
845
|
+
gr = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.heartbeat = O;
|
|
796
846
|
var r = V();
|
|
797
|
-
function
|
|
847
|
+
function y(E) {
|
|
798
848
|
return Array.isArray(E) ? E.reduce(function(f, _) {
|
|
799
849
|
return f.current > _.current ? f : _;
|
|
800
850
|
}).current : E.current;
|
|
801
851
|
}
|
|
802
852
|
function O(E, f, _) {
|
|
803
|
-
var
|
|
804
|
-
var h = Date.now(), o =
|
|
853
|
+
var S = _ || {}, v = S.interval, c = v === void 0 ? r.DEFAULT_HEARTBEAT.interval : v, s = S.timeout, u = s === void 0 ? r.DEFAULT_HEARTBEAT.timeout : s, a = S.message, i = a === void 0 ? r.DEFAULT_HEARTBEAT.message : a, t = Math.max(100, c / 10), n = Date.now(), d = setInterval(function() {
|
|
854
|
+
var h = Date.now(), o = y(f);
|
|
805
855
|
if (o + u <= h)
|
|
806
856
|
console.warn("Heartbeat timed out, closing connection, last message received ".concat(h - o, "ms ago, last ping sent ").concat(h - n, "ms ago")), E.close();
|
|
807
857
|
else if (o + c <= h && n + c <= h)
|
|
@@ -818,53 +868,53 @@ function Mr() {
|
|
|
818
868
|
}
|
|
819
869
|
return Ie;
|
|
820
870
|
}
|
|
821
|
-
var he = {}, Ge = {},
|
|
871
|
+
var he = {}, Ge = {}, Or;
|
|
822
872
|
function Ke() {
|
|
823
|
-
return
|
|
873
|
+
return Or || (Or = 1, (function(r) {
|
|
824
874
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.resetSubscribers = r.removeSubscriber = r.addSubscriber = r.hasSubscribers = r.getSubscribers = void 0;
|
|
825
|
-
var
|
|
826
|
-
return (0, r.hasSubscribers)(c) ? Array.from(
|
|
875
|
+
var y = {}, O = [], E = function(c) {
|
|
876
|
+
return (0, r.hasSubscribers)(c) ? Array.from(y[c]) : O;
|
|
827
877
|
};
|
|
828
878
|
r.getSubscribers = E;
|
|
829
879
|
var f = function(c) {
|
|
830
880
|
var s;
|
|
831
|
-
return ((s =
|
|
881
|
+
return ((s = y[c]) === null || s === void 0 ? void 0 : s.size) > 0;
|
|
832
882
|
};
|
|
833
883
|
r.hasSubscribers = f;
|
|
834
884
|
var _ = function(c, s) {
|
|
835
|
-
|
|
885
|
+
y[c] = y[c] || /* @__PURE__ */ new Set(), y[c].add(s);
|
|
836
886
|
};
|
|
837
887
|
r.addSubscriber = _;
|
|
838
|
-
var
|
|
839
|
-
|
|
888
|
+
var S = function(c, s) {
|
|
889
|
+
y[c].delete(s);
|
|
840
890
|
};
|
|
841
|
-
r.removeSubscriber =
|
|
891
|
+
r.removeSubscriber = S;
|
|
842
892
|
var v = function(c) {
|
|
843
|
-
if (c &&
|
|
844
|
-
delete
|
|
893
|
+
if (c && y.hasOwnProperty(c))
|
|
894
|
+
delete y[c];
|
|
845
895
|
else
|
|
846
|
-
for (var s in
|
|
847
|
-
|
|
896
|
+
for (var s in y)
|
|
897
|
+
y.hasOwnProperty(s) && delete y[s];
|
|
848
898
|
};
|
|
849
899
|
r.resetSubscribers = v;
|
|
850
900
|
})(Ge)), Ge;
|
|
851
901
|
}
|
|
852
|
-
var
|
|
902
|
+
var mr;
|
|
853
903
|
function Ye() {
|
|
854
|
-
if (
|
|
855
|
-
|
|
856
|
-
var r = $e(),
|
|
904
|
+
if (mr) return he;
|
|
905
|
+
mr = 1, Object.defineProperty(he, "__esModule", { value: !0 }), he.assertIsWebSocket = O, he.resetGlobalState = E;
|
|
906
|
+
var r = $e(), y = Ke();
|
|
857
907
|
function O(f, _) {
|
|
858
908
|
if (!_ && !(f instanceof WebSocket))
|
|
859
909
|
throw new Error("");
|
|
860
910
|
}
|
|
861
911
|
function E(f) {
|
|
862
|
-
(0,
|
|
912
|
+
(0, y.resetSubscribers)(f), (0, r.resetWebSockets)(f);
|
|
863
913
|
}
|
|
864
914
|
return he;
|
|
865
915
|
}
|
|
866
916
|
var pr;
|
|
867
|
-
function
|
|
917
|
+
function gt() {
|
|
868
918
|
if (pr) return te;
|
|
869
919
|
pr = 1;
|
|
870
920
|
var r = te && te.__assign || function() {
|
|
@@ -877,12 +927,12 @@ function St() {
|
|
|
877
927
|
}, r.apply(this, arguments);
|
|
878
928
|
};
|
|
879
929
|
Object.defineProperty(te, "__esModule", { value: !0 }), te.attachListeners = void 0;
|
|
880
|
-
var
|
|
930
|
+
var y = Be(), O = Lr(), E = V(), f = Ye(), _ = function(u, a, i, t) {
|
|
881
931
|
u.onmessage = function(n) {
|
|
882
932
|
var d;
|
|
883
933
|
a.current.onMessage && a.current.onMessage(n), typeof t?.current == "number" && (t.current = Date.now()), !(typeof a.current.filter == "function" && a.current.filter(n) !== !0) && (a.current.heartbeat && typeof a.current.heartbeat != "boolean" && ((d = a.current.heartbeat) === null || d === void 0 ? void 0 : d.returnMessage) === n.data || i(n));
|
|
884
934
|
};
|
|
885
|
-
},
|
|
935
|
+
}, S = function(u, a, i, t, n) {
|
|
886
936
|
u.onopen = function(d) {
|
|
887
937
|
if (a.current.onOpen && a.current.onOpen(d), t.current = 0, i(E.ReadyState.OPEN), a.current.heartbeat && u instanceof WebSocket) {
|
|
888
938
|
var h = typeof a.current.heartbeat == "boolean" ? void 0 : a.current.heartbeat;
|
|
@@ -926,17 +976,17 @@ function St() {
|
|
|
926
976
|
return d && window.clearTimeout(d);
|
|
927
977
|
};
|
|
928
978
|
}, s = function(u, a, i, t, n, d, h) {
|
|
929
|
-
var o = a.setLastMessage, b = a.setReadyState, R, P,
|
|
930
|
-
return i.current.fromSocketIO && (R = (0,
|
|
931
|
-
b(E.ReadyState.CLOSING), P(),
|
|
979
|
+
var o = a.setLastMessage, b = a.setReadyState, R, P, p;
|
|
980
|
+
return i.current.fromSocketIO && (R = (0, y.setUpSocketIOPing)(h)), _(u, i, o, d), S(u, i, b, n, d), P = v(u, i, b, t, n), p = c(u, i, b, t, n), function() {
|
|
981
|
+
b(E.ReadyState.CLOSING), P(), p(), u.close(), R && clearInterval(R);
|
|
932
982
|
};
|
|
933
983
|
};
|
|
934
984
|
return te.attachListeners = s, te;
|
|
935
985
|
}
|
|
936
|
-
var ne = {},
|
|
937
|
-
function
|
|
938
|
-
if (
|
|
939
|
-
|
|
986
|
+
var ne = {}, Tr;
|
|
987
|
+
function Ot() {
|
|
988
|
+
if (Tr) return ne;
|
|
989
|
+
Tr = 1;
|
|
940
990
|
var r = ne && ne.__assign || function() {
|
|
941
991
|
return r = Object.assign || function(a) {
|
|
942
992
|
for (var i, t = 1, n = arguments.length; t < n; t++) {
|
|
@@ -947,7 +997,7 @@ function ht() {
|
|
|
947
997
|
}, r.apply(this, arguments);
|
|
948
998
|
};
|
|
949
999
|
Object.defineProperty(ne, "__esModule", { value: !0 }), ne.attachSharedListeners = void 0;
|
|
950
|
-
var
|
|
1000
|
+
var y = $e(), O = V(), E = Ke(), f = Be(), _ = Lr(), S = function(a, i, t) {
|
|
951
1001
|
a.onmessage = function(n) {
|
|
952
1002
|
(0, E.getSubscribers)(i).forEach(function(d) {
|
|
953
1003
|
var h;
|
|
@@ -967,7 +1017,7 @@ function ht() {
|
|
|
967
1017
|
a instanceof WebSocket && (a.onclose = function(t) {
|
|
968
1018
|
(0, E.getSubscribers)(i).forEach(function(n) {
|
|
969
1019
|
n.optionsRef.current.onClose && n.optionsRef.current.onClose(t), n.setReadyState(O.ReadyState.CLOSED);
|
|
970
|
-
}), delete
|
|
1020
|
+
}), delete y.sharedWebSockets[i], (0, E.getSubscribers)(i).forEach(function(n) {
|
|
971
1021
|
var d;
|
|
972
1022
|
if (n.optionsRef.current.shouldReconnect && n.optionsRef.current.shouldReconnect(t)) {
|
|
973
1023
|
var h = (d = n.optionsRef.current.reconnectAttempts) !== null && d !== void 0 ? d : O.DEFAULT_RECONNECT_LIMIT;
|
|
@@ -989,35 +1039,35 @@ function ht() {
|
|
|
989
1039
|
};
|
|
990
1040
|
}, u = function(a, i, t, n) {
|
|
991
1041
|
var d;
|
|
992
|
-
return t.current.fromSocketIO && (d = (0, f.setUpSocketIOPing)(n)),
|
|
1042
|
+
return t.current.fromSocketIO && (d = (0, f.setUpSocketIOPing)(n)), S(a, i, t.current.heartbeat), c(a, i), v(a, i, t.current.heartbeat), s(a, i), function() {
|
|
993
1043
|
d && clearInterval(d);
|
|
994
1044
|
};
|
|
995
1045
|
};
|
|
996
1046
|
return ne.attachSharedListeners = u, ne;
|
|
997
1047
|
}
|
|
998
|
-
var
|
|
999
|
-
function
|
|
1000
|
-
if (
|
|
1001
|
-
|
|
1002
|
-
var r = $e(),
|
|
1048
|
+
var Cr;
|
|
1049
|
+
function mt() {
|
|
1050
|
+
if (Cr) return Se;
|
|
1051
|
+
Cr = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.createOrJoinSocket = void 0;
|
|
1052
|
+
var r = $e(), y = V(), O = gt(), E = Ot(), f = Ke(), _ = function(v, c, s, u, a) {
|
|
1003
1053
|
return function() {
|
|
1004
1054
|
if ((0, f.removeSubscriber)(v, c), !(0, f.hasSubscribers)(v)) {
|
|
1005
1055
|
try {
|
|
1006
1056
|
var i = r.sharedWebSockets[v];
|
|
1007
1057
|
i instanceof WebSocket && (i.onclose = function(t) {
|
|
1008
|
-
s.current.onClose && s.current.onClose(t), u(
|
|
1058
|
+
s.current.onClose && s.current.onClose(t), u(y.ReadyState.CLOSED);
|
|
1009
1059
|
}), i.close();
|
|
1010
1060
|
} catch {
|
|
1011
1061
|
}
|
|
1012
1062
|
a && a(), delete r.sharedWebSockets[v];
|
|
1013
1063
|
}
|
|
1014
1064
|
};
|
|
1015
|
-
},
|
|
1016
|
-
if (!
|
|
1017
|
-
throw
|
|
1065
|
+
}, S = function(v, c, s, u, a, i, t, n, d) {
|
|
1066
|
+
if (!y.isEventSourceSupported && u.current.eventSourceOptions)
|
|
1067
|
+
throw y.isReactNative ? new Error("EventSource is not supported in ReactNative") : new Error("EventSource is not supported");
|
|
1018
1068
|
if (u.current.share) {
|
|
1019
1069
|
var h = null;
|
|
1020
|
-
r.sharedWebSockets[c] === void 0 ? (r.sharedWebSockets[c] = u.current.eventSourceOptions ? new EventSource(c, u.current.eventSourceOptions) : new WebSocket(c, u.current.protocols), v.current = r.sharedWebSockets[c], s(
|
|
1070
|
+
r.sharedWebSockets[c] === void 0 ? (r.sharedWebSockets[c] = u.current.eventSourceOptions ? new EventSource(c, u.current.eventSourceOptions) : new WebSocket(c, u.current.protocols), v.current = r.sharedWebSockets[c], s(y.ReadyState.CONNECTING), h = (0, E.attachSharedListeners)(r.sharedWebSockets[c], c, u, d)) : (v.current = r.sharedWebSockets[c], s(r.sharedWebSockets[c].readyState));
|
|
1021
1071
|
var o = {
|
|
1022
1072
|
setLastMessage: a,
|
|
1023
1073
|
setReadyState: s,
|
|
@@ -1028,7 +1078,7 @@ function bt() {
|
|
|
1028
1078
|
};
|
|
1029
1079
|
return (0, f.addSubscriber)(c, o), _(c, o, u, s, h);
|
|
1030
1080
|
} else {
|
|
1031
|
-
if (v.current = u.current.eventSourceOptions ? new EventSource(c, u.current.eventSourceOptions) : new WebSocket(c, u.current.protocols), s(
|
|
1081
|
+
if (v.current = u.current.eventSourceOptions ? new EventSource(c, u.current.eventSourceOptions) : new WebSocket(c, u.current.protocols), s(y.ReadyState.CONNECTING), !v.current)
|
|
1032
1082
|
throw new Error("WebSocket failed to be created");
|
|
1033
1083
|
return (0, O.attachListeners)(v.current, {
|
|
1034
1084
|
setLastMessage: a,
|
|
@@ -1036,12 +1086,12 @@ function bt() {
|
|
|
1036
1086
|
}, u, i.current, t, n, d);
|
|
1037
1087
|
}
|
|
1038
1088
|
};
|
|
1039
|
-
return Se.createOrJoinSocket =
|
|
1089
|
+
return Se.createOrJoinSocket = S, Se;
|
|
1040
1090
|
}
|
|
1041
|
-
var x = {},
|
|
1042
|
-
function
|
|
1043
|
-
return
|
|
1044
|
-
var
|
|
1091
|
+
var x = {}, Rr;
|
|
1092
|
+
function pt() {
|
|
1093
|
+
return Rr || (Rr = 1, (function(r) {
|
|
1094
|
+
var y = x && x.__awaiter || function(c, s, u, a) {
|
|
1045
1095
|
function i(t) {
|
|
1046
1096
|
return t instanceof u ? t : new u(function(n) {
|
|
1047
1097
|
n(t);
|
|
@@ -1132,15 +1182,15 @@ function gt() {
|
|
|
1132
1182
|
return c.concat(t || Array.prototype.slice.call(s));
|
|
1133
1183
|
};
|
|
1134
1184
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.getUrl = void 0;
|
|
1135
|
-
var f = Be(), _ = V(),
|
|
1185
|
+
var f = Be(), _ = V(), S = function(c) {
|
|
1136
1186
|
return new Promise(function(s) {
|
|
1137
1187
|
return window.setTimeout(s, c);
|
|
1138
1188
|
});
|
|
1139
1189
|
}, v = function(c, s) {
|
|
1140
1190
|
for (var u = [], a = 2; a < arguments.length; a++)
|
|
1141
1191
|
u[a - 2] = arguments[a];
|
|
1142
|
-
return
|
|
1143
|
-
var d, h, o, b, R, P,
|
|
1192
|
+
return y(void 0, E([c, s], u, !0), void 0, function(i, t, n) {
|
|
1193
|
+
var d, h, o, b, R, P, p, A;
|
|
1144
1194
|
return n === void 0 && (n = 0), O(this, function(k) {
|
|
1145
1195
|
switch (k.label) {
|
|
1146
1196
|
case 0:
|
|
@@ -1151,11 +1201,11 @@ function gt() {
|
|
|
1151
1201
|
case 2:
|
|
1152
1202
|
return d = k.sent(), [3, 9];
|
|
1153
1203
|
case 3:
|
|
1154
|
-
return k.sent(), t.current.retryOnError ? (h = (P = t.current.reconnectAttempts) !== null && P !== void 0 ? P : _.DEFAULT_RECONNECT_LIMIT, n < h ? (o = typeof t.current.reconnectInterval == "function" ? t.current.reconnectInterval(n) : t.current.reconnectInterval, [4,
|
|
1204
|
+
return k.sent(), t.current.retryOnError ? (h = (P = t.current.reconnectAttempts) !== null && P !== void 0 ? P : _.DEFAULT_RECONNECT_LIMIT, n < h ? (o = typeof t.current.reconnectInterval == "function" ? t.current.reconnectInterval(n) : t.current.reconnectInterval, [4, S(o ?? _.DEFAULT_RECONNECT_INTERVAL_MS)]) : [3, 5]) : [3, 7];
|
|
1155
1205
|
case 4:
|
|
1156
1206
|
return k.sent(), [2, (0, r.getUrl)(i, t, n + 1)];
|
|
1157
1207
|
case 5:
|
|
1158
|
-
return (A = (
|
|
1208
|
+
return (A = (p = t.current).onReconnectStop) === null || A === void 0 || A.call(p, n), [2, null];
|
|
1159
1209
|
case 6:
|
|
1160
1210
|
return [3, 8];
|
|
1161
1211
|
case 7:
|
|
@@ -1175,29 +1225,29 @@ function gt() {
|
|
|
1175
1225
|
r.getUrl = v;
|
|
1176
1226
|
})(x)), x;
|
|
1177
1227
|
}
|
|
1178
|
-
var Je = {},
|
|
1179
|
-
function
|
|
1180
|
-
return
|
|
1228
|
+
var Je = {}, wr;
|
|
1229
|
+
function Tt() {
|
|
1230
|
+
return wr || (wr = 1, (function(r) {
|
|
1181
1231
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.websocketWrapper = void 0;
|
|
1182
|
-
var
|
|
1232
|
+
var y = function(O, E) {
|
|
1183
1233
|
return new Proxy(O, {
|
|
1184
1234
|
get: function(f, _) {
|
|
1185
|
-
var
|
|
1186
|
-
return _ === "reconnect" ? E : typeof
|
|
1187
|
-
}) :
|
|
1235
|
+
var S = f[_];
|
|
1236
|
+
return _ === "reconnect" ? E : typeof S == "function" ? (console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."), function() {
|
|
1237
|
+
}) : S;
|
|
1188
1238
|
},
|
|
1189
|
-
set: function(f, _,
|
|
1190
|
-
return /^on/.test(_) ? (console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."), !1) : (f[_] =
|
|
1239
|
+
set: function(f, _, S) {
|
|
1240
|
+
return /^on/.test(_) ? (console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."), !1) : (f[_] = S, !0);
|
|
1191
1241
|
}
|
|
1192
1242
|
});
|
|
1193
1243
|
};
|
|
1194
|
-
r.websocketWrapper =
|
|
1244
|
+
r.websocketWrapper = y, r.default = r.websocketWrapper;
|
|
1195
1245
|
})(Je)), Je;
|
|
1196
1246
|
}
|
|
1197
|
-
var
|
|
1247
|
+
var Ar;
|
|
1198
1248
|
function xe() {
|
|
1199
|
-
if (
|
|
1200
|
-
|
|
1249
|
+
if (Ar) return F;
|
|
1250
|
+
Ar = 1;
|
|
1201
1251
|
var r = F && F.__assign || function() {
|
|
1202
1252
|
return r = Object.assign || function(i) {
|
|
1203
1253
|
for (var t, n = 1, d = arguments.length; n < d; n++) {
|
|
@@ -1206,7 +1256,7 @@ function xe() {
|
|
|
1206
1256
|
}
|
|
1207
1257
|
return i;
|
|
1208
1258
|
}, r.apply(this, arguments);
|
|
1209
|
-
},
|
|
1259
|
+
}, y = F && F.__awaiter || function(i, t, n, d) {
|
|
1210
1260
|
function h(o) {
|
|
1211
1261
|
return o instanceof n ? o : new n(function(b) {
|
|
1212
1262
|
b(o);
|
|
@@ -1215,22 +1265,22 @@ function xe() {
|
|
|
1215
1265
|
return new (n || (n = Promise))(function(o, b) {
|
|
1216
1266
|
function R(A) {
|
|
1217
1267
|
try {
|
|
1218
|
-
|
|
1268
|
+
p(d.next(A));
|
|
1219
1269
|
} catch (k) {
|
|
1220
1270
|
b(k);
|
|
1221
1271
|
}
|
|
1222
1272
|
}
|
|
1223
1273
|
function P(A) {
|
|
1224
1274
|
try {
|
|
1225
|
-
|
|
1275
|
+
p(d.throw(A));
|
|
1226
1276
|
} catch (k) {
|
|
1227
1277
|
b(k);
|
|
1228
1278
|
}
|
|
1229
1279
|
}
|
|
1230
|
-
function
|
|
1280
|
+
function p(A) {
|
|
1231
1281
|
A.done ? o(A.value) : h(A.value).then(R, P);
|
|
1232
1282
|
}
|
|
1233
|
-
|
|
1283
|
+
p((d = d.apply(i, t || [])).next());
|
|
1234
1284
|
});
|
|
1235
1285
|
}, O = F && F.__generator || function(i, t) {
|
|
1236
1286
|
var n = { label: 0, sent: function() {
|
|
@@ -1240,91 +1290,91 @@ function xe() {
|
|
|
1240
1290
|
return b.next = R(0), b.throw = R(1), b.return = R(2), typeof Symbol == "function" && (b[Symbol.iterator] = function() {
|
|
1241
1291
|
return this;
|
|
1242
1292
|
}), b;
|
|
1243
|
-
function R(
|
|
1293
|
+
function R(p) {
|
|
1244
1294
|
return function(A) {
|
|
1245
|
-
return P([
|
|
1295
|
+
return P([p, A]);
|
|
1246
1296
|
};
|
|
1247
1297
|
}
|
|
1248
|
-
function P(
|
|
1298
|
+
function P(p) {
|
|
1249
1299
|
if (d) throw new TypeError("Generator is already executing.");
|
|
1250
|
-
for (; b && (b = 0,
|
|
1251
|
-
if (d = 1, h && (o =
|
|
1252
|
-
switch (h = 0, o && (
|
|
1300
|
+
for (; b && (b = 0, p[0] && (n = 0)), n; ) try {
|
|
1301
|
+
if (d = 1, h && (o = p[0] & 2 ? h.return : p[0] ? h.throw || ((o = h.return) && o.call(h), 0) : h.next) && !(o = o.call(h, p[1])).done) return o;
|
|
1302
|
+
switch (h = 0, o && (p = [p[0] & 2, o.value]), p[0]) {
|
|
1253
1303
|
case 0:
|
|
1254
1304
|
case 1:
|
|
1255
|
-
o =
|
|
1305
|
+
o = p;
|
|
1256
1306
|
break;
|
|
1257
1307
|
case 4:
|
|
1258
|
-
return n.label++, { value:
|
|
1308
|
+
return n.label++, { value: p[1], done: !1 };
|
|
1259
1309
|
case 5:
|
|
1260
|
-
n.label++, h =
|
|
1310
|
+
n.label++, h = p[1], p = [0];
|
|
1261
1311
|
continue;
|
|
1262
1312
|
case 7:
|
|
1263
|
-
|
|
1313
|
+
p = n.ops.pop(), n.trys.pop();
|
|
1264
1314
|
continue;
|
|
1265
1315
|
default:
|
|
1266
|
-
if (o = n.trys, !(o = o.length > 0 && o[o.length - 1]) && (
|
|
1316
|
+
if (o = n.trys, !(o = o.length > 0 && o[o.length - 1]) && (p[0] === 6 || p[0] === 2)) {
|
|
1267
1317
|
n = 0;
|
|
1268
1318
|
continue;
|
|
1269
1319
|
}
|
|
1270
|
-
if (
|
|
1271
|
-
n.label =
|
|
1320
|
+
if (p[0] === 3 && (!o || p[1] > o[0] && p[1] < o[3])) {
|
|
1321
|
+
n.label = p[1];
|
|
1272
1322
|
break;
|
|
1273
1323
|
}
|
|
1274
|
-
if (
|
|
1275
|
-
n.label = o[1], o =
|
|
1324
|
+
if (p[0] === 6 && n.label < o[1]) {
|
|
1325
|
+
n.label = o[1], o = p;
|
|
1276
1326
|
break;
|
|
1277
1327
|
}
|
|
1278
1328
|
if (o && n.label < o[2]) {
|
|
1279
|
-
n.label = o[2], n.ops.push(
|
|
1329
|
+
n.label = o[2], n.ops.push(p);
|
|
1280
1330
|
break;
|
|
1281
1331
|
}
|
|
1282
1332
|
o[2] && n.ops.pop(), n.trys.pop();
|
|
1283
1333
|
continue;
|
|
1284
1334
|
}
|
|
1285
|
-
|
|
1335
|
+
p = t.call(i, n);
|
|
1286
1336
|
} catch (A) {
|
|
1287
|
-
|
|
1337
|
+
p = [6, A], h = 0;
|
|
1288
1338
|
} finally {
|
|
1289
1339
|
d = o = 0;
|
|
1290
1340
|
}
|
|
1291
|
-
if (
|
|
1292
|
-
return { value:
|
|
1341
|
+
if (p[0] & 5) throw p[1];
|
|
1342
|
+
return { value: p[0] ? p[1] : void 0, done: !0 };
|
|
1293
1343
|
}
|
|
1294
1344
|
}, E = F && F.__importDefault || function(i) {
|
|
1295
1345
|
return i && i.__esModule ? i : { default: i };
|
|
1296
1346
|
};
|
|
1297
1347
|
Object.defineProperty(F, "__esModule", { value: !0 }), F.useWebSocket = void 0;
|
|
1298
|
-
var f = be, _ =
|
|
1299
|
-
t === void 0 && (t =
|
|
1300
|
-
var d = (0, f.useState)(null), h = d[0], o = d[1], b = (0, f.useState)({}), R = b[0], P = b[1],
|
|
1348
|
+
var f = be, _ = Et, S = V(), v = mt(), c = pt(), s = E(Tt()), u = Ye(), a = function(i, t, n) {
|
|
1349
|
+
t === void 0 && (t = S.DEFAULT_OPTIONS), n === void 0 && (n = !0);
|
|
1350
|
+
var d = (0, f.useState)(null), h = d[0], o = d[1], b = (0, f.useState)({}), R = b[0], P = b[1], p = (0, f.useMemo)(function() {
|
|
1301
1351
|
if (!t.disableJson && h)
|
|
1302
1352
|
try {
|
|
1303
1353
|
return JSON.parse(h.data);
|
|
1304
1354
|
} catch {
|
|
1305
|
-
return
|
|
1355
|
+
return S.UNPARSABLE_JSON_OBJECT;
|
|
1306
1356
|
}
|
|
1307
1357
|
return null;
|
|
1308
1358
|
}, [h, t.disableJson]), A = (0, f.useRef)(null), k = (0, f.useRef)(null), fe = (0, f.useRef)(function() {
|
|
1309
1359
|
}), ve = (0, f.useRef)(0), Ne = (0, f.useRef)(Date.now()), ge = (0, f.useRef)([]), J = (0, f.useRef)(null), D = (0, f.useRef)(t);
|
|
1310
1360
|
D.current = t;
|
|
1311
|
-
var G = A.current && R[A.current] !== void 0 ? R[A.current] : i !== null && n === !0 ?
|
|
1361
|
+
var G = A.current && R[A.current] !== void 0 ? R[A.current] : i !== null && n === !0 ? S.ReadyState.CONNECTING : S.ReadyState.UNINSTANTIATED, X = t.queryParams ? JSON.stringify(t.queryParams) : null, $ = (0, f.useCallback)(function(L, j) {
|
|
1312
1362
|
var B;
|
|
1313
|
-
if (j === void 0 && (j = !0),
|
|
1363
|
+
if (j === void 0 && (j = !0), S.isEventSourceSupported && k.current instanceof EventSource) {
|
|
1314
1364
|
console.warn("Unable to send a message from an eventSource");
|
|
1315
1365
|
return;
|
|
1316
1366
|
}
|
|
1317
|
-
((B = k.current) === null || B === void 0 ? void 0 : B.readyState) ===
|
|
1367
|
+
((B = k.current) === null || B === void 0 ? void 0 : B.readyState) === S.ReadyState.OPEN ? ((0, u.assertIsWebSocket)(k.current, D.current.skipAssert), k.current.send(L)) : j && ge.current.push(L);
|
|
1318
1368
|
}, []), Oe = (0, f.useCallback)(function(L, j) {
|
|
1319
1369
|
j === void 0 && (j = !0), $(JSON.stringify(L), j);
|
|
1320
|
-
}, [$]),
|
|
1321
|
-
return D.current.share !== !0 ||
|
|
1370
|
+
}, [$]), me = (0, f.useCallback)(function() {
|
|
1371
|
+
return D.current.share !== !0 || S.isEventSourceSupported && k.current instanceof EventSource ? k.current : (J.current === null && k.current && ((0, u.assertIsWebSocket)(k.current, D.current.skipAssert), J.current = (0, s.default)(k.current, fe)), J.current);
|
|
1322
1372
|
}, []);
|
|
1323
1373
|
return (0, f.useEffect)(function() {
|
|
1324
1374
|
if (i !== null && n === !0) {
|
|
1325
1375
|
var L, j = !1, B = !0, de = function() {
|
|
1326
|
-
return
|
|
1327
|
-
var Z, z,
|
|
1376
|
+
return y(void 0, void 0, void 0, function() {
|
|
1377
|
+
var Z, z, pe;
|
|
1328
1378
|
return O(this, function(oe) {
|
|
1329
1379
|
switch (oe.label) {
|
|
1330
1380
|
case 0:
|
|
@@ -1332,7 +1382,7 @@ function xe() {
|
|
|
1332
1382
|
case 1:
|
|
1333
1383
|
return Z.current = oe.sent(), A.current === null ? (console.error("Failed to get a valid URL. WebSocket connection aborted."), A.current = "ABORTED", (0, _.flushSync)(function() {
|
|
1334
1384
|
return P(function(K) {
|
|
1335
|
-
return r(r({}, K), { ABORTED:
|
|
1385
|
+
return r(r({}, K), { ABORTED: S.ReadyState.CLOSED });
|
|
1336
1386
|
});
|
|
1337
1387
|
}), [
|
|
1338
1388
|
2
|
|
@@ -1341,14 +1391,14 @@ function xe() {
|
|
|
1341
1391
|
j || (0, _.flushSync)(function() {
|
|
1342
1392
|
return o(K);
|
|
1343
1393
|
});
|
|
1344
|
-
},
|
|
1394
|
+
}, pe = function(K) {
|
|
1345
1395
|
j || (0, _.flushSync)(function() {
|
|
1346
1396
|
return P(function(ce) {
|
|
1347
1397
|
var ee;
|
|
1348
1398
|
return r(r({}, ce), A.current && (ee = {}, ee[A.current] = K, ee));
|
|
1349
1399
|
});
|
|
1350
1400
|
});
|
|
1351
|
-
}, B && (L = (0, v.createOrJoinSocket)(k, A.current,
|
|
1401
|
+
}, B && (L = (0, v.createOrJoinSocket)(k, A.current, pe, D, z, fe, ve, Ne, $)), [
|
|
1352
1402
|
2
|
|
1353
1403
|
/*return*/
|
|
1354
1404
|
]);
|
|
@@ -1363,27 +1413,27 @@ function xe() {
|
|
|
1363
1413
|
};
|
|
1364
1414
|
} else (i === null || n === !1) && (ve.current = 0, P(function(Z) {
|
|
1365
1415
|
var z;
|
|
1366
|
-
return r(r({}, Z), A.current && (z = {}, z[A.current] =
|
|
1416
|
+
return r(r({}, Z), A.current && (z = {}, z[A.current] = S.ReadyState.CLOSED, z));
|
|
1367
1417
|
}));
|
|
1368
1418
|
}, [i, n, X, $]), (0, f.useEffect)(function() {
|
|
1369
|
-
G ===
|
|
1419
|
+
G === S.ReadyState.OPEN && ge.current.splice(0).forEach(function(L) {
|
|
1370
1420
|
$(L);
|
|
1371
1421
|
});
|
|
1372
1422
|
}, [G]), {
|
|
1373
1423
|
sendMessage: $,
|
|
1374
1424
|
sendJsonMessage: Oe,
|
|
1375
1425
|
lastMessage: h,
|
|
1376
|
-
lastJsonMessage:
|
|
1426
|
+
lastJsonMessage: p,
|
|
1377
1427
|
readyState: G,
|
|
1378
|
-
getWebSocket:
|
|
1428
|
+
getWebSocket: me
|
|
1379
1429
|
};
|
|
1380
1430
|
};
|
|
1381
1431
|
return F.useWebSocket = a, F;
|
|
1382
1432
|
}
|
|
1383
|
-
var ae = {},
|
|
1384
|
-
function
|
|
1385
|
-
if (
|
|
1386
|
-
|
|
1433
|
+
var ae = {}, Pr;
|
|
1434
|
+
function Ct() {
|
|
1435
|
+
if (Pr) return ae;
|
|
1436
|
+
Pr = 1;
|
|
1387
1437
|
var r = ae && ae.__assign || function() {
|
|
1388
1438
|
return r = Object.assign || function(v) {
|
|
1389
1439
|
for (var c, s = 1, u = arguments.length; s < u; s++) {
|
|
@@ -1394,7 +1444,7 @@ function pt() {
|
|
|
1394
1444
|
}, r.apply(this, arguments);
|
|
1395
1445
|
};
|
|
1396
1446
|
Object.defineProperty(ae, "__esModule", { value: !0 }), ae.useSocketIO = void 0;
|
|
1397
|
-
var
|
|
1447
|
+
var y = be, O = xe(), E = V(), f = {
|
|
1398
1448
|
type: "empty",
|
|
1399
1449
|
payload: null
|
|
1400
1450
|
}, _ = function(v) {
|
|
@@ -1408,11 +1458,11 @@ function pt() {
|
|
|
1408
1458
|
type: s[0],
|
|
1409
1459
|
payload: s[1]
|
|
1410
1460
|
};
|
|
1411
|
-
},
|
|
1461
|
+
}, S = function(v, c, s) {
|
|
1412
1462
|
c === void 0 && (c = E.DEFAULT_OPTIONS), s === void 0 && (s = !0);
|
|
1413
|
-
var u = (0,
|
|
1463
|
+
var u = (0, y.useMemo)(function() {
|
|
1414
1464
|
return r(r({}, c), { fromSocketIO: !0 });
|
|
1415
|
-
}, []), a = (0, O.useWebSocket)(v, u, s), i = a.sendMessage, t = a.sendJsonMessage, n = a.lastMessage, d = a.readyState, h = a.getWebSocket, o = (0,
|
|
1465
|
+
}, []), a = (0, O.useWebSocket)(v, u, s), i = a.sendMessage, t = a.sendJsonMessage, n = a.lastMessage, d = a.readyState, h = a.getWebSocket, o = (0, y.useMemo)(function() {
|
|
1416
1466
|
return _(n);
|
|
1417
1467
|
}, [n]);
|
|
1418
1468
|
return {
|
|
@@ -1424,38 +1474,38 @@ function pt() {
|
|
|
1424
1474
|
getWebSocket: h
|
|
1425
1475
|
};
|
|
1426
1476
|
};
|
|
1427
|
-
return ae.useSocketIO =
|
|
1477
|
+
return ae.useSocketIO = S, ae;
|
|
1428
1478
|
}
|
|
1429
|
-
var Q = {},
|
|
1430
|
-
function
|
|
1431
|
-
if (
|
|
1432
|
-
|
|
1479
|
+
var Q = {}, Ir;
|
|
1480
|
+
function Rt() {
|
|
1481
|
+
if (Ir) return Q;
|
|
1482
|
+
Ir = 1;
|
|
1433
1483
|
var r = Q && Q.__assign || function() {
|
|
1434
|
-
return r = Object.assign || function(
|
|
1484
|
+
return r = Object.assign || function(S) {
|
|
1435
1485
|
for (var v, c = 1, s = arguments.length; c < s; c++) {
|
|
1436
1486
|
v = arguments[c];
|
|
1437
|
-
for (var u in v) Object.prototype.hasOwnProperty.call(v, u) && (
|
|
1487
|
+
for (var u in v) Object.prototype.hasOwnProperty.call(v, u) && (S[u] = v[u]);
|
|
1438
1488
|
}
|
|
1439
|
-
return
|
|
1489
|
+
return S;
|
|
1440
1490
|
}, r.apply(this, arguments);
|
|
1441
|
-
},
|
|
1491
|
+
}, y = Q && Q.__rest || function(S, v) {
|
|
1442
1492
|
var c = {};
|
|
1443
|
-
for (var s in
|
|
1444
|
-
if (
|
|
1445
|
-
for (var u = 0, s = Object.getOwnPropertySymbols(
|
|
1446
|
-
v.indexOf(s[u]) < 0 && Object.prototype.propertyIsEnumerable.call(
|
|
1493
|
+
for (var s in S) Object.prototype.hasOwnProperty.call(S, s) && v.indexOf(s) < 0 && (c[s] = S[s]);
|
|
1494
|
+
if (S != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1495
|
+
for (var u = 0, s = Object.getOwnPropertySymbols(S); u < s.length; u++)
|
|
1496
|
+
v.indexOf(s[u]) < 0 && Object.prototype.propertyIsEnumerable.call(S, s[u]) && (c[s[u]] = S[s[u]]);
|
|
1447
1497
|
return c;
|
|
1448
1498
|
};
|
|
1449
1499
|
Object.defineProperty(Q, "__esModule", { value: !0 }), Q.useEventSource = void 0;
|
|
1450
|
-
var O = be, E = xe(), f = V(), _ = function(
|
|
1500
|
+
var O = be, E = xe(), f = V(), _ = function(S, v, c) {
|
|
1451
1501
|
v === void 0 && (v = f.DEFAULT_EVENT_SOURCE_OPTIONS);
|
|
1452
|
-
var s = v.withCredentials, u = v.events, a =
|
|
1502
|
+
var s = v.withCredentials, u = v.events, a = y(v, ["withCredentials", "events"]);
|
|
1453
1503
|
c === void 0 && (c = !0);
|
|
1454
1504
|
var i = r(r({}, a), { eventSourceOptions: {
|
|
1455
1505
|
withCredentials: s
|
|
1456
1506
|
} }), t = (0, O.useRef)(f.EMPTY_EVENT_HANDLERS);
|
|
1457
1507
|
u && (t.current = u);
|
|
1458
|
-
var n = (0, E.useWebSocket)(
|
|
1508
|
+
var n = (0, E.useWebSocket)(S, i, c), d = n.lastMessage, h = n.readyState, o = n.getWebSocket;
|
|
1459
1509
|
return (0, O.useEffect)(function() {
|
|
1460
1510
|
d?.type && Object.entries(t.current).forEach(function(b) {
|
|
1461
1511
|
var R = b[0], P = b[1];
|
|
@@ -1469,15 +1519,15 @@ function mt() {
|
|
|
1469
1519
|
};
|
|
1470
1520
|
return Q.useEventSource = _, Q;
|
|
1471
1521
|
}
|
|
1472
|
-
var
|
|
1473
|
-
function
|
|
1474
|
-
return
|
|
1522
|
+
var kr;
|
|
1523
|
+
function wt() {
|
|
1524
|
+
return kr || (kr = 1, (function(r) {
|
|
1475
1525
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.resetGlobalState = r.useEventSource = r.ReadyState = r.useSocketIO = r.default = void 0;
|
|
1476
|
-
var
|
|
1526
|
+
var y = xe();
|
|
1477
1527
|
Object.defineProperty(r, "default", { enumerable: !0, get: function() {
|
|
1478
|
-
return
|
|
1528
|
+
return y.useWebSocket;
|
|
1479
1529
|
} });
|
|
1480
|
-
var O =
|
|
1530
|
+
var O = Ct();
|
|
1481
1531
|
Object.defineProperty(r, "useSocketIO", { enumerable: !0, get: function() {
|
|
1482
1532
|
return O.useSocketIO;
|
|
1483
1533
|
} });
|
|
@@ -1485,7 +1535,7 @@ function Tt() {
|
|
|
1485
1535
|
Object.defineProperty(r, "ReadyState", { enumerable: !0, get: function() {
|
|
1486
1536
|
return E.ReadyState;
|
|
1487
1537
|
} });
|
|
1488
|
-
var f =
|
|
1538
|
+
var f = Rt();
|
|
1489
1539
|
Object.defineProperty(r, "useEventSource", { enumerable: !0, get: function() {
|
|
1490
1540
|
return f.useEventSource;
|
|
1491
1541
|
} });
|
|
@@ -1495,8 +1545,8 @@ function Tt() {
|
|
|
1495
1545
|
} });
|
|
1496
1546
|
})(We)), We;
|
|
1497
1547
|
}
|
|
1498
|
-
var
|
|
1499
|
-
const
|
|
1548
|
+
var At = wt();
|
|
1549
|
+
const Pt = /* @__PURE__ */ _t(At), H = {
|
|
1500
1550
|
DEPOSIT: "deposit",
|
|
1501
1551
|
TRANS_CODE: "transCode",
|
|
1502
1552
|
ERROR: "error",
|
|
@@ -1507,15 +1557,15 @@ const Rt = /* @__PURE__ */ vt(Ct), H = {
|
|
|
1507
1557
|
TRANSFER_IN_GAME: "transfer_in_game",
|
|
1508
1558
|
CHECK_REQUEST: "CHECK_RREQUEST",
|
|
1509
1559
|
CASH_REGISTER_LIMIT: "cash_register_limit"
|
|
1510
|
-
},
|
|
1560
|
+
}, It = 3e4, Jt = ({
|
|
1511
1561
|
socketUrl: r,
|
|
1512
|
-
socketHandlers:
|
|
1562
|
+
socketHandlers: y = {},
|
|
1513
1563
|
options: O = {}
|
|
1514
1564
|
}) => {
|
|
1515
|
-
const E = fr(!1), f = fr(
|
|
1565
|
+
const E = fr(!1), f = fr(y), {
|
|
1516
1566
|
sendMessage: _,
|
|
1517
1567
|
// 發送普通訊息
|
|
1518
|
-
sendJsonMessage:
|
|
1568
|
+
sendJsonMessage: S,
|
|
1519
1569
|
// 發送 JSON 訊息
|
|
1520
1570
|
lastMessage: v,
|
|
1521
1571
|
// 最後接收到的訊息
|
|
@@ -1523,7 +1573,7 @@ const Rt = /* @__PURE__ */ vt(Ct), H = {
|
|
|
1523
1573
|
readyState: c
|
|
1524
1574
|
// WebSocket 連線狀態
|
|
1525
1575
|
// getWebSocket, // 獲取 WebSocket 實例
|
|
1526
|
-
} =
|
|
1576
|
+
} = Pt(r, {
|
|
1527
1577
|
queryParams: { key: "wsky" },
|
|
1528
1578
|
onOpen: () => console.log("連線成功"),
|
|
1529
1579
|
shouldReconnect: () => E.current === !1,
|
|
@@ -1540,12 +1590,12 @@ const Rt = /* @__PURE__ */ vt(Ct), H = {
|
|
|
1540
1590
|
return we(() => {
|
|
1541
1591
|
const u = setInterval(
|
|
1542
1592
|
() => _("ping"),
|
|
1543
|
-
|
|
1593
|
+
It
|
|
1544
1594
|
);
|
|
1545
1595
|
return () => clearInterval(u);
|
|
1546
1596
|
}, [_]), we(() => {
|
|
1547
|
-
f.current =
|
|
1548
|
-
}, [
|
|
1597
|
+
f.current = y;
|
|
1598
|
+
}, [y]), we(() => {
|
|
1549
1599
|
if (!s) return;
|
|
1550
1600
|
const {
|
|
1551
1601
|
onDeposit: u,
|
|
@@ -1597,79 +1647,40 @@ const Rt = /* @__PURE__ */ vt(Ct), H = {
|
|
|
1597
1647
|
}
|
|
1598
1648
|
}, [s]), we(() => () => E.current = !0, []), {
|
|
1599
1649
|
sendMessage: _,
|
|
1600
|
-
sendJsonMessage:
|
|
1650
|
+
sendJsonMessage: S,
|
|
1601
1651
|
readyState: c
|
|
1602
1652
|
// WebSocket 連線狀態
|
|
1603
1653
|
};
|
|
1604
|
-
},
|
|
1605
|
-
const { client: r } = ke(),
|
|
1654
|
+
}, Dr = () => {
|
|
1655
|
+
const { client: r } = ke(), y = ue(async () => {
|
|
1606
1656
|
const { data: E } = await r.get("/carousels");
|
|
1607
1657
|
return E;
|
|
1608
1658
|
}, [r]), O = ue(async () => await r.get("/marquees"), [r]);
|
|
1609
|
-
return { commonCarouselApi:
|
|
1610
|
-
},
|
|
1611
|
-
const { commonCarouselApi: r } =
|
|
1659
|
+
return { commonCarouselApi: y, commonMarqueeApi: O };
|
|
1660
|
+
}, Ht = () => {
|
|
1661
|
+
const { commonCarouselApi: r } = Dr();
|
|
1612
1662
|
return le({
|
|
1613
1663
|
queryKey: ["getCarouselList"],
|
|
1614
1664
|
queryFn: async () => await r()
|
|
1615
1665
|
});
|
|
1616
|
-
},
|
|
1617
|
-
const { commonMarqueeApi: r } =
|
|
1666
|
+
}, Vt = () => {
|
|
1667
|
+
const { commonMarqueeApi: r } = Dr();
|
|
1618
1668
|
return le({
|
|
1619
1669
|
queryKey: ["getMarqueeList"],
|
|
1620
1670
|
queryFn: async () => r(),
|
|
1621
|
-
select: (
|
|
1622
|
-
});
|
|
1623
|
-
}, Ft = ({
|
|
1624
|
-
refetchInterval: r = 5e4,
|
|
1625
|
-
trigger: S = [],
|
|
1626
|
-
enabled: O = !0
|
|
1627
|
-
} = {}) => {
|
|
1628
|
-
const { getToken: E } = ke(), { userInfoApi: f } = Ve(), _ = kr({
|
|
1629
|
-
queries: [
|
|
1630
|
-
{
|
|
1631
|
-
queryKey: ["getMemberInfo", ...S],
|
|
1632
|
-
queryFn: async () => await f(),
|
|
1633
|
-
refetchInterval: r,
|
|
1634
|
-
enabled: !!E && O
|
|
1635
|
-
}
|
|
1636
|
-
]
|
|
1637
|
-
}), { data: y, isFetching: v, error: c } = _[0] || {};
|
|
1638
|
-
return { data: y, isFetching: v, error: c };
|
|
1639
|
-
}, qt = ({ enabled: r = !0 } = {}) => {
|
|
1640
|
-
const {
|
|
1641
|
-
userInfoApi: S,
|
|
1642
|
-
userFavoriteGameApi: O,
|
|
1643
|
-
userGameListApi: E,
|
|
1644
|
-
userCurrencyExchangeApi: f
|
|
1645
|
-
} = Ve(), _ = le({
|
|
1646
|
-
queryKey: ["getMemInfo"],
|
|
1647
|
-
queryFn: async () => S(),
|
|
1648
|
-
enabled: r
|
|
1649
|
-
}), y = le({
|
|
1650
|
-
queryKey: ["getFavoriteGame"],
|
|
1651
|
-
queryFn: async () => O(),
|
|
1652
|
-
enabled: r && _.isSuccess
|
|
1653
|
-
}), v = le({
|
|
1654
|
-
queryKey: ["getUserGameList"],
|
|
1655
|
-
queryFn: async () => E(),
|
|
1656
|
-
enabled: r && _.isSuccess && y.isSuccess
|
|
1657
|
-
}), c = le({
|
|
1658
|
-
queryKey: ["getUserCurrencyExchange"],
|
|
1659
|
-
queryFn: async () => f(),
|
|
1660
|
-
enabled: r && _.isSuccess && y.isSuccess && v.isSuccess
|
|
1671
|
+
select: (y) => y.Marquees
|
|
1661
1672
|
});
|
|
1662
|
-
return [_, y, v, c];
|
|
1663
1673
|
};
|
|
1664
1674
|
export {
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1675
|
+
Mr as ApiCtx,
|
|
1676
|
+
jt as ApiProvider,
|
|
1677
|
+
Ut as createLogoutHandler,
|
|
1678
|
+
Wt as processPlatformData,
|
|
1668
1679
|
ke as useApiContext,
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1680
|
+
Ft as useBalanceGetter,
|
|
1681
|
+
Jt as useClientWebSocket,
|
|
1682
|
+
Ht as useGetCarouseList,
|
|
1683
|
+
Vt as useGetMarquee,
|
|
1684
|
+
qt as useGetMemberInfo,
|
|
1685
|
+
Gt as useInitializeWithToken
|
|
1675
1686
|
};
|