@aikaara/chat-sdk 0.9.7 → 0.9.9

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.
@@ -1,4 +1,4 @@
1
- class pl {
1
+ class ml {
2
2
  identifier;
3
3
  callbacks = {};
4
4
  sendFn;
@@ -37,7 +37,7 @@ class pl {
37
37
  this.callbacks.rejected?.();
38
38
  }
39
39
  }
40
- class ao {
40
+ class lo {
41
41
  ws = null;
42
42
  url;
43
43
  subscriptions = /* @__PURE__ */ new Map();
@@ -63,7 +63,7 @@ class ao {
63
63
  this.ws && (this.ws.onclose = null, this.ws.close(), this.ws = null), this.subscriptions.forEach((e) => e._notifyDisconnected()), this.subscriptions.clear();
64
64
  }
65
65
  subscribe(e) {
66
- const t = JSON.stringify(e), r = new pl(t, (a) => {
66
+ const t = JSON.stringify(e), r = new ml(t, (a) => {
67
67
  this.send({
68
68
  command: "message",
69
69
  identifier: t,
@@ -142,7 +142,7 @@ class ao {
142
142
  }
143
143
  }
144
144
  }
145
- class Ts {
145
+ class Os {
146
146
  handlers = /* @__PURE__ */ new Map();
147
147
  on(e, t) {
148
148
  return this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set()), this.handlers.get(e).add(t), () => this.off(e, t);
@@ -163,8 +163,8 @@ class Ts {
163
163
  this.handlers.clear();
164
164
  }
165
165
  }
166
- const gl = 1e3, ml = 10, bl = 400, yl = 600, lo = "#6366f1", vl = 12, wl = "system-ui, -apple-system, sans-serif", co = "Type a message...", _l = "bottom-right", kl = "light", Sl = { x: 20, y: 20 }, Br = "aikaara_conversation_id";
167
- class El extends Ts {
166
+ const bl = 1e3, yl = 10, vl = 400, wl = 600, co = "#6366f1", _l = 12, kl = "system-ui, -apple-system, sans-serif", uo = "Type a message...", Sl = "bottom-right", El = "light", xl = { x: 20, y: 20 }, Fr = "aikaara_conversation_id";
167
+ class Al extends Os {
168
168
  client;
169
169
  config;
170
170
  state = "disconnected";
@@ -173,7 +173,7 @@ class El extends Ts {
173
173
  constructor(e) {
174
174
  super(), this.config = e;
175
175
  const t = this.buildWsUrl(e.baseUrl, e.userToken);
176
- this.client = new ao(t);
176
+ this.client = new lo(t);
177
177
  }
178
178
  async connect() {
179
179
  this.setState("connecting");
@@ -220,17 +220,17 @@ class El extends Ts {
220
220
  this.state !== e && (this.state = e, this.emit("connection:state", e));
221
221
  }
222
222
  scheduleReconnect() {
223
- const e = this.config.maxReconnectAttempts ?? ml;
223
+ const e = this.config.maxReconnectAttempts ?? yl;
224
224
  if (this.reconnectAttempt >= e) {
225
225
  this.emit("error", new Error("Max reconnection attempts reached"));
226
226
  return;
227
227
  }
228
228
  this.setState("reconnecting");
229
- const r = (this.config.reconnectInterval ?? gl) * Math.pow(2, this.reconnectAttempt);
229
+ const r = (this.config.reconnectInterval ?? bl) * Math.pow(2, this.reconnectAttempt);
230
230
  this.reconnectAttempt++, this.reconnectTimer = setTimeout(async () => {
231
231
  try {
232
232
  const a = this.buildWsUrl(this.config.baseUrl, this.config.userToken);
233
- this.client = new ao(a), await this.connect();
233
+ this.client = new lo(a), await this.connect();
234
234
  } catch {
235
235
  }
236
236
  }, r);
@@ -246,7 +246,7 @@ class El extends Ts {
246
246
  return `${e.replace(/^http/, "ws")}/cable?token=${t}`;
247
247
  }
248
248
  }
249
- class xl {
249
+ class Il {
250
250
  baseUrl;
251
251
  apiKey;
252
252
  authToken;
@@ -353,7 +353,7 @@ class xl {
353
353
  return r && (n.body = JSON.stringify(r)), fetch(e, n);
354
354
  }
355
355
  }
356
- class Al {
356
+ class Tl {
357
357
  _messages = [];
358
358
  optimisticCounter = 0;
359
359
  get messages() {
@@ -400,7 +400,7 @@ class Al {
400
400
  const r = e.externalId ? this._messages.find((n) => n.externalId && n.externalId === e.externalId) : void 0;
401
401
  if (r)
402
402
  return Object.assign(r, e, { id: r.id }), { message: r, deduped: !0 };
403
- const a = Il(this._messages, e);
403
+ const a = ho(this._messages, e);
404
404
  return a ? (Object.assign(a, e, { id: a.id }), { message: a, deduped: !0 }) : (this._messages.push(e), { message: e, deduped: !1 });
405
405
  }
406
406
  updateMessageStatus(e, t) {
@@ -441,48 +441,77 @@ class Al {
441
441
  this._messages.push(e);
442
442
  }
443
443
  setMessages(e) {
444
- this._messages = [...e];
444
+ const t = [];
445
+ for (const r of e) {
446
+ const a = ho(t, r);
447
+ if (a) {
448
+ const n = Or(a), i = Or(r);
449
+ !n && i && Object.assign(a, r, { id: a.id });
450
+ continue;
451
+ }
452
+ t.push({ ...r });
453
+ }
454
+ this._messages = t;
445
455
  }
446
456
  clear() {
447
457
  this._messages = [];
448
458
  }
449
459
  }
450
- function Il(c, e, t = 15e3) {
460
+ function ho(c, e, t = 15e3) {
451
461
  const r = e.attachments && e.attachments[0], a = (e.metadata ?? {}).attributes;
452
462
  if (!(!!r || !!(a && a.fileMessage))) return null;
453
- const i = fo(e), o = uo(e), s = ho(e);
463
+ const i = Or(e), o = fo(e), s = po(e);
454
464
  if (!i && !o && !s) return null;
455
465
  const l = new Date(e.createdAt).getTime();
456
466
  for (let u = c.length - 1; u >= 0; u--) {
457
467
  const d = c[u], p = d.attachments && d.attachments[0], y = (d.metadata ?? {}).attributes;
458
- if (!(!!p || !!(y && y.fileMessage)) || Math.abs(l - new Date(d.createdAt).getTime()) > t) continue;
459
- const m = fo(d);
460
- if (i && m && i === m) return d;
461
- const b = uo(d);
462
- if (o && b && o === b) return d;
463
- const k = ho(d);
464
- if (s && k && s === k) return d;
468
+ if (!(!!p || !!(y && y.fileMessage))) continue;
469
+ const m = (d.content || "").trim().toLowerCase();
470
+ if (m === "file_uploaded" || m === "file_upload" || Math.abs(l - new Date(d.createdAt).getTime()) > t) continue;
471
+ const b = Or(d);
472
+ if (i && b && i === b) return d;
473
+ const k = fo(d);
474
+ if (o && k && o === k) return d;
475
+ const g = po(d);
476
+ if (s && g && s === g) return d;
465
477
  }
466
478
  return null;
467
479
  }
468
- function uo(c) {
480
+ function fo(c) {
469
481
  const e = c.attachments && c.attachments[0];
470
482
  if (e && typeof e.fileUrl == "string")
471
483
  return e.fileUrl;
484
+ const t = Cs(c);
485
+ if (t) return t;
472
486
  }
473
- function ho(c) {
487
+ function po(c) {
474
488
  const e = c.attachments && c.attachments[0];
475
489
  if (e && typeof e.fileName == "string")
476
490
  return e.fileName;
491
+ const t = (c.metadata ?? {}).attributes;
492
+ if (t && typeof t.fileName == "string") return t.fileName;
493
+ const n = c.template?.payload?.elements?.[0]?.description;
494
+ if (typeof n == "string" && n) return n;
477
495
  }
478
- function fo(c) {
496
+ function Or(c) {
479
497
  const e = c.attachments && c.attachments[0];
480
498
  if (e && typeof e.cloudFileId == "string")
481
499
  return e.cloudFileId;
482
500
  const t = (c.metadata ?? {}).attributes;
483
501
  if (t && typeof t.cloudFileId == "string") return t.cloudFileId;
502
+ const r = Cs(c);
503
+ if (r) {
504
+ const a = /[?&]cloudFileId=([^&]+)/.exec(r);
505
+ if (a) return decodeURIComponent(a[1]);
506
+ }
484
507
  }
485
- class Tl {
508
+ function Cs(c) {
509
+ const e = c.template;
510
+ if (e?.templateId !== "7") return;
511
+ const r = e.payload?.elements?.[0]?.action?.url;
512
+ return typeof r == "string" ? r : void 0;
513
+ }
514
+ class Ol {
486
515
  _conversationId;
487
516
  persist;
488
517
  constructor(e, t = !0) {
@@ -497,42 +526,42 @@ class Tl {
497
526
  clear() {
498
527
  if (this._conversationId = null, this.persist)
499
528
  try {
500
- localStorage.removeItem(Br);
529
+ localStorage.removeItem(Fr);
501
530
  } catch {
502
531
  }
503
532
  }
504
533
  loadFromStorage() {
505
534
  if (!this.persist) return null;
506
535
  try {
507
- return localStorage.getItem(Br);
536
+ return localStorage.getItem(Fr);
508
537
  } catch {
509
538
  return null;
510
539
  }
511
540
  }
512
541
  saveToStorage(e) {
513
542
  try {
514
- localStorage.setItem(Br, e);
543
+ localStorage.setItem(Fr, e);
515
544
  } catch {
516
545
  }
517
546
  }
518
547
  }
519
- var Ki = Object.defineProperty, Ol = Object.getOwnPropertyDescriptor, Cl = Object.getOwnPropertyNames, Pl = Object.prototype.hasOwnProperty, He = (c, e) => () => (c && (e = c(c = 0)), e), pe = (c, e) => () => (e || c((e = { exports: {} }).exports, e), e.exports), Lt = (c, e) => {
520
- for (var t in e) Ki(c, t, { get: e[t], enumerable: !0 });
521
- }, Ml = (c, e, t, r) => {
522
- if (e && typeof e == "object" || typeof e == "function") for (let a of Cl(e)) !Pl.call(c, a) && a !== t && Ki(c, a, { get: () => e[a], enumerable: !(r = Ol(e, a)) || r.enumerable });
548
+ var Vi = Object.defineProperty, Cl = Object.getOwnPropertyDescriptor, Pl = Object.getOwnPropertyNames, Ml = Object.prototype.hasOwnProperty, He = (c, e) => () => (c && (e = c(c = 0)), e), pe = (c, e) => () => (e || c((e = { exports: {} }).exports, e), e.exports), Lt = (c, e) => {
549
+ for (var t in e) Vi(c, t, { get: e[t], enumerable: !0 });
550
+ }, Rl = (c, e, t, r) => {
551
+ if (e && typeof e == "object" || typeof e == "function") for (let a of Pl(e)) !Ml.call(c, a) && a !== t && Vi(c, a, { get: () => e[a], enumerable: !(r = Cl(e, a)) || r.enumerable });
523
552
  return c;
524
- }, Ce = (c) => Ml(Ki({}, "__esModule", { value: !0 }), c), le = He(() => {
553
+ }, Ce = (c) => Rl(Vi({}, "__esModule", { value: !0 }), c), le = He(() => {
525
554
  }), Pe = {};
526
- Lt(Pe, { _debugEnd: () => In, _debugProcess: () => An, _events: () => Wn, _eventsCount: () => qn, _exiting: () => fn, _fatalExceptions: () => Sn, _getActiveHandles: () => Ls, _getActiveRequests: () => js, _kill: () => gn, _linkedBinding: () => Ms, _maxListeners: () => $n, _preload_modules: () => Fn, _rawDebug: () => cn, _startProfilerIdleNotifier: () => Tn, _stopProfilerIdleNotifier: () => On, _tickCallback: () => xn, abort: () => Rn, addListener: () => Hn, allowedNodeEnvironmentFlags: () => _n, arch: () => Gr, argv: () => Jr, argv0: () => Bn, assert: () => Ns, binding: () => rn, browser: () => ln, chdir: () => sn, config: () => dn, cpuUsage: () => qt, cwd: () => on, debugPort: () => Un, default: () => Gi, dlopen: () => Rs, domain: () => hn, emit: () => Yn, emitWarning: () => tn, env: () => Qr, execArgv: () => Xr, execPath: () => Nn, exit: () => vn, features: () => kn, hasUncaughtExceptionCaptureCallback: () => Us, hrtime: () => ir, kill: () => yn, listeners: () => Fs, memoryUsage: () => bn, moduleLoadList: () => un, nextTick: () => Cs, off: () => Kn, on: () => nt, once: () => zn, openStdin: () => wn, pid: () => jn, platform: () => Yr, ppid: () => Ln, prependListener: () => Qn, prependOnceListener: () => Jn, reallyExit: () => pn, release: () => an, removeAllListeners: () => Gn, removeListener: () => Vn, resourceUsage: () => mn, setSourceMapsEnabled: () => Dn, setUncaughtExceptionCaptureCallback: () => En, stderr: () => Pn, stdin: () => Mn, stdout: () => Cn, title: () => Vr, umask: () => nn, uptime: () => Bs, version: () => Zr, versions: () => en });
527
- function Vi(c) {
555
+ Lt(Pe, { _debugEnd: () => Tn, _debugProcess: () => In, _events: () => qn, _eventsCount: () => Hn, _exiting: () => dn, _fatalExceptions: () => En, _getActiveHandles: () => Us, _getActiveRequests: () => Ns, _kill: () => mn, _linkedBinding: () => js, _maxListeners: () => Wn, _preload_modules: () => Dn, _rawDebug: () => un, _startProfilerIdleNotifier: () => On, _stopProfilerIdleNotifier: () => Cn, _tickCallback: () => An, abort: () => jn, addListener: () => zn, allowedNodeEnvironmentFlags: () => kn, arch: () => Yr, argv: () => Xr, argv0: () => Fn, assert: () => Bs, binding: () => nn, browser: () => cn, chdir: () => an, config: () => pn, cpuUsage: () => qt, cwd: () => sn, debugPort: () => Bn, default: () => Yi, dlopen: () => Ls, domain: () => fn, emit: () => Qn, emitWarning: () => rn, env: () => Jr, execArgv: () => Zr, execPath: () => Un, exit: () => wn, features: () => Sn, hasUncaughtExceptionCaptureCallback: () => Fs, hrtime: () => ir, kill: () => vn, listeners: () => $s, memoryUsage: () => yn, moduleLoadList: () => hn, nextTick: () => Ms, off: () => Vn, on: () => nt, once: () => Kn, openStdin: () => _n, pid: () => Ln, platform: () => Qr, ppid: () => Nn, prependListener: () => Jn, prependOnceListener: () => Xn, reallyExit: () => gn, release: () => ln, removeAllListeners: () => Yn, removeListener: () => Gn, resourceUsage: () => bn, setSourceMapsEnabled: () => $n, setUncaughtExceptionCaptureCallback: () => xn, stderr: () => Mn, stdin: () => Rn, stdout: () => Pn, title: () => Gr, umask: () => on, uptime: () => Ds, version: () => en, versions: () => tn });
556
+ function Gi(c) {
528
557
  throw new Error("Node.js process " + c + " is not supported by JSPM core outside of Node.js");
529
558
  }
530
- function Rl() {
531
- !St || !_t || (St = !1, _t.length ? et = _t.concat(et) : Vt = -1, et.length && Os());
559
+ function jl() {
560
+ !St || !_t || (St = !1, _t.length ? et = _t.concat(et) : Vt = -1, et.length && Ps());
532
561
  }
533
- function Os() {
562
+ function Ps() {
534
563
  if (!St) {
535
- var c = setTimeout(Rl, 0);
564
+ var c = setTimeout(jl, 0);
536
565
  St = !0;
537
566
  for (var e = et.length; e; ) {
538
567
  for (_t = et, et = []; ++Vt < e; ) _t && _t[Vt].run();
@@ -541,35 +570,35 @@ function Os() {
541
570
  _t = null, St = !1, clearTimeout(c);
542
571
  }
543
572
  }
544
- function Cs(c) {
573
+ function Ms(c) {
545
574
  var e = new Array(arguments.length - 1);
546
575
  if (arguments.length > 1) for (var t = 1; t < arguments.length; t++) e[t - 1] = arguments[t];
547
- et.push(new Ps(c, e)), et.length === 1 && !St && setTimeout(Os, 0);
576
+ et.push(new Rs(c, e)), et.length === 1 && !St && setTimeout(Ps, 0);
548
577
  }
549
- function Ps(c, e) {
578
+ function Rs(c, e) {
550
579
  this.fun = c, this.array = e;
551
580
  }
552
581
  function Be() {
553
582
  }
554
- function Ms(c) {
555
- Vi("_linkedBinding");
583
+ function js(c) {
584
+ Gi("_linkedBinding");
556
585
  }
557
- function Rs(c) {
558
- Vi("dlopen");
586
+ function Ls(c) {
587
+ Gi("dlopen");
559
588
  }
560
- function js() {
589
+ function Ns() {
561
590
  return [];
562
591
  }
563
- function Ls() {
592
+ function Us() {
564
593
  return [];
565
594
  }
566
- function Ns(c, e) {
595
+ function Bs(c, e) {
567
596
  if (!c) throw new Error(e || "assertion error");
568
597
  }
569
- function Us() {
598
+ function Fs() {
570
599
  return !1;
571
600
  }
572
- function Bs() {
601
+ function Ds() {
573
602
  return ot.now() / 1e3;
574
603
  }
575
604
  function ir(c) {
@@ -577,35 +606,35 @@ function ir(c) {
577
606
  return c && (r = r - c[0], a = a - c[1], a < 0 && (r--, a += or)), [r, a];
578
607
  }
579
608
  function nt() {
580
- return Gi;
609
+ return Yi;
581
610
  }
582
- function Fs(c) {
611
+ function $s(c) {
583
612
  return [];
584
613
  }
585
- var et, St, _t, Vt, Vr, Gr, Yr, Qr, Jr, Xr, Zr, en, tn, rn, nn, on, sn, an, ln, cn, un, hn, fn, dn, pn, gn, qt, mn, bn, yn, vn, wn, _n, kn, Sn, En, xn, An, In, Tn, On, Cn, Pn, Mn, Rn, jn, Ln, Nn, Un, Bn, Fn, Dn, ot, Fr, or, $n, Wn, qn, Hn, zn, Kn, Vn, Gn, Yn, Qn, Jn, Gi, jl = He(() => {
586
- le(), ue(), ce(), et = [], St = !1, Vt = -1, Ps.prototype.run = function() {
614
+ var et, St, _t, Vt, Gr, Yr, Qr, Jr, Xr, Zr, en, tn, rn, nn, on, sn, an, ln, cn, un, hn, fn, dn, pn, gn, mn, qt, bn, yn, vn, wn, _n, kn, Sn, En, xn, An, In, Tn, On, Cn, Pn, Mn, Rn, jn, Ln, Nn, Un, Bn, Fn, Dn, $n, ot, Dr, or, Wn, qn, Hn, zn, Kn, Vn, Gn, Yn, Qn, Jn, Xn, Yi, Ll = He(() => {
615
+ le(), ue(), ce(), et = [], St = !1, Vt = -1, Rs.prototype.run = function() {
587
616
  this.fun.apply(null, this.array);
588
- }, Vr = "browser", Gr = "x64", Yr = "browser", Qr = { PATH: "/usr/bin", LANG: typeof navigator < "u" ? navigator.language + ".UTF-8" : void 0, PWD: "/", HOME: "/home", TMP: "/tmp" }, Jr = ["/usr/bin/node"], Xr = [], Zr = "v16.8.0", en = {}, tn = function(c, e) {
617
+ }, Gr = "browser", Yr = "x64", Qr = "browser", Jr = { PATH: "/usr/bin", LANG: typeof navigator < "u" ? navigator.language + ".UTF-8" : void 0, PWD: "/", HOME: "/home", TMP: "/tmp" }, Xr = ["/usr/bin/node"], Zr = [], en = "v16.8.0", tn = {}, rn = function(c, e) {
589
618
  console.warn((e ? e + ": " : "") + c);
590
- }, rn = function(c) {
591
- Vi("binding");
592
619
  }, nn = function(c) {
620
+ Gi("binding");
621
+ }, on = function(c) {
593
622
  return 0;
594
- }, on = function() {
623
+ }, sn = function() {
595
624
  return "/";
596
- }, sn = function(c) {
597
- }, an = { name: "node", sourceUrl: "", headersUrl: "", libUrl: "" }, ln = !0, cn = Be, un = [], hn = {}, fn = !1, dn = {}, pn = Be, gn = Be, qt = function() {
625
+ }, an = function(c) {
626
+ }, ln = { name: "node", sourceUrl: "", headersUrl: "", libUrl: "" }, cn = !0, un = Be, hn = [], fn = {}, dn = !1, pn = {}, gn = Be, mn = Be, qt = function() {
598
627
  return {};
599
- }, mn = qt, bn = qt, yn = Be, vn = Be, wn = Be, _n = {}, kn = { inspector: !1, debug: !1, uv: !1, ipv6: !1, tls_alpn: !1, tls_sni: !1, tls_ocsp: !1, tls: !1, cached_builtins: !0 }, Sn = Be, En = Be, xn = Be, An = Be, In = Be, Tn = Be, On = Be, Cn = void 0, Pn = void 0, Mn = void 0, Rn = Be, jn = 2, Ln = 1, Nn = "/bin/usr/node", Un = 9229, Bn = "node", Fn = [], Dn = Be, ot = { now: typeof performance < "u" ? performance.now.bind(performance) : void 0, timing: typeof performance < "u" ? performance.timing : void 0 }, ot.now === void 0 && (Fr = Date.now(), ot.timing && ot.timing.navigationStart && (Fr = ot.timing.navigationStart), ot.now = () => Date.now() - Fr), or = 1e9, ir.bigint = function(c) {
628
+ }, bn = qt, yn = qt, vn = Be, wn = Be, _n = Be, kn = {}, Sn = { inspector: !1, debug: !1, uv: !1, ipv6: !1, tls_alpn: !1, tls_sni: !1, tls_ocsp: !1, tls: !1, cached_builtins: !0 }, En = Be, xn = Be, An = Be, In = Be, Tn = Be, On = Be, Cn = Be, Pn = void 0, Mn = void 0, Rn = void 0, jn = Be, Ln = 2, Nn = 1, Un = "/bin/usr/node", Bn = 9229, Fn = "node", Dn = [], $n = Be, ot = { now: typeof performance < "u" ? performance.now.bind(performance) : void 0, timing: typeof performance < "u" ? performance.timing : void 0 }, ot.now === void 0 && (Dr = Date.now(), ot.timing && ot.timing.navigationStart && (Dr = ot.timing.navigationStart), ot.now = () => Date.now() - Dr), or = 1e9, ir.bigint = function(c) {
600
629
  var e = ir(c);
601
630
  return typeof BigInt > "u" ? e[0] * or + e[1] : BigInt(e[0] * or) + BigInt(e[1]);
602
- }, $n = 10, Wn = {}, qn = 0, Hn = nt, zn = nt, Kn = nt, Vn = nt, Gn = nt, Yn = Be, Qn = nt, Jn = nt, Gi = { version: Zr, versions: en, arch: Gr, platform: Yr, browser: ln, release: an, _rawDebug: cn, moduleLoadList: un, binding: rn, _linkedBinding: Ms, _events: Wn, _eventsCount: qn, _maxListeners: $n, on: nt, addListener: Hn, once: zn, off: Kn, removeListener: Vn, removeAllListeners: Gn, emit: Yn, prependListener: Qn, prependOnceListener: Jn, listeners: Fs, domain: hn, _exiting: fn, config: dn, dlopen: Rs, uptime: Bs, _getActiveRequests: js, _getActiveHandles: Ls, reallyExit: pn, _kill: gn, cpuUsage: qt, resourceUsage: mn, memoryUsage: bn, kill: yn, exit: vn, openStdin: wn, allowedNodeEnvironmentFlags: _n, assert: Ns, features: kn, _fatalExceptions: Sn, setUncaughtExceptionCaptureCallback: En, hasUncaughtExceptionCaptureCallback: Us, emitWarning: tn, nextTick: Cs, _tickCallback: xn, _debugProcess: An, _debugEnd: In, _startProfilerIdleNotifier: Tn, _stopProfilerIdleNotifier: On, stdout: Cn, stdin: Mn, stderr: Pn, abort: Rn, umask: nn, chdir: sn, cwd: on, env: Qr, title: Vr, argv: Jr, execArgv: Xr, pid: jn, ppid: Ln, execPath: Nn, debugPort: Un, hrtime: ir, argv0: Bn, _preload_modules: Fn, setSourceMapsEnabled: Dn };
631
+ }, Wn = 10, qn = {}, Hn = 0, zn = nt, Kn = nt, Vn = nt, Gn = nt, Yn = nt, Qn = Be, Jn = nt, Xn = nt, Yi = { version: en, versions: tn, arch: Yr, platform: Qr, browser: cn, release: ln, _rawDebug: un, moduleLoadList: hn, binding: nn, _linkedBinding: js, _events: qn, _eventsCount: Hn, _maxListeners: Wn, on: nt, addListener: zn, once: Kn, off: Vn, removeListener: Gn, removeAllListeners: Yn, emit: Qn, prependListener: Jn, prependOnceListener: Xn, listeners: $s, domain: fn, _exiting: dn, config: pn, dlopen: Ls, uptime: Ds, _getActiveRequests: Ns, _getActiveHandles: Us, reallyExit: gn, _kill: mn, cpuUsage: qt, resourceUsage: bn, memoryUsage: yn, kill: vn, exit: wn, openStdin: _n, allowedNodeEnvironmentFlags: kn, assert: Bs, features: Sn, _fatalExceptions: En, setUncaughtExceptionCaptureCallback: xn, hasUncaughtExceptionCaptureCallback: Fs, emitWarning: rn, nextTick: Ms, _tickCallback: An, _debugProcess: In, _debugEnd: Tn, _startProfilerIdleNotifier: On, _stopProfilerIdleNotifier: Cn, stdout: Pn, stdin: Rn, stderr: Mn, abort: jn, umask: on, chdir: an, cwd: sn, env: Jr, title: Gr, argv: Xr, execArgv: Zr, pid: Ln, ppid: Nn, execPath: Un, debugPort: Bn, hrtime: ir, argv0: Fn, _preload_modules: Dn, setSourceMapsEnabled: $n };
603
632
  }), ce = He(() => {
604
- jl();
633
+ Ll();
605
634
  });
606
- function Ll() {
607
- if (Xn) return Ct;
608
- Xn = !0, Ct.byteLength = o, Ct.toByteArray = l, Ct.fromByteArray = p;
635
+ function Nl() {
636
+ if (Zn) return Ct;
637
+ Zn = !0, Ct.byteLength = o, Ct.toByteArray = l, Ct.fromByteArray = p;
609
638
  for (var c = [], e = [], t = typeof Uint8Array < "u" ? Uint8Array : Array, r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a = 0, n = r.length; a < n; ++a) c[a] = r[a], e[r.charCodeAt(a)] = a;
610
639
  e[45] = 62, e[95] = 63;
611
640
  function i(y) {
@@ -641,8 +670,8 @@ function Ll() {
641
670
  }
642
671
  return Ct;
643
672
  }
644
- function Nl() {
645
- return Zn ? Ht : (Zn = !0, Ht.read = function(c, e, t, r, a) {
673
+ function Ul() {
674
+ return ei ? Ht : (ei = !0, Ht.read = function(c, e, t, r, a) {
646
675
  var n, i, o = a * 8 - r - 1, s = (1 << o) - 1, l = s >> 1, u = -7, d = t ? a - 1 : 0, p = t ? -1 : 1, y = c[e + d];
647
676
  for (d += p, n = y & (1 << -u) - 1, y >>= -u, u += o; u > 0; n = n * 256 + c[e + d], d += p, u -= 8) ;
648
677
  for (i = n & (1 << -u) - 1, n >>= -u, u += r; u > 0; i = i * 256 + c[e + d], d += p, u -= 8) ;
@@ -659,10 +688,10 @@ function Nl() {
659
688
  c[t + y - f] |= m * 128;
660
689
  }, Ht);
661
690
  }
662
- function Ul() {
663
- if (ei) return pt;
664
- ei = !0;
665
- let c = Ll(), e = Nl(), t = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
691
+ function Bl() {
692
+ if (ti) return pt;
693
+ ti = !0;
694
+ let c = Nl(), e = Ul(), t = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
666
695
  pt.Buffer = i, pt.SlowBuffer = k, pt.INSPECT_MAX_BYTES = 50;
667
696
  let r = 2147483647;
668
697
  pt.kMaxLength = r, i.TYPED_ARRAY_SUPPORT = a(), !i.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");
@@ -1417,12 +1446,12 @@ function Ul() {
1417
1446
  }
1418
1447
  return pt;
1419
1448
  }
1420
- var Ct, Xn, Ht, Zn, pt, ei, Bl = He(() => {
1421
- le(), ue(), ce(), Ct = {}, Xn = !1, Ht = {}, Zn = !1, pt = {}, ei = !1;
1449
+ var Ct, Zn, Ht, ei, pt, ti, Fl = He(() => {
1450
+ le(), ue(), ce(), Ct = {}, Zn = !1, Ht = {}, ei = !1, pt = {}, ti = !1;
1422
1451
  }), Le = {};
1423
- Lt(Le, { Buffer: () => Or, INSPECT_MAX_BYTES: () => Ds, default: () => it, kMaxLength: () => $s });
1424
- var it, Or, Ds, $s, Ne = He(() => {
1425
- le(), ue(), ce(), Bl(), it = Ul(), it.Buffer, it.SlowBuffer, it.INSPECT_MAX_BYTES, it.kMaxLength, Or = it.Buffer, Ds = it.INSPECT_MAX_BYTES, $s = it.kMaxLength;
1452
+ Lt(Le, { Buffer: () => Cr, INSPECT_MAX_BYTES: () => Ws, default: () => it, kMaxLength: () => qs });
1453
+ var it, Cr, Ws, qs, Ne = He(() => {
1454
+ le(), ue(), ce(), Fl(), it = Bl(), it.Buffer, it.SlowBuffer, it.INSPECT_MAX_BYTES, it.kMaxLength, Cr = it.Buffer, Ws = it.INSPECT_MAX_BYTES, qs = it.kMaxLength;
1426
1455
  }), ue = He(() => {
1427
1456
  Ne();
1428
1457
  }), Re = pe((c, e) => {
@@ -1487,7 +1516,7 @@ var it, Or, Ds, $s, Ne = He(() => {
1487
1516
  }, Symbol, SymbolFor: Symbol.for, SymbolAsyncIterator: Symbol.asyncIterator, SymbolHasInstance: Symbol.hasInstance, SymbolIterator: Symbol.iterator, SymbolDispose: Symbol.dispose || /* @__PURE__ */ Symbol("Symbol.dispose"), SymbolAsyncDispose: Symbol.asyncDispose || /* @__PURE__ */ Symbol("Symbol.asyncDispose"), TypedArrayPrototypeSet(r, a, n) {
1488
1517
  return r.set(a, n);
1489
1518
  }, Boolean, Uint8Array };
1490
- }), Ws = pe((c, e) => {
1519
+ }), Hs = pe((c, e) => {
1491
1520
  le(), ue(), ce(), e.exports = { format(t, ...r) {
1492
1521
  return t.replace(/%([sdifj])/g, function(...[a, n]) {
1493
1522
  let i = r.shift();
@@ -1513,7 +1542,7 @@ var it, Or, Ds, $s, Ne = He(() => {
1513
1542
  } };
1514
1543
  }), We = pe((c, e) => {
1515
1544
  le(), ue(), ce();
1516
- var { format: t, inspect: r } = Ws(), { AggregateError: a } = Re(), n = globalThis.AggregateError || a, i = /* @__PURE__ */ Symbol("kIsNodeError"), o = ["string", "function", "number", "object", "Function", "Object", "boolean", "bigint", "symbol"], s = /^([A-Z][a-z0-9]*)+$/, l = "__node_internal_", u = {};
1545
+ var { format: t, inspect: r } = Hs(), { AggregateError: a } = Re(), n = globalThis.AggregateError || a, i = /* @__PURE__ */ Symbol("kIsNodeError"), o = ["string", "function", "number", "object", "Function", "Object", "boolean", "bigint", "symbol"], s = /^([A-Z][a-z0-9]*)+$/, l = "__node_internal_", u = {};
1517
1546
  function d(g, _) {
1518
1547
  if (!g) throw new u.ERR_INTERNAL_ASSERTION(_);
1519
1548
  }
@@ -1668,10 +1697,10 @@ var it, Or, Ds, $s, Ne = He(() => {
1668
1697
  var { AbortController: t, AbortSignal: r } = typeof self < "u" ? self : typeof window < "u" ? window : void 0;
1669
1698
  e.exports = t, e.exports.AbortSignal = r, e.exports.default = t;
1670
1699
  }), bt = {};
1671
- Lt(bt, { EventEmitter: () => qs, default: () => Pt, defaultMaxListeners: () => Hs, init: () => zs, listenerCount: () => Ks, on: () => Vs, once: () => Gs });
1672
- function Fl() {
1673
- if (ti) return zt;
1674
- ti = !0;
1700
+ Lt(bt, { EventEmitter: () => zs, default: () => Pt, defaultMaxListeners: () => Ks, init: () => Vs, listenerCount: () => Gs, on: () => Ys, once: () => Qs });
1701
+ function Dl() {
1702
+ if (ri) return zt;
1703
+ ri = !0;
1675
1704
  var c = typeof Reflect == "object" ? Reflect : null, e = c && typeof c.apply == "function" ? c.apply : function(S, v, x) {
1676
1705
  return Function.prototype.apply.call(S, v, x);
1677
1706
  }, t;
@@ -1840,8 +1869,8 @@ function Fl() {
1840
1869
  }
1841
1870
  return zt;
1842
1871
  }
1843
- var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
1844
- le(), ue(), ce(), zt = {}, ti = !1, Pt = Fl(), Pt.once, Pt.once = function(c, e) {
1872
+ var zt, ri, Pt, zs, Ks, Vs, Gs, Ys, Qs, xt = He(() => {
1873
+ le(), ue(), ce(), zt = {}, ri = !1, Pt = Dl(), Pt.once, Pt.once = function(c, e) {
1845
1874
  return new Promise((t, r) => {
1846
1875
  function a(...i) {
1847
1876
  n !== void 0 && c.removeListener("error", n), t(i);
@@ -1879,10 +1908,10 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
1879
1908
  let u = r.shift();
1880
1909
  u ? u.reject(l) : a = l, i.return();
1881
1910
  }
1882
- }, { EventEmitter: qs, defaultMaxListeners: Hs, init: zs, listenerCount: Ks, on: Vs, once: Gs } = Pt;
1911
+ }, { EventEmitter: zs, defaultMaxListeners: Ks, init: Vs, listenerCount: Gs, on: Ys, once: Qs } = Pt;
1883
1912
  }), qe = pe((c, e) => {
1884
1913
  le(), ue(), ce();
1885
- var t = (Ne(), Ce(Le)), { format: r, inspect: a } = Ws(), { codes: { ERR_INVALID_ARG_TYPE: n } } = We(), { kResistStopPropagation: i, AggregateError: o, SymbolDispose: s } = Re(), l = globalThis.AbortSignal || Yt().AbortSignal, u = globalThis.AbortController || Yt().AbortController, d = Object.getPrototypeOf(async function() {
1914
+ var t = (Ne(), Ce(Le)), { format: r, inspect: a } = Hs(), { codes: { ERR_INVALID_ARG_TYPE: n } } = We(), { kResistStopPropagation: i, AggregateError: o, SymbolDispose: s } = Re(), l = globalThis.AbortSignal || Yt().AbortSignal, u = globalThis.AbortController || Yt().AbortController, d = Object.getPrototypeOf(async function() {
1886
1915
  }).constructor, p = globalThis.Blob || t.Blob, y = typeof p < "u" ? function(b) {
1887
1916
  return b instanceof p;
1888
1917
  } : function(b) {
@@ -2417,7 +2446,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
2417
2446
  !T || s(T) || (!W && !l(T) && (W = new n()), u(T) ? (T.socket = null, T.destroy(W)) : I(T) ? T.abort() : I(T.req) ? T.req.abort() : typeof T.destroy == "function" ? T.destroy(W) : typeof T.close == "function" ? T.close() : W ? t.nextTick(C, T, W) : t.nextTick(M, T), T.destroyed || (T[o] = !0));
2418
2447
  }
2419
2448
  e.exports = { construct: v, destroyer: B, destroy: f, undestroy: _, errorOrDestroy: S };
2420
- }), Yi = pe((c, e) => {
2449
+ }), Qi = pe((c, e) => {
2421
2450
  le(), ue(), ce();
2422
2451
  var { ArrayIsArray: t, ObjectSetPrototypeOf: r } = Re(), { EventEmitter: a } = (xt(), Ce(bt));
2423
2452
  function n(o) {
@@ -2454,7 +2483,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
2454
2483
  !o._events || !o._events[s] ? o.on(s, l) : t(o._events[s]) ? o._events[s].unshift(l) : o._events[s] = [l, o._events[s]];
2455
2484
  }
2456
2485
  e.exports = { Stream: n, prependListener: i };
2457
- }), Mr = pe((c, e) => {
2486
+ }), Rr = pe((c, e) => {
2458
2487
  le(), ue(), ce();
2459
2488
  var { SymbolDispose: t } = Re(), { AbortError: r, codes: a } = We(), { isNodeStream: n, isWebStream: i, kControllerErrorFunction: o } = ct(), s = yt(), { ERR_INVALID_ARG_TYPE: l } = a, u, d = (p, y) => {
2460
2489
  if (typeof p != "object" || !("aborted" in p)) throw new l(y, "AbortSignal", p);
@@ -2477,7 +2506,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
2477
2506
  }
2478
2507
  return y;
2479
2508
  };
2480
- }), Dl = pe((c, e) => {
2509
+ }), $l = pe((c, e) => {
2481
2510
  le(), ue(), ce();
2482
2511
  var { StringPrototypeSlice: t, SymbolIterator: r, TypedArrayPrototypeSet: a, Uint8Array: n } = Re(), { Buffer: i } = (Ne(), Ce(Le)), { inspect: o } = qe();
2483
2512
  e.exports = class {
@@ -2556,7 +2585,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
2556
2585
  return o(this, { ...l, depth: 0, customInspect: !1 });
2557
2586
  }
2558
2587
  };
2559
- }), Rr = pe((c, e) => {
2588
+ }), jr = pe((c, e) => {
2560
2589
  le(), ue(), ce();
2561
2590
  var { MathFloor: t, NumberIsInteger: r } = Re(), { validateInteger: a } = Qt(), { ERR_INVALID_ARG_VALUE: n } = We().codes, i = 16 * 1024, o = 16;
2562
2591
  function s(p, y, f) {
@@ -2580,7 +2609,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
2580
2609
  return l(p.objectMode);
2581
2610
  }
2582
2611
  e.exports = { getHighWaterMark: d, getDefaultHighWaterMark: l, setDefaultHighWaterMark: u };
2583
- }), $l = pe((c, e) => {
2612
+ }), Wl = pe((c, e) => {
2584
2613
  le(), ue(), ce();
2585
2614
  var t = (Ne(), Ce(Le)), r = t.Buffer;
2586
2615
  function a(i, o) {
@@ -2604,9 +2633,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
2604
2633
  if (typeof i != "number") throw new TypeError("Argument must be a number");
2605
2634
  return t.SlowBuffer(i);
2606
2635
  };
2607
- }), Wl = pe((c) => {
2636
+ }), ql = pe((c) => {
2608
2637
  le(), ue(), ce();
2609
- var e = $l().Buffer, t = e.isEncoding || function(g) {
2638
+ var e = Wl().Buffer, t = e.isEncoding || function(g) {
2610
2639
  switch (g = "" + g, g && g.toLowerCase()) {
2611
2640
  case "hex":
2612
2641
  case "utf8":
@@ -2750,7 +2779,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
2750
2779
  function k(g) {
2751
2780
  return g && g.length ? this.write(g) : "";
2752
2781
  }
2753
- }), Ys = pe((c, e) => {
2782
+ }), Js = pe((c, e) => {
2754
2783
  le(), ue(), ce();
2755
2784
  var t = At(), { PromisePrototypeThen: r, SymbolAsyncIterator: a, SymbolIterator: n } = Re(), { Buffer: i } = (Ne(), Ce(Le)), { ERR_INVALID_ARG_TYPE: o, ERR_STREAM_NULL_VALUES: s } = We().codes;
2756
2785
  function l(u, d, p) {
@@ -2799,13 +2828,13 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
2799
2828
  return m;
2800
2829
  }
2801
2830
  e.exports = l;
2802
- }), jr = pe((c, e) => {
2831
+ }), Lr = pe((c, e) => {
2803
2832
  le(), ue(), ce();
2804
2833
  var t = At(), { ArrayPrototypeIndexOf: r, NumberIsInteger: a, NumberIsNaN: n, NumberParseInt: i, ObjectDefineProperties: o, ObjectKeys: s, ObjectSetPrototypeOf: l, Promise: u, SafeSet: d, SymbolAsyncDispose: p, SymbolAsyncIterator: y, Symbol: f } = Re();
2805
2834
  e.exports = se, se.ReadableState = ve;
2806
- var { EventEmitter: m } = (xt(), Ce(bt)), { Stream: b, prependListener: k } = Yi(), { Buffer: g } = (Ne(), Ce(Le)), { addAbortSignal: _ } = Mr(), S = yt(), v = qe().debuglog("stream", (O) => {
2835
+ var { EventEmitter: m } = (xt(), Ce(bt)), { Stream: b, prependListener: k } = Qi(), { Buffer: g } = (Ne(), Ce(Le)), { addAbortSignal: _ } = Rr(), S = yt(), v = qe().debuglog("stream", (O) => {
2807
2836
  v = O;
2808
- }), x = Dl(), E = Nt(), { getHighWaterMark: I, getDefaultHighWaterMark: M } = Rr(), { aggregateTwoErrors: C, codes: { ERR_INVALID_ARG_TYPE: B, ERR_METHOD_NOT_IMPLEMENTED: T, ERR_OUT_OF_RANGE: W, ERR_STREAM_PUSH_AFTER_EOF: F, ERR_STREAM_UNSHIFT_AFTER_END_EVENT: N }, AbortError: ae } = We(), { validateObject: Y } = Qt(), K = f("kPaused"), { StringDecoder: re } = Wl(), D = Ys();
2837
+ }), x = $l(), E = Nt(), { getHighWaterMark: I, getDefaultHighWaterMark: M } = jr(), { aggregateTwoErrors: C, codes: { ERR_INVALID_ARG_TYPE: B, ERR_METHOD_NOT_IMPLEMENTED: T, ERR_OUT_OF_RANGE: W, ERR_STREAM_PUSH_AFTER_EOF: F, ERR_STREAM_UNSHIFT_AFTER_END_EVENT: N }, AbortError: ae } = We(), { validateObject: Y } = Qt(), K = f("kPaused"), { StringDecoder: re } = ql(), D = Js();
2809
2838
  l(se.prototype, b.prototype), l(se, b);
2810
2839
  var Z = () => {
2811
2840
  }, { errorOrDestroy: P } = E, J = 1, be = 2, te = 4, we = 8, V = 16, L = 32, ne = 64, H = 128, G = 256, Q = 512, me = 1024, oe = 2048, R = 4096, $ = 8192, ee = 16384, fe = 32768, de = 65536, ye = 1 << 17, q = 1 << 18;
@@ -3155,11 +3184,11 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
3155
3184
  E.destroyer(O, Ee), je(Ee);
3156
3185
  } }).wrap(O);
3157
3186
  };
3158
- }), Qi = pe((c, e) => {
3187
+ }), Ji = pe((c, e) => {
3159
3188
  le(), ue(), ce();
3160
3189
  var t = At(), { ArrayPrototypeSlice: r, Error: a, FunctionPrototypeSymbolHasInstance: n, ObjectDefineProperty: i, ObjectDefineProperties: o, ObjectSetPrototypeOf: s, StringPrototypeToLowerCase: l, Symbol: u, SymbolHasInstance: d } = Re();
3161
3190
  e.exports = Y, Y.WritableState = N;
3162
- var { EventEmitter: p } = (xt(), Ce(bt)), y = Yi().Stream, { Buffer: f } = (Ne(), Ce(Le)), m = Nt(), { addAbortSignal: b } = Mr(), { getHighWaterMark: k, getDefaultHighWaterMark: g } = Rr(), { ERR_INVALID_ARG_TYPE: _, ERR_METHOD_NOT_IMPLEMENTED: S, ERR_MULTIPLE_CALLBACK: v, ERR_STREAM_CANNOT_PIPE: x, ERR_STREAM_DESTROYED: E, ERR_STREAM_ALREADY_FINISHED: I, ERR_STREAM_NULL_VALUES: M, ERR_STREAM_WRITE_AFTER_END: C, ERR_UNKNOWN_ENCODING: B } = We().codes, { errorOrDestroy: T } = m;
3191
+ var { EventEmitter: p } = (xt(), Ce(bt)), y = Qi().Stream, { Buffer: f } = (Ne(), Ce(Le)), m = Nt(), { addAbortSignal: b } = Rr(), { getHighWaterMark: k, getDefaultHighWaterMark: g } = jr(), { ERR_INVALID_ARG_TYPE: _, ERR_METHOD_NOT_IMPLEMENTED: S, ERR_MULTIPLE_CALLBACK: v, ERR_STREAM_CANNOT_PIPE: x, ERR_STREAM_DESTROYED: E, ERR_STREAM_ALREADY_FINISHED: I, ERR_STREAM_NULL_VALUES: M, ERR_STREAM_WRITE_AFTER_END: C, ERR_UNKNOWN_ENCODING: B } = We().codes, { errorOrDestroy: T } = m;
3163
3192
  s(Y.prototype, y.prototype), s(Y, y);
3164
3193
  function W() {
3165
3194
  }
@@ -3385,9 +3414,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
3385
3414
  }, Y.toWeb = function(R) {
3386
3415
  return oe().newWritableStreamFromStreamWritable(R);
3387
3416
  };
3388
- }), ql = pe((c, e) => {
3417
+ }), Hl = pe((c, e) => {
3389
3418
  le(), ue(), ce();
3390
- var t = At(), r = (Ne(), Ce(Le)), { isReadable: a, isWritable: n, isIterable: i, isNodeStream: o, isReadableNodeStream: s, isWritableNodeStream: l, isDuplexNodeStream: u, isReadableStream: d, isWritableStream: p } = ct(), y = yt(), { AbortError: f, codes: { ERR_INVALID_ARG_TYPE: m, ERR_INVALID_RETURN_VALUE: b } } = We(), { destroyer: k } = Nt(), g = at(), _ = jr(), S = Qi(), { createDeferredPromise: v } = qe(), x = Ys(), E = globalThis.Blob || r.Blob, I = typeof E < "u" ? function(F) {
3419
+ var t = At(), r = (Ne(), Ce(Le)), { isReadable: a, isWritable: n, isIterable: i, isNodeStream: o, isReadableNodeStream: s, isWritableNodeStream: l, isDuplexNodeStream: u, isReadableStream: d, isWritableStream: p } = ct(), y = yt(), { AbortError: f, codes: { ERR_INVALID_ARG_TYPE: m, ERR_INVALID_RETURN_VALUE: b } } = We(), { destroyer: k } = Nt(), g = at(), _ = Lr(), S = Ji(), { createDeferredPromise: v } = qe(), x = Js(), E = globalThis.Blob || r.Blob, I = typeof E < "u" ? function(F) {
3391
3420
  return F instanceof E;
3392
3421
  } : function(F) {
3393
3422
  return !1;
@@ -3513,7 +3542,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
3513
3542
  le(), ue(), ce();
3514
3543
  var { ObjectDefineProperties: t, ObjectGetOwnPropertyDescriptor: r, ObjectKeys: a, ObjectSetPrototypeOf: n } = Re();
3515
3544
  e.exports = s;
3516
- var i = jr(), o = Qi();
3545
+ var i = Lr(), o = Ji();
3517
3546
  n(s.prototype, i.prototype), n(s, i);
3518
3547
  {
3519
3548
  let p = a(o.prototype);
@@ -3542,13 +3571,13 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
3542
3571
  };
3543
3572
  var d;
3544
3573
  s.from = function(p) {
3545
- return d || (d = ql()), d(p, "body");
3574
+ return d || (d = Hl()), d(p, "body");
3546
3575
  };
3547
- }), Qs = pe((c, e) => {
3576
+ }), Xs = pe((c, e) => {
3548
3577
  le(), ue(), ce();
3549
3578
  var { ObjectSetPrototypeOf: t, Symbol: r } = Re();
3550
3579
  e.exports = s;
3551
- var { ERR_METHOD_NOT_IMPLEMENTED: a } = We().codes, n = at(), { getHighWaterMark: i } = Rr();
3580
+ var { ERR_METHOD_NOT_IMPLEMENTED: a } = We().codes, n = at(), { getHighWaterMark: i } = jr();
3552
3581
  t(s.prototype, n.prototype), t(s, n);
3553
3582
  var o = r("kCallback");
3554
3583
  function s(d) {
@@ -3585,11 +3614,11 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
3585
3614
  this[o] = null, d();
3586
3615
  }
3587
3616
  };
3588
- }), Js = pe((c, e) => {
3617
+ }), Zs = pe((c, e) => {
3589
3618
  le(), ue(), ce();
3590
3619
  var { ObjectSetPrototypeOf: t } = Re();
3591
3620
  e.exports = a;
3592
- var r = Qs();
3621
+ var r = Xs();
3593
3622
  t(a.prototype, r.prototype), t(a, r);
3594
3623
  function a(n) {
3595
3624
  if (!(this instanceof a)) return new a(n);
@@ -3598,7 +3627,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
3598
3627
  a.prototype._transform = function(n, i, o) {
3599
3628
  o(null, n);
3600
3629
  };
3601
- }), Ji = pe((c, e) => {
3630
+ }), Xi = pe((c, e) => {
3602
3631
  le(), ue(), ce();
3603
3632
  var t = At(), { ArrayIsArray: r, Promise: a, SymbolAsyncIterator: n, SymbolDispose: i } = Re(), o = yt(), { once: s } = qe(), l = Nt(), u = at(), { aggregateTwoErrors: d, codes: { ERR_INVALID_ARG_TYPE: p, ERR_INVALID_RETURN_VALUE: y, ERR_MISSING_ARGS: f, ERR_STREAM_DESTROYED: m, ERR_STREAM_PREMATURE_CLOSE: b }, AbortError: k } = We(), { validateFunction: g, validateAbortSignal: _ } = Qt(), { isIterable: S, isReadable: v, isReadableNodeStream: x, isNodeStream: E, isTransformStream: I, isWebStream: M, isReadableStream: C, isReadableFinished: B } = ct(), T = globalThis.AbortController || Yt().AbortController, W, F, N;
3604
3633
  function ae(te, we, V) {
@@ -3622,7 +3651,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
3622
3651
  throw new p("val", ["Readable", "Iterable", "AsyncIterable"], te);
3623
3652
  }
3624
3653
  async function* re(te) {
3625
- F || (F = jr()), yield* F.prototype[n].call(te);
3654
+ F || (F = Lr()), yield* F.prototype[n].call(te);
3626
3655
  }
3627
3656
  async function D(te, we, V, { end: L }) {
3628
3657
  let ne, H = null, G = (oe) => {
@@ -3713,7 +3742,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
3713
3742
  if (!S(ye, !0)) throw new y("AsyncIterable", `transform[${ve - 1}]`, ye);
3714
3743
  } else {
3715
3744
  var ge;
3716
- W || (W = Js());
3745
+ W || (W = Zs());
3717
3746
  let U = new W({ objectMode: !0 }), X = (ge = ye) === null || ge === void 0 ? void 0 : ge.then;
3718
3747
  if (typeof X == "function") ee++, X.call(ye, (z) => {
3719
3748
  R = z, z != null && U.write(z), w && U.end(), t.nextTick(fe);
@@ -3766,9 +3795,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
3766
3795
  }), o(we, { readable: !1, writable: !0 }, V);
3767
3796
  }
3768
3797
  e.exports = { pipelineImpl: J, pipeline: P };
3769
- }), Xs = pe((c, e) => {
3798
+ }), ea = pe((c, e) => {
3770
3799
  le(), ue(), ce();
3771
- var { pipeline: t } = Ji(), r = at(), { destroyer: a } = Nt(), { isNodeStream: n, isReadable: i, isWritable: o, isWebStream: s, isTransformStream: l, isWritableStream: u, isReadableStream: d } = ct(), { AbortError: p, codes: { ERR_INVALID_ARG_VALUE: y, ERR_MISSING_ARGS: f } } = We(), m = yt();
3800
+ var { pipeline: t } = Xi(), r = at(), { destroyer: a } = Nt(), { isNodeStream: n, isReadable: i, isWritable: o, isWebStream: s, isTransformStream: l, isWritableStream: u, isReadableStream: d } = ct(), { AbortError: p, codes: { ERR_INVALID_ARG_VALUE: y, ERR_MISSING_ARGS: f } } = We(), m = yt();
3772
3801
  e.exports = function(...b) {
3773
3802
  if (b.length === 0) throw new f("streams");
3774
3803
  if (b.length === 1) return r.from(b[0]);
@@ -3862,9 +3891,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
3862
3891
  !T && v !== null && (T = new p()), S = null, g = null, _ = null, v === null ? W(T) : (v = W, n(M) && a(M, T));
3863
3892
  }, x;
3864
3893
  };
3865
- }), Hl = pe((c, e) => {
3894
+ }), zl = pe((c, e) => {
3866
3895
  le(), ue(), ce();
3867
- var t = globalThis.AbortController || Yt().AbortController, { codes: { ERR_INVALID_ARG_VALUE: r, ERR_INVALID_ARG_TYPE: a, ERR_MISSING_ARGS: n, ERR_OUT_OF_RANGE: i }, AbortError: o } = We(), { validateAbortSignal: s, validateInteger: l, validateObject: u } = Qt(), d = Re().Symbol("kWeak"), p = Re().Symbol("kResistStopPropagation"), { finished: y } = yt(), f = Xs(), { addAbortSignalNoValidate: m } = Mr(), { isWritable: b, isNodeStream: k } = ct(), { deprecate: g } = qe(), { ArrayPrototypePush: _, Boolean: S, MathFloor: v, Number: x, NumberIsNaN: E, Promise: I, PromiseReject: M, PromiseResolve: C, PromisePrototypeThen: B, Symbol: T } = Re(), W = T("kEmpty"), F = T("kEof");
3896
+ var t = globalThis.AbortController || Yt().AbortController, { codes: { ERR_INVALID_ARG_VALUE: r, ERR_INVALID_ARG_TYPE: a, ERR_MISSING_ARGS: n, ERR_OUT_OF_RANGE: i }, AbortError: o } = We(), { validateAbortSignal: s, validateInteger: l, validateObject: u } = Qt(), d = Re().Symbol("kWeak"), p = Re().Symbol("kResistStopPropagation"), { finished: y } = yt(), f = ea(), { addAbortSignalNoValidate: m } = Rr(), { isWritable: b, isNodeStream: k } = ct(), { deprecate: g } = qe(), { ArrayPrototypePush: _, Boolean: S, MathFloor: v, Number: x, NumberIsNaN: E, Promise: I, PromiseReject: M, PromiseResolve: C, PromisePrototypeThen: B, Symbol: T } = Re(), W = T("kEmpty"), F = T("kEof");
3868
3897
  function N(H, G) {
3869
3898
  if (G != null && u(G, "options"), G?.signal != null && s(G.signal, "options.signal"), k(H) && !b(H)) throw new r("stream", H, "must be writable");
3870
3899
  let Q = f(this, H);
@@ -4040,10 +4069,10 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4040
4069
  }).call(this);
4041
4070
  }
4042
4071
  e.exports.streamReturningOperators = { asIndexedPairs: g(Y, "readable.asIndexedPairs will be removed in a future version."), drop: L, filter: P, flatMap: we, map: ae, take: ne, compose: N }, e.exports.promiseReturningOperators = { every: re, forEach: Z, reduce: be, toArray: te, some: K, find: D };
4043
- }), Zs = pe((c, e) => {
4072
+ }), ta = pe((c, e) => {
4044
4073
  le(), ue(), ce();
4045
- var { ArrayPrototypePop: t, Promise: r } = Re(), { isIterable: a, isNodeStream: n, isWebStream: i } = ct(), { pipelineImpl: o } = Ji(), { finished: s } = yt();
4046
- ea();
4074
+ var { ArrayPrototypePop: t, Promise: r } = Re(), { isIterable: a, isNodeStream: n, isWebStream: i } = ct(), { pipelineImpl: o } = Xi(), { finished: s } = yt();
4075
+ ra();
4047
4076
  function l(...u) {
4048
4077
  return new r((d, p) => {
4049
4078
  let y, f, m = u[u.length - 1];
@@ -4057,10 +4086,10 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4057
4086
  });
4058
4087
  }
4059
4088
  e.exports = { finished: s, pipeline: l };
4060
- }), ea = pe((c, e) => {
4089
+ }), ra = pe((c, e) => {
4061
4090
  le(), ue(), ce();
4062
- var { Buffer: t } = (Ne(), Ce(Le)), { ObjectDefineProperty: r, ObjectKeys: a, ReflectApply: n } = Re(), { promisify: { custom: i } } = qe(), { streamReturningOperators: o, promiseReturningOperators: s } = Hl(), { codes: { ERR_ILLEGAL_CONSTRUCTOR: l } } = We(), u = Xs(), { setDefaultHighWaterMark: d, getDefaultHighWaterMark: p } = Rr(), { pipeline: y } = Ji(), { destroyer: f } = Nt(), m = yt(), b = Zs(), k = ct(), g = e.exports = Yi().Stream;
4063
- g.isDestroyed = k.isDestroyed, g.isDisturbed = k.isDisturbed, g.isErrored = k.isErrored, g.isReadable = k.isReadable, g.isWritable = k.isWritable, g.Readable = jr();
4091
+ var { Buffer: t } = (Ne(), Ce(Le)), { ObjectDefineProperty: r, ObjectKeys: a, ReflectApply: n } = Re(), { promisify: { custom: i } } = qe(), { streamReturningOperators: o, promiseReturningOperators: s } = zl(), { codes: { ERR_ILLEGAL_CONSTRUCTOR: l } } = We(), u = ea(), { setDefaultHighWaterMark: d, getDefaultHighWaterMark: p } = jr(), { pipeline: y } = Xi(), { destroyer: f } = Nt(), m = yt(), b = ta(), k = ct(), g = e.exports = Qi().Stream;
4092
+ g.isDestroyed = k.isDestroyed, g.isDisturbed = k.isDisturbed, g.isErrored = k.isErrored, g.isReadable = k.isReadable, g.isWritable = k.isWritable, g.Readable = Lr();
4064
4093
  for (let S of a(o)) {
4065
4094
  let v = function(...E) {
4066
4095
  if (new.target) throw l();
@@ -4075,8 +4104,8 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4075
4104
  }, x = s[S];
4076
4105
  r(v, "name", { __proto__: null, value: x.name }), r(v, "length", { __proto__: null, value: x.length }), r(g.Readable.prototype, S, { __proto__: null, value: v, enumerable: !1, configurable: !0, writable: !0 });
4077
4106
  }
4078
- g.Writable = Qi(), g.Duplex = at(), g.Transform = Qs(), g.PassThrough = Js(), g.pipeline = y;
4079
- var { addAbortSignal: _ } = Mr();
4107
+ g.Writable = Ji(), g.Duplex = at(), g.Transform = Xs(), g.PassThrough = Zs(), g.pipeline = y;
4108
+ var { addAbortSignal: _ } = Rr();
4080
4109
  g.addAbortSignal = _, g.finished = m, g.destroy = f, g.compose = u, g.setDefaultHighWaterMark = d, g.getDefaultHighWaterMark = p, r(g, "promises", { __proto__: null, configurable: !0, enumerable: !0, get() {
4081
4110
  return b;
4082
4111
  } }), r(y, i, { __proto__: null, enumerable: !0, get() {
@@ -4090,11 +4119,11 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4090
4119
  };
4091
4120
  }), It = pe((c, e) => {
4092
4121
  le(), ue(), ce();
4093
- var t = ea(), r = Zs(), a = t.Readable.destroy;
4122
+ var t = ra(), r = ta(), a = t.Readable.destroy;
4094
4123
  e.exports = t.Readable, e.exports._uint8ArrayToBuffer = t._uint8ArrayToBuffer, e.exports._isUint8Array = t._isUint8Array, e.exports.isDisturbed = t.isDisturbed, e.exports.isErrored = t.isErrored, e.exports.isReadable = t.isReadable, e.exports.Readable = t.Readable, e.exports.Writable = t.Writable, e.exports.Duplex = t.Duplex, e.exports.Transform = t.Transform, e.exports.PassThrough = t.PassThrough, e.exports.addAbortSignal = t.addAbortSignal, e.exports.finished = t.finished, e.exports.destroy = t.destroy, e.exports.destroy = a, e.exports.pipeline = t.pipeline, e.exports.compose = t.compose, Object.defineProperty(t, "promises", { configurable: !0, enumerable: !0, get() {
4095
4124
  return r;
4096
4125
  } }), e.exports.Stream = t.Stream, e.exports.default = e.exports;
4097
- }), zl = pe((c, e) => {
4126
+ }), Kl = pe((c, e) => {
4098
4127
  le(), ue(), ce(), typeof Object.create == "function" ? e.exports = function(t, r) {
4099
4128
  r && (t.super_ = r, t.prototype = Object.create(r.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }));
4100
4129
  } : e.exports = function(t, r) {
@@ -4105,7 +4134,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4105
4134
  a.prototype = r.prototype, t.prototype = new a(), t.prototype.constructor = t;
4106
4135
  }
4107
4136
  };
4108
- }), Kl = pe((c, e) => {
4137
+ }), Vl = pe((c, e) => {
4109
4138
  le(), ue(), ce();
4110
4139
  var { Buffer: t } = (Ne(), Ce(Le)), r = /* @__PURE__ */ Symbol.for("BufferList");
4111
4140
  function a(n) {
@@ -4229,9 +4258,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4229
4258
  }, a.isBufferList = function(n) {
4230
4259
  return n != null && n[r];
4231
4260
  }, e.exports = a;
4232
- }), Vl = pe((c, e) => {
4261
+ }), Gl = pe((c, e) => {
4233
4262
  le(), ue(), ce();
4234
- var t = It().Duplex, r = zl(), a = Kl();
4263
+ var t = It().Duplex, r = Kl(), a = Vl();
4235
4264
  function n(i) {
4236
4265
  if (!(this instanceof n)) return new n(i);
4237
4266
  if (typeof i == "function") {
@@ -4261,7 +4290,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4261
4290
  }, n.prototype._isBufferList = function(i) {
4262
4291
  return i instanceof n || i instanceof a || n.isBufferList(i);
4263
4292
  }, n.isBufferList = a.isBufferList, e.exports = n, e.exports.BufferListStream = n, e.exports.BufferList = a;
4264
- }), Gl = pe((c, e) => {
4293
+ }), Yl = pe((c, e) => {
4265
4294
  le(), ue(), ce();
4266
4295
  var t = class {
4267
4296
  constructor() {
@@ -4269,7 +4298,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4269
4298
  }
4270
4299
  };
4271
4300
  e.exports = t;
4272
- }), ta = pe((c, e) => {
4301
+ }), na = pe((c, e) => {
4273
4302
  le(), ue(), ce();
4274
4303
  var t = e.exports, { Buffer: r } = (Ne(), Ce(Le));
4275
4304
  t.types = { 0: "reserved", 1: "connect", 2: "connack", 3: "publish", 4: "puback", 5: "pubrec", 6: "pubrel", 7: "pubcomp", 8: "subscribe", 9: "suback", 10: "unsubscribe", 11: "unsuback", 12: "pingreq", 13: "pingresp", 14: "disconnect", 15: "auth" }, t.requiredHeaderFlags = { 1: 0, 2: 0, 4: 0, 5: 0, 6: 2, 7: 0, 8: 2, 9: 0, 10: 2, 11: 0, 12: 0, 13: 0, 14: 0, 15: 0 }, t.requiredHeaderFlagsErrors = {};
@@ -4295,7 +4324,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4295
4324
  })));
4296
4325
  }
4297
4326
  t.PUBLISH_HEADER = a("publish"), t.SUBSCRIBE_HEADER = a("subscribe"), t.SUBSCRIBE_OPTIONS_QOS_MASK = 3, t.SUBSCRIBE_OPTIONS_NL_MASK = 1, t.SUBSCRIBE_OPTIONS_NL_SHIFT = 2, t.SUBSCRIBE_OPTIONS_RAP_MASK = 1, t.SUBSCRIBE_OPTIONS_RAP_SHIFT = 3, t.SUBSCRIBE_OPTIONS_RH_MASK = 3, t.SUBSCRIBE_OPTIONS_RH_SHIFT = 4, t.SUBSCRIBE_OPTIONS_RH = [0, 16, 32], t.SUBSCRIBE_OPTIONS_NL = 4, t.SUBSCRIBE_OPTIONS_RAP = 8, t.SUBSCRIBE_OPTIONS_QOS = [0, 1, 2], t.UNSUBSCRIBE_HEADER = a("unsubscribe"), t.ACKS = { unsuback: a("unsuback"), puback: a("puback"), pubcomp: a("pubcomp"), pubrel: a("pubrel"), pubrec: a("pubrec") }, t.SUBACK_HEADER = r.from([t.codes.suback << t.CMD_SHIFT]), t.VERSION3 = r.from([3]), t.VERSION4 = r.from([4]), t.VERSION5 = r.from([5]), t.VERSION131 = r.from([131]), t.VERSION132 = r.from([132]), t.QOS = [0, 1, 2].map((n) => r.from([n])), t.EMPTY = { pingreq: r.from([t.codes.pingreq << 4, 0]), pingresp: r.from([t.codes.pingresp << 4, 0]), disconnect: r.from([t.codes.disconnect << 4, 0]) }, t.MQTT5_PUBACK_PUBREC_CODES = { 0: "Success", 16: "No matching subscribers", 128: "Unspecified error", 131: "Implementation specific error", 135: "Not authorized", 144: "Topic Name invalid", 145: "Packet identifier in use", 151: "Quota exceeded", 153: "Payload format invalid" }, t.MQTT5_PUBREL_PUBCOMP_CODES = { 0: "Success", 146: "Packet Identifier not found" }, t.MQTT5_SUBACK_CODES = { 0: "Granted QoS 0", 1: "Granted QoS 1", 2: "Granted QoS 2", 128: "Unspecified error", 131: "Implementation specific error", 135: "Not authorized", 143: "Topic Filter invalid", 145: "Packet Identifier in use", 151: "Quota exceeded", 158: "Shared Subscriptions not supported", 161: "Subscription Identifiers not supported", 162: "Wildcard Subscriptions not supported" }, t.MQTT5_UNSUBACK_CODES = { 0: "Success", 17: "No subscription existed", 128: "Unspecified error", 131: "Implementation specific error", 135: "Not authorized", 143: "Topic Filter invalid", 145: "Packet Identifier in use" }, t.MQTT5_DISCONNECT_CODES = { 0: "Normal disconnection", 4: "Disconnect with Will Message", 128: "Unspecified error", 129: "Malformed Packet", 130: "Protocol Error", 131: "Implementation specific error", 135: "Not authorized", 137: "Server busy", 139: "Server shutting down", 141: "Keep Alive timeout", 142: "Session taken over", 143: "Topic Filter invalid", 144: "Topic Name invalid", 147: "Receive Maximum exceeded", 148: "Topic Alias invalid", 149: "Packet too large", 150: "Message rate too high", 151: "Quota exceeded", 152: "Administrative action", 153: "Payload format invalid", 154: "Retain not supported", 155: "QoS not supported", 156: "Use another server", 157: "Server moved", 158: "Shared Subscriptions not supported", 159: "Connection rate exceeded", 160: "Maximum connect time", 161: "Subscription Identifiers not supported", 162: "Wildcard Subscriptions not supported" }, t.MQTT5_AUTH_CODES = { 0: "Success", 24: "Continue authentication", 25: "Re-authenticate" };
4298
- }), Yl = pe((c, e) => {
4327
+ }), Ql = pe((c, e) => {
4299
4328
  le(), ue(), ce();
4300
4329
  var t = 1e3, r = t * 60, a = r * 60, n = a * 24, i = n * 7, o = n * 365.25;
4301
4330
  e.exports = function(p, y) {
@@ -4367,10 +4396,10 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4367
4396
  var b = y >= f * 1.5;
4368
4397
  return Math.round(p / f) + " " + m + (b ? "s" : "");
4369
4398
  }
4370
- }), Ql = pe((c, e) => {
4399
+ }), Jl = pe((c, e) => {
4371
4400
  le(), ue(), ce();
4372
4401
  function t(r) {
4373
- n.debug = n, n.default = n, n.coerce = d, n.disable = l, n.enable = o, n.enabled = u, n.humanize = Yl(), n.destroy = p, Object.keys(r).forEach((y) => {
4402
+ n.debug = n, n.default = n, n.coerce = d, n.disable = l, n.enable = o, n.enabled = u, n.humanize = Ql(), n.destroy = p, Object.keys(r).forEach((y) => {
4374
4403
  n[y] = r[y];
4375
4404
  }), n.names = [], n.skips = [], n.formatters = {};
4376
4405
  function a(y) {
@@ -4480,7 +4509,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4480
4509
  } catch {
4481
4510
  }
4482
4511
  }
4483
- e.exports = Ql()(c);
4512
+ e.exports = Jl()(c);
4484
4513
  var { formatters: o } = e.exports;
4485
4514
  o.j = function(s) {
4486
4515
  try {
@@ -4489,14 +4518,14 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4489
4518
  return "[UnexpectedJSONParseError]: " + l.message;
4490
4519
  }
4491
4520
  };
4492
- }), Jl = pe((c, e) => {
4521
+ }), Xl = pe((c, e) => {
4493
4522
  le(), ue(), ce();
4494
- var t = Vl(), { EventEmitter: r } = (xt(), Ce(bt)), a = Gl(), n = ta(), i = lt()("mqtt-packet:parser"), o = class ri extends r {
4523
+ var t = Gl(), { EventEmitter: r } = (xt(), Ce(bt)), a = Yl(), n = na(), i = lt()("mqtt-packet:parser"), o = class ni extends r {
4495
4524
  constructor() {
4496
4525
  super(), this.parser = this.constructor.parser;
4497
4526
  }
4498
4527
  static parser(l) {
4499
- return this instanceof ri ? (this.settings = l || {}, this._states = ["_parseHeader", "_parseLength", "_parsePayload", "_newPacket"], this._resetState(), this) : new ri().parser(l);
4528
+ return this instanceof ni ? (this.settings = l || {}, this._states = ["_parseHeader", "_parseLength", "_parsePayload", "_newPacket"], this._resetState(), this) : new ni().parser(l);
4500
4529
  }
4501
4530
  _resetState() {
4502
4531
  i("_resetState: resetting packet, error, _list, and _stateCounter"), this.packet = new a(), this.error = null, this._list = t(), this._stateCounter = 0;
@@ -4842,7 +4871,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4842
4871
  }
4843
4872
  };
4844
4873
  e.exports = o;
4845
- }), Xl = pe((c, e) => {
4874
+ }), Zl = pe((c, e) => {
4846
4875
  le(), ue(), ce();
4847
4876
  var { Buffer: t } = (Ne(), Ce(Le)), r = 65536, a = {}, n = t.isBuffer(t.from([1, 2]).subarray(0, 1));
4848
4877
  function i(u) {
@@ -4864,7 +4893,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4864
4893
  return d.writeUInt32BE(u, 0), d;
4865
4894
  }
4866
4895
  e.exports = { cache: a, generateCache: o, generateNumber: i, genBufVariableByteInt: s, generate4ByteBuffer: l };
4867
- }), Zl = pe((c, e) => {
4896
+ }), ec = pe((c, e) => {
4868
4897
  le(), ue(), ce(), typeof Pe > "u" || !Pe.version || Pe.version.indexOf("v0.") === 0 || Pe.version.indexOf("v1.") === 0 && Pe.version.indexOf("v1.8.") !== 0 ? e.exports = { nextTick: t } : e.exports = Pe;
4869
4898
  function t(r, a, n, i) {
4870
4899
  if (typeof r != "function") throw new TypeError('"callback" argument must be a function');
@@ -4892,9 +4921,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
4892
4921
  });
4893
4922
  }
4894
4923
  }
4895
- }), ra = pe((c, e) => {
4924
+ }), ia = pe((c, e) => {
4896
4925
  le(), ue(), ce();
4897
- var t = ta(), { Buffer: r } = (Ne(), Ce(Le)), a = r.allocUnsafe(0), n = r.from([0]), i = Xl(), o = Zl().nextTick, s = lt()("mqtt-packet:writeToStream"), l = i.cache, u = i.generateNumber, d = i.generateCache, p = i.genBufVariableByteInt, y = i.generate4ByteBuffer, f = Y, m = !0;
4926
+ var t = na(), { Buffer: r } = (Ne(), Ce(Le)), a = r.allocUnsafe(0), n = r.from([0]), i = Zl(), o = ec().nextTick, s = lt()("mqtt-packet:writeToStream"), l = i.cache, u = i.generateNumber, d = i.generateCache, p = i.genBufVariableByteInt, y = i.generate4ByteBuffer, f = Y, m = !0;
4898
4927
  function b(V, L, ne) {
4899
4928
  switch (s("generate called"), L.cork && (L.cork(), o(k, L)), m && (m = !1, d()), s("generate: packet.cmd: %s", V.cmd), V.cmd) {
4900
4929
  case "connect":
@@ -5275,9 +5304,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5275
5304
  return typeof V == "string" || V instanceof r;
5276
5305
  }
5277
5306
  e.exports = b;
5278
- }), ec = pe((c, e) => {
5307
+ }), tc = pe((c, e) => {
5279
5308
  le(), ue(), ce();
5280
- var t = ra(), { EventEmitter: r } = (xt(), Ce(bt)), { Buffer: a } = (Ne(), Ce(Le));
5309
+ var t = ia(), { EventEmitter: r } = (xt(), Ce(bt)), { Buffer: a } = (Ne(), Ce(Le));
5281
5310
  function n(o, s) {
5282
5311
  let l = new i();
5283
5312
  return t(o, l, s), l.concat();
@@ -5301,12 +5330,12 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5301
5330
  }
5302
5331
  };
5303
5332
  e.exports = n;
5304
- }), tc = pe((c) => {
5305
- le(), ue(), ce(), c.parser = Jl().parser, c.generate = ec(), c.writeToStream = ra();
5306
- }), rc = pe((c, e) => {
5333
+ }), rc = pe((c) => {
5334
+ le(), ue(), ce(), c.parser = Xl().parser, c.generate = tc(), c.writeToStream = ia();
5335
+ }), nc = pe((c, e) => {
5307
5336
  le(), ue(), ce(), e.exports = r;
5308
5337
  function t(n) {
5309
- return n instanceof Or ? Or.from(n) : new n.constructor(n.buffer.slice(), n.byteOffset, n.length);
5338
+ return n instanceof Cr ? Cr.from(n) : new n.constructor(n.buffer.slice(), n.byteOffset, n.length);
5310
5339
  }
5311
5340
  function r(n) {
5312
5341
  if (n = n || {}, n.circles) return a(n);
@@ -5403,9 +5432,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5403
5432
  return i.pop(), o.pop(), f;
5404
5433
  }
5405
5434
  }
5406
- }), nc = pe((c, e) => {
5407
- le(), ue(), ce(), e.exports = rc()();
5408
- }), na = pe((c) => {
5435
+ }), ic = pe((c, e) => {
5436
+ le(), ue(), ce(), e.exports = nc()();
5437
+ }), oa = pe((c) => {
5409
5438
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 }), c.validateTopic = e, c.validateTopics = t;
5410
5439
  function e(r) {
5411
5440
  let a = r.split("/");
@@ -5420,7 +5449,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5420
5449
  for (let a = 0; a < r.length; a++) if (!e(r[a])) return r[a];
5421
5450
  return null;
5422
5451
  }
5423
- }), ia = pe((c) => {
5452
+ }), sa = pe((c) => {
5424
5453
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 });
5425
5454
  var e = It(), t = { objectMode: !0 }, r = { clean: !0 }, a = class {
5426
5455
  options;
@@ -5456,7 +5485,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5456
5485
  }
5457
5486
  };
5458
5487
  c.default = a;
5459
- }), ic = pe((c) => {
5488
+ }), oc = pe((c) => {
5460
5489
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 });
5461
5490
  var e = [0, 16, 128, 131, 135, 144, 145, 151, 153], t = (r, a, n) => {
5462
5491
  r.log("handlePublish: packet %o", a), n = typeof n < "u" ? n : r.noop;
@@ -5511,21 +5540,21 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5511
5540
  }
5512
5541
  };
5513
5542
  c.default = t;
5514
- }), oc = pe((c, e) => {
5543
+ }), sc = pe((c, e) => {
5515
5544
  e.exports = { version: "5.15.0" };
5516
5545
  }), Ut = pe((c) => {
5517
5546
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 }), c.MQTTJS_VERSION = c.nextTick = c.ErrorWithSubackPacket = c.ErrorWithReasonCode = void 0, c.applyMixin = r;
5518
- var e = class oa extends Error {
5547
+ var e = class aa extends Error {
5519
5548
  code;
5520
5549
  constructor(n, i) {
5521
- super(n), this.code = i, Object.setPrototypeOf(this, oa.prototype), Object.getPrototypeOf(this).name = "ErrorWithReasonCode";
5550
+ super(n), this.code = i, Object.setPrototypeOf(this, aa.prototype), Object.getPrototypeOf(this).name = "ErrorWithReasonCode";
5522
5551
  }
5523
5552
  };
5524
5553
  c.ErrorWithReasonCode = e;
5525
- var t = class sa extends Error {
5554
+ var t = class la extends Error {
5526
5555
  packet;
5527
5556
  constructor(n, i) {
5528
- super(n), this.packet = i, Object.setPrototypeOf(this, sa.prototype), Object.getPrototypeOf(this).name = "ErrorWithSubackPacket";
5557
+ super(n), this.packet = i, Object.setPrototypeOf(this, la.prototype), Object.getPrototypeOf(this).name = "ErrorWithSubackPacket";
5529
5558
  }
5530
5559
  };
5531
5560
  c.ErrorWithSubackPacket = t;
@@ -5540,8 +5569,8 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5540
5569
  }
5541
5570
  c.nextTick = typeof Pe?.nextTick == "function" ? Pe.nextTick : (a) => {
5542
5571
  setTimeout(a, 0);
5543
- }, c.MQTTJS_VERSION = oc().version;
5544
- }), Lr = pe((c) => {
5572
+ }, c.MQTTJS_VERSION = sc().version;
5573
+ }), Nr = pe((c) => {
5545
5574
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 }), c.ReasonCodes = void 0;
5546
5575
  var e = Ut();
5547
5576
  c.ReasonCodes = { 0: "", 1: "Unacceptable protocol version", 2: "Identifier rejected", 3: "Server unavailable", 4: "Bad username or password", 5: "Not authorized", 16: "No matching subscribers", 17: "No subscription existed", 128: "Unspecified error", 129: "Malformed Packet", 130: "Protocol Error", 131: "Implementation specific error", 132: "Unsupported Protocol Version", 133: "Client Identifier not valid", 134: "Bad User Name or Password", 135: "Not authorized", 136: "Server unavailable", 137: "Server busy", 138: "Banned", 139: "Server shutting down", 140: "Bad authentication method", 141: "Keep Alive timeout", 142: "Session taken over", 143: "Topic Filter invalid", 144: "Topic Name invalid", 145: "Packet identifier in use", 146: "Packet Identifier not found", 147: "Receive Maximum exceeded", 148: "Topic Alias invalid", 149: "Packet too large", 150: "Message rate too high", 151: "Quota exceeded", 152: "Administrative action", 153: "Payload format invalid", 154: "Retain not supported", 155: "QoS not supported", 156: "Use another server", 157: "Server moved", 158: "Shared Subscriptions not supported", 159: "Connection rate exceeded", 160: "Maximum connect time", 161: "Subscription Identifiers not supported", 162: "Wildcard Subscriptions not supported" };
@@ -5594,9 +5623,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5594
5623
  r.disconnecting && Object.keys(r.outgoing).length === 0 && r.emit("outgoingEmpty");
5595
5624
  };
5596
5625
  c.default = t;
5597
- }), sc = pe((c) => {
5626
+ }), ac = pe((c) => {
5598
5627
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 });
5599
- var e = Ut(), t = Lr(), r = (a, n) => {
5628
+ var e = Ut(), t = Nr(), r = (a, n) => {
5600
5629
  let { options: i } = a, o = i.protocolVersion, s = o === 5 ? n.reasonCode : n.returnCode;
5601
5630
  if (o !== 5) {
5602
5631
  let l = new e.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${o}`, s);
@@ -5616,7 +5645,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5616
5645
  });
5617
5646
  };
5618
5647
  c.default = r;
5619
- }), ac = pe((c) => {
5648
+ }), lc = pe((c) => {
5620
5649
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 }), c.LRUCache = void 0;
5621
5650
  var e = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, t = /* @__PURE__ */ new Set(), r = typeof Pe == "object" && Pe ? Pe : {}, a = (y, f, m, b) => {
5622
5651
  typeof r.emitWarning == "function" ? r.emitWarning(y, f, m, b) : console.error(`[${m}] ${f}: ${y}`);
@@ -5672,7 +5701,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5672
5701
  pop() {
5673
5702
  return this.heap[--this.length];
5674
5703
  }
5675
- }, p = class aa {
5704
+ }, p = class ca {
5676
5705
  #l;
5677
5706
  #h;
5678
5707
  #g;
@@ -5765,7 +5794,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
5765
5794
  if (this.#l === 0 && this.ttl === 0 && this.#h === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
5766
5795
  if (!this.ttlAutopurge && !this.#l && !this.#h) {
5767
5796
  let Z = "LRU_CACHE_UNBOUNDED";
5768
- o(Z) && (t.add(Z), a("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", Z, aa));
5797
+ o(Z) && (t.add(Z), a("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", Z, ca));
5769
5798
  }
5770
5799
  }
5771
5800
  getRemainingTTL(f) {
@@ -6160,7 +6189,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6160
6189
  var r = class extends t {
6161
6190
  };
6162
6191
  c.Container = r;
6163
- }), lc = pe((c) => {
6192
+ }), cc = pe((c) => {
6164
6193
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
6165
6194
  var e = ut(), t = class extends e.Base {
6166
6195
  constructor(a = []) {
@@ -6184,7 +6213,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6184
6213
  }
6185
6214
  }, r = t;
6186
6215
  c.default = r;
6187
- }), cc = pe((c) => {
6216
+ }), uc = pe((c) => {
6188
6217
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
6189
6218
  var e = ut(), t = class extends e.Base {
6190
6219
  constructor(a = []) {
@@ -6216,7 +6245,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6216
6245
  }
6217
6246
  }, r = t;
6218
6247
  c.default = r;
6219
- }), uc = pe((c) => {
6248
+ }), hc = pe((c) => {
6220
6249
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
6221
6250
  var e = ut(), t = class extends e.Base {
6222
6251
  constructor(a = [], n = function(o, s) {
@@ -6282,7 +6311,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6282
6311
  }
6283
6312
  }, r = t;
6284
6313
  c.default = r;
6285
- }), Xi = pe((c) => {
6314
+ }), Zi = pe((c) => {
6286
6315
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
6287
6316
  var e = ut(), t = class extends e.Container {
6288
6317
  }, r = t;
@@ -6292,7 +6321,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6292
6321
  function e() {
6293
6322
  throw new RangeError("Iterator access denied!");
6294
6323
  }
6295
- }), la = pe((c) => {
6324
+ }), ua = pe((c) => {
6296
6325
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.RandomIterator = void 0;
6297
6326
  var e = ut(), t = ht(), r = class extends e.ContainerIterator {
6298
6327
  constructor(a, n) {
@@ -6314,18 +6343,18 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6314
6343
  }
6315
6344
  };
6316
6345
  c.RandomIterator = r;
6317
- }), hc = pe((c) => {
6346
+ }), fc = pe((c) => {
6318
6347
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
6319
- var e = r(Xi()), t = la();
6348
+ var e = r(Zi()), t = ua();
6320
6349
  function r(o) {
6321
6350
  return o && o.t ? o : { default: o };
6322
6351
  }
6323
- var a = class ca extends t.RandomIterator {
6352
+ var a = class ha extends t.RandomIterator {
6324
6353
  constructor(s, l, u) {
6325
6354
  super(s, u), this.container = l;
6326
6355
  }
6327
6356
  copy() {
6328
- return new ca(this.o, this.container, this.iteratorType);
6357
+ return new ha(this.o, this.container, this.iteratorType);
6329
6358
  }
6330
6359
  }, n = class extends e.default {
6331
6360
  constructor(o = [], s = !0) {
@@ -6415,13 +6444,13 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6415
6444
  }
6416
6445
  }, i = n;
6417
6446
  c.default = i;
6418
- }), fc = pe((c) => {
6447
+ }), dc = pe((c) => {
6419
6448
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
6420
- var e = a(Xi()), t = ut(), r = ht();
6449
+ var e = a(Zi()), t = ut(), r = ht();
6421
6450
  function a(s) {
6422
6451
  return s && s.t ? s : { default: s };
6423
6452
  }
6424
- var n = class ua extends t.ContainerIterator {
6453
+ var n = class fa extends t.ContainerIterator {
6425
6454
  constructor(l, u, d, p) {
6426
6455
  super(p), this.o = l, this.h = u, this.container = d, this.iteratorType === 0 ? (this.pre = function() {
6427
6456
  return this.o.L === this.h && (0, r.throwIteratorAccessError)(), this.o = this.o.L, this;
@@ -6440,7 +6469,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6440
6469
  this.o === this.h && (0, r.throwIteratorAccessError)(), this.o.l = l;
6441
6470
  }
6442
6471
  copy() {
6443
- return new ua(this.o, this.h, this.container, this.iteratorType);
6472
+ return new fa(this.o, this.h, this.container, this.iteratorType);
6444
6473
  }
6445
6474
  }, i = class extends e.default {
6446
6475
  constructor(s = []) {
@@ -6600,18 +6629,18 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6600
6629
  }
6601
6630
  }, o = i;
6602
6631
  c.default = o;
6603
- }), dc = pe((c) => {
6632
+ }), pc = pe((c) => {
6604
6633
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
6605
- var e = r(Xi()), t = la();
6634
+ var e = r(Zi()), t = ua();
6606
6635
  function r(o) {
6607
6636
  return o && o.t ? o : { default: o };
6608
6637
  }
6609
- var a = class ha extends t.RandomIterator {
6638
+ var a = class da extends t.RandomIterator {
6610
6639
  constructor(s, l, u) {
6611
6640
  super(s, u), this.container = l;
6612
6641
  }
6613
6642
  copy() {
6614
- return new ha(this.o, this.container, this.iteratorType);
6643
+ return new da(this.o, this.container, this.iteratorType);
6615
6644
  }
6616
6645
  }, n = class extends e.default {
6617
6646
  constructor(o = [], s = 4096) {
@@ -6785,7 +6814,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6785
6814
  }
6786
6815
  }, i = n;
6787
6816
  c.default = i;
6788
- }), pc = pe((c) => {
6817
+ }), gc = pe((c) => {
6789
6818
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.TreeNodeEnableIndex = c.TreeNode = void 0;
6790
6819
  var e = class {
6791
6820
  constructor(r, a) {
@@ -6840,9 +6869,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
6840
6869
  }
6841
6870
  };
6842
6871
  c.TreeNodeEnableIndex = t;
6843
- }), fa = pe((c) => {
6872
+ }), pa = pe((c) => {
6844
6873
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
6845
- var e = pc(), t = ut(), r = ht(), a = class extends t.Container {
6874
+ var e = gc(), t = ut(), r = ht(), a = class extends t.Container {
6846
6875
  constructor(i = function(s, l) {
6847
6876
  return s < l ? -1 : s > l ? 1 : 0;
6848
6877
  }, o = !1) {
@@ -7094,7 +7123,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7094
7123
  }
7095
7124
  }, n = a;
7096
7125
  c.default = n;
7097
- }), da = pe((c) => {
7126
+ }), ga = pe((c) => {
7098
7127
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
7099
7128
  var e = ut(), t = ht(), r = class extends e.ContainerIterator {
7100
7129
  constructor(n, i, o) {
@@ -7120,13 +7149,13 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7120
7149
  }
7121
7150
  }, a = r;
7122
7151
  c.default = a;
7123
- }), gc = pe((c) => {
7152
+ }), mc = pe((c) => {
7124
7153
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
7125
- var e = a(fa()), t = a(da()), r = ht();
7154
+ var e = a(pa()), t = a(ga()), r = ht();
7126
7155
  function a(s) {
7127
7156
  return s && s.t ? s : { default: s };
7128
7157
  }
7129
- var n = class pa extends t.default {
7158
+ var n = class ma extends t.default {
7130
7159
  constructor(l, u, d, p) {
7131
7160
  super(l, u, p), this.container = d;
7132
7161
  }
@@ -7134,7 +7163,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7134
7163
  return this.o === this.h && (0, r.throwIteratorAccessError)(), this.o.u;
7135
7164
  }
7136
7165
  copy() {
7137
- return new pa(this.o, this.h, this.container, this.iteratorType);
7166
+ return new ma(this.o, this.h, this.container, this.iteratorType);
7138
7167
  }
7139
7168
  }, i = class extends e.default {
7140
7169
  constructor(s = [], l, u) {
@@ -7199,13 +7228,13 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7199
7228
  }
7200
7229
  }, o = i;
7201
7230
  c.default = o;
7202
- }), mc = pe((c) => {
7231
+ }), bc = pe((c) => {
7203
7232
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
7204
- var e = a(fa()), t = a(da()), r = ht();
7233
+ var e = a(pa()), t = a(ga()), r = ht();
7205
7234
  function a(s) {
7206
7235
  return s && s.t ? s : { default: s };
7207
7236
  }
7208
- var n = class ga extends t.default {
7237
+ var n = class ba extends t.default {
7209
7238
  constructor(l, u, d, p) {
7210
7239
  super(l, u, p), this.container = d;
7211
7240
  }
@@ -7221,7 +7250,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7221
7250
  } });
7222
7251
  }
7223
7252
  copy() {
7224
- return new ga(this.o, this.h, this.container, this.iteratorType);
7253
+ return new ba(this.o, this.h, this.container, this.iteratorType);
7225
7254
  }
7226
7255
  }, i = class extends e.default {
7227
7256
  constructor(s = [], l, u) {
@@ -7293,15 +7322,15 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7293
7322
  }
7294
7323
  }, o = i;
7295
7324
  c.default = o;
7296
- }), ma = pe((c) => {
7325
+ }), ya = pe((c) => {
7297
7326
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = e;
7298
7327
  function e(t) {
7299
7328
  let r = typeof t;
7300
7329
  return r === "object" && t !== null || r === "function";
7301
7330
  }
7302
- }), ba = pe((c) => {
7331
+ }), va = pe((c) => {
7303
7332
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.HashContainerIterator = c.HashContainer = void 0;
7304
- var e = ut(), t = a(ma()), r = ht();
7333
+ var e = ut(), t = a(ya()), r = ht();
7305
7334
  function a(o) {
7306
7335
  return o && o.t ? o : { default: o };
7307
7336
  }
@@ -7377,9 +7406,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7377
7406
  }
7378
7407
  };
7379
7408
  c.HashContainer = i;
7380
- }), bc = pe((c) => {
7409
+ }), yc = pe((c) => {
7381
7410
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
7382
- var e = ba(), t = ht(), r = class ya extends e.HashContainerIterator {
7411
+ var e = va(), t = ht(), r = class wa extends e.HashContainerIterator {
7383
7412
  constructor(o, s, l, u) {
7384
7413
  super(o, s, u), this.container = l;
7385
7414
  }
@@ -7387,7 +7416,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7387
7416
  return this.o === this.h && (0, t.throwIteratorAccessError)(), this.o.u;
7388
7417
  }
7389
7418
  copy() {
7390
- return new ya(this.o, this.h, this.container, this.iteratorType);
7419
+ return new wa(this.o, this.h, this.container, this.iteratorType);
7391
7420
  }
7392
7421
  }, a = class extends e.HashContainer {
7393
7422
  constructor(i = []) {
@@ -7440,13 +7469,13 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7440
7469
  }
7441
7470
  }, n = a;
7442
7471
  c.default = n;
7443
- }), yc = pe((c) => {
7472
+ }), vc = pe((c) => {
7444
7473
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), c.default = void 0;
7445
- var e = ba(), t = a(ma()), r = ht();
7474
+ var e = va(), t = a(ya()), r = ht();
7446
7475
  function a(s) {
7447
7476
  return s && s.t ? s : { default: s };
7448
7477
  }
7449
- var n = class va extends e.HashContainerIterator {
7478
+ var n = class _a extends e.HashContainerIterator {
7450
7479
  constructor(l, u, d, p) {
7451
7480
  super(l, u, p), this.container = d;
7452
7481
  }
@@ -7462,7 +7491,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7462
7491
  } });
7463
7492
  }
7464
7493
  copy() {
7465
- return new va(this.o, this.h, this.container, this.iteratorType);
7494
+ return new _a(this.o, this.h, this.container, this.iteratorType);
7466
7495
  }
7467
7496
  }, i = class extends e.HashContainer {
7468
7497
  constructor(s = []) {
@@ -7523,7 +7552,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7523
7552
  }
7524
7553
  }, o = i;
7525
7554
  c.default = o;
7526
- }), vc = pe((c) => {
7555
+ }), wc = pe((c) => {
7527
7556
  le(), ue(), ce(), Object.defineProperty(c, "t", { value: !0 }), Object.defineProperty(c, "Deque", { enumerable: !0, get: function() {
7528
7557
  return i.default;
7529
7558
  } }), Object.defineProperty(c, "HashMap", { enumerable: !0, get: function() {
@@ -7545,13 +7574,13 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7545
7574
  } }), Object.defineProperty(c, "Vector", { enumerable: !0, get: function() {
7546
7575
  return a.default;
7547
7576
  } });
7548
- var e = d(lc()), t = d(cc()), r = d(uc()), a = d(hc()), n = d(fc()), i = d(dc()), o = d(gc()), s = d(mc()), l = d(bc()), u = d(yc());
7577
+ var e = d(cc()), t = d(uc()), r = d(hc()), a = d(fc()), n = d(dc()), i = d(pc()), o = d(mc()), s = d(bc()), l = d(yc()), u = d(vc());
7549
7578
  function d(p) {
7550
7579
  return p && p.t ? p : { default: p };
7551
7580
  }
7552
- }), wc = pe((c, e) => {
7581
+ }), _c = pe((c, e) => {
7553
7582
  le(), ue(), ce();
7554
- var t = vc().OrderedSet, r = lt()("number-allocator:trace"), a = lt()("number-allocator:error");
7583
+ var t = wc().OrderedSet, r = lt()("number-allocator:trace"), a = lt()("number-allocator:error");
7555
7584
  function n(o, s) {
7556
7585
  this.low = o, this.high = s;
7557
7586
  }
@@ -7610,13 +7639,13 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7610
7639
  console.log("length:" + this.ss.size());
7611
7640
  for (let o of this.ss) console.log(o);
7612
7641
  }, e.exports = i;
7613
- }), wa = pe((c, e) => {
7642
+ }), ka = pe((c, e) => {
7614
7643
  le(), ue(), ce();
7615
- var t = wc();
7644
+ var t = _c();
7616
7645
  e.exports.NumberAllocator = t;
7617
- }), _c = pe((c) => {
7646
+ }), kc = pe((c) => {
7618
7647
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 });
7619
- var e = ac(), t = wa(), r = class {
7648
+ var e = lc(), t = ka(), r = class {
7620
7649
  aliasToTopic;
7621
7650
  topicToAlias;
7622
7651
  max;
@@ -7645,13 +7674,13 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7645
7674
  }
7646
7675
  };
7647
7676
  c.default = r;
7648
- }), kc = pe((c) => {
7677
+ }), Sc = pe((c) => {
7649
7678
  le(), ue(), ce();
7650
7679
  var e = c && c.__importDefault || function(i) {
7651
7680
  return i && i.__esModule ? i : { default: i };
7652
7681
  };
7653
7682
  Object.defineProperty(c, "__esModule", { value: !0 });
7654
- var t = Lr(), r = e(_c()), a = Ut(), n = (i, o) => {
7683
+ var t = Nr(), r = e(kc()), a = Ut(), n = (i, o) => {
7655
7684
  i.log("_handleConnack");
7656
7685
  let { options: s } = i, l = s.protocolVersion === 5 ? o.reasonCode : o.returnCode;
7657
7686
  if (clearTimeout(i.connackTimer), delete i.topicAliasSend, o.properties) {
@@ -7671,7 +7700,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7671
7700
  }
7672
7701
  };
7673
7702
  c.default = n;
7674
- }), Sc = pe((c) => {
7703
+ }), Ec = pe((c) => {
7675
7704
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 });
7676
7705
  var e = (t, r, a) => {
7677
7706
  t.log("handling pubrel packet");
@@ -7684,13 +7713,13 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7684
7713
  });
7685
7714
  };
7686
7715
  c.default = e;
7687
- }), Ec = pe((c) => {
7716
+ }), xc = pe((c) => {
7688
7717
  le(), ue(), ce();
7689
7718
  var e = c && c.__importDefault || function(s) {
7690
7719
  return s && s.__esModule ? s : { default: s };
7691
7720
  };
7692
7721
  Object.defineProperty(c, "__esModule", { value: !0 });
7693
- var t = e(ic()), r = e(sc()), a = e(kc()), n = e(Lr()), i = e(Sc()), o = (s, l, u) => {
7722
+ var t = e(oc()), r = e(ac()), a = e(Sc()), n = e(Nr()), i = e(Ec()), o = (s, l, u) => {
7694
7723
  let { options: d } = s;
7695
7724
  if (d.protocolVersion === 5 && d.properties && d.properties.maximumPacketSize && d.properties.maximumPacketSize < l.length) return s.emit("error", new Error(`exceeding packets size ${l.cmd}`)), s.end({ reasonCode: 149, properties: { reasonString: "Maximum packet size was exceeded" } }), s;
7696
7725
  switch (s.log("_handlePacket :: emitting packetreceive"), s.emit("packetreceive", l), l.cmd) {
@@ -7725,7 +7754,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7725
7754
  }
7726
7755
  };
7727
7756
  c.default = o;
7728
- }), _a = pe((c) => {
7757
+ }), Sa = pe((c) => {
7729
7758
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 });
7730
7759
  var e = class {
7731
7760
  nextId;
@@ -7748,7 +7777,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7748
7777
  }
7749
7778
  };
7750
7779
  c.default = e;
7751
- }), xc = pe((c) => {
7780
+ }), Ac = pe((c) => {
7752
7781
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 });
7753
7782
  var e = class {
7754
7783
  aliasToTopic;
@@ -7768,7 +7797,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7768
7797
  }
7769
7798
  };
7770
7799
  c.default = e;
7771
- }), Ac = pe((c) => {
7800
+ }), Ic = pe((c) => {
7772
7801
  le(), ue(), ce();
7773
7802
  var e = c && c.__importDefault || function(n) {
7774
7803
  return n && n.__esModule ? n : { default: n };
@@ -7777,7 +7806,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7777
7806
  var t = e((xt(), Ce(bt))), r = Ut(), a = class {
7778
7807
  };
7779
7808
  c.TypedEventEmitter = a, (0, r.applyMixin)(a, t.default);
7780
- }), Nr = pe((c, e) => {
7809
+ }), Ur = pe((c, e) => {
7781
7810
  le(), ue(), ce();
7782
7811
  function t(r) {
7783
7812
  "@babel/helpers - typeof";
@@ -7788,9 +7817,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7788
7817
  }, e.exports.__esModule = !0, e.exports.default = e.exports, t(r);
7789
7818
  }
7790
7819
  e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
7791
- }), Ic = pe((c, e) => {
7820
+ }), Tc = pe((c, e) => {
7792
7821
  le(), ue(), ce();
7793
- var t = Nr().default;
7822
+ var t = Ur().default;
7794
7823
  function r(a, n) {
7795
7824
  if (t(a) != "object" || !a) return a;
7796
7825
  var i = a[Symbol.toPrimitive];
@@ -7802,28 +7831,28 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7802
7831
  return (n === "string" ? String : Number)(a);
7803
7832
  }
7804
7833
  e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
7805
- }), Tc = pe((c, e) => {
7834
+ }), Oc = pe((c, e) => {
7806
7835
  le(), ue(), ce();
7807
- var t = Nr().default, r = Ic();
7836
+ var t = Ur().default, r = Tc();
7808
7837
  function a(n) {
7809
7838
  var i = r(n, "string");
7810
7839
  return t(i) == "symbol" ? i : i + "";
7811
7840
  }
7812
7841
  e.exports = a, e.exports.__esModule = !0, e.exports.default = e.exports;
7813
- }), Oc = pe((c, e) => {
7842
+ }), Cc = pe((c, e) => {
7814
7843
  le(), ue(), ce();
7815
- var t = Tc();
7844
+ var t = Oc();
7816
7845
  function r(a, n, i) {
7817
7846
  return (n = t(n)) in a ? Object.defineProperty(a, n, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : a[n] = i, a;
7818
7847
  }
7819
7848
  e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
7820
- }), Cc = pe((c, e) => {
7849
+ }), Pc = pe((c, e) => {
7821
7850
  le(), ue(), ce();
7822
7851
  function t(r) {
7823
7852
  if (Array.isArray(r)) return r;
7824
7853
  }
7825
7854
  e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
7826
- }), Pc = pe((c, e) => {
7855
+ }), Mc = pe((c, e) => {
7827
7856
  le(), ue(), ce();
7828
7857
  function t(r, a) {
7829
7858
  var n = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
@@ -7847,7 +7876,7 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7847
7876
  }
7848
7877
  }
7849
7878
  e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
7850
- }), Mc = pe((c, e) => {
7879
+ }), Rc = pe((c, e) => {
7851
7880
  le(), ue(), ce();
7852
7881
  function t(r, a) {
7853
7882
  (a == null || a > r.length) && (a = r.length);
@@ -7855,9 +7884,9 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7855
7884
  return i;
7856
7885
  }
7857
7886
  e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
7858
- }), Rc = pe((c, e) => {
7887
+ }), jc = pe((c, e) => {
7859
7888
  le(), ue(), ce();
7860
- var t = Mc();
7889
+ var t = Rc();
7861
7890
  function r(a, n) {
7862
7891
  if (a) {
7863
7892
  if (typeof a == "string") return t(a, n);
@@ -7866,21 +7895,21 @@ var zt, ti, Pt, qs, Hs, zs, Ks, Vs, Gs, xt = He(() => {
7866
7895
  }
7867
7896
  }
7868
7897
  e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
7869
- }), jc = pe((c, e) => {
7898
+ }), Lc = pe((c, e) => {
7870
7899
  le(), ue(), ce();
7871
7900
  function t() {
7872
7901
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7873
7902
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
7874
7903
  }
7875
7904
  e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
7876
- }), Lc = pe((c, e) => {
7905
+ }), Nc = pe((c, e) => {
7877
7906
  le(), ue(), ce();
7878
- var t = Cc(), r = Pc(), a = Rc(), n = jc();
7907
+ var t = Pc(), r = Mc(), a = jc(), n = Lc();
7879
7908
  function i(o, s) {
7880
7909
  return t(o) || r(o, s) || a(o, s) || n();
7881
7910
  }
7882
7911
  e.exports = i, e.exports.__esModule = !0, e.exports.default = e.exports;
7883
- }), ka = pe((c, e) => {
7912
+ }), Ea = pe((c, e) => {
7884
7913
  le(), ue(), ce(), (function(t, r) {
7885
7914
  typeof c == "object" && typeof e < "u" ? r(c) : typeof define == "function" && define.amd ? define(["exports"], r) : (t = typeof globalThis < "u" ? globalThis : t || self, r(t.fastUniqueNumbers = {}));
7886
7915
  })(c, function(t) {
@@ -7908,7 +7937,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
7908
7937
  }, l = /* @__PURE__ */ new WeakMap(), u = a(l), d = s(u, l), p = r(d);
7909
7938
  t.addUniqueNumber = p, t.generateUniqueNumber = d;
7910
7939
  });
7911
- }), Nc = pe((c, e) => {
7940
+ }), Uc = pe((c, e) => {
7912
7941
  le(), ue(), ce();
7913
7942
  function t(a, n, i, o, s, l, u) {
7914
7943
  try {
@@ -7934,13 +7963,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
7934
7963
  };
7935
7964
  }
7936
7965
  e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
7937
- }), Sa = pe((c, e) => {
7966
+ }), xa = pe((c, e) => {
7938
7967
  le(), ue(), ce();
7939
7968
  function t(r, a) {
7940
7969
  this.v = r, this.k = a;
7941
7970
  }
7942
7971
  e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
7943
- }), Ea = pe((c, e) => {
7972
+ }), Aa = pe((c, e) => {
7944
7973
  le(), ue(), ce();
7945
7974
  function t(r, a, n, i) {
7946
7975
  var o = Object.defineProperty;
@@ -7959,9 +7988,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
7959
7988
  }, e.exports.__esModule = !0, e.exports.default = e.exports, t(r, a, n, i);
7960
7989
  }
7961
7990
  e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
7962
- }), xa = pe((c, e) => {
7991
+ }), Ia = pe((c, e) => {
7963
7992
  le(), ue(), ce();
7964
- var t = Ea();
7993
+ var t = Aa();
7965
7994
  function r() {
7966
7995
  var a, n, i = typeof Symbol == "function" ? Symbol : {}, o = i.iterator || "@@iterator", s = i.toStringTag || "@@toStringTag";
7967
7996
  function l(k, g, _, S) {
@@ -8024,9 +8053,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8024
8053
  }, e.exports.__esModule = !0, e.exports.default = e.exports)();
8025
8054
  }
8026
8055
  e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
8027
- }), Aa = pe((c, e) => {
8056
+ }), Ta = pe((c, e) => {
8028
8057
  le(), ue(), ce();
8029
- var t = Sa(), r = Ea();
8058
+ var t = xa(), r = Aa();
8030
8059
  function a(n, i) {
8031
8060
  function o(l, u, d, p) {
8032
8061
  try {
@@ -8057,16 +8086,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8057
8086
  }, !0);
8058
8087
  }
8059
8088
  e.exports = a, e.exports.__esModule = !0, e.exports.default = e.exports;
8060
- }), Ia = pe((c, e) => {
8089
+ }), Oa = pe((c, e) => {
8061
8090
  le(), ue(), ce();
8062
- var t = xa(), r = Aa();
8091
+ var t = Ia(), r = Ta();
8063
8092
  function a(n, i, o, s, l) {
8064
8093
  return new r(t().w(n, i, o, s), l || Promise);
8065
8094
  }
8066
8095
  e.exports = a, e.exports.__esModule = !0, e.exports.default = e.exports;
8067
- }), Uc = pe((c, e) => {
8096
+ }), Bc = pe((c, e) => {
8068
8097
  le(), ue(), ce();
8069
- var t = Ia();
8098
+ var t = Oa();
8070
8099
  function r(a, n, i, o, s) {
8071
8100
  var l = t(a, n, i, o, s);
8072
8101
  return l.next().then(function(u) {
@@ -8074,7 +8103,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8074
8103
  });
8075
8104
  }
8076
8105
  e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
8077
- }), Bc = pe((c, e) => {
8106
+ }), Fc = pe((c, e) => {
8078
8107
  le(), ue(), ce();
8079
8108
  function t(r) {
8080
8109
  var a = Object(r), n = [];
@@ -8085,9 +8114,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8085
8114
  };
8086
8115
  }
8087
8116
  e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
8088
- }), Fc = pe((c, e) => {
8117
+ }), Dc = pe((c, e) => {
8089
8118
  le(), ue(), ce();
8090
- var t = Nr().default;
8119
+ var t = Ur().default;
8091
8120
  function r(a) {
8092
8121
  if (a != null) {
8093
8122
  var n = a[typeof Symbol == "function" && Symbol.iterator || "@@iterator"], i = 0;
@@ -8100,9 +8129,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8100
8129
  throw new TypeError(t(a) + " is not iterable");
8101
8130
  }
8102
8131
  e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
8103
- }), Dc = pe((c, e) => {
8132
+ }), $c = pe((c, e) => {
8104
8133
  le(), ue(), ce();
8105
- var t = Sa(), r = xa(), a = Uc(), n = Ia(), i = Aa(), o = Bc(), s = Fc();
8134
+ var t = xa(), r = Ia(), a = Bc(), n = Oa(), i = Ta(), o = Fc(), s = Dc();
8106
8135
  function l() {
8107
8136
  var u = r(), d = u.m(l), p = (Object.getPrototypeOf ? Object.getPrototypeOf(d) : d.__proto__).constructor;
8108
8137
  function y(b) {
@@ -8149,18 +8178,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8149
8178
  }, e.exports.__esModule = !0, e.exports.default = e.exports)();
8150
8179
  }
8151
8180
  e.exports = l, e.exports.__esModule = !0, e.exports.default = e.exports;
8152
- }), $c = pe((c, e) => {
8181
+ }), Wc = pe((c, e) => {
8153
8182
  le(), ue(), ce();
8154
- var t = Dc()();
8183
+ var t = $c()();
8155
8184
  e.exports = t;
8156
8185
  try {
8157
8186
  regeneratorRuntime = t;
8158
8187
  } catch {
8159
8188
  typeof globalThis == "object" ? globalThis.regeneratorRuntime = t : Function("r", "regeneratorRuntime = r")(t);
8160
8189
  }
8161
- }), Wc = pe((c, e) => {
8190
+ }), qc = pe((c, e) => {
8162
8191
  le(), ue(), ce(), (function(t, r) {
8163
- typeof c == "object" && typeof e < "u" ? r(c, Oc(), Lc(), ka(), Nc(), $c()) : typeof define == "function" && define.amd ? define(["exports", "@babel/runtime/helpers/defineProperty", "@babel/runtime/helpers/slicedToArray", "fast-unique-numbers", "@babel/runtime/helpers/asyncToGenerator", "@babel/runtime/regenerator"], r) : (t = typeof globalThis < "u" ? globalThis : t || self, r(t.brokerFactory = {}, t._defineProperty, t._slicedToArray, t.fastUniqueNumbers, t._asyncToGenerator, t._regeneratorRuntime));
8192
+ typeof c == "object" && typeof e < "u" ? r(c, Cc(), Nc(), Ea(), Uc(), Wc()) : typeof define == "function" && define.amd ? define(["exports", "@babel/runtime/helpers/defineProperty", "@babel/runtime/helpers/slicedToArray", "fast-unique-numbers", "@babel/runtime/helpers/asyncToGenerator", "@babel/runtime/regenerator"], r) : (t = typeof globalThis < "u" ? globalThis : t || self, r(t.brokerFactory = {}, t._defineProperty, t._slicedToArray, t.fastUniqueNumbers, t._asyncToGenerator, t._regeneratorRuntime));
8164
8193
  })(c, function(t, r, a, n, i, o) {
8165
8194
  var s = function(g) {
8166
8195
  return typeof g.start == "function";
@@ -8289,9 +8318,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8289
8318
  };
8290
8319
  t.createBroker = k;
8291
8320
  });
8292
- }), qc = pe((c, e) => {
8321
+ }), Hc = pe((c, e) => {
8293
8322
  le(), ue(), ce(), (function(t, r) {
8294
- typeof c == "object" && typeof e < "u" ? r(c, Nr(), Wc(), ka()) : typeof define == "function" && define.amd ? define(["exports", "@babel/runtime/helpers/typeof", "broker-factory", "fast-unique-numbers"], r) : (t = typeof globalThis < "u" ? globalThis : t || self, r(t.workerTimersBroker = {}, t._typeof, t.brokerFactory, t.fastUniqueNumbers));
8323
+ typeof c == "object" && typeof e < "u" ? r(c, Ur(), qc(), Ea()) : typeof define == "function" && define.amd ? define(["exports", "@babel/runtime/helpers/typeof", "broker-factory", "fast-unique-numbers"], r) : (t = typeof globalThis < "u" ? globalThis : t || self, r(t.workerTimersBroker = {}, t._typeof, t.brokerFactory, t.fastUniqueNumbers));
8295
8324
  })(c, function(t, r, a, n) {
8296
8325
  var i = /* @__PURE__ */ new Map([[0, null]]), o = /* @__PURE__ */ new Map([[0, null]]), s = a.createBroker({ clearInterval: function(u) {
8297
8326
  var d = u.call;
@@ -8339,9 +8368,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8339
8368
  };
8340
8369
  t.load = l, t.wrap = s;
8341
8370
  });
8342
- }), Hc = pe((c, e) => {
8371
+ }), zc = pe((c, e) => {
8343
8372
  le(), ue(), ce(), (function(t, r) {
8344
- typeof c == "object" && typeof e < "u" ? r(c, qc()) : typeof define == "function" && define.amd ? define(["exports", "worker-timers-broker"], r) : (t = typeof globalThis < "u" ? globalThis : t || self, r(t.workerTimers = {}, t.workerTimersBroker));
8373
+ typeof c == "object" && typeof e < "u" ? r(c, Hc()) : typeof define == "function" && define.amd ? define(["exports", "worker-timers-broker"], r) : (t = typeof globalThis < "u" ? globalThis : t || self, r(t.workerTimers = {}, t.workerTimersBroker));
8345
8374
  })(c, function(t, r) {
8346
8375
  var a = function(d, p) {
8347
8376
  var y = null;
@@ -8365,11 +8394,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8365
8394
  };
8366
8395
  t.clearInterval = o, t.clearTimeout = s, t.setInterval = l, t.setTimeout = u;
8367
8396
  });
8368
- }), Ur = pe((c) => {
8397
+ }), Br = pe((c) => {
8369
8398
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 }), c.isReactNativeBrowser = c.isWebWorker = void 0;
8370
8399
  var e = () => typeof window < "u" ? typeof navigator < "u" && navigator.userAgent?.toLowerCase().indexOf(" electron/") > -1 && Pe?.versions ? !Object.prototype.hasOwnProperty.call(Pe.versions, "electron") : typeof window.document < "u" : !1, t = () => !!(typeof self == "object" && self?.constructor?.name?.includes("WorkerGlobalScope") && typeof Deno > "u"), r = () => typeof navigator < "u" && navigator.product === "ReactNative", a = e() || t() || r();
8371
8400
  c.isWebWorker = t(), c.isReactNativeBrowser = r(), c.default = a;
8372
- }), zc = pe((c) => {
8401
+ }), Kc = pe((c) => {
8373
8402
  le(), ue(), ce();
8374
8403
  var e = c && c.__createBinding || (Object.create ? function(l, u, d, p) {
8375
8404
  p === void 0 && (p = d);
@@ -8399,7 +8428,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8399
8428
  };
8400
8429
  })();
8401
8430
  Object.defineProperty(c, "__esModule", { value: !0 });
8402
- var a = Hc(), n = r(Ur()), i = { set: a.setInterval, clear: a.clearInterval }, o = { set: (l, u) => setInterval(l, u), clear: (l) => clearInterval(l) }, s = (l) => {
8431
+ var a = zc(), n = r(Br()), i = { set: a.setInterval, clear: a.clearInterval }, o = { set: (l, u) => setInterval(l, u), clear: (l) => clearInterval(l) }, s = (l) => {
8403
8432
  switch (l) {
8404
8433
  case "native":
8405
8434
  return o;
@@ -8410,13 +8439,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8410
8439
  }
8411
8440
  };
8412
8441
  c.default = s;
8413
- }), Ta = pe((c) => {
8442
+ }), Ca = pe((c) => {
8414
8443
  le(), ue(), ce();
8415
8444
  var e = c && c.__importDefault || function(a) {
8416
8445
  return a && a.__esModule ? a : { default: a };
8417
8446
  };
8418
8447
  Object.defineProperty(c, "__esModule", { value: !0 });
8419
- var t = e(zc()), r = class {
8448
+ var t = e(Kc()), r = class {
8420
8449
  _keepalive;
8421
8450
  timerId;
8422
8451
  timer;
@@ -8457,7 +8486,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8457
8486
  }
8458
8487
  };
8459
8488
  c.default = r;
8460
- }), ni = pe((c) => {
8489
+ }), ii = pe((c) => {
8461
8490
  le(), ue(), ce();
8462
8491
  var e = c && c.__createBinding || (Object.create ? function(v, x, E, I) {
8463
8492
  I === void 0 && (I = E);
@@ -8489,12 +8518,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8489
8518
  return v && v.__esModule ? v : { default: v };
8490
8519
  };
8491
8520
  Object.defineProperty(c, "__esModule", { value: !0 });
8492
- var n = a(tc()), i = It(), o = a(nc()), s = a(lt()), l = r(na()), u = a(ia()), d = a(Ec()), p = a(_a()), y = a(xc()), f = Ut(), m = Ac(), b = a(Ta()), k = r(Ur()), g = globalThis.setImmediate || ((...v) => {
8521
+ var n = a(rc()), i = It(), o = a(ic()), s = a(lt()), l = r(oa()), u = a(sa()), d = a(xc()), p = a(Sa()), y = a(Ac()), f = Ut(), m = Ic(), b = a(Ca()), k = r(Br()), g = globalThis.setImmediate || ((...v) => {
8493
8522
  let x = v.shift();
8494
8523
  (0, f.nextTick)(() => {
8495
8524
  x(...v);
8496
8525
  });
8497
- }), _ = { keepalive: 60, reschedulePings: !0, protocolId: "MQTT", protocolVersion: 4, reconnectPeriod: 1e3, connectTimeout: 30 * 1e3, clean: !0, resubscribe: !0, subscribeBatchSize: null, writeCache: !0, timerVariant: "auto" }, S = class ii extends m.TypedEventEmitter {
8526
+ }), _ = { keepalive: 60, reschedulePings: !0, protocolId: "MQTT", protocolVersion: 4, reconnectPeriod: 1e3, connectTimeout: 30 * 1e3, clean: !0, resubscribe: !0, subscribeBatchSize: null, writeCache: !0, timerVariant: "auto" }, S = class oi extends m.TypedEventEmitter {
8498
8527
  static VERSION = f.MQTTJS_VERSION;
8499
8528
  connected;
8500
8529
  disconnecting;
@@ -8531,7 +8560,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8531
8560
  constructor(x, E) {
8532
8561
  super(), this.options = E || {};
8533
8562
  for (let I in _) typeof this.options[I] > "u" ? this.options[I] = _[I] : this.options[I] = E[I];
8534
- this.log = this.options.log || (0, s.default)("mqttjs:client"), this.noop = this._noop.bind(this), this.log("MqttClient :: version:", ii.VERSION), k.isWebWorker ? this.log("MqttClient :: environment", "webworker") : this.log("MqttClient :: environment", k.default ? "browser" : "node"), this.log("MqttClient :: options.protocol", E.protocol), this.log("MqttClient :: options.protocolVersion", E.protocolVersion), this.log("MqttClient :: options.username", E.username), this.log("MqttClient :: options.keepalive", E.keepalive), this.log("MqttClient :: options.reconnectPeriod", E.reconnectPeriod), this.log("MqttClient :: options.rejectUnauthorized", E.rejectUnauthorized), this.log("MqttClient :: options.properties.topicAliasMaximum", E.properties ? E.properties.topicAliasMaximum : void 0), this.options.clientId = typeof E.clientId == "string" ? E.clientId : ii.defaultId(), this.log("MqttClient :: clientId", this.options.clientId), this.options.customHandleAcks = E.protocolVersion === 5 && E.customHandleAcks ? E.customHandleAcks : (...I) => {
8563
+ this.log = this.options.log || (0, s.default)("mqttjs:client"), this.noop = this._noop.bind(this), this.log("MqttClient :: version:", oi.VERSION), k.isWebWorker ? this.log("MqttClient :: environment", "webworker") : this.log("MqttClient :: environment", k.default ? "browser" : "node"), this.log("MqttClient :: options.protocol", E.protocol), this.log("MqttClient :: options.protocolVersion", E.protocolVersion), this.log("MqttClient :: options.username", E.username), this.log("MqttClient :: options.keepalive", E.keepalive), this.log("MqttClient :: options.reconnectPeriod", E.reconnectPeriod), this.log("MqttClient :: options.rejectUnauthorized", E.rejectUnauthorized), this.log("MqttClient :: options.properties.topicAliasMaximum", E.properties ? E.properties.topicAliasMaximum : void 0), this.options.clientId = typeof E.clientId == "string" ? E.clientId : oi.defaultId(), this.log("MqttClient :: clientId", this.options.clientId), this.options.customHandleAcks = E.protocolVersion === 5 && E.customHandleAcks ? E.customHandleAcks : (...I) => {
8535
8564
  I[3](null, 0);
8536
8565
  }, this.options.writeCache || (n.default.writeToStream.cacheNumbers = !1), this.streamBuilder = x, this.messageIdProvider = typeof this.options.messageIdProvider > "u" ? new p.default() : this.options.messageIdProvider, this.outgoingStore = E.outgoingStore || new u.default(), this.incomingStore = E.incomingStore || new u.default(), this.queueQoSZero = E.queueQoSZero === void 0 ? !0 : E.queueQoSZero, this._resubscribeTopics = {}, this.messageIdToTopic = {}, this.keepaliveManager = null, this.connected = !1, this.disconnecting = !1, this.reconnecting = !1, this.queue = [], this.connackTimer = null, this.reconnectTimer = null, this._storeProcessing = !1, this._packetIdsDuringStoreProcessing = {}, this._storeProcessingQueue = [], this.outgoing = {}, this._firstConnection = !0, E.properties && E.properties.topicAliasMaximum > 0 && (E.properties.topicAliasMaximum > 65535 ? this.log("MqttClient :: options.properties.topicAliasMaximum is out of range") : this.topicAliasRecv = new y.default(E.properties.topicAliasMaximum)), this.on("connect", () => {
8537
8566
  let { queue: I } = this, M = () => {
@@ -8991,9 +9020,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8991
9020
  }
8992
9021
  };
8993
9022
  c.default = S;
8994
- }), Kc = pe((c) => {
9023
+ }), Vc = pe((c) => {
8995
9024
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 });
8996
- var e = wa(), t = class {
9025
+ var e = ka(), t = class {
8997
9026
  numberAllocator;
8998
9027
  lastId;
8999
9028
  constructor() {
@@ -9017,9 +9046,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
9017
9046
  };
9018
9047
  c.default = t;
9019
9048
  });
9020
- function Vc() {
9021
- if (oi) return sr;
9022
- oi = !0;
9049
+ function Gc() {
9050
+ if (si) return sr;
9051
+ si = !0;
9023
9052
  let c = 2147483647, e = 36, t = 1, r = 26, a = 38, n = 700, i = 72, o = 128, s = "-", l = /^xn--/, u = /[^\0-\x7F]/, d = /[\x2E\u3002\uFF0E\uFF61]/g, p = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }, y = e - t, f = Math.floor, m = String.fromCharCode;
9024
9053
  function b(C) {
9025
9054
  throw new RangeError(p[C]);
@@ -9108,11 +9137,11 @@ function Vc() {
9108
9137
  });
9109
9138
  } }, sr;
9110
9139
  }
9111
- var sr, oi, gt, Gc = He(() => {
9112
- le(), ue(), ce(), sr = {}, oi = !1, gt = Vc(), gt.decode, gt.encode, gt.toASCII, gt.toUnicode, gt.ucs2, gt.version;
9140
+ var sr, si, gt, Yc = He(() => {
9141
+ le(), ue(), ce(), sr = {}, si = !1, gt = Gc(), gt.decode, gt.encode, gt.toASCII, gt.toUnicode, gt.ucs2, gt.version;
9113
9142
  });
9114
- function Yc() {
9115
- return ai || (ai = !0, si = function() {
9143
+ function Qc() {
9144
+ return li || (li = !0, ai = function() {
9116
9145
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function") return !1;
9117
9146
  if (typeof Symbol.iterator == "symbol") return !0;
9118
9147
  var c = {}, e = /* @__PURE__ */ Symbol("test"), t = Object(e);
@@ -9128,48 +9157,48 @@ function Yc() {
9128
9157
  if (n.value !== r || n.enumerable !== !0) return !1;
9129
9158
  }
9130
9159
  return !0;
9131
- }), si;
9132
- }
9133
- function Qc() {
9134
- return ci || (ci = !0, li = Error), li;
9160
+ }), ai;
9135
9161
  }
9136
9162
  function Jc() {
9137
- return hi || (hi = !0, ui = EvalError), ui;
9163
+ return ui || (ui = !0, ci = Error), ci;
9138
9164
  }
9139
9165
  function Xc() {
9140
- return di || (di = !0, fi = RangeError), fi;
9166
+ return fi || (fi = !0, hi = EvalError), hi;
9141
9167
  }
9142
9168
  function Zc() {
9143
- return gi || (gi = !0, pi = ReferenceError), pi;
9169
+ return pi || (pi = !0, di = RangeError), di;
9144
9170
  }
9145
- function Oa() {
9146
- return bi || (bi = !0, mi = SyntaxError), mi;
9171
+ function eu() {
9172
+ return mi || (mi = !0, gi = ReferenceError), gi;
9147
9173
  }
9148
- function Jt() {
9149
- return vi || (vi = !0, yi = TypeError), yi;
9174
+ function Pa() {
9175
+ return yi || (yi = !0, bi = SyntaxError), bi;
9150
9176
  }
9151
- function eu() {
9152
- return _i || (_i = !0, wi = URIError), wi;
9177
+ function Jt() {
9178
+ return wi || (wi = !0, vi = TypeError), vi;
9153
9179
  }
9154
9180
  function tu() {
9155
- if (ki) return ar;
9156
- ki = !0;
9157
- var c = typeof Symbol < "u" && Symbol, e = Yc();
9181
+ return ki || (ki = !0, _i = URIError), _i;
9182
+ }
9183
+ function ru() {
9184
+ if (Si) return ar;
9185
+ Si = !0;
9186
+ var c = typeof Symbol < "u" && Symbol, e = Qc();
9158
9187
  return ar = function() {
9159
9188
  return typeof c != "function" || typeof Symbol != "function" || typeof c("foo") != "symbol" || typeof /* @__PURE__ */ Symbol("bar") != "symbol" ? !1 : e();
9160
9189
  }, ar;
9161
9190
  }
9162
- function ru() {
9163
- if (Si) return lr;
9164
- Si = !0;
9191
+ function nu() {
9192
+ if (Ei) return lr;
9193
+ Ei = !0;
9165
9194
  var c = { __proto__: null, foo: {} }, e = Object;
9166
9195
  return lr = function() {
9167
9196
  return { __proto__: c }.foo === c.foo && !(c instanceof e);
9168
9197
  }, lr;
9169
9198
  }
9170
- function nu() {
9171
- if (Ei) return cr;
9172
- Ei = !0;
9199
+ function iu() {
9200
+ if (xi) return cr;
9201
+ xi = !0;
9173
9202
  var c = "Function.prototype.bind called on incompatible ", e = Object.prototype.toString, t = Math.max, r = "[object Function]", a = function(o, s) {
9174
9203
  for (var l = [], u = 0; u < o.length; u += 1) l[u] = o[u];
9175
9204
  for (var d = 0; d < s.length; d += 1) l[d + o.length] = s[d];
@@ -9199,22 +9228,22 @@ function nu() {
9199
9228
  return u;
9200
9229
  }, cr;
9201
9230
  }
9202
- function Zi() {
9203
- if (xi) return ur;
9204
- xi = !0;
9205
- var c = nu();
9231
+ function eo() {
9232
+ if (Ai) return ur;
9233
+ Ai = !0;
9234
+ var c = iu();
9206
9235
  return ur = Function.prototype.bind || c, ur;
9207
9236
  }
9208
- function iu() {
9209
- if (Ai) return hr;
9210
- Ai = !0;
9211
- var c = Function.prototype.call, e = Object.prototype.hasOwnProperty, t = Zi();
9237
+ function ou() {
9238
+ if (Ii) return hr;
9239
+ Ii = !0;
9240
+ var c = Function.prototype.call, e = Object.prototype.hasOwnProperty, t = eo();
9212
9241
  return hr = t.call(c, e), hr;
9213
9242
  }
9214
9243
  function Bt() {
9215
- if (Ii) return fr;
9216
- Ii = !0;
9217
- var c, e = Qc(), t = Jc(), r = Xc(), a = Zc(), n = Oa(), i = Jt(), o = eu(), s = Function, l = function(Y) {
9244
+ if (Ti) return fr;
9245
+ Ti = !0;
9246
+ var c, e = Jc(), t = Xc(), r = Zc(), a = eu(), n = Pa(), i = Jt(), o = tu(), s = Function, l = function(Y) {
9218
9247
  try {
9219
9248
  return s('"use strict"; return (' + Y + ").constructor;")();
9220
9249
  } catch {
@@ -9237,7 +9266,7 @@ function Bt() {
9237
9266
  return d;
9238
9267
  }
9239
9268
  }
9240
- })() : d, y = tu()(), f = ru()(), m = Object.getPrototypeOf || (f ? function(Y) {
9269
+ })() : d, y = ru()(), f = nu()(), m = Object.getPrototypeOf || (f ? function(Y) {
9241
9270
  return Y.__proto__;
9242
9271
  } : null), b = {}, k = typeof Uint8Array > "u" || !m ? c : m(Uint8Array), g = { __proto__: null, "%AggregateError%": typeof AggregateError > "u" ? c : AggregateError, "%Array%": Array, "%ArrayBuffer%": typeof ArrayBuffer > "u" ? c : ArrayBuffer, "%ArrayIteratorPrototype%": y && m ? m([][Symbol.iterator]()) : c, "%AsyncFromSyncIteratorPrototype%": c, "%AsyncFunction%": b, "%AsyncGenerator%": b, "%AsyncGeneratorFunction%": b, "%AsyncIteratorPrototype%": b, "%Atomics%": typeof Atomics > "u" ? c : Atomics, "%BigInt%": typeof BigInt > "u" ? c : BigInt, "%BigInt64Array%": typeof BigInt64Array > "u" ? c : BigInt64Array, "%BigUint64Array%": typeof BigUint64Array > "u" ? c : BigUint64Array, "%Boolean%": Boolean, "%DataView%": typeof DataView > "u" ? c : DataView, "%Date%": Date, "%decodeURI%": decodeURI, "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, "%Error%": e, "%eval%": eval, "%EvalError%": t, "%Float32Array%": typeof Float32Array > "u" ? c : Float32Array, "%Float64Array%": typeof Float64Array > "u" ? c : Float64Array, "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? c : FinalizationRegistry, "%Function%": s, "%GeneratorFunction%": b, "%Int8Array%": typeof Int8Array > "u" ? c : Int8Array, "%Int16Array%": typeof Int16Array > "u" ? c : Int16Array, "%Int32Array%": typeof Int32Array > "u" ? c : Int32Array, "%isFinite%": isFinite, "%isNaN%": isNaN, "%IteratorPrototype%": y && m ? m(m([][Symbol.iterator]())) : c, "%JSON%": typeof JSON == "object" ? JSON : c, "%Map%": typeof Map > "u" ? c : Map, "%MapIteratorPrototype%": typeof Map > "u" || !y || !m ? c : m((/* @__PURE__ */ new Map())[Symbol.iterator]()), "%Math%": Math, "%Number%": Number, "%Object%": Object, "%parseFloat%": parseFloat, "%parseInt%": parseInt, "%Promise%": typeof Promise > "u" ? c : Promise, "%Proxy%": typeof Proxy > "u" ? c : Proxy, "%RangeError%": r, "%ReferenceError%": a, "%Reflect%": typeof Reflect > "u" ? c : Reflect, "%RegExp%": RegExp, "%Set%": typeof Set > "u" ? c : Set, "%SetIteratorPrototype%": typeof Set > "u" || !y || !m ? c : m((/* @__PURE__ */ new Set())[Symbol.iterator]()), "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? c : SharedArrayBuffer, "%String%": String, "%StringIteratorPrototype%": y && m ? m(""[Symbol.iterator]()) : c, "%Symbol%": y ? Symbol : c, "%SyntaxError%": n, "%ThrowTypeError%": p, "%TypedArray%": k, "%TypeError%": i, "%Uint8Array%": typeof Uint8Array > "u" ? c : Uint8Array, "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? c : Uint8ClampedArray, "%Uint16Array%": typeof Uint16Array > "u" ? c : Uint16Array, "%Uint32Array%": typeof Uint32Array > "u" ? c : Uint32Array, "%URIError%": o, "%WeakMap%": typeof WeakMap > "u" ? c : WeakMap, "%WeakRef%": typeof WeakRef > "u" ? c : WeakRef, "%WeakSet%": typeof WeakSet > "u" ? c : WeakSet };
9243
9272
  if (m) try {
@@ -9259,7 +9288,7 @@ function Bt() {
9259
9288
  Z && m && (re = m(Z.prototype));
9260
9289
  }
9261
9290
  return g[K] = re, re;
9262
- }, v = { __proto__: null, "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], "%ArrayPrototype%": ["Array", "prototype"], "%ArrayProto_entries%": ["Array", "prototype", "entries"], "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], "%ArrayProto_keys%": ["Array", "prototype", "keys"], "%ArrayProto_values%": ["Array", "prototype", "values"], "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], "%BooleanPrototype%": ["Boolean", "prototype"], "%DataViewPrototype%": ["DataView", "prototype"], "%DatePrototype%": ["Date", "prototype"], "%ErrorPrototype%": ["Error", "prototype"], "%EvalErrorPrototype%": ["EvalError", "prototype"], "%Float32ArrayPrototype%": ["Float32Array", "prototype"], "%Float64ArrayPrototype%": ["Float64Array", "prototype"], "%FunctionPrototype%": ["Function", "prototype"], "%Generator%": ["GeneratorFunction", "prototype"], "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], "%Int8ArrayPrototype%": ["Int8Array", "prototype"], "%Int16ArrayPrototype%": ["Int16Array", "prototype"], "%Int32ArrayPrototype%": ["Int32Array", "prototype"], "%JSONParse%": ["JSON", "parse"], "%JSONStringify%": ["JSON", "stringify"], "%MapPrototype%": ["Map", "prototype"], "%NumberPrototype%": ["Number", "prototype"], "%ObjectPrototype%": ["Object", "prototype"], "%ObjProto_toString%": ["Object", "prototype", "toString"], "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], "%PromisePrototype%": ["Promise", "prototype"], "%PromiseProto_then%": ["Promise", "prototype", "then"], "%Promise_all%": ["Promise", "all"], "%Promise_reject%": ["Promise", "reject"], "%Promise_resolve%": ["Promise", "resolve"], "%RangeErrorPrototype%": ["RangeError", "prototype"], "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], "%RegExpPrototype%": ["RegExp", "prototype"], "%SetPrototype%": ["Set", "prototype"], "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], "%StringPrototype%": ["String", "prototype"], "%SymbolPrototype%": ["Symbol", "prototype"], "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], "%TypedArrayPrototype%": ["TypedArray", "prototype"], "%TypeErrorPrototype%": ["TypeError", "prototype"], "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], "%URIErrorPrototype%": ["URIError", "prototype"], "%WeakMapPrototype%": ["WeakMap", "prototype"], "%WeakSetPrototype%": ["WeakSet", "prototype"] }, x = Zi(), E = iu(), I = x.call(Function.call, Array.prototype.concat), M = x.call(Function.apply, Array.prototype.splice), C = x.call(Function.call, String.prototype.replace), B = x.call(Function.call, String.prototype.slice), T = x.call(Function.call, RegExp.prototype.exec), W = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, F = /\\(\\)?/g, N = function(Y) {
9291
+ }, v = { __proto__: null, "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], "%ArrayPrototype%": ["Array", "prototype"], "%ArrayProto_entries%": ["Array", "prototype", "entries"], "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], "%ArrayProto_keys%": ["Array", "prototype", "keys"], "%ArrayProto_values%": ["Array", "prototype", "values"], "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], "%BooleanPrototype%": ["Boolean", "prototype"], "%DataViewPrototype%": ["DataView", "prototype"], "%DatePrototype%": ["Date", "prototype"], "%ErrorPrototype%": ["Error", "prototype"], "%EvalErrorPrototype%": ["EvalError", "prototype"], "%Float32ArrayPrototype%": ["Float32Array", "prototype"], "%Float64ArrayPrototype%": ["Float64Array", "prototype"], "%FunctionPrototype%": ["Function", "prototype"], "%Generator%": ["GeneratorFunction", "prototype"], "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], "%Int8ArrayPrototype%": ["Int8Array", "prototype"], "%Int16ArrayPrototype%": ["Int16Array", "prototype"], "%Int32ArrayPrototype%": ["Int32Array", "prototype"], "%JSONParse%": ["JSON", "parse"], "%JSONStringify%": ["JSON", "stringify"], "%MapPrototype%": ["Map", "prototype"], "%NumberPrototype%": ["Number", "prototype"], "%ObjectPrototype%": ["Object", "prototype"], "%ObjProto_toString%": ["Object", "prototype", "toString"], "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], "%PromisePrototype%": ["Promise", "prototype"], "%PromiseProto_then%": ["Promise", "prototype", "then"], "%Promise_all%": ["Promise", "all"], "%Promise_reject%": ["Promise", "reject"], "%Promise_resolve%": ["Promise", "resolve"], "%RangeErrorPrototype%": ["RangeError", "prototype"], "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], "%RegExpPrototype%": ["RegExp", "prototype"], "%SetPrototype%": ["Set", "prototype"], "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], "%StringPrototype%": ["String", "prototype"], "%SymbolPrototype%": ["Symbol", "prototype"], "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], "%TypedArrayPrototype%": ["TypedArray", "prototype"], "%TypeErrorPrototype%": ["TypeError", "prototype"], "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], "%URIErrorPrototype%": ["URIError", "prototype"], "%WeakMapPrototype%": ["WeakMap", "prototype"], "%WeakSetPrototype%": ["WeakSet", "prototype"] }, x = eo(), E = ou(), I = x.call(Function.call, Array.prototype.concat), M = x.call(Function.apply, Array.prototype.splice), C = x.call(Function.call, String.prototype.replace), B = x.call(Function.call, String.prototype.slice), T = x.call(Function.call, RegExp.prototype.exec), W = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, F = /\\(\\)?/g, N = function(Y) {
9263
9292
  var K = B(Y, 0, 1), re = B(Y, -1);
9264
9293
  if (K === "%" && re !== "%") throw new n("invalid intrinsic syntax, expected closing `%`");
9265
9294
  if (re === "%" && K !== "%") throw new n("invalid intrinsic syntax, expected opening `%`");
@@ -9301,9 +9330,9 @@ function Bt() {
9301
9330
  return J;
9302
9331
  }, fr;
9303
9332
  }
9304
- function eo() {
9305
- if (Ti) return dr;
9306
- Ti = !0;
9333
+ function to() {
9334
+ if (Oi) return dr;
9335
+ Oi = !0;
9307
9336
  var c = Bt(), e = c("%Object.defineProperty%", !0) || !1;
9308
9337
  if (e) try {
9309
9338
  e({}, "a", { value: 1 });
@@ -9312,9 +9341,9 @@ function eo() {
9312
9341
  }
9313
9342
  return dr = e, dr;
9314
9343
  }
9315
- function Ca() {
9316
- if (Oi) return pr;
9317
- Oi = !0;
9344
+ function Ma() {
9345
+ if (Ci) return pr;
9346
+ Ci = !0;
9318
9347
  var c = Bt(), e = c("%Object.getOwnPropertyDescriptor%", !0);
9319
9348
  if (e) try {
9320
9349
  e([], "length");
@@ -9323,10 +9352,10 @@ function Ca() {
9323
9352
  }
9324
9353
  return pr = e, pr;
9325
9354
  }
9326
- function ou() {
9327
- if (Ci) return gr;
9328
- Ci = !0;
9329
- var c = eo(), e = Oa(), t = Jt(), r = Ca();
9355
+ function su() {
9356
+ if (Pi) return gr;
9357
+ Pi = !0;
9358
+ var c = to(), e = Pa(), t = Jt(), r = Ma();
9330
9359
  return gr = function(a, n, i) {
9331
9360
  if (!a || typeof a != "object" && typeof a != "function") throw new t("`obj` must be an object or a function`");
9332
9361
  if (typeof n != "string" && typeof n != "symbol") throw new t("`property` must be a string or a symbol`");
@@ -9340,10 +9369,10 @@ function ou() {
9340
9369
  else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
9341
9370
  }, gr;
9342
9371
  }
9343
- function su() {
9344
- if (Pi) return mr;
9345
- Pi = !0;
9346
- var c = eo(), e = function() {
9372
+ function au() {
9373
+ if (Mi) return mr;
9374
+ Mi = !0;
9375
+ var c = to(), e = function() {
9347
9376
  return !!c;
9348
9377
  };
9349
9378
  return e.hasArrayLengthDefineBug = function() {
@@ -9355,10 +9384,10 @@ function su() {
9355
9384
  }
9356
9385
  }, mr = e, mr;
9357
9386
  }
9358
- function au() {
9359
- if (Mi) return br;
9360
- Mi = !0;
9361
- var c = Bt(), e = ou(), t = su()(), r = Ca(), a = Jt(), n = c("%Math.floor%");
9387
+ function lu() {
9388
+ if (Ri) return br;
9389
+ Ri = !0;
9390
+ var c = Bt(), e = su(), t = au()(), r = Ma(), a = Jt(), n = c("%Math.floor%");
9362
9391
  return br = function(i, o) {
9363
9392
  if (typeof i != "function") throw new a("`fn` is not a function");
9364
9393
  if (typeof o != "number" || o < 0 || o > 4294967295 || n(o) !== o) throw new a("`length` must be a positive 32-bit integer");
@@ -9370,10 +9399,10 @@ function au() {
9370
9399
  return (l || u || !s) && (t ? e(i, "length", o, !0, !0) : e(i, "length", o)), i;
9371
9400
  }, br;
9372
9401
  }
9373
- function lu() {
9374
- if (Ri) return Mt;
9375
- Ri = !0;
9376
- var c = Zi(), e = Bt(), t = au(), r = Jt(), a = e("%Function.prototype.apply%"), n = e("%Function.prototype.call%"), i = e("%Reflect.apply%", !0) || c.call(n, a), o = eo(), s = e("%Math.max%");
9402
+ function cu() {
9403
+ if (ji) return Mt;
9404
+ ji = !0;
9405
+ var c = eo(), e = Bt(), t = lu(), r = Jt(), a = e("%Function.prototype.apply%"), n = e("%Function.prototype.call%"), i = e("%Reflect.apply%", !0) || c.call(n, a), o = to(), s = e("%Math.max%");
9377
9406
  Mt = function(u) {
9378
9407
  if (typeof u != "function") throw new r("a function is required");
9379
9408
  var d = i(c, n, arguments);
@@ -9384,27 +9413,27 @@ function lu() {
9384
9413
  };
9385
9414
  return o ? o(Mt, "apply", { value: l }) : Mt.apply = l, Mt;
9386
9415
  }
9387
- function cu() {
9388
- if (ji) return yr;
9389
- ji = !0;
9390
- var c = Bt(), e = lu(), t = e(c("String.prototype.indexOf"));
9416
+ function uu() {
9417
+ if (Li) return yr;
9418
+ Li = !0;
9419
+ var c = Bt(), e = cu(), t = e(c("String.prototype.indexOf"));
9391
9420
  return yr = function(r, a) {
9392
9421
  var n = c(r, !!a);
9393
9422
  return typeof n == "function" && t(r, ".prototype.") > -1 ? e(n) : n;
9394
9423
  }, yr;
9395
9424
  }
9396
- var si, ai, li, ci, ui, hi, fi, di, pi, gi, mi, bi, yi, vi, wi, _i, ar, ki, lr, Si, cr, Ei, ur, xi, hr, Ai, fr, Ii, dr, Ti, pr, Oi, gr, Ci, mr, Pi, br, Mi, Mt, Ri, yr, ji, uu = He(() => {
9397
- le(), ue(), ce(), si = {}, ai = !1, li = {}, ci = !1, ui = {}, hi = !1, fi = {}, di = !1, pi = {}, gi = !1, mi = {}, bi = !1, yi = {}, vi = !1, wi = {}, _i = !1, ar = {}, ki = !1, lr = {}, Si = !1, cr = {}, Ei = !1, ur = {}, xi = !1, hr = {}, Ai = !1, fr = {}, Ii = !1, dr = {}, Ti = !1, pr = {}, Oi = !1, gr = {}, Ci = !1, mr = {}, Pi = !1, br = {}, Mi = !1, Mt = {}, Ri = !1, yr = {}, ji = !1;
9425
+ var ai, li, ci, ui, hi, fi, di, pi, gi, mi, bi, yi, vi, wi, _i, ki, ar, Si, lr, Ei, cr, xi, ur, Ai, hr, Ii, fr, Ti, dr, Oi, pr, Ci, gr, Pi, mr, Mi, br, Ri, Mt, ji, yr, Li, hu = He(() => {
9426
+ le(), ue(), ce(), ai = {}, li = !1, ci = {}, ui = !1, hi = {}, fi = !1, di = {}, pi = !1, gi = {}, mi = !1, bi = {}, yi = !1, vi = {}, wi = !1, _i = {}, ki = !1, ar = {}, Si = !1, lr = {}, Ei = !1, cr = {}, xi = !1, ur = {}, Ai = !1, hr = {}, Ii = !1, fr = {}, Ti = !1, dr = {}, Oi = !1, pr = {}, Ci = !1, gr = {}, Pi = !1, mr = {}, Mi = !1, br = {}, Ri = !1, Mt = {}, ji = !1, yr = {}, Li = !1;
9398
9427
  });
9399
- function to(c) {
9428
+ function ro(c) {
9400
9429
  throw new Error("Node.js process " + c + " is not supported by JSPM core outside of Node.js");
9401
9430
  }
9402
- function hu() {
9403
- !Et || !kt || (Et = !1, kt.length ? tt = kt.concat(tt) : Gt = -1, tt.length && Pa());
9431
+ function fu() {
9432
+ !Et || !kt || (Et = !1, kt.length ? tt = kt.concat(tt) : Gt = -1, tt.length && Ra());
9404
9433
  }
9405
- function Pa() {
9434
+ function Ra() {
9406
9435
  if (!Et) {
9407
- var c = setTimeout(hu, 0);
9436
+ var c = setTimeout(fu, 0);
9408
9437
  Et = !0;
9409
9438
  for (var e = tt.length; e; ) {
9410
9439
  for (kt = tt, tt = []; ++Gt < e; ) kt && kt[Gt].run();
@@ -9413,70 +9442,70 @@ function Pa() {
9413
9442
  kt = null, Et = !1, clearTimeout(c);
9414
9443
  }
9415
9444
  }
9416
- function fu(c) {
9445
+ function du(c) {
9417
9446
  var e = new Array(arguments.length - 1);
9418
9447
  if (arguments.length > 1) for (var t = 1; t < arguments.length; t++) e[t - 1] = arguments[t];
9419
- tt.push(new Ma(c, e)), tt.length === 1 && !Et && setTimeout(Pa, 0);
9448
+ tt.push(new ja(c, e)), tt.length === 1 && !Et && setTimeout(Ra, 0);
9420
9449
  }
9421
- function Ma(c, e) {
9450
+ function ja(c, e) {
9422
9451
  this.fun = c, this.array = e;
9423
9452
  }
9424
9453
  function Fe() {
9425
9454
  }
9426
- function du(c) {
9427
- to("_linkedBinding");
9428
- }
9429
9455
  function pu(c) {
9430
- to("dlopen");
9456
+ ro("_linkedBinding");
9431
9457
  }
9432
- function gu() {
9433
- return [];
9458
+ function gu(c) {
9459
+ ro("dlopen");
9434
9460
  }
9435
9461
  function mu() {
9436
9462
  return [];
9437
9463
  }
9438
- function bu(c, e) {
9464
+ function bu() {
9465
+ return [];
9466
+ }
9467
+ function yu(c, e) {
9439
9468
  if (!c) throw new Error(e || "assertion error");
9440
9469
  }
9441
- function yu() {
9470
+ function vu() {
9442
9471
  return !1;
9443
9472
  }
9444
- function vu() {
9473
+ function wu() {
9445
9474
  return st.now() / 1e3;
9446
9475
  }
9447
- function Dr(c) {
9476
+ function $r(c) {
9448
9477
  var e = Math.floor((Date.now() - st.now()) * 1e-3), t = st.now() * 1e-3, r = Math.floor(t) + e, a = Math.floor(t % 1 * 1e9);
9449
9478
  return c && (r = r - c[0], a = a - c[1], a < 0 && (r--, a += vr)), [r, a];
9450
9479
  }
9451
9480
  function dt() {
9452
- return ro;
9481
+ return no;
9453
9482
  }
9454
- function wu(c) {
9483
+ function _u(c) {
9455
9484
  return [];
9456
9485
  }
9457
- var tt, Et, kt, Gt, po, go, mo, bo, yo, vo, wo, _o, ko, So, Eo, xo, Ao, Io, To, Oo, Co, Po, Mo, Ro, jo, er, Lo, No, Uo, Bo, Fo, Do, $o, Wo, qo, Ho, zo, Ko, Vo, Go, Yo, Qo, Jo, Xo, Zo, es, ts, rs, ns, is, os, st, $r, vr, ss, as, ls, cs, us, hs, fs, ds, ps, gs, ms, ro, Ra = He(() => {
9458
- le(), ue(), ce(), tt = [], Et = !1, Gt = -1, Ma.prototype.run = function() {
9486
+ var tt, Et, kt, Gt, go, mo, bo, yo, vo, wo, _o, ko, So, Eo, xo, Ao, Io, To, Oo, Co, Po, Mo, Ro, jo, Lo, er, No, Uo, Bo, Fo, Do, $o, Wo, qo, Ho, zo, Ko, Vo, Go, Yo, Qo, Jo, Xo, Zo, es, ts, rs, ns, is, os, ss, st, Wr, vr, as, ls, cs, us, hs, fs, ds, ps, gs, ms, bs, no, La = He(() => {
9487
+ le(), ue(), ce(), tt = [], Et = !1, Gt = -1, ja.prototype.run = function() {
9459
9488
  this.fun.apply(null, this.array);
9460
- }, po = "browser", go = "x64", mo = "browser", bo = { PATH: "/usr/bin", LANG: navigator.language + ".UTF-8", PWD: "/", HOME: "/home", TMP: "/tmp" }, yo = ["/usr/bin/node"], vo = [], wo = "v16.8.0", _o = {}, ko = function(c, e) {
9489
+ }, go = "browser", mo = "x64", bo = "browser", yo = { PATH: "/usr/bin", LANG: navigator.language + ".UTF-8", PWD: "/", HOME: "/home", TMP: "/tmp" }, vo = ["/usr/bin/node"], wo = [], _o = "v16.8.0", ko = {}, So = function(c, e) {
9461
9490
  console.warn((e ? e + ": " : "") + c);
9462
- }, So = function(c) {
9463
- to("binding");
9464
9491
  }, Eo = function(c) {
9492
+ ro("binding");
9493
+ }, xo = function(c) {
9465
9494
  return 0;
9466
- }, xo = function() {
9495
+ }, Ao = function() {
9467
9496
  return "/";
9468
- }, Ao = function(c) {
9469
- }, Io = { name: "node", sourceUrl: "", headersUrl: "", libUrl: "" }, To = Fe, Oo = [], Co = {}, Po = !1, Mo = {}, Ro = Fe, jo = Fe, er = function() {
9497
+ }, Io = function(c) {
9498
+ }, To = { name: "node", sourceUrl: "", headersUrl: "", libUrl: "" }, Oo = Fe, Co = [], Po = {}, Mo = !1, Ro = {}, jo = Fe, Lo = Fe, er = function() {
9470
9499
  return {};
9471
- }, Lo = er, No = er, Uo = Fe, Bo = Fe, Fo = Fe, Do = {}, $o = { inspector: !1, debug: !1, uv: !1, ipv6: !1, tls_alpn: !1, tls_sni: !1, tls_ocsp: !1, tls: !1, cached_builtins: !0 }, Wo = Fe, qo = Fe, Ho = Fe, zo = Fe, Ko = Fe, Vo = Fe, Go = Fe, Yo = void 0, Qo = void 0, Jo = void 0, Xo = Fe, Zo = 2, es = 1, ts = "/bin/usr/node", rs = 9229, ns = "node", is = [], os = Fe, st = { now: typeof performance < "u" ? performance.now.bind(performance) : void 0, timing: typeof performance < "u" ? performance.timing : void 0 }, st.now === void 0 && ($r = Date.now(), st.timing && st.timing.navigationStart && ($r = st.timing.navigationStart), st.now = () => Date.now() - $r), vr = 1e9, Dr.bigint = function(c) {
9472
- var e = Dr(c);
9500
+ }, No = er, Uo = er, Bo = Fe, Fo = Fe, Do = Fe, $o = {}, Wo = { inspector: !1, debug: !1, uv: !1, ipv6: !1, tls_alpn: !1, tls_sni: !1, tls_ocsp: !1, tls: !1, cached_builtins: !0 }, qo = Fe, Ho = Fe, zo = Fe, Ko = Fe, Vo = Fe, Go = Fe, Yo = Fe, Qo = void 0, Jo = void 0, Xo = void 0, Zo = Fe, es = 2, ts = 1, rs = "/bin/usr/node", ns = 9229, is = "node", os = [], ss = Fe, st = { now: typeof performance < "u" ? performance.now.bind(performance) : void 0, timing: typeof performance < "u" ? performance.timing : void 0 }, st.now === void 0 && (Wr = Date.now(), st.timing && st.timing.navigationStart && (Wr = st.timing.navigationStart), st.now = () => Date.now() - Wr), vr = 1e9, $r.bigint = function(c) {
9501
+ var e = $r(c);
9473
9502
  return typeof BigInt > "u" ? e[0] * vr + e[1] : BigInt(e[0] * vr) + BigInt(e[1]);
9474
- }, ss = 10, as = {}, ls = 0, cs = dt, us = dt, hs = dt, fs = dt, ds = dt, ps = Fe, gs = dt, ms = dt, ro = { version: wo, versions: _o, arch: go, platform: mo, release: Io, _rawDebug: To, moduleLoadList: Oo, binding: So, _linkedBinding: du, _events: as, _eventsCount: ls, _maxListeners: ss, on: dt, addListener: cs, once: us, off: hs, removeListener: fs, removeAllListeners: ds, emit: ps, prependListener: gs, prependOnceListener: ms, listeners: wu, domain: Co, _exiting: Po, config: Mo, dlopen: pu, uptime: vu, _getActiveRequests: gu, _getActiveHandles: mu, reallyExit: Ro, _kill: jo, cpuUsage: er, resourceUsage: Lo, memoryUsage: No, kill: Uo, exit: Bo, openStdin: Fo, allowedNodeEnvironmentFlags: Do, assert: bu, features: $o, _fatalExceptions: Wo, setUncaughtExceptionCaptureCallback: qo, hasUncaughtExceptionCaptureCallback: yu, emitWarning: ko, nextTick: fu, _tickCallback: Ho, _debugProcess: zo, _debugEnd: Ko, _startProfilerIdleNotifier: Vo, _stopProfilerIdleNotifier: Go, stdout: Yo, stdin: Jo, stderr: Qo, abort: Xo, umask: Eo, chdir: Ao, cwd: xo, env: bo, title: po, argv: yo, execArgv: vo, pid: Zo, ppid: es, execPath: ts, debugPort: rs, hrtime: Dr, argv0: ns, _preload_modules: is, setSourceMapsEnabled: os };
9503
+ }, as = 10, ls = {}, cs = 0, us = dt, hs = dt, fs = dt, ds = dt, ps = dt, gs = Fe, ms = dt, bs = dt, no = { version: _o, versions: ko, arch: mo, platform: bo, release: To, _rawDebug: Oo, moduleLoadList: Co, binding: Eo, _linkedBinding: pu, _events: ls, _eventsCount: cs, _maxListeners: as, on: dt, addListener: us, once: hs, off: fs, removeListener: ds, removeAllListeners: ps, emit: gs, prependListener: ms, prependOnceListener: bs, listeners: _u, domain: Po, _exiting: Mo, config: Ro, dlopen: gu, uptime: wu, _getActiveRequests: mu, _getActiveHandles: bu, reallyExit: jo, _kill: Lo, cpuUsage: er, resourceUsage: No, memoryUsage: Uo, kill: Bo, exit: Fo, openStdin: Do, allowedNodeEnvironmentFlags: $o, assert: yu, features: Wo, _fatalExceptions: qo, setUncaughtExceptionCaptureCallback: Ho, hasUncaughtExceptionCaptureCallback: vu, emitWarning: So, nextTick: du, _tickCallback: zo, _debugProcess: Ko, _debugEnd: Vo, _startProfilerIdleNotifier: Go, _stopProfilerIdleNotifier: Yo, stdout: Qo, stdin: Xo, stderr: Jo, abort: Zo, umask: xo, chdir: Io, cwd: Ao, env: yo, title: go, argv: vo, execArgv: wo, pid: es, ppid: ts, execPath: rs, debugPort: ns, hrtime: $r, argv0: is, _preload_modules: os, setSourceMapsEnabled: ss };
9475
9504
  });
9476
- function _u() {
9477
- if (Li) return wr;
9478
- Li = !0;
9479
- var c = ro;
9505
+ function ku() {
9506
+ if (Ni) return wr;
9507
+ Ni = !0;
9508
+ var c = no;
9480
9509
  function e(n) {
9481
9510
  if (typeof n != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
9482
9511
  }
@@ -9624,13 +9653,13 @@ function _u() {
9624
9653
  }, sep: "/", delimiter: ":", win32: null, posix: null };
9625
9654
  return a.posix = a, wr = a, wr;
9626
9655
  }
9627
- var wr, Li, Ni, ku = He(() => {
9628
- le(), ue(), ce(), Ra(), wr = {}, Li = !1, Ni = _u();
9629
- }), ja = {};
9630
- Lt(ja, { URL: () => Ha, Url: () => Fa, default: () => De, fileURLToPath: () => Na, format: () => Da, parse: () => qa, pathToFileURL: () => Ua, resolve: () => $a, resolveObject: () => Wa });
9631
- function Su() {
9632
- if (Ui) return _r;
9633
- Ui = !0;
9656
+ var wr, Ni, Ui, Su = He(() => {
9657
+ le(), ue(), ce(), La(), wr = {}, Ni = !1, Ui = ku();
9658
+ }), Na = {};
9659
+ Lt(Na, { URL: () => Ka, Url: () => $a, default: () => De, fileURLToPath: () => Ba, format: () => Wa, parse: () => za, pathToFileURL: () => Fa, resolve: () => qa, resolveObject: () => Ha });
9660
+ function Eu() {
9661
+ if (Bi) return _r;
9662
+ Bi = !0;
9634
9663
  var c = typeof Map == "function" && Map.prototype, e = Object.getOwnPropertyDescriptor && c ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, t = c && e && typeof e.get == "function" ? e.get : null, r = c && Map.prototype.forEach, a = typeof Set == "function" && Set.prototype, n = Object.getOwnPropertyDescriptor && a ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, i = a && n && typeof n.get == "function" ? n.get : null, o = a && Set.prototype.forEach, s = typeof WeakMap == "function" && WeakMap.prototype, l = s ? WeakMap.prototype.has : null, u = typeof WeakSet == "function" && WeakSet.prototype, d = u ? WeakSet.prototype.has : null, p = typeof WeakRef == "function" && WeakRef.prototype, y = p ? WeakRef.prototype.deref : null, f = Boolean.prototype.valueOf, m = Object.prototype.toString, b = Function.prototype.toString, k = String.prototype.match, g = String.prototype.slice, _ = String.prototype.replace, S = String.prototype.toUpperCase, v = String.prototype.toLowerCase, x = RegExp.prototype.test, E = Array.prototype.concat, I = Array.prototype.join, M = Array.prototype.slice, C = Math.floor, B = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, T = Object.getOwnPropertySymbols, W = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, F = typeof Symbol == "function" && typeof Symbol.iterator == "object", N = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === F || !0) ? Symbol.toStringTag : null, ae = Object.prototype.propertyIsEnumerable, Y = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(z) {
9635
9664
  return z.__proto__;
9636
9665
  } : null);
@@ -9646,7 +9675,7 @@ function Su() {
9646
9675
  }
9647
9676
  return _.call(ie, xe, "$&_");
9648
9677
  }
9649
- var re = Ba, D = re.custom, Z = G(D) ? D : null;
9678
+ var re = Da, D = re.custom, Z = G(D) ? D : null;
9650
9679
  _r = function z(ie, xe, Ae, Ie) {
9651
9680
  var Oe = xe || {};
9652
9681
  if (oe(Oe, "quoteStyle") && Oe.quoteStyle !== "single" && Oe.quoteStyle !== "double") throw new TypeError('option "quoteStyle" must be "single" or "double"');
@@ -9923,10 +9952,10 @@ function Su() {
9923
9952
  }
9924
9953
  return _r;
9925
9954
  }
9926
- function Eu() {
9927
- if (Bi) return Sr;
9928
- Bi = !0;
9929
- var c = Bt(), e = cu(), t = Su(), r = Jt(), a = c("%WeakMap%", !0), n = c("%Map%", !0), i = e("WeakMap.prototype.get", !0), o = e("WeakMap.prototype.set", !0), s = e("WeakMap.prototype.has", !0), l = e("Map.prototype.get", !0), u = e("Map.prototype.set", !0), d = e("Map.prototype.has", !0), p = function(b, k) {
9955
+ function xu() {
9956
+ if (Fi) return Sr;
9957
+ Fi = !0;
9958
+ var c = Bt(), e = uu(), t = Eu(), r = Jt(), a = c("%WeakMap%", !0), n = c("%Map%", !0), i = e("WeakMap.prototype.get", !0), o = e("WeakMap.prototype.set", !0), s = e("WeakMap.prototype.has", !0), l = e("Map.prototype.get", !0), u = e("Map.prototype.set", !0), d = e("Map.prototype.has", !0), p = function(b, k) {
9930
9959
  for (var g = b, _; (_ = g.next) !== null; g = _) if (_.key === k) return g.next = _.next, _.next = b.next, b.next = _, _;
9931
9960
  }, y = function(b, k) {
9932
9961
  var g = p(b, k);
@@ -9959,9 +9988,9 @@ function Eu() {
9959
9988
  return _;
9960
9989
  }, Sr;
9961
9990
  }
9962
- function no() {
9963
- if (Fi) return Er;
9964
- Fi = !0;
9991
+ function io() {
9992
+ if (Di) return Er;
9993
+ Di = !0;
9965
9994
  var c = String.prototype.replace, e = /%20/g, t = { RFC1738: "RFC1738", RFC3986: "RFC3986" };
9966
9995
  return Er = { default: t.RFC3986, formatters: { RFC1738: function(r) {
9967
9996
  return c.call(r, e, "+");
@@ -9969,10 +9998,10 @@ function no() {
9969
9998
  return String(r);
9970
9999
  } }, RFC1738: t.RFC1738, RFC3986: t.RFC3986 }, Er;
9971
10000
  }
9972
- function La() {
9973
- if (Di) return xr;
9974
- Di = !0;
9975
- var c = no(), e = Object.prototype.hasOwnProperty, t = Array.isArray, r = (function() {
10001
+ function Ua() {
10002
+ if ($i) return xr;
10003
+ $i = !0;
10004
+ var c = io(), e = Object.prototype.hasOwnProperty, t = Array.isArray, r = (function() {
9976
10005
  for (var b = [], k = 0; k < 256; ++k) b.push("%" + ((k < 16 ? "0" : "") + k.toString(16)).toUpperCase());
9977
10006
  return b;
9978
10007
  })(), a = function(b) {
@@ -10068,10 +10097,10 @@ function La() {
10068
10097
  };
10069
10098
  return xr = { arrayToObject: n, assign: o, combine: f, compact: d, decode: s, encode: u, isBuffer: y, isRegExp: p, maybeMap: m, merge: i }, xr;
10070
10099
  }
10071
- function xu() {
10072
- if ($i) return Ar;
10073
- $i = !0;
10074
- var c = Eu(), e = La(), t = no(), r = Object.prototype.hasOwnProperty, a = { brackets: function(m) {
10100
+ function Au() {
10101
+ if (Wi) return Ar;
10102
+ Wi = !0;
10103
+ var c = xu(), e = Ua(), t = io(), r = Object.prototype.hasOwnProperty, a = { brackets: function(m) {
10075
10104
  return m + "[]";
10076
10105
  }, comma: "comma", indices: function(m, b) {
10077
10106
  return m + "[" + b + "]";
@@ -10160,10 +10189,10 @@ function xu() {
10160
10189
  return g.charsetSentinel && (g.charset === "iso-8859-1" ? T += "utf8=%26%2310003%3B&" : T += "utf8=%E2%9C%93&"), B.length > 0 ? T + B : "";
10161
10190
  }, Ar;
10162
10191
  }
10163
- function Au() {
10164
- if (Wi) return Ir;
10165
- Wi = !0;
10166
- var c = La(), e = Object.prototype.hasOwnProperty, t = Array.isArray, r = { allowDots: !1, allowEmptyArrays: !1, allowPrototypes: !1, allowSparse: !1, arrayLimit: 20, charset: "utf-8", charsetSentinel: !1, comma: !1, decodeDotInKeys: !1, decoder: c.decode, delimiter: "&", depth: 5, duplicates: "combine", ignoreQueryPrefix: !1, interpretNumericEntities: !1, parameterLimit: 1e3, parseArrays: !0, plainObjects: !1, strictDepth: !1, strictNullHandling: !1 }, a = function(p) {
10192
+ function Iu() {
10193
+ if (qi) return Ir;
10194
+ qi = !0;
10195
+ var c = Ua(), e = Object.prototype.hasOwnProperty, t = Array.isArray, r = { allowDots: !1, allowEmptyArrays: !1, allowPrototypes: !1, allowSparse: !1, arrayLimit: 20, charset: "utf-8", charsetSentinel: !1, comma: !1, decodeDotInKeys: !1, decoder: c.decode, delimiter: "&", depth: 5, duplicates: "combine", ignoreQueryPrefix: !1, interpretNumericEntities: !1, parameterLimit: 1e3, parseArrays: !0, plainObjects: !1, strictDepth: !1, strictNullHandling: !1 }, a = function(p) {
10167
10196
  return p.replace(/&#(\d+);/g, function(y, f) {
10168
10197
  return String.fromCharCode(parseInt(f, 10));
10169
10198
  });
@@ -10233,21 +10262,21 @@ function Au() {
10233
10262
  return f.allowSparse === !0 ? b : c.compact(b);
10234
10263
  }, Ir;
10235
10264
  }
10236
- function Iu() {
10237
- if (qi) return Tr;
10238
- qi = !0;
10239
- var c = xu(), e = Au(), t = no();
10240
- return Tr = { formats: t, parse: e, stringify: c }, Tr;
10241
- }
10242
10265
  function Tu() {
10243
- if (Hi) return mt;
10266
+ if (Hi) return Tr;
10244
10267
  Hi = !0;
10268
+ var c = Au(), e = Iu(), t = io();
10269
+ return Tr = { formats: t, parse: e, stringify: c }, Tr;
10270
+ }
10271
+ function Ou() {
10272
+ if (zi) return mt;
10273
+ zi = !0;
10245
10274
  var c = gt;
10246
10275
  function e() {
10247
10276
  this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;
10248
10277
  }
10249
10278
  var t = /^([a-z0-9.+-]+:)/i, r = /:[0-9]*$/, a = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, n = ["<", ">", '"', "`", " ", "\r", `
10250
- `, " "], i = ["{", "}", "|", "\\", "^", "`"].concat(n), o = ["'"].concat(i), s = ["%", "/", "?", ";", "#"].concat(o), l = ["/", "?", "#"], u = 255, d = /^[+a-z0-9A-Z_-]{0,63}$/, p = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, y = { javascript: !0, "javascript:": !0 }, f = { javascript: !0, "javascript:": !0 }, m = { http: !0, https: !0, ftp: !0, gopher: !0, file: !0, "http:": !0, "https:": !0, "ftp:": !0, "gopher:": !0, "file:": !0 }, b = Iu();
10279
+ `, " "], i = ["{", "}", "|", "\\", "^", "`"].concat(n), o = ["'"].concat(i), s = ["%", "/", "?", ";", "#"].concat(o), l = ["/", "?", "#"], u = 255, d = /^[+a-z0-9A-Z_-]{0,63}$/, p = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, y = { javascript: !0, "javascript:": !0 }, f = { javascript: !0, "javascript:": !0 }, m = { http: !0, https: !0, ftp: !0, gopher: !0, file: !0, "http:": !0, "https:": !0, "ftp:": !0, "gopher:": !0, "file:": !0 }, b = Tu();
10251
10280
  function k(v, x, E) {
10252
10281
  if (v && typeof v == "object" && v instanceof e) return v;
10253
10282
  var I = new e();
@@ -10400,26 +10429,26 @@ function Tu() {
10400
10429
  x && (x = x[0], x !== ":" && (this.port = x.substr(1)), v = v.substr(0, v.length - x.length)), v && (this.hostname = v);
10401
10430
  }, mt.parse = k, mt.resolve = _, mt.resolveObject = S, mt.format = g, mt.Url = e, mt;
10402
10431
  }
10403
- function Na(c) {
10432
+ function Ba(c) {
10404
10433
  if (typeof c == "string") c = new URL(c);
10405
10434
  else if (!(c instanceof URL)) throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");
10406
10435
  if (c.protocol !== "file:") throw new Deno.errors.InvalidData("invalid url scheme");
10407
- return Cr ? Ou(c) : Cu(c);
10436
+ return Pr ? Cu(c) : Pu(c);
10408
10437
  }
10409
- function Ou(c) {
10438
+ function Cu(c) {
10410
10439
  let e = c.hostname, t = c.pathname;
10411
10440
  for (let r = 0; r < t.length; r++) if (t[r] === "%") {
10412
10441
  let a = t.codePointAt(r + 2) || 32;
10413
10442
  if (t[r + 1] === "2" && a === 102 || t[r + 1] === "5" && a === 99) throw new Deno.errors.InvalidData("must not include encoded \\ or / characters");
10414
10443
  }
10415
- if (t = t.replace(Ya, "\\"), t = decodeURIComponent(t), e !== "") return `\\\\${e}${t}`;
10444
+ if (t = t.replace(Ja, "\\"), t = decodeURIComponent(t), e !== "") return `\\\\${e}${t}`;
10416
10445
  {
10417
10446
  let r = t.codePointAt(1) | 32, a = t[2];
10418
- if (r < Va || r > Ga || a !== ":") throw new Deno.errors.InvalidData("file url path must be absolute");
10447
+ if (r < Ya || r > Qa || a !== ":") throw new Deno.errors.InvalidData("file url path must be absolute");
10419
10448
  return t.slice(1);
10420
10449
  }
10421
10450
  }
10422
- function Cu(c) {
10451
+ function Pu(c) {
10423
10452
  if (c.hostname !== "") throw new Deno.errors.InvalidData("invalid file url hostname");
10424
10453
  let e = c.pathname;
10425
10454
  for (let t = 0; t < e.length; t++) if (e[t] === "%") {
@@ -10428,20 +10457,20 @@ function Cu(c) {
10428
10457
  }
10429
10458
  return decodeURIComponent(e);
10430
10459
  }
10431
- function Ua(c) {
10432
- let e = Ni.resolve(c), t = c.charCodeAt(c.length - 1);
10433
- (t === Ka || Cr && t === za) && e[e.length - 1] !== Ni.sep && (e += "/");
10460
+ function Fa(c) {
10461
+ let e = Ui.resolve(c), t = c.charCodeAt(c.length - 1);
10462
+ (t === Ga || Pr && t === Va) && e[e.length - 1] !== Ui.sep && (e += "/");
10434
10463
  let r = new URL("file://");
10435
- return e.includes("%") && (e = e.replace(Qa, "%25")), !Cr && e.includes("\\") && (e = e.replace(Ja, "%5C")), e.includes(`
10436
- `) && (e = e.replace(Xa, "%0A")), e.includes("\r") && (e = e.replace(Za, "%0D")), e.includes(" ") && (e = e.replace(el, "%09")), r.pathname = e, r;
10464
+ return e.includes("%") && (e = e.replace(Xa, "%25")), !Pr && e.includes("\\") && (e = e.replace(Za, "%5C")), e.includes(`
10465
+ `) && (e = e.replace(el, "%0A")), e.includes("\r") && (e = e.replace(tl, "%0D")), e.includes(" ") && (e = e.replace(rl, "%09")), r.pathname = e, r;
10437
10466
  }
10438
- var Ba, _r, Ui, kr, Sr, Bi, Er, Fi, xr, Di, Ar, $i, Ir, Wi, Tr, qi, mt, Hi, De, bs, Fa, Da, $a, Wa, qa, Ha, za, Ka, Va, Ga, Cr, Ya, Qa, Ja, Xa, Za, el, Pu = He(() => {
10439
- le(), ue(), ce(), Gc(), uu(), ku(), Ra(), Ba = Object.freeze(/* @__PURE__ */ Object.create(null)), _r = {}, Ui = !1, kr = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : global, Sr = {}, Bi = !1, Er = {}, Fi = !1, xr = {}, Di = !1, Ar = {}, $i = !1, Ir = {}, Wi = !1, Tr = {}, qi = !1, mt = {}, Hi = !1, De = Tu(), De.parse, De.resolve, De.resolveObject, De.format, De.Url, bs = typeof Deno < "u" ? Deno.build.os === "windows" ? "win32" : Deno.build.os : void 0, De.URL = typeof URL < "u" ? URL : null, De.pathToFileURL = Ua, De.fileURLToPath = Na, Fa = De.Url, Da = De.format, $a = De.resolve, Wa = De.resolveObject, qa = De.parse, Ha = De.URL, za = 92, Ka = 47, Va = 97, Ga = 122, Cr = bs === "win32", Ya = /\//g, Qa = /%/g, Ja = /\\/g, Xa = /\n/g, Za = /\r/g, el = /\t/g;
10440
- }), Mu = pe((c, e) => {
10467
+ var Da, _r, Bi, kr, Sr, Fi, Er, Di, xr, $i, Ar, Wi, Ir, qi, Tr, Hi, mt, zi, De, ys, $a, Wa, qa, Ha, za, Ka, Va, Ga, Ya, Qa, Pr, Ja, Xa, Za, el, tl, rl, Mu = He(() => {
10468
+ le(), ue(), ce(), Yc(), hu(), Su(), La(), Da = Object.freeze(/* @__PURE__ */ Object.create(null)), _r = {}, Bi = !1, kr = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : global, Sr = {}, Fi = !1, Er = {}, Di = !1, xr = {}, $i = !1, Ar = {}, Wi = !1, Ir = {}, qi = !1, Tr = {}, Hi = !1, mt = {}, zi = !1, De = Ou(), De.parse, De.resolve, De.resolveObject, De.format, De.Url, ys = typeof Deno < "u" ? Deno.build.os === "windows" ? "win32" : Deno.build.os : void 0, De.URL = typeof URL < "u" ? URL : null, De.pathToFileURL = Fa, De.fileURLToPath = Ba, $a = De.Url, Wa = De.format, qa = De.resolve, Ha = De.resolveObject, za = De.parse, Ka = De.URL, Va = 92, Ga = 47, Ya = 97, Qa = 122, Pr = ys === "win32", Ja = /\//g, Xa = /%/g, Za = /\\/g, el = /\n/g, tl = /\r/g, rl = /\t/g;
10469
+ }), Ru = pe((c, e) => {
10441
10470
  le(), ue(), ce(), e.exports = function() {
10442
10471
  throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object");
10443
10472
  };
10444
- }), io = pe((c) => {
10473
+ }), oo = pe((c) => {
10445
10474
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 }), c.BufferedDuplex = void 0, c.writev = r;
10446
10475
  var e = It(), t = (Ne(), Ce(Le));
10447
10476
  function r(n, i) {
@@ -10491,7 +10520,7 @@ var Ba, _r, Ui, kr, Sr, Bi, Er, Fi, xr, Di, Ar, $i, Ir, Wi, Tr, qi, mt, Hi, De,
10491
10520
  return k && k.__esModule ? k : { default: k };
10492
10521
  };
10493
10522
  Object.defineProperty(c, "__esModule", { value: !0 }), c.streamBuilder = c.browserStreamBuilder = void 0;
10494
- var t = (Ne(), Ce(Le)), r = e(Mu()), a = e(lt()), n = It(), i = e(Ur()), o = io(), s = (0, a.default)("mqttjs:ws"), l = ["rejectUnauthorized", "ca", "cert", "key", "pfx", "passphrase"];
10523
+ var t = (Ne(), Ce(Le)), r = e(Ru()), a = e(lt()), n = It(), i = e(Br()), o = oo(), s = (0, a.default)("mqttjs:ws"), l = ["rejectUnauthorized", "ca", "cert", "key", "pfx", "passphrase"];
10495
10524
  function u(k, g) {
10496
10525
  let _ = `${k.protocol}://${k.hostname}:${k.port}${k.path}`;
10497
10526
  return typeof k.transformWsUrl == "function" && (_ = k.transformWsUrl(_, k, g)), _;
@@ -10579,38 +10608,38 @@ var Ba, _r, Ui, kr, Sr, Bi, Er, Fi, xr, Di, Ar, $i, Ir, Wi, Tr, qi, mt, Hi, De,
10579
10608
  return _;
10580
10609
  };
10581
10610
  c.browserStreamBuilder = b;
10582
- }), oo = {};
10583
- Lt(oo, { Server: () => Me, Socket: () => Me, Stream: () => Me, _createServerHandle: () => Me, _normalizeArgs: () => Me, _setSimultaneousAccepts: () => Me, connect: () => Me, createConnection: () => Me, createServer: () => Me, default: () => tl, isIP: () => Me, isIPv4: () => Me, isIPv6: () => Me });
10611
+ }), so = {};
10612
+ Lt(so, { Server: () => Me, Socket: () => Me, Stream: () => Me, _createServerHandle: () => Me, _normalizeArgs: () => Me, _setSimultaneousAccepts: () => Me, connect: () => Me, createConnection: () => Me, createServer: () => Me, default: () => nl, isIP: () => Me, isIPv4: () => Me, isIPv6: () => Me });
10584
10613
  function Me() {
10585
10614
  throw new Error("Node.js net module is not supported by JSPM core outside of Node.js");
10586
10615
  }
10587
- var tl, rl = He(() => {
10588
- le(), ue(), ce(), tl = { _createServerHandle: Me, _normalizeArgs: Me, _setSimultaneousAccepts: Me, connect: Me, createConnection: Me, createServer: Me, isIP: Me, isIPv4: Me, isIPv6: Me, Server: Me, Socket: Me, Stream: Me };
10589
- }), nl = pe((c, e) => {
10616
+ var nl, il = He(() => {
10617
+ le(), ue(), ce(), nl = { _createServerHandle: Me, _normalizeArgs: Me, _setSimultaneousAccepts: Me, connect: Me, createConnection: Me, createServer: Me, isIP: Me, isIPv4: Me, isIPv6: Me, Server: Me, Socket: Me, Stream: Me };
10618
+ }), ol = pe((c, e) => {
10590
10619
  le(), ue(), ce(), e.exports = {};
10591
- }), ys = pe((c) => {
10620
+ }), vs = pe((c) => {
10592
10621
  le(), ue(), ce();
10593
10622
  var e = c && c.__importDefault || function(o) {
10594
10623
  return o && o.__esModule ? o : { default: o };
10595
10624
  };
10596
10625
  Object.defineProperty(c, "__esModule", { value: !0 });
10597
- var t = e((rl(), Ce(oo))), r = e(lt()), a = e(nl()), n = (0, r.default)("mqttjs:tcp"), i = (o, s) => {
10626
+ var t = e((il(), Ce(so))), r = e(lt()), a = e(ol()), n = (0, r.default)("mqttjs:tcp"), i = (o, s) => {
10598
10627
  if (s.port = s.port || 1883, s.hostname = s.hostname || s.host || "localhost", s.socksProxy) return (0, a.default)(s.hostname, s.port, s.socksProxy, { timeout: s.socksTimeout });
10599
10628
  let { port: l, path: u } = s, d = s.hostname;
10600
10629
  return n("port %d and host %s", l, d), t.default.createConnection({ port: l, host: d, path: u });
10601
10630
  };
10602
10631
  c.default = i;
10603
- }), il = {};
10604
- Lt(il, { default: () => ol });
10605
- var ol, Ru = He(() => {
10606
- le(), ue(), ce(), ol = {};
10607
- }), vs = pe((c) => {
10632
+ }), sl = {};
10633
+ Lt(sl, { default: () => al });
10634
+ var al, ju = He(() => {
10635
+ le(), ue(), ce(), al = {};
10636
+ }), ws = pe((c) => {
10608
10637
  le(), ue(), ce();
10609
10638
  var e = c && c.__importDefault || function(l) {
10610
10639
  return l && l.__esModule ? l : { default: l };
10611
10640
  };
10612
10641
  Object.defineProperty(c, "__esModule", { value: !0 });
10613
- var t = (Ru(), Ce(il)), r = e((rl(), Ce(oo))), a = e(lt()), n = e(nl()), i = (0, a.default)("mqttjs:tls");
10642
+ var t = (ju(), Ce(sl)), r = e((il(), Ce(so))), a = e(lt()), n = e(ol()), i = (0, a.default)("mqttjs:tls");
10614
10643
  function o(l) {
10615
10644
  let { host: u, port: d, socksProxy: p, ...y } = l;
10616
10645
  if (p !== void 0) {
@@ -10631,9 +10660,9 @@ var ol, Ru = He(() => {
10631
10660
  return d.on("error", p), d;
10632
10661
  };
10633
10662
  c.default = s;
10634
- }), ws = pe((c) => {
10663
+ }), _s = pe((c) => {
10635
10664
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 });
10636
- var e = (Ne(), Ce(Le)), t = It(), r = io(), a, n, i;
10665
+ var e = (Ne(), Ce(Le)), t = It(), r = oo(), a, n, i;
10637
10666
  function o() {
10638
10667
  let p = new t.Transform();
10639
10668
  return p._write = (y, f, m) => {
@@ -10686,9 +10715,9 @@ var ol, Ru = He(() => {
10686
10715
  }, 0), i), u(), i;
10687
10716
  };
10688
10717
  c.default = d;
10689
- }), _s = pe((c) => {
10718
+ }), ks = pe((c) => {
10690
10719
  le(), ue(), ce(), Object.defineProperty(c, "__esModule", { value: !0 });
10691
- var e = (Ne(), Ce(Le)), t = It(), r = io(), a, n, i, o = !1;
10720
+ var e = (Ne(), Ce(Le)), t = It(), r = oo(), a, n, i, o = !1;
10692
10721
  function s() {
10693
10722
  let y = new t.Transform();
10694
10723
  return y._write = (f, m, b) => {
@@ -10741,13 +10770,13 @@ var ol, Ru = He(() => {
10741
10770
  return a = f.my, a.connectSocket({ url: b, protocols: m }), n = s(), i = new r.BufferedDuplex(f, n, a), d(), i;
10742
10771
  };
10743
10772
  c.default = p;
10744
- }), ju = pe((c) => {
10773
+ }), Lu = pe((c) => {
10745
10774
  le(), ue(), ce();
10746
10775
  var e = c && c.__importDefault || function(d) {
10747
10776
  return d && d.__esModule ? d : { default: d };
10748
10777
  };
10749
10778
  Object.defineProperty(c, "__esModule", { value: !0 }), c.connectAsync = u;
10750
- var t = e(lt()), r = e((Pu(), Ce(ja))), a = e(ni()), n = e(Ur());
10779
+ var t = e(lt()), r = e((Mu(), Ce(Na))), a = e(ii()), n = e(Br());
10751
10780
  typeof Pe?.nextTick != "function" && (Pe.nextTick = setImmediate);
10752
10781
  var i = (0, t.default)("mqttjs"), o = null;
10753
10782
  function s(d) {
@@ -10781,7 +10810,7 @@ var ol, Ru = He(() => {
10781
10810
  throw new Error(`Unknown protocol for secure connection: "${p.protocol}"!`);
10782
10811
  }
10783
10812
  } else throw new Error("Missing secure protocol key");
10784
- if (o || (o = {}, !n.default && !p.forceNativeWebSocket ? (o.ws = tr().streamBuilder, o.wss = tr().streamBuilder, o.mqtt = ys().default, o.tcp = ys().default, o.ssl = vs().default, o.tls = o.ssl, o.mqtts = vs().default) : (o.ws = tr().browserStreamBuilder, o.wss = tr().browserStreamBuilder, o.wx = ws().default, o.wxs = ws().default, o.ali = _s().default, o.alis = _s().default)), !o[p.protocol]) {
10813
+ if (o || (o = {}, !n.default && !p.forceNativeWebSocket ? (o.ws = tr().streamBuilder, o.wss = tr().streamBuilder, o.mqtt = vs().default, o.tcp = vs().default, o.ssl = ws().default, o.tls = o.ssl, o.mqtts = ws().default) : (o.ws = tr().browserStreamBuilder, o.wss = tr().browserStreamBuilder, o.wx = _s().default, o.wxs = _s().default, o.ali = ks().default, o.alis = ks().default)), !o[p.protocol]) {
10785
10814
  let m = ["mqtts", "wss"].indexOf(p.protocol) !== -1;
10786
10815
  p.protocol = ["mqtt", "mqtts", "ws", "wss", "wx", "wxs", "ali", "alis"].filter((b, k) => m && k % 2 === 0 ? !1 : typeof o[b] == "function")[0];
10787
10816
  }
@@ -10817,7 +10846,7 @@ var ol, Ru = He(() => {
10817
10846
  });
10818
10847
  }
10819
10848
  c.default = l;
10820
- }), ks = pe((c) => {
10849
+ }), Ss = pe((c) => {
10821
10850
  le(), ue(), ce();
10822
10851
  var e = c && c.__createBinding || (Object.create ? function(y, f, m, b) {
10823
10852
  b === void 0 && (b = m);
@@ -10851,25 +10880,25 @@ var ol, Ru = He(() => {
10851
10880
  return y && y.__esModule ? y : { default: y };
10852
10881
  };
10853
10882
  Object.defineProperty(c, "__esModule", { value: !0 }), c.ReasonCodes = c.KeepaliveManager = c.UniqueMessageIdProvider = c.DefaultMessageIdProvider = c.Store = c.MqttClient = c.connectAsync = c.connect = c.Client = void 0;
10854
- var i = n(ni());
10883
+ var i = n(ii());
10855
10884
  c.MqttClient = i.default;
10856
- var o = n(_a());
10885
+ var o = n(Sa());
10857
10886
  c.DefaultMessageIdProvider = o.default;
10858
- var s = n(Kc());
10887
+ var s = n(Vc());
10859
10888
  c.UniqueMessageIdProvider = s.default;
10860
- var l = n(ia());
10889
+ var l = n(sa());
10861
10890
  c.Store = l.default;
10862
- var u = r(ju());
10891
+ var u = r(Lu());
10863
10892
  c.connect = u.default, Object.defineProperty(c, "connectAsync", { enumerable: !0, get: function() {
10864
10893
  return u.connectAsync;
10865
10894
  } });
10866
- var d = n(Ta());
10867
- c.KeepaliveManager = d.default, c.Client = i.default, a(ni(), c), a(Ut(), c), a(na(), c);
10868
- var p = Lr();
10895
+ var d = n(Ca());
10896
+ c.KeepaliveManager = d.default, c.Client = i.default, a(ii(), c), a(Ut(), c), a(oa(), c);
10897
+ var p = Nr();
10869
10898
  Object.defineProperty(c, "ReasonCodes", { enumerable: !0, get: function() {
10870
10899
  return p.ReasonCodes;
10871
10900
  } });
10872
- }), Lu = pe((c) => {
10901
+ }), Nu = pe((c) => {
10873
10902
  le(), ue(), ce();
10874
10903
  var e = c && c.__createBinding || (Object.create ? function(i, o, s, l) {
10875
10904
  l === void 0 && (l = s);
@@ -10901,28 +10930,28 @@ var ol, Ru = He(() => {
10901
10930
  for (var s in i) s !== "default" && !Object.prototype.hasOwnProperty.call(o, s) && e(o, i, s);
10902
10931
  };
10903
10932
  Object.defineProperty(c, "__esModule", { value: !0 });
10904
- var n = r(ks());
10905
- c.default = n, a(ks(), c);
10933
+ var n = r(Ss());
10934
+ c.default = n, a(Ss(), c);
10906
10935
  });
10907
- const Nu = Lu();
10908
- const Uu = {
10936
+ const Uu = Nu();
10937
+ const Bu = {
10909
10938
  inbound: "apps/{appId}/users/{userId}/messages/{conversationId}/clientadded",
10910
10939
  inboundUpdate: "apps/{appId}/users/{userId}/messages/{conversationId}/{messageId}/update",
10911
10940
  outbound: "apps/{appId}/outgoing/users/{userId}/messages/{conversationId}/outgoing",
10912
10941
  presence: "apps/{appId}/users/{userId}/presence/{clientId}",
10913
10942
  wildcardSubscribe: "apps/{appId}/users/{userId}/#"
10914
- }, Bu = 300, Fu = {
10943
+ }, Fu = 300, Du = {
10915
10944
  templateId: "7",
10916
10945
  type: "link",
10917
10946
  isDeepLink: !0
10918
- }, Du = {
10947
+ }, $u = {
10919
10948
  channelType: "group",
10920
10949
  channel: "chat21",
10921
10950
  requestChannel: "chat21",
10922
10951
  platform: "WEBSITE",
10923
10952
  medium: "CHATBUDDY"
10924
10953
  };
10925
- class $u {
10954
+ class Wu {
10926
10955
  client = null;
10927
10956
  config;
10928
10957
  currentToken;
@@ -10941,7 +10970,7 @@ class $u {
10941
10970
  inboundRegex;
10942
10971
  inboundUpdateRegex;
10943
10972
  constructor(e) {
10944
- this.config = e, this.currentToken = e.jwtToken, this.appId = e.appId ?? "tilechat", this.clientId = e.clientId ?? `aikaara_${e.userId}_${Date.now()}`, this.topics = { ...Uu, ...e.topicTemplates ?? {} }, this.maxReconnectAttempts = e.maxReconnectAttempts ?? 10, this.reconnectMaxDelayMs = e.reconnectMaxDelayMs ?? 3e4, this.inboundRegex = this.buildTopicRegex(
10973
+ this.config = e, this.currentToken = e.jwtToken, this.appId = e.appId ?? "tilechat", this.clientId = e.clientId ?? `aikaara_${e.userId}_${Date.now()}`, this.topics = { ...Bu, ...e.topicTemplates ?? {} }, this.maxReconnectAttempts = e.maxReconnectAttempts ?? 10, this.reconnectMaxDelayMs = e.reconnectMaxDelayMs ?? 3e4, this.inboundRegex = this.buildTopicRegex(
10945
10974
  this.topics.inbound,
10946
10975
  ["conversationId"]
10947
10976
  ), this.inboundUpdateRegex = this.buildTopicRegex(
@@ -10971,7 +11000,7 @@ class $u {
10971
11000
  qos: 0,
10972
11001
  retain: !1
10973
11002
  }), new Promise((a, n) => {
10974
- this.client = Nu.connect(this.config.mqttEndpoint, r), this.client.on("connect", () => {
11003
+ this.client = Uu.connect(this.config.mqttEndpoint, r), this.client.on("connect", () => {
10975
11004
  if (this.reconnectAttempt = 0, this.debugLog("CONNECT", { endpoint: this.config.mqttEndpoint, clientId: this.clientId }), this.notifyStateChange(!0), this.config.enablePresence !== !1) {
10976
11005
  const i = this.config.presencePayloadConnected ?? { connected: !0 };
10977
11006
  this.client.publish(e, JSON.stringify(i), { qos: 0, retain: !1 }), this.debugLog("PUBLISH", { topic: e, payload: i });
@@ -11022,9 +11051,9 @@ class $u {
11022
11051
  publishFileMessage(e, t) {
11023
11052
  if (!this.client) return;
11024
11053
  const r = {
11025
- ...Fu,
11054
+ ...Du,
11026
11055
  ...this.config.fileTemplate ?? {},
11027
- ...Wu(t)
11056
+ ...qu(t)
11028
11057
  }, a = {
11029
11058
  metadata: {
11030
11059
  contentType: "300",
@@ -11063,7 +11092,7 @@ class $u {
11063
11092
  * Send a read receipt for a message. Tiledesk widgets publish
11064
11093
  * `{"status":300}` to apps/{appId}/users/{userId}/messages/{convId}/{msgId}/update.
11065
11094
  */
11066
- publishReadReceipt(e, t, r = Bu) {
11095
+ publishReadReceipt(e, t, r = Fu) {
11067
11096
  if (!this.client) return;
11068
11097
  const a = this.renderTemplate(this.topics.inboundUpdate, { conversationId: e, messageId: t });
11069
11098
  this.client.publish(a, JSON.stringify({ status: r }), {
@@ -11171,7 +11200,7 @@ class $u {
11171
11200
  this.messageHandlers.forEach((l) => l(a, s));
11172
11201
  }
11173
11202
  buildOutgoingEnvelope(e, t) {
11174
- const r = { ...Du, ...this.config.messageDefaults ?? {} }, a = this.config.senderFullname ?? this.config.userName ?? this.config.userId, n = this.config.recipientFullnameResolver?.(e), i = {
11203
+ const r = { ...$u, ...this.config.messageDefaults ?? {} }, a = this.config.senderFullname ?? this.config.userName ?? this.config.userId, n = this.config.recipientFullnameResolver?.(e), i = {
11175
11204
  projectId: this.config.projectId,
11176
11205
  ...r.departmentId ? { departmentId: r.departmentId } : {},
11177
11206
  ...this.config.userName ? { userFullname: this.config.userName } : {},
@@ -11245,20 +11274,20 @@ class $u {
11245
11274
  return new RegExp(`^${r}$`);
11246
11275
  }
11247
11276
  }
11248
- function Wu(c) {
11277
+ function qu(c) {
11249
11278
  const e = {};
11250
11279
  for (const [t, r] of Object.entries(c))
11251
11280
  r !== void 0 && (e[t] = r);
11252
11281
  return e;
11253
11282
  }
11254
- function qu(c, e) {
11283
+ function Hu(c, e) {
11255
11284
  return (c.sender ?? "").toString() === e;
11256
11285
  }
11257
- function Hu(c, e) {
11286
+ function zu(c, e) {
11258
11287
  const t = (c.sender ?? "").toString(), r = e.systemSenders ?? ["metadata", "system"], a = e.botSenderPrefix ?? "bot_";
11259
11288
  return t ? t === e.userId ? "user" : t.startsWith(a) ? "assistant" : r.includes(t) ? "system" : "agent" : "system";
11260
11289
  }
11261
- function sl(c) {
11290
+ function ll(c) {
11262
11291
  const e = { raw: c }, t = c.metadata;
11263
11292
  if (t && typeof t == "object" && (typeof t.contentType == "string" && (e.contentType = t.contentType), typeof t.templateId == "string" && (e.templateId = t.templateId), t.payload !== void 0 && (e.payload = t.payload)), typeof c.text == "string" && c.text.trim().startsWith("{"))
11264
11293
  try {
@@ -11275,8 +11304,8 @@ function sl(c) {
11275
11304
  }
11276
11305
  return e;
11277
11306
  }
11278
- function zu(c) {
11279
- const e = sl(c);
11307
+ function Ku(c) {
11308
+ const e = ll(c);
11280
11309
  if (e.contentType !== "300") return null;
11281
11310
  const t = e.payload, r = t && Array.isArray(t.elements) ? t.elements : null;
11282
11311
  if (!r || r.length === 0) return null;
@@ -11288,11 +11317,11 @@ function zu(c) {
11288
11317
  templateId: e.templateId
11289
11318
  };
11290
11319
  }
11291
- function Ss(c, e, t) {
11292
- const r = Hu(c, t), a = sl(c), n = zu(c);
11320
+ function Es(c, e, t) {
11321
+ const r = zu(c, t), a = ll(c), n = Ku(c);
11293
11322
  let i = "";
11294
11323
  a.innerMessage ? i = a.innerMessage : typeof c.text == "string" && (c.text.trim().startsWith("{") ? a.contentType !== "300" && (i = c.text) : i = c.text);
11295
- const o = typeof c.message_id == "string" ? c.message_id : `td_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`, s = typeof c.timestamp == "number" ? new Date(c.timestamp).toISOString() : (/* @__PURE__ */ new Date()).toISOString(), l = r === "assistant" ? "assistant" : r === "agent" ? "agent" : r === "system" ? "system" : "user", u = typeof c.status == "number" ? Ku(c.status) : "delivered", d = {
11324
+ const o = typeof c.message_id == "string" ? c.message_id : `td_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`, s = typeof c.timestamp == "number" ? new Date(c.timestamp).toISOString() : (/* @__PURE__ */ new Date()).toISOString(), l = r === "assistant" ? "assistant" : r === "agent" ? "agent" : r === "system" ? "system" : "user", u = typeof c.status == "number" ? Vu(c.status) : "delivered", d = {
11296
11325
  id: o,
11297
11326
  externalId: o,
11298
11327
  conversationId: e,
@@ -11319,10 +11348,10 @@ function Ss(c, e, t) {
11319
11348
  }
11320
11349
  ]), { message: d, template: a };
11321
11350
  }
11322
- function Ku(c) {
11351
+ function Vu(c) {
11323
11352
  return c < 0 ? "error" : c >= 250 ? "read" : c >= 150 ? "delivered" : "sent";
11324
11353
  }
11325
- class Vu extends Ts {
11354
+ class Gu extends Os {
11326
11355
  connection = null;
11327
11356
  tiledesk = null;
11328
11357
  api;
@@ -11335,7 +11364,7 @@ class Vu extends Ts {
11335
11364
  historyAdapter;
11336
11365
  tiledeskUnsubs = [];
11337
11366
  constructor(e, t) {
11338
- super(), this.config = e, this.mode = e.transport ?? "aikaara", this.uploadAdapter = t?.uploadAdapter ?? null, this.historyAdapter = t?.historyAdapter ?? null, this.api = new xl(e.baseUrl, e.userToken, e.apiKey, e.authToken), this.messageStore = new Al(), this.conversationManager = new Tl(e.conversationId), this.usesAikaara() && (this.connection = new El(e), this.connection.on("connection:state", (r) => {
11367
+ super(), this.config = e, this.mode = e.transport ?? "aikaara", this.uploadAdapter = t?.uploadAdapter ?? null, this.historyAdapter = t?.historyAdapter ?? null, this.api = new Il(e.baseUrl, e.userToken, e.apiKey, e.authToken), this.messageStore = new Tl(), this.conversationManager = new Ol(e.conversationId), this.usesAikaara() && (this.connection = new Al(e), this.connection.on("connection:state", (r) => {
11339
11368
  this.emit("connection:state", r), this.config.onConnectionStateChange?.(r);
11340
11369
  }), this.connection.on("error", (r) => {
11341
11370
  this.emit("error", r), this.config.onError?.(r);
@@ -11353,7 +11382,7 @@ class Vu extends Ts {
11353
11382
  throw new Error("AikaaraChatClient: tiledesk transport requires `config.tiledesk` (TiledeskTransportConfig)");
11354
11383
  if (!t?.userId)
11355
11384
  throw new Error("AikaaraChatClient: tiledesk transport requires `config.tiledeskIdentity.userId`");
11356
- this.tiledesk = new $u({
11385
+ this.tiledesk = new Wu({
11357
11386
  ...e,
11358
11387
  userId: t.userId,
11359
11388
  userName: t.userName ?? e.userName,
@@ -11412,7 +11441,7 @@ class Vu extends Ts {
11412
11441
  return this.config.onError?.(o instanceof Error ? o : new Error(String(o))), "unknown";
11413
11442
  }
11414
11443
  if (!r.length) return "empty";
11415
- const a = r.map((o) => Ss(o, e, { userId: t }).message).sort((o, s) => new Date(o.createdAt).getTime() - new Date(s.createdAt).getTime()), n = this.messageStore.messages, i = [...a, ...n.filter((o) => !a.some((s) => s.externalId && s.externalId === o.externalId))];
11444
+ const a = r.map((o) => Es(o, e, { userId: t }).message).sort((o, s) => new Date(o.createdAt).getTime() - new Date(s.createdAt).getTime()), n = this.messageStore.messages, i = [...a, ...n.filter((o) => !a.some((s) => s.externalId && s.externalId === o.externalId))];
11416
11445
  if (this.messageStore.setMessages(i), this.config.onMessage)
11417
11446
  for (const o of a)
11418
11447
  try {
@@ -11543,12 +11572,12 @@ class Vu extends Ts {
11543
11572
  if (t.kind === "update") return;
11544
11573
  const r = t.conversationId ?? this.conversationManager.conversationId;
11545
11574
  if (!r) return;
11546
- const a = this.config.tiledeskIdentity?.userId ?? "", { message: n, template: i } = Ss(e, r, {
11575
+ const a = this.config.tiledeskIdentity?.userId ?? "", { message: n, template: i } = Es(e, r, {
11547
11576
  userId: a,
11548
11577
  systemSenders: this.config.tiledesk?.messageDefaults?.attributes?.systemSenders
11549
11578
  });
11550
11579
  if (this.mode === "dual" && n.role === "assistant") return;
11551
- if (qu(e, a)) {
11580
+ if (Hu(e, a)) {
11552
11581
  const l = this.messageStore.reconcileOptimistic(n);
11553
11582
  if (l) {
11554
11583
  this.emit("message:updated", l);
@@ -11556,7 +11585,26 @@ class Vu extends Ts {
11556
11585
  }
11557
11586
  }
11558
11587
  const { message: o, deduped: s } = this.messageStore.upsertRemoteMessage(n);
11559
- if (s ? this.emit("message:updated", o) : (this.emit("message:received", o), this.config.onMessage?.(o)), i.contentType) {
11588
+ if (s)
11589
+ this.emit("message:updated", o);
11590
+ else {
11591
+ this.emit("message:received", o), this.config.onMessage?.(o);
11592
+ try {
11593
+ typeof window < "u" && window.dispatchEvent(
11594
+ new CustomEvent("aikaara:message", {
11595
+ detail: {
11596
+ role: o.role,
11597
+ hasAttachments: Array.isArray(o.attachments) && o.attachments.length > 0,
11598
+ templateId: o.template?.templateId,
11599
+ messageId: o.id,
11600
+ conversationId: o.conversationId
11601
+ }
11602
+ })
11603
+ );
11604
+ } catch {
11605
+ }
11606
+ }
11607
+ if (i.contentType) {
11560
11608
  const l = {
11561
11609
  messageId: o.id,
11562
11610
  conversationId: r,
@@ -11657,7 +11705,7 @@ class Vu extends Ts {
11657
11705
  }
11658
11706
  }
11659
11707
  }
11660
- const Es = {
11708
+ const xs = {
11661
11709
  txt: "text/plain",
11662
11710
  pdf: "application/pdf",
11663
11711
  jpg: "image/jpeg",
@@ -11667,20 +11715,20 @@ const Es = {
11667
11715
  doc: "application/msword",
11668
11716
  json: "application/json"
11669
11717
  };
11670
- function Gu(c) {
11718
+ function Yu(c) {
11671
11719
  const e = c.lastIndexOf(".");
11672
11720
  return e < 0 || e === c.length - 1 ? "" : c.slice(e + 1).toLowerCase();
11673
11721
  }
11674
- function Yu(c, e, t) {
11675
- const r = Gu(c.name || "");
11722
+ function Qu(c, e, t) {
11723
+ const r = Yu(c.name || "");
11676
11724
  if (r && e && e[r]) return e[r];
11677
11725
  const a = c.type;
11678
- return a && a.trim().length > 0 ? a : r && Es[r] ? Es[r] : t;
11726
+ return a && a.trim().length > 0 ? a : r && xs[r] ? xs[r] : t;
11679
11727
  }
11680
- function Wr(c, e) {
11728
+ function qr(c, e) {
11681
11729
  return c.replace(/\{(\w+)\}/g, (t, r) => e[r] ?? "");
11682
11730
  }
11683
- function Qu(c, e) {
11731
+ function Ju(c, e) {
11684
11732
  const t = e.split(".");
11685
11733
  let r = c;
11686
11734
  for (const a of t)
@@ -11689,7 +11737,7 @@ function Qu(c, e) {
11689
11737
  else return "";
11690
11738
  return typeof r == "string" ? r : "";
11691
11739
  }
11692
- function Ju(c) {
11740
+ function Xu(c) {
11693
11741
  const e = c.signedUrlPath ?? "data.s3SignedUrl";
11694
11742
  return {
11695
11743
  async upload(t, r) {
@@ -11702,7 +11750,7 @@ function Ju(c) {
11702
11750
  accept: "application/json",
11703
11751
  ...c.extraHeaders ?? {},
11704
11752
  ...i ? { authorization: i } : {}
11705
- }, s = Wr(
11753
+ }, s = qr(
11706
11754
  c.signEndpoint.includes("{") ? c.signEndpoint : `${c.signEndpoint}?fileName={fileName}`,
11707
11755
  n
11708
11756
  ), l = await fetch(s, {
@@ -11711,9 +11759,9 @@ function Ju(c) {
11711
11759
  });
11712
11760
  if (!l.ok)
11713
11761
  throw new Error(`Sign request failed: ${l.status}`);
11714
- const u = await l.json().catch(() => ({})), d = Qu(u, e);
11762
+ const u = await l.json().catch(() => ({})), d = Ju(u, e);
11715
11763
  if (!d) throw new Error(`Sign response missing path "${e}"`);
11716
- const p = Yu(
11764
+ const p = Qu(
11717
11765
  t,
11718
11766
  c.contentTypeMap,
11719
11767
  c.contentTypeFallback ?? "application/octet-stream"
@@ -11728,7 +11776,7 @@ function Ju(c) {
11728
11776
  }
11729
11777
  if (c.registerEndpoint) {
11730
11778
  const b = JSON.parse(
11731
- Wr(JSON.stringify(c.registerBody ?? {}), n)
11779
+ qr(JSON.stringify(c.registerBody ?? {}), n)
11732
11780
  ), k = await fetch(c.registerEndpoint, {
11733
11781
  method: "POST",
11734
11782
  headers: { ...o, "content-type": "application/json" },
@@ -11740,7 +11788,7 @@ function Ju(c) {
11740
11788
  }
11741
11789
  }
11742
11790
  return {
11743
- url: c.viewerTemplate ? Wr(c.viewerTemplate, n) : d.split("?")[0],
11791
+ url: c.viewerTemplate ? qr(c.viewerTemplate, n) : d.split("?")[0],
11744
11792
  fileName: a,
11745
11793
  contentType: p,
11746
11794
  byteSize: t.size,
@@ -11749,7 +11797,7 @@ function Ju(c) {
11749
11797
  }
11750
11798
  };
11751
11799
  }
11752
- function al(c) {
11800
+ function cl(c) {
11753
11801
  return {
11754
11802
  async upload(e, t) {
11755
11803
  const r = new FormData(), a = c.fieldName ?? "file";
@@ -11782,9 +11830,9 @@ function al(c) {
11782
11830
  }
11783
11831
  };
11784
11832
  }
11785
- const Xu = "/tilechat/{userId}/conversations/{conversationId}/messages?pageSize={pageSize}";
11786
- function Zu(c) {
11787
- const e = c.apiBase.replace(/\/$/, ""), t = c.pageSize ?? 200, r = c.pathTemplate ?? Xu;
11833
+ const Zu = "/tilechat/{userId}/conversations/{conversationId}/messages?pageSize={pageSize}";
11834
+ function eh(c) {
11835
+ const e = c.apiBase.replace(/\/$/, ""), t = c.pageSize ?? 200, r = c.pathTemplate ?? Zu;
11788
11836
  return {
11789
11837
  async fetchMessages(a, n) {
11790
11838
  const i = r.replace("{userId}", encodeURIComponent(n.userId)).replace("{conversationId}", encodeURIComponent(a)).replace("{appId}", encodeURIComponent(n.appId ?? "tilechat")).replace("{projectId}", encodeURIComponent(n.projectId ?? "")).replace("{pageSize}", String(t)), o = i.startsWith("http") ? i : `${e}${i.startsWith("/") ? i : `/${i}`}`, s = {
@@ -11808,7 +11856,7 @@ function Zu(c) {
11808
11856
  }
11809
11857
  };
11810
11858
  }
11811
- class eh {
11859
+ class th {
11812
11860
  client;
11813
11861
  panel;
11814
11862
  bubble;
@@ -11819,7 +11867,7 @@ class eh {
11819
11867
  isOpen = !1;
11820
11868
  isEmbed = !1;
11821
11869
  constructor(e, t, r) {
11822
- this.client = new Vu(e, {
11870
+ this.client = new Gu(e, {
11823
11871
  uploadAdapter: r?.uploadAdapter,
11824
11872
  historyAdapter: r?.historyAdapter
11825
11873
  }), this.isEmbed = e.display === "embed", this.bubble = t.querySelector("aikaara-chat-bubble"), this.panel = t.querySelector(".aikaara-panel"), this.header = t.querySelector("aikaara-chat-header"), this.messageList = t.querySelector("aikaara-message-list"), this.input = t.querySelector("aikaara-chat-input"), this.errorBanner = t.querySelector("aikaara-error-banner"), e.welcomeMessage && this.messageList.setWelcomeMessage(e.welcomeMessage), e.showTimestamps !== void 0 && this.messageList.setShowTimestamps(e.showTimestamps), (e.linkHandlers || e.getLinkBearer) && this.messageList.setLinkConfig(e.linkHandlers ?? [], e.getLinkBearer), this.wireEvents();
@@ -11910,7 +11958,7 @@ class eh {
11910
11958
  }, 200)));
11911
11959
  }
11912
11960
  }
11913
- class th extends HTMLElement {
11961
+ class rh extends HTMLElement {
11914
11962
  shadow;
11915
11963
  controller = null;
11916
11964
  _config = {};
@@ -11956,14 +12004,14 @@ class th extends HTMLElement {
11956
12004
  apiKey: this.getAttribute("api-key") || this._config.apiKey,
11957
12005
  title: this.getAttribute("title") || this._config.title || "Chat",
11958
12006
  subtitle: this.getAttribute("subtitle") || this._config.subtitle,
11959
- theme: this.getAttribute("theme") || this._config.theme || kl,
11960
- primaryColor: this.getAttribute("primary-color") || this._config.primaryColor || lo,
11961
- position: this.getAttribute("position") || this._config.position || _l,
11962
- width: Number(this.getAttribute("width")) || this._config.width || bl,
11963
- height: Number(this.getAttribute("height")) || this._config.height || yl,
11964
- fontFamily: this._config.fontFamily || wl,
11965
- borderRadius: this._config.borderRadius ?? vl,
11966
- placeholder: this.getAttribute("placeholder") || this._config.placeholder || co,
12007
+ theme: this.getAttribute("theme") || this._config.theme || El,
12008
+ primaryColor: this.getAttribute("primary-color") || this._config.primaryColor || co,
12009
+ position: this.getAttribute("position") || this._config.position || Sl,
12010
+ width: Number(this.getAttribute("width")) || this._config.width || vl,
12011
+ height: Number(this.getAttribute("height")) || this._config.height || wl,
12012
+ fontFamily: this._config.fontFamily || kl,
12013
+ borderRadius: this._config.borderRadius ?? _l,
12014
+ placeholder: this.getAttribute("placeholder") || this._config.placeholder || uo,
11967
12015
  welcomeMessage: this.getAttribute("welcome-message") || this._config.welcomeMessage,
11968
12016
  avatarUrl: this.getAttribute("avatar-url") || this._config.avatarUrl,
11969
12017
  showTimestamps: this._config.showTimestamps ?? !0,
@@ -11975,7 +12023,7 @@ class th extends HTMLElement {
11975
12023
  templateLayout: this._config.templateLayout,
11976
12024
  showBubble: this._config.showBubble ?? !0,
11977
12025
  display: (this.getAttribute("display") || this._config.display) ?? "popup",
11978
- offset: this._config.offset || Sl,
12026
+ offset: this._config.offset || xl,
11979
12027
  conversationId: this._config.conversationId,
11980
12028
  systemPromptId: this._config.systemPromptId,
11981
12029
  channel: this._config.channel,
@@ -12090,7 +12138,7 @@ class th extends HTMLElement {
12090
12138
  <style>
12091
12139
  :host {
12092
12140
  --aikaara-primary: ${e.primaryColor};
12093
- --aikaara-primary-hover: ${this.darkenColor(e.primaryColor || lo)};
12141
+ --aikaara-primary-hover: ${this.darkenColor(e.primaryColor || co)};
12094
12142
  /* Cascade through descriptor.theme.surface / surfaceMuted /
12095
12143
  * text / textMuted / border when those are present (themeVars
12096
12144
  * sets the canonical token below). When the descriptor doesn't
@@ -12161,7 +12209,7 @@ class th extends HTMLElement {
12161
12209
  ></aikaara-chat-header>`}
12162
12210
  <aikaara-message-list></aikaara-message-list>
12163
12211
  <aikaara-chat-input
12164
- placeholder="${e.placeholder || co}"
12212
+ placeholder="${e.placeholder || uo}"
12165
12213
  ${this._config.uploadAdapter ? "" : "disable-attach"}
12166
12214
  ${e.input?.attachPosition === "right" ? 'attach-position="right"' : ""}
12167
12215
  ${e.input?.sendButtonShape === "square" ? 'send-shape="square"' : ""}
@@ -12178,7 +12226,7 @@ class th extends HTMLElement {
12178
12226
  }
12179
12227
  async initController() {
12180
12228
  const e = this.getConfig(), t = e.transport ?? "aikaara";
12181
- (t === "aikaara" || t === "dual") && (!e.baseUrl || !e.userToken) || (this.controller?.disconnect(), this.controller = new eh(e, this.shadow, {
12229
+ (t === "aikaara" || t === "dual") && (!e.baseUrl || !e.userToken) || (this.controller?.disconnect(), this.controller = new th(e, this.shadow, {
12182
12230
  uploadAdapter: this._config.uploadAdapter,
12183
12231
  historyAdapter: this._config.historyAdapter
12184
12232
  }), await this.controller.connect());
@@ -12198,7 +12246,7 @@ class th extends HTMLElement {
12198
12246
  }
12199
12247
  }
12200
12248
  }
12201
- class rh extends HTMLElement {
12249
+ class nh extends HTMLElement {
12202
12250
  shadow;
12203
12251
  constructor() {
12204
12252
  super(), this.shadow = this.attachShadow({ mode: "open" });
@@ -12251,7 +12299,7 @@ class rh extends HTMLElement {
12251
12299
  t && (t.innerHTML = e);
12252
12300
  }
12253
12301
  }
12254
- class nh extends HTMLElement {
12302
+ class ih extends HTMLElement {
12255
12303
  shadow;
12256
12304
  static get observedAttributes() {
12257
12305
  return ["title", "subtitle", "avatar-url", "status"];
@@ -12372,17 +12420,17 @@ class nh extends HTMLElement {
12372
12420
  this.setAttribute("status", e);
12373
12421
  }
12374
12422
  }
12375
- const ih = /<\s*(br|i|b|em|strong|small|sub|sup|p|div|span|ul|ol|li|a|img|code|pre)\b/i;
12423
+ const oh = /<\s*(br|i|b|em|strong|small|sub|sup|p|div|span|ul|ol|li|a|img|code|pre)\b/i;
12376
12424
  function Rt(c) {
12377
- if (ih.test(c))
12425
+ if (oh.test(c))
12378
12426
  return c;
12379
- let e = oh(c);
12427
+ let e = sh(c);
12380
12428
  return e = e.replace(/```(\w*)\n([\s\S]*?)```/g, (t, r, a) => `<pre><code>${a.trim()}</code></pre>`), e = e.replace(/`([^`]+)`/g, "<code>$1</code>"), e = e.replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/\*(.+?)\*/g, "<em>$1</em>"), e = e.replace(
12381
12429
  /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
12382
12430
  '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'
12383
12431
  ), e = e.replace(/\n/g, "<br>"), e;
12384
12432
  }
12385
- function oh(c) {
12433
+ function sh(c) {
12386
12434
  const e = {
12387
12435
  "&": "&amp;",
12388
12436
  "<": "&lt;",
@@ -12392,7 +12440,7 @@ function oh(c) {
12392
12440
  };
12393
12441
  return c.replace(/[&<>"']/g, (t) => e[t]);
12394
12442
  }
12395
- const sh = /* @__PURE__ */ new Set([
12443
+ const ah = /* @__PURE__ */ new Set([
12396
12444
  "p",
12397
12445
  "br",
12398
12446
  "hr",
@@ -12427,7 +12475,7 @@ const sh = /* @__PURE__ */ new Set([
12427
12475
  "tr",
12428
12476
  "th",
12429
12477
  "td"
12430
- ]), ah = {
12478
+ ]), lh = {
12431
12479
  a: /* @__PURE__ */ new Set(["href", "target", "rel"]),
12432
12480
  img: /* @__PURE__ */ new Set(["src", "alt", "width", "height"]),
12433
12481
  code: /* @__PURE__ */ new Set(["class"]),
@@ -12437,51 +12485,29 @@ const sh = /* @__PURE__ */ new Set([
12437
12485
  };
12438
12486
  function jt(c) {
12439
12487
  const e = document.createElement("template");
12440
- return e.innerHTML = c, ll(e.content), e.innerHTML;
12488
+ return e.innerHTML = c, ul(e.content), e.innerHTML;
12441
12489
  }
12442
- function ll(c) {
12490
+ function ul(c) {
12443
12491
  const e = Array.from(c.childNodes);
12444
12492
  for (const t of e)
12445
12493
  if (t.nodeType === Node.ELEMENT_NODE) {
12446
12494
  const r = t, a = r.tagName.toLowerCase();
12447
- if (!sh.has(a)) {
12495
+ if (!ah.has(a)) {
12448
12496
  const o = document.createTextNode(r.textContent || "");
12449
12497
  c.replaceChild(o, t);
12450
12498
  continue;
12451
12499
  }
12452
- const n = ah[a] || /* @__PURE__ */ new Set(), i = Array.from(r.attributes);
12500
+ const n = lh[a] || /* @__PURE__ */ new Set(), i = Array.from(r.attributes);
12453
12501
  for (const o of i)
12454
12502
  n.has(o.name) || r.removeAttribute(o.name);
12455
12503
  if (r.hasAttribute("href")) {
12456
12504
  const o = r.getAttribute("href") || "";
12457
12505
  !o.startsWith("http://") && !o.startsWith("https://") && !o.startsWith("/") && r.removeAttribute("href");
12458
12506
  }
12459
- ll(t);
12507
+ ul(t);
12460
12508
  }
12461
12509
  }
12462
- function lh(c) {
12463
- const e = ch(c);
12464
- return e == null ? !1 : !e.includes("cloudFileId=");
12465
- }
12466
12510
  function ch(c) {
12467
- const e = c.template;
12468
- if (e?.templateId === "7") {
12469
- const a = e.payload?.elements?.[0]?.action?.url;
12470
- if (typeof a == "string") return a;
12471
- }
12472
- const t = (c.content || "").trim();
12473
- if (t.startsWith("{") && t.includes('"templateId"') && t.includes('"7"'))
12474
- try {
12475
- const r = JSON.parse(t);
12476
- if (r?.metadata?.templateId === "7") {
12477
- const a = r.metadata.payload?.elements?.[0]?.action?.url;
12478
- if (typeof a == "string") return a;
12479
- }
12480
- } catch {
12481
- }
12482
- return null;
12483
- }
12484
- function uh(c) {
12485
12511
  const e = Date.now() - c.getTime(), t = Math.round(e / 1e3);
12486
12512
  if (t < 5) return "just now";
12487
12513
  if (t < 60) return `${t}s ago`;
@@ -12492,7 +12518,7 @@ function uh(c) {
12492
12518
  const n = Math.round(a / 24);
12493
12519
  return n === 1 ? "Yesterday" : n < 7 ? `${n} d ago` : c.toLocaleDateString(void 0, { month: "short", day: "2-digit" });
12494
12520
  }
12495
- class hh extends HTMLElement {
12521
+ class uh extends HTMLElement {
12496
12522
  shadow;
12497
12523
  container;
12498
12524
  welcomeMessage = "";
@@ -12519,7 +12545,6 @@ class hh extends HTMLElement {
12519
12545
  * once before the cloud upload finishes (no cloudFileId in the url)
12520
12546
  * and once after. We render only the canonical one. */
12521
12547
  shouldHideMessage(e) {
12522
- if (lh(e)) return !0;
12523
12548
  const t = e.content;
12524
12549
  if (!t) return !1;
12525
12550
  const r = t.trim().toLowerCase();
@@ -12860,7 +12885,7 @@ class hh extends HTMLElement {
12860
12885
  case "date":
12861
12886
  return r;
12862
12887
  case "relative":
12863
- return uh(t);
12888
+ return ch(t);
12864
12889
  case "time-24":
12865
12890
  return t.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit", hour12: !1 });
12866
12891
  case "time-seconds":
@@ -12880,7 +12905,7 @@ class hh extends HTMLElement {
12880
12905
  * data, or opens in a new tab depending on the matched handler.
12881
12906
  */
12882
12907
  async handleLinkClick(e, t) {
12883
- const r = this.linkHandlers.find((y) => fh(e, y.match)), a = r?.target ?? "iframe";
12908
+ const r = this.linkHandlers.find((y) => hh(e, y.match)), a = r?.target ?? "iframe";
12884
12909
  if (a === "tab") {
12885
12910
  window.open(e, "_blank", "noopener,noreferrer");
12886
12911
  return;
@@ -12890,7 +12915,7 @@ class hh extends HTMLElement {
12890
12915
  requestAnimationFrame(() => n.show?.(e, i));
12891
12916
  return;
12892
12917
  }
12893
- const o = dh(e), s = cl(r.fetch.url, o), l = {
12918
+ const o = fh(e), s = hl(r.fetch.url, o), l = {
12894
12919
  accept: "application/json",
12895
12920
  ...r.fetch.headers ?? {}
12896
12921
  }, u = r.fetch.authHeader ?? "session";
@@ -12899,7 +12924,7 @@ class hh extends HTMLElement {
12899
12924
  y && (l.authorization = `Bearer ${y}`);
12900
12925
  }
12901
12926
  const d = { method: r.fetch.method ?? "GET", headers: l };
12902
- r.fetch.body && (l["content-type"] = "application/json", d.body = JSON.stringify(zi(r.fetch.body, o)));
12927
+ r.fetch.body && (l["content-type"] = "application/json", d.body = JSON.stringify(Ki(r.fetch.body, o)));
12903
12928
  let p = null;
12904
12929
  try {
12905
12930
  const y = await fetch(s, d);
@@ -12936,11 +12961,11 @@ class hh extends HTMLElement {
12936
12961
  return e || (e = document.createElement("aikaara-link-modal"), document.body.appendChild(e)), e;
12937
12962
  }
12938
12963
  }
12939
- function fh(c, e) {
12964
+ function hh(c, e) {
12940
12965
  const t = e.replace(/[.+^${}()|[\]\\]/g, "\\$&");
12941
12966
  return new RegExp("^" + t.replace(/\*/g, ".*").replace(/\?/g, ".") + "$", "i").test(c);
12942
12967
  }
12943
- function dh(c) {
12968
+ function fh(c) {
12944
12969
  try {
12945
12970
  const e = new URL(c), t = {};
12946
12971
  return e.searchParams.forEach((r, a) => {
@@ -12950,20 +12975,20 @@ function dh(c) {
12950
12975
  return {};
12951
12976
  }
12952
12977
  }
12953
- function cl(c, e) {
12978
+ function hl(c, e) {
12954
12979
  return c.replace(/\{(\w+)\}/g, (t, r) => e[r] ?? "");
12955
12980
  }
12956
- function zi(c, e) {
12957
- if (typeof c == "string") return cl(c, e);
12958
- if (Array.isArray(c)) return c.map((t) => zi(t, e));
12981
+ function Ki(c, e) {
12982
+ if (typeof c == "string") return hl(c, e);
12983
+ if (Array.isArray(c)) return c.map((t) => Ki(t, e));
12959
12984
  if (c && typeof c == "object") {
12960
12985
  const t = {};
12961
- for (const [r, a] of Object.entries(c)) t[r] = zi(a, e);
12986
+ for (const [r, a] of Object.entries(c)) t[r] = Ki(a, e);
12962
12987
  return t;
12963
12988
  }
12964
12989
  return c;
12965
12990
  }
12966
- class ph extends HTMLElement {
12991
+ class dh extends HTMLElement {
12967
12992
  shadow;
12968
12993
  templatePayload = null;
12969
12994
  attachments = [];
@@ -13055,7 +13080,7 @@ class ph extends HTMLElement {
13055
13080
  ${n ? `<aikaara-template-renderer
13056
13081
  content-type="${n}"
13057
13082
  template-id="${i}"
13058
- inner-message="${xs(o)}"
13083
+ inner-message="${As(o)}"
13059
13084
  ></aikaara-template-renderer>` : ""}
13060
13085
  ${this.renderAttachments()}
13061
13086
  </div>
@@ -13078,19 +13103,19 @@ class ph extends HTMLElement {
13078
13103
  }
13079
13104
  renderAttachments() {
13080
13105
  return this.attachments.length ? `<div class="attachments">${this.attachments.map(
13081
- (t) => `<a class="attachment" href="${xs(t.fileUrl)}" target="_blank" rel="noopener noreferrer">
13082
- 📎 ${gh(t.fileName)}
13106
+ (t) => `<a class="attachment" href="${As(t.fileUrl)}" target="_blank" rel="noopener noreferrer">
13107
+ 📎 ${ph(t.fileName)}
13083
13108
  </a>`
13084
13109
  ).join("")}</div>` : "";
13085
13110
  }
13086
13111
  }
13087
- function xs(c) {
13112
+ function As(c) {
13088
13113
  return String(c).replace(/[&<>"']/g, (e) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[e]);
13089
13114
  }
13090
- function gh(c) {
13115
+ function ph(c) {
13091
13116
  return String(c).replace(/[&<>]/g, (e) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;" })[e]);
13092
13117
  }
13093
- class mh extends HTMLElement {
13118
+ class gh extends HTMLElement {
13094
13119
  shadow;
13095
13120
  textarea;
13096
13121
  sendBtn;
@@ -13241,7 +13266,7 @@ class mh extends HTMLElement {
13241
13266
  this.textarea.style.height = "auto", this.textarea.style.height = Math.min(this.textarea.scrollHeight, 120) + "px";
13242
13267
  }
13243
13268
  }
13244
- class bh extends HTMLElement {
13269
+ class mh extends HTMLElement {
13245
13270
  shadow;
13246
13271
  constructor() {
13247
13272
  super(), this.shadow = this.attachShadow({ mode: "open" });
@@ -13290,7 +13315,7 @@ class bh extends HTMLElement {
13290
13315
  this.removeAttribute("visible");
13291
13316
  }
13292
13317
  }
13293
- class yh extends HTMLElement {
13318
+ class bh extends HTMLElement {
13294
13319
  shadow;
13295
13320
  bubble;
13296
13321
  constructor() {
@@ -13355,7 +13380,7 @@ class yh extends HTMLElement {
13355
13380
  this.bubble?.classList.remove("cursor");
13356
13381
  }
13357
13382
  }
13358
- class vh extends HTMLElement {
13383
+ class yh extends HTMLElement {
13359
13384
  shadow;
13360
13385
  container;
13361
13386
  dismissTimer = null;
@@ -13401,9 +13426,9 @@ class vh extends HTMLElement {
13401
13426
  this.container.classList.remove("visible"), this.dismissTimer && (clearTimeout(this.dismissTimer), this.dismissTimer = null);
13402
13427
  }
13403
13428
  }
13404
- const qr = /* @__PURE__ */ new Map();
13405
- function ul(c) {
13406
- const e = qr.get(c);
13429
+ const Hr = /* @__PURE__ */ new Map();
13430
+ function fl(c) {
13431
+ const e = Hr.get(c);
13407
13432
  if (e) return e;
13408
13433
  const t = new Promise((r, a) => {
13409
13434
  const n = document.querySelector(`script[data-aikaara-src="${CSS.escape(c)}"]`);
@@ -13421,14 +13446,14 @@ function ul(c) {
13421
13446
  ), i.addEventListener(
13422
13447
  "error",
13423
13448
  () => {
13424
- qr.delete(c), a(new Error(`Failed to load ${c}`));
13449
+ Hr.delete(c), a(new Error(`Failed to load ${c}`));
13425
13450
  },
13426
13451
  { once: !0 }
13427
13452
  ), document.head.appendChild(i);
13428
13453
  });
13429
- return qr.set(c, t), t;
13454
+ return Hr.set(c, t), t;
13430
13455
  }
13431
- function wh(c, e = 5e3) {
13456
+ function vh(c, e = 5e3) {
13432
13457
  return new Promise((t, r) => {
13433
13458
  const a = setTimeout(() => r(new Error(`Custom element <${c}> not registered within ${e}ms`)), e);
13434
13459
  customElements.whenDefined(c).then(() => {
@@ -13436,11 +13461,11 @@ function wh(c, e = 5e3) {
13436
13461
  });
13437
13462
  });
13438
13463
  }
13439
- function _h(c) {
13464
+ function wh(c) {
13440
13465
  const e = `template:${c}`, t = window.__aikaara_descriptor__?.components?.[e];
13441
13466
  return t && t.kind === "iife-element" ? { render: t.tag, scriptUrl: t.scriptUrl, props: t.props } : window.__aikaara_descriptor__?.templates?.[c];
13442
13467
  }
13443
- class kh extends HTMLElement {
13468
+ class _h extends HTMLElement {
13444
13469
  shadow;
13445
13470
  payloadData = null;
13446
13471
  innerMessage = "";
@@ -13478,8 +13503,8 @@ class kh extends HTMLElement {
13478
13503
  <slot></slot>
13479
13504
  `; this.firstChild; ) this.removeChild(this.firstChild);
13480
13505
  if (!e) return;
13481
- const r = t ? _h(t) : void 0, a = r?.render ?? (t ? `aikaara-template-${t}` : `aikaara-template-${e}`);
13482
- if (r?.scriptUrl && !customElements.get(a) && ul(r.scriptUrl).then(() => wh(a)).then(() => this.render()).catch((n) => console.warn(`[aikaara-template-renderer] failed to lazy-load ${r.scriptUrl}`, n)), customElements.get(a)) {
13506
+ const r = t ? wh(t) : void 0, a = r?.render ?? (t ? `aikaara-template-${t}` : `aikaara-template-${e}`);
13507
+ if (r?.scriptUrl && !customElements.get(a) && fl(r.scriptUrl).then(() => vh(a)).then(() => this.render()).catch((n) => console.warn(`[aikaara-template-renderer] failed to lazy-load ${r.scriptUrl}`, n)), customElements.get(a)) {
13483
13508
  const n = document.createElement(a);
13484
13509
  if (r?.props) {
13485
13510
  for (const [i, o] of Object.entries(r.props))
@@ -13569,7 +13594,7 @@ class kh extends HTMLElement {
13569
13594
  url: e.url ?? "",
13570
13595
  openLinkInNewTab: e.openLinkInNewTab,
13571
13596
  orderId: e.orderId,
13572
- extra: Eh(e),
13597
+ extra: Sh(e),
13573
13598
  messageId: this.getAttribute("message-id") ?? void 0
13574
13599
  }), this.appendChild(n);
13575
13600
  });
@@ -13579,20 +13604,20 @@ class kh extends HTMLElement {
13579
13604
  t.setPayload(e), this.appendChild(t);
13580
13605
  }
13581
13606
  }
13582
- const Sh = /* @__PURE__ */ new Set([
13607
+ const kh = /* @__PURE__ */ new Set([
13583
13608
  "type",
13584
13609
  "url",
13585
13610
  "name",
13586
13611
  "openLinkInNewTab",
13587
13612
  "orderId"
13588
13613
  ]);
13589
- function Eh(c) {
13614
+ function Sh(c) {
13590
13615
  const e = {};
13591
13616
  for (const [t, r] of Object.entries(c))
13592
- Sh.has(t) || (e[t] = r);
13617
+ kh.has(t) || (e[t] = r);
13593
13618
  return e;
13594
13619
  }
13595
- class xh extends HTMLElement {
13620
+ class Eh extends HTMLElement {
13596
13621
  shadow;
13597
13622
  static get observedAttributes() {
13598
13623
  return ["text", "subtext"];
@@ -13633,15 +13658,15 @@ class xh extends HTMLElement {
13633
13658
  color: var(--aikaara-text-secondary, #9ca3af);
13634
13659
  }
13635
13660
  </style>
13636
- <span class="pill">${As(e)}</span>
13637
- ${t ? `<span class="sub">${As(t)}</span>` : ""}
13661
+ <span class="pill">${Is(e)}</span>
13662
+ ${t ? `<span class="sub">${Is(t)}</span>` : ""}
13638
13663
  `;
13639
13664
  }
13640
13665
  }
13641
- function As(c) {
13666
+ function Is(c) {
13642
13667
  return String(c).replace(/[&<>]/g, (e) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;" })[e]);
13643
13668
  }
13644
- class Ah extends HTMLElement {
13669
+ class xh extends HTMLElement {
13645
13670
  shadow;
13646
13671
  data = null;
13647
13672
  selected = /* @__PURE__ */ new Set();
@@ -13718,7 +13743,7 @@ class Ah extends HTMLElement {
13718
13743
  .row[aria-checked="true"] .check { opacity: 1; }
13719
13744
  .text { flex: 1; }
13720
13745
  </style>
13721
- <div class="row" role="checkbox" tabindex="0" aria-checked="${o}" data-value="${Is(i.value)}">
13746
+ <div class="row" role="checkbox" tabindex="0" aria-checked="${o}" data-value="${Ts(i.value)}">
13722
13747
  <span class="box" aria-hidden="true">
13723
13748
  <svg class="check" viewBox="0 0 16 16" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
13724
13749
  <path d="M3 8 L7 12 L13 4" />
@@ -13774,7 +13799,7 @@ class Ah extends HTMLElement {
13774
13799
  ${t.map(
13775
13800
  (i) => `
13776
13801
  <button class="opt" type="button"
13777
- data-value="${Is(i.value)}"
13802
+ data-value="${Ts(i.value)}"
13778
13803
  role="${a ? "checkbox" : "radio"}"
13779
13804
  aria-pressed="${this.selected.has(i.value)}">
13780
13805
  ${rr(i.label)}
@@ -13789,10 +13814,10 @@ class Ah extends HTMLElement {
13789
13814
  function rr(c) {
13790
13815
  return String(c).replace(/[&<>]/g, (e) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;" })[e]);
13791
13816
  }
13792
- function Is(c) {
13817
+ function Ts(c) {
13793
13818
  return String(c).replace(/[&<>"']/g, (e) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[e]);
13794
13819
  }
13795
- class Ih extends HTMLElement {
13820
+ class Ah extends HTMLElement {
13796
13821
  shadow;
13797
13822
  data = null;
13798
13823
  constructor() {
@@ -13852,14 +13877,14 @@ class Ih extends HTMLElement {
13852
13877
  button:hover { background: var(--aikaara-submit-hover-bg, var(--aikaara-primary-hover, #4f46e5)); }
13853
13878
  button:disabled { opacity: var(--aikaara-submit-disabled-opacity, 0.5); cursor: not-allowed; }
13854
13879
  </style>
13855
- <button type="button">${Th(e)}</button>
13880
+ <button type="button">${Ih(e)}</button>
13856
13881
  `, this.shadow.querySelector("button").addEventListener("click", () => this.handleClick());
13857
13882
  }
13858
13883
  }
13859
- function Th(c) {
13884
+ function Ih(c) {
13860
13885
  return String(c).replace(/[&<>]/g, (e) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;" })[e]);
13861
13886
  }
13862
- class Oh extends HTMLElement {
13887
+ class Th extends HTMLElement {
13863
13888
  shadow;
13864
13889
  data = null;
13865
13890
  dismissed = !1;
@@ -13938,20 +13963,20 @@ class Oh extends HTMLElement {
13938
13963
  </style>
13939
13964
  <div class="overlay" role="dialog" aria-modal="true">
13940
13965
  <div class="modal">
13941
- <div class="msg">${Hr(this.data.message)}</div>
13966
+ <div class="msg">${zr(this.data.message)}</div>
13942
13967
  <div class="actions">
13943
- ${t ? `<button class="cancel" type="button">${Hr(t)}</button>` : ""}
13944
- <button class="ok" type="button">${Hr(e)}</button>
13968
+ ${t ? `<button class="cancel" type="button">${zr(t)}</button>` : ""}
13969
+ <button class="ok" type="button">${zr(e)}</button>
13945
13970
  </div>
13946
13971
  </div>
13947
13972
  </div>
13948
13973
  `, this.shadow.querySelector("button.ok").addEventListener("click", () => this.handleOk()), this.shadow.querySelector("button.cancel")?.addEventListener("click", () => this.dismiss());
13949
13974
  }
13950
13975
  }
13951
- function Hr(c) {
13976
+ function zr(c) {
13952
13977
  return String(c).replace(/[&<>]/g, (e) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;" })[e]);
13953
13978
  }
13954
- class Ch extends HTMLElement {
13979
+ class Oh extends HTMLElement {
13955
13980
  static get observedAttributes() {
13956
13981
  return ["slug", "user-id", "user-name", "user-token", "department-id", "config-base", "api-key"];
13957
13982
  }
@@ -14005,7 +14030,7 @@ class Ch extends HTMLElement {
14005
14030
  const s = Object.keys(n).length > 0 ? n : void 0;
14006
14031
  return this.mountInflight = (async () => {
14007
14032
  try {
14008
- this.mounted = await ff({
14033
+ this.mounted = await hf({
14009
14034
  container: this,
14010
14035
  slug: e,
14011
14036
  configBase: this.getAttribute("config-base") ?? void 0,
@@ -14034,7 +14059,7 @@ class Ch extends HTMLElement {
14034
14059
  })(), this.mountInflight;
14035
14060
  }
14036
14061
  }
14037
- class Ph extends HTMLElement {
14062
+ class Ch extends HTMLElement {
14038
14063
  shadow;
14039
14064
  root = null;
14040
14065
  iframe = null;
@@ -14151,7 +14176,7 @@ class Ph extends HTMLElement {
14151
14176
  });
14152
14177
  }
14153
14178
  }
14154
- const Mh = [
14179
+ const Ph = [
14155
14180
  { label: "Self-filing guidance" },
14156
14181
  { label: "Smart tax suggestions" },
14157
14182
  { label: "Auto-fetch 26AS / AIS" },
@@ -14159,7 +14184,7 @@ const Mh = [
14159
14184
  { label: "Dedicated tax expert" },
14160
14185
  { label: "End-to-end filing" },
14161
14186
  { label: "Document handling" }
14162
- ], Rh = [
14187
+ ], Mh = [
14163
14188
  {
14164
14189
  label: "DIY",
14165
14190
  match: ["DIY", "DIY_SALARY"],
@@ -14182,11 +14207,11 @@ const Mh = [
14182
14207
  features: [!0, !0, !0, !0, !0, !0, !0]
14183
14208
  }
14184
14209
  ];
14185
- class jh extends HTMLElement {
14210
+ class Rh extends HTMLElement {
14186
14211
  shadow;
14187
14212
  data = null;
14188
- columns = Rh;
14189
- features = Mh;
14213
+ columns = Mh;
14214
+ features = Ph;
14190
14215
  constructor() {
14191
14216
  super(), this.shadow = this.attachShadow({ mode: "open" });
14192
14217
  }
@@ -14268,14 +14293,14 @@ class jh extends HTMLElement {
14268
14293
  <thead>
14269
14294
  <tr>
14270
14295
  <th>Feature</th>
14271
- ${e.map((r) => `<th>${zr(r.label)}</th>`).join("")}
14296
+ ${e.map((r) => `<th>${Kr(r.label)}</th>`).join("")}
14272
14297
  </tr>
14273
14298
  </thead>
14274
14299
  <tbody>
14275
14300
  ${t.map(
14276
14301
  (r, a) => `
14277
14302
  <tr>
14278
- <td>${zr(r.label)}</td>
14303
+ <td>${Kr(r.label)}</td>
14279
14304
  ${e.map(
14280
14305
  (n) => n.features[a] ? '<td><span class="check">✓</span></td>' : '<td><span class="cross">✕</span></td>'
14281
14306
  ).join("")}
@@ -14294,7 +14319,7 @@ class jh extends HTMLElement {
14294
14319
  ${e.map((r, a) => {
14295
14320
  const n = this.priceFor(r), i = r.selectLabel.replace("{price}", n != null ? String(Math.round(n)) : "—");
14296
14321
  return `<button class="action" data-col="${a}" type="button">
14297
- <span>${zr(i)}</span>
14322
+ <span>${Kr(i)}</span>
14298
14323
  <small>Tap to select</small>
14299
14324
  </button>`;
14300
14325
  }).join("")}
@@ -14313,37 +14338,37 @@ class jh extends HTMLElement {
14313
14338
  });
14314
14339
  }
14315
14340
  }
14316
- function zr(c) {
14341
+ function Kr(c) {
14317
14342
  return c.replace(
14318
14343
  /[&<>"']/g,
14319
14344
  (e) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[e]
14320
14345
  );
14321
14346
  }
14322
- function Lh() {
14347
+ function jh() {
14323
14348
  const c = [
14324
- ["aikaara-chat-widget", th],
14325
- ["aikaara-chat-bubble", rh],
14326
- ["aikaara-chat-header", nh],
14327
- ["aikaara-message-list", hh],
14328
- ["aikaara-message-bubble", ph],
14329
- ["aikaara-chat-input", mh],
14330
- ["aikaara-typing-indicator", bh],
14331
- ["aikaara-streaming-message", yh],
14332
- ["aikaara-error-banner", vh],
14333
- ["aikaara-template-renderer", kh],
14334
- ["aikaara-system-pill", xh],
14335
- ["aikaara-option-list", Ah],
14336
- ["aikaara-submit-action", Ih],
14337
- ["aikaara-modal-action", Oh],
14338
- ["aikaara-chat", Ch],
14339
- ["aikaara-link-modal", Ph],
14340
- ["aikaara-compare-plans", jh]
14349
+ ["aikaara-chat-widget", rh],
14350
+ ["aikaara-chat-bubble", nh],
14351
+ ["aikaara-chat-header", ih],
14352
+ ["aikaara-message-list", uh],
14353
+ ["aikaara-message-bubble", dh],
14354
+ ["aikaara-chat-input", gh],
14355
+ ["aikaara-typing-indicator", mh],
14356
+ ["aikaara-streaming-message", bh],
14357
+ ["aikaara-error-banner", yh],
14358
+ ["aikaara-template-renderer", _h],
14359
+ ["aikaara-system-pill", Eh],
14360
+ ["aikaara-option-list", xh],
14361
+ ["aikaara-submit-action", Ah],
14362
+ ["aikaara-modal-action", Th],
14363
+ ["aikaara-chat", Oh],
14364
+ ["aikaara-link-modal", Ch],
14365
+ ["aikaara-compare-plans", Rh]
14341
14366
  ];
14342
14367
  for (const [e, t] of c)
14343
14368
  customElements.get(e) || customElements.define(e, t);
14344
14369
  }
14345
- Lh();
14346
- function Kr(c, e, t = "") {
14370
+ jh();
14371
+ function Vr(c, e, t = "") {
14347
14372
  if (!e) return t;
14348
14373
  const r = e.split(".");
14349
14374
  let a = c;
@@ -14353,7 +14378,7 @@ function Kr(c, e, t = "") {
14353
14378
  else return t;
14354
14379
  return typeof a == "string" ? a : t;
14355
14380
  }
14356
- function Nh(c) {
14381
+ function Lh(c) {
14357
14382
  try {
14358
14383
  const e = c.split(".")[1];
14359
14384
  if (!e) return 0;
@@ -14365,10 +14390,10 @@ function Nh(c) {
14365
14390
  return 0;
14366
14391
  }
14367
14392
  }
14368
- async function Pr(c) {
14393
+ async function Mr(c) {
14369
14394
  return typeof c == "function" ? await c() : c;
14370
14395
  }
14371
- class Uh {
14396
+ class Nh {
14372
14397
  constructor(e, t) {
14373
14398
  this.descriptor = e, this.sessionToken = t;
14374
14399
  }
@@ -14385,7 +14410,7 @@ class Uh {
14385
14410
  }), this.inflight);
14386
14411
  }
14387
14412
  async fetchOnce() {
14388
- const e = await Pr(this.sessionToken), t = this.descriptor.authHeader ?? "Authorization", r = this.descriptor.authHeaderTemplate ?? "Bearer {token}", a = {
14413
+ const e = await Mr(this.sessionToken), t = this.descriptor.authHeader ?? "Authorization", r = this.descriptor.authHeaderTemplate ?? "Bearer {token}", a = {
14389
14414
  accept: "application/json",
14390
14415
  ...this.descriptor.headers ?? {},
14391
14416
  [t]: r.replace("{token}", e)
@@ -14396,18 +14421,18 @@ class Uh {
14396
14421
  const b = await o.text().catch(() => "");
14397
14422
  throw new Error(`Session auth failed: ${o.status} ${b.slice(0, 200)}`);
14398
14423
  }
14399
- const s = await o.json().catch(() => ({})), l = Kr(s, this.descriptor.tokenPath ?? "data.token"), u = this.descriptor.tokenStripPrefix, d = u ? l.replace(new RegExp(`^${u}`, "i"), "").trim() : l;
14424
+ const s = await o.json().catch(() => ({})), l = Vr(s, this.descriptor.tokenPath ?? "data.token"), u = this.descriptor.tokenStripPrefix, d = u ? l.replace(new RegExp(`^${u}`, "i"), "").trim() : l;
14400
14425
  if (!d) throw new Error("Session auth response missing token");
14401
- const p = Kr(s, this.descriptor.requestIdPath ?? "data.requestId"), y = this.cache?.requestId || p;
14426
+ const p = Vr(s, this.descriptor.requestIdPath ?? "data.requestId"), y = this.cache?.requestId || p;
14402
14427
  if (!y) throw new Error("Session auth response missing requestId");
14403
- const f = Kr(s, this.descriptor.fullNamePath ?? "data.fullName"), m = Nh(d) || Date.now() + 3600 * 1e3;
14428
+ const f = Vr(s, this.descriptor.fullNamePath ?? "data.fullName"), m = Lh(d) || Date.now() + 3600 * 1e3;
14404
14429
  return this.cache = { token: d, requestId: y, fullName: f, expiresAt: m }, this.cache;
14405
14430
  }
14406
14431
  }
14407
- async function Bh(c) {
14432
+ async function Uh(c) {
14408
14433
  const e = {};
14409
14434
  for (const t of c.spec) {
14410
- const r = await Fh(t, c.providers);
14435
+ const r = await Bh(t, c.providers);
14411
14436
  if (r !== void 0 && r !== "")
14412
14437
  e[t.name] = r;
14413
14438
  else {
@@ -14420,11 +14445,11 @@ async function Bh(c) {
14420
14445
  }
14421
14446
  return e;
14422
14447
  }
14423
- async function Fh(c, e) {
14448
+ async function Bh(c, e) {
14424
14449
  const t = c.key ?? c.name;
14425
14450
  switch (c.source) {
14426
14451
  case "cookie":
14427
- return Dh(t);
14452
+ return Fh(t);
14428
14453
  case "localStorage":
14429
14454
  return nr(() => window.localStorage.getItem(t) ?? void 0);
14430
14455
  case "sessionStorage":
@@ -14432,7 +14457,7 @@ async function Fh(c, e) {
14432
14457
  case "url_param":
14433
14458
  return nr(() => new URL(window.location.href).searchParams.get(t) ?? void 0);
14434
14459
  case "header_meta":
14435
- return nr(() => document.querySelector(`meta[name="${$h(t)}"]`)?.content ?? void 0);
14460
+ return nr(() => document.querySelector(`meta[name="${Dh(t)}"]`)?.content ?? void 0);
14436
14461
  case "callback": {
14437
14462
  const r = e?.[c.name];
14438
14463
  if (!r) return;
@@ -14443,7 +14468,7 @@ async function Fh(c, e) {
14443
14468
  return;
14444
14469
  }
14445
14470
  }
14446
- function Dh(c) {
14471
+ function Fh(c) {
14447
14472
  if (typeof document > "u") return;
14448
14473
  const e = encodeURIComponent(c), t = document.cookie ? document.cookie.split("; ") : [];
14449
14474
  for (const r of t) {
@@ -14465,11 +14490,11 @@ function nr(c) {
14465
14490
  return;
14466
14491
  }
14467
14492
  }
14468
- function $h(c) {
14493
+ function Dh(c) {
14469
14494
  return c.replace(/["\\]/g, "\\$&");
14470
14495
  }
14471
- const Wh = 1800;
14472
- class qh {
14496
+ const $h = 1800;
14497
+ class Wh {
14473
14498
  constructor(e) {
14474
14499
  this.opts = e, this.cache = this.loadCache();
14475
14500
  }
@@ -14498,7 +14523,7 @@ class qh {
14498
14523
  throw new Error(
14499
14524
  "[aikaara-chat-sdk] SsoExchangeAdapter.exchange() requires descriptor.sso.collect; v2 partner-token flow should be handled by TokenDiscoveryReader instead."
14500
14525
  );
14501
- const e = await Bh({
14526
+ const e = await Uh({
14502
14527
  spec: this.opts.descriptor.collect,
14503
14528
  providers: this.opts.providers
14504
14529
  }), t = JSON.stringify({ credentials: e }), r = {
@@ -14536,7 +14561,7 @@ class qh {
14536
14561
  return this.cache = u, this.persistCache(u), u;
14537
14562
  }
14538
14563
  computeExpiry() {
14539
- const e = this.opts.descriptor.cacheTtlSec ?? Wh;
14564
+ const e = this.opts.descriptor.cacheTtlSec ?? $h;
14540
14565
  if (!(!this.opts.descriptor.cacheKey || e <= 0))
14541
14566
  return Date.now() + e * 1e3;
14542
14567
  }
@@ -14569,8 +14594,8 @@ class qh {
14569
14594
  }
14570
14595
  }
14571
14596
  }
14572
- const Hh = 3e4, zh = 2e3, Kh = 100;
14573
- async function Vh(c) {
14597
+ const qh = 3e4, Hh = 2e3, zh = 100;
14598
+ async function Kh(c) {
14574
14599
  const { descriptor: e } = c, t = e.tokenSourceConfig ?? {};
14575
14600
  switch (e.tokenSource) {
14576
14601
  case "init": {
@@ -14579,37 +14604,37 @@ async function Vh(c) {
14579
14604
  return { token: c.initToken, source: "init" };
14580
14605
  }
14581
14606
  case "query": {
14582
- const r = typeof t.key == "string" && t.key ? t.key : "token", a = Yh(r);
14607
+ const r = typeof t.key == "string" && t.key ? t.key : "token", a = Gh(r);
14583
14608
  if (!a) throw new Ke("query", `?${r}= not present`);
14584
14609
  return { token: a, source: "query" };
14585
14610
  }
14586
14611
  case "hash": {
14587
- const r = typeof t.key == "string" && t.key ? t.key : "token", a = Qh(r);
14612
+ const r = typeof t.key == "string" && t.key ? t.key : "token", a = Yh(r);
14588
14613
  if (!a) throw new Ke("hash", `#${r}= not present`);
14589
14614
  return { token: a, source: "hash" };
14590
14615
  }
14591
14616
  case "postmsg": {
14592
- const r = typeof t.type == "string" ? t.type : "", a = typeof t.key == "string" && t.key ? t.key : "token", n = tf(typeof t.origins == "string" ? t.origins : ""), i = typeof t.timeoutMs == "number" && t.timeoutMs > 0 ? t.timeoutMs : Hh;
14593
- return { token: await ef({ type: r, key: a, origins: n, timeoutMs: i }), source: "postmsg" };
14617
+ const r = typeof t.type == "string" ? t.type : "", a = typeof t.key == "string" && t.key ? t.key : "token", n = ef(typeof t.origins == "string" ? t.origins : ""), i = typeof t.timeoutMs == "number" && t.timeoutMs > 0 ? t.timeoutMs : qh;
14618
+ return { token: await Zh({ type: r, key: a, origins: n, timeoutMs: i }), source: "postmsg" };
14594
14619
  }
14595
14620
  case "cookie": {
14596
14621
  const r = typeof t.name == "string" && t.name ? t.name : "";
14597
14622
  if (!r) throw new Ke("cookie", "cookie.name not configured");
14598
- const a = Jh(r);
14623
+ const a = Qh(r);
14599
14624
  if (!a) throw new Ke("cookie", `cookie "${r}" not set`);
14600
14625
  return { token: a, source: "cookie" };
14601
14626
  }
14602
14627
  case "storage": {
14603
14628
  const r = t.store === "session" ? "session" : "local", a = typeof t.key == "string" && t.key ? t.key : "", n = typeof t.path == "string" ? t.path : "";
14604
14629
  if (!a) throw new Ke("storage", "storage.key not configured");
14605
- const i = Xh(r, a, n);
14630
+ const i = Jh(r, a, n);
14606
14631
  if (!i) throw new Ke("storage", `${r}Storage["${a}"] not set`);
14607
14632
  return { token: i, source: "storage" };
14608
14633
  }
14609
14634
  case "global": {
14610
14635
  const r = typeof t.path == "string" ? t.path : "";
14611
14636
  if (!r) throw new Ke("global", "global.path not configured");
14612
- const a = typeof t.timeoutMs == "number" && t.timeoutMs > 0 ? t.timeoutMs : zh, n = typeof t.intervalMs == "number" && t.intervalMs > 0 ? t.intervalMs : Kh, i = await Zh(r, a, n);
14637
+ const a = typeof t.timeoutMs == "number" && t.timeoutMs > 0 ? t.timeoutMs : Hh, n = typeof t.intervalMs == "number" && t.intervalMs > 0 ? t.intervalMs : zh, i = await Xh(r, a, n);
14613
14638
  if (!i) throw new Ke("global", `window.${r} not present`);
14614
14639
  return { token: i, source: "global" };
14615
14640
  }
@@ -14622,7 +14647,7 @@ async function Vh(c) {
14622
14647
  }
14623
14648
  }
14624
14649
  }
14625
- class Gh {
14650
+ class Vh {
14626
14651
  constructor(e) {
14627
14652
  this.opts = e;
14628
14653
  }
@@ -14633,7 +14658,7 @@ class Gh {
14633
14658
  /** Resolve the token. Returns cache if present. */
14634
14659
  async get() {
14635
14660
  if (this.cached) return this.cached;
14636
- const e = await Vh(this.opts);
14661
+ const e = await Kh(this.opts);
14637
14662
  return this.cached = e, e;
14638
14663
  }
14639
14664
  /**
@@ -14650,7 +14675,7 @@ class Ke extends Error {
14650
14675
  super(`[aikaara-chat-sdk] token-discovery (${e}): ${t}`), this.source = e, this.name = "TokenDiscoveryError";
14651
14676
  }
14652
14677
  }
14653
- function Yh(c) {
14678
+ function Gh(c) {
14654
14679
  if (!(typeof window > "u"))
14655
14680
  try {
14656
14681
  return new URL(window.location.href).searchParams.get(c) ?? void 0;
@@ -14658,7 +14683,7 @@ function Yh(c) {
14658
14683
  return;
14659
14684
  }
14660
14685
  }
14661
- function Qh(c) {
14686
+ function Yh(c) {
14662
14687
  if (!(typeof window > "u"))
14663
14688
  try {
14664
14689
  const e = window.location.hash.replace(/^#/, "");
@@ -14667,7 +14692,7 @@ function Qh(c) {
14667
14692
  return;
14668
14693
  }
14669
14694
  }
14670
- function Jh(c) {
14695
+ function Qh(c) {
14671
14696
  if (typeof document > "u") return;
14672
14697
  const e = encodeURIComponent(c), t = document.cookie ? document.cookie.split("; ") : [];
14673
14698
  for (const r of t) {
@@ -14682,7 +14707,7 @@ function Jh(c) {
14682
14707
  }
14683
14708
  }
14684
14709
  }
14685
- function Xh(c, e, t) {
14710
+ function Jh(c, e, t) {
14686
14711
  if (!(typeof window > "u"))
14687
14712
  try {
14688
14713
  const a = (c === "session" ? window.sessionStorage : window.localStorage).getItem(e);
@@ -14694,17 +14719,17 @@ function Xh(c, e, t) {
14694
14719
  } catch {
14695
14720
  return a;
14696
14721
  }
14697
- const i = hl(n, t);
14722
+ const i = dl(n, t);
14698
14723
  return typeof i == "string" ? i : void 0;
14699
14724
  } catch {
14700
14725
  return;
14701
14726
  }
14702
14727
  }
14703
- async function Zh(c, e, t) {
14728
+ async function Xh(c, e, t) {
14704
14729
  if (typeof window > "u") return;
14705
14730
  const r = Date.now() + e;
14706
14731
  for (; Date.now() < r; ) {
14707
- const a = hl(window, c);
14732
+ const a = dl(window, c);
14708
14733
  if (typeof a == "string" && a.length > 0) return a;
14709
14734
  if (typeof a == "function")
14710
14735
  try {
@@ -14715,7 +14740,7 @@ async function Zh(c, e, t) {
14715
14740
  await new Promise((n) => setTimeout(n, t));
14716
14741
  }
14717
14742
  }
14718
- function ef(c) {
14743
+ function Zh(c) {
14719
14744
  return new Promise((e, t) => {
14720
14745
  if (typeof window > "u") {
14721
14746
  t(new Ke("postmsg", "no window"));
@@ -14737,10 +14762,10 @@ function ef(c) {
14737
14762
  window.addEventListener("message", n);
14738
14763
  });
14739
14764
  }
14740
- function tf(c) {
14765
+ function ef(c) {
14741
14766
  return c ? c.split(/[,\s]+/).map((e) => e.trim()).filter(Boolean) : [];
14742
14767
  }
14743
- function hl(c, e) {
14768
+ function dl(c, e) {
14744
14769
  if (!e) return c;
14745
14770
  const t = e.split(".").filter(Boolean);
14746
14771
  let r = c;
@@ -14751,7 +14776,7 @@ function hl(c, e) {
14751
14776
  return;
14752
14777
  return r;
14753
14778
  }
14754
- function rf() {
14779
+ function tf() {
14755
14780
  const c = typeof crypto < "u" ? crypto : null;
14756
14781
  if (c?.randomUUID) return c.randomUUID();
14757
14782
  if (c?.getRandomValues) {
@@ -14765,30 +14790,30 @@ function rf() {
14765
14790
  return (e === "x" ? t : t & 3 | 8).toString(16);
14766
14791
  });
14767
14792
  }
14768
- const nf = "aikaara_chat:requestId";
14769
- function so(c, e) {
14770
- return `${nf}:${c}:${e}`;
14793
+ const rf = "aikaara_chat:requestId";
14794
+ function ao(c, e) {
14795
+ return `${rf}:${c}:${e}`;
14771
14796
  }
14772
- function of(c, e) {
14797
+ function nf(c, e) {
14773
14798
  try {
14774
- return localStorage.getItem(so(c, e));
14799
+ return localStorage.getItem(ao(c, e));
14775
14800
  } catch {
14776
14801
  return null;
14777
14802
  }
14778
14803
  }
14779
- function sf(c, e, t) {
14804
+ function of(c, e, t) {
14780
14805
  try {
14781
- localStorage.setItem(so(c, e), t);
14806
+ localStorage.setItem(ao(c, e), t);
14782
14807
  } catch {
14783
14808
  }
14784
14809
  }
14785
- function df(c, e) {
14810
+ function ff(c, e) {
14786
14811
  try {
14787
- localStorage.removeItem(so(c, e));
14812
+ localStorage.removeItem(ao(c, e));
14788
14813
  } catch {
14789
14814
  }
14790
14815
  }
14791
- async function af(c, e) {
14816
+ async function sf(c, e) {
14792
14817
  console.log("[aikaara-chat-sdk] preflight running", c.length, "steps");
14793
14818
  const t = {
14794
14819
  userId: e.userId,
@@ -14807,7 +14832,7 @@ async function af(c, e) {
14807
14832
  return s;
14808
14833
  }
14809
14834
  return o;
14810
- }, n = await Pr(e.sessionToken), i = [800, 1500, 3e3, 5e3, 8e3];
14835
+ }, n = await Mr(e.sessionToken), i = [800, 1500, 3e3, 5e3, 8e3];
14811
14836
  for (let o = 0; o < c.length; o++) {
14812
14837
  const s = c[o], l = r(s.url), u = s.method ?? (s.body ? "POST" : "GET"), d = { accept: "application/json", ...s.headers ?? {} };
14813
14838
  if ((s.authHeader ?? "session") === "session") {
@@ -14821,7 +14846,7 @@ async function af(c, e) {
14821
14846
  try {
14822
14847
  const b = await fetch(l, p);
14823
14848
  if (b.ok) break;
14824
- if (y = b.status, f = await b.text().catch(() => ""), m < i.length && lf(y, f)) {
14849
+ if (y = b.status, f = await b.text().catch(() => ""), m < i.length && af(y, f)) {
14825
14850
  const g = i[m++];
14826
14851
  console.warn(
14827
14852
  `[aikaara-chat-sdk] preflight #${o} ${u} ${l} → ${y} (transient). Retry #${m} in ${g}ms.`
@@ -14851,7 +14876,7 @@ async function af(c, e) {
14851
14876
  }
14852
14877
  }
14853
14878
  }
14854
- function lf(c, e) {
14879
+ function af(c, e) {
14855
14880
  if (c === 503 || c === 504 || c === 502) return !0;
14856
14881
  if (c === 401 || c === 403) return e.trim().length === 0;
14857
14882
  if (c === 500) {
@@ -14860,7 +14885,7 @@ function lf(c, e) {
14860
14885
  }
14861
14886
  return !1;
14862
14887
  }
14863
- async function fl(c, e) {
14888
+ async function pl(c, e) {
14864
14889
  const t = await fetch(c, {
14865
14890
  method: "GET",
14866
14891
  headers: { accept: "application/json", ...e ?? {} }
@@ -14876,10 +14901,10 @@ async function fl(c, e) {
14876
14901
  }
14877
14902
  return r;
14878
14903
  }
14879
- function cf(c, e) {
14880
- return c.replace("{projectId}", e).replace("{uuid}", rf().replace(/-/g, ""));
14904
+ function lf(c, e) {
14905
+ return c.replace("{projectId}", e).replace("{uuid}", tf().replace(/-/g, ""));
14881
14906
  }
14882
- function dl(c) {
14907
+ function gl(c) {
14883
14908
  const e = c._preload;
14884
14909
  if (!Array.isArray(e) || e.length === 0) return;
14885
14910
  const t = Array.from(
@@ -14887,19 +14912,19 @@ function dl(c) {
14887
14912
  e.map((r) => r && typeof r == "object" ? r.scriptUrl : null).filter((r) => typeof r == "string" && r.length > 0)
14888
14913
  )
14889
14914
  );
14890
- t.length !== 0 && Promise.allSettled(t.map((r) => ul(r)));
14915
+ t.length !== 0 && Promise.allSettled(t.map((r) => fl(r)));
14891
14916
  }
14892
- async function uf(c) {
14917
+ async function cf(c) {
14893
14918
  const e = {
14894
- ...c.config ?? (c.configUrl ? await fl(c.configUrl, c.configHeaders) : {}),
14919
+ ...c.config ?? (c.configUrl ? await pl(c.configUrl, c.configHeaders) : {}),
14895
14920
  ...c.overrides ?? {}
14896
14921
  };
14897
- dl(e);
14922
+ gl(e);
14898
14923
  const t = e.transport ?? "tiledesk", r = e.tiledesk;
14899
14924
  if ((t === "tiledesk" || t === "dual") && !r)
14900
14925
  throw new Error("mount: descriptor.tiledesk is required for tiledesk/dual transport");
14901
- const a = r?.projectId ?? "", n = c.identity.userId, i = c.forceNewConversation ? null : of(n, a), o = r?.requestIdTemplate ?? "support-group-{projectId}-{uuid}", s = c.conversationId ?? i ?? cf(o, a);
14902
- (!i || c.forceNewConversation) && a && sf(n, a, s);
14926
+ const a = r?.projectId ?? "", n = c.identity.userId, i = c.forceNewConversation ? null : nf(n, a), o = r?.requestIdTemplate ?? "support-group-{projectId}-{uuid}", s = c.conversationId ?? i ?? lf(o, a);
14927
+ (!i || c.forceNewConversation) && a && of(n, a, s);
14903
14928
  const l = await c.tokenProvider(), u = c.tokenProvider, d = c.historyTokenProvider ?? u, p = r ? {
14904
14929
  mqttEndpoint: r.mqttEndpoint,
14905
14930
  jwtToken: l,
@@ -14927,11 +14952,11 @@ async function uf(c) {
14927
14952
  debug: r.debug,
14928
14953
  senderFullname: c.identity.senderFullname ?? c.identity.userName,
14929
14954
  tokenProvider: u
14930
- } : void 0, y = c.uploadAdapter ?? (e.uploadEndpoint ? al({
14955
+ } : void 0, y = c.uploadAdapter ?? (e.uploadEndpoint ? cl({
14931
14956
  endpoint: e.uploadEndpoint,
14932
14957
  fieldName: e.uploadFieldName,
14933
14958
  extraFields: e.uploadExtraFields
14934
- }) : void 0), f = c.historyAdapter ?? (e.historyApiBase ? Zu({
14959
+ }) : void 0), f = c.historyAdapter ?? (e.historyApiBase ? eh({
14935
14960
  apiBase: e.historyApiBase,
14936
14961
  pageSize: e.historyPageSize ?? 200,
14937
14962
  pathTemplate: e.historyPathTemplate,
@@ -14986,17 +15011,17 @@ async function uf(c) {
14986
15011
  }
14987
15012
  };
14988
15013
  }
14989
- function hf(c) {
15014
+ function uf(c) {
14990
15015
  if (typeof c != "string") return c;
14991
15016
  const e = document.querySelector(c);
14992
15017
  if (!e) throw new Error(`mountFromSlug: container "${c}" not found`);
14993
15018
  return e;
14994
15019
  }
14995
- async function ff(c) {
15020
+ async function hf(c) {
14996
15021
  const e = (c.configBase ?? "https://api.aikaara.com").replace(/\/$/, ""), t = `${e}/api/v1/widget_configs/${encodeURIComponent(c.slug)}`;
14997
15022
  let r = null;
14998
15023
  try {
14999
- r = await fl(t, c.configHeaders);
15024
+ r = await pl(t, c.configHeaders);
15000
15025
  } catch (S) {
15001
15026
  if (!c.fallbackConfig) throw S;
15002
15027
  console.warn(
@@ -15009,7 +15034,7 @@ async function ff(c) {
15009
15034
  ...r ?? {},
15010
15035
  ...c.overrides ?? {}
15011
15036
  };
15012
- if (dl(a), a.templates && Object.keys(a.templates).length > 0) {
15037
+ if (gl(a), a.templates && Object.keys(a.templates).length > 0) {
15013
15038
  a.components = { ...a.components ?? {} };
15014
15039
  for (const [S, v] of Object.entries(a.templates)) {
15015
15040
  const x = `template:${S}`;
@@ -15037,7 +15062,7 @@ async function ff(c) {
15037
15062
  );
15038
15063
  let i = null, o = c.user.id, s = c.user.name, l = "", u = c.user.token, d = null;
15039
15064
  if (a.sso?.tokenSource) {
15040
- d = new Gh({
15065
+ d = new Vh({
15041
15066
  descriptor: {
15042
15067
  provider: a.sso.provider,
15043
15068
  flow: a.sso.flow,
@@ -15054,20 +15079,20 @@ async function ff(c) {
15054
15079
  u = async () => (await d.get()).token, c.user.identity && !c.user.identity.partnerToken && (c.user.identity.partnerToken = S.token);
15055
15080
  } else if (a.sso && a.sso.collect && a.sso.collect.length > 0) {
15056
15081
  const S = `${e}/api/v1/projects/by-slug/${encodeURIComponent(c.slug)}/sso_exchange`;
15057
- i = await new qh({
15082
+ i = await new Wh({
15058
15083
  descriptor: a.sso,
15059
15084
  providers: c.user.credentialProviders,
15060
15085
  exchangeUrl: S
15061
15086
  }).get(), o = i.extUid || o, s = s ?? i.displayName, l = i.userToken;
15062
15087
  }
15063
- a.preflight && a.preflight.length && await af(a.preflight, {
15088
+ a.preflight && a.preflight.length && await sf(a.preflight, {
15064
15089
  sessionToken: u,
15065
15090
  userId: o,
15066
15091
  projectId: a.tiledesk?.projectId ?? "",
15067
15092
  slug: c.slug,
15068
15093
  identity: c.user.identity
15069
15094
  });
15070
- const p = new Uh(a.auth, u), y = await p.get(), f = y.fullName || s || o;
15095
+ const p = new Nh(a.auth, u), y = await p.get(), f = y.fullName || s || o;
15071
15096
  window.__aikaara_runtime__ = {
15072
15097
  getChatJwt: async () => (await p.get()).token,
15073
15098
  identity: c.user.identity,
@@ -15079,16 +15104,16 @@ async function ff(c) {
15079
15104
  } catch (S) {
15080
15105
  return console.warn("[aikaara-chat-sdk] partner auto-refresh failed", S), null;
15081
15106
  }
15082
- } : null, b = a.upload, k = async () => `Bearer ${b && "tokenSource" in b && b.tokenSource === "chat" ? (await p.get()).token : await Pr(c.user.token)}`, g = c.hooks?.upload ?? (b && b.mode === "presigned-3step" ? Ju({
15107
+ } : null, b = a.upload, k = async () => `Bearer ${b && "tokenSource" in b && b.tokenSource === "chat" ? (await p.get()).token : await Mr(c.user.token)}`, g = c.hooks?.upload ?? (b && b.mode === "presigned-3step" ? Xu({
15083
15108
  ...b,
15084
15109
  authHeader: k
15085
- }) : b && b.mode === "direct" ? al({
15110
+ }) : b && b.mode === "direct" ? cl({
15086
15111
  endpoint: b.endpoint,
15087
15112
  fieldName: b.fieldName,
15088
15113
  extraFields: b.extraFields,
15089
15114
  headers: async () => ({ authorization: await k() })
15090
- }) : void 0), _ = await uf({
15091
- container: hf(c.container),
15115
+ }) : void 0), _ = await cf({
15116
+ container: uf(c.container),
15092
15117
  config: a,
15093
15118
  // SSO-issued Aikaara user token, used by the ActionCable transport.
15094
15119
  // Tiledesk-only widgets ignore this; falls back to `userId` inside `mount`.
@@ -15106,7 +15131,7 @@ async function ff(c) {
15106
15131
  conversationId: y.requestId,
15107
15132
  onError: c.hooks?.onError,
15108
15133
  onMessage: c.hooks?.onMessage,
15109
- getLinkBearer: async (S) => S === "none" ? null : S === "chat" ? (await p.get()).token : Pr(c.user.token)
15134
+ getLinkBearer: async (S) => S === "none" ? null : S === "chat" ? (await p.get()).token : Mr(c.user.token)
15110
15135
  });
15111
15136
  return Object.assign(_, {
15112
15137
  fullName: f,
@@ -15121,47 +15146,47 @@ async function ff(c) {
15121
15146
  });
15122
15147
  }
15123
15148
  export {
15124
- ao as A,
15125
- ff as B,
15126
- pl as C,
15127
- uf as D,
15128
- Ts as E,
15129
- sl as F,
15130
- Ch as G,
15131
- jh as H,
15132
- Ph as I,
15133
- Oh as J,
15134
- Ah as K,
15135
- Ih as L,
15136
- Al as M,
15137
- xh as N,
15138
- kh as O,
15139
- Uh as S,
15140
- $u as T,
15141
- rh as a,
15142
- Vu as b,
15143
- nh as c,
15144
- mh as d,
15145
- th as e,
15146
- vh as f,
15147
- ph as g,
15148
- hh as h,
15149
- yh as i,
15150
- bh as j,
15151
- xl as k,
15152
- El as l,
15153
- Tl as m,
15154
- qh as n,
15149
+ lo as A,
15150
+ hf as B,
15151
+ ml as C,
15152
+ cf as D,
15153
+ Os as E,
15154
+ ll as F,
15155
+ Oh as G,
15156
+ Rh as H,
15157
+ Ch as I,
15158
+ Th as J,
15159
+ xh as K,
15160
+ Ah as L,
15161
+ Tl as M,
15162
+ Eh as N,
15163
+ _h as O,
15164
+ Nh as S,
15165
+ Wu as T,
15166
+ nh as a,
15167
+ Gu as b,
15168
+ ih as c,
15169
+ gh as d,
15170
+ rh as e,
15171
+ yh as f,
15172
+ dh as g,
15173
+ uh as h,
15174
+ bh as i,
15175
+ mh as j,
15176
+ Il as k,
15177
+ Al as l,
15178
+ Ol as m,
15179
+ Wh as n,
15155
15180
  Ke as o,
15156
- Gh as p,
15157
- df as q,
15158
- Lh as r,
15159
- Bh as s,
15160
- al as t,
15161
- Ju as u,
15162
- Zu as v,
15163
- Vh as w,
15164
- zu as x,
15165
- Hu as y,
15166
- qu as z
15181
+ Vh as p,
15182
+ ff as q,
15183
+ jh as r,
15184
+ Uh as s,
15185
+ cl as t,
15186
+ Xu as u,
15187
+ eh as v,
15188
+ Kh as w,
15189
+ Ku as x,
15190
+ zu as y,
15191
+ Hu as z
15167
15192
  };