@obb871001/api-integration-sdk 1.0.37 → 1.0.38

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