@jexity/chat-widget 0.1.0

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.mjs ADDED
@@ -0,0 +1,954 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.jex-widget{--jex-primary: #0070f3;--jex-primary-hover: #0060df;--jex-bg-glass: rgba(255, 255, 255, .7);--jex-border-glass: rgba(255, 255, 255, .3);--jex-text-main: #171717;--jex-text-muted: #666;--jex-shadow: 0 8px 32px 0 rgba(31, 38, 135, .15);--jex-font-family: "Inter", system-ui, -apple-system, sans-serif;font-family:var(--jex-font-family);-webkit-font-smoothing:antialiased}@media(prefers-color-scheme:dark){.jex-widget{--jex-bg-glass: rgba(20, 20, 20, .8);--jex-border-glass: rgba(255, 255, 255, .1);--jex-text-main: #ededed;--jex-text-muted: #a1a1a1}}.jex-widget *{box-sizing:border-box;margin:0;padding:0}.jex-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;align-items:flex-end;gap:16px;z-index:9999}.jex-container.jex-pos-left{right:auto;left:24px;align-items:flex-start}.jex-floating-button{width:56px;height:56px;border-radius:28px;background:var(--jex-primary);color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--jex-shadow);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),background .2s}.jex-floating-button:hover{transform:scale(1.1);background:var(--jex-primary-hover)}.jex-floating-button:active{transform:scale(.95)}.jex-chat-window{width:380px;height:600px;max-height:calc(100vh - 120px);background:var(--jex-bg-glass);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--jex-border-glass);border-radius:24px;box-shadow:var(--jex-shadow);display:flex;flex-direction:column;overflow:hidden;animation:jexSlideUp .4s cubic-bezier(.16,1,.3,1);transform-origin:bottom right}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}.jex-chat-header{padding:20px;background:var(--jex-primary);color:#fff;display:flex;align-items:center;gap:12px}.jex-header-info h3{font-size:16px;font-weight:600;color:#fff;margin:0}.jex-header-info p{font-size:12px;opacity:.8;color:#fff;margin:0}.jex-chat-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.jex-message{max-width:80%;padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.4}.jex-message.bot{align-self:flex-start;background:#ffffff1a;border:1px solid var(--jex-border-glass);color:var(--jex-text-main);border-bottom-left-radius:4px}.jex-message.user{align-self:flex-end;background:var(--jex-primary);color:#fff;border-bottom-right-radius:4px}.jex-chat-input{padding:16px;border-top:1px solid var(--jex-border-glass);display:flex;gap:8px}.jex-chat-input input{flex:1;background:#ffffff0d;border:1px solid var(--jex-border-glass);border-radius:12px;padding:10px 14px;color:var(--jex-text-main);outline:none;font-family:inherit}.jex-chat-input input:focus{border-color:var(--jex-primary)}.jex-send-btn{background:var(--jex-primary);color:#fff;border:none;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .2s}.jex-send-btn:hover{opacity:.9}')),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
+ var ie, d, Le, Fe, P, be, Oe, Ie, We, he, se, ue, W = {}, qe = [], ft = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, R = Array.isArray;
3
+ function N(t, e) {
4
+ for (var i in e) t[i] = e[i];
5
+ return t;
6
+ }
7
+ function ve(t) {
8
+ t && t.parentNode && t.parentNode.removeChild(t);
9
+ }
10
+ function q(t, e, i) {
11
+ var n, _, r, o = {};
12
+ for (r in e) r == "key" ? n = e[r] : r == "ref" ? _ = e[r] : o[r] = e[r];
13
+ if (arguments.length > 2 && (o.children = arguments.length > 3 ? ie.call(arguments, 2) : i), typeof t == "function" && t.defaultProps != null) for (r in t.defaultProps) o[r] === void 0 && (o[r] = t.defaultProps[r]);
14
+ return K(t, o, n, _, null);
15
+ }
16
+ function K(t, e, i, n, _) {
17
+ var r = { type: t, props: e, key: i, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: _ ?? ++Le, __i: -1, __u: 0 };
18
+ return _ == null && d.vnode != null && d.vnode(r), r;
19
+ }
20
+ function z(t) {
21
+ return t.children;
22
+ }
23
+ function O(t, e) {
24
+ this.props = t, this.context = e;
25
+ }
26
+ function M(t, e) {
27
+ if (e == null) return t.__ ? M(t.__, t.__i + 1) : null;
28
+ for (var i; e < t.__k.length; e++) if ((i = t.__k[e]) != null && i.__e != null) return i.__e;
29
+ return typeof t.type == "function" ? M(t) : null;
30
+ }
31
+ function Re(t) {
32
+ var e, i;
33
+ if ((t = t.__) != null && t.__c != null) {
34
+ for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((i = t.__k[e]) != null && i.__e != null) {
35
+ t.__e = t.__c.base = i.__e;
36
+ break;
37
+ }
38
+ return Re(t);
39
+ }
40
+ }
41
+ function we(t) {
42
+ (!t.__d && (t.__d = !0) && P.push(t) && !Y.__r++ || be != d.debounceRendering) && ((be = d.debounceRendering) || Oe)(Y);
43
+ }
44
+ function Y() {
45
+ for (var t, e, i, n, _, r, o, l = 1; P.length; ) P.length > l && P.sort(Ie), t = P.shift(), l = P.length, t.__d && (i = void 0, n = void 0, _ = (n = (e = t).__v).__e, r = [], o = [], e.__P && ((i = N({}, n)).__v = n.__v + 1, d.vnode && d.vnode(i), de(e.__P, i, n, e.__n, e.__P.namespaceURI, 32 & n.__u ? [_] : null, r, _ ?? M(n), !!(32 & n.__u), o), i.__v = n.__v, i.__.__k[i.__i] = i, Ze(r, i, o), n.__e = n.__ = null, i.__e != _ && Re(i)));
46
+ Y.__r = 0;
47
+ }
48
+ function ze(t, e, i, n, _, r, o, l, f, u, c) {
49
+ var s, h, a, b, x, w, y, p = n && n.__k || qe, E = e.length;
50
+ for (f = at(i, e, p, f, E), s = 0; s < E; s++) (a = i.__k[s]) != null && (h = a.__i == -1 ? W : p[a.__i] || W, a.__i = s, w = de(t, a, h, _, r, o, l, f, u, c), b = a.__e, a.ref && h.ref != a.ref && (h.ref && pe(h.ref, null, a), c.push(a.ref, a.__c || b, a)), x == null && b != null && (x = b), (y = !!(4 & a.__u)) || h.__k === a.__k ? f = Be(a, f, t, y) : typeof a.type == "function" && w !== void 0 ? f = w : b && (f = b.nextSibling), a.__u &= -7);
51
+ return i.__e = x, f;
52
+ }
53
+ function at(t, e, i, n, _) {
54
+ var r, o, l, f, u, c = i.length, s = c, h = 0;
55
+ for (t.__k = new Array(_), r = 0; r < _; r++) (o = e[r]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = t.__k[r] = K(null, o, null, null, null) : R(o) ? o = t.__k[r] = K(z, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = t.__k[r] = K(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : t.__k[r] = o, f = r + h, o.__ = t, o.__b = t.__b + 1, l = null, (u = o.__i = ct(o, i, f, s)) != -1 && (s--, (l = i[u]) && (l.__u |= 2)), l == null || l.__v == null ? (u == -1 && (_ > c ? h-- : _ < c && h++), typeof o.type != "function" && (o.__u |= 4)) : u != f && (u == f - 1 ? h-- : u == f + 1 ? h++ : (u > f ? h-- : h++, o.__u |= 4))) : t.__k[r] = null;
56
+ if (s) for (r = 0; r < c; r++) (l = i[r]) != null && (2 & l.__u) == 0 && (l.__e == n && (n = M(l)), Je(l, l));
57
+ return n;
58
+ }
59
+ function Be(t, e, i, n) {
60
+ var _, r;
61
+ if (typeof t.type == "function") {
62
+ for (_ = t.__k, r = 0; _ && r < _.length; r++) _[r] && (_[r].__ = t, e = Be(_[r], e, i, n));
63
+ return e;
64
+ }
65
+ t.__e != e && (n && (e && t.type && !e.parentNode && (e = M(t)), i.insertBefore(t.__e, e || null)), e = t.__e);
66
+ do
67
+ e = e && e.nextSibling;
68
+ while (e != null && e.nodeType == 8);
69
+ return e;
70
+ }
71
+ function Ve(t, e) {
72
+ return e = e || [], t == null || typeof t == "boolean" || (R(t) ? t.some(function(i) {
73
+ Ve(i, e);
74
+ }) : e.push(t)), e;
75
+ }
76
+ function ct(t, e, i, n) {
77
+ var _, r, o, l = t.key, f = t.type, u = e[i], c = u != null && (2 & u.__u) == 0;
78
+ if (u === null && l == null || c && l == u.key && f == u.type) return i;
79
+ if (n > (c ? 1 : 0)) {
80
+ for (_ = i - 1, r = i + 1; _ >= 0 || r < e.length; ) if ((u = e[o = _ >= 0 ? _-- : r++]) != null && (2 & u.__u) == 0 && l == u.key && f == u.type) return o;
81
+ }
82
+ return -1;
83
+ }
84
+ function $e(t, e, i) {
85
+ e[0] == "-" ? t.setProperty(e, i ?? "") : t[e] = i == null ? "" : typeof i != "number" || ft.test(e) ? i : i + "px";
86
+ }
87
+ function G(t, e, i, n, _) {
88
+ var r, o;
89
+ e: if (e == "style") if (typeof i == "string") t.style.cssText = i;
90
+ else {
91
+ if (typeof n == "string" && (t.style.cssText = n = ""), n) for (e in n) i && e in i || $e(t.style, e, "");
92
+ if (i) for (e in i) n && i[e] == n[e] || $e(t.style, e, i[e]);
93
+ }
94
+ else if (e[0] == "o" && e[1] == "n") r = e != (e = e.replace(We, "$1")), o = e.toLowerCase(), e = o in t || e == "onFocusOut" || e == "onFocusIn" ? o.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + r] = i, i ? n ? i.u = n.u : (i.u = he, t.addEventListener(e, r ? ue : se, r)) : t.removeEventListener(e, r ? ue : se, r);
95
+ else {
96
+ if (_ == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
97
+ 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 {
98
+ t[e] = i ?? "";
99
+ break e;
100
+ } catch {
101
+ }
102
+ typeof i == "function" || (i == null || i === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && i == 1 ? "" : i));
103
+ }
104
+ }
105
+ function ke(t) {
106
+ return function(e) {
107
+ if (this.l) {
108
+ var i = this.l[e.type + t];
109
+ if (e.t == null) e.t = he++;
110
+ else if (e.t < i.u) return;
111
+ return i(d.event ? d.event(e) : e);
112
+ }
113
+ };
114
+ }
115
+ function de(t, e, i, n, _, r, o, l, f, u) {
116
+ var c, s, h, a, b, x, w, y, p, E, U, V, L, ge, Z, F, _e, S = e.type;
117
+ if (e.constructor !== void 0) return null;
118
+ 128 & i.__u && (f = !!(32 & i.__u), r = [l = e.__e = i.__e]), (c = d.__b) && c(e);
119
+ e: if (typeof S == "function") try {
120
+ if (y = e.props, p = "prototype" in S && S.prototype.render, E = (c = S.contextType) && n[c.__c], U = c ? E ? E.props.value : c.__ : n, i.__c ? w = (s = e.__c = i.__c).__ = s.__E : (p ? e.__c = s = new S(y, U) : (e.__c = s = new O(y, U), s.constructor = S, s.render = vt), E && E.sub(s), s.state || (s.state = {}), s.__n = n, h = s.__d = !0, s.__h = [], s._sb = []), p && s.__s == null && (s.__s = s.state), p && S.getDerivedStateFromProps != null && (s.__s == s.state && (s.__s = N({}, s.__s)), N(s.__s, S.getDerivedStateFromProps(y, s.__s))), a = s.props, b = s.state, s.__v = e, h) p && S.getDerivedStateFromProps == null && s.componentWillMount != null && s.componentWillMount(), p && s.componentDidMount != null && s.__h.push(s.componentDidMount);
121
+ else {
122
+ if (p && S.getDerivedStateFromProps == null && y !== a && s.componentWillReceiveProps != null && s.componentWillReceiveProps(y, U), e.__v == i.__v || !s.__e && s.shouldComponentUpdate != null && s.shouldComponentUpdate(y, s.__s, U) === !1) {
123
+ for (e.__v != i.__v && (s.props = y, s.state = s.__s, s.__d = !1), e.__e = i.__e, e.__k = i.__k, e.__k.some(function(A) {
124
+ A && (A.__ = e);
125
+ }), V = 0; V < s._sb.length; V++) s.__h.push(s._sb[V]);
126
+ s._sb = [], s.__h.length && o.push(s);
127
+ break e;
128
+ }
129
+ s.componentWillUpdate != null && s.componentWillUpdate(y, s.__s, U), p && s.componentDidUpdate != null && s.__h.push(function() {
130
+ s.componentDidUpdate(a, b, x);
131
+ });
132
+ }
133
+ if (s.context = U, s.props = y, s.__P = t, s.__e = !1, L = d.__r, ge = 0, p) {
134
+ for (s.state = s.__s, s.__d = !1, L && L(e), c = s.render(s.props, s.state, s.context), Z = 0; Z < s._sb.length; Z++) s.__h.push(s._sb[Z]);
135
+ s._sb = [];
136
+ } else do
137
+ s.__d = !1, L && L(e), c = s.render(s.props, s.state, s.context), s.state = s.__s;
138
+ while (s.__d && ++ge < 25);
139
+ s.state = s.__s, s.getChildContext != null && (n = N(N({}, n), s.getChildContext())), p && !h && s.getSnapshotBeforeUpdate != null && (x = s.getSnapshotBeforeUpdate(a, b)), F = c, c != null && c.type === z && c.key == null && (F = Ge(c.props.children)), l = ze(t, R(F) ? F : [F], e, i, n, _, r, o, l, f, u), s.base = e.__e, e.__u &= -161, s.__h.length && o.push(s), w && (s.__E = s.__ = null);
140
+ } catch (A) {
141
+ if (e.__v = null, f || r != null) if (A.then) {
142
+ for (e.__u |= f ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
143
+ r[r.indexOf(l)] = null, e.__e = l;
144
+ } else {
145
+ for (_e = r.length; _e--; ) ve(r[_e]);
146
+ le(e);
147
+ }
148
+ else e.__e = i.__e, e.__k = i.__k, A.then || le(e);
149
+ d.__e(A, e, i);
150
+ }
151
+ else r == null && e.__v == i.__v ? (e.__k = i.__k, e.__e = i.__e) : l = e.__e = ht(i.__e, e, i, n, _, r, o, f, u);
152
+ return (c = d.diffed) && c(e), 128 & e.__u ? void 0 : l;
153
+ }
154
+ function le(t) {
155
+ t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(le);
156
+ }
157
+ function Ze(t, e, i) {
158
+ for (var n = 0; n < i.length; n++) pe(i[n], i[++n], i[++n]);
159
+ d.__c && d.__c(e, t), t.some(function(_) {
160
+ try {
161
+ t = _.__h, _.__h = [], t.some(function(r) {
162
+ r.call(_);
163
+ });
164
+ } catch (r) {
165
+ d.__e(r, _.__v);
166
+ }
167
+ });
168
+ }
169
+ function Ge(t) {
170
+ return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : R(t) ? t.map(Ge) : N({}, t);
171
+ }
172
+ function ht(t, e, i, n, _, r, o, l, f) {
173
+ var u, c, s, h, a, b, x, w = i.props || W, y = e.props, p = e.type;
174
+ if (p == "svg" ? _ = "http://www.w3.org/2000/svg" : p == "math" ? _ = "http://www.w3.org/1998/Math/MathML" : _ || (_ = "http://www.w3.org/1999/xhtml"), r != null) {
175
+ for (u = 0; u < r.length; u++) if ((a = r[u]) && "setAttribute" in a == !!p && (p ? a.localName == p : a.nodeType == 3)) {
176
+ t = a, r[u] = null;
177
+ break;
178
+ }
179
+ }
180
+ if (t == null) {
181
+ if (p == null) return document.createTextNode(y);
182
+ t = document.createElementNS(_, p, y.is && y), l && (d.__m && d.__m(e, r), l = !1), r = null;
183
+ }
184
+ if (p == null) w === y || l && t.data == y || (t.data = y);
185
+ else {
186
+ if (r = r && ie.call(t.childNodes), !l && r != null) for (w = {}, u = 0; u < t.attributes.length; u++) w[(a = t.attributes[u]).name] = a.value;
187
+ for (u in w) if (a = w[u], u != "children") {
188
+ if (u == "dangerouslySetInnerHTML") s = a;
189
+ else if (!(u in y)) {
190
+ if (u == "value" && "defaultValue" in y || u == "checked" && "defaultChecked" in y) continue;
191
+ G(t, u, null, a, _);
192
+ }
193
+ }
194
+ for (u in y) a = y[u], u == "children" ? h = a : u == "dangerouslySetInnerHTML" ? c = a : u == "value" ? b = a : u == "checked" ? x = a : l && typeof a != "function" || w[u] === a || G(t, u, a, w[u], _);
195
+ if (c) l || s && (c.__html == s.__html || c.__html == t.innerHTML) || (t.innerHTML = c.__html), e.__k = [];
196
+ else if (s && (t.innerHTML = ""), ze(e.type == "template" ? t.content : t, R(h) ? h : [h], e, i, n, p == "foreignObject" ? "http://www.w3.org/1999/xhtml" : _, r, o, r ? r[0] : i.__k && M(i, 0), l, f), r != null) for (u = r.length; u--; ) ve(r[u]);
197
+ l || (u = "value", p == "progress" && b == null ? t.removeAttribute("value") : b != null && (b !== t[u] || p == "progress" && !b || p == "option" && b != w[u]) && G(t, u, b, w[u], _), u = "checked", x != null && x != t[u] && G(t, u, x, w[u], _));
198
+ }
199
+ return t;
200
+ }
201
+ function pe(t, e, i) {
202
+ try {
203
+ if (typeof t == "function") {
204
+ var n = typeof t.__u == "function";
205
+ n && t.__u(), n && e == null || (t.__u = t(e));
206
+ } else t.current = e;
207
+ } catch (_) {
208
+ d.__e(_, i);
209
+ }
210
+ }
211
+ function Je(t, e, i) {
212
+ var n, _;
213
+ if (d.unmount && d.unmount(t), (n = t.ref) && (n.current && n.current != t.__e || pe(n, null, e)), (n = t.__c) != null) {
214
+ if (n.componentWillUnmount) try {
215
+ n.componentWillUnmount();
216
+ } catch (r) {
217
+ d.__e(r, e);
218
+ }
219
+ n.base = n.__P = null;
220
+ }
221
+ if (n = t.__k) for (_ = 0; _ < n.length; _++) n[_] && Je(n[_], e, i || typeof t.type != "function");
222
+ i || ve(t.__e), t.__c = t.__ = t.__e = void 0;
223
+ }
224
+ function vt(t, e, i) {
225
+ return this.constructor(t, i);
226
+ }
227
+ function xe(t, e, i) {
228
+ var n, _, r, o;
229
+ e == document && (e = document.documentElement), d.__ && d.__(t, e), _ = (n = !1) ? null : e.__k, r = [], o = [], de(e, t = e.__k = q(z, null, [t]), _ || W, W, e.namespaceURI, _ ? null : e.firstChild ? ie.call(e.childNodes) : null, r, _ ? _.__e : e.firstChild, n, o), Ze(r, t, o);
230
+ }
231
+ ie = qe.slice, d = { __e: function(t, e, i, n) {
232
+ for (var _, r, o; e = e.__; ) if ((_ = e.__c) && !_.__) try {
233
+ if ((r = _.constructor) && r.getDerivedStateFromError != null && (_.setState(r.getDerivedStateFromError(t)), o = _.__d), _.componentDidCatch != null && (_.componentDidCatch(t, n || {}), o = _.__d), o) return _.__E = _;
234
+ } catch (l) {
235
+ t = l;
236
+ }
237
+ throw t;
238
+ } }, Le = 0, Fe = function(t) {
239
+ return t != null && t.constructor === void 0;
240
+ }, O.prototype.setState = function(t, e) {
241
+ var i;
242
+ i = this.__s != null && this.__s != this.state ? this.__s : this.__s = N({}, this.state), typeof t == "function" && (t = t(N({}, i), this.props)), t && N(i, t), t != null && this.__v && (e && this._sb.push(e), we(this));
243
+ }, O.prototype.forceUpdate = function(t) {
244
+ this.__v && (this.__e = !0, t && this.__h.push(t), we(this));
245
+ }, O.prototype.render = z, P = [], Oe = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ie = function(t, e) {
246
+ return t.__v.__b - e.__v.__b;
247
+ }, Y.__r = 0, We = /(PointerCapture)$|Capture$/i, he = 0, se = ke(!1), ue = ke(!0);
248
+ var dt = 0;
249
+ function $(t, e, i, n, _, r) {
250
+ e || (e = {});
251
+ var o, l, f = e;
252
+ if ("ref" in f) for (l in f = {}, e) l == "ref" ? o = e[l] : f[l] = e[l];
253
+ var u = { type: t, props: f, key: i, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --dt, __i: -1, __u: 0, __source: _, __self: r };
254
+ if (typeof t == "function" && (o = t.defaultProps)) for (l in o) f[l] === void 0 && (f[l] = o[l]);
255
+ return d.vnode && d.vnode(u), u;
256
+ }
257
+ var Q, m, oe, Se, fe = 0, Ke = [], g = d, Ce = g.__b, Ne = g.__r, Ee = g.diffed, He = g.__c, Ue = g.unmount, Pe = g.__;
258
+ function Xe(t, e) {
259
+ g.__h && g.__h(m, t, fe || e), fe = 0;
260
+ var i = m.__H || (m.__H = { __: [], __h: [] });
261
+ return t >= i.__.length && i.__.push({}), i.__[t];
262
+ }
263
+ function Te(t) {
264
+ return fe = 1, pt(Qe, t);
265
+ }
266
+ function pt(t, e, i) {
267
+ var n = Xe(Q++, 2);
268
+ if (n.t = t, !n.__c && (n.__ = [Qe(void 0, e), function(l) {
269
+ var f = n.__N ? n.__N[0] : n.__[0], u = n.t(f, l);
270
+ f !== u && (n.__N = [u, n.__[1]], n.__c.setState({}));
271
+ }], n.__c = m, !m.__f)) {
272
+ var _ = function(l, f, u) {
273
+ if (!n.__c.__H) return !0;
274
+ var c = n.__c.__H.__.filter(function(h) {
275
+ return !!h.__c;
276
+ });
277
+ if (c.every(function(h) {
278
+ return !h.__N;
279
+ })) return !r || r.call(this, l, f, u);
280
+ var s = n.__c.props !== l;
281
+ return c.forEach(function(h) {
282
+ if (h.__N) {
283
+ var a = h.__[0];
284
+ h.__ = h.__N, h.__N = void 0, a !== h.__[0] && (s = !0);
285
+ }
286
+ }), r && r.call(this, l, f, u) || s;
287
+ };
288
+ m.__f = !0;
289
+ var r = m.shouldComponentUpdate, o = m.componentWillUpdate;
290
+ m.componentWillUpdate = function(l, f, u) {
291
+ if (this.__e) {
292
+ var c = r;
293
+ r = void 0, _(l, f, u), r = c;
294
+ }
295
+ o && o.call(this, l, f, u);
296
+ }, m.shouldComponentUpdate = _;
297
+ }
298
+ return n.__N || n.__;
299
+ }
300
+ function Ye(t, e) {
301
+ var i = Xe(Q++, 7);
302
+ return gt(i.__H, e) && (i.__ = t(), i.__H = e, i.__h = t), i.__;
303
+ }
304
+ function yt() {
305
+ for (var t; t = Ke.shift(); ) if (t.__P && t.__H) try {
306
+ t.__H.__h.forEach(X), t.__H.__h.forEach(ae), t.__H.__h = [];
307
+ } catch (e) {
308
+ t.__H.__h = [], g.__e(e, t.__v);
309
+ }
310
+ }
311
+ g.__b = function(t) {
312
+ m = null, Ce && Ce(t);
313
+ }, g.__ = function(t, e) {
314
+ t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Pe && Pe(t, e);
315
+ }, g.__r = function(t) {
316
+ Ne && Ne(t), Q = 0;
317
+ var e = (m = t.__c).__H;
318
+ e && (oe === m ? (e.__h = [], m.__h = [], e.__.forEach(function(i) {
319
+ i.__N && (i.__ = i.__N), i.u = i.__N = void 0;
320
+ })) : (e.__h.forEach(X), e.__h.forEach(ae), e.__h = [], Q = 0)), oe = m;
321
+ }, g.diffed = function(t) {
322
+ Ee && Ee(t);
323
+ var e = t.__c;
324
+ e && e.__H && (e.__H.__h.length && (Ke.push(e) !== 1 && Se === g.requestAnimationFrame || ((Se = g.requestAnimationFrame) || mt)(yt)), e.__H.__.forEach(function(i) {
325
+ i.u && (i.__H = i.u), i.u = void 0;
326
+ })), oe = m = null;
327
+ }, g.__c = function(t, e) {
328
+ e.some(function(i) {
329
+ try {
330
+ i.__h.forEach(X), i.__h = i.__h.filter(function(n) {
331
+ return !n.__ || ae(n);
332
+ });
333
+ } catch (n) {
334
+ e.some(function(_) {
335
+ _.__h && (_.__h = []);
336
+ }), e = [], g.__e(n, i.__v);
337
+ }
338
+ }), He && He(t, e);
339
+ }, g.unmount = function(t) {
340
+ Ue && Ue(t);
341
+ var e, i = t.__c;
342
+ i && i.__H && (i.__H.__.forEach(function(n) {
343
+ try {
344
+ X(n);
345
+ } catch (_) {
346
+ e = _;
347
+ }
348
+ }), i.__H = void 0, e && g.__e(e, i.__v));
349
+ };
350
+ var Ae = typeof requestAnimationFrame == "function";
351
+ function mt(t) {
352
+ var e, i = function() {
353
+ clearTimeout(n), Ae && cancelAnimationFrame(e), setTimeout(t);
354
+ }, n = setTimeout(i, 35);
355
+ Ae && (e = requestAnimationFrame(i));
356
+ }
357
+ function X(t) {
358
+ var e = m, i = t.__c;
359
+ typeof i == "function" && (t.__c = void 0, i()), m = e;
360
+ }
361
+ function ae(t) {
362
+ var e = m;
363
+ t.__c = t.__(), m = e;
364
+ }
365
+ function gt(t, e) {
366
+ return !t || t.length !== e.length || e.some(function(i, n) {
367
+ return i !== t[n];
368
+ });
369
+ }
370
+ function Qe(t, e) {
371
+ return typeof e == "function" ? e(t) : e;
372
+ }
373
+ const bt = (...t) => t.filter((e, i, n) => !!e && e.trim() !== "" && n.indexOf(e) === i).join(" ").trim();
374
+ const Me = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
375
+ const wt = (t) => t.replace(
376
+ /^([A-Z])|[\s-_]+(\w)/g,
377
+ (e, i, n) => n ? n.toUpperCase() : i.toLowerCase()
378
+ );
379
+ const je = (t) => {
380
+ const e = wt(t);
381
+ return e.charAt(0).toUpperCase() + e.slice(1);
382
+ };
383
+ var $t = {
384
+ xmlns: "http://www.w3.org/2000/svg",
385
+ width: 24,
386
+ height: 24,
387
+ viewBox: "0 0 24 24",
388
+ fill: "none",
389
+ stroke: "currentColor",
390
+ "stroke-width": "2",
391
+ "stroke-linecap": "round",
392
+ "stroke-linejoin": "round"
393
+ };
394
+ const kt = (t) => {
395
+ for (const e in t)
396
+ if (e.startsWith("aria-") || e === "role" || e === "title")
397
+ return !0;
398
+ return !1;
399
+ };
400
+ const xt = ({
401
+ color: t = "currentColor",
402
+ size: e = 24,
403
+ strokeWidth: i = 2,
404
+ absoluteStrokeWidth: n,
405
+ children: _,
406
+ iconNode: r,
407
+ class: o = "",
408
+ ...l
409
+ }) => q(
410
+ "svg",
411
+ {
412
+ ...$t,
413
+ width: String(e),
414
+ height: e,
415
+ stroke: t,
416
+ "stroke-width": n ? Number(i) * 24 / Number(e) : i,
417
+ class: ["lucide", o].join(" "),
418
+ ...!_ && !kt(l) && { "aria-hidden": "true" },
419
+ ...l
420
+ },
421
+ [...r.map(([f, u]) => q(f, u)), ...Ve(_)]
422
+ );
423
+ const ne = (t, e) => {
424
+ const i = ({ class: n = "", className: _ = "", children: r, ...o }) => q(
425
+ xt,
426
+ {
427
+ ...o,
428
+ iconNode: e,
429
+ class: bt(
430
+ `lucide-${Me(je(t))}`,
431
+ `lucide-${Me(t)}`,
432
+ n,
433
+ _
434
+ )
435
+ },
436
+ r
437
+ );
438
+ return i.displayName = je(t), i;
439
+ };
440
+ const St = ne("bot", [
441
+ ["path", { d: "M12 8V4H8", key: "hb8ula" }],
442
+ ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
443
+ ["path", { d: "M2 14h2", key: "vft8re" }],
444
+ ["path", { d: "M20 14h2", key: "4cs60a" }],
445
+ ["path", { d: "M15 13v2", key: "1xurst" }],
446
+ ["path", { d: "M9 13v2", key: "rq6x2g" }]
447
+ ]);
448
+ const Ct = ne("message-circle", [
449
+ [
450
+ "path",
451
+ {
452
+ d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",
453
+ key: "1sd12s"
454
+ }
455
+ ]
456
+ ]);
457
+ const Nt = ne("send", [
458
+ [
459
+ "path",
460
+ {
461
+ d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
462
+ key: "1ffxy3"
463
+ }
464
+ ],
465
+ ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
466
+ ]);
467
+ const Et = ne("x", [
468
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
469
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
470
+ ]);
471
+ var Ht = Symbol.for("preact-signals");
472
+ function re() {
473
+ if (H > 1)
474
+ H--;
475
+ else {
476
+ for (var t, e = !1; I !== void 0; ) {
477
+ var i = I;
478
+ for (I = void 0, ce++; i !== void 0; ) {
479
+ var n = i.o;
480
+ if (i.o = void 0, i.f &= -3, !(8 & i.f) && it(i)) try {
481
+ i.c();
482
+ } catch (_) {
483
+ e || (t = _, e = !0);
484
+ }
485
+ i = n;
486
+ }
487
+ }
488
+ if (ce = 0, H--, e) throw t;
489
+ }
490
+ }
491
+ function Ut(t) {
492
+ if (H > 0) return t();
493
+ H++;
494
+ try {
495
+ return t();
496
+ } finally {
497
+ re();
498
+ }
499
+ }
500
+ var v = void 0;
501
+ function et(t) {
502
+ var e = v;
503
+ v = void 0;
504
+ try {
505
+ return t();
506
+ } finally {
507
+ v = e;
508
+ }
509
+ }
510
+ var I = void 0, H = 0, ce = 0, ee = 0;
511
+ function tt(t) {
512
+ if (v !== void 0) {
513
+ var e = t.n;
514
+ if (e === void 0 || e.t !== v)
515
+ return e = { i: 0, S: t, p: v.s, n: void 0, t: v, e: void 0, x: void 0, r: e }, v.s !== void 0 && (v.s.n = e), v.s = e, t.n = e, 32 & v.f && t.S(e), e;
516
+ if (e.i === -1)
517
+ return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = v.s, e.n = void 0, v.s.n = e, v.s = e), e;
518
+ }
519
+ }
520
+ function k(t, e) {
521
+ 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;
522
+ }
523
+ k.prototype.brand = Ht;
524
+ k.prototype.h = function() {
525
+ return !0;
526
+ };
527
+ k.prototype.S = function(t) {
528
+ var e = this, i = this.t;
529
+ i !== t && t.e === void 0 && (t.x = i, this.t = t, i !== void 0 ? i.e = t : et(function() {
530
+ var n;
531
+ (n = e.W) == null || n.call(e);
532
+ }));
533
+ };
534
+ k.prototype.U = function(t) {
535
+ var e = this;
536
+ if (this.t !== void 0) {
537
+ var i = t.e, n = t.x;
538
+ i !== void 0 && (i.x = n, t.e = void 0), n !== void 0 && (n.e = i, t.x = void 0), t === this.t && (this.t = n, n === void 0 && et(function() {
539
+ var _;
540
+ (_ = e.Z) == null || _.call(e);
541
+ }));
542
+ }
543
+ };
544
+ k.prototype.subscribe = function(t) {
545
+ var e = this;
546
+ return B(function() {
547
+ var i = e.value, n = v;
548
+ v = void 0;
549
+ try {
550
+ t(i);
551
+ } finally {
552
+ v = n;
553
+ }
554
+ }, { name: "sub" });
555
+ };
556
+ k.prototype.valueOf = function() {
557
+ return this.value;
558
+ };
559
+ k.prototype.toString = function() {
560
+ return this.value + "";
561
+ };
562
+ k.prototype.toJSON = function() {
563
+ return this.value;
564
+ };
565
+ k.prototype.peek = function() {
566
+ var t = v;
567
+ v = void 0;
568
+ try {
569
+ return this.value;
570
+ } finally {
571
+ v = t;
572
+ }
573
+ };
574
+ Object.defineProperty(k.prototype, "value", { get: function() {
575
+ var t = tt(this);
576
+ return t !== void 0 && (t.i = this.i), this.v;
577
+ }, set: function(t) {
578
+ if (t !== this.v) {
579
+ if (ce > 100) throw new Error("Cycle detected");
580
+ this.v = t, this.i++, ee++, H++;
581
+ try {
582
+ for (var e = this.t; e !== void 0; e = e.x) e.t.N();
583
+ } finally {
584
+ re();
585
+ }
586
+ }
587
+ } });
588
+ function ye(t, e) {
589
+ return new k(t, e);
590
+ }
591
+ function it(t) {
592
+ for (var e = t.s; e !== void 0; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
593
+ return !1;
594
+ }
595
+ function nt(t) {
596
+ for (var e = t.s; e !== void 0; e = e.n) {
597
+ var i = e.S.n;
598
+ if (i !== void 0 && (e.r = i), e.S.n = e, e.i = -1, e.n === void 0) {
599
+ t.s = e;
600
+ break;
601
+ }
602
+ }
603
+ }
604
+ function rt(t) {
605
+ for (var e = t.s, i = void 0; e !== void 0; ) {
606
+ var n = e.p;
607
+ e.i === -1 ? (e.S.U(e), n !== void 0 && (n.n = e.n), e.n !== void 0 && (e.n.p = n)) : i = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = n;
608
+ }
609
+ t.s = i;
610
+ }
611
+ function T(t, e) {
612
+ k.call(this, void 0), this.x = t, this.s = void 0, this.g = ee - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
613
+ }
614
+ T.prototype = new k();
615
+ T.prototype.h = function() {
616
+ if (this.f &= -3, 1 & this.f) return !1;
617
+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === ee)) return !0;
618
+ if (this.g = ee, this.f |= 1, this.i > 0 && !it(this))
619
+ return this.f &= -2, !0;
620
+ var t = v;
621
+ try {
622
+ nt(this), v = this;
623
+ var e = this.x();
624
+ (16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
625
+ } catch (i) {
626
+ this.v = i, this.f |= 16, this.i++;
627
+ }
628
+ return v = t, rt(this), this.f &= -2, !0;
629
+ };
630
+ T.prototype.S = function(t) {
631
+ if (this.t === void 0) {
632
+ this.f |= 36;
633
+ for (var e = this.s; e !== void 0; e = e.n) e.S.S(e);
634
+ }
635
+ k.prototype.S.call(this, t);
636
+ };
637
+ T.prototype.U = function(t) {
638
+ if (this.t !== void 0 && (k.prototype.U.call(this, t), this.t === void 0)) {
639
+ this.f &= -33;
640
+ for (var e = this.s; e !== void 0; e = e.n) e.S.U(e);
641
+ }
642
+ };
643
+ T.prototype.N = function() {
644
+ if (!(2 & this.f)) {
645
+ this.f |= 6;
646
+ for (var t = this.t; t !== void 0; t = t.x) t.t.N();
647
+ }
648
+ };
649
+ Object.defineProperty(T.prototype, "value", { get: function() {
650
+ if (1 & this.f) throw new Error("Cycle detected");
651
+ var t = tt(this);
652
+ if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
653
+ return this.v;
654
+ } });
655
+ function De(t, e) {
656
+ return new T(t, e);
657
+ }
658
+ function _t(t) {
659
+ var e = t.u;
660
+ if (t.u = void 0, typeof e == "function") {
661
+ H++;
662
+ var i = v;
663
+ v = void 0;
664
+ try {
665
+ e();
666
+ } catch (n) {
667
+ throw t.f &= -2, t.f |= 8, me(t), n;
668
+ } finally {
669
+ v = i, re();
670
+ }
671
+ }
672
+ }
673
+ function me(t) {
674
+ for (var e = t.s; e !== void 0; e = e.n) e.S.U(e);
675
+ t.x = void 0, t.s = void 0, _t(t);
676
+ }
677
+ function Pt(t) {
678
+ if (v !== this) throw new Error("Out-of-order effect");
679
+ rt(this), v = t, this.f &= -2, 8 & this.f && me(this), re();
680
+ }
681
+ function j(t, e) {
682
+ this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = e?.name;
683
+ }
684
+ j.prototype.c = function() {
685
+ var t = this.S();
686
+ try {
687
+ if (8 & this.f || this.x === void 0) return;
688
+ var e = this.x();
689
+ typeof e == "function" && (this.u = e);
690
+ } finally {
691
+ t();
692
+ }
693
+ };
694
+ j.prototype.S = function() {
695
+ if (1 & this.f) throw new Error("Cycle detected");
696
+ this.f |= 1, this.f &= -9, _t(this), nt(this), H++;
697
+ var t = v;
698
+ return v = this, Pt.bind(this, t);
699
+ };
700
+ j.prototype.N = function() {
701
+ 2 & this.f || (this.f |= 2, this.o = I, I = this);
702
+ };
703
+ j.prototype.d = function() {
704
+ this.f |= 8, 1 & this.f || me(this);
705
+ };
706
+ j.prototype.dispose = function() {
707
+ this.d();
708
+ };
709
+ function B(t, e) {
710
+ var i = new j(t, e);
711
+ try {
712
+ i.c();
713
+ } catch (_) {
714
+ throw i.d(), _;
715
+ }
716
+ var n = i.d.bind(i);
717
+ return n[Symbol.dispose] = n, n;
718
+ }
719
+ var ot, J, Tt = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, st = [];
720
+ B(function() {
721
+ ot = this.N;
722
+ })();
723
+ function D(t, e) {
724
+ d[t] = e.bind(null, d[t] || function() {
725
+ });
726
+ }
727
+ function te(t) {
728
+ if (J) {
729
+ var e = J;
730
+ J = void 0, e();
731
+ }
732
+ J = t && t.S();
733
+ }
734
+ function ut(t) {
735
+ var e = this, i = t.data, n = Mt(i);
736
+ n.value = i;
737
+ var _ = Ye(function() {
738
+ for (var l = e, f = e.__v; f = f.__; ) if (f.__c) {
739
+ f.__c.__$f |= 4;
740
+ break;
741
+ }
742
+ var u = De(function() {
743
+ var a = n.value.value;
744
+ return a === 0 ? 0 : a === !0 ? "" : a || "";
745
+ }), c = De(function() {
746
+ return !Array.isArray(u.value) && !Fe(u.value);
747
+ }), s = B(function() {
748
+ if (this.N = lt, c.value) {
749
+ var a = u.value;
750
+ l.__v && l.__v.__e && l.__v.__e.nodeType === 3 && (l.__v.__e.data = a);
751
+ }
752
+ }), h = e.__$u.d;
753
+ return e.__$u.d = function() {
754
+ s(), h.call(this);
755
+ }, [c, u];
756
+ }, []), r = _[0], o = _[1];
757
+ return r.value ? o.peek() : o.value;
758
+ }
759
+ ut.displayName = "ReactiveTextNode";
760
+ Object.defineProperties(k.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: ut }, props: { configurable: !0, get: function() {
761
+ return { data: this };
762
+ } }, __b: { configurable: !0, value: 1 } });
763
+ D("__b", function(t, e) {
764
+ if (typeof e.type == "string") {
765
+ var i, n = e.props;
766
+ for (var _ in n) if (_ !== "children") {
767
+ var r = n[_];
768
+ r instanceof k && (i || (e.__np = i = {}), i[_] = r, n[_] = r.peek());
769
+ }
770
+ }
771
+ t(e);
772
+ });
773
+ D("__r", function(t, e) {
774
+ if (t(e), e.type !== z) {
775
+ te();
776
+ var i, n = e.__c;
777
+ n && (n.__$f &= -2, (i = n.__$u) === void 0 && (n.__$u = i = (function(_, r) {
778
+ var o;
779
+ return B(function() {
780
+ o = this;
781
+ }, { name: r }), o.c = _, o;
782
+ })(function() {
783
+ var _;
784
+ Tt && ((_ = i.y) == null || _.call(i)), n.__$f |= 1, n.setState({});
785
+ }, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), te(i);
786
+ }
787
+ });
788
+ D("__e", function(t, e, i, n) {
789
+ te(), t(e, i, n);
790
+ });
791
+ D("diffed", function(t, e) {
792
+ te();
793
+ var i;
794
+ if (typeof e.type == "string" && (i = e.__e)) {
795
+ var n = e.__np, _ = e.props;
796
+ if (n) {
797
+ var r = i.U;
798
+ if (r) for (var o in r) {
799
+ var l = r[o];
800
+ l !== void 0 && !(o in n) && (l.d(), r[o] = void 0);
801
+ }
802
+ else
803
+ r = {}, i.U = r;
804
+ for (var f in n) {
805
+ var u = r[f], c = n[f];
806
+ u === void 0 ? (u = At(i, f, c, _), r[f] = u) : u.o(c, _);
807
+ }
808
+ }
809
+ }
810
+ t(e);
811
+ });
812
+ function At(t, e, i, n) {
813
+ var _ = e in t && t.ownerSVGElement === void 0, r = ye(i);
814
+ return { o: function(o, l) {
815
+ r.value = o, n = l;
816
+ }, d: B(function() {
817
+ this.N = lt;
818
+ var o = r.value.value;
819
+ n[e] !== o && (n[e] = o, _ ? t[e] = o : o != null && (o !== !1 || e[4] === "-") ? t.setAttribute(e, o) : t.removeAttribute(e));
820
+ }) };
821
+ }
822
+ D("unmount", function(t, e) {
823
+ if (typeof e.type == "string") {
824
+ var i = e.__e;
825
+ if (i) {
826
+ var n = i.U;
827
+ if (n) {
828
+ i.U = void 0;
829
+ for (var _ in n) {
830
+ var r = n[_];
831
+ r && r.d();
832
+ }
833
+ }
834
+ }
835
+ } else {
836
+ var o = e.__c;
837
+ if (o) {
838
+ var l = o.__$u;
839
+ l && (o.__$u = void 0, l.d());
840
+ }
841
+ }
842
+ t(e);
843
+ });
844
+ D("__h", function(t, e, i, n) {
845
+ (n < 3 || n === 9) && (e.__$f |= 2), t(e, i, n);
846
+ });
847
+ O.prototype.shouldComponentUpdate = function(t, e) {
848
+ if (this.__R) return !0;
849
+ var i = this.__$u, n = i && i.s !== void 0;
850
+ for (var _ in e) return !0;
851
+ if (this.__f || typeof this.u == "boolean" && this.u === !0) {
852
+ var r = 2 & this.__$f;
853
+ if (!(n || r || 4 & this.__$f) || 1 & this.__$f) return !0;
854
+ } else if (!(n || 4 & this.__$f) || 3 & this.__$f) return !0;
855
+ for (var o in t) if (o !== "__source" && t[o] !== this.props[o]) return !0;
856
+ for (var l in this.props) if (!(l in t)) return !0;
857
+ return !1;
858
+ };
859
+ function Mt(t, e) {
860
+ return Ye(function() {
861
+ return ye(t, e);
862
+ }, []);
863
+ }
864
+ var jt = function(t) {
865
+ queueMicrotask(function() {
866
+ queueMicrotask(t);
867
+ });
868
+ };
869
+ function Dt() {
870
+ Ut(function() {
871
+ for (var t; t = st.shift(); ) ot.call(t);
872
+ });
873
+ }
874
+ function lt() {
875
+ st.push(this) === 1 && (d.requestAnimationFrame || jt)(Dt);
876
+ }
877
+ const C = ye(!1);
878
+ function Lt({ options: t }) {
879
+ const [e, i] = Te(""), [n, _] = Te([
880
+ {
881
+ id: 1,
882
+ text: t.greeting ?? `Hi there! This is ${t.orgId} assistant. How can I help you today?`,
883
+ sender: "bot"
884
+ }
885
+ ]), r = t.title ?? "Jexity Assistant", o = t.position === "bottom-left", l = () => {
886
+ if (!e.trim()) return;
887
+ const u = { id: Date.now(), text: e, sender: "user" };
888
+ _([...n, u]), i(""), setTimeout(() => {
889
+ _((c) => [
890
+ ...c,
891
+ {
892
+ id: Date.now() + 1,
893
+ text: `You said: "${e}". This is a demo of the Jexity Chat Widget!`,
894
+ sender: "bot"
895
+ }
896
+ ]);
897
+ }, 1e3);
898
+ }, f = t.primaryColor ? { "--jex-primary": t.primaryColor } : void 0;
899
+ return /* @__PURE__ */ $("div", { className: "jex-widget", style: f, children: /* @__PURE__ */ $("div", { className: `jex-container${o ? " jex-pos-left" : ""}`, children: [
900
+ C.value && /* @__PURE__ */ $("div", { className: "jex-chat-window", children: [
901
+ /* @__PURE__ */ $("header", { className: "jex-chat-header", children: [
902
+ /* @__PURE__ */ $(St, { size: 24 }),
903
+ /* @__PURE__ */ $("div", { className: "jex-header-info", children: [
904
+ /* @__PURE__ */ $("h3", { children: r }),
905
+ /* @__PURE__ */ $("p", { children: "Online | Typically replies in seconds" })
906
+ ] })
907
+ ] }),
908
+ /* @__PURE__ */ $("div", { className: "jex-chat-messages", children: n.map((u) => /* @__PURE__ */ $("div", { className: `jex-message ${u.sender}`, children: u.text }, u.id)) }),
909
+ /* @__PURE__ */ $("div", { className: "jex-chat-input", children: [
910
+ /* @__PURE__ */ $(
911
+ "input",
912
+ {
913
+ type: "text",
914
+ placeholder: "Type a message...",
915
+ value: e,
916
+ onInput: (u) => i(u.currentTarget.value),
917
+ onKeyDown: (u) => u.key === "Enter" && l()
918
+ }
919
+ ),
920
+ /* @__PURE__ */ $("button", { className: "jex-send-btn", onClick: l, children: /* @__PURE__ */ $(Nt, { size: 18 }) })
921
+ ] })
922
+ ] }),
923
+ /* @__PURE__ */ $(
924
+ "button",
925
+ {
926
+ className: "jex-floating-button",
927
+ onClick: () => C.value = !C.value,
928
+ "aria-label": C.value ? "Close chat" : "Open chat",
929
+ children: C.value ? /* @__PURE__ */ $(Et, { size: 28 }) : /* @__PURE__ */ $(Ct, { size: 28 })
930
+ }
931
+ )
932
+ ] }) });
933
+ }
934
+ function Ft(t) {
935
+ let e;
936
+ return t.container ? e = typeof t.container == "string" ? document.querySelector(t.container) : t.container : (e = document.createElement("div"), e.id = "jexity-chat-widget", document.body.appendChild(e)), xe(q(Lt, { options: t }), e), {
937
+ destroy() {
938
+ xe(null, e), t.container || e.remove();
939
+ },
940
+ open() {
941
+ C.value = !0;
942
+ },
943
+ close() {
944
+ C.value = !1;
945
+ },
946
+ toggle() {
947
+ C.value = !C.value;
948
+ }
949
+ };
950
+ }
951
+ export {
952
+ Ft as init
953
+ };
954
+ //# sourceMappingURL=index.mjs.map