@ariaflowagents/widget 0.5.10 → 0.5.11

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/widget.js CHANGED
@@ -1,31 +1,31 @@
1
- var V, m, Ee, T, ge, Me, He, Te, le, ie, re, B = {}, Pe = [], et = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Z = Array.isArray;
1
+ var B, m, Te, R, me, He, Pe, Ie, ce, re, le, q = {}, Re = [], it = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ee = Array.isArray;
2
2
  function F(t, e) {
3
3
  for (var n in e) t[n] = e[n];
4
4
  return t;
5
5
  }
6
- function ae(t) {
6
+ function ue(t) {
7
7
  t && t.parentNode && t.parentNode.removeChild(t);
8
8
  }
9
9
  function D(t, e, n) {
10
- var i, r, o, _ = {};
11
- for (o in e) o == "key" ? i = e[o] : o == "ref" ? r = e[o] : _[o] = e[o];
12
- if (arguments.length > 2 && (_.children = arguments.length > 3 ? V.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (o in t.defaultProps) _[o] === void 0 && (_[o] = t.defaultProps[o]);
13
- return j(t, _, i, r, null);
10
+ var o, s, i, l = {};
11
+ for (i in e) i == "key" ? o = e[i] : i == "ref" ? s = e[i] : l[i] = e[i];
12
+ if (arguments.length > 2 && (l.children = arguments.length > 3 ? B.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (i in t.defaultProps) l[i] === void 0 && (l[i] = t.defaultProps[i]);
13
+ return Q(t, l, o, s, null);
14
14
  }
15
- function j(t, e, n, i, r) {
16
- var o = { type: t, props: e, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: r ?? ++Ee, __i: -1, __u: 0 };
17
- return r == null && m.vnode != null && m.vnode(o), o;
15
+ function Q(t, e, n, o, s) {
16
+ var i = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: s ?? ++Te, __i: -1, __u: 0 };
17
+ return s == null && m.vnode != null && m.vnode(i), i;
18
18
  }
19
- function L(t) {
19
+ function U(t) {
20
20
  return t.children;
21
21
  }
22
- function J(t, e) {
22
+ function K(t, e) {
23
23
  this.props = t, this.context = e;
24
24
  }
25
- function R(t, e) {
26
- if (e == null) return t.__ ? R(t.__, t.__i + 1) : null;
25
+ function O(t, e) {
26
+ if (e == null) return t.__ ? O(t.__, t.__i + 1) : null;
27
27
  for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
28
- return typeof t.type == "function" ? R(t) : null;
28
+ return typeof t.type == "function" ? O(t) : null;
29
29
  }
30
30
  function Ue(t) {
31
31
  var e, n;
@@ -37,57 +37,57 @@ function Ue(t) {
37
37
  return Ue(t);
38
38
  }
39
39
  }
40
- function pe(t) {
41
- (!t.__d && (t.__d = !0) && T.push(t) && !Q.__r++ || ge != m.debounceRendering) && ((ge = m.debounceRendering) || Me)(Q);
42
- }
43
- function Q() {
44
- for (var t, e, n, i, r, o, _, a = 1; T.length; ) T.length > a && T.sort(He), t = T.shift(), a = T.length, t.__d && (n = void 0, i = void 0, r = (i = (e = t).__v).__e, o = [], _ = [], e.__P && ((n = F({}, i)).__v = i.__v + 1, m.vnode && m.vnode(n), ce(e.__P, n, i, e.__n, e.__P.namespaceURI, 32 & i.__u ? [r] : null, o, r ?? R(i), !!(32 & i.__u), _), n.__v = i.__v, n.__.__k[n.__i] = n, Re(o, n, _), i.__e = i.__ = null, n.__e != r && Ue(n)));
45
- Q.__r = 0;
46
- }
47
- function Ie(t, e, n, i, r, o, _, a, c, l, d) {
48
- var s, f, u, w, C, v, p, h = i && i.__k || Pe, S = e.length;
49
- for (c = tt(n, e, h, c, S), s = 0; s < S; s++) (u = n.__k[s]) != null && (f = u.__i == -1 ? B : h[u.__i] || B, u.__i = s, v = ce(t, u, f, r, o, _, a, c, l, d), w = u.__e, u.ref && f.ref != u.ref && (f.ref && ue(f.ref, null, u), d.push(u.ref, u.__c || w, u)), C == null && w != null && (C = w), (p = !!(4 & u.__u)) || f.__k === u.__k ? c = De(u, c, t, p) : typeof u.type == "function" && v !== void 0 ? c = v : w && (c = w.nextSibling), u.__u &= -7);
50
- return n.__e = C, c;
40
+ function ye(t) {
41
+ (!t.__d && (t.__d = !0) && R.push(t) && !X.__r++ || me != m.debounceRendering) && ((me = m.debounceRendering) || He)(X);
51
42
  }
52
- function tt(t, e, n, i, r) {
53
- var o, _, a, c, l, d = n.length, s = d, f = 0;
54
- for (t.__k = new Array(r), o = 0; o < r; o++) (_ = e[o]) != null && typeof _ != "boolean" && typeof _ != "function" ? (typeof _ == "string" || typeof _ == "number" || typeof _ == "bigint" || _.constructor == String ? _ = t.__k[o] = j(null, _, null, null, null) : Z(_) ? _ = t.__k[o] = j(L, { children: _ }, null, null, null) : _.constructor === void 0 && _.__b > 0 ? _ = t.__k[o] = j(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : t.__k[o] = _, c = o + f, _.__ = t, _.__b = t.__b + 1, a = null, (l = _.__i = nt(_, n, c, s)) != -1 && (s--, (a = n[l]) && (a.__u |= 2)), a == null || a.__v == null ? (l == -1 && (r > d ? f-- : r < d && f++), typeof _.type != "function" && (_.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, _.__u |= 4))) : t.__k[o] = null;
55
- if (s) for (o = 0; o < d; o++) (a = n[o]) != null && !(2 & a.__u) && (a.__e == i && (i = R(a)), Oe(a, a));
56
- return i;
57
- }
58
- function De(t, e, n, i) {
59
- var r, o;
43
+ function X() {
44
+ for (var t, e, n, o, s, i, l, _ = 1; R.length; ) R.length > _ && R.sort(Pe), t = R.shift(), _ = R.length, t.__d && (n = void 0, o = void 0, s = (o = (e = t).__v).__e, i = [], l = [], e.__P && ((n = F({}, o)).__v = o.__v + 1, m.vnode && m.vnode(n), de(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [s] : null, i, s ?? O(o), !!(32 & o.__u), l), n.__v = o.__v, n.__.__k[n.__i] = n, Le(i, n, l), o.__e = o.__ = null, n.__e != s && Ue(n)));
45
+ X.__r = 0;
46
+ }
47
+ function De(t, e, n, o, s, i, l, _, c, a, d) {
48
+ var r, g, u, w, A, y, p, f = o && o.__k || Re, x = e.length;
49
+ for (c = st(n, e, f, c, x), r = 0; r < x; r++) (u = n.__k[r]) != null && (g = u.__i == -1 ? q : f[u.__i] || q, u.__i = r, y = de(t, u, g, s, i, l, _, c, a, d), w = u.__e, u.ref && g.ref != u.ref && (g.ref && he(g.ref, null, u), d.push(u.ref, u.__c || w, u)), A == null && w != null && (A = w), (p = !!(4 & u.__u)) || g.__k === u.__k ? c = Oe(u, c, t, p) : typeof u.type == "function" && y !== void 0 ? c = y : w && (c = w.nextSibling), u.__u &= -7);
50
+ return n.__e = A, c;
51
+ }
52
+ function st(t, e, n, o, s) {
53
+ var i, l, _, c, a, d = n.length, r = d, g = 0;
54
+ for (t.__k = new Array(s), i = 0; i < s; i++) (l = e[i]) != null && typeof l != "boolean" && typeof l != "function" ? (typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? l = t.__k[i] = Q(null, l, null, null, null) : ee(l) ? l = t.__k[i] = Q(U, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? l = t.__k[i] = Q(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : t.__k[i] = l, c = i + g, l.__ = t, l.__b = t.__b + 1, _ = null, (a = l.__i = rt(l, n, c, r)) != -1 && (r--, (_ = n[a]) && (_.__u |= 2)), _ == null || _.__v == null ? (a == -1 && (s > d ? g-- : s < d && g++), typeof l.type != "function" && (l.__u |= 4)) : a != c && (a == c - 1 ? g-- : a == c + 1 ? g++ : (a > c ? g-- : g++, l.__u |= 4))) : t.__k[i] = null;
55
+ if (r) for (i = 0; i < d; i++) (_ = n[i]) != null && !(2 & _.__u) && (_.__e == o && (o = O(_)), qe(_, _));
56
+ return o;
57
+ }
58
+ function Oe(t, e, n, o) {
59
+ var s, i;
60
60
  if (typeof t.type == "function") {
61
- for (r = t.__k, o = 0; r && o < r.length; o++) r[o] && (r[o].__ = t, e = De(r[o], e, n, i));
61
+ for (s = t.__k, i = 0; s && i < s.length; i++) s[i] && (s[i].__ = t, e = Oe(s[i], e, n, o));
62
62
  return e;
63
63
  }
64
- t.__e != e && (i && (e && t.type && !e.parentNode && (e = R(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
64
+ t.__e != e && (o && (e && t.type && !e.parentNode && (e = O(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
65
65
  do
66
66
  e = e && e.nextSibling;
67
67
  while (e != null && e.nodeType == 8);
68
68
  return e;
69
69
  }
70
- function nt(t, e, n, i) {
71
- var r, o, _, a = t.key, c = t.type, l = e[n], d = l != null && (2 & l.__u) == 0;
72
- if (l === null && a == null || d && a == l.key && c == l.type) return n;
73
- if (i > (d ? 1 : 0)) {
74
- for (r = n - 1, o = n + 1; r >= 0 || o < e.length; ) if ((l = e[_ = r >= 0 ? r-- : o++]) != null && !(2 & l.__u) && a == l.key && c == l.type) return _;
70
+ function rt(t, e, n, o) {
71
+ var s, i, l, _ = t.key, c = t.type, a = e[n], d = a != null && (2 & a.__u) == 0;
72
+ if (a === null && _ == null || d && _ == a.key && c == a.type) return n;
73
+ if (o > (d ? 1 : 0)) {
74
+ for (s = n - 1, i = n + 1; s >= 0 || i < e.length; ) if ((a = e[l = s >= 0 ? s-- : i++]) != null && !(2 & a.__u) && _ == a.key && c == a.type) return l;
75
75
  }
76
76
  return -1;
77
77
  }
78
- function me(t, e, n) {
79
- e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || et.test(e) ? n : n + "px";
78
+ function ve(t, e, n) {
79
+ e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || it.test(e) ? n : n + "px";
80
80
  }
81
- function K(t, e, n, i, r) {
82
- var o, _;
81
+ function V(t, e, n, o, s) {
82
+ var i, l;
83
83
  e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
84
84
  else {
85
- if (typeof i == "string" && (t.style.cssText = i = ""), i) for (e in i) n && e in n || me(t.style, e, "");
86
- if (n) for (e in n) i && n[e] == i[e] || me(t.style, e, n[e]);
85
+ if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || ve(t.style, e, "");
86
+ if (n) for (e in n) o && n[e] == o[e] || ve(t.style, e, n[e]);
87
87
  }
88
- else if (e[0] == "o" && e[1] == "n") o = e != (e = e.replace(Te, "$1")), _ = e.toLowerCase(), e = _ in t || e == "onFocusOut" || e == "onFocusIn" ? _.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + o] = n, n ? i ? n.u = i.u : (n.u = le, t.addEventListener(e, o ? re : ie, o)) : t.removeEventListener(e, o ? re : ie, o);
88
+ else if (e[0] == "o" && e[1] == "n") i = e != (e = e.replace(Ie, "$1")), l = e.toLowerCase(), e = l in t || e == "onFocusOut" || e == "onFocusIn" ? l.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + i] = n, n ? o ? n.u = o.u : (n.u = ce, t.addEventListener(e, i ? le : re, i)) : t.removeEventListener(e, i ? le : re, i);
89
89
  else {
90
- if (r == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
90
+ if (s == "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 {
92
92
  t[e] = n ?? "";
93
93
  break e;
@@ -96,299 +96,299 @@ function K(t, e, n, i, r) {
96
96
  typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
97
97
  }
98
98
  }
99
- function ve(t) {
99
+ function we(t) {
100
100
  return function(e) {
101
101
  if (this.l) {
102
102
  var n = this.l[e.type + t];
103
- if (e.t == null) e.t = le++;
103
+ if (e.t == null) e.t = ce++;
104
104
  else if (e.t < n.u) return;
105
105
  return n(m.event ? m.event(e) : e);
106
106
  }
107
107
  };
108
108
  }
109
- function ce(t, e, n, i, r, o, _, a, c, l) {
110
- var d, s, f, u, w, C, v, p, h, S, A, E, $, q, k, M, H, W = e.type;
109
+ function de(t, e, n, o, s, i, l, _, c, a) {
110
+ var d, r, g, u, w, A, y, p, f, x, S, H, $, z, k, P, I, W = e.type;
111
111
  if (e.constructor !== void 0) return null;
112
- 128 & n.__u && (c = !!(32 & n.__u), o = [a = e.__e = n.__e]), (d = m.__b) && d(e);
112
+ 128 & n.__u && (c = !!(32 & n.__u), i = [_ = e.__e = n.__e]), (d = m.__b) && d(e);
113
113
  e: if (typeof W == "function") try {
114
- if (p = e.props, h = "prototype" in W && W.prototype.render, S = (d = W.contextType) && i[d.__c], A = d ? S ? S.props.value : d.__ : i, n.__c ? v = (s = e.__c = n.__c).__ = s.__E : (h ? e.__c = s = new W(p, A) : (e.__c = s = new J(p, A), s.constructor = W, s.render = it), S && S.sub(s), s.state || (s.state = {}), s.__n = i, f = s.__d = !0, s.__h = [], s._sb = []), h && s.__s == null && (s.__s = s.state), h && W.getDerivedStateFromProps != null && (s.__s == s.state && (s.__s = F({}, s.__s)), F(s.__s, W.getDerivedStateFromProps(p, s.__s))), u = s.props, w = s.state, s.__v = e, f) h && W.getDerivedStateFromProps == null && s.componentWillMount != null && s.componentWillMount(), h && s.componentDidMount != null && s.__h.push(s.componentDidMount);
114
+ if (p = e.props, f = "prototype" in W && W.prototype.render, x = (d = W.contextType) && o[d.__c], S = d ? x ? x.props.value : d.__ : o, n.__c ? y = (r = e.__c = n.__c).__ = r.__E : (f ? e.__c = r = new W(p, S) : (e.__c = r = new K(p, S), r.constructor = W, r.render = at), x && x.sub(r), r.state || (r.state = {}), r.__n = o, g = r.__d = !0, r.__h = [], r._sb = []), f && r.__s == null && (r.__s = r.state), f && W.getDerivedStateFromProps != null && (r.__s == r.state && (r.__s = F({}, r.__s)), F(r.__s, W.getDerivedStateFromProps(p, r.__s))), u = r.props, w = r.state, r.__v = e, g) f && W.getDerivedStateFromProps == null && r.componentWillMount != null && r.componentWillMount(), f && r.componentDidMount != null && r.__h.push(r.componentDidMount);
115
115
  else {
116
- if (h && W.getDerivedStateFromProps == null && p !== u && s.componentWillReceiveProps != null && s.componentWillReceiveProps(p, A), e.__v == n.__v || !s.__e && s.shouldComponentUpdate != null && s.shouldComponentUpdate(p, s.__s, A) === !1) {
117
- for (e.__v != n.__v && (s.props = p, s.state = s.__s, s.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(N) {
118
- N && (N.__ = e);
119
- }), E = 0; E < s._sb.length; E++) s.__h.push(s._sb[E]);
120
- s._sb = [], s.__h.length && _.push(s);
116
+ if (f && W.getDerivedStateFromProps == null && p !== u && r.componentWillReceiveProps != null && r.componentWillReceiveProps(p, S), e.__v == n.__v || !r.__e && r.shouldComponentUpdate != null && r.shouldComponentUpdate(p, r.__s, S) === !1) {
117
+ for (e.__v != n.__v && (r.props = p, r.state = r.__s, r.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(M) {
118
+ M && (M.__ = e);
119
+ }), H = 0; H < r._sb.length; H++) r.__h.push(r._sb[H]);
120
+ r._sb = [], r.__h.length && l.push(r);
121
121
  break e;
122
122
  }
123
- s.componentWillUpdate != null && s.componentWillUpdate(p, s.__s, A), h && s.componentDidUpdate != null && s.__h.push(function() {
124
- s.componentDidUpdate(u, w, C);
123
+ r.componentWillUpdate != null && r.componentWillUpdate(p, r.__s, S), f && r.componentDidUpdate != null && r.__h.push(function() {
124
+ r.componentDidUpdate(u, w, A);
125
125
  });
126
126
  }
127
- if (s.context = A, s.props = p, s.__P = t, s.__e = !1, $ = m.__r, q = 0, h) {
128
- for (s.state = s.__s, s.__d = !1, $ && $(e), d = s.render(s.props, s.state, s.context), k = 0; k < s._sb.length; k++) s.__h.push(s._sb[k]);
129
- s._sb = [];
127
+ if (r.context = S, r.props = p, r.__P = t, r.__e = !1, $ = m.__r, z = 0, f) {
128
+ for (r.state = r.__s, r.__d = !1, $ && $(e), d = r.render(r.props, r.state, r.context), k = 0; k < r._sb.length; k++) r.__h.push(r._sb[k]);
129
+ r._sb = [];
130
130
  } else do
131
- s.__d = !1, $ && $(e), d = s.render(s.props, s.state, s.context), s.state = s.__s;
132
- while (s.__d && ++q < 25);
133
- s.state = s.__s, s.getChildContext != null && (i = F(F({}, i), s.getChildContext())), h && !f && s.getSnapshotBeforeUpdate != null && (C = s.getSnapshotBeforeUpdate(u, w)), M = d, d != null && d.type === L && d.key == null && (M = Le(d.props.children)), a = Ie(t, Z(M) ? M : [M], e, n, i, r, o, _, a, c, l), s.base = e.__e, e.__u &= -161, s.__h.length && _.push(s), v && (s.__E = s.__ = null);
134
- } catch (N) {
135
- if (e.__v = null, c || o != null) if (N.then) {
136
- for (e.__u |= c ? 160 : 128; a && a.nodeType == 8 && a.nextSibling; ) a = a.nextSibling;
137
- o[o.indexOf(a)] = null, e.__e = a;
131
+ r.__d = !1, $ && $(e), d = r.render(r.props, r.state, r.context), r.state = r.__s;
132
+ while (r.__d && ++z < 25);
133
+ r.state = r.__s, r.getChildContext != null && (o = F(F({}, o), r.getChildContext())), f && !g && r.getSnapshotBeforeUpdate != null && (A = r.getSnapshotBeforeUpdate(u, w)), P = d, d != null && d.type === U && d.key == null && (P = Qe(d.props.children)), _ = De(t, ee(P) ? P : [P], e, n, o, s, i, l, _, c, a), r.base = e.__e, e.__u &= -161, r.__h.length && l.push(r), y && (r.__E = r.__ = null);
134
+ } catch (M) {
135
+ if (e.__v = null, c || i != null) if (M.then) {
136
+ for (e.__u |= c ? 160 : 128; _ && _.nodeType == 8 && _.nextSibling; ) _ = _.nextSibling;
137
+ i[i.indexOf(_)] = null, e.__e = _;
138
138
  } else {
139
- for (H = o.length; H--; ) ae(o[H]);
140
- se(e);
139
+ for (I = i.length; I--; ) ue(i[I]);
140
+ ae(e);
141
141
  }
142
- else e.__e = n.__e, e.__k = n.__k, N.then || se(e);
143
- m.__e(N, e, n);
142
+ else e.__e = n.__e, e.__k = n.__k, M.then || ae(e);
143
+ m.__e(M, e, n);
144
144
  }
145
- else o == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : a = e.__e = ot(n.__e, e, n, i, r, o, _, c, l);
146
- return (d = m.diffed) && d(e), 128 & e.__u ? void 0 : a;
145
+ else i == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : _ = e.__e = lt(n.__e, e, n, o, s, i, l, c, a);
146
+ return (d = m.diffed) && d(e), 128 & e.__u ? void 0 : _;
147
147
  }
148
- function se(t) {
149
- t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(se);
148
+ function ae(t) {
149
+ t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(ae);
150
150
  }
151
- function Re(t, e, n) {
152
- for (var i = 0; i < n.length; i++) ue(n[i], n[++i], n[++i]);
153
- m.__c && m.__c(e, t), t.some(function(r) {
151
+ function Le(t, e, n) {
152
+ for (var o = 0; o < n.length; o++) he(n[o], n[++o], n[++o]);
153
+ m.__c && m.__c(e, t), t.some(function(s) {
154
154
  try {
155
- t = r.__h, r.__h = [], t.some(function(o) {
156
- o.call(r);
155
+ t = s.__h, s.__h = [], t.some(function(i) {
156
+ i.call(s);
157
157
  });
158
- } catch (o) {
159
- m.__e(o, r.__v);
158
+ } catch (i) {
159
+ m.__e(i, s.__v);
160
160
  }
161
161
  });
162
162
  }
163
- function Le(t) {
164
- return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : Z(t) ? t.map(Le) : F({}, t);
163
+ function Qe(t) {
164
+ return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : ee(t) ? t.map(Qe) : F({}, t);
165
165
  }
166
- function ot(t, e, n, i, r, o, _, a, c) {
167
- var l, d, s, f, u, w, C, v = n.props || B, p = e.props, h = e.type;
168
- if (h == "svg" ? r = "http://www.w3.org/2000/svg" : h == "math" ? r = "http://www.w3.org/1998/Math/MathML" : r || (r = "http://www.w3.org/1999/xhtml"), o != null) {
169
- for (l = 0; l < o.length; l++) if ((u = o[l]) && "setAttribute" in u == !!h && (h ? u.localName == h : u.nodeType == 3)) {
170
- t = u, o[l] = null;
166
+ function lt(t, e, n, o, s, i, l, _, c) {
167
+ var a, d, r, g, u, w, A, y = n.props || q, p = e.props, f = e.type;
168
+ if (f == "svg" ? s = "http://www.w3.org/2000/svg" : f == "math" ? s = "http://www.w3.org/1998/Math/MathML" : s || (s = "http://www.w3.org/1999/xhtml"), i != null) {
169
+ for (a = 0; a < i.length; a++) if ((u = i[a]) && "setAttribute" in u == !!f && (f ? u.localName == f : u.nodeType == 3)) {
170
+ t = u, i[a] = null;
171
171
  break;
172
172
  }
173
173
  }
174
174
  if (t == null) {
175
- if (h == null) return document.createTextNode(p);
176
- t = document.createElementNS(r, h, p.is && p), a && (m.__m && m.__m(e, o), a = !1), o = null;
175
+ if (f == null) return document.createTextNode(p);
176
+ t = document.createElementNS(s, f, p.is && p), _ && (m.__m && m.__m(e, i), _ = !1), i = null;
177
177
  }
178
- if (h == null) v === p || a && t.data == p || (t.data = p);
178
+ if (f == null) y === p || _ && t.data == p || (t.data = p);
179
179
  else {
180
- if (o = o && V.call(t.childNodes), !a && o != null) for (v = {}, l = 0; l < t.attributes.length; l++) v[(u = t.attributes[l]).name] = u.value;
181
- for (l in v) if (u = v[l], l != "children") {
182
- if (l == "dangerouslySetInnerHTML") s = u;
183
- else if (!(l in p)) {
184
- if (l == "value" && "defaultValue" in p || l == "checked" && "defaultChecked" in p) continue;
185
- K(t, l, null, u, r);
180
+ if (i = i && B.call(t.childNodes), !_ && i != null) for (y = {}, a = 0; a < t.attributes.length; a++) y[(u = t.attributes[a]).name] = u.value;
181
+ for (a in y) if (u = y[a], a != "children") {
182
+ if (a == "dangerouslySetInnerHTML") r = u;
183
+ else if (!(a in p)) {
184
+ if (a == "value" && "defaultValue" in p || a == "checked" && "defaultChecked" in p) continue;
185
+ V(t, a, null, u, s);
186
186
  }
187
187
  }
188
- for (l in p) u = p[l], l == "children" ? f = u : l == "dangerouslySetInnerHTML" ? d = u : l == "value" ? w = u : l == "checked" ? C = u : a && typeof u != "function" || v[l] === u || K(t, l, u, v[l], r);
189
- if (d) a || s && (d.__html == s.__html || d.__html == t.innerHTML) || (t.innerHTML = d.__html), e.__k = [];
190
- else if (s && (t.innerHTML = ""), Ie(e.type == "template" ? t.content : t, Z(f) ? f : [f], e, n, i, h == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, o, _, o ? o[0] : n.__k && R(n, 0), a, c), o != null) for (l = o.length; l--; ) ae(o[l]);
191
- a || (l = "value", h == "progress" && w == null ? t.removeAttribute("value") : w != null && (w !== t[l] || h == "progress" && !w || h == "option" && w != v[l]) && K(t, l, w, v[l], r), l = "checked", C != null && C != t[l] && K(t, l, C, v[l], r));
188
+ for (a in p) u = p[a], a == "children" ? g = u : a == "dangerouslySetInnerHTML" ? d = u : a == "value" ? w = u : a == "checked" ? A = u : _ && typeof u != "function" || y[a] === u || V(t, a, u, y[a], s);
189
+ if (d) _ || r && (d.__html == r.__html || d.__html == t.innerHTML) || (t.innerHTML = d.__html), e.__k = [];
190
+ else if (r && (t.innerHTML = ""), De(e.type == "template" ? t.content : t, ee(g) ? g : [g], e, n, o, f == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, i, l, i ? i[0] : n.__k && O(n, 0), _, c), i != null) for (a = i.length; a--; ) ue(i[a]);
191
+ _ || (a = "value", f == "progress" && w == null ? t.removeAttribute("value") : w != null && (w !== t[a] || f == "progress" && !w || f == "option" && w != y[a]) && V(t, a, w, y[a], s), a = "checked", A != null && A != t[a] && V(t, a, A, y[a], s));
192
192
  }
193
193
  return t;
194
194
  }
195
- function ue(t, e, n) {
195
+ function he(t, e, n) {
196
196
  try {
197
197
  if (typeof t == "function") {
198
- var i = typeof t.__u == "function";
199
- i && t.__u(), i && e == null || (t.__u = t(e));
198
+ var o = typeof t.__u == "function";
199
+ o && t.__u(), o && e == null || (t.__u = t(e));
200
200
  } else t.current = e;
201
- } catch (r) {
202
- m.__e(r, n);
201
+ } catch (s) {
202
+ m.__e(s, n);
203
203
  }
204
204
  }
205
- function Oe(t, e, n) {
206
- var i, r;
207
- if (m.unmount && m.unmount(t), (i = t.ref) && (i.current && i.current != t.__e || ue(i, null, e)), (i = t.__c) != null) {
208
- if (i.componentWillUnmount) try {
209
- i.componentWillUnmount();
210
- } catch (o) {
211
- m.__e(o, e);
205
+ function qe(t, e, n) {
206
+ var o, s;
207
+ if (m.unmount && m.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || he(o, null, e)), (o = t.__c) != null) {
208
+ if (o.componentWillUnmount) try {
209
+ o.componentWillUnmount();
210
+ } catch (i) {
211
+ m.__e(i, e);
212
212
  }
213
- i.base = i.__P = null;
213
+ o.base = o.__P = null;
214
214
  }
215
- if (i = t.__k) for (r = 0; r < i.length; r++) i[r] && Oe(i[r], e, n || typeof t.type != "function");
216
- n || ae(t.__e), t.__c = t.__ = t.__e = void 0;
215
+ if (o = t.__k) for (s = 0; s < o.length; s++) o[s] && qe(o[s], e, n || typeof t.type != "function");
216
+ n || ue(t.__e), t.__c = t.__ = t.__e = void 0;
217
217
  }
218
- function it(t, e, n) {
218
+ function at(t, e, n) {
219
219
  return this.constructor(t, n);
220
220
  }
221
- function ee(t, e, n) {
222
- var i, r, o, _;
223
- e == document && (e = document.documentElement), m.__ && m.__(t, e), r = (i = typeof n == "function") ? null : n && n.__k || e.__k, o = [], _ = [], ce(e, t = (!i && n || e).__k = D(L, null, [t]), r || B, B, e.namespaceURI, !i && n ? [n] : r ? null : e.firstChild ? V.call(e.childNodes) : null, o, !i && n ? n : r ? r.__e : e.firstChild, i, _), Re(o, t, _);
221
+ function te(t, e, n) {
222
+ var o, s, i, l;
223
+ e == document && (e = document.documentElement), m.__ && m.__(t, e), s = (o = typeof n == "function") ? null : n && n.__k || e.__k, i = [], l = [], de(e, t = (!o && n || e).__k = D(U, null, [t]), s || q, q, e.namespaceURI, !o && n ? [n] : s ? null : e.firstChild ? B.call(e.childNodes) : null, i, !o && n ? n : s ? s.__e : e.firstChild, o, l), Le(i, t, l);
224
224
  }
225
225
  function je(t, e) {
226
- ee(t, e, je);
226
+ te(t, e, je);
227
227
  }
228
228
  function Be(t, e, n) {
229
- var i, r, o, _, a = F({}, t.props);
230
- for (o in t.type && t.type.defaultProps && (_ = t.type.defaultProps), e) o == "key" ? i = e[o] : o == "ref" ? r = e[o] : a[o] = e[o] === void 0 && _ != null ? _[o] : e[o];
231
- return arguments.length > 2 && (a.children = arguments.length > 3 ? V.call(arguments, 2) : n), j(t.type, a, i || t.key, r || t.ref, null);
232
- }
233
- V = Pe.slice, m = { __e: function(t, e, n, i) {
234
- for (var r, o, _; e = e.__; ) if ((r = e.__c) && !r.__) try {
235
- if ((o = r.constructor) && o.getDerivedStateFromError != null && (r.setState(o.getDerivedStateFromError(t)), _ = r.__d), r.componentDidCatch != null && (r.componentDidCatch(t, i || {}), _ = r.__d), _) return r.__E = r;
236
- } catch (a) {
237
- t = a;
229
+ var o, s, i, l, _ = F({}, t.props);
230
+ for (i in t.type && t.type.defaultProps && (l = t.type.defaultProps), e) i == "key" ? o = e[i] : i == "ref" ? s = e[i] : _[i] = e[i] === void 0 && l != null ? l[i] : e[i];
231
+ return arguments.length > 2 && (_.children = arguments.length > 3 ? B.call(arguments, 2) : n), Q(t.type, _, o || t.key, s || t.ref, null);
232
+ }
233
+ B = Re.slice, m = { __e: function(t, e, n, o) {
234
+ for (var s, i, l; e = e.__; ) if ((s = e.__c) && !s.__) try {
235
+ if ((i = s.constructor) && i.getDerivedStateFromError != null && (s.setState(i.getDerivedStateFromError(t)), l = s.__d), s.componentDidCatch != null && (s.componentDidCatch(t, o || {}), l = s.__d), l) return s.__E = s;
236
+ } catch (_) {
237
+ t = _;
238
238
  }
239
239
  throw t;
240
- } }, Ee = 0, J.prototype.setState = function(t, e) {
240
+ } }, Te = 0, K.prototype.setState = function(t, e) {
241
241
  var n;
242
- n = this.__s != null && this.__s != this.state ? this.__s : this.__s = F({}, this.state), typeof t == "function" && (t = t(F({}, n), this.props)), t && F(n, t), t != null && this.__v && (e && this._sb.push(e), pe(this));
243
- }, J.prototype.forceUpdate = function(t) {
244
- this.__v && (this.__e = !0, t && this.__h.push(t), pe(this));
245
- }, J.prototype.render = L, T = [], Me = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, He = function(t, e) {
242
+ n = this.__s != null && this.__s != this.state ? this.__s : this.__s = F({}, this.state), typeof t == "function" && (t = t(F({}, n), this.props)), t && F(n, t), t != null && this.__v && (e && this._sb.push(e), ye(this));
243
+ }, K.prototype.forceUpdate = function(t) {
244
+ this.__v && (this.__e = !0, t && this.__h.push(t), ye(this));
245
+ }, K.prototype.render = U, R = [], He = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Pe = function(t, e) {
246
246
  return t.__v.__b - e.__v.__b;
247
- }, Q.__r = 0, Te = /(PointerCapture)$|Capture$/i, le = 0, ie = ve(!1), re = ve(!0);
248
- function X() {
249
- return X = Object.assign ? Object.assign.bind() : function(t) {
247
+ }, X.__r = 0, Ie = /(PointerCapture)$|Capture$/i, ce = 0, re = we(!1), le = we(!0);
248
+ function Y() {
249
+ return Y = Object.assign ? Object.assign.bind() : function(t) {
250
250
  for (var e = 1; e < arguments.length; e++) {
251
251
  var n = arguments[e];
252
- for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
252
+ for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
253
253
  }
254
254
  return t;
255
- }, X.apply(this, arguments);
255
+ }, Y.apply(this, arguments);
256
256
  }
257
257
  function ze(t, e) {
258
258
  if (t == null) return {};
259
- var n, i, r = {}, o = Object.keys(t);
260
- for (i = 0; i < o.length; i++) e.indexOf(n = o[i]) >= 0 || (r[n] = t[n]);
261
- return r;
262
- }
263
- var rt = ["context", "children"], st = ["useFragment"];
264
- function _t(t, e, n, i) {
265
- function r() {
266
- var o = Reflect.construct(HTMLElement, [], r);
267
- return o._vdomComponent = t, o._root = o, o;
268
- }
269
- return (r.prototype = Object.create(HTMLElement.prototype)).constructor = r, r.prototype.connectedCallback = function() {
270
- at.call(this, i);
271
- }, r.prototype.attributeChangedCallback = ct, r.prototype.disconnectedCallback = ut, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), r.observedAttributes = n, t.formAssociated && (r.formAssociated = !0), n.forEach(function(o) {
272
- Object.defineProperty(r.prototype, o, { get: function() {
273
- return this._vdom ? this._vdom.props[o] : this._props[o];
274
- }, set: function(_) {
275
- this._vdom ? this.attributeChangedCallback(o, null, _) : (this._props || (this._props = {}), this._props[o] = _);
276
- var a = typeof _;
277
- _ != null && a !== "string" && a !== "boolean" && a !== "number" || this.setAttribute(o, _);
259
+ var n, o, s = {}, i = Object.keys(t);
260
+ for (o = 0; o < i.length; o++) e.indexOf(n = i[o]) >= 0 || (s[n] = t[n]);
261
+ return s;
262
+ }
263
+ var _t = ["context", "children"], ct = ["useFragment"];
264
+ function ut(t, e, n, o) {
265
+ function s() {
266
+ var i = Reflect.construct(HTMLElement, [], s);
267
+ return i._vdomComponent = t, i._root = i, i;
268
+ }
269
+ return (s.prototype = Object.create(HTMLElement.prototype)).constructor = s, s.prototype.connectedCallback = function() {
270
+ ht.call(this, o);
271
+ }, s.prototype.attributeChangedCallback = gt, s.prototype.disconnectedCallback = ft, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), s.observedAttributes = n, t.formAssociated && (s.formAssociated = !0), n.forEach(function(i) {
272
+ Object.defineProperty(s.prototype, i, { get: function() {
273
+ return this._vdom ? this._vdom.props[i] : this._props[i];
274
+ }, set: function(l) {
275
+ this._vdom ? this.attributeChangedCallback(i, null, l) : (this._props || (this._props = {}), this._props[i] = l);
276
+ var _ = typeof l;
277
+ l != null && _ !== "string" && _ !== "boolean" && _ !== "number" || this.setAttribute(i, l);
278
278
  } });
279
- }), customElements.define(e, r), r;
279
+ }), customElements.define(e, s), s;
280
280
  }
281
- function lt(t) {
281
+ function dt(t) {
282
282
  this.getChildContext = function() {
283
283
  return t.context;
284
284
  };
285
- var e = t.children, n = ze(t, rt);
285
+ var e = t.children, n = ze(t, _t);
286
286
  return Be(e, n);
287
287
  }
288
- function at(t) {
288
+ function ht(t) {
289
289
  var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
290
- this.dispatchEvent(e), this._vdom = D(lt, X({}, this._props, { context: e.detail.context }), qe(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? je : ee)(this._vdom, this._root);
290
+ this.dispatchEvent(e), this._vdom = D(dt, Y({}, this._props, { context: e.detail.context }), Je(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? je : te)(this._vdom, this._root);
291
291
  }
292
292
  function Ve(t) {
293
293
  return t.replace(/-(\w)/g, function(e, n) {
294
294
  return n ? n.toUpperCase() : "";
295
295
  });
296
296
  }
297
- function ct(t, e, n) {
297
+ function gt(t, e, n) {
298
298
  if (this._vdom) {
299
- var i = {};
300
- i[t] = n = n ?? void 0, i[Ve(t)] = n, this._vdom = Be(this._vdom, i), ee(this._vdom, this._root);
299
+ var o = {};
300
+ o[t] = n = n ?? void 0, o[Ve(t)] = n, this._vdom = Be(this._vdom, o), te(this._vdom, this._root);
301
301
  }
302
302
  }
303
- function ut() {
304
- ee(this._vdom = null, this._root);
303
+ function ft() {
304
+ te(this._vdom = null, this._root);
305
305
  }
306
- function ye(t, e) {
307
- var n = this, i = t.useFragment, r = ze(t, st);
308
- return D(i ? L : "slot", X({}, r, { ref: function(o) {
309
- o ? (n.ref = o, n._listener || (n._listener = function(_) {
310
- _.stopPropagation(), _.detail.context = e;
311
- }, o.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
306
+ function be(t, e) {
307
+ var n = this, o = t.useFragment, s = ze(t, ct);
308
+ return D(o ? U : "slot", Y({}, s, { ref: function(i) {
309
+ i ? (n.ref = i, n._listener || (n._listener = function(l) {
310
+ l.stopPropagation(), l.detail.context = e;
311
+ }, i.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
312
312
  } }));
313
313
  }
314
- function qe(t, e, n) {
314
+ function Je(t, e, n) {
315
315
  if (t.nodeType === 3) return t.data;
316
316
  if (t.nodeType !== 1) return null;
317
- var i = [], r = {}, o = 0, _ = t.attributes, a = t.childNodes;
318
- for (o = _.length; o--; ) _[o].name !== "slot" && (r[_[o].name] = _[o].value, r[Ve(_[o].name)] = _[o].value);
319
- for (o = a.length; o--; ) {
320
- var c = qe(a[o], null, n), l = a[o].slot;
321
- l ? r[l] = D(ye, { name: l }, c) : i[o] = c;
317
+ var o = [], s = {}, i = 0, l = t.attributes, _ = t.childNodes;
318
+ for (i = l.length; i--; ) l[i].name !== "slot" && (s[l[i].name] = l[i].value, s[Ve(l[i].name)] = l[i].value);
319
+ for (i = _.length; i--; ) {
320
+ var c = Je(_[i], null, n), a = _[i].slot;
321
+ a ? s[a] = D(be, { name: a }, c) : o[i] = c;
322
322
  }
323
- var d = !(!n || !n.shadow), s = e ? D(ye, { useFragment: !d }, i) : i;
324
- return !d && e && (t.innerHTML = ""), D(e || t.nodeName.toLowerCase(), r, s);
323
+ var d = !(!n || !n.shadow), r = e ? D(be, { useFragment: !d }, o) : o;
324
+ return !d && e && (t.innerHTML = ""), D(e || t.nodeName.toLowerCase(), s, r);
325
325
  }
326
- var dt = 0;
327
- function g(t, e, n, i, r, o) {
326
+ var pt = 0;
327
+ function h(t, e, n, o, s, i) {
328
328
  e || (e = {});
329
- var _, a, c = e;
330
- if ("ref" in c) for (a in c = {}, e) a == "ref" ? _ = e[a] : c[a] = e[a];
331
- var l = { type: t, props: c, key: n, ref: _, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --dt, __i: -1, __u: 0, __source: r, __self: o };
332
- if (typeof t == "function" && (_ = t.defaultProps)) for (a in _) c[a] === void 0 && (c[a] = _[a]);
333
- return m.vnode && m.vnode(l), l;
334
- }
335
- var z, y, te, we, Y = 0, Ke = [], b = m, be = b.__b, ke = b.__r, Ce = b.diffed, Ae = b.__c, $e = b.unmount, We = b.__;
336
- function de(t, e) {
337
- b.__h && b.__h(y, t, Y || e), Y = 0;
338
- var n = y.__H || (y.__H = { __: [], __h: [] });
329
+ var l, _, c = e;
330
+ if ("ref" in c) for (_ in c = {}, e) _ == "ref" ? l = e[_] : c[_] = e[_];
331
+ var a = { type: t, props: c, key: n, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --pt, __i: -1, __u: 0, __source: s, __self: i };
332
+ if (typeof t == "function" && (l = t.defaultProps)) for (_ in l) c[_] === void 0 && (c[_] = l[_]);
333
+ return m.vnode && m.vnode(a), a;
334
+ }
335
+ var j, v, ie, Ce, Z = 0, Ke = [], b = m, ke = b.__b, Ae = b.__r, Se = b.diffed, $e = b.__c, We = b.unmount, Ne = b.__;
336
+ function ge(t, e) {
337
+ b.__h && b.__h(v, t, Z || e), Z = 0;
338
+ var n = v.__H || (v.__H = { __: [], __h: [] });
339
339
  return t >= n.__.length && n.__.push({}), n.__[t];
340
340
  }
341
- function I(t) {
342
- return Y = 1, ft(Ge, t);
343
- }
344
- function ft(t, e, n) {
345
- var i = de(z++, 2);
346
- if (i.t = t, !i.__c && (i.__ = [Ge(void 0, e), function(a) {
347
- var c = i.__N ? i.__N[0] : i.__[0], l = i.t(c, a);
348
- c !== l && (i.__N = [l, i.__[1]], i.__c.setState({}));
349
- }], i.__c = y, !y.__f)) {
350
- var r = function(a, c, l) {
351
- if (!i.__c.__H) return !0;
352
- var d = i.__c.__H.__.filter(function(f) {
353
- return !!f.__c;
341
+ function T(t) {
342
+ return Z = 1, mt(Xe, t);
343
+ }
344
+ function mt(t, e, n) {
345
+ var o = ge(j++, 2);
346
+ if (o.t = t, !o.__c && (o.__ = [Xe(void 0, e), function(_) {
347
+ var c = o.__N ? o.__N[0] : o.__[0], a = o.t(c, _);
348
+ c !== a && (o.__N = [a, o.__[1]], o.__c.setState({}));
349
+ }], o.__c = v, !v.__f)) {
350
+ var s = function(_, c, a) {
351
+ if (!o.__c.__H) return !0;
352
+ var d = o.__c.__H.__.filter(function(g) {
353
+ return !!g.__c;
354
354
  });
355
- if (d.every(function(f) {
356
- return !f.__N;
357
- })) return !o || o.call(this, a, c, l);
358
- var s = i.__c.props !== a;
359
- return d.forEach(function(f) {
360
- if (f.__N) {
361
- var u = f.__[0];
362
- f.__ = f.__N, f.__N = void 0, u !== f.__[0] && (s = !0);
355
+ if (d.every(function(g) {
356
+ return !g.__N;
357
+ })) return !i || i.call(this, _, c, a);
358
+ var r = o.__c.props !== _;
359
+ return d.forEach(function(g) {
360
+ if (g.__N) {
361
+ var u = g.__[0];
362
+ g.__ = g.__N, g.__N = void 0, u !== g.__[0] && (r = !0);
363
363
  }
364
- }), o && o.call(this, a, c, l) || s;
364
+ }), i && i.call(this, _, c, a) || r;
365
365
  };
366
- y.__f = !0;
367
- var o = y.shouldComponentUpdate, _ = y.componentWillUpdate;
368
- y.componentWillUpdate = function(a, c, l) {
366
+ v.__f = !0;
367
+ var i = v.shouldComponentUpdate, l = v.componentWillUpdate;
368
+ v.componentWillUpdate = function(_, c, a) {
369
369
  if (this.__e) {
370
- var d = o;
371
- o = void 0, r(a, c, l), o = d;
370
+ var d = i;
371
+ i = void 0, s(_, c, a), i = d;
372
372
  }
373
- _ && _.call(this, a, c, l);
374
- }, y.shouldComponentUpdate = r;
373
+ l && l.call(this, _, c, a);
374
+ }, v.shouldComponentUpdate = s;
375
375
  }
376
- return i.__N || i.__;
376
+ return o.__N || o.__;
377
377
  }
378
378
  function xe(t, e) {
379
- var n = de(z++, 3);
380
- !b.__s && Je(n.__H, e) && (n.__ = t, n.u = e, y.__H.__h.push(n));
379
+ var n = ge(j++, 3);
380
+ !b.__s && Ge(n.__H, e) && (n.__ = t, n.u = e, v.__H.__h.push(n));
381
381
  }
382
- function Se(t) {
383
- return Y = 5, ht(function() {
382
+ function Fe(t) {
383
+ return Z = 5, yt(function() {
384
384
  return { current: t };
385
385
  }, []);
386
386
  }
387
- function ht(t, e) {
388
- var n = de(z++, 7);
389
- return Je(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
387
+ function yt(t, e) {
388
+ var n = ge(j++, 7);
389
+ return Ge(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
390
390
  }
391
- function gt() {
391
+ function vt() {
392
392
  for (var t; t = Ke.shift(); ) if (t.__P && t.__H) try {
393
393
  t.__H.__h.forEach(G), t.__H.__h.forEach(_e), t.__H.__h = [];
394
394
  } catch (e) {
@@ -396,77 +396,77 @@ function gt() {
396
396
  }
397
397
  }
398
398
  b.__b = function(t) {
399
- y = null, be && be(t);
399
+ v = null, ke && ke(t);
400
400
  }, b.__ = function(t, e) {
401
- t && e.__k && e.__k.__m && (t.__m = e.__k.__m), We && We(t, e);
401
+ t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Ne && Ne(t, e);
402
402
  }, b.__r = function(t) {
403
- ke && ke(t), z = 0;
404
- var e = (y = t.__c).__H;
405
- e && (te === y ? (e.__h = [], y.__h = [], e.__.forEach(function(n) {
403
+ Ae && Ae(t), j = 0;
404
+ var e = (v = t.__c).__H;
405
+ e && (ie === v ? (e.__h = [], v.__h = [], e.__.forEach(function(n) {
406
406
  n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
407
- })) : (e.__h.forEach(G), e.__h.forEach(_e), e.__h = [], z = 0)), te = y;
407
+ })) : (e.__h.forEach(G), e.__h.forEach(_e), e.__h = [], j = 0)), ie = v;
408
408
  }, b.diffed = function(t) {
409
- Ce && Ce(t);
409
+ Se && Se(t);
410
410
  var e = t.__c;
411
- e && e.__H && (e.__H.__h.length && (Ke.push(e) !== 1 && we === b.requestAnimationFrame || ((we = b.requestAnimationFrame) || pt)(gt)), e.__H.__.forEach(function(n) {
411
+ e && e.__H && (e.__H.__h.length && (Ke.push(e) !== 1 && Ce === b.requestAnimationFrame || ((Ce = b.requestAnimationFrame) || wt)(vt)), e.__H.__.forEach(function(n) {
412
412
  n.u && (n.__H = n.u), n.u = void 0;
413
- })), te = y = null;
413
+ })), ie = v = null;
414
414
  }, b.__c = function(t, e) {
415
415
  e.some(function(n) {
416
416
  try {
417
- n.__h.forEach(G), n.__h = n.__h.filter(function(i) {
418
- return !i.__ || _e(i);
417
+ n.__h.forEach(G), n.__h = n.__h.filter(function(o) {
418
+ return !o.__ || _e(o);
419
419
  });
420
- } catch (i) {
421
- e.some(function(r) {
422
- r.__h && (r.__h = []);
423
- }), e = [], b.__e(i, n.__v);
420
+ } catch (o) {
421
+ e.some(function(s) {
422
+ s.__h && (s.__h = []);
423
+ }), e = [], b.__e(o, n.__v);
424
424
  }
425
- }), Ae && Ae(t, e);
425
+ }), $e && $e(t, e);
426
426
  }, b.unmount = function(t) {
427
- $e && $e(t);
427
+ We && We(t);
428
428
  var e, n = t.__c;
429
- n && n.__H && (n.__H.__.forEach(function(i) {
429
+ n && n.__H && (n.__H.__.forEach(function(o) {
430
430
  try {
431
- G(i);
432
- } catch (r) {
433
- e = r;
431
+ G(o);
432
+ } catch (s) {
433
+ e = s;
434
434
  }
435
435
  }), n.__H = void 0, e && b.__e(e, n.__v));
436
436
  };
437
- var Ne = typeof requestAnimationFrame == "function";
438
- function pt(t) {
437
+ var Me = typeof requestAnimationFrame == "function";
438
+ function wt(t) {
439
439
  var e, n = function() {
440
- clearTimeout(i), Ne && cancelAnimationFrame(e), setTimeout(t);
441
- }, i = setTimeout(n, 35);
442
- Ne && (e = requestAnimationFrame(n));
440
+ clearTimeout(o), Me && cancelAnimationFrame(e), setTimeout(t);
441
+ }, o = setTimeout(n, 35);
442
+ Me && (e = requestAnimationFrame(n));
443
443
  }
444
444
  function G(t) {
445
- var e = y, n = t.__c;
446
- typeof n == "function" && (t.__c = void 0, n()), y = e;
445
+ var e = v, n = t.__c;
446
+ typeof n == "function" && (t.__c = void 0, n()), v = e;
447
447
  }
448
448
  function _e(t) {
449
- var e = y;
450
- t.__c = t.__(), y = e;
449
+ var e = v;
450
+ t.__c = t.__(), v = e;
451
451
  }
452
- function Je(t, e) {
453
- return !t || t.length !== e.length || e.some(function(n, i) {
454
- return n !== t[i];
452
+ function Ge(t, e) {
453
+ return !t || t.length !== e.length || e.some(function(n, o) {
454
+ return n !== t[o];
455
455
  });
456
456
  }
457
- function Ge(t, e) {
457
+ function Xe(t, e) {
458
458
  return typeof e == "function" ? e(t) : e;
459
459
  }
460
- const mt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
461
- let ne = (t = 21) => {
460
+ const bt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
461
+ let J = (t = 21) => {
462
462
  let e = "", n = crypto.getRandomValues(new Uint8Array(t |= 0));
463
463
  for (; t--; )
464
- e += mt[n[t] & 63];
464
+ e += bt[n[t] & 63];
465
465
  return e;
466
466
  };
467
- class vt {
467
+ class Ct {
468
468
  constructor(e, n) {
469
- this.agentUrl = e, this.agentId = n, this.agentConfig = null, this.ws = null, this.messageCallbacks = /* @__PURE__ */ new Set(), this.connectionCallbacks = /* @__PURE__ */ new Set(), this.messages = [], this.reconnectAttempts = 0, this.maxReconnectAttempts = 5, this.reconnectDelay = 1e3;
469
+ this.agentUrl = e, this.agentId = n, this.agentConfig = null, this.ws = null, this.messageCallbacks = /* @__PURE__ */ new Set(), this.connectionCallbacks = /* @__PURE__ */ new Set(), this.streamingCallbacks = /* @__PURE__ */ new Set(), this.queueCallbacks = /* @__PURE__ */ new Set(), this.messages = [], this.reconnectAttempts = 0, this.maxReconnectAttempts = 5, this.reconnectDelay = 1e3, this.isAgentStreaming = !1, this.messageQueue = [];
470
470
  }
471
471
  /**
472
472
  * Initialize the widget by fetching agent configuration
@@ -477,8 +477,8 @@ class vt {
477
477
  try {
478
478
  const n = await fetch(`${this.agentUrl}/api/agent/${this.agentId}`);
479
479
  if (n.ok) {
480
- const i = await n.json();
481
- return console.log("[AriaFlow Widget] Agent config received:", i), !i || i.status !== "active" ? (console.error("Agent not found or inactive"), null) : (this.agentConfig = i, this.maxReconnectAttempts = i.config.maxRetries || 5, this.reconnectDelay = i.config.reconnectDelay || 1e3, await this.connectToAgent(), i);
480
+ const o = await n.json();
481
+ return console.log("[AriaFlow Widget] Agent config received:", o), !o || o.status !== "active" ? (console.error("Agent not found or inactive"), null) : (this.agentConfig = o, this.maxReconnectAttempts = o.config.maxRetries || 5, this.reconnectDelay = o.config.reconnectDelay || 1e3, await this.connectToAgent(), o);
482
482
  }
483
483
  } catch {
484
484
  console.warn("[AriaFlow Widget] Agent config endpoint not available, trying fallback");
@@ -512,23 +512,23 @@ class vt {
512
512
  if (!this.agentConfig?.wsUrl)
513
513
  throw new Error("No agent WebSocket URL configured");
514
514
  const e = this.getSessionId(), n = `${this.agentConfig.wsUrl}/${e}`;
515
- return console.log("[AriaFlow Widget] Connecting to WebSocket:", n), new Promise((i, r) => {
515
+ return console.log("[AriaFlow Widget] Connecting to WebSocket:", n), new Promise((o, s) => {
516
516
  try {
517
517
  this.ws = new WebSocket(n), this.ws.onopen = () => {
518
- console.log("[Widget] Connected to agent"), this.reconnectAttempts = 0, this.notifyConnectionChange(!0), i();
519
- }, this.ws.onmessage = (o) => {
520
- this.handleMessage(o);
518
+ console.log("[Widget] Connected to agent"), this.reconnectAttempts = 0, this.notifyConnectionChange(!0), o();
519
+ }, this.ws.onmessage = (i) => {
520
+ this.handleMessage(i);
521
521
  }, this.ws.onclose = () => {
522
522
  if (console.log("[Widget] Disconnected from agent"), this.notifyConnectionChange(!1), this.reconnectAttempts < this.maxReconnectAttempts) {
523
523
  this.reconnectAttempts++;
524
- const o = this.reconnectDelay * Math.pow(2, this.reconnectAttempts - 1);
525
- console.log(`[Widget] Reconnecting in ${o}ms... (attempt ${this.reconnectAttempts})`), setTimeout(() => this.connectToAgent(), o);
524
+ const i = this.reconnectDelay * Math.pow(2, this.reconnectAttempts - 1);
525
+ console.log(`[Widget] Reconnecting in ${i}ms... (attempt ${this.reconnectAttempts})`), setTimeout(() => this.connectToAgent(), i);
526
526
  }
527
- }, this.ws.onerror = (o) => {
528
- console.error("[Widget] WebSocket error:", o), r(o);
527
+ }, this.ws.onerror = (i) => {
528
+ console.error("[Widget] WebSocket error:", i), s(i);
529
529
  };
530
- } catch (o) {
531
- r(o);
530
+ } catch (i) {
531
+ s(i);
532
532
  }
533
533
  });
534
534
  }
@@ -538,16 +538,52 @@ class vt {
538
538
  handleMessage(e) {
539
539
  try {
540
540
  const n = JSON.parse(e.data);
541
- n.type === "text-delta" ? this.setMessages((i) => {
542
- const r = i[i.length - 1];
543
- return r && r.role === "assistant" ? [
544
- ...i.slice(0, -1),
545
- { ...r, content: r.content + n.text }
546
- ] : [
547
- ...i,
548
- { id: ne(), role: "assistant", content: n.text, timestamp: Date.now() }
549
- ];
550
- }) : n.type === "done" ? console.log("[Widget] Response complete") : n.type === "handoff" ? console.log(`[Widget] Handoff: ${n.from} -> ${n.to}: ${n.reason}`) : n.type === "tool-call" ? console.log("[Widget] Tool call:", n.tool) : console.log("[Widget] Unknown message type:", n.type);
541
+ if (n.type === "text-delta")
542
+ this.setMessages((o) => {
543
+ const s = o[o.length - 1];
544
+ return s && s.role === "assistant" && s.isStreaming ? [
545
+ ...o.slice(0, -1),
546
+ { ...s, content: s.content + n.text }
547
+ ] : [
548
+ ...o,
549
+ {
550
+ id: J(),
551
+ role: "assistant",
552
+ content: n.text,
553
+ timestamp: Date.now(),
554
+ isStreaming: !0
555
+ }
556
+ ];
557
+ });
558
+ else if (n.type === "done")
559
+ console.log("[Widget] Response complete"), this.setMessages((o) => {
560
+ const s = o[o.length - 1];
561
+ return s && s.role === "assistant" && s.isStreaming ? [
562
+ ...o.slice(0, -1),
563
+ { ...s, isStreaming: !1 }
564
+ ] : o;
565
+ }), this.isAgentStreaming = !1, this.notifyStreamingChange(!1), this.processMessageQueue();
566
+ else if (n.type === "tool-call") {
567
+ console.log("[Widget] Tool call:", n.tool);
568
+ const o = {
569
+ id: J(),
570
+ role: "tool",
571
+ content: `Calling tool: ${n.tool.name}`,
572
+ timestamp: Date.now(),
573
+ toolCall: {
574
+ name: n.tool.name,
575
+ arguments: n.tool.arguments
576
+ }
577
+ };
578
+ this.setMessages((s) => [...s, o]);
579
+ } else n.type === "tool-result" ? (console.log("[Widget] Tool result:", n.result), this.setMessages((o) => {
580
+ const s = o[o.length - 1];
581
+ return s && s.role === "tool" && !s.toolResult ? [
582
+ ...o.slice(0, -1),
583
+ { ...s, content: s.content + `
584
+ Result: ${JSON.stringify(n.result)}`, toolResult: n.result }
585
+ ] : o;
586
+ })) : n.type === "agent-start" ? (console.log(`[Widget] Agent started: ${n.agentId}`), this.isAgentStreaming = !0, this.notifyStreamingChange(!0)) : n.type === "handoff" ? console.log(`[Widget] Handoff: ${n.from} -> ${n.to}: ${n.reason}`) : console.log("[Widget] Unknown message type:", n.type);
551
587
  } catch (n) {
552
588
  console.error("[Widget] Error parsing message:", e.data, n);
553
589
  }
@@ -559,21 +595,47 @@ class vt {
559
595
  if (!this.ws || this.ws.readyState !== WebSocket.OPEN)
560
596
  throw new Error("Not connected to agent");
561
597
  const n = {
562
- id: ne(),
598
+ id: J(),
563
599
  role: "user",
564
600
  content: e,
565
601
  timestamp: Date.now()
566
602
  };
567
- this.setMessages((r) => [...r, n]);
568
- const i = this.getSessionId();
569
- this.ws.send(JSON.stringify({ message: e, sessionId: i }));
603
+ if (this.setMessages((o) => [...o, n]), this.isAgentStreaming) {
604
+ console.log("[Widget] Agent is streaming, queuing message"), this.messageQueue.push(e), this.notifyQueueChange(this.messageQueue.length);
605
+ return;
606
+ }
607
+ this.sendToAgent(e);
608
+ }
609
+ /**
610
+ * Send message to agent via WebSocket
611
+ */
612
+ async sendToAgent(e) {
613
+ const n = this.getSessionId();
614
+ this.ws.send(JSON.stringify({ message: e, sessionId: n }));
615
+ }
616
+ /**
617
+ * Process queued messages when agent is done streaming
618
+ */
619
+ async processMessageQueue() {
620
+ if (this.messageQueue.length !== 0) {
621
+ if (this.messageQueue.length === 1) {
622
+ const e = this.messageQueue.shift();
623
+ console.log("[Widget] Sending queued message:", e), this.sendToAgent(e);
624
+ } else {
625
+ const e = this.messageQueue.join(`
626
+
627
+ `);
628
+ this.messageQueue.length = 0, console.log("[Widget] Sending combined queued messages:", e), this.sendToAgent(e);
629
+ }
630
+ this.notifyQueueChange(this.messageQueue.length);
631
+ }
570
632
  }
571
633
  /**
572
634
  * Get or generate session ID
573
635
  */
574
636
  getSessionId() {
575
637
  let e = sessionStorage.getItem("ariaflow_session_id");
576
- return e || (e = ne(), sessionStorage.setItem("ariaflow_session_id", e)), e;
638
+ return e || (e = J(), sessionStorage.setItem("ariaflow_session_id", e)), e;
577
639
  }
578
640
  /**
579
641
  * Update messages state
@@ -597,12 +659,40 @@ class vt {
597
659
  this.connectionCallbacks.delete(e);
598
660
  };
599
661
  }
662
+ /**
663
+ * Register a callback for streaming state changes
664
+ */
665
+ onStreamingChange(e) {
666
+ return this.streamingCallbacks.add(e), () => {
667
+ this.streamingCallbacks.delete(e);
668
+ };
669
+ }
670
+ /**
671
+ * Register a callback for queue count changes
672
+ */
673
+ onQueueChange(e) {
674
+ return this.queueCallbacks.add(e), () => {
675
+ this.queueCallbacks.delete(e);
676
+ };
677
+ }
600
678
  /**
601
679
  * Notify all connection callbacks
602
680
  */
603
681
  notifyConnectionChange(e) {
604
682
  this.connectionCallbacks.forEach((n) => n(e));
605
683
  }
684
+ /**
685
+ * Notify all streaming callbacks
686
+ */
687
+ notifyStreamingChange(e) {
688
+ this.streamingCallbacks.forEach((n) => n(e));
689
+ }
690
+ /**
691
+ * Notify all queue callbacks
692
+ */
693
+ notifyQueueChange(e) {
694
+ this.queueCallbacks.forEach((n) => n(e));
695
+ }
606
696
  /**
607
697
  * Get current messages
608
698
  */
@@ -628,84 +718,88 @@ class vt {
628
718
  this.ws && (this.ws.close(), this.ws = null), this.messageCallbacks.clear(), this.connectionCallbacks.clear();
629
719
  }
630
720
  }
631
- const oe = {
721
+ const se = {
632
722
  none: "0",
633
723
  small: "0.375rem",
634
724
  medium: "0.75rem",
635
725
  large: "1rem"
636
726
  };
637
- function yt({
727
+ function kt({
638
728
  agentUrl: t,
639
729
  agentId: e,
640
730
  // Legacy props for backward compatibility
641
731
  widgetId: n,
642
- apiUrl: i,
643
- mode: r = "chat",
644
- theme: o = "light",
645
- position: _ = "bottom-right",
646
- size: a = "full",
732
+ apiUrl: o,
733
+ mode: s = "chat",
734
+ theme: i = "light",
735
+ position: l = "bottom-right",
736
+ size: _ = "full",
647
737
  radius: c = "medium",
648
- baseColor: l,
738
+ baseColor: a,
649
739
  accentColor: d = "#14B8A6",
650
- buttonBaseColor: s = "#000000",
651
- buttonAccentColor: f = "#FFFFFF",
740
+ buttonBaseColor: r = "#000000",
741
+ buttonAccentColor: g = "#FFFFFF",
652
742
  title: u,
653
743
  subtitle: w,
654
- emptyChatMessage: C
744
+ emptyChatMessage: A
655
745
  }) {
656
- const [v, p] = I(!1), [h, S] = I([]), [A, E] = I(""), [$, q] = I(!1), [k, M] = I(!1), [H, W] = I(null), N = Se(null), fe = Se(null);
746
+ const [y, p] = T(!1), [f, x] = T([]), [S, H] = T(""), [$, z] = T(!1), [k, P] = T(!1), [I, W] = T(null), [M, Ye] = T(!1), [ne, Ze] = T(0), oe = Fe(null), fe = Fe(null);
657
747
  xe(() => ((async () => {
658
748
  if (t && e) {
659
749
  console.log("[AriaFlow Widget] Using new agent resolution:", { agentUrl: t, agentId: e });
660
- const P = new vt(t, e);
661
- N.current = P;
750
+ const E = new Ct(t, e);
751
+ oe.current = E;
662
752
  try {
663
- P.onMessages((U) => {
664
- console.log("[AriaFlow Widget] Messages updated:", U.length), S(U);
665
- }), P.onConnectionChange((U) => {
666
- console.log("[AriaFlow Widget] Connection state:", U), q(U), U && M(!0);
753
+ E.onMessages((N) => {
754
+ console.log("[AriaFlow Widget] Messages updated:", N.length), x(N);
755
+ }), E.onConnectionChange((N) => {
756
+ console.log("[AriaFlow Widget] Connection state:", N), z(N), N && P(!0);
757
+ }), E.onStreamingChange((N) => {
758
+ console.log("[AriaFlow Widget] Streaming state:", N), Ye(N);
759
+ }), E.onQueueChange((N) => {
760
+ console.log("[AriaFlow Widget] Queue count:", N), Ze(N);
667
761
  });
668
- const O = await P.initWidget();
669
- console.log("[AriaFlow Widget] Agent config received:", O), O ? (W(O), console.log("[AriaFlow Widget] Widget initialized successfully")) : console.error("[AriaFlow Widget] Agent config fetch failed");
670
- } catch (O) {
671
- console.error("[AriaFlow Widget] Initialization error:", O);
762
+ const L = await E.initWidget();
763
+ console.log("[AriaFlow Widget] Agent config received:", L), L ? (W(L), console.log("[AriaFlow Widget] Widget initialized successfully")) : console.error("[AriaFlow Widget] Agent config fetch failed");
764
+ } catch (L) {
765
+ console.error("[AriaFlow Widget] Initialization error:", L);
672
766
  }
673
- } else t && !e ? (console.warn("[AriaFlow Widget] Direct WebSocket URLs are deprecated. Use agent-url + agent-id instead."), console.error("[AriaFlow Widget] Configuration error: agent-id is required")) : i && n ? (console.warn("[AriaFlow Widget] Legacy widget config is deprecated. Use agent-url + agent-id instead."), console.error("[AriaFlow Widget] Configuration error: use agent-url + agent-id instead")) : console.error("[AriaFlow Widget] Invalid configuration. Provide agent-url and agent-id.");
767
+ } else t && !e ? (console.warn("[AriaFlow Widget] Direct WebSocket URLs are deprecated. Use agent-url + agent-id instead."), console.error("[AriaFlow Widget] Configuration error: agent-id is required")) : o && n ? (console.warn("[AriaFlow Widget] Legacy widget config is deprecated. Use agent-url + agent-id instead."), console.error("[AriaFlow Widget] Configuration error: use agent-url + agent-id instead")) : console.error("[AriaFlow Widget] Invalid configuration. Provide agent-url and agent-id.");
674
768
  })(), () => {
675
- N.current?.dispose();
676
- }), [t, e, n, i]), xe(() => {
769
+ oe.current?.dispose();
770
+ }), [t, e, n, o]), xe(() => {
677
771
  fe.current?.scrollIntoView({ behavior: "smooth" });
678
- }, [h]);
679
- const he = async () => {
680
- if (!A.trim() || !$) return;
681
- const x = A.trim();
682
- E("");
772
+ }, [f]);
773
+ const pe = async () => {
774
+ if (!S.trim() || !$) return;
775
+ const C = S.trim();
776
+ H("");
683
777
  try {
684
- await N.current?.sendMessage(x);
685
- } catch (P) {
686
- console.error("Failed to send message:", P);
778
+ await oe.current?.sendMessage(C);
779
+ } catch (E) {
780
+ console.error("Failed to send message:", E);
687
781
  }
688
- }, Qe = (x) => {
689
- x.key === "Enter" && !x.shiftKey && (x.preventDefault(), he());
690
- }, Xe = u || H?.title || "Chat with us", Ye = w || H?.subtitle || "We typically reply within minutes", Ze = C || H?.config?.emptyChatMessage || "Start a conversation...";
691
- return console.log("[AriaFlow Widget] Rendering widget component", { isInitialized: k, isOpen: v, position: _ }), /* @__PURE__ */ g(
782
+ }, et = (C) => {
783
+ C.key === "Enter" && !C.shiftKey && (C.preventDefault(), pe());
784
+ }, tt = u || I?.title || "Chat with us", nt = w || I?.subtitle || "We typically reply within minutes", ot = A || I?.config?.emptyChatMessage || "Start a conversation...";
785
+ return console.log("[AriaFlow Widget] Rendering widget component", { isInitialized: k, isOpen: y, position: l }), /* @__PURE__ */ h(
692
786
  "div",
693
787
  {
694
- className: `ariaflow-widget-container ariaflow-widget-${_} ariaflow-widget-${a} ariaflow-widget-radius-${c}`,
695
- "data-theme": o,
788
+ className: `ariaflow-widget-container ariaflow-widget-${l} ariaflow-widget-${_} ariaflow-widget-radius-${c}`,
789
+ "data-theme": i,
696
790
  style: {
697
791
  "--ariaflow-accent-color": d,
698
- "--ariaflow-base-color": l
792
+ "--ariaflow-base-color": a
699
793
  },
700
794
  children: [
701
- !v && /* @__PURE__ */ g(
795
+ !y && /* @__PURE__ */ h(
702
796
  "button",
703
797
  {
704
798
  className: "ariaflow-widget-launcher",
705
799
  onClick: () => p(!0),
706
800
  style: {
707
- backgroundColor: s,
708
- color: f,
801
+ backgroundColor: r,
802
+ color: g,
709
803
  opacity: k ? 1 : 0.8,
710
804
  cursor: k ? "pointer" : "wait",
711
805
  position: "relative"
@@ -714,7 +808,7 @@ function yt({
714
808
  disabled: !k,
715
809
  title: k ? "Click to start chat" : "Connecting to agent...",
716
810
  children: [
717
- !k && /* @__PURE__ */ g(
811
+ !k && /* @__PURE__ */ h(
718
812
  "div",
719
813
  {
720
814
  className: "ariaflow-widget-launcher-loading",
@@ -725,14 +819,14 @@ function yt({
725
819
  transform: "translate(-50%, -50%)",
726
820
  width: "20px",
727
821
  height: "20px",
728
- border: `2px solid ${f}`,
822
+ border: `2px solid ${g}`,
729
823
  borderTop: "2px solid transparent",
730
824
  borderRadius: "50%",
731
825
  animation: "spin 1s linear infinite"
732
826
  }
733
827
  }
734
828
  ),
735
- k && /* @__PURE__ */ g(
829
+ k && /* @__PURE__ */ h(
736
830
  "svg",
737
831
  {
738
832
  width: "24",
@@ -741,41 +835,41 @@ function yt({
741
835
  fill: "none",
742
836
  stroke: "currentColor",
743
837
  strokeWidth: "2",
744
- children: /* @__PURE__ */ g("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
838
+ children: /* @__PURE__ */ h("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
745
839
  }
746
840
  )
747
841
  ]
748
842
  }
749
843
  ),
750
- v && k && /* @__PURE__ */ g(
844
+ y && k && /* @__PURE__ */ h(
751
845
  "div",
752
846
  {
753
847
  className: "ariaflow-widget-window",
754
848
  style: {
755
- backgroundColor: o === "dark" && l ? l : void 0,
756
- borderRadius: oe[c]
849
+ backgroundColor: i === "dark" && a ? a : void 0,
850
+ borderRadius: se[c]
757
851
  },
758
852
  children: [
759
- /* @__PURE__ */ g(
853
+ /* @__PURE__ */ h(
760
854
  "div",
761
855
  {
762
856
  className: "ariaflow-widget-header",
763
857
  style: {
764
858
  backgroundColor: d,
765
- borderRadius: c === "none" ? "0" : `${oe[c]} ${oe[c]} 0 0`
859
+ borderRadius: c === "none" ? "0" : `${se[c]} ${se[c]} 0 0`
766
860
  },
767
861
  children: [
768
- /* @__PURE__ */ g("div", { className: "ariaflow-widget-header-content", children: /* @__PURE__ */ g("div", { className: "ariaflow-widget-title-group", children: [
769
- /* @__PURE__ */ g("h3", { className: "ariaflow-widget-title", children: Xe }),
770
- /* @__PURE__ */ g("p", { className: "ariaflow-widget-subtitle", children: Ye })
862
+ /* @__PURE__ */ h("div", { className: "ariaflow-widget-header-content", children: /* @__PURE__ */ h("div", { className: "ariaflow-widget-title-group", children: [
863
+ /* @__PURE__ */ h("h3", { className: "ariaflow-widget-title", children: tt }),
864
+ /* @__PURE__ */ h("p", { className: "ariaflow-widget-subtitle", children: nt })
771
865
  ] }) }),
772
- /* @__PURE__ */ g(
866
+ /* @__PURE__ */ h(
773
867
  "button",
774
868
  {
775
869
  className: "ariaflow-widget-close",
776
870
  onClick: () => p(!1),
777
871
  "aria-label": "Close chat",
778
- children: /* @__PURE__ */ g(
872
+ children: /* @__PURE__ */ h(
779
873
  "svg",
780
874
  {
781
875
  width: "20",
@@ -785,8 +879,8 @@ function yt({
785
879
  stroke: "currentColor",
786
880
  strokeWidth: "2",
787
881
  children: [
788
- /* @__PURE__ */ g("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
789
- /* @__PURE__ */ g("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
882
+ /* @__PURE__ */ h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
883
+ /* @__PURE__ */ h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
790
884
  ]
791
885
  }
792
886
  )
@@ -795,42 +889,66 @@ function yt({
795
889
  ]
796
890
  }
797
891
  ),
798
- !$ && /* @__PURE__ */ g("div", { className: "ariaflow-widget-status", children: [
799
- /* @__PURE__ */ g("span", { className: "ariaflow-widget-status-dot" }),
892
+ !$ && /* @__PURE__ */ h("div", { className: "ariaflow-widget-status", children: [
893
+ /* @__PURE__ */ h("span", { className: "ariaflow-widget-status-dot" }),
800
894
  "Connecting..."
801
895
  ] }),
802
- /* @__PURE__ */ g("div", { className: "ariaflow-widget-messages", children: h.length === 0 ? /* @__PURE__ */ g("div", { className: "ariaflow-widget-empty", children: /* @__PURE__ */ g("p", { children: $ ? Ze : "Connecting to agent..." }) }) : /* @__PURE__ */ g(L, { children: [
803
- h.map((x) => /* @__PURE__ */ g(
896
+ /* @__PURE__ */ h("div", { className: "ariaflow-widget-messages", children: f.length === 0 ? /* @__PURE__ */ h("div", { className: "ariaflow-widget-empty", children: /* @__PURE__ */ h("p", { children: $ ? ot : "Connecting to agent..." }) }) : /* @__PURE__ */ h(U, { children: [
897
+ f.map((C) => /* @__PURE__ */ h(
804
898
  "div",
805
899
  {
806
- className: `ariaflow-widget-message ariaflow-widget-message-${x.role}`,
807
- children: /* @__PURE__ */ g("div", { className: "ariaflow-widget-message-bubble", children: x.content })
900
+ className: `ariaflow-widget-message ariaflow-widget-message-${C.role}`,
901
+ children: /* @__PURE__ */ h("div", { className: "ariaflow-widget-message-bubble", children: C.role === "tool" ? /* @__PURE__ */ h("div", { className: "ariaflow-widget-tool-message", children: [
902
+ /* @__PURE__ */ h("div", { className: "ariaflow-widget-tool-header", children: [
903
+ "🔧 ",
904
+ C.toolCall?.name
905
+ ] }),
906
+ /* @__PURE__ */ h("div", { className: "ariaflow-widget-tool-content", children: [
907
+ C.toolCall && /* @__PURE__ */ h("div", { className: "ariaflow-widget-tool-args", children: [
908
+ /* @__PURE__ */ h("strong", { children: "Arguments:" }),
909
+ " ",
910
+ JSON.stringify(C.toolCall.arguments, null, 2)
911
+ ] }),
912
+ C.toolResult && /* @__PURE__ */ h("div", { className: "ariaflow-widget-tool-result", children: [
913
+ /* @__PURE__ */ h("strong", { children: "Result:" }),
914
+ " ",
915
+ JSON.stringify(C.toolResult, null, 2)
916
+ ] })
917
+ ] })
918
+ ] }) : /* @__PURE__ */ h(U, { children: [
919
+ C.content,
920
+ C.isStreaming && /* @__PURE__ */ h("span", { className: "ariaflow-widget-typing-indicator", children: [
921
+ /* @__PURE__ */ h("span", { children: "•" }),
922
+ /* @__PURE__ */ h("span", { children: "•" }),
923
+ /* @__PURE__ */ h("span", { children: "•" })
924
+ ] })
925
+ ] }) })
808
926
  },
809
- x.id
927
+ C.id
810
928
  )),
811
- /* @__PURE__ */ g("div", { ref: fe })
929
+ /* @__PURE__ */ h("div", { ref: fe })
812
930
  ] }) }),
813
- /* @__PURE__ */ g("div", { className: "ariaflow-widget-input", children: [
814
- /* @__PURE__ */ g(
931
+ /* @__PURE__ */ h("div", { className: "ariaflow-widget-input", children: [
932
+ /* @__PURE__ */ h(
815
933
  "textarea",
816
934
  {
817
- value: A,
818
- onInput: (x) => E(x.target.value),
819
- onKeyDown: Qe,
820
- placeholder: $ ? "Type your message..." : "Connecting...",
935
+ value: S,
936
+ onInput: (C) => H(C.target.value),
937
+ onKeyDown: et,
938
+ placeholder: $ ? M ? ne > 0 ? `Agent is responding... (${ne} message${ne > 1 ? "s" : ""} queued)` : "Agent is responding..." : "Type your message..." : "Connecting...",
821
939
  rows: 1,
822
940
  disabled: !$
823
941
  }
824
942
  ),
825
- /* @__PURE__ */ g(
943
+ /* @__PURE__ */ h(
826
944
  "button",
827
945
  {
828
946
  className: "ariaflow-widget-send",
829
- onClick: he,
830
- disabled: !A.trim() || !$,
947
+ onClick: pe,
948
+ disabled: !S.trim() || !$,
831
949
  style: { backgroundColor: d },
832
950
  "aria-label": "Send message",
833
- children: /* @__PURE__ */ g(
951
+ children: /* @__PURE__ */ h(
834
952
  "svg",
835
953
  {
836
954
  width: "18",
@@ -840,8 +958,8 @@ function yt({
840
958
  stroke: "currentColor",
841
959
  strokeWidth: "2",
842
960
  children: [
843
- /* @__PURE__ */ g("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
844
- /* @__PURE__ */ g("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
961
+ /* @__PURE__ */ h("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
962
+ /* @__PURE__ */ h("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
845
963
  ]
846
964
  }
847
965
  )
@@ -855,8 +973,8 @@ function yt({
855
973
  }
856
974
  );
857
975
  }
858
- _t(
859
- yt,
976
+ ut(
977
+ kt,
860
978
  "ariaflow-widget",
861
979
  // Properties to observe from HTML attributes (mirror Vapi's naming convention)
862
980
  [
@@ -882,12 +1000,12 @@ _t(
882
1000
  // Shadow DOM (optional, set to false for light DOM)
883
1001
  !1
884
1002
  );
885
- typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", Fe) : Fe());
886
- function Fe() {
1003
+ typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", Ee) : Ee());
1004
+ function Ee() {
887
1005
  const t = document.querySelectorAll("ariaflow-widget");
888
1006
  console.log(`[AriaFlow] Initializing ${t.length} widget(s)`);
889
1007
  }
890
1008
  export {
891
- yt as Widget,
892
- vt as WidgetClient
1009
+ kt as Widget,
1010
+ Ct as WidgetClient
893
1011
  };