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