@anam-ai/agent-widget 0.1.1 → 0.2.0-alpha.3
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 +428 -425
- package/dist/index.umd.js +1 -1
- package/package.json +8 -1
package/dist/index.js
CHANGED
|
@@ -7,14 +7,14 @@ function mt(t) {
|
|
|
7
7
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
8
8
|
}
|
|
9
9
|
function Se(t, e, n) {
|
|
10
|
-
var o, l,
|
|
11
|
-
for (
|
|
12
|
-
if (arguments.length > 2 && (u.children = arguments.length > 3 ? Ue.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (
|
|
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
|
|
17
|
-
return l == null && k.vnode != null && k.vnode(
|
|
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,
|
|
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,
|
|
47
|
+
function ai(t, e, n, o, l, s, u, c, m, 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,
|
|
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, s, 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
50
|
return n.__e = C, m;
|
|
51
51
|
}
|
|
52
52
|
function Ji(t, e, n, o, l) {
|
|
53
|
-
var
|
|
54
|
-
for (t.__k = new Array(l),
|
|
55
|
-
if (d) for (
|
|
53
|
+
var s, u, c, m, 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, m = s + 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[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,
|
|
59
|
+
var l, s;
|
|
60
60
|
if (typeof t.type == "function") {
|
|
61
|
-
for (l = t.__k,
|
|
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,
|
|
71
|
+
var l, s, u, c = t.key, m = t.type, p = e[n], _ = p != null && (2 & p.__u) == 0;
|
|
72
72
|
if (p === null && c == null || _ && c == p.key && m == p.type) return n;
|
|
73
73
|
if (o > (_ ? 1 : 0)) {
|
|
74
|
-
for (l = n - 1,
|
|
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 && m == 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
|
|
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")
|
|
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 = Et, 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 {
|
|
@@ -106,10 +106,10 @@ function Lt(t) {
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function gt(t, e, n, o, l,
|
|
109
|
+
function gt(t, e, n, o, l, s, u, c, m, 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),
|
|
112
|
+
128 & n.__u && (m = !!(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,
|
|
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, m, 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 ||
|
|
135
|
+
if (e.__v = null, m || s != null) if (oe.then) {
|
|
136
136
|
for (e.__u |= m ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
|
|
137
|
-
|
|
137
|
+
s[s.indexOf(c)] = null, e.__e = c;
|
|
138
138
|
} else {
|
|
139
|
-
for (ne =
|
|
139
|
+
for (ne = s.length; ne--; ) mt(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
|
|
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, m, 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(
|
|
156
|
-
|
|
155
|
+
t = l.__h, l.__h = [], t.some(function(s) {
|
|
156
|
+
s.call(l);
|
|
157
157
|
});
|
|
158
|
-
} catch (
|
|
159
|
-
k.__e(
|
|
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,
|
|
166
|
+
function Zi(t, e, n, o, l, s, u, c, m) {
|
|
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"),
|
|
169
|
-
for (p = 0; p <
|
|
170
|
-
t = g,
|
|
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,
|
|
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 (
|
|
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,
|
|
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, m), s != null) for (p = s.length; p--; ) mt(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,8 +207,8 @@ 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 (
|
|
211
|
-
k.__e(
|
|
210
|
+
} catch (s) {
|
|
211
|
+
k.__e(s, e);
|
|
212
212
|
}
|
|
213
213
|
o.base = o.__P = null;
|
|
214
214
|
}
|
|
@@ -219,20 +219,20 @@ 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,
|
|
223
|
-
e == document && (e = document.documentElement), k.__ && k.__(t, e), l = (o = typeof n == "function") ? null : n && n.__k || e.__k,
|
|
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,
|
|
230
|
-
for (
|
|
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,
|
|
235
|
-
if ((
|
|
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
|
}
|
|
@@ -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 = {},
|
|
262
|
-
for (o = 0; o <
|
|
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
|
|
269
|
-
return u._vdomComponent = t, o && o.shadow ? (u._root = u.attachShadow({ mode: o.mode || "open", serializable: (
|
|
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(
|
|
274
|
-
Object.defineProperty(l.prototype,
|
|
275
|
-
return this._vdom ? this._vdom.props[
|
|
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(
|
|
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(
|
|
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
|
}
|
|
@@ -307,30 +307,30 @@ 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(
|
|
311
|
-
|
|
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
|
-
},
|
|
313
|
+
}, s.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
|
|
314
314
|
} }));
|
|
315
315
|
}
|
|
316
316
|
function Ei(t, e, n) {
|
|
317
317
|
if (t.nodeType === 3) return t.data;
|
|
318
318
|
if (t.nodeType !== 1) return null;
|
|
319
|
-
var o = [], l = {},
|
|
320
|
-
for (
|
|
321
|
-
for (
|
|
322
|
-
var m = Ei(c[
|
|
323
|
-
p ? l[p] = Se(Bt, { name: p }, m) : o[
|
|
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 m = Ei(c[s], null, n), p = c[s].slot;
|
|
323
|
+
p ? l[p] = Se(Bt, { name: p }, m) : o[s] = m;
|
|
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,
|
|
329
|
+
function w(t, e, n, o, l, s) {
|
|
330
330
|
e || (e = {});
|
|
331
331
|
var u, c, m = e;
|
|
332
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:
|
|
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: s };
|
|
334
334
|
if (typeof t == "function" && (u = t.defaultProps)) for (c in u) m[c] === void 0 && (m[c] = u[c]);
|
|
335
335
|
return k.vnode && k.vnode(p), p;
|
|
336
336
|
}
|
|
@@ -356,21 +356,21 @@ function cn(t, e, n) {
|
|
|
356
356
|
});
|
|
357
357
|
if (_.every(function(S) {
|
|
358
358
|
return !S.__N;
|
|
359
|
-
})) return !
|
|
359
|
+
})) return !s || s.call(this, c, m, 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
|
-
}),
|
|
366
|
+
}), s && s.call(this, c, m, p) || d;
|
|
367
367
|
};
|
|
368
368
|
P.__f = !0;
|
|
369
|
-
var
|
|
369
|
+
var s = P.shouldComponentUpdate, u = P.componentWillUpdate;
|
|
370
370
|
P.componentWillUpdate = function(c, m, p) {
|
|
371
371
|
if (this.__e) {
|
|
372
|
-
var _ =
|
|
373
|
-
|
|
372
|
+
var _ = s;
|
|
373
|
+
s = void 0, l(c, m, p), s = _;
|
|
374
374
|
}
|
|
375
375
|
u && u.call(this, c, m, p);
|
|
376
376
|
}, P.shouldComponentUpdate = l;
|
|
@@ -745,8 +745,8 @@ function Ri(t) {
|
|
|
745
745
|
return e.__$u.d = function() {
|
|
746
746
|
d(), S.call(this);
|
|
747
747
|
}, [_, p];
|
|
748
|
-
}, []),
|
|
749
|
-
return
|
|
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
|
|
760
|
-
|
|
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,
|
|
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:
|
|
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
|
|
791
|
-
if (
|
|
792
|
-
var c =
|
|
793
|
-
c !== void 0 && !(u in o) && (c.d(),
|
|
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
|
-
|
|
796
|
+
s = {}, n.U = s;
|
|
797
797
|
for (var m in o) {
|
|
798
|
-
var p =
|
|
799
|
-
p === void 0 ? (p = En(n, m, _, l),
|
|
798
|
+
var p = s[m], _ = o[m];
|
|
799
|
+
p === void 0 ? (p = En(n, m, _, l), s[m] = p) : p.o(_, l);
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
t(e);
|
|
804
804
|
});
|
|
805
805
|
function En(t, e, n, o) {
|
|
806
|
-
var l = e in t && t.ownerSVGElement === void 0,
|
|
806
|
+
var l = e in t && t.ownerSVGElement === void 0, s = z(n);
|
|
807
807
|
return { o: function(u, c) {
|
|
808
|
-
|
|
808
|
+
s.value = u, o = c;
|
|
809
809
|
}, d: Le(function() {
|
|
810
810
|
this.N = xi;
|
|
811
|
-
var u =
|
|
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
|
|
824
|
-
|
|
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
|
|
846
|
-
if (!(o ||
|
|
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;
|
|
@@ -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(),
|
|
903
|
-
if (
|
|
904
|
-
const u = l.slice(0,
|
|
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(
|
|
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,
|
|
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) {
|
|
@@ -960,21 +960,21 @@ 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
|
|
964
|
-
for (d += S,
|
|
963
|
+
var s, 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, s = g & (1 << -_) - 1, g >>= -_, _ += c; _ > 0; s = s * 256 + t[e + d], d += S, _ -= 8)
|
|
965
965
|
;
|
|
966
|
-
for (u =
|
|
966
|
+
for (u = s & (1 << -_) - 1, s >>= -_, _ += o; _ > 0; u = u * 256 + t[e + d], d += S, _ -= 8)
|
|
967
967
|
;
|
|
968
|
-
if (
|
|
969
|
-
|
|
968
|
+
if (s === 0)
|
|
969
|
+
s = 1 - p;
|
|
970
970
|
else {
|
|
971
|
-
if (
|
|
971
|
+
if (s === m)
|
|
972
972
|
return u ? NaN : (g ? -1 : 1) * (1 / 0);
|
|
973
|
-
u = u + Math.pow(2, o),
|
|
973
|
+
u = u + Math.pow(2, o), s = s - p;
|
|
974
974
|
}
|
|
975
|
-
return (g ? -1 : 1) * u * Math.pow(2,
|
|
976
|
-
}, $e.write = function(t, e, n, o, l,
|
|
977
|
-
var u, c, m, p =
|
|
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, m, 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
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)
|
|
979
979
|
;
|
|
980
980
|
for (u = u << l | c, p += l; p > 0; t[n + g] = u & 255, g += y, u /= 256, p -= 8)
|
|
@@ -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 =
|
|
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
|
|
994
|
+
function s() {
|
|
995
995
|
try {
|
|
996
|
-
const
|
|
996
|
+
const a = new Uint8Array(1), i = { foo: function() {
|
|
997
997
|
return 42;
|
|
998
998
|
} };
|
|
999
|
-
return Object.setPrototypeOf(i, Uint8Array.prototype), Object.setPrototypeOf(
|
|
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(
|
|
1018
|
-
if (
|
|
1019
|
-
throw new RangeError('The value "' +
|
|
1020
|
-
const i = new Uint8Array(
|
|
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(
|
|
1024
|
-
if (typeof
|
|
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(
|
|
1029
|
+
return d(a);
|
|
1030
1030
|
}
|
|
1031
|
-
return m(
|
|
1031
|
+
return m(a, i, r);
|
|
1032
1032
|
}
|
|
1033
1033
|
c.poolSize = 8192;
|
|
1034
|
-
function m(
|
|
1035
|
-
if (typeof
|
|
1036
|
-
return S(
|
|
1037
|
-
if (ArrayBuffer.isView(
|
|
1038
|
-
return y(
|
|
1039
|
-
if (
|
|
1034
|
+
function m(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
|
|
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(
|
|
1044
|
-
return C(
|
|
1045
|
-
if (typeof
|
|
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 =
|
|
1050
|
-
if (h != null && h !==
|
|
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(
|
|
1052
|
+
const f = A(a);
|
|
1053
1053
|
if (f) return f;
|
|
1054
|
-
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof
|
|
1055
|
-
return c.from(
|
|
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
|
|
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(
|
|
1061
|
-
return m(
|
|
1060
|
+
c.from = function(a, i, r) {
|
|
1061
|
+
return m(a, i, r);
|
|
1062
1062
|
}, Object.setPrototypeOf(c.prototype, Uint8Array.prototype), Object.setPrototypeOf(c, Uint8Array);
|
|
1063
|
-
function p(
|
|
1064
|
-
if (typeof
|
|
1063
|
+
function p(a) {
|
|
1064
|
+
if (typeof a != "number")
|
|
1065
1065
|
throw new TypeError('"size" argument must be of type number');
|
|
1066
|
-
if (
|
|
1067
|
-
throw new RangeError('The value "' +
|
|
1066
|
+
if (a < 0)
|
|
1067
|
+
throw new RangeError('The value "' + a + '" is invalid for option "size"');
|
|
1068
1068
|
}
|
|
1069
|
-
function _(
|
|
1070
|
-
return p(
|
|
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(
|
|
1073
|
-
return _(
|
|
1072
|
+
c.alloc = function(a, i, r) {
|
|
1073
|
+
return _(a, i, r);
|
|
1074
1074
|
};
|
|
1075
|
-
function d(
|
|
1076
|
-
return p(
|
|
1075
|
+
function d(a) {
|
|
1076
|
+
return p(a), u(a < 0 ? 0 : I(a) | 0);
|
|
1077
1077
|
}
|
|
1078
|
-
c.allocUnsafe = function(
|
|
1079
|
-
return d(
|
|
1080
|
-
}, c.allocUnsafeSlow = function(
|
|
1081
|
-
return d(
|
|
1078
|
+
c.allocUnsafe = function(a) {
|
|
1079
|
+
return d(a);
|
|
1080
|
+
}, c.allocUnsafeSlow = function(a) {
|
|
1081
|
+
return d(a);
|
|
1082
1082
|
};
|
|
1083
|
-
function S(
|
|
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(
|
|
1086
|
+
const r = R(a, i) | 0;
|
|
1087
1087
|
let h = u(r);
|
|
1088
|
-
const f = h.write(
|
|
1088
|
+
const f = h.write(a, i);
|
|
1089
1089
|
return f !== r && (h = h.slice(0, f)), h;
|
|
1090
1090
|
}
|
|
1091
|
-
function g(
|
|
1092
|
-
const 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] =
|
|
1094
|
+
r[h] = a[h] & 255;
|
|
1095
1095
|
return r;
|
|
1096
1096
|
}
|
|
1097
|
-
function y(
|
|
1098
|
-
if (Q(
|
|
1099
|
-
const i = new Uint8Array(
|
|
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(
|
|
1102
|
+
return g(a);
|
|
1103
1103
|
}
|
|
1104
|
-
function C(
|
|
1105
|
-
if (i < 0 ||
|
|
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 (
|
|
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(
|
|
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(
|
|
1113
|
-
if (c.isBuffer(
|
|
1114
|
-
const i = I(
|
|
1115
|
-
return r.length === 0 ||
|
|
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 (
|
|
1118
|
-
return typeof
|
|
1119
|
-
if (
|
|
1120
|
-
return g(
|
|
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(
|
|
1123
|
-
if (
|
|
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
|
|
1125
|
+
return a | 0;
|
|
1126
1126
|
}
|
|
1127
|
-
function b(
|
|
1128
|
-
return +
|
|
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;
|
|
@@ -1186,16 +1186,16 @@ function Cn() {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
return f;
|
|
1188
1188
|
};
|
|
1189
|
-
function R(
|
|
1190
|
-
if (c.isBuffer(
|
|
1191
|
-
return
|
|
1192
|
-
if (ArrayBuffer.isView(
|
|
1193
|
-
return
|
|
1194
|
-
if (typeof
|
|
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
|
|
1196
|
+
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof a
|
|
1197
1197
|
);
|
|
1198
|
-
const r =
|
|
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(
|
|
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(
|
|
1218
|
+
return kt(a).length;
|
|
1219
1219
|
default:
|
|
1220
1220
|
if (f)
|
|
1221
|
-
return h ? -1 : et(
|
|
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(
|
|
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 (
|
|
1231
|
-
switch (
|
|
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: " +
|
|
1251
|
-
|
|
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(
|
|
1256
|
-
const h =
|
|
1257
|
-
|
|
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;
|
|
@@ -1310,24 +1310,24 @@ function Cn() {
|
|
|
1310
1310
|
}
|
|
1311
1311
|
return v < T ? -1 : T < v ? 1 : 0;
|
|
1312
1312
|
};
|
|
1313
|
-
function Y(
|
|
1314
|
-
if (
|
|
1315
|
-
if (typeof r == "string" ? (h = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, tt(r) && (r = f ? 0 :
|
|
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 =
|
|
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(
|
|
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(
|
|
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(
|
|
1328
|
-
let E = 1, v =
|
|
1327
|
+
function te(a, i, r, h, f) {
|
|
1328
|
+
let E = 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 (
|
|
1330
|
+
if (a.length < 2 || i.length < 2)
|
|
1331
1331
|
return -1;
|
|
1332
1332
|
E = 2, v /= 2, T /= 2, r /= 2;
|
|
1333
1333
|
}
|
|
@@ -1338,7 +1338,7 @@ function Cn() {
|
|
|
1338
1338
|
if (f) {
|
|
1339
1339
|
let B = -1;
|
|
1340
1340
|
for (U = r; U < v; U++)
|
|
1341
|
-
if (L(
|
|
1341
|
+
if (L(a, U) === L(i, B === -1 ? 0 : U - B)) {
|
|
1342
1342
|
if (B === -1 && (B = U), U - B + 1 === T) return B * E;
|
|
1343
1343
|
} else
|
|
1344
1344
|
B !== -1 && (U -= U - B), B = -1;
|
|
@@ -1346,7 +1346,7 @@ function Cn() {
|
|
|
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(
|
|
1349
|
+
if (L(a, U + D) !== L(i, D)) {
|
|
1350
1350
|
B = !1;
|
|
1351
1351
|
break;
|
|
1352
1352
|
}
|
|
@@ -1361,9 +1361,9 @@ function Cn() {
|
|
|
1361
1361
|
}, c.prototype.lastIndexOf = function(i, r, h) {
|
|
1362
1362
|
return Y(this, i, r, h, !1);
|
|
1363
1363
|
};
|
|
1364
|
-
function $(
|
|
1364
|
+
function $(a, i, r, h) {
|
|
1365
1365
|
r = Number(r) || 0;
|
|
1366
|
-
const f =
|
|
1366
|
+
const f = a.length - r;
|
|
1367
1367
|
h ? (h = Number(h), h > f && (h = f)) : h = f;
|
|
1368
1368
|
const E = i.length;
|
|
1369
1369
|
h > E / 2 && (h = E / 2);
|
|
@@ -1371,21 +1371,21 @@ function Cn() {
|
|
|
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
|
-
|
|
1374
|
+
a[r + v] = T;
|
|
1375
1375
|
}
|
|
1376
1376
|
return v;
|
|
1377
1377
|
}
|
|
1378
|
-
function ie(
|
|
1379
|
-
return Be(et(i,
|
|
1378
|
+
function ie(a, i, r, h) {
|
|
1379
|
+
return Be(et(i, a.length - r), a, r, h);
|
|
1380
1380
|
}
|
|
1381
|
-
function ne(
|
|
1382
|
-
return Be(Wi(i),
|
|
1381
|
+
function ne(a, i, r, h) {
|
|
1382
|
+
return Be(Wi(i), a, r, h);
|
|
1383
1383
|
}
|
|
1384
|
-
function Z(
|
|
1385
|
-
return Be(kt(i),
|
|
1384
|
+
function Z(a, i, r, h) {
|
|
1385
|
+
return Be(kt(i), a, r, h);
|
|
1386
1386
|
}
|
|
1387
|
-
function oe(
|
|
1388
|
-
return Be(zi(i,
|
|
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)
|
|
@@ -1431,15 +1431,15 @@ function Cn() {
|
|
|
1431
1431
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
1432
1432
|
};
|
|
1433
1433
|
};
|
|
1434
|
-
function Li(
|
|
1435
|
-
return i === 0 && 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(
|
|
1438
|
-
r = Math.min(
|
|
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 =
|
|
1442
|
+
const E = a[f];
|
|
1443
1443
|
let v = null, T = E > 239 ? 4 : E > 223 ? 3 : E > 191 ? 2 : 1;
|
|
1444
1444
|
if (f + T <= r) {
|
|
1445
1445
|
let L, U, B, D;
|
|
@@ -1448,13 +1448,13 @@ function Cn() {
|
|
|
1448
1448
|
E < 128 && (v = E);
|
|
1449
1449
|
break;
|
|
1450
1450
|
case 2:
|
|
1451
|
-
L =
|
|
1451
|
+
L = a[f + 1], (L & 192) === 128 && (D = (E & 31) << 6 | L & 63, D > 127 && (v = D));
|
|
1452
1452
|
break;
|
|
1453
1453
|
case 3:
|
|
1454
|
-
L =
|
|
1454
|
+
L = a[f + 1], U = a[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));
|
|
1455
1455
|
break;
|
|
1456
1456
|
case 4:
|
|
1457
|
-
L =
|
|
1457
|
+
L = a[f + 1], U = a[f + 2], B = a[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));
|
|
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,42 +1462,42 @@ function Cn() {
|
|
|
1462
1462
|
return Bi(h);
|
|
1463
1463
|
}
|
|
1464
1464
|
const It = 4096;
|
|
1465
|
-
function Bi(
|
|
1466
|
-
const i =
|
|
1465
|
+
function Bi(a) {
|
|
1466
|
+
const i = a.length;
|
|
1467
1467
|
if (i <= It)
|
|
1468
|
-
return String.fromCharCode.apply(String,
|
|
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
|
-
|
|
1473
|
+
a.slice(h, h += It)
|
|
1474
1474
|
);
|
|
1475
1475
|
return r;
|
|
1476
1476
|
}
|
|
1477
|
-
function Pi(
|
|
1477
|
+
function Pi(a, i, r) {
|
|
1478
1478
|
let h = "";
|
|
1479
|
-
r = Math.min(
|
|
1479
|
+
r = Math.min(a.length, r);
|
|
1480
1480
|
for (let f = i; f < r; ++f)
|
|
1481
|
-
h += String.fromCharCode(
|
|
1481
|
+
h += String.fromCharCode(a[f] & 127);
|
|
1482
1482
|
return h;
|
|
1483
1483
|
}
|
|
1484
|
-
function Fi(
|
|
1484
|
+
function Fi(a, i, r) {
|
|
1485
1485
|
let h = "";
|
|
1486
|
-
r = Math.min(
|
|
1486
|
+
r = Math.min(a.length, r);
|
|
1487
1487
|
for (let f = i; f < r; ++f)
|
|
1488
|
-
h += String.fromCharCode(
|
|
1488
|
+
h += String.fromCharCode(a[f]);
|
|
1489
1489
|
return h;
|
|
1490
1490
|
}
|
|
1491
|
-
function $i(
|
|
1492
|
-
const h =
|
|
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
1495
|
for (let E = i; E < r; ++E)
|
|
1496
|
-
f += qi[
|
|
1496
|
+
f += qi[a[E]];
|
|
1497
1497
|
return f;
|
|
1498
1498
|
}
|
|
1499
|
-
function Vi(
|
|
1500
|
-
const h =
|
|
1499
|
+
function Vi(a, i, r) {
|
|
1500
|
+
const h = a.slice(i, r);
|
|
1501
1501
|
let f = "";
|
|
1502
1502
|
for (let E = 0; E < h.length - 1; E += 2)
|
|
1503
1503
|
f += String.fromCharCode(h[E] + h[E + 1] * 256);
|
|
@@ -1509,9 +1509,9 @@ function Cn() {
|
|
|
1509
1509
|
const f = this.subarray(i, r);
|
|
1510
1510
|
return Object.setPrototypeOf(f, c.prototype), f;
|
|
1511
1511
|
};
|
|
1512
|
-
function G(
|
|
1513
|
-
if (
|
|
1514
|
-
if (
|
|
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);
|
|
@@ -1595,10 +1595,10 @@ 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(
|
|
1599
|
-
if (!c.isBuffer(
|
|
1598
|
+
function K(a, i, r, h, f, E) {
|
|
1599
|
+
if (!c.isBuffer(a)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1600
1600
|
if (i > f || i < E) throw new RangeError('"value" argument is out of bounds');
|
|
1601
|
-
if (r + h >
|
|
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) {
|
|
@@ -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(
|
|
1633
|
-
Ot(i, h, f,
|
|
1632
|
+
function bt(a, i, r, h, f) {
|
|
1633
|
+
Ot(i, h, f, a, r, 7);
|
|
1634
1634
|
let E = Number(i & BigInt(4294967295));
|
|
1635
|
-
|
|
1635
|
+
a[r++] = E, E = E >> 8, a[r++] = E, E = E >> 8, a[r++] = E, E = E >> 8, a[r++] = E;
|
|
1636
1636
|
let v = Number(i >> BigInt(32) & BigInt(4294967295));
|
|
1637
|
-
return
|
|
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(
|
|
1640
|
-
Ot(i, h, f,
|
|
1639
|
+
function At(a, i, r, h, f) {
|
|
1640
|
+
Ot(i, h, f, a, r, 7);
|
|
1641
1641
|
let E = Number(i & BigInt(4294967295));
|
|
1642
|
-
|
|
1642
|
+
a[r + 7] = E, E = E >> 8, a[r + 6] = E, E = E >> 8, a[r + 5] = E, E = E >> 8, a[r + 4] = E;
|
|
1643
1643
|
let v = Number(i >> BigInt(32) & BigInt(4294967295));
|
|
1644
|
-
return
|
|
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"));
|
|
@@ -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(
|
|
1684
|
-
if (r + h >
|
|
1683
|
+
function Tt(a, i, r, h, f, E) {
|
|
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(
|
|
1688
|
-
return i = +i, r = r >>> 0, f || Tt(
|
|
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(
|
|
1696
|
-
return i = +i, r = r >>> 0, f || Tt(
|
|
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);
|
|
@@ -1743,17 +1743,17 @@ function Cn() {
|
|
|
1743
1743
|
return this;
|
|
1744
1744
|
};
|
|
1745
1745
|
const me = {};
|
|
1746
|
-
function Qe(
|
|
1747
|
-
me[
|
|
1746
|
+
function Qe(a, i, r) {
|
|
1747
|
+
me[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} [${
|
|
1753
|
+
}), this.name = `${this.name} [${a}]`, this.stack, delete this.name;
|
|
1754
1754
|
}
|
|
1755
1755
|
get code() {
|
|
1756
|
-
return
|
|
1756
|
+
return a;
|
|
1757
1757
|
}
|
|
1758
1758
|
set code(f) {
|
|
1759
1759
|
Object.defineProperty(this, "code", {
|
|
@@ -1764,74 +1764,74 @@ function Cn() {
|
|
|
1764
1764
|
});
|
|
1765
1765
|
}
|
|
1766
1766
|
toString() {
|
|
1767
|
-
return `${this.name} [${
|
|
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(
|
|
1774
|
-
return
|
|
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(
|
|
1780
|
-
return `The "${
|
|
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(
|
|
1786
|
-
let h = `The value of "${
|
|
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(
|
|
1792
|
-
let i = "", r =
|
|
1793
|
-
const h =
|
|
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 = `_${
|
|
1796
|
-
return `${
|
|
1795
|
+
i = `_${a.slice(r - 3, r)}${i}`;
|
|
1796
|
+
return `${a.slice(0, r)}${i}`;
|
|
1797
1797
|
}
|
|
1798
|
-
function Gi(
|
|
1799
|
-
ge(i, "offset"), (
|
|
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(
|
|
1802
|
-
if (
|
|
1801
|
+
function Ot(a, i, r, h, f, E) {
|
|
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,
|
|
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, a);
|
|
1806
1806
|
}
|
|
1807
1807
|
Gi(h, f, E);
|
|
1808
1808
|
}
|
|
1809
|
-
function ge(
|
|
1810
|
-
if (typeof
|
|
1811
|
-
throw new me.ERR_INVALID_ARG_TYPE(i, "number",
|
|
1809
|
+
function ge(a, i) {
|
|
1810
|
+
if (typeof a != "number")
|
|
1811
|
+
throw new me.ERR_INVALID_ARG_TYPE(i, "number", a);
|
|
1812
1812
|
}
|
|
1813
|
-
function Te(
|
|
1814
|
-
throw Math.floor(
|
|
1813
|
+
function Te(a, i, r) {
|
|
1814
|
+
throw Math.floor(a) !== a ? (ge(a, r), new me.ERR_OUT_OF_RANGE("offset", "an integer", a)) : i < 0 ? new me.ERR_BUFFER_OUT_OF_BOUNDS() : new me.ERR_OUT_OF_RANGE(
|
|
1815
1815
|
"offset",
|
|
1816
1816
|
`>= 0 and <= ${i}`,
|
|
1817
|
-
|
|
1817
|
+
a
|
|
1818
1818
|
);
|
|
1819
1819
|
}
|
|
1820
1820
|
const ji = /[^+/0-9A-Za-z-_]/g;
|
|
1821
|
-
function Hi(
|
|
1822
|
-
if (
|
|
1823
|
-
for (;
|
|
1824
|
-
|
|
1825
|
-
return
|
|
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(
|
|
1827
|
+
function et(a, i) {
|
|
1828
1828
|
i = i || 1 / 0;
|
|
1829
1829
|
let r;
|
|
1830
|
-
const h =
|
|
1830
|
+
const h = a.length;
|
|
1831
1831
|
let f = null;
|
|
1832
1832
|
const E = [];
|
|
1833
1833
|
for (let v = 0; v < h; ++v) {
|
|
1834
|
-
if (r =
|
|
1834
|
+
if (r = a.charCodeAt(v), r > 55295 && r < 57344) {
|
|
1835
1835
|
if (!f) {
|
|
1836
1836
|
if (r > 56319) {
|
|
1837
1837
|
(i -= 3) > -1 && E.push(239, 191, 189);
|
|
@@ -1878,45 +1878,45 @@ function Cn() {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
return E;
|
|
1880
1880
|
}
|
|
1881
|
-
function Wi(
|
|
1881
|
+
function Wi(a) {
|
|
1882
1882
|
const i = [];
|
|
1883
|
-
for (let r = 0; r <
|
|
1884
|
-
i.push(
|
|
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(
|
|
1887
|
+
function zi(a, i) {
|
|
1888
1888
|
let r, h, f;
|
|
1889
1889
|
const E = [];
|
|
1890
|
-
for (let v = 0; v <
|
|
1891
|
-
r =
|
|
1890
|
+
for (let v = 0; v < a.length && !((i -= 2) < 0); ++v)
|
|
1891
|
+
r = a.charCodeAt(v), h = r >> 8, f = r % 256, E.push(f), E.push(h);
|
|
1892
1892
|
return E;
|
|
1893
1893
|
}
|
|
1894
|
-
function kt(
|
|
1895
|
-
return e.toByteArray(Hi(
|
|
1894
|
+
function kt(a) {
|
|
1895
|
+
return e.toByteArray(Hi(a));
|
|
1896
1896
|
}
|
|
1897
|
-
function Be(
|
|
1897
|
+
function Be(a, i, r, h) {
|
|
1898
1898
|
let f;
|
|
1899
|
-
for (f = 0; f < h && !(f + r >= i.length || f >=
|
|
1900
|
-
i[f + r] =
|
|
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(
|
|
1904
|
-
return
|
|
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(
|
|
1907
|
-
return
|
|
1906
|
+
function tt(a) {
|
|
1907
|
+
return a !== a;
|
|
1908
1908
|
}
|
|
1909
1909
|
const qi = (function() {
|
|
1910
|
-
const
|
|
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] =
|
|
1914
|
+
i[h + f] = a[r] + a[f];
|
|
1915
1915
|
}
|
|
1916
1916
|
return i;
|
|
1917
1917
|
})();
|
|
1918
|
-
function se(
|
|
1919
|
-
return typeof BigInt > "u" ? Yi :
|
|
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(
|
|
1933
|
-
return
|
|
1934
|
-
u(
|
|
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(
|
|
1937
|
+
return new (n || (n = Promise))(function(s, u) {
|
|
1938
1938
|
function c(_) {
|
|
1939
1939
|
try {
|
|
1940
1940
|
p(o.next(_));
|
|
@@ -1950,7 +1950,7 @@ var Tn = function(t, e, n, o) {
|
|
|
1950
1950
|
}
|
|
1951
1951
|
}
|
|
1952
1952
|
function p(_) {
|
|
1953
|
-
_.done ?
|
|
1953
|
+
_.done ? s(_.value) : l(_.value).then(c, m);
|
|
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
|
|
1984
|
+
let s, u = {
|
|
1985
1985
|
"Content-Type": "application/json"
|
|
1986
1986
|
};
|
|
1987
|
-
le?.enabled && le?.baseUrl ? (
|
|
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
|
|
2001
|
+
const s = {};
|
|
2002
2002
|
t.forEach((d) => {
|
|
2003
|
-
|
|
2003
|
+
s[d.type] || (s[d.type] = []), s[d.type].push(d);
|
|
2004
2004
|
});
|
|
2005
2005
|
const u = {
|
|
2006
2006
|
issues: []
|
|
2007
|
-
}, c = ((n =
|
|
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,7 +2018,7 @@ const ve = (t) => {
|
|
|
2018
2018
|
};
|
|
2019
2019
|
u.personaVideoStream.push(I);
|
|
2020
2020
|
}));
|
|
2021
|
-
const m = ((o =
|
|
2021
|
+
const m = ((o = s["inbound-rtp"]) === null || o === void 0 ? void 0 : o.filter((d) => d.kind === "audio")) || [];
|
|
2022
2022
|
m.length > 0 && (u.personaAudioStream = [], m.forEach((d) => {
|
|
2023
2023
|
var S, g, y;
|
|
2024
2024
|
const C = {
|
|
@@ -2030,7 +2030,7 @@ const ve = (t) => {
|
|
|
2030
2030
|
};
|
|
2031
2031
|
u.personaAudioStream.push(C);
|
|
2032
2032
|
}));
|
|
2033
|
-
const p = ((l =
|
|
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
|
-
})),
|
|
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
|
-
})),
|
|
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",
|
|
@@ -2177,12 +2177,12 @@ class Dn {
|
|
|
2177
2177
|
}
|
|
2178
2178
|
}
|
|
2179
2179
|
var ye = function(t, e, n, o) {
|
|
2180
|
-
function l(
|
|
2181
|
-
return
|
|
2182
|
-
u(
|
|
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(
|
|
2185
|
+
return new (n || (n = Promise))(function(s, u) {
|
|
2186
2186
|
function c(_) {
|
|
2187
2187
|
try {
|
|
2188
2188
|
p(o.next(_));
|
|
@@ -2198,16 +2198,16 @@ var ye = function(t, e, n, o) {
|
|
|
2198
2198
|
}
|
|
2199
2199
|
}
|
|
2200
2200
|
function p(_) {
|
|
2201
|
-
_.done ?
|
|
2201
|
+
_.done ? s(_.value) : l(_.value).then(c, m);
|
|
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,
|
|
2208
|
+
constructor(e, n, o, l, s) {
|
|
2209
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 =
|
|
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;
|
|
@@ -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(
|
|
2350
|
-
return
|
|
2351
|
-
u(
|
|
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(
|
|
2354
|
+
return new (n || (n = Promise))(function(s, u) {
|
|
2355
2355
|
function c(_) {
|
|
2356
2356
|
try {
|
|
2357
2357
|
p(o.next(_));
|
|
@@ -2367,7 +2367,7 @@ var Zt = function(t, e, n, o) {
|
|
|
2367
2367
|
}
|
|
2368
2368
|
}
|
|
2369
2369
|
function p(_) {
|
|
2370
|
-
_.done ?
|
|
2370
|
+
_.done ? s(_.value) : l(_.value).then(c, m);
|
|
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
|
|
2388
|
-
return { url:
|
|
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,12 +2401,12 @@ 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:
|
|
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:
|
|
2409
|
+
headers: s,
|
|
2410
2410
|
body: JSON.stringify({
|
|
2411
2411
|
personaConfig: e,
|
|
2412
2412
|
sessionOptions: n,
|
|
@@ -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:
|
|
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:
|
|
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(
|
|
2470
|
-
return
|
|
2471
|
-
u(
|
|
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(
|
|
2474
|
+
return new (n || (n = Promise))(function(s, u) {
|
|
2475
2475
|
function c(_) {
|
|
2476
2476
|
try {
|
|
2477
2477
|
p(o.next(_));
|
|
@@ -2487,7 +2487,7 @@ var Fn = function(t, e, n, o) {
|
|
|
2487
2487
|
}
|
|
2488
2488
|
}
|
|
2489
2489
|
function p(_) {
|
|
2490
|
-
_.done ?
|
|
2490
|
+
_.done ? s(_.value) : l(_.value).then(c, m);
|
|
2491
2491
|
}
|
|
2492
2492
|
p((o = o.apply(t, e || [])).next());
|
|
2493
2493
|
});
|
|
@@ -2500,19 +2500,19 @@ class $n {
|
|
|
2500
2500
|
return Fn(this, void 0, void 0, function* () {
|
|
2501
2501
|
var n, o;
|
|
2502
2502
|
try {
|
|
2503
|
-
let l,
|
|
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
|
-
|
|
2510
|
+
s["X-Anam-Target-Url"] = p.href;
|
|
2511
2511
|
} else
|
|
2512
2512
|
l = `${this.baseUrl}${u}${c}`;
|
|
2513
2513
|
const m = yield fetch(l, {
|
|
2514
2514
|
method: "POST",
|
|
2515
|
-
headers:
|
|
2515
|
+
headers: s,
|
|
2516
2516
|
body: JSON.stringify({
|
|
2517
2517
|
content: e
|
|
2518
2518
|
})
|
|
@@ -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(
|
|
2618
|
-
return
|
|
2619
|
-
u(
|
|
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(
|
|
2622
|
+
return new (n || (n = Promise))(function(s, u) {
|
|
2623
2623
|
function c(_) {
|
|
2624
2624
|
try {
|
|
2625
2625
|
p(o.next(_));
|
|
@@ -2635,7 +2635,7 @@ var st = function(t, e, n, o) {
|
|
|
2635
2635
|
}
|
|
2636
2636
|
}
|
|
2637
2637
|
function p(_) {
|
|
2638
|
-
_.done ?
|
|
2638
|
+
_.done ? s(_.value) : l(_.value).then(c, m);
|
|
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(
|
|
2699
|
-
return
|
|
2700
|
-
u(
|
|
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(
|
|
2703
|
+
return new (n || (n = Promise))(function(s, u) {
|
|
2704
2704
|
function c(_) {
|
|
2705
2705
|
try {
|
|
2706
2706
|
p(o.next(_));
|
|
@@ -2716,7 +2716,7 @@ var J = function(t, e, n, o) {
|
|
|
2716
2716
|
}
|
|
2717
2717
|
}
|
|
2718
2718
|
function p(_) {
|
|
2719
|
-
_.done ?
|
|
2719
|
+
_.done ? s(_.value) : l(_.value).then(c, m);
|
|
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
|
|
2727
|
+
var s, u, c, m;
|
|
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 = (
|
|
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 = (m = (c = n.metrics) === null || c === void 0 ? void 0 : c.peerConnectionStatsReportOutputFormat) !== null && m !== void 0 ? m : "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((
|
|
2787
|
-
|
|
2788
|
-
|
|
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
|
|
2912
|
-
this.publicEventEmitter.emit(N.CONNECTION_CLOSED, he.SERVER_CLOSED_CONNECTION,
|
|
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;
|
|
@@ -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
|
|
3012
|
-
this.publicEventEmitter.emit(N.CLIENT_TOOL_EVENT_RECEIVED,
|
|
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
|
|
3065
|
-
return ((
|
|
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((
|
|
3161
|
+
}, l = this.reasoning_messages.findIndex((s) => s.id === o.id);
|
|
3162
3162
|
if (l !== -1) {
|
|
3163
|
-
const
|
|
3164
|
-
|
|
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(
|
|
3172
|
-
return
|
|
3173
|
-
u(
|
|
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(
|
|
3176
|
+
return new (n || (n = Promise))(function(s, u) {
|
|
3177
3177
|
function c(_) {
|
|
3178
3178
|
try {
|
|
3179
3179
|
p(o.next(_));
|
|
@@ -3189,14 +3189,14 @@ var ae = function(t, e, n, o) {
|
|
|
3189
3189
|
}
|
|
3190
3190
|
}
|
|
3191
3191
|
function p(_) {
|
|
3192
|
-
_.done ?
|
|
3192
|
+
_.done ? s(_.value) : l(_.value).then(c, m);
|
|
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,
|
|
3199
|
+
var l, s, u, c, m;
|
|
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 || !((
|
|
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), !((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);
|
|
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,
|
|
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,7 +3228,7 @@ class Xn {
|
|
|
3228
3228
|
this.organizationId = c.accountId, ve({
|
|
3229
3229
|
organizationId: this.organizationId
|
|
3230
3230
|
});
|
|
3231
|
-
const m = (
|
|
3231
|
+
const m = (s = c.type) === null || s === void 0 ? void 0 : s.toLowerCase();
|
|
3232
3232
|
if (m === "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
3234
|
if ((m === "ephemeral" || m === "stateful") && n)
|
|
@@ -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,
|
|
3257
|
+
var n, o, l, s, u, c, m, 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,7 +3279,7 @@ 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: (
|
|
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: {
|
|
@@ -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
|
|
3320
|
+
var s;
|
|
3321
3321
|
const u = [];
|
|
3322
3322
|
let c = !1, m = !1;
|
|
3323
3323
|
this.publicEventEmitter.addListener(N.VIDEO_STREAM_STARTED, (p) => {
|
|
3324
3324
|
u.push(p), c = !0, m && l(u);
|
|
3325
3325
|
}), this.publicEventEmitter.addListener(N.AUDIO_STREAM_STARTED, (p) => {
|
|
3326
3326
|
u.push(p), m = !0, c && l(u);
|
|
3327
|
-
}), (
|
|
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 (
|
|
3351
|
-
throw
|
|
3352
|
-
cause:
|
|
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.
|
|
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)
|
|
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
|
-
|
|
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
|
|
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 (
|
|
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,26 +3565,26 @@ async function rr(t, e, n, o, l) {
|
|
|
3562
3565
|
hasToken: !!d.sessionToken
|
|
3563
3566
|
}), c = d.sessionToken;
|
|
3564
3567
|
}
|
|
3565
|
-
if (
|
|
3568
|
+
if (s !== t.generation) return;
|
|
3566
3569
|
const m = Zn(c, {
|
|
3567
3570
|
api: n ? { baseUrl: n } : void 0,
|
|
3568
3571
|
metrics: { disableClientMetrics: !0 }
|
|
3569
3572
|
});
|
|
3570
3573
|
m.addListener(N.CONNECTION_ESTABLISHED, () => {
|
|
3571
|
-
|
|
3574
|
+
s === t.generation && (console.log("[AnamWidget] Connection established"), t.connectionStatus.value = "connected");
|
|
3572
3575
|
}), m.addListener(N.VIDEO_STREAM_STARTED, () => {
|
|
3573
|
-
|
|
3576
|
+
s === t.generation && (console.log("[AnamWidget] Video stream started"), t.isStreaming.value = !0);
|
|
3574
3577
|
}), m.addListener(N.AUDIO_STREAM_STARTED, () => {
|
|
3575
3578
|
console.log("[AnamWidget] Audio stream started");
|
|
3576
3579
|
}), m.addListener(N.MESSAGE_HISTORY_UPDATED, (_) => {
|
|
3577
|
-
|
|
3580
|
+
s === t.generation && (t.messages.value = [..._]);
|
|
3578
3581
|
}), m.addListener(N.CONNECTION_CLOSED, (_, d) => {
|
|
3579
|
-
|
|
3582
|
+
s === t.generation && (console.log("[AnamWidget] Connection closed:", _, d), t.connectionStatus.value = "idle", t.isStreaming.value = !1, t.sessionId.value = null);
|
|
3580
3583
|
}), m.addListener(N.SESSION_READY, (_) => {
|
|
3581
|
-
|
|
3584
|
+
s === t.generation && (console.log("[AnamWidget] Session ready:", _), t.sessionId.value = _);
|
|
3582
3585
|
});
|
|
3583
3586
|
const p = await m.stream();
|
|
3584
|
-
if (
|
|
3587
|
+
if (s !== t.generation) {
|
|
3585
3588
|
try {
|
|
3586
3589
|
await m.stopStreaming();
|
|
3587
3590
|
} catch {
|
|
@@ -3593,7 +3596,7 @@ async function rr(t, e, n, o, l) {
|
|
|
3593
3596
|
_ && (o.srcObject = _);
|
|
3594
3597
|
}
|
|
3595
3598
|
} catch (c) {
|
|
3596
|
-
if (
|
|
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,
|
|
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,20 +3638,20 @@ function cr(t, e, n) {
|
|
|
3635
3638
|
personaName: l.personaName,
|
|
3636
3639
|
serverConfig: l.serverConfig,
|
|
3637
3640
|
fetchWidgetConfig: () => {
|
|
3638
|
-
if (!
|
|
3641
|
+
if (!s) {
|
|
3639
3642
|
l.isReady.value = !0;
|
|
3640
3643
|
return;
|
|
3641
3644
|
}
|
|
3642
|
-
nr(l,
|
|
3645
|
+
nr(l, s, c);
|
|
3643
3646
|
},
|
|
3644
|
-
startSession: (m) => !
|
|
3647
|
+
startSession: (m) => !s && !n ? (l.error.value = "No agent ID or session token configured", Promise.resolve()) : rr(l, s || "", c, m, n),
|
|
3645
3648
|
stopSession: () => or(l),
|
|
3646
3649
|
sendMessage: (m) => sr(l, m),
|
|
3647
3650
|
toggleMute: () => ar(l),
|
|
3648
3651
|
cleanup: () => lr(l)
|
|
3649
3652
|
};
|
|
3650
3653
|
}
|
|
3651
|
-
const ur = '@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.block{display:block}.flex{display:flex}.inline{display:inline}.flex-shrink{flex-shrink:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.border{border-style:var(--tw-border-style);border-width:1px}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}:host{--anam-trigger-size:80px;--anam-sheet-width:400px;--anam-sheet-height:640px;all:initial;color:#18181b;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:DM Sans,system-ui,-apple-system,sans-serif;font-size:15px;line-height:1.5}@media(max-width:640px){:host{--anam-trigger-size:72px;--anam-sheet-width: calc(100vw - 24px) ;--anam-sheet-height: calc(100dvh - 100px) }}.anam-widget{z-index:9999;font-family:inherit}.anam-widget[data-layout=floating]{position:fixed}.anam-widget[data-layout=inline]{position:relative}.anam-trigger{width:var(--anam-trigger-size);height:var(--anam-trigger-size);cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:all .25s cubic-bezier(.4,0,.2,1);display:flex;overflow:hidden;box-shadow:0 2px 8px #00000014,0 8px 24px -4px #0000002e}.anam-trigger:hover{transform:scale(1.06);box-shadow:0 4px 12px #0000001a,0 12px 32px -4px #00000040}.anam-trigger:active{transform:scale(.97)}.anam-trigger img{object-fit:cover;width:100%;height:100%;display:block}.anam-sheet{width:var(--anam-sheet-width);aspect-ratio:16/10;max-height:var(--anam-sheet-height);border-radius:8px;animation:.25s cubic-bezier(.16,1,.3,1) sheetIn;position:relative;overflow:hidden;box-shadow:0 32px 64px -16px #00000040,0 0 0 1px #00000014}.anam-widget[data-layout=inline] .anam-sheet{aspect-ratio:3/2;border-radius:8px;width:100%;max-height:none;animation:none}@keyframes sheetIn{0%{opacity:0;transform:translateY(8px)scale(.97)}to{opacity:1;transform:translateY(0)scale(1)}}.anam-video{object-fit:cover;background:#000;width:100%;height:100%;display:block;position:absolute;inset:0}.anam-video[data-hidden=true]{visibility:hidden}.anam-overlay-idle{z-index:2;position:absolute;inset:0}.anam-overlay-idle img{object-fit:cover;width:100%;height:100%;display:block}.anam-preview-video{object-fit:cover;z-index:1;width:100%;height:100%;display:block;position:absolute;inset:0}.anam-preview-fallback{z-index:0;position:absolute;inset:0}.anam-cta-pill{z-index:2;-webkit-backdrop-filter:blur(8px);color:#fff;letter-spacing:-.01em;cursor:pointer;white-space:nowrap;background:#ffffff24;border:1px solid #ffffff38;border-radius:999px;align-items:center;gap:12px;min-width:200px;padding:12px 26px;font-family:inherit;font-size:16px;font-weight:600;transition:all .2s;display:flex;position:absolute;bottom:20px;left:50%;transform:translate(-50%)}.anam-cta-pill:hover{background:#ffffff38;transform:translate(-50%)scale(1.03)}.anam-cta-pill:active{transform:translate(-50%)scale(.98)}.anam-cta-pill svg{flex-shrink:0}.anam-overlay-unconfigured{z-index:2;background:#111;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-unconfigured span{color:#ffffff59;letter-spacing:-.01em;font-size:14px;font-weight:400}.anam-overlay-loading{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:20px;display:flex;position:absolute;inset:0}.anam-overlay-loading span{color:#fffc;letter-spacing:-.01em;font-size:15px;font-weight:400}.anam-overlay-error{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-error-text{color:#fff9;text-align:center;max-width:260px;font-size:14px;line-height:1.5}.anam-overlay-error .anam-retry-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff1f;border:1px solid #ffffff1a;border-radius:999px;padding:10px 24px;font-family:inherit;font-size:14px;font-weight:500;transition:background .15s}.anam-overlay-error .anam-retry-btn:hover{background:#fff3}.anam-spinner{border:2.5px solid #ffffff1f;border-top-color:#fff;border-radius:50%;width:32px;height:32px;animation:.75s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.anam-close-btn{z-index:10;-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#00000073;border:1px solid #ffffff38;border-radius:50%;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:background .15s;display:flex;position:absolute;top:12px;right:12px}.anam-close-btn:hover{background:#0009}.anam-toast{z-index:10;-webkit-backdrop-filter:blur(16px);color:#fff;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;background:#0009;border:1px solid #ffffff0f;border-radius:999px;max-width:85%;padding:10px 22px;font-size:14px;font-weight:400;animation:.25s cubic-bezier(.16,1,.3,1) toastIn;position:absolute;bottom:80px;left:50%;overflow:hidden;transform:translate(-50%)}.anam-toast-out{animation:.4s forwards toastOut}@keyframes toastIn{0%{opacity:0;transform:translate(-50%)translateY(6px)}to{opacity:1;transform:translate(-50%)translateY(0)}}@keyframes toastOut{0%{opacity:1}to{opacity:0}}.anam-control-bar{z-index:10;background:linear-gradient(#0000,#00000040 40%,#0000008c);justify-content:center;align-items:center;gap:8px;padding:48px 16px 16px;display:flex;position:absolute;bottom:0;left:0;right:0}.anam-ctl-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff38;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:background .15s;display:flex}.anam-ctl-btn:hover{background:#ffffff38}.anam-ctl-btn:disabled{opacity:.35;cursor:not-allowed}.anam-ctl-input-wrap{flex:1;align-items:center;min-width:0;margin-right:56px;display:flex;position:relative}.anam-ctl-input{-webkit-backdrop-filter:blur(8px);color:#fff;background:#ffffff1a;border:1px solid #ffffff38;border-radius:999px;outline:none;width:100%;padding:11px 44px 11px 18px;font-family:inherit;font-size:14px;transition:background .15s,border-color .15s}.anam-ctl-input::placeholder{color:#fff6}.anam-ctl-input:focus{background:#ffffff26;border-color:#ffffff2e}.anam-ctl-input:disabled{opacity:.35;cursor:not-allowed}.anam-ctl-send{color:#ffffff80;cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;padding:0;transition:color .15s;display:flex;position:absolute;right:6px}.anam-ctl-send:hover{color:#fff}.anam-ctl-send:disabled{opacity:.35;cursor:not-allowed}.anam-watermark{z-index:11;opacity:.5;line-height:0;text-decoration:none;transition:opacity .15s;position:absolute;top:16px;left:16px}.anam-watermark:hover{opacity:.8}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}';
|
|
3654
|
+
const ur = '@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.block{display:block}.flex{display:flex}.inline{display:inline}.flex-shrink{flex-shrink:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.border{border-style:var(--tw-border-style);border-width:1px}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}:host{--anam-trigger-size:80px;--anam-sheet-width:400px;--anam-sheet-height:640px;all:initial;color:#18181b;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:DM Sans,system-ui,-apple-system,sans-serif;font-size:15px;line-height:1.5}@media(max-width:640px){:host{--anam-trigger-size:72px;--anam-sheet-width: calc(100vw - 24px) ;--anam-sheet-height: calc(100dvh - 100px) }}.anam-widget{z-index:9999;font-family:inherit}.anam-widget[data-layout=floating]{position:fixed}.anam-widget[data-layout=inline]{position:relative}.anam-trigger{width:var(--anam-trigger-size);height:var(--anam-trigger-size);cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:all .25s cubic-bezier(.4,0,.2,1);display:flex;overflow:hidden;box-shadow:0 2px 8px #00000014,0 8px 24px -4px #0000002e}.anam-trigger:hover{transform:scale(1.06);box-shadow:0 4px 12px #0000001a,0 12px 32px -4px #00000040}.anam-trigger:active{transform:scale(.97)}.anam-trigger img{object-fit:cover;width:100%;height:100%;display:block}.anam-sheet{width:var(--anam-sheet-width);aspect-ratio:16/10;max-height:var(--anam-sheet-height);border-radius:8px;animation:.25s cubic-bezier(.16,1,.3,1) sheetIn;position:relative;overflow:hidden;box-shadow:0 32px 64px -16px #00000040,0 0 0 1px #00000014}.anam-widget[data-layout=inline] .anam-sheet{aspect-ratio:3/2;border-radius:8px;width:100%;max-height:none;animation:none}@keyframes sheetIn{0%{opacity:0;transform:translateY(8px)scale(.97)}to{opacity:1;transform:translateY(0)scale(1)}}.anam-video{object-fit:cover;background:#000;width:100%;height:100%;display:block;position:absolute;inset:0}.anam-video[data-hidden=true]{visibility:hidden}.anam-overlay-idle{z-index:2;position:absolute;inset:0}.anam-overlay-idle img{object-fit:cover;width:100%;height:100%;display:block}.anam-preview-video{object-fit:cover;z-index:1;width:100%;height:100%;display:block;position:absolute;inset:0}.anam-preview-fallback{z-index:0;position:absolute;inset:0}.anam-cta-pill{z-index:2;-webkit-backdrop-filter:blur(12px);color:#2a2220;letter-spacing:-.01em;cursor:pointer;white-space:nowrap;background:#ffffff8c;border:none;border-radius:999px;justify-content:center;align-items:center;gap:10px;padding:14px 28px;font-family:inherit;font-size:18px;font-weight:600;transition:all .2s;display:flex;position:absolute;bottom:20px;left:50%;transform:translate(-50%)}.anam-cta-pill:hover{background:#ffffffb3;transform:translate(-50%)scale(1.03)}.anam-cta-pill:active{transform:translate(-50%)scale(.98)}.anam-cta-pill svg{flex-shrink:0;transform:translateY(-1px)}.anam-overlay-unconfigured{z-index:2;background:#111;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-unconfigured span{color:#ffffff59;letter-spacing:-.01em;font-size:14px;font-weight:400}.anam-overlay-loading{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:20px;display:flex;position:absolute;inset:0}.anam-overlay-loading span{color:#fffc;letter-spacing:-.01em;font-size:15px;font-weight:400}.anam-overlay-error{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-error-text{color:#fff9;text-align:center;max-width:260px;font-size:14px;line-height:1.5}.anam-overlay-error .anam-retry-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff1f;border:1px solid #ffffff1a;border-radius:999px;padding:10px 24px;font-family:inherit;font-size:14px;font-weight:500;transition:background .15s}.anam-overlay-error .anam-retry-btn:hover{background:#fff3}.anam-spinner{border:2.5px solid #ffffff1f;border-top-color:#fff;border-radius:50%;width:32px;height:32px;animation:.75s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.anam-close-btn{z-index:10;-webkit-backdrop-filter:blur(12px);color:#2a2220;cursor:pointer;background:#ffffff8c;border:none;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;padding:0;transition:background .15s;display:flex;position:absolute;top:12px;right:12px}.anam-close-btn:hover{background:#ffffffb3}.anam-toast{z-index:10;-webkit-backdrop-filter:blur(16px);color:#18181b;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;background:#ffffffeb;border:1px solid #00000014;border-radius:999px;max-width:85%;padding:10px 22px;font-size:14px;font-weight:400;animation:.25s cubic-bezier(.16,1,.3,1) toastIn;position:absolute;bottom:80px;left:50%;overflow:hidden;transform:translate(-50%)}.anam-toast-out{animation:.4s forwards toastOut}@keyframes toastIn{0%{opacity:0;transform:translate(-50%)translateY(6px)}to{opacity:1;transform:translate(-50%)translateY(0)}}@keyframes toastOut{0%{opacity:1}to{opacity:0}}.anam-control-bar{z-index:10;background:0 0;justify-content:center;align-items:center;gap:8px;padding:0;display:flex;position:absolute;bottom:12px;left:12px;right:12px}.anam-ctl-btn{-webkit-backdrop-filter:blur(12px);color:#2a2220;cursor:pointer;background:#ffffff8c;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:background .15s;display:flex}.anam-ctl-btn:hover{background:#ffffffb3}.anam-ctl-btn:disabled{opacity:.35;cursor:not-allowed}.anam-ctl-input-wrap{flex:1;align-items:center;min-width:0;display:flex;position:relative}.anam-ctl-input{-webkit-backdrop-filter:blur(12px);color:#2a2220;background:#ffffff8c;border:none;border-radius:999px;outline:none;width:100%;padding:11px 44px 11px 18px;font-family:inherit;font-size:14px;transition:background .15s}.anam-ctl-input::placeholder{color:#2a222080}.anam-ctl-input:focus{background:#ffffffb3}.anam-ctl-input:disabled{opacity:.35;cursor:not-allowed}.anam-ctl-send{color:#2a222080;cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;padding:0;transition:color .15s;display:flex;position:absolute;right:6px}.anam-ctl-send:hover{color:#2a2220}.anam-ctl-send:disabled{opacity:.35;cursor:not-allowed}.anam-watermark{z-index:11;opacity:.5;line-height:0;text-decoration:none;transition:opacity .15s;position:absolute;top:16px;left:16px}.anam-watermark:hover{opacity:.8}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}';
|
|
3652
3655
|
class dr extends we {
|
|
3653
3656
|
state = { hasError: !1 };
|
|
3654
3657
|
static getDerivedStateFromError() {
|
|
@@ -3683,7 +3686,7 @@ function hr(t) {
|
|
|
3683
3686
|
const l = at(t["ui-captions"]);
|
|
3684
3687
|
return l !== void 0 && (e.showCaptions = l), t["call-to-action"] && (e.callToAction = t["call-to-action"]), e;
|
|
3685
3688
|
}
|
|
3686
|
-
const fr = () => /* @__PURE__ */ w("svg", { width: "
|
|
3689
|
+
const fr = () => /* @__PURE__ */ w("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round", children: /* @__PURE__ */ w("path", { d: "M18 6L6 18M6 6l12 12" }) }), pr = () => /* @__PURE__ */ w("svg", { width: "24", height: "24", viewBox: "0 0 640 640", fill: "currentColor", children: /* @__PURE__ */ w("path", { d: "M187.2 100.9C174.8 94.1 159.8 94.4 147.6 101.6C135.4 108.8 128 121.9 128 136L128 504C128 518.1 135.5 531.2 147.6 538.4C159.7 545.6 174.8 545.9 187.2 539.1L523.2 355.1C536 348.1 544 334.6 544 320C544 305.4 536 291.9 523.2 284.9L187.2 100.9z" }) }), _r = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
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" })
|
|
@@ -3705,7 +3708,7 @@ function gr({
|
|
|
3705
3708
|
videoRef: n,
|
|
3706
3709
|
avatarSrc: o,
|
|
3707
3710
|
avatarVideoSrc: l,
|
|
3708
|
-
displayCta:
|
|
3711
|
+
displayCta: s,
|
|
3709
3712
|
onCollapse: u,
|
|
3710
3713
|
onStop: c
|
|
3711
3714
|
}) {
|
|
@@ -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
|
-
|
|
3768
|
+
s
|
|
3766
3769
|
] })
|
|
3767
3770
|
] })
|
|
3768
3771
|
) : (
|
|
@@ -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
|
-
),
|
|
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
|
-
|
|
3871
|
+
s.layout === "floating" ? s.initialState : "expanded"
|
|
3869
3872
|
);
|
|
3870
3873
|
Ge(() => {
|
|
3871
|
-
|
|
3872
|
-
}, [
|
|
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 =
|
|
3876
|
-
if (
|
|
3877
|
-
const I = yn(
|
|
3878
|
+
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 = 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
|
-
}, [
|
|
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":
|
|
3891
|
+
"data-layout": s.layout,
|
|
3889
3892
|
"data-state": u.value,
|
|
3890
3893
|
style: S,
|
|
3891
3894
|
children: [
|
|
@@ -3901,7 +3904,7 @@ function yr(t) {
|
|
|
3901
3904
|
A && /* @__PURE__ */ w(
|
|
3902
3905
|
gr,
|
|
3903
3906
|
{
|
|
3904
|
-
config:
|
|
3907
|
+
config: s,
|
|
3905
3908
|
session: o,
|
|
3906
3909
|
videoRef: e,
|
|
3907
3910
|
avatarSrc: c,
|