@anam-ai/agent-widget 0.1.0-alpha.5 → 0.1.0-alpha.6
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 +287 -275
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var $e,
|
|
1
|
+
var $e, D, hi, fi, Ee, Ht, pi, _i, Ei, It, _t, Et, Ue = {}, mi = [], an = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, rt = Array.isArray;
|
|
2
2
|
function ie(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
@@ -14,7 +14,7 @@ function Ce(t, e, n) {
|
|
|
14
14
|
}
|
|
15
15
|
function xe(t, e, n, o, c) {
|
|
16
16
|
var a = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: c ?? ++hi, __i: -1, __u: 0 };
|
|
17
|
-
return c == null &&
|
|
17
|
+
return c == null && D.vnode != null && D.vnode(a), a;
|
|
18
18
|
}
|
|
19
19
|
function oe(t) {
|
|
20
20
|
return t.children;
|
|
@@ -38,16 +38,16 @@ function gi(t) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
function Wt(t) {
|
|
41
|
-
(!t.__d && (t.__d = !0) && Ee.push(t) && !Xe.__r++ || Ht !=
|
|
41
|
+
(!t.__d && (t.__d = !0) && Ee.push(t) && !Xe.__r++ || Ht != D.debounceRendering) && ((Ht = D.debounceRendering) || pi)(Xe);
|
|
42
42
|
}
|
|
43
43
|
function Xe() {
|
|
44
|
-
for (var t, e, n, o, c, a, u, l = 1; Ee.length; ) Ee.length > l && Ee.sort(_i), t = Ee.shift(), l = Ee.length, t.__d && (n = void 0, o = void 0, c = (o = (e = t).__v).__e, a = [], u = [], e.__P && ((n = ie({}, o)).__v = o.__v + 1,
|
|
44
|
+
for (var t, e, n, o, c, a, u, l = 1; Ee.length; ) Ee.length > l && Ee.sort(_i), t = Ee.shift(), l = Ee.length, t.__d && (n = void 0, o = void 0, c = (o = (e = t).__v).__e, a = [], u = [], e.__P && ((n = ie({}, o)).__v = o.__v + 1, D.vnode && D.vnode(n), At(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [c] : null, a, c ?? be(o), !!(32 & o.__u), u), n.__v = o.__v, n.__.__k[n.__i] = n, Si(a, n, u), o.__e = o.__ = null, n.__e != c && gi(n)));
|
|
45
45
|
Xe.__r = 0;
|
|
46
46
|
}
|
|
47
47
|
function vi(t, e, n, o, c, a, u, l, m, p, _) {
|
|
48
|
-
var d, S, g, y,
|
|
49
|
-
for (m = ln(n, e,
|
|
50
|
-
return n.__e =
|
|
48
|
+
var d, S, g, y, I, A, w, b = o && o.__k || mi, T = e.length;
|
|
49
|
+
for (m = ln(n, e, b, m, T), d = 0; d < T; d++) (g = n.__k[d]) != null && (S = g.__i == -1 ? Ue : b[g.__i] || Ue, g.__i = d, A = At(t, g, S, c, a, u, l, m, p, _), y = g.__e, g.ref && S.ref != g.ref && (S.ref && Tt(S.ref, null, g), _.push(g.ref, g.__c || y, g)), I == null && y != null && (I = y), (w = !!(4 & g.__u)) || S.__k === g.__k ? m = yi(g, m, t, w) : typeof g.type == "function" && A !== void 0 ? m = A : y && (m = y.nextSibling), g.__u &= -7);
|
|
50
|
+
return n.__e = I, m;
|
|
51
51
|
}
|
|
52
52
|
function ln(t, e, n, o, c) {
|
|
53
53
|
var a, u, l, m, p, _ = n.length, d = _, S = 0;
|
|
@@ -102,35 +102,35 @@ function qt(t) {
|
|
|
102
102
|
var n = this.l[e.type + t];
|
|
103
103
|
if (e.t == null) e.t = It++;
|
|
104
104
|
else if (e.t < n.u) return;
|
|
105
|
-
return n(
|
|
105
|
+
return n(D.event ? D.event(e) : e);
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
function At(t, e, n, o, c, a, u, l, m, p) {
|
|
110
|
-
var _, d, S, g, y,
|
|
110
|
+
var _, d, S, g, y, I, A, w, b, T, O, x, Z, H, ae, ne, re, Q = e.type;
|
|
111
111
|
if (e.constructor !== void 0) return null;
|
|
112
|
-
128 & n.__u && (m = !!(32 & n.__u), a = [l = e.__e = n.__e]), (_ =
|
|
112
|
+
128 & n.__u && (m = !!(32 & n.__u), a = [l = e.__e = n.__e]), (_ = D.__b) && _(e);
|
|
113
113
|
e: if (typeof Q == "function") try {
|
|
114
|
-
if (w = e.props,
|
|
114
|
+
if (w = e.props, b = "prototype" in Q && Q.prototype.render, T = (_ = Q.contextType) && o[_.__c], O = _ ? T ? T.props.value : _.__ : o, n.__c ? A = (d = e.__c = n.__c).__ = d.__E : (b ? e.__c = d = new Q(w, O) : (e.__c = d = new Oe(w, O), d.constructor = Q, d.render = dn), T && T.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 && Q.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ie({}, d.__s)), ie(d.__s, Q.getDerivedStateFromProps(w, d.__s))), g = d.props, y = d.state, d.__v = e, S) b && Q.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), b && d.componentDidMount != null && d.__h.push(d.componentDidMount);
|
|
115
115
|
else {
|
|
116
|
-
if (
|
|
116
|
+
if (b && Q.getDerivedStateFromProps == null && w !== g && d.componentWillReceiveProps != null && d.componentWillReceiveProps(w, O), e.__v == n.__v || !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(w, d.__s, O) === !1) {
|
|
117
117
|
for (e.__v != n.__v && (d.props = w, d.state = d.__s, d.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(le) {
|
|
118
118
|
le && (le.__ = e);
|
|
119
119
|
}), x = 0; x < d._sb.length; x++) d.__h.push(d._sb[x]);
|
|
120
120
|
d._sb = [], d.__h.length && u.push(d);
|
|
121
121
|
break e;
|
|
122
122
|
}
|
|
123
|
-
d.componentWillUpdate != null && d.componentWillUpdate(w, d.__s,
|
|
124
|
-
d.componentDidUpdate(g, y,
|
|
123
|
+
d.componentWillUpdate != null && d.componentWillUpdate(w, d.__s, O), b && d.componentDidUpdate != null && d.__h.push(function() {
|
|
124
|
+
d.componentDidUpdate(g, y, I);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
if (d.context =
|
|
127
|
+
if (d.context = O, d.props = w, d.__P = t, d.__e = !1, Z = D.__r, H = 0, b) {
|
|
128
128
|
for (d.state = d.__s, d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context), ae = 0; ae < d._sb.length; ae++) d.__h.push(d._sb[ae]);
|
|
129
129
|
d._sb = [];
|
|
130
130
|
} else do
|
|
131
131
|
d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context), d.state = d.__s;
|
|
132
132
|
while (d.__d && ++H < 25);
|
|
133
|
-
d.state = d.__s, d.getChildContext != null && (o = ie(ie({}, o), d.getChildContext())),
|
|
133
|
+
d.state = d.__s, d.getChildContext != null && (o = ie(ie({}, o), d.getChildContext())), b && !S && d.getSnapshotBeforeUpdate != null && (I = d.getSnapshotBeforeUpdate(g, y)), ne = _, _ != null && _.type === oe && _.key == null && (ne = wi(_.props.children)), l = vi(t, rt(ne) ? ne : [ne], e, n, o, c, a, u, l, m, p), d.base = e.__e, e.__u &= -161, d.__h.length && u.push(d), A && (d.__E = d.__ = null);
|
|
134
134
|
} catch (le) {
|
|
135
135
|
if (e.__v = null, m || a != null) if (le.then) {
|
|
136
136
|
for (e.__u |= m ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
@@ -140,23 +140,23 @@ function At(t, e, n, o, c, a, u, l, m, p) {
|
|
|
140
140
|
mt(e);
|
|
141
141
|
}
|
|
142
142
|
else e.__e = n.__e, e.__k = n.__k, le.then || mt(e);
|
|
143
|
-
|
|
143
|
+
D.__e(le, e, n);
|
|
144
144
|
}
|
|
145
145
|
else a == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = un(n.__e, e, n, o, c, a, u, m, p);
|
|
146
|
-
return (_ =
|
|
146
|
+
return (_ = D.diffed) && _(e), 128 & e.__u ? void 0 : l;
|
|
147
147
|
}
|
|
148
148
|
function mt(t) {
|
|
149
149
|
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(mt);
|
|
150
150
|
}
|
|
151
151
|
function Si(t, e, n) {
|
|
152
152
|
for (var o = 0; o < n.length; o++) Tt(n[o], n[++o], n[++o]);
|
|
153
|
-
|
|
153
|
+
D.__c && D.__c(e, t), t.some(function(c) {
|
|
154
154
|
try {
|
|
155
155
|
t = c.__h, c.__h = [], t.some(function(a) {
|
|
156
156
|
a.call(c);
|
|
157
157
|
});
|
|
158
158
|
} catch (a) {
|
|
159
|
-
|
|
159
|
+
D.__e(a, c.__v);
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
}
|
|
@@ -164,31 +164,31 @@ function wi(t) {
|
|
|
164
164
|
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : rt(t) ? t.map(wi) : ie({}, t);
|
|
165
165
|
}
|
|
166
166
|
function un(t, e, n, o, c, a, u, l, m) {
|
|
167
|
-
var p, _, d, S, g, y,
|
|
168
|
-
if (
|
|
169
|
-
for (p = 0; p < a.length; p++) if ((g = a[p]) && "setAttribute" in g == !!
|
|
167
|
+
var p, _, d, S, g, y, I, A = n.props || Ue, w = e.props, b = e.type;
|
|
168
|
+
if (b == "svg" ? c = "http://www.w3.org/2000/svg" : b == "math" ? c = "http://www.w3.org/1998/Math/MathML" : c || (c = "http://www.w3.org/1999/xhtml"), a != null) {
|
|
169
|
+
for (p = 0; p < a.length; p++) if ((g = a[p]) && "setAttribute" in g == !!b && (b ? g.localName == b : g.nodeType == 3)) {
|
|
170
170
|
t = g, a[p] = null;
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
if (t == null) {
|
|
175
|
-
if (
|
|
176
|
-
t = document.createElementNS(c,
|
|
175
|
+
if (b == null) return document.createTextNode(w);
|
|
176
|
+
t = document.createElementNS(c, b, w.is && w), l && (D.__m && D.__m(e, a), l = !1), a = null;
|
|
177
177
|
}
|
|
178
|
-
if (
|
|
178
|
+
if (b == null) A === w || l && t.data == w || (t.data = w);
|
|
179
179
|
else {
|
|
180
|
-
if (a = a && $e.call(t.childNodes), !l && a != null) for (
|
|
181
|
-
for (p in
|
|
180
|
+
if (a = a && $e.call(t.childNodes), !l && a != null) for (A = {}, p = 0; p < t.attributes.length; p++) A[(g = t.attributes[p]).name] = g.value;
|
|
181
|
+
for (p in A) if (g = A[p], p != "children") {
|
|
182
182
|
if (p == "dangerouslySetInnerHTML") d = g;
|
|
183
183
|
else if (!(p in w)) {
|
|
184
184
|
if (p == "value" && "defaultValue" in w || p == "checked" && "defaultChecked" in w) continue;
|
|
185
185
|
je(t, p, null, g, c);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
for (p in w) g = w[p], p == "children" ? S = g : p == "dangerouslySetInnerHTML" ? _ = g : p == "value" ? y = g : p == "checked" ?
|
|
188
|
+
for (p in w) g = w[p], p == "children" ? S = g : p == "dangerouslySetInnerHTML" ? _ = g : p == "value" ? y = g : p == "checked" ? I = g : l && typeof g != "function" || A[p] === g || je(t, p, g, A[p], c);
|
|
189
189
|
if (_) l || d && (_.__html == d.__html || _.__html == t.innerHTML) || (t.innerHTML = _.__html), e.__k = [];
|
|
190
|
-
else if (d && (t.innerHTML = ""), vi(e.type == "template" ? t.content : t, rt(S) ? S : [S], e, n, o,
|
|
191
|
-
l || (p = "value",
|
|
190
|
+
else if (d && (t.innerHTML = ""), vi(e.type == "template" ? t.content : t, rt(S) ? S : [S], e, n, o, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : c, a, u, a ? a[0] : n.__k && be(n, 0), l, m), a != null) for (p = a.length; p--; ) bt(a[p]);
|
|
191
|
+
l || (p = "value", b == "progress" && y == null ? t.removeAttribute("value") : y != null && (y !== t[p] || b == "progress" && !y || b == "option" && y != A[p]) && je(t, p, y, A[p], c), p = "checked", I != null && I != t[p] && je(t, p, I, A[p], c));
|
|
192
192
|
}
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
@@ -199,16 +199,16 @@ function Tt(t, e, n) {
|
|
|
199
199
|
o && t.__u(), o && e == null || (t.__u = t(e));
|
|
200
200
|
} else t.current = e;
|
|
201
201
|
} catch (c) {
|
|
202
|
-
|
|
202
|
+
D.__e(c, n);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
function Ci(t, e, n) {
|
|
206
206
|
var o, c;
|
|
207
|
-
if (
|
|
207
|
+
if (D.unmount && D.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || Tt(o, null, e)), (o = t.__c) != null) {
|
|
208
208
|
if (o.componentWillUnmount) try {
|
|
209
209
|
o.componentWillUnmount();
|
|
210
210
|
} catch (a) {
|
|
211
|
-
|
|
211
|
+
D.__e(a, e);
|
|
212
212
|
}
|
|
213
213
|
o.base = o.__P = null;
|
|
214
214
|
}
|
|
@@ -220,7 +220,7 @@ function dn(t, e, n) {
|
|
|
220
220
|
}
|
|
221
221
|
function ot(t, e, n) {
|
|
222
222
|
var o, c, a, u;
|
|
223
|
-
e == document && (e = document.documentElement),
|
|
223
|
+
e == document && (e = document.documentElement), D.__ && D.__(t, e), c = (o = typeof n == "function") ? null : n && n.__k || e.__k, a = [], u = [], At(e, t = (!o && n || e).__k = Ce(oe, null, [t]), c || Ue, Ue, e.namespaceURI, !o && n ? [n] : c ? null : e.firstChild ? $e.call(e.childNodes) : null, a, !o && n ? n : c ? c.__e : e.firstChild, o, u), Si(a, t, u);
|
|
224
224
|
}
|
|
225
225
|
function Ii(t, e) {
|
|
226
226
|
ot(t, e, Ii);
|
|
@@ -230,7 +230,7 @@ function bi(t, e, n) {
|
|
|
230
230
|
for (a in t.type && t.type.defaultProps && (u = t.type.defaultProps), e) a == "key" ? o = e[a] : a == "ref" ? c = e[a] : l[a] = e[a] === void 0 && u != null ? u[a] : e[a];
|
|
231
231
|
return arguments.length > 2 && (l.children = arguments.length > 3 ? $e.call(arguments, 2) : n), xe(t.type, l, o || t.key, c || t.ref, null);
|
|
232
232
|
}
|
|
233
|
-
$e = mi.slice,
|
|
233
|
+
$e = mi.slice, D = { __e: function(t, e, n, o) {
|
|
234
234
|
for (var c, a, u; e = e.__; ) if ((c = e.__c) && !c.__) try {
|
|
235
235
|
if ((a = c.constructor) && a.getDerivedStateFromError != null && (c.setState(a.getDerivedStateFromError(t)), u = c.__d), c.componentDidCatch != null && (c.componentDidCatch(t, o || {}), u = c.__d), u) return c.__E = c;
|
|
236
236
|
} catch (l) {
|
|
@@ -305,7 +305,7 @@ function mn(t, e, n) {
|
|
|
305
305
|
function gn() {
|
|
306
306
|
ot(this._vdom = null, this._root);
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function Jt(t, e) {
|
|
309
309
|
var n = this, o = t.useFragment, c = Ai(t, fn);
|
|
310
310
|
return Ce(o ? oe : "slot", Ze({}, c, { ref: function(a) {
|
|
311
311
|
a ? (n.ref = a, n._listener || (n._listener = function(u) {
|
|
@@ -320,9 +320,9 @@ function Ri(t, e, n) {
|
|
|
320
320
|
for (a = u.length; a--; ) u[a].name !== "slot" && (c[u[a].name] = u[a].value, c[Ti(u[a].name)] = u[a].value);
|
|
321
321
|
for (a = l.length; a--; ) {
|
|
322
322
|
var m = Ri(l[a], null, n), p = l[a].slot;
|
|
323
|
-
p ? c[p] = Ce(
|
|
323
|
+
p ? c[p] = Ce(Jt, { name: p }, m) : o[a] = m;
|
|
324
324
|
}
|
|
325
|
-
var _ = !(!n || !n.shadow), d = e ? Ce(
|
|
325
|
+
var _ = !(!n || !n.shadow), d = e ? Ce(Jt, { useFragment: !_ }, o) : o;
|
|
326
326
|
return !_ && e && (t.innerHTML = ""), Ce(e || t.nodeName.toLowerCase(), c, d);
|
|
327
327
|
}
|
|
328
328
|
var vn = 0;
|
|
@@ -332,15 +332,15 @@ function C(t, e, n, o, c, a) {
|
|
|
332
332
|
if ("ref" in m) for (l in m = {}, e) l == "ref" ? u = e[l] : m[l] = e[l];
|
|
333
333
|
var p = { type: t, props: m, key: n, ref: u, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --vn, __i: -1, __u: 0, __source: c, __self: a };
|
|
334
334
|
if (typeof t == "function" && (u = t.defaultProps)) for (l in u) m[l] === void 0 && (m[l] = u[l]);
|
|
335
|
-
return
|
|
335
|
+
return D.vnode && D.vnode(p), p;
|
|
336
336
|
}
|
|
337
|
-
var Me, P, dt,
|
|
337
|
+
var Me, P, dt, Yt, Be = 0, Ni = [], F = D, Kt = F.__b, Xt = F.__r, Zt = F.diffed, Qt = F.__c, ei = F.unmount, ti = F.__;
|
|
338
338
|
function Rt(t, e) {
|
|
339
339
|
F.__h && F.__h(P, t, Be || e), Be = 0;
|
|
340
340
|
var n = P.__H || (P.__H = { __: [], __h: [] });
|
|
341
341
|
return t >= n.__.length && n.__.push({}), n.__[t];
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function Je(t) {
|
|
344
344
|
return Be = 1, yn(Oi, t);
|
|
345
345
|
}
|
|
346
346
|
function yn(t, e, n) {
|
|
@@ -397,7 +397,7 @@ function He(t, e) {
|
|
|
397
397
|
}
|
|
398
398
|
function Sn() {
|
|
399
399
|
for (var t; t = Ni.shift(); ) if (t.__P && t.__H) try {
|
|
400
|
-
t.__H.__h.forEach(
|
|
400
|
+
t.__H.__h.forEach(Ye), t.__H.__h.forEach(vt), t.__H.__h = [];
|
|
401
401
|
} catch (e) {
|
|
402
402
|
t.__H.__h = [], F.__e(e, t.__v);
|
|
403
403
|
}
|
|
@@ -411,17 +411,17 @@ F.__b = function(t) {
|
|
|
411
411
|
var e = (P = t.__c).__H;
|
|
412
412
|
e && (dt === P ? (e.__h = [], P.__h = [], e.__.forEach(function(n) {
|
|
413
413
|
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
|
|
414
|
-
})) : (e.__h.forEach(
|
|
414
|
+
})) : (e.__h.forEach(Ye), e.__h.forEach(vt), e.__h = [], Me = 0)), dt = P;
|
|
415
415
|
}, F.diffed = function(t) {
|
|
416
416
|
Zt && Zt(t);
|
|
417
417
|
var e = t.__c;
|
|
418
|
-
e && e.__H && (e.__H.__h.length && (Ni.push(e) !== 1 &&
|
|
418
|
+
e && e.__H && (e.__H.__h.length && (Ni.push(e) !== 1 && Yt === F.requestAnimationFrame || ((Yt = F.requestAnimationFrame) || wn)(Sn)), e.__H.__.forEach(function(n) {
|
|
419
419
|
n.u && (n.__H = n.u), n.u = void 0;
|
|
420
420
|
})), dt = P = null;
|
|
421
421
|
}, F.__c = function(t, e) {
|
|
422
422
|
e.some(function(n) {
|
|
423
423
|
try {
|
|
424
|
-
n.__h.forEach(
|
|
424
|
+
n.__h.forEach(Ye), n.__h = n.__h.filter(function(o) {
|
|
425
425
|
return !o.__ || vt(o);
|
|
426
426
|
});
|
|
427
427
|
} catch (o) {
|
|
@@ -435,7 +435,7 @@ F.__b = function(t) {
|
|
|
435
435
|
var e, n = t.__c;
|
|
436
436
|
n && n.__H && (n.__H.__.forEach(function(o) {
|
|
437
437
|
try {
|
|
438
|
-
|
|
438
|
+
Ye(o);
|
|
439
439
|
} catch (c) {
|
|
440
440
|
e = c;
|
|
441
441
|
}
|
|
@@ -448,7 +448,7 @@ function wn(t) {
|
|
|
448
448
|
}, o = setTimeout(n, 35);
|
|
449
449
|
ii && (e = requestAnimationFrame(n));
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function Ye(t) {
|
|
452
452
|
var e = P, n = t.__c;
|
|
453
453
|
typeof n == "function" && (t.__c = void 0, n()), P = e;
|
|
454
454
|
}
|
|
@@ -493,24 +493,24 @@ function In(t) {
|
|
|
493
493
|
st();
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
var
|
|
496
|
+
var k = void 0;
|
|
497
497
|
function ki(t) {
|
|
498
|
-
var e =
|
|
499
|
-
|
|
498
|
+
var e = k;
|
|
499
|
+
k = void 0;
|
|
500
500
|
try {
|
|
501
501
|
return t();
|
|
502
502
|
} finally {
|
|
503
|
-
|
|
503
|
+
k = e;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
var ke = void 0, pe = 0, yt = 0, et = 0;
|
|
507
507
|
function Di(t) {
|
|
508
|
-
if (
|
|
508
|
+
if (k !== void 0) {
|
|
509
509
|
var e = t.n;
|
|
510
|
-
if (e === void 0 || e.t !==
|
|
511
|
-
return e = { i: 0, S: t, p:
|
|
510
|
+
if (e === void 0 || e.t !== k)
|
|
511
|
+
return e = { i: 0, S: t, p: k.s, n: void 0, t: k, e: void 0, x: void 0, r: e }, k.s !== void 0 && (k.s.n = e), k.s = e, t.n = e, 32 & k.f && t.S(e), e;
|
|
512
512
|
if (e.i === -1)
|
|
513
|
-
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p =
|
|
513
|
+
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = k.s, e.n = void 0, k.s.n = e, k.s = e), e;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
function j(t, e) {
|
|
@@ -540,12 +540,12 @@ j.prototype.U = function(t) {
|
|
|
540
540
|
j.prototype.subscribe = function(t) {
|
|
541
541
|
var e = this;
|
|
542
542
|
return Ge(function() {
|
|
543
|
-
var n = e.value, o =
|
|
544
|
-
|
|
543
|
+
var n = e.value, o = k;
|
|
544
|
+
k = void 0;
|
|
545
545
|
try {
|
|
546
546
|
t(n);
|
|
547
547
|
} finally {
|
|
548
|
-
|
|
548
|
+
k = o;
|
|
549
549
|
}
|
|
550
550
|
}, { name: "sub" });
|
|
551
551
|
};
|
|
@@ -559,12 +559,12 @@ j.prototype.toJSON = function() {
|
|
|
559
559
|
return this.value;
|
|
560
560
|
};
|
|
561
561
|
j.prototype.peek = function() {
|
|
562
|
-
var t =
|
|
563
|
-
|
|
562
|
+
var t = k;
|
|
563
|
+
k = void 0;
|
|
564
564
|
try {
|
|
565
565
|
return this.value;
|
|
566
566
|
} finally {
|
|
567
|
-
|
|
567
|
+
k = t;
|
|
568
568
|
}
|
|
569
569
|
};
|
|
570
570
|
Object.defineProperty(j.prototype, "value", { get: function() {
|
|
@@ -581,7 +581,7 @@ Object.defineProperty(j.prototype, "value", { get: function() {
|
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
} });
|
|
584
|
-
function
|
|
584
|
+
function J(t, e) {
|
|
585
585
|
return new j(t, e);
|
|
586
586
|
}
|
|
587
587
|
function Ui(t) {
|
|
@@ -613,15 +613,15 @@ ge.prototype.h = function() {
|
|
|
613
613
|
if ((36 & this.f) == 32 || (this.f &= -5, this.g === et)) return !0;
|
|
614
614
|
if (this.g = et, this.f |= 1, this.i > 0 && !Ui(this))
|
|
615
615
|
return this.f &= -2, !0;
|
|
616
|
-
var t =
|
|
616
|
+
var t = k;
|
|
617
617
|
try {
|
|
618
|
-
Mi(this),
|
|
618
|
+
Mi(this), k = this;
|
|
619
619
|
var e = this.x();
|
|
620
620
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
621
621
|
} catch (n) {
|
|
622
622
|
this.v = n, this.f |= 16, this.i++;
|
|
623
623
|
}
|
|
624
|
-
return
|
|
624
|
+
return k = t, Bi(this), this.f &= -2, !0;
|
|
625
625
|
};
|
|
626
626
|
ge.prototype.S = function(t) {
|
|
627
627
|
if (this.t === void 0) {
|
|
@@ -655,14 +655,14 @@ function Li(t) {
|
|
|
655
655
|
var e = t.u;
|
|
656
656
|
if (t.u = void 0, typeof e == "function") {
|
|
657
657
|
pe++;
|
|
658
|
-
var n =
|
|
659
|
-
|
|
658
|
+
var n = k;
|
|
659
|
+
k = void 0;
|
|
660
660
|
try {
|
|
661
661
|
e();
|
|
662
662
|
} catch (o) {
|
|
663
663
|
throw t.f &= -2, t.f |= 8, Nt(t), o;
|
|
664
664
|
} finally {
|
|
665
|
-
|
|
665
|
+
k = n, st();
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
}
|
|
@@ -671,8 +671,8 @@ function Nt(t) {
|
|
|
671
671
|
t.x = void 0, t.s = void 0, Li(t);
|
|
672
672
|
}
|
|
673
673
|
function bn(t) {
|
|
674
|
-
if (
|
|
675
|
-
Bi(this),
|
|
674
|
+
if (k !== this) throw new Error("Out-of-order effect");
|
|
675
|
+
Bi(this), k = t, this.f &= -2, 8 & this.f && Nt(this), st();
|
|
676
676
|
}
|
|
677
677
|
function Ae(t, e) {
|
|
678
678
|
this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = e?.name;
|
|
@@ -690,8 +690,8 @@ Ae.prototype.c = function() {
|
|
|
690
690
|
Ae.prototype.S = function() {
|
|
691
691
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
692
692
|
this.f |= 1, this.f &= -9, Li(this), Mi(this), pe++;
|
|
693
|
-
var t =
|
|
694
|
-
return
|
|
693
|
+
var t = k;
|
|
694
|
+
return k = this, bn.bind(this, t);
|
|
695
695
|
};
|
|
696
696
|
Ae.prototype.N = function() {
|
|
697
697
|
2 & this.f || (this.f |= 2, this.o = ke, ke = this);
|
|
@@ -717,7 +717,7 @@ Ge(function() {
|
|
|
717
717
|
Pi = this.N;
|
|
718
718
|
})();
|
|
719
719
|
function Te(t, e) {
|
|
720
|
-
|
|
720
|
+
D[t] = e.bind(null, D[t] || function() {
|
|
721
721
|
});
|
|
722
722
|
}
|
|
723
723
|
function tt(t) {
|
|
@@ -803,7 +803,7 @@ Te("diffed", function(t, e) {
|
|
|
803
803
|
t(e);
|
|
804
804
|
});
|
|
805
805
|
function Tn(t, e, n, o) {
|
|
806
|
-
var c = e in t && t.ownerSVGElement === void 0, a =
|
|
806
|
+
var c = e in t && t.ownerSVGElement === void 0, a = J(n);
|
|
807
807
|
return { o: function(u, l) {
|
|
808
808
|
a.value = u, o = l;
|
|
809
809
|
}, d: Ge(function() {
|
|
@@ -850,8 +850,8 @@ Oe.prototype.shouldComponentUpdate = function(t, e) {
|
|
|
850
850
|
return !1;
|
|
851
851
|
};
|
|
852
852
|
function Gi(t, e) {
|
|
853
|
-
return
|
|
854
|
-
return
|
|
853
|
+
return Je(function() {
|
|
854
|
+
return J(t, e);
|
|
855
855
|
})[0];
|
|
856
856
|
}
|
|
857
857
|
var Rn = function(t) {
|
|
@@ -865,7 +865,7 @@ function Nn() {
|
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
867
|
function Vi() {
|
|
868
|
-
Fi.push(this) === 1 && (
|
|
868
|
+
Fi.push(this) === 1 && (D.requestAnimationFrame || Rn)(Nn);
|
|
869
869
|
}
|
|
870
870
|
const We = {
|
|
871
871
|
mode: "orb",
|
|
@@ -920,38 +920,38 @@ function On() {
|
|
|
920
920
|
var y = g.length;
|
|
921
921
|
if (y % 4 > 0)
|
|
922
922
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
923
|
-
var
|
|
924
|
-
|
|
925
|
-
var
|
|
926
|
-
return [
|
|
923
|
+
var I = g.indexOf("=");
|
|
924
|
+
I === -1 && (I = y);
|
|
925
|
+
var A = I === y ? 0 : 4 - I % 4;
|
|
926
|
+
return [I, A];
|
|
927
927
|
}
|
|
928
928
|
function l(g) {
|
|
929
|
-
var y = u(g),
|
|
930
|
-
return (
|
|
929
|
+
var y = u(g), I = y[0], A = y[1];
|
|
930
|
+
return (I + A) * 3 / 4 - A;
|
|
931
931
|
}
|
|
932
|
-
function m(g, y,
|
|
933
|
-
return (y +
|
|
932
|
+
function m(g, y, I) {
|
|
933
|
+
return (y + I) * 3 / 4 - I;
|
|
934
934
|
}
|
|
935
935
|
function p(g) {
|
|
936
|
-
var y,
|
|
937
|
-
for (x = 0; x <
|
|
938
|
-
y = e[g.charCodeAt(x)] << 18 | e[g.charCodeAt(x + 1)] << 12 | e[g.charCodeAt(x + 2)] << 6 | e[g.charCodeAt(x + 3)],
|
|
939
|
-
return w === 2 && (y = e[g.charCodeAt(x)] << 2 | e[g.charCodeAt(x + 1)] >> 4,
|
|
936
|
+
var y, I = u(g), A = I[0], w = I[1], b = new n(m(g, A, w)), T = 0, O = w > 0 ? A - 4 : A, x;
|
|
937
|
+
for (x = 0; x < O; x += 4)
|
|
938
|
+
y = e[g.charCodeAt(x)] << 18 | e[g.charCodeAt(x + 1)] << 12 | e[g.charCodeAt(x + 2)] << 6 | e[g.charCodeAt(x + 3)], b[T++] = y >> 16 & 255, b[T++] = y >> 8 & 255, b[T++] = y & 255;
|
|
939
|
+
return w === 2 && (y = e[g.charCodeAt(x)] << 2 | e[g.charCodeAt(x + 1)] >> 4, b[T++] = y & 255), w === 1 && (y = e[g.charCodeAt(x)] << 10 | e[g.charCodeAt(x + 1)] << 4 | e[g.charCodeAt(x + 2)] >> 2, b[T++] = y >> 8 & 255, b[T++] = y & 255), b;
|
|
940
940
|
}
|
|
941
941
|
function _(g) {
|
|
942
942
|
return t[g >> 18 & 63] + t[g >> 12 & 63] + t[g >> 6 & 63] + t[g & 63];
|
|
943
943
|
}
|
|
944
|
-
function d(g, y,
|
|
945
|
-
for (var
|
|
946
|
-
|
|
944
|
+
function d(g, y, I) {
|
|
945
|
+
for (var A, w = [], b = y; b < I; b += 3)
|
|
946
|
+
A = (g[b] << 16 & 16711680) + (g[b + 1] << 8 & 65280) + (g[b + 2] & 255), w.push(_(A));
|
|
947
947
|
return w.join("");
|
|
948
948
|
}
|
|
949
949
|
function S(g) {
|
|
950
|
-
for (var y,
|
|
951
|
-
w.push(d(g,
|
|
952
|
-
return
|
|
950
|
+
for (var y, I = g.length, A = I % 3, w = [], b = 16383, T = 0, O = I - A; T < O; T += b)
|
|
951
|
+
w.push(d(g, T, T + b > O ? O : T + b));
|
|
952
|
+
return A === 1 ? (y = g[I - 1], w.push(
|
|
953
953
|
t[y >> 2] + t[y << 4 & 63] + "=="
|
|
954
|
-
)) :
|
|
954
|
+
)) : A === 2 && (y = (g[I - 2] << 8) + g[I - 1], w.push(
|
|
955
955
|
t[y >> 10] + t[y >> 4 & 63] + t[y << 2 & 63] + "="
|
|
956
956
|
)), w.join("");
|
|
957
957
|
}
|
|
@@ -975,19 +975,19 @@ function kn() {
|
|
|
975
975
|
}
|
|
976
976
|
return (g ? -1 : 1) * u * Math.pow(2, a - o);
|
|
977
977
|
}, qe.write = function(t, e, n, o, c, a) {
|
|
978
|
-
var u, l, m, p = a * 8 - c - 1, _ = (1 << p) - 1, d = _ >> 1, S = c === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = o ? 0 : a - 1, y = o ? 1 : -1,
|
|
978
|
+
var u, l, m, p = a * 8 - c - 1, _ = (1 << p) - 1, d = _ >> 1, S = c === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = o ? 0 : a - 1, y = o ? 1 : -1, I = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
979
979
|
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (l = 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 >= _ ? (l = 0, u = _) : u + d >= 1 ? (l = (e * m - 1) * Math.pow(2, c), u = u + d) : (l = e * Math.pow(2, d - 1) * Math.pow(2, c), u = 0)); c >= 8; t[n + g] = l & 255, g += y, l /= 256, c -= 8)
|
|
980
980
|
;
|
|
981
981
|
for (u = u << c | l, p += c; p > 0; t[n + g] = u & 255, g += y, u /= 256, p -= 8)
|
|
982
982
|
;
|
|
983
|
-
t[n + g - y] |=
|
|
983
|
+
t[n + g - y] |= I * 128;
|
|
984
984
|
}), qe;
|
|
985
985
|
}
|
|
986
986
|
var si;
|
|
987
987
|
function Dn() {
|
|
988
988
|
return si || (si = 1, (function(t) {
|
|
989
989
|
const e = On(), n = kn(), o = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
|
|
990
|
-
t.Buffer = l, t.SlowBuffer =
|
|
990
|
+
t.Buffer = l, t.SlowBuffer = b, t.INSPECT_MAX_BYTES = 50;
|
|
991
991
|
const c = 2147483647;
|
|
992
992
|
t.kMaxLength = c, l.TYPED_ARRAY_SUPPORT = a(), !l.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
993
993
|
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
@@ -1042,7 +1042,7 @@ function Dn() {
|
|
|
1042
1042
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
|
|
1043
1043
|
);
|
|
1044
1044
|
if (ee(s, ArrayBuffer) || s && ee(s.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (ee(s, SharedArrayBuffer) || s && ee(s.buffer, SharedArrayBuffer)))
|
|
1045
|
-
return
|
|
1045
|
+
return I(s, i, r);
|
|
1046
1046
|
if (typeof s == "number")
|
|
1047
1047
|
throw new TypeError(
|
|
1048
1048
|
'The "value" argument must not be of type number. Received type number'
|
|
@@ -1050,7 +1050,7 @@ function Dn() {
|
|
|
1050
1050
|
const h = s.valueOf && s.valueOf();
|
|
1051
1051
|
if (h != null && h !== s)
|
|
1052
1052
|
return l.from(h, i, r);
|
|
1053
|
-
const f =
|
|
1053
|
+
const f = A(s);
|
|
1054
1054
|
if (f) return f;
|
|
1055
1055
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof s[Symbol.toPrimitive] == "function")
|
|
1056
1056
|
return l.from(s[Symbol.toPrimitive]("string"), i, r);
|
|
@@ -1084,7 +1084,7 @@ function Dn() {
|
|
|
1084
1084
|
function S(s, i) {
|
|
1085
1085
|
if ((typeof i != "string" || i === "") && (i = "utf8"), !l.isEncoding(i))
|
|
1086
1086
|
throw new TypeError("Unknown encoding: " + i);
|
|
1087
|
-
const r =
|
|
1087
|
+
const r = T(s, i) | 0;
|
|
1088
1088
|
let h = u(r);
|
|
1089
1089
|
const f = h.write(s, i);
|
|
1090
1090
|
return f !== r && (h = h.slice(0, f)), h;
|
|
@@ -1098,11 +1098,11 @@ function Dn() {
|
|
|
1098
1098
|
function y(s) {
|
|
1099
1099
|
if (ee(s, Uint8Array)) {
|
|
1100
1100
|
const i = new Uint8Array(s);
|
|
1101
|
-
return
|
|
1101
|
+
return I(i.buffer, i.byteOffset, i.byteLength);
|
|
1102
1102
|
}
|
|
1103
1103
|
return g(s);
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function I(s, i, r) {
|
|
1106
1106
|
if (i < 0 || s.byteLength < i)
|
|
1107
1107
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
1108
1108
|
if (s.byteLength < i + (r || 0))
|
|
@@ -1110,7 +1110,7 @@ function Dn() {
|
|
|
1110
1110
|
let h;
|
|
1111
1111
|
return i === void 0 && r === void 0 ? h = new Uint8Array(s) : r === void 0 ? h = new Uint8Array(s, i) : h = new Uint8Array(s, i, r), Object.setPrototypeOf(h, l.prototype), h;
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function A(s) {
|
|
1114
1114
|
if (l.isBuffer(s)) {
|
|
1115
1115
|
const i = w(s.length) | 0, r = u(i);
|
|
1116
1116
|
return r.length === 0 || s.copy(r, 0, 0, i), r;
|
|
@@ -1125,7 +1125,7 @@ function Dn() {
|
|
|
1125
1125
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + c.toString(16) + " bytes");
|
|
1126
1126
|
return s | 0;
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function b(s) {
|
|
1129
1129
|
return +s != s && (s = 0), l.alloc(+s);
|
|
1130
1130
|
}
|
|
1131
1131
|
l.isBuffer = function(i) {
|
|
@@ -1187,7 +1187,7 @@ function Dn() {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
return f;
|
|
1189
1189
|
};
|
|
1190
|
-
function
|
|
1190
|
+
function T(s, i) {
|
|
1191
1191
|
if (l.isBuffer(s))
|
|
1192
1192
|
return s.length;
|
|
1193
1193
|
if (ArrayBuffer.isView(s) || ee(s, ArrayBuffer))
|
|
@@ -1223,8 +1223,8 @@ function Dn() {
|
|
|
1223
1223
|
i = ("" + i).toLowerCase(), f = !0;
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
l.byteLength =
|
|
1227
|
-
function
|
|
1226
|
+
l.byteLength = T;
|
|
1227
|
+
function O(s, i, r) {
|
|
1228
1228
|
let h = !1;
|
|
1229
1229
|
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))
|
|
1230
1230
|
return "";
|
|
@@ -1236,7 +1236,7 @@ function Dn() {
|
|
|
1236
1236
|
case "utf-8":
|
|
1237
1237
|
return Ut(this, i, r);
|
|
1238
1238
|
case "ascii":
|
|
1239
|
-
return
|
|
1239
|
+
return Yi(this, i, r);
|
|
1240
1240
|
case "latin1":
|
|
1241
1241
|
case "binary":
|
|
1242
1242
|
return Ki(this, i, r);
|
|
@@ -1280,7 +1280,7 @@ function Dn() {
|
|
|
1280
1280
|
return this;
|
|
1281
1281
|
}, l.prototype.toString = function() {
|
|
1282
1282
|
const i = this.length;
|
|
1283
|
-
return i === 0 ? "" : arguments.length === 0 ? Ut(this, 0, i) :
|
|
1283
|
+
return i === 0 ? "" : arguments.length === 0 ? Ut(this, 0, i) : O.apply(this, arguments);
|
|
1284
1284
|
}, l.prototype.toLocaleString = l.prototype.toString, l.prototype.equals = function(i) {
|
|
1285
1285
|
if (!l.isBuffer(i)) throw new TypeError("Argument must be a Buffer");
|
|
1286
1286
|
return this === i ? !0 : l.compare(this, i) === 0;
|
|
@@ -1302,14 +1302,14 @@ function Dn() {
|
|
|
1302
1302
|
if (r >= h)
|
|
1303
1303
|
return 1;
|
|
1304
1304
|
if (r >>>= 0, h >>>= 0, f >>>= 0, E >>>= 0, this === i) return 0;
|
|
1305
|
-
let v = E - f,
|
|
1306
|
-
const B = Math.min(v,
|
|
1307
|
-
for (let
|
|
1308
|
-
if (M[
|
|
1309
|
-
v = M[
|
|
1305
|
+
let v = E - f, R = h - r;
|
|
1306
|
+
const B = Math.min(v, R), M = this.slice(f, E), L = i.slice(r, h);
|
|
1307
|
+
for (let U = 0; U < B; ++U)
|
|
1308
|
+
if (M[U] !== L[U]) {
|
|
1309
|
+
v = M[U], R = L[U];
|
|
1310
1310
|
break;
|
|
1311
1311
|
}
|
|
1312
|
-
return v <
|
|
1312
|
+
return v < R ? -1 : R < v ? 1 : 0;
|
|
1313
1313
|
};
|
|
1314
1314
|
function Z(s, i, r, h, f) {
|
|
1315
1315
|
if (s.length === 0) return -1;
|
|
@@ -1326,28 +1326,28 @@ function Dn() {
|
|
|
1326
1326
|
throw new TypeError("val must be string, number or Buffer");
|
|
1327
1327
|
}
|
|
1328
1328
|
function H(s, i, r, h, f) {
|
|
1329
|
-
let E = 1, v = s.length,
|
|
1329
|
+
let E = 1, v = s.length, R = i.length;
|
|
1330
1330
|
if (h !== void 0 && (h = String(h).toLowerCase(), h === "ucs2" || h === "ucs-2" || h === "utf16le" || h === "utf-16le")) {
|
|
1331
1331
|
if (s.length < 2 || i.length < 2)
|
|
1332
1332
|
return -1;
|
|
1333
|
-
E = 2, v /= 2,
|
|
1333
|
+
E = 2, v /= 2, R /= 2, r /= 2;
|
|
1334
1334
|
}
|
|
1335
|
-
function B(L,
|
|
1336
|
-
return E === 1 ? L[
|
|
1335
|
+
function B(L, U) {
|
|
1336
|
+
return E === 1 ? L[U] : L.readUInt16BE(U * E);
|
|
1337
1337
|
}
|
|
1338
1338
|
let M;
|
|
1339
1339
|
if (f) {
|
|
1340
1340
|
let L = -1;
|
|
1341
1341
|
for (M = r; M < v; M++)
|
|
1342
1342
|
if (B(s, M) === B(i, L === -1 ? 0 : M - L)) {
|
|
1343
|
-
if (L === -1 && (L = M), M - L + 1 ===
|
|
1343
|
+
if (L === -1 && (L = M), M - L + 1 === R) return L * E;
|
|
1344
1344
|
} else
|
|
1345
1345
|
L !== -1 && (M -= M - L), L = -1;
|
|
1346
1346
|
} else
|
|
1347
|
-
for (r +
|
|
1347
|
+
for (r + R > v && (r = v - R), M = r; M >= 0; M--) {
|
|
1348
1348
|
let L = !0;
|
|
1349
|
-
for (let
|
|
1350
|
-
if (B(s, M +
|
|
1349
|
+
for (let U = 0; U < R; U++)
|
|
1350
|
+
if (B(s, M + U) !== B(i, U)) {
|
|
1351
1351
|
L = !1;
|
|
1352
1352
|
break;
|
|
1353
1353
|
}
|
|
@@ -1370,9 +1370,9 @@ function Dn() {
|
|
|
1370
1370
|
h > E / 2 && (h = E / 2);
|
|
1371
1371
|
let v;
|
|
1372
1372
|
for (v = 0; v < h; ++v) {
|
|
1373
|
-
const
|
|
1374
|
-
if (ut(
|
|
1375
|
-
s[r + v] =
|
|
1373
|
+
const R = parseInt(i.substr(v * 2, 2), 16);
|
|
1374
|
+
if (ut(R)) return v;
|
|
1375
|
+
s[r + v] = R;
|
|
1376
1376
|
}
|
|
1377
1377
|
return v;
|
|
1378
1378
|
}
|
|
@@ -1441,29 +1441,29 @@ function Dn() {
|
|
|
1441
1441
|
let f = i;
|
|
1442
1442
|
for (; f < r; ) {
|
|
1443
1443
|
const E = s[f];
|
|
1444
|
-
let v = null,
|
|
1445
|
-
if (f +
|
|
1446
|
-
let B, M, L,
|
|
1447
|
-
switch (
|
|
1444
|
+
let v = null, R = E > 239 ? 4 : E > 223 ? 3 : E > 191 ? 2 : 1;
|
|
1445
|
+
if (f + R <= r) {
|
|
1446
|
+
let B, M, L, U;
|
|
1447
|
+
switch (R) {
|
|
1448
1448
|
case 1:
|
|
1449
1449
|
E < 128 && (v = E);
|
|
1450
1450
|
break;
|
|
1451
1451
|
case 2:
|
|
1452
|
-
B = s[f + 1], (B & 192) === 128 && (
|
|
1452
|
+
B = s[f + 1], (B & 192) === 128 && (U = (E & 31) << 6 | B & 63, U > 127 && (v = U));
|
|
1453
1453
|
break;
|
|
1454
1454
|
case 3:
|
|
1455
|
-
B = s[f + 1], M = s[f + 2], (B & 192) === 128 && (M & 192) === 128 && (
|
|
1455
|
+
B = s[f + 1], M = s[f + 2], (B & 192) === 128 && (M & 192) === 128 && (U = (E & 15) << 12 | (B & 63) << 6 | M & 63, U > 2047 && (U < 55296 || U > 57343) && (v = U));
|
|
1456
1456
|
break;
|
|
1457
1457
|
case 4:
|
|
1458
|
-
B = s[f + 1], M = s[f + 2], L = s[f + 3], (B & 192) === 128 && (M & 192) === 128 && (L & 192) === 128 && (
|
|
1458
|
+
B = s[f + 1], M = s[f + 2], L = s[f + 3], (B & 192) === 128 && (M & 192) === 128 && (L & 192) === 128 && (U = (E & 15) << 18 | (B & 63) << 12 | (M & 63) << 6 | L & 63, U > 65535 && U < 1114112 && (v = U));
|
|
1459
1459
|
}
|
|
1460
1460
|
}
|
|
1461
|
-
v === null ? (v = 65533,
|
|
1461
|
+
v === null ? (v = 65533, R = 1) : v > 65535 && (v -= 65536, h.push(v >>> 10 & 1023 | 55296), v = 56320 | v & 1023), h.push(v), f += R;
|
|
1462
1462
|
}
|
|
1463
|
-
return
|
|
1463
|
+
return Ji(h);
|
|
1464
1464
|
}
|
|
1465
1465
|
const Mt = 4096;
|
|
1466
|
-
function
|
|
1466
|
+
function Ji(s) {
|
|
1467
1467
|
const i = s.length;
|
|
1468
1468
|
if (i <= Mt)
|
|
1469
1469
|
return String.fromCharCode.apply(String, s);
|
|
@@ -1475,7 +1475,7 @@ function Dn() {
|
|
|
1475
1475
|
);
|
|
1476
1476
|
return r;
|
|
1477
1477
|
}
|
|
1478
|
-
function
|
|
1478
|
+
function Yi(s, i, r) {
|
|
1479
1479
|
let h = "";
|
|
1480
1480
|
r = Math.min(s.length, r);
|
|
1481
1481
|
for (let f = i; f < r; ++f)
|
|
@@ -1603,8 +1603,8 @@ function Dn() {
|
|
|
1603
1603
|
}
|
|
1604
1604
|
l.prototype.writeUintLE = l.prototype.writeUIntLE = function(i, r, h, f) {
|
|
1605
1605
|
if (i = +i, r = r >>> 0, h = h >>> 0, !f) {
|
|
1606
|
-
const
|
|
1607
|
-
q(this, i, r, h,
|
|
1606
|
+
const R = Math.pow(2, 8 * h) - 1;
|
|
1607
|
+
q(this, i, r, h, R, 0);
|
|
1608
1608
|
}
|
|
1609
1609
|
let E = 1, v = 0;
|
|
1610
1610
|
for (this[r] = i & 255; ++v < h && (E *= 256); )
|
|
@@ -1612,8 +1612,8 @@ function Dn() {
|
|
|
1612
1612
|
return r + h;
|
|
1613
1613
|
}, l.prototype.writeUintBE = l.prototype.writeUIntBE = function(i, r, h, f) {
|
|
1614
1614
|
if (i = +i, r = r >>> 0, h = h >>> 0, !f) {
|
|
1615
|
-
const
|
|
1616
|
-
q(this, i, r, h,
|
|
1615
|
+
const R = Math.pow(2, 8 * h) - 1;
|
|
1616
|
+
q(this, i, r, h, R, 0);
|
|
1617
1617
|
}
|
|
1618
1618
|
let E = h - 1, v = 1;
|
|
1619
1619
|
for (this[r + E] = i & 255; --E >= 0 && (v *= 256); )
|
|
@@ -1653,18 +1653,18 @@ function Dn() {
|
|
|
1653
1653
|
const B = Math.pow(2, 8 * h - 1);
|
|
1654
1654
|
q(this, i, r, h, B - 1, -B);
|
|
1655
1655
|
}
|
|
1656
|
-
let E = 0, v = 1,
|
|
1656
|
+
let E = 0, v = 1, R = 0;
|
|
1657
1657
|
for (this[r] = i & 255; ++E < h && (v *= 256); )
|
|
1658
|
-
i < 0 &&
|
|
1658
|
+
i < 0 && R === 0 && this[r + E - 1] !== 0 && (R = 1), this[r + E] = (i / v >> 0) - R & 255;
|
|
1659
1659
|
return r + h;
|
|
1660
1660
|
}, l.prototype.writeIntBE = function(i, r, h, f) {
|
|
1661
1661
|
if (i = +i, r = r >>> 0, !f) {
|
|
1662
1662
|
const B = Math.pow(2, 8 * h - 1);
|
|
1663
1663
|
q(this, i, r, h, B - 1, -B);
|
|
1664
1664
|
}
|
|
1665
|
-
let E = h - 1, v = 1,
|
|
1665
|
+
let E = h - 1, v = 1, R = 0;
|
|
1666
1666
|
for (this[r + E] = i & 255; --E >= 0 && (v *= 256); )
|
|
1667
|
-
i < 0 &&
|
|
1667
|
+
i < 0 && R === 0 && this[r + E + 1] !== 0 && (R = 1), this[r + E] = (i / v >> 0) - R & 255;
|
|
1668
1668
|
return r + h;
|
|
1669
1669
|
}, l.prototype.writeInt8 = function(i, r, h) {
|
|
1670
1670
|
return i = +i, r = r >>> 0, h || q(this, i, r, 1, 127, -128), i < 0 && (i = 255 + i + 1), this[r] = i & 255, r + 1;
|
|
@@ -1735,11 +1735,11 @@ function Dn() {
|
|
|
1735
1735
|
for (E = r; E < h; ++E)
|
|
1736
1736
|
this[E] = i;
|
|
1737
1737
|
else {
|
|
1738
|
-
const v = l.isBuffer(i) ? i : l.from(i, f),
|
|
1739
|
-
if (
|
|
1738
|
+
const v = l.isBuffer(i) ? i : l.from(i, f), R = v.length;
|
|
1739
|
+
if (R === 0)
|
|
1740
1740
|
throw new TypeError('The value "' + i + '" is invalid for argument "value"');
|
|
1741
1741
|
for (E = 0; E < h - r; ++E)
|
|
1742
|
-
this[E + r] = v[E %
|
|
1742
|
+
this[E + r] = v[E % R];
|
|
1743
1743
|
}
|
|
1744
1744
|
return this;
|
|
1745
1745
|
};
|
|
@@ -1802,8 +1802,8 @@ function Dn() {
|
|
|
1802
1802
|
function Vt(s, i, r, h, f, E) {
|
|
1803
1803
|
if (s > r || s < i) {
|
|
1804
1804
|
const v = typeof i == "bigint" ? "n" : "";
|
|
1805
|
-
let
|
|
1806
|
-
throw i === 0 || i === BigInt(0) ?
|
|
1805
|
+
let R;
|
|
1806
|
+
throw i === 0 || i === BigInt(0) ? R = `>= 0${v} and < 2${v} ** ${(E + 1) * 8}${v}` : R = `>= -(2${v} ** ${(E + 1) * 8 - 1}${v}) and < 2 ** ${(E + 1) * 8 - 1}${v}`, new ve.ERR_OUT_OF_RANGE("value", R, s);
|
|
1807
1807
|
}
|
|
1808
1808
|
Qi(h, f, E);
|
|
1809
1809
|
}
|
|
@@ -2007,13 +2007,13 @@ const Se = (t) => {
|
|
|
2007
2007
|
issues: []
|
|
2008
2008
|
}, l = ((n = a["inbound-rtp"]) === null || n === void 0 ? void 0 : n.filter((d) => d.kind === "video")) || [];
|
|
2009
2009
|
l.length > 0 && (u.personaVideoStream = [], l.forEach((d) => {
|
|
2010
|
-
var S, g, y,
|
|
2010
|
+
var S, g, y, I, A;
|
|
2011
2011
|
const w = {
|
|
2012
2012
|
framesReceived: (S = d.framesReceived) !== null && S !== void 0 ? S : "unknown",
|
|
2013
2013
|
framesDropped: (g = d.framesDropped) !== null && g !== void 0 ? g : "unknown",
|
|
2014
2014
|
framesPerSecond: (y = d.framesPerSecond) !== null && y !== void 0 ? y : "unknown",
|
|
2015
|
-
packetsReceived: (
|
|
2016
|
-
packetsLost: (
|
|
2015
|
+
packetsReceived: (I = d.packetsReceived) !== null && I !== void 0 ? I : "unknown",
|
|
2016
|
+
packetsLost: (A = d.packetsLost) !== null && A !== void 0 ? A : "unknown",
|
|
2017
2017
|
resolution: d.frameWidth && d.frameHeight ? `${d.frameWidth}x${d.frameHeight}` : void 0,
|
|
2018
2018
|
jitter: d.jitter !== void 0 ? d.jitter : void 0
|
|
2019
2019
|
};
|
|
@@ -2022,14 +2022,14 @@ const Se = (t) => {
|
|
|
2022
2022
|
const m = ((o = a["inbound-rtp"]) === null || o === void 0 ? void 0 : o.filter((d) => d.kind === "audio")) || [];
|
|
2023
2023
|
m.length > 0 && (u.personaAudioStream = [], m.forEach((d) => {
|
|
2024
2024
|
var S, g, y;
|
|
2025
|
-
const
|
|
2025
|
+
const I = {
|
|
2026
2026
|
packetsReceived: (S = d.packetsReceived) !== null && S !== void 0 ? S : "unknown",
|
|
2027
2027
|
packetsLost: (g = d.packetsLost) !== null && g !== void 0 ? g : "unknown",
|
|
2028
2028
|
audioLevel: (y = d.audioLevel) !== null && y !== void 0 ? y : "unknown",
|
|
2029
2029
|
jitter: d.jitter !== void 0 ? d.jitter : void 0,
|
|
2030
2030
|
totalAudioEnergy: d.totalAudioEnergy !== void 0 ? d.totalAudioEnergy : void 0
|
|
2031
2031
|
};
|
|
2032
|
-
u.personaAudioStream.push(
|
|
2032
|
+
u.personaAudioStream.push(I);
|
|
2033
2033
|
}));
|
|
2034
2034
|
const p = ((c = a["outbound-rtp"]) === null || c === void 0 ? void 0 : c.filter((d) => d.kind === "audio")) || [];
|
|
2035
2035
|
p.length > 0 && (u.userAudioInput = [], p.forEach((d) => {
|
|
@@ -2215,13 +2215,13 @@ class zn {
|
|
|
2215
2215
|
if (this.heartbeatIntervalSeconds = d || Hn, this.maxWsReconnectionAttempts = S || Wn, !g.baseUrl)
|
|
2216
2216
|
throw new Error("Signalling Client: baseUrl is required");
|
|
2217
2217
|
if (!((u = this.apiGatewayConfig) === null || u === void 0) && u.enabled && (!((l = this.apiGatewayConfig) === null || l === void 0) && l.baseUrl)) {
|
|
2218
|
-
const y = new URL(this.apiGatewayConfig.baseUrl),
|
|
2219
|
-
y.protocol = y.protocol.replace("http", "ws"), y.pathname =
|
|
2220
|
-
const
|
|
2221
|
-
|
|
2218
|
+
const y = new URL(this.apiGatewayConfig.baseUrl), I = (m = this.apiGatewayConfig.wsPath) !== null && m !== void 0 ? m : "/ws";
|
|
2219
|
+
y.protocol = y.protocol.replace("http", "ws"), y.pathname = I, this.url = y;
|
|
2220
|
+
const A = g.protocol || "https", w = A === "http" ? "ws" : "wss", b = `${A}://${g.baseUrl}`, T = (p = g.signallingPath) !== null && p !== void 0 ? p : "/ws", O = new URL(b);
|
|
2221
|
+
O.protocol = w === "ws" ? "ws:" : "wss:", g.port && (O.port = g.port), O.pathname = T, O.searchParams.append("session_id", e), this.url.searchParams.append("target_url", O.href);
|
|
2222
2222
|
} else {
|
|
2223
|
-
const
|
|
2224
|
-
this.url = new URL(
|
|
2223
|
+
const I = `${g.protocol || "https"}://${g.baseUrl}`;
|
|
2224
|
+
this.url = new URL(I), this.url.protocol = g.protocol === "http" ? "ws:" : "wss:", g.port && (this.url.port = g.port), this.url.pathname = (_ = g.signallingPath) !== null && _ !== void 0 ? _ : "/ws", this.url.searchParams.append("session_id", e);
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
2227
|
stop() {
|
|
@@ -2373,7 +2373,7 @@ var li = function(t, e, n, o) {
|
|
|
2373
2373
|
p((o = o.apply(t, e || [])).next());
|
|
2374
2374
|
});
|
|
2375
2375
|
};
|
|
2376
|
-
class
|
|
2376
|
+
class Jn {
|
|
2377
2377
|
constructor(e, n, o) {
|
|
2378
2378
|
if (!e && !n)
|
|
2379
2379
|
throw new Error("Either sessionToken or apiKey must be provided");
|
|
@@ -2466,7 +2466,7 @@ class Yn {
|
|
|
2466
2466
|
return `${this.baseUrl}${this.apiVersion}`;
|
|
2467
2467
|
}
|
|
2468
2468
|
}
|
|
2469
|
-
var
|
|
2469
|
+
var Yn = function(t, e, n, o) {
|
|
2470
2470
|
function c(a) {
|
|
2471
2471
|
return a instanceof n ? a : new n(function(u) {
|
|
2472
2472
|
u(a);
|
|
@@ -2498,7 +2498,7 @@ class Kn {
|
|
|
2498
2498
|
this.baseUrl = e, this.sessionId = n, this.apiGatewayConfig = o;
|
|
2499
2499
|
}
|
|
2500
2500
|
sendTalkCommand(e) {
|
|
2501
|
-
return
|
|
2501
|
+
return Yn(this, void 0, void 0, function* () {
|
|
2502
2502
|
var n, o;
|
|
2503
2503
|
try {
|
|
2504
2504
|
let c, a = {
|
|
@@ -2695,7 +2695,7 @@ class er {
|
|
|
2695
2695
|
return this.state;
|
|
2696
2696
|
}
|
|
2697
2697
|
}
|
|
2698
|
-
var
|
|
2698
|
+
var Y = function(t, e, n, o) {
|
|
2699
2699
|
function c(a) {
|
|
2700
2700
|
return a instanceof n ? a : new n(function(u) {
|
|
2701
2701
|
u(a);
|
|
@@ -2749,7 +2749,7 @@ class rr {
|
|
|
2749
2749
|
});
|
|
2750
2750
|
}
|
|
2751
2751
|
startStatsCollection() {
|
|
2752
|
-
this.statsCollectionInterval || (this.statsCollectionInterval = setInterval(() =>
|
|
2752
|
+
this.statsCollectionInterval || (this.statsCollectionInterval = setInterval(() => Y(this, void 0, void 0, function* () {
|
|
2753
2753
|
if (!(!this.peerConnection || !this.dataChannel || this.dataChannel.readyState !== "open"))
|
|
2754
2754
|
try {
|
|
2755
2755
|
const e = yield this.peerConnection.getStats();
|
|
@@ -2776,7 +2776,7 @@ class rr {
|
|
|
2776
2776
|
const e = setTimeout(() => {
|
|
2777
2777
|
this.successMetricPoller && (console.warn("No video frames received, there is a problem with the connection."), clearInterval(this.successMetricPoller), this.successMetricPoller = null);
|
|
2778
2778
|
}, tr);
|
|
2779
|
-
this.successMetricPoller = setInterval(() =>
|
|
2779
|
+
this.successMetricPoller = setInterval(() => Y(this, void 0, void 0, function* () {
|
|
2780
2780
|
if (!this.peerConnection || this.successMetricFired) {
|
|
2781
2781
|
this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e);
|
|
2782
2782
|
return;
|
|
@@ -2807,7 +2807,7 @@ class rr {
|
|
|
2807
2807
|
return this.peerConnection;
|
|
2808
2808
|
}
|
|
2809
2809
|
changeAudioInputDevice(e) {
|
|
2810
|
-
return
|
|
2810
|
+
return Y(this, void 0, void 0, function* () {
|
|
2811
2811
|
if (!this.peerConnection)
|
|
2812
2812
|
throw new Error("StreamingClient - changeAudioInputDevice: peer connection is not initialized. Start streaming first.");
|
|
2813
2813
|
if (e == null)
|
|
@@ -2863,12 +2863,12 @@ class rr {
|
|
|
2863
2863
|
}
|
|
2864
2864
|
}
|
|
2865
2865
|
stopConnection() {
|
|
2866
|
-
return
|
|
2866
|
+
return Y(this, void 0, void 0, function* () {
|
|
2867
2867
|
yield this.shutdown();
|
|
2868
2868
|
});
|
|
2869
2869
|
}
|
|
2870
2870
|
sendTalkCommand(e) {
|
|
2871
|
-
return
|
|
2871
|
+
return Y(this, void 0, void 0, function* () {
|
|
2872
2872
|
if (!this.peerConnection)
|
|
2873
2873
|
throw new Error("StreamingClient - sendTalkCommand: peer connection is null");
|
|
2874
2874
|
yield this.engineApiRestClient.sendTalkCommand(e);
|
|
@@ -2884,7 +2884,7 @@ class rr {
|
|
|
2884
2884
|
return this.agentAudioInputStream;
|
|
2885
2885
|
}
|
|
2886
2886
|
initPeerConnection() {
|
|
2887
|
-
return
|
|
2887
|
+
return Y(this, void 0, void 0, function* () {
|
|
2888
2888
|
this.peerConnection = new RTCPeerConnection({
|
|
2889
2889
|
iceServers: this.iceServers,
|
|
2890
2890
|
iceCandidatePoolSize: nr
|
|
@@ -2894,7 +2894,7 @@ class rr {
|
|
|
2894
2894
|
});
|
|
2895
2895
|
}
|
|
2896
2896
|
onSignalMessage(e) {
|
|
2897
|
-
return
|
|
2897
|
+
return Y(this, void 0, void 0, function* () {
|
|
2898
2898
|
if (!this.peerConnection) {
|
|
2899
2899
|
console.error("StreamingClient - onSignalMessage: peerConnection is not initialized");
|
|
2900
2900
|
return;
|
|
@@ -2932,7 +2932,7 @@ class rr {
|
|
|
2932
2932
|
});
|
|
2933
2933
|
}
|
|
2934
2934
|
onSignallingClientConnected() {
|
|
2935
|
-
return
|
|
2935
|
+
return Y(this, void 0, void 0, function* () {
|
|
2936
2936
|
if (!this.peerConnection)
|
|
2937
2937
|
try {
|
|
2938
2938
|
yield this.initPeerConnectionAndSendOffer();
|
|
@@ -2986,7 +2986,7 @@ class rr {
|
|
|
2986
2986
|
* Set up the data channels for sending and receiving messages
|
|
2987
2987
|
*/
|
|
2988
2988
|
setupDataChannels() {
|
|
2989
|
-
return
|
|
2989
|
+
return Y(this, void 0, void 0, function* () {
|
|
2990
2990
|
if (!this.peerConnection) {
|
|
2991
2991
|
console.error("StreamingClient - setupDataChannels: peer connection is not initialized");
|
|
2992
2992
|
return;
|
|
@@ -3029,7 +3029,7 @@ class rr {
|
|
|
3029
3029
|
* Request microphone permission asynchronously without blocking connection
|
|
3030
3030
|
*/
|
|
3031
3031
|
requestMicrophonePermissionAsync() {
|
|
3032
|
-
return
|
|
3032
|
+
return Y(this, void 0, void 0, function* () {
|
|
3033
3033
|
if (this.inputAudioState.permissionState !== fe.PENDING) {
|
|
3034
3034
|
this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: fe.PENDING }), this.publicEventEmitter.emit(N.MIC_PERMISSION_PENDING);
|
|
3035
3035
|
try {
|
|
@@ -3053,7 +3053,7 @@ class rr {
|
|
|
3053
3053
|
* Set up audio track and add it to the peer connection using replaceTrack
|
|
3054
3054
|
*/
|
|
3055
3055
|
setupAudioTrack() {
|
|
3056
|
-
return
|
|
3056
|
+
return Y(this, void 0, void 0, function* () {
|
|
3057
3057
|
if (!this.peerConnection || !this.inputAudioStream)
|
|
3058
3058
|
return;
|
|
3059
3059
|
if (!this.inputAudioStream.getAudioTracks().length) {
|
|
@@ -3077,7 +3077,7 @@ class rr {
|
|
|
3077
3077
|
});
|
|
3078
3078
|
}
|
|
3079
3079
|
initPeerConnectionAndSendOffer() {
|
|
3080
|
-
return
|
|
3080
|
+
return Y(this, void 0, void 0, function* () {
|
|
3081
3081
|
if (yield this.initPeerConnection(), !this.peerConnection) {
|
|
3082
3082
|
console.error("StreamingClient - initPeerConnectionAndSendOffer: peer connection is not initialized");
|
|
3083
3083
|
return;
|
|
@@ -3094,7 +3094,7 @@ class rr {
|
|
|
3094
3094
|
});
|
|
3095
3095
|
}
|
|
3096
3096
|
shutdown() {
|
|
3097
|
-
return
|
|
3097
|
+
return Y(this, void 0, void 0, function* () {
|
|
3098
3098
|
var e;
|
|
3099
3099
|
if (this.showPeerConnectionStatsReport) {
|
|
3100
3100
|
const n = yield (e = this.peerConnection) === null || e === void 0 ? void 0 : e.getStats();
|
|
@@ -3205,7 +3205,7 @@ class ar {
|
|
|
3205
3205
|
const p = this.validateClientConfig(e, n, o);
|
|
3206
3206
|
if (p)
|
|
3207
3207
|
throw new $(p, V.CLIENT_ERROR_CODE_CONFIGURATION_ERROR, 400);
|
|
3208
|
-
this.personaConfig = n, this.clientOptions = o, (!((c = o?.api) === null || c === void 0) && c.baseUrl || !((a = o?.api) === null || a === void 0) && a.apiVersion) && Pn(o.api.baseUrl || Hi, o.api.apiVersion || xt), !((l = (u = o?.api) === null || u === void 0 ? void 0 : u.apiGateway) === null || l === void 0) && l.enabled && Fn(o.api.apiGateway), !((m = o?.metrics) === null || m === void 0) && m.disableClientMetrics && $n(!0), this.publicEventEmitter = new Qn(), this.internalEventEmitter = new Xn(), this.apiClient = new
|
|
3208
|
+
this.personaConfig = n, this.clientOptions = o, (!((c = o?.api) === null || c === void 0) && c.baseUrl || !((a = o?.api) === null || a === void 0) && a.apiVersion) && Pn(o.api.baseUrl || Hi, o.api.apiVersion || xt), !((l = (u = o?.api) === null || u === void 0 ? void 0 : u.apiGateway) === null || l === void 0) && l.enabled && Fn(o.api.apiGateway), !((m = o?.metrics) === null || m === void 0) && m.disableClientMetrics && $n(!0), this.publicEventEmitter = new Qn(), this.internalEventEmitter = new Xn(), this.apiClient = new Jn(e, o?.apiKey, o?.api), this.messageHistoryClient = new Zn(this.publicEventEmitter, this.internalEventEmitter), this.reasoningHistoryClient = new sr(this.publicEventEmitter, this.internalEventEmitter);
|
|
3209
3209
|
}
|
|
3210
3210
|
decodeJwt(e) {
|
|
3211
3211
|
try {
|
|
@@ -3256,7 +3256,7 @@ class ar {
|
|
|
3256
3256
|
startSession(e) {
|
|
3257
3257
|
return ue(this, void 0, void 0, function* () {
|
|
3258
3258
|
var n, o, c, a, u, l, m, p, _, d, S, g;
|
|
3259
|
-
const y = this.personaConfig,
|
|
3259
|
+
const y = this.personaConfig, I = this.buildStartSessionOptionsForClient(), A = yield this.apiClient.startSession(y, I), { sessionId: w, clientConfig: b, engineHost: T, engineProtocol: O, signallingEndpoint: x } = A, { heartbeatIntervalSeconds: Z, maxWsReconnectionAttempts: H, iceServers: ae } = b;
|
|
3260
3260
|
this.sessionId = w, Se({
|
|
3261
3261
|
sessionId: this.sessionId
|
|
3262
3262
|
});
|
|
@@ -3264,14 +3264,14 @@ class ar {
|
|
|
3264
3264
|
try {
|
|
3265
3265
|
this.streamingClient = new rr(w, {
|
|
3266
3266
|
engine: {
|
|
3267
|
-
baseUrl: `${
|
|
3267
|
+
baseUrl: `${O}://${T}`
|
|
3268
3268
|
},
|
|
3269
3269
|
signalling: {
|
|
3270
3270
|
heartbeatIntervalSeconds: Z,
|
|
3271
3271
|
maxWsReconnectionAttempts: H,
|
|
3272
3272
|
url: {
|
|
3273
|
-
baseUrl:
|
|
3274
|
-
protocol:
|
|
3273
|
+
baseUrl: T,
|
|
3274
|
+
protocol: O,
|
|
3275
3275
|
signallingPath: x
|
|
3276
3276
|
}
|
|
3277
3277
|
},
|
|
@@ -3486,11 +3486,20 @@ class ar {
|
|
|
3486
3486
|
return this.sessionId;
|
|
3487
3487
|
}
|
|
3488
3488
|
}
|
|
3489
|
-
const lr = (t, e) => new ar(t, void 0, e), cr = "https://api.anam.ai"
|
|
3490
|
-
function ur(t
|
|
3489
|
+
const lr = (t, e) => new ar(t, void 0, e), cr = "https://api.anam.ai";
|
|
3490
|
+
function ur(t) {
|
|
3491
|
+
try {
|
|
3492
|
+
const e = t.split(".")[1];
|
|
3493
|
+
return JSON.parse(atob(e));
|
|
3494
|
+
} catch {
|
|
3495
|
+
return {};
|
|
3496
|
+
}
|
|
3497
|
+
}
|
|
3498
|
+
const X = J(null), te = J("idle"), Le = J(!1), Ke = J(!1), at = J([]), Pe = J(null), nt = J(null), Ot = J(null), kt = J(null), Dt = J(null), ci = J(!1), Fe = J(!1);
|
|
3499
|
+
function dr(t, e) {
|
|
3491
3500
|
return e === 401 || e === 403 ? "This agent is not authorized. Check your agent ID." : e === 404 ? "Agent not found. Check your agent ID." : e === 429 ? "Too many requests. Please wait a moment." : e && e >= 500 ? "Server error. Please try again later." : t instanceof TypeError && t.message === "Failed to fetch" ? "Unable to connect. Check your network connection." : t instanceof Error && t.message.length < 80 ? t.message : "Something went wrong. Please try again.";
|
|
3492
3501
|
}
|
|
3493
|
-
async function
|
|
3502
|
+
async function hr(t, e) {
|
|
3494
3503
|
Fe.value = !1;
|
|
3495
3504
|
try {
|
|
3496
3505
|
const n = await fetch(`${e}/v1/personas/${t}/widget`);
|
|
@@ -3502,7 +3511,7 @@ async function dr(t, e) {
|
|
|
3502
3511
|
Fe.value = !0;
|
|
3503
3512
|
}
|
|
3504
3513
|
}
|
|
3505
|
-
async function
|
|
3514
|
+
async function fr(t, e, n, o) {
|
|
3506
3515
|
if (te.value === "connecting" || te.value === "connected")
|
|
3507
3516
|
return;
|
|
3508
3517
|
te.value = "connecting", Pe.value = null;
|
|
@@ -3550,10 +3559,10 @@ async function hr(t, e, n, o) {
|
|
|
3550
3559
|
m && (n.srcObject = m);
|
|
3551
3560
|
}
|
|
3552
3561
|
} catch (a) {
|
|
3553
|
-
console.error("[AnamWidget] Failed to start session:", a), Pe.value =
|
|
3562
|
+
console.error("[AnamWidget] Failed to start session:", a), Pe.value = dr(a, c), te.value = "error", X.value = null;
|
|
3554
3563
|
}
|
|
3555
3564
|
}
|
|
3556
|
-
async function
|
|
3565
|
+
async function pr() {
|
|
3557
3566
|
if (X.value)
|
|
3558
3567
|
try {
|
|
3559
3568
|
await X.value.stopStreaming();
|
|
@@ -3562,21 +3571,22 @@ async function fr() {
|
|
|
3562
3571
|
}
|
|
3563
3572
|
X.value = null, te.value = "idle", Le.value = !1, at.value = [];
|
|
3564
3573
|
}
|
|
3565
|
-
function
|
|
3574
|
+
function _r(t) {
|
|
3566
3575
|
!X.value || te.value !== "connected" || X.value.sendUserMessage(t);
|
|
3567
3576
|
}
|
|
3568
|
-
function
|
|
3577
|
+
function Er() {
|
|
3569
3578
|
X.value && (Ke.value ? (X.value.unmuteInputAudio(), Ke.value = !1) : (X.value.muteInputAudio(), Ke.value = !0));
|
|
3570
3579
|
}
|
|
3571
|
-
function
|
|
3580
|
+
function mr() {
|
|
3572
3581
|
Fe.value = !0;
|
|
3573
3582
|
}
|
|
3574
|
-
function
|
|
3583
|
+
function gr() {
|
|
3575
3584
|
X.value?.isStreaming() && X.value.stopStreaming(), X.value = null, te.value = "idle", Le.value = !1, at.value = [], Pe.value = null, nt.value = null, Ot.value = null, kt.value = null, Dt.value = null;
|
|
3576
3585
|
}
|
|
3577
|
-
function
|
|
3578
|
-
|
|
3579
|
-
|
|
3586
|
+
function vr(t, e, n) {
|
|
3587
|
+
const o = t || (n ? ur(n).personaId : void 0);
|
|
3588
|
+
ci.value = !!o;
|
|
3589
|
+
const c = e || cr;
|
|
3580
3590
|
return {
|
|
3581
3591
|
connectionStatus: te,
|
|
3582
3592
|
isStreaming: Le,
|
|
@@ -3590,18 +3600,18 @@ function gr(t, e, n) {
|
|
|
3590
3600
|
personaName: kt,
|
|
3591
3601
|
serverConfig: Dt,
|
|
3592
3602
|
fetchWidgetConfig: () => {
|
|
3593
|
-
if (!
|
|
3603
|
+
if (!o) {
|
|
3594
3604
|
Fe.value = !0;
|
|
3595
3605
|
return;
|
|
3596
3606
|
}
|
|
3597
|
-
|
|
3607
|
+
hr(o, c);
|
|
3598
3608
|
},
|
|
3599
|
-
skipFetch:
|
|
3600
|
-
startSession: (
|
|
3601
|
-
stopSession:
|
|
3602
|
-
sendMessage:
|
|
3603
|
-
toggleMute:
|
|
3604
|
-
cleanup:
|
|
3609
|
+
skipFetch: mr,
|
|
3610
|
+
startSession: (l) => !o && !n ? (Pe.value = "No agent ID or session token configured", Promise.resolve()) : fr(o || "", c, l, n),
|
|
3611
|
+
stopSession: pr,
|
|
3612
|
+
sendMessage: _r,
|
|
3613
|
+
toggleMute: Er,
|
|
3614
|
+
cleanup: gr
|
|
3605
3615
|
};
|
|
3606
3616
|
}
|
|
3607
3617
|
const ui = '@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}.fixed{position:fixed}.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-background:#fff;--anam-text:#18181b;--anam-trigger-size:80px;--anam-sheet-width:400px;--anam-sheet-height:640px;all:initial;color:var(--anam-text);-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=fixed]{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:16px;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-mode=expanded][data-layout=inline] .anam-sheet{aspect-ratio:3/2;border-radius:16px;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-cta-pill{-webkit-backdrop-filter:blur(16px);color:#fff;letter-spacing:-.01em;cursor:pointer;white-space:nowrap;background:#00000080;border:1px solid #ffffff1a;border-radius:999px;align-items:center;gap:10px;padding:12px 28px;font-family:inherit;font-size:15px;font-weight:500;transition:all .2s;display:flex;position:absolute;bottom:40px;left:50%;transform:translate(-50%)}.anam-cta-pill:hover{background:#000000a6;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 #ffffff14;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;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);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 #ffffff0f;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-btn-muted{background:#dc26268c;border-color:#dc262633}.anam-ctl-btn-muted:hover{background:#dc2626b3}.anam-ctl-end{background:#dc262699;border-color:#dc262626}.anam-ctl-end:hover{background:#dc2626cc}.anam-ctl-input{-webkit-backdrop-filter:blur(8px);color:#fff;background:#ffffff1a;border:1px solid #ffffff14;border-radius:999px;outline:none;flex:1;min-width:0;padding: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}@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}';
|
|
@@ -3613,26 +3623,26 @@ function wt(t, e) {
|
|
|
3613
3623
|
}
|
|
3614
3624
|
return n;
|
|
3615
3625
|
}
|
|
3616
|
-
const
|
|
3626
|
+
const yr = () => /* @__PURE__ */ C("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2.5", "stroke-linecap": "round", children: /* @__PURE__ */ C("path", { d: "M18 6L6 18M6 6l12 12" }) }), Sr = () => /* @__PURE__ */ C("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ C("path", { d: "M8 5.14v13.72a1 1 0 0 0 1.5.86l11.04-6.86a1 1 0 0 0 0-1.72L9.5 4.28A1 1 0 0 0 8 5.14Z" }) }), wr = () => /* @__PURE__ */ C("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3617
3627
|
/* @__PURE__ */ C("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" }),
|
|
3618
3628
|
/* @__PURE__ */ C("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
3619
3629
|
/* @__PURE__ */ C("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
3620
|
-
] }),
|
|
3630
|
+
] }), Cr = () => /* @__PURE__ */ C("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3621
3631
|
/* @__PURE__ */ C("line", { x1: "1", y1: "1", x2: "23", y2: "23" }),
|
|
3622
3632
|
/* @__PURE__ */ C("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V5a3 3 0 0 0-5.94-.6" }),
|
|
3623
3633
|
/* @__PURE__ */ C("path", { d: "M17 16.95A7 7 0 0 1 5 12v-2m14 0v2c0 .87-.16 1.71-.46 2.49" }),
|
|
3624
3634
|
/* @__PURE__ */ C("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
3625
|
-
] }),
|
|
3635
|
+
] }), Ir = () => /* @__PURE__ */ C("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3626
3636
|
/* @__PURE__ */ C("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
|
|
3627
3637
|
/* @__PURE__ */ C("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
|
|
3628
|
-
] }),
|
|
3638
|
+
] }), br = () => /* @__PURE__ */ C("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3629
3639
|
/* @__PURE__ */ C("path", { d: "M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 2.59 3.4z" }),
|
|
3630
3640
|
/* @__PURE__ */ C("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
3631
3641
|
] }), Ct = () => /* @__PURE__ */ C("svg", { width: "48", height: "48", viewBox: "0 0 48 48", fill: "none", style: { opacity: 0.3 }, children: [
|
|
3632
3642
|
/* @__PURE__ */ C("circle", { cx: "24", cy: "18", r: "8", stroke: "white", "stroke-width": "2", fill: "none" }),
|
|
3633
3643
|
/* @__PURE__ */ C("path", { d: "M8 42c0-8.837 7.163-16 16-16s16 7.163 16 16", stroke: "white", "stroke-width": "2", fill: "none" })
|
|
3634
3644
|
] });
|
|
3635
|
-
function
|
|
3645
|
+
function Ar({
|
|
3636
3646
|
config: t,
|
|
3637
3647
|
session: e,
|
|
3638
3648
|
videoRef: n,
|
|
@@ -3640,9 +3650,9 @@ function br({
|
|
|
3640
3650
|
displayCta: c,
|
|
3641
3651
|
onCollapse: a
|
|
3642
3652
|
}) {
|
|
3643
|
-
const u = Qe(null), [l, m] =
|
|
3653
|
+
const u = Qe(null), [l, m] = Je(""), [p, _] = Je(null), [d, S] = Je(!1), g = Qe(null), y = e.connectionStatus.value === "connected", I = e.connectionStatus.value === "connecting", A = e.connectionStatus.value === "error", w = e.isStreaming.value, b = !I && !y && !A, T = He(async () => {
|
|
3644
3654
|
n.current && await e.startSession(n.current);
|
|
3645
|
-
}, []),
|
|
3655
|
+
}, []), O = He(async () => {
|
|
3646
3656
|
await e.stopSession();
|
|
3647
3657
|
}, []), x = He(() => {
|
|
3648
3658
|
if (!l.trim()) return;
|
|
@@ -3668,12 +3678,12 @@ function br({
|
|
|
3668
3678
|
"data-hidden": w ? void 0 : "true"
|
|
3669
3679
|
}
|
|
3670
3680
|
),
|
|
3671
|
-
|
|
3681
|
+
b && (e.hasAgentId.value ? (
|
|
3672
3682
|
/* Has agent-id: show avatar or placeholder + CTA pill */
|
|
3673
3683
|
/* @__PURE__ */ C("div", { class: "anam-overlay-idle", children: [
|
|
3674
3684
|
o ? /* @__PURE__ */ C("img", { src: o, alt: "Avatar" }) : /* @__PURE__ */ C(Ct, {}),
|
|
3675
|
-
/* @__PURE__ */ C("button", { class: "anam-cta-pill", onClick:
|
|
3676
|
-
/* @__PURE__ */ C(
|
|
3685
|
+
/* @__PURE__ */ C("button", { class: "anam-cta-pill", onClick: T, children: [
|
|
3686
|
+
/* @__PURE__ */ C(Sr, {}),
|
|
3677
3687
|
c
|
|
3678
3688
|
] })
|
|
3679
3689
|
] })
|
|
@@ -3684,16 +3694,16 @@ function br({
|
|
|
3684
3694
|
/* @__PURE__ */ C("span", { children: "Agent not configured" })
|
|
3685
3695
|
] })
|
|
3686
3696
|
)),
|
|
3687
|
-
|
|
3697
|
+
I && /* @__PURE__ */ C("div", { class: "anam-overlay-loading", children: [
|
|
3688
3698
|
/* @__PURE__ */ C("span", { class: "anam-spinner" }),
|
|
3689
3699
|
/* @__PURE__ */ C("span", { children: "Starting your conversation..." })
|
|
3690
3700
|
] }),
|
|
3691
|
-
|
|
3701
|
+
A && /* @__PURE__ */ C("div", { class: "anam-overlay-error", children: [
|
|
3692
3702
|
/* @__PURE__ */ C("div", { class: "anam-overlay-error-text", children: e.error.value || "Something went wrong" }),
|
|
3693
|
-
/* @__PURE__ */ C("button", { class: "anam-retry-btn", onClick:
|
|
3703
|
+
/* @__PURE__ */ C("button", { class: "anam-retry-btn", onClick: T, children: "Try Again" })
|
|
3694
3704
|
] }),
|
|
3695
3705
|
(y || w) && /* @__PURE__ */ C(oe, { children: [
|
|
3696
|
-
a && /* @__PURE__ */ C("button", { class: "anam-close-btn", onClick: a, "aria-label": "Close", children: /* @__PURE__ */ C(
|
|
3706
|
+
a && /* @__PURE__ */ C("button", { class: "anam-close-btn", onClick: a, "aria-label": "Close", children: /* @__PURE__ */ C(yr, {}) }),
|
|
3697
3707
|
p && /* @__PURE__ */ C("div", { class: `anam-toast ${d ? "anam-toast-out" : ""}`, children: p }),
|
|
3698
3708
|
/* @__PURE__ */ C("div", { class: "anam-control-bar", children: [
|
|
3699
3709
|
t.showMuteButton && /* @__PURE__ */ C(
|
|
@@ -3702,7 +3712,7 @@ function br({
|
|
|
3702
3712
|
class: `anam-ctl-btn ${e.isMuted.value ? "anam-ctl-btn-muted" : ""}`,
|
|
3703
3713
|
onClick: () => e.toggleMute(),
|
|
3704
3714
|
"aria-label": e.isMuted.value ? "Unmute" : "Mute",
|
|
3705
|
-
children: e.isMuted.value ? /* @__PURE__ */ C(
|
|
3715
|
+
children: e.isMuted.value ? /* @__PURE__ */ C(Cr, {}) : /* @__PURE__ */ C(wr, {})
|
|
3706
3716
|
}
|
|
3707
3717
|
),
|
|
3708
3718
|
t.showTextInput && /* @__PURE__ */ C(oe, { children: [
|
|
@@ -3726,7 +3736,7 @@ function br({
|
|
|
3726
3736
|
onClick: x,
|
|
3727
3737
|
disabled: !y || !l.trim(),
|
|
3728
3738
|
"aria-label": "Send message",
|
|
3729
|
-
children: /* @__PURE__ */ C(
|
|
3739
|
+
children: /* @__PURE__ */ C(Ir, {})
|
|
3730
3740
|
}
|
|
3731
3741
|
)
|
|
3732
3742
|
] }),
|
|
@@ -3734,85 +3744,87 @@ function br({
|
|
|
3734
3744
|
"button",
|
|
3735
3745
|
{
|
|
3736
3746
|
class: "anam-ctl-btn anam-ctl-end",
|
|
3737
|
-
onClick:
|
|
3747
|
+
onClick: O,
|
|
3738
3748
|
"aria-label": "End call",
|
|
3739
|
-
children: /* @__PURE__ */ C(
|
|
3749
|
+
children: /* @__PURE__ */ C(br, {})
|
|
3740
3750
|
}
|
|
3741
3751
|
)
|
|
3742
3752
|
] })
|
|
3743
3753
|
] })
|
|
3744
3754
|
] });
|
|
3745
3755
|
}
|
|
3746
|
-
function
|
|
3747
|
-
const e = Qe(null), n = Gi(!1)
|
|
3756
|
+
function Tr(t) {
|
|
3757
|
+
const e = Qe(null), n = Gi(!1);
|
|
3758
|
+
t["agent-id"] && t["session-token"] && console.warn("[AnamWidget] Both agent-id and session-token are set. Use one or the other. Ignoring agent-id.");
|
|
3759
|
+
const o = t["session-token"] ? void 0 : t["agent-id"], c = vr(o, t["api-base-url"], t["session-token"]), a = Ie(() => {
|
|
3748
3760
|
if (t["override-config"])
|
|
3749
3761
|
try {
|
|
3750
|
-
const
|
|
3751
|
-
return
|
|
3752
|
-
} catch (
|
|
3753
|
-
console.warn("[AnamWidget] Invalid override-config JSON:",
|
|
3754
|
-
}
|
|
3755
|
-
const
|
|
3756
|
-
return
|
|
3757
|
-
}, [t["override-config"],
|
|
3762
|
+
const T = JSON.parse(t["override-config"]), O = wt({ ...We }, T);
|
|
3763
|
+
return O.mode === "orb" && (O.layout = "fixed"), O;
|
|
3764
|
+
} catch (T) {
|
|
3765
|
+
console.warn("[AnamWidget] Invalid override-config JSON:", T);
|
|
3766
|
+
}
|
|
3767
|
+
const w = c.serverConfig.value, b = w ? wt({ ...We }, w) : { ...We };
|
|
3768
|
+
return b.mode === "orb" && (b.layout = "fixed"), b;
|
|
3769
|
+
}, [t["override-config"], c.serverConfig.value]);
|
|
3758
3770
|
gt(() => {
|
|
3759
3771
|
if (t["override-config"]) {
|
|
3760
3772
|
try {
|
|
3761
|
-
const
|
|
3762
|
-
|
|
3773
|
+
const w = JSON.parse(t["override-config"]);
|
|
3774
|
+
w.avatarImageUrl && (c.avatarThumbnailUrl.value = w.avatarImageUrl), w.personaName && (c.personaName.value = w.personaName);
|
|
3763
3775
|
} catch {
|
|
3764
3776
|
}
|
|
3765
|
-
|
|
3777
|
+
c.skipFetch();
|
|
3766
3778
|
return;
|
|
3767
3779
|
}
|
|
3768
|
-
|
|
3769
|
-
}, [
|
|
3770
|
-
const
|
|
3771
|
-
() => `--anam-background: ${
|
|
3772
|
-
[
|
|
3773
|
-
),
|
|
3774
|
-
if (
|
|
3775
|
-
const
|
|
3776
|
-
return Object.entries(
|
|
3777
|
-
}, [
|
|
3778
|
-
n.value = !0,
|
|
3779
|
-
e.current &&
|
|
3780
|
+
c.fetchWidgetConfig();
|
|
3781
|
+
}, [o, t["api-base-url"], t["override-config"], t["session-token"]]);
|
|
3782
|
+
const u = c.avatarThumbnailUrl.value || null, l = a.textContents.callToAction === We.textContents.callToAction && c.personaName.value ? `Talk to ${c.personaName.value}` : a.textContents.callToAction, m = Ie(
|
|
3783
|
+
() => `--anam-background: ${a.styles.backgroundColor}; --anam-text: ${a.styles.textColor};`,
|
|
3784
|
+
[a.styles.backgroundColor, a.styles.textColor]
|
|
3785
|
+
), p = Ie(() => {
|
|
3786
|
+
if (a.layout !== "fixed") return "";
|
|
3787
|
+
const w = xn(a.position);
|
|
3788
|
+
return Object.entries(w).map(([b, T]) => `${b}: ${T}`).join("; ");
|
|
3789
|
+
}, [a.layout, a.position]), _ = [m, p].filter(Boolean).join("; "), d = Qe(!1), S = () => {
|
|
3790
|
+
n.value = !0, d.current = !1, setTimeout(() => {
|
|
3791
|
+
e.current && c.startSession(e.current);
|
|
3780
3792
|
}, 50);
|
|
3781
|
-
},
|
|
3782
|
-
|
|
3783
|
-
},
|
|
3784
|
-
(
|
|
3785
|
-
|
|
3786
|
-
}, [
|
|
3787
|
-
const A =
|
|
3788
|
-
return
|
|
3793
|
+
}, g = async () => {
|
|
3794
|
+
c.connectionStatus.value !== "idle" && await c.stopSession(), d.current = !1, n.value = !1;
|
|
3795
|
+
}, y = a.mode === "orb", I = c.connectionStatus.value;
|
|
3796
|
+
(I === "connecting" || I === "connected") && (d.current = !0), gt(() => {
|
|
3797
|
+
y && n.value && I === "idle" && d.current && (d.current = !1, n.value = !1);
|
|
3798
|
+
}, [I]);
|
|
3799
|
+
const A = y ? n.value : !0;
|
|
3800
|
+
return c.isReady.value ? /* @__PURE__ */ C(oe, { children: [
|
|
3789
3801
|
/* @__PURE__ */ C("style", { children: ui }),
|
|
3790
3802
|
/* @__PURE__ */ C(
|
|
3791
3803
|
"div",
|
|
3792
3804
|
{
|
|
3793
3805
|
class: "anam-widget",
|
|
3794
|
-
"data-mode":
|
|
3795
|
-
"data-layout":
|
|
3796
|
-
style:
|
|
3806
|
+
"data-mode": a.mode,
|
|
3807
|
+
"data-layout": a.layout,
|
|
3808
|
+
style: _,
|
|
3797
3809
|
children: [
|
|
3798
|
-
|
|
3810
|
+
y && !n.value && /* @__PURE__ */ C(
|
|
3799
3811
|
"button",
|
|
3800
3812
|
{
|
|
3801
3813
|
class: "anam-trigger",
|
|
3802
|
-
onClick:
|
|
3803
|
-
"aria-label":
|
|
3804
|
-
children:
|
|
3814
|
+
onClick: S,
|
|
3815
|
+
"aria-label": l,
|
|
3816
|
+
children: u ? /* @__PURE__ */ C("img", { src: u, alt: "Avatar" }) : /* @__PURE__ */ C(Ct, {})
|
|
3805
3817
|
}
|
|
3806
3818
|
),
|
|
3807
3819
|
A && /* @__PURE__ */ C(
|
|
3808
|
-
|
|
3820
|
+
Ar,
|
|
3809
3821
|
{
|
|
3810
|
-
config:
|
|
3811
|
-
session:
|
|
3822
|
+
config: a,
|
|
3823
|
+
session: c,
|
|
3812
3824
|
videoRef: e,
|
|
3813
|
-
avatarSrc:
|
|
3814
|
-
displayCta:
|
|
3815
|
-
onCollapse:
|
|
3825
|
+
avatarSrc: u,
|
|
3826
|
+
displayCta: l,
|
|
3827
|
+
onCollapse: y ? g : null
|
|
3816
3828
|
}
|
|
3817
3829
|
)
|
|
3818
3830
|
]
|
|
@@ -3820,7 +3832,7 @@ function Ar(t) {
|
|
|
3820
3832
|
)
|
|
3821
3833
|
] }) : /* @__PURE__ */ C("style", { children: ui });
|
|
3822
3834
|
}
|
|
3823
|
-
const
|
|
3835
|
+
const Rr = [
|
|
3824
3836
|
"agent-id",
|
|
3825
3837
|
// Persona ID — required for session streaming + server config fetch
|
|
3826
3838
|
"api-base-url",
|
|
@@ -3829,7 +3841,7 @@ const Tr = [
|
|
|
3829
3841
|
// JSON string — bypasses server fetch when set
|
|
3830
3842
|
"session-token"
|
|
3831
3843
|
// Pre-created session token — skips /v1/auth/widget call when set
|
|
3832
|
-
],
|
|
3844
|
+
], xr = {
|
|
3833
3845
|
SESSION_STARTED: "anam-agent:session-started",
|
|
3834
3846
|
SESSION_ENDED: "anam-agent:session-ended",
|
|
3835
3847
|
MESSAGE_RECEIVED: "anam-agent:message-received",
|
|
@@ -3841,13 +3853,13 @@ const Tr = [
|
|
|
3841
3853
|
MIC_UNMUTED: "anam-agent:mic-unmuted"
|
|
3842
3854
|
};
|
|
3843
3855
|
function di(t = "anam-agent") {
|
|
3844
|
-
pn(
|
|
3856
|
+
pn(Tr, t, [...Rr], {
|
|
3845
3857
|
shadow: !0
|
|
3846
3858
|
});
|
|
3847
3859
|
}
|
|
3848
3860
|
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => di()) : di());
|
|
3849
3861
|
export {
|
|
3850
3862
|
We as DefaultConfig,
|
|
3851
|
-
|
|
3863
|
+
xr as WidgetEventNames,
|
|
3852
3864
|
di as registerWidget
|
|
3853
3865
|
};
|