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