@anam-ai/agent-widget 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
- var Ue, k, ei, ti, pe, Dt, ii, ni, ri, Et, lt, ct, ke = {}, oi = [], Ki = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Je = Array.isArray;
1
+ var Ue, k, ei, ti, pe, Dt, ii, ni, ri, mt, lt, ct, ke = {}, oi = [], Ki = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Je = Array.isArray;
2
2
  function ee(t, e) {
3
3
  for (var n in e) t[n] = e[n];
4
4
  return t;
5
5
  }
6
- function mt(t) {
6
+ function Et(t) {
7
7
  t && t.parentNode && t.parentNode.removeChild(t);
8
8
  }
9
9
  function Se(t, e, n) {
10
- var o, l, a, u = {};
11
- for (a in e) a == "key" ? o = e[a] : a == "ref" ? l = e[a] : u[a] = e[a];
12
- if (arguments.length > 2 && (u.children = arguments.length > 3 ? Ue.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (a in t.defaultProps) u[a] === void 0 && (u[a] = t.defaultProps[a]);
10
+ var o, l, s, u = {};
11
+ for (s in e) s == "key" ? o = e[s] : s == "ref" ? l = e[s] : u[s] = e[s];
12
+ if (arguments.length > 2 && (u.children = arguments.length > 3 ? Ue.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) u[s] === void 0 && (u[s] = t.defaultProps[s]);
13
13
  return Ne(t, u, o, l, null);
14
14
  }
15
15
  function Ne(t, e, n, o, l) {
16
- var a = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: l ?? ++ei, __i: -1, __u: 0 };
17
- return l == null && k.vnode != null && k.vnode(a), a;
16
+ var s = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: l ?? ++ei, __i: -1, __u: 0 };
17
+ return l == null && k.vnode != null && k.vnode(s), s;
18
18
  }
19
19
  function fe(t) {
20
20
  return t.children;
@@ -41,24 +41,24 @@ function Mt(t) {
41
41
  (!t.__d && (t.__d = !0) && pe.push(t) && !He.__r++ || Dt != k.debounceRendering) && ((Dt = k.debounceRendering) || ii)(He);
42
42
  }
43
43
  function He() {
44
- for (var t, e, n, o, l, a, u, c = 1; pe.length; ) pe.length > c && pe.sort(ni), t = pe.shift(), c = pe.length, t.__d && (n = void 0, o = void 0, l = (o = (e = t).__v).__e, a = [], u = [], e.__P && ((n = ee({}, o)).__v = o.__v + 1, k.vnode && k.vnode(n), gt(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [l] : null, a, l ?? Ie(o), !!(32 & o.__u), u), n.__v = o.__v, n.__.__k[n.__i] = n, ci(a, n, u), o.__e = o.__ = null, n.__e != l && si(n)));
44
+ for (var t, e, n, o, l, s, u, c = 1; pe.length; ) pe.length > c && pe.sort(ni), t = pe.shift(), c = pe.length, t.__d && (n = void 0, o = void 0, l = (o = (e = t).__v).__e, s = [], u = [], e.__P && ((n = ee({}, o)).__v = o.__v + 1, k.vnode && k.vnode(n), gt(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [l] : null, s, l ?? Ie(o), !!(32 & o.__u), u), n.__v = o.__v, n.__.__k[n.__i] = n, ci(s, n, u), o.__e = o.__ = null, n.__e != l && si(n)));
45
45
  He.__r = 0;
46
46
  }
47
- function ai(t, e, n, o, l, a, u, c, m, p, _) {
47
+ function ai(t, e, n, o, l, s, u, c, E, p, _) {
48
48
  var d, S, g, y, C, A, I, b = o && o.__k || oi, R = e.length;
49
- for (m = Ji(n, e, b, m, R), d = 0; d < R; d++) (g = n.__k[d]) != null && (S = g.__i == -1 ? ke : b[g.__i] || ke, g.__i = d, A = gt(t, g, S, l, a, u, c, m, p, _), y = g.__e, g.ref && S.ref != g.ref && (S.ref && vt(S.ref, null, g), _.push(g.ref, g.__c || y, g)), C == null && y != null && (C = y), (I = !!(4 & g.__u)) || S.__k === g.__k ? m = li(g, m, t, I) : typeof g.type == "function" && A !== void 0 ? m = A : y && (m = y.nextSibling), g.__u &= -7);
50
- return n.__e = C, m;
49
+ for (E = Ji(n, e, b, E, R), d = 0; d < R; d++) (g = n.__k[d]) != null && (S = g.__i == -1 ? ke : b[g.__i] || ke, g.__i = d, A = gt(t, g, S, l, s, u, c, E, p, _), y = g.__e, g.ref && S.ref != g.ref && (S.ref && vt(S.ref, null, g), _.push(g.ref, g.__c || y, g)), C == null && y != null && (C = y), (I = !!(4 & g.__u)) || S.__k === g.__k ? E = li(g, E, t, I) : typeof g.type == "function" && A !== void 0 ? E = A : y && (E = y.nextSibling), g.__u &= -7);
50
+ return n.__e = C, E;
51
51
  }
52
52
  function Ji(t, e, n, o, l) {
53
- var a, u, c, m, p, _ = n.length, d = _, S = 0;
54
- for (t.__k = new Array(l), a = 0; a < l; a++) (u = e[a]) != null && typeof u != "boolean" && typeof u != "function" ? (typeof u == "string" || typeof u == "number" || typeof u == "bigint" || u.constructor == String ? u = t.__k[a] = Ne(null, u, null, null, null) : Je(u) ? u = t.__k[a] = Ne(fe, { children: u }, null, null, null) : u.constructor === void 0 && u.__b > 0 ? u = t.__k[a] = Ne(u.type, u.props, u.key, u.ref ? u.ref : null, u.__v) : t.__k[a] = u, m = a + S, u.__ = t, u.__b = t.__b + 1, c = null, (p = u.__i = Xi(u, n, m, d)) != -1 && (d--, (c = n[p]) && (c.__u |= 2)), c == null || c.__v == null ? (p == -1 && (l > _ ? S-- : l < _ && S++), typeof u.type != "function" && (u.__u |= 4)) : p != m && (p == m - 1 ? S-- : p == m + 1 ? S++ : (p > m ? S-- : S++, u.__u |= 4))) : t.__k[a] = null;
55
- if (d) for (a = 0; a < _; a++) (c = n[a]) != null && (2 & c.__u) == 0 && (c.__e == o && (o = Ie(c)), di(c, c));
53
+ var s, u, c, E, p, _ = n.length, d = _, S = 0;
54
+ for (t.__k = new Array(l), s = 0; s < l; s++) (u = e[s]) != null && typeof u != "boolean" && typeof u != "function" ? (typeof u == "string" || typeof u == "number" || typeof u == "bigint" || u.constructor == String ? u = t.__k[s] = Ne(null, u, null, null, null) : Je(u) ? u = t.__k[s] = Ne(fe, { children: u }, null, null, null) : u.constructor === void 0 && u.__b > 0 ? u = t.__k[s] = Ne(u.type, u.props, u.key, u.ref ? u.ref : null, u.__v) : t.__k[s] = u, E = s + S, u.__ = t, u.__b = t.__b + 1, c = null, (p = u.__i = Xi(u, n, E, d)) != -1 && (d--, (c = n[p]) && (c.__u |= 2)), c == null || c.__v == null ? (p == -1 && (l > _ ? S-- : l < _ && S++), typeof u.type != "function" && (u.__u |= 4)) : p != E && (p == E - 1 ? S-- : p == E + 1 ? S++ : (p > E ? S-- : S++, u.__u |= 4))) : t.__k[s] = null;
55
+ if (d) for (s = 0; s < _; s++) (c = n[s]) != null && (2 & c.__u) == 0 && (c.__e == o && (o = Ie(c)), di(c, c));
56
56
  return o;
57
57
  }
58
58
  function li(t, e, n, o) {
59
- var l, a;
59
+ var l, s;
60
60
  if (typeof t.type == "function") {
61
- for (l = t.__k, a = 0; l && a < l.length; a++) l[a] && (l[a].__ = t, e = li(l[a], e, n, o));
61
+ for (l = t.__k, s = 0; l && s < l.length; s++) l[s] && (l[s].__ = t, e = li(l[s], e, n, o));
62
62
  return e;
63
63
  }
64
64
  t.__e != e && (o && (e && t.type && !e.parentNode && (e = Ie(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
@@ -68,10 +68,10 @@ function li(t, e, n, o) {
68
68
  return e;
69
69
  }
70
70
  function Xi(t, e, n, o) {
71
- var l, a, u, c = t.key, m = t.type, p = e[n], _ = p != null && (2 & p.__u) == 0;
72
- if (p === null && c == null || _ && c == p.key && m == p.type) return n;
71
+ var l, s, u, c = t.key, E = t.type, p = e[n], _ = p != null && (2 & p.__u) == 0;
72
+ if (p === null && c == null || _ && c == p.key && E == p.type) return n;
73
73
  if (o > (_ ? 1 : 0)) {
74
- for (l = n - 1, a = n + 1; l >= 0 || a < e.length; ) if ((p = e[u = l >= 0 ? l-- : a++]) != null && (2 & p.__u) == 0 && c == p.key && m == p.type) return u;
74
+ for (l = n - 1, s = n + 1; l >= 0 || s < e.length; ) if ((p = e[u = l >= 0 ? l-- : s++]) != null && (2 & p.__u) == 0 && c == p.key && E == p.type) return u;
75
75
  }
76
76
  return -1;
77
77
  }
@@ -79,13 +79,13 @@ function Ut(t, e, n) {
79
79
  e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || Ki.test(e) ? n : n + "px";
80
80
  }
81
81
  function Pe(t, e, n, o, l) {
82
- var a, u;
82
+ var s, u;
83
83
  e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
84
84
  else {
85
85
  if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || Ut(t.style, e, "");
86
86
  if (n) for (e in n) o && n[e] == o[e] || Ut(t.style, e, n[e]);
87
87
  }
88
- else if (e[0] == "o" && e[1] == "n") a = e != (e = e.replace(ri, "$1")), u = e.toLowerCase(), e = u in t || e == "onFocusOut" || e == "onFocusIn" ? u.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + a] = n, n ? o ? n.u = o.u : (n.u = Et, t.addEventListener(e, a ? ct : lt, a)) : t.removeEventListener(e, a ? ct : lt, a);
88
+ else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(ri, "$1")), u = e.toLowerCase(), e = u in t || e == "onFocusOut" || e == "onFocusIn" ? u.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? o ? n.u = o.u : (n.u = mt, t.addEventListener(e, s ? ct : lt, s)) : t.removeEventListener(e, s ? ct : lt, s);
89
89
  else {
90
90
  if (l == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
91
91
  else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
@@ -100,16 +100,16 @@ function Lt(t) {
100
100
  return function(e) {
101
101
  if (this.l) {
102
102
  var n = this.l[e.type + t];
103
- if (e.t == null) e.t = Et++;
103
+ if (e.t == null) e.t = mt++;
104
104
  else if (e.t < n.u) return;
105
105
  return n(k.event ? k.event(e) : e);
106
106
  }
107
107
  };
108
108
  }
109
- function gt(t, e, n, o, l, a, u, c, m, p) {
109
+ function gt(t, e, n, o, l, s, u, c, E, p) {
110
110
  var _, d, S, g, y, C, A, I, b, R, M, x, Y, te, $, ie, ne, Z = e.type;
111
111
  if (e.constructor !== void 0) return null;
112
- 128 & n.__u && (m = !!(32 & n.__u), a = [c = e.__e = n.__e]), (_ = k.__b) && _(e);
112
+ 128 & n.__u && (E = !!(32 & n.__u), s = [c = e.__e = n.__e]), (_ = k.__b) && _(e);
113
113
  e: if (typeof Z == "function") try {
114
114
  if (I = e.props, b = "prototype" in Z && Z.prototype.render, R = (_ = Z.contextType) && o[_.__c], M = _ ? R ? R.props.value : _.__ : o, n.__c ? A = (d = e.__c = n.__c).__ = d.__E : (b ? e.__c = d = new Z(I, M) : (e.__c = d = new we(I, M), d.constructor = Z, d.render = Qi), R && R.sub(d), d.state || (d.state = {}), d.__n = o, S = d.__d = !0, d.__h = [], d._sb = []), b && d.__s == null && (d.__s = d.state), b && Z.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ee({}, d.__s)), ee(d.__s, Z.getDerivedStateFromProps(I, d.__s))), g = d.props, y = d.state, d.__v = e, S) b && Z.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), b && d.componentDidMount != null && d.__h.push(d.componentDidMount);
115
115
  else {
@@ -130,19 +130,19 @@ function gt(t, e, n, o, l, a, u, c, m, p) {
130
130
  } else do
131
131
  d.__d = !1, Y && Y(e), _ = d.render(d.props, d.state, d.context), d.state = d.__s;
132
132
  while (d.__d && ++te < 25);
133
- d.state = d.__s, d.getChildContext != null && (o = ee(ee({}, o), d.getChildContext())), b && !S && d.getSnapshotBeforeUpdate != null && (C = d.getSnapshotBeforeUpdate(g, y)), ie = _, _ != null && _.type === fe && _.key == null && (ie = ui(_.props.children)), c = ai(t, Je(ie) ? ie : [ie], e, n, o, l, a, u, c, m, p), d.base = e.__e, e.__u &= -161, d.__h.length && u.push(d), A && (d.__E = d.__ = null);
133
+ d.state = d.__s, d.getChildContext != null && (o = ee(ee({}, o), d.getChildContext())), b && !S && d.getSnapshotBeforeUpdate != null && (C = d.getSnapshotBeforeUpdate(g, y)), ie = _, _ != null && _.type === fe && _.key == null && (ie = ui(_.props.children)), c = ai(t, Je(ie) ? ie : [ie], e, n, o, l, s, u, c, E, p), d.base = e.__e, e.__u &= -161, d.__h.length && u.push(d), A && (d.__E = d.__ = null);
134
134
  } catch (oe) {
135
- if (e.__v = null, m || a != null) if (oe.then) {
136
- for (e.__u |= m ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
137
- a[a.indexOf(c)] = null, e.__e = c;
135
+ if (e.__v = null, E || s != null) if (oe.then) {
136
+ for (e.__u |= E ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
137
+ s[s.indexOf(c)] = null, e.__e = c;
138
138
  } else {
139
- for (ne = a.length; ne--; ) mt(a[ne]);
139
+ for (ne = s.length; ne--; ) Et(s[ne]);
140
140
  ut(e);
141
141
  }
142
142
  else e.__e = n.__e, e.__k = n.__k, oe.then || ut(e);
143
143
  k.__e(oe, e, n);
144
144
  }
145
- else a == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : c = e.__e = Zi(n.__e, e, n, o, l, a, u, m, p);
145
+ else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : c = e.__e = Zi(n.__e, e, n, o, l, s, u, E, p);
146
146
  return (_ = k.diffed) && _(e), 128 & e.__u ? void 0 : c;
147
147
  }
148
148
  function ut(t) {
@@ -152,32 +152,32 @@ function ci(t, e, n) {
152
152
  for (var o = 0; o < n.length; o++) vt(n[o], n[++o], n[++o]);
153
153
  k.__c && k.__c(e, t), t.some(function(l) {
154
154
  try {
155
- t = l.__h, l.__h = [], t.some(function(a) {
156
- a.call(l);
155
+ t = l.__h, l.__h = [], t.some(function(s) {
156
+ s.call(l);
157
157
  });
158
- } catch (a) {
159
- k.__e(a, l.__v);
158
+ } catch (s) {
159
+ k.__e(s, l.__v);
160
160
  }
161
161
  });
162
162
  }
163
163
  function ui(t) {
164
164
  return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : Je(t) ? t.map(ui) : ee({}, t);
165
165
  }
166
- function Zi(t, e, n, o, l, a, u, c, m) {
166
+ function Zi(t, e, n, o, l, s, u, c, E) {
167
167
  var p, _, d, S, g, y, C, A = n.props || ke, I = e.props, b = e.type;
168
- if (b == "svg" ? l = "http://www.w3.org/2000/svg" : b == "math" ? l = "http://www.w3.org/1998/Math/MathML" : l || (l = "http://www.w3.org/1999/xhtml"), a != null) {
169
- for (p = 0; p < a.length; p++) if ((g = a[p]) && "setAttribute" in g == !!b && (b ? g.localName == b : g.nodeType == 3)) {
170
- t = g, a[p] = null;
168
+ if (b == "svg" ? l = "http://www.w3.org/2000/svg" : b == "math" ? l = "http://www.w3.org/1998/Math/MathML" : l || (l = "http://www.w3.org/1999/xhtml"), s != null) {
169
+ for (p = 0; p < s.length; p++) if ((g = s[p]) && "setAttribute" in g == !!b && (b ? g.localName == b : g.nodeType == 3)) {
170
+ t = g, s[p] = null;
171
171
  break;
172
172
  }
173
173
  }
174
174
  if (t == null) {
175
175
  if (b == null) return document.createTextNode(I);
176
- t = document.createElementNS(l, b, I.is && I), c && (k.__m && k.__m(e, a), c = !1), a = null;
176
+ t = document.createElementNS(l, b, I.is && I), c && (k.__m && k.__m(e, s), c = !1), s = null;
177
177
  }
178
178
  if (b == null) A === I || c && t.data == I || (t.data = I);
179
179
  else {
180
- if (a = a && Ue.call(t.childNodes), !c && a != null) for (A = {}, p = 0; p < t.attributes.length; p++) A[(g = t.attributes[p]).name] = g.value;
180
+ if (s = s && Ue.call(t.childNodes), !c && s != null) for (A = {}, p = 0; p < t.attributes.length; p++) A[(g = t.attributes[p]).name] = g.value;
181
181
  for (p in A) if (g = A[p], p != "children") {
182
182
  if (p == "dangerouslySetInnerHTML") d = g;
183
183
  else if (!(p in I)) {
@@ -187,7 +187,7 @@ function Zi(t, e, n, o, l, a, u, c, m) {
187
187
  }
188
188
  for (p in I) g = I[p], p == "children" ? S = g : p == "dangerouslySetInnerHTML" ? _ = g : p == "value" ? y = g : p == "checked" ? C = g : c && typeof g != "function" || A[p] === g || Pe(t, p, g, A[p], l);
189
189
  if (_) c || d && (_.__html == d.__html || _.__html == t.innerHTML) || (t.innerHTML = _.__html), e.__k = [];
190
- else if (d && (t.innerHTML = ""), ai(e.type == "template" ? t.content : t, Je(S) ? S : [S], e, n, o, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : l, a, u, a ? a[0] : n.__k && Ie(n, 0), c, m), a != null) for (p = a.length; p--; ) mt(a[p]);
190
+ else if (d && (t.innerHTML = ""), ai(e.type == "template" ? t.content : t, Je(S) ? S : [S], e, n, o, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : l, s, u, s ? s[0] : n.__k && Ie(n, 0), c, E), s != null) for (p = s.length; p--; ) Et(s[p]);
191
191
  c || (p = "value", b == "progress" && y == null ? t.removeAttribute("value") : y != null && (y !== t[p] || b == "progress" && !y || b == "option" && y != A[p]) && Pe(t, p, y, A[p], l), p = "checked", C != null && C != t[p] && Pe(t, p, C, A[p], l));
192
192
  }
193
193
  return t;
@@ -207,32 +207,32 @@ function di(t, e, n) {
207
207
  if (k.unmount && k.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || vt(o, null, e)), (o = t.__c) != null) {
208
208
  if (o.componentWillUnmount) try {
209
209
  o.componentWillUnmount();
210
- } catch (a) {
211
- k.__e(a, e);
210
+ } catch (s) {
211
+ k.__e(s, e);
212
212
  }
213
213
  o.base = o.__P = null;
214
214
  }
215
215
  if (o = t.__k) for (l = 0; l < o.length; l++) o[l] && di(o[l], e, n || typeof t.type != "function");
216
- n || mt(t.__e), t.__c = t.__ = t.__e = void 0;
216
+ n || Et(t.__e), t.__c = t.__ = t.__e = void 0;
217
217
  }
218
218
  function Qi(t, e, n) {
219
219
  return this.constructor(t, n);
220
220
  }
221
221
  function Xe(t, e, n) {
222
- var o, l, a, u;
223
- e == document && (e = document.documentElement), k.__ && k.__(t, e), l = (o = typeof n == "function") ? null : n && n.__k || e.__k, a = [], u = [], gt(e, t = (!o && n || e).__k = Se(fe, null, [t]), l || ke, ke, e.namespaceURI, !o && n ? [n] : l ? null : e.firstChild ? Ue.call(e.childNodes) : null, a, !o && n ? n : l ? l.__e : e.firstChild, o, u), ci(a, t, u);
222
+ var o, l, s, u;
223
+ e == document && (e = document.documentElement), k.__ && k.__(t, e), l = (o = typeof n == "function") ? null : n && n.__k || e.__k, s = [], u = [], gt(e, t = (!o && n || e).__k = Se(fe, null, [t]), l || ke, ke, e.namespaceURI, !o && n ? [n] : l ? null : e.firstChild ? Ue.call(e.childNodes) : null, s, !o && n ? n : l ? l.__e : e.firstChild, o, u), ci(s, t, u);
224
224
  }
225
225
  function hi(t, e) {
226
226
  Xe(t, e, hi);
227
227
  }
228
228
  function fi(t, e, n) {
229
- var o, l, a, u, c = ee({}, t.props);
230
- for (a in t.type && t.type.defaultProps && (u = t.type.defaultProps), e) a == "key" ? o = e[a] : a == "ref" ? l = e[a] : c[a] = e[a] === void 0 && u != null ? u[a] : e[a];
229
+ var o, l, s, u, c = ee({}, t.props);
230
+ for (s in t.type && t.type.defaultProps && (u = t.type.defaultProps), e) s == "key" ? o = e[s] : s == "ref" ? l = e[s] : c[s] = e[s] === void 0 && u != null ? u[s] : e[s];
231
231
  return arguments.length > 2 && (c.children = arguments.length > 3 ? Ue.call(arguments, 2) : n), Ne(t.type, c, o || t.key, l || t.ref, null);
232
232
  }
233
233
  Ue = oi.slice, k = { __e: function(t, e, n, o) {
234
- for (var l, a, u; e = e.__; ) if ((l = e.__c) && !l.__) try {
235
- if ((a = l.constructor) && a.getDerivedStateFromError != null && (l.setState(a.getDerivedStateFromError(t)), u = l.__d), l.componentDidCatch != null && (l.componentDidCatch(t, o || {}), u = l.__d), u) return l.__E = l;
234
+ for (var l, s, u; e = e.__; ) if ((l = e.__c) && !l.__) try {
235
+ if ((s = l.constructor) && s.getDerivedStateFromError != null && (l.setState(s.getDerivedStateFromError(t)), u = l.__d), l.componentDidCatch != null && (l.componentDidCatch(t, o || {}), u = l.__d), u) return l.__E = l;
236
236
  } catch (c) {
237
237
  t = c;
238
238
  }
@@ -246,7 +246,7 @@ Ue = oi.slice, k = { __e: function(t, e, n, o) {
246
246
  this.__v && (this.__e = !0, t && this.__h.push(t), Mt(this));
247
247
  }, we.prototype.render = fe, pe = [], ii = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, ni = function(t, e) {
248
248
  return t.__v.__b - e.__v.__b;
249
- }, He.__r = 0, ri = /(PointerCapture)$|Capture$/i, Et = 0, lt = Lt(!1), ct = Lt(!0);
249
+ }, He.__r = 0, ri = /(PointerCapture)$|Capture$/i, mt = 0, lt = Lt(!1), ct = Lt(!0);
250
250
  function We() {
251
251
  return We = Object.assign ? Object.assign.bind() : function(t) {
252
252
  for (var e = 1; e < arguments.length; e++) {
@@ -258,25 +258,25 @@ function We() {
258
258
  }
259
259
  function pi(t, e) {
260
260
  if (t == null) return {};
261
- var n, o, l = {}, a = Object.keys(t);
262
- for (o = 0; o < a.length; o++) e.indexOf(n = a[o]) >= 0 || (l[n] = t[n]);
261
+ var n, o, l = {}, s = Object.keys(t);
262
+ for (o = 0; o < s.length; o++) e.indexOf(n = s[o]) >= 0 || (l[n] = t[n]);
263
263
  return l;
264
264
  }
265
265
  var en = ["context", "children"], tn = ["useFragment"];
266
266
  function nn(t, e, n, o) {
267
267
  function l() {
268
- var a, u = Reflect.construct(HTMLElement, [], l);
269
- return u._vdomComponent = t, o && o.shadow ? (u._root = u.attachShadow({ mode: o.mode || "open", serializable: (a = o.serializable) != null && a }), o.adoptedStyleSheets && (u._root.adoptedStyleSheets = o.adoptedStyleSheets)) : u._root = u, u;
268
+ var s, u = Reflect.construct(HTMLElement, [], l);
269
+ return u._vdomComponent = t, o && o.shadow ? (u._root = u.attachShadow({ mode: o.mode || "open", serializable: (s = o.serializable) != null && s }), o.adoptedStyleSheets && (u._root.adoptedStyleSheets = o.adoptedStyleSheets)) : u._root = u, u;
270
270
  }
271
271
  return (l.prototype = Object.create(HTMLElement.prototype)).constructor = l, l.prototype.connectedCallback = function() {
272
272
  on.call(this, o);
273
- }, l.prototype.attributeChangedCallback = sn, l.prototype.disconnectedCallback = an, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), l.observedAttributes = n, t.formAssociated && (l.formAssociated = !0), n.forEach(function(a) {
274
- Object.defineProperty(l.prototype, a, { get: function() {
275
- return this._vdom ? this._vdom.props[a] : this._props[a];
273
+ }, l.prototype.attributeChangedCallback = sn, l.prototype.disconnectedCallback = an, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), l.observedAttributes = n, t.formAssociated && (l.formAssociated = !0), n.forEach(function(s) {
274
+ Object.defineProperty(l.prototype, s, { get: function() {
275
+ return this._vdom ? this._vdom.props[s] : this._props[s];
276
276
  }, set: function(u) {
277
- this._vdom ? this.attributeChangedCallback(a, null, u) : (this._props || (this._props = {}), this._props[a] = u);
277
+ this._vdom ? this.attributeChangedCallback(s, null, u) : (this._props || (this._props = {}), this._props[s] = u);
278
278
  var c = typeof u;
279
- u != null && c !== "string" && c !== "boolean" && c !== "number" || this.setAttribute(a, u);
279
+ u != null && c !== "string" && c !== "boolean" && c !== "number" || this.setAttribute(s, u);
280
280
  } });
281
281
  }), customElements.define(e || t.tagName || t.displayName || t.name, l), l;
282
282
  }
@@ -289,7 +289,7 @@ function rn(t) {
289
289
  }
290
290
  function on(t) {
291
291
  var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
292
- this.dispatchEvent(e), this._vdom = Se(rn, We({}, this._props, { context: e.detail.context }), Ei(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? hi : Xe)(this._vdom, this._root);
292
+ this.dispatchEvent(e), this._vdom = Se(rn, We({}, this._props, { context: e.detail.context }), mi(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? hi : Xe)(this._vdom, this._root);
293
293
  }
294
294
  function _i(t) {
295
295
  return t.replace(/-(\w)/g, function(e, n) {
@@ -307,34 +307,34 @@ function an() {
307
307
  }
308
308
  function Bt(t, e) {
309
309
  var n = this, o = t.useFragment, l = pi(t, tn);
310
- return Se(o ? fe : "slot", We({}, l, { ref: function(a) {
311
- a ? (n.ref = a, n._listener || (n._listener = function(u) {
310
+ return Se(o ? fe : "slot", We({}, l, { ref: function(s) {
311
+ s ? (n.ref = s, n._listener || (n._listener = function(u) {
312
312
  u.stopPropagation(), u.detail.context = e;
313
- }, a.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
313
+ }, s.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
314
314
  } }));
315
315
  }
316
- function Ei(t, e, n) {
316
+ function mi(t, e, n) {
317
317
  if (t.nodeType === 3) return t.data;
318
318
  if (t.nodeType !== 1) return null;
319
- var o = [], l = {}, a = 0, u = t.attributes, c = t.childNodes;
320
- for (a = u.length; a--; ) u[a].name !== "slot" && (l[u[a].name] = u[a].value, l[_i(u[a].name)] = u[a].value);
321
- for (a = c.length; a--; ) {
322
- var m = Ei(c[a], null, n), p = c[a].slot;
323
- p ? l[p] = Se(Bt, { name: p }, m) : o[a] = m;
319
+ var o = [], l = {}, s = 0, u = t.attributes, c = t.childNodes;
320
+ for (s = u.length; s--; ) u[s].name !== "slot" && (l[u[s].name] = u[s].value, l[_i(u[s].name)] = u[s].value);
321
+ for (s = c.length; s--; ) {
322
+ var E = mi(c[s], null, n), p = c[s].slot;
323
+ p ? l[p] = Se(Bt, { name: p }, E) : o[s] = E;
324
324
  }
325
325
  var _ = !(!n || !n.shadow), d = e ? Se(Bt, { useFragment: !_ }, o) : o;
326
326
  return !_ && e && (t.innerHTML = ""), Se(e || t.nodeName.toLowerCase(), l, d);
327
327
  }
328
328
  var ln = 0;
329
- function w(t, e, n, o, l, a) {
329
+ function w(t, e, n, o, l, s) {
330
330
  e || (e = {});
331
- var u, c, m = e;
332
- if ("ref" in m) for (c in m = {}, e) c == "ref" ? u = e[c] : m[c] = e[c];
333
- var p = { type: t, props: m, key: n, ref: u, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --ln, __i: -1, __u: 0, __source: l, __self: a };
334
- if (typeof t == "function" && (u = t.defaultProps)) for (c in u) m[c] === void 0 && (m[c] = u[c]);
331
+ var u, c, E = e;
332
+ if ("ref" in E) for (c in E = {}, e) c == "ref" ? u = e[c] : E[c] = e[c];
333
+ var p = { type: t, props: E, key: n, ref: u, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --ln, __i: -1, __u: 0, __source: l, __self: s };
334
+ if (typeof t == "function" && (u = t.defaultProps)) for (c in u) E[c] === void 0 && (E[c] = u[c]);
335
335
  return k.vnode && k.vnode(p), p;
336
336
  }
337
- var De, P, it, Pt, Me = 0, mi = [], F = k, Ft = F.__b, $t = F.__r, Vt = F.diffed, Gt = F.__c, jt = F.unmount, Ht = F.__;
337
+ var De, P, it, Pt, Me = 0, Ei = [], F = k, Ft = F.__b, $t = F.__r, Vt = F.diffed, Gt = F.__c, jt = F.unmount, Ht = F.__;
338
338
  function yt(t, e) {
339
339
  F.__h && F.__h(P, t, Me || e), Me = 0;
340
340
  var n = P.__H || (P.__H = { __: [], __h: [] });
@@ -346,33 +346,33 @@ function Ve(t) {
346
346
  function cn(t, e, n) {
347
347
  var o = yt(De++, 2);
348
348
  if (o.t = t, !o.__c && (o.__ = [vi(void 0, e), function(c) {
349
- var m = o.__N ? o.__N[0] : o.__[0], p = o.t(m, c);
350
- m !== p && (o.__N = [p, o.__[1]], o.__c.setState({}));
349
+ var E = o.__N ? o.__N[0] : o.__[0], p = o.t(E, c);
350
+ E !== p && (o.__N = [p, o.__[1]], o.__c.setState({}));
351
351
  }], o.__c = P, !P.__f)) {
352
- var l = function(c, m, p) {
352
+ var l = function(c, E, p) {
353
353
  if (!o.__c.__H) return !0;
354
354
  var _ = o.__c.__H.__.filter(function(S) {
355
355
  return !!S.__c;
356
356
  });
357
357
  if (_.every(function(S) {
358
358
  return !S.__N;
359
- })) return !a || a.call(this, c, m, p);
359
+ })) return !s || s.call(this, c, E, p);
360
360
  var d = o.__c.props !== c;
361
361
  return _.forEach(function(S) {
362
362
  if (S.__N) {
363
363
  var g = S.__[0];
364
364
  S.__ = S.__N, S.__N = void 0, g !== S.__[0] && (d = !0);
365
365
  }
366
- }), a && a.call(this, c, m, p) || d;
366
+ }), s && s.call(this, c, E, p) || d;
367
367
  };
368
368
  P.__f = !0;
369
- var a = P.shouldComponentUpdate, u = P.componentWillUpdate;
370
- P.componentWillUpdate = function(c, m, p) {
369
+ var s = P.shouldComponentUpdate, u = P.componentWillUpdate;
370
+ P.componentWillUpdate = function(c, E, p) {
371
371
  if (this.__e) {
372
- var _ = a;
373
- a = void 0, l(c, m, p), a = _;
372
+ var _ = s;
373
+ s = void 0, l(c, E, p), s = _;
374
374
  }
375
- u && u.call(this, c, m, p);
375
+ u && u.call(this, c, E, p);
376
376
  }, P.shouldComponentUpdate = l;
377
377
  }
378
378
  return o.__N || o.__;
@@ -396,7 +396,7 @@ function nt(t, e) {
396
396
  }, e);
397
397
  }
398
398
  function un() {
399
- for (var t; t = mi.shift(); ) if (t.__P && t.__H) try {
399
+ for (var t; t = Ei.shift(); ) if (t.__P && t.__H) try {
400
400
  t.__H.__h.forEach(je), t.__H.__h.forEach(dt), t.__H.__h = [];
401
401
  } catch (e) {
402
402
  t.__H.__h = [], F.__e(e, t.__v);
@@ -415,7 +415,7 @@ F.__b = function(t) {
415
415
  }, F.diffed = function(t) {
416
416
  Vt && Vt(t);
417
417
  var e = t.__c;
418
- e && e.__H && (e.__H.__h.length && (mi.push(e) !== 1 && Pt === F.requestAnimationFrame || ((Pt = F.requestAnimationFrame) || dn)(un)), e.__H.__.forEach(function(n) {
418
+ e && e.__H && (e.__H.__h.length && (Ei.push(e) !== 1 && Pt === F.requestAnimationFrame || ((Pt = F.requestAnimationFrame) || dn)(un)), e.__H.__.forEach(function(n) {
419
419
  n.u && (n.__H = n.u), n.u = void 0;
420
420
  })), it = P = null;
421
421
  }, F.__c = function(t, e) {
@@ -604,11 +604,11 @@ function Ii(t) {
604
604
  }
605
605
  t.s = n;
606
606
  }
607
- function Ee(t, e) {
607
+ function me(t, e) {
608
608
  H.call(this, void 0), this.x = t, this.s = void 0, this.g = qe - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
609
609
  }
610
- Ee.prototype = new H();
611
- Ee.prototype.h = function() {
610
+ me.prototype = new H();
611
+ me.prototype.h = function() {
612
612
  if (this.f &= -3, 1 & this.f) return !1;
613
613
  if ((36 & this.f) == 32 || (this.f &= -5, this.g === qe)) return !0;
614
614
  if (this.g = qe, this.f |= 1, this.i > 0 && !wi(this))
@@ -623,33 +623,33 @@ Ee.prototype.h = function() {
623
623
  }
624
624
  return O = t, Ii(this), this.f &= -2, !0;
625
625
  };
626
- Ee.prototype.S = function(t) {
626
+ me.prototype.S = function(t) {
627
627
  if (this.t === void 0) {
628
628
  this.f |= 36;
629
629
  for (var e = this.s; e !== void 0; e = e.n) e.S.S(e);
630
630
  }
631
631
  H.prototype.S.call(this, t);
632
632
  };
633
- Ee.prototype.U = function(t) {
633
+ me.prototype.U = function(t) {
634
634
  if (this.t !== void 0 && (H.prototype.U.call(this, t), this.t === void 0)) {
635
635
  this.f &= -33;
636
636
  for (var e = this.s; e !== void 0; e = e.n) e.S.U(e);
637
637
  }
638
638
  };
639
- Ee.prototype.N = function() {
639
+ me.prototype.N = function() {
640
640
  if (!(2 & this.f)) {
641
641
  this.f |= 6;
642
642
  for (var t = this.t; t !== void 0; t = t.x) t.t.N();
643
643
  }
644
644
  };
645
- Object.defineProperty(Ee.prototype, "value", { get: function() {
645
+ Object.defineProperty(me.prototype, "value", { get: function() {
646
646
  if (1 & this.f) throw new Error("Cycle detected");
647
647
  var t = Si(this);
648
648
  if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
649
649
  return this.v;
650
650
  } });
651
651
  function zt(t, e) {
652
- return new Ee(t, e);
652
+ return new me(t, e);
653
653
  }
654
654
  function bi(t) {
655
655
  var e = t.u;
@@ -727,8 +727,8 @@ function Ri(t) {
727
727
  var e = this, n = t.data, o = Ni(n);
728
728
  o.value = n;
729
729
  var l = Ce(function() {
730
- for (var c = e, m = e.__v; m = m.__; ) if (m.__c) {
731
- m.__c.__$f |= 4;
730
+ for (var c = e, E = e.__v; E = E.__; ) if (E.__c) {
731
+ E.__c.__$f |= 4;
732
732
  break;
733
733
  }
734
734
  var p = zt(function() {
@@ -745,8 +745,8 @@ function Ri(t) {
745
745
  return e.__$u.d = function() {
746
746
  d(), S.call(this);
747
747
  }, [_, p];
748
- }, []), a = l[0], u = l[1];
749
- return a.value ? u.peek() : u.value;
748
+ }, []), s = l[0], u = l[1];
749
+ return s.value ? u.peek() : u.value;
750
750
  }
751
751
  Ri.displayName = "ReactiveTextNode";
752
752
  Object.defineProperties(H.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Ri }, props: { configurable: !0, get: function() {
@@ -756,8 +756,8 @@ Ae("__b", function(t, e) {
756
756
  if (typeof e.type == "string") {
757
757
  var n, o = e.props;
758
758
  for (var l in o) if (l !== "children") {
759
- var a = o[l];
760
- a instanceof H && (n || (e.__np = n = {}), n[l] = a, o[l] = a.peek());
759
+ var s = o[l];
760
+ s instanceof H && (n || (e.__np = n = {}), n[l] = s, o[l] = s.peek());
761
761
  }
762
762
  }
763
763
  t(e);
@@ -766,11 +766,11 @@ Ae("__r", function(t, e) {
766
766
  if (e.type !== fe) {
767
767
  Ye();
768
768
  var n, o = e.__c;
769
- o && (o.__$f &= -2, (n = o.__$u) === void 0 && (o.__$u = n = (function(l, a) {
769
+ o && (o.__$f &= -2, (n = o.__$u) === void 0 && (o.__$u = n = (function(l, s) {
770
770
  var u;
771
771
  return Le(function() {
772
772
  u = this;
773
- }, { name: a }), u.c = l, u;
773
+ }, { name: s }), u.c = l, u;
774
774
  })(function() {
775
775
  var l;
776
776
  _n && ((l = n.y) == null || l.call(n)), o.__$f |= 1, o.setState({});
@@ -787,28 +787,28 @@ Ae("diffed", function(t, e) {
787
787
  if (typeof e.type == "string" && (n = e.__e)) {
788
788
  var o = e.__np, l = e.props;
789
789
  if (o) {
790
- var a = n.U;
791
- if (a) for (var u in a) {
792
- var c = a[u];
793
- c !== void 0 && !(u in o) && (c.d(), a[u] = void 0);
790
+ var s = n.U;
791
+ if (s) for (var u in s) {
792
+ var c = s[u];
793
+ c !== void 0 && !(u in o) && (c.d(), s[u] = void 0);
794
794
  }
795
795
  else
796
- a = {}, n.U = a;
797
- for (var m in o) {
798
- var p = a[m], _ = o[m];
799
- p === void 0 ? (p = En(n, m, _, l), a[m] = p) : p.o(_, l);
796
+ s = {}, n.U = s;
797
+ for (var E in o) {
798
+ var p = s[E], _ = o[E];
799
+ p === void 0 ? (p = mn(n, E, _, l), s[E] = p) : p.o(_, l);
800
800
  }
801
801
  }
802
802
  }
803
803
  t(e);
804
804
  });
805
- function En(t, e, n, o) {
806
- var l = e in t && t.ownerSVGElement === void 0, a = z(n);
805
+ function mn(t, e, n, o) {
806
+ var l = e in t && t.ownerSVGElement === void 0, s = z(n);
807
807
  return { o: function(u, c) {
808
- a.value = u, o = c;
808
+ s.value = u, o = c;
809
809
  }, d: Le(function() {
810
810
  this.N = xi;
811
- var u = a.value.value;
811
+ var u = s.value.value;
812
812
  o[e] !== u && (o[e] = u, l ? t[e] = u : u != null && (u !== !1 || e[4] === "-") ? t.setAttribute(e, u) : t.removeAttribute(e));
813
813
  }) };
814
814
  }
@@ -820,8 +820,8 @@ Ae("unmount", function(t, e) {
820
820
  if (o) {
821
821
  n.U = void 0;
822
822
  for (var l in o) {
823
- var a = o[l];
824
- a && a.d();
823
+ var s = o[l];
824
+ s && s.d();
825
825
  }
826
826
  }
827
827
  }
@@ -842,8 +842,8 @@ we.prototype.shouldComponentUpdate = function(t, e) {
842
842
  var n = this.__$u, o = n && n.s !== void 0;
843
843
  for (var l in e) return !0;
844
844
  if (this.__f || typeof this.u == "boolean" && this.u === !0) {
845
- var a = 2 & this.__$f;
846
- if (!(o || a || 4 & this.__$f) || 1 & this.__$f) return !0;
845
+ var s = 2 & this.__$f;
846
+ if (!(o || s || 4 & this.__$f) || 1 & this.__$f) return !0;
847
847
  } else if (!(o || 4 & this.__$f) || 3 & this.__$f) return !0;
848
848
  for (var u in t) if (u !== "__source" && t[u] !== this.props[u]) return !0;
849
849
  for (var c in this.props) if (!(c in t)) return !0;
@@ -854,7 +854,7 @@ function Ni(t, e) {
854
854
  return z(t, e);
855
855
  })[0];
856
856
  }
857
- var mn = function(t) {
857
+ var En = function(t) {
858
858
  queueMicrotask(function() {
859
859
  queueMicrotask(t);
860
860
  });
@@ -865,7 +865,7 @@ function gn() {
865
865
  });
866
866
  }
867
867
  function xi() {
868
- Ti.push(this) === 1 && (k.requestAnimationFrame || mn)(gn);
868
+ Ti.push(this) === 1 && (k.requestAnimationFrame || En)(gn);
869
869
  }
870
870
  const qt = {
871
871
  layout: "floating",
@@ -899,11 +899,11 @@ function yn(t) {
899
899
  if (!e) return Fe["bottom-right"];
900
900
  const n = {};
901
901
  for (const o of e[1].split(",")) {
902
- const l = o.trim(), a = l.lastIndexOf("-");
903
- if (a <= 0) continue;
904
- const u = l.slice(0, a);
902
+ const l = o.trim(), s = l.lastIndexOf("-");
903
+ if (s <= 0) continue;
904
+ const u = l.slice(0, s);
905
905
  if (!vn.has(u)) continue;
906
- const c = l.slice(a + 1);
906
+ const c = l.slice(s + 1);
907
907
  /^[\w.%-]+$/.test(c) && (n[u] = /^\d+$/.test(c) ? `${c}px` : c);
908
908
  }
909
909
  return Object.keys(n).length > 0 ? n : Fe["bottom-right"];
@@ -912,7 +912,7 @@ var ot = {}, Re = {}, Yt;
912
912
  function Sn() {
913
913
  if (Yt) return Re;
914
914
  Yt = 1, Re.byteLength = c, Re.toByteArray = p, Re.fromByteArray = S;
915
- for (var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = 0, a = o.length; l < a; ++l)
915
+ for (var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = 0, s = o.length; l < s; ++l)
916
916
  t[l] = o[l], e[o.charCodeAt(l)] = l;
917
917
  e[45] = 62, e[95] = 63;
918
918
  function u(g) {
@@ -928,11 +928,11 @@ function Sn() {
928
928
  var y = u(g), C = y[0], A = y[1];
929
929
  return (C + A) * 3 / 4 - A;
930
930
  }
931
- function m(g, y, C) {
931
+ function E(g, y, C) {
932
932
  return (y + C) * 3 / 4 - C;
933
933
  }
934
934
  function p(g) {
935
- var y, C = u(g), A = C[0], I = C[1], b = new n(m(g, A, I)), R = 0, M = I > 0 ? A - 4 : A, x;
935
+ var y, C = u(g), A = C[0], I = C[1], b = new n(E(g, A, I)), R = 0, M = I > 0 ? A - 4 : A, x;
936
936
  for (x = 0; x < M; x += 4)
937
937
  y = e[g.charCodeAt(x)] << 18 | e[g.charCodeAt(x + 1)] << 12 | e[g.charCodeAt(x + 2)] << 6 | e[g.charCodeAt(x + 3)], b[R++] = y >> 16 & 255, b[R++] = y >> 8 & 255, b[R++] = y & 255;
938
938
  return I === 2 && (y = e[g.charCodeAt(x)] << 2 | e[g.charCodeAt(x + 1)] >> 4, b[R++] = y & 255), I === 1 && (y = e[g.charCodeAt(x)] << 10 | e[g.charCodeAt(x + 1)] << 4 | e[g.charCodeAt(x + 2)] >> 2, b[R++] = y >> 8 & 255, b[R++] = y & 255), b;
@@ -960,22 +960,22 @@ var $e = {};
960
960
  var Kt;
961
961
  function wn() {
962
962
  return Kt || (Kt = 1, $e.read = function(t, e, n, o, l) {
963
- var a, u, c = l * 8 - o - 1, m = (1 << c) - 1, p = m >> 1, _ = -7, d = n ? l - 1 : 0, S = n ? -1 : 1, g = t[e + d];
964
- for (d += S, a = g & (1 << -_) - 1, g >>= -_, _ += c; _ > 0; a = a * 256 + t[e + d], d += S, _ -= 8)
963
+ var s, u, c = l * 8 - o - 1, E = (1 << c) - 1, p = E >> 1, _ = -7, d = n ? l - 1 : 0, S = n ? -1 : 1, g = t[e + d];
964
+ for (d += S, s = g & (1 << -_) - 1, g >>= -_, _ += c; _ > 0; s = s * 256 + t[e + d], d += S, _ -= 8)
965
965
  ;
966
- for (u = a & (1 << -_) - 1, a >>= -_, _ += o; _ > 0; u = u * 256 + t[e + d], d += S, _ -= 8)
966
+ for (u = s & (1 << -_) - 1, s >>= -_, _ += o; _ > 0; u = u * 256 + t[e + d], d += S, _ -= 8)
967
967
  ;
968
- if (a === 0)
969
- a = 1 - p;
968
+ if (s === 0)
969
+ s = 1 - p;
970
970
  else {
971
- if (a === m)
971
+ if (s === E)
972
972
  return u ? NaN : (g ? -1 : 1) * (1 / 0);
973
- u = u + Math.pow(2, o), a = a - p;
973
+ u = u + Math.pow(2, o), s = s - p;
974
974
  }
975
- return (g ? -1 : 1) * u * Math.pow(2, a - o);
976
- }, $e.write = function(t, e, n, o, l, a) {
977
- var u, c, m, p = a * 8 - l - 1, _ = (1 << p) - 1, d = _ >> 1, S = l === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = o ? 0 : a - 1, y = o ? 1 : -1, C = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
978
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, u = _) : (u = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -u)) < 1 && (u--, m *= 2), u + d >= 1 ? e += S / m : e += S * Math.pow(2, 1 - d), e * m >= 2 && (u++, m /= 2), u + d >= _ ? (c = 0, u = _) : u + d >= 1 ? (c = (e * m - 1) * Math.pow(2, l), u = u + d) : (c = e * Math.pow(2, d - 1) * Math.pow(2, l), u = 0)); l >= 8; t[n + g] = c & 255, g += y, c /= 256, l -= 8)
975
+ return (g ? -1 : 1) * u * Math.pow(2, s - o);
976
+ }, $e.write = function(t, e, n, o, l, s) {
977
+ var u, c, E, p = s * 8 - l - 1, _ = (1 << p) - 1, d = _ >> 1, S = l === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = o ? 0 : s - 1, y = o ? 1 : -1, C = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
978
+ for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, u = _) : (u = Math.floor(Math.log(e) / Math.LN2), e * (E = Math.pow(2, -u)) < 1 && (u--, E *= 2), u + d >= 1 ? e += S / E : e += S * Math.pow(2, 1 - d), e * E >= 2 && (u++, E /= 2), u + d >= _ ? (c = 0, u = _) : u + d >= 1 ? (c = (e * E - 1) * Math.pow(2, l), u = u + d) : (c = e * Math.pow(2, d - 1) * Math.pow(2, l), u = 0)); l >= 8; t[n + g] = c & 255, g += y, c /= 256, l -= 8)
979
979
  ;
980
980
  for (u = u << l | c, p += l; p > 0; t[n + g] = u & 255, g += y, u /= 256, p -= 8)
981
981
  ;
@@ -988,15 +988,15 @@ function Cn() {
988
988
  const e = Sn(), n = wn(), o = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
989
989
  t.Buffer = c, t.SlowBuffer = b, t.INSPECT_MAX_BYTES = 50;
990
990
  const l = 2147483647;
991
- t.kMaxLength = l, c.TYPED_ARRAY_SUPPORT = a(), !c.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
991
+ t.kMaxLength = l, c.TYPED_ARRAY_SUPPORT = s(), !c.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
992
992
  "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
993
993
  );
994
- function a() {
994
+ function s() {
995
995
  try {
996
- const s = new Uint8Array(1), i = { foo: function() {
996
+ const a = new Uint8Array(1), i = { foo: function() {
997
997
  return 42;
998
998
  } };
999
- return Object.setPrototypeOf(i, Uint8Array.prototype), Object.setPrototypeOf(s, i), s.foo() === 42;
999
+ return Object.setPrototypeOf(i, Uint8Array.prototype), Object.setPrototypeOf(a, i), a.foo() === 42;
1000
1000
  } catch {
1001
1001
  return !1;
1002
1002
  }
@@ -1014,118 +1014,118 @@ function Cn() {
1014
1014
  return this.byteOffset;
1015
1015
  }
1016
1016
  });
1017
- function u(s) {
1018
- if (s > l)
1019
- throw new RangeError('The value "' + s + '" is invalid for option "size"');
1020
- const i = new Uint8Array(s);
1017
+ function u(a) {
1018
+ if (a > l)
1019
+ throw new RangeError('The value "' + a + '" is invalid for option "size"');
1020
+ const i = new Uint8Array(a);
1021
1021
  return Object.setPrototypeOf(i, c.prototype), i;
1022
1022
  }
1023
- function c(s, i, r) {
1024
- if (typeof s == "number") {
1023
+ function c(a, i, r) {
1024
+ if (typeof a == "number") {
1025
1025
  if (typeof i == "string")
1026
1026
  throw new TypeError(
1027
1027
  'The "string" argument must be of type string. Received type number'
1028
1028
  );
1029
- return d(s);
1029
+ return d(a);
1030
1030
  }
1031
- return m(s, i, r);
1031
+ return E(a, i, r);
1032
1032
  }
1033
1033
  c.poolSize = 8192;
1034
- function m(s, i, r) {
1035
- if (typeof s == "string")
1036
- return S(s, i);
1037
- if (ArrayBuffer.isView(s))
1038
- return y(s);
1039
- if (s == null)
1034
+ function E(a, i, r) {
1035
+ if (typeof a == "string")
1036
+ return S(a, i);
1037
+ if (ArrayBuffer.isView(a))
1038
+ return y(a);
1039
+ if (a == null)
1040
1040
  throw new TypeError(
1041
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
1041
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof a
1042
1042
  );
1043
- if (Q(s, ArrayBuffer) || s && Q(s.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Q(s, SharedArrayBuffer) || s && Q(s.buffer, SharedArrayBuffer)))
1044
- return C(s, i, r);
1045
- if (typeof s == "number")
1043
+ if (Q(a, ArrayBuffer) || a && Q(a.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Q(a, SharedArrayBuffer) || a && Q(a.buffer, SharedArrayBuffer)))
1044
+ return C(a, i, r);
1045
+ if (typeof a == "number")
1046
1046
  throw new TypeError(
1047
1047
  'The "value" argument must not be of type number. Received type number'
1048
1048
  );
1049
- const h = s.valueOf && s.valueOf();
1050
- if (h != null && h !== s)
1049
+ const h = a.valueOf && a.valueOf();
1050
+ if (h != null && h !== a)
1051
1051
  return c.from(h, i, r);
1052
- const f = A(s);
1052
+ const f = A(a);
1053
1053
  if (f) return f;
1054
- if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof s[Symbol.toPrimitive] == "function")
1055
- return c.from(s[Symbol.toPrimitive]("string"), i, r);
1054
+ if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof a[Symbol.toPrimitive] == "function")
1055
+ return c.from(a[Symbol.toPrimitive]("string"), i, r);
1056
1056
  throw new TypeError(
1057
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
1057
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof a
1058
1058
  );
1059
1059
  }
1060
- c.from = function(s, i, r) {
1061
- return m(s, i, r);
1060
+ c.from = function(a, i, r) {
1061
+ return E(a, i, r);
1062
1062
  }, Object.setPrototypeOf(c.prototype, Uint8Array.prototype), Object.setPrototypeOf(c, Uint8Array);
1063
- function p(s) {
1064
- if (typeof s != "number")
1063
+ function p(a) {
1064
+ if (typeof a != "number")
1065
1065
  throw new TypeError('"size" argument must be of type number');
1066
- if (s < 0)
1067
- throw new RangeError('The value "' + s + '" is invalid for option "size"');
1066
+ if (a < 0)
1067
+ throw new RangeError('The value "' + a + '" is invalid for option "size"');
1068
1068
  }
1069
- function _(s, i, r) {
1070
- return p(s), s <= 0 ? u(s) : i !== void 0 ? typeof r == "string" ? u(s).fill(i, r) : u(s).fill(i) : u(s);
1069
+ function _(a, i, r) {
1070
+ return p(a), a <= 0 ? u(a) : i !== void 0 ? typeof r == "string" ? u(a).fill(i, r) : u(a).fill(i) : u(a);
1071
1071
  }
1072
- c.alloc = function(s, i, r) {
1073
- return _(s, i, r);
1072
+ c.alloc = function(a, i, r) {
1073
+ return _(a, i, r);
1074
1074
  };
1075
- function d(s) {
1076
- return p(s), u(s < 0 ? 0 : I(s) | 0);
1075
+ function d(a) {
1076
+ return p(a), u(a < 0 ? 0 : I(a) | 0);
1077
1077
  }
1078
- c.allocUnsafe = function(s) {
1079
- return d(s);
1080
- }, c.allocUnsafeSlow = function(s) {
1081
- return d(s);
1078
+ c.allocUnsafe = function(a) {
1079
+ return d(a);
1080
+ }, c.allocUnsafeSlow = function(a) {
1081
+ return d(a);
1082
1082
  };
1083
- function S(s, i) {
1083
+ function S(a, i) {
1084
1084
  if ((typeof i != "string" || i === "") && (i = "utf8"), !c.isEncoding(i))
1085
1085
  throw new TypeError("Unknown encoding: " + i);
1086
- const r = R(s, i) | 0;
1086
+ const r = R(a, i) | 0;
1087
1087
  let h = u(r);
1088
- const f = h.write(s, i);
1088
+ const f = h.write(a, i);
1089
1089
  return f !== r && (h = h.slice(0, f)), h;
1090
1090
  }
1091
- function g(s) {
1092
- const i = s.length < 0 ? 0 : I(s.length) | 0, r = u(i);
1091
+ function g(a) {
1092
+ const i = a.length < 0 ? 0 : I(a.length) | 0, r = u(i);
1093
1093
  for (let h = 0; h < i; h += 1)
1094
- r[h] = s[h] & 255;
1094
+ r[h] = a[h] & 255;
1095
1095
  return r;
1096
1096
  }
1097
- function y(s) {
1098
- if (Q(s, Uint8Array)) {
1099
- const i = new Uint8Array(s);
1097
+ function y(a) {
1098
+ if (Q(a, Uint8Array)) {
1099
+ const i = new Uint8Array(a);
1100
1100
  return C(i.buffer, i.byteOffset, i.byteLength);
1101
1101
  }
1102
- return g(s);
1102
+ return g(a);
1103
1103
  }
1104
- function C(s, i, r) {
1105
- if (i < 0 || s.byteLength < i)
1104
+ function C(a, i, r) {
1105
+ if (i < 0 || a.byteLength < i)
1106
1106
  throw new RangeError('"offset" is outside of buffer bounds');
1107
- if (s.byteLength < i + (r || 0))
1107
+ if (a.byteLength < i + (r || 0))
1108
1108
  throw new RangeError('"length" is outside of buffer bounds');
1109
1109
  let h;
1110
- return i === void 0 && r === void 0 ? h = new Uint8Array(s) : r === void 0 ? h = new Uint8Array(s, i) : h = new Uint8Array(s, i, r), Object.setPrototypeOf(h, c.prototype), h;
1110
+ return i === void 0 && r === void 0 ? h = new Uint8Array(a) : r === void 0 ? h = new Uint8Array(a, i) : h = new Uint8Array(a, i, r), Object.setPrototypeOf(h, c.prototype), h;
1111
1111
  }
1112
- function A(s) {
1113
- if (c.isBuffer(s)) {
1114
- const i = I(s.length) | 0, r = u(i);
1115
- return r.length === 0 || s.copy(r, 0, 0, i), r;
1112
+ function A(a) {
1113
+ if (c.isBuffer(a)) {
1114
+ const i = I(a.length) | 0, r = u(i);
1115
+ return r.length === 0 || a.copy(r, 0, 0, i), r;
1116
1116
  }
1117
- if (s.length !== void 0)
1118
- return typeof s.length != "number" || tt(s.length) ? u(0) : g(s);
1119
- if (s.type === "Buffer" && Array.isArray(s.data))
1120
- return g(s.data);
1117
+ if (a.length !== void 0)
1118
+ return typeof a.length != "number" || tt(a.length) ? u(0) : g(a);
1119
+ if (a.type === "Buffer" && Array.isArray(a.data))
1120
+ return g(a.data);
1121
1121
  }
1122
- function I(s) {
1123
- if (s >= l)
1122
+ function I(a) {
1123
+ if (a >= l)
1124
1124
  throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + l.toString(16) + " bytes");
1125
- return s | 0;
1125
+ return a | 0;
1126
1126
  }
1127
- function b(s) {
1128
- return +s != s && (s = 0), c.alloc(+s);
1127
+ function b(a) {
1128
+ return +a != a && (a = 0), c.alloc(+a);
1129
1129
  }
1130
1130
  c.isBuffer = function(i) {
1131
1131
  return i != null && i._isBuffer === !0 && i !== c.prototype;
@@ -1136,9 +1136,9 @@ function Cn() {
1136
1136
  );
1137
1137
  if (i === r) return 0;
1138
1138
  let h = i.length, f = r.length;
1139
- for (let E = 0, v = Math.min(h, f); E < v; ++E)
1140
- if (i[E] !== r[E]) {
1141
- h = i[E], f = r[E];
1139
+ for (let m = 0, v = Math.min(h, f); m < v; ++m)
1140
+ if (i[m] !== r[m]) {
1141
+ h = i[m], f = r[m];
1142
1142
  break;
1143
1143
  }
1144
1144
  return h < f ? -1 : f < h ? 1 : 0;
@@ -1169,33 +1169,33 @@ function Cn() {
1169
1169
  for (r = 0, h = 0; h < i.length; ++h)
1170
1170
  r += i[h].length;
1171
1171
  const f = c.allocUnsafe(r);
1172
- let E = 0;
1172
+ let m = 0;
1173
1173
  for (h = 0; h < i.length; ++h) {
1174
1174
  let v = i[h];
1175
1175
  if (Q(v, Uint8Array))
1176
- E + v.length > f.length ? (c.isBuffer(v) || (v = c.from(v)), v.copy(f, E)) : Uint8Array.prototype.set.call(
1176
+ m + v.length > f.length ? (c.isBuffer(v) || (v = c.from(v)), v.copy(f, m)) : Uint8Array.prototype.set.call(
1177
1177
  f,
1178
1178
  v,
1179
- E
1179
+ m
1180
1180
  );
1181
1181
  else if (c.isBuffer(v))
1182
- v.copy(f, E);
1182
+ v.copy(f, m);
1183
1183
  else
1184
1184
  throw new TypeError('"list" argument must be an Array of Buffers');
1185
- E += v.length;
1185
+ m += v.length;
1186
1186
  }
1187
1187
  return f;
1188
1188
  };
1189
- function R(s, i) {
1190
- if (c.isBuffer(s))
1191
- return s.length;
1192
- if (ArrayBuffer.isView(s) || Q(s, ArrayBuffer))
1193
- return s.byteLength;
1194
- if (typeof s != "string")
1189
+ function R(a, i) {
1190
+ if (c.isBuffer(a))
1191
+ return a.length;
1192
+ if (ArrayBuffer.isView(a) || Q(a, ArrayBuffer))
1193
+ return a.byteLength;
1194
+ if (typeof a != "string")
1195
1195
  throw new TypeError(
1196
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof s
1196
+ 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof a
1197
1197
  );
1198
- const r = s.length, h = arguments.length > 2 && arguments[2] === !0;
1198
+ const r = a.length, h = arguments.length > 2 && arguments[2] === !0;
1199
1199
  if (!h && r === 0) return 0;
1200
1200
  let f = !1;
1201
1201
  for (; ; )
@@ -1206,7 +1206,7 @@ function Cn() {
1206
1206
  return r;
1207
1207
  case "utf8":
1208
1208
  case "utf-8":
1209
- return et(s).length;
1209
+ return et(a).length;
1210
1210
  case "ucs2":
1211
1211
  case "ucs-2":
1212
1212
  case "utf16le":
@@ -1215,20 +1215,20 @@ function Cn() {
1215
1215
  case "hex":
1216
1216
  return r >>> 1;
1217
1217
  case "base64":
1218
- return kt(s).length;
1218
+ return kt(a).length;
1219
1219
  default:
1220
1220
  if (f)
1221
- return h ? -1 : et(s).length;
1221
+ return h ? -1 : et(a).length;
1222
1222
  i = ("" + i).toLowerCase(), f = !0;
1223
1223
  }
1224
1224
  }
1225
1225
  c.byteLength = R;
1226
- function M(s, i, r) {
1226
+ function M(a, i, r) {
1227
1227
  let h = !1;
1228
1228
  if ((i === void 0 || i < 0) && (i = 0), i > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, i >>>= 0, r <= i))
1229
1229
  return "";
1230
- for (s || (s = "utf8"); ; )
1231
- switch (s) {
1230
+ for (a || (a = "utf8"); ; )
1231
+ switch (a) {
1232
1232
  case "hex":
1233
1233
  return $i(this, i, r);
1234
1234
  case "utf8":
@@ -1247,14 +1247,14 @@ function Cn() {
1247
1247
  case "utf-16le":
1248
1248
  return Vi(this, i, r);
1249
1249
  default:
1250
- if (h) throw new TypeError("Unknown encoding: " + s);
1251
- s = (s + "").toLowerCase(), h = !0;
1250
+ if (h) throw new TypeError("Unknown encoding: " + a);
1251
+ a = (a + "").toLowerCase(), h = !0;
1252
1252
  }
1253
1253
  }
1254
1254
  c.prototype._isBuffer = !0;
1255
- function x(s, i, r) {
1256
- const h = s[i];
1257
- s[i] = s[r], s[r] = h;
1255
+ function x(a, i, r) {
1256
+ const h = a[i];
1257
+ a[i] = a[r], a[r] = h;
1258
1258
  }
1259
1259
  c.prototype.swap16 = function() {
1260
1260
  const i = this.length;
@@ -1287,22 +1287,22 @@ function Cn() {
1287
1287
  let i = "";
1288
1288
  const r = t.INSPECT_MAX_BYTES;
1289
1289
  return i = this.toString("hex", 0, r).replace(/(.{2})/g, "$1 ").trim(), this.length > r && (i += " ... "), "<Buffer " + i + ">";
1290
- }, o && (c.prototype[o] = c.prototype.inspect), c.prototype.compare = function(i, r, h, f, E) {
1290
+ }, o && (c.prototype[o] = c.prototype.inspect), c.prototype.compare = function(i, r, h, f, m) {
1291
1291
  if (Q(i, Uint8Array) && (i = c.from(i, i.offset, i.byteLength)), !c.isBuffer(i))
1292
1292
  throw new TypeError(
1293
1293
  'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof i
1294
1294
  );
1295
- if (r === void 0 && (r = 0), h === void 0 && (h = i ? i.length : 0), f === void 0 && (f = 0), E === void 0 && (E = this.length), r < 0 || h > i.length || f < 0 || E > this.length)
1295
+ if (r === void 0 && (r = 0), h === void 0 && (h = i ? i.length : 0), f === void 0 && (f = 0), m === void 0 && (m = this.length), r < 0 || h > i.length || f < 0 || m > this.length)
1296
1296
  throw new RangeError("out of range index");
1297
- if (f >= E && r >= h)
1297
+ if (f >= m && r >= h)
1298
1298
  return 0;
1299
- if (f >= E)
1299
+ if (f >= m)
1300
1300
  return -1;
1301
1301
  if (r >= h)
1302
1302
  return 1;
1303
- if (r >>>= 0, h >>>= 0, f >>>= 0, E >>>= 0, this === i) return 0;
1304
- let v = E - f, T = h - r;
1305
- const L = Math.min(v, T), U = this.slice(f, E), B = i.slice(r, h);
1303
+ if (r >>>= 0, h >>>= 0, f >>>= 0, m >>>= 0, this === i) return 0;
1304
+ let v = m - f, T = h - r;
1305
+ const L = Math.min(v, T), U = this.slice(f, m), B = i.slice(r, h);
1306
1306
  for (let D = 0; D < L; ++D)
1307
1307
  if (U[D] !== B[D]) {
1308
1308
  v = U[D], T = B[D];
@@ -1310,43 +1310,43 @@ function Cn() {
1310
1310
  }
1311
1311
  return v < T ? -1 : T < v ? 1 : 0;
1312
1312
  };
1313
- function Y(s, i, r, h, f) {
1314
- if (s.length === 0) return -1;
1315
- if (typeof r == "string" ? (h = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, tt(r) && (r = f ? 0 : s.length - 1), r < 0 && (r = s.length + r), r >= s.length) {
1313
+ function Y(a, i, r, h, f) {
1314
+ if (a.length === 0) return -1;
1315
+ if (typeof r == "string" ? (h = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, tt(r) && (r = f ? 0 : a.length - 1), r < 0 && (r = a.length + r), r >= a.length) {
1316
1316
  if (f) return -1;
1317
- r = s.length - 1;
1317
+ r = a.length - 1;
1318
1318
  } else if (r < 0)
1319
1319
  if (f) r = 0;
1320
1320
  else return -1;
1321
1321
  if (typeof i == "string" && (i = c.from(i, h)), c.isBuffer(i))
1322
- return i.length === 0 ? -1 : te(s, i, r, h, f);
1322
+ return i.length === 0 ? -1 : te(a, i, r, h, f);
1323
1323
  if (typeof i == "number")
1324
- return i = i & 255, typeof Uint8Array.prototype.indexOf == "function" ? f ? Uint8Array.prototype.indexOf.call(s, i, r) : Uint8Array.prototype.lastIndexOf.call(s, i, r) : te(s, [i], r, h, f);
1324
+ return i = i & 255, typeof Uint8Array.prototype.indexOf == "function" ? f ? Uint8Array.prototype.indexOf.call(a, i, r) : Uint8Array.prototype.lastIndexOf.call(a, i, r) : te(a, [i], r, h, f);
1325
1325
  throw new TypeError("val must be string, number or Buffer");
1326
1326
  }
1327
- function te(s, i, r, h, f) {
1328
- let E = 1, v = s.length, T = i.length;
1327
+ function te(a, i, r, h, f) {
1328
+ let m = 1, v = a.length, T = i.length;
1329
1329
  if (h !== void 0 && (h = String(h).toLowerCase(), h === "ucs2" || h === "ucs-2" || h === "utf16le" || h === "utf-16le")) {
1330
- if (s.length < 2 || i.length < 2)
1330
+ if (a.length < 2 || i.length < 2)
1331
1331
  return -1;
1332
- E = 2, v /= 2, T /= 2, r /= 2;
1332
+ m = 2, v /= 2, T /= 2, r /= 2;
1333
1333
  }
1334
1334
  function L(B, D) {
1335
- return E === 1 ? B[D] : B.readUInt16BE(D * E);
1335
+ return m === 1 ? B[D] : B.readUInt16BE(D * m);
1336
1336
  }
1337
1337
  let U;
1338
1338
  if (f) {
1339
1339
  let B = -1;
1340
1340
  for (U = r; U < v; U++)
1341
- if (L(s, U) === L(i, B === -1 ? 0 : U - B)) {
1342
- if (B === -1 && (B = U), U - B + 1 === T) return B * E;
1341
+ if (L(a, U) === L(i, B === -1 ? 0 : U - B)) {
1342
+ if (B === -1 && (B = U), U - B + 1 === T) return B * m;
1343
1343
  } else
1344
1344
  B !== -1 && (U -= U - B), B = -1;
1345
1345
  } else
1346
1346
  for (r + T > v && (r = v - T), U = r; U >= 0; U--) {
1347
1347
  let B = !0;
1348
1348
  for (let D = 0; D < T; D++)
1349
- if (L(s, U + D) !== L(i, D)) {
1349
+ if (L(a, U + D) !== L(i, D)) {
1350
1350
  B = !1;
1351
1351
  break;
1352
1352
  }
@@ -1361,31 +1361,31 @@ function Cn() {
1361
1361
  }, c.prototype.lastIndexOf = function(i, r, h) {
1362
1362
  return Y(this, i, r, h, !1);
1363
1363
  };
1364
- function $(s, i, r, h) {
1364
+ function $(a, i, r, h) {
1365
1365
  r = Number(r) || 0;
1366
- const f = s.length - r;
1366
+ const f = a.length - r;
1367
1367
  h ? (h = Number(h), h > f && (h = f)) : h = f;
1368
- const E = i.length;
1369
- h > E / 2 && (h = E / 2);
1368
+ const m = i.length;
1369
+ h > m / 2 && (h = m / 2);
1370
1370
  let v;
1371
1371
  for (v = 0; v < h; ++v) {
1372
1372
  const T = parseInt(i.substr(v * 2, 2), 16);
1373
1373
  if (tt(T)) return v;
1374
- s[r + v] = T;
1374
+ a[r + v] = T;
1375
1375
  }
1376
1376
  return v;
1377
1377
  }
1378
- function ie(s, i, r, h) {
1379
- return Be(et(i, s.length - r), s, r, h);
1378
+ function ie(a, i, r, h) {
1379
+ return Be(et(i, a.length - r), a, r, h);
1380
1380
  }
1381
- function ne(s, i, r, h) {
1382
- return Be(Wi(i), s, r, h);
1381
+ function ne(a, i, r, h) {
1382
+ return Be(Wi(i), a, r, h);
1383
1383
  }
1384
- function Z(s, i, r, h) {
1385
- return Be(kt(i), s, r, h);
1384
+ function Z(a, i, r, h) {
1385
+ return Be(kt(i), a, r, h);
1386
1386
  }
1387
- function oe(s, i, r, h) {
1388
- return Be(zi(i, s.length - r), s, r, h);
1387
+ function oe(a, i, r, h) {
1388
+ return Be(zi(i, a.length - r), a, r, h);
1389
1389
  }
1390
1390
  c.prototype.write = function(i, r, h, f) {
1391
1391
  if (r === void 0)
@@ -1398,8 +1398,8 @@ function Cn() {
1398
1398
  throw new Error(
1399
1399
  "Buffer.write(string, encoding, offset[, length]) is no longer supported"
1400
1400
  );
1401
- const E = this.length - r;
1402
- if ((h === void 0 || h > E) && (h = E), i.length > 0 && (h < 0 || r < 0) || r > this.length)
1401
+ const m = this.length - r;
1402
+ if ((h === void 0 || h > m) && (h = m), i.length > 0 && (h < 0 || r < 0) || r > this.length)
1403
1403
  throw new RangeError("Attempt to write outside buffer bounds");
1404
1404
  f || (f = "utf8");
1405
1405
  let v = !1;
@@ -1431,30 +1431,30 @@ function Cn() {
1431
1431
  data: Array.prototype.slice.call(this._arr || this, 0)
1432
1432
  };
1433
1433
  };
1434
- function Li(s, i, r) {
1435
- return i === 0 && r === s.length ? e.fromByteArray(s) : e.fromByteArray(s.slice(i, r));
1434
+ function Li(a, i, r) {
1435
+ return i === 0 && r === a.length ? e.fromByteArray(a) : e.fromByteArray(a.slice(i, r));
1436
1436
  }
1437
- function Ct(s, i, r) {
1438
- r = Math.min(s.length, r);
1437
+ function Ct(a, i, r) {
1438
+ r = Math.min(a.length, r);
1439
1439
  const h = [];
1440
1440
  let f = i;
1441
1441
  for (; f < r; ) {
1442
- const E = s[f];
1443
- let v = null, T = E > 239 ? 4 : E > 223 ? 3 : E > 191 ? 2 : 1;
1442
+ const m = a[f];
1443
+ let v = null, T = m > 239 ? 4 : m > 223 ? 3 : m > 191 ? 2 : 1;
1444
1444
  if (f + T <= r) {
1445
1445
  let L, U, B, D;
1446
1446
  switch (T) {
1447
1447
  case 1:
1448
- E < 128 && (v = E);
1448
+ m < 128 && (v = m);
1449
1449
  break;
1450
1450
  case 2:
1451
- L = s[f + 1], (L & 192) === 128 && (D = (E & 31) << 6 | L & 63, D > 127 && (v = D));
1451
+ L = a[f + 1], (L & 192) === 128 && (D = (m & 31) << 6 | L & 63, D > 127 && (v = D));
1452
1452
  break;
1453
1453
  case 3:
1454
- L = s[f + 1], U = s[f + 2], (L & 192) === 128 && (U & 192) === 128 && (D = (E & 15) << 12 | (L & 63) << 6 | U & 63, D > 2047 && (D < 55296 || D > 57343) && (v = D));
1454
+ L = a[f + 1], U = a[f + 2], (L & 192) === 128 && (U & 192) === 128 && (D = (m & 15) << 12 | (L & 63) << 6 | U & 63, D > 2047 && (D < 55296 || D > 57343) && (v = D));
1455
1455
  break;
1456
1456
  case 4:
1457
- L = s[f + 1], U = s[f + 2], B = s[f + 3], (L & 192) === 128 && (U & 192) === 128 && (B & 192) === 128 && (D = (E & 15) << 18 | (L & 63) << 12 | (U & 63) << 6 | B & 63, D > 65535 && D < 1114112 && (v = D));
1457
+ L = a[f + 1], U = a[f + 2], B = a[f + 3], (L & 192) === 128 && (U & 192) === 128 && (B & 192) === 128 && (D = (m & 15) << 18 | (L & 63) << 12 | (U & 63) << 6 | B & 63, D > 65535 && D < 1114112 && (v = D));
1458
1458
  }
1459
1459
  }
1460
1460
  v === null ? (v = 65533, T = 1) : v > 65535 && (v -= 65536, h.push(v >>> 10 & 1023 | 55296), v = 56320 | v & 1023), h.push(v), f += T;
@@ -1462,45 +1462,45 @@ function Cn() {
1462
1462
  return Bi(h);
1463
1463
  }
1464
1464
  const It = 4096;
1465
- function Bi(s) {
1466
- const i = s.length;
1465
+ function Bi(a) {
1466
+ const i = a.length;
1467
1467
  if (i <= It)
1468
- return String.fromCharCode.apply(String, s);
1468
+ return String.fromCharCode.apply(String, a);
1469
1469
  let r = "", h = 0;
1470
1470
  for (; h < i; )
1471
1471
  r += String.fromCharCode.apply(
1472
1472
  String,
1473
- s.slice(h, h += It)
1473
+ a.slice(h, h += It)
1474
1474
  );
1475
1475
  return r;
1476
1476
  }
1477
- function Pi(s, i, r) {
1477
+ function Pi(a, i, r) {
1478
1478
  let h = "";
1479
- r = Math.min(s.length, r);
1479
+ r = Math.min(a.length, r);
1480
1480
  for (let f = i; f < r; ++f)
1481
- h += String.fromCharCode(s[f] & 127);
1481
+ h += String.fromCharCode(a[f] & 127);
1482
1482
  return h;
1483
1483
  }
1484
- function Fi(s, i, r) {
1484
+ function Fi(a, i, r) {
1485
1485
  let h = "";
1486
- r = Math.min(s.length, r);
1486
+ r = Math.min(a.length, r);
1487
1487
  for (let f = i; f < r; ++f)
1488
- h += String.fromCharCode(s[f]);
1488
+ h += String.fromCharCode(a[f]);
1489
1489
  return h;
1490
1490
  }
1491
- function $i(s, i, r) {
1492
- const h = s.length;
1491
+ function $i(a, i, r) {
1492
+ const h = a.length;
1493
1493
  (!i || i < 0) && (i = 0), (!r || r < 0 || r > h) && (r = h);
1494
1494
  let f = "";
1495
- for (let E = i; E < r; ++E)
1496
- f += qi[s[E]];
1495
+ for (let m = i; m < r; ++m)
1496
+ f += qi[a[m]];
1497
1497
  return f;
1498
1498
  }
1499
- function Vi(s, i, r) {
1500
- const h = s.slice(i, r);
1499
+ function Vi(a, i, r) {
1500
+ const h = a.slice(i, r);
1501
1501
  let f = "";
1502
- for (let E = 0; E < h.length - 1; E += 2)
1503
- f += String.fromCharCode(h[E] + h[E + 1] * 256);
1502
+ for (let m = 0; m < h.length - 1; m += 2)
1503
+ f += String.fromCharCode(h[m] + h[m + 1] * 256);
1504
1504
  return f;
1505
1505
  }
1506
1506
  c.prototype.slice = function(i, r) {
@@ -1509,21 +1509,21 @@ function Cn() {
1509
1509
  const f = this.subarray(i, r);
1510
1510
  return Object.setPrototypeOf(f, c.prototype), f;
1511
1511
  };
1512
- function G(s, i, r) {
1513
- if (s % 1 !== 0 || s < 0) throw new RangeError("offset is not uint");
1514
- if (s + i > r) throw new RangeError("Trying to access beyond buffer length");
1512
+ function G(a, i, r) {
1513
+ if (a % 1 !== 0 || a < 0) throw new RangeError("offset is not uint");
1514
+ if (a + i > r) throw new RangeError("Trying to access beyond buffer length");
1515
1515
  }
1516
1516
  c.prototype.readUintLE = c.prototype.readUIntLE = function(i, r, h) {
1517
1517
  i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
1518
- let f = this[i], E = 1, v = 0;
1519
- for (; ++v < r && (E *= 256); )
1520
- f += this[i + v] * E;
1518
+ let f = this[i], m = 1, v = 0;
1519
+ for (; ++v < r && (m *= 256); )
1520
+ f += this[i + v] * m;
1521
1521
  return f;
1522
1522
  }, c.prototype.readUintBE = c.prototype.readUIntBE = function(i, r, h) {
1523
1523
  i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
1524
- let f = this[i + --r], E = 1;
1525
- for (; r > 0 && (E *= 256); )
1526
- f += this[i + --r] * E;
1524
+ let f = this[i + --r], m = 1;
1525
+ for (; r > 0 && (m *= 256); )
1526
+ f += this[i + --r] * m;
1527
1527
  return f;
1528
1528
  }, c.prototype.readUint8 = c.prototype.readUInt8 = function(i, r) {
1529
1529
  return i = i >>> 0, r || G(i, 1, this.length), this[i];
@@ -1539,26 +1539,26 @@ function Cn() {
1539
1539
  i = i >>> 0, ge(i, "offset");
1540
1540
  const r = this[i], h = this[i + 7];
1541
1541
  (r === void 0 || h === void 0) && Te(i, this.length - 8);
1542
- const f = r + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + this[++i] * 2 ** 24, E = this[++i] + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + h * 2 ** 24;
1543
- return BigInt(f) + (BigInt(E) << BigInt(32));
1542
+ const f = r + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + this[++i] * 2 ** 24, m = this[++i] + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + h * 2 ** 24;
1543
+ return BigInt(f) + (BigInt(m) << BigInt(32));
1544
1544
  }), c.prototype.readBigUInt64BE = se(function(i) {
1545
1545
  i = i >>> 0, ge(i, "offset");
1546
1546
  const r = this[i], h = this[i + 7];
1547
1547
  (r === void 0 || h === void 0) && Te(i, this.length - 8);
1548
- const f = r * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + this[++i], E = this[++i] * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + h;
1549
- return (BigInt(f) << BigInt(32)) + BigInt(E);
1548
+ const f = r * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + this[++i], m = this[++i] * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + h;
1549
+ return (BigInt(f) << BigInt(32)) + BigInt(m);
1550
1550
  }), c.prototype.readIntLE = function(i, r, h) {
1551
1551
  i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
1552
- let f = this[i], E = 1, v = 0;
1553
- for (; ++v < r && (E *= 256); )
1554
- f += this[i + v] * E;
1555
- return E *= 128, f >= E && (f -= Math.pow(2, 8 * r)), f;
1552
+ let f = this[i], m = 1, v = 0;
1553
+ for (; ++v < r && (m *= 256); )
1554
+ f += this[i + v] * m;
1555
+ return m *= 128, f >= m && (f -= Math.pow(2, 8 * r)), f;
1556
1556
  }, c.prototype.readIntBE = function(i, r, h) {
1557
1557
  i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
1558
- let f = r, E = 1, v = this[i + --f];
1559
- for (; f > 0 && (E *= 256); )
1560
- v += this[i + --f] * E;
1561
- return E *= 128, v >= E && (v -= Math.pow(2, 8 * r)), v;
1558
+ let f = r, m = 1, v = this[i + --f];
1559
+ for (; f > 0 && (m *= 256); )
1560
+ v += this[i + --f] * m;
1561
+ return m *= 128, v >= m && (v -= Math.pow(2, 8 * r)), v;
1562
1562
  }, c.prototype.readInt8 = function(i, r) {
1563
1563
  return i = i >>> 0, r || G(i, 1, this.length), this[i] & 128 ? (255 - this[i] + 1) * -1 : this[i];
1564
1564
  }, c.prototype.readInt16LE = function(i, r) {
@@ -1595,28 +1595,28 @@ function Cn() {
1595
1595
  }, c.prototype.readDoubleBE = function(i, r) {
1596
1596
  return i = i >>> 0, r || G(i, 8, this.length), n.read(this, i, !1, 52, 8);
1597
1597
  };
1598
- function K(s, i, r, h, f, E) {
1599
- if (!c.isBuffer(s)) throw new TypeError('"buffer" argument must be a Buffer instance');
1600
- if (i > f || i < E) throw new RangeError('"value" argument is out of bounds');
1601
- if (r + h > s.length) throw new RangeError("Index out of range");
1598
+ function K(a, i, r, h, f, m) {
1599
+ if (!c.isBuffer(a)) throw new TypeError('"buffer" argument must be a Buffer instance');
1600
+ if (i > f || i < m) throw new RangeError('"value" argument is out of bounds');
1601
+ if (r + h > a.length) throw new RangeError("Index out of range");
1602
1602
  }
1603
1603
  c.prototype.writeUintLE = c.prototype.writeUIntLE = function(i, r, h, f) {
1604
1604
  if (i = +i, r = r >>> 0, h = h >>> 0, !f) {
1605
1605
  const T = Math.pow(2, 8 * h) - 1;
1606
1606
  K(this, i, r, h, T, 0);
1607
1607
  }
1608
- let E = 1, v = 0;
1609
- for (this[r] = i & 255; ++v < h && (E *= 256); )
1610
- this[r + v] = i / E & 255;
1608
+ let m = 1, v = 0;
1609
+ for (this[r] = i & 255; ++v < h && (m *= 256); )
1610
+ this[r + v] = i / m & 255;
1611
1611
  return r + h;
1612
1612
  }, c.prototype.writeUintBE = c.prototype.writeUIntBE = function(i, r, h, f) {
1613
1613
  if (i = +i, r = r >>> 0, h = h >>> 0, !f) {
1614
1614
  const T = Math.pow(2, 8 * h) - 1;
1615
1615
  K(this, i, r, h, T, 0);
1616
1616
  }
1617
- let E = h - 1, v = 1;
1618
- for (this[r + E] = i & 255; --E >= 0 && (v *= 256); )
1619
- this[r + E] = i / v & 255;
1617
+ let m = h - 1, v = 1;
1618
+ for (this[r + m] = i & 255; --m >= 0 && (v *= 256); )
1619
+ this[r + m] = i / v & 255;
1620
1620
  return r + h;
1621
1621
  }, c.prototype.writeUint8 = c.prototype.writeUInt8 = function(i, r, h) {
1622
1622
  return i = +i, r = r >>> 0, h || K(this, i, r, 1, 255, 0), this[r] = i & 255, r + 1;
@@ -1629,19 +1629,19 @@ function Cn() {
1629
1629
  }, c.prototype.writeUint32BE = c.prototype.writeUInt32BE = function(i, r, h) {
1630
1630
  return i = +i, r = r >>> 0, h || K(this, i, r, 4, 4294967295, 0), this[r] = i >>> 24, this[r + 1] = i >>> 16, this[r + 2] = i >>> 8, this[r + 3] = i & 255, r + 4;
1631
1631
  };
1632
- function bt(s, i, r, h, f) {
1633
- Ot(i, h, f, s, r, 7);
1634
- let E = Number(i & BigInt(4294967295));
1635
- s[r++] = E, E = E >> 8, s[r++] = E, E = E >> 8, s[r++] = E, E = E >> 8, s[r++] = E;
1632
+ function bt(a, i, r, h, f) {
1633
+ Ot(i, h, f, a, r, 7);
1634
+ let m = Number(i & BigInt(4294967295));
1635
+ a[r++] = m, m = m >> 8, a[r++] = m, m = m >> 8, a[r++] = m, m = m >> 8, a[r++] = m;
1636
1636
  let v = Number(i >> BigInt(32) & BigInt(4294967295));
1637
- return s[r++] = v, v = v >> 8, s[r++] = v, v = v >> 8, s[r++] = v, v = v >> 8, s[r++] = v, r;
1637
+ return a[r++] = v, v = v >> 8, a[r++] = v, v = v >> 8, a[r++] = v, v = v >> 8, a[r++] = v, r;
1638
1638
  }
1639
- function At(s, i, r, h, f) {
1640
- Ot(i, h, f, s, r, 7);
1641
- let E = Number(i & BigInt(4294967295));
1642
- s[r + 7] = E, E = E >> 8, s[r + 6] = E, E = E >> 8, s[r + 5] = E, E = E >> 8, s[r + 4] = E;
1639
+ function At(a, i, r, h, f) {
1640
+ Ot(i, h, f, a, r, 7);
1641
+ let m = Number(i & BigInt(4294967295));
1642
+ a[r + 7] = m, m = m >> 8, a[r + 6] = m, m = m >> 8, a[r + 5] = m, m = m >> 8, a[r + 4] = m;
1643
1643
  let v = Number(i >> BigInt(32) & BigInt(4294967295));
1644
- return s[r + 3] = v, v = v >> 8, s[r + 2] = v, v = v >> 8, s[r + 1] = v, v = v >> 8, s[r] = v, r + 8;
1644
+ return a[r + 3] = v, v = v >> 8, a[r + 2] = v, v = v >> 8, a[r + 1] = v, v = v >> 8, a[r] = v, r + 8;
1645
1645
  }
1646
1646
  c.prototype.writeBigUInt64LE = se(function(i, r = 0) {
1647
1647
  return bt(this, i, r, BigInt(0), BigInt("0xffffffffffffffff"));
@@ -1652,18 +1652,18 @@ function Cn() {
1652
1652
  const L = Math.pow(2, 8 * h - 1);
1653
1653
  K(this, i, r, h, L - 1, -L);
1654
1654
  }
1655
- let E = 0, v = 1, T = 0;
1656
- for (this[r] = i & 255; ++E < h && (v *= 256); )
1657
- i < 0 && T === 0 && this[r + E - 1] !== 0 && (T = 1), this[r + E] = (i / v >> 0) - T & 255;
1655
+ let m = 0, v = 1, T = 0;
1656
+ for (this[r] = i & 255; ++m < h && (v *= 256); )
1657
+ i < 0 && T === 0 && this[r + m - 1] !== 0 && (T = 1), this[r + m] = (i / v >> 0) - T & 255;
1658
1658
  return r + h;
1659
1659
  }, c.prototype.writeIntBE = function(i, r, h, f) {
1660
1660
  if (i = +i, r = r >>> 0, !f) {
1661
1661
  const L = Math.pow(2, 8 * h - 1);
1662
1662
  K(this, i, r, h, L - 1, -L);
1663
1663
  }
1664
- let E = h - 1, v = 1, T = 0;
1665
- for (this[r + E] = i & 255; --E >= 0 && (v *= 256); )
1666
- i < 0 && T === 0 && this[r + E + 1] !== 0 && (T = 1), this[r + E] = (i / v >> 0) - T & 255;
1664
+ let m = h - 1, v = 1, T = 0;
1665
+ for (this[r + m] = i & 255; --m >= 0 && (v *= 256); )
1666
+ i < 0 && T === 0 && this[r + m + 1] !== 0 && (T = 1), this[r + m] = (i / v >> 0) - T & 255;
1667
1667
  return r + h;
1668
1668
  }, c.prototype.writeInt8 = function(i, r, h) {
1669
1669
  return i = +i, r = r >>> 0, h || K(this, i, r, 1, 127, -128), i < 0 && (i = 255 + i + 1), this[r] = i & 255, r + 1;
@@ -1680,20 +1680,20 @@ function Cn() {
1680
1680
  }), c.prototype.writeBigInt64BE = se(function(i, r = 0) {
1681
1681
  return At(this, i, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
1682
1682
  });
1683
- function Tt(s, i, r, h, f, E) {
1684
- if (r + h > s.length) throw new RangeError("Index out of range");
1683
+ function Tt(a, i, r, h, f, m) {
1684
+ if (r + h > a.length) throw new RangeError("Index out of range");
1685
1685
  if (r < 0) throw new RangeError("Index out of range");
1686
1686
  }
1687
- function Rt(s, i, r, h, f) {
1688
- return i = +i, r = r >>> 0, f || Tt(s, i, r, 4), n.write(s, i, r, h, 23, 4), r + 4;
1687
+ function Rt(a, i, r, h, f) {
1688
+ return i = +i, r = r >>> 0, f || Tt(a, i, r, 4), n.write(a, i, r, h, 23, 4), r + 4;
1689
1689
  }
1690
1690
  c.prototype.writeFloatLE = function(i, r, h) {
1691
1691
  return Rt(this, i, r, !0, h);
1692
1692
  }, c.prototype.writeFloatBE = function(i, r, h) {
1693
1693
  return Rt(this, i, r, !1, h);
1694
1694
  };
1695
- function Nt(s, i, r, h, f) {
1696
- return i = +i, r = r >>> 0, f || Tt(s, i, r, 8), n.write(s, i, r, h, 52, 8), r + 8;
1695
+ function Nt(a, i, r, h, f) {
1696
+ return i = +i, r = r >>> 0, f || Tt(a, i, r, 8), n.write(a, i, r, h, 52, 8), r + 8;
1697
1697
  }
1698
1698
  c.prototype.writeDoubleLE = function(i, r, h) {
1699
1699
  return Nt(this, i, r, !0, h);
@@ -1707,12 +1707,12 @@ function Cn() {
1707
1707
  if (h < 0 || h >= this.length) throw new RangeError("Index out of range");
1708
1708
  if (f < 0) throw new RangeError("sourceEnd out of bounds");
1709
1709
  f > this.length && (f = this.length), i.length - r < f - h && (f = i.length - r + h);
1710
- const E = f - h;
1710
+ const m = f - h;
1711
1711
  return this === i && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(r, h, f) : Uint8Array.prototype.set.call(
1712
1712
  i,
1713
1713
  this.subarray(h, f),
1714
1714
  r
1715
- ), E;
1715
+ ), m;
1716
1716
  }, c.prototype.fill = function(i, r, h, f) {
1717
1717
  if (typeof i == "string") {
1718
1718
  if (typeof r == "string" ? (f = r, r = 0, h = this.length) : typeof h == "string" && (f = h, h = this.length), f !== void 0 && typeof f != "string")
@@ -1729,31 +1729,31 @@ function Cn() {
1729
1729
  if (h <= r)
1730
1730
  return this;
1731
1731
  r = r >>> 0, h = h === void 0 ? this.length : h >>> 0, i || (i = 0);
1732
- let E;
1732
+ let m;
1733
1733
  if (typeof i == "number")
1734
- for (E = r; E < h; ++E)
1735
- this[E] = i;
1734
+ for (m = r; m < h; ++m)
1735
+ this[m] = i;
1736
1736
  else {
1737
1737
  const v = c.isBuffer(i) ? i : c.from(i, f), T = v.length;
1738
1738
  if (T === 0)
1739
1739
  throw new TypeError('The value "' + i + '" is invalid for argument "value"');
1740
- for (E = 0; E < h - r; ++E)
1741
- this[E + r] = v[E % T];
1740
+ for (m = 0; m < h - r; ++m)
1741
+ this[m + r] = v[m % T];
1742
1742
  }
1743
1743
  return this;
1744
1744
  };
1745
- const me = {};
1746
- function Qe(s, i, r) {
1747
- me[s] = class extends r {
1745
+ const Ee = {};
1746
+ function Qe(a, i, r) {
1747
+ Ee[a] = class extends r {
1748
1748
  constructor() {
1749
1749
  super(), Object.defineProperty(this, "message", {
1750
1750
  value: i.apply(this, arguments),
1751
1751
  writable: !0,
1752
1752
  configurable: !0
1753
- }), this.name = `${this.name} [${s}]`, this.stack, delete this.name;
1753
+ }), this.name = `${this.name} [${a}]`, this.stack, delete this.name;
1754
1754
  }
1755
1755
  get code() {
1756
- return s;
1756
+ return a;
1757
1757
  }
1758
1758
  set code(f) {
1759
1759
  Object.defineProperty(this, "code", {
@@ -1764,110 +1764,110 @@ function Cn() {
1764
1764
  });
1765
1765
  }
1766
1766
  toString() {
1767
- return `${this.name} [${s}]: ${this.message}`;
1767
+ return `${this.name} [${a}]: ${this.message}`;
1768
1768
  }
1769
1769
  };
1770
1770
  }
1771
1771
  Qe(
1772
1772
  "ERR_BUFFER_OUT_OF_BOUNDS",
1773
- function(s) {
1774
- return s ? `${s} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
1773
+ function(a) {
1774
+ return a ? `${a} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
1775
1775
  },
1776
1776
  RangeError
1777
1777
  ), Qe(
1778
1778
  "ERR_INVALID_ARG_TYPE",
1779
- function(s, i) {
1780
- return `The "${s}" argument must be of type number. Received type ${typeof i}`;
1779
+ function(a, i) {
1780
+ return `The "${a}" argument must be of type number. Received type ${typeof i}`;
1781
1781
  },
1782
1782
  TypeError
1783
1783
  ), Qe(
1784
1784
  "ERR_OUT_OF_RANGE",
1785
- function(s, i, r) {
1786
- let h = `The value of "${s}" is out of range.`, f = r;
1785
+ function(a, i, r) {
1786
+ let h = `The value of "${a}" is out of range.`, f = r;
1787
1787
  return Number.isInteger(r) && Math.abs(r) > 2 ** 32 ? f = xt(String(r)) : typeof r == "bigint" && (f = String(r), (r > BigInt(2) ** BigInt(32) || r < -(BigInt(2) ** BigInt(32))) && (f = xt(f)), f += "n"), h += ` It must be ${i}. Received ${f}`, h;
1788
1788
  },
1789
1789
  RangeError
1790
1790
  );
1791
- function xt(s) {
1792
- let i = "", r = s.length;
1793
- const h = s[0] === "-" ? 1 : 0;
1791
+ function xt(a) {
1792
+ let i = "", r = a.length;
1793
+ const h = a[0] === "-" ? 1 : 0;
1794
1794
  for (; r >= h + 4; r -= 3)
1795
- i = `_${s.slice(r - 3, r)}${i}`;
1796
- return `${s.slice(0, r)}${i}`;
1795
+ i = `_${a.slice(r - 3, r)}${i}`;
1796
+ return `${a.slice(0, r)}${i}`;
1797
1797
  }
1798
- function Gi(s, i, r) {
1799
- ge(i, "offset"), (s[i] === void 0 || s[i + r] === void 0) && Te(i, s.length - (r + 1));
1798
+ function Gi(a, i, r) {
1799
+ ge(i, "offset"), (a[i] === void 0 || a[i + r] === void 0) && Te(i, a.length - (r + 1));
1800
1800
  }
1801
- function Ot(s, i, r, h, f, E) {
1802
- if (s > r || s < i) {
1801
+ function Ot(a, i, r, h, f, m) {
1802
+ if (a > r || a < i) {
1803
1803
  const v = typeof i == "bigint" ? "n" : "";
1804
1804
  let T;
1805
- throw i === 0 || i === BigInt(0) ? T = `>= 0${v} and < 2${v} ** ${(E + 1) * 8}${v}` : T = `>= -(2${v} ** ${(E + 1) * 8 - 1}${v}) and < 2 ** ${(E + 1) * 8 - 1}${v}`, new me.ERR_OUT_OF_RANGE("value", T, s);
1805
+ throw i === 0 || i === BigInt(0) ? T = `>= 0${v} and < 2${v} ** ${(m + 1) * 8}${v}` : T = `>= -(2${v} ** ${(m + 1) * 8 - 1}${v}) and < 2 ** ${(m + 1) * 8 - 1}${v}`, new Ee.ERR_OUT_OF_RANGE("value", T, a);
1806
1806
  }
1807
- Gi(h, f, E);
1807
+ Gi(h, f, m);
1808
1808
  }
1809
- function ge(s, i) {
1810
- if (typeof s != "number")
1811
- throw new me.ERR_INVALID_ARG_TYPE(i, "number", s);
1809
+ function ge(a, i) {
1810
+ if (typeof a != "number")
1811
+ throw new Ee.ERR_INVALID_ARG_TYPE(i, "number", a);
1812
1812
  }
1813
- function Te(s, i, r) {
1814
- throw Math.floor(s) !== s ? (ge(s, r), new me.ERR_OUT_OF_RANGE("offset", "an integer", s)) : i < 0 ? new me.ERR_BUFFER_OUT_OF_BOUNDS() : new me.ERR_OUT_OF_RANGE(
1813
+ function Te(a, i, r) {
1814
+ throw Math.floor(a) !== a ? (ge(a, r), new Ee.ERR_OUT_OF_RANGE("offset", "an integer", a)) : i < 0 ? new Ee.ERR_BUFFER_OUT_OF_BOUNDS() : new Ee.ERR_OUT_OF_RANGE(
1815
1815
  "offset",
1816
1816
  `>= 0 and <= ${i}`,
1817
- s
1817
+ a
1818
1818
  );
1819
1819
  }
1820
1820
  const ji = /[^+/0-9A-Za-z-_]/g;
1821
- function Hi(s) {
1822
- if (s = s.split("=")[0], s = s.trim().replace(ji, ""), s.length < 2) return "";
1823
- for (; s.length % 4 !== 0; )
1824
- s = s + "=";
1825
- return s;
1821
+ function Hi(a) {
1822
+ if (a = a.split("=")[0], a = a.trim().replace(ji, ""), a.length < 2) return "";
1823
+ for (; a.length % 4 !== 0; )
1824
+ a = a + "=";
1825
+ return a;
1826
1826
  }
1827
- function et(s, i) {
1827
+ function et(a, i) {
1828
1828
  i = i || 1 / 0;
1829
1829
  let r;
1830
- const h = s.length;
1830
+ const h = a.length;
1831
1831
  let f = null;
1832
- const E = [];
1832
+ const m = [];
1833
1833
  for (let v = 0; v < h; ++v) {
1834
- if (r = s.charCodeAt(v), r > 55295 && r < 57344) {
1834
+ if (r = a.charCodeAt(v), r > 55295 && r < 57344) {
1835
1835
  if (!f) {
1836
1836
  if (r > 56319) {
1837
- (i -= 3) > -1 && E.push(239, 191, 189);
1837
+ (i -= 3) > -1 && m.push(239, 191, 189);
1838
1838
  continue;
1839
1839
  } else if (v + 1 === h) {
1840
- (i -= 3) > -1 && E.push(239, 191, 189);
1840
+ (i -= 3) > -1 && m.push(239, 191, 189);
1841
1841
  continue;
1842
1842
  }
1843
1843
  f = r;
1844
1844
  continue;
1845
1845
  }
1846
1846
  if (r < 56320) {
1847
- (i -= 3) > -1 && E.push(239, 191, 189), f = r;
1847
+ (i -= 3) > -1 && m.push(239, 191, 189), f = r;
1848
1848
  continue;
1849
1849
  }
1850
1850
  r = (f - 55296 << 10 | r - 56320) + 65536;
1851
- } else f && (i -= 3) > -1 && E.push(239, 191, 189);
1851
+ } else f && (i -= 3) > -1 && m.push(239, 191, 189);
1852
1852
  if (f = null, r < 128) {
1853
1853
  if ((i -= 1) < 0) break;
1854
- E.push(r);
1854
+ m.push(r);
1855
1855
  } else if (r < 2048) {
1856
1856
  if ((i -= 2) < 0) break;
1857
- E.push(
1857
+ m.push(
1858
1858
  r >> 6 | 192,
1859
1859
  r & 63 | 128
1860
1860
  );
1861
1861
  } else if (r < 65536) {
1862
1862
  if ((i -= 3) < 0) break;
1863
- E.push(
1863
+ m.push(
1864
1864
  r >> 12 | 224,
1865
1865
  r >> 6 & 63 | 128,
1866
1866
  r & 63 | 128
1867
1867
  );
1868
1868
  } else if (r < 1114112) {
1869
1869
  if ((i -= 4) < 0) break;
1870
- E.push(
1870
+ m.push(
1871
1871
  r >> 18 | 240,
1872
1872
  r >> 12 & 63 | 128,
1873
1873
  r >> 6 & 63 | 128,
@@ -1876,47 +1876,47 @@ function Cn() {
1876
1876
  } else
1877
1877
  throw new Error("Invalid code point");
1878
1878
  }
1879
- return E;
1879
+ return m;
1880
1880
  }
1881
- function Wi(s) {
1881
+ function Wi(a) {
1882
1882
  const i = [];
1883
- for (let r = 0; r < s.length; ++r)
1884
- i.push(s.charCodeAt(r) & 255);
1883
+ for (let r = 0; r < a.length; ++r)
1884
+ i.push(a.charCodeAt(r) & 255);
1885
1885
  return i;
1886
1886
  }
1887
- function zi(s, i) {
1887
+ function zi(a, i) {
1888
1888
  let r, h, f;
1889
- const E = [];
1890
- for (let v = 0; v < s.length && !((i -= 2) < 0); ++v)
1891
- r = s.charCodeAt(v), h = r >> 8, f = r % 256, E.push(f), E.push(h);
1892
- return E;
1889
+ const m = [];
1890
+ for (let v = 0; v < a.length && !((i -= 2) < 0); ++v)
1891
+ r = a.charCodeAt(v), h = r >> 8, f = r % 256, m.push(f), m.push(h);
1892
+ return m;
1893
1893
  }
1894
- function kt(s) {
1895
- return e.toByteArray(Hi(s));
1894
+ function kt(a) {
1895
+ return e.toByteArray(Hi(a));
1896
1896
  }
1897
- function Be(s, i, r, h) {
1897
+ function Be(a, i, r, h) {
1898
1898
  let f;
1899
- for (f = 0; f < h && !(f + r >= i.length || f >= s.length); ++f)
1900
- i[f + r] = s[f];
1899
+ for (f = 0; f < h && !(f + r >= i.length || f >= a.length); ++f)
1900
+ i[f + r] = a[f];
1901
1901
  return f;
1902
1902
  }
1903
- function Q(s, i) {
1904
- return s instanceof i || s != null && s.constructor != null && s.constructor.name != null && s.constructor.name === i.name;
1903
+ function Q(a, i) {
1904
+ return a instanceof i || a != null && a.constructor != null && a.constructor.name != null && a.constructor.name === i.name;
1905
1905
  }
1906
- function tt(s) {
1907
- return s !== s;
1906
+ function tt(a) {
1907
+ return a !== a;
1908
1908
  }
1909
1909
  const qi = (function() {
1910
- const s = "0123456789abcdef", i = new Array(256);
1910
+ const a = "0123456789abcdef", i = new Array(256);
1911
1911
  for (let r = 0; r < 16; ++r) {
1912
1912
  const h = r * 16;
1913
1913
  for (let f = 0; f < 16; ++f)
1914
- i[h + f] = s[r] + s[f];
1914
+ i[h + f] = a[r] + a[f];
1915
1915
  }
1916
1916
  return i;
1917
1917
  })();
1918
- function se(s) {
1919
- return typeof BigInt > "u" ? Yi : s;
1918
+ function se(a) {
1919
+ return typeof BigInt > "u" ? Yi : a;
1920
1920
  }
1921
1921
  function Yi() {
1922
1922
  throw new Error("BigInt not supported");
@@ -1929,12 +1929,12 @@ const bn = "https://api.anam.ai", An = "/v1", Oi = {
1929
1929
  version: "4.8.0"
1930
1930
  };
1931
1931
  var Tn = function(t, e, n, o) {
1932
- function l(a) {
1933
- return a instanceof n ? a : new n(function(u) {
1934
- u(a);
1932
+ function l(s) {
1933
+ return s instanceof n ? s : new n(function(u) {
1934
+ u(s);
1935
1935
  });
1936
1936
  }
1937
- return new (n || (n = Promise))(function(a, u) {
1937
+ return new (n || (n = Promise))(function(s, u) {
1938
1938
  function c(_) {
1939
1939
  try {
1940
1940
  p(o.next(_));
@@ -1942,7 +1942,7 @@ var Tn = function(t, e, n, o) {
1942
1942
  u(d);
1943
1943
  }
1944
1944
  }
1945
- function m(_) {
1945
+ function E(_) {
1946
1946
  try {
1947
1947
  p(o.throw(_));
1948
1948
  } catch (d) {
@@ -1950,7 +1950,7 @@ var Tn = function(t, e, n, o) {
1950
1950
  }
1951
1951
  }
1952
1952
  function p(_) {
1953
- _.done ? a(_.value) : l(_.value).then(c, m);
1953
+ _.done ? s(_.value) : l(_.value).then(c, E);
1954
1954
  }
1955
1955
  p((o = o.apply(t, e || [])).next());
1956
1956
  });
@@ -1981,10 +1981,10 @@ const ve = (t) => {
1981
1981
  const o = Object.assign(Object.assign({}, Oi), n);
1982
1982
  ce.sessionId && (o.sessionId = ce.sessionId), ce.organizationId && (o.organizationId = ce.organizationId), ce.attemptCorrelationId && (o.attemptCorrelationId = ce.attemptCorrelationId);
1983
1983
  const l = `${Di}/metrics/client`;
1984
- let a, u = {
1984
+ let s, u = {
1985
1985
  "Content-Type": "application/json"
1986
1986
  };
1987
- le?.enabled && le?.baseUrl ? (a = `${le.baseUrl}${l}`, u["X-Anam-Target-Url"] = `${ft}${l}`) : a = `${ft}${l}`, yield fetch(a, {
1987
+ le?.enabled && le?.baseUrl ? (s = `${le.baseUrl}${l}`, u["X-Anam-Target-Url"] = `${ft}${l}`) : s = `${ft}${l}`, yield fetch(s, {
1988
1988
  method: "POST",
1989
1989
  headers: u,
1990
1990
  body: JSON.stringify({
@@ -1998,13 +1998,13 @@ const ve = (t) => {
1998
1998
  }
1999
1999
  }), On = (t, e = "console") => {
2000
2000
  var n, o, l;
2001
- const a = {};
2001
+ const s = {};
2002
2002
  t.forEach((d) => {
2003
- a[d.type] || (a[d.type] = []), a[d.type].push(d);
2003
+ s[d.type] || (s[d.type] = []), s[d.type].push(d);
2004
2004
  });
2005
2005
  const u = {
2006
2006
  issues: []
2007
- }, c = ((n = a["inbound-rtp"]) === null || n === void 0 ? void 0 : n.filter((d) => d.kind === "video")) || [];
2007
+ }, c = ((n = s["inbound-rtp"]) === null || n === void 0 ? void 0 : n.filter((d) => d.kind === "video")) || [];
2008
2008
  c.length > 0 && (u.personaVideoStream = [], c.forEach((d) => {
2009
2009
  var S, g, y, C, A;
2010
2010
  const I = {
@@ -2018,8 +2018,8 @@ const ve = (t) => {
2018
2018
  };
2019
2019
  u.personaVideoStream.push(I);
2020
2020
  }));
2021
- const m = ((o = a["inbound-rtp"]) === null || o === void 0 ? void 0 : o.filter((d) => d.kind === "audio")) || [];
2022
- m.length > 0 && (u.personaAudioStream = [], m.forEach((d) => {
2021
+ const E = ((o = s["inbound-rtp"]) === null || o === void 0 ? void 0 : o.filter((d) => d.kind === "audio")) || [];
2022
+ E.length > 0 && (u.personaAudioStream = [], E.forEach((d) => {
2023
2023
  var S, g, y;
2024
2024
  const C = {
2025
2025
  packetsReceived: (S = d.packetsReceived) !== null && S !== void 0 ? S : "unknown",
@@ -2030,7 +2030,7 @@ const ve = (t) => {
2030
2030
  };
2031
2031
  u.personaAudioStream.push(C);
2032
2032
  }));
2033
- const p = ((l = a["outbound-rtp"]) === null || l === void 0 ? void 0 : l.filter((d) => d.kind === "audio")) || [];
2033
+ const p = ((l = s["outbound-rtp"]) === null || l === void 0 ? void 0 : l.filter((d) => d.kind === "audio")) || [];
2034
2034
  p.length > 0 && (u.userAudioInput = [], p.forEach((d) => {
2035
2035
  var S, g;
2036
2036
  const y = {
@@ -2039,7 +2039,7 @@ const ve = (t) => {
2039
2039
  avgPacketSendDelay: d.totalPacketSendDelay !== void 0 ? d.totalPacketSendDelay / (d.packetsSent || 1) * 1e3 : void 0
2040
2040
  };
2041
2041
  u.userAudioInput.push(y);
2042
- })), a.codec && (u.codecs = [], a.codec.forEach((d) => {
2042
+ })), s.codec && (u.codecs = [], s.codec.forEach((d) => {
2043
2043
  const S = {
2044
2044
  status: d.payloadType ? "Active" : "Available",
2045
2045
  mimeType: d.mimeType || "Unknown",
@@ -2048,7 +2048,7 @@ const ve = (t) => {
2048
2048
  channels: d.channels || void 0
2049
2049
  };
2050
2050
  u.codecs.push(S);
2051
- })), a.transport && (u.transportLayer = [], a.transport.forEach((d) => {
2051
+ })), s.transport && (u.transportLayer = [], s.transport.forEach((d) => {
2052
2052
  const S = {
2053
2053
  dtlsState: d.dtlsState || "unknown",
2054
2054
  iceState: d.iceState || "unknown",
@@ -2060,7 +2060,7 @@ const ve = (t) => {
2060
2060
  const _ = [];
2061
2061
  if (c.forEach((d) => {
2062
2062
  typeof d.framesDropped == "number" && d.framesDropped > 0 && _.push(`Video: ${d.framesDropped} frames dropped`), typeof d.packetsLost == "number" && d.packetsLost > 0 && _.push(`Video: ${d.packetsLost} packets lost`), typeof d.framesPerSecond == "number" && d.framesPerSecond < 23 && _.push(`Video: Low frame rate (${d.framesPerSecond} fps)`);
2063
- }), m.forEach((d) => {
2063
+ }), E.forEach((d) => {
2064
2064
  typeof d.packetsLost == "number" && d.packetsLost > 0 && _.push(`Audio: ${d.packetsLost} packets lost`), typeof d.jitter == "number" && d.jitter > 0.1 && _.push(`Audio: High jitter (${(d.jitter * 1e3).toFixed(1)}ms)`);
2065
2065
  }), u.issues = _, e === "json")
2066
2066
  return u;
@@ -2177,12 +2177,12 @@ class Dn {
2177
2177
  }
2178
2178
  }
2179
2179
  var ye = function(t, e, n, o) {
2180
- function l(a) {
2181
- return a instanceof n ? a : new n(function(u) {
2182
- u(a);
2180
+ function l(s) {
2181
+ return s instanceof n ? s : new n(function(u) {
2182
+ u(s);
2183
2183
  });
2184
2184
  }
2185
- return new (n || (n = Promise))(function(a, u) {
2185
+ return new (n || (n = Promise))(function(s, u) {
2186
2186
  function c(_) {
2187
2187
  try {
2188
2188
  p(o.next(_));
@@ -2190,7 +2190,7 @@ var ye = function(t, e, n, o) {
2190
2190
  u(d);
2191
2191
  }
2192
2192
  }
2193
- function m(_) {
2193
+ function E(_) {
2194
2194
  try {
2195
2195
  p(o.throw(_));
2196
2196
  } catch (d) {
@@ -2198,23 +2198,23 @@ var ye = function(t, e, n, o) {
2198
2198
  }
2199
2199
  }
2200
2200
  function p(_) {
2201
- _.done ? a(_.value) : l(_.value).then(c, m);
2201
+ _.done ? s(_.value) : l(_.value).then(c, E);
2202
2202
  }
2203
2203
  p((o = o.apply(t, e || [])).next());
2204
2204
  });
2205
2205
  };
2206
2206
  const Mn = 5, Un = 5;
2207
2207
  class Ln {
2208
- constructor(e, n, o, l, a) {
2209
- var u, c, m, p, _;
2210
- if (this.stopSignal = !1, this.sendingBuffer = [], this.wsConnectionAttempts = 0, this.socket = null, this.heartBeatIntervalRef = null, this.publicEventEmitter = o, this.internalEventEmitter = l, this.apiGatewayConfig = a, !e)
2208
+ constructor(e, n, o, l, s) {
2209
+ var u, c, E, p, _;
2210
+ if (this.stopSignal = !1, this.sendingBuffer = [], this.wsConnectionAttempts = 0, this.socket = null, this.heartBeatIntervalRef = null, this.publicEventEmitter = o, this.internalEventEmitter = l, this.apiGatewayConfig = s, !e)
2211
2211
  throw new Error("Signalling Client: sessionId is required");
2212
2212
  this.sessionId = e;
2213
2213
  const { heartbeatIntervalSeconds: d, maxWsReconnectionAttempts: S, url: g } = n;
2214
2214
  if (this.heartbeatIntervalSeconds = d || Mn, this.maxWsReconnectionAttempts = S || Un, !g.baseUrl)
2215
2215
  throw new Error("Signalling Client: baseUrl is required");
2216
2216
  if (!((u = this.apiGatewayConfig) === null || u === void 0) && u.enabled && (!((c = this.apiGatewayConfig) === null || c === void 0) && c.baseUrl)) {
2217
- const y = new URL(this.apiGatewayConfig.baseUrl), C = (m = this.apiGatewayConfig.wsPath) !== null && m !== void 0 ? m : "/ws";
2217
+ const y = new URL(this.apiGatewayConfig.baseUrl), C = (E = this.apiGatewayConfig.wsPath) !== null && E !== void 0 ? E : "/ws";
2218
2218
  y.protocol = y.protocol.replace("http", "ws"), y.pathname = C, this.url = y;
2219
2219
  const A = g.protocol || "https", I = A === "http" ? "ws" : "wss", b = `${A}://${g.baseUrl}`, R = (p = g.signallingPath) !== null && p !== void 0 ? p : "/ws", M = new URL(b);
2220
2220
  M.protocol = I === "ws" ? "ws:" : "wss:", g.port && (M.port = g.port), M.pathname = R, M.searchParams.append("session_id", e), this.url.searchParams.append("target_url", M.href);
@@ -2346,12 +2346,12 @@ function Bn(t) {
2346
2346
  return "brainType" in t || "llmId" in t;
2347
2347
  }
2348
2348
  var Zt = function(t, e, n, o) {
2349
- function l(a) {
2350
- return a instanceof n ? a : new n(function(u) {
2351
- u(a);
2349
+ function l(s) {
2350
+ return s instanceof n ? s : new n(function(u) {
2351
+ u(s);
2352
2352
  });
2353
2353
  }
2354
- return new (n || (n = Promise))(function(a, u) {
2354
+ return new (n || (n = Promise))(function(s, u) {
2355
2355
  function c(_) {
2356
2356
  try {
2357
2357
  p(o.next(_));
@@ -2359,7 +2359,7 @@ var Zt = function(t, e, n, o) {
2359
2359
  u(d);
2360
2360
  }
2361
2361
  }
2362
- function m(_) {
2362
+ function E(_) {
2363
2363
  try {
2364
2364
  p(o.throw(_));
2365
2365
  } catch (d) {
@@ -2367,7 +2367,7 @@ var Zt = function(t, e, n, o) {
2367
2367
  }
2368
2368
  }
2369
2369
  function p(_) {
2370
- _.done ? a(_.value) : l(_.value).then(c, m);
2370
+ _.done ? s(_.value) : l(_.value).then(c, E);
2371
2371
  }
2372
2372
  p((o = o.apply(t, e || [])).next());
2373
2373
  });
@@ -2384,8 +2384,8 @@ class Pn {
2384
2384
  buildGatewayUrlAndHeaders(e, n) {
2385
2385
  var o, l;
2386
2386
  if (!((o = this.apiGatewayConfig) === null || o === void 0) && o.enabled && (!((l = this.apiGatewayConfig) === null || l === void 0) && l.baseUrl)) {
2387
- const a = `${this.apiGatewayConfig.baseUrl}${e}`, u = new URL(`${this.baseUrl}${e}`), c = Object.assign(Object.assign({}, n), { "X-Anam-Target-Url": u.href });
2388
- return { url: a, headers: c };
2387
+ const s = `${this.apiGatewayConfig.baseUrl}${e}`, u = new URL(`${this.baseUrl}${e}`), c = Object.assign(Object.assign({}, n), { "X-Anam-Target-Url": u.href });
2388
+ return { url: s, headers: c };
2389
2389
  } else
2390
2390
  return {
2391
2391
  url: `${this.baseUrl}${e}`,
@@ -2401,18 +2401,18 @@ class Pn {
2401
2401
  }
2402
2402
  e && "brainType" in e && console.warn("Warning: brainType is deprecated and will be removed in a future version. Please use llmId instead.");
2403
2403
  try {
2404
- const o = `${this.apiVersion}/engine/session`, { url: l, headers: a } = this.buildGatewayUrlAndHeaders(o, {
2404
+ const o = `${this.apiVersion}/engine/session`, { url: l, headers: s } = this.buildGatewayUrlAndHeaders(o, {
2405
2405
  "Content-Type": "application/json",
2406
2406
  Authorization: `Bearer ${this.sessionToken}`
2407
2407
  }), u = yield fetch(l, {
2408
2408
  method: "POST",
2409
- headers: a,
2409
+ headers: s,
2410
2410
  body: JSON.stringify({
2411
2411
  personaConfig: e,
2412
2412
  sessionOptions: n,
2413
2413
  clientMetadata: Oi
2414
2414
  })
2415
- }), c = yield u.json(), m = c.error;
2415
+ }), c = yield u.json(), E = c.error;
2416
2416
  switch (u.status) {
2417
2417
  case 200:
2418
2418
  case 201:
@@ -2426,7 +2426,7 @@ class Pn {
2426
2426
  case 403:
2427
2427
  throw new V("Authentication failed when starting session", j.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR, 403, { cause: c.message });
2428
2428
  case 429:
2429
- throw m === "Concurrent session limit reached" ? new V("Concurrency limit reached, please upgrade your plan", j.CLIENT_ERROR_CODE_MAX_CONCURRENT_SESSIONS_REACHED, 429, { cause: c.message }) : m === "Spend cap reached" ? new V("Spend cap reached, please upgrade your plan", j.CLIENT_ERROR_CODE_SPEND_CAP_REACHED, 429, { cause: c.message }) : new V("Usage limit reached, please upgrade your plan", j.CLIENT_ERROR_CODE_USAGE_LIMIT_REACHED, 429, { cause: c.message });
2429
+ throw E === "Concurrent session limit reached" ? new V("Concurrency limit reached, please upgrade your plan", j.CLIENT_ERROR_CODE_MAX_CONCURRENT_SESSIONS_REACHED, 429, { cause: c.message }) : E === "Spend cap reached" ? new V("Spend cap reached, please upgrade your plan", j.CLIENT_ERROR_CODE_SPEND_CAP_REACHED, 429, { cause: c.message }) : new V("Usage limit reached, please upgrade your plan", j.CLIENT_ERROR_CODE_USAGE_LIMIT_REACHED, 429, { cause: c.message });
2430
2430
  case 503:
2431
2431
  throw new V("There are no available personas, please try again later", j.CLIENT_ERROR_CODE_SERVICE_BUSY, 503, { cause: c.message });
2432
2432
  default:
@@ -2447,13 +2447,13 @@ class Pn {
2447
2447
  };
2448
2448
  Bn(e) && (n = Object.assign(Object.assign({}, n), { personaConfig: e }));
2449
2449
  try {
2450
- const o = `${this.apiVersion}/auth/session-token`, { url: l, headers: a } = this.buildGatewayUrlAndHeaders(o, {
2450
+ const o = `${this.apiVersion}/auth/session-token`, { url: l, headers: s } = this.buildGatewayUrlAndHeaders(o, {
2451
2451
  "Content-Type": "application/json",
2452
2452
  Authorization: `Bearer ${this.apiKey}`
2453
2453
  });
2454
2454
  return (yield (yield fetch(l, {
2455
2455
  method: "POST",
2456
- headers: a,
2456
+ headers: s,
2457
2457
  body: JSON.stringify(n)
2458
2458
  })).json()).sessionToken;
2459
2459
  } catch {
@@ -2466,12 +2466,12 @@ class Pn {
2466
2466
  }
2467
2467
  }
2468
2468
  var Fn = function(t, e, n, o) {
2469
- function l(a) {
2470
- return a instanceof n ? a : new n(function(u) {
2471
- u(a);
2469
+ function l(s) {
2470
+ return s instanceof n ? s : new n(function(u) {
2471
+ u(s);
2472
2472
  });
2473
2473
  }
2474
- return new (n || (n = Promise))(function(a, u) {
2474
+ return new (n || (n = Promise))(function(s, u) {
2475
2475
  function c(_) {
2476
2476
  try {
2477
2477
  p(o.next(_));
@@ -2479,7 +2479,7 @@ var Fn = function(t, e, n, o) {
2479
2479
  u(d);
2480
2480
  }
2481
2481
  }
2482
- function m(_) {
2482
+ function E(_) {
2483
2483
  try {
2484
2484
  p(o.throw(_));
2485
2485
  } catch (d) {
@@ -2487,7 +2487,7 @@ var Fn = function(t, e, n, o) {
2487
2487
  }
2488
2488
  }
2489
2489
  function p(_) {
2490
- _.done ? a(_.value) : l(_.value).then(c, m);
2490
+ _.done ? s(_.value) : l(_.value).then(c, E);
2491
2491
  }
2492
2492
  p((o = o.apply(t, e || [])).next());
2493
2493
  });
@@ -2500,25 +2500,25 @@ class $n {
2500
2500
  return Fn(this, void 0, void 0, function* () {
2501
2501
  var n, o;
2502
2502
  try {
2503
- let l, a = {
2503
+ let l, s = {
2504
2504
  "Content-Type": "application/json"
2505
2505
  };
2506
2506
  const u = "/talk", c = `?session_id=${this.sessionId}`;
2507
2507
  if (!((n = this.apiGatewayConfig) === null || n === void 0) && n.enabled && (!((o = this.apiGatewayConfig) === null || o === void 0) && o.baseUrl)) {
2508
2508
  l = `${this.apiGatewayConfig.baseUrl}${u}${c}`;
2509
2509
  const p = new URL(`${this.baseUrl}${u}${c}`);
2510
- a["X-Anam-Target-Url"] = p.href;
2510
+ s["X-Anam-Target-Url"] = p.href;
2511
2511
  } else
2512
2512
  l = `${this.baseUrl}${u}${c}`;
2513
- const m = yield fetch(l, {
2513
+ const E = yield fetch(l, {
2514
2514
  method: "POST",
2515
- headers: a,
2515
+ headers: s,
2516
2516
  body: JSON.stringify({
2517
2517
  content: e
2518
2518
  })
2519
2519
  });
2520
- if (!m.ok)
2521
- throw new Error(`Failed to send talk command: ${m.status} ${m.statusText}`);
2520
+ if (!E.ok)
2521
+ throw new Error(`Failed to send talk command: ${E.status} ${E.statusText}`);
2522
2522
  } catch (l) {
2523
2523
  throw console.error(l), new Error("EngineApiRestClient - sendTalkCommand: Failed to send talk command");
2524
2524
  }
@@ -2614,12 +2614,12 @@ var q;
2614
2614
  t[t.UNSTARTED = 0] = "UNSTARTED", t[t.STREAMING = 1] = "STREAMING", t[t.INTERRUPTED = 2] = "INTERRUPTED", t[t.ENDED = 3] = "ENDED";
2615
2615
  })(q || (q = {}));
2616
2616
  var st = function(t, e, n, o) {
2617
- function l(a) {
2618
- return a instanceof n ? a : new n(function(u) {
2619
- u(a);
2617
+ function l(s) {
2618
+ return s instanceof n ? s : new n(function(u) {
2619
+ u(s);
2620
2620
  });
2621
2621
  }
2622
- return new (n || (n = Promise))(function(a, u) {
2622
+ return new (n || (n = Promise))(function(s, u) {
2623
2623
  function c(_) {
2624
2624
  try {
2625
2625
  p(o.next(_));
@@ -2627,7 +2627,7 @@ var st = function(t, e, n, o) {
2627
2627
  u(d);
2628
2628
  }
2629
2629
  }
2630
- function m(_) {
2630
+ function E(_) {
2631
2631
  try {
2632
2632
  p(o.throw(_));
2633
2633
  } catch (d) {
@@ -2635,7 +2635,7 @@ var st = function(t, e, n, o) {
2635
2635
  }
2636
2636
  }
2637
2637
  function p(_) {
2638
- _.done ? a(_.value) : l(_.value).then(c, m);
2638
+ _.done ? s(_.value) : l(_.value).then(c, E);
2639
2639
  }
2640
2640
  p((o = o.apply(t, e || [])).next());
2641
2641
  });
@@ -2695,12 +2695,12 @@ class Hn {
2695
2695
  }
2696
2696
  }
2697
2697
  var J = function(t, e, n, o) {
2698
- function l(a) {
2699
- return a instanceof n ? a : new n(function(u) {
2700
- u(a);
2698
+ function l(s) {
2699
+ return s instanceof n ? s : new n(function(u) {
2700
+ u(s);
2701
2701
  });
2702
2702
  }
2703
- return new (n || (n = Promise))(function(a, u) {
2703
+ return new (n || (n = Promise))(function(s, u) {
2704
2704
  function c(_) {
2705
2705
  try {
2706
2706
  p(o.next(_));
@@ -2708,7 +2708,7 @@ var J = function(t, e, n, o) {
2708
2708
  u(d);
2709
2709
  }
2710
2710
  }
2711
- function m(_) {
2711
+ function E(_) {
2712
2712
  try {
2713
2713
  p(o.throw(_));
2714
2714
  } catch (d) {
@@ -2716,7 +2716,7 @@ var J = function(t, e, n, o) {
2716
2716
  }
2717
2717
  }
2718
2718
  function p(_) {
2719
- _.done ? a(_.value) : l(_.value).then(c, m);
2719
+ _.done ? s(_.value) : l(_.value).then(c, E);
2720
2720
  }
2721
2721
  p((o = o.apply(t, e || [])).next());
2722
2722
  });
@@ -2724,13 +2724,13 @@ var J = function(t, e, n, o) {
2724
2724
  const Wn = 15e3, zn = 5e3, qn = 2;
2725
2725
  class Yn {
2726
2726
  constructor(e, n, o, l) {
2727
- var a, u, c, m;
2727
+ var s, u, c, E;
2728
2728
  this.peerConnection = null, this.connectionReceivedAnswer = !1, this.remoteIceCandidateBuffer = [], this.inputAudioStream = null, this.dataChannel = null, this.videoElement = null, this.videoStream = null, this.audioStream = null, this.inputAudioState = {
2729
2729
  isMuted: !1,
2730
2730
  permissionState: ue.NOT_REQUESTED
2731
2731
  }, this.successMetricPoller = null, this.successMetricFired = !1, this.showPeerConnectionStatsReport = !1, this.peerConnectionStatsReportOutputFormat = "console", this.statsCollectionInterval = null, this.agentAudioInputStream = null, this.publicEventEmitter = o, this.internalEventEmitter = l, this.apiGatewayConfig = n.apiGateway;
2732
2732
  const { inputAudio: p } = n;
2733
- this.inputAudioState = p.inputAudioState, n.inputAudio.userProvidedMediaStream && (this.inputAudioStream = n.inputAudio.userProvidedMediaStream), this.disableInputAudio = n.inputAudio.disableInputAudio === !0, this.internalEventEmitter.addListener(X.WEB_SOCKET_OPEN, this.onSignallingClientConnected.bind(this)), this.internalEventEmitter.addListener(X.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this)), this.iceServers = n.iceServers, this.signallingClient = new Ln(e, n.signalling, this.publicEventEmitter, this.internalEventEmitter, this.apiGatewayConfig), this.engineApiRestClient = new $n(n.engine.baseUrl, e, this.apiGatewayConfig), this.audioDeviceId = n.inputAudio.audioDeviceId, this.showPeerConnectionStatsReport = (u = (a = n.metrics) === null || a === void 0 ? void 0 : a.showPeerConnectionStatsReport) !== null && u !== void 0 ? u : !1, this.peerConnectionStatsReportOutputFormat = (m = (c = n.metrics) === null || c === void 0 ? void 0 : c.peerConnectionStatsReportOutputFormat) !== null && m !== void 0 ? m : "console";
2733
+ this.inputAudioState = p.inputAudioState, n.inputAudio.userProvidedMediaStream && (this.inputAudioStream = n.inputAudio.userProvidedMediaStream), this.disableInputAudio = n.inputAudio.disableInputAudio === !0, this.internalEventEmitter.addListener(X.WEB_SOCKET_OPEN, this.onSignallingClientConnected.bind(this)), this.internalEventEmitter.addListener(X.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this)), this.iceServers = n.iceServers, this.signallingClient = new Ln(e, n.signalling, this.publicEventEmitter, this.internalEventEmitter, this.apiGatewayConfig), this.engineApiRestClient = new $n(n.engine.baseUrl, e, this.apiGatewayConfig), this.audioDeviceId = n.inputAudio.audioDeviceId, this.showPeerConnectionStatsReport = (u = (s = n.metrics) === null || s === void 0 ? void 0 : s.showPeerConnectionStatsReport) !== null && u !== void 0 ? u : !1, this.peerConnectionStatsReportOutputFormat = (E = (c = n.metrics) === null || c === void 0 ? void 0 : c.peerConnectionStatsReportOutputFormat) !== null && E !== void 0 ? E : "console";
2734
2734
  }
2735
2735
  onInputAudioStateChange(e, n) {
2736
2736
  e.isMuted !== n.isMuted && (n.isMuted ? this.muteAllAudioTracks() : this.unmuteAllAudioTracks());
@@ -2783,9 +2783,9 @@ class Yn {
2783
2783
  try {
2784
2784
  const n = yield this.peerConnection.getStats();
2785
2785
  let o = !1, l = null;
2786
- n.forEach((a) => {
2787
- a.type === "inbound-rtp" && a.kind === "video" && (a.framesDecoded !== void 0 && a.framesDecoded > 0 ? (o = !0, l = "framesDecoded") : a.framesReceived !== void 0 && a.framesReceived > 0 ? (o = !0, l = "framesReceived") : a.bytesReceived > 0 && a.packetsReceived > 0 && // Additional check: ensure we've received enough data for actual video
2788
- a.bytesReceived > 1e5 && (o = !0, l = "bytesReceived"));
2786
+ n.forEach((s) => {
2787
+ s.type === "inbound-rtp" && s.kind === "video" && (s.framesDecoded !== void 0 && s.framesDecoded > 0 ? (o = !0, l = "framesDecoded") : s.framesReceived !== void 0 && s.framesReceived > 0 ? (o = !0, l = "framesReceived") : s.bytesReceived > 0 && s.packetsReceived > 0 && // Additional check: ensure we've received enough data for actual video
2788
+ s.bytesReceived > 1e5 && (o = !0, l = "bytesReceived"));
2789
2789
  }), o && !this.successMetricFired && (this.successMetricFired = !0, _e(re.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", l ? { detectionMethod: l } : void 0), this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e), this.successMetricPoller = null);
2790
2790
  } catch {
2791
2791
  }
@@ -2908,8 +2908,8 @@ class Yn {
2908
2908
  this.connectionReceivedAnswer ? yield this.peerConnection.addIceCandidate(l) : this.remoteIceCandidateBuffer.push(l);
2909
2909
  break;
2910
2910
  case W.END_SESSION:
2911
- const a = e.payload;
2912
- this.publicEventEmitter.emit(N.CONNECTION_CLOSED, he.SERVER_CLOSED_CONNECTION, a), this.shutdown();
2911
+ const s = e.payload;
2912
+ this.publicEventEmitter.emit(N.CONNECTION_CLOSED, he.SERVER_CLOSED_CONNECTION, s), this.shutdown();
2913
2913
  break;
2914
2914
  case W.WARNING:
2915
2915
  const u = e.payload;
@@ -2920,8 +2920,8 @@ class Yn {
2920
2920
  this.publicEventEmitter.emit(N.TALK_STREAM_INTERRUPTED, c.correlationId);
2921
2921
  break;
2922
2922
  case W.SESSION_READY:
2923
- const m = e.sessionId;
2924
- this.publicEventEmitter.emit(N.SESSION_READY, m);
2923
+ const E = e.sessionId;
2924
+ this.publicEventEmitter.emit(N.SESSION_READY, E);
2925
2925
  break;
2926
2926
  case W.HEARTBEAT:
2927
2927
  break;
@@ -3008,8 +3008,8 @@ class Yn {
3008
3008
  case Oe.CLIENT_TOOL_EVENT:
3009
3009
  const l = o.data;
3010
3010
  this.internalEventEmitter.emit(X.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED, l);
3011
- const a = Kn.WebRTCClientToolEventToClientToolEvent(l);
3012
- this.publicEventEmitter.emit(N.CLIENT_TOOL_EVENT_RECEIVED, a);
3011
+ const s = Kn.WebRTCClientToolEventToClientToolEvent(l);
3012
+ this.publicEventEmitter.emit(N.CLIENT_TOOL_EVENT_RECEIVED, s);
3013
3013
  break;
3014
3014
  case Oe.REASONING_TEXT:
3015
3015
  this.internalEventEmitter.emit(X.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, o.data);
@@ -3061,8 +3061,8 @@ class Yn {
3061
3061
  }
3062
3062
  this.inputAudioState.isMuted && this.muteAllAudioTracks();
3063
3063
  const e = this.inputAudioStream.getAudioTracks()[0], o = this.peerConnection.getSenders().find((l) => {
3064
- var a;
3065
- return ((a = l.track) === null || a === void 0 ? void 0 : a.kind) === "audio" || l.track === null && l.dtmf !== null;
3064
+ var s;
3065
+ return ((s = l.track) === null || s === void 0 ? void 0 : s.kind) === "audio" || l.track === null && l.dtmf !== null;
3066
3066
  });
3067
3067
  if (o)
3068
3068
  try {
@@ -3158,22 +3158,22 @@ class Jn {
3158
3158
  id: n.id,
3159
3159
  content: n.content,
3160
3160
  role: n.role
3161
- }, l = this.reasoning_messages.findIndex((a) => a.id === o.id);
3161
+ }, l = this.reasoning_messages.findIndex((s) => s.id === o.id);
3162
3162
  if (l !== -1) {
3163
- const a = this.reasoning_messages[l];
3164
- a.content += o.content, this.reasoning_messages[l] = a;
3163
+ const s = this.reasoning_messages[l];
3164
+ s.content += o.content, this.reasoning_messages[l] = s;
3165
3165
  } else
3166
3166
  this.reasoning_messages.push(o);
3167
3167
  n.endOfThought && this.publicEventEmitter.emit(N.REASONING_HISTORY_UPDATED, this.reasoning_messages);
3168
3168
  }
3169
3169
  }
3170
3170
  var ae = function(t, e, n, o) {
3171
- function l(a) {
3172
- return a instanceof n ? a : new n(function(u) {
3173
- u(a);
3171
+ function l(s) {
3172
+ return s instanceof n ? s : new n(function(u) {
3173
+ u(s);
3174
3174
  });
3175
3175
  }
3176
- return new (n || (n = Promise))(function(a, u) {
3176
+ return new (n || (n = Promise))(function(s, u) {
3177
3177
  function c(_) {
3178
3178
  try {
3179
3179
  p(o.next(_));
@@ -3181,7 +3181,7 @@ var ae = function(t, e, n, o) {
3181
3181
  u(d);
3182
3182
  }
3183
3183
  }
3184
- function m(_) {
3184
+ function E(_) {
3185
3185
  try {
3186
3186
  p(o.throw(_));
3187
3187
  } catch (d) {
@@ -3189,14 +3189,14 @@ var ae = function(t, e, n, o) {
3189
3189
  }
3190
3190
  }
3191
3191
  function p(_) {
3192
- _.done ? a(_.value) : l(_.value).then(c, m);
3192
+ _.done ? s(_.value) : l(_.value).then(c, E);
3193
3193
  }
3194
3194
  p((o = o.apply(t, e || [])).next());
3195
3195
  });
3196
3196
  };
3197
3197
  class Xn {
3198
3198
  constructor(e, n, o) {
3199
- var l, a, u, c, m;
3199
+ var l, s, u, c, E;
3200
3200
  this.inputAudioState = {
3201
3201
  isMuted: !1,
3202
3202
  permissionState: ue.NOT_REQUESTED
@@ -3204,7 +3204,7 @@ class Xn {
3204
3204
  const p = this.validateClientConfig(e, n, o);
3205
3205
  if (p)
3206
3206
  throw new V(p, j.CLIENT_ERROR_CODE_CONFIGURATION_ERROR, 400);
3207
- this.personaConfig = n, this.clientOptions = o, (!((l = o?.api) === null || l === void 0) && l.baseUrl || !((a = o?.api) === null || a === void 0) && a.apiVersion) && Rn(o.api.baseUrl || ki, o.api.apiVersion || wt), !((c = (u = o?.api) === null || u === void 0 ? void 0 : u.apiGateway) === null || c === void 0) && c.enabled && Nn(o.api.apiGateway), !((m = o?.metrics) === null || m === void 0) && m.disableClientMetrics && xn(!0), this.publicEventEmitter = new jn(), this.internalEventEmitter = new Vn(), this.apiClient = new Pn(e, o?.apiKey, o?.api), this.messageHistoryClient = new Gn(this.publicEventEmitter, this.internalEventEmitter), this.reasoningHistoryClient = new Jn(this.publicEventEmitter, this.internalEventEmitter);
3207
+ this.personaConfig = n, this.clientOptions = o, (!((l = o?.api) === null || l === void 0) && l.baseUrl || !((s = o?.api) === null || s === void 0) && s.apiVersion) && Rn(o.api.baseUrl || ki, o.api.apiVersion || wt), !((c = (u = o?.api) === null || u === void 0 ? void 0 : u.apiGateway) === null || c === void 0) && c.enabled && Nn(o.api.apiGateway), !((E = o?.metrics) === null || E === void 0) && E.disableClientMetrics && xn(!0), this.publicEventEmitter = new jn(), this.internalEventEmitter = new Vn(), this.apiClient = new Pn(e, o?.apiKey, o?.api), this.messageHistoryClient = new Gn(this.publicEventEmitter, this.internalEventEmitter), this.reasoningHistoryClient = new Jn(this.publicEventEmitter, this.internalEventEmitter);
3208
3208
  }
3209
3209
  decodeJwt(e) {
3210
3210
  try {
@@ -3215,7 +3215,7 @@ class Xn {
3215
3215
  }
3216
3216
  }
3217
3217
  validateClientConfig(e, n, o) {
3218
- var l, a;
3218
+ var l, s;
3219
3219
  if (!e && !o?.apiKey)
3220
3220
  return "Either sessionToken or apiKey must be provided";
3221
3221
  if (o?.apiKey && e)
@@ -3228,10 +3228,10 @@ class Xn {
3228
3228
  this.organizationId = c.accountId, ve({
3229
3229
  organizationId: this.organizationId
3230
3230
  });
3231
- const m = (a = c.type) === null || a === void 0 ? void 0 : a.toLowerCase();
3232
- if (m === "legacy")
3231
+ const E = (s = c.type) === null || s === void 0 ? void 0 : s.toLowerCase();
3232
+ if (E === "legacy")
3233
3233
  return "Legacy session tokens are no longer supported. Please define your persona when creating your session token. See https://docs.anam.ai/resources/migrating-legacy for more information.";
3234
- if ((m === "ephemeral" || m === "stateful") && n)
3234
+ if ((E === "ephemeral" || E === "stateful") && n)
3235
3235
  return "This session token already contains a persona configuration. Please remove the personaConfig parameter.";
3236
3236
  } else if (!n)
3237
3237
  return "Missing persona config. Persona configuration must be provided when using apiKey";
@@ -3254,7 +3254,7 @@ class Xn {
3254
3254
  }
3255
3255
  startSession(e) {
3256
3256
  return ae(this, void 0, void 0, function* () {
3257
- var n, o, l, a, u, c, m, p, _, d, S, g;
3257
+ var n, o, l, s, u, c, E, p, _, d, S, g;
3258
3258
  const y = this.personaConfig, C = this.buildStartSessionOptionsForClient(), A = yield this.apiClient.startSession(y, C), { sessionId: I, clientConfig: b, engineHost: R, engineProtocol: M, signallingEndpoint: x } = A, { heartbeatIntervalSeconds: Y, maxWsReconnectionAttempts: te, iceServers: $ } = b;
3259
3259
  this.sessionId = I, ve({
3260
3260
  sessionId: this.sessionId
@@ -3279,11 +3279,11 @@ class Xn {
3279
3279
  inputAudioState: this.inputAudioState,
3280
3280
  userProvidedMediaStream: !((o = this.clientOptions) === null || o === void 0) && o.disableInputAudio ? void 0 : e,
3281
3281
  audioDeviceId: (l = this.clientOptions) === null || l === void 0 ? void 0 : l.audioDeviceId,
3282
- disableInputAudio: (a = this.clientOptions) === null || a === void 0 ? void 0 : a.disableInputAudio
3282
+ disableInputAudio: (s = this.clientOptions) === null || s === void 0 ? void 0 : s.disableInputAudio
3283
3283
  },
3284
3284
  apiGateway: (c = (u = this.clientOptions) === null || u === void 0 ? void 0 : u.api) === null || c === void 0 ? void 0 : c.apiGateway,
3285
3285
  metrics: {
3286
- showPeerConnectionStatsReport: (_ = (p = (m = this.clientOptions) === null || m === void 0 ? void 0 : m.metrics) === null || p === void 0 ? void 0 : p.showPeerConnectionStatsReport) !== null && _ !== void 0 ? _ : !1,
3286
+ showPeerConnectionStatsReport: (_ = (p = (E = this.clientOptions) === null || E === void 0 ? void 0 : E.metrics) === null || p === void 0 ? void 0 : p.showPeerConnectionStatsReport) !== null && _ !== void 0 ? _ : !1,
3287
3287
  peerConnectionStatsReportOutputFormat: (g = (S = (d = this.clientOptions) === null || d === void 0 ? void 0 : d.metrics) === null || S === void 0 ? void 0 : S.peerConnectionStatsReportOutputFormat) !== null && g !== void 0 ? g : "console"
3288
3288
  }
3289
3289
  }, this.publicEventEmitter, this.internalEventEmitter);
@@ -3317,14 +3317,14 @@ class Xn {
3317
3317
  sessionId: null
3318
3318
  // reset sessionId
3319
3319
  }), _e(re.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT, "1"), !((n = this.clientOptions) === null || n === void 0) && n.disableInputAudio && e && console.warn("AnamClient:Input audio is disabled. User provided audio stream will be ignored."), yield this.startSessionIfNeeded(e), this._isStreaming = !0, new Promise((l) => {
3320
- var a;
3320
+ var s;
3321
3321
  const u = [];
3322
- let c = !1, m = !1;
3322
+ let c = !1, E = !1;
3323
3323
  this.publicEventEmitter.addListener(N.VIDEO_STREAM_STARTED, (p) => {
3324
- u.push(p), c = !0, m && l(u);
3324
+ u.push(p), c = !0, E && l(u);
3325
3325
  }), this.publicEventEmitter.addListener(N.AUDIO_STREAM_STARTED, (p) => {
3326
- u.push(p), m = !0, c && l(u);
3327
- }), (a = this.streamingClient) === null || a === void 0 || a.startConnection();
3326
+ u.push(p), E = !0, c && l(u);
3327
+ }), (s = this.streamingClient) === null || s === void 0 || s.startConnection();
3328
3328
  });
3329
3329
  });
3330
3330
  }
@@ -3347,9 +3347,9 @@ class Xn {
3347
3347
  }), _e(re.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT, "1"), !((o = this.clientOptions) === null || o === void 0) && o.disableInputAudio && n && console.warn("AnamClient:Input audio is disabled. User provided audio stream will be ignored.");
3348
3348
  try {
3349
3349
  yield this.startSessionIfNeeded(n);
3350
- } catch (a) {
3351
- throw a instanceof V ? a : new V("Failed to start session", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
3352
- cause: a instanceof Error ? a.message : String(a),
3350
+ } catch (s) {
3351
+ throw s instanceof V ? s : new V("Failed to start session", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
3352
+ cause: s instanceof Error ? s.message : String(s),
3353
3353
  sessionId: this.sessionId
3354
3354
  });
3355
3355
  }
@@ -3520,23 +3520,26 @@ function ir() {
3520
3520
  }
3521
3521
  async function nr(t, e, n) {
3522
3522
  if (t.isReady.value = !1, !Ui(e)) {
3523
- console.warn("[AnamWidget] Invalid agent ID format:", e), t.isReady.value = !0;
3523
+ console.error("[AnamWidget] Invalid agent ID format:", e);
3524
3524
  return;
3525
3525
  }
3526
3526
  try {
3527
3527
  const o = await fetch(`${n}/v1/personas/${e}/widget`);
3528
- if (!o.ok) return;
3528
+ if (!o.ok) {
3529
+ const s = o.status === 404 ? "Agent not found. Check your agent ID." : o.status === 401 || o.status === 403 ? "Not authorized. Check your agent ID." : "Server error. Please try again later.";
3530
+ console.error(`[AnamWidget] Failed to load widget config: ${s}`);
3531
+ return;
3532
+ }
3529
3533
  const l = await o.json();
3530
- t.avatarThumbnailUrl.value = l.persona?.avatarImageUrl || null, t.avatarVideoUrl.value = l.persona?.avatarVideoUrl || null, t.personaName.value = l.persona?.name || null, t.serverConfig.value = l.widgetConfig || null;
3531
- } catch {
3532
- } finally {
3533
- t.isReady.value = !0;
3534
+ t.avatarThumbnailUrl.value = l.persona?.avatarImageUrl || null, t.avatarVideoUrl.value = l.persona?.avatarVideoUrl || null, t.personaName.value = l.persona?.name || null, t.serverConfig.value = l.widgetConfig || null, t.isReady.value = !0;
3535
+ } catch (o) {
3536
+ console.error("[AnamWidget] Failed to load widget config:", o);
3534
3537
  }
3535
3538
  }
3536
3539
  async function rr(t, e, n, o, l) {
3537
3540
  if (t.connectionStatus.value === "connecting" || t.connectionStatus.value === "connected")
3538
3541
  return;
3539
- const a = ++t.generation;
3542
+ const s = ++t.generation;
3540
3543
  t.connectionStatus.value = "connecting", t.error.value = null;
3541
3544
  let u;
3542
3545
  try {
@@ -3552,7 +3555,7 @@ async function rr(t, e, n, o, l) {
3552
3555
  headers: { "Content-Type": "application/json" },
3553
3556
  body: JSON.stringify({ agentId: e })
3554
3557
  });
3555
- if (a !== t.generation) return;
3558
+ if (s !== t.generation) return;
3556
3559
  if (u = _.status, !_.ok) {
3557
3560
  const S = await _.json().catch(() => ({}));
3558
3561
  throw new Error(S.error || `HTTP ${_.status}`);
@@ -3562,38 +3565,38 @@ async function rr(t, e, n, o, l) {
3562
3565
  hasToken: !!d.sessionToken
3563
3566
  }), c = d.sessionToken;
3564
3567
  }
3565
- if (a !== t.generation) return;
3566
- const m = Zn(c, {
3568
+ if (s !== t.generation) return;
3569
+ const E = Zn(c, {
3567
3570
  api: n ? { baseUrl: n } : void 0,
3568
3571
  metrics: { disableClientMetrics: !0 }
3569
3572
  });
3570
- m.addListener(N.CONNECTION_ESTABLISHED, () => {
3571
- a === t.generation && (console.log("[AnamWidget] Connection established"), t.connectionStatus.value = "connected");
3572
- }), m.addListener(N.VIDEO_STREAM_STARTED, () => {
3573
- a === t.generation && (console.log("[AnamWidget] Video stream started"), t.isStreaming.value = !0);
3574
- }), m.addListener(N.AUDIO_STREAM_STARTED, () => {
3573
+ E.addListener(N.CONNECTION_ESTABLISHED, () => {
3574
+ s === t.generation && (console.log("[AnamWidget] Connection established"), t.connectionStatus.value = "connected");
3575
+ }), E.addListener(N.VIDEO_STREAM_STARTED, () => {
3576
+ s === t.generation && (console.log("[AnamWidget] Video stream started"), t.isStreaming.value = !0);
3577
+ }), E.addListener(N.AUDIO_STREAM_STARTED, () => {
3575
3578
  console.log("[AnamWidget] Audio stream started");
3576
- }), m.addListener(N.MESSAGE_HISTORY_UPDATED, (_) => {
3577
- a === t.generation && (t.messages.value = [..._]);
3578
- }), m.addListener(N.CONNECTION_CLOSED, (_, d) => {
3579
- a === t.generation && (console.log("[AnamWidget] Connection closed:", _, d), t.connectionStatus.value = "idle", t.isStreaming.value = !1, t.sessionId.value = null);
3580
- }), m.addListener(N.SESSION_READY, (_) => {
3581
- a === t.generation && (console.log("[AnamWidget] Session ready:", _), t.sessionId.value = _);
3579
+ }), E.addListener(N.MESSAGE_HISTORY_UPDATED, (_) => {
3580
+ s === t.generation && (t.messages.value = [..._]);
3581
+ }), E.addListener(N.CONNECTION_CLOSED, (_, d) => {
3582
+ s === t.generation && (console.log("[AnamWidget] Connection closed:", _, d), t.connectionStatus.value = "idle", t.isStreaming.value = !1, t.sessionId.value = null);
3583
+ }), E.addListener(N.SESSION_READY, (_) => {
3584
+ s === t.generation && (console.log("[AnamWidget] Session ready:", _), t.sessionId.value = _);
3582
3585
  });
3583
- const p = await m.stream();
3584
- if (a !== t.generation) {
3586
+ const p = await E.stream();
3587
+ if (s !== t.generation) {
3585
3588
  try {
3586
- await m.stopStreaming();
3589
+ await E.stopStreaming();
3587
3590
  } catch {
3588
3591
  }
3589
3592
  return;
3590
3593
  }
3591
- if (t.client.value = m, o && p.length > 0) {
3594
+ if (t.client.value = E, o && p.length > 0) {
3592
3595
  const _ = p.find((d) => d.getVideoTracks().length > 0);
3593
3596
  _ && (o.srcObject = _);
3594
3597
  }
3595
3598
  } catch (c) {
3596
- if (a !== t.generation) return;
3599
+ if (s !== t.generation) return;
3597
3600
  console.error("[AnamWidget] Failed to start session:", c), t.error.value = tr(c, u), t.connectionStatus.value = "error", t.client.value = null;
3598
3601
  }
3599
3602
  }
@@ -3618,7 +3621,7 @@ function lr(t) {
3618
3621
  function cr(t, e, n) {
3619
3622
  const o = ze();
3620
3623
  o.current || (o.current = ir());
3621
- const l = o.current, a = t || (n ? er(n).personaId : void 0), u = !!a || !!n;
3624
+ const l = o.current, s = t || (n ? er(n).personaId : void 0), u = !!s || !!n;
3622
3625
  l.isConfigured.value !== u && (l.isConfigured.value = u);
3623
3626
  const c = e || Qn;
3624
3627
  return {
@@ -3635,15 +3638,15 @@ function cr(t, e, n) {
3635
3638
  personaName: l.personaName,
3636
3639
  serverConfig: l.serverConfig,
3637
3640
  fetchWidgetConfig: () => {
3638
- if (!a) {
3641
+ if (!s) {
3639
3642
  l.isReady.value = !0;
3640
3643
  return;
3641
3644
  }
3642
- nr(l, a, c);
3645
+ nr(l, s, c);
3643
3646
  },
3644
- startSession: (m) => !a && !n ? (l.error.value = "No agent ID or session token configured", Promise.resolve()) : rr(l, a || "", c, m, n),
3647
+ startSession: (E) => !s && !n ? (l.error.value = "No agent ID or session token configured", Promise.resolve()) : rr(l, s || "", c, E, n),
3645
3648
  stopSession: () => or(l),
3646
- sendMessage: (m) => sr(l, m),
3649
+ sendMessage: (E) => sr(l, E),
3647
3650
  toggleMute: () => ar(l),
3648
3651
  cleanup: () => lr(l)
3649
3652
  };
@@ -3687,12 +3690,12 @@ const fr = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox:
3687
3690
  /* @__PURE__ */ w("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" }),
3688
3691
  /* @__PURE__ */ w("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
3689
3692
  /* @__PURE__ */ w("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
3690
- ] }), Er = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3693
+ ] }), mr = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3691
3694
  /* @__PURE__ */ w("line", { x1: "1", y1: "1", x2: "23", y2: "23" }),
3692
3695
  /* @__PURE__ */ w("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V5a3 3 0 0 0-5.94-.6" }),
3693
3696
  /* @__PURE__ */ w("path", { d: "M17 16.95A7 7 0 0 1 5 12v-2m14 0v2c0 .87-.16 1.71-.46 2.49" }),
3694
3697
  /* @__PURE__ */ w("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
3695
- ] }), mr = () => /* @__PURE__ */ w("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3698
+ ] }), Er = () => /* @__PURE__ */ w("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3696
3699
  /* @__PURE__ */ w("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
3697
3700
  /* @__PURE__ */ w("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
3698
3701
  ] }), _t = () => /* @__PURE__ */ w("svg", { width: "48", height: "48", viewBox: "0 0 48 48", fill: "none", style: { opacity: 0.3 }, children: [
@@ -3705,16 +3708,16 @@ function gr({
3705
3708
  videoRef: n,
3706
3709
  avatarSrc: o,
3707
3710
  avatarVideoSrc: l,
3708
- displayCta: a,
3711
+ displayCta: s,
3709
3712
  onCollapse: u,
3710
3713
  onStop: c
3711
3714
  }) {
3712
- const m = ze(null), [p, _] = Ve(""), [d, S] = Ve(null), [g, y] = Ve(!1), C = ze(null), A = e.connectionStatus.value === "connected", I = e.connectionStatus.value === "connecting", b = e.connectionStatus.value === "error", R = e.isStreaming.value, M = !I && !A && !b, x = nt(async () => {
3715
+ const E = ze(null), [p, _] = Ve(""), [d, S] = Ve(null), [g, y] = Ve(!1), C = ze(null), A = e.connectionStatus.value === "connected", I = e.connectionStatus.value === "connecting", b = e.connectionStatus.value === "error", R = e.isStreaming.value, M = !I && !A && !b, x = nt(async () => {
3713
3716
  n.current && await e.startSession(n.current);
3714
3717
  }, [e.startSession]), Y = nt(() => {
3715
3718
  if (!p.trim()) return;
3716
3719
  const $ = p.trim();
3717
- e.sendMessage($), _(""), m.current?.focus(), C.current && clearTimeout(C.current), y(!1), S($), C.current = window.setTimeout(() => {
3720
+ e.sendMessage($), _(""), E.current?.focus(), C.current && clearTimeout(C.current), y(!1), S($), C.current = window.setTimeout(() => {
3718
3721
  y(!0), C.current = window.setTimeout(() => {
3719
3722
  S(null), y(!1);
3720
3723
  }, 400);
@@ -3762,7 +3765,7 @@ function gr({
3762
3765
  ) : /* @__PURE__ */ w(_t, {}),
3763
3766
  /* @__PURE__ */ w("button", { class: "anam-cta-pill", onClick: x, children: [
3764
3767
  /* @__PURE__ */ w(pr, {}),
3765
- a
3768
+ s
3766
3769
  ] })
3767
3770
  ] })
3768
3771
  ) : (
@@ -3798,14 +3801,14 @@ function gr({
3798
3801
  class: `anam-ctl-btn ${e.isMuted.value ? "anam-ctl-btn-muted" : ""}`,
3799
3802
  onClick: () => e.toggleMute(),
3800
3803
  "aria-label": e.isMuted.value ? "Unmute" : "Mute",
3801
- children: e.isMuted.value ? /* @__PURE__ */ w(Er, {}) : /* @__PURE__ */ w(_r, {})
3804
+ children: e.isMuted.value ? /* @__PURE__ */ w(mr, {}) : /* @__PURE__ */ w(_r, {})
3802
3805
  }
3803
3806
  ),
3804
3807
  t.showTextInput && /* @__PURE__ */ w("div", { class: "anam-ctl-input-wrap", children: [
3805
3808
  /* @__PURE__ */ w(
3806
3809
  "input",
3807
3810
  {
3808
- ref: m,
3811
+ ref: E,
3809
3812
  type: "text",
3810
3813
  class: "anam-ctl-input",
3811
3814
  placeholder: "Type a message...",
@@ -3822,7 +3825,7 @@ function gr({
3822
3825
  onClick: Y,
3823
3826
  disabled: !A || !p.trim(),
3824
3827
  "aria-label": "Send message",
3825
- children: /* @__PURE__ */ w(mr, {})
3828
+ children: /* @__PURE__ */ w(Er, {})
3826
3829
  }
3827
3830
  )
3828
3831
  ] })
@@ -3861,22 +3864,22 @@ function yr(t) {
3861
3864
  const l = Ce(
3862
3865
  () => hr(t),
3863
3866
  [t.layout, t["initial-state"], t.position, t["ui-mute-button"], t["ui-text-input"], t["ui-captions"], t["call-to-action"]]
3864
- ), a = Ce(() => {
3867
+ ), s = Ce(() => {
3865
3868
  const I = o.serverConfig.value;
3866
3869
  return pt(pt({ ...qt }, I ?? {}), l);
3867
3870
  }, [o.serverConfig.value, l]), u = Ni(
3868
- a.layout === "floating" ? a.initialState : "expanded"
3871
+ s.layout === "floating" ? s.initialState : "expanded"
3869
3872
  );
3870
3873
  Ge(() => {
3871
- a.layout === "inline" ? u.value = "expanded" : u.value = a.initialState;
3872
- }, [a.layout, a.initialState]), Ge(() => {
3874
+ s.layout === "inline" ? u.value = "expanded" : u.value = s.initialState;
3875
+ }, [s.layout, s.initialState]), Ge(() => {
3873
3876
  o.fetchWidgetConfig();
3874
3877
  }, [n, t["api-base-url"], t["session-token"]]);
3875
- const c = t["avatar-url"] || o.avatarThumbnailUrl.value || null, m = t["avatar-video-url"] || o.avatarVideoUrl.value || null, _ = t["agent-name"] || o.personaName.value, d = a.callToAction === qt.callToAction && _ ? `Talk to ${_}` : a.callToAction, S = Ce(() => {
3876
- if (a.layout === "inline") return "";
3877
- const I = yn(a.position);
3878
+ const c = t["avatar-url"] || o.avatarThumbnailUrl.value || null, E = t["avatar-video-url"] || o.avatarVideoUrl.value || null, _ = t["agent-name"] || o.personaName.value, d = s.callToAction === qt.callToAction && _ ? `Talk to ${_}` : s.callToAction, S = Ce(() => {
3879
+ if (s.layout === "inline") return "";
3880
+ const I = yn(s.position);
3878
3881
  return Object.entries(I).map(([b, R]) => `${b}: ${R}`).join("; ");
3879
- }, [a.layout, a.position]), g = a.layout === "floating", y = () => {
3882
+ }, [s.layout, s.position]), g = s.layout === "floating", y = () => {
3880
3883
  u.value = "expanded";
3881
3884
  }, C = async () => {
3882
3885
  o.connectionStatus.value !== "idle" && await o.stopSession(), u.value = "minimized";
@@ -3885,7 +3888,7 @@ function yr(t) {
3885
3888
  "div",
3886
3889
  {
3887
3890
  class: "anam-widget",
3888
- "data-layout": a.layout,
3891
+ "data-layout": s.layout,
3889
3892
  "data-state": u.value,
3890
3893
  style: S,
3891
3894
  children: [
@@ -3901,11 +3904,11 @@ function yr(t) {
3901
3904
  A && /* @__PURE__ */ w(
3902
3905
  gr,
3903
3906
  {
3904
- config: a,
3907
+ config: s,
3905
3908
  session: o,
3906
3909
  videoRef: e,
3907
3910
  avatarSrc: c,
3908
- avatarVideoSrc: m,
3911
+ avatarVideoSrc: E,
3909
3912
  displayCta: d,
3910
3913
  onCollapse: g ? C : null,
3911
3914
  onStop: g ? null : () => o.stopSession()