@evelan/jexity-widget 0.0.1

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,966 @@
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, v, Oe, Fe, P, we, Ie, We, qe, de, ue, le, q = {}, Re = [], at = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, z = Array.isArray;
3
+ function N(t, e) {
4
+ for (var n in e) t[n] = e[n];
5
+ return t;
6
+ }
7
+ function ve(t) {
8
+ t && t.parentNode && t.parentNode.removeChild(t);
9
+ }
10
+ function R(t, e, n) {
11
+ var i, _, r, s = {};
12
+ for (r in e) r == "key" ? i = e[r] : r == "ref" ? _ = e[r] : s[r] = e[r];
13
+ if (arguments.length > 2 && (s.children = arguments.length > 3 ? ie.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (r in t.defaultProps) s[r] === void 0 && (s[r] = t.defaultProps[r]);
14
+ return X(t, s, i, _, null);
15
+ }
16
+ function X(t, e, n, i, _) {
17
+ var r = { type: t, props: e, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: _ ?? ++Oe, __i: -1, __u: 0 };
18
+ return _ == null && v.vnode != null && v.vnode(r), r;
19
+ }
20
+ function B(t) {
21
+ return t.children;
22
+ }
23
+ function I(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 n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
29
+ return typeof t.type == "function" ? M(t) : null;
30
+ }
31
+ function ze(t) {
32
+ var e, n;
33
+ if ((t = t.__) != null && t.__c != null) {
34
+ for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
35
+ t.__e = t.__c.base = n.__e;
36
+ break;
37
+ }
38
+ return ze(t);
39
+ }
40
+ }
41
+ function $e(t) {
42
+ (!t.__d && (t.__d = !0) && P.push(t) && !Q.__r++ || we != v.debounceRendering) && ((we = v.debounceRendering) || Ie)(Q);
43
+ }
44
+ function Q() {
45
+ for (var t, e, n, i, _, r, s, l = 1; P.length; ) P.length > l && P.sort(We), t = P.shift(), l = P.length, t.__d && (n = void 0, i = void 0, _ = (i = (e = t).__v).__e, r = [], s = [], e.__P && ((n = N({}, i)).__v = i.__v + 1, v.vnode && v.vnode(n), pe(e.__P, n, i, e.__n, e.__P.namespaceURI, 32 & i.__u ? [_] : null, r, _ ?? M(i), !!(32 & i.__u), s), n.__v = i.__v, n.__.__k[n.__i] = n, Je(r, n, s), i.__e = i.__ = null, n.__e != _ && ze(n)));
46
+ Q.__r = 0;
47
+ }
48
+ function Be(t, e, n, i, _, r, s, l, f, u, c) {
49
+ var o, h, a, b, x, w, p, y = i && i.__k || Re, E = e.length;
50
+ for (f = ct(n, e, y, f, E), o = 0; o < E; o++) (a = n.__k[o]) != null && (h = a.__i == -1 ? q : y[a.__i] || q, a.__i = o, w = pe(t, a, h, _, r, s, l, f, u, c), b = a.__e, a.ref && h.ref != a.ref && (h.ref && ye(h.ref, null, a), c.push(a.ref, a.__c || b, a)), x == null && b != null && (x = b), (p = !!(4 & a.__u)) || h.__k === a.__k ? f = Ve(a, f, t, p) : typeof a.type == "function" && w !== void 0 ? f = w : b && (f = b.nextSibling), a.__u &= -7);
51
+ return n.__e = x, f;
52
+ }
53
+ function ct(t, e, n, i, _) {
54
+ var r, s, l, f, u, c = n.length, o = c, h = 0;
55
+ for (t.__k = new Array(_), r = 0; r < _; r++) (s = e[r]) != null && typeof s != "boolean" && typeof s != "function" ? (f = r + h, (s = t.__k[r] = typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? X(null, s, null, null, null) : z(s) ? X(B, { children: s }, null, null, null) : s.constructor == null && s.__b > 0 ? X(s.type, s.props, s.key, s.ref ? s.ref : null, s.__v) : s).__ = t, s.__b = t.__b + 1, l = null, (u = s.__i = ht(s, n, f, o)) != -1 && (o--, (l = n[u]) && (l.__u |= 2)), l == null || l.__v == null ? (u == -1 && (_ > c ? h-- : _ < c && h++), typeof s.type != "function" && (s.__u |= 4)) : u != f && (u == f - 1 ? h-- : u == f + 1 ? h++ : (u > f ? h-- : h++, s.__u |= 4))) : t.__k[r] = null;
56
+ if (o) for (r = 0; r < c; r++) (l = n[r]) != null && (2 & l.__u) == 0 && (l.__e == i && (i = M(l)), Ke(l, l));
57
+ return i;
58
+ }
59
+ function Ve(t, e, n, i) {
60
+ var _, r;
61
+ if (typeof t.type == "function") {
62
+ for (_ = t.__k, r = 0; _ && r < _.length; r++) _[r] && (_[r].__ = t, e = Ve(_[r], e, n, i));
63
+ return e;
64
+ }
65
+ t.__e != e && (i && (e && t.type && !e.parentNode && (e = M(t)), n.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 Ze(t, e) {
72
+ return e = e || [], t == null || typeof t == "boolean" || (z(t) ? t.some(function(n) {
73
+ Ze(n, e);
74
+ }) : e.push(t)), e;
75
+ }
76
+ function ht(t, e, n, i) {
77
+ var _, r, s, l = t.key, f = t.type, u = e[n], c = u != null && (2 & u.__u) == 0;
78
+ if (u === null && t.key == null || c && l == u.key && f == u.type) return n;
79
+ if (i > (c ? 1 : 0)) {
80
+ for (_ = n - 1, r = n + 1; _ >= 0 || r < e.length; ) if ((u = e[s = _ >= 0 ? _-- : r++]) != null && (2 & u.__u) == 0 && l == u.key && f == u.type) return s;
81
+ }
82
+ return -1;
83
+ }
84
+ function ke(t, e, n) {
85
+ e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || at.test(e) ? n : n + "px";
86
+ }
87
+ function G(t, e, n, i, _) {
88
+ var r, s;
89
+ e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
90
+ else {
91
+ if (typeof i == "string" && (t.style.cssText = i = ""), i) for (e in i) n && e in n || ke(t.style, e, "");
92
+ if (n) for (e in n) i && n[e] == i[e] || ke(t.style, e, n[e]);
93
+ }
94
+ else if (e[0] == "o" && e[1] == "n") r = e != (e = e.replace(qe, "$1")), s = e.toLowerCase(), e = s in t || e == "onFocusOut" || e == "onFocusIn" ? s.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + r] = n, n ? i ? n.u = i.u : (n.u = de, t.addEventListener(e, r ? le : ue, r)) : t.removeEventListener(e, r ? le : ue, 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] = n ?? "";
99
+ break e;
100
+ } catch {
101
+ }
102
+ typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
103
+ }
104
+ }
105
+ function xe(t) {
106
+ return function(e) {
107
+ if (this.l) {
108
+ var n = this.l[e.type + t];
109
+ if (e.t == null) e.t = de++;
110
+ else if (e.t < n.u) return;
111
+ return n(v.event ? v.event(e) : e);
112
+ }
113
+ };
114
+ }
115
+ function pe(t, e, n, i, _, r, s, l, f, u) {
116
+ var c, o, h, a, b, x, w, p, y, E, H, Z, L, be, J, O, oe, C = e.type;
117
+ if (e.constructor != null) return null;
118
+ 128 & n.__u && (f = !!(32 & n.__u), r = [l = e.__e = n.__e]), (c = v.__b) && c(e);
119
+ e: if (typeof C == "function") try {
120
+ if (p = e.props, y = "prototype" in C && C.prototype.render, E = (c = C.contextType) && i[c.__c], H = c ? E ? E.props.value : c.__ : i, n.__c ? w = (o = e.__c = n.__c).__ = o.__E : (y ? e.__c = o = new C(p, H) : (e.__c = o = new I(p, H), o.constructor = C, o.render = vt), E && E.sub(o), o.props = p, o.state || (o.state = {}), o.context = H, o.__n = i, h = o.__d = !0, o.__h = [], o._sb = []), y && o.__s == null && (o.__s = o.state), y && C.getDerivedStateFromProps != null && (o.__s == o.state && (o.__s = N({}, o.__s)), N(o.__s, C.getDerivedStateFromProps(p, o.__s))), a = o.props, b = o.state, o.__v = e, h) y && C.getDerivedStateFromProps == null && o.componentWillMount != null && o.componentWillMount(), y && o.componentDidMount != null && o.__h.push(o.componentDidMount);
121
+ else {
122
+ if (y && C.getDerivedStateFromProps == null && p !== a && o.componentWillReceiveProps != null && o.componentWillReceiveProps(p, H), !o.__e && o.shouldComponentUpdate != null && o.shouldComponentUpdate(p, o.__s, H) === !1 || e.__v == n.__v) {
123
+ for (e.__v != n.__v && (o.props = p, o.state = o.__s, o.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(A) {
124
+ A && (A.__ = e);
125
+ }), Z = 0; Z < o._sb.length; Z++) o.__h.push(o._sb[Z]);
126
+ o._sb = [], o.__h.length && s.push(o);
127
+ break e;
128
+ }
129
+ o.componentWillUpdate != null && o.componentWillUpdate(p, o.__s, H), y && o.componentDidUpdate != null && o.__h.push(function() {
130
+ o.componentDidUpdate(a, b, x);
131
+ });
132
+ }
133
+ if (o.context = H, o.props = p, o.__P = t, o.__e = !1, L = v.__r, be = 0, y) {
134
+ for (o.state = o.__s, o.__d = !1, L && L(e), c = o.render(o.props, o.state, o.context), J = 0; J < o._sb.length; J++) o.__h.push(o._sb[J]);
135
+ o._sb = [];
136
+ } else do
137
+ o.__d = !1, L && L(e), c = o.render(o.props, o.state, o.context), o.state = o.__s;
138
+ while (o.__d && ++be < 25);
139
+ o.state = o.__s, o.getChildContext != null && (i = N(N({}, i), o.getChildContext())), y && !h && o.getSnapshotBeforeUpdate != null && (x = o.getSnapshotBeforeUpdate(a, b)), O = c, c != null && c.type === B && c.key == null && (O = Ge(c.props.children)), l = Be(t, z(O) ? O : [O], e, n, i, _, r, s, l, f, u), o.base = e.__e, e.__u &= -161, o.__h.length && s.push(o), w && (o.__E = o.__ = 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 (oe = r.length; oe--; ) ve(r[oe]);
146
+ fe(e);
147
+ }
148
+ else e.__e = n.__e, e.__k = n.__k, A.then || fe(e);
149
+ v.__e(A, e, n);
150
+ }
151
+ else r == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = dt(n.__e, e, n, i, _, r, s, f, u);
152
+ return (c = v.diffed) && c(e), 128 & e.__u ? void 0 : l;
153
+ }
154
+ function fe(t) {
155
+ t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(fe);
156
+ }
157
+ function Je(t, e, n) {
158
+ for (var i = 0; i < n.length; i++) ye(n[i], n[++i], n[++i]);
159
+ v.__c && v.__c(e, t), t.some(function(_) {
160
+ try {
161
+ t = _.__h, _.__h = [], t.some(function(r) {
162
+ r.call(_);
163
+ });
164
+ } catch (r) {
165
+ v.__e(r, _.__v);
166
+ }
167
+ });
168
+ }
169
+ function Ge(t) {
170
+ return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : z(t) ? t.map(Ge) : N({}, t);
171
+ }
172
+ function dt(t, e, n, i, _, r, s, l, f) {
173
+ var u, c, o, h, a, b, x, w = n.props, p = e.props, y = e.type;
174
+ if (y == "svg" ? _ = "http://www.w3.org/2000/svg" : y == "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 == !!y && (y ? a.localName == y : a.nodeType == 3)) {
176
+ t = a, r[u] = null;
177
+ break;
178
+ }
179
+ }
180
+ if (t == null) {
181
+ if (y == null) return document.createTextNode(p);
182
+ t = document.createElementNS(_, y, p.is && p), l && (v.__m && v.__m(e, r), l = !1), r = null;
183
+ }
184
+ if (y == null) w === p || l && t.data == p || (t.data = p);
185
+ else {
186
+ if (r = r && ie.call(t.childNodes), w = n.props || q, !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") o = a;
189
+ else if (!(u in p)) {
190
+ if (u == "value" && "defaultValue" in p || u == "checked" && "defaultChecked" in p) continue;
191
+ G(t, u, null, a, _);
192
+ }
193
+ }
194
+ for (u in p) a = p[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 || o && (c.__html == o.__html || c.__html == t.innerHTML) || (t.innerHTML = c.__html), e.__k = [];
196
+ else if (o && (t.innerHTML = ""), Be(e.type == "template" ? t.content : t, z(h) ? h : [h], e, n, i, y == "foreignObject" ? "http://www.w3.org/1999/xhtml" : _, r, s, r ? r[0] : n.__k && M(n, 0), l, f), r != null) for (u = r.length; u--; ) ve(r[u]);
197
+ l || (u = "value", y == "progress" && b == null ? t.removeAttribute("value") : b != null && (b !== t[u] || y == "progress" && !b || y == "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 ye(t, e, n) {
202
+ try {
203
+ if (typeof t == "function") {
204
+ var i = typeof t.__u == "function";
205
+ i && t.__u(), i && e == null || (t.__u = t(e));
206
+ } else t.current = e;
207
+ } catch (_) {
208
+ v.__e(_, n);
209
+ }
210
+ }
211
+ function Ke(t, e, n) {
212
+ var i, _;
213
+ if (v.unmount && v.unmount(t), (i = t.ref) && (i.current && i.current != t.__e || ye(i, null, e)), (i = t.__c) != null) {
214
+ if (i.componentWillUnmount) try {
215
+ i.componentWillUnmount();
216
+ } catch (r) {
217
+ v.__e(r, e);
218
+ }
219
+ i.base = i.__P = null;
220
+ }
221
+ if (i = t.__k) for (_ = 0; _ < i.length; _++) i[_] && Ke(i[_], e, n || typeof t.type != "function");
222
+ n || ve(t.__e), t.__c = t.__ = t.__e = void 0;
223
+ }
224
+ function vt(t, e, n) {
225
+ return this.constructor(t, n);
226
+ }
227
+ function Se(t, e, n) {
228
+ var i, _, r, s;
229
+ e == document && (e = document.documentElement), v.__ && v.__(t, e), _ = (i = !1) ? null : e.__k, r = [], s = [], pe(e, t = e.__k = R(B, null, [t]), _ || q, q, e.namespaceURI, _ ? null : e.firstChild ? ie.call(e.childNodes) : null, r, _ ? _.__e : e.firstChild, i, s), Je(r, t, s);
230
+ }
231
+ ie = Re.slice, v = { __e: function(t, e, n, i) {
232
+ for (var _, r, s; e = e.__; ) if ((_ = e.__c) && !_.__) try {
233
+ if ((r = _.constructor) && r.getDerivedStateFromError != null && (_.setState(r.getDerivedStateFromError(t)), s = _.__d), _.componentDidCatch != null && (_.componentDidCatch(t, i || {}), s = _.__d), s) return _.__E = _;
234
+ } catch (l) {
235
+ t = l;
236
+ }
237
+ throw t;
238
+ } }, Oe = 0, Fe = function(t) {
239
+ return t != null && t.constructor == null;
240
+ }, I.prototype.setState = function(t, e) {
241
+ var n;
242
+ n = this.__s != null && this.__s != this.state ? this.__s : this.__s = N({}, this.state), typeof t == "function" && (t = t(N({}, n), this.props)), t && N(n, t), t != null && this.__v && (e && this._sb.push(e), $e(this));
243
+ }, I.prototype.forceUpdate = function(t) {
244
+ this.__v && (this.__e = !0, t && this.__h.push(t), $e(this));
245
+ }, I.prototype.render = B, P = [], Ie = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, We = function(t, e) {
246
+ return t.__v.__b - e.__v.__b;
247
+ }, Q.__r = 0, qe = /(PointerCapture)$|Capture$/i, de = 0, ue = xe(!1), le = xe(!0);
248
+ var pt = 0;
249
+ function $(t, e, n, i, _, r) {
250
+ e || (e = {});
251
+ var s, l, f = e;
252
+ if ("ref" in f) for (l in f = {}, e) l == "ref" ? s = e[l] : f[l] = e[l];
253
+ var u = { type: t, props: f, key: n, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --pt, __i: -1, __u: 0, __source: _, __self: r };
254
+ if (typeof t == "function" && (s = t.defaultProps)) for (l in s) f[l] === void 0 && (f[l] = s[l]);
255
+ return v.vnode && v.vnode(u), u;
256
+ }
257
+ var ee, m, se, Ce, ae = 0, Xe = [], g = v, Ne = g.__b, Ee = g.__r, He = g.diffed, Ue = g.__c, Pe = g.unmount, Te = g.__;
258
+ function Ye(t, e) {
259
+ g.__h && g.__h(m, t, ae || e), ae = 0;
260
+ var n = m.__H || (m.__H = { __: [], __h: [] });
261
+ return t >= n.__.length && n.__.push({}), n.__[t];
262
+ }
263
+ function Ae(t) {
264
+ return ae = 1, yt(et, t);
265
+ }
266
+ function yt(t, e, n) {
267
+ var i = Ye(ee++, 2);
268
+ if (i.t = t, !i.__c && (i.__ = [et(void 0, e), function(l) {
269
+ var f = i.__N ? i.__N[0] : i.__[0], u = i.t(f, l);
270
+ f !== u && (i.__N = [u, i.__[1]], i.__c.setState({}));
271
+ }], i.__c = m, !m.__f)) {
272
+ var _ = function(l, f, u) {
273
+ if (!i.__c.__H) return !0;
274
+ var c = i.__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 o = i.__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] && (o = !0);
285
+ }
286
+ }), r && r.call(this, l, f, u) || o;
287
+ };
288
+ m.__f = !0;
289
+ var r = m.shouldComponentUpdate, s = 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
+ s && s.call(this, l, f, u);
296
+ }, m.shouldComponentUpdate = _;
297
+ }
298
+ return i.__N || i.__;
299
+ }
300
+ function Qe(t, e) {
301
+ var n = Ye(ee++, 7);
302
+ return bt(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
303
+ }
304
+ function mt() {
305
+ for (var t; t = Xe.shift(); ) if (t.__P && t.__H) try {
306
+ t.__H.__h.forEach(Y), t.__H.__h.forEach(ce), 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, Ne && Ne(t);
313
+ }, g.__ = function(t, e) {
314
+ t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Te && Te(t, e);
315
+ }, g.__r = function(t) {
316
+ Ee && Ee(t), ee = 0;
317
+ var e = (m = t.__c).__H;
318
+ e && (se === m ? (e.__h = [], m.__h = [], e.__.forEach(function(n) {
319
+ n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
320
+ })) : (e.__h.forEach(Y), e.__h.forEach(ce), e.__h = [], ee = 0)), se = m;
321
+ }, g.diffed = function(t) {
322
+ He && He(t);
323
+ var e = t.__c;
324
+ e && e.__H && (e.__H.__h.length && (Xe.push(e) !== 1 && Ce === g.requestAnimationFrame || ((Ce = g.requestAnimationFrame) || gt)(mt)), e.__H.__.forEach(function(n) {
325
+ n.u && (n.__H = n.u), n.u = void 0;
326
+ })), se = m = null;
327
+ }, g.__c = function(t, e) {
328
+ e.some(function(n) {
329
+ try {
330
+ n.__h.forEach(Y), n.__h = n.__h.filter(function(i) {
331
+ return !i.__ || ce(i);
332
+ });
333
+ } catch (i) {
334
+ e.some(function(_) {
335
+ _.__h && (_.__h = []);
336
+ }), e = [], g.__e(i, n.__v);
337
+ }
338
+ }), Ue && Ue(t, e);
339
+ }, g.unmount = function(t) {
340
+ Pe && Pe(t);
341
+ var e, n = t.__c;
342
+ n && n.__H && (n.__H.__.forEach(function(i) {
343
+ try {
344
+ Y(i);
345
+ } catch (_) {
346
+ e = _;
347
+ }
348
+ }), n.__H = void 0, e && g.__e(e, n.__v));
349
+ };
350
+ var Me = typeof requestAnimationFrame == "function";
351
+ function gt(t) {
352
+ var e, n = function() {
353
+ clearTimeout(i), Me && cancelAnimationFrame(e), setTimeout(t);
354
+ }, i = setTimeout(n, 35);
355
+ Me && (e = requestAnimationFrame(n));
356
+ }
357
+ function Y(t) {
358
+ var e = m, n = t.__c;
359
+ typeof n == "function" && (t.__c = void 0, n()), m = e;
360
+ }
361
+ function ce(t) {
362
+ var e = m;
363
+ t.__c = t.__(), m = e;
364
+ }
365
+ function bt(t, e) {
366
+ return !t || t.length !== e.length || e.some(function(n, i) {
367
+ return n !== t[i];
368
+ });
369
+ }
370
+ function et(t, e) {
371
+ return typeof e == "function" ? e(t) : e;
372
+ }
373
+ const wt = (...t) => t.filter((e, n, i) => !!e && e.trim() !== "" && i.indexOf(e) === n).join(" ").trim();
374
+ const je = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
375
+ const $t = (t) => t.replace(
376
+ /^([A-Z])|[\s-_]+(\w)/g,
377
+ (e, n, i) => i ? i.toUpperCase() : n.toLowerCase()
378
+ );
379
+ const De = (t) => {
380
+ const e = $t(t);
381
+ return e.charAt(0).toUpperCase() + e.slice(1);
382
+ };
383
+ var kt = {
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 xt = (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 St = ({
401
+ color: t = "currentColor",
402
+ size: e = 24,
403
+ strokeWidth: n = 2,
404
+ absoluteStrokeWidth: i,
405
+ children: _,
406
+ iconNode: r,
407
+ class: s = "",
408
+ ...l
409
+ }) => R(
410
+ "svg",
411
+ {
412
+ ...kt,
413
+ width: String(e),
414
+ height: e,
415
+ stroke: t,
416
+ "stroke-width": i ? Number(n) * 24 / Number(e) : n,
417
+ class: ["lucide", s].join(" "),
418
+ ...!_ && !xt(l) && { "aria-hidden": "true" },
419
+ ...l
420
+ },
421
+ [...r.map(([f, u]) => R(f, u)), ...Ze(_)]
422
+ );
423
+ const re = (t, e) => {
424
+ const n = ({ class: i = "", className: _ = "", children: r, ...s }) => R(
425
+ St,
426
+ {
427
+ ...s,
428
+ iconNode: e,
429
+ class: wt(
430
+ `lucide-${je(De(t))}`,
431
+ `lucide-${je(t)}`,
432
+ i,
433
+ _
434
+ )
435
+ },
436
+ r
437
+ );
438
+ return n.displayName = De(t), n;
439
+ };
440
+ const Ct = re("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 Nt = re("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 Et = re("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 Ht = re("x", [
468
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
469
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
470
+ ]);
471
+ var Ut = /* @__PURE__ */ Symbol.for("preact-signals");
472
+ function _e() {
473
+ if (U > 1)
474
+ U--;
475
+ else {
476
+ for (var t, e = !1; W !== void 0; ) {
477
+ var n = W;
478
+ for (W = void 0, he++; n !== void 0; ) {
479
+ var i = n.o;
480
+ if (n.o = void 0, n.f &= -3, !(8 & n.f) && it(n)) try {
481
+ n.c();
482
+ } catch (_) {
483
+ e || (t = _, e = !0);
484
+ }
485
+ n = i;
486
+ }
487
+ }
488
+ if (he = 0, U--, e) throw t;
489
+ }
490
+ }
491
+ function Pt(t) {
492
+ if (U > 0) return t();
493
+ U++;
494
+ try {
495
+ return t();
496
+ } finally {
497
+ _e();
498
+ }
499
+ }
500
+ var d = void 0;
501
+ function tt(t) {
502
+ var e = d;
503
+ d = void 0;
504
+ try {
505
+ return t();
506
+ } finally {
507
+ d = e;
508
+ }
509
+ }
510
+ var W = void 0, U = 0, he = 0, te = 0;
511
+ function nt(t) {
512
+ if (d !== void 0) {
513
+ var e = t.n;
514
+ if (e === void 0 || e.t !== d)
515
+ return e = { i: 0, S: t, p: d.s, n: void 0, t: d, e: void 0, x: void 0, r: e }, d.s !== void 0 && (d.s.n = e), d.s = e, t.n = e, 32 & d.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 = d.s, e.n = void 0, d.s.n = e, d.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 = Ut;
524
+ k.prototype.h = function() {
525
+ return !0;
526
+ };
527
+ k.prototype.S = function(t) {
528
+ var e = this, n = this.t;
529
+ n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : tt(function() {
530
+ var i;
531
+ (i = e.W) == null || i.call(e);
532
+ }));
533
+ };
534
+ k.prototype.U = function(t) {
535
+ var e = this;
536
+ if (this.t !== void 0) {
537
+ var n = t.e, i = t.x;
538
+ n !== void 0 && (n.x = i, t.e = void 0), i !== void 0 && (i.e = n, t.x = void 0), t === this.t && (this.t = i, i === void 0 && tt(function() {
539
+ var _;
540
+ (_ = e.Z) == null || _.call(e);
541
+ }));
542
+ }
543
+ };
544
+ k.prototype.subscribe = function(t) {
545
+ var e = this;
546
+ return V(function() {
547
+ var n = e.value, i = d;
548
+ d = void 0;
549
+ try {
550
+ t(n);
551
+ } finally {
552
+ d = i;
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 = d;
567
+ d = void 0;
568
+ try {
569
+ return this.value;
570
+ } finally {
571
+ d = t;
572
+ }
573
+ };
574
+ Object.defineProperty(k.prototype, "value", { get: function() {
575
+ var t = nt(this);
576
+ return t !== void 0 && (t.i = this.i), this.v;
577
+ }, set: function(t) {
578
+ if (t !== this.v) {
579
+ if (he > 100) throw new Error("Cycle detected");
580
+ this.v = t, this.i++, te++, U++;
581
+ try {
582
+ for (var e = this.t; e !== void 0; e = e.x) e.t.N();
583
+ } finally {
584
+ _e();
585
+ }
586
+ }
587
+ } });
588
+ function me(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 rt(t) {
596
+ for (var e = t.s; e !== void 0; e = e.n) {
597
+ var n = e.S.n;
598
+ if (n !== void 0 && (e.r = n), e.S.n = e, e.i = -1, e.n === void 0) {
599
+ t.s = e;
600
+ break;
601
+ }
602
+ }
603
+ }
604
+ function _t(t) {
605
+ for (var e = t.s, n = void 0; e !== void 0; ) {
606
+ var i = e.p;
607
+ e.i === -1 ? (e.S.U(e), i !== void 0 && (i.n = e.n), e.n !== void 0 && (e.n.p = i)) : n = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = i;
608
+ }
609
+ t.s = n;
610
+ }
611
+ function T(t, e) {
612
+ k.call(this, void 0), this.x = t, this.s = void 0, this.g = te - 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 === te)) return !0;
618
+ if (this.g = te, this.f |= 1, this.i > 0 && !it(this))
619
+ return this.f &= -2, !0;
620
+ var t = d;
621
+ try {
622
+ rt(this), d = 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 (n) {
626
+ this.v = n, this.f |= 16, this.i++;
627
+ }
628
+ return d = t, _t(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 = nt(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 Le(t, e) {
656
+ return new T(t, e);
657
+ }
658
+ function ot(t) {
659
+ var e = t.u;
660
+ if (t.u = void 0, typeof e == "function") {
661
+ U++;
662
+ var n = d;
663
+ d = void 0;
664
+ try {
665
+ e();
666
+ } catch (i) {
667
+ throw t.f &= -2, t.f |= 8, ge(t), i;
668
+ } finally {
669
+ d = n, _e();
670
+ }
671
+ }
672
+ }
673
+ function ge(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, ot(t);
676
+ }
677
+ function Tt(t) {
678
+ if (d !== this) throw new Error("Out-of-order effect");
679
+ _t(this), d = t, this.f &= -2, 8 & this.f && ge(this), _e();
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, ot(this), rt(this), U++;
697
+ var t = d;
698
+ return d = this, Tt.bind(this, t);
699
+ };
700
+ j.prototype.N = function() {
701
+ 2 & this.f || (this.f |= 2, this.o = W, W = this);
702
+ };
703
+ j.prototype.d = function() {
704
+ this.f |= 8, 1 & this.f || ge(this);
705
+ };
706
+ j.prototype.dispose = function() {
707
+ this.d();
708
+ };
709
+ function V(t, e) {
710
+ var n = new j(t, e);
711
+ try {
712
+ n.c();
713
+ } catch (_) {
714
+ throw n.d(), _;
715
+ }
716
+ var i = n.d.bind(n);
717
+ return i[Symbol.dispose] = i, i;
718
+ }
719
+ var st, K, At = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, ut = [];
720
+ V(function() {
721
+ st = this.N;
722
+ })();
723
+ function D(t, e) {
724
+ v[t] = e.bind(null, v[t] || function() {
725
+ });
726
+ }
727
+ function ne(t) {
728
+ if (K) {
729
+ var e = K;
730
+ K = void 0, e();
731
+ }
732
+ K = t && t.S();
733
+ }
734
+ function lt(t) {
735
+ var e = this, n = t.data, i = jt(n);
736
+ i.value = n;
737
+ var _ = Qe(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 = Le(function() {
743
+ var a = i.value.value;
744
+ return a === 0 ? 0 : a === !0 ? "" : a || "";
745
+ }), c = Le(function() {
746
+ return !Array.isArray(u.value) && !Fe(u.value);
747
+ }), o = V(function() {
748
+ if (this.N = ft, 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
+ o(), h.call(this);
755
+ }, [c, u];
756
+ }, []), r = _[0], s = _[1];
757
+ return r.value ? s.peek() : s.value;
758
+ }
759
+ lt.displayName = "ReactiveTextNode";
760
+ Object.defineProperties(k.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: lt }, 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 n, i = e.props;
766
+ for (var _ in i) if (_ !== "children") {
767
+ var r = i[_];
768
+ r instanceof k && (n || (e.__np = n = {}), n[_] = r, i[_] = r.peek());
769
+ }
770
+ }
771
+ t(e);
772
+ });
773
+ D("__r", function(t, e) {
774
+ if (t(e), e.type !== B) {
775
+ ne();
776
+ var n, i = e.__c;
777
+ i && (i.__$f &= -2, (n = i.__$u) === void 0 && (i.__$u = n = (function(_, r) {
778
+ var s;
779
+ return V(function() {
780
+ s = this;
781
+ }, { name: r }), s.c = _, s;
782
+ })(function() {
783
+ var _;
784
+ At && ((_ = n.y) == null || _.call(n)), i.__$f |= 1, i.setState({});
785
+ }, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), ne(n);
786
+ }
787
+ });
788
+ D("__e", function(t, e, n, i) {
789
+ ne(), t(e, n, i);
790
+ });
791
+ D("diffed", function(t, e) {
792
+ ne();
793
+ var n;
794
+ if (typeof e.type == "string" && (n = e.__e)) {
795
+ var i = e.__np, _ = e.props;
796
+ if (i) {
797
+ var r = n.U;
798
+ if (r) for (var s in r) {
799
+ var l = r[s];
800
+ l !== void 0 && !(s in i) && (l.d(), r[s] = void 0);
801
+ }
802
+ else
803
+ r = {}, n.U = r;
804
+ for (var f in i) {
805
+ var u = r[f], c = i[f];
806
+ u === void 0 ? (u = Mt(n, f, c, _), r[f] = u) : u.o(c, _);
807
+ }
808
+ }
809
+ }
810
+ t(e);
811
+ });
812
+ function Mt(t, e, n, i) {
813
+ var _ = e in t && t.ownerSVGElement === void 0, r = me(n);
814
+ return { o: function(s, l) {
815
+ r.value = s, i = l;
816
+ }, d: V(function() {
817
+ this.N = ft;
818
+ var s = r.value.value;
819
+ i[e] !== s && (i[e] = s, _ ? t[e] = s : s != null && (s !== !1 || e[4] === "-") ? t.setAttribute(e, s) : t.removeAttribute(e));
820
+ }) };
821
+ }
822
+ D("unmount", function(t, e) {
823
+ if (typeof e.type == "string") {
824
+ var n = e.__e;
825
+ if (n) {
826
+ var i = n.U;
827
+ if (i) {
828
+ n.U = void 0;
829
+ for (var _ in i) {
830
+ var r = i[_];
831
+ r && r.d();
832
+ }
833
+ }
834
+ }
835
+ } else {
836
+ var s = e.__c;
837
+ if (s) {
838
+ var l = s.__$u;
839
+ l && (s.__$u = void 0, l.d());
840
+ }
841
+ }
842
+ t(e);
843
+ });
844
+ D("__h", function(t, e, n, i) {
845
+ (i < 3 || i === 9) && (e.__$f |= 2), t(e, n, i);
846
+ });
847
+ I.prototype.shouldComponentUpdate = function(t, e) {
848
+ if (this.__R) return !0;
849
+ var n = this.__$u, i = n && n.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 (!(i || r || 4 & this.__$f) || 1 & this.__$f) return !0;
854
+ } else if (!(i || 4 & this.__$f) || 3 & this.__$f) return !0;
855
+ for (var s in t) if (s !== "__source" && t[s] !== this.props[s]) return !0;
856
+ for (var l in this.props) if (!(l in t)) return !0;
857
+ return !1;
858
+ };
859
+ function jt(t, e) {
860
+ return Qe(function() {
861
+ return me(t, e);
862
+ }, []);
863
+ }
864
+ var Dt = function(t) {
865
+ queueMicrotask(function() {
866
+ queueMicrotask(t);
867
+ });
868
+ };
869
+ function Lt() {
870
+ Pt(function() {
871
+ for (var t; t = ut.shift(); ) st.call(t);
872
+ });
873
+ }
874
+ function ft() {
875
+ ut.push(this) === 1 && (v.requestAnimationFrame || Dt)(Lt);
876
+ }
877
+ const S = me(!1);
878
+ function Ot({ options: t }) {
879
+ const [e, n] = Ae(""), [i, _] = Ae([
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", s = t.position === "bottom-left", l = () => {
886
+ if (!e.trim()) return;
887
+ const u = { id: Date.now(), text: e, sender: "user" };
888
+ _([...i, u]), n(""), 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${s ? " jex-pos-left" : ""}`, children: [
900
+ S.value && /* @__PURE__ */ $("div", { className: "jex-chat-window", children: [
901
+ /* @__PURE__ */ $("header", { className: "jex-chat-header", children: [
902
+ /* @__PURE__ */ $(Ct, { 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: i.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) => n(u.currentTarget.value),
917
+ onKeyDown: (u) => u.key === "Enter" && l()
918
+ }
919
+ ),
920
+ /* @__PURE__ */ $("button", { className: "jex-send-btn", onClick: l, children: /* @__PURE__ */ $(Et, { size: 18 }) })
921
+ ] })
922
+ ] }),
923
+ /* @__PURE__ */ $(
924
+ "button",
925
+ {
926
+ className: "jex-floating-button",
927
+ onClick: () => S.value = !S.value,
928
+ "aria-label": S.value ? "Close chat" : "Open chat",
929
+ children: S.value ? /* @__PURE__ */ $(Ht, { size: 28 }) : /* @__PURE__ */ $(Nt, { size: 28 })
930
+ }
931
+ )
932
+ ] }) });
933
+ }
934
+ let F = null;
935
+ function Ft(t) {
936
+ F && F.shutdown();
937
+ let e;
938
+ 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)), Se(R(Ot, { options: t }), e);
939
+ const n = /* @__PURE__ */ new Set(), i = S.subscribe((r) => {
940
+ for (const s of n) s(r);
941
+ }), _ = {
942
+ shutdown() {
943
+ i(), n.clear(), Se(null, e), t.container || e.remove(), F === _ && (F = null);
944
+ },
945
+ open() {
946
+ S.value = !0;
947
+ },
948
+ close() {
949
+ S.value = !1;
950
+ },
951
+ toggle() {
952
+ S.value = !S.value;
953
+ },
954
+ get isOpen() {
955
+ return S.value;
956
+ },
957
+ subscribe(r) {
958
+ return n.add(r), () => n.delete(r);
959
+ }
960
+ };
961
+ return F = _, _;
962
+ }
963
+ export {
964
+ Ft as JexityChat
965
+ };
966
+ //# sourceMappingURL=index.mjs.map