@famibee/skynovel 2.0.3 → 2.0.4

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/SysBase.js CHANGED
@@ -13,73 +13,73 @@ Object.keys(s).forEach((e) => {
13
13
  var l = {
14
14
  type: "error",
15
15
  data: "parser error"
16
- }, u = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", d = typeof ArrayBuffer == "function", f = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e && e.buffer instanceof ArrayBuffer, p = ({ type: e, data: t }, n, r) => u && t instanceof Blob ? n ? r(t) : m(t, r) : d && (t instanceof ArrayBuffer || f(t)) ? n ? r(t) : m(new Blob([t]), r) : r(s[e] + (t || "")), m = (e, t) => {
16
+ }, u = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", ee = typeof ArrayBuffer == "function", d = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e && e.buffer instanceof ArrayBuffer, f = ({ type: e, data: t }, n, r) => u && t instanceof Blob ? n ? r(t) : p(t, r) : ee && (t instanceof ArrayBuffer || d(t)) ? n ? r(t) : p(new Blob([t]), r) : r(s[e] + (t || "")), p = (e, t) => {
17
17
  let n = new FileReader();
18
18
  return n.onload = function() {
19
19
  let e = n.result.split(",")[1];
20
20
  t("b" + (e || ""));
21
21
  }, n.readAsDataURL(e);
22
22
  };
23
- function h(e) {
23
+ function m(e) {
24
24
  return e instanceof Uint8Array ? e : e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
25
25
  }
26
- var g;
27
- function ee(e, t) {
28
- if (u && e.data instanceof Blob) return e.data.arrayBuffer().then(h).then(t);
29
- if (d && (e.data instanceof ArrayBuffer || f(e.data))) return t(h(e.data));
30
- p(e, !1, (e) => {
31
- g ||= new TextEncoder(), t(g.encode(e));
26
+ var te;
27
+ function ne(e, t) {
28
+ if (u && e.data instanceof Blob) return e.data.arrayBuffer().then(m).then(t);
29
+ if (ee && (e.data instanceof ArrayBuffer || d(e.data))) return t(m(e.data));
30
+ f(e, !1, (e) => {
31
+ te ||= new TextEncoder(), t(te.encode(e));
32
32
  });
33
33
  }
34
34
  //#endregion
35
35
  //#region node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js
36
- var te = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", _ = typeof Uint8Array > "u" ? [] : /* @__PURE__ */ new Uint8Array(256);
37
- for (let e = 0; e < 64; e++) _[te.charCodeAt(e)] = e;
38
- var ne = (e) => {
36
+ var re = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", h = typeof Uint8Array > "u" ? [] : /* @__PURE__ */ new Uint8Array(256);
37
+ for (let e = 0; e < 64; e++) h[re.charCodeAt(e)] = e;
38
+ var ie = (e) => {
39
39
  let t = e.length * .75, n = e.length, r, i = 0, a, o, s, c;
40
40
  e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
41
41
  let l = new ArrayBuffer(t), u = new Uint8Array(l);
42
- for (r = 0; r < n; r += 4) a = _[e.charCodeAt(r)], o = _[e.charCodeAt(r + 1)], s = _[e.charCodeAt(r + 2)], c = _[e.charCodeAt(r + 3)], u[i++] = a << 2 | o >> 4, u[i++] = (o & 15) << 4 | s >> 2, u[i++] = (s & 3) << 6 | c & 63;
42
+ for (r = 0; r < n; r += 4) a = h[e.charCodeAt(r)], o = h[e.charCodeAt(r + 1)], s = h[e.charCodeAt(r + 2)], c = h[e.charCodeAt(r + 3)], u[i++] = a << 2 | o >> 4, u[i++] = (o & 15) << 4 | s >> 2, u[i++] = (s & 3) << 6 | c & 63;
43
43
  return l;
44
- }, re = typeof ArrayBuffer == "function", v = (e, t) => {
44
+ }, ae = typeof ArrayBuffer == "function", g = (e, t) => {
45
45
  if (typeof e != "string") return {
46
46
  type: "message",
47
- data: y(e, t)
47
+ data: _(e, t)
48
48
  };
49
49
  let n = e.charAt(0);
50
50
  return n === "b" ? {
51
51
  type: "message",
52
- data: ie(e.substring(1), t)
52
+ data: oe(e.substring(1), t)
53
53
  } : c[n] ? e.length > 1 ? {
54
54
  type: c[n],
55
55
  data: e.substring(1)
56
56
  } : { type: c[n] } : l;
57
- }, ie = (e, t) => re ? y(ne(e), t) : {
57
+ }, oe = (e, t) => ae ? _(ie(e), t) : {
58
58
  base64: !0,
59
59
  data: e
60
- }, y = (e, t) => {
60
+ }, _ = (e, t) => {
61
61
  switch (t) {
62
62
  case "blob": return e instanceof Blob ? e : new Blob([e]);
63
63
  default: return e instanceof ArrayBuffer ? e : e.buffer;
64
64
  }
65
- }, b = "", ae = (e, t) => {
65
+ }, v = "", se = (e, t) => {
66
66
  let n = e.length, r = Array(n), i = 0;
67
67
  e.forEach((e, a) => {
68
- p(e, !1, (e) => {
69
- r[a] = e, ++i === n && t(r.join(b));
68
+ f(e, !1, (e) => {
69
+ r[a] = e, ++i === n && t(r.join(v));
70
70
  });
71
71
  });
72
- }, oe = (e, t) => {
73
- let n = e.split(b), r = [];
72
+ }, ce = (e, t) => {
73
+ let n = e.split(v), r = [];
74
74
  for (let e = 0; e < n.length; e++) {
75
- let i = v(n[e], t);
75
+ let i = g(n[e], t);
76
76
  if (r.push(i), i.type === "error") break;
77
77
  }
78
78
  return r;
79
79
  };
80
- function se() {
80
+ function le() {
81
81
  return new TransformStream({ transform(e, t) {
82
- ee(e, (n) => {
82
+ ne(e, (n) => {
83
83
  let r = n.length, i;
84
84
  if (r < 126) i = /* @__PURE__ */ new Uint8Array(1), new DataView(i.buffer).setUint8(0, r);
85
85
  else if (r < 65536) {
@@ -95,41 +95,41 @@ function se() {
95
95
  });
96
96
  } });
97
97
  }
98
- var x;
99
- function S(e) {
98
+ var y;
99
+ function b(e) {
100
100
  return e.reduce((e, t) => e + t.length, 0);
101
101
  }
102
- function C(e, t) {
102
+ function x(e, t) {
103
103
  if (e[0].length === t) return e.shift();
104
104
  let n = new Uint8Array(t), r = 0;
105
105
  for (let i = 0; i < t; i++) n[i] = e[0][r++], r === e[0].length && (e.shift(), r = 0);
106
106
  return e.length && r < e[0].length && (e[0] = e[0].slice(r)), n;
107
107
  }
108
- function ce(e, t) {
109
- x ||= new TextDecoder();
108
+ function ue(e, t) {
109
+ y ||= new TextDecoder();
110
110
  let n = [], r = 0, i = -1, a = !1;
111
111
  return new TransformStream({ transform(o, s) {
112
112
  for (n.push(o);;) {
113
113
  if (r === 0) {
114
- if (S(n) < 1) break;
115
- let e = C(n, 1);
114
+ if (b(n) < 1) break;
115
+ let e = x(n, 1);
116
116
  a = (e[0] & 128) == 128, i = e[0] & 127, r = i < 126 ? 3 : i === 126 ? 1 : 2;
117
117
  } else if (r === 1) {
118
- if (S(n) < 2) break;
119
- let e = C(n, 2);
118
+ if (b(n) < 2) break;
119
+ let e = x(n, 2);
120
120
  i = new DataView(e.buffer, e.byteOffset, e.length).getUint16(0), r = 3;
121
121
  } else if (r === 2) {
122
- if (S(n) < 8) break;
123
- let e = C(n, 8), t = new DataView(e.buffer, e.byteOffset, e.length), a = t.getUint32(0);
122
+ if (b(n) < 8) break;
123
+ let e = x(n, 8), t = new DataView(e.buffer, e.byteOffset, e.length), a = t.getUint32(0);
124
124
  if (a > 2 ** 21 - 1) {
125
125
  s.enqueue(l);
126
126
  break;
127
127
  }
128
128
  i = a * 2 ** 32 + t.getUint32(4), r = 3;
129
129
  } else {
130
- if (S(n) < i) break;
131
- let e = C(n, i);
132
- s.enqueue(v(a ? e : x.decode(e), t)), r = 0;
130
+ if (b(n) < i) break;
131
+ let e = x(n, i);
132
+ s.enqueue(g(a ? e : y.decode(e), t)), r = 0;
133
133
  }
134
134
  if (i === 0 || i > e) {
135
135
  s.enqueue(l);
@@ -140,21 +140,21 @@ function ce(e, t) {
140
140
  }
141
141
  //#endregion
142
142
  //#region node_modules/@socket.io/component-emitter/lib/esm/index.js
143
- function w(e) {
144
- if (e) return le(e);
143
+ function S(e) {
144
+ if (e) return de(e);
145
145
  }
146
- function le(e) {
147
- for (var t in w.prototype) e[t] = w.prototype[t];
146
+ function de(e) {
147
+ for (var t in S.prototype) e[t] = S.prototype[t];
148
148
  return e;
149
149
  }
150
- w.prototype.on = w.prototype.addEventListener = function(e, t) {
150
+ S.prototype.on = S.prototype.addEventListener = function(e, t) {
151
151
  return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e] = this._callbacks["$" + e] || []).push(t), this;
152
- }, w.prototype.once = function(e, t) {
152
+ }, S.prototype.once = function(e, t) {
153
153
  function n() {
154
154
  this.off(e, n), t.apply(this, arguments);
155
155
  }
156
156
  return n.fn = t, this.on(e, n), this;
157
- }, w.prototype.off = w.prototype.removeListener = w.prototype.removeAllListeners = w.prototype.removeEventListener = function(e, t) {
157
+ }, S.prototype.off = S.prototype.removeListener = S.prototype.removeAllListeners = S.prototype.removeEventListener = function(e, t) {
158
158
  if (this._callbacks = this._callbacks || {}, arguments.length == 0) return this._callbacks = {}, this;
159
159
  var n = this._callbacks["$" + e];
160
160
  if (!n) return this;
@@ -164,7 +164,7 @@ w.prototype.on = w.prototype.addEventListener = function(e, t) {
164
164
  break;
165
165
  }
166
166
  return n.length === 0 && delete this._callbacks["$" + e], this;
167
- }, w.prototype.emit = function(e) {
167
+ }, S.prototype.emit = function(e) {
168
168
  this._callbacks = this._callbacks || {};
169
169
  for (var t = Array(arguments.length - 1), n = this._callbacks["$" + e], r = 1; r < arguments.length; r++) t[r - 1] = arguments[r];
170
170
  if (n) {
@@ -172,43 +172,43 @@ w.prototype.on = w.prototype.addEventListener = function(e, t) {
172
172
  for (var r = 0, i = n.length; r < i; ++r) n[r].apply(this, t);
173
173
  }
174
174
  return this;
175
- }, w.prototype.emitReserved = w.prototype.emit, w.prototype.listeners = function(e) {
175
+ }, S.prototype.emitReserved = S.prototype.emit, S.prototype.listeners = function(e) {
176
176
  return this._callbacks = this._callbacks || {}, this._callbacks["$" + e] || [];
177
- }, w.prototype.hasListeners = function(e) {
177
+ }, S.prototype.hasListeners = function(e) {
178
178
  return !!this.listeners(e).length;
179
179
  };
180
180
  //#endregion
181
181
  //#region node_modules/engine.io-client/build/esm/globals.js
182
- var T = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), E = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), ue = "arraybuffer";
182
+ var C = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), w = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), fe = "arraybuffer";
183
183
  //#endregion
184
184
  //#region node_modules/engine.io-client/build/esm/util.js
185
- function D(e, ...t) {
185
+ function T(e, ...t) {
186
186
  return t.reduce((t, n) => (e.hasOwnProperty(n) && (t[n] = e[n]), t), {});
187
187
  }
188
- var de = E.setTimeout, fe = E.clearTimeout;
189
- function O(e, t) {
190
- t.useNativeTimers ? (e.setTimeoutFn = de.bind(E), e.clearTimeoutFn = fe.bind(E)) : (e.setTimeoutFn = E.setTimeout.bind(E), e.clearTimeoutFn = E.clearTimeout.bind(E));
188
+ var pe = w.setTimeout, me = w.clearTimeout;
189
+ function E(e, t) {
190
+ t.useNativeTimers ? (e.setTimeoutFn = pe.bind(w), e.clearTimeoutFn = me.bind(w)) : (e.setTimeoutFn = w.setTimeout.bind(w), e.clearTimeoutFn = w.clearTimeout.bind(w));
191
191
  }
192
- var pe = 1.33;
193
- function me(e) {
194
- return typeof e == "string" ? he(e) : Math.ceil((e.byteLength || e.size) * pe);
192
+ var he = 1.33;
193
+ function ge(e) {
194
+ return typeof e == "string" ? _e(e) : Math.ceil((e.byteLength || e.size) * he);
195
195
  }
196
- function he(e) {
196
+ function _e(e) {
197
197
  let t = 0, n = 0;
198
198
  for (let r = 0, i = e.length; r < i; r++) t = e.charCodeAt(r), t < 128 ? n += 1 : t < 2048 ? n += 2 : t < 55296 || t >= 57344 ? n += 3 : (r++, n += 4);
199
199
  return n;
200
200
  }
201
- function ge() {
201
+ function D() {
202
202
  return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
203
203
  }
204
204
  //#endregion
205
205
  //#region node_modules/engine.io-client/build/esm/contrib/parseqs.js
206
- function _e(e) {
206
+ function ve(e) {
207
207
  let t = "";
208
208
  for (let n in e) e.hasOwnProperty(n) && (t.length && (t += "&"), t += encodeURIComponent(n) + "=" + encodeURIComponent(e[n]));
209
209
  return t;
210
210
  }
211
- function ve(e) {
211
+ function ye(e) {
212
212
  let t = {}, n = e.split("&");
213
213
  for (let e = 0, r = n.length; e < r; e++) {
214
214
  let r = n[e].split("=");
@@ -218,16 +218,16 @@ function ve(e) {
218
218
  }
219
219
  //#endregion
220
220
  //#region node_modules/engine.io-client/build/esm/transport.js
221
- var ye = class extends Error {
221
+ var be = class extends Error {
222
222
  constructor(e, t, n) {
223
223
  super(e), this.description = t, this.context = n, this.type = "TransportError";
224
224
  }
225
- }, k = class extends w {
225
+ }, O = class extends S {
226
226
  constructor(e) {
227
- super(), this.writable = !1, O(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64;
227
+ super(), this.writable = !1, E(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64;
228
228
  }
229
229
  onError(e, t, n) {
230
- return super.emitReserved("error", new ye(e, t, n)), this;
230
+ return super.emitReserved("error", new be(e, t, n)), this;
231
231
  }
232
232
  open() {
233
233
  return this.readyState = "opening", this.doOpen(), this;
@@ -242,7 +242,7 @@ var ye = class extends Error {
242
242
  this.readyState = "open", this.writable = !0, super.emitReserved("open");
243
243
  }
244
244
  onData(e) {
245
- let t = v(e, this.socket.binaryType);
245
+ let t = g(e, this.socket.binaryType);
246
246
  this.onPacket(t);
247
247
  }
248
248
  onPacket(e) {
@@ -260,13 +260,13 @@ var ye = class extends Error {
260
260
  return e.indexOf(":") === -1 ? e : "[" + e + "]";
261
261
  }
262
262
  _port() {
263
- return this.opts.port && (this.opts.secure && Number(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
263
+ return this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
264
264
  }
265
265
  _query(e) {
266
- let t = _e(e);
266
+ let t = ve(e);
267
267
  return t.length ? "?" + t : "";
268
268
  }
269
- }, be = class extends k {
269
+ }, xe = class extends O {
270
270
  constructor() {
271
271
  super(...arguments), this._polling = !1;
272
272
  }
@@ -294,7 +294,7 @@ var ye = class extends Error {
294
294
  this._polling = !0, this.doPoll(), this.emitReserved("poll");
295
295
  }
296
296
  onData(e) {
297
- oe(e, this.socket.binaryType).forEach((e) => {
297
+ ce(e, this.socket.binaryType).forEach((e) => {
298
298
  if (this.readyState === "opening" && e.type === "open" && this.onOpen(), e.type === "close") return this.onClose({ description: "transport closed by the server" }), !1;
299
299
  this.onPacket(e);
300
300
  }), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
@@ -306,7 +306,7 @@ var ye = class extends Error {
306
306
  this.readyState === "open" ? e() : this.once("open", e);
307
307
  }
308
308
  write(e) {
309
- this.writable = !1, ae(e, (e) => {
309
+ this.writable = !1, se(e, (e) => {
310
310
  this.doWrite(e, () => {
311
311
  this.writable = !0, this.emitReserved("drain");
312
312
  });
@@ -314,17 +314,17 @@ var ye = class extends Error {
314
314
  }
315
315
  uri() {
316
316
  let e = this.opts.secure ? "https" : "http", t = this.query || {};
317
- return !1 !== this.opts.timestampRequests && (t[this.opts.timestampParam] = ge()), !this.supportsBinary && !t.sid && (t.b64 = 1), this.createUri(e, t);
317
+ return !1 !== this.opts.timestampRequests && (t[this.opts.timestampParam] = D()), !this.supportsBinary && !t.sid && (t.b64 = 1), this.createUri(e, t);
318
318
  }
319
- }, A = !1;
319
+ }, k = !1;
320
320
  try {
321
- A = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
321
+ k = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
322
322
  } catch {}
323
- var xe = A;
323
+ var Se = k;
324
324
  //#endregion
325
325
  //#region node_modules/engine.io-client/build/esm/transports/polling-xhr.js
326
- function Se() {}
327
- var Ce = class extends be {
326
+ function Ce() {}
327
+ var we = class extends xe {
328
328
  constructor(e) {
329
329
  if (super(e), typeof location < "u") {
330
330
  let t = location.protocol === "https:", n = location.port;
@@ -346,13 +346,13 @@ var Ce = class extends be {
346
346
  this.onError("xhr poll error", e, t);
347
347
  }), this.pollXhr = e;
348
348
  }
349
- }, j = class e extends w {
349
+ }, A = class e extends S {
350
350
  constructor(e, t, n) {
351
- super(), this.createRequest = e, O(this, n), this._opts = n, this._method = n.method || "GET", this._uri = t, this._data = n.data === void 0 ? null : n.data, this._create();
351
+ super(), this.createRequest = e, E(this, n), this._opts = n, this._method = n.method || "GET", this._uri = t, this._data = n.data === void 0 ? null : n.data, this._create();
352
352
  }
353
353
  _create() {
354
354
  var t;
355
- let n = D(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
355
+ let n = T(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
356
356
  n.xdomain = !!this._opts.xd;
357
357
  let r = this._xhr = this.createRequest(n);
358
358
  try {
@@ -388,7 +388,7 @@ var Ce = class extends be {
388
388
  }
389
389
  _cleanup(t) {
390
390
  if (!(this._xhr === void 0 || this._xhr === null)) {
391
- if (this._xhr.onreadystatechange = Se, t) try {
391
+ if (this._xhr.onreadystatechange = Ce, t) try {
392
392
  this._xhr.abort();
393
393
  } catch {}
394
394
  typeof document < "u" && delete e.requests[this._index], this._xhr = null;
@@ -402,46 +402,46 @@ var Ce = class extends be {
402
402
  this._cleanup();
403
403
  }
404
404
  };
405
- if (j.requestsCount = 0, j.requests = {}, typeof document < "u") {
406
- if (typeof attachEvent == "function") attachEvent("onunload", M);
405
+ if (A.requestsCount = 0, A.requests = {}, typeof document < "u") {
406
+ if (typeof attachEvent == "function") attachEvent("onunload", j);
407
407
  else if (typeof addEventListener == "function") {
408
- let e = "onpagehide" in E ? "pagehide" : "unload";
409
- addEventListener(e, M, !1);
408
+ let e = "onpagehide" in w ? "pagehide" : "unload";
409
+ addEventListener(e, j, !1);
410
410
  }
411
411
  }
412
- function M() {
413
- for (let e in j.requests) j.requests.hasOwnProperty(e) && j.requests[e].abort();
412
+ function j() {
413
+ for (let e in A.requests) A.requests.hasOwnProperty(e) && A.requests[e].abort();
414
414
  }
415
- var we = (function() {
416
- let e = N({ xdomain: !1 });
415
+ var Te = (function() {
416
+ let e = M({ xdomain: !1 });
417
417
  return e && e.responseType !== null;
418
- })(), Te = class extends Ce {
418
+ })(), Ee = class extends we {
419
419
  constructor(e) {
420
420
  super(e);
421
421
  let t = e && e.forceBase64;
422
- this.supportsBinary = we && !t;
422
+ this.supportsBinary = Te && !t;
423
423
  }
424
424
  request(e = {}) {
425
- return Object.assign(e, { xd: this.xd }, this.opts), new j(N, this.uri(), e);
425
+ return Object.assign(e, { xd: this.xd }, this.opts), new A(M, this.uri(), e);
426
426
  }
427
427
  };
428
- function N(e) {
428
+ function M(e) {
429
429
  let t = e.xdomain;
430
430
  try {
431
- if (typeof XMLHttpRequest < "u" && (!t || xe)) return new XMLHttpRequest();
431
+ if (typeof XMLHttpRequest < "u" && (!t || Se)) return new XMLHttpRequest();
432
432
  } catch {}
433
433
  if (!t) try {
434
- return new E[["Active", "Object"].join("X")]("Microsoft.XMLHTTP");
434
+ return new w[["Active", "Object"].join("X")]("Microsoft.XMLHTTP");
435
435
  } catch {}
436
436
  }
437
437
  //#endregion
438
438
  //#region node_modules/engine.io-client/build/esm/transports/websocket.js
439
- var P = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative", Ee = class extends k {
439
+ var N = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative", De = class extends O {
440
440
  get name() {
441
441
  return "websocket";
442
442
  }
443
443
  doOpen() {
444
- let e = this.uri(), t = this.opts.protocols, n = P ? {} : D(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
444
+ let e = this.uri(), t = this.opts.protocols, n = N ? {} : T(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
445
445
  this.opts.extraHeaders && (n.headers = this.opts.extraHeaders);
446
446
  try {
447
447
  this.ws = this.createSocket(e, t, n);
@@ -462,11 +462,11 @@ var P = typeof navigator < "u" && typeof navigator.product == "string" && naviga
462
462
  this.writable = !1;
463
463
  for (let t = 0; t < e.length; t++) {
464
464
  let n = e[t], r = t === e.length - 1;
465
- p(n, this.supportsBinary, (e) => {
465
+ f(n, this.supportsBinary, (e) => {
466
466
  try {
467
467
  this.doWrite(n, e);
468
468
  } catch {}
469
- r && T(() => {
469
+ r && C(() => {
470
470
  this.writable = !0, this.emitReserved("drain");
471
471
  }, this.setTimeoutFn);
472
472
  });
@@ -477,18 +477,18 @@ var P = typeof navigator < "u" && typeof navigator.product == "string" && naviga
477
477
  }
478
478
  uri() {
479
479
  let e = this.opts.secure ? "wss" : "ws", t = this.query || {};
480
- return this.opts.timestampRequests && (t[this.opts.timestampParam] = ge()), this.supportsBinary || (t.b64 = 1), this.createUri(e, t);
480
+ return this.opts.timestampRequests && (t[this.opts.timestampParam] = D()), this.supportsBinary || (t.b64 = 1), this.createUri(e, t);
481
481
  }
482
- }, F = E.WebSocket || E.MozWebSocket, De = {
483
- websocket: class extends Ee {
482
+ }, P = w.WebSocket || w.MozWebSocket, Oe = {
483
+ websocket: class extends De {
484
484
  createSocket(e, t, n) {
485
- return P ? new F(e, t, n) : t ? new F(e, t) : new F(e);
485
+ return N ? new P(e, t, n) : t ? new P(e, t) : new P(e);
486
486
  }
487
487
  doWrite(e, t) {
488
488
  this.ws.send(t);
489
489
  }
490
490
  },
491
- webtransport: class extends k {
491
+ webtransport: class extends O {
492
492
  get name() {
493
493
  return "webtransport";
494
494
  }
@@ -504,7 +504,7 @@ var P = typeof navigator < "u" && typeof navigator.product == "string" && naviga
504
504
  this.onError("webtransport error", e);
505
505
  }), this._transport.ready.then(() => {
506
506
  this._transport.createBidirectionalStream().then((e) => {
507
- let t = ce(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r = se();
507
+ let t = ue(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r = le();
508
508
  r.readable.pipeTo(e.writable), this._writer = r.writable.getWriter();
509
509
  let i = () => {
510
510
  n.read().then(({ done: e, value: t }) => {
@@ -522,7 +522,7 @@ var P = typeof navigator < "u" && typeof navigator.product == "string" && naviga
522
522
  for (let t = 0; t < e.length; t++) {
523
523
  let n = e[t], r = t === e.length - 1;
524
524
  this._writer.write(n).then(() => {
525
- r && T(() => {
525
+ r && C(() => {
526
526
  this.writable = !0, this.emitReserved("drain");
527
527
  }, this.setTimeoutFn);
528
528
  });
@@ -533,8 +533,8 @@ var P = typeof navigator < "u" && typeof navigator.product == "string" && naviga
533
533
  (e = this._transport) == null || e.close();
534
534
  }
535
535
  },
536
- polling: Te
537
- }, Oe = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, ke = [
536
+ polling: Ee
537
+ }, ke = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, Ae = [
538
538
  "source",
539
539
  "protocol",
540
540
  "authority",
@@ -550,19 +550,19 @@ var P = typeof navigator < "u" && typeof navigator.product == "string" && naviga
550
550
  "query",
551
551
  "anchor"
552
552
  ];
553
- function I(e) {
553
+ function F(e) {
554
554
  if (e.length > 8e3) throw "URI too long";
555
555
  let t = e, n = e.indexOf("["), r = e.indexOf("]");
556
556
  n != -1 && r != -1 && (e = e.substring(0, n) + e.substring(n, r).replace(/:/g, ";") + e.substring(r, e.length));
557
- let i = Oe.exec(e || ""), a = {}, o = 14;
558
- for (; o--;) a[ke[o]] = i[o] || "";
559
- return n != -1 && r != -1 && (a.source = t, a.host = a.host.substring(1, a.host.length - 1).replace(/;/g, ":"), a.authority = a.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), a.ipv6uri = !0), a.pathNames = Ae(a, a.path), a.queryKey = je(a, a.query), a;
557
+ let i = ke.exec(e || ""), a = {}, o = 14;
558
+ for (; o--;) a[Ae[o]] = i[o] || "";
559
+ return n != -1 && r != -1 && (a.source = t, a.host = a.host.substring(1, a.host.length - 1).replace(/;/g, ":"), a.authority = a.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), a.ipv6uri = !0), a.pathNames = je(a, a.path), a.queryKey = Me(a, a.query), a;
560
560
  }
561
- function Ae(e, t) {
561
+ function je(e, t) {
562
562
  let n = t.replace(/\/{2,9}/g, "/").split("/");
563
563
  return (t.slice(0, 1) == "/" || t.length === 0) && n.splice(0, 1), t.slice(-1) == "/" && n.splice(n.length - 1, 1), n;
564
564
  }
565
- function je(e, t) {
565
+ function Me(e, t) {
566
566
  let n = {};
567
567
  return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(e, t, r) {
568
568
  t && (n[t] = r);
@@ -570,17 +570,17 @@ function je(e, t) {
570
570
  }
571
571
  //#endregion
572
572
  //#region node_modules/engine.io-client/build/esm/socket.js
573
- var L = typeof addEventListener == "function" && typeof removeEventListener == "function", R = [];
574
- L && addEventListener("offline", () => {
575
- R.forEach((e) => e());
573
+ var I = typeof addEventListener == "function" && typeof removeEventListener == "function", L = [];
574
+ I && addEventListener("offline", () => {
575
+ L.forEach((e) => e());
576
576
  }, !1);
577
- var z = class e extends w {
577
+ var R = class e extends S {
578
578
  constructor(e, t) {
579
- if (super(), this.binaryType = ue, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = Infinity, e && typeof e == "object" && (t = e, e = null), e) {
580
- let n = I(e);
579
+ if (super(), this.binaryType = fe, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = Infinity, e && typeof e == "object" && (t = e, e = null), e) {
580
+ let n = F(e);
581
581
  t.hostname = n.host, t.secure = n.protocol === "https" || n.protocol === "wss", t.port = n.port, n.query && (t.query = n.query);
582
- } else t.host && (t.hostname = I(t.host).host);
583
- O(this, t), this.secure = t.secure == null ? typeof location < "u" && location.protocol === "https:" : t.secure, t.hostname && !t.port && (t.port = this.secure ? "443" : "80"), this.hostname = t.hostname || (typeof location < "u" ? location.hostname : "localhost"), this.port = t.port || (typeof location < "u" && location.port ? location.port : this.secure ? "443" : "80"), this.transports = [], this._transportsByName = {}, t.transports.forEach((e) => {
582
+ } else t.host && (t.hostname = F(t.host).host);
583
+ E(this, t), this.secure = t.secure == null ? typeof location < "u" && location.protocol === "https:" : t.secure, t.hostname && !t.port && (t.port = this.secure ? "443" : "80"), this.hostname = t.hostname || (typeof location < "u" ? location.hostname : "localhost"), this.port = t.port || (typeof location < "u" && location.port ? location.port : this.secure ? "443" : "80"), this.transports = [], this._transportsByName = {}, t.transports.forEach((e) => {
584
584
  let t = e.prototype.name;
585
585
  this.transports.push(t), this._transportsByName[t] = e;
586
586
  }), this.opts = Object.assign({
@@ -595,11 +595,11 @@ var z = class e extends w {
595
595
  perMessageDeflate: { threshold: 1024 },
596
596
  transportOptions: {},
597
597
  closeOnBeforeunload: !1
598
- }, t), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = ve(this.opts.query)), L && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
598
+ }, t), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = ye(this.opts.query)), I && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
599
599
  this.transport && (this.transport.removeAllListeners(), this.transport.close());
600
600
  }, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
601
601
  this._onClose("transport close", { description: "network connection lost" });
602
- }, R.push(this._offlineEventListener))), this.opts.withCredentials && (this._cookieJar = void 0), this._open();
602
+ }, L.push(this._offlineEventListener))), this.opts.withCredentials && (this._cookieJar = void 0), this._open();
603
603
  }
604
604
  createTransport(e) {
605
605
  let t = Object.assign({}, this.opts.query);
@@ -672,7 +672,7 @@ var z = class e extends w {
672
672
  let e = 1;
673
673
  for (let t = 0; t < this.writeBuffer.length; t++) {
674
674
  let n = this.writeBuffer[t].data;
675
- if (n && (e += me(n)), t > 0 && e > this._maxPayload) return this.writeBuffer.slice(0, t);
675
+ if (n && (e += ge(n)), t > 0 && e > this._maxPayload) return this.writeBuffer.slice(0, t);
676
676
  e += 2;
677
677
  }
678
678
  return this.writeBuffer;
@@ -680,7 +680,7 @@ var z = class e extends w {
680
680
  _hasPingExpired() {
681
681
  if (!this._pingTimeoutTime) return !0;
682
682
  let e = Date.now() > this._pingTimeoutTime;
683
- return e && (this._pingTimeoutTime = 0, T(() => {
683
+ return e && (this._pingTimeoutTime = 0, C(() => {
684
684
  this._onClose("ping timeout");
685
685
  }, this.setTimeoutFn)), e;
686
686
  }
@@ -718,16 +718,16 @@ var z = class e extends w {
718
718
  }
719
719
  _onClose(e, t) {
720
720
  if (this.readyState === "opening" || this.readyState === "open" || this.readyState === "closing") {
721
- if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), L && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
722
- let e = R.indexOf(this._offlineEventListener);
723
- e !== -1 && R.splice(e, 1);
721
+ if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), I && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
722
+ let e = L.indexOf(this._offlineEventListener);
723
+ e !== -1 && L.splice(e, 1);
724
724
  }
725
725
  this.readyState = "closed", this.id = null, this.emitReserved("close", e, t), this.writeBuffer = [], this._prevBufferLen = 0;
726
726
  }
727
727
  }
728
728
  };
729
- z.protocol = 4;
730
- var Me = class extends z {
729
+ R.protocol = 4;
730
+ var Ne = class extends R {
731
731
  constructor() {
732
732
  super(...arguments), this._upgrades = [];
733
733
  }
@@ -736,7 +736,7 @@ var Me = class extends z {
736
736
  }
737
737
  _probe(e) {
738
738
  let t = this.createTransport(e), n = !1;
739
- z.priorWebsocketSuccess = !1;
739
+ R.priorWebsocketSuccess = !1;
740
740
  let r = () => {
741
741
  n || (t.send([{
742
742
  type: "ping",
@@ -744,7 +744,7 @@ var Me = class extends z {
744
744
  }]), t.once("packet", (e) => {
745
745
  if (!n) if (e.type === "pong" && e.data === "probe") {
746
746
  if (this.upgrading = !0, this.emitReserved("upgrading", t), !t) return;
747
- z.priorWebsocketSuccess = t.name === "websocket", this.transport.pause(() => {
747
+ R.priorWebsocketSuccess = t.name === "websocket", this.transport.pause(() => {
748
748
  n || this.readyState !== "closed" && (l(), this.setTransport(t), t.send([{ type: "upgrade" }]), this.emitReserved("upgrade", t), t = null, this.upgrading = !1, this.flush());
749
749
  });
750
750
  } else {
@@ -784,54 +784,54 @@ var Me = class extends z {
784
784
  for (let n = 0; n < e.length; n++) ~this.transports.indexOf(e[n]) && t.push(e[n]);
785
785
  return t;
786
786
  }
787
- }, B = class extends Me {
787
+ }, z = class extends Ne {
788
788
  constructor(e, t = {}) {
789
- let n = typeof e == "object" ? e : t;
790
- (!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || [
789
+ let n = typeof e == "object", r = n ? { ...e } : { ...t };
790
+ (!r.transports || r.transports && typeof r.transports[0] == "string") && (r.transports = (r.transports || [
791
791
  "polling",
792
792
  "websocket",
793
793
  "webtransport"
794
- ]).map((e) => De[e]).filter((e) => !!e)), super(e, n);
794
+ ]).map((e) => Oe[e]).filter((e) => !!e)), super(n ? r : e, r);
795
795
  }
796
796
  };
797
- B.protocol;
797
+ z.protocol;
798
798
  //#endregion
799
799
  //#region node_modules/socket.io-client/build/esm/url.js
800
- function Ne(e, t = "", n) {
800
+ function Pe(e, t = "", n) {
801
801
  let r = e;
802
- n ||= typeof location < "u" && location, e ??= n.protocol + "//" + n.host, typeof e == "string" && (e.charAt(0) === "/" && (e = e.charAt(1) === "/" ? n.protocol + e : n.host + e), /^(https?|wss?):\/\//.test(e) || (e = n === void 0 ? "https://" + e : n.protocol + "//" + e), r = I(e)), r.port || (/^(http|ws)$/.test(r.protocol) ? r.port = "80" : /^(http|ws)s$/.test(r.protocol) && (r.port = "443")), r.path = r.path || "/";
802
+ n ||= typeof location < "u" && location, e ??= n.protocol + "//" + n.host, typeof e == "string" && (e.charAt(0) === "/" && (e = e.charAt(1) === "/" ? n.protocol + e : n.host + e), /^(https?|wss?):\/\//.test(e) || (e = n === void 0 ? "https://" + e : n.protocol + "//" + e), r = F(e)), r.port || (/^(http|ws)$/.test(r.protocol) ? r.port = "80" : /^(http|ws)s$/.test(r.protocol) && (r.port = "443")), r.path = r.path || "/";
803
803
  let i = r.host.indexOf(":") === -1 ? r.host : "[" + r.host + "]";
804
804
  return r.id = r.protocol + "://" + i + ":" + r.port + t, r.href = r.protocol + "://" + i + (n && n.port === r.port ? "" : ":" + r.port), r;
805
805
  }
806
806
  //#endregion
807
807
  //#region node_modules/socket.io-parser/build/esm/is-binary.js
808
- var Pe = typeof ArrayBuffer == "function", Fe = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, V = Object.prototype.toString, Ie = typeof Blob == "function" || typeof Blob < "u" && V.call(Blob) === "[object BlobConstructor]", Le = typeof File == "function" || typeof File < "u" && V.call(File) === "[object FileConstructor]";
809
- function H(e) {
810
- return Pe && (e instanceof ArrayBuffer || Fe(e)) || Ie && e instanceof Blob || Le && e instanceof File;
808
+ var Fe = typeof ArrayBuffer == "function", Ie = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, B = Object.prototype.toString, Le = typeof Blob == "function" || typeof Blob < "u" && B.call(Blob) === "[object BlobConstructor]", Re = typeof File == "function" || typeof File < "u" && B.call(File) === "[object FileConstructor]";
809
+ function V(e) {
810
+ return Fe && (e instanceof ArrayBuffer || Ie(e)) || Le && e instanceof Blob || Re && e instanceof File;
811
811
  }
812
- function U(e, t) {
812
+ function H(e, t) {
813
813
  if (!e || typeof e != "object") return !1;
814
814
  if (Array.isArray(e)) {
815
- for (let t = 0, n = e.length; t < n; t++) if (U(e[t])) return !0;
815
+ for (let t = 0, n = e.length; t < n; t++) if (H(e[t])) return !0;
816
816
  return !1;
817
817
  }
818
- if (H(e)) return !0;
819
- if (e.toJSON && typeof e.toJSON == "function" && arguments.length === 1) return U(e.toJSON(), !0);
820
- for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && U(e[t])) return !0;
818
+ if (V(e)) return !0;
819
+ if (e.toJSON && typeof e.toJSON == "function" && arguments.length === 1) return H(e.toJSON(), !0);
820
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && H(e[t])) return !0;
821
821
  return !1;
822
822
  }
823
823
  //#endregion
824
824
  //#region node_modules/socket.io-parser/build/esm/binary.js
825
- function Re(e) {
825
+ function ze(e) {
826
826
  let t = [], n = e.data, r = e;
827
- return r.data = W(n, t), r.attachments = t.length, {
827
+ return r.data = U(n, t), r.attachments = t.length, {
828
828
  packet: r,
829
829
  buffers: t
830
830
  };
831
831
  }
832
- function W(e, t) {
832
+ function U(e, t, n) {
833
833
  if (!e) return e;
834
- if (H(e)) {
834
+ if (V(e)) {
835
835
  let n = {
836
836
  _placeholder: !0,
837
837
  num: t.length
@@ -839,35 +839,37 @@ function W(e, t) {
839
839
  return t.push(e), n;
840
840
  } else if (Array.isArray(e)) {
841
841
  let n = Array(e.length);
842
- for (let r = 0; r < e.length; r++) n[r] = W(e[r], t);
842
+ for (let r = 0; r < e.length; r++) n[r] = U(e[r], t);
843
843
  return n;
844
844
  } else if (typeof e == "object" && !(e instanceof Date)) {
845
- let n = {};
846
- for (let r in e) Object.prototype.hasOwnProperty.call(e, r) && (n[r] = W(e[r], t));
847
- return n;
845
+ if (e.toJSON && typeof e.toJSON == "function" && !n) return U(e.toJSON(), t, !0);
846
+ let r = {};
847
+ for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (r[n] = U(e[n], t));
848
+ return r;
848
849
  }
849
850
  return e;
850
851
  }
851
- function ze(e, t) {
852
- return e.data = G(e.data, t), delete e.attachments, e;
852
+ function Be(e, t) {
853
+ return e.data = W(e.data, t), delete e.attachments, e;
853
854
  }
854
- function G(e, t) {
855
+ function W(e, t) {
855
856
  if (!e) return e;
856
857
  if (e && e._placeholder === !0) {
857
858
  if (typeof e.num == "number" && e.num >= 0 && e.num < t.length) return t[e.num];
858
859
  throw Error("illegal attachments");
859
- } else if (Array.isArray(e)) for (let n = 0; n < e.length; n++) e[n] = G(e[n], t);
860
- else if (typeof e == "object") for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (e[n] = G(e[n], t));
860
+ } else if (Array.isArray(e)) for (let n = 0; n < e.length; n++) e[n] = W(e[n], t);
861
+ else if (typeof e == "object") for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (e[n] = W(e[n], t));
861
862
  return e;
862
863
  }
863
864
  //#endregion
864
865
  //#region node_modules/socket.io-parser/build/esm/index.js
865
- var Be = /* @__PURE__ */ e({
866
+ var Ve = /* @__PURE__ */ e({
866
867
  Decoder: () => Ue,
867
868
  Encoder: () => He,
868
869
  PacketType: () => K,
870
+ isPacketValid: () => Je,
869
871
  protocol: () => 5
870
- }), Ve = [
872
+ }), G = [
871
873
  "connect",
872
874
  "connect_error",
873
875
  "disconnect",
@@ -883,7 +885,7 @@ var He = class {
883
885
  this.replacer = e;
884
886
  }
885
887
  encode(e) {
886
- return (e.type === K.EVENT || e.type === K.ACK) && U(e) ? this.encodeAsBinary({
888
+ return (e.type === K.EVENT || e.type === K.ACK) && H(e) ? this.encodeAsBinary({
887
889
  type: e.type === K.EVENT ? K.BINARY_EVENT : K.BINARY_ACK,
888
890
  nsp: e.nsp,
889
891
  data: e.data,
@@ -895,16 +897,15 @@ var He = class {
895
897
  return (e.type === K.BINARY_EVENT || e.type === K.BINARY_ACK) && (t += e.attachments + "-"), e.nsp && e.nsp !== "/" && (t += e.nsp + ","), e.id != null && (t += e.id), e.data != null && (t += JSON.stringify(e.data, this.replacer)), t;
896
898
  }
897
899
  encodeAsBinary(e) {
898
- let t = Re(e), n = this.encodeAsString(t.packet), r = t.buffers;
900
+ let t = ze(e), n = this.encodeAsString(t.packet), r = t.buffers;
899
901
  return r.unshift(n), r;
900
902
  }
901
- };
902
- function q(e) {
903
- return Object.prototype.toString.call(e) === "[object Object]";
904
- }
905
- var Ue = class e extends w {
903
+ }, Ue = class e extends S {
906
904
  constructor(e) {
907
- super(), this.reviver = e;
905
+ super(), this.opts = Object.assign({
906
+ reviver: void 0,
907
+ maxAttachments: 10
908
+ }, typeof e == "function" ? { reviver: e } : e);
908
909
  }
909
910
  add(e) {
910
911
  let t;
@@ -912,8 +913,8 @@ var Ue = class e extends w {
912
913
  if (this.reconstructor) throw Error("got plaintext data when reconstructing a packet");
913
914
  t = this.decodeString(e);
914
915
  let n = t.type === K.BINARY_EVENT;
915
- n || t.type === K.BINARY_ACK ? (t.type = n ? K.EVENT : K.ACK, this.reconstructor = new We(t), t.attachments === 0 && super.emitReserved("decoded", t)) : super.emitReserved("decoded", t);
916
- } else if (H(e) || e.base64) if (this.reconstructor) t = this.reconstructor.takeBinaryData(e), t && (this.reconstructor = null, super.emitReserved("decoded", t));
916
+ n || t.type === K.BINARY_ACK ? (t.type = n ? K.EVENT : K.ACK, this.reconstructor = new We(t)) : super.emitReserved("decoded", t);
917
+ } else if (V(e) || e.base64) if (this.reconstructor) t = this.reconstructor.takeBinaryData(e), t && (this.reconstructor = null, super.emitReserved("decoded", t));
917
918
  else throw Error("got binary data when not reconstructing a packet");
918
919
  else throw Error("Unknown type: " + e);
919
920
  }
@@ -925,7 +926,10 @@ var Ue = class e extends w {
925
926
  for (; t.charAt(++n) !== "-" && n != t.length;);
926
927
  let i = t.substring(e, n);
927
928
  if (i != Number(i) || t.charAt(n) !== "-") throw Error("Illegal attachments");
928
- r.attachments = Number(i);
929
+ let a = Number(i);
930
+ if (!q(a) || a < 1) throw Error("Illegal attachments");
931
+ if (a > this.opts.maxAttachments) throw Error("too many attachments");
932
+ r.attachments = a;
929
933
  }
930
934
  if (t.charAt(n + 1) === "/") {
931
935
  let e = n + 1;
@@ -954,18 +958,18 @@ var Ue = class e extends w {
954
958
  }
955
959
  tryParse(e) {
956
960
  try {
957
- return JSON.parse(e, this.reviver);
961
+ return JSON.parse(e, this.opts.reviver);
958
962
  } catch {
959
963
  return !1;
960
964
  }
961
965
  }
962
966
  static isPayloadValid(e, t) {
963
967
  switch (e) {
964
- case K.CONNECT: return q(t);
968
+ case K.CONNECT: return J(t);
965
969
  case K.DISCONNECT: return t === void 0;
966
- case K.CONNECT_ERROR: return typeof t == "string" || q(t);
970
+ case K.CONNECT_ERROR: return typeof t == "string" || J(t);
967
971
  case K.EVENT:
968
- case K.BINARY_EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && Ve.indexOf(t[0]) === -1);
972
+ case K.BINARY_EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && G.indexOf(t[0]) === -1);
969
973
  case K.ACK:
970
974
  case K.BINARY_ACK: return Array.isArray(t);
971
975
  }
@@ -979,7 +983,7 @@ var Ue = class e extends w {
979
983
  }
980
984
  takeBinaryData(e) {
981
985
  if (this.buffers.push(e), this.buffers.length === this.reconPack.attachments) {
982
- let e = ze(this.reconPack, this.buffers);
986
+ let e = Be(this.reconPack, this.buffers);
983
987
  return this.finishedReconstruction(), e;
984
988
  }
985
989
  return null;
@@ -988,23 +992,48 @@ var Ue = class e extends w {
988
992
  this.reconPack = null, this.buffers = [];
989
993
  }
990
994
  };
995
+ function Ge(e) {
996
+ return typeof e == "string";
997
+ }
998
+ var q = Number.isInteger || function(e) {
999
+ return typeof e == "number" && isFinite(e) && Math.floor(e) === e;
1000
+ };
1001
+ function Ke(e) {
1002
+ return e === void 0 || q(e);
1003
+ }
1004
+ function J(e) {
1005
+ return Object.prototype.toString.call(e) === "[object Object]";
1006
+ }
1007
+ function qe(e, t) {
1008
+ switch (e) {
1009
+ case K.CONNECT: return t === void 0 || J(t);
1010
+ case K.DISCONNECT: return t === void 0;
1011
+ case K.EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && G.indexOf(t[0]) === -1);
1012
+ case K.ACK: return Array.isArray(t);
1013
+ case K.CONNECT_ERROR: return typeof t == "string" || J(t);
1014
+ default: return !1;
1015
+ }
1016
+ }
1017
+ function Je(e) {
1018
+ return Ge(e.nsp) && Ke(e.id) && qe(e.type, e.data);
1019
+ }
991
1020
  //#endregion
992
1021
  //#region node_modules/socket.io-client/build/esm/on.js
993
- function J(e, t, n) {
1022
+ function Y(e, t, n) {
994
1023
  return e.on(t, n), function() {
995
1024
  e.off(t, n);
996
1025
  };
997
1026
  }
998
1027
  //#endregion
999
1028
  //#region node_modules/socket.io-client/build/esm/socket.js
1000
- var Ge = Object.freeze({
1029
+ var Ye = Object.freeze({
1001
1030
  connect: 1,
1002
1031
  connect_error: 1,
1003
1032
  disconnect: 1,
1004
1033
  disconnecting: 1,
1005
1034
  newListener: 1,
1006
1035
  removeListener: 1
1007
- }), Y = class extends w {
1036
+ }), Xe = class extends S {
1008
1037
  constructor(e, t, n) {
1009
1038
  super(), this.connected = !1, this.recovered = !1, this.receiveBuffer = [], this.sendBuffer = [], this._queue = [], this._queueSeq = 0, this.ids = 0, this.acks = {}, this.flags = {}, this.io = e, this.nsp = t, n && n.auth && (this.auth = n.auth), this._opts = Object.assign({}, n), this.io._autoConnect && this.open();
1010
1039
  }
@@ -1015,10 +1044,10 @@ var Ge = Object.freeze({
1015
1044
  if (this.subs) return;
1016
1045
  let e = this.io;
1017
1046
  this.subs = [
1018
- J(e, "open", this.onopen.bind(this)),
1019
- J(e, "packet", this.onpacket.bind(this)),
1020
- J(e, "error", this.onerror.bind(this)),
1021
- J(e, "close", this.onclose.bind(this))
1047
+ Y(e, "open", this.onopen.bind(this)),
1048
+ Y(e, "packet", this.onpacket.bind(this)),
1049
+ Y(e, "error", this.onerror.bind(this)),
1050
+ Y(e, "close", this.onclose.bind(this))
1022
1051
  ];
1023
1052
  }
1024
1053
  get active() {
@@ -1034,7 +1063,7 @@ var Ge = Object.freeze({
1034
1063
  return e.unshift("message"), this.emit.apply(this, e), this;
1035
1064
  }
1036
1065
  emit(e, ...t) {
1037
- if (Ge.hasOwnProperty(e)) throw Error("\"" + e.toString() + "\" is a reserved event name");
1066
+ if (Ye.hasOwnProperty(e)) throw Error("\"" + e.toString() + "\" is a reserved event name");
1038
1067
  if (t.unshift(e), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) return this._addToQueue(t), this;
1039
1068
  let n = {
1040
1069
  type: K.EVENT,
@@ -1257,14 +1286,14 @@ X.prototype.duration = function() {
1257
1286
  };
1258
1287
  //#endregion
1259
1288
  //#region node_modules/socket.io-client/build/esm/manager.js
1260
- var Z = class extends w {
1289
+ var Z = class extends S {
1261
1290
  constructor(e, t) {
1262
- super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (t = e, e = void 0), t ||= {}, t.path = t.path || "/socket.io", this.opts = t, O(this, t), this.reconnection(t.reconnection !== !1), this.reconnectionAttempts(t.reconnectionAttempts || Infinity), this.reconnectionDelay(t.reconnectionDelay || 1e3), this.reconnectionDelayMax(t.reconnectionDelayMax || 5e3), this.randomizationFactor(t.randomizationFactor ?? .5), this.backoff = new X({
1291
+ super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (t = e, e = void 0), t ||= {}, t.path = t.path || "/socket.io", this.opts = t, E(this, t), this.reconnection(t.reconnection !== !1), this.reconnectionAttempts(t.reconnectionAttempts || Infinity), this.reconnectionDelay(t.reconnectionDelay || 1e3), this.reconnectionDelayMax(t.reconnectionDelayMax || 5e3), this.randomizationFactor(t.randomizationFactor ?? .5), this.backoff = new X({
1263
1292
  min: this.reconnectionDelay(),
1264
1293
  max: this.reconnectionDelayMax(),
1265
1294
  jitter: this.randomizationFactor()
1266
1295
  }), this.timeout(t.timeout == null ? 2e4 : t.timeout), this._readyState = "closed", this.uri = e;
1267
- let n = t.parser || Be;
1296
+ let n = t.parser || Ve;
1268
1297
  this.encoder = new n.Encoder(), this.decoder = new n.Decoder(), this._autoConnect = t.autoConnect !== !1, this._autoConnect && this.open();
1269
1298
  }
1270
1299
  reconnection(e) {
@@ -1293,14 +1322,14 @@ var Z = class extends w {
1293
1322
  }
1294
1323
  open(e) {
1295
1324
  if (~this._readyState.indexOf("open")) return this;
1296
- this.engine = new B(this.uri, this.opts);
1325
+ this.engine = new z(this.uri, this.opts);
1297
1326
  let t = this.engine, n = this;
1298
1327
  this._readyState = "opening", this.skipReconnect = !1;
1299
- let r = J(t, "open", function() {
1328
+ let r = Y(t, "open", function() {
1300
1329
  n.onopen(), e && e();
1301
1330
  }), i = (t) => {
1302
1331
  this.cleanup(), this._readyState = "closed", this.emitReserved("error", t), e ? e(t) : this.maybeReconnectOnOpen();
1303
- }, a = J(t, "error", i);
1332
+ }, a = Y(t, "error", i);
1304
1333
  if (!1 !== this._timeout) {
1305
1334
  let e = this._timeout, n = this.setTimeoutFn(() => {
1306
1335
  r(), i(/* @__PURE__ */ Error("timeout")), t.close();
@@ -1317,7 +1346,7 @@ var Z = class extends w {
1317
1346
  onopen() {
1318
1347
  this.cleanup(), this._readyState = "open", this.emitReserved("open");
1319
1348
  let e = this.engine;
1320
- this.subs.push(J(e, "ping", this.onping.bind(this)), J(e, "data", this.ondata.bind(this)), J(e, "error", this.onerror.bind(this)), J(e, "close", this.onclose.bind(this)), J(this.decoder, "decoded", this.ondecoded.bind(this)));
1349
+ this.subs.push(Y(e, "ping", this.onping.bind(this)), Y(e, "data", this.ondata.bind(this)), Y(e, "error", this.onerror.bind(this)), Y(e, "close", this.onclose.bind(this)), Y(this.decoder, "decoded", this.ondecoded.bind(this)));
1321
1350
  }
1322
1351
  onping() {
1323
1352
  this.emitReserved("ping");
@@ -1330,7 +1359,7 @@ var Z = class extends w {
1330
1359
  }
1331
1360
  }
1332
1361
  ondecoded(e) {
1333
- T(() => {
1362
+ C(() => {
1334
1363
  this.emitReserved("packet", e);
1335
1364
  }, this.setTimeoutFn);
1336
1365
  }
@@ -1339,7 +1368,7 @@ var Z = class extends w {
1339
1368
  }
1340
1369
  socket(e, t) {
1341
1370
  let n = this.nsps[e];
1342
- return n ? this._autoConnect && !n.active && n.connect() : (n = new Y(this, e, t), this.nsps[e] = n), n;
1371
+ return n ? this._autoConnect && !n.active && n.connect() : (n = new Xe(this, e, t), this.nsps[e] = n), n;
1343
1372
  }
1344
1373
  _destroy(e) {
1345
1374
  let t = Object.keys(this.nsps);
@@ -1387,18 +1416,18 @@ var Z = class extends w {
1387
1416
  }, Q = {};
1388
1417
  function $(e, t) {
1389
1418
  typeof e == "object" && (t = e, e = void 0), t ||= {};
1390
- let n = Ne(e, t.path || "/socket.io"), r = n.source, i = n.id, a = n.path, o = Q[i] && a in Q[i].nsps, s = t.forceNew || t["force new connection"] || !1 === t.multiplex || o, c;
1419
+ let n = Pe(e, t.path || "/socket.io"), r = n.source, i = n.id, a = n.path, o = Q[i] && a in Q[i].nsps, s = t.forceNew || t["force new connection"] || !1 === t.multiplex || o, c;
1391
1420
  return s ? c = new Z(r, t) : (Q[i] || (Q[i] = new Z(r, t)), c = Q[i]), n.query && !t.query && (t.query = n.queryKey), c.socket(n.path, t);
1392
1421
  }
1393
1422
  Object.assign($, {
1394
1423
  Manager: Z,
1395
- Socket: Y,
1424
+ Socket: Xe,
1396
1425
  io: $,
1397
1426
  connect: $
1398
1427
  });
1399
1428
  //#endregion
1400
1429
  //#region src/sn/SysBase.ts
1401
- var Ke = class e {
1430
+ var Ze = class e {
1402
1431
  hPlg;
1403
1432
  arg;
1404
1433
  elc = new a();
@@ -1759,6 +1788,6 @@ top: ${String((r.stageH - o) / 2 * this.#a + o * (a.dy ?? 0))}px;`, i.classList.
1759
1788
  async outputFile(e, t) {}
1760
1789
  };
1761
1790
  //#endregion
1762
- export { Ke as t };
1791
+ export { Ze as t };
1763
1792
 
1764
1793
  //# sourceMappingURL=SysBase.js.map