@enegelai/bot-widget 1.11.1 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/enegelaibot.umd.js +265 -265
- package/dist/index.es.js +128 -105
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var ja = Object.defineProperty;
|
|
2
2
|
var Ha = (c, e, a) => e in c ? ja(c, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : c[e] = a;
|
|
3
3
|
var ge = (c, e, a) => Ha(c, typeof e != "symbol" ? e + "" : e, a);
|
|
4
|
-
import { css as X, LitElement as ut, html as g, svg as
|
|
4
|
+
import { css as X, LitElement as ut, html as g, svg as le } from "lit";
|
|
5
5
|
import { property as v, customElement as J, queryAll as Qt, query as ke, eventOptions as Mt } from "lit/decorators.js";
|
|
6
6
|
import { unsafeHTML as W } from "lit-html/directives/unsafe-html.js";
|
|
7
|
-
import { when as
|
|
7
|
+
import { when as ie } from "lit/directives/when.js";
|
|
8
8
|
import { registerIconLibrary as Ba } from "@shoelace-style/shoelace";
|
|
9
9
|
import "@shoelace-style/shoelace/dist/components/button/button.js";
|
|
10
10
|
import "@shoelace-style/shoelace/dist/components/avatar/avatar.js";
|
|
@@ -800,7 +800,7 @@ var dc = Object.defineProperty, O = (c, e, a, n) => {
|
|
|
800
800
|
};
|
|
801
801
|
const A = Ke.noConflict();
|
|
802
802
|
A.setLevel("info");
|
|
803
|
-
const
|
|
803
|
+
const ee = "cb_";
|
|
804
804
|
class L extends kt {
|
|
805
805
|
constructor() {
|
|
806
806
|
super(...arguments), this.actionIdCounter = 0, this.prefilledFormValues = {}, this.wsClient = null, this.replyMessage = null, this.streamingResponseInProgress = !1, this.streamingResponseLastText = null, this.streamingResponseBuffer = null, this.streamingResponseTagStartPos = 0, this.streamingResponseCurrentTag = null;
|
|
@@ -938,7 +938,7 @@ class L extends kt {
|
|
|
938
938
|
A.info("form has no fields", e);
|
|
939
939
|
return;
|
|
940
940
|
}
|
|
941
|
-
const r = `${
|
|
941
|
+
const r = `${ee}${this.setting.botId}.${this.conversationId}.form.${n}`, f = localStorage.getItem(r);
|
|
942
942
|
if (f) {
|
|
943
943
|
let w = null;
|
|
944
944
|
try {
|
|
@@ -1016,22 +1016,34 @@ class L extends kt {
|
|
|
1016
1016
|
if ((e == null ? void 0 : e.type) !== "ack")
|
|
1017
1017
|
switch (this.lastConversationUpdate = Date.now(), e == null ? void 0 : e.type) {
|
|
1018
1018
|
case "message": {
|
|
1019
|
-
if (
|
|
1020
|
-
this.streamingResponseInProgress ? (this.finishStreamingResponse(e.text), this.streamingResponseInProgress = !1) : (this.replyMessage.data.text = e.text, this.updateMessage(this.replyMessage, "")), this.replyMessage = null;
|
|
1021
|
-
else {
|
|
1019
|
+
if ((e == null ? void 0 : e.author) === "user") {
|
|
1022
1020
|
const n = {
|
|
1023
1021
|
id: (e == null ? void 0 : e.id) || null,
|
|
1024
1022
|
type: "text",
|
|
1025
|
-
author: "
|
|
1023
|
+
author: "user",
|
|
1026
1024
|
data: {
|
|
1027
1025
|
text: e.text
|
|
1028
1026
|
}
|
|
1029
1027
|
};
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1028
|
+
this.replyMessage ? this.insertMessage(n, -1) : this.addMessage(n);
|
|
1029
|
+
} else {
|
|
1030
|
+
if (this.replyMessage)
|
|
1031
|
+
this.streamingResponseInProgress ? (this.finishStreamingResponse(e.text), this.streamingResponseInProgress = !1) : (this.replyMessage.data.text = e.text, this.updateMessage(this.replyMessage, "")), this.replyMessage = null;
|
|
1032
|
+
else {
|
|
1033
|
+
const n = {
|
|
1034
|
+
id: (e == null ? void 0 : e.id) || null,
|
|
1035
|
+
type: "text",
|
|
1036
|
+
author: "assistant",
|
|
1037
|
+
data: {
|
|
1038
|
+
text: e.text
|
|
1039
|
+
}
|
|
1040
|
+
};
|
|
1041
|
+
"userName" in e && (n.data.userName = e.userName), "userAvatar" in e && (n.data.userAvatar = e.userAvatar);
|
|
1042
|
+
const s = this.formatMessage(n);
|
|
1043
|
+
this.messages = this.messages.concat([s]);
|
|
1044
|
+
}
|
|
1045
|
+
this.open || (this.unreadMessages++, this.playAudioNotification());
|
|
1033
1046
|
}
|
|
1034
|
-
this.open || (this.unreadMessages++, this.playAudioNotification());
|
|
1035
1047
|
break;
|
|
1036
1048
|
}
|
|
1037
1049
|
case "message-chunk": {
|
|
@@ -1200,6 +1212,10 @@ class L extends kt {
|
|
|
1200
1212
|
addMessage(e) {
|
|
1201
1213
|
e = this.formatMessage(e), this.messages = this.messages.concat([e]);
|
|
1202
1214
|
}
|
|
1215
|
+
// insert message
|
|
1216
|
+
insertMessage(e, a = -1) {
|
|
1217
|
+
e = this.formatMessage(e), this.messages.length === 0 ? this.messages = [e] : this.messages = [...this.messages.slice(0, -1), e, ...this.messages.slice(-1)];
|
|
1218
|
+
}
|
|
1203
1219
|
addSystemMessage(e) {
|
|
1204
1220
|
this.addMessage({
|
|
1205
1221
|
type: "text",
|
|
@@ -1228,7 +1244,7 @@ class L extends kt {
|
|
|
1228
1244
|
A.info("submitForm: No form is active - ignored");
|
|
1229
1245
|
return;
|
|
1230
1246
|
}
|
|
1231
|
-
const a = `${
|
|
1247
|
+
const a = `${ee}${this.setting.botId}.${this.conversationId}.form.${this.form.name}`;
|
|
1232
1248
|
await this.sendFormData(this.form.name, e), localStorage.setItem(a, JSON.stringify(e)), "name" in e && (this.feedbackName = e.name), "email" in e && (this.feedbackEmail = e.email), this.form = null;
|
|
1233
1249
|
}
|
|
1234
1250
|
async sendFormData(e, a) {
|
|
@@ -1333,42 +1349,42 @@ class L extends kt {
|
|
|
1333
1349
|
}
|
|
1334
1350
|
}
|
|
1335
1351
|
O([
|
|
1336
|
-
oe({ prefix:
|
|
1352
|
+
oe({ prefix: ee }),
|
|
1337
1353
|
q({ value: "en" })
|
|
1338
1354
|
], L.prototype, "language");
|
|
1339
1355
|
O([
|
|
1340
|
-
oe({ prefix:
|
|
1356
|
+
oe({ prefix: ee }),
|
|
1341
1357
|
q({ value: "light" })
|
|
1342
1358
|
], L.prototype, "theme");
|
|
1343
1359
|
O([
|
|
1344
|
-
oe({ prefix:
|
|
1360
|
+
oe({ prefix: ee }),
|
|
1345
1361
|
q({ type: Boolean, value: !1 })
|
|
1346
1362
|
], L.prototype, "open");
|
|
1347
1363
|
O([
|
|
1348
1364
|
q({ type: Boolean, value: !1 })
|
|
1349
1365
|
], L.prototype, "alwaysOpen");
|
|
1350
1366
|
O([
|
|
1351
|
-
oe({ prefix:
|
|
1367
|
+
oe({ prefix: ee }),
|
|
1352
1368
|
q({ value: "false" })
|
|
1353
1369
|
], L.prototype, "connectWs");
|
|
1354
1370
|
O([
|
|
1355
|
-
oe({ prefix:
|
|
1371
|
+
oe({ prefix: ee }),
|
|
1356
1372
|
q({ value: xe() })
|
|
1357
1373
|
], L.prototype, "conversationId");
|
|
1358
1374
|
O([
|
|
1359
|
-
oe({ prefix:
|
|
1375
|
+
oe({ prefix: ee }),
|
|
1360
1376
|
q({ value: 0 })
|
|
1361
1377
|
], L.prototype, "lastConversationUpdate");
|
|
1362
1378
|
O([
|
|
1363
|
-
oe({ prefix:
|
|
1379
|
+
oe({ prefix: ee }),
|
|
1364
1380
|
q({ type: Array, value: [] })
|
|
1365
1381
|
], L.prototype, "messages");
|
|
1366
1382
|
O([
|
|
1367
|
-
oe({ prefix:
|
|
1383
|
+
oe({ prefix: ee }),
|
|
1368
1384
|
q({ value: 0 })
|
|
1369
1385
|
], L.prototype, "unreadMessages");
|
|
1370
1386
|
O([
|
|
1371
|
-
oe({ prefix:
|
|
1387
|
+
oe({ prefix: ee }),
|
|
1372
1388
|
q({
|
|
1373
1389
|
type: Array,
|
|
1374
1390
|
value: []
|
|
@@ -1434,14 +1450,14 @@ O([
|
|
|
1434
1450
|
q({ type: Boolean, value: !1 })
|
|
1435
1451
|
], L.prototype, "connected");
|
|
1436
1452
|
O([
|
|
1437
|
-
oe({ prefix:
|
|
1453
|
+
oe({ prefix: ee }),
|
|
1438
1454
|
q({ value: "true" })
|
|
1439
1455
|
], L.prototype, "shouldEngage");
|
|
1440
1456
|
O([
|
|
1441
1457
|
q({ type: Boolean, value: !1 })
|
|
1442
1458
|
], L.prototype, "engage");
|
|
1443
1459
|
O([
|
|
1444
|
-
oe({ prefix:
|
|
1460
|
+
oe({ prefix: ee }),
|
|
1445
1461
|
q({
|
|
1446
1462
|
type: Object,
|
|
1447
1463
|
value: {
|
|
@@ -1457,7 +1473,7 @@ O([
|
|
|
1457
1473
|
})
|
|
1458
1474
|
], L.prototype, "setting");
|
|
1459
1475
|
O([
|
|
1460
|
-
oe({ prefix:
|
|
1476
|
+
oe({ prefix: ee }),
|
|
1461
1477
|
q({ type: Object, value: null })
|
|
1462
1478
|
], L.prototype, "context");
|
|
1463
1479
|
O([
|
|
@@ -1491,11 +1507,11 @@ O([
|
|
|
1491
1507
|
q({ type: Array, value: [] })
|
|
1492
1508
|
], L.prototype, "feedbackMessages");
|
|
1493
1509
|
O([
|
|
1494
|
-
oe({ prefix:
|
|
1510
|
+
oe({ prefix: ee }),
|
|
1495
1511
|
q({ type: String, value: "" })
|
|
1496
1512
|
], L.prototype, "feedbackName");
|
|
1497
1513
|
O([
|
|
1498
|
-
oe({ prefix:
|
|
1514
|
+
oe({ prefix: ee }),
|
|
1499
1515
|
q({ type: String, value: "" })
|
|
1500
1516
|
], L.prototype, "feedbackEmail");
|
|
1501
1517
|
const p = new L(), fc = X`
|
|
@@ -1581,7 +1597,7 @@ var lc = Object.defineProperty, bc = (c, e, a, n) => {
|
|
|
1581
1597
|
Ba("system", {
|
|
1582
1598
|
resolver: (c) => ""
|
|
1583
1599
|
});
|
|
1584
|
-
class
|
|
1600
|
+
class te extends ut {
|
|
1585
1601
|
constructor() {
|
|
1586
1602
|
super(...arguments), this.lang = "en";
|
|
1587
1603
|
}
|
|
@@ -1598,14 +1614,14 @@ class ae extends ut {
|
|
|
1598
1614
|
}
|
|
1599
1615
|
bc([
|
|
1600
1616
|
v({ type: String })
|
|
1601
|
-
],
|
|
1617
|
+
], te.prototype, "lang");
|
|
1602
1618
|
var hc = Object.defineProperty, uc = Object.getOwnPropertyDescriptor, na = (c, e, a, n) => {
|
|
1603
1619
|
for (var s = n > 1 ? void 0 : n ? uc(e, a) : e, r = c.length - 1, f; r >= 0; r--)
|
|
1604
1620
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
1605
1621
|
return n && s && hc(e, a, s), s;
|
|
1606
1622
|
};
|
|
1607
1623
|
const pc = '<svg viewBox="0 0 16 16" width="16px" height="16px"><path fill="currentColor" d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"></path></svg>';
|
|
1608
|
-
let ot = class extends
|
|
1624
|
+
let ot = class extends te {
|
|
1609
1625
|
constructor() {
|
|
1610
1626
|
super(...arguments), this.title = "ChatBot";
|
|
1611
1627
|
}
|
|
@@ -1616,13 +1632,13 @@ let ot = class extends ae {
|
|
|
1616
1632
|
*/
|
|
1617
1633
|
renderExp() {
|
|
1618
1634
|
return g` <header class="cb-header" part="header">
|
|
1619
|
-
${
|
|
1635
|
+
${ie(
|
|
1620
1636
|
p.setting.logoUrl !== "",
|
|
1621
1637
|
() => g`<img class="cb-header-logo" part="header-logo" src="${p.setting.logoUrl}" />`,
|
|
1622
1638
|
() => g`<div class="cb-header-logo" part="header-logo">${W(p.setting.logoSvg)}</div>`
|
|
1623
1639
|
)}
|
|
1624
1640
|
<div class="cb-header-title" part="header-title">${this.title}</div>
|
|
1625
|
-
${
|
|
1641
|
+
${ie(
|
|
1626
1642
|
p.alwaysOpen,
|
|
1627
1643
|
() => g``,
|
|
1628
1644
|
() => g`<div class="cb-header-close" part="header-close">${W(pc)}</div>`
|
|
@@ -1631,13 +1647,13 @@ let ot = class extends ae {
|
|
|
1631
1647
|
}
|
|
1632
1648
|
render() {
|
|
1633
1649
|
return g` <header class="cb-header" part="header">
|
|
1634
|
-
${
|
|
1650
|
+
${ie(
|
|
1635
1651
|
p.setting.logoUrl !== "",
|
|
1636
1652
|
() => g`<img class="cb-header-img" part="header-logo" src="${p.setting.logoUrl}" />`,
|
|
1637
1653
|
() => g`<div class="cb-header-logo" part="header-logo">${W(p.setting.logoSvg)}</div>`
|
|
1638
1654
|
)}
|
|
1639
1655
|
<div class="cb-header-title" part="header-title">${this.title}</div>
|
|
1640
|
-
${
|
|
1656
|
+
${ie(
|
|
1641
1657
|
p.alwaysOpen,
|
|
1642
1658
|
() => g`<div></div>`,
|
|
1643
1659
|
() => g`<div @click=${this._clickCloseHandler} class="cb-header-close" part="header-close">${W(p.setting.closeSvg)}</div>`
|
|
@@ -1694,7 +1710,7 @@ var mc = Object.defineProperty, yc = Object.getOwnPropertyDescriptor, vc = (c, e
|
|
|
1694
1710
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
1695
1711
|
return n && s && mc(e, a, s), s;
|
|
1696
1712
|
};
|
|
1697
|
-
let Ct = class extends
|
|
1713
|
+
let Ct = class extends te {
|
|
1698
1714
|
constructor() {
|
|
1699
1715
|
super(...arguments), this.year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
1700
1716
|
}
|
|
@@ -2446,7 +2462,7 @@ var sa = { exports: {} };
|
|
|
2446
2462
|
typeof o == "function" && o.apply(this.el, arguments);
|
|
2447
2463
|
}
|
|
2448
2464
|
} }]);
|
|
2449
|
-
function
|
|
2465
|
+
function ae(t, i) {
|
|
2450
2466
|
var o = new Ma(t);
|
|
2451
2467
|
return o.add(i), o;
|
|
2452
2468
|
}
|
|
@@ -2454,7 +2470,7 @@ var sa = { exports: {} };
|
|
|
2454
2470
|
s(this, t), this.element = typeof i == "string" ? document.querySelector(i) : i, this.start = this.start.bind(this), this.move = this.move.bind(this), this.end = this.end.bind(this), this.cancel = this.cancel.bind(this), this.element.addEventListener("touchstart", this.start, !1), this.element.addEventListener("touchmove", this.move, !1), this.element.addEventListener("touchend", this.end, !1), this.element.addEventListener("touchcancel", this.cancel, !1), this.preV = { x: null, y: null }, this.pinchStartLen = null, this.zoom = 1, this.isDoubleTap = !1;
|
|
2455
2471
|
var d = function() {
|
|
2456
2472
|
};
|
|
2457
|
-
this.rotate =
|
|
2473
|
+
this.rotate = ae(this.element, o.rotate || d), this.touchStart = ae(this.element, o.touchStart || d), this.multipointStart = ae(this.element, o.multipointStart || d), this.multipointEnd = ae(this.element, o.multipointEnd || d), this.pinch = ae(this.element, o.pinch || d), this.swipe = ae(this.element, o.swipe || d), this.tap = ae(this.element, o.tap || d), this.doubleTap = ae(this.element, o.doubleTap || d), this.longTap = ae(this.element, o.longTap || d), this.singleTap = ae(this.element, o.singleTap || d), this.pressMove = ae(this.element, o.pressMove || d), this.twoFingerPressMove = ae(this.element, o.twoFingerPressMove || d), this.touchMove = ae(this.element, o.touchMove || d), this.touchEnd = ae(this.element, o.touchEnd || d), this.touchCancel = ae(this.element, o.touchCancel || d), this.translateContainer = this.element, this._cancelAllHandler = this.cancelAll.bind(this), window.addEventListener("scroll", this._cancelAllHandler), this.delta = null, this.last = null, this.now = null, this.tapTimeout = null, this.singleTapTimeout = null, this.longTapTimeout = null, this.swipeTimeout = null, this.x1 = this.x2 = this.y1 = this.y2 = null, this.preTapPosition = { x: null, y: null };
|
|
2458
2474
|
}, [{ key: "start", value: function(t) {
|
|
2459
2475
|
if (t.touches) if (t.target && t.target.nodeName && ["a", "button", "input"].indexOf(t.target.nodeName.toLowerCase()) >= 0) console.log("ignore drag for this touched element", t.target.nodeName.toLowerCase());
|
|
2460
2476
|
else {
|
|
@@ -2533,8 +2549,8 @@ var sa = { exports: {} };
|
|
|
2533
2549
|
}, touchMove: function(B) {
|
|
2534
2550
|
if (u && (Oe = B.targetTouches[0], !I && !U)) {
|
|
2535
2551
|
if (d && d.offsetHeight > b) {
|
|
2536
|
-
var
|
|
2537
|
-
if (Math.abs(
|
|
2552
|
+
var ce = pe.pageX - Oe.pageX;
|
|
2553
|
+
if (Math.abs(ce) <= 13) return !1;
|
|
2538
2554
|
}
|
|
2539
2555
|
k = !0;
|
|
2540
2556
|
var $e, it = B.targetTouches[0].clientX, Oa = B.targetTouches[0].clientY, Pa = Rt - it, za = Vt - Oa;
|
|
@@ -2544,8 +2560,8 @@ var sa = { exports: {} };
|
|
|
2544
2560
|
}, touchEnd: function() {
|
|
2545
2561
|
if (u) {
|
|
2546
2562
|
if (k = !1, U || I) return G = fe, void (_e = de);
|
|
2547
|
-
var B = Math.abs(parseInt(Re)),
|
|
2548
|
-
if (!(B > 29 && x)) return B < 29 &&
|
|
2563
|
+
var B = Math.abs(parseInt(Re)), ce = Math.abs(parseInt(ue));
|
|
2564
|
+
if (!(B > 29 && x)) return B < 29 && ce < 25 ? (T(ct, "greset"), ct.style.opacity = 1, yt(m)) : void 0;
|
|
2549
2565
|
t.close();
|
|
2550
2566
|
}
|
|
2551
2567
|
}, multipointEnd: function() {
|
|
@@ -2557,14 +2573,14 @@ var sa = { exports: {} };
|
|
|
2557
2573
|
}, pinch: function(B) {
|
|
2558
2574
|
if (!x || k) return !1;
|
|
2559
2575
|
I = !0, x.scaleX = x.scaleY = M * B.zoom;
|
|
2560
|
-
var
|
|
2561
|
-
if (U = !0,
|
|
2562
|
-
|
|
2576
|
+
var ce = M * B.zoom;
|
|
2577
|
+
if (U = !0, ce <= 1) return U = !1, ce = 1, _e = null, G = null, fe = null, de = null, void x.setAttribute("style", "");
|
|
2578
|
+
ce > 4.5 && (ce = 4.5), x.style.transform = "scale3d(".concat(ce, ", ").concat(ce, ", 1)"), E = ce;
|
|
2563
2579
|
}, pressMove: function(B) {
|
|
2564
2580
|
if (U && !I) {
|
|
2565
|
-
var
|
|
2566
|
-
G && (
|
|
2567
|
-
var it = "translate3d(".concat(
|
|
2581
|
+
var ce = Oe.pageX - pe.pageX, $e = Oe.pageY - pe.pageY;
|
|
2582
|
+
G && (ce += G), _e && ($e += _e), fe = ce, de = $e;
|
|
2583
|
+
var it = "translate3d(".concat(ce, "px, ").concat($e, "px, 0)");
|
|
2568
2584
|
E && (it += " scale3d(".concat(E, ", ").concat(E, ", 1)")), C(x, it);
|
|
2569
2585
|
}
|
|
2570
2586
|
}, swipe: function(B) {
|
|
@@ -2959,7 +2975,7 @@ var $c = Object.defineProperty, Mc = Object.getOwnPropertyDescriptor, oa = (c, e
|
|
|
2959
2975
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
2960
2976
|
return n && s && $c(e, a, s), s;
|
|
2961
2977
|
};
|
|
2962
|
-
let rt = class extends
|
|
2978
|
+
let rt = class extends te {
|
|
2963
2979
|
constructor() {
|
|
2964
2980
|
super(...arguments), this.files = [];
|
|
2965
2981
|
}
|
|
@@ -3094,7 +3110,7 @@ const Nt = {
|
|
|
3094
3110
|
doc: zc,
|
|
3095
3111
|
docx: jc
|
|
3096
3112
|
};
|
|
3097
|
-
let Je = class extends
|
|
3113
|
+
let Je = class extends te {
|
|
3098
3114
|
constructor() {
|
|
3099
3115
|
super(...arguments), this.filename = "", this.url = "";
|
|
3100
3116
|
}
|
|
@@ -4609,7 +4625,7 @@ var Nc = Object.defineProperty, Uc = Object.getOwnPropertyDescriptor, Ne = (c, e
|
|
|
4609
4625
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
4610
4626
|
return n && s && Nc(e, a, s), s;
|
|
4611
4627
|
};
|
|
4612
|
-
let Te = class extends
|
|
4628
|
+
let Te = class extends te {
|
|
4613
4629
|
constructor() {
|
|
4614
4630
|
super(...arguments), this.store = new pt(this, p), this.type = "assistant", this.suppressFeedback = !1, this.lightbox = kc({
|
|
4615
4631
|
touchNavigation: !0,
|
|
@@ -4692,12 +4708,12 @@ let Te = class extends ae {
|
|
|
4692
4708
|
});
|
|
4693
4709
|
}
|
|
4694
4710
|
render() {
|
|
4695
|
-
return
|
|
4711
|
+
return ie(
|
|
4696
4712
|
this.message.data || this.message.isThinking,
|
|
4697
4713
|
() => g`
|
|
4698
4714
|
<div class="cb-message-row" part="bot-message">
|
|
4699
4715
|
<!-- message -->
|
|
4700
|
-
${
|
|
4716
|
+
${ie(
|
|
4701
4717
|
this._isBot,
|
|
4702
4718
|
() => this.renderBotMessage(this.message),
|
|
4703
4719
|
() => this.renderUserMessage(this.message)
|
|
@@ -4730,12 +4746,12 @@ let Te = class extends ae {
|
|
|
4730
4746
|
`;
|
|
4731
4747
|
}
|
|
4732
4748
|
async _getMessageText(c) {
|
|
4733
|
-
return
|
|
4749
|
+
return Yt(c.data.text);
|
|
4734
4750
|
}
|
|
4735
4751
|
renderMessageContent(c) {
|
|
4736
4752
|
var e;
|
|
4737
4753
|
return c.isThinking ? g`<cb-thinking></cb-thinking>` : c.isUploading ? g`<cb-uploading .files="${c.data.files || []}"></cb-uploading>` : c.type === "text" ? g`<div class="cb-message-text">
|
|
4738
|
-
${
|
|
4754
|
+
${ie(
|
|
4739
4755
|
c.data.userName,
|
|
4740
4756
|
() => g`<div class="assistant-message-user-name">${c.data.userName}</div>`,
|
|
4741
4757
|
() => null
|
|
@@ -4771,9 +4787,9 @@ let Te = class extends ae {
|
|
|
4771
4787
|
var e;
|
|
4772
4788
|
if (c.data.userName && c.data.userName !== "") {
|
|
4773
4789
|
const a = ((e = c.data) == null ? void 0 : e.userAvatar) || "";
|
|
4774
|
-
return a !== "" ? g` <img src="${a}" style="width: 24px;height: 24px;" /> ` :
|
|
4790
|
+
return a !== "" ? g` <img src="${a}" style="width: 24px;height: 24px;" /> ` : le`${W(p.setting.agentIconSvg)}`;
|
|
4775
4791
|
}
|
|
4776
|
-
return c.author === "system" ?
|
|
4792
|
+
return c.author === "system" ? le`${W(p.setting.systemIconSvg)}` : le`${W(p.setting.botIconSvg)}`;
|
|
4777
4793
|
}
|
|
4778
4794
|
renderBotMessage(c) {
|
|
4779
4795
|
return g`
|
|
@@ -4787,8 +4803,8 @@ let Te = class extends ae {
|
|
|
4787
4803
|
renderBotMessageFeedback(c) {
|
|
4788
4804
|
return this.suppressFeedback || !p.setting.feedbackEnabled ? null : g`
|
|
4789
4805
|
<div class="cb-message-feedback-tools">
|
|
4790
|
-
<div class="cb-message-feedback-icon cb-feedback-up" @click="${() => this.startFeedback(!0, c)}">${
|
|
4791
|
-
<div class="cb-message-feedback-icon cb-feedback-down" @click="${() => this.startFeedback(!1, c)}">${
|
|
4806
|
+
<div class="cb-message-feedback-icon cb-feedback-up" @click="${() => this.startFeedback(!0, c)}">${le`${W(ra)}`}</div>
|
|
4807
|
+
<div class="cb-message-feedback-icon cb-feedback-down" @click="${() => this.startFeedback(!1, c)}">${le`${W(da)}`}</div>
|
|
4792
4808
|
</div>
|
|
4793
4809
|
`;
|
|
4794
4810
|
}
|
|
@@ -4802,7 +4818,7 @@ let Te = class extends ae {
|
|
|
4802
4818
|
<cb-icon slot="icon" svg="${Ut}" color="white"></cb-icon>
|
|
4803
4819
|
//appState.appearanceUserMessageAvatarPosition
|
|
4804
4820
|
</sl-avatar>-->
|
|
4805
|
-
${
|
|
4821
|
+
${ie(
|
|
4806
4822
|
p.appearanceUserMessageAvatarPosition === "left",
|
|
4807
4823
|
() => g`
|
|
4808
4824
|
<div class="avatar user-avatar">${W(p.setting.userIconSvg)}</div>
|
|
@@ -4825,7 +4841,7 @@ let Te = class extends ae {
|
|
|
4825
4841
|
<cb-icon slot="icon" svg="${Ut}" color="white"></cb-icon>
|
|
4826
4842
|
//appState.appearanceUserMessageAvatarPosition
|
|
4827
4843
|
</sl-avatar>-->
|
|
4828
|
-
${
|
|
4844
|
+
${ie(
|
|
4829
4845
|
p.appearanceUserMessageAvatarPosition === "left",
|
|
4830
4846
|
() => g`
|
|
4831
4847
|
<div class="avatar user-avatar">${W(p.setting.userIconSvg)}</div>
|
|
@@ -4866,7 +4882,7 @@ var Wc = Object.defineProperty, Yc = Object.getOwnPropertyDescriptor, ye = (c, e
|
|
|
4866
4882
|
};
|
|
4867
4883
|
const we = Ke.noConflict();
|
|
4868
4884
|
we.setLevel("info");
|
|
4869
|
-
let
|
|
4885
|
+
let be = class extends te {
|
|
4870
4886
|
constructor() {
|
|
4871
4887
|
super(...arguments), this.messages = [], this.actions = [], this.form = null, this.suppressFeedback = !1, this.calendlyInjected = !1, this.activeCalendlyAction = -1, this.hubspotMeetingInjected = !1, this.activeHubspotMeetingAction = -1;
|
|
4872
4888
|
}
|
|
@@ -4936,7 +4952,7 @@ let le = class extends ae {
|
|
|
4936
4952
|
return a || n[0], g`<div class="cb-form-field">
|
|
4937
4953
|
<label class="cb-form-field-label"
|
|
4938
4954
|
>${c.title}
|
|
4939
|
-
${
|
|
4955
|
+
${ie(
|
|
4940
4956
|
e,
|
|
4941
4957
|
() => g`*`,
|
|
4942
4958
|
() => g``
|
|
@@ -5144,37 +5160,37 @@ let le = class extends ae {
|
|
|
5144
5160
|
`;
|
|
5145
5161
|
}
|
|
5146
5162
|
};
|
|
5147
|
-
|
|
5163
|
+
be.styles = wc;
|
|
5148
5164
|
ye([
|
|
5149
5165
|
v({ type: Array })
|
|
5150
|
-
],
|
|
5166
|
+
], be.prototype, "messages", 2);
|
|
5151
5167
|
ye([
|
|
5152
5168
|
v({ type: Array })
|
|
5153
|
-
],
|
|
5169
|
+
], be.prototype, "actions", 2);
|
|
5154
5170
|
ye([
|
|
5155
5171
|
v({ type: Object })
|
|
5156
|
-
],
|
|
5172
|
+
], be.prototype, "form", 2);
|
|
5157
5173
|
ye([
|
|
5158
5174
|
v({ type: Boolean })
|
|
5159
|
-
],
|
|
5175
|
+
], be.prototype, "suppressFeedback", 2);
|
|
5160
5176
|
ye([
|
|
5161
5177
|
ke("#cb-message-list-bottom-anchor")
|
|
5162
|
-
],
|
|
5178
|
+
], be.prototype, "_messageListBottomAnchor", 2);
|
|
5163
5179
|
ye([
|
|
5164
5180
|
ke(".cb-input-form")
|
|
5165
|
-
],
|
|
5181
|
+
], be.prototype, "_inputForm", 2);
|
|
5166
5182
|
ye([
|
|
5167
5183
|
Mt({ capture: !1, passive: !0 })
|
|
5168
|
-
],
|
|
5184
|
+
], be.prototype, "invokeLinkAction", 1);
|
|
5169
5185
|
ye([
|
|
5170
5186
|
Mt({ capture: !1, passive: !0 })
|
|
5171
|
-
],
|
|
5187
|
+
], be.prototype, "invokeCalendlyAction", 1);
|
|
5172
5188
|
ye([
|
|
5173
5189
|
Mt({ capture: !1, passive: !0 })
|
|
5174
|
-
],
|
|
5175
|
-
|
|
5190
|
+
], be.prototype, "invokeHubspotMeetingAction", 1);
|
|
5191
|
+
be = ye([
|
|
5176
5192
|
J("cb-message-list")
|
|
5177
|
-
],
|
|
5193
|
+
], be);
|
|
5178
5194
|
const Xc = X`
|
|
5179
5195
|
${me}
|
|
5180
5196
|
|
|
@@ -5223,7 +5239,7 @@ var Jc = Object.defineProperty, Kc = Object.getOwnPropertyDescriptor, Ce = (c, e
|
|
|
5223
5239
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5224
5240
|
return n && s && Jc(e, a, s), s;
|
|
5225
5241
|
};
|
|
5226
|
-
let he = class extends
|
|
5242
|
+
let he = class extends te {
|
|
5227
5243
|
constructor() {
|
|
5228
5244
|
super(...arguments), this.placeholder = "Type a message...", this.sendButtonLabel = "Send", this.enableFileUpload = !1, this.value = "", this.loading = !1, this.disabled = !1, this.currentKey = "";
|
|
5229
5245
|
}
|
|
@@ -5268,7 +5284,7 @@ let he = class extends ae {
|
|
|
5268
5284
|
}
|
|
5269
5285
|
render() {
|
|
5270
5286
|
return g`
|
|
5271
|
-
${
|
|
5287
|
+
${ie(
|
|
5272
5288
|
this.loading,
|
|
5273
5289
|
() => g`<sl-progress-bar style="--height: 2px;" indeterminate></sl-progress-bar>`,
|
|
5274
5290
|
() => g``
|
|
@@ -5294,7 +5310,7 @@ let he = class extends ae {
|
|
|
5294
5310
|
<sl-button @click=${this._sendHandler} name="send" label="Send" size="small" class="send-button" variant="text" ?disabled=${this.value.length === 0} ?loading=${this.loading} circle>
|
|
5295
5311
|
<cb-icon svg="${Gc}"></cb-icon>
|
|
5296
5312
|
</sl-button>
|
|
5297
|
-
${
|
|
5313
|
+
${ie(
|
|
5298
5314
|
this.enableFileUpload,
|
|
5299
5315
|
() => g`
|
|
5300
5316
|
<sl-button @click=${this._sendFileHandler} name="paperclip" label="Attachment" size="small" class="paperclip-button" variant="text" circle>
|
|
@@ -5381,7 +5397,7 @@ var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, gt = (c, e
|
|
|
5381
5397
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5382
5398
|
return n && s && ei(e, a, s), s;
|
|
5383
5399
|
};
|
|
5384
|
-
let Fe = class extends
|
|
5400
|
+
let Fe = class extends te {
|
|
5385
5401
|
constructor() {
|
|
5386
5402
|
super(...arguments), this.open = !1, this.label = "Dialog", this.zindex = 100;
|
|
5387
5403
|
}
|
|
@@ -5443,7 +5459,7 @@ var ai = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, la = (c, e
|
|
|
5443
5459
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5444
5460
|
return n && s && ai(e, a, s), s;
|
|
5445
5461
|
};
|
|
5446
|
-
let dt = class extends
|
|
5462
|
+
let dt = class extends te {
|
|
5447
5463
|
constructor() {
|
|
5448
5464
|
super(...arguments), this.open = !1;
|
|
5449
5465
|
}
|
|
@@ -5556,7 +5572,7 @@ var ni = Object.defineProperty, si = Object.getOwnPropertyDescriptor, Ue = (c, e
|
|
|
5556
5572
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5557
5573
|
return n && s && ni(e, a, s), s;
|
|
5558
5574
|
};
|
|
5559
|
-
let Ee = class extends
|
|
5575
|
+
let Ee = class extends te {
|
|
5560
5576
|
constructor() {
|
|
5561
5577
|
super(...arguments), this.open = !1, this.clearMessageDialogOpen = !1, this.customRequest = !1;
|
|
5562
5578
|
}
|
|
@@ -5589,7 +5605,7 @@ let Ee = class extends ae {
|
|
|
5589
5605
|
Enable it for your own backend.
|
|
5590
5606
|
</sl-switch>
|
|
5591
5607
|
</div> -->
|
|
5592
|
-
${
|
|
5608
|
+
${ie(
|
|
5593
5609
|
this.customRequest,
|
|
5594
5610
|
() => null,
|
|
5595
5611
|
() => this.renderInternalServices()
|
|
@@ -5814,7 +5830,7 @@ var ri = Object.defineProperty, di = Object.getOwnPropertyDescriptor, ba = (c, e
|
|
|
5814
5830
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5815
5831
|
return n && s && ri(e, a, s), s;
|
|
5816
5832
|
};
|
|
5817
|
-
let ft = class extends
|
|
5833
|
+
let ft = class extends te {
|
|
5818
5834
|
constructor() {
|
|
5819
5835
|
super(...arguments), this.store = new pt(this, p), this.open = !1;
|
|
5820
5836
|
}
|
|
@@ -5845,31 +5861,29 @@ let ft = class extends ae {
|
|
|
5845
5861
|
let c = "danger";
|
|
5846
5862
|
return c = p.appearanceAnchorBadgeVariant, c;
|
|
5847
5863
|
}
|
|
5864
|
+
renderPopupLogo() {
|
|
5865
|
+
return p.setting.popupLogoUrl !== "" ? g`<img class="cb-engage-popup-img" src="${p.setting.popupLogoUrl}" />` : p.setting.popupLogoSvg !== "" ? g`<div class="cb-engage-popup-logo">${le`${W(p.setting.popupLogoSvg)}`}</div>` : p.setting.logoUrl !== "" ? g`<img class="cb-engage-popup-img" src="${p.setting.logoUrl}" />` : p.setting.logoSvg !== "" ? g`<div class="cb-engage-popup-logo">${le`${W(p.setting.logoSvg)}`}</div>` : null;
|
|
5866
|
+
}
|
|
5848
5867
|
render() {
|
|
5849
5868
|
return g`
|
|
5850
5869
|
<div class="cb-anchor ${this.open ? "open" : ""}" part="anchor" @click=${this._clickHandler.bind(this)}>
|
|
5851
5870
|
<sl-popup placement="${this.getPopupPlacement()}" distance="16" ?active="${p.engage && !p.open}">
|
|
5852
5871
|
<sl-button slot="anchor" label="Start" size="large" variant="primary" class="anchor-button" circle>
|
|
5853
|
-
${
|
|
5872
|
+
${ie(
|
|
5854
5873
|
this.open,
|
|
5855
|
-
() => g`<div class="cb-anchor-icon" part="anchor-icon">${
|
|
5856
|
-
() => g`<div class="cb-anchor-icon" part="anchor-icon">${
|
|
5874
|
+
() => g`<div class="cb-anchor-icon" part="anchor-icon">${le`${W(p.setting.anchorCloseSvg)}`}</div>`,
|
|
5875
|
+
() => g`<div class="cb-anchor-icon" part="anchor-icon">${le`${W(p.setting.anchorOpenSvg)}`}</div>`
|
|
5857
5876
|
)}
|
|
5858
|
-
${
|
|
5877
|
+
${ie(
|
|
5859
5878
|
!this.open && p.unreadMessages > 0,
|
|
5860
5879
|
() => g`<sl-badge part="anchor-badge" class="cb-anchor-badge" variant="${this.getBadgeVariant()}" pill>${p.unreadMessages}</sl-badge>`,
|
|
5861
5880
|
() => null
|
|
5862
5881
|
)}
|
|
5863
5882
|
</sl-button>
|
|
5864
5883
|
<div class="cb-engage-popup">
|
|
5865
|
-
<div class="cb-engage-popup-close" @click=${this._engageClickHandler.bind(this)}>${
|
|
5884
|
+
<div class="cb-engage-popup-close" @click=${this._engageClickHandler.bind(this)}>${le`${W(fa)}`}</div>
|
|
5866
5885
|
<div class="cb-engage-popup-content">
|
|
5867
|
-
${
|
|
5868
|
-
p.setting.logoUrl !== "",
|
|
5869
|
-
() => g`<img class="cb-engage-popup-img" src="${p.setting.logoUrl}" />`,
|
|
5870
|
-
() => g`<div class="cb-engage-popup-logo">${be`${W(p.setting.logoSvg)}`}</div>`
|
|
5871
|
-
)}
|
|
5872
|
-
<!--<cb-icon class="cb-engage-popup-logo" svg="${p.setting.logoSvg}"></cb-icon>-->
|
|
5886
|
+
${this.renderPopupLogo()}
|
|
5873
5887
|
<div>${p.setting.engageMessage}</div>
|
|
5874
5888
|
</div>
|
|
5875
5889
|
</div>
|
|
@@ -5915,7 +5929,7 @@ const Gt = {
|
|
|
5915
5929
|
icon: hi
|
|
5916
5930
|
}
|
|
5917
5931
|
};
|
|
5918
|
-
let lt = class extends
|
|
5932
|
+
let lt = class extends te {
|
|
5919
5933
|
constructor() {
|
|
5920
5934
|
super(...arguments), this.status = "info";
|
|
5921
5935
|
}
|
|
@@ -5936,7 +5950,7 @@ var gi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, yi = (c, e
|
|
|
5936
5950
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5937
5951
|
return n && s && gi(e, a, s), s;
|
|
5938
5952
|
};
|
|
5939
|
-
let _t = class extends
|
|
5953
|
+
let _t = class extends te {
|
|
5940
5954
|
render() {
|
|
5941
5955
|
return g` <sl-alert variant="danger" open>
|
|
5942
5956
|
<cb-status-icon status="error" slot="icon"></cb-status-icon>
|
|
@@ -6036,7 +6050,7 @@ var wi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, We = (c, e
|
|
|
6036
6050
|
return n && s && wi(e, a, s), s;
|
|
6037
6051
|
};
|
|
6038
6052
|
const Zt = Ke.noConflict(), ki = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16"><path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/></svg>';
|
|
6039
|
-
let Ae = class extends
|
|
6053
|
+
let Ae = class extends te {
|
|
6040
6054
|
constructor() {
|
|
6041
6055
|
super(...arguments), this.store = new pt(this, p), this.zindex = 100;
|
|
6042
6056
|
}
|
|
@@ -6069,7 +6083,7 @@ let Ae = class extends ae {
|
|
|
6069
6083
|
p.feedbackScore = 0;
|
|
6070
6084
|
}}"
|
|
6071
6085
|
>
|
|
6072
|
-
${
|
|
6086
|
+
${le`${W(da)}`}
|
|
6073
6087
|
</div>
|
|
6074
6088
|
<sl-rating id="cb-feedback-rating-el" class="cb-feedback-rating" @sl-change="${this._ratingChangeHandler}" label="Rating" precision="1" .value=${p.feedbackScore}></sl-rating>
|
|
6075
6089
|
<div
|
|
@@ -6078,7 +6092,7 @@ let Ae = class extends ae {
|
|
|
6078
6092
|
p.feedbackScore = 5;
|
|
6079
6093
|
}}"
|
|
6080
6094
|
>
|
|
6081
|
-
${
|
|
6095
|
+
${le`${W(ra)}`}
|
|
6082
6096
|
</div>
|
|
6083
6097
|
</div>
|
|
6084
6098
|
<div style="display: flex">
|
|
@@ -6484,7 +6498,7 @@ var Ri = Object.defineProperty, Vi = Object.getOwnPropertyDescriptor, H = (c, e,
|
|
|
6484
6498
|
};
|
|
6485
6499
|
const Me = Ke.noConflict();
|
|
6486
6500
|
Me.setLevel("info");
|
|
6487
|
-
let j = class extends
|
|
6501
|
+
let j = class extends te {
|
|
6488
6502
|
constructor() {
|
|
6489
6503
|
super(...arguments), this.store = new pt(this, p), this.displayLicense = !1, this.name = "ChatBot", this.orgId = "", this.botId = "", this.url = "ws://localhost:3070", this.logoUrl = "", this.logoSvg = `<svg width="34" height="34" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6490
6504
|
<g clip-path="url(#clip0_830_887)">
|
|
@@ -6516,6 +6530,10 @@ let j = class extends ae {
|
|
|
6516
6530
|
this._addMessageHandler(c);
|
|
6517
6531
|
}, this.handleStateEvent = (c) => {
|
|
6518
6532
|
this._stateEventHandler(c);
|
|
6533
|
+
}, this.handleToggleEvent = (c) => {
|
|
6534
|
+
this._chatbotToggleHandler(c);
|
|
6535
|
+
}, this.handleFormSubmitEvent = (c) => {
|
|
6536
|
+
this._formSubmitHandler(c);
|
|
6519
6537
|
}, this.fetchStream = Bi;
|
|
6520
6538
|
}
|
|
6521
6539
|
/**
|
|
@@ -6570,14 +6588,15 @@ let j = class extends ae {
|
|
|
6570
6588
|
}
|
|
6571
6589
|
renderUserInput() {
|
|
6572
6590
|
return p.form || p.disabled && this.alwaysOpen ? null : g`<cb-user-input
|
|
6591
|
+
part="user-input-control"
|
|
6573
6592
|
?loading=${p.connecting}
|
|
6574
6593
|
?disabled=${p.connecting || p.form}
|
|
6575
6594
|
?enable-file-upload=${p.setting.uploadImages && p.connected}
|
|
6576
|
-
exportparts="user-input, user-input-wrapper, user-input-base, user-input-textarea"
|
|
6595
|
+
exportparts="user-input-control,user-input, user-input-wrapper, user-input-base, user-input-textarea"
|
|
6577
6596
|
></cb-user-input>`;
|
|
6578
6597
|
}
|
|
6579
6598
|
connectedCallback() {
|
|
6580
|
-
super.connectedCallback(), Me.info("connectedCallback"), this.initCssVariables(), addEventListener("c7o:bot:stateEvent", this.handleStateEvent), addEventListener("message:send", this.handleAddMessage), addEventListener("chatbot:toggle", this.
|
|
6599
|
+
super.connectedCallback(), Me.info("connectedCallback"), this.initCssVariables(), addEventListener("c7o:bot:stateEvent", this.handleStateEvent), addEventListener("message:send", this.handleAddMessage), addEventListener("chatbot:toggle", this.handleToggleEvent), addEventListener("form:submit", this.handleFormSubmitEvent), addEventListener("message:send:file", this._uploadFileHandler);
|
|
6581
6600
|
}
|
|
6582
6601
|
extractCssVariable(c, e, a) {
|
|
6583
6602
|
let n = c.getPropertyValue(e).trim();
|
|
@@ -6606,7 +6625,7 @@ let j = class extends ae {
|
|
|
6606
6625
|
|
|
6607
6626
|
*/
|
|
6608
6627
|
disconnectedCallback() {
|
|
6609
|
-
Me.info("disconnectedCallback"), super.disconnectedCallback(), window.removeEventListener("c7o:bot:stateEvent", this.handleStateEvent), window.removeEventListener("message:send", this.handleAddMessage), window.removeEventListener("chatbot:toggle", this.
|
|
6628
|
+
Me.info("disconnectedCallback"), super.disconnectedCallback(), window.removeEventListener("c7o:bot:stateEvent", this.handleStateEvent), window.removeEventListener("message:send", this.handleAddMessage), window.removeEventListener("chatbot:toggle", this.handleToggleEvent), window.removeEventListener("form:submit", this.handleFormSubmitEvent), window.removeEventListener("message:send:file", this._uploadFileHandler);
|
|
6610
6629
|
}
|
|
6611
6630
|
// This is called when component is loaded, with all the settings (props) values
|
|
6612
6631
|
// Use to initialize
|
|
@@ -6714,13 +6733,13 @@ let j = class extends ae {
|
|
|
6714
6733
|
console.log("_addMessageHandler: input text is empty, ignored", c);
|
|
6715
6734
|
return;
|
|
6716
6735
|
}
|
|
6717
|
-
p.isConversationStart() && (console.log("Start of conversation detected, emitting c7o:bot:conversationStart"), this.emit("c7o:bot:conversationStart", {
|
|
6736
|
+
p.isConversationStart() && (console.log("Start of conversation detected, emitting c7o:bot:conversationStart"), e.conversationId = p.conversationId, this.emit("c7o:bot:conversationStart", {
|
|
6718
6737
|
detail: e
|
|
6719
6738
|
})), p.sendMessage(e);
|
|
6720
6739
|
}
|
|
6721
6740
|
_chatbotToggleHandler(c) {
|
|
6722
6741
|
const e = c.detail;
|
|
6723
|
-
p.open = e.open, p.unreadMessages = 0, p.suppressEngagePopup();
|
|
6742
|
+
p.open = e.open, this.emit(e.open ? "c7o:bot:open" : "c7o:bot:close"), p.unreadMessages = 0, p.suppressEngagePopup();
|
|
6724
6743
|
}
|
|
6725
6744
|
_deleteMessageHandler(c) {
|
|
6726
6745
|
const e = c.detail;
|
|
@@ -6735,7 +6754,11 @@ let j = class extends ae {
|
|
|
6735
6754
|
const e = c.detail;
|
|
6736
6755
|
p.setSetting(e.setting), this.showSetting = !1, this._checkAuth();
|
|
6737
6756
|
}
|
|
6738
|
-
|
|
6757
|
+
_formSubmitHandler(c) {
|
|
6758
|
+
const e = c.detail;
|
|
6759
|
+
e.conversationId = p.conversationId, this.emit("c7o:bot:formSubmit", {
|
|
6760
|
+
detail: e
|
|
6761
|
+
});
|
|
6739
6762
|
}
|
|
6740
6763
|
// scroll to bottom
|
|
6741
6764
|
_scrollToBottom(c = !1) {
|