@anam-ai/agent-widget 0.1.0-alpha.1 → 0.1.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 +413 -462
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $e, k, hi, fi, Ee, Ht, pi, _i, Ei, At, mt, gt, Me = {}, 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;
|
|
@@ -9,10 +9,10 @@ function Tt(t) {
|
|
|
9
9
|
function Ce(t, e, n) {
|
|
10
10
|
var o, c, a, u = {};
|
|
11
11
|
for (a in e) a == "key" ? o = e[a] : a == "ref" ? c = e[a] : u[a] = e[a];
|
|
12
|
-
if (arguments.length > 2 && (u.children = arguments.length > 3 ?
|
|
13
|
-
return
|
|
12
|
+
if (arguments.length > 2 && (u.children = arguments.length > 3 ? $e.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (a in t.defaultProps) u[a] === void 0 && (u[a] = t.defaultProps[a]);
|
|
13
|
+
return xe(t, u, o, c, null);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
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
17
|
return c == null && k.vnode != null && k.vnode(a), a;
|
|
18
18
|
}
|
|
@@ -45,13 +45,13 @@ function Xe() {
|
|
|
45
45
|
Xe.__r = 0;
|
|
46
46
|
}
|
|
47
47
|
function vi(t, e, n, o, c, a, u, l, g, p, _) {
|
|
48
|
-
var d, S, m, y, A, w, I
|
|
49
|
-
for (g =
|
|
50
|
-
return n.__e =
|
|
48
|
+
var d, S, m, y, b, A, w, I = o && o.__k || mi, R = e.length;
|
|
49
|
+
for (g = ln(n, e, I, g, R), d = 0; d < R; d++) (m = n.__k[d]) != null && (S = m.__i == -1 ? Me : I[m.__i] || Me, m.__i = d, A = Rt(t, m, S, c, a, u, l, g, p, _), y = m.__e, m.ref && S.ref != m.ref && (S.ref && Nt(S.ref, null, m), _.push(m.ref, m.__c || y, m)), b == null && y != null && (b = y), (w = !!(4 & m.__u)) || S.__k === m.__k ? g = yi(m, g, t, w) : typeof m.type == "function" && A !== void 0 ? g = A : y && (g = y.nextSibling), m.__u &= -7);
|
|
50
|
+
return n.__e = b, g;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function ln(t, e, n, o, c) {
|
|
53
53
|
var a, u, l, g, p, _ = n.length, d = _, S = 0;
|
|
54
|
-
for (t.__k = new Array(c), a = 0; a < c; a++) (u = e[a]) != null && typeof u != "boolean" && typeof u != "function" ? (typeof u == "string" || typeof u == "number" || typeof u == "bigint" || u.constructor == String ? u = t.__k[a] =
|
|
54
|
+
for (t.__k = new Array(c), a = 0; a < c; a++) (u = e[a]) != null && typeof u != "boolean" && typeof u != "function" ? (typeof u == "string" || typeof u == "number" || typeof u == "bigint" || u.constructor == String ? u = t.__k[a] = xe(null, u, null, null, null) : rt(u) ? u = t.__k[a] = xe(oe, { children: u }, null, null, null) : u.constructor === void 0 && u.__b > 0 ? u = t.__k[a] = xe(u.type, u.props, u.key, u.ref ? u.ref : null, u.__v) : t.__k[a] = u, g = a + S, u.__ = t, u.__b = t.__b + 1, l = null, (p = u.__i = cn(u, n, g, d)) != -1 && (d--, (l = n[p]) && (l.__u |= 2)), l == null || l.__v == null ? (p == -1 && (c > _ ? S-- : c < _ && S++), typeof u.type != "function" && (u.__u |= 4)) : p != g && (p == g - 1 ? S-- : p == g + 1 ? S++ : (p > g ? S-- : S++, u.__u |= 4))) : t.__k[a] = null;
|
|
55
55
|
if (d) for (a = 0; a < _; a++) (l = n[a]) != null && (2 & l.__u) == 0 && (l.__e == o && (o = be(l)), Ci(l, l));
|
|
56
56
|
return o;
|
|
57
57
|
}
|
|
@@ -67,7 +67,7 @@ function yi(t, e, n, o) {
|
|
|
67
67
|
while (e != null && e.nodeType == 8);
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function cn(t, e, n, o) {
|
|
71
71
|
var c, a, u, l = t.key, g = t.type, p = e[n], _ = p != null && (2 & p.__u) == 0;
|
|
72
72
|
if (p === null && l == null || _ && l == p.key && g == p.type) return n;
|
|
73
73
|
if (o > (_ ? 1 : 0)) {
|
|
@@ -76,16 +76,16 @@ function un(t, e, n, o) {
|
|
|
76
76
|
return -1;
|
|
77
77
|
}
|
|
78
78
|
function zt(t, e, n) {
|
|
79
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
79
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || an.test(e) ? n : n + "px";
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function je(t, e, n, o, c) {
|
|
82
82
|
var a, 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 || zt(t.style, e, "");
|
|
86
86
|
if (n) for (e in n) o && n[e] == o[e] || zt(t.style, e, n[e]);
|
|
87
87
|
}
|
|
88
|
-
else if (e[0] == "o" && e[1] == "n") a = e != (e = e.replace(Ei, "$1")), u = e.toLowerCase(), e = u in t || e == "onFocusOut" || e == "onFocusIn" ? u.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + a] = n, n ? o ? n.u = o.u : (n.u = At, t.addEventListener(e, a ?
|
|
88
|
+
else if (e[0] == "o" && e[1] == "n") a = e != (e = e.replace(Ei, "$1")), u = e.toLowerCase(), e = u in t || e == "onFocusOut" || e == "onFocusIn" ? u.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + a] = n, n ? o ? n.u = o.u : (n.u = At, t.addEventListener(e, a ? gt : mt, a)) : t.removeEventListener(e, a ? gt : mt, a);
|
|
89
89
|
else {
|
|
90
90
|
if (c == "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 {
|
|
@@ -107,49 +107,49 @@ function qt(t) {
|
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
function Rt(t, e, n, o, c, a, u, l, g, p) {
|
|
110
|
-
var _, d, S, m, y, A, w, I,
|
|
110
|
+
var _, d, S, m, y, b, A, w, I, R, M, x, Z, H, ae, ne, re, Q = e.type;
|
|
111
111
|
if (e.constructor !== void 0) return null;
|
|
112
112
|
128 & n.__u && (g = !!(32 & n.__u), a = [l = e.__e = n.__e]), (_ = k.__b) && _(e);
|
|
113
113
|
e: if (typeof Q == "function") try {
|
|
114
|
-
if (
|
|
114
|
+
if (w = e.props, I = "prototype" in Q && Q.prototype.render, R = (_ = Q.contextType) && o[_.__c], M = _ ? R ? R.props.value : _.__ : o, n.__c ? A = (d = e.__c = n.__c).__ = d.__E : (I ? e.__c = d = new Q(w, M) : (e.__c = d = new Oe(w, M), d.constructor = Q, d.render = dn), R && R.sub(d), d.state || (d.state = {}), d.__n = o, S = d.__d = !0, d.__h = [], d._sb = []), I && d.__s == null && (d.__s = d.state), I && Q.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ie({}, d.__s)), ie(d.__s, Q.getDerivedStateFromProps(w, d.__s))), m = d.props, y = d.state, d.__v = e, S) I && Q.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), I && d.componentDidMount != null && d.__h.push(d.componentDidMount);
|
|
115
115
|
else {
|
|
116
|
-
if (
|
|
117
|
-
for (e.__v != n.__v && (d.props =
|
|
116
|
+
if (I && Q.getDerivedStateFromProps == null && w !== m && d.componentWillReceiveProps != null && d.componentWillReceiveProps(w, M), e.__v == n.__v || !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(w, d.__s, M) === !1) {
|
|
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(
|
|
124
|
-
d.componentDidUpdate(m, y,
|
|
123
|
+
d.componentWillUpdate != null && d.componentWillUpdate(w, d.__s, M), I && d.componentDidUpdate != null && d.__h.push(function() {
|
|
124
|
+
d.componentDidUpdate(m, y, b);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
if (d.context = M, d.props =
|
|
127
|
+
if (d.context = M, d.props = w, d.__P = t, d.__e = !1, Z = k.__r, H = 0, I) {
|
|
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())), I && !S && d.getSnapshotBeforeUpdate != null && (b = d.getSnapshotBeforeUpdate(m, 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, g, 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, g || a != null) if (le.then) {
|
|
136
136
|
for (e.__u |= g ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
137
137
|
a[a.indexOf(l)] = null, e.__e = l;
|
|
138
138
|
} else {
|
|
139
139
|
for (re = a.length; re--; ) Tt(a[re]);
|
|
140
|
-
|
|
140
|
+
vt(e);
|
|
141
141
|
}
|
|
142
|
-
else e.__e = n.__e, e.__k = n.__k, le.then ||
|
|
142
|
+
else e.__e = n.__e, e.__k = n.__k, le.then || vt(e);
|
|
143
143
|
k.__e(le, e, n);
|
|
144
144
|
}
|
|
145
|
-
else a == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e =
|
|
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, g, p);
|
|
146
146
|
return (_ = k.diffed) && _(e), 128 & e.__u ? void 0 : l;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(
|
|
148
|
+
function vt(t) {
|
|
149
|
+
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(vt);
|
|
150
150
|
}
|
|
151
151
|
function Si(t, e, n) {
|
|
152
|
-
for (var o = 0; o < n.length; o++)
|
|
152
|
+
for (var o = 0; o < n.length; o++) Nt(n[o], n[++o], n[++o]);
|
|
153
153
|
k.__c && k.__c(e, t), t.some(function(c) {
|
|
154
154
|
try {
|
|
155
155
|
t = c.__h, c.__h = [], t.some(function(a) {
|
|
@@ -161,38 +161,38 @@ function Si(t, e, n) {
|
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
function wi(t) {
|
|
164
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t :
|
|
164
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : rt(t) ? t.map(wi) : ie({}, t);
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
var p, _, d, S, m, y,
|
|
168
|
-
if (
|
|
169
|
-
for (p = 0; p < a.length; p++) if ((m = a[p]) && "setAttribute" in m == !!
|
|
166
|
+
function un(t, e, n, o, c, a, u, l, g) {
|
|
167
|
+
var p, _, d, S, m, y, b, A = n.props || Me, w = e.props, I = e.type;
|
|
168
|
+
if (I == "svg" ? c = "http://www.w3.org/2000/svg" : I == "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 ((m = a[p]) && "setAttribute" in m == !!I && (I ? m.localName == I : m.nodeType == 3)) {
|
|
170
170
|
t = m, a[p] = null;
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
if (t == null) {
|
|
175
|
-
if (
|
|
176
|
-
t = document.createElementNS(c,
|
|
175
|
+
if (I == null) return document.createTextNode(w);
|
|
176
|
+
t = document.createElementNS(c, I, w.is && w), l && (k.__m && k.__m(e, a), l = !1), a = null;
|
|
177
177
|
}
|
|
178
|
-
if (
|
|
178
|
+
if (I == null) A === w || l && t.data == w || (t.data = w);
|
|
179
179
|
else {
|
|
180
|
-
if (a = a &&
|
|
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[(m = t.attributes[p]).name] = m.value;
|
|
181
|
+
for (p in A) if (m = A[p], p != "children") {
|
|
182
182
|
if (p == "dangerouslySetInnerHTML") d = m;
|
|
183
|
-
else if (!(p in
|
|
184
|
-
if (p == "value" && "defaultValue" in
|
|
185
|
-
|
|
183
|
+
else if (!(p in w)) {
|
|
184
|
+
if (p == "value" && "defaultValue" in w || p == "checked" && "defaultChecked" in w) continue;
|
|
185
|
+
je(t, p, null, m, c);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
for (p in
|
|
188
|
+
for (p in w) m = w[p], p == "children" ? S = m : p == "dangerouslySetInnerHTML" ? _ = m : p == "value" ? y = m : p == "checked" ? b = m : l && typeof m != "function" || A[p] === m || je(t, p, m, 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,
|
|
191
|
-
l || (p = "value",
|
|
190
|
+
else if (d && (t.innerHTML = ""), vi(e.type == "template" ? t.content : t, rt(S) ? S : [S], e, n, o, I == "foreignObject" ? "http://www.w3.org/1999/xhtml" : c, a, u, a ? a[0] : n.__k && be(n, 0), l, g), a != null) for (p = a.length; p--; ) Tt(a[p]);
|
|
191
|
+
l || (p = "value", I == "progress" && y == null ? t.removeAttribute("value") : y != null && (y !== t[p] || I == "progress" && !y || I == "option" && y != A[p]) && je(t, p, y, A[p], c), p = "checked", b != null && b != t[p] && je(t, p, b, A[p], c));
|
|
192
192
|
}
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function Nt(t, e, n) {
|
|
196
196
|
try {
|
|
197
197
|
if (typeof t == "function") {
|
|
198
198
|
var o = typeof t.__u == "function";
|
|
@@ -204,7 +204,7 @@ function xt(t, e, n) {
|
|
|
204
204
|
}
|
|
205
205
|
function Ci(t, e, n) {
|
|
206
206
|
var o, c;
|
|
207
|
-
if (k.unmount && k.unmount(t), (o = t.ref) && (o.current && o.current != t.__e ||
|
|
207
|
+
if (k.unmount && k.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || Nt(o, null, e)), (o = t.__c) != null) {
|
|
208
208
|
if (o.componentWillUnmount) try {
|
|
209
209
|
o.componentWillUnmount();
|
|
210
210
|
} catch (a) {
|
|
@@ -215,22 +215,22 @@ function Ci(t, e, n) {
|
|
|
215
215
|
if (o = t.__k) for (c = 0; c < o.length; c++) o[c] && Ci(o[c], e, n || typeof t.type != "function");
|
|
216
216
|
n || Tt(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function dn(t, e, n) {
|
|
219
219
|
return this.constructor(t, n);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function ot(t, e, n) {
|
|
222
222
|
var o, c, a, u;
|
|
223
|
-
e == document && (e = document.documentElement), k.__ && k.__(t, e), c = (o = typeof n == "function") ? null : n && n.__k || e.__k, a = [], u = [], Rt(e, t = (!o && n || e).__k = Ce(oe, null, [t]), c || Me, Me, e.namespaceURI, !o && n ? [n] : c ? null : e.firstChild ?
|
|
223
|
+
e == document && (e = document.documentElement), k.__ && k.__(t, e), c = (o = typeof n == "function") ? null : n && n.__k || e.__k, a = [], u = [], Rt(e, t = (!o && n || e).__k = Ce(oe, null, [t]), c || Me, Me, 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);
|
|
227
227
|
}
|
|
228
228
|
function bi(t, e, n) {
|
|
229
229
|
var o, c, a, u, l = ie({}, t.props);
|
|
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
|
-
return arguments.length > 2 && (l.children = arguments.length > 3 ?
|
|
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
|
-
|
|
233
|
+
$e = mi.slice, k = { __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) {
|
|
@@ -246,7 +246,7 @@ Fe = mi.slice, k = { __e: function(t, e, n, o) {
|
|
|
246
246
|
this.__v && (this.__e = !0, t && this.__h.push(t), Wt(this));
|
|
247
247
|
}, Oe.prototype.render = oe, Ee = [], pi = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, _i = function(t, e) {
|
|
248
248
|
return t.__v.__b - e.__v.__b;
|
|
249
|
-
}, Xe.__r = 0, Ei = /(PointerCapture)$|Capture$/i, At = 0,
|
|
249
|
+
}, Xe.__r = 0, Ei = /(PointerCapture)$|Capture$/i, At = 0, mt = qt(!1), gt = qt(!0);
|
|
250
250
|
function Ze() {
|
|
251
251
|
return Ze = Object.assign ? Object.assign.bind() : function(t) {
|
|
252
252
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -262,15 +262,15 @@ function Ai(t, e) {
|
|
|
262
262
|
for (o = 0; o < a.length; o++) e.indexOf(n = a[o]) >= 0 || (c[n] = t[n]);
|
|
263
263
|
return c;
|
|
264
264
|
}
|
|
265
|
-
var
|
|
266
|
-
function
|
|
265
|
+
var hn = ["context", "children"], fn = ["useFragment"];
|
|
266
|
+
function pn(t, e, n, o) {
|
|
267
267
|
function c() {
|
|
268
268
|
var a, u = Reflect.construct(HTMLElement, [], c);
|
|
269
269
|
return u._vdomComponent = t, o && o.shadow ? (u._root = u.attachShadow({ mode: o.mode || "open", serializable: (a = o.serializable) != null && a }), o.adoptedStyleSheets && (u._root.adoptedStyleSheets = o.adoptedStyleSheets)) : u._root = u, u;
|
|
270
270
|
}
|
|
271
271
|
return (c.prototype = Object.create(HTMLElement.prototype)).constructor = c, c.prototype.connectedCallback = function() {
|
|
272
|
-
|
|
273
|
-
}, c.prototype.attributeChangedCallback =
|
|
272
|
+
En.call(this, o);
|
|
273
|
+
}, c.prototype.attributeChangedCallback = mn, c.prototype.disconnectedCallback = gn, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), c.observedAttributes = n, t.formAssociated && (c.formAssociated = !0), n.forEach(function(a) {
|
|
274
274
|
Object.defineProperty(c.prototype, a, { get: function() {
|
|
275
275
|
return this._vdom ? this._vdom.props[a] : this._props[a];
|
|
276
276
|
}, set: function(u) {
|
|
@@ -280,33 +280,33 @@ function _n(t, e, n, o) {
|
|
|
280
280
|
} });
|
|
281
281
|
}), customElements.define(e || t.tagName || t.displayName || t.name, c), c;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function _n(t) {
|
|
284
284
|
this.getChildContext = function() {
|
|
285
285
|
return t.context;
|
|
286
286
|
};
|
|
287
|
-
var e = t.children, n = Ai(t,
|
|
287
|
+
var e = t.children, n = Ai(t, hn);
|
|
288
288
|
return bi(e, n);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function En(t) {
|
|
291
291
|
var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
|
|
292
|
-
this.dispatchEvent(e), this._vdom = Ce(
|
|
292
|
+
this.dispatchEvent(e), this._vdom = Ce(_n, Ze({}, this._props, { context: e.detail.context }), Ri(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? Ii : ot)(this._vdom, this._root);
|
|
293
293
|
}
|
|
294
294
|
function Ti(t) {
|
|
295
295
|
return t.replace(/-(\w)/g, function(e, n) {
|
|
296
296
|
return n ? n.toUpperCase() : "";
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function mn(t, e, n) {
|
|
300
300
|
if (this._vdom) {
|
|
301
301
|
var o = {};
|
|
302
|
-
o[t] = n = n ?? void 0, o[Ti(t)] = n, this._vdom = bi(this._vdom, o),
|
|
302
|
+
o[t] = n = n ?? void 0, o[Ti(t)] = n, this._vdom = bi(this._vdom, o), ot(this._vdom, this._root);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
|
|
305
|
+
function gn() {
|
|
306
|
+
ot(this._vdom = null, this._root);
|
|
307
307
|
}
|
|
308
308
|
function Yt(t, e) {
|
|
309
|
-
var n = this, o = t.useFragment, c = Ai(t,
|
|
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) {
|
|
312
312
|
u.stopPropagation(), u.detail.context = e;
|
|
@@ -325,26 +325,26 @@ function Ri(t, e, n) {
|
|
|
325
325
|
var _ = !(!n || !n.shadow), d = e ? Ce(Yt, { useFragment: !_ }, o) : o;
|
|
326
326
|
return !_ && e && (t.innerHTML = ""), Ce(e || t.nodeName.toLowerCase(), c, d);
|
|
327
327
|
}
|
|
328
|
-
var
|
|
328
|
+
var vn = 0;
|
|
329
329
|
function C(t, e, n, o, c, a) {
|
|
330
330
|
e || (e = {});
|
|
331
331
|
var u, l, g = e;
|
|
332
332
|
if ("ref" in g) for (l in g = {}, e) l == "ref" ? u = e[l] : g[l] = e[l];
|
|
333
|
-
var p = { type: t, props: g, key: n, ref: u, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --
|
|
333
|
+
var p = { type: t, props: g, 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) g[l] === void 0 && (g[l] = u[l]);
|
|
335
335
|
return k.vnode && k.vnode(p), p;
|
|
336
336
|
}
|
|
337
|
-
var Ue, P,
|
|
338
|
-
function
|
|
337
|
+
var Ue, P, ft, Kt, Be = 0, Ni = [], F = k, Jt = F.__b, Xt = F.__r, Zt = F.diffed, Qt = F.__c, ei = F.unmount, ti = F.__;
|
|
338
|
+
function xt(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
343
|
function Ye(t) {
|
|
344
|
-
return Be = 1,
|
|
344
|
+
return Be = 1, yn(Oi, t);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
var o =
|
|
346
|
+
function yn(t, e, n) {
|
|
347
|
+
var o = xt(Ue++, 2);
|
|
348
348
|
if (o.t = t, !o.__c && (o.__ = [Oi(void 0, e), function(l) {
|
|
349
349
|
var g = o.__N ? o.__N[0] : o.__[0], p = o.t(g, l);
|
|
350
350
|
g !== p && (o.__N = [p, o.__[1]], o.__c.setState({}));
|
|
@@ -377,9 +377,9 @@ function Sn(t, e, n) {
|
|
|
377
377
|
}
|
|
378
378
|
return o.__N || o.__;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
var n =
|
|
382
|
-
!F.__s &&
|
|
380
|
+
function yt(t, e) {
|
|
381
|
+
var n = xt(Ue++, 3);
|
|
382
|
+
!F.__s && xi(n.__H, e) && (n.__ = t, n.u = e, P.__H.__h.push(n));
|
|
383
383
|
}
|
|
384
384
|
function Qe(t) {
|
|
385
385
|
return Be = 5, Ie(function() {
|
|
@@ -387,17 +387,17 @@ function Qe(t) {
|
|
|
387
387
|
}, []);
|
|
388
388
|
}
|
|
389
389
|
function Ie(t, e) {
|
|
390
|
-
var n =
|
|
391
|
-
return
|
|
390
|
+
var n = xt(Ue++, 7);
|
|
391
|
+
return xi(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function He(t, e) {
|
|
394
394
|
return Be = 8, Ie(function() {
|
|
395
395
|
return t;
|
|
396
396
|
}, e);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
for (var t; t =
|
|
400
|
-
t.__H.__h.forEach(Ke), t.__H.__h.forEach(
|
|
398
|
+
function Sn() {
|
|
399
|
+
for (var t; t = Ni.shift(); ) if (t.__P && t.__H) try {
|
|
400
|
+
t.__H.__h.forEach(Ke), t.__H.__h.forEach(St), t.__H.__h = [];
|
|
401
401
|
} catch (e) {
|
|
402
402
|
t.__H.__h = [], F.__e(e, t.__v);
|
|
403
403
|
}
|
|
@@ -409,20 +409,20 @@ F.__b = function(t) {
|
|
|
409
409
|
}, F.__r = function(t) {
|
|
410
410
|
Xt && Xt(t), Ue = 0;
|
|
411
411
|
var e = (P = t.__c).__H;
|
|
412
|
-
e && (
|
|
412
|
+
e && (ft === 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(Ke), e.__h.forEach(
|
|
414
|
+
})) : (e.__h.forEach(Ke), e.__h.forEach(St), e.__h = [], Ue = 0)), ft = 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 && (
|
|
418
|
+
e && e.__H && (e.__H.__h.length && (Ni.push(e) !== 1 && Kt === F.requestAnimationFrame || ((Kt = F.requestAnimationFrame) || wn)(Sn)), e.__H.__.forEach(function(n) {
|
|
419
419
|
n.u && (n.__H = n.u), n.u = void 0;
|
|
420
|
-
})),
|
|
420
|
+
})), ft = P = null;
|
|
421
421
|
}, F.__c = function(t, e) {
|
|
422
422
|
e.some(function(n) {
|
|
423
423
|
try {
|
|
424
424
|
n.__h.forEach(Ke), n.__h = n.__h.filter(function(o) {
|
|
425
|
-
return !o.__ ||
|
|
425
|
+
return !o.__ || St(o);
|
|
426
426
|
});
|
|
427
427
|
} catch (o) {
|
|
428
428
|
e.some(function(c) {
|
|
@@ -442,7 +442,7 @@ F.__b = function(t) {
|
|
|
442
442
|
}), n.__H = void 0, e && F.__e(e, n.__v));
|
|
443
443
|
};
|
|
444
444
|
var ii = typeof requestAnimationFrame == "function";
|
|
445
|
-
function
|
|
445
|
+
function wn(t) {
|
|
446
446
|
var e, n = function() {
|
|
447
447
|
clearTimeout(o), ii && cancelAnimationFrame(e), setTimeout(t);
|
|
448
448
|
}, o = setTimeout(n, 35);
|
|
@@ -452,11 +452,11 @@ function Ke(t) {
|
|
|
452
452
|
var e = P, n = t.__c;
|
|
453
453
|
typeof n == "function" && (t.__c = void 0, n()), P = e;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function St(t) {
|
|
456
456
|
var e = P;
|
|
457
457
|
t.__c = t.__(), P = e;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function xi(t, e) {
|
|
460
460
|
return !t || t.length !== e.length || e.some(function(n, o) {
|
|
461
461
|
return n !== t[o];
|
|
462
462
|
});
|
|
@@ -464,14 +464,14 @@ function Ni(t, e) {
|
|
|
464
464
|
function Oi(t, e) {
|
|
465
465
|
return typeof e == "function" ? e(t) : e;
|
|
466
466
|
}
|
|
467
|
-
var
|
|
468
|
-
function
|
|
467
|
+
var Cn = /* @__PURE__ */ Symbol.for("preact-signals");
|
|
468
|
+
function st() {
|
|
469
469
|
if (pe > 1)
|
|
470
470
|
pe--;
|
|
471
471
|
else {
|
|
472
472
|
for (var t, e = !1; ke !== void 0; ) {
|
|
473
473
|
var n = ke;
|
|
474
|
-
for (ke = void 0,
|
|
474
|
+
for (ke = void 0, wt++; n !== void 0; ) {
|
|
475
475
|
var o = n.o;
|
|
476
476
|
if (n.o = void 0, n.f &= -3, !(8 & n.f) && Mi(n)) try {
|
|
477
477
|
n.c();
|
|
@@ -481,16 +481,16 @@ function at() {
|
|
|
481
481
|
n = o;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
if (
|
|
484
|
+
if (wt = 0, pe--, e) throw t;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function In(t) {
|
|
488
488
|
if (pe > 0) return t();
|
|
489
489
|
pe++;
|
|
490
490
|
try {
|
|
491
491
|
return t();
|
|
492
492
|
} finally {
|
|
493
|
-
|
|
493
|
+
st();
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
var O = void 0;
|
|
@@ -503,7 +503,7 @@ function ki(t) {
|
|
|
503
503
|
O = e;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
var ke = void 0, pe = 0,
|
|
506
|
+
var ke = void 0, pe = 0, wt = 0, et = 0;
|
|
507
507
|
function Di(t) {
|
|
508
508
|
if (O !== void 0) {
|
|
509
509
|
var e = t.n;
|
|
@@ -516,7 +516,7 @@ function Di(t) {
|
|
|
516
516
|
function j(t, e) {
|
|
517
517
|
this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
|
|
518
518
|
}
|
|
519
|
-
j.prototype.brand =
|
|
519
|
+
j.prototype.brand = Cn;
|
|
520
520
|
j.prototype.h = function() {
|
|
521
521
|
return !0;
|
|
522
522
|
};
|
|
@@ -539,7 +539,7 @@ j.prototype.U = function(t) {
|
|
|
539
539
|
};
|
|
540
540
|
j.prototype.subscribe = function(t) {
|
|
541
541
|
var e = this;
|
|
542
|
-
return
|
|
542
|
+
return Ge(function() {
|
|
543
543
|
var n = e.value, o = O;
|
|
544
544
|
O = void 0;
|
|
545
545
|
try {
|
|
@@ -572,12 +572,12 @@ Object.defineProperty(j.prototype, "value", { get: function() {
|
|
|
572
572
|
return t !== void 0 && (t.i = this.i), this.v;
|
|
573
573
|
}, set: function(t) {
|
|
574
574
|
if (t !== this.v) {
|
|
575
|
-
if (
|
|
575
|
+
if (wt > 100) throw new Error("Cycle detected");
|
|
576
576
|
this.v = t, this.i++, et++, pe++;
|
|
577
577
|
try {
|
|
578
578
|
for (var e = this.t; e !== void 0; e = e.x) e.t.N();
|
|
579
579
|
} finally {
|
|
580
|
-
|
|
580
|
+
st();
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
} });
|
|
@@ -662,7 +662,7 @@ function Li(t) {
|
|
|
662
662
|
} catch (o) {
|
|
663
663
|
throw t.f &= -2, t.f |= 8, Ot(t), o;
|
|
664
664
|
} finally {
|
|
665
|
-
O = n,
|
|
665
|
+
O = n, st();
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
}
|
|
@@ -670,9 +670,9 @@ function Ot(t) {
|
|
|
670
670
|
for (var e = t.s; e !== void 0; e = e.n) e.S.U(e);
|
|
671
671
|
t.x = void 0, t.s = void 0, Li(t);
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function bn(t) {
|
|
674
674
|
if (O !== this) throw new Error("Out-of-order effect");
|
|
675
|
-
Bi(this), O = t, this.f &= -2, 8 & this.f && Ot(this),
|
|
675
|
+
Bi(this), O = t, this.f &= -2, 8 & this.f && Ot(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;
|
|
@@ -691,7 +691,7 @@ 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), Ui(this), pe++;
|
|
693
693
|
var t = O;
|
|
694
|
-
return O = this,
|
|
694
|
+
return O = 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);
|
|
@@ -702,7 +702,7 @@ Ae.prototype.d = function() {
|
|
|
702
702
|
Ae.prototype.dispose = function() {
|
|
703
703
|
this.d();
|
|
704
704
|
};
|
|
705
|
-
function
|
|
705
|
+
function Ge(t, e) {
|
|
706
706
|
var n = new Ae(t, e);
|
|
707
707
|
try {
|
|
708
708
|
n.c();
|
|
@@ -712,8 +712,8 @@ function $e(t, e) {
|
|
|
712
712
|
var o = n.d.bind(n);
|
|
713
713
|
return o[Symbol.dispose] = o, o;
|
|
714
714
|
}
|
|
715
|
-
var Pi,
|
|
716
|
-
|
|
715
|
+
var Pi, pt, An = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Fi = [];
|
|
716
|
+
Ge(function() {
|
|
717
717
|
Pi = this.N;
|
|
718
718
|
})();
|
|
719
719
|
function Te(t, e) {
|
|
@@ -721,7 +721,7 @@ function Te(t, e) {
|
|
|
721
721
|
});
|
|
722
722
|
}
|
|
723
723
|
function tt(t) {
|
|
724
|
-
|
|
724
|
+
pt && pt(), pt = t && t.S();
|
|
725
725
|
}
|
|
726
726
|
function $i(t) {
|
|
727
727
|
var e = this, n = t.data, o = Gi(n);
|
|
@@ -736,7 +736,7 @@ function $i(t) {
|
|
|
736
736
|
return m === 0 ? 0 : m === !0 ? "" : m || "";
|
|
737
737
|
}), _ = ni(function() {
|
|
738
738
|
return !Array.isArray(p.value) && !fi(p.value);
|
|
739
|
-
}), d =
|
|
739
|
+
}), d = Ge(function() {
|
|
740
740
|
if (this.N = Vi, _.value) {
|
|
741
741
|
var m = p.value;
|
|
742
742
|
l.__v && l.__v.__e && l.__v.__e.nodeType === 3 && (l.__v.__e.data = m);
|
|
@@ -768,12 +768,12 @@ Te("__r", function(t, e) {
|
|
|
768
768
|
var n, o = e.__c;
|
|
769
769
|
o && (o.__$f &= -2, (n = o.__$u) === void 0 && (o.__$u = n = (function(c, a) {
|
|
770
770
|
var u;
|
|
771
|
-
return
|
|
771
|
+
return Ge(function() {
|
|
772
772
|
u = this;
|
|
773
773
|
}, { name: a }), u.c = c, u;
|
|
774
774
|
})(function() {
|
|
775
775
|
var c;
|
|
776
|
-
|
|
776
|
+
An && ((c = n.y) == null || c.call(n)), o.__$f |= 1, o.setState({});
|
|
777
777
|
}, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), tt(n);
|
|
778
778
|
}
|
|
779
779
|
t(e);
|
|
@@ -796,17 +796,17 @@ Te("diffed", function(t, e) {
|
|
|
796
796
|
a = {}, n.U = a;
|
|
797
797
|
for (var g in o) {
|
|
798
798
|
var p = a[g], _ = o[g];
|
|
799
|
-
p === void 0 ? (p =
|
|
799
|
+
p === void 0 ? (p = Tn(n, g, _, c), a[g] = p) : p.o(_, c);
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
t(e);
|
|
804
804
|
});
|
|
805
|
-
function
|
|
805
|
+
function Tn(t, e, n, o) {
|
|
806
806
|
var c = e in t && t.ownerSVGElement === void 0, a = Y(n);
|
|
807
807
|
return { o: function(u, l) {
|
|
808
808
|
a.value = u, o = l;
|
|
809
|
-
}, d:
|
|
809
|
+
}, d: Ge(function() {
|
|
810
810
|
this.N = Vi;
|
|
811
811
|
var u = a.value.value;
|
|
812
812
|
o[e] !== u && (o[e] = u, c ? t[e] = u : u != null && (u !== !1 || e[4] === "-") ? t.setAttribute(e, u) : t.removeAttribute(e));
|
|
@@ -854,20 +854,20 @@ function Gi(t, e) {
|
|
|
854
854
|
return Y(t, e);
|
|
855
855
|
})[0];
|
|
856
856
|
}
|
|
857
|
-
var
|
|
857
|
+
var Rn = function(t) {
|
|
858
858
|
queueMicrotask(function() {
|
|
859
859
|
queueMicrotask(t);
|
|
860
860
|
});
|
|
861
861
|
};
|
|
862
862
|
function Nn() {
|
|
863
|
-
|
|
863
|
+
In(function() {
|
|
864
864
|
for (var t; t = Fi.shift(); ) Pi.call(t);
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
867
|
function Vi() {
|
|
868
|
-
Fi.push(this) === 1 && (k.requestAnimationFrame ||
|
|
868
|
+
Fi.push(this) === 1 && (k.requestAnimationFrame || Rn)(Nn);
|
|
869
869
|
}
|
|
870
|
-
const
|
|
870
|
+
const We = {
|
|
871
871
|
mode: "orb",
|
|
872
872
|
layout: "fixed",
|
|
873
873
|
position: "bottom-right",
|
|
@@ -889,17 +889,17 @@ const He = {
|
|
|
889
889
|
sendMessage: "Send",
|
|
890
890
|
placeholder: "Type a message..."
|
|
891
891
|
}
|
|
892
|
-
},
|
|
892
|
+
}, ze = {
|
|
893
893
|
"bottom-right": { bottom: "24px", right: "24px" },
|
|
894
894
|
"bottom-left": { bottom: "24px", left: "24px" },
|
|
895
895
|
"top-right": { top: "24px", right: "24px" },
|
|
896
896
|
"top-left": { top: "24px", left: "24px" }
|
|
897
897
|
};
|
|
898
|
-
function
|
|
899
|
-
if (
|
|
900
|
-
return
|
|
898
|
+
function xn(t) {
|
|
899
|
+
if (ze[t])
|
|
900
|
+
return ze[t];
|
|
901
901
|
const e = t.match(/^\[(.+)\]$/);
|
|
902
|
-
if (!e) return
|
|
902
|
+
if (!e) return ze["bottom-right"];
|
|
903
903
|
const n = {};
|
|
904
904
|
for (const o of e[1].split(",")) {
|
|
905
905
|
const c = o.trim(), a = c.lastIndexOf("-");
|
|
@@ -907,56 +907,12 @@ function On(t) {
|
|
|
907
907
|
const u = c.slice(0, a), l = c.slice(a + 1);
|
|
908
908
|
n[u] = /^\d+$/.test(l) ? `${l}px` : l;
|
|
909
909
|
}
|
|
910
|
-
return Object.keys(n).length > 0 ? n :
|
|
911
|
-
}
|
|
912
|
-
const kn = [
|
|
913
|
-
// Authentication
|
|
914
|
-
"agent-id",
|
|
915
|
-
"api-base-url",
|
|
916
|
-
// Default: https://api.anam.ai
|
|
917
|
-
// Layout
|
|
918
|
-
"mode",
|
|
919
|
-
// 'orb' | 'expanded'
|
|
920
|
-
"layout",
|
|
921
|
-
// 'inline' | 'fixed'
|
|
922
|
-
"position",
|
|
923
|
-
// 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | '[top-20,right-0]'
|
|
924
|
-
// Backward compat (mapped to mode/layout)
|
|
925
|
-
"variant",
|
|
926
|
-
// deprecated → maps to mode
|
|
927
|
-
"placement",
|
|
928
|
-
// deprecated → maps to position
|
|
929
|
-
// Theming
|
|
930
|
-
"background-color",
|
|
931
|
-
"text-color",
|
|
932
|
-
// Features
|
|
933
|
-
"show-transcript",
|
|
934
|
-
// 'true' | 'false'
|
|
935
|
-
"show-text-input",
|
|
936
|
-
// 'true' | 'false'
|
|
937
|
-
"show-mute-button",
|
|
938
|
-
// 'true' | 'false'
|
|
939
|
-
"interaction-mode",
|
|
940
|
-
// 'voice' | 'text' | 'both'
|
|
941
|
-
"start-expanded",
|
|
942
|
-
// 'true' | 'false'
|
|
943
|
-
// Text customization
|
|
944
|
-
"text-call-to-action",
|
|
945
|
-
"text-connecting",
|
|
946
|
-
"text-listening",
|
|
947
|
-
"text-speaking",
|
|
948
|
-
"text-end-call",
|
|
949
|
-
// Advanced
|
|
950
|
-
"override-config"
|
|
951
|
-
// JSON string for full config override
|
|
952
|
-
];
|
|
953
|
-
function ze(t) {
|
|
954
|
-
return t === void 0 ? !1 : t === "true" || t === "";
|
|
910
|
+
return Object.keys(n).length > 0 ? n : ze["bottom-right"];
|
|
955
911
|
}
|
|
956
|
-
var
|
|
957
|
-
function
|
|
958
|
-
if (ri) return
|
|
959
|
-
ri = 1,
|
|
912
|
+
var _t = {}, Ne = {}, ri;
|
|
913
|
+
function On() {
|
|
914
|
+
if (ri) return Ne;
|
|
915
|
+
ri = 1, Ne.byteLength = l, Ne.toByteArray = p, Ne.fromByteArray = S;
|
|
960
916
|
for (var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = 0, a = o.length; c < a; ++c)
|
|
961
917
|
t[c] = o[c], e[o.charCodeAt(c)] = c;
|
|
962
918
|
e[45] = 62, e[95] = 63;
|
|
@@ -964,46 +920,46 @@ function Dn() {
|
|
|
964
920
|
var y = m.length;
|
|
965
921
|
if (y % 4 > 0)
|
|
966
922
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
967
|
-
var
|
|
968
|
-
|
|
969
|
-
var
|
|
970
|
-
return [
|
|
923
|
+
var b = m.indexOf("=");
|
|
924
|
+
b === -1 && (b = y);
|
|
925
|
+
var A = b === y ? 0 : 4 - b % 4;
|
|
926
|
+
return [b, A];
|
|
971
927
|
}
|
|
972
928
|
function l(m) {
|
|
973
|
-
var y = u(m),
|
|
974
|
-
return (
|
|
929
|
+
var y = u(m), b = y[0], A = y[1];
|
|
930
|
+
return (b + A) * 3 / 4 - A;
|
|
975
931
|
}
|
|
976
|
-
function g(m, y,
|
|
977
|
-
return (y +
|
|
932
|
+
function g(m, y, b) {
|
|
933
|
+
return (y + b) * 3 / 4 - b;
|
|
978
934
|
}
|
|
979
935
|
function p(m) {
|
|
980
|
-
var y,
|
|
981
|
-
for (
|
|
982
|
-
y = e[m.charCodeAt(
|
|
983
|
-
return
|
|
936
|
+
var y, b = u(m), A = b[0], w = b[1], I = new n(g(m, A, w)), R = 0, M = w > 0 ? A - 4 : A, x;
|
|
937
|
+
for (x = 0; x < M; x += 4)
|
|
938
|
+
y = e[m.charCodeAt(x)] << 18 | e[m.charCodeAt(x + 1)] << 12 | e[m.charCodeAt(x + 2)] << 6 | e[m.charCodeAt(x + 3)], I[R++] = y >> 16 & 255, I[R++] = y >> 8 & 255, I[R++] = y & 255;
|
|
939
|
+
return w === 2 && (y = e[m.charCodeAt(x)] << 2 | e[m.charCodeAt(x + 1)] >> 4, I[R++] = y & 255), w === 1 && (y = e[m.charCodeAt(x)] << 10 | e[m.charCodeAt(x + 1)] << 4 | e[m.charCodeAt(x + 2)] >> 2, I[R++] = y >> 8 & 255, I[R++] = y & 255), I;
|
|
984
940
|
}
|
|
985
941
|
function _(m) {
|
|
986
942
|
return t[m >> 18 & 63] + t[m >> 12 & 63] + t[m >> 6 & 63] + t[m & 63];
|
|
987
943
|
}
|
|
988
|
-
function d(m, y,
|
|
989
|
-
for (var
|
|
990
|
-
|
|
991
|
-
return
|
|
944
|
+
function d(m, y, b) {
|
|
945
|
+
for (var A, w = [], I = y; I < b; I += 3)
|
|
946
|
+
A = (m[I] << 16 & 16711680) + (m[I + 1] << 8 & 65280) + (m[I + 2] & 255), w.push(_(A));
|
|
947
|
+
return w.join("");
|
|
992
948
|
}
|
|
993
949
|
function S(m) {
|
|
994
|
-
for (var y,
|
|
995
|
-
|
|
996
|
-
return
|
|
950
|
+
for (var y, b = m.length, A = b % 3, w = [], I = 16383, R = 0, M = b - A; R < M; R += I)
|
|
951
|
+
w.push(d(m, R, R + I > M ? M : R + I));
|
|
952
|
+
return A === 1 ? (y = m[b - 1], w.push(
|
|
997
953
|
t[y >> 2] + t[y << 4 & 63] + "=="
|
|
998
|
-
)) :
|
|
954
|
+
)) : A === 2 && (y = (m[b - 2] << 8) + m[b - 1], w.push(
|
|
999
955
|
t[y >> 10] + t[y >> 4 & 63] + t[y << 2 & 63] + "="
|
|
1000
|
-
)),
|
|
956
|
+
)), w.join("");
|
|
1001
957
|
}
|
|
1002
|
-
return
|
|
958
|
+
return Ne;
|
|
1003
959
|
}
|
|
1004
960
|
var qe = {};
|
|
1005
961
|
var oi;
|
|
1006
|
-
function
|
|
962
|
+
function kn() {
|
|
1007
963
|
return oi || (oi = 1, qe.read = function(t, e, n, o, c) {
|
|
1008
964
|
var a, u, l = c * 8 - o - 1, g = (1 << l) - 1, p = g >> 1, _ = -7, d = n ? c - 1 : 0, S = n ? -1 : 1, m = t[e + d];
|
|
1009
965
|
for (d += S, a = m & (1 << -_) - 1, m >>= -_, _ += l; _ > 0; a = a * 256 + t[e + d], d += S, _ -= 8)
|
|
@@ -1019,19 +975,19 @@ function Mn() {
|
|
|
1019
975
|
}
|
|
1020
976
|
return (m ? -1 : 1) * u * Math.pow(2, a - o);
|
|
1021
977
|
}, qe.write = function(t, e, n, o, c, a) {
|
|
1022
|
-
var u, l, g, p = a * 8 - c - 1, _ = (1 << p) - 1, d = _ >> 1, S = c === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = o ? 0 : a - 1, y = o ? 1 : -1,
|
|
978
|
+
var u, l, g, p = a * 8 - c - 1, _ = (1 << p) - 1, d = _ >> 1, S = c === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = o ? 0 : a - 1, y = o ? 1 : -1, b = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
1023
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 * (g = Math.pow(2, -u)) < 1 && (u--, g *= 2), u + d >= 1 ? e += S / g : e += S * Math.pow(2, 1 - d), e * g >= 2 && (u++, g /= 2), u + d >= _ ? (l = 0, u = _) : u + d >= 1 ? (l = (e * g - 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 + m] = l & 255, m += y, l /= 256, c -= 8)
|
|
1024
980
|
;
|
|
1025
981
|
for (u = u << c | l, p += c; p > 0; t[n + m] = u & 255, m += y, u /= 256, p -= 8)
|
|
1026
982
|
;
|
|
1027
|
-
t[n + m - y] |=
|
|
983
|
+
t[n + m - y] |= b * 128;
|
|
1028
984
|
}), qe;
|
|
1029
985
|
}
|
|
1030
986
|
var si;
|
|
1031
|
-
function
|
|
987
|
+
function Dn() {
|
|
1032
988
|
return si || (si = 1, (function(t) {
|
|
1033
|
-
const e =
|
|
1034
|
-
t.Buffer = l, t.SlowBuffer =
|
|
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 = I, t.INSPECT_MAX_BYTES = 50;
|
|
1035
991
|
const c = 2147483647;
|
|
1036
992
|
t.kMaxLength = c, l.TYPED_ARRAY_SUPPORT = a(), !l.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
1037
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."
|
|
@@ -1086,7 +1042,7 @@ function Un() {
|
|
|
1086
1042
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
|
|
1087
1043
|
);
|
|
1088
1044
|
if (ee(s, ArrayBuffer) || s && ee(s.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (ee(s, SharedArrayBuffer) || s && ee(s.buffer, SharedArrayBuffer)))
|
|
1089
|
-
return
|
|
1045
|
+
return b(s, i, r);
|
|
1090
1046
|
if (typeof s == "number")
|
|
1091
1047
|
throw new TypeError(
|
|
1092
1048
|
'The "value" argument must not be of type number. Received type number'
|
|
@@ -1094,7 +1050,7 @@ function Un() {
|
|
|
1094
1050
|
const h = s.valueOf && s.valueOf();
|
|
1095
1051
|
if (h != null && h !== s)
|
|
1096
1052
|
return l.from(h, i, r);
|
|
1097
|
-
const f =
|
|
1053
|
+
const f = A(s);
|
|
1098
1054
|
if (f) return f;
|
|
1099
1055
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof s[Symbol.toPrimitive] == "function")
|
|
1100
1056
|
return l.from(s[Symbol.toPrimitive]("string"), i, r);
|
|
@@ -1118,7 +1074,7 @@ function Un() {
|
|
|
1118
1074
|
return _(s, i, r);
|
|
1119
1075
|
};
|
|
1120
1076
|
function d(s) {
|
|
1121
|
-
return p(s), u(s < 0 ? 0 :
|
|
1077
|
+
return p(s), u(s < 0 ? 0 : w(s) | 0);
|
|
1122
1078
|
}
|
|
1123
1079
|
l.allocUnsafe = function(s) {
|
|
1124
1080
|
return d(s);
|
|
@@ -1128,13 +1084,13 @@ function Un() {
|
|
|
1128
1084
|
function S(s, i) {
|
|
1129
1085
|
if ((typeof i != "string" || i === "") && (i = "utf8"), !l.isEncoding(i))
|
|
1130
1086
|
throw new TypeError("Unknown encoding: " + i);
|
|
1131
|
-
const r =
|
|
1087
|
+
const r = R(s, i) | 0;
|
|
1132
1088
|
let h = u(r);
|
|
1133
1089
|
const f = h.write(s, i);
|
|
1134
1090
|
return f !== r && (h = h.slice(0, f)), h;
|
|
1135
1091
|
}
|
|
1136
1092
|
function m(s) {
|
|
1137
|
-
const i = s.length < 0 ? 0 :
|
|
1093
|
+
const i = s.length < 0 ? 0 : w(s.length) | 0, r = u(i);
|
|
1138
1094
|
for (let h = 0; h < i; h += 1)
|
|
1139
1095
|
r[h] = s[h] & 255;
|
|
1140
1096
|
return r;
|
|
@@ -1142,11 +1098,11 @@ function Un() {
|
|
|
1142
1098
|
function y(s) {
|
|
1143
1099
|
if (ee(s, Uint8Array)) {
|
|
1144
1100
|
const i = new Uint8Array(s);
|
|
1145
|
-
return
|
|
1101
|
+
return b(i.buffer, i.byteOffset, i.byteLength);
|
|
1146
1102
|
}
|
|
1147
1103
|
return m(s);
|
|
1148
1104
|
}
|
|
1149
|
-
function
|
|
1105
|
+
function b(s, i, r) {
|
|
1150
1106
|
if (i < 0 || s.byteLength < i)
|
|
1151
1107
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
1152
1108
|
if (s.byteLength < i + (r || 0))
|
|
@@ -1154,22 +1110,22 @@ function Un() {
|
|
|
1154
1110
|
let h;
|
|
1155
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;
|
|
1156
1112
|
}
|
|
1157
|
-
function
|
|
1113
|
+
function A(s) {
|
|
1158
1114
|
if (l.isBuffer(s)) {
|
|
1159
|
-
const i =
|
|
1115
|
+
const i = w(s.length) | 0, r = u(i);
|
|
1160
1116
|
return r.length === 0 || s.copy(r, 0, 0, i), r;
|
|
1161
1117
|
}
|
|
1162
1118
|
if (s.length !== void 0)
|
|
1163
|
-
return typeof s.length != "number" ||
|
|
1119
|
+
return typeof s.length != "number" || ht(s.length) ? u(0) : m(s);
|
|
1164
1120
|
if (s.type === "Buffer" && Array.isArray(s.data))
|
|
1165
1121
|
return m(s.data);
|
|
1166
1122
|
}
|
|
1167
|
-
function
|
|
1123
|
+
function w(s) {
|
|
1168
1124
|
if (s >= c)
|
|
1169
1125
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + c.toString(16) + " bytes");
|
|
1170
1126
|
return s | 0;
|
|
1171
1127
|
}
|
|
1172
|
-
function
|
|
1128
|
+
function I(s) {
|
|
1173
1129
|
return +s != s && (s = 0), l.alloc(+s);
|
|
1174
1130
|
}
|
|
1175
1131
|
l.isBuffer = function(i) {
|
|
@@ -1231,7 +1187,7 @@ function Un() {
|
|
|
1231
1187
|
}
|
|
1232
1188
|
return f;
|
|
1233
1189
|
};
|
|
1234
|
-
function
|
|
1190
|
+
function R(s, i) {
|
|
1235
1191
|
if (l.isBuffer(s))
|
|
1236
1192
|
return s.length;
|
|
1237
1193
|
if (ArrayBuffer.isView(s) || ee(s, ArrayBuffer))
|
|
@@ -1251,7 +1207,7 @@ function Un() {
|
|
|
1251
1207
|
return r;
|
|
1252
1208
|
case "utf8":
|
|
1253
1209
|
case "utf-8":
|
|
1254
|
-
return
|
|
1210
|
+
return dt(s).length;
|
|
1255
1211
|
case "ucs2":
|
|
1256
1212
|
case "ucs-2":
|
|
1257
1213
|
case "utf16le":
|
|
@@ -1263,11 +1219,11 @@ function Un() {
|
|
|
1263
1219
|
return jt(s).length;
|
|
1264
1220
|
default:
|
|
1265
1221
|
if (f)
|
|
1266
|
-
return h ? -1 :
|
|
1222
|
+
return h ? -1 : dt(s).length;
|
|
1267
1223
|
i = ("" + i).toLowerCase(), f = !0;
|
|
1268
1224
|
}
|
|
1269
1225
|
}
|
|
1270
|
-
l.byteLength =
|
|
1226
|
+
l.byteLength = R;
|
|
1271
1227
|
function M(s, i, r) {
|
|
1272
1228
|
let h = !1;
|
|
1273
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))
|
|
@@ -1275,29 +1231,29 @@ function Un() {
|
|
|
1275
1231
|
for (s || (s = "utf8"); ; )
|
|
1276
1232
|
switch (s) {
|
|
1277
1233
|
case "hex":
|
|
1278
|
-
return
|
|
1234
|
+
return Xi(this, i, r);
|
|
1279
1235
|
case "utf8":
|
|
1280
1236
|
case "utf-8":
|
|
1281
1237
|
return Mt(this, i, r);
|
|
1282
1238
|
case "ascii":
|
|
1283
|
-
return
|
|
1239
|
+
return Ki(this, i, r);
|
|
1284
1240
|
case "latin1":
|
|
1285
1241
|
case "binary":
|
|
1286
|
-
return
|
|
1242
|
+
return Ji(this, i, r);
|
|
1287
1243
|
case "base64":
|
|
1288
|
-
return
|
|
1244
|
+
return qi(this, i, r);
|
|
1289
1245
|
case "ucs2":
|
|
1290
1246
|
case "ucs-2":
|
|
1291
1247
|
case "utf16le":
|
|
1292
1248
|
case "utf-16le":
|
|
1293
|
-
return
|
|
1249
|
+
return Zi(this, i, r);
|
|
1294
1250
|
default:
|
|
1295
1251
|
if (h) throw new TypeError("Unknown encoding: " + s);
|
|
1296
1252
|
s = (s + "").toLowerCase(), h = !0;
|
|
1297
1253
|
}
|
|
1298
1254
|
}
|
|
1299
1255
|
l.prototype._isBuffer = !0;
|
|
1300
|
-
function
|
|
1256
|
+
function x(s, i, r) {
|
|
1301
1257
|
const h = s[i];
|
|
1302
1258
|
s[i] = s[r], s[r] = h;
|
|
1303
1259
|
}
|
|
@@ -1306,21 +1262,21 @@ function Un() {
|
|
|
1306
1262
|
if (i % 2 !== 0)
|
|
1307
1263
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
1308
1264
|
for (let r = 0; r < i; r += 2)
|
|
1309
|
-
|
|
1265
|
+
x(this, r, r + 1);
|
|
1310
1266
|
return this;
|
|
1311
1267
|
}, l.prototype.swap32 = function() {
|
|
1312
1268
|
const i = this.length;
|
|
1313
1269
|
if (i % 4 !== 0)
|
|
1314
1270
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
1315
1271
|
for (let r = 0; r < i; r += 4)
|
|
1316
|
-
|
|
1272
|
+
x(this, r, r + 3), x(this, r + 1, r + 2);
|
|
1317
1273
|
return this;
|
|
1318
1274
|
}, l.prototype.swap64 = function() {
|
|
1319
1275
|
const i = this.length;
|
|
1320
1276
|
if (i % 8 !== 0)
|
|
1321
1277
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
1322
1278
|
for (let r = 0; r < i; r += 8)
|
|
1323
|
-
|
|
1279
|
+
x(this, r, r + 7), x(this, r + 1, r + 6), x(this, r + 2, r + 5), x(this, r + 3, r + 4);
|
|
1324
1280
|
return this;
|
|
1325
1281
|
}, l.prototype.toString = function() {
|
|
1326
1282
|
const i = this.length;
|
|
@@ -1357,7 +1313,7 @@ function Un() {
|
|
|
1357
1313
|
};
|
|
1358
1314
|
function Z(s, i, r, h, f) {
|
|
1359
1315
|
if (s.length === 0) return -1;
|
|
1360
|
-
if (typeof r == "string" ? (h = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r,
|
|
1316
|
+
if (typeof r == "string" ? (h = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, ht(r) && (r = f ? 0 : s.length - 1), r < 0 && (r = s.length + r), r >= s.length) {
|
|
1361
1317
|
if (f) return -1;
|
|
1362
1318
|
r = s.length - 1;
|
|
1363
1319
|
} else if (r < 0)
|
|
@@ -1415,22 +1371,22 @@ function Un() {
|
|
|
1415
1371
|
let v;
|
|
1416
1372
|
for (v = 0; v < h; ++v) {
|
|
1417
1373
|
const T = parseInt(i.substr(v * 2, 2), 16);
|
|
1418
|
-
if (
|
|
1374
|
+
if (ht(T)) return v;
|
|
1419
1375
|
s[r + v] = T;
|
|
1420
1376
|
}
|
|
1421
1377
|
return v;
|
|
1422
1378
|
}
|
|
1423
1379
|
function ne(s, i, r, h) {
|
|
1424
|
-
return
|
|
1380
|
+
return Ve(dt(i, s.length - r), s, r, h);
|
|
1425
1381
|
}
|
|
1426
1382
|
function re(s, i, r, h) {
|
|
1427
|
-
return
|
|
1383
|
+
return Ve(nn(i), s, r, h);
|
|
1428
1384
|
}
|
|
1429
1385
|
function Q(s, i, r, h) {
|
|
1430
|
-
return
|
|
1386
|
+
return Ve(jt(i), s, r, h);
|
|
1431
1387
|
}
|
|
1432
1388
|
function le(s, i, r, h) {
|
|
1433
|
-
return
|
|
1389
|
+
return Ve(rn(i, s.length - r), s, r, h);
|
|
1434
1390
|
}
|
|
1435
1391
|
l.prototype.write = function(i, r, h, f) {
|
|
1436
1392
|
if (r === void 0)
|
|
@@ -1476,7 +1432,7 @@ function Un() {
|
|
|
1476
1432
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
1477
1433
|
};
|
|
1478
1434
|
};
|
|
1479
|
-
function
|
|
1435
|
+
function qi(s, i, r) {
|
|
1480
1436
|
return i === 0 && r === s.length ? e.fromByteArray(s) : e.fromByteArray(s.slice(i, r));
|
|
1481
1437
|
}
|
|
1482
1438
|
function Mt(s, i, r) {
|
|
@@ -1504,10 +1460,10 @@ function Un() {
|
|
|
1504
1460
|
}
|
|
1505
1461
|
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;
|
|
1506
1462
|
}
|
|
1507
|
-
return
|
|
1463
|
+
return Yi(h);
|
|
1508
1464
|
}
|
|
1509
1465
|
const Ut = 4096;
|
|
1510
|
-
function
|
|
1466
|
+
function Yi(s) {
|
|
1511
1467
|
const i = s.length;
|
|
1512
1468
|
if (i <= Ut)
|
|
1513
1469
|
return String.fromCharCode.apply(String, s);
|
|
@@ -1519,29 +1475,29 @@ function Un() {
|
|
|
1519
1475
|
);
|
|
1520
1476
|
return r;
|
|
1521
1477
|
}
|
|
1522
|
-
function
|
|
1478
|
+
function Ki(s, i, r) {
|
|
1523
1479
|
let h = "";
|
|
1524
1480
|
r = Math.min(s.length, r);
|
|
1525
1481
|
for (let f = i; f < r; ++f)
|
|
1526
1482
|
h += String.fromCharCode(s[f] & 127);
|
|
1527
1483
|
return h;
|
|
1528
1484
|
}
|
|
1529
|
-
function
|
|
1485
|
+
function Ji(s, i, r) {
|
|
1530
1486
|
let h = "";
|
|
1531
1487
|
r = Math.min(s.length, r);
|
|
1532
1488
|
for (let f = i; f < r; ++f)
|
|
1533
1489
|
h += String.fromCharCode(s[f]);
|
|
1534
1490
|
return h;
|
|
1535
1491
|
}
|
|
1536
|
-
function
|
|
1492
|
+
function Xi(s, i, r) {
|
|
1537
1493
|
const h = s.length;
|
|
1538
1494
|
(!i || i < 0) && (i = 0), (!r || r < 0 || r > h) && (r = h);
|
|
1539
1495
|
let f = "";
|
|
1540
1496
|
for (let E = i; E < r; ++E)
|
|
1541
|
-
f +=
|
|
1497
|
+
f += on[s[E]];
|
|
1542
1498
|
return f;
|
|
1543
1499
|
}
|
|
1544
|
-
function
|
|
1500
|
+
function Zi(s, i, r) {
|
|
1545
1501
|
const h = s.slice(i, r);
|
|
1546
1502
|
let f = "";
|
|
1547
1503
|
for (let E = 0; E < h.length - 1; E += 2)
|
|
@@ -1788,7 +1744,7 @@ function Un() {
|
|
|
1788
1744
|
return this;
|
|
1789
1745
|
};
|
|
1790
1746
|
const ve = {};
|
|
1791
|
-
function
|
|
1747
|
+
function ut(s, i, r) {
|
|
1792
1748
|
ve[s] = class extends r {
|
|
1793
1749
|
constructor() {
|
|
1794
1750
|
super(), Object.defineProperty(this, "message", {
|
|
@@ -1813,19 +1769,19 @@ function Un() {
|
|
|
1813
1769
|
}
|
|
1814
1770
|
};
|
|
1815
1771
|
}
|
|
1816
|
-
|
|
1772
|
+
ut(
|
|
1817
1773
|
"ERR_BUFFER_OUT_OF_BOUNDS",
|
|
1818
1774
|
function(s) {
|
|
1819
1775
|
return s ? `${s} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
1820
1776
|
},
|
|
1821
1777
|
RangeError
|
|
1822
|
-
),
|
|
1778
|
+
), ut(
|
|
1823
1779
|
"ERR_INVALID_ARG_TYPE",
|
|
1824
1780
|
function(s, i) {
|
|
1825
1781
|
return `The "${s}" argument must be of type number. Received type ${typeof i}`;
|
|
1826
1782
|
},
|
|
1827
1783
|
TypeError
|
|
1828
|
-
),
|
|
1784
|
+
), ut(
|
|
1829
1785
|
"ERR_OUT_OF_RANGE",
|
|
1830
1786
|
function(s, i, r) {
|
|
1831
1787
|
let h = `The value of "${s}" is out of range.`, f = r;
|
|
@@ -1840,7 +1796,7 @@ function Un() {
|
|
|
1840
1796
|
i = `_${s.slice(r - 3, r)}${i}`;
|
|
1841
1797
|
return `${s.slice(0, r)}${i}`;
|
|
1842
1798
|
}
|
|
1843
|
-
function
|
|
1799
|
+
function Qi(s, i, r) {
|
|
1844
1800
|
ye(i, "offset"), (s[i] === void 0 || s[i + r] === void 0) && Re(i, s.length - (r + 1));
|
|
1845
1801
|
}
|
|
1846
1802
|
function Vt(s, i, r, h, f, E) {
|
|
@@ -1849,7 +1805,7 @@ function Un() {
|
|
|
1849
1805
|
let T;
|
|
1850
1806
|
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 ve.ERR_OUT_OF_RANGE("value", T, s);
|
|
1851
1807
|
}
|
|
1852
|
-
|
|
1808
|
+
Qi(h, f, E);
|
|
1853
1809
|
}
|
|
1854
1810
|
function ye(s, i) {
|
|
1855
1811
|
if (typeof s != "number")
|
|
@@ -1862,14 +1818,14 @@ function Un() {
|
|
|
1862
1818
|
s
|
|
1863
1819
|
);
|
|
1864
1820
|
}
|
|
1865
|
-
const
|
|
1866
|
-
function
|
|
1867
|
-
if (s = s.split("=")[0], s = s.trim().replace(
|
|
1821
|
+
const en = /[^+/0-9A-Za-z-_]/g;
|
|
1822
|
+
function tn(s) {
|
|
1823
|
+
if (s = s.split("=")[0], s = s.trim().replace(en, ""), s.length < 2) return "";
|
|
1868
1824
|
for (; s.length % 4 !== 0; )
|
|
1869
1825
|
s = s + "=";
|
|
1870
1826
|
return s;
|
|
1871
1827
|
}
|
|
1872
|
-
function
|
|
1828
|
+
function dt(s, i) {
|
|
1873
1829
|
i = i || 1 / 0;
|
|
1874
1830
|
let r;
|
|
1875
1831
|
const h = s.length;
|
|
@@ -1923,13 +1879,13 @@ function Un() {
|
|
|
1923
1879
|
}
|
|
1924
1880
|
return E;
|
|
1925
1881
|
}
|
|
1926
|
-
function
|
|
1882
|
+
function nn(s) {
|
|
1927
1883
|
const i = [];
|
|
1928
1884
|
for (let r = 0; r < s.length; ++r)
|
|
1929
1885
|
i.push(s.charCodeAt(r) & 255);
|
|
1930
1886
|
return i;
|
|
1931
1887
|
}
|
|
1932
|
-
function
|
|
1888
|
+
function rn(s, i) {
|
|
1933
1889
|
let r, h, f;
|
|
1934
1890
|
const E = [];
|
|
1935
1891
|
for (let v = 0; v < s.length && !((i -= 2) < 0); ++v)
|
|
@@ -1937,9 +1893,9 @@ function Un() {
|
|
|
1937
1893
|
return E;
|
|
1938
1894
|
}
|
|
1939
1895
|
function jt(s) {
|
|
1940
|
-
return e.toByteArray(
|
|
1896
|
+
return e.toByteArray(tn(s));
|
|
1941
1897
|
}
|
|
1942
|
-
function
|
|
1898
|
+
function Ve(s, i, r, h) {
|
|
1943
1899
|
let f;
|
|
1944
1900
|
for (f = 0; f < h && !(f + r >= i.length || f >= s.length); ++f)
|
|
1945
1901
|
i[f + r] = s[f];
|
|
@@ -1948,10 +1904,10 @@ function Un() {
|
|
|
1948
1904
|
function ee(s, i) {
|
|
1949
1905
|
return s instanceof i || s != null && s.constructor != null && s.constructor.name != null && s.constructor.name === i.name;
|
|
1950
1906
|
}
|
|
1951
|
-
function
|
|
1907
|
+
function ht(s) {
|
|
1952
1908
|
return s !== s;
|
|
1953
1909
|
}
|
|
1954
|
-
const
|
|
1910
|
+
const on = (function() {
|
|
1955
1911
|
const s = "0123456789abcdef", i = new Array(256);
|
|
1956
1912
|
for (let r = 0; r < 16; ++r) {
|
|
1957
1913
|
const h = r * 16;
|
|
@@ -1961,19 +1917,19 @@ function Un() {
|
|
|
1961
1917
|
return i;
|
|
1962
1918
|
})();
|
|
1963
1919
|
function ce(s) {
|
|
1964
|
-
return typeof BigInt > "u" ?
|
|
1920
|
+
return typeof BigInt > "u" ? sn : s;
|
|
1965
1921
|
}
|
|
1966
|
-
function
|
|
1922
|
+
function sn() {
|
|
1967
1923
|
throw new Error("BigInt not supported");
|
|
1968
1924
|
}
|
|
1969
|
-
})(
|
|
1925
|
+
})(_t)), _t;
|
|
1970
1926
|
}
|
|
1971
|
-
var
|
|
1972
|
-
const
|
|
1927
|
+
var Mn = Dn();
|
|
1928
|
+
const Un = "https://api.anam.ai", Bn = "/v1", ji = {
|
|
1973
1929
|
client: "js-sdk",
|
|
1974
1930
|
version: "4.8.0"
|
|
1975
1931
|
};
|
|
1976
|
-
var
|
|
1932
|
+
var Ln = function(t, e, n, o) {
|
|
1977
1933
|
function c(a) {
|
|
1978
1934
|
return a instanceof n ? a : new n(function(u) {
|
|
1979
1935
|
u(a);
|
|
@@ -2005,12 +1961,12 @@ var se;
|
|
|
2005
1961
|
(function(t) {
|
|
2006
1962
|
t.CLIENT_METRIC_MEASUREMENT_ERROR = "client_error", t.CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED = "client_connection_closed", t.CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED = "client_connection_established", t.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT = "client_session_attempt", t.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS = "client_session_success";
|
|
2007
1963
|
})(se || (se = {}));
|
|
2008
|
-
let
|
|
2009
|
-
const
|
|
2010
|
-
|
|
2011
|
-
},
|
|
1964
|
+
let Ct = Hi, Wi = kt, de, zi = !1;
|
|
1965
|
+
const Pn = (t, e = kt) => {
|
|
1966
|
+
Ct = t, Wi = e;
|
|
1967
|
+
}, Fn = (t) => {
|
|
2012
1968
|
de = t;
|
|
2013
|
-
},
|
|
1969
|
+
}, $n = (t) => {
|
|
2014
1970
|
zi = t;
|
|
2015
1971
|
};
|
|
2016
1972
|
let he = {
|
|
@@ -2020,7 +1976,7 @@ let he = {
|
|
|
2020
1976
|
};
|
|
2021
1977
|
const Se = (t) => {
|
|
2022
1978
|
he = Object.assign(Object.assign({}, he), t);
|
|
2023
|
-
}, me = (t, e, n) =>
|
|
1979
|
+
}, me = (t, e, n) => Ln(void 0, void 0, void 0, function* () {
|
|
2024
1980
|
if (!zi)
|
|
2025
1981
|
try {
|
|
2026
1982
|
const o = Object.assign(Object.assign({}, ji), n);
|
|
@@ -2029,7 +1985,7 @@ const Se = (t) => {
|
|
|
2029
1985
|
let a, u = {
|
|
2030
1986
|
"Content-Type": "application/json"
|
|
2031
1987
|
};
|
|
2032
|
-
de?.enabled && de?.baseUrl ? (a = `${de.baseUrl}${c}`, u["X-Anam-Target-Url"] = `${
|
|
1988
|
+
de?.enabled && de?.baseUrl ? (a = `${de.baseUrl}${c}`, u["X-Anam-Target-Url"] = `${Ct}${c}`) : a = `${Ct}${c}`, yield fetch(a, {
|
|
2033
1989
|
method: "POST",
|
|
2034
1990
|
headers: u,
|
|
2035
1991
|
body: JSON.stringify({
|
|
@@ -2041,7 +1997,7 @@ const Se = (t) => {
|
|
|
2041
1997
|
} catch (o) {
|
|
2042
1998
|
console.error("Failed to send error metric:", o);
|
|
2043
1999
|
}
|
|
2044
|
-
}),
|
|
2000
|
+
}), Gn = (t, e = "console") => {
|
|
2045
2001
|
var n, o, c;
|
|
2046
2002
|
const a = {};
|
|
2047
2003
|
t.forEach((d) => {
|
|
@@ -2051,29 +2007,29 @@ const Se = (t) => {
|
|
|
2051
2007
|
issues: []
|
|
2052
2008
|
}, l = ((n = a["inbound-rtp"]) === null || n === void 0 ? void 0 : n.filter((d) => d.kind === "video")) || [];
|
|
2053
2009
|
l.length > 0 && (u.personaVideoStream = [], l.forEach((d) => {
|
|
2054
|
-
var S, m, y,
|
|
2055
|
-
const
|
|
2010
|
+
var S, m, y, b, A;
|
|
2011
|
+
const w = {
|
|
2056
2012
|
framesReceived: (S = d.framesReceived) !== null && S !== void 0 ? S : "unknown",
|
|
2057
2013
|
framesDropped: (m = d.framesDropped) !== null && m !== void 0 ? m : "unknown",
|
|
2058
2014
|
framesPerSecond: (y = d.framesPerSecond) !== null && y !== void 0 ? y : "unknown",
|
|
2059
|
-
packetsReceived: (
|
|
2060
|
-
packetsLost: (
|
|
2015
|
+
packetsReceived: (b = d.packetsReceived) !== null && b !== void 0 ? b : "unknown",
|
|
2016
|
+
packetsLost: (A = d.packetsLost) !== null && A !== void 0 ? A : "unknown",
|
|
2061
2017
|
resolution: d.frameWidth && d.frameHeight ? `${d.frameWidth}x${d.frameHeight}` : void 0,
|
|
2062
2018
|
jitter: d.jitter !== void 0 ? d.jitter : void 0
|
|
2063
2019
|
};
|
|
2064
|
-
u.personaVideoStream.push(
|
|
2020
|
+
u.personaVideoStream.push(w);
|
|
2065
2021
|
}));
|
|
2066
2022
|
const g = ((o = a["inbound-rtp"]) === null || o === void 0 ? void 0 : o.filter((d) => d.kind === "audio")) || [];
|
|
2067
2023
|
g.length > 0 && (u.personaAudioStream = [], g.forEach((d) => {
|
|
2068
2024
|
var S, m, y;
|
|
2069
|
-
const
|
|
2025
|
+
const b = {
|
|
2070
2026
|
packetsReceived: (S = d.packetsReceived) !== null && S !== void 0 ? S : "unknown",
|
|
2071
2027
|
packetsLost: (m = d.packetsLost) !== null && m !== void 0 ? m : "unknown",
|
|
2072
2028
|
audioLevel: (y = d.audioLevel) !== null && y !== void 0 ? y : "unknown",
|
|
2073
2029
|
jitter: d.jitter !== void 0 ? d.jitter : void 0,
|
|
2074
2030
|
totalAudioEnergy: d.totalAudioEnergy !== void 0 ? d.totalAudioEnergy : void 0
|
|
2075
2031
|
};
|
|
2076
|
-
u.personaAudioStream.push(
|
|
2032
|
+
u.personaAudioStream.push(b);
|
|
2077
2033
|
}));
|
|
2078
2034
|
const p = ((c = a["outbound-rtp"]) === null || c === void 0 ? void 0 : c.filter((d) => d.kind === "audio")) || [];
|
|
2079
2035
|
p.length > 0 && (u.userAudioInput = [], p.forEach((d) => {
|
|
@@ -2136,7 +2092,7 @@ class $ extends Error {
|
|
|
2136
2092
|
function ai() {
|
|
2137
2093
|
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : Date.now().toString(36) + Math.random().toString(36).substr(2, 9);
|
|
2138
2094
|
}
|
|
2139
|
-
function
|
|
2095
|
+
function Vn(t) {
|
|
2140
2096
|
if (!(!t || !t.enabled)) {
|
|
2141
2097
|
if (!t.baseUrl)
|
|
2142
2098
|
return "API Gateway baseUrl is required when enabled";
|
|
@@ -2167,10 +2123,10 @@ var it;
|
|
|
2167
2123
|
(function(t) {
|
|
2168
2124
|
t.USER = "user", t.PERSONA = "persona";
|
|
2169
2125
|
})(it || (it = {}));
|
|
2170
|
-
var
|
|
2126
|
+
var N;
|
|
2171
2127
|
(function(t) {
|
|
2172
2128
|
t.MESSAGE_HISTORY_UPDATED = "MESSAGE_HISTORY_UPDATED", t.MESSAGE_STREAM_EVENT_RECEIVED = "MESSAGE_STREAM_EVENT_RECEIVED", t.CONNECTION_ESTABLISHED = "CONNECTION_ESTABLISHED", t.CONNECTION_CLOSED = "CONNECTION_CLOSED", t.INPUT_AUDIO_STREAM_STARTED = "INPUT_AUDIO_STREAM_STARTED", t.VIDEO_STREAM_STARTED = "VIDEO_STREAM_STARTED", t.VIDEO_PLAY_STARTED = "VIDEO_PLAY_STARTED", t.AUDIO_STREAM_STARTED = "AUDIO_STREAM_STARTED", t.TALK_STREAM_INTERRUPTED = "TALK_STREAM_INTERRUPTED", t.SESSION_READY = "SESSION_READY", t.SERVER_WARNING = "SERVER_WARNING", t.MIC_PERMISSION_PENDING = "MIC_PERMISSION_PENDING", t.MIC_PERMISSION_GRANTED = "MIC_PERMISSION_GRANTED", t.MIC_PERMISSION_DENIED = "MIC_PERMISSION_DENIED", t.INPUT_AUDIO_DEVICE_CHANGED = "INPUT_AUDIO_DEVICE_CHANGED", t.CLIENT_TOOL_EVENT_RECEIVED = "CLIENT_TOOL_EVENT_RECEIVED", t.REASONING_HISTORY_UPDATED = "REASONING_HISTORY_UPDATED", t.REASONING_STREAM_EVENT_RECEIVED = "REASONING_STREAM_EVENT_RECEIVED";
|
|
2173
|
-
})(
|
|
2129
|
+
})(N || (N = {}));
|
|
2174
2130
|
var J;
|
|
2175
2131
|
(function(t) {
|
|
2176
2132
|
t.WEB_SOCKET_OPEN = "WEB_SOCKET_OPEN", t.SIGNAL_MESSAGE_RECEIVED = "SIGNAL_MESSAGE_RECEIVED", t.WEBRTC_CHAT_MESSAGE_RECEIVED = "WEBRTC_CHAT_MESSAGE_RECEIVED", t.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED = "WEBRTC_CLIENT_TOOL_EVENT_RECEIVED", t.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED = "WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED";
|
|
@@ -2179,7 +2135,7 @@ var _e;
|
|
|
2179
2135
|
(function(t) {
|
|
2180
2136
|
t.NORMAL = "CONNECTION_CLOSED_CODE_NORMAL", t.MICROPHONE_PERMISSION_DENIED = "CONNECTION_CLOSED_CODE_MICROPHONE_PERMISSION_DENIED", t.SIGNALLING_CLIENT_CONNECTION_FAILURE = "CONNECTION_CLOSED_CODE_SIGNALLING_CLIENT_CONNECTION_FAILURE", t.WEBRTC_FAILURE = "CONNECTION_CLOSED_CODE_WEBRTC_FAILURE", t.SERVER_CLOSED_CONNECTION = "CONNECTION_CLOSED_CODE_SERVER_CLOSED_CONNECTION";
|
|
2181
2137
|
})(_e || (_e = {}));
|
|
2182
|
-
class
|
|
2138
|
+
class jn {
|
|
2183
2139
|
constructor(e, n) {
|
|
2184
2140
|
this.sequenceNumber = 0, this.config = e, this.signallingClient = n;
|
|
2185
2141
|
}
|
|
@@ -2248,24 +2204,24 @@ var we = function(t, e, n, o) {
|
|
|
2248
2204
|
p((o = o.apply(t, e || [])).next());
|
|
2249
2205
|
});
|
|
2250
2206
|
};
|
|
2251
|
-
const
|
|
2252
|
-
class
|
|
2207
|
+
const Hn = 5, Wn = 5;
|
|
2208
|
+
class zn {
|
|
2253
2209
|
constructor(e, n, o, c, a) {
|
|
2254
2210
|
var u, l, g, p, _;
|
|
2255
2211
|
if (this.stopSignal = !1, this.sendingBuffer = [], this.wsConnectionAttempts = 0, this.socket = null, this.heartBeatIntervalRef = null, this.publicEventEmitter = o, this.internalEventEmitter = c, this.apiGatewayConfig = a, !e)
|
|
2256
2212
|
throw new Error("Signalling Client: sessionId is required");
|
|
2257
2213
|
this.sessionId = e;
|
|
2258
2214
|
const { heartbeatIntervalSeconds: d, maxWsReconnectionAttempts: S, url: m } = n;
|
|
2259
|
-
if (this.heartbeatIntervalSeconds = d ||
|
|
2215
|
+
if (this.heartbeatIntervalSeconds = d || Hn, this.maxWsReconnectionAttempts = S || Wn, !m.baseUrl)
|
|
2260
2216
|
throw new Error("Signalling Client: baseUrl is required");
|
|
2261
2217
|
if (!((u = this.apiGatewayConfig) === null || u === void 0) && u.enabled && (!((l = this.apiGatewayConfig) === null || l === void 0) && l.baseUrl)) {
|
|
2262
|
-
const y = new URL(this.apiGatewayConfig.baseUrl),
|
|
2263
|
-
y.protocol = y.protocol.replace("http", "ws"), y.pathname =
|
|
2264
|
-
const
|
|
2265
|
-
M.protocol =
|
|
2218
|
+
const y = new URL(this.apiGatewayConfig.baseUrl), b = (g = this.apiGatewayConfig.wsPath) !== null && g !== void 0 ? g : "/ws";
|
|
2219
|
+
y.protocol = y.protocol.replace("http", "ws"), y.pathname = b, this.url = y;
|
|
2220
|
+
const A = m.protocol || "https", w = A === "http" ? "ws" : "wss", I = `${A}://${m.baseUrl}`, R = (p = m.signallingPath) !== null && p !== void 0 ? p : "/ws", M = new URL(I);
|
|
2221
|
+
M.protocol = w === "ws" ? "ws:" : "wss:", m.port && (M.port = m.port), M.pathname = R, M.searchParams.append("session_id", e), this.url.searchParams.append("target_url", M.href);
|
|
2266
2222
|
} else {
|
|
2267
|
-
const
|
|
2268
|
-
this.url = new URL(
|
|
2223
|
+
const b = `${m.protocol || "https"}://${m.baseUrl}`;
|
|
2224
|
+
this.url = new URL(b), this.url.protocol = m.protocol === "http" ? "ws:" : "wss:", m.port && (this.url.port = m.port), this.url.pathname = (_ = m.signallingPath) !== null && _ !== void 0 ? _ : "/ws", this.url.searchParams.append("session_id", e);
|
|
2269
2225
|
}
|
|
2270
2226
|
}
|
|
2271
2227
|
stop() {
|
|
@@ -2345,7 +2301,7 @@ class Yn {
|
|
|
2345
2301
|
try {
|
|
2346
2302
|
this.wsConnectionAttempts = 0, this.flushSendingBuffer(), this.socket.onmessage = this.onMessage.bind(this), this.startSendingHeartBeats(), this.internalEventEmitter.emit(J.WEB_SOCKET_OPEN);
|
|
2347
2303
|
} catch (e) {
|
|
2348
|
-
console.error("SignallingClient - onOpen: error in onOpen", e), this.publicEventEmitter.emit(
|
|
2304
|
+
console.error("SignallingClient - onOpen: error in onOpen", e), this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.SIGNALLING_CLIENT_CONNECTION_FAILURE);
|
|
2349
2305
|
}
|
|
2350
2306
|
});
|
|
2351
2307
|
}
|
|
@@ -2353,7 +2309,7 @@ class Yn {
|
|
|
2353
2309
|
return we(this, void 0, void 0, function* () {
|
|
2354
2310
|
this.wsConnectionAttempts += 1, !this.stopSignal && (this.wsConnectionAttempts <= this.maxWsReconnectionAttempts ? (this.socket = null, setTimeout(() => {
|
|
2355
2311
|
this.connect();
|
|
2356
|
-
}, 100 * this.wsConnectionAttempts)) : (this.heartBeatIntervalRef && (clearInterval(this.heartBeatIntervalRef), this.heartBeatIntervalRef = null), this.publicEventEmitter.emit(
|
|
2312
|
+
}, 100 * this.wsConnectionAttempts)) : (this.heartBeatIntervalRef && (clearInterval(this.heartBeatIntervalRef), this.heartBeatIntervalRef = null), this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.SIGNALLING_CLIENT_CONNECTION_FAILURE)));
|
|
2357
2313
|
});
|
|
2358
2314
|
}
|
|
2359
2315
|
onError(e) {
|
|
@@ -2387,7 +2343,7 @@ class Yn {
|
|
|
2387
2343
|
}, e);
|
|
2388
2344
|
}
|
|
2389
2345
|
}
|
|
2390
|
-
function
|
|
2346
|
+
function qn(t) {
|
|
2391
2347
|
return "brainType" in t || "llmId" in t;
|
|
2392
2348
|
}
|
|
2393
2349
|
var li = function(t, e, n, o) {
|
|
@@ -2417,11 +2373,11 @@ var li = function(t, e, n, o) {
|
|
|
2417
2373
|
p((o = o.apply(t, e || [])).next());
|
|
2418
2374
|
});
|
|
2419
2375
|
};
|
|
2420
|
-
class
|
|
2376
|
+
class Yn {
|
|
2421
2377
|
constructor(e, n, o) {
|
|
2422
2378
|
if (!e && !n)
|
|
2423
2379
|
throw new Error("Either sessionToken or apiKey must be provided");
|
|
2424
|
-
this.sessionToken = e || null, this.apiKey = n || null, this.baseUrl = o?.baseUrl ||
|
|
2380
|
+
this.sessionToken = e || null, this.apiKey = n || null, this.baseUrl = o?.baseUrl || Un, this.apiVersion = o?.apiVersion || Bn, this.apiGatewayConfig = o?.apiGateway || void 0;
|
|
2425
2381
|
}
|
|
2426
2382
|
/**
|
|
2427
2383
|
* Builds URL and headers for a request, applying API Gateway configuration if enabled
|
|
@@ -2490,7 +2446,7 @@ class Jn {
|
|
|
2490
2446
|
let n = {
|
|
2491
2447
|
clientLabel: "js-sdk-api-key"
|
|
2492
2448
|
};
|
|
2493
|
-
|
|
2449
|
+
qn(e) && (n = Object.assign(Object.assign({}, n), { personaConfig: e }));
|
|
2494
2450
|
try {
|
|
2495
2451
|
const o = `${this.apiVersion}/auth/session-token`, { url: c, headers: a } = this.buildGatewayUrlAndHeaders(o, {
|
|
2496
2452
|
"Content-Type": "application/json",
|
|
@@ -2510,7 +2466,7 @@ class Jn {
|
|
|
2510
2466
|
return `${this.baseUrl}${this.apiVersion}`;
|
|
2511
2467
|
}
|
|
2512
2468
|
}
|
|
2513
|
-
var
|
|
2469
|
+
var Kn = function(t, e, n, o) {
|
|
2514
2470
|
function c(a) {
|
|
2515
2471
|
return a instanceof n ? a : new n(function(u) {
|
|
2516
2472
|
u(a);
|
|
@@ -2537,12 +2493,12 @@ var Xn = function(t, e, n, o) {
|
|
|
2537
2493
|
p((o = o.apply(t, e || [])).next());
|
|
2538
2494
|
});
|
|
2539
2495
|
};
|
|
2540
|
-
class
|
|
2496
|
+
class Jn {
|
|
2541
2497
|
constructor(e, n, o) {
|
|
2542
2498
|
this.baseUrl = e, this.sessionId = n, this.apiGatewayConfig = o;
|
|
2543
2499
|
}
|
|
2544
2500
|
sendTalkCommand(e) {
|
|
2545
|
-
return
|
|
2501
|
+
return Kn(this, void 0, void 0, function* () {
|
|
2546
2502
|
var n, o;
|
|
2547
2503
|
try {
|
|
2548
2504
|
let c, a = {
|
|
@@ -2570,7 +2526,7 @@ class Zn {
|
|
|
2570
2526
|
});
|
|
2571
2527
|
}
|
|
2572
2528
|
}
|
|
2573
|
-
class
|
|
2529
|
+
class Xn {
|
|
2574
2530
|
constructor() {
|
|
2575
2531
|
this.listeners = {};
|
|
2576
2532
|
}
|
|
@@ -2586,7 +2542,7 @@ class Qn {
|
|
|
2586
2542
|
});
|
|
2587
2543
|
}
|
|
2588
2544
|
}
|
|
2589
|
-
class
|
|
2545
|
+
class Zn {
|
|
2590
2546
|
constructor(e, n) {
|
|
2591
2547
|
this.messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(J.WEBRTC_CHAT_MESSAGE_RECEIVED, this.processWebRtcTextMessageEvent.bind(this));
|
|
2592
2548
|
}
|
|
@@ -2623,7 +2579,7 @@ class er {
|
|
|
2623
2579
|
}
|
|
2624
2580
|
processWebRtcTextMessageEvent(e) {
|
|
2625
2581
|
const n = this.webRtcTextMessageEventToMessageStreamEvent(e);
|
|
2626
|
-
switch (this.publicEventEmitter.emit(
|
|
2582
|
+
switch (this.publicEventEmitter.emit(N.MESSAGE_STREAM_EVENT_RECEIVED, n), n.role) {
|
|
2627
2583
|
case it.USER:
|
|
2628
2584
|
this.processUserMessage(n);
|
|
2629
2585
|
break;
|
|
@@ -2631,10 +2587,10 @@ class er {
|
|
|
2631
2587
|
this.processPersonaMessage(n);
|
|
2632
2588
|
break;
|
|
2633
2589
|
}
|
|
2634
|
-
n.endOfSpeech && this.publicEventEmitter.emit(
|
|
2590
|
+
n.endOfSpeech && this.publicEventEmitter.emit(N.MESSAGE_HISTORY_UPDATED, this.messages);
|
|
2635
2591
|
}
|
|
2636
2592
|
}
|
|
2637
|
-
class
|
|
2593
|
+
class Qn {
|
|
2638
2594
|
constructor() {
|
|
2639
2595
|
this.listeners = {};
|
|
2640
2596
|
}
|
|
@@ -2645,7 +2601,7 @@ class tr {
|
|
|
2645
2601
|
this.listeners[e] && this.listeners[e].delete(n);
|
|
2646
2602
|
}
|
|
2647
2603
|
emit(e, ...n) {
|
|
2648
|
-
if (e ===
|
|
2604
|
+
if (e === N.CONNECTION_ESTABLISHED && me(se.CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED, "1"), e === N.CONNECTION_CLOSED) {
|
|
2649
2605
|
const [o, c] = n;
|
|
2650
2606
|
me(se.CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED, o, c ? { details: c } : void 0);
|
|
2651
2607
|
}
|
|
@@ -2658,7 +2614,7 @@ var z;
|
|
|
2658
2614
|
(function(t) {
|
|
2659
2615
|
t[t.UNSTARTED = 0] = "UNSTARTED", t[t.STREAMING = 1] = "STREAMING", t[t.INTERRUPTED = 2] = "INTERRUPTED", t[t.ENDED = 3] = "ENDED";
|
|
2660
2616
|
})(z || (z = {}));
|
|
2661
|
-
var
|
|
2617
|
+
var Et = function(t, e, n, o) {
|
|
2662
2618
|
function c(a) {
|
|
2663
2619
|
return a instanceof n ? a : new n(function(u) {
|
|
2664
2620
|
u(a);
|
|
@@ -2685,7 +2641,7 @@ var mt = function(t, e, n, o) {
|
|
|
2685
2641
|
p((o = o.apply(t, e || [])).next());
|
|
2686
2642
|
});
|
|
2687
2643
|
};
|
|
2688
|
-
class
|
|
2644
|
+
class er {
|
|
2689
2645
|
constructor(e, n, o) {
|
|
2690
2646
|
this.state = z.UNSTARTED, this.correlationId = e, this.internalEventEmitter = n, this.signallingClient = o, this.internalEventEmitter.addListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this));
|
|
2691
2647
|
}
|
|
@@ -2693,12 +2649,12 @@ class ir {
|
|
|
2693
2649
|
this.internalEventEmitter.removeListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this));
|
|
2694
2650
|
}
|
|
2695
2651
|
onSignalMessage(e) {
|
|
2696
|
-
return
|
|
2652
|
+
return Et(this, void 0, void 0, function* () {
|
|
2697
2653
|
e.actionType === W.TALK_STREAM_INTERRUPTED && e.payload.correlationId === this.correlationId && (this.state = z.INTERRUPTED, this.onDeactivate());
|
|
2698
2654
|
});
|
|
2699
2655
|
}
|
|
2700
2656
|
endMessage() {
|
|
2701
|
-
return
|
|
2657
|
+
return Et(this, void 0, void 0, function* () {
|
|
2702
2658
|
if (this.state === z.ENDED) {
|
|
2703
2659
|
console.warn("Talk stream is already ended via end of speech. No need to call endMessage.");
|
|
2704
2660
|
return;
|
|
@@ -2717,7 +2673,7 @@ class ir {
|
|
|
2717
2673
|
});
|
|
2718
2674
|
}
|
|
2719
2675
|
streamMessageChunk(e, n) {
|
|
2720
|
-
return
|
|
2676
|
+
return Et(this, void 0, void 0, function* () {
|
|
2721
2677
|
if (this.state !== z.STREAMING && this.state !== z.UNSTARTED)
|
|
2722
2678
|
throw new Error("Talk stream is not in an active state: " + this.state);
|
|
2723
2679
|
const o = {
|
|
@@ -2766,8 +2722,8 @@ var K = function(t, e, n, o) {
|
|
|
2766
2722
|
p((o = o.apply(t, e || [])).next());
|
|
2767
2723
|
});
|
|
2768
2724
|
};
|
|
2769
|
-
const
|
|
2770
|
-
class
|
|
2725
|
+
const tr = 15e3, ir = 5e3, nr = 2;
|
|
2726
|
+
class rr {
|
|
2771
2727
|
constructor(e, n, o, c) {
|
|
2772
2728
|
var a, u, l, g;
|
|
2773
2729
|
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 = {
|
|
@@ -2775,7 +2731,7 @@ class sr {
|
|
|
2775
2731
|
permissionState: fe.NOT_REQUESTED
|
|
2776
2732
|
}, this.successMetricPoller = null, this.successMetricFired = !1, this.showPeerConnectionStatsReport = !1, this.peerConnectionStatsReportOutputFormat = "console", this.statsCollectionInterval = null, this.agentAudioInputStream = null, this.publicEventEmitter = o, this.internalEventEmitter = c, this.apiGatewayConfig = n.apiGateway;
|
|
2777
2733
|
const { inputAudio: p } = n;
|
|
2778
|
-
this.inputAudioState = p.inputAudioState, n.inputAudio.userProvidedMediaStream && (this.inputAudioStream = n.inputAudio.userProvidedMediaStream), this.disableInputAudio = n.inputAudio.disableInputAudio === !0, this.internalEventEmitter.addListener(J.WEB_SOCKET_OPEN, this.onSignallingClientConnected.bind(this)), this.internalEventEmitter.addListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this)), this.iceServers = n.iceServers, this.signallingClient = new
|
|
2734
|
+
this.inputAudioState = p.inputAudioState, n.inputAudio.userProvidedMediaStream && (this.inputAudioStream = n.inputAudio.userProvidedMediaStream), this.disableInputAudio = n.inputAudio.disableInputAudio === !0, this.internalEventEmitter.addListener(J.WEB_SOCKET_OPEN, this.onSignallingClientConnected.bind(this)), this.internalEventEmitter.addListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this)), this.iceServers = n.iceServers, this.signallingClient = new zn(e, n.signalling, this.publicEventEmitter, this.internalEventEmitter, this.apiGatewayConfig), this.engineApiRestClient = new Jn(n.engine.baseUrl, e, this.apiGatewayConfig), this.audioDeviceId = n.inputAudio.audioDeviceId, this.showPeerConnectionStatsReport = (u = (a = n.metrics) === null || a === void 0 ? void 0 : a.showPeerConnectionStatsReport) !== null && u !== void 0 ? u : !1, this.peerConnectionStatsReportOutputFormat = (g = (l = n.metrics) === null || l === void 0 ? void 0 : l.peerConnectionStatsReportOutputFormat) !== null && g !== void 0 ? g : "console";
|
|
2779
2735
|
}
|
|
2780
2736
|
onInputAudioStateChange(e, n) {
|
|
2781
2737
|
e.isMuted !== n.isMuted && (n.isMuted ? this.muteAllAudioTracks() : this.unmuteAllAudioTracks());
|
|
@@ -2801,7 +2757,7 @@ class sr {
|
|
|
2801
2757
|
} catch (e) {
|
|
2802
2758
|
console.error("Failed to collect and send stats:", e);
|
|
2803
2759
|
}
|
|
2804
|
-
}),
|
|
2760
|
+
}), ir));
|
|
2805
2761
|
}
|
|
2806
2762
|
sendClientSideMetrics(e) {
|
|
2807
2763
|
e.forEach((n) => {
|
|
@@ -2819,7 +2775,7 @@ class sr {
|
|
|
2819
2775
|
return;
|
|
2820
2776
|
const e = setTimeout(() => {
|
|
2821
2777
|
this.successMetricPoller && (console.warn("No video frames received, there is a problem with the connection."), clearInterval(this.successMetricPoller), this.successMetricPoller = null);
|
|
2822
|
-
},
|
|
2778
|
+
}, tr);
|
|
2823
2779
|
this.successMetricPoller = setInterval(() => K(this, void 0, void 0, function* () {
|
|
2824
2780
|
if (!this.peerConnection || this.successMetricFired) {
|
|
2825
2781
|
this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e);
|
|
@@ -2869,7 +2825,7 @@ class sr {
|
|
|
2869
2825
|
};
|
|
2870
2826
|
this.inputAudioStream = yield navigator.mediaDevices.getUserMedia({
|
|
2871
2827
|
audio: o
|
|
2872
|
-
}), this.audioDeviceId = e, yield this.setupAudioTrack(), n && this.muteAllAudioTracks(), this.publicEventEmitter.emit(
|
|
2828
|
+
}), this.audioDeviceId = e, yield this.setupAudioTrack(), n && this.muteAllAudioTracks(), this.publicEventEmitter.emit(N.INPUT_AUDIO_DEVICE_CHANGED, e);
|
|
2873
2829
|
} catch (o) {
|
|
2874
2830
|
throw console.error("Failed to change audio input device:", o), new Error(`StreamingClient - changeAudioInputDevice: ${o instanceof Error ? o.message : String(o)}`);
|
|
2875
2831
|
}
|
|
@@ -2919,10 +2875,10 @@ class sr {
|
|
|
2919
2875
|
});
|
|
2920
2876
|
}
|
|
2921
2877
|
startTalkMessageStream(e) {
|
|
2922
|
-
return e || (e = Math.random().toString(36).substring(2, 15)), new
|
|
2878
|
+
return e || (e = Math.random().toString(36).substring(2, 15)), new er(e, this.internalEventEmitter, this.signallingClient);
|
|
2923
2879
|
}
|
|
2924
2880
|
createAgentAudioInputStream(e) {
|
|
2925
|
-
return this.agentAudioInputStream = new
|
|
2881
|
+
return this.agentAudioInputStream = new jn(e, this.signallingClient), this.agentAudioInputStream;
|
|
2926
2882
|
}
|
|
2927
2883
|
getAgentAudioInputStream() {
|
|
2928
2884
|
return this.agentAudioInputStream;
|
|
@@ -2931,7 +2887,7 @@ class sr {
|
|
|
2931
2887
|
return K(this, void 0, void 0, function* () {
|
|
2932
2888
|
this.peerConnection = new RTCPeerConnection({
|
|
2933
2889
|
iceServers: this.iceServers,
|
|
2934
|
-
iceCandidatePoolSize:
|
|
2890
|
+
iceCandidatePoolSize: nr
|
|
2935
2891
|
}), this.peerConnection.onicecandidate = this.onIceCandidate.bind(this), this.peerConnection.oniceconnectionstatechange = this.onIceConnectionStateChange.bind(this), this.peerConnection.onconnectionstatechange = this.onConnectionStateChange.bind(this), this.peerConnection.addEventListener("track", this.onTrackEventHandler.bind(this)), yield this.setupDataChannels(), this.peerConnection.addTransceiver("video", { direction: "recvonly" }), this.disableInputAudio ? this.peerConnection.addTransceiver("audio", { direction: "recvonly" }) : (this.peerConnection.addTransceiver("audio", { direction: "sendrecv" }), this.inputAudioStream ? yield this.setupAudioTrack() : this.requestMicrophonePermissionAsync().catch((e) => {
|
|
2936
2892
|
console.error("Async microphone permission request failed:", e);
|
|
2937
2893
|
}));
|
|
@@ -2954,19 +2910,19 @@ class sr {
|
|
|
2954
2910
|
break;
|
|
2955
2911
|
case W.END_SESSION:
|
|
2956
2912
|
const a = e.payload;
|
|
2957
|
-
this.publicEventEmitter.emit(
|
|
2913
|
+
this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.SERVER_CLOSED_CONNECTION, a), this.shutdown();
|
|
2958
2914
|
break;
|
|
2959
2915
|
case W.WARNING:
|
|
2960
2916
|
const u = e.payload;
|
|
2961
|
-
console.warn("Warning received from server: " + u), this.publicEventEmitter.emit(
|
|
2917
|
+
console.warn("Warning received from server: " + u), this.publicEventEmitter.emit(N.SERVER_WARNING, u);
|
|
2962
2918
|
break;
|
|
2963
2919
|
case W.TALK_STREAM_INTERRUPTED:
|
|
2964
2920
|
const l = e.payload;
|
|
2965
|
-
this.publicEventEmitter.emit(
|
|
2921
|
+
this.publicEventEmitter.emit(N.TALK_STREAM_INTERRUPTED, l.correlationId);
|
|
2966
2922
|
break;
|
|
2967
2923
|
case W.SESSION_READY:
|
|
2968
2924
|
const g = e.sessionId;
|
|
2969
|
-
this.publicEventEmitter.emit(
|
|
2925
|
+
this.publicEventEmitter.emit(N.SESSION_READY, g);
|
|
2970
2926
|
break;
|
|
2971
2927
|
case W.HEARTBEAT:
|
|
2972
2928
|
break;
|
|
@@ -3001,14 +2957,14 @@ class sr {
|
|
|
3001
2957
|
}
|
|
3002
2958
|
onIceConnectionStateChange() {
|
|
3003
2959
|
var e, n;
|
|
3004
|
-
(((e = this.peerConnection) === null || e === void 0 ? void 0 : e.iceConnectionState) === "connected" || ((n = this.peerConnection) === null || n === void 0 ? void 0 : n.iceConnectionState) === "completed") && (this.publicEventEmitter.emit(
|
|
2960
|
+
(((e = this.peerConnection) === null || e === void 0 ? void 0 : e.iceConnectionState) === "connected" || ((n = this.peerConnection) === null || n === void 0 ? void 0 : n.iceConnectionState) === "completed") && (this.publicEventEmitter.emit(N.CONNECTION_ESTABLISHED), this.startStatsCollection());
|
|
3005
2961
|
}
|
|
3006
2962
|
onConnectionStateChange() {
|
|
3007
2963
|
var e;
|
|
3008
2964
|
((e = this.peerConnection) === null || e === void 0 ? void 0 : e.connectionState) === "closed" && (console.error("StreamingClient - onConnectionStateChange: Connection closed"), this.handleWebrtcFailure("The connection to our servers was lost. Please try again."));
|
|
3009
2965
|
}
|
|
3010
2966
|
handleWebrtcFailure(e) {
|
|
3011
|
-
console.error({ message: "StreamingClient - handleWebrtcFailure: ", err: e }), e.name === "NotAllowedError" && e.message === "Permission denied" ? this.publicEventEmitter.emit(
|
|
2967
|
+
console.error({ message: "StreamingClient - handleWebrtcFailure: ", err: e }), e.name === "NotAllowedError" && e.message === "Permission denied" ? this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.MICROPHONE_PERMISSION_DENIED) : this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.WEBRTC_FAILURE);
|
|
3012
2968
|
try {
|
|
3013
2969
|
this.stopConnection();
|
|
3014
2970
|
} catch (n) {
|
|
@@ -3017,14 +2973,14 @@ class sr {
|
|
|
3017
2973
|
}
|
|
3018
2974
|
onTrackEventHandler(e) {
|
|
3019
2975
|
if (e.track.kind === "video") {
|
|
3020
|
-
if (this.startSuccessMetricPolling(), this.videoStream = e.streams[0], this.publicEventEmitter.emit(
|
|
2976
|
+
if (this.startSuccessMetricPolling(), this.videoStream = e.streams[0], this.publicEventEmitter.emit(N.VIDEO_STREAM_STARTED, this.videoStream), this.videoElement) {
|
|
3021
2977
|
this.videoElement.srcObject = this.videoStream;
|
|
3022
2978
|
const n = this.videoElement.requestVideoFrameCallback(() => {
|
|
3023
2979
|
var o;
|
|
3024
|
-
(o = this.videoElement) === null || o === void 0 || o.cancelVideoFrameCallback(n), this.publicEventEmitter.emit(
|
|
2980
|
+
(o = this.videoElement) === null || o === void 0 || o.cancelVideoFrameCallback(n), this.publicEventEmitter.emit(N.VIDEO_PLAY_STARTED), this.successMetricFired || (this.successMetricFired = !0, me(se.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", { detectionMethod: "videoElement" }));
|
|
3025
2981
|
});
|
|
3026
2982
|
}
|
|
3027
|
-
} else e.track.kind === "audio" && (this.audioStream = e.streams[0], this.publicEventEmitter.emit(
|
|
2983
|
+
} else e.track.kind === "audio" && (this.audioStream = e.streams[0], this.publicEventEmitter.emit(N.AUDIO_STREAM_STARTED, this.audioStream));
|
|
3028
2984
|
}
|
|
3029
2985
|
/**
|
|
3030
2986
|
* Set up the data channels for sending and receiving messages
|
|
@@ -3053,8 +3009,8 @@ class sr {
|
|
|
3053
3009
|
case De.CLIENT_TOOL_EVENT:
|
|
3054
3010
|
const c = o.data;
|
|
3055
3011
|
this.internalEventEmitter.emit(J.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED, c);
|
|
3056
|
-
const a =
|
|
3057
|
-
this.publicEventEmitter.emit(
|
|
3012
|
+
const a = or.WebRTCClientToolEventToClientToolEvent(c);
|
|
3013
|
+
this.publicEventEmitter.emit(N.CLIENT_TOOL_EVENT_RECEIVED, a);
|
|
3058
3014
|
break;
|
|
3059
3015
|
case De.REASONING_TEXT:
|
|
3060
3016
|
this.internalEventEmitter.emit(J.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, o.data);
|
|
@@ -3075,7 +3031,7 @@ class sr {
|
|
|
3075
3031
|
requestMicrophonePermissionAsync() {
|
|
3076
3032
|
return K(this, void 0, void 0, function* () {
|
|
3077
3033
|
if (this.inputAudioState.permissionState !== fe.PENDING) {
|
|
3078
|
-
this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: fe.PENDING }), this.publicEventEmitter.emit(
|
|
3034
|
+
this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: fe.PENDING }), this.publicEventEmitter.emit(N.MIC_PERMISSION_PENDING);
|
|
3079
3035
|
try {
|
|
3080
3036
|
const e = {
|
|
3081
3037
|
echoCancellation: !0
|
|
@@ -3084,11 +3040,11 @@ class sr {
|
|
|
3084
3040
|
exact: this.audioDeviceId
|
|
3085
3041
|
}), this.inputAudioStream = yield navigator.mediaDevices.getUserMedia({
|
|
3086
3042
|
audio: e
|
|
3087
|
-
}), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: fe.GRANTED }), this.publicEventEmitter.emit(
|
|
3043
|
+
}), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: fe.GRANTED }), this.publicEventEmitter.emit(N.MIC_PERMISSION_GRANTED), yield this.setupAudioTrack();
|
|
3088
3044
|
} catch (e) {
|
|
3089
3045
|
console.error("Failed to get microphone permission:", e), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: fe.DENIED });
|
|
3090
3046
|
const n = e instanceof Error ? e.message : String(e);
|
|
3091
|
-
this.publicEventEmitter.emit(
|
|
3047
|
+
this.publicEventEmitter.emit(N.MIC_PERMISSION_DENIED, n);
|
|
3092
3048
|
}
|
|
3093
3049
|
}
|
|
3094
3050
|
});
|
|
@@ -3117,7 +3073,7 @@ class sr {
|
|
|
3117
3073
|
}
|
|
3118
3074
|
else
|
|
3119
3075
|
this.peerConnection.addTrack(e, this.inputAudioStream);
|
|
3120
|
-
this.publicEventEmitter.emit(
|
|
3076
|
+
this.publicEventEmitter.emit(N.INPUT_AUDIO_STREAM_STARTED, this.inputAudioStream);
|
|
3121
3077
|
});
|
|
3122
3078
|
}
|
|
3123
3079
|
initPeerConnectionAndSendOffer() {
|
|
@@ -3143,7 +3099,7 @@ class sr {
|
|
|
3143
3099
|
if (this.showPeerConnectionStatsReport) {
|
|
3144
3100
|
const n = yield (e = this.peerConnection) === null || e === void 0 ? void 0 : e.getStats();
|
|
3145
3101
|
if (n) {
|
|
3146
|
-
const o =
|
|
3102
|
+
const o = Gn(n, this.peerConnectionStatsReportOutputFormat);
|
|
3147
3103
|
o && console.log(o, void 0, 2);
|
|
3148
3104
|
}
|
|
3149
3105
|
}
|
|
@@ -3168,7 +3124,7 @@ class sr {
|
|
|
3168
3124
|
});
|
|
3169
3125
|
}
|
|
3170
3126
|
}
|
|
3171
|
-
class
|
|
3127
|
+
class or {
|
|
3172
3128
|
/**
|
|
3173
3129
|
* Converts a WebRtcClientToolEvent to a ClientToolEvent
|
|
3174
3130
|
*/
|
|
@@ -3184,7 +3140,7 @@ class ar {
|
|
|
3184
3140
|
};
|
|
3185
3141
|
}
|
|
3186
3142
|
}
|
|
3187
|
-
class
|
|
3143
|
+
class sr {
|
|
3188
3144
|
constructor(e, n) {
|
|
3189
3145
|
this.reasoning_messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(J.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, this.processWebRtcReasoningTextMessageEvent.bind(this));
|
|
3190
3146
|
}
|
|
@@ -3198,7 +3154,7 @@ class lr {
|
|
|
3198
3154
|
}
|
|
3199
3155
|
processWebRtcReasoningTextMessageEvent(e) {
|
|
3200
3156
|
const n = this.webRtcTextMessageEventToReasoningStreamEvent(e);
|
|
3201
|
-
this.publicEventEmitter.emit(
|
|
3157
|
+
this.publicEventEmitter.emit(N.REASONING_STREAM_EVENT_RECEIVED, n);
|
|
3202
3158
|
const o = {
|
|
3203
3159
|
id: n.id,
|
|
3204
3160
|
content: n.content,
|
|
@@ -3209,7 +3165,7 @@ class lr {
|
|
|
3209
3165
|
a.content += o.content, this.reasoning_messages[c] = a;
|
|
3210
3166
|
} else
|
|
3211
3167
|
this.reasoning_messages.push(o);
|
|
3212
|
-
n.endOfThought && this.publicEventEmitter.emit(
|
|
3168
|
+
n.endOfThought && this.publicEventEmitter.emit(N.REASONING_HISTORY_UPDATED, this.reasoning_messages);
|
|
3213
3169
|
}
|
|
3214
3170
|
}
|
|
3215
3171
|
var ue = function(t, e, n, o) {
|
|
@@ -3239,7 +3195,7 @@ var ue = function(t, e, n, o) {
|
|
|
3239
3195
|
p((o = o.apply(t, e || [])).next());
|
|
3240
3196
|
});
|
|
3241
3197
|
};
|
|
3242
|
-
class
|
|
3198
|
+
class ar {
|
|
3243
3199
|
constructor(e, n, o) {
|
|
3244
3200
|
var c, a, u, l, g;
|
|
3245
3201
|
this.inputAudioState = {
|
|
@@ -3249,11 +3205,11 @@ class cr {
|
|
|
3249
3205
|
const p = this.validateClientConfig(e, n, o);
|
|
3250
3206
|
if (p)
|
|
3251
3207
|
throw new $(p, V.CLIENT_ERROR_CODE_CONFIGURATION_ERROR, 400);
|
|
3252
|
-
this.personaConfig = n, this.clientOptions = o, (!((c = o?.api) === null || c === void 0) && c.baseUrl || !((a = o?.api) === null || a === void 0) && a.apiVersion) &&
|
|
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 || kt), !((l = (u = o?.api) === null || u === void 0 ? void 0 : u.apiGateway) === null || l === void 0) && l.enabled && Fn(o.api.apiGateway), !((g = o?.metrics) === null || g === void 0) && g.disableClientMetrics && $n(!0), this.publicEventEmitter = new Qn(), this.internalEventEmitter = new Xn(), this.apiClient = new Yn(e, o?.apiKey, o?.api), this.messageHistoryClient = new Zn(this.publicEventEmitter, this.internalEventEmitter), this.reasoningHistoryClient = new sr(this.publicEventEmitter, this.internalEventEmitter);
|
|
3253
3209
|
}
|
|
3254
3210
|
decodeJwt(e) {
|
|
3255
3211
|
try {
|
|
3256
|
-
const n = e.split(".")[1], o =
|
|
3212
|
+
const n = e.split(".")[1], o = Mn.Buffer.from(n, "base64").toString("utf8");
|
|
3257
3213
|
return JSON.parse(o);
|
|
3258
3214
|
} catch {
|
|
3259
3215
|
throw new Error("Invalid session token format");
|
|
@@ -3265,7 +3221,7 @@ class cr {
|
|
|
3265
3221
|
return "Either sessionToken or apiKey must be provided";
|
|
3266
3222
|
if (o?.apiKey && e)
|
|
3267
3223
|
return "Only one of sessionToken or apiKey should be used";
|
|
3268
|
-
const u =
|
|
3224
|
+
const u = Vn((c = o?.api) === null || c === void 0 ? void 0 : c.apiGateway);
|
|
3269
3225
|
if (u)
|
|
3270
3226
|
return u;
|
|
3271
3227
|
if (e) {
|
|
@@ -3300,23 +3256,23 @@ class cr {
|
|
|
3300
3256
|
startSession(e) {
|
|
3301
3257
|
return ue(this, void 0, void 0, function* () {
|
|
3302
3258
|
var n, o, c, a, u, l, g, p, _, d, S, m;
|
|
3303
|
-
const y = this.personaConfig,
|
|
3304
|
-
this.sessionId =
|
|
3259
|
+
const y = this.personaConfig, b = this.buildStartSessionOptionsForClient(), A = yield this.apiClient.startSession(y, b), { sessionId: w, clientConfig: I, engineHost: R, engineProtocol: M, signallingEndpoint: x } = A, { heartbeatIntervalSeconds: Z, maxWsReconnectionAttempts: H, iceServers: ae } = I;
|
|
3260
|
+
this.sessionId = w, Se({
|
|
3305
3261
|
sessionId: this.sessionId
|
|
3306
3262
|
});
|
|
3307
3263
|
const ne = !((n = this.clientOptions) === null || n === void 0) && n.iceServers ? this.clientOptions.iceServers : ae;
|
|
3308
3264
|
try {
|
|
3309
|
-
this.streamingClient = new
|
|
3265
|
+
this.streamingClient = new rr(w, {
|
|
3310
3266
|
engine: {
|
|
3311
|
-
baseUrl: `${M}://${
|
|
3267
|
+
baseUrl: `${M}://${R}`
|
|
3312
3268
|
},
|
|
3313
3269
|
signalling: {
|
|
3314
3270
|
heartbeatIntervalSeconds: Z,
|
|
3315
3271
|
maxWsReconnectionAttempts: H,
|
|
3316
3272
|
url: {
|
|
3317
|
-
baseUrl:
|
|
3273
|
+
baseUrl: R,
|
|
3318
3274
|
protocol: M,
|
|
3319
|
-
signallingPath:
|
|
3275
|
+
signallingPath: x
|
|
3320
3276
|
}
|
|
3321
3277
|
},
|
|
3322
3278
|
iceServers: ne,
|
|
@@ -3337,10 +3293,10 @@ class cr {
|
|
|
3337
3293
|
sessionId: null
|
|
3338
3294
|
}), new $("Failed to initialize streaming client", V.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
|
|
3339
3295
|
cause: re instanceof Error ? re.message : String(re),
|
|
3340
|
-
sessionId:
|
|
3296
|
+
sessionId: w
|
|
3341
3297
|
});
|
|
3342
3298
|
}
|
|
3343
|
-
return
|
|
3299
|
+
return w;
|
|
3344
3300
|
});
|
|
3345
3301
|
}
|
|
3346
3302
|
startSessionIfNeeded(e) {
|
|
@@ -3365,9 +3321,9 @@ class cr {
|
|
|
3365
3321
|
var a;
|
|
3366
3322
|
const u = [];
|
|
3367
3323
|
let l = !1, g = !1;
|
|
3368
|
-
this.publicEventEmitter.addListener(
|
|
3324
|
+
this.publicEventEmitter.addListener(N.VIDEO_STREAM_STARTED, (p) => {
|
|
3369
3325
|
u.push(p), l = !0, g && c(u);
|
|
3370
|
-
}), this.publicEventEmitter.addListener(
|
|
3326
|
+
}), this.publicEventEmitter.addListener(N.AUDIO_STREAM_STARTED, (p) => {
|
|
3371
3327
|
u.push(p), g = !0, l && c(u);
|
|
3372
3328
|
}), (a = this.streamingClient) === null || a === void 0 || a.startConnection();
|
|
3373
3329
|
});
|
|
@@ -3465,7 +3421,7 @@ class cr {
|
|
|
3465
3421
|
}
|
|
3466
3422
|
stopStreaming() {
|
|
3467
3423
|
return ue(this, void 0, void 0, function* () {
|
|
3468
|
-
this.streamingClient && (this.publicEventEmitter.emit(
|
|
3424
|
+
this.streamingClient && (this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.NORMAL), yield this.streamingClient.stopConnection(), this.streamingClient = null, this.sessionId = null, Se({
|
|
3469
3425
|
attemptCorrelationId: null,
|
|
3470
3426
|
sessionId: null,
|
|
3471
3427
|
organizationId: this.organizationId
|
|
@@ -3530,23 +3486,23 @@ class cr {
|
|
|
3530
3486
|
return this.sessionId;
|
|
3531
3487
|
}
|
|
3532
3488
|
}
|
|
3533
|
-
const
|
|
3534
|
-
function
|
|
3489
|
+
const lr = (t, e) => new ar(t, void 0, e), cr = "https://api.anam.ai", X = Y(null), te = Y("idle"), Le = Y(!1), Je = Y(!1), at = Y([]), Pe = Y(null), nt = Y(null), lt = Y(null), ct = Y(null), Dt = Y(null), ci = Y(!1), Fe = Y(!1);
|
|
3490
|
+
function ur(t, e) {
|
|
3535
3491
|
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.";
|
|
3536
3492
|
}
|
|
3537
|
-
async function
|
|
3538
|
-
|
|
3493
|
+
async function dr(t, e) {
|
|
3494
|
+
Fe.value = !1;
|
|
3539
3495
|
try {
|
|
3540
3496
|
const n = await fetch(`${e}/v1/personas/${t}/widget`);
|
|
3541
3497
|
if (!n.ok) return;
|
|
3542
3498
|
const o = await n.json();
|
|
3543
|
-
|
|
3499
|
+
lt.value = o.persona?.avatarImageUrl || null, ct.value = o.persona?.name || null, Dt.value = o.widgetConfig || null;
|
|
3544
3500
|
} catch {
|
|
3545
3501
|
} finally {
|
|
3546
|
-
|
|
3502
|
+
Fe.value = !0;
|
|
3547
3503
|
}
|
|
3548
3504
|
}
|
|
3549
|
-
async function
|
|
3505
|
+
async function hr(t, e, n) {
|
|
3550
3506
|
if (te.value === "connecting" || te.value === "connected")
|
|
3551
3507
|
return;
|
|
3552
3508
|
te.value = "connecting", Pe.value = null;
|
|
@@ -3566,22 +3522,22 @@ async function pr(t, e, n) {
|
|
|
3566
3522
|
console.log("[AnamWidget] Got session from agent-id:", {
|
|
3567
3523
|
persona: a.persona?.name,
|
|
3568
3524
|
hasToken: !!a.sessionToken
|
|
3569
|
-
}),
|
|
3570
|
-
const u =
|
|
3525
|
+
}), lt.value = a.persona?.avatarImageUrl || null, ct.value = a.persona?.name || null;
|
|
3526
|
+
const u = lr(a.sessionToken, {
|
|
3571
3527
|
api: e ? { baseUrl: e } : void 0,
|
|
3572
3528
|
metrics: { disableClientMetrics: !0 }
|
|
3573
3529
|
});
|
|
3574
|
-
u.addListener(
|
|
3530
|
+
u.addListener(N.CONNECTION_ESTABLISHED, () => {
|
|
3575
3531
|
console.log("[AnamWidget] Connection established"), te.value = "connected";
|
|
3576
|
-
}), u.addListener(
|
|
3532
|
+
}), u.addListener(N.VIDEO_STREAM_STARTED, () => {
|
|
3577
3533
|
console.log("[AnamWidget] Video stream started"), Le.value = !0;
|
|
3578
|
-
}), u.addListener(
|
|
3534
|
+
}), u.addListener(N.AUDIO_STREAM_STARTED, () => {
|
|
3579
3535
|
console.log("[AnamWidget] Audio stream started");
|
|
3580
|
-
}), u.addListener(
|
|
3581
|
-
|
|
3582
|
-
}), u.addListener(
|
|
3536
|
+
}), u.addListener(N.MESSAGE_HISTORY_UPDATED, (g) => {
|
|
3537
|
+
at.value = [...g];
|
|
3538
|
+
}), u.addListener(N.CONNECTION_CLOSED, (g, p) => {
|
|
3583
3539
|
console.log("[AnamWidget] Connection closed:", g, p), te.value = "idle", Le.value = !1, nt.value = null;
|
|
3584
|
-
}), u.addListener(
|
|
3540
|
+
}), u.addListener(N.SESSION_READY, (g) => {
|
|
3585
3541
|
console.log("[AnamWidget] Session ready:", g), nt.value = g;
|
|
3586
3542
|
}), X.value = u;
|
|
3587
3543
|
const l = await u.stream();
|
|
@@ -3590,85 +3546,89 @@ async function pr(t, e, n) {
|
|
|
3590
3546
|
g && (n.srcObject = g);
|
|
3591
3547
|
}
|
|
3592
3548
|
} catch (c) {
|
|
3593
|
-
console.error("[AnamWidget] Failed to start session:", c), Pe.value =
|
|
3549
|
+
console.error("[AnamWidget] Failed to start session:", c), Pe.value = ur(c, o), te.value = "error", X.value = null;
|
|
3594
3550
|
}
|
|
3595
3551
|
}
|
|
3596
|
-
async function
|
|
3552
|
+
async function fr() {
|
|
3597
3553
|
if (X.value)
|
|
3598
3554
|
try {
|
|
3599
3555
|
await X.value.stopStreaming();
|
|
3600
3556
|
} catch (t) {
|
|
3601
3557
|
console.error("[AnamWidget] Failed to stop session:", t);
|
|
3602
3558
|
}
|
|
3603
|
-
X.value = null, te.value = "idle", Le.value = !1,
|
|
3559
|
+
X.value = null, te.value = "idle", Le.value = !1, at.value = [];
|
|
3604
3560
|
}
|
|
3605
|
-
function
|
|
3561
|
+
function pr(t) {
|
|
3606
3562
|
!X.value || te.value !== "connected" || X.value.sendUserMessage(t);
|
|
3607
3563
|
}
|
|
3608
|
-
function
|
|
3564
|
+
function _r() {
|
|
3609
3565
|
X.value && (Je.value ? (X.value.unmuteInputAudio(), Je.value = !1) : (X.value.muteInputAudio(), Je.value = !0));
|
|
3610
3566
|
}
|
|
3611
|
-
function
|
|
3612
|
-
|
|
3567
|
+
function Er() {
|
|
3568
|
+
Fe.value = !0;
|
|
3613
3569
|
}
|
|
3614
|
-
function
|
|
3570
|
+
function mr() {
|
|
3571
|
+
X.value?.isStreaming() && X.value.stopStreaming(), X.value = null, te.value = "idle", Le.value = !1, at.value = [], Pe.value = null, nt.value = null, lt.value = null, ct.value = null, Dt.value = null;
|
|
3572
|
+
}
|
|
3573
|
+
function gr(t, e) {
|
|
3615
3574
|
ci.value = !!t;
|
|
3616
|
-
const n = e ||
|
|
3575
|
+
const n = e || cr;
|
|
3617
3576
|
return {
|
|
3618
3577
|
connectionStatus: te,
|
|
3619
3578
|
isStreaming: Le,
|
|
3620
3579
|
isMuted: Je,
|
|
3621
|
-
messages:
|
|
3580
|
+
messages: at,
|
|
3622
3581
|
error: Pe,
|
|
3623
3582
|
sessionId: nt,
|
|
3624
3583
|
hasAgentId: ci,
|
|
3625
|
-
isReady:
|
|
3626
|
-
avatarThumbnailUrl:
|
|
3627
|
-
personaName:
|
|
3584
|
+
isReady: Fe,
|
|
3585
|
+
avatarThumbnailUrl: lt,
|
|
3586
|
+
personaName: ct,
|
|
3628
3587
|
serverConfig: Dt,
|
|
3629
3588
|
fetchWidgetConfig: () => {
|
|
3630
3589
|
if (!t) {
|
|
3631
|
-
|
|
3590
|
+
Fe.value = !0;
|
|
3632
3591
|
return;
|
|
3633
3592
|
}
|
|
3634
|
-
|
|
3593
|
+
dr(t, n);
|
|
3635
3594
|
},
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3595
|
+
skipFetch: Er,
|
|
3596
|
+
startSession: (a) => t ? hr(t, n, a) : (Pe.value = "No agent ID configured", Promise.resolve()),
|
|
3597
|
+
stopSession: fr,
|
|
3598
|
+
sendMessage: pr,
|
|
3599
|
+
toggleMute: _r,
|
|
3600
|
+
cleanup: mr
|
|
3641
3601
|
};
|
|
3642
3602
|
}
|
|
3643
|
-
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{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}';
|
|
3644
|
-
function
|
|
3603
|
+
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}';
|
|
3604
|
+
function It(t, e) {
|
|
3645
3605
|
const n = { ...t };
|
|
3646
3606
|
for (const o of Object.keys(e)) {
|
|
3647
3607
|
const c = e[o];
|
|
3648
|
-
c !== void 0 && (c !== null && typeof c == "object" && !Array.isArray(c) && typeof n[o] == "object" && n[o] !== null && !Array.isArray(n[o]) ? n[o] =
|
|
3608
|
+
c !== void 0 && (c !== null && typeof c == "object" && !Array.isArray(c) && typeof n[o] == "object" && n[o] !== null && !Array.isArray(n[o]) ? n[o] = It(n[o], c) : n[o] = c);
|
|
3649
3609
|
}
|
|
3650
3610
|
return n;
|
|
3651
3611
|
}
|
|
3652
|
-
const
|
|
3612
|
+
const vr = () => /* @__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" }) }), yr = () => /* @__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" }) }), Sr = () => /* @__PURE__ */ C("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3653
3613
|
/* @__PURE__ */ C("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" }),
|
|
3654
3614
|
/* @__PURE__ */ C("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
3655
3615
|
/* @__PURE__ */ C("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
3656
|
-
] }),
|
|
3616
|
+
] }), wr = () => /* @__PURE__ */ C("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3657
3617
|
/* @__PURE__ */ C("line", { x1: "1", y1: "1", x2: "23", y2: "23" }),
|
|
3658
3618
|
/* @__PURE__ */ C("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V5a3 3 0 0 0-5.94-.6" }),
|
|
3659
3619
|
/* @__PURE__ */ C("path", { d: "M17 16.95A7 7 0 0 1 5 12v-2m14 0v2c0 .87-.16 1.71-.46 2.49" }),
|
|
3660
3620
|
/* @__PURE__ */ C("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
3661
|
-
] }),
|
|
3621
|
+
] }), Cr = () => /* @__PURE__ */ C("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3662
3622
|
/* @__PURE__ */ C("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
|
|
3663
3623
|
/* @__PURE__ */ C("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
|
|
3664
|
-
] }),
|
|
3624
|
+
] }), Ir = () => /* @__PURE__ */ C("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
|
|
3665
3625
|
/* @__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" }),
|
|
3666
3626
|
/* @__PURE__ */ C("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
3667
3627
|
] }), bt = () => /* @__PURE__ */ C("svg", { width: "48", height: "48", viewBox: "0 0 48 48", fill: "none", style: { opacity: 0.3 }, children: [
|
|
3668
3628
|
/* @__PURE__ */ C("circle", { cx: "24", cy: "18", r: "8", stroke: "white", "stroke-width": "2", fill: "none" }),
|
|
3669
3629
|
/* @__PURE__ */ C("path", { d: "M8 42c0-8.837 7.163-16 16-16s16 7.163 16 16", stroke: "white", "stroke-width": "2", fill: "none" })
|
|
3670
3630
|
] });
|
|
3671
|
-
function
|
|
3631
|
+
function br({
|
|
3672
3632
|
config: t,
|
|
3673
3633
|
session: e,
|
|
3674
3634
|
videoRef: n,
|
|
@@ -3676,11 +3636,11 @@ function Ar({
|
|
|
3676
3636
|
displayCta: c,
|
|
3677
3637
|
onCollapse: a
|
|
3678
3638
|
}) {
|
|
3679
|
-
const u = Qe(null), [l, g] = Ye(""), [p, _] = Ye(null), [d, S] = Ye(!1), m = Qe(null), y = e.connectionStatus.value === "connected",
|
|
3639
|
+
const u = Qe(null), [l, g] = Ye(""), [p, _] = Ye(null), [d, S] = Ye(!1), m = Qe(null), y = e.connectionStatus.value === "connected", b = e.connectionStatus.value === "connecting", A = e.connectionStatus.value === "error", w = e.isStreaming.value, I = !b && !y && !A, R = He(async () => {
|
|
3680
3640
|
n.current && await e.startSession(n.current);
|
|
3681
|
-
}, []), M =
|
|
3641
|
+
}, []), M = He(async () => {
|
|
3682
3642
|
await e.stopSession();
|
|
3683
|
-
}, []),
|
|
3643
|
+
}, []), x = He(() => {
|
|
3684
3644
|
if (!l.trim()) return;
|
|
3685
3645
|
const H = l.trim();
|
|
3686
3646
|
e.sendMessage(H), g(""), u.current?.focus(), m.current && clearTimeout(m.current), S(!1), _(H), m.current = window.setTimeout(() => {
|
|
@@ -3688,10 +3648,10 @@ function Ar({
|
|
|
3688
3648
|
_(null), S(!1);
|
|
3689
3649
|
}, 400);
|
|
3690
3650
|
}, 2600);
|
|
3691
|
-
}, [l]), Z =
|
|
3692
|
-
H.key === "Enter" && !H.shiftKey && (H.preventDefault(),
|
|
3693
|
-
}, [
|
|
3694
|
-
return
|
|
3651
|
+
}, [l]), Z = He((H) => {
|
|
3652
|
+
H.key === "Enter" && !H.shiftKey && (H.preventDefault(), x());
|
|
3653
|
+
}, [x]);
|
|
3654
|
+
return yt(() => () => {
|
|
3695
3655
|
m.current && clearTimeout(m.current);
|
|
3696
3656
|
}, []), /* @__PURE__ */ C("div", { class: "anam-sheet", children: [
|
|
3697
3657
|
/* @__PURE__ */ C(
|
|
@@ -3701,15 +3661,15 @@ function Ar({
|
|
|
3701
3661
|
class: "anam-video",
|
|
3702
3662
|
autoplay: !0,
|
|
3703
3663
|
playsinline: !0,
|
|
3704
|
-
"data-hidden":
|
|
3664
|
+
"data-hidden": w ? void 0 : "true"
|
|
3705
3665
|
}
|
|
3706
3666
|
),
|
|
3707
|
-
|
|
3667
|
+
I && (e.hasAgentId.value ? (
|
|
3708
3668
|
/* Has agent-id: show avatar or placeholder + CTA pill */
|
|
3709
3669
|
/* @__PURE__ */ C("div", { class: "anam-overlay-idle", children: [
|
|
3710
3670
|
o ? /* @__PURE__ */ C("img", { src: o, alt: "Avatar" }) : /* @__PURE__ */ C(bt, {}),
|
|
3711
|
-
/* @__PURE__ */ C("button", { class: "anam-cta-pill", onClick:
|
|
3712
|
-
/* @__PURE__ */ C(
|
|
3671
|
+
/* @__PURE__ */ C("button", { class: "anam-cta-pill", onClick: R, children: [
|
|
3672
|
+
/* @__PURE__ */ C(yr, {}),
|
|
3713
3673
|
c
|
|
3714
3674
|
] })
|
|
3715
3675
|
] })
|
|
@@ -3720,16 +3680,16 @@ function Ar({
|
|
|
3720
3680
|
/* @__PURE__ */ C("span", { children: "Agent not configured" })
|
|
3721
3681
|
] })
|
|
3722
3682
|
)),
|
|
3723
|
-
|
|
3683
|
+
b && /* @__PURE__ */ C("div", { class: "anam-overlay-loading", children: [
|
|
3724
3684
|
/* @__PURE__ */ C("span", { class: "anam-spinner" }),
|
|
3725
3685
|
/* @__PURE__ */ C("span", { children: "Starting your conversation..." })
|
|
3726
3686
|
] }),
|
|
3727
|
-
|
|
3687
|
+
A && /* @__PURE__ */ C("div", { class: "anam-overlay-error", children: [
|
|
3728
3688
|
/* @__PURE__ */ C("div", { class: "anam-overlay-error-text", children: e.error.value || "Something went wrong" }),
|
|
3729
|
-
/* @__PURE__ */ C("button", { class: "anam-retry-btn", onClick:
|
|
3689
|
+
/* @__PURE__ */ C("button", { class: "anam-retry-btn", onClick: R, children: "Try Again" })
|
|
3730
3690
|
] }),
|
|
3731
|
-
(y ||
|
|
3732
|
-
a && /* @__PURE__ */ C("button", { class: "anam-close-btn", onClick: a, "aria-label": "Close", children: /* @__PURE__ */ C(
|
|
3691
|
+
(y || w) && /* @__PURE__ */ C(oe, { children: [
|
|
3692
|
+
a && /* @__PURE__ */ C("button", { class: "anam-close-btn", onClick: a, "aria-label": "Close", children: /* @__PURE__ */ C(vr, {}) }),
|
|
3733
3693
|
p && /* @__PURE__ */ C("div", { class: `anam-toast ${d ? "anam-toast-out" : ""}`, children: p }),
|
|
3734
3694
|
/* @__PURE__ */ C("div", { class: "anam-control-bar", children: [
|
|
3735
3695
|
t.showMuteButton && /* @__PURE__ */ C(
|
|
@@ -3738,7 +3698,7 @@ function Ar({
|
|
|
3738
3698
|
class: `anam-ctl-btn ${e.isMuted.value ? "anam-ctl-btn-muted" : ""}`,
|
|
3739
3699
|
onClick: () => e.toggleMute(),
|
|
3740
3700
|
"aria-label": e.isMuted.value ? "Unmute" : "Mute",
|
|
3741
|
-
children: e.isMuted.value ? /* @__PURE__ */ C(
|
|
3701
|
+
children: e.isMuted.value ? /* @__PURE__ */ C(wr, {}) : /* @__PURE__ */ C(Sr, {})
|
|
3742
3702
|
}
|
|
3743
3703
|
),
|
|
3744
3704
|
t.showTextInput && /* @__PURE__ */ C(oe, { children: [
|
|
@@ -3759,10 +3719,10 @@ function Ar({
|
|
|
3759
3719
|
"button",
|
|
3760
3720
|
{
|
|
3761
3721
|
class: "anam-ctl-btn",
|
|
3762
|
-
onClick:
|
|
3722
|
+
onClick: x,
|
|
3763
3723
|
disabled: !y || !l.trim(),
|
|
3764
3724
|
"aria-label": "Send message",
|
|
3765
|
-
children: /* @__PURE__ */ C(
|
|
3725
|
+
children: /* @__PURE__ */ C(Cr, {})
|
|
3766
3726
|
}
|
|
3767
3727
|
)
|
|
3768
3728
|
] }),
|
|
@@ -3772,55 +3732,39 @@ function Ar({
|
|
|
3772
3732
|
class: "anam-ctl-btn anam-ctl-end",
|
|
3773
3733
|
onClick: M,
|
|
3774
3734
|
"aria-label": "End call",
|
|
3775
|
-
children: /* @__PURE__ */ C(
|
|
3735
|
+
children: /* @__PURE__ */ C(Ir, {})
|
|
3776
3736
|
}
|
|
3777
3737
|
)
|
|
3778
3738
|
] })
|
|
3779
3739
|
] })
|
|
3780
3740
|
] });
|
|
3781
3741
|
}
|
|
3782
|
-
function
|
|
3783
|
-
const e = Qe(null), n = Gi(!1), o =
|
|
3784
|
-
|
|
3785
|
-
...He,
|
|
3786
|
-
styles: { ...He.styles },
|
|
3787
|
-
textContents: { ...He.textContents }
|
|
3788
|
-
};
|
|
3789
|
-
if (t.mode ? w.mode = t.mode : t.variant && (w.mode = t.variant), t.layout ? w.layout = t.layout : w.layout = w.mode === "orb" ? "fixed" : "inline", t.position ? w.position = t.position : t.placement && (w.position = t.placement), t["background-color"] && (w.styles.backgroundColor = t["background-color"]), t["text-color"] && (w.styles.textColor = t["text-color"]), t["show-transcript"] !== void 0 && (w.showTranscript = ze(t["show-transcript"])), t["show-text-input"] !== void 0 && (w.showTextInput = ze(t["show-text-input"])), t["show-mute-button"] !== void 0 && (w.showMuteButton = ze(t["show-mute-button"])), t["interaction-mode"] && (w.interactionMode = t["interaction-mode"]), t["start-expanded"] !== void 0 && (w.startExpanded = ze(t["start-expanded"])), t["text-call-to-action"] && (w.textContents.callToAction = t["text-call-to-action"]), t["override-config"])
|
|
3742
|
+
function Ar(t) {
|
|
3743
|
+
const e = Qe(null), n = Gi(!1), o = gr(t["agent-id"], t["api-base-url"]), c = Ie(() => {
|
|
3744
|
+
if (t["override-config"])
|
|
3790
3745
|
try {
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
t
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
t["text-color"],
|
|
3805
|
-
t["show-transcript"],
|
|
3806
|
-
t["show-text-input"],
|
|
3807
|
-
t["show-mute-button"],
|
|
3808
|
-
t["interaction-mode"],
|
|
3809
|
-
t["start-expanded"],
|
|
3810
|
-
t["text-call-to-action"],
|
|
3811
|
-
t["override-config"],
|
|
3812
|
-
o.serverConfig.value
|
|
3813
|
-
]);
|
|
3814
|
-
St(() => {
|
|
3746
|
+
const I = JSON.parse(t["override-config"]), R = It({ ...We }, I);
|
|
3747
|
+
return R.mode === "orb" && (R.layout = "fixed"), R;
|
|
3748
|
+
} catch (I) {
|
|
3749
|
+
console.warn("[AnamWidget] Invalid override-config JSON:", I);
|
|
3750
|
+
}
|
|
3751
|
+
const A = o.serverConfig.value, w = A ? It({ ...We }, A) : { ...We };
|
|
3752
|
+
return w.mode === "orb" && (w.layout = "fixed"), w;
|
|
3753
|
+
}, [t["override-config"], o.serverConfig.value]);
|
|
3754
|
+
yt(() => {
|
|
3755
|
+
if (t["override-config"]) {
|
|
3756
|
+
o.skipFetch();
|
|
3757
|
+
return;
|
|
3758
|
+
}
|
|
3815
3759
|
o.fetchWidgetConfig();
|
|
3816
|
-
}, [t["agent-id"], t["api-base-url"]]);
|
|
3817
|
-
const a = o.avatarThumbnailUrl.value || null, u = c.textContents.callToAction ===
|
|
3760
|
+
}, [t["agent-id"], t["api-base-url"], t["override-config"]]);
|
|
3761
|
+
const a = o.avatarThumbnailUrl.value || null, u = c.textContents.callToAction === We.textContents.callToAction && o.personaName.value ? `Talk to ${o.personaName.value}` : c.textContents.callToAction, l = Ie(
|
|
3818
3762
|
() => `--anam-background: ${c.styles.backgroundColor}; --anam-text: ${c.styles.textColor};`,
|
|
3819
3763
|
[c.styles.backgroundColor, c.styles.textColor]
|
|
3820
3764
|
), g = Ie(() => {
|
|
3821
3765
|
if (c.layout !== "fixed") return "";
|
|
3822
|
-
const
|
|
3823
|
-
return Object.entries(
|
|
3766
|
+
const A = xn(c.position);
|
|
3767
|
+
return Object.entries(A).map(([w, I]) => `${w}: ${I}`).join("; ");
|
|
3824
3768
|
}, [c.layout, c.position]), p = [l, g].filter(Boolean).join("; "), _ = Qe(!1), d = () => {
|
|
3825
3769
|
n.value = !0, _.current = !1, setTimeout(() => {
|
|
3826
3770
|
e.current && o.startSession(e.current);
|
|
@@ -3828,10 +3772,10 @@ function Tr(t) {
|
|
|
3828
3772
|
}, S = async () => {
|
|
3829
3773
|
o.connectionStatus.value !== "idle" && await o.stopSession(), _.current = !1, n.value = !1;
|
|
3830
3774
|
}, m = c.mode === "orb", y = o.connectionStatus.value;
|
|
3831
|
-
(y === "connecting" || y === "connected") && (_.current = !0),
|
|
3775
|
+
(y === "connecting" || y === "connected") && (_.current = !0), yt(() => {
|
|
3832
3776
|
m && n.value && y === "idle" && _.current && (_.current = !1, n.value = !1);
|
|
3833
3777
|
}, [y]);
|
|
3834
|
-
const
|
|
3778
|
+
const b = m ? n.value : !0;
|
|
3835
3779
|
return o.isReady.value ? /* @__PURE__ */ C(oe, { children: [
|
|
3836
3780
|
/* @__PURE__ */ C("style", { children: ui }),
|
|
3837
3781
|
/* @__PURE__ */ C(
|
|
@@ -3851,8 +3795,8 @@ function Tr(t) {
|
|
|
3851
3795
|
children: a ? /* @__PURE__ */ C("img", { src: a, alt: "Avatar" }) : /* @__PURE__ */ C(bt, {})
|
|
3852
3796
|
}
|
|
3853
3797
|
),
|
|
3854
|
-
|
|
3855
|
-
|
|
3798
|
+
b && /* @__PURE__ */ C(
|
|
3799
|
+
br,
|
|
3856
3800
|
{
|
|
3857
3801
|
config: c,
|
|
3858
3802
|
session: o,
|
|
@@ -3867,7 +3811,14 @@ function Tr(t) {
|
|
|
3867
3811
|
)
|
|
3868
3812
|
] }) : /* @__PURE__ */ C("style", { children: ui });
|
|
3869
3813
|
}
|
|
3870
|
-
const
|
|
3814
|
+
const Tr = [
|
|
3815
|
+
"agent-id",
|
|
3816
|
+
// Persona ID — required for session streaming + server config fetch
|
|
3817
|
+
"api-base-url",
|
|
3818
|
+
// API URL override (default: https://api.anam.ai)
|
|
3819
|
+
"override-config"
|
|
3820
|
+
// JSON string — bypasses server fetch when set
|
|
3821
|
+
], Nr = {
|
|
3871
3822
|
SESSION_STARTED: "anam-agent:session-started",
|
|
3872
3823
|
SESSION_ENDED: "anam-agent:session-ended",
|
|
3873
3824
|
MESSAGE_RECEIVED: "anam-agent:message-received",
|
|
@@ -3879,13 +3830,13 @@ const xr = {
|
|
|
3879
3830
|
MIC_UNMUTED: "anam-agent:mic-unmuted"
|
|
3880
3831
|
};
|
|
3881
3832
|
function di(t = "anam-agent") {
|
|
3882
|
-
|
|
3833
|
+
pn(Ar, t, [...Tr], {
|
|
3883
3834
|
shadow: !0
|
|
3884
3835
|
});
|
|
3885
3836
|
}
|
|
3886
3837
|
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => di()) : di());
|
|
3887
3838
|
export {
|
|
3888
|
-
|
|
3889
|
-
|
|
3839
|
+
We as DefaultConfig,
|
|
3840
|
+
Nr as WidgetEventNames,
|
|
3890
3841
|
di as registerWidget
|
|
3891
3842
|
};
|