@squadico/chatbot 1.1.3 → 1.2.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/README.md +27 -7
- package/dist/chatbot.global.js +7 -7
- package/dist/chatbot.global.js.map +1 -1
- package/dist/components/AgentRail.d.ts +22 -0
- package/dist/components/AgentRail.d.ts.map +1 -0
- package/dist/components/Avatar.d.ts +19 -0
- package/dist/components/Avatar.d.ts.map +1 -0
- package/dist/components/ChatbotWidget.d.ts.map +1 -1
- package/dist/components/Composer.d.ts.map +1 -1
- package/dist/components/MessageList.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/i18n.d.ts +2 -0
- package/dist/lib/i18n.d.ts.map +1 -1
- package/dist/lib/rail.d.ts +20 -0
- package/dist/lib/rail.d.ts.map +1 -0
- package/dist/lib/useChat.d.ts +3 -0
- package/dist/lib/useChat.d.ts.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/{src-D6ZMGuKC.js → src-2GKPJcbZ.js} +683 -586
- package/dist/src-2GKPJcbZ.js.map +1 -0
- package/dist/src-CcILETWB.cjs +8 -0
- package/dist/src-CcILETWB.cjs.map +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -1
- package/dist/src-D6ZMGuKC.js.map +0 -1
- package/dist/src-DeXNeWwe.cjs +0 -8
- package/dist/src-DeXNeWwe.cjs.map +0 -1
|
@@ -45,7 +45,7 @@ function w(e, t) {
|
|
|
45
45
|
function T(e) {
|
|
46
46
|
if (e.__P && e.__d) {
|
|
47
47
|
var n = e.__v, r = n.__e, i = [], a = [], o = v({}, n);
|
|
48
|
-
o.__v = n.__v + 1, t.vnode && t.vnode(o), I(e.__P, o, n, e.__n, e.__P.namespaceURI, 32 & n.__u ? [r] : null, i, r ?? w(n), !!(32 & n.__u), a), o.__v = n.__v, o.__.__k[o.__i] = o,
|
|
48
|
+
o.__v = n.__v + 1, t.vnode && t.vnode(o), I(e.__P, o, n, e.__n, e.__P.namespaceURI, 32 & n.__u ? [r] : null, i, r ?? w(n), !!(32 & n.__u), a), o.__v = n.__v, o.__.__k[o.__i] = o, L(i, o, a), n.__e = n.__ = null, o.__e != r && E(o);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
function E(e) {
|
|
@@ -65,13 +65,13 @@ function O() {
|
|
|
65
65
|
}
|
|
66
66
|
function k(e, t, n, r, i, a, o, s, c, l, u) {
|
|
67
67
|
var d, f, p, g, _, v, y = r && r.__k || h, b = t.length;
|
|
68
|
-
for (c = A(n, t, y, c, b), d = 0; d < b; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && y[p.__i] || m, p.__i = d, v = I(e, p, f, i, a, o, s, c, l, u), g = p.__e, p.ref && f.ref != p.ref && (f.ref &&
|
|
68
|
+
for (c = A(n, t, y, c, b), d = 0; d < b; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && y[p.__i] || m, p.__i = d, v = I(e, p, f, i, a, o, s, c, l, u), g = p.__e, p.ref && f.ref != p.ref && (f.ref && ne(f.ref, null, p), u.push(p.ref, p.__c || g, p)), _ == null && g != null && (_ = g), 4 & p.__u ? (c = j(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && v !== void 0 ? c = v : g && (c = g.nextSibling), p.__u &= -7);
|
|
69
69
|
return n.__e = _, c;
|
|
70
70
|
}
|
|
71
71
|
function A(e, t, n, r, i) {
|
|
72
72
|
var a, o, s, c, l, u = n.length, d = u, f = 0;
|
|
73
73
|
for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = x(null, o, null, null, null) : _(o) ? o = e.__k[a] = x(S, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = x(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = M(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
|
|
74
|
-
if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = w(s)),
|
|
74
|
+
if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = w(s)), re(s, s));
|
|
75
75
|
return r;
|
|
76
76
|
}
|
|
77
77
|
function j(e, t, n) {
|
|
@@ -132,7 +132,7 @@ function I(e, n, r, i, a, o, s, c, l, u) {
|
|
|
132
132
|
n: if (typeof F == "function") {
|
|
133
133
|
f = s.length;
|
|
134
134
|
try {
|
|
135
|
-
if (E = n.props, D = F.prototype && F.prototype.render, O = (d = F.contextType) && i[d.__c], A = d ? O ? O.props.value : d.__ : i, r.__c ? T = (p = n.__c = r.__c).__ = p.__E : (D ? n.__c = p = new F(E, A) : (n.__c = p = new C(E, A), p.constructor = F, p.render =
|
|
135
|
+
if (E = n.props, D = F.prototype && F.prototype.render, O = (d = F.contextType) && i[d.__c], A = d ? O ? O.props.value : d.__ : i, r.__c ? T = (p = n.__c = r.__c).__ = p.__E : (D ? n.__c = p = new F(E, A) : (n.__c = p = new C(E, A), p.constructor = F, p.render = ie), O && O.sub(p), p.state || (p.state = {}), p.__n = i, m = p.__d = !0, p.__h = [], p._sb = []), D && p.__s == null && (p.__s = p.state), D && F.getDerivedStateFromProps != null && (p.__s == p.state && (p.__s = v({}, p.__s)), v(p.__s, F.getDerivedStateFromProps(E, p.__s))), g = p.props, b = p.state, p.__v = n, m) D && F.getDerivedStateFromProps == null && p.componentWillMount != null && p.componentWillMount(), D && p.componentDidMount != null && p.__h.push(p.componentDidMount);
|
|
136
136
|
else {
|
|
137
137
|
if (D && F.getDerivedStateFromProps == null && E !== g && p.componentWillReceiveProps != null && p.componentWillReceiveProps(E, A), n.__v == r.__v || !p.__e && p.shouldComponentUpdate != null && !1 === p.shouldComponentUpdate(E, p.__s, A)) {
|
|
138
138
|
n.__v != r.__v && (p.props = E, p.state = p.__s, p.__d = !1), n.__e = r.__e, n.__k = r.__k, n.__k.some(function(e) {
|
|
@@ -148,7 +148,7 @@ function I(e, n, r, i, a, o, s, c, l, u) {
|
|
|
148
148
|
else do
|
|
149
149
|
p.__d = !1, j && j(n), d = p.render(p.props, p.state, p.context), p.state = p.__s;
|
|
150
150
|
while (p.__d && ++M < 25);
|
|
151
|
-
p.state = p.__s, p.getChildContext != null && (i = v(v({}, i), p.getChildContext())), D && !m && p.getSnapshotBeforeUpdate != null && (x = p.getSnapshotBeforeUpdate(g, b)), N = d != null && d.type === S && d.key == null ?
|
|
151
|
+
p.state = p.__s, p.getChildContext != null && (i = v(v({}, i), p.getChildContext())), D && !m && p.getSnapshotBeforeUpdate != null && (x = p.getSnapshotBeforeUpdate(g, b)), N = d != null && d.type === S && d.key == null ? te(d.props.children) : d, c = k(e, _(N) ? N : [N], n, r, i, a, o, s, c, l, u), p.base = n.__e, n.__u &= -161, p.__h.length && s.push(p), T && (p.__E = p.__ = null);
|
|
152
152
|
} catch (e) {
|
|
153
153
|
if (s.length = f, n.__v = null, l || o != null) {
|
|
154
154
|
if (e.then) {
|
|
@@ -156,16 +156,16 @@ function I(e, n, r, i, a, o, s, c, l, u) {
|
|
|
156
156
|
o != null && (o[o.indexOf(c)] = null), n.__e = c;
|
|
157
157
|
} else if (o != null) for (P = o.length; P--;) y(o[P]);
|
|
158
158
|
} else n.__e = r.__e;
|
|
159
|
-
n.__k ?? (n.__k = r.__k || []), e.then ||
|
|
159
|
+
n.__k ?? (n.__k = r.__k || []), e.then || ee(n), t.__e(e, n, r);
|
|
160
160
|
}
|
|
161
|
-
} else o == null && n.__v == r.__v ? (n.__k = r.__k, n.__e = r.__e) : c = n.__e =
|
|
161
|
+
} else o == null && n.__v == r.__v ? (n.__k = r.__k, n.__e = r.__e) : c = n.__e = R(r.__e, n, r, i, a, o, s, l, u);
|
|
162
162
|
return (d = t.diffed) && d(n), 128 & n.__u ? void 0 : c;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(
|
|
164
|
+
function ee(e) {
|
|
165
|
+
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(ee));
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
for (var i = 0; i < r.length; i++)
|
|
167
|
+
function L(e, n, r) {
|
|
168
|
+
for (var i = 0; i < r.length; i++) ne(r[i], r[++i], r[++i]);
|
|
169
169
|
t.__c && t.__c(n, e), e.some(function(n) {
|
|
170
170
|
try {
|
|
171
171
|
e = n.__h, n.__h = [], e.some(function(e) {
|
|
@@ -176,10 +176,10 @@ function R(e, n, r) {
|
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
return typeof e != "object" || !e || e.__b > 0 ? e : _(e) ? e.map(
|
|
179
|
+
function te(e) {
|
|
180
|
+
return typeof e != "object" || !e || e.__b > 0 ? e : _(e) ? e.map(te) : e.constructor === void 0 ? v({}, e) : null;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function R(n, r, i, a, o, s, c, l, u) {
|
|
183
183
|
var d, f, p, h, g, v, b, x = i.props || m, S = r.props, C = r.type;
|
|
184
184
|
if (C == "svg" ? o = "http://www.w3.org/2000/svg" : C == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), s != null) {
|
|
185
185
|
for (d = 0; d < s.length; d++) if ((g = s[d]) && "setAttribute" in g == !!C && (C ? g.localName == C : g.nodeType == 3)) {
|
|
@@ -202,7 +202,7 @@ function z(n, r, i, a, o, s, c, l, u) {
|
|
|
202
202
|
}
|
|
203
203
|
return n;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function ne(e, n, r) {
|
|
206
206
|
try {
|
|
207
207
|
if (typeof e == "function") {
|
|
208
208
|
var i = typeof e.__u == "function";
|
|
@@ -212,9 +212,9 @@ function te(e, n, r) {
|
|
|
212
212
|
t.__e(e, r);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function re(e, n, r) {
|
|
216
216
|
var i, a;
|
|
217
|
-
if (t.unmount && t.unmount(e), (i = e.ref) && (i.current && i.current != e.__e ||
|
|
217
|
+
if (t.unmount && t.unmount(e), (i = e.ref) && (i.current && i.current != e.__e || ne(i, null, n)), (i = e.__c) != null) {
|
|
218
218
|
if (i.componentWillUnmount) try {
|
|
219
219
|
i.componentWillUnmount();
|
|
220
220
|
} catch (e) {
|
|
@@ -222,15 +222,15 @@ function ne(e, n, r) {
|
|
|
222
222
|
}
|
|
223
223
|
i.base = i.__P = i.__n = null;
|
|
224
224
|
}
|
|
225
|
-
if (i = e.__k) for (a = 0; a < i.length; a++) i[a] &&
|
|
225
|
+
if (i = e.__k) for (a = 0; a < i.length; a++) i[a] && re(i[a], n, r || typeof e.type != "function");
|
|
226
226
|
r || y(e.__e), e.__c = e.__ = e.__e = void 0;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function ie(e, t, n) {
|
|
229
229
|
return this.constructor(e, n);
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function ae(n, r, i) {
|
|
232
232
|
var a, o, s, c;
|
|
233
|
-
r == document && (r = document.documentElement), t.__ && t.__(n, r), o = (a = typeof i == "function") ? null : i && i.__k || r.__k, s = [], c = [], I(r, n = (!a && i || r).__k = b(S, null, [n]), o || m, m, r.namespaceURI, !a && i ? [i] : o ? null : r.firstChild ? e.call(r.childNodes) : null, s, !a && i ? i : o ? o.__e : r.firstChild, a, c),
|
|
233
|
+
r == document && (r = document.documentElement), t.__ && t.__(n, r), o = (a = typeof i == "function") ? null : i && i.__k || r.__k, s = [], c = [], I(r, n = (!a && i || r).__k = b(S, null, [n]), o || m, m, r.namespaceURI, !a && i ? [i] : o ? null : r.firstChild ? e.call(r.childNodes) : null, s, !a && i ? i : o ? o.__e : r.firstChild, a, c), L(s, n, c), n.props.children = null;
|
|
234
234
|
}
|
|
235
235
|
e = h.slice, t = { __e: function(e, t, n, r) {
|
|
236
236
|
for (var i, a, o; t = t.__;) if ((i = t.__c) && !i.__) try {
|
|
@@ -249,24 +249,24 @@ e = h.slice, t = { __e: function(e, t, n, r) {
|
|
|
249
249
|
}, O.__r = 0, s = Math.random().toString(8), c = "__d" + s, l = "__a" + s, u = /(PointerCapture)$|Capture$/i, d = 0, f = F(!1), p = F(!0);
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region node_modules/preact/hooks/dist/hooks.module.js
|
|
252
|
-
var B, V,
|
|
253
|
-
function
|
|
254
|
-
|
|
255
|
-
var n =
|
|
252
|
+
var z, B, V, oe, H = 0, se = [], U = t, ce = U.__b, le = U.__r, ue = U.diffed, de = U.__c, fe = U.unmount, pe = U.__;
|
|
253
|
+
function me(e, t) {
|
|
254
|
+
U.__h && U.__h(B, e, H || t), H = 0;
|
|
255
|
+
var n = B.__H || (B.__H = {
|
|
256
256
|
__: [],
|
|
257
257
|
__h: []
|
|
258
258
|
});
|
|
259
259
|
return e >= n.__.length && n.__.push({}), n.__[e];
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
return
|
|
261
|
+
function W(e) {
|
|
262
|
+
return H = 1, he(we, e);
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
var r =
|
|
264
|
+
function he(e, t, n) {
|
|
265
|
+
var r = me(z++, 2);
|
|
266
266
|
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : we(void 0, t), function(e) {
|
|
267
267
|
var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
|
|
268
268
|
t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
|
|
269
|
-
}], r.__c =
|
|
269
|
+
}], r.__c = B, !B.__f)) {
|
|
270
270
|
var i = function(e, t, n) {
|
|
271
271
|
if (!r.__c.__H) return !0;
|
|
272
272
|
var i = !1, o = r.__c.props !== e;
|
|
@@ -282,67 +282,67 @@ function ge(e, t, n) {
|
|
|
282
282
|
}
|
|
283
283
|
return !i || o;
|
|
284
284
|
};
|
|
285
|
-
|
|
286
|
-
var a =
|
|
287
|
-
|
|
285
|
+
B.__f = !0;
|
|
286
|
+
var a = B.shouldComponentUpdate, o = B.componentWillUpdate;
|
|
287
|
+
B.componentWillUpdate = function(e, t, n) {
|
|
288
288
|
if (this.__e) {
|
|
289
289
|
var r = a;
|
|
290
290
|
a = void 0, i(e, t, n), a = r;
|
|
291
291
|
}
|
|
292
292
|
o && o.call(this, e, t, n);
|
|
293
|
-
},
|
|
293
|
+
}, B.shouldComponentUpdate = i;
|
|
294
294
|
}
|
|
295
295
|
return r.__N || r.__;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
var n =
|
|
299
|
-
!
|
|
297
|
+
function G(e, t) {
|
|
298
|
+
var n = me(z++, 3);
|
|
299
|
+
!U.__s && Ce(n.__H, t) && (n.__ = e, n.u = t, B.__H.__h.push(n));
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
var n =
|
|
303
|
-
!
|
|
301
|
+
function ge(e, t) {
|
|
302
|
+
var n = me(z++, 4);
|
|
303
|
+
!U.__s && Ce(n.__H, t) && (n.__ = e, n.u = t, B.__h.push(n));
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
return
|
|
305
|
+
function K(e) {
|
|
306
|
+
return H = 5, _e(function() {
|
|
307
307
|
return { current: e };
|
|
308
308
|
}, []);
|
|
309
309
|
}
|
|
310
|
-
function
|
|
311
|
-
var n =
|
|
310
|
+
function _e(e, t) {
|
|
311
|
+
var n = me(z++, 7);
|
|
312
312
|
return Ce(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
|
|
313
313
|
}
|
|
314
314
|
function q(e, t) {
|
|
315
|
-
return
|
|
315
|
+
return H = 8, _e(function() {
|
|
316
316
|
return e;
|
|
317
317
|
}, t);
|
|
318
318
|
}
|
|
319
319
|
function ve() {
|
|
320
|
-
for (var e; e =
|
|
320
|
+
for (var e; e = se.shift();) {
|
|
321
321
|
var t = e.__H;
|
|
322
322
|
if (e.__P && t) try {
|
|
323
323
|
t.__h.some(xe), t.__h.some(Se), t.__h = [];
|
|
324
324
|
} catch (n) {
|
|
325
|
-
t.__h = [],
|
|
325
|
+
t.__h = [], U.__e(n, e.__v);
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
},
|
|
332
|
-
e && t.__k && t.__k.__m && (e.__m = t.__k.__m),
|
|
333
|
-
},
|
|
334
|
-
|
|
335
|
-
var t = (
|
|
336
|
-
t && (
|
|
329
|
+
U.__b = function(e) {
|
|
330
|
+
B = null, ce && ce(e);
|
|
331
|
+
}, U.__ = function(e, t) {
|
|
332
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), pe && pe(e, t);
|
|
333
|
+
}, U.__r = function(e) {
|
|
334
|
+
le && le(e), z = 0;
|
|
335
|
+
var t = (B = e.__c).__H;
|
|
336
|
+
t && (V === B ? (t.__h = [], B.__h = [], t.__.some(function(e) {
|
|
337
337
|
e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
|
|
338
|
-
})) : (t.__h.some(xe), t.__h.some(Se), t.__h = [],
|
|
339
|
-
},
|
|
340
|
-
|
|
338
|
+
})) : (t.__h.some(xe), t.__h.some(Se), t.__h = [], z = 0)), V = B;
|
|
339
|
+
}, U.diffed = function(e) {
|
|
340
|
+
ue && ue(e);
|
|
341
341
|
var t = e.__c;
|
|
342
|
-
t && t.__H && (t.__H.__h.length && (
|
|
342
|
+
t && t.__H && (t.__H.__h.length && (se.push(t) !== 1 && oe === U.requestAnimationFrame || ((oe = U.requestAnimationFrame) || be)(ve)), t.__H.__.some(function(e) {
|
|
343
343
|
e.u && (e.__H = e.u, e.u = void 0);
|
|
344
|
-
})),
|
|
345
|
-
},
|
|
344
|
+
})), V = B = null;
|
|
345
|
+
}, U.__c = function(e, t) {
|
|
346
346
|
t.some(function(e) {
|
|
347
347
|
try {
|
|
348
348
|
e.__h.some(xe), e.__h = e.__h.filter(function(e) {
|
|
@@ -351,11 +351,11 @@ H.__b = function(e) {
|
|
|
351
351
|
} catch (n) {
|
|
352
352
|
t.some(function(e) {
|
|
353
353
|
e.__h && (e.__h = []);
|
|
354
|
-
}), t = [],
|
|
354
|
+
}), t = [], U.__e(n, e.__v);
|
|
355
355
|
}
|
|
356
|
-
}),
|
|
357
|
-
},
|
|
358
|
-
|
|
356
|
+
}), de && de(e, t);
|
|
357
|
+
}, U.unmount = function(e) {
|
|
358
|
+
fe && fe(e);
|
|
359
359
|
var t, n = e.__c;
|
|
360
360
|
n && n.__H && (n.__H.__.some(function(e) {
|
|
361
361
|
try {
|
|
@@ -363,7 +363,7 @@ H.__b = function(e) {
|
|
|
363
363
|
} catch (e) {
|
|
364
364
|
t = e;
|
|
365
365
|
}
|
|
366
|
-
}), n.__H = void 0, t &&
|
|
366
|
+
}), n.__H = void 0, t && U.__e(t, n.__v));
|
|
367
367
|
};
|
|
368
368
|
var ye = typeof requestAnimationFrame == "function";
|
|
369
369
|
function be(e) {
|
|
@@ -373,12 +373,12 @@ function be(e) {
|
|
|
373
373
|
ye && (t = requestAnimationFrame(n));
|
|
374
374
|
}
|
|
375
375
|
function xe(e) {
|
|
376
|
-
var t =
|
|
377
|
-
typeof n == "function" && (e.__c = void 0, n()),
|
|
376
|
+
var t = B, n = e.__c;
|
|
377
|
+
typeof n == "function" && (e.__c = void 0, n()), B = t;
|
|
378
378
|
}
|
|
379
379
|
function Se(e) {
|
|
380
|
-
var t =
|
|
381
|
-
e.__c = e.__(),
|
|
380
|
+
var t = B;
|
|
381
|
+
e.__c = e.__(), B = t;
|
|
382
382
|
}
|
|
383
383
|
function Ce(e, t) {
|
|
384
384
|
return !e || e.length !== t.length || t.some(function(t, n) {
|
|
@@ -468,7 +468,8 @@ var Ae = "en", je = [
|
|
|
468
468
|
handles: {
|
|
469
469
|
picker: "Agents you can address",
|
|
470
470
|
unknown: "Nobody answers to that name here:",
|
|
471
|
-
instead: "You can address:"
|
|
471
|
+
instead: "You can address:",
|
|
472
|
+
rail: "Agents"
|
|
472
473
|
},
|
|
473
474
|
selection: {
|
|
474
475
|
group: "Suggested choice",
|
|
@@ -538,7 +539,8 @@ var Ae = "en", je = [
|
|
|
538
539
|
handles: {
|
|
539
540
|
picker: "Agents que vous pouvez adresser",
|
|
540
541
|
unknown: "Personne ne répond à ce nom ici :",
|
|
541
|
-
instead: "Vous pouvez adresser :"
|
|
542
|
+
instead: "Vous pouvez adresser :",
|
|
543
|
+
rail: "Agents"
|
|
542
544
|
},
|
|
543
545
|
selection: {
|
|
544
546
|
group: "Choix proposé",
|
|
@@ -608,7 +610,8 @@ var Ae = "en", je = [
|
|
|
608
610
|
handles: {
|
|
609
611
|
picker: "Agentes a los que puedes dirigirte",
|
|
610
612
|
unknown: "Nadie responde a ese nombre aquí:",
|
|
611
|
-
instead: "Puedes dirigirte a:"
|
|
613
|
+
instead: "Puedes dirigirte a:",
|
|
614
|
+
rail: "Agentes"
|
|
612
615
|
},
|
|
613
616
|
selection: {
|
|
614
617
|
group: "Opción propuesta",
|
|
@@ -678,8 +681,20 @@ function Be(e, t) {
|
|
|
678
681
|
return t === !1 ? e ?? !1 : Re() ?? e ?? !1;
|
|
679
682
|
}
|
|
680
683
|
//#endregion
|
|
684
|
+
//#region src/lib/rail.ts
|
|
685
|
+
function Ve(e, t) {
|
|
686
|
+
for (let t = e.length - 1; t >= 0; --t) {
|
|
687
|
+
let n = e[t];
|
|
688
|
+
if (n.role === "assistant" && n.agent) return n.agent.handle;
|
|
689
|
+
}
|
|
690
|
+
return t;
|
|
691
|
+
}
|
|
692
|
+
function He(e, t, n) {
|
|
693
|
+
return !t || t === n || e.trimStart().startsWith("@") ? e : `@${t} ${e}`;
|
|
694
|
+
}
|
|
695
|
+
//#endregion
|
|
681
696
|
//#region src/lib/uid.ts
|
|
682
|
-
function
|
|
697
|
+
function Ue() {
|
|
683
698
|
let e = globalThis.crypto;
|
|
684
699
|
if (e && typeof e.randomUUID == "function") return e.randomUUID();
|
|
685
700
|
let t = /* @__PURE__ */ new Uint8Array(16);
|
|
@@ -692,36 +707,36 @@ function Ve() {
|
|
|
692
707
|
}
|
|
693
708
|
//#endregion
|
|
694
709
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/typeof.js
|
|
695
|
-
function
|
|
710
|
+
function We(e) {
|
|
696
711
|
"@babel/helpers - typeof";
|
|
697
|
-
return
|
|
712
|
+
return We = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
698
713
|
return typeof e;
|
|
699
714
|
} : function(e) {
|
|
700
715
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
701
|
-
},
|
|
716
|
+
}, We(e);
|
|
702
717
|
}
|
|
703
718
|
//#endregion
|
|
704
719
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/toPrimitive.js
|
|
705
|
-
function
|
|
706
|
-
if (
|
|
720
|
+
function Ge(e, t) {
|
|
721
|
+
if (We(e) != "object" || !e) return e;
|
|
707
722
|
var n = e[Symbol.toPrimitive];
|
|
708
723
|
if (n !== void 0) {
|
|
709
724
|
var r = n.call(e, t || "default");
|
|
710
|
-
if (
|
|
725
|
+
if (We(r) != "object") return r;
|
|
711
726
|
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
712
727
|
}
|
|
713
728
|
return (t === "string" ? String : Number)(e);
|
|
714
729
|
}
|
|
715
730
|
//#endregion
|
|
716
731
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/toPropertyKey.js
|
|
717
|
-
function
|
|
718
|
-
var t =
|
|
719
|
-
return
|
|
732
|
+
function Ke(e) {
|
|
733
|
+
var t = Ge(e, "string");
|
|
734
|
+
return We(t) == "symbol" ? t : t + "";
|
|
720
735
|
}
|
|
721
736
|
//#endregion
|
|
722
737
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/defineProperty.js
|
|
723
|
-
function
|
|
724
|
-
return (t =
|
|
738
|
+
function qe(e, t, n) {
|
|
739
|
+
return (t = Ke(t)) in e ? Object.defineProperty(e, t, {
|
|
725
740
|
value: n,
|
|
726
741
|
enumerable: !0,
|
|
727
742
|
configurable: !0,
|
|
@@ -730,15 +745,15 @@ function Ge(e, t, n) {
|
|
|
730
745
|
}
|
|
731
746
|
//#endregion
|
|
732
747
|
//#region src/lib/client.ts
|
|
733
|
-
var
|
|
748
|
+
var Je = "https://api.squadico.com", Ye = 2e4, J = class extends Error {
|
|
734
749
|
constructor(e, t, n) {
|
|
735
|
-
super(e),
|
|
750
|
+
super(e), qe(this, "status", void 0), qe(this, "code", void 0), this.name = "ChatHttpError", this.status = t, this.code = n;
|
|
736
751
|
}
|
|
737
752
|
};
|
|
738
|
-
function
|
|
753
|
+
function Xe(e, t) {
|
|
739
754
|
return `${e.replace(/\/+$/, "")}${t}`;
|
|
740
755
|
}
|
|
741
|
-
function
|
|
756
|
+
function Ze(e, t) {
|
|
742
757
|
return {
|
|
743
758
|
"Content-Type": "application/json",
|
|
744
759
|
Accept: "text/event-stream, application/json",
|
|
@@ -746,21 +761,21 @@ function Ye(e, t) {
|
|
|
746
761
|
...t ? { "X-Subject-Token": t } : {}
|
|
747
762
|
};
|
|
748
763
|
}
|
|
749
|
-
function
|
|
764
|
+
function Qe(e) {
|
|
750
765
|
if (!e || typeof e != "object") return;
|
|
751
766
|
let { loc: t, msg: n } = e;
|
|
752
767
|
if (typeof n != "string" || !n) return;
|
|
753
768
|
let r = (Array.isArray(t) ? t.filter((e) => typeof e == "string") : []).at(-1);
|
|
754
769
|
return r && r !== "body" ? `${r}: ${n}` : n;
|
|
755
770
|
}
|
|
756
|
-
async function
|
|
771
|
+
async function $e(e) {
|
|
757
772
|
let t = "", n;
|
|
758
773
|
try {
|
|
759
774
|
let r = await e.text();
|
|
760
775
|
if (r) try {
|
|
761
776
|
let e = JSON.parse(r), i = e.detail ?? e.message;
|
|
762
777
|
if (Array.isArray(i)) {
|
|
763
|
-
let e = i.map((e) =>
|
|
778
|
+
let e = i.map((e) => Qe(e) ?? (typeof e == "string" ? e : void 0)).filter((e) => e !== void 0);
|
|
764
779
|
t = e.length > 0 ? e.join(", ") : r;
|
|
765
780
|
} else t = typeof i == "string" ? i : r;
|
|
766
781
|
n = typeof e.code == "string" ? e.code : void 0;
|
|
@@ -770,20 +785,20 @@ async function Ze(e) {
|
|
|
770
785
|
} catch {}
|
|
771
786
|
return new J(t || `The API answered ${e.status}`, e.status, n);
|
|
772
787
|
}
|
|
773
|
-
function
|
|
788
|
+
function et(e, t) {
|
|
774
789
|
if (!e || typeof e != "object") return;
|
|
775
|
-
let
|
|
776
|
-
if (!(typeof
|
|
777
|
-
handle:
|
|
778
|
-
name: typeof
|
|
779
|
-
|
|
780
|
-
color: typeof
|
|
790
|
+
let n = e;
|
|
791
|
+
if (!(typeof n.handle != "string" || !n.handle)) return {
|
|
792
|
+
handle: n.handle,
|
|
793
|
+
name: typeof n.name == "string" ? n.name : n.handle,
|
|
794
|
+
avatarUrl: typeof n.avatar_url == "string" && n.avatar_url ? Xe(t, n.avatar_url) : void 0,
|
|
795
|
+
color: typeof n.color == "string" ? n.color : void 0
|
|
781
796
|
};
|
|
782
797
|
}
|
|
783
|
-
function
|
|
784
|
-
return (Array.isArray(e) ? e : []).map(
|
|
798
|
+
function tt(e, t) {
|
|
799
|
+
return (Array.isArray(e) ? e : []).map((e) => et(e, t)).filter((e) => e !== void 0);
|
|
785
800
|
}
|
|
786
|
-
function
|
|
801
|
+
function nt(e) {
|
|
787
802
|
if (!e || typeof e != "object") return;
|
|
788
803
|
let t = e;
|
|
789
804
|
if (!(typeof t.tool_call_id != "string" || !t.tool_call_id)) return {
|
|
@@ -792,26 +807,26 @@ function et(e) {
|
|
|
792
807
|
arguments: t.arguments && typeof t.arguments == "object" ? t.arguments : {}
|
|
793
808
|
};
|
|
794
809
|
}
|
|
795
|
-
var
|
|
796
|
-
function
|
|
797
|
-
if (typeof e.role != "string" || !
|
|
798
|
-
let
|
|
810
|
+
var rt = /* @__PURE__ */ new Set(["user", "assistant"]);
|
|
811
|
+
function it(e, t) {
|
|
812
|
+
if (typeof e.role != "string" || !rt.has(e.role) || typeof e.content != "string" || !e.content) return null;
|
|
813
|
+
let n = typeof e.created_at == "string" ? Date.parse(e.created_at) : NaN;
|
|
799
814
|
return {
|
|
800
|
-
id: typeof e.id == "string" && e.id ? e.id :
|
|
815
|
+
id: typeof e.id == "string" && e.id ? e.id : Ue(),
|
|
801
816
|
role: e.role,
|
|
802
817
|
content: e.content,
|
|
803
|
-
createdAt: Number.isNaN(
|
|
804
|
-
agent:
|
|
805
|
-
attachments:
|
|
818
|
+
createdAt: Number.isNaN(n) ? Date.now() : n,
|
|
819
|
+
agent: et(e.agent, t),
|
|
820
|
+
attachments: at(e.attachments),
|
|
806
821
|
authorName: e.kind === "human" && typeof e.author_name == "string" && e.author_name ? e.author_name : void 0
|
|
807
822
|
};
|
|
808
823
|
}
|
|
809
|
-
function
|
|
824
|
+
function at(e) {
|
|
810
825
|
if (!Array.isArray(e)) return;
|
|
811
|
-
let t = e.map((e) =>
|
|
826
|
+
let t = e.map((e) => ot(e)).filter((e) => e !== null);
|
|
812
827
|
return t.length > 0 ? t : void 0;
|
|
813
828
|
}
|
|
814
|
-
function
|
|
829
|
+
function ot(e) {
|
|
815
830
|
if (!e || typeof e != "object") return null;
|
|
816
831
|
let { id: t, kind: n, filename: r, content_type: i } = e;
|
|
817
832
|
return typeof t != "string" || !t || typeof r != "string" || !r ? null : {
|
|
@@ -821,36 +836,36 @@ function it(e) {
|
|
|
821
836
|
contentType: typeof i == "string" ? i : "application/octet-stream"
|
|
822
837
|
};
|
|
823
838
|
}
|
|
824
|
-
async function
|
|
825
|
-
let t = e.agent ? `?agent=${encodeURIComponent(e.agent)}` : "", n = await fetch(
|
|
839
|
+
async function st(e) {
|
|
840
|
+
let t = e.agent ? `?agent=${encodeURIComponent(e.agent)}` : "", n = await fetch(Xe(e.apiUrl, `/public/applications/${encodeURIComponent(e.embedKey)}${t}`), {
|
|
826
841
|
method: "GET",
|
|
827
|
-
headers:
|
|
842
|
+
headers: Ze(),
|
|
828
843
|
signal: e.signal
|
|
829
844
|
});
|
|
830
|
-
if (!n.ok) throw await
|
|
845
|
+
if (!n.ok) throw await $e(n);
|
|
831
846
|
let r = await n.json();
|
|
832
847
|
return {
|
|
833
848
|
welcomeMessage: typeof r.welcome_message == "string" && r.welcome_message ? r.welcome_message : void 0,
|
|
834
|
-
agent:
|
|
835
|
-
handles:
|
|
849
|
+
agent: et(r.agent, e.apiUrl),
|
|
850
|
+
handles: tt(r.handles, e.apiUrl),
|
|
836
851
|
agentHandle: typeof r.agent_handle == "string" && r.agent_handle ? r.agent_handle : void 0,
|
|
837
852
|
branding: r.branding === !0
|
|
838
853
|
};
|
|
839
854
|
}
|
|
840
|
-
async function
|
|
841
|
-
let t = await fetch(
|
|
855
|
+
async function ct(e) {
|
|
856
|
+
let t = await fetch(Xe(e.apiUrl, `/public/applications/${encodeURIComponent(e.embedKey)}/conversations`), {
|
|
842
857
|
method: "POST",
|
|
843
|
-
headers:
|
|
858
|
+
headers: Ze(),
|
|
844
859
|
body: JSON.stringify({
|
|
845
860
|
...e.user ? { user: e.user } : {},
|
|
846
861
|
...e.agent ? { agent: e.agent } : {}
|
|
847
862
|
}),
|
|
848
863
|
signal: e.signal
|
|
849
864
|
});
|
|
850
|
-
if (!t.ok) throw await
|
|
865
|
+
if (!t.ok) throw await $e(t);
|
|
851
866
|
let n = await t.json();
|
|
852
867
|
if (typeof n.id != "string" || typeof n.visitor_token != "string") throw new J("The API opened a conversation without an id or a token");
|
|
853
|
-
let r = (Array.isArray(n.messages) ? n.messages : []).map(
|
|
868
|
+
let r = (Array.isArray(n.messages) ? n.messages : []).map((t) => it(t, e.apiUrl)).filter((e) => e !== null);
|
|
854
869
|
return {
|
|
855
870
|
conversationId: n.id,
|
|
856
871
|
visitorToken: n.visitor_token,
|
|
@@ -858,19 +873,19 @@ async function ot(e) {
|
|
|
858
873
|
agentSlug: typeof n.agent_slug == "string" ? n.agent_slug : "",
|
|
859
874
|
welcomeMessage: typeof n.welcome_message == "string" && n.welcome_message ? n.welcome_message : void 0,
|
|
860
875
|
messages: r,
|
|
861
|
-
handles:
|
|
876
|
+
handles: tt(n.handles, e.apiUrl),
|
|
862
877
|
agentHandle: typeof n.agent_handle == "string" && n.agent_handle ? n.agent_handle : void 0,
|
|
863
878
|
withHuman: typeof n.handling == "string" && n.handling !== "agents",
|
|
864
879
|
branding: n.branding === !0
|
|
865
880
|
};
|
|
866
881
|
}
|
|
867
|
-
async function
|
|
868
|
-
let t = await fetch(
|
|
882
|
+
async function lt(e) {
|
|
883
|
+
let t = await fetch(Xe(e.apiUrl, `/public/conversations/${encodeURIComponent(e.conversationId)}`), {
|
|
869
884
|
method: "GET",
|
|
870
|
-
headers:
|
|
885
|
+
headers: Ze(e.visitorToken),
|
|
871
886
|
signal: e.signal
|
|
872
887
|
});
|
|
873
|
-
if (!t.ok) throw await
|
|
888
|
+
if (!t.ok) throw await $e(t);
|
|
874
889
|
let n = await t.json();
|
|
875
890
|
if (typeof n.id != "string") throw new J("The API replayed a conversation without an id");
|
|
876
891
|
return {
|
|
@@ -879,67 +894,67 @@ async function st(e) {
|
|
|
879
894
|
agentName: typeof n.agent_name == "string" ? n.agent_name : "",
|
|
880
895
|
agentSlug: typeof n.agent_slug == "string" ? n.agent_slug : "",
|
|
881
896
|
welcomeMessage: typeof n.welcome_message == "string" && n.welcome_message ? n.welcome_message : void 0,
|
|
882
|
-
messages: (Array.isArray(n.messages) ? n.messages : []).map(
|
|
883
|
-
handles:
|
|
897
|
+
messages: (Array.isArray(n.messages) ? n.messages : []).map((t) => it(t, e.apiUrl)).filter((e) => e !== null),
|
|
898
|
+
handles: tt(n.handles, e.apiUrl),
|
|
884
899
|
agentHandle: typeof n.agent_handle == "string" && n.agent_handle ? n.agent_handle : void 0,
|
|
885
900
|
withHuman: typeof n.handling == "string" && n.handling !== "agents",
|
|
886
901
|
branding: n.branding === !0
|
|
887
902
|
};
|
|
888
903
|
}
|
|
889
|
-
async function
|
|
904
|
+
async function ut(e) {
|
|
890
905
|
let t = new FormData();
|
|
891
906
|
t.append("file", e.file);
|
|
892
|
-
let n = await fetch(
|
|
907
|
+
let n = await fetch(pt(e), {
|
|
893
908
|
method: "POST",
|
|
894
909
|
headers: { "X-Visitor-Token": e.visitorToken },
|
|
895
910
|
body: t,
|
|
896
911
|
signal: e.signal
|
|
897
912
|
});
|
|
898
|
-
if (!n.ok) throw await
|
|
899
|
-
let r =
|
|
913
|
+
if (!n.ok) throw await $e(n);
|
|
914
|
+
let r = ot(await n.json());
|
|
900
915
|
if (!r) throw new J("The upload could not be read", n.status);
|
|
901
916
|
return r;
|
|
902
917
|
}
|
|
903
|
-
async function
|
|
904
|
-
let t = await fetch(`${
|
|
918
|
+
async function dt(e) {
|
|
919
|
+
let t = await fetch(`${pt(e)}/${encodeURIComponent(e.attachmentId)}`, {
|
|
905
920
|
method: "DELETE",
|
|
906
921
|
headers: { "X-Visitor-Token": e.visitorToken },
|
|
907
922
|
signal: e.signal
|
|
908
923
|
});
|
|
909
|
-
if (!t.ok) throw await
|
|
924
|
+
if (!t.ok) throw await $e(t);
|
|
910
925
|
}
|
|
911
|
-
async function
|
|
912
|
-
let t = await fetch(`${
|
|
926
|
+
async function ft(e) {
|
|
927
|
+
let t = await fetch(`${pt(e)}/${encodeURIComponent(e.attachmentId)}/content`, {
|
|
913
928
|
headers: { "X-Visitor-Token": e.visitorToken },
|
|
914
929
|
signal: e.signal
|
|
915
930
|
});
|
|
916
|
-
if (!t.ok) throw await
|
|
931
|
+
if (!t.ok) throw await $e(t);
|
|
917
932
|
return t.blob();
|
|
918
933
|
}
|
|
919
|
-
function
|
|
920
|
-
return
|
|
934
|
+
function pt(e) {
|
|
935
|
+
return Xe(e.apiUrl, `/public/conversations/${encodeURIComponent(e.conversationId)}/attachments`);
|
|
921
936
|
}
|
|
922
|
-
async function
|
|
923
|
-
return
|
|
937
|
+
async function mt(e) {
|
|
938
|
+
return gt(Xe(e.apiUrl, `/public/conversations/${encodeURIComponent(e.conversationId)}/messages`), {
|
|
924
939
|
content: e.message,
|
|
925
940
|
attachment_ids: e.attachmentIds ?? [],
|
|
926
941
|
...e.context && Object.keys(e.context).length > 0 ? { context: e.context } : {}
|
|
927
942
|
}, e);
|
|
928
943
|
}
|
|
929
|
-
async function
|
|
930
|
-
return
|
|
944
|
+
async function ht(e) {
|
|
945
|
+
return gt(Xe(e.apiUrl, `/public/conversations/${encodeURIComponent(e.conversationId)}/approvals`), {
|
|
931
946
|
tool_call_id: e.toolCallId,
|
|
932
947
|
approved: e.approved
|
|
933
948
|
}, e);
|
|
934
949
|
}
|
|
935
|
-
async function
|
|
950
|
+
async function gt(e, t, n) {
|
|
936
951
|
let r = await fetch(e, {
|
|
937
952
|
method: "POST",
|
|
938
|
-
headers:
|
|
953
|
+
headers: Ze(n.visitorToken, n.subjectToken),
|
|
939
954
|
body: JSON.stringify(t),
|
|
940
955
|
signal: n.signal
|
|
941
956
|
});
|
|
942
|
-
if (!r.ok) throw await
|
|
957
|
+
if (!r.ok) throw await $e(r);
|
|
943
958
|
if (!r.body) throw new J("Answer with no stream body");
|
|
944
959
|
let i = r.body.getReader(), a = new TextDecoder(), o = "", s = "", c = "", l, u, d = { answer: "" };
|
|
945
960
|
try {
|
|
@@ -968,7 +983,7 @@ async function mt(e, t, n) {
|
|
|
968
983
|
} catch {
|
|
969
984
|
continue;
|
|
970
985
|
}
|
|
971
|
-
s === "token" && typeof i.text == "string" ? (c += i.text, n.onToken(i.text)) : s === "done" ? (d.answer = typeof i.content == "string" ? i.content : c, d.agent =
|
|
986
|
+
s === "token" && typeof i.text == "string" ? (c += i.text, n.onToken(i.text)) : s === "done" ? (d.answer = typeof i.content == "string" ? i.content : c, d.agent = et(i.agent, n.apiUrl), typeof i.unknown_handle == "string" && i.unknown_handle && (d.unknownHandle = i.unknown_handle, d.offered = tt(i.handles, n.apiUrl))) : s === "handoff" ? (typeof i.to_agent_name == "string" && (u = i.to_agent_name), c = "") : s === "escalated" ? d.withHuman = !0 : s === "held" ? (d.held = !0, d.withHuman = !0) : s === "approval_required" ? d.approval = nt(i) : s === "error" && (l = typeof i.detail == "string" ? i.detail : "The turn failed");
|
|
972
987
|
}
|
|
973
988
|
if (l) break;
|
|
974
989
|
}
|
|
@@ -980,11 +995,11 @@ async function mt(e, t, n) {
|
|
|
980
995
|
}
|
|
981
996
|
//#endregion
|
|
982
997
|
//#region src/lib/conversation.ts
|
|
983
|
-
var
|
|
984
|
-
function
|
|
998
|
+
var _t = "squadico-chatbot:conversation";
|
|
999
|
+
function vt() {
|
|
985
1000
|
try {
|
|
986
1001
|
if (typeof sessionStorage > "u") return;
|
|
987
|
-
let e = sessionStorage.getItem(
|
|
1002
|
+
let e = sessionStorage.getItem(_t);
|
|
988
1003
|
if (!e) return;
|
|
989
1004
|
let t = JSON.parse(e);
|
|
990
1005
|
return !t.sessionId || !t.visitorToken || !t.embedKey ? void 0 : {
|
|
@@ -997,68 +1012,68 @@ function gt() {
|
|
|
997
1012
|
return;
|
|
998
1013
|
}
|
|
999
1014
|
}
|
|
1000
|
-
function
|
|
1015
|
+
function yt(e) {
|
|
1001
1016
|
try {
|
|
1002
1017
|
if (typeof sessionStorage > "u") return;
|
|
1003
|
-
sessionStorage.setItem(
|
|
1018
|
+
sessionStorage.setItem(_t, JSON.stringify(e));
|
|
1004
1019
|
} catch {}
|
|
1005
1020
|
}
|
|
1006
|
-
function
|
|
1021
|
+
function bt() {
|
|
1007
1022
|
try {
|
|
1008
1023
|
if (typeof sessionStorage > "u") return;
|
|
1009
|
-
sessionStorage.removeItem(
|
|
1024
|
+
sessionStorage.removeItem(_t);
|
|
1010
1025
|
} catch {}
|
|
1011
1026
|
}
|
|
1012
|
-
function
|
|
1027
|
+
function xt(e, { embedKey: t, user: n }) {
|
|
1013
1028
|
return e.embedKey === t && e.user === n;
|
|
1014
1029
|
}
|
|
1015
1030
|
//#endregion
|
|
1016
1031
|
//#region src/lib/useChat.ts
|
|
1017
|
-
async function
|
|
1032
|
+
async function St(e) {
|
|
1018
1033
|
if (e) try {
|
|
1019
1034
|
return await e() || void 0;
|
|
1020
1035
|
} catch {
|
|
1021
1036
|
return;
|
|
1022
1037
|
}
|
|
1023
1038
|
}
|
|
1024
|
-
var
|
|
1025
|
-
function
|
|
1039
|
+
var Ct = "preview-welcome";
|
|
1040
|
+
function wt(e) {
|
|
1026
1041
|
let t = e instanceof J ? e.status : void 0;
|
|
1027
1042
|
return t === 415 ? "unsupported" : t === 413 ? "tooLarge" : t === 409 ? "tooMany" : t === 422 ? "unreadable" : "failed";
|
|
1028
1043
|
}
|
|
1029
|
-
var
|
|
1030
|
-
function
|
|
1044
|
+
var Tt = 5e3;
|
|
1045
|
+
function Et(e) {
|
|
1031
1046
|
return e instanceof J && e.code === "conversation_retired";
|
|
1032
1047
|
}
|
|
1033
|
-
function
|
|
1034
|
-
let [t, n] =
|
|
1035
|
-
|
|
1036
|
-
let
|
|
1048
|
+
function Dt(e) {
|
|
1049
|
+
let [t, n] = W([]), [r, i] = W(!1), [a, o] = W(""), [s, c] = W([]), [l, u] = W(""), [d, f] = W(""), [p, m] = W(null), [h, g] = W(!1), [_, v] = W(!1), [y, b] = W([]), [x, S] = W([]), [C, w] = W(null), T = K(null), E = K(e);
|
|
1050
|
+
E.current = e;
|
|
1051
|
+
let D = K(null), O = K(null), k = K(null), A = K(null), j = K(void 0), M = e.greeting, N = _e(() => M ? {
|
|
1037
1052
|
id: "greeting",
|
|
1038
1053
|
role: "assistant",
|
|
1039
|
-
content:
|
|
1054
|
+
content: M,
|
|
1040
1055
|
createdAt: Date.now()
|
|
1041
|
-
} : null, [
|
|
1042
|
-
|
|
1043
|
-
}, []),
|
|
1056
|
+
} : null, [M]), P = q((e) => {
|
|
1057
|
+
E.current.onEvent?.(e);
|
|
1058
|
+
}, []), F = q((e, t) => {
|
|
1044
1059
|
n((n) => n.map((n) => n.id === e ? {
|
|
1045
1060
|
...n,
|
|
1046
1061
|
...t
|
|
1047
1062
|
} : n));
|
|
1048
|
-
}, []),
|
|
1049
|
-
let n = e instanceof J ? e.status : void 0, r = e instanceof Error ? e.message : String(e), i = (
|
|
1050
|
-
t &&
|
|
1063
|
+
}, []), I = q((e, t) => {
|
|
1064
|
+
let n = e instanceof J ? e.status : void 0, r = e instanceof Error ? e.message : String(e), i = (E.current.locale ?? Ie(void 0)).t.error;
|
|
1065
|
+
t && F(t, {
|
|
1051
1066
|
content: i,
|
|
1052
1067
|
streaming: !1,
|
|
1053
1068
|
error: !0
|
|
1054
|
-
}),
|
|
1069
|
+
}), P({
|
|
1055
1070
|
type: "chatbot-error",
|
|
1056
1071
|
message: r,
|
|
1057
1072
|
status: n,
|
|
1058
|
-
sessionId:
|
|
1073
|
+
sessionId: O.current?.sessionId ?? ""
|
|
1059
1074
|
}), typeof console < "u" && console.error("[squadico-chatbot]", r);
|
|
1060
|
-
}, [
|
|
1061
|
-
let e =
|
|
1075
|
+
}, [P, F]), ee = q(() => {
|
|
1076
|
+
let e = E.current;
|
|
1062
1077
|
if (!e.embedKey) throw new J("No embed key: nothing says which application to open");
|
|
1063
1078
|
return {
|
|
1064
1079
|
opts: e,
|
|
@@ -1066,93 +1081,93 @@ function Tt(e) {
|
|
|
1066
1081
|
embedKey: e.embedKey,
|
|
1067
1082
|
claim: e.user
|
|
1068
1083
|
};
|
|
1069
|
-
}, []),
|
|
1084
|
+
}, []), L = q((e, t) => {
|
|
1070
1085
|
let r = {
|
|
1071
1086
|
sessionId: t.conversationId,
|
|
1072
1087
|
visitorToken: t.visitorToken
|
|
1073
1088
|
};
|
|
1074
|
-
return
|
|
1089
|
+
return O.current = r, j.current = e.claim?.id, yt({
|
|
1075
1090
|
...r,
|
|
1076
1091
|
embedKey: e.embedKey,
|
|
1077
1092
|
user: e.claim?.id
|
|
1078
|
-
}), o(t.conversationId), c(t.handles), u(e.opts.agent && t.agentHandle ? t.agentHandle : ""),
|
|
1079
|
-
}, []),
|
|
1080
|
-
if (
|
|
1081
|
-
let t =
|
|
1082
|
-
if (!t || !
|
|
1093
|
+
}), o(t.conversationId), c(t.handles), u(e.opts.agent && t.agentHandle ? t.agentHandle : ""), f(t.agentHandle ?? ""), g(!!t.withHuman), v(t.branding), n((e) => [...t.messages, ...e.filter((e) => e.id !== Ct)]), r;
|
|
1094
|
+
}, []), te = q((e) => {
|
|
1095
|
+
if (k.current) return k.current;
|
|
1096
|
+
let t = vt();
|
|
1097
|
+
if (!t || !xt(t, {
|
|
1083
1098
|
embedKey: e.embedKey,
|
|
1084
1099
|
user: e.claim?.id
|
|
1085
1100
|
})) return Promise.resolve(null);
|
|
1086
|
-
let n =
|
|
1101
|
+
let n = lt({
|
|
1087
1102
|
apiUrl: e.apiUrl,
|
|
1088
1103
|
conversationId: t.sessionId,
|
|
1089
1104
|
visitorToken: t.visitorToken
|
|
1090
|
-
}).then((t) =>
|
|
1091
|
-
|
|
1105
|
+
}).then((t) => L(e, t)).catch(() => (bt(), null)).finally(() => {
|
|
1106
|
+
k.current = null;
|
|
1092
1107
|
});
|
|
1093
|
-
return
|
|
1094
|
-
}, [
|
|
1095
|
-
if (
|
|
1096
|
-
if (
|
|
1097
|
-
let e =
|
|
1108
|
+
return k.current = n, n;
|
|
1109
|
+
}, [L]), R = q(async () => {
|
|
1110
|
+
if (O.current) return O.current;
|
|
1111
|
+
if (D.current) return D.current;
|
|
1112
|
+
let e = ee(), t = te(e).then((t) => t ?? ct({
|
|
1098
1113
|
apiUrl: e.apiUrl,
|
|
1099
1114
|
embedKey: e.embedKey,
|
|
1100
1115
|
user: e.claim,
|
|
1101
1116
|
agent: e.opts.agent
|
|
1102
|
-
}).then((t) =>
|
|
1103
|
-
|
|
1117
|
+
}).then((t) => L(e, t)));
|
|
1118
|
+
D.current = t;
|
|
1104
1119
|
try {
|
|
1105
1120
|
return await t;
|
|
1106
1121
|
} finally {
|
|
1107
|
-
|
|
1122
|
+
D.current = null;
|
|
1108
1123
|
}
|
|
1109
1124
|
}, [
|
|
1110
|
-
I,
|
|
1111
1125
|
L,
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1126
|
+
te,
|
|
1127
|
+
ee
|
|
1128
|
+
]), ne = q(() => {
|
|
1129
|
+
if (O.current || D.current || A.current) return;
|
|
1115
1130
|
let e;
|
|
1116
1131
|
try {
|
|
1117
|
-
e =
|
|
1132
|
+
e = ee();
|
|
1118
1133
|
} catch (e) {
|
|
1119
|
-
|
|
1134
|
+
I(e);
|
|
1120
1135
|
return;
|
|
1121
1136
|
}
|
|
1122
|
-
let t =
|
|
1123
|
-
if (t ||
|
|
1124
|
-
let r = await
|
|
1137
|
+
let t = te(e).then(async (t) => {
|
|
1138
|
+
if (t || O.current || D.current) return;
|
|
1139
|
+
let r = await st({
|
|
1125
1140
|
apiUrl: e.apiUrl,
|
|
1126
1141
|
embedKey: e.embedKey,
|
|
1127
1142
|
agent: e.opts.agent
|
|
1128
1143
|
});
|
|
1129
|
-
if (
|
|
1130
|
-
c(r.handles), u(e.opts.agent && r.agentHandle ? r.agentHandle : ""),
|
|
1144
|
+
if (O.current || D.current) return;
|
|
1145
|
+
c(r.handles), u(e.opts.agent && r.agentHandle ? r.agentHandle : ""), f(r.agentHandle ?? ""), v(r.branding);
|
|
1131
1146
|
let i = r.welcomeMessage;
|
|
1132
1147
|
i && n((e) => e.length > 0 ? e : [{
|
|
1133
|
-
id:
|
|
1148
|
+
id: Ct,
|
|
1134
1149
|
role: "assistant",
|
|
1135
1150
|
content: i,
|
|
1136
1151
|
createdAt: Date.now(),
|
|
1137
1152
|
agent: r.agent
|
|
1138
1153
|
}]);
|
|
1139
1154
|
});
|
|
1140
|
-
|
|
1141
|
-
|
|
1155
|
+
A.current = t, t.catch((e) => {
|
|
1156
|
+
A.current = null, I(e);
|
|
1142
1157
|
});
|
|
1143
1158
|
}, [
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
]),
|
|
1148
|
-
if (
|
|
1159
|
+
I,
|
|
1160
|
+
te,
|
|
1161
|
+
ee
|
|
1162
|
+
]), re = q((e, t, { retry: r = !1, carried: a = [] } = {}) => {
|
|
1163
|
+
if (T.current) return;
|
|
1149
1164
|
let o = new AbortController();
|
|
1150
|
-
|
|
1151
|
-
let s =
|
|
1165
|
+
T.current = o, i(!0), m(null);
|
|
1166
|
+
let s = Ue();
|
|
1152
1167
|
n((t) => [
|
|
1153
1168
|
...t,
|
|
1154
1169
|
{
|
|
1155
|
-
id:
|
|
1170
|
+
id: Ue(),
|
|
1156
1171
|
role: "user",
|
|
1157
1172
|
content: e,
|
|
1158
1173
|
createdAt: Date.now(),
|
|
@@ -1167,26 +1182,26 @@ function Tt(e) {
|
|
|
1167
1182
|
}
|
|
1168
1183
|
]), (async () => {
|
|
1169
1184
|
let i = await R();
|
|
1170
|
-
|
|
1185
|
+
P({
|
|
1171
1186
|
type: "chatbot-message",
|
|
1172
1187
|
role: "user",
|
|
1173
1188
|
content: e,
|
|
1174
1189
|
sessionId: i.sessionId
|
|
1175
1190
|
});
|
|
1176
1191
|
let a = "", c = (e) => {
|
|
1177
|
-
a += e,
|
|
1192
|
+
a += e, F(s, { content: a });
|
|
1178
1193
|
}, l;
|
|
1179
1194
|
try {
|
|
1180
1195
|
l = await t(i, c, o.signal);
|
|
1181
1196
|
} catch (e) {
|
|
1182
|
-
if (!
|
|
1183
|
-
i = await R(), a = "",
|
|
1197
|
+
if (!Et(e) || (bt(), O.current = null, D.current = null, !r)) throw e;
|
|
1198
|
+
i = await R(), a = "", F(s, { content: "" }), l = await t(i, c, o.signal);
|
|
1184
1199
|
}
|
|
1185
|
-
if (l.withHuman &&
|
|
1200
|
+
if (l.withHuman && g(!0), l.held) {
|
|
1186
1201
|
n((e) => e.filter((e) => e.id !== s));
|
|
1187
1202
|
return;
|
|
1188
1203
|
}
|
|
1189
|
-
|
|
1204
|
+
F(s, {
|
|
1190
1205
|
content: l.answer,
|
|
1191
1206
|
streaming: !1,
|
|
1192
1207
|
agent: l.agent,
|
|
@@ -1194,7 +1209,7 @@ function Tt(e) {
|
|
|
1194
1209
|
approval: l.approval,
|
|
1195
1210
|
unknownHandle: l.unknownHandle,
|
|
1196
1211
|
offered: l.offered
|
|
1197
|
-
}),
|
|
1212
|
+
}), m(l.approval ?? null), P({
|
|
1198
1213
|
type: "chatbot-message",
|
|
1199
1214
|
role: "assistant",
|
|
1200
1215
|
content: l.answer,
|
|
@@ -1203,69 +1218,69 @@ function Tt(e) {
|
|
|
1203
1218
|
});
|
|
1204
1219
|
})().catch((e) => {
|
|
1205
1220
|
if (o.signal.aborted) {
|
|
1206
|
-
|
|
1221
|
+
F(s, { streaming: !1 });
|
|
1207
1222
|
return;
|
|
1208
1223
|
}
|
|
1209
|
-
|
|
1224
|
+
I(e, s);
|
|
1210
1225
|
}).finally(() => {
|
|
1211
|
-
|
|
1226
|
+
T.current = null, i(!1);
|
|
1212
1227
|
});
|
|
1213
1228
|
}, [
|
|
1214
1229
|
R,
|
|
1215
|
-
M,
|
|
1216
1230
|
P,
|
|
1217
|
-
|
|
1218
|
-
|
|
1231
|
+
I,
|
|
1232
|
+
F
|
|
1233
|
+
]), ie = q((e) => {
|
|
1219
1234
|
let t = e.trim();
|
|
1220
|
-
if (!t &&
|
|
1221
|
-
let n =
|
|
1222
|
-
|
|
1223
|
-
subjectToken: await
|
|
1224
|
-
apiUrl:
|
|
1235
|
+
if (!t && y.length === 0) return;
|
|
1236
|
+
let n = y;
|
|
1237
|
+
b([]), w(null), re(t, async (e, r, i) => mt({
|
|
1238
|
+
subjectToken: await St(E.current.getSubjectToken),
|
|
1239
|
+
apiUrl: E.current.apiUrl ?? "https://api.squadico.com",
|
|
1225
1240
|
conversationId: e.sessionId,
|
|
1226
1241
|
visitorToken: e.visitorToken,
|
|
1227
1242
|
message: t,
|
|
1228
1243
|
attachmentIds: n.map((e) => e.id),
|
|
1229
|
-
context:
|
|
1244
|
+
context: E.current.context ? ke(E.current.context) : void 0,
|
|
1230
1245
|
onToken: r,
|
|
1231
1246
|
signal: i
|
|
1232
1247
|
}), {
|
|
1233
1248
|
retry: !0,
|
|
1234
1249
|
carried: n
|
|
1235
1250
|
});
|
|
1236
|
-
}, [
|
|
1237
|
-
|
|
1238
|
-
apiUrl:
|
|
1251
|
+
}, [y, re]), ae = q((e) => {
|
|
1252
|
+
w(null), S((t) => [...t, e.name]), R().then((t) => ut({
|
|
1253
|
+
apiUrl: E.current.apiUrl ?? "https://api.squadico.com",
|
|
1239
1254
|
conversationId: t.sessionId,
|
|
1240
1255
|
visitorToken: t.visitorToken,
|
|
1241
1256
|
file: e
|
|
1242
|
-
})).then((e) =>
|
|
1257
|
+
})).then((e) => b((t) => [...t, e])).catch((e) => w(wt(e))).finally(() => S((t) => {
|
|
1243
1258
|
let n = t.indexOf(e.name);
|
|
1244
1259
|
return n < 0 ? t : [...t.slice(0, n), ...t.slice(n + 1)];
|
|
1245
1260
|
}));
|
|
1246
|
-
}, [R]),
|
|
1247
|
-
|
|
1248
|
-
let t =
|
|
1249
|
-
t &&
|
|
1250
|
-
apiUrl:
|
|
1261
|
+
}, [R]), z = q((e) => {
|
|
1262
|
+
b((t) => t.filter((t) => t.id !== e));
|
|
1263
|
+
let t = O.current;
|
|
1264
|
+
t && dt({
|
|
1265
|
+
apiUrl: E.current.apiUrl ?? "https://api.squadico.com",
|
|
1251
1266
|
conversationId: t.sessionId,
|
|
1252
1267
|
visitorToken: t.visitorToken,
|
|
1253
1268
|
attachmentId: e
|
|
1254
1269
|
}).catch(() => {});
|
|
1255
|
-
}, []),
|
|
1256
|
-
let t =
|
|
1270
|
+
}, []), B = q(async (e) => {
|
|
1271
|
+
let t = O.current;
|
|
1257
1272
|
if (!t) throw new J("No conversation to read that file from");
|
|
1258
|
-
return
|
|
1259
|
-
apiUrl:
|
|
1273
|
+
return ft({
|
|
1274
|
+
apiUrl: E.current.apiUrl ?? "https://api.squadico.com",
|
|
1260
1275
|
conversationId: t.sessionId,
|
|
1261
1276
|
visitorToken: t.visitorToken,
|
|
1262
1277
|
attachmentId: e
|
|
1263
1278
|
});
|
|
1264
|
-
}, []),
|
|
1265
|
-
let n =
|
|
1266
|
-
n &&
|
|
1267
|
-
subjectToken: await
|
|
1268
|
-
apiUrl:
|
|
1279
|
+
}, []), V = q((e, t) => {
|
|
1280
|
+
let n = p;
|
|
1281
|
+
n && re(t, async (t, r, i) => ht({
|
|
1282
|
+
subjectToken: await St(E.current.getSubjectToken),
|
|
1283
|
+
apiUrl: E.current.apiUrl ?? "https://api.squadico.com",
|
|
1269
1284
|
conversationId: t.sessionId,
|
|
1270
1285
|
visitorToken: t.visitorToken,
|
|
1271
1286
|
toolCallId: n.toolCallId,
|
|
@@ -1273,60 +1288,61 @@ function Tt(e) {
|
|
|
1273
1288
|
onToken: r,
|
|
1274
1289
|
signal: i
|
|
1275
1290
|
}));
|
|
1276
|
-
}, [
|
|
1277
|
-
|
|
1278
|
-
}, []),
|
|
1279
|
-
|
|
1291
|
+
}, [p, re]), oe = q(() => {
|
|
1292
|
+
T.current?.abort(), T.current = null, i(!1);
|
|
1293
|
+
}, []), H = q(() => {
|
|
1294
|
+
T.current?.abort(), T.current = null, O.current = null, D.current = null, k.current = null, A.current = null, j.current = void 0, bt(), i(!1), m(null), g(!1), o(""), u(""), f(""), n([]), P({
|
|
1280
1295
|
type: "chatbot-reset",
|
|
1281
1296
|
sessionId: ""
|
|
1282
1297
|
});
|
|
1283
|
-
}, [
|
|
1284
|
-
|
|
1285
|
-
if (!
|
|
1298
|
+
}, [P]), se = e.humanPollMs ?? Tt;
|
|
1299
|
+
G(() => {
|
|
1300
|
+
if (!h || !a) return;
|
|
1286
1301
|
let e = setInterval(() => {
|
|
1287
|
-
let e =
|
|
1288
|
-
!e ||
|
|
1289
|
-
apiUrl:
|
|
1302
|
+
let e = O.current;
|
|
1303
|
+
!e || T.current || lt({
|
|
1304
|
+
apiUrl: E.current.apiUrl ?? "https://api.squadico.com",
|
|
1290
1305
|
conversationId: e.sessionId,
|
|
1291
1306
|
visitorToken: e.visitorToken
|
|
1292
1307
|
}).then((e) => {
|
|
1293
|
-
n(e.messages),
|
|
1308
|
+
n(e.messages), g(!!e.withHuman);
|
|
1294
1309
|
}).catch(() => {});
|
|
1295
|
-
},
|
|
1310
|
+
}, se);
|
|
1296
1311
|
return () => clearInterval(e);
|
|
1297
1312
|
}, [
|
|
1298
|
-
|
|
1313
|
+
h,
|
|
1299
1314
|
a,
|
|
1300
|
-
|
|
1315
|
+
se
|
|
1301
1316
|
]);
|
|
1302
|
-
let
|
|
1303
|
-
return
|
|
1304
|
-
|
|
1305
|
-
}, [
|
|
1306
|
-
messages:
|
|
1317
|
+
let U = e.user?.id;
|
|
1318
|
+
return G(() => {
|
|
1319
|
+
O.current && j.current !== U && H();
|
|
1320
|
+
}, [U, H]), {
|
|
1321
|
+
messages: _e(() => t.length === 0 && N ? [N] : t, [N, t]),
|
|
1307
1322
|
busy: r,
|
|
1308
1323
|
sessionId: a,
|
|
1309
1324
|
handles: s,
|
|
1310
1325
|
addressee: l,
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1326
|
+
agentHandle: d,
|
|
1327
|
+
approval: p,
|
|
1328
|
+
withHuman: h,
|
|
1329
|
+
branding: _,
|
|
1330
|
+
start: ne,
|
|
1331
|
+
send: ie,
|
|
1332
|
+
attachments: y,
|
|
1333
|
+
uploading: x,
|
|
1334
|
+
attachmentError: C,
|
|
1335
|
+
attach: ae,
|
|
1336
|
+
detach: z,
|
|
1337
|
+
loadAttachment: B,
|
|
1338
|
+
decide: V,
|
|
1339
|
+
stop: oe,
|
|
1340
|
+
reset: H
|
|
1325
1341
|
};
|
|
1326
1342
|
}
|
|
1327
1343
|
//#endregion
|
|
1328
1344
|
//#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
|
|
1329
|
-
var
|
|
1345
|
+
var Ot = 0;
|
|
1330
1346
|
Array.isArray;
|
|
1331
1347
|
function Y(e, n, r, i, a, o) {
|
|
1332
1348
|
n || (n = {});
|
|
@@ -1343,7 +1359,7 @@ function Y(e, n, r, i, a, o) {
|
|
|
1343
1359
|
__e: null,
|
|
1344
1360
|
__c: null,
|
|
1345
1361
|
constructor: void 0,
|
|
1346
|
-
__v: --
|
|
1362
|
+
__v: --Ot,
|
|
1347
1363
|
__i: -1,
|
|
1348
1364
|
__u: 0,
|
|
1349
1365
|
__source: a,
|
|
@@ -1353,19 +1369,75 @@ function Y(e, n, r, i, a, o) {
|
|
|
1353
1369
|
return t.vnode && t.vnode(u), u;
|
|
1354
1370
|
}
|
|
1355
1371
|
//#endregion
|
|
1372
|
+
//#region src/components/Avatar.tsx
|
|
1373
|
+
function kt({ name: e, color: t, url: n, size: r = 16 }) {
|
|
1374
|
+
let [i, a] = W(void 0), o = !!n && i !== n;
|
|
1375
|
+
return /* @__PURE__ */ Y("span", {
|
|
1376
|
+
class: "sqc-avatar",
|
|
1377
|
+
"aria-hidden": "true",
|
|
1378
|
+
style: {
|
|
1379
|
+
width: `${r}px`,
|
|
1380
|
+
height: `${r}px`,
|
|
1381
|
+
fontSize: `${Math.round(r * .45)}px`,
|
|
1382
|
+
borderRadius: `${Math.round(r * .25)}px`,
|
|
1383
|
+
...o || !t ? {} : { backgroundColor: t }
|
|
1384
|
+
},
|
|
1385
|
+
children: o ? /* @__PURE__ */ Y("img", {
|
|
1386
|
+
src: n,
|
|
1387
|
+
alt: "",
|
|
1388
|
+
onError: () => a(n)
|
|
1389
|
+
}) : At(e)
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
function At(e) {
|
|
1393
|
+
let t = Array.from(e.trim())[0];
|
|
1394
|
+
return t ? t.toLocaleUpperCase() : "?";
|
|
1395
|
+
}
|
|
1396
|
+
//#endregion
|
|
1397
|
+
//#region src/components/AgentRail.tsx
|
|
1398
|
+
function jt({ handles: e, active: t, disabled: n, onPick: r, label: i }) {
|
|
1399
|
+
return /* @__PURE__ */ Y("nav", {
|
|
1400
|
+
class: "sqc-rail",
|
|
1401
|
+
"aria-label": i,
|
|
1402
|
+
children: e.map((e) => /* @__PURE__ */ Y("button", {
|
|
1403
|
+
type: "button",
|
|
1404
|
+
class: "sqc-rail__item",
|
|
1405
|
+
"aria-label": e.name,
|
|
1406
|
+
"aria-pressed": e.handle === t,
|
|
1407
|
+
"data-tip": e.name,
|
|
1408
|
+
disabled: n,
|
|
1409
|
+
onClick: () => r(e.handle),
|
|
1410
|
+
children: [/* @__PURE__ */ Y(kt, {
|
|
1411
|
+
name: e.name,
|
|
1412
|
+
color: e.color,
|
|
1413
|
+
url: e.avatarUrl,
|
|
1414
|
+
size: 40
|
|
1415
|
+
}), /* @__PURE__ */ Y("span", {
|
|
1416
|
+
class: "sqc-rail__label",
|
|
1417
|
+
"aria-hidden": "true",
|
|
1418
|
+
children: Mt(e.handle)
|
|
1419
|
+
})]
|
|
1420
|
+
}, e.handle))
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
function Mt(e) {
|
|
1424
|
+
let t = e.split(/[-_]/)[0] ?? e;
|
|
1425
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
1426
|
+
}
|
|
1427
|
+
//#endregion
|
|
1356
1428
|
//#region src/components/Composer.tsx
|
|
1357
|
-
var
|
|
1358
|
-
function
|
|
1429
|
+
var Nt = 132, Pt = "image/png,image/jpeg,image/gif,image/webp,application/pdf,.docx,.txt,.md,.csv,.json", Ft = /^[a-zA-Z0-9_-]*$/;
|
|
1430
|
+
function It(e, t) {
|
|
1359
1431
|
let n = e.slice(0, t), r = n.lastIndexOf("@");
|
|
1360
1432
|
if (r < 0 || r > 0 && !/\s/.test(n[r - 1] ?? "")) return null;
|
|
1361
1433
|
let i = n.slice(r + 1);
|
|
1362
|
-
return
|
|
1434
|
+
return Ft.test(i) ? {
|
|
1363
1435
|
start: r,
|
|
1364
1436
|
query: i
|
|
1365
1437
|
} : null;
|
|
1366
1438
|
}
|
|
1367
|
-
function
|
|
1368
|
-
let [p, m] =
|
|
1439
|
+
function Lt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addressee: a, attachments: o = [], uploading: s = [], attachmentError: c, onAttach: l, onDetach: u, onSend: d, onStop: f }) {
|
|
1440
|
+
let [p, m] = W(""), [h, g] = W(null), [_, v] = W(0), [y, b] = W(!1), x = K(null), C = K(null), w = !!l, T = s.length > 0, E = _e(() => {
|
|
1369
1441
|
if (!h || !i || i.length === 0) return [];
|
|
1370
1442
|
let e = h.query.toLowerCase();
|
|
1371
1443
|
return i.filter((t) => t.handle.startsWith(e));
|
|
@@ -1373,16 +1445,16 @@ function jt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addr
|
|
|
1373
1445
|
let e = x.current;
|
|
1374
1446
|
if (!e) return;
|
|
1375
1447
|
e.style.height = "auto";
|
|
1376
|
-
let t = e.scrollHeight >
|
|
1377
|
-
e.style.height = `${Math.min(e.scrollHeight,
|
|
1448
|
+
let t = e.scrollHeight > Nt;
|
|
1449
|
+
e.style.height = `${Math.min(e.scrollHeight, Nt)}px`, e.style.overflowY = t ? "auto" : "hidden";
|
|
1378
1450
|
}, []);
|
|
1379
|
-
|
|
1451
|
+
G(() => {
|
|
1380
1452
|
r && x.current?.focus(), O();
|
|
1381
|
-
}, [r, O]),
|
|
1453
|
+
}, [r, O]), G(() => {
|
|
1382
1454
|
a && (m((e) => e || `@${a} `), requestAnimationFrame(O));
|
|
1383
1455
|
}, [a, O]);
|
|
1384
1456
|
let k = q((e) => {
|
|
1385
|
-
g(
|
|
1457
|
+
g(It(e.value, e.selectionStart ?? e.value.length)), v(0);
|
|
1386
1458
|
}, []), A = q((e) => {
|
|
1387
1459
|
let t = x.current;
|
|
1388
1460
|
if (!t || !h) return;
|
|
@@ -1430,7 +1502,7 @@ function jt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addr
|
|
|
1430
1502
|
A,
|
|
1431
1503
|
D,
|
|
1432
1504
|
M
|
|
1433
|
-
]), P =
|
|
1505
|
+
]), P = Ye - p.length;
|
|
1434
1506
|
return /* @__PURE__ */ Y("form", {
|
|
1435
1507
|
class: `sqc-composer${y ? " sqc-composer--dropping" : ""}`,
|
|
1436
1508
|
onSubmit: (e) => {
|
|
@@ -1492,8 +1564,12 @@ function jt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addr
|
|
|
1492
1564
|
children: [
|
|
1493
1565
|
/* @__PURE__ */ Y("span", {
|
|
1494
1566
|
class: "sqc-mention__icon",
|
|
1495
|
-
|
|
1496
|
-
|
|
1567
|
+
children: /* @__PURE__ */ Y(kt, {
|
|
1568
|
+
name: e.name,
|
|
1569
|
+
color: e.color,
|
|
1570
|
+
url: e.avatarUrl,
|
|
1571
|
+
size: 18
|
|
1572
|
+
})
|
|
1497
1573
|
}),
|
|
1498
1574
|
/* @__PURE__ */ Y("span", {
|
|
1499
1575
|
class: "sqc-mention__handle",
|
|
@@ -1512,7 +1588,7 @@ function jt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addr
|
|
|
1512
1588
|
rows: 1,
|
|
1513
1589
|
value: p,
|
|
1514
1590
|
placeholder: e,
|
|
1515
|
-
maxLength:
|
|
1591
|
+
maxLength: Ye,
|
|
1516
1592
|
"aria-label": t.t.composer.label,
|
|
1517
1593
|
onInput: (e) => {
|
|
1518
1594
|
m(e.currentTarget.value), k(e.currentTarget), O();
|
|
@@ -1535,7 +1611,7 @@ function jt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addr
|
|
|
1535
1611
|
ref: C,
|
|
1536
1612
|
type: "file",
|
|
1537
1613
|
multiple: !0,
|
|
1538
|
-
accept:
|
|
1614
|
+
accept: Pt,
|
|
1539
1615
|
class: "sqc-file-input",
|
|
1540
1616
|
onChange: (e) => {
|
|
1541
1617
|
j(e.currentTarget.files), e.currentTarget.value = "";
|
|
@@ -1597,18 +1673,18 @@ function jt({ placeholder: e, locale: t, busy: n, autoFocus: r, handles: i, addr
|
|
|
1597
1673
|
}
|
|
1598
1674
|
//#endregion
|
|
1599
1675
|
//#region src/lib/confirm.ts
|
|
1600
|
-
var
|
|
1676
|
+
var Rt = {
|
|
1601
1677
|
fr: /\br[ée]ponde?z? +«?\s*oui\b/i,
|
|
1602
1678
|
en: /\b(?:reply|answer|respond) +[“"']?\s*yes\b/i,
|
|
1603
1679
|
es: /\bresponda?e?d? +«?\s*s[íi]\b/i
|
|
1604
|
-
},
|
|
1680
|
+
}, zt = {
|
|
1605
1681
|
fr: [
|
|
1606
1682
|
/\b(?:confirmes?[- ]tu|confirmez[- ]vous)\b/i,
|
|
1607
1683
|
/\b(?:valides?[- ]tu|validez[- ]vous)\b/i,
|
|
1608
1684
|
/\b(?:es[- ]tu s[ûu]re?|[êe]tes[- ]vous s[ûu]re?s?)\b/i,
|
|
1609
1685
|
/\b(?:dois[- ]je|puis[- ]je)\b/i,
|
|
1610
1686
|
/\b(?:je continue|on continue|on y va|je lance)\b/i,
|
|
1611
|
-
|
|
1687
|
+
Rt.fr
|
|
1612
1688
|
],
|
|
1613
1689
|
en: [
|
|
1614
1690
|
/\bdo you confirm\b/i,
|
|
@@ -1616,7 +1692,7 @@ var Mt = {
|
|
|
1616
1692
|
/\b(?:shall|should) I\b/i,
|
|
1617
1693
|
/\bare you sure\b/i,
|
|
1618
1694
|
/\b(?:shall we|should I) (?:proceed|continue|go ahead)\b/i,
|
|
1619
|
-
|
|
1695
|
+
Rt.en
|
|
1620
1696
|
],
|
|
1621
1697
|
es: [
|
|
1622
1698
|
/\b(?:confirmas|confirma|confirm[áa]is)\b/i,
|
|
@@ -1624,26 +1700,26 @@ var Mt = {
|
|
|
1624
1700
|
/\best[áa]s? seguro\b/i,
|
|
1625
1701
|
/\b(?:contin[úu]o|procedo|lo lanzo|lo hago)\b/i,
|
|
1626
1702
|
/\bquieres? que\b/i,
|
|
1627
|
-
|
|
1703
|
+
Rt.es
|
|
1628
1704
|
]
|
|
1629
|
-
},
|
|
1630
|
-
function
|
|
1631
|
-
if (
|
|
1705
|
+
}, Bt = /^\s*(?:[-*•]\s+)?\[[ xX]\]\s+/m;
|
|
1706
|
+
function Vt(e, t = "en") {
|
|
1707
|
+
if (Bt.test(e)) return !1;
|
|
1632
1708
|
let n = e.split("\n").map((e) => e.trim()).filter(Boolean), r = n[n.length - 1];
|
|
1633
|
-
return !r || !r.includes("?") && !
|
|
1709
|
+
return !r || !r.includes("?") && !Rt[t].test(r) ? !1 : zt[t].some((e) => e.test(r));
|
|
1634
1710
|
}
|
|
1635
1711
|
//#endregion
|
|
1636
1712
|
//#region src/components/Approval.tsx
|
|
1637
|
-
var
|
|
1638
|
-
function
|
|
1639
|
-
let t = e.replace(
|
|
1713
|
+
var Ht = /^(?:mcp|custom|a2a)_[0-9a-f]{8}_/;
|
|
1714
|
+
function Ut(e) {
|
|
1715
|
+
let t = e.replace(Ht, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().toLowerCase();
|
|
1640
1716
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : e;
|
|
1641
1717
|
}
|
|
1642
|
-
function
|
|
1718
|
+
function Wt(e, t) {
|
|
1643
1719
|
return e === !0 ? t.t.confirm.yes : e === !1 ? t.t.confirm.no : typeof e == "string" ? e : JSON.stringify(e) ?? String(e);
|
|
1644
1720
|
}
|
|
1645
|
-
function
|
|
1646
|
-
let { approval: r, confirm: i } = e.t, [a, o] =
|
|
1721
|
+
function Gt({ locale: e, call: t, onDecide: n }) {
|
|
1722
|
+
let { approval: r, confirm: i } = e.t, [a, o] = W(null), s = !!n && a === null, c = (e, t) => {
|
|
1647
1723
|
o(t), n?.(e, t);
|
|
1648
1724
|
}, l = t ? Object.entries(t.arguments) : [];
|
|
1649
1725
|
return /* @__PURE__ */ Y("div", {
|
|
@@ -1654,7 +1730,7 @@ function zt({ locale: e, call: t, onDecide: n }) {
|
|
|
1654
1730
|
t && /* @__PURE__ */ Y("p", {
|
|
1655
1731
|
class: "sqc-approval__request",
|
|
1656
1732
|
"data-testid": "sqc-approval-tool",
|
|
1657
|
-
children: r.request.replace("{tool}",
|
|
1733
|
+
children: r.request.replace("{tool}", Ut(t.tool))
|
|
1658
1734
|
}),
|
|
1659
1735
|
l.length > 0 && /* @__PURE__ */ Y("dl", {
|
|
1660
1736
|
class: "sqc-approval__args",
|
|
@@ -1663,10 +1739,10 @@ function zt({ locale: e, call: t, onDecide: n }) {
|
|
|
1663
1739
|
class: "sqc-approval__arg",
|
|
1664
1740
|
children: [/* @__PURE__ */ Y("dt", {
|
|
1665
1741
|
class: "sqc-approval__arg-name",
|
|
1666
|
-
children:
|
|
1742
|
+
children: Ut(t)
|
|
1667
1743
|
}), /* @__PURE__ */ Y("dd", {
|
|
1668
1744
|
class: "sqc-approval__arg-value",
|
|
1669
|
-
children:
|
|
1745
|
+
children: Wt(n, e)
|
|
1670
1746
|
})]
|
|
1671
1747
|
}, t))
|
|
1672
1748
|
}),
|
|
@@ -1693,8 +1769,8 @@ function zt({ locale: e, call: t, onDecide: n }) {
|
|
|
1693
1769
|
}
|
|
1694
1770
|
//#endregion
|
|
1695
1771
|
//#region src/components/Confirm.tsx
|
|
1696
|
-
function
|
|
1697
|
-
let [n, r] =
|
|
1772
|
+
function Kt({ locale: e, onPick: t }) {
|
|
1773
|
+
let [n, r] = W(null), i = !!t && n === null, { confirm: a } = e.t, o = [{
|
|
1698
1774
|
value: a.yesValue,
|
|
1699
1775
|
label: a.yes,
|
|
1700
1776
|
kind: "yes"
|
|
@@ -1721,7 +1797,7 @@ function Bt({ locale: e, onPick: t }) {
|
|
|
1721
1797
|
}
|
|
1722
1798
|
//#endregion
|
|
1723
1799
|
//#region src/components/Choices.tsx
|
|
1724
|
-
function
|
|
1800
|
+
function qt() {
|
|
1725
1801
|
return /* @__PURE__ */ Y("svg", {
|
|
1726
1802
|
viewBox: "0 0 16 16",
|
|
1727
1803
|
fill: "none",
|
|
@@ -1735,8 +1811,8 @@ function Vt() {
|
|
|
1735
1811
|
})
|
|
1736
1812
|
});
|
|
1737
1813
|
}
|
|
1738
|
-
function
|
|
1739
|
-
let [r, i] =
|
|
1814
|
+
function Jt({ items: e, locale: t, onPick: n }) {
|
|
1815
|
+
let [r, i] = W(null), a = !!n && r === null;
|
|
1740
1816
|
return /* @__PURE__ */ Y("div", {
|
|
1741
1817
|
class: "sqc-choices",
|
|
1742
1818
|
role: "group",
|
|
@@ -1754,7 +1830,7 @@ function Ht({ items: e, locale: t, onPick: n }) {
|
|
|
1754
1830
|
children: [/* @__PURE__ */ Y("span", {
|
|
1755
1831
|
class: `sqc-choice__box${o ? " sqc-choice__box--on" : ""}`,
|
|
1756
1832
|
"aria-hidden": "true",
|
|
1757
|
-
children: o && /* @__PURE__ */ Y(
|
|
1833
|
+
children: o && /* @__PURE__ */ Y(qt, {})
|
|
1758
1834
|
}), /* @__PURE__ */ Y("span", {
|
|
1759
1835
|
class: "sqc-choice__label",
|
|
1760
1836
|
children: e.content
|
|
@@ -1765,38 +1841,38 @@ function Ht({ items: e, locale: t, onPick: n }) {
|
|
|
1765
1841
|
}
|
|
1766
1842
|
//#endregion
|
|
1767
1843
|
//#region src/components/RichText.tsx
|
|
1768
|
-
var
|
|
1769
|
-
function
|
|
1770
|
-
return
|
|
1844
|
+
var Yt = /(\*\*[^*\n]+\*\*|`[^`\n]+`|~~[^~\n]+~~|\[[^\]\n]+\]\([^)\s]+\)|\*[^*\n]+\*|https?:\/\/[^\s<>()]+)/g, Xt = /^\[([^\]\n]+)\]\(([^)\s]+)\)$/, Zt = /^(https?:|mailto:)/i;
|
|
1845
|
+
function Qt(e, t, n) {
|
|
1846
|
+
return Zt.test(e) ? /* @__PURE__ */ Y("a", {
|
|
1771
1847
|
href: e,
|
|
1772
1848
|
target: "_blank",
|
|
1773
1849
|
rel: "noopener noreferrer",
|
|
1774
1850
|
children: t
|
|
1775
1851
|
}, n) : t;
|
|
1776
1852
|
}
|
|
1777
|
-
function
|
|
1778
|
-
let n = e.split(
|
|
1853
|
+
function $t(e, t) {
|
|
1854
|
+
let n = e.split(Yt), r = [];
|
|
1779
1855
|
return n.forEach((e, n) => {
|
|
1780
1856
|
if (!e) return;
|
|
1781
|
-
let i = `${t}-${n}`, a =
|
|
1782
|
-
e.startsWith("**") && e.endsWith("**") && e.length > 4 ? r.push(/* @__PURE__ */ Y("strong", { children: e.slice(2, -2) }, i)) : e.startsWith("`") && e.endsWith("`") && e.length > 2 ? r.push(/* @__PURE__ */ Y("code", { children: e.slice(1, -1) }, i)) : e.startsWith("~~") && e.endsWith("~~") && e.length > 4 ? r.push(/* @__PURE__ */ Y("del", { children: e.slice(2, -2) }, i)) : a ? r.push(
|
|
1857
|
+
let i = `${t}-${n}`, a = Xt.exec(e);
|
|
1858
|
+
e.startsWith("**") && e.endsWith("**") && e.length > 4 ? r.push(/* @__PURE__ */ Y("strong", { children: e.slice(2, -2) }, i)) : e.startsWith("`") && e.endsWith("`") && e.length > 2 ? r.push(/* @__PURE__ */ Y("code", { children: e.slice(1, -1) }, i)) : e.startsWith("~~") && e.endsWith("~~") && e.length > 4 ? r.push(/* @__PURE__ */ Y("del", { children: e.slice(2, -2) }, i)) : a ? r.push(Qt(a[2], a[1], i)) : e.startsWith("*") && e.endsWith("*") && e.length > 2 ? r.push(/* @__PURE__ */ Y("em", { children: e.slice(1, -1) }, i)) : /^https?:\/\//.test(e) ? r.push(Qt(e, e, i)) : r.push(e);
|
|
1783
1859
|
}), r;
|
|
1784
1860
|
}
|
|
1785
|
-
var
|
|
1786
|
-
function
|
|
1861
|
+
var en = /^\s*(?:[-*•]\s+)?\[([ xX])\]\s+(.+)$/;
|
|
1862
|
+
function tn(e) {
|
|
1787
1863
|
return e.replace(/\[([^\]\n]+)\]\([^)\s]+\)/g, "$1").replace(/\*\*|~~|`|\*/g, "").trim();
|
|
1788
1864
|
}
|
|
1789
|
-
var
|
|
1790
|
-
function
|
|
1865
|
+
var nn = /^(\s*)[-*•]\s+/, rn = /^(\s*)\d+[.)]\s+/, an = /^\s{0,3}(#{1,6})\s+(.+?)#*\s*$/, on = /^\s*([-*_])(?:\s*\1){2,}\s*$/, sn = /^\s*>\s?(.*)$/, cn = /^\s*\|.*\|\s*$/, ln = /^\s*\|(?:\s*:?-{1,}:?\s*\|)+\s*$/, un = /^\s*```/;
|
|
1866
|
+
function dn(e) {
|
|
1791
1867
|
return e.replace(/^\s*\|/, "").replace(/\|\s*$/, "").split("|").map((e) => e.trim());
|
|
1792
1868
|
}
|
|
1793
|
-
function
|
|
1869
|
+
function fn(e, t, n, r) {
|
|
1794
1870
|
let i = e[t].ordered, a = [], o = t;
|
|
1795
1871
|
for (; o < e.length && e[o].depth >= n;) {
|
|
1796
1872
|
let t = e[o];
|
|
1797
1873
|
if (t.depth === n && t.ordered !== i) break;
|
|
1798
1874
|
if (t.depth > n) {
|
|
1799
|
-
let [n, i] =
|
|
1875
|
+
let [n, i] = fn(e, o, t.depth, `${r}-${o}`), s = a[a.length - 1];
|
|
1800
1876
|
s ? s.nested.push(n) : a.push({
|
|
1801
1877
|
key: `${r}-${o}`,
|
|
1802
1878
|
text: null,
|
|
@@ -1810,48 +1886,48 @@ function on(e, t, n, r) {
|
|
|
1810
1886
|
nested: []
|
|
1811
1887
|
}), o += 1;
|
|
1812
1888
|
}
|
|
1813
|
-
let s = a.map((e) => /* @__PURE__ */ Y("li", { children: [e.text === null ? null :
|
|
1889
|
+
let s = a.map((e) => /* @__PURE__ */ Y("li", { children: [e.text === null ? null : $t(e.text, e.key), e.nested] }, e.key));
|
|
1814
1890
|
return [Y(i ? "ol" : "ul", { children: s }, r), o];
|
|
1815
1891
|
}
|
|
1816
|
-
function
|
|
1892
|
+
function pn({ text: e, locale: t, onChoice: n }) {
|
|
1817
1893
|
let r = e.split("\n"), i = [], a = [], o = [], s = [], c = () => {
|
|
1818
1894
|
if (!a.length) return;
|
|
1819
1895
|
let e = `p${i.length}`;
|
|
1820
|
-
i.push(/* @__PURE__ */ Y("p", { children:
|
|
1896
|
+
i.push(/* @__PURE__ */ Y("p", { children: $t(a.join("\n"), e) }, e)), a = [];
|
|
1821
1897
|
}, l = () => {
|
|
1822
1898
|
if (!o.length) return;
|
|
1823
1899
|
let e = 0;
|
|
1824
1900
|
for (; e < o.length;) {
|
|
1825
|
-
let t = `l${i.length}`, [n, r] =
|
|
1901
|
+
let t = `l${i.length}`, [n, r] = fn(o, e, o[e].depth, t);
|
|
1826
1902
|
i.push(n), e = r;
|
|
1827
1903
|
}
|
|
1828
1904
|
o = [];
|
|
1829
1905
|
}, u = () => {
|
|
1830
1906
|
if (!s.length) return;
|
|
1831
1907
|
let e = `q${i.length}`;
|
|
1832
|
-
i.push(/* @__PURE__ */ Y("blockquote", { children:
|
|
1908
|
+
i.push(/* @__PURE__ */ Y("blockquote", { children: $t(s.join("\n"), e) }, e)), s = [];
|
|
1833
1909
|
}, d = () => {
|
|
1834
1910
|
c(), l(), u();
|
|
1835
1911
|
};
|
|
1836
1912
|
for (let e = 0; e < r.length; e += 1) {
|
|
1837
1913
|
let f = r[e];
|
|
1838
|
-
if (
|
|
1914
|
+
if (un.test(f)) {
|
|
1839
1915
|
d();
|
|
1840
1916
|
let t = [];
|
|
1841
|
-
for (e += 1; e < r.length && !
|
|
1917
|
+
for (e += 1; e < r.length && !un.test(r[e]);) t.push(r[e]), e += 1;
|
|
1842
1918
|
let n = `c${i.length}`;
|
|
1843
1919
|
i.push(/* @__PURE__ */ Y("pre", { children: /* @__PURE__ */ Y("code", { children: t.join("\n") }) }, n));
|
|
1844
1920
|
continue;
|
|
1845
1921
|
}
|
|
1846
|
-
if (
|
|
1922
|
+
if (cn.test(f) && e + 1 < r.length && ln.test(r[e + 1])) {
|
|
1847
1923
|
d();
|
|
1848
|
-
let t =
|
|
1849
|
-
for (e += 2; e < r.length &&
|
|
1924
|
+
let t = dn(f), n = [];
|
|
1925
|
+
for (e += 2; e < r.length && cn.test(r[e]);) n.push(dn(r[e])), e += 1;
|
|
1850
1926
|
--e;
|
|
1851
1927
|
let a = `t${i.length}`;
|
|
1852
1928
|
i.push(/* @__PURE__ */ Y("div", {
|
|
1853
1929
|
class: "sqc-table",
|
|
1854
|
-
children: /* @__PURE__ */ Y("table", { children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ Y("tr", { children: t.map((e, t) => /* @__PURE__ */ Y("th", { children:
|
|
1930
|
+
children: /* @__PURE__ */ Y("table", { children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ Y("tr", { children: t.map((e, t) => /* @__PURE__ */ Y("th", { children: $t(e, `${a}-h${t}`) }, `${a}-h${t}`)) }) }), /* @__PURE__ */ Y("tbody", { children: n.map((e, n) => /* @__PURE__ */ Y("tr", { children: t.map((t, r) => /* @__PURE__ */ Y("td", { children: $t(e[r] ?? "", `${a}-r${n}c${r}`) }, `${a}-r${n}c${r}`)) }, `${a}-r${n}`)) })] })
|
|
1855
1931
|
}, a));
|
|
1856
1932
|
continue;
|
|
1857
1933
|
}
|
|
@@ -1859,43 +1935,43 @@ function sn({ text: e, locale: t, onChoice: n }) {
|
|
|
1859
1935
|
d();
|
|
1860
1936
|
continue;
|
|
1861
1937
|
}
|
|
1862
|
-
if (
|
|
1938
|
+
if (en.test(f)) {
|
|
1863
1939
|
d();
|
|
1864
1940
|
let a = [];
|
|
1865
1941
|
for (; e < r.length;) {
|
|
1866
|
-
let t =
|
|
1942
|
+
let t = en.exec(r[e]);
|
|
1867
1943
|
if (!t) break;
|
|
1868
1944
|
let n = t[2].trim(), o = `o${i.length}-${a.length}`;
|
|
1869
1945
|
a.push({
|
|
1870
|
-
label:
|
|
1946
|
+
label: tn(n),
|
|
1871
1947
|
checked: t[1].toLowerCase() === "x",
|
|
1872
|
-
content:
|
|
1948
|
+
content: $t(n, o)
|
|
1873
1949
|
}), e += 1;
|
|
1874
1950
|
}
|
|
1875
|
-
--e, i.push(/* @__PURE__ */ Y(
|
|
1951
|
+
--e, i.push(/* @__PURE__ */ Y(Jt, {
|
|
1876
1952
|
items: a,
|
|
1877
1953
|
locale: t,
|
|
1878
1954
|
onPick: n
|
|
1879
1955
|
}, `o${i.length}`));
|
|
1880
1956
|
continue;
|
|
1881
1957
|
}
|
|
1882
|
-
let p =
|
|
1958
|
+
let p = an.exec(f);
|
|
1883
1959
|
if (p) {
|
|
1884
1960
|
d();
|
|
1885
1961
|
let e = p[1].length, t = e <= 2 ? "h3" : e === 3 ? "h4" : "h5", n = `h${i.length}`;
|
|
1886
|
-
i.push(/* @__PURE__ */ Y(t, { children:
|
|
1962
|
+
i.push(/* @__PURE__ */ Y(t, { children: $t(p[2], n) }, n));
|
|
1887
1963
|
continue;
|
|
1888
1964
|
}
|
|
1889
|
-
if (
|
|
1965
|
+
if (on.test(f)) {
|
|
1890
1966
|
d(), i.push(/* @__PURE__ */ Y("hr", {}, `r${i.length}`));
|
|
1891
1967
|
continue;
|
|
1892
1968
|
}
|
|
1893
|
-
let m =
|
|
1969
|
+
let m = sn.exec(f);
|
|
1894
1970
|
if (m) {
|
|
1895
1971
|
c(), l(), s.push(m[1]);
|
|
1896
1972
|
continue;
|
|
1897
1973
|
}
|
|
1898
|
-
let h =
|
|
1974
|
+
let h = nn.exec(f), g = h ? null : rn.exec(f), _ = h ?? g;
|
|
1899
1975
|
if (_) {
|
|
1900
1976
|
c(), u(), o.push({
|
|
1901
1977
|
depth: _[1].replace(/\t/g, " ").length,
|
|
@@ -1910,8 +1986,8 @@ function sn({ text: e, locale: t, onChoice: n }) {
|
|
|
1910
1986
|
}
|
|
1911
1987
|
//#endregion
|
|
1912
1988
|
//#region src/components/MessageList.tsx
|
|
1913
|
-
var
|
|
1914
|
-
function
|
|
1989
|
+
var mn = 80;
|
|
1990
|
+
function hn({ at: e, locale: t }) {
|
|
1915
1991
|
let n = new Date(e);
|
|
1916
1992
|
return /* @__PURE__ */ Y("time", {
|
|
1917
1993
|
class: "sqc-msg__time",
|
|
@@ -1922,9 +1998,9 @@ function ln({ at: e, locale: t }) {
|
|
|
1922
1998
|
})
|
|
1923
1999
|
});
|
|
1924
2000
|
}
|
|
1925
|
-
function
|
|
1926
|
-
let [n, r] =
|
|
1927
|
-
return
|
|
2001
|
+
function gn({ file: e, load: t }) {
|
|
2002
|
+
let [n, r] = W(null);
|
|
2003
|
+
return G(() => {
|
|
1928
2004
|
let n = null, i = !0;
|
|
1929
2005
|
return t(e.id).then((e) => {
|
|
1930
2006
|
i && (n = URL.createObjectURL(e), r(n));
|
|
@@ -1940,10 +2016,10 @@ function un({ file: e, load: t }) {
|
|
|
1940
2016
|
children: e.filename
|
|
1941
2017
|
});
|
|
1942
2018
|
}
|
|
1943
|
-
function
|
|
2019
|
+
function _n({ files: e, load: t }) {
|
|
1944
2020
|
return e.length === 0 || !t ? null : /* @__PURE__ */ Y("div", {
|
|
1945
2021
|
class: "sqc-attachments sqc-attachments--sent",
|
|
1946
|
-
children: e.map((e) => e.kind === "image" ? /* @__PURE__ */ Y(
|
|
2022
|
+
children: e.map((e) => e.kind === "image" ? /* @__PURE__ */ Y(gn, {
|
|
1947
2023
|
file: e,
|
|
1948
2024
|
load: t
|
|
1949
2025
|
}, e.id) : /* @__PURE__ */ Y("span", {
|
|
@@ -1956,17 +2032,17 @@ function dn({ files: e, load: t }) {
|
|
|
1956
2032
|
}, e.id))
|
|
1957
2033
|
});
|
|
1958
2034
|
}
|
|
1959
|
-
function
|
|
2035
|
+
function vn({ message: e, locale: t, assistantName: n, onChoice: r, onDecide: i, onLoadAttachment: a }) {
|
|
1960
2036
|
let o = e.streaming && !e.content, s = !!e.approval;
|
|
1961
2037
|
return /* @__PURE__ */ Y("div", {
|
|
1962
2038
|
class: `sqc-msg sqc-msg--${e.role}${e.error ? " sqc-msg--error" : ""}`,
|
|
1963
2039
|
children: [e.role === "assistant" && /* @__PURE__ */ Y("div", {
|
|
1964
2040
|
class: "sqc-msg__who",
|
|
1965
|
-
children: [e.agent
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
}) : /* @__PURE__ */ Y(
|
|
2041
|
+
children: [e.agent ? /* @__PURE__ */ Y(kt, {
|
|
2042
|
+
name: e.agent.name,
|
|
2043
|
+
color: e.agent.color,
|
|
2044
|
+
url: e.agent.avatarUrl
|
|
2045
|
+
}) : /* @__PURE__ */ Y(bn, {}), e.authorName ?? e.agent?.name ?? n]
|
|
1970
2046
|
}), /* @__PURE__ */ Y("div", {
|
|
1971
2047
|
class: "sqc-msg__bubble",
|
|
1972
2048
|
children: [o ? /* @__PURE__ */ Y("span", {
|
|
@@ -1980,7 +2056,7 @@ function fn({ message: e, locale: t, assistantName: n, onChoice: r, onDecide: i,
|
|
|
1980
2056
|
}) : /* @__PURE__ */ Y("div", {
|
|
1981
2057
|
class: "sqc-msg__body",
|
|
1982
2058
|
children: [
|
|
1983
|
-
/* @__PURE__ */ Y(
|
|
2059
|
+
/* @__PURE__ */ Y(pn, {
|
|
1984
2060
|
text: e.content,
|
|
1985
2061
|
locale: t,
|
|
1986
2062
|
onChoice: r
|
|
@@ -1989,32 +2065,32 @@ function fn({ message: e, locale: t, assistantName: n, onChoice: r, onDecide: i,
|
|
|
1989
2065
|
class: "sqc-caret",
|
|
1990
2066
|
"aria-hidden": "true"
|
|
1991
2067
|
}),
|
|
1992
|
-
s && /* @__PURE__ */ Y(
|
|
2068
|
+
s && /* @__PURE__ */ Y(Gt, {
|
|
1993
2069
|
locale: t,
|
|
1994
2070
|
call: e.content.trim() === "" ? e.approval : void 0,
|
|
1995
2071
|
onDecide: i
|
|
1996
2072
|
}),
|
|
1997
|
-
!s && !e.streaming && !e.error &&
|
|
2073
|
+
e.role === "assistant" && !s && !e.streaming && !e.error && Vt(e.content, t.code) && /* @__PURE__ */ Y(Kt, {
|
|
1998
2074
|
locale: t,
|
|
1999
2075
|
onPick: r
|
|
2000
2076
|
}),
|
|
2001
|
-
e.unknownHandle && !e.streaming && /* @__PURE__ */ Y(
|
|
2077
|
+
e.unknownHandle && !e.streaming && /* @__PURE__ */ Y(yn, {
|
|
2002
2078
|
message: e,
|
|
2003
2079
|
locale: t
|
|
2004
2080
|
}),
|
|
2005
|
-
/* @__PURE__ */ Y(
|
|
2081
|
+
/* @__PURE__ */ Y(_n, {
|
|
2006
2082
|
files: e.attachments ?? [],
|
|
2007
2083
|
load: a
|
|
2008
2084
|
})
|
|
2009
2085
|
]
|
|
2010
|
-
}), !o && /* @__PURE__ */ Y(
|
|
2086
|
+
}), !o && /* @__PURE__ */ Y(hn, {
|
|
2011
2087
|
at: e.createdAt,
|
|
2012
2088
|
locale: t
|
|
2013
2089
|
})]
|
|
2014
2090
|
})]
|
|
2015
2091
|
});
|
|
2016
2092
|
}
|
|
2017
|
-
function
|
|
2093
|
+
function yn({ message: e, locale: t }) {
|
|
2018
2094
|
let n = e.offered ?? [];
|
|
2019
2095
|
return /* @__PURE__ */ Y("p", {
|
|
2020
2096
|
class: "sqc-msg__unaddressed",
|
|
@@ -2031,7 +2107,7 @@ function pn({ message: e, locale: t }) {
|
|
|
2031
2107
|
]
|
|
2032
2108
|
});
|
|
2033
2109
|
}
|
|
2034
|
-
function
|
|
2110
|
+
function bn() {
|
|
2035
2111
|
return /* @__PURE__ */ Y("svg", {
|
|
2036
2112
|
viewBox: "0 0 24 24",
|
|
2037
2113
|
fill: "none",
|
|
@@ -2043,16 +2119,16 @@ function mn() {
|
|
|
2043
2119
|
children: /* @__PURE__ */ Y("path", { 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" })
|
|
2044
2120
|
});
|
|
2045
2121
|
}
|
|
2046
|
-
function
|
|
2047
|
-
let d =
|
|
2048
|
-
return
|
|
2122
|
+
function xn({ messages: e, locale: t, assistantName: n, suggestions: r, showSuggestions: i, busy: a, withHuman: o, onSuggestion: s, onChoice: c, onDecide: l, onLoadAttachment: u }) {
|
|
2123
|
+
let d = K(null), f = K(!0);
|
|
2124
|
+
return ge(() => {
|
|
2049
2125
|
let e = d.current;
|
|
2050
2126
|
e && f.current && (e.scrollTop = e.scrollHeight);
|
|
2051
|
-
}, [e]),
|
|
2127
|
+
}, [e]), G(() => {
|
|
2052
2128
|
let e = d.current;
|
|
2053
2129
|
if (!e) return;
|
|
2054
2130
|
let t = () => {
|
|
2055
|
-
f.current = e.scrollHeight - e.scrollTop - e.clientHeight <
|
|
2131
|
+
f.current = e.scrollHeight - e.scrollTop - e.clientHeight < mn;
|
|
2056
2132
|
};
|
|
2057
2133
|
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
2058
2134
|
}, []), /* @__PURE__ */ Y("div", {
|
|
@@ -2062,7 +2138,7 @@ function hn({ messages: e, locale: t, assistantName: n, suggestions: r, showSugg
|
|
|
2062
2138
|
"aria-live": "polite",
|
|
2063
2139
|
"aria-atomic": "false",
|
|
2064
2140
|
children: [
|
|
2065
|
-
e.map((r, i) => /* @__PURE__ */ Y(
|
|
2141
|
+
e.map((r, i) => /* @__PURE__ */ Y(vn, {
|
|
2066
2142
|
message: r,
|
|
2067
2143
|
locale: t,
|
|
2068
2144
|
assistantName: n,
|
|
@@ -2089,30 +2165,30 @@ function hn({ messages: e, locale: t, assistantName: n, suggestions: r, showSugg
|
|
|
2089
2165
|
}
|
|
2090
2166
|
//#endregion
|
|
2091
2167
|
//#region src/components/ChatbotWidget.tsx
|
|
2092
|
-
var
|
|
2093
|
-
function
|
|
2168
|
+
var Sn = { width: "min(392px, 100vw)" }, Cn = /* @__PURE__ */ new Set(["sessionId"]);
|
|
2169
|
+
function wn(e) {
|
|
2094
2170
|
let t = e.replace(/Id$|Ref$/, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().toLowerCase();
|
|
2095
2171
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : e;
|
|
2096
2172
|
}
|
|
2097
|
-
function
|
|
2173
|
+
function Tn(e) {
|
|
2098
2174
|
if (!e) return [];
|
|
2099
2175
|
let t = [];
|
|
2100
2176
|
for (let [n, r] of Object.entries(e)) {
|
|
2101
|
-
if (
|
|
2177
|
+
if (Cn.has(n) || typeof r != "string" && !Oe(r)) continue;
|
|
2102
2178
|
let e = De(r);
|
|
2103
2179
|
e && t.push({
|
|
2104
|
-
label:
|
|
2180
|
+
label: wn(n),
|
|
2105
2181
|
value: e
|
|
2106
2182
|
});
|
|
2107
2183
|
}
|
|
2108
2184
|
return t;
|
|
2109
2185
|
}
|
|
2110
|
-
function
|
|
2186
|
+
function En(e, t) {
|
|
2111
2187
|
return e?.trim() ? e : t;
|
|
2112
2188
|
}
|
|
2113
|
-
function
|
|
2114
|
-
let [t, n] =
|
|
2115
|
-
return
|
|
2189
|
+
function Dn(e) {
|
|
2190
|
+
let [t, n] = W(!1);
|
|
2191
|
+
return G(() => {
|
|
2116
2192
|
if (e !== "auto" || typeof matchMedia != "function") return;
|
|
2117
2193
|
let t = matchMedia("(prefers-color-scheme: dark)");
|
|
2118
2194
|
n(t.matches);
|
|
@@ -2120,8 +2196,8 @@ function xn(e) {
|
|
|
2120
2196
|
return t.addEventListener("change", r), () => t.removeEventListener("change", r);
|
|
2121
2197
|
}, [e]), e === "dark" ? "dark" : e === "light" ? "light" : t ? "dark" : "light";
|
|
2122
2198
|
}
|
|
2123
|
-
function
|
|
2124
|
-
let t = e.persistOpen ?? !0, [n, r] =
|
|
2199
|
+
function On(e) {
|
|
2200
|
+
let t = e.persistOpen ?? !0, [n, r] = W(() => Be(e.defaultOpen, t)), [i, a] = W(!1), [o, s] = W(!1), c = K(null), l = K(null), u = Dn(e.theme ?? "light"), d = _e(() => Ie(e.locale), [e.locale]), f = d.t, p = En(e.heading, f.heading), m = En(e.assistantName, f.assistant), h = En(e.greeting, f.greeting), g = e.onEvent, { send: _, reset: v, decide: y, stop: b, start: x, busy: S, messages: C, withHuman: w, branding: T, sessionId: E, handles: D, addressee: O, agentHandle: k, attachments: A, uploading: j, attachmentError: M, attach: N, detach: P, loadAttachment: F } = Dt({
|
|
2125
2201
|
embedKey: e.embedKey,
|
|
2126
2202
|
user: e.user,
|
|
2127
2203
|
getSubjectToken: e.getSubjectToken,
|
|
@@ -2131,13 +2207,13 @@ function Sn(e) {
|
|
|
2131
2207
|
locale: d,
|
|
2132
2208
|
onEvent: g
|
|
2133
2209
|
});
|
|
2134
|
-
|
|
2210
|
+
G(() => {
|
|
2135
2211
|
!n && C.some((e) => e.role === "assistant" && e.id !== "greeting") && s(!0);
|
|
2136
2212
|
}, [C, n]);
|
|
2137
|
-
let
|
|
2138
|
-
|
|
2139
|
-
let
|
|
2140
|
-
s(!1), !
|
|
2213
|
+
let I = K(n);
|
|
2214
|
+
I.current = n;
|
|
2215
|
+
let ee = q(() => {
|
|
2216
|
+
s(!1), !I.current && (I.current = !0, r(!0), t && ze(!0), g?.({
|
|
2141
2217
|
type: "chatbot-open",
|
|
2142
2218
|
sessionId: E
|
|
2143
2219
|
}));
|
|
@@ -2146,7 +2222,7 @@ function Sn(e) {
|
|
|
2146
2222
|
t,
|
|
2147
2223
|
E
|
|
2148
2224
|
]), L = q(() => {
|
|
2149
|
-
|
|
2225
|
+
I.current && (I.current = !1, r(!1), t && ze(!1), g?.({
|
|
2150
2226
|
type: "chatbot-close",
|
|
2151
2227
|
sessionId: E
|
|
2152
2228
|
}), l.current?.focus());
|
|
@@ -2155,48 +2231,58 @@ function Sn(e) {
|
|
|
2155
2231
|
t,
|
|
2156
2232
|
E
|
|
2157
2233
|
]);
|
|
2158
|
-
|
|
2234
|
+
G(() => {
|
|
2159
2235
|
n && x();
|
|
2160
2236
|
}, [n, x]);
|
|
2161
|
-
let R = q((e) => {
|
|
2162
|
-
|
|
2163
|
-
}, [
|
|
2237
|
+
let te = D.length >= 2, R = Ve(C, k || void 0), [ne, re] = W(void 0), ie = K(void 0), ae = q((e) => {
|
|
2238
|
+
ie.current = e, re(e);
|
|
2239
|
+
}, []);
|
|
2240
|
+
G(() => {
|
|
2241
|
+
ie.current = void 0, re(void 0);
|
|
2242
|
+
}, [R]);
|
|
2243
|
+
let z = q((e) => {
|
|
2244
|
+
a(!0), _(te ? He(e, ie.current, R) : e);
|
|
2245
|
+
}, [
|
|
2246
|
+
_,
|
|
2247
|
+
te,
|
|
2248
|
+
R
|
|
2249
|
+
]), B = q(() => {
|
|
2164
2250
|
a(!1), s(!1), v();
|
|
2165
|
-
}, [v]),
|
|
2166
|
-
openPanel:
|
|
2251
|
+
}, [v]), V = K({
|
|
2252
|
+
openPanel: ee,
|
|
2167
2253
|
closePanel: L,
|
|
2168
|
-
send:
|
|
2169
|
-
reset:
|
|
2254
|
+
send: z,
|
|
2255
|
+
reset: B,
|
|
2170
2256
|
sessionId: E
|
|
2171
2257
|
});
|
|
2172
|
-
|
|
2173
|
-
openPanel:
|
|
2258
|
+
V.current = {
|
|
2259
|
+
openPanel: ee,
|
|
2174
2260
|
closePanel: L,
|
|
2175
|
-
send:
|
|
2176
|
-
reset:
|
|
2261
|
+
send: z,
|
|
2262
|
+
reset: B,
|
|
2177
2263
|
sessionId: E
|
|
2178
2264
|
};
|
|
2179
|
-
let
|
|
2180
|
-
open: () =>
|
|
2181
|
-
close: () =>
|
|
2182
|
-
toggle: () =>
|
|
2183
|
-
reset: () =>
|
|
2265
|
+
let oe = K({
|
|
2266
|
+
open: () => V.current.openPanel(),
|
|
2267
|
+
close: () => V.current.closePanel(),
|
|
2268
|
+
toggle: () => I.current ? V.current.closePanel() : V.current.openPanel(),
|
|
2269
|
+
reset: () => V.current.reset(),
|
|
2184
2270
|
send: (e) => {
|
|
2185
|
-
|
|
2271
|
+
V.current.openPanel(), V.current.send(e);
|
|
2186
2272
|
},
|
|
2187
|
-
isOpen: () =>
|
|
2188
|
-
sessionId: () =>
|
|
2189
|
-
}),
|
|
2190
|
-
|
|
2273
|
+
isOpen: () => I.current,
|
|
2274
|
+
sessionId: () => V.current.sessionId
|
|
2275
|
+
}), H = e.bind;
|
|
2276
|
+
ge(() => (H?.(oe.current), () => H?.(null)), [H]), G(() => {
|
|
2191
2277
|
if (!n) return;
|
|
2192
2278
|
let e = (e) => {
|
|
2193
2279
|
e.key === "Escape" && (e.stopPropagation(), L());
|
|
2194
2280
|
};
|
|
2195
2281
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
2196
2282
|
}, [L, n]);
|
|
2197
|
-
let
|
|
2283
|
+
let se = _e(() => C.some((e) => e.id !== "greeting"), [C]), U = _e(() => Tn(e.context), [e.context]), ce = {
|
|
2198
2284
|
...e.accent ? { "--sqc-accent": e.accent } : {},
|
|
2199
|
-
"--sqc-width": e.width ??
|
|
2285
|
+
"--sqc-width": e.width ?? Sn.width
|
|
2200
2286
|
};
|
|
2201
2287
|
return /* @__PURE__ */ Y("div", {
|
|
2202
2288
|
class: "sqc",
|
|
@@ -2204,7 +2290,7 @@ function Sn(e) {
|
|
|
2204
2290
|
"data-position": e.position ?? "bottom-right",
|
|
2205
2291
|
"data-layout": e.layout ?? "sidebar",
|
|
2206
2292
|
"data-open": n ? "true" : "false",
|
|
2207
|
-
style:
|
|
2293
|
+
style: ce,
|
|
2208
2294
|
children: [/* @__PURE__ */ Y("button", {
|
|
2209
2295
|
ref: l,
|
|
2210
2296
|
type: "button",
|
|
@@ -2212,13 +2298,13 @@ function Sn(e) {
|
|
|
2212
2298
|
"aria-label": p,
|
|
2213
2299
|
"aria-expanded": n,
|
|
2214
2300
|
"aria-haspopup": "dialog",
|
|
2215
|
-
onClick:
|
|
2301
|
+
onClick: ee,
|
|
2216
2302
|
children: [/* @__PURE__ */ Y("span", {
|
|
2217
2303
|
class: "sqc-launcher__icon",
|
|
2218
2304
|
children: /* @__PURE__ */ Y("slot", {
|
|
2219
2305
|
name: "launcher-icon",
|
|
2220
2306
|
class: "sqc-slot-icon",
|
|
2221
|
-
children: /* @__PURE__ */ Y(
|
|
2307
|
+
children: /* @__PURE__ */ Y(bn, {})
|
|
2222
2308
|
})
|
|
2223
2309
|
}), o && /* @__PURE__ */ Y("span", {
|
|
2224
2310
|
class: "sqc-launcher__badge",
|
|
@@ -2231,132 +2317,143 @@ function Sn(e) {
|
|
|
2231
2317
|
"aria-modal": "false",
|
|
2232
2318
|
"aria-label": p,
|
|
2233
2319
|
...n ? {} : { inert: !0 },
|
|
2234
|
-
children: [
|
|
2235
|
-
|
|
2236
|
-
|
|
2320
|
+
children: [/* @__PURE__ */ Y("header", {
|
|
2321
|
+
class: "sqc-header",
|
|
2322
|
+
children: [
|
|
2323
|
+
/* @__PURE__ */ Y("span", {
|
|
2324
|
+
class: "sqc-header__icon",
|
|
2325
|
+
"aria-hidden": "true",
|
|
2326
|
+
children: /* @__PURE__ */ Y(bn, {})
|
|
2327
|
+
}),
|
|
2328
|
+
/* @__PURE__ */ Y("div", {
|
|
2329
|
+
class: "sqc-header__titles",
|
|
2330
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
2331
|
+
class: "sqc-header__heading",
|
|
2332
|
+
children: p
|
|
2333
|
+
}), /* @__PURE__ */ Y("p", {
|
|
2334
|
+
class: "sqc-header__sub",
|
|
2335
|
+
children: En(e.subheading, f.subheading)
|
|
2336
|
+
})]
|
|
2337
|
+
}),
|
|
2338
|
+
/* @__PURE__ */ Y("button", {
|
|
2339
|
+
type: "button",
|
|
2340
|
+
class: "sqc-icon-btn",
|
|
2341
|
+
onClick: B,
|
|
2342
|
+
"aria-label": f.newConversation,
|
|
2343
|
+
"data-tip": f.newConversation,
|
|
2344
|
+
children: /* @__PURE__ */ Y("svg", {
|
|
2345
|
+
viewBox: "0 0 24 24",
|
|
2346
|
+
fill: "none",
|
|
2347
|
+
stroke: "currentColor",
|
|
2348
|
+
"stroke-width": "1.8",
|
|
2349
|
+
children: /* @__PURE__ */ Y("path", {
|
|
2350
|
+
d: "M20 12a8 8 0 1 1-2.6-5.9M20 4v4h-4",
|
|
2351
|
+
"stroke-linecap": "round"
|
|
2352
|
+
})
|
|
2353
|
+
})
|
|
2354
|
+
}),
|
|
2355
|
+
/* @__PURE__ */ Y("button", {
|
|
2356
|
+
type: "button",
|
|
2357
|
+
class: "sqc-icon-btn",
|
|
2358
|
+
onClick: L,
|
|
2359
|
+
"aria-label": f.close,
|
|
2360
|
+
"data-tip": f.closeTitle,
|
|
2361
|
+
children: /* @__PURE__ */ Y("svg", {
|
|
2362
|
+
viewBox: "0 0 24 24",
|
|
2363
|
+
fill: "none",
|
|
2364
|
+
stroke: "currentColor",
|
|
2365
|
+
"stroke-width": "1.8",
|
|
2366
|
+
children: /* @__PURE__ */ Y("path", {
|
|
2367
|
+
d: "M6 6l12 12M18 6L6 18",
|
|
2368
|
+
"stroke-linecap": "round"
|
|
2369
|
+
})
|
|
2370
|
+
})
|
|
2371
|
+
})
|
|
2372
|
+
]
|
|
2373
|
+
}), /* @__PURE__ */ Y("div", {
|
|
2374
|
+
class: "sqc-panel__body",
|
|
2375
|
+
children: [te && /* @__PURE__ */ Y(jt, {
|
|
2376
|
+
handles: D,
|
|
2377
|
+
active: ne ?? R,
|
|
2378
|
+
disabled: w,
|
|
2379
|
+
onPick: ae,
|
|
2380
|
+
label: f.handles.rail
|
|
2381
|
+
}), /* @__PURE__ */ Y("div", {
|
|
2382
|
+
class: "sqc-panel__main",
|
|
2237
2383
|
children: [
|
|
2238
|
-
/* @__PURE__ */ Y("
|
|
2239
|
-
class: "sqc-
|
|
2240
|
-
"aria-
|
|
2241
|
-
children: /* @__PURE__ */ Y(
|
|
2384
|
+
U.length > 0 && /* @__PURE__ */ Y("div", {
|
|
2385
|
+
class: "sqc-context",
|
|
2386
|
+
"aria-label": f.context.region,
|
|
2387
|
+
children: U.map((e) => /* @__PURE__ */ Y("span", {
|
|
2388
|
+
class: "sqc-chip",
|
|
2389
|
+
title: `${e.label}: ${e.value}`,
|
|
2390
|
+
children: [/* @__PURE__ */ Y("b", { children: e.label }), e.value]
|
|
2391
|
+
}, e.label))
|
|
2242
2392
|
}),
|
|
2243
|
-
/* @__PURE__ */ Y(
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2393
|
+
/* @__PURE__ */ Y(xn, {
|
|
2394
|
+
messages: C,
|
|
2395
|
+
locale: d,
|
|
2396
|
+
assistantName: m,
|
|
2397
|
+
suggestions: e.suggestions,
|
|
2398
|
+
showSuggestions: !i && !se,
|
|
2399
|
+
busy: S,
|
|
2400
|
+
withHuman: w,
|
|
2401
|
+
onSuggestion: z,
|
|
2402
|
+
onChoice: z,
|
|
2403
|
+
onDecide: y,
|
|
2404
|
+
onLoadAttachment: F
|
|
2252
2405
|
}),
|
|
2253
|
-
/* @__PURE__ */ Y(
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
})
|
|
2268
|
-
})
|
|
2406
|
+
/* @__PURE__ */ Y(Lt, {
|
|
2407
|
+
placeholder: En(e.placeholder, f.placeholder),
|
|
2408
|
+
locale: d,
|
|
2409
|
+
busy: S,
|
|
2410
|
+
autoFocus: n,
|
|
2411
|
+
handles: D,
|
|
2412
|
+
addressee: O,
|
|
2413
|
+
attachments: A,
|
|
2414
|
+
uploading: j,
|
|
2415
|
+
attachmentError: M ? f.attachments[M] : void 0,
|
|
2416
|
+
onAttach: N,
|
|
2417
|
+
onDetach: P,
|
|
2418
|
+
onSend: z,
|
|
2419
|
+
onStop: b
|
|
2269
2420
|
}),
|
|
2270
|
-
/* @__PURE__ */ Y("
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
"
|
|
2276
|
-
children: /* @__PURE__ */ Y("
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
children: /* @__PURE__ */ Y("path", {
|
|
2282
|
-
d: "M6 6l12 12M18 6L6 18",
|
|
2283
|
-
"stroke-linecap": "round"
|
|
2284
|
-
})
|
|
2421
|
+
/* @__PURE__ */ Y("p", {
|
|
2422
|
+
class: "sqc-hint",
|
|
2423
|
+
children: f.hint
|
|
2424
|
+
}),
|
|
2425
|
+
T && /* @__PURE__ */ Y("p", {
|
|
2426
|
+
class: "sqc-powered",
|
|
2427
|
+
children: /* @__PURE__ */ Y("a", {
|
|
2428
|
+
href: "https://squadico.com",
|
|
2429
|
+
target: "_blank",
|
|
2430
|
+
rel: "noopener noreferrer",
|
|
2431
|
+
children: f.poweredBy
|
|
2285
2432
|
})
|
|
2286
2433
|
})
|
|
2287
2434
|
]
|
|
2288
|
-
})
|
|
2289
|
-
|
|
2290
|
-
class: "sqc-context",
|
|
2291
|
-
"aria-label": f.context.region,
|
|
2292
|
-
children: ie.map((e) => /* @__PURE__ */ Y("span", {
|
|
2293
|
-
class: "sqc-chip",
|
|
2294
|
-
title: `${e.label}: ${e.value}`,
|
|
2295
|
-
children: [/* @__PURE__ */ Y("b", { children: e.label }), e.value]
|
|
2296
|
-
}, e.label))
|
|
2297
|
-
}),
|
|
2298
|
-
/* @__PURE__ */ Y(hn, {
|
|
2299
|
-
messages: C,
|
|
2300
|
-
locale: d,
|
|
2301
|
-
assistantName: m,
|
|
2302
|
-
suggestions: e.suggestions,
|
|
2303
|
-
showSuggestions: !i && !re,
|
|
2304
|
-
busy: S,
|
|
2305
|
-
withHuman: w,
|
|
2306
|
-
onSuggestion: R,
|
|
2307
|
-
onChoice: R,
|
|
2308
|
-
onDecide: y,
|
|
2309
|
-
onLoadAttachment: P
|
|
2310
|
-
}),
|
|
2311
|
-
/* @__PURE__ */ Y(jt, {
|
|
2312
|
-
placeholder: bn(e.placeholder, f.placeholder),
|
|
2313
|
-
locale: d,
|
|
2314
|
-
busy: S,
|
|
2315
|
-
autoFocus: n,
|
|
2316
|
-
handles: D,
|
|
2317
|
-
addressee: O,
|
|
2318
|
-
attachments: k,
|
|
2319
|
-
uploading: A,
|
|
2320
|
-
attachmentError: j ? f.attachments[j] : void 0,
|
|
2321
|
-
onAttach: M,
|
|
2322
|
-
onDetach: N,
|
|
2323
|
-
onSend: R,
|
|
2324
|
-
onStop: b
|
|
2325
|
-
}),
|
|
2326
|
-
/* @__PURE__ */ Y("p", {
|
|
2327
|
-
class: "sqc-hint",
|
|
2328
|
-
children: f.hint
|
|
2329
|
-
}),
|
|
2330
|
-
T && /* @__PURE__ */ Y("p", {
|
|
2331
|
-
class: "sqc-powered",
|
|
2332
|
-
children: /* @__PURE__ */ Y("a", {
|
|
2333
|
-
href: "https://squadico.com",
|
|
2334
|
-
target: "_blank",
|
|
2335
|
-
rel: "noopener noreferrer",
|
|
2336
|
-
children: f.poweredBy
|
|
2337
|
-
})
|
|
2338
|
-
})
|
|
2339
|
-
]
|
|
2435
|
+
})]
|
|
2436
|
+
})]
|
|
2340
2437
|
})]
|
|
2341
2438
|
});
|
|
2342
2439
|
}
|
|
2343
2440
|
//#endregion
|
|
2344
2441
|
//#region src/styles.css?inline
|
|
2345
|
-
var Cn = ":host{--sqc-width:min(392px, 100vw);--sqc-height:640px;--sqc-z:2147480000;--sqc-radius:16px;--sqc-font-family:\"Plus Jakarta Sans\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;--sqc-font-heading:var(--sqc-font-family);z-index:var(--sqc-z);pointer-events:none;font-family:var(--sqc-font-family);-webkit-font-smoothing:antialiased;text-align:left;font-size:14px;line-height:1.5;display:block;position:fixed;top:0;bottom:0;left:0;right:0;margin:0!important}:host([hidden]){display:none}.sqc{--sqc-neutral-50:#f8fafc;--sqc-neutral-100:#f1f5f9;--sqc-neutral-200:#e2e8f0;--sqc-neutral-300:#cbd5e1;--sqc-neutral-400:#94a3b8;--sqc-neutral-500:#64748b;--sqc-neutral-600:#475569;--sqc-neutral-900:#0f172a;--sqc-error-50:#fff1f2;--sqc-error-100:#ffe4e6;--sqc-error-600:#e11d48;--sqc-accent-default:#000;--sqc-accent-color:var(--sqc-accent,var(--sqc-accent-default));--sqc-on-accent:#fff;--sqc-accent-hover:color-mix(in oklab, var(--sqc-accent-color) 84%, var(--sqc-on-accent));--sqc-accent-fg:var(--sqc-accent,var(--sqc-text));--sqc-bg:#fff;--sqc-surface:var(--sqc-neutral-50);--sqc-selected:var(--sqc-neutral-100);--sqc-border:var(--sqc-neutral-200);--sqc-border-strong:var(--sqc-neutral-300);--sqc-text:var(--sqc-neutral-900);--sqc-text-muted:var(--sqc-neutral-500);--sqc-link:#2563eb;--sqc-bubble-user:var(--sqc-accent-color);--sqc-bubble-user-text:var(--sqc-on-accent);--sqc-code-bg:var(--sqc-neutral-100);--sqc-disabled:var(--sqc-neutral-300);--sqc-shadow:0 10px 15px -3px #0f172a1a, 0 4px 6px -4px #0f172a1a;--sqc-shadow-bottom:0 6px 8px -6px #0f172a2e;--sqc-focus:0 0 0 2px var(--sqc-bg), 0 0 0 4px #0f172a4d;--sqc-focus-input:0 0 0 3px #0f172a1a;--sqc-danger:var(--sqc-error-600);color:var(--sqc-text);position:absolute;top:0;bottom:0;left:0;right:0}.sqc[data-theme=dark]{--sqc-neutral-50:#172033;--sqc-neutral-100:#1e293b;--sqc-neutral-200:#334155;--sqc-neutral-300:#475569;--sqc-neutral-400:#64748b;--sqc-neutral-500:#94a3b8;--sqc-neutral-600:#cbd5e1;--sqc-neutral-900:#f8fafc;--sqc-error-50:#2a0a12;--sqc-error-100:#4c0519;--sqc-error-600:#fb7185;--sqc-accent-default:#fff;--sqc-on-accent:#0f172a;--sqc-bg:#0f172a;--sqc-link:#60a5fa;--sqc-code-bg:#020617;--sqc-shadow:0 10px 24px -4px #0000008c;--sqc-shadow-bottom:0 6px 8px -6px #0000008c;--sqc-focus:0 0 0 2px var(--sqc-bg), 0 0 0 4px #f8fafc59;--sqc-focus-input:0 0 0 3px #f8fafc1f}@supports (color:oklch(from red l c h)){.sqc{--sqc-on-accent:oklch(from var(--sqc-accent-color) clamp(.208, (.62 - l) * 1000, 1) 0 0)}}.sqc *,.sqc :before,.sqc :after{box-sizing:border-box}.sqc-launcher{background:var(--sqc-accent-color);width:56px;height:56px;color:var(--sqc-on-accent);cursor:pointer;pointer-events:auto;box-shadow:var(--sqc-shadow);border:none;border-radius:50%;place-items:center;padding:0;transition:transform .18s,opacity .18s,background .18s,box-shadow .18s;display:grid;position:absolute;bottom:24px;right:24px}.sqc[data-position=bottom-left] .sqc-launcher{left:24px;right:auto}.sqc-launcher:hover{background:var(--sqc-accent-hover);transform:scale(1.06)}.sqc-launcher:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc[data-open=true] .sqc-launcher{opacity:0;pointer-events:none;transform:scale(.5)}.sqc-launcher__icon svg{width:26px;height:26px;display:block}.sqc-slot-icon::slotted(*){justify-content:center;align-items:center;width:26px;height:26px;display:inline-flex}.sqc-launcher__badge{background:var(--sqc-error-600);border:2px solid var(--sqc-bg);border-radius:50%;width:12px;height:12px;position:absolute;top:6px;right:6px}.sqc-panel{width:var(--sqc-width);background:var(--sqc-bg);border-left:1px solid var(--sqc-border);box-shadow:var(--sqc-shadow);pointer-events:auto;visibility:hidden;flex-direction:column;transition:transform .26s cubic-bezier(.22,1,.36,1),visibility 0s linear .26s;display:flex;position:absolute;top:0;bottom:0;right:0;transform:translate(100%)}.sqc[data-open=true] .sqc-panel{visibility:visible;transition:transform .26s cubic-bezier(.22,1,.36,1),visibility;transform:translate(0)}.sqc[data-layout=floating] .sqc-panel{max-width:calc(100% - 48px);height:var(--sqc-height);border:1px solid var(--sqc-border);border-radius:var(--sqc-radius);opacity:0;transform-origin:100% 100%;max-height:calc(100% - 48px);transition:transform .22s cubic-bezier(.22,1,.36,1),opacity .22s,visibility 0s linear .22s;top:auto;bottom:24px;right:24px;overflow:hidden;transform:translateY(16px)scale(.96)}.sqc[data-layout=floating][data-position=bottom-left] .sqc-panel{transform-origin:0 100%;left:24px;right:auto}.sqc[data-layout=floating][data-open=true] .sqc-panel{opacity:1;transition:transform .22s cubic-bezier(.22,1,.36,1),opacity .22s,visibility;transform:none}.sqc-header{background:var(--sqc-bg);color:var(--sqc-text);border-bottom:1px solid var(--sqc-border);flex-shrink:0;align-items:center;gap:8px;padding:13px 12px 13px 16px;display:flex}.sqc-header__icon{color:var(--sqc-accent-fg);flex-shrink:0;place-items:center;display:grid}.sqc-header__icon svg{width:17px;height:17px;display:block}.sqc-header__titles{flex:1;min-width:0}.sqc-header__heading,.sqc-header__sub{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.sqc-header__heading{font-family:var(--sqc-font-heading);letter-spacing:-.2px;font-size:15px;font-weight:700}.sqc-header__sub{color:var(--sqc-text-muted);font-size:12px}.sqc-icon-btn{width:26px;height:26px;color:var(--sqc-text-muted);cursor:pointer;background:0 0;border:none;border-radius:8px;flex-shrink:0;place-items:center;transition:background .15s;display:grid}.sqc-icon-btn:hover{background:var(--sqc-surface);color:var(--sqc-text)}.sqc-icon-btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-icon-btn svg{width:16px;height:16px}.sqc-icon-btn[data-tip]{position:relative}.sqc-icon-btn[data-tip]:after{content:attr(data-tip);z-index:6;background:var(--sqc-text);color:var(--sqc-bg);font-family:var(--sqc-font-family);white-space:nowrap;pointer-events:none;opacity:0;border-radius:8px;padding:4px 8px;font-size:11px;font-weight:500;line-height:1.3;transition:opacity .12s .15s;position:absolute;top:calc(100% + 6px);right:0}.sqc-icon-btn[data-tip]:hover:after{opacity:1}.sqc-icon-btn[data-tip]:focus-visible:after{opacity:1}.sqc-history-pop{z-index:5;position:absolute;top:54px;left:0;right:0}.sqc-history{background:var(--sqc-bg);max-height:320px;box-shadow:var(--sqc-shadow-bottom);flex-direction:column;display:flex;overflow-y:auto}.sqc-history__empty{color:var(--sqc-text-muted);text-align:center;margin:0;padding:14px 16px;font-size:12px}.sqc-history__item{border:none;border-bottom:1px solid var(--sqc-border);width:100%;color:var(--sqc-text);text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:10px 16px;transition:background .15s;display:flex}.sqc-history__item:last-child{border-bottom:none}.sqc-history__item:hover{background:var(--sqc-surface)}.sqc-history__item:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-history__item[aria-current=true]{background:var(--sqc-selected)}.sqc-history__item[aria-current=true] .sqc-history__title{color:var(--sqc-text);font-weight:600}.sqc-history__title{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.sqc-history__date{color:var(--sqc-text-muted);font-size:11px}.sqc-context{background:var(--sqc-selected);border:1px solid var(--sqc-border);color:var(--sqc-text);border-radius:12px;flex-wrap:wrap;flex-shrink:0;align-items:center;gap:8px;margin:12px 16px 4px;padding:8px 11px;font-size:12px;display:flex}.sqc-chip{text-overflow:ellipsis;white-space:nowrap;align-items:baseline;gap:4px;max-width:100%;display:inline-flex;overflow:hidden}.sqc-chip b{font-weight:600}.sqc-chip:not(:last-child):after{content:\"·\";opacity:.5;margin-left:4px}.sqc-messages{overscroll-behavior:contain;background:var(--sqc-bg);scrollbar-width:thin;scrollbar-color:var(--sqc-neutral-300) transparent;flex-direction:column;flex:1;gap:13px;min-height:0;padding:12px 16px;display:flex;overflow-y:auto}.sqc-messages::-webkit-scrollbar{width:6px}.sqc-messages::-webkit-scrollbar-thumb{background:var(--sqc-neutral-300);border-radius:99px}.sqc-msg{flex-direction:column;max-width:93%;font-size:13.5px;display:flex}.sqc-msg--assistant{align-self:flex-start}.sqc-msg--user{align-self:flex-end}.sqc-msg__who{color:var(--sqc-text-muted);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;font-weight:500;display:flex}.sqc-msg__who svg{width:12px;height:12px;color:var(--sqc-accent-fg);flex-shrink:0}.sqc-msg__unaddressed{color:var(--sqc-text-muted);margin:8px 0 0;font-size:11.5px;line-height:1.5}.sqc-msg__unaddressed code{background:var(--sqc-code-bg);color:var(--sqc-text);border-radius:4px;margin-right:4px;padding:1px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px}.sqc-msg--user .sqc-msg__bubble{background:var(--sqc-bubble-user);color:var(--sqc-bubble-user-text);border-radius:var(--sqc-radius) var(--sqc-radius) 4px var(--sqc-radius);padding:9px 13px}.sqc-msg--error .sqc-msg__bubble{background:var(--sqc-error-50);color:var(--sqc-error-600);border:1px solid var(--sqc-error-100);border-radius:12px;padding:11px}.sqc-msg__body{overflow-wrap:anywhere}.sqc-msg--assistant .sqc-msg__body{font-size:14px;line-height:1.6}.sqc-msg__body>:first-child{margin-top:0}.sqc-msg__body>:last-child{margin-bottom:0}.sqc-msg__body p{white-space:pre-wrap;margin:0 0 8px}.sqc-msg__body ul,.sqc-msg__body ol{margin:0 0 8px;padding-left:20px}.sqc-msg__body li{margin-bottom:3px}.sqc-msg__body code{background:var(--sqc-code-bg);border-radius:4px;padding:1px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.85em}.sqc-msg--user .sqc-msg__body code{background:#ffffff38}.sqc-msg__body pre{background:var(--sqc-code-bg);border-radius:8px;margin:0 0 8px;padding:9px 11px;overflow-x:auto}.sqc-msg__body pre code{background:0 0;padding:0}.sqc-msg__body a{color:inherit;text-underline-offset:2px;text-decoration:underline}.sqc-msg--assistant .sqc-msg__body a{color:var(--sqc-link);text-decoration:none}.sqc-msg--assistant .sqc-msg__body a:hover{text-decoration:underline}.sqc-msg__body h3,.sqc-msg__body h4,.sqc-msg__body h5,.sqc-msg__body h6{font-family:var(--sqc-font-heading);letter-spacing:-.2px;margin:12px 0 6px;font-weight:700;line-height:1.3}.sqc-msg__body h3{font-size:1.05em}.sqc-msg__body h4{font-size:1em}.sqc-msg__body h5,.sqc-msg__body h6{font-size:.94em}.sqc-msg__body ul ul,.sqc-msg__body ul ol,.sqc-msg__body ol ul,.sqc-msg__body ol ol{margin:3px 0 0}.sqc-msg__body blockquote{border-left:2px solid var(--sqc-border-strong);color:var(--sqc-text-muted);white-space:pre-wrap;margin:0 0 8px;padding:2px 0 2px 10px}.sqc-msg--user .sqc-msg__body blockquote{color:inherit;opacity:.85;border-left-color:#ffffff73}.sqc-msg__body hr{border:0;border-top:1px solid var(--sqc-border);margin:10px 0}.sqc-msg--user .sqc-msg__body hr{border-top-color:#ffffff4d}.sqc-msg__body del{opacity:.7}.sqc-approval{flex-direction:column;gap:8px;margin:11px 0 2px;display:flex}.sqc-approval__actions{flex-wrap:wrap;gap:8px;display:flex}.sqc-approval__request{color:var(--sqc-text);margin:0;font-size:13px}.sqc-approval__args{border:1px solid var(--sqc-border);background:var(--sqc-surface);border-radius:12px;flex-direction:column;gap:4px;margin:0;padding:8px 10px;font-size:12px;display:flex}.sqc-approval__arg{gap:8px;display:flex}.sqc-approval__arg-name{color:var(--sqc-text-muted);flex:none;font-weight:500}.sqc-approval__arg-value{overflow-wrap:anywhere;min-width:0;color:var(--sqc-text);margin:0}.sqc-approval__btn{height:32px;font-family:var(--sqc-font-family);border:1px solid var(--sqc-border);background:var(--sqc-bg);color:var(--sqc-text);cursor:pointer;border-radius:12px;flex:auto;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:500;transition:border-color .12s,background .12s;display:inline-flex}.sqc-approval__btn--yes:not(:disabled),.sqc-approval__btn--send:not(:disabled){background:var(--sqc-accent-color);color:var(--sqc-on-accent);border-color:#0000;font-weight:600}.sqc-approval__btn:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-approval__btn--yes:hover:not(:disabled),.sqc-approval__btn--send:hover:not(:disabled){background:var(--sqc-accent-hover);border-color:#0000}.sqc-approval__btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-approval__btn:disabled{cursor:default}.sqc-approval__btn:disabled[aria-pressed=false]{opacity:.45}.sqc-approval__btn[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected);color:var(--sqc-text);font-weight:600}.sqc-approval__edit{flex-direction:column;gap:8px;display:flex}.sqc-approval__input{width:100%;font-family:var(--sqc-font-family);color:var(--sqc-text);background:var(--sqc-bg);border:1px solid var(--sqc-border-strong);resize:vertical;border-radius:12px;padding:8px 10px;font-size:13px;line-height:1.4}.sqc-approval__input:focus-visible{border-color:var(--sqc-text);box-shadow:var(--sqc-focus-input);outline:none}.sqc-approval__btn--send{flex:none;align-self:flex-end}.sqc-confirm{gap:8px;margin:11px 0 2px;display:flex}.sqc-confirm__btn{height:32px;font-family:var(--sqc-font-family);border:1px solid var(--sqc-border);background:var(--sqc-bg);color:var(--sqc-text);cursor:pointer;border-radius:12px;flex:1 1 0;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:500;transition:border-color .12s,background .12s;display:inline-flex}.sqc-confirm__btn--yes:not(:disabled){background:var(--sqc-accent-color);color:var(--sqc-on-accent);border-color:#0000;font-weight:600}.sqc-confirm__btn:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-confirm__btn--yes:hover:not(:disabled){background:var(--sqc-accent-hover);border-color:#0000}.sqc-confirm__btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-confirm__btn:disabled{cursor:default}.sqc-confirm__btn:disabled[aria-pressed=false]{opacity:.45}.sqc-confirm__btn[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected);color:var(--sqc-text);font-weight:600}.sqc-choices{flex-direction:column;gap:7px;margin:10px 0 2px;display:flex}.sqc-choice{width:100%;font-family:var(--sqc-font-family);text-align:left;color:var(--sqc-text);background:var(--sqc-bg);border:1px solid var(--sqc-border);cursor:pointer;border-radius:12px;align-items:center;gap:8px;padding:8px 11px;font-size:12.5px;transition:border-color .12s,background .12s;display:flex}.sqc-choice:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-choice:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-choice:disabled{cursor:default}.sqc-choice:disabled[aria-pressed=false]{opacity:.55}.sqc-choice[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected)}.sqc-choice__box{border:1.5px solid var(--sqc-border-strong);border-radius:4px;flex:none;justify-content:center;align-items:center;width:15px;height:15px;display:inline-flex}.sqc-choice__box--on{color:var(--sqc-on-accent);background:var(--sqc-accent-color);border-color:var(--sqc-accent-color)}.sqc-choice__box svg{width:11px;height:11px}.sqc-choice__label{overflow-wrap:anywhere}.sqc-choice__detail{color:var(--sqc-text-muted);margin-top:1px;font-size:11.5px;display:block}.sqc-selection{flex-direction:column;gap:10px;margin:2px 0;display:flex}.sqc-selection__question{flex-direction:column;gap:2px;display:flex}.sqc-selection__ask{font-family:var(--sqc-font-family);color:var(--sqc-text);margin:0;font-size:13px;font-weight:600}.sqc-selection__actions{display:flex}.sqc-selection__validate{height:32px;font-family:var(--sqc-font-family);color:var(--sqc-on-accent);background:var(--sqc-accent-color);cursor:pointer;border:1px solid #0000;border-radius:12px;flex:auto;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:600;transition:filter .12s,background .12s;display:inline-flex}.sqc-selection__validate:hover:not(:disabled){background:var(--sqc-accent-hover)}.sqc-selection__validate:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-selection__validate:disabled{cursor:not-allowed;color:#fff;background:var(--sqc-disabled)}.sqc-selection__hint{font-family:var(--sqc-font-family);color:var(--sqc-text-muted);margin:0;font-size:11.5px}.sqc-table{scrollbar-width:thin;margin:0 0 8px;overflow-x:auto}.sqc-table table{border-collapse:collapse;min-width:100%;font-family:var(--sqc-font-family);white-space:nowrap;font-size:12.5px}.sqc-table th,.sqc-table td{text-align:left;vertical-align:top;border-bottom:1px solid var(--sqc-border);padding:6px 10px 6px 0}.sqc-table thead th{text-transform:uppercase;letter-spacing:.05em;color:var(--sqc-text-muted);font-size:10.5px;font-weight:600}.sqc-table tbody th{font-weight:500}.sqc-msg--user .sqc-table th,.sqc-msg--user .sqc-table td{border-bottom-color:#ffffff40}.sqc-msg--user .sqc-table thead th{color:#fffc}.sqc-table tbody tr:last-child th,.sqc-table tbody tr:last-child td{border-bottom:0}.sqc-msg__time{color:var(--sqc-text-muted);font-variant-numeric:tabular-nums;margin-top:3px;font-size:10px;display:block}.sqc-msg--user .sqc-msg__time{color:#ffffffb3;text-align:right}.sqc-caret{vertical-align:text-bottom;background:currentColor;width:2px;height:1em;margin-left:2px;animation:1s step-end infinite sqc-blink;display:inline-block}@keyframes sqc-blink{0%,to{opacity:1}50%{opacity:0}}.sqc-typing{gap:3px;padding:2px 0;display:inline-flex}.sqc-typing i{background:var(--sqc-neutral-400);border-radius:50%;width:5px;height:5px;animation:1.2s infinite sqc-pulse}.sqc-typing i:nth-child(2){animation-delay:.2s}.sqc-typing i:nth-child(3){animation-delay:.4s}@keyframes sqc-pulse{0%,60%,to{opacity:.25}30%{opacity:1}}.sqc-suggestions{flex-direction:column;gap:7px;display:flex}.sqc-suggestion{border:1px solid var(--sqc-border);background:var(--sqc-bg);width:100%;color:var(--sqc-text);font-family:var(--sqc-font-family);cursor:pointer;text-align:left;border-radius:12px;align-items:center;gap:8px;padding:8px 11px;font-size:12.5px;transition:background .15s,border-color .15s;display:flex}.sqc-suggestion:before{content:\"\";background:var(--sqc-accent-fg);border-radius:50%;flex:none;width:5px;height:5px}.sqc-suggestion:hover{background:var(--sqc-surface);border-color:var(--sqc-border-strong)}.sqc-suggestion:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-composer{border-top:1px solid var(--sqc-border);background:var(--sqc-bg);flex-wrap:wrap;flex-shrink:0;align-items:flex-end;gap:8px;padding:12px 14px;display:flex}.sqc-composer--dropping{outline:2px dashed var(--sqc-accent-color);outline-offset:-4px}.sqc-attachments{flex-wrap:wrap;flex-basis:100%;gap:6px;display:flex}.sqc-attachments--sent{margin-top:8px}.sqc-chip{border:1px solid var(--sqc-border);background:var(--sqc-selected);max-width:100%;color:var(--sqc-text);border-radius:999px;align-items:center;gap:4px;padding:3px 4px 3px 10px;font-size:12px;display:inline-flex}.sqc-chip--waiting{opacity:.6;padding-right:10px}.sqc-chip__name{text-overflow:ellipsis;white-space:nowrap;max-width:180px;overflow:hidden}.sqc-chip__remove{width:18px;height:18px;color:var(--sqc-text-muted);cursor:pointer;background:0 0;border:0;border-radius:999px;justify-content:center;align-items:center;padding:0;font-size:14px;line-height:1;display:inline-flex}.sqc-chip__remove:hover{background:var(--sqc-selected);color:var(--sqc-text)}.sqc-attachments__error{color:var(--sqc-error-600);flex-basis:100%;margin:0;font-size:12px}.sqc-attachment__image{border-radius:12px;max-width:100%;max-height:180px;display:block}.sqc-file-input{display:none}.sqc-btn--attach{color:var(--sqc-text-muted);background:0 0}.sqc-btn--attach:hover{background:var(--sqc-selected);color:var(--sqc-text)}.sqc-composer__field{flex:1;min-width:0;position:relative}.sqc-composer__input{border:1px solid var(--sqc-border-strong);background:var(--sqc-bg);width:100%;min-height:38px;max-height:132px;color:var(--sqc-text);font-family:var(--sqc-font-family);resize:none;border-radius:12px;outline:none;padding:9px 12px;font-size:13.5px;line-height:1.4;transition:border-color .15s,box-shadow .15s;display:block;overflow-y:hidden}.sqc-composer__input::placeholder{color:var(--sqc-neutral-400)}.sqc-composer__input:focus{border-color:var(--sqc-text);box-shadow:var(--sqc-focus-input)}.sqc-mentions{z-index:2;border:1px solid var(--sqc-border);background:var(--sqc-bg);max-height:184px;box-shadow:var(--sqc-shadow);scrollbar-width:thin;border-radius:12px;margin:0;padding:4px;list-style:none;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow-y:auto}.sqc-mention{cursor:pointer;color:var(--sqc-text);border-radius:8px;align-items:baseline;gap:6px;padding:6px 8px;font-size:12.5px;display:flex}.sqc-mention--active{background:var(--sqc-neutral-100)}.sqc-mention__icon{flex-shrink:0}.sqc-mention__handle{font-weight:600}.sqc-mention__name{text-overflow:ellipsis;white-space:nowrap;color:var(--sqc-text-muted);overflow:hidden}.sqc-composer__count{color:var(--sqc-text-muted);pointer-events:none;font-variant-numeric:tabular-nums;font-size:10px;position:absolute;bottom:4px;right:8px}.sqc-btn{cursor:pointer;border:none;border-radius:12px;flex-shrink:0;place-items:center;width:38px;height:38px;transition:background .15s,opacity .15s;display:grid}.sqc-btn svg{width:17px;height:17px}.sqc-btn--send{background:var(--sqc-accent-color);color:var(--sqc-on-accent)}.sqc-btn--send:hover:not(:disabled){background:var(--sqc-accent-hover)}.sqc-btn--send:disabled{background:var(--sqc-disabled);color:#fff;cursor:not-allowed}.sqc-btn--stop{background:var(--sqc-bg);color:var(--sqc-text);border:1px solid var(--sqc-border)}.sqc-btn--stop:hover{border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-hint{padding:0 16px max(9px, env(safe-area-inset-bottom));color:var(--sqc-text-muted);text-align:center;flex-shrink:0;margin:0;font-size:10.5px;line-height:1.35}.sqc-powered{padding:0 16px max(9px, env(safe-area-inset-bottom));text-align:center;flex-shrink:0;margin:0;font-size:10.5px;line-height:1.35}.sqc-powered a{color:var(--sqc-text-muted);text-decoration:none}.sqc-powered a:hover{text-decoration:underline}@media (max-width:520px){.sqc{--sqc-width:100vw}.sqc-panel{border-left:none}.sqc-launcher{bottom:16px;right:16px}.sqc[data-position=bottom-left] .sqc-launcher{left:16px}.sqc[data-layout=floating] .sqc-panel,.sqc[data-layout=floating][data-position=bottom-left] .sqc-panel{border:none;border-radius:0;max-width:none;height:auto;max-height:none;top:0;bottom:0;left:0;right:0}}@media (prefers-reduced-motion:reduce){.sqc-launcher,.sqc-panel,.sqc-btn,.sqc-suggestion,.sqc-choice,.sqc-confirm__btn,.sqc-icon-btn,.sqc-icon-btn[data-tip]:after{transition:none}.sqc-typing i,.sqc-caret{animation:none}}.sqc-with-human{border:1px solid var(--sqc-border);background:var(--sqc-selected);color:var(--sqc-neutral-600);border-radius:12px;margin:8px 0 0;padding:8px 12px;font-size:13px}";
|
|
2442
|
+
var kn = ":host{--sqc-width:min(392px, 100vw);--sqc-height:640px;--sqc-z:2147480000;--sqc-radius:16px;--sqc-font-family:\"Plus Jakarta Sans\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;--sqc-font-heading:var(--sqc-font-family);z-index:var(--sqc-z);pointer-events:none;font-family:var(--sqc-font-family);-webkit-font-smoothing:antialiased;text-align:left;font-size:14px;line-height:1.5;display:block;position:fixed;top:0;bottom:0;left:0;right:0;margin:0!important}:host([hidden]){display:none}.sqc{--sqc-neutral-50:#f8fafc;--sqc-neutral-100:#f1f5f9;--sqc-neutral-200:#e2e8f0;--sqc-neutral-300:#cbd5e1;--sqc-neutral-400:#94a3b8;--sqc-neutral-500:#64748b;--sqc-neutral-600:#475569;--sqc-neutral-900:#0f172a;--sqc-error-50:#fff1f2;--sqc-error-100:#ffe4e6;--sqc-error-600:#e11d48;--sqc-accent-default:#000;--sqc-accent-color:var(--sqc-accent,var(--sqc-accent-default));--sqc-on-accent:#fff;--sqc-accent-hover:color-mix(in oklab, var(--sqc-accent-color) 84%, var(--sqc-on-accent));--sqc-accent-fg:var(--sqc-accent,var(--sqc-text));--sqc-bg:#fff;--sqc-surface:var(--sqc-neutral-50);--sqc-selected:var(--sqc-neutral-100);--sqc-border:var(--sqc-neutral-200);--sqc-border-strong:var(--sqc-neutral-300);--sqc-text:var(--sqc-neutral-900);--sqc-text-muted:var(--sqc-neutral-500);--sqc-link:#2563eb;--sqc-bubble-user:var(--sqc-accent-color);--sqc-bubble-user-text:var(--sqc-on-accent);--sqc-code-bg:var(--sqc-neutral-100);--sqc-disabled:var(--sqc-neutral-300);--sqc-shadow:0 10px 15px -3px #0f172a1a, 0 4px 6px -4px #0f172a1a;--sqc-shadow-bottom:0 6px 8px -6px #0f172a2e;--sqc-focus:0 0 0 2px var(--sqc-bg), 0 0 0 4px #0f172a4d;--sqc-focus-input:0 0 0 3px #0f172a1a;--sqc-danger:var(--sqc-error-600);color:var(--sqc-text);position:absolute;top:0;bottom:0;left:0;right:0}.sqc[data-theme=dark]{--sqc-neutral-50:#172033;--sqc-neutral-100:#1e293b;--sqc-neutral-200:#334155;--sqc-neutral-300:#475569;--sqc-neutral-400:#64748b;--sqc-neutral-500:#94a3b8;--sqc-neutral-600:#cbd5e1;--sqc-neutral-900:#f8fafc;--sqc-error-50:#2a0a12;--sqc-error-100:#4c0519;--sqc-error-600:#fb7185;--sqc-accent-default:#fff;--sqc-on-accent:#0f172a;--sqc-bg:#0f172a;--sqc-link:#60a5fa;--sqc-code-bg:#020617;--sqc-shadow:0 10px 24px -4px #0000008c;--sqc-shadow-bottom:0 6px 8px -6px #0000008c;--sqc-focus:0 0 0 2px var(--sqc-bg), 0 0 0 4px #f8fafc59;--sqc-focus-input:0 0 0 3px #f8fafc1f}@supports (color:oklch(from red l c h)){.sqc{--sqc-on-accent:oklch(from var(--sqc-accent-color) clamp(.208, (.62 - l) * 1000, 1) 0 0)}}.sqc *,.sqc :before,.sqc :after{box-sizing:border-box}.sqc-launcher{background:var(--sqc-accent-color);width:56px;height:56px;color:var(--sqc-on-accent);cursor:pointer;pointer-events:auto;box-shadow:var(--sqc-shadow);border:none;border-radius:50%;place-items:center;padding:0;transition:transform .18s,opacity .18s,background .18s,box-shadow .18s;display:grid;position:absolute;bottom:24px;right:24px}.sqc[data-position=bottom-left] .sqc-launcher{left:24px;right:auto}.sqc-launcher:hover{background:var(--sqc-accent-hover);transform:scale(1.06)}.sqc-launcher:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc[data-open=true] .sqc-launcher{opacity:0;pointer-events:none;transform:scale(.5)}.sqc-launcher__icon svg{width:26px;height:26px;display:block}.sqc-slot-icon::slotted(*){justify-content:center;align-items:center;width:26px;height:26px;display:inline-flex}.sqc-launcher__badge{background:var(--sqc-error-600);border:2px solid var(--sqc-bg);border-radius:50%;width:12px;height:12px;position:absolute;top:6px;right:6px}.sqc-panel{width:var(--sqc-width);background:var(--sqc-bg);border-left:1px solid var(--sqc-border);box-shadow:var(--sqc-shadow);pointer-events:auto;visibility:hidden;flex-direction:column;transition:transform .26s cubic-bezier(.22,1,.36,1),visibility 0s linear .26s;display:flex;position:absolute;top:0;bottom:0;right:0;transform:translate(100%)}.sqc-panel__body{flex:1;min-height:0;display:flex}.sqc-panel__main{flex-direction:column;flex:1;min-width:0;min-height:0;display:flex}.sqc-rail{border-right:1px solid var(--sqc-border);background:color-mix(in oklab, var(--sqc-accent-color) 7%, var(--sqc-bg));flex-direction:column;flex-shrink:0;align-items:stretch;gap:6px;width:72px;padding:12px 0;display:flex;overflow:visible}.sqc-rail__item{color:var(--sqc-text-muted);font:inherit;cursor:pointer;background:0 0;border:0;flex-direction:column;align-items:center;gap:4px;padding:4px 0;display:flex;position:relative}.sqc-rail__label{white-space:nowrap;text-overflow:ellipsis;max-width:64px;font-size:10.5px;font-weight:500;line-height:1.2;overflow:hidden}.sqc-rail__item:hover,.sqc-rail__item[aria-pressed=true]{color:var(--sqc-text)}.sqc-rail__item[aria-pressed=true] .sqc-rail__label{font-weight:600}.sqc-rail__item .sqc-avatar{transition:box-shadow .15s}.sqc-rail__item[aria-pressed=true] .sqc-avatar{box-shadow:0 0 0 2px var(--sqc-bg), 0 0 0 4px var(--sqc-accent-color)}.sqc-rail__item:before{content:\"\";background:var(--sqc-text);border-radius:0 4px 4px 0;width:4px;height:0;transition:height .15s;position:absolute;top:24px;left:0;transform:translateY(-50%)}.sqc-rail__item:hover:before{height:12px}.sqc-rail__item[aria-pressed=true]:before{height:32px}.sqc-rail__item:focus-visible{outline:2px solid var(--sqc-accent-color);outline-offset:-2px;border-radius:8px}.sqc-rail__item:disabled{cursor:not-allowed;opacity:.5}.sqc-rail__item[data-tip]:after{content:attr(data-tip);z-index:2;background:var(--sqc-text);color:var(--sqc-bg);white-space:nowrap;pointer-events:none;opacity:0;border-radius:6px;padding:4px 8px;font-size:12px;font-weight:500;transition:opacity .12s;position:absolute;top:24px;left:calc(100% + 6px);transform:translateY(-50%)}.sqc-rail__item[data-tip]:hover:after{opacity:1}.sqc-rail__item[data-tip]:focus-visible:after{opacity:1}.sqc[data-open=true] .sqc-panel{visibility:visible;transition:transform .26s cubic-bezier(.22,1,.36,1),visibility;transform:translate(0)}.sqc[data-layout=floating] .sqc-panel{max-width:calc(100% - 48px);height:var(--sqc-height);border:1px solid var(--sqc-border);border-radius:var(--sqc-radius);opacity:0;transform-origin:100% 100%;max-height:calc(100% - 48px);transition:transform .22s cubic-bezier(.22,1,.36,1),opacity .22s,visibility 0s linear .22s;top:auto;bottom:24px;right:24px;overflow:hidden;transform:translateY(16px)scale(.96)}.sqc[data-layout=floating][data-position=bottom-left] .sqc-panel{transform-origin:0 100%;left:24px;right:auto}.sqc[data-layout=floating][data-open=true] .sqc-panel{opacity:1;transition:transform .22s cubic-bezier(.22,1,.36,1),opacity .22s,visibility;transform:none}.sqc-header{background:var(--sqc-bg);color:var(--sqc-text);border-bottom:1px solid var(--sqc-border);flex-shrink:0;align-items:center;gap:8px;padding:13px 12px 13px 16px;display:flex}.sqc-header__icon{color:var(--sqc-accent-fg);flex-shrink:0;place-items:center;display:grid}.sqc-header__icon svg{width:17px;height:17px;display:block}.sqc-header__titles{flex:1;min-width:0}.sqc-header__heading,.sqc-header__sub{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.sqc-header__heading{font-family:var(--sqc-font-heading);letter-spacing:-.2px;font-size:15px;font-weight:700}.sqc-header__sub{color:var(--sqc-text-muted);font-size:12px}.sqc-icon-btn{width:26px;height:26px;color:var(--sqc-text-muted);cursor:pointer;background:0 0;border:none;border-radius:8px;flex-shrink:0;place-items:center;transition:background .15s;display:grid}.sqc-icon-btn:hover{background:var(--sqc-surface);color:var(--sqc-text)}.sqc-icon-btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-icon-btn svg{width:16px;height:16px}.sqc-icon-btn[data-tip]{position:relative}.sqc-icon-btn[data-tip]:after{content:attr(data-tip);z-index:6;background:var(--sqc-text);color:var(--sqc-bg);font-family:var(--sqc-font-family);white-space:nowrap;pointer-events:none;opacity:0;border-radius:8px;padding:4px 8px;font-size:11px;font-weight:500;line-height:1.3;transition:opacity .12s .15s;position:absolute;top:calc(100% + 6px);right:0}.sqc-icon-btn[data-tip]:hover:after{opacity:1}.sqc-icon-btn[data-tip]:focus-visible:after{opacity:1}.sqc-history-pop{z-index:5;position:absolute;top:54px;left:0;right:0}.sqc-history{background:var(--sqc-bg);max-height:320px;box-shadow:var(--sqc-shadow-bottom);flex-direction:column;display:flex;overflow-y:auto}.sqc-history__empty{color:var(--sqc-text-muted);text-align:center;margin:0;padding:14px 16px;font-size:12px}.sqc-history__item{border:none;border-bottom:1px solid var(--sqc-border);width:100%;color:var(--sqc-text);text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:10px 16px;transition:background .15s;display:flex}.sqc-history__item:last-child{border-bottom:none}.sqc-history__item:hover{background:var(--sqc-surface)}.sqc-history__item:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-history__item[aria-current=true]{background:var(--sqc-selected)}.sqc-history__item[aria-current=true] .sqc-history__title{color:var(--sqc-text);font-weight:600}.sqc-history__title{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.sqc-history__date{color:var(--sqc-text-muted);font-size:11px}.sqc-context{background:var(--sqc-selected);border:1px solid var(--sqc-border);color:var(--sqc-text);border-radius:12px;flex-wrap:wrap;flex-shrink:0;align-items:center;gap:8px;margin:12px 16px 4px;padding:8px 11px;font-size:12px;display:flex}.sqc-chip{text-overflow:ellipsis;white-space:nowrap;align-items:baseline;gap:4px;max-width:100%;display:inline-flex;overflow:hidden}.sqc-chip b{font-weight:600}.sqc-chip:not(:last-child):after{content:\"·\";opacity:.5;margin-left:4px}.sqc-messages{overscroll-behavior:contain;background:var(--sqc-bg);scrollbar-width:thin;scrollbar-color:var(--sqc-neutral-300) transparent;flex-direction:column;flex:1;gap:13px;min-height:0;padding:12px 16px;display:flex;overflow-y:auto}.sqc-messages::-webkit-scrollbar{width:6px}.sqc-messages::-webkit-scrollbar-thumb{background:var(--sqc-neutral-300);border-radius:99px}.sqc-msg{flex-direction:column;max-width:93%;font-size:13.5px;display:flex}.sqc-msg--assistant{align-self:flex-start}.sqc-msg--user{align-self:flex-end}.sqc-msg__who{color:var(--sqc-text-muted);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;font-weight:500;display:flex}.sqc-msg__who svg{width:12px;height:12px;color:var(--sqc-accent-fg);flex-shrink:0}.sqc-avatar{background:var(--sqc-accent-color);color:var(--sqc-on-accent);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;font-weight:600;line-height:1;display:inline-flex;overflow:hidden}.sqc-avatar img{object-fit:cover;width:100%;height:100%}.sqc-msg__unaddressed{color:var(--sqc-text-muted);margin:8px 0 0;font-size:11.5px;line-height:1.5}.sqc-msg__unaddressed code{background:var(--sqc-code-bg);color:var(--sqc-text);border-radius:4px;margin-right:4px;padding:1px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px}.sqc-msg--user .sqc-msg__bubble{background:var(--sqc-bubble-user);color:var(--sqc-bubble-user-text);border-radius:var(--sqc-radius) var(--sqc-radius) 4px var(--sqc-radius);padding:9px 13px}.sqc-msg--error .sqc-msg__bubble{background:var(--sqc-error-50);color:var(--sqc-error-600);border:1px solid var(--sqc-error-100);border-radius:12px;padding:11px}.sqc-msg__body{overflow-wrap:anywhere}.sqc-msg--assistant .sqc-msg__body{font-size:14px;line-height:1.6}.sqc-msg__body>:first-child{margin-top:0}.sqc-msg__body>:last-child{margin-bottom:0}.sqc-msg__body p{white-space:pre-wrap;margin:0 0 8px}.sqc-msg__body ul,.sqc-msg__body ol{margin:0 0 8px;padding-left:20px}.sqc-msg__body li{margin-bottom:3px}.sqc-msg__body code{background:var(--sqc-code-bg);border-radius:4px;padding:1px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.85em}.sqc-msg--user .sqc-msg__body code{background:#ffffff38}.sqc-msg__body pre{background:var(--sqc-code-bg);border-radius:8px;margin:0 0 8px;padding:9px 11px;overflow-x:auto}.sqc-msg__body pre code{background:0 0;padding:0}.sqc-msg__body a{color:inherit;text-underline-offset:2px;text-decoration:underline}.sqc-msg--assistant .sqc-msg__body a{color:var(--sqc-link);text-decoration:none}.sqc-msg--assistant .sqc-msg__body a:hover{text-decoration:underline}.sqc-msg__body h3,.sqc-msg__body h4,.sqc-msg__body h5,.sqc-msg__body h6{font-family:var(--sqc-font-heading);letter-spacing:-.2px;margin:12px 0 6px;font-weight:700;line-height:1.3}.sqc-msg__body h3{font-size:1.05em}.sqc-msg__body h4{font-size:1em}.sqc-msg__body h5,.sqc-msg__body h6{font-size:.94em}.sqc-msg__body ul ul,.sqc-msg__body ul ol,.sqc-msg__body ol ul,.sqc-msg__body ol ol{margin:3px 0 0}.sqc-msg__body blockquote{border-left:2px solid var(--sqc-border-strong);color:var(--sqc-text-muted);white-space:pre-wrap;margin:0 0 8px;padding:2px 0 2px 10px}.sqc-msg--user .sqc-msg__body blockquote{color:inherit;opacity:.85;border-left-color:#ffffff73}.sqc-msg__body hr{border:0;border-top:1px solid var(--sqc-border);margin:10px 0}.sqc-msg--user .sqc-msg__body hr{border-top-color:#ffffff4d}.sqc-msg__body del{opacity:.7}.sqc-approval{flex-direction:column;gap:8px;margin:11px 0 2px;display:flex}.sqc-approval__actions{flex-wrap:wrap;gap:8px;display:flex}.sqc-approval__request{color:var(--sqc-text);margin:0;font-size:13px}.sqc-approval__args{border:1px solid var(--sqc-border);background:var(--sqc-surface);border-radius:12px;flex-direction:column;gap:4px;margin:0;padding:8px 10px;font-size:12px;display:flex}.sqc-approval__arg{gap:8px;display:flex}.sqc-approval__arg-name{color:var(--sqc-text-muted);flex:none;font-weight:500}.sqc-approval__arg-value{overflow-wrap:anywhere;min-width:0;color:var(--sqc-text);margin:0}.sqc-approval__btn{height:32px;font-family:var(--sqc-font-family);border:1px solid var(--sqc-border);background:var(--sqc-bg);color:var(--sqc-text);cursor:pointer;border-radius:12px;flex:auto;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:500;transition:border-color .12s,background .12s;display:inline-flex}.sqc-approval__btn--yes:not(:disabled),.sqc-approval__btn--send:not(:disabled){background:var(--sqc-accent-color);color:var(--sqc-on-accent);border-color:#0000;font-weight:600}.sqc-approval__btn:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-approval__btn--yes:hover:not(:disabled),.sqc-approval__btn--send:hover:not(:disabled){background:var(--sqc-accent-hover);border-color:#0000}.sqc-approval__btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-approval__btn:disabled{cursor:default}.sqc-approval__btn:disabled[aria-pressed=false]{opacity:.45}.sqc-approval__btn[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected);color:var(--sqc-text);font-weight:600}.sqc-approval__edit{flex-direction:column;gap:8px;display:flex}.sqc-approval__input{width:100%;font-family:var(--sqc-font-family);color:var(--sqc-text);background:var(--sqc-bg);border:1px solid var(--sqc-border-strong);resize:vertical;border-radius:12px;padding:8px 10px;font-size:13px;line-height:1.4}.sqc-approval__input:focus-visible{border-color:var(--sqc-text);box-shadow:var(--sqc-focus-input);outline:none}.sqc-approval__btn--send{flex:none;align-self:flex-end}.sqc-confirm{gap:8px;margin:11px 0 2px;display:flex}.sqc-confirm__btn{height:32px;font-family:var(--sqc-font-family);border:1px solid var(--sqc-border);background:var(--sqc-bg);color:var(--sqc-text);cursor:pointer;border-radius:12px;flex:1 1 0;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:500;transition:border-color .12s,background .12s;display:inline-flex}.sqc-confirm__btn--yes:not(:disabled){background:var(--sqc-accent-color);color:var(--sqc-on-accent);border-color:#0000;font-weight:600}.sqc-confirm__btn:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-confirm__btn--yes:hover:not(:disabled){background:var(--sqc-accent-hover);border-color:#0000}.sqc-confirm__btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-confirm__btn:disabled{cursor:default}.sqc-confirm__btn:disabled[aria-pressed=false]{opacity:.45}.sqc-confirm__btn[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected);color:var(--sqc-text);font-weight:600}.sqc-choices{flex-direction:column;gap:7px;margin:10px 0 2px;display:flex}.sqc-choice{width:100%;font-family:var(--sqc-font-family);text-align:left;color:var(--sqc-text);background:var(--sqc-bg);border:1px solid var(--sqc-border);cursor:pointer;border-radius:12px;align-items:center;gap:8px;padding:8px 11px;font-size:12.5px;transition:border-color .12s,background .12s;display:flex}.sqc-choice:hover:not(:disabled){border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-choice:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-choice:disabled{cursor:default}.sqc-choice:disabled[aria-pressed=false]{opacity:.55}.sqc-choice[aria-pressed=true]{border-color:var(--sqc-border-strong);background:var(--sqc-selected)}.sqc-choice__box{border:1.5px solid var(--sqc-border-strong);border-radius:4px;flex:none;justify-content:center;align-items:center;width:15px;height:15px;display:inline-flex}.sqc-choice__box--on{color:var(--sqc-on-accent);background:var(--sqc-accent-color);border-color:var(--sqc-accent-color)}.sqc-choice__box svg{width:11px;height:11px}.sqc-choice__label{overflow-wrap:anywhere}.sqc-choice__detail{color:var(--sqc-text-muted);margin-top:1px;font-size:11.5px;display:block}.sqc-selection{flex-direction:column;gap:10px;margin:2px 0;display:flex}.sqc-selection__question{flex-direction:column;gap:2px;display:flex}.sqc-selection__ask{font-family:var(--sqc-font-family);color:var(--sqc-text);margin:0;font-size:13px;font-weight:600}.sqc-selection__actions{display:flex}.sqc-selection__validate{height:32px;font-family:var(--sqc-font-family);color:var(--sqc-on-accent);background:var(--sqc-accent-color);cursor:pointer;border:1px solid #0000;border-radius:12px;flex:auto;justify-content:center;align-items:center;padding:0 12px;font-size:13px;font-weight:600;transition:filter .12s,background .12s;display:inline-flex}.sqc-selection__validate:hover:not(:disabled){background:var(--sqc-accent-hover)}.sqc-selection__validate:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-selection__validate:disabled{cursor:not-allowed;color:#fff;background:var(--sqc-disabled)}.sqc-selection__hint{font-family:var(--sqc-font-family);color:var(--sqc-text-muted);margin:0;font-size:11.5px}.sqc-table{scrollbar-width:thin;margin:0 0 8px;overflow-x:auto}.sqc-table table{border-collapse:collapse;min-width:100%;font-family:var(--sqc-font-family);white-space:nowrap;font-size:12.5px}.sqc-table th,.sqc-table td{text-align:left;vertical-align:top;border-bottom:1px solid var(--sqc-border);padding:6px 10px 6px 0}.sqc-table thead th{text-transform:uppercase;letter-spacing:.05em;color:var(--sqc-text-muted);font-size:10.5px;font-weight:600}.sqc-table tbody th{font-weight:500}.sqc-msg--user .sqc-table th,.sqc-msg--user .sqc-table td{border-bottom-color:#ffffff40}.sqc-msg--user .sqc-table thead th{color:#fffc}.sqc-table tbody tr:last-child th,.sqc-table tbody tr:last-child td{border-bottom:0}.sqc-msg__time{color:var(--sqc-text-muted);font-variant-numeric:tabular-nums;margin-top:3px;font-size:10px;display:block}.sqc-msg--user .sqc-msg__time{color:#ffffffb3;text-align:right}.sqc-caret{vertical-align:text-bottom;background:currentColor;width:2px;height:1em;margin-left:2px;animation:1s step-end infinite sqc-blink;display:inline-block}@keyframes sqc-blink{0%,to{opacity:1}50%{opacity:0}}.sqc-typing{gap:3px;padding:2px 0;display:inline-flex}.sqc-typing i{background:var(--sqc-neutral-400);border-radius:50%;width:5px;height:5px;animation:1.2s infinite sqc-pulse}.sqc-typing i:nth-child(2){animation-delay:.2s}.sqc-typing i:nth-child(3){animation-delay:.4s}@keyframes sqc-pulse{0%,60%,to{opacity:.25}30%{opacity:1}}.sqc-suggestions{flex-direction:column;gap:7px;display:flex}.sqc-suggestion{border:1px solid var(--sqc-border);background:var(--sqc-bg);width:100%;color:var(--sqc-text);font-family:var(--sqc-font-family);cursor:pointer;text-align:left;border-radius:12px;align-items:center;gap:8px;padding:8px 11px;font-size:12.5px;transition:background .15s,border-color .15s;display:flex}.sqc-suggestion:before{content:\"\";background:var(--sqc-accent-fg);border-radius:50%;flex:none;width:5px;height:5px}.sqc-suggestion:hover{background:var(--sqc-surface);border-color:var(--sqc-border-strong)}.sqc-suggestion:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-composer{border-top:1px solid var(--sqc-border);background:var(--sqc-bg);flex-wrap:wrap;flex-shrink:0;align-items:flex-end;gap:8px;padding:12px 14px;display:flex}.sqc-composer--dropping{outline:2px dashed var(--sqc-accent-color);outline-offset:-4px}.sqc-attachments{flex-wrap:wrap;flex-basis:100%;gap:6px;display:flex}.sqc-attachments--sent{margin-top:8px}.sqc-chip{border:1px solid var(--sqc-border);background:var(--sqc-selected);max-width:100%;color:var(--sqc-text);border-radius:999px;align-items:center;gap:4px;padding:3px 4px 3px 10px;font-size:12px;display:inline-flex}.sqc-chip--waiting{opacity:.6;padding-right:10px}.sqc-chip__name{text-overflow:ellipsis;white-space:nowrap;max-width:180px;overflow:hidden}.sqc-chip__remove{width:18px;height:18px;color:var(--sqc-text-muted);cursor:pointer;background:0 0;border:0;border-radius:999px;justify-content:center;align-items:center;padding:0;font-size:14px;line-height:1;display:inline-flex}.sqc-chip__remove:hover{background:var(--sqc-selected);color:var(--sqc-text)}.sqc-attachments__error{color:var(--sqc-error-600);flex-basis:100%;margin:0;font-size:12px}.sqc-attachment__image{border-radius:12px;max-width:100%;max-height:180px;display:block}.sqc-file-input{display:none}.sqc-btn--attach{color:var(--sqc-text-muted);background:0 0}.sqc-btn--attach:hover{background:var(--sqc-selected);color:var(--sqc-text)}.sqc-composer__field{flex:1;min-width:0;position:relative}.sqc-composer__input{border:1px solid var(--sqc-border-strong);background:var(--sqc-bg);width:100%;min-height:38px;max-height:132px;color:var(--sqc-text);font-family:var(--sqc-font-family);resize:none;border-radius:12px;outline:none;padding:9px 12px;font-size:13.5px;line-height:1.4;transition:border-color .15s,box-shadow .15s;display:block;overflow-y:hidden}.sqc-composer__input::placeholder{color:var(--sqc-neutral-400)}.sqc-composer__input:focus{border-color:var(--sqc-text);box-shadow:var(--sqc-focus-input)}.sqc-mentions{z-index:2;border:1px solid var(--sqc-border);background:var(--sqc-bg);max-height:184px;box-shadow:var(--sqc-shadow);scrollbar-width:thin;border-radius:12px;margin:0;padding:4px;list-style:none;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow-y:auto}.sqc-mention{cursor:pointer;color:var(--sqc-text);border-radius:8px;align-items:baseline;gap:6px;padding:6px 8px;font-size:12.5px;display:flex}.sqc-mention--active{background:var(--sqc-neutral-100)}.sqc-mention__icon{flex-shrink:0}.sqc-mention__handle{font-weight:600}.sqc-mention__name{text-overflow:ellipsis;white-space:nowrap;color:var(--sqc-text-muted);overflow:hidden}.sqc-composer__count{color:var(--sqc-text-muted);pointer-events:none;font-variant-numeric:tabular-nums;font-size:10px;position:absolute;bottom:4px;right:8px}.sqc-btn{cursor:pointer;border:none;border-radius:12px;flex-shrink:0;place-items:center;width:38px;height:38px;transition:background .15s,opacity .15s;display:grid}.sqc-btn svg{width:17px;height:17px}.sqc-btn--send{background:var(--sqc-accent-color);color:var(--sqc-on-accent)}.sqc-btn--send:hover:not(:disabled){background:var(--sqc-accent-hover)}.sqc-btn--send:disabled{background:var(--sqc-disabled);color:#fff;cursor:not-allowed}.sqc-btn--stop{background:var(--sqc-bg);color:var(--sqc-text);border:1px solid var(--sqc-border)}.sqc-btn--stop:hover{border-color:var(--sqc-border-strong);background:var(--sqc-surface)}.sqc-btn:focus-visible{box-shadow:var(--sqc-focus);outline:none}.sqc-hint{padding:0 16px max(9px, env(safe-area-inset-bottom));color:var(--sqc-text-muted);text-align:center;flex-shrink:0;margin:0;font-size:10.5px;line-height:1.35}.sqc-powered{padding:0 16px max(9px, env(safe-area-inset-bottom));text-align:center;flex-shrink:0;margin:0;font-size:10.5px;line-height:1.35}.sqc-powered a{color:var(--sqc-text-muted);text-decoration:none}.sqc-powered a:hover{text-decoration:underline}@media (max-width:520px){.sqc{--sqc-width:100vw}.sqc-panel{border-left:none}.sqc-launcher{bottom:16px;right:16px}.sqc[data-position=bottom-left] .sqc-launcher{left:16px}.sqc[data-layout=floating] .sqc-panel,.sqc[data-layout=floating][data-position=bottom-left] .sqc-panel{border:none;border-radius:0;max-width:none;height:auto;max-height:none;top:0;bottom:0;left:0;right:0}}@media (prefers-reduced-motion:reduce){.sqc-launcher,.sqc-panel,.sqc-btn,.sqc-suggestion,.sqc-choice,.sqc-confirm__btn,.sqc-icon-btn,.sqc-icon-btn[data-tip]:after,.sqc-rail__item:before,.sqc-rail__item[data-tip]:after,.sqc-rail__item .sqc-avatar{transition:none}.sqc-typing i,.sqc-caret{animation:none}}.sqc-with-human{border:1px solid var(--sqc-border);background:var(--sqc-selected);color:var(--sqc-neutral-600);border-radius:12px;margin:8px 0 0;padding:8px 12px;font-size:13px}";
|
|
2346
2443
|
//#endregion
|
|
2347
2444
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/checkPrivateRedeclaration.js
|
|
2348
|
-
function
|
|
2445
|
+
function An(e, t) {
|
|
2349
2446
|
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
2350
2447
|
}
|
|
2351
2448
|
//#endregion
|
|
2352
2449
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
2353
|
-
function
|
|
2354
|
-
|
|
2450
|
+
function jn(e, t) {
|
|
2451
|
+
An(e, t), t.add(e);
|
|
2355
2452
|
}
|
|
2356
2453
|
//#endregion
|
|
2357
2454
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
2358
2455
|
function X(e, t, n) {
|
|
2359
|
-
|
|
2456
|
+
An(e, t), t.set(e, n);
|
|
2360
2457
|
}
|
|
2361
2458
|
//#endregion
|
|
2362
2459
|
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/assertClassBrand.js
|
|
@@ -2376,7 +2473,7 @@ function $(e, t) {
|
|
|
2376
2473
|
}
|
|
2377
2474
|
//#endregion
|
|
2378
2475
|
//#region src/element.tsx
|
|
2379
|
-
var
|
|
2476
|
+
var Mn = "squadico-chatbot", Nn = [
|
|
2380
2477
|
"embed-key",
|
|
2381
2478
|
"context",
|
|
2382
2479
|
"user",
|
|
@@ -2395,21 +2492,21 @@ var En = "squadico-chatbot", Dn = [
|
|
|
2395
2492
|
"open",
|
|
2396
2493
|
"persist-open",
|
|
2397
2494
|
"locale"
|
|
2398
|
-
],
|
|
2399
|
-
function
|
|
2400
|
-
if (
|
|
2495
|
+
], Pn;
|
|
2496
|
+
function Fn() {
|
|
2497
|
+
if (Pn !== void 0) return Pn;
|
|
2401
2498
|
try {
|
|
2402
2499
|
let e = new CSSStyleSheet();
|
|
2403
|
-
e.replaceSync(
|
|
2500
|
+
e.replaceSync(kn), Pn = e;
|
|
2404
2501
|
} catch {
|
|
2405
|
-
|
|
2502
|
+
Pn = null;
|
|
2406
2503
|
}
|
|
2407
|
-
return
|
|
2504
|
+
return Pn;
|
|
2408
2505
|
}
|
|
2409
|
-
function
|
|
2410
|
-
typeof console < "u" && console.warn(`[${
|
|
2506
|
+
function In(e, t) {
|
|
2507
|
+
typeof console < "u" && console.warn(`[${Mn}] ${e}`, t ?? "");
|
|
2411
2508
|
}
|
|
2412
|
-
function
|
|
2509
|
+
function Ln(e) {
|
|
2413
2510
|
if (!(!e || !e.trim())) try {
|
|
2414
2511
|
let t = JSON.parse(e);
|
|
2415
2512
|
if (t && typeof t == "object" && !Array.isArray(t)) {
|
|
@@ -2420,56 +2517,56 @@ function jn(e) {
|
|
|
2420
2517
|
digest: typeof e.digest == "string" && e.digest ? e.digest : void 0
|
|
2421
2518
|
};
|
|
2422
2519
|
}
|
|
2423
|
-
|
|
2520
|
+
In("the \"user\" attribute needs an object with an id", e);
|
|
2424
2521
|
} catch (e) {
|
|
2425
|
-
|
|
2522
|
+
In("the \"user\" attribute is not valid JSON", e);
|
|
2426
2523
|
}
|
|
2427
2524
|
}
|
|
2428
|
-
function
|
|
2525
|
+
function Rn(e) {
|
|
2429
2526
|
if (!(!e || !e.trim())) try {
|
|
2430
2527
|
let t = JSON.parse(e);
|
|
2431
2528
|
if (t && typeof t == "object" && !Array.isArray(t)) return t;
|
|
2432
|
-
|
|
2529
|
+
In("the `context` attribute must be a JSON object", e);
|
|
2433
2530
|
} catch (e) {
|
|
2434
|
-
|
|
2531
|
+
In("the `context` attribute is not valid JSON", e);
|
|
2435
2532
|
}
|
|
2436
2533
|
}
|
|
2437
|
-
function
|
|
2534
|
+
function zn(e) {
|
|
2438
2535
|
if (!(!e || !e.trim())) {
|
|
2439
2536
|
if (e.trim().startsWith("[")) try {
|
|
2440
2537
|
let t = JSON.parse(e);
|
|
2441
2538
|
if (Array.isArray(t)) return t.map(String);
|
|
2442
2539
|
} catch (e) {
|
|
2443
|
-
|
|
2540
|
+
In("the `suggestions` attribute is not valid JSON", e);
|
|
2444
2541
|
return;
|
|
2445
2542
|
}
|
|
2446
2543
|
return e.split("|").map((e) => e.trim()).filter(Boolean);
|
|
2447
2544
|
}
|
|
2448
2545
|
}
|
|
2449
|
-
function
|
|
2546
|
+
function Bn(e) {
|
|
2450
2547
|
if (e !== null) return e !== "false" && e !== "0";
|
|
2451
2548
|
}
|
|
2452
|
-
function
|
|
2549
|
+
function Vn(e) {
|
|
2453
2550
|
return e === "dark" || e === "light" || e === "auto" ? e : void 0;
|
|
2454
2551
|
}
|
|
2455
|
-
function
|
|
2552
|
+
function Hn(e) {
|
|
2456
2553
|
return e === "bottom-left" || e === "bottom-right" ? e : void 0;
|
|
2457
2554
|
}
|
|
2458
|
-
function
|
|
2555
|
+
function Un(e) {
|
|
2459
2556
|
return e === "floating" || e === "sidebar" ? e : void 0;
|
|
2460
2557
|
}
|
|
2461
|
-
var
|
|
2558
|
+
var Wn = [
|
|
2462
2559
|
"context",
|
|
2463
2560
|
"embedKey",
|
|
2464
2561
|
"user",
|
|
2465
2562
|
"getSubjectToken",
|
|
2466
2563
|
"agent"
|
|
2467
2564
|
];
|
|
2468
|
-
function
|
|
2565
|
+
function Gn() {
|
|
2469
2566
|
var e, t, n, r, i, a, o, s, c, l, u, d, f, p;
|
|
2470
2567
|
return t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakSet(), f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), e = class extends HTMLElement {
|
|
2471
2568
|
constructor() {
|
|
2472
|
-
super(),
|
|
2569
|
+
super(), jn(this, d), X(this, t, void 0), X(this, n, null), X(this, r, !1), X(this, i, !1), X(this, a, ""), X(this, o, void 0), X(this, s, void 0), X(this, c, void 0), X(this, l, void 0), X(this, u, void 0), X(this, f, (e) => {
|
|
2473
2570
|
let { type: t, ...n } = e;
|
|
2474
2571
|
Q(a, this, n.sessionId), this.dispatchEvent(new CustomEvent(t, {
|
|
2475
2572
|
detail: n,
|
|
@@ -2479,14 +2576,14 @@ function zn() {
|
|
|
2479
2576
|
}), X(this, p, (e) => {
|
|
2480
2577
|
Q(n, this, e), e && Q(a, this, e.sessionId());
|
|
2481
2578
|
});
|
|
2482
|
-
let e = this.attachShadow({ mode: "open" }), m =
|
|
2579
|
+
let e = this.attachShadow({ mode: "open" }), m = Fn();
|
|
2483
2580
|
if (m) e.adoptedStyleSheets = [m];
|
|
2484
2581
|
else {
|
|
2485
2582
|
let t = document.createElement("style");
|
|
2486
|
-
t.textContent =
|
|
2583
|
+
t.textContent = kn, e.append(t);
|
|
2487
2584
|
}
|
|
2488
2585
|
Q(t, this, document.createElement("div")), e.append($(t, this));
|
|
2489
|
-
for (let e of
|
|
2586
|
+
for (let e of Wn) {
|
|
2490
2587
|
if (!Object.hasOwn(this, e)) continue;
|
|
2491
2588
|
let t = this[e];
|
|
2492
2589
|
delete this[e], this[e] = t;
|
|
@@ -2496,19 +2593,19 @@ function zn() {
|
|
|
2496
2593
|
Q(i, this, !0), Z(d, this, h).call(this);
|
|
2497
2594
|
}
|
|
2498
2595
|
disconnectedCallback() {
|
|
2499
|
-
Q(i, this, !1),
|
|
2596
|
+
Q(i, this, !1), ae(null, $(t, this)), Q(n, this, null);
|
|
2500
2597
|
}
|
|
2501
2598
|
attributeChangedCallback(e, t, r) {
|
|
2502
2599
|
if (t !== r) {
|
|
2503
2600
|
if (e === "open" && $(n, this)) {
|
|
2504
|
-
|
|
2601
|
+
Bn(r) ? $(n, this).open() : $(n, this).close();
|
|
2505
2602
|
return;
|
|
2506
2603
|
}
|
|
2507
2604
|
Z(d, this, m).call(this);
|
|
2508
2605
|
}
|
|
2509
2606
|
}
|
|
2510
2607
|
get context() {
|
|
2511
|
-
return $(o, this) ??
|
|
2608
|
+
return $(o, this) ?? Rn(this.getAttribute("context"));
|
|
2512
2609
|
}
|
|
2513
2610
|
set context(e) {
|
|
2514
2611
|
Q(o, this, e), Z(d, this, m).call(this);
|
|
@@ -2520,7 +2617,7 @@ function zn() {
|
|
|
2520
2617
|
Q(u, this, e), Z(d, this, m).call(this);
|
|
2521
2618
|
}
|
|
2522
2619
|
get user() {
|
|
2523
|
-
return $(s, this) ??
|
|
2620
|
+
return $(s, this) ?? Ln(this.getAttribute("user"));
|
|
2524
2621
|
}
|
|
2525
2622
|
set user(e) {
|
|
2526
2623
|
Q(s, this, e), Z(d, this, m).call(this);
|
|
@@ -2538,7 +2635,7 @@ function zn() {
|
|
|
2538
2635
|
Q(l, this, e), Z(d, this, m).call(this);
|
|
2539
2636
|
}
|
|
2540
2637
|
get open() {
|
|
2541
|
-
return $(n, this)?.isOpen() ??
|
|
2638
|
+
return $(n, this)?.isOpen() ?? Bn(this.getAttribute("open")) ?? !1;
|
|
2542
2639
|
}
|
|
2543
2640
|
set open(e) {
|
|
2544
2641
|
e ? this.openChat() : this.closeChat();
|
|
@@ -2560,12 +2657,12 @@ function zn() {
|
|
|
2560
2657
|
}
|
|
2561
2658
|
sendMessage(e) {
|
|
2562
2659
|
if (!$(n, this)) {
|
|
2563
|
-
|
|
2660
|
+
In("sendMessage() called before the component was mounted — ignored");
|
|
2564
2661
|
return;
|
|
2565
2662
|
}
|
|
2566
2663
|
$(n, this).send(e);
|
|
2567
2664
|
}
|
|
2568
|
-
},
|
|
2665
|
+
}, qe(e, "observedAttributes", Nn), e;
|
|
2569
2666
|
function m() {
|
|
2570
2667
|
$(r, this) || !$(i, this) || (Q(r, this, !0), queueMicrotask(() => {
|
|
2571
2668
|
Q(r, this, !1), $(i, this) && Z(d, this, h).call(this);
|
|
@@ -2573,7 +2670,7 @@ function zn() {
|
|
|
2573
2670
|
}
|
|
2574
2671
|
function h() {
|
|
2575
2672
|
let e = (e) => this.getAttribute(e) ?? void 0;
|
|
2576
|
-
|
|
2673
|
+
ae(/* @__PURE__ */ Y(On, {
|
|
2577
2674
|
embedKey: this.embedKey,
|
|
2578
2675
|
context: this.context,
|
|
2579
2676
|
user: this.user,
|
|
@@ -2584,28 +2681,28 @@ function zn() {
|
|
|
2584
2681
|
assistantName: e("assistant-name"),
|
|
2585
2682
|
placeholder: e("placeholder"),
|
|
2586
2683
|
greeting: e("greeting"),
|
|
2587
|
-
suggestions:
|
|
2684
|
+
suggestions: zn(this.getAttribute("suggestions")),
|
|
2588
2685
|
width: e("width"),
|
|
2589
2686
|
accent: e("accent"),
|
|
2590
|
-
theme:
|
|
2591
|
-
position:
|
|
2592
|
-
layout:
|
|
2593
|
-
defaultOpen:
|
|
2594
|
-
persistOpen:
|
|
2687
|
+
theme: Vn(this.getAttribute("theme")),
|
|
2688
|
+
position: Hn(this.getAttribute("position")),
|
|
2689
|
+
layout: Un(this.getAttribute("layout")),
|
|
2690
|
+
defaultOpen: Bn(this.getAttribute("open")) ?? !1,
|
|
2691
|
+
persistOpen: Bn(this.getAttribute("persist-open")) ?? !0,
|
|
2595
2692
|
locale: e("locale"),
|
|
2596
2693
|
onEvent: $(f, this),
|
|
2597
2694
|
bind: $(p, this)
|
|
2598
2695
|
}), $(t, this));
|
|
2599
2696
|
}
|
|
2600
2697
|
}
|
|
2601
|
-
var
|
|
2602
|
-
function
|
|
2603
|
-
typeof window > "u" || typeof HTMLElement > "u" || (
|
|
2698
|
+
var Kn;
|
|
2699
|
+
function qn(e = Mn) {
|
|
2700
|
+
typeof window > "u" || typeof HTMLElement > "u" || (Kn ?? (Kn = Gn()), window.customElements.get(e) || window.customElements.define(e, Kn));
|
|
2604
2701
|
}
|
|
2605
2702
|
//#endregion
|
|
2606
2703
|
//#region src/index.ts
|
|
2607
|
-
|
|
2704
|
+
qn();
|
|
2608
2705
|
//#endregion
|
|
2609
|
-
export {
|
|
2706
|
+
export { Ye as a, je as c, J as i, qn as n, Be as o, Je as r, Ae as s, Mn as t };
|
|
2610
2707
|
|
|
2611
|
-
//# sourceMappingURL=src-
|
|
2708
|
+
//# sourceMappingURL=src-2GKPJcbZ.js.map
|