@enegelai/bot-widget 1.2.6 → 1.2.9
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 +3 -0
- package/dist/enegelaibot.umd.js +116 -108
- package/dist/index.es.js +158 -145
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -25,7 +25,7 @@ import { repeat as we } from "lit/directives/repeat.js";
|
|
|
25
25
|
import { when as D } from "lit/directives/when.js";
|
|
26
26
|
import { until as Ie } from "lit-html/directives/until.js";
|
|
27
27
|
import hc from "markdown-it";
|
|
28
|
-
import
|
|
28
|
+
import gc from "markdown-it-link-attributes";
|
|
29
29
|
import "@shoelace-style/shoelace/dist/components/popup/popup.js";
|
|
30
30
|
function De(c) {
|
|
31
31
|
return typeof c == "function" ? c() : c;
|
|
@@ -47,8 +47,8 @@ const ne = class ne extends Event {
|
|
|
47
47
|
};
|
|
48
48
|
j(ne, "eventName", "lit-state-changed");
|
|
49
49
|
let R = ne;
|
|
50
|
-
const
|
|
51
|
-
class
|
|
50
|
+
const uc = (c, e) => e !== c && (e === e || c === c);
|
|
51
|
+
class Q extends EventTarget {
|
|
52
52
|
constructor() {
|
|
53
53
|
super();
|
|
54
54
|
// hold a reference to hooks
|
|
@@ -81,7 +81,7 @@ class X extends EventTarget {
|
|
|
81
81
|
Object.defineProperty(this.prototype, a, o);
|
|
82
82
|
}
|
|
83
83
|
static getPropertyDescriptor(a, f, t) {
|
|
84
|
-
const o = (t == null ? void 0 : t.hasChanged) ||
|
|
84
|
+
const o = (t == null ? void 0 : t.hasChanged) || uc;
|
|
85
85
|
return {
|
|
86
86
|
get() {
|
|
87
87
|
return this[f];
|
|
@@ -123,8 +123,8 @@ class X extends EventTarget {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
// a map holding decorators definition.
|
|
126
|
-
j(
|
|
127
|
-
class
|
|
126
|
+
j(Q, "propertyMap"), j(Q, "properties"), j(Q, "finalized", !1);
|
|
127
|
+
class Ue {
|
|
128
128
|
constructor(e, a, f) {
|
|
129
129
|
j(this, "host");
|
|
130
130
|
j(this, "state");
|
|
@@ -143,7 +143,7 @@ class Fe {
|
|
|
143
143
|
* Copyright 2017 Google LLC
|
|
144
144
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
145
145
|
*/
|
|
146
|
-
const
|
|
146
|
+
const Fe = ({ finisher: c, descriptor: e }) => (a, f) => {
|
|
147
147
|
var t;
|
|
148
148
|
if (f === void 0) {
|
|
149
149
|
const o = (t = a.originalKey) !== null && t !== void 0 ? t : a.key, d = e != null ? { kind: "method", placement: "prototype", key: o, descriptor: e(a.key) } : { ...a, key: o };
|
|
@@ -157,7 +157,7 @@ const Ue = ({ finisher: c, descriptor: e }) => (a, f) => {
|
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
159
|
function O(c) {
|
|
160
|
-
return
|
|
160
|
+
return Fe({
|
|
161
161
|
// @ts-ignore ctor is typof State and not typeof ReactiveElement
|
|
162
162
|
finisher: (e, a) => {
|
|
163
163
|
if (Object.getOwnPropertyDescriptor(e.prototype, a))
|
|
@@ -180,7 +180,7 @@ const yc = {
|
|
|
180
180
|
prefix: "_ls"
|
|
181
181
|
};
|
|
182
182
|
function V(c) {
|
|
183
|
-
return c = { ...yc, ...c },
|
|
183
|
+
return c = { ...yc, ...c }, Fe({
|
|
184
184
|
// @ts-ignore ctor is typof State and not typeof ReactiveElement
|
|
185
185
|
finisher: (e, a) => {
|
|
186
186
|
const f = Object.getOwnPropertyDescriptor(e.prototype, a);
|
|
@@ -191,13 +191,13 @@ function V(c) {
|
|
|
191
191
|
const m = o.initialValue;
|
|
192
192
|
o.initialValue = () => mc(localStorage.getItem(t), d) ?? De(m), e.propertyMap.set(a, { ...o, ...c });
|
|
193
193
|
}
|
|
194
|
-
const b = f == null ? void 0 : f.set,
|
|
194
|
+
const b = f == null ? void 0 : f.set, u = {
|
|
195
195
|
...f,
|
|
196
196
|
set: function(m) {
|
|
197
197
|
m !== void 0 && localStorage.setItem(t, d === Object || d === Array ? JSON.stringify(m) : m), b && b.call(this, m);
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
|
-
Object.defineProperty(e.prototype, a,
|
|
200
|
+
Object.defineProperty(e.prototype, a, u);
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
}
|
|
@@ -243,15 +243,15 @@ var Ze = { exports: {} };
|
|
|
243
243
|
}
|
|
244
244
|
this.log = this.debug;
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function u(p, y, w) {
|
|
247
247
|
return function() {
|
|
248
248
|
typeof console !== a && (h.call(this, y, w), this[p].apply(this, arguments));
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
251
|
function m(p, y, w) {
|
|
252
|
-
return b(p) ||
|
|
252
|
+
return b(p) || u.apply(this, arguments);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function ue(p, y, w) {
|
|
255
255
|
var l = this, Oe;
|
|
256
256
|
y = y ?? "WARN";
|
|
257
257
|
var A = "loglevel";
|
|
@@ -279,10 +279,10 @@ var Ze = { exports: {} };
|
|
|
279
279
|
}
|
|
280
280
|
if (typeof i === a)
|
|
281
281
|
try {
|
|
282
|
-
var T = window.document.cookie,
|
|
282
|
+
var T = window.document.cookie, G = T.indexOf(
|
|
283
283
|
encodeURIComponent(A) + "="
|
|
284
284
|
);
|
|
285
|
-
|
|
285
|
+
G !== -1 && (i = /^([^;]+)/.exec(T.slice(G))[1]);
|
|
286
286
|
} catch {
|
|
287
287
|
}
|
|
288
288
|
return l.levels[i] === void 0 && (i = void 0), i;
|
|
@@ -328,12 +328,12 @@ var Ze = { exports: {} };
|
|
|
328
328
|
var ye = He();
|
|
329
329
|
ye == null && (ye = y), l.setLevel(ye, !1);
|
|
330
330
|
}
|
|
331
|
-
var S = new
|
|
331
|
+
var S = new ue(), me = {};
|
|
332
332
|
S.getLogger = function(y) {
|
|
333
333
|
if (typeof y != "symbol" && typeof y != "string" || y === "")
|
|
334
334
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
335
335
|
var w = me[y];
|
|
336
|
-
return w || (w = me[y] = new
|
|
336
|
+
return w || (w = me[y] = new ue(
|
|
337
337
|
y,
|
|
338
338
|
S.getLevel(),
|
|
339
339
|
S.methodFactory
|
|
@@ -362,8 +362,8 @@ const pe = /* @__PURE__ */ wc(xc), kc = x`
|
|
|
362
362
|
box-sizing: border-box;
|
|
363
363
|
border-radius: 6px;
|
|
364
364
|
|
|
365
|
-
height: calc(100% -
|
|
366
|
-
max-height:
|
|
365
|
+
height: calc(100% - var(--enegelai-bot-height-top-margin, 220px));
|
|
366
|
+
max-height: var(--enegelai-bot-max-height, 600px);
|
|
367
367
|
position: fixed;
|
|
368
368
|
right: 25px;
|
|
369
369
|
bottom: 100px;
|
|
@@ -405,11 +405,11 @@ const pe = /* @__PURE__ */ wc(xc), kc = x`
|
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
@media (max-width:
|
|
408
|
+
@media (max-width: 640px) {
|
|
409
409
|
.cb-wrapper {
|
|
410
410
|
width: 100%;
|
|
411
|
-
height: 100
|
|
412
|
-
max-height: 100
|
|
411
|
+
height: calc(100% - var(--enegelai-bot-height-top-margin-sm, 100px));
|
|
412
|
+
max-height: var(--enegelai-bot-max-height, 100%);
|
|
413
413
|
right: 0;
|
|
414
414
|
bottom: 0;
|
|
415
415
|
border-radius: 0;
|
|
@@ -510,26 +510,24 @@ var _c = Object.defineProperty, Cc = Object.getOwnPropertyDescriptor, Me = (c, e
|
|
|
510
510
|
(d = c[o]) && (t = (f ? d(e, a, t) : d(t)) || t);
|
|
511
511
|
return f && t && _c(e, a, t), t;
|
|
512
512
|
};
|
|
513
|
-
let
|
|
513
|
+
let K = class extends ie {
|
|
514
514
|
constructor() {
|
|
515
515
|
super(...arguments), this.color = "primary", this.svg = "";
|
|
516
516
|
}
|
|
517
517
|
render() {
|
|
518
|
-
return s`<span class="cb-icon
|
|
519
|
-
>${B(this.svg)}</span
|
|
520
|
-
>`;
|
|
518
|
+
return s`<span class="cb-icon" part="base">${B(this.svg)}</span>`;
|
|
521
519
|
}
|
|
522
520
|
};
|
|
523
|
-
|
|
521
|
+
K.styles = Ne;
|
|
524
522
|
Me([
|
|
525
523
|
r({ type: String })
|
|
526
|
-
],
|
|
524
|
+
], K.prototype, "color", 2);
|
|
527
525
|
Me([
|
|
528
526
|
r({ type: String })
|
|
529
|
-
],
|
|
530
|
-
|
|
527
|
+
], K.prototype, "svg", 2);
|
|
528
|
+
K = Me([
|
|
531
529
|
k("cb-icon")
|
|
532
|
-
],
|
|
530
|
+
], K);
|
|
533
531
|
let $c = (c) => crypto.getRandomValues(new Uint8Array(c)), jc = (c, e, a) => {
|
|
534
532
|
let f = (2 << Math.log(c.length - 1) / Math.LN2) - 1, t = -~(1.6 * f * e / c.length);
|
|
535
533
|
return (o = e) => {
|
|
@@ -685,7 +683,7 @@ var Ic = Object.defineProperty, Pc = Object.getOwnPropertyDescriptor, H = (c, e,
|
|
|
685
683
|
const $ = pe.noConflict();
|
|
686
684
|
$.setLevel("info");
|
|
687
685
|
const q = "cb_";
|
|
688
|
-
class M extends
|
|
686
|
+
class M extends Q {
|
|
689
687
|
constructor() {
|
|
690
688
|
super(...arguments), this.actionIdCounter = 0, this.wsClient = null, this.replyMessage = null;
|
|
691
689
|
}
|
|
@@ -732,7 +730,7 @@ class M extends X {
|
|
|
732
730
|
$.error("No bot settings available - bot disabled"), this.disabled = !0;
|
|
733
731
|
return;
|
|
734
732
|
}
|
|
735
|
-
this.setting.welcomeMessage = (t == null ? void 0 : t.welcomeMessage) || "How can I help ?", this.setting.engageMessage = (t == null ? void 0 : t.engageMessage) || "How can I help ?", this.setting.engageTimeout = (t == null ? void 0 : t.engageTimeout) || 5, setTimeout(() => {
|
|
733
|
+
$.info("Got bot settings - bot is enabled", t), this.disabled = !1, this.setting.welcomeMessage = (t == null ? void 0 : t.welcomeMessage) || "How can I help ?", this.setting.engageMessage = (t == null ? void 0 : t.engageMessage) || "How can I help ?", this.setting.engageTimeout = (t == null ? void 0 : t.engageTimeout) || 5, setTimeout(() => {
|
|
736
734
|
this.showEngagePopup();
|
|
737
735
|
}, this.setting.engageTimeout * 1e3);
|
|
738
736
|
}
|
|
@@ -947,7 +945,7 @@ H([
|
|
|
947
945
|
O({ type: Boolean, value: !1 })
|
|
948
946
|
], M.prototype, "botSettingsInitialized", 2);
|
|
949
947
|
H([
|
|
950
|
-
O({ type: Boolean, value: !
|
|
948
|
+
O({ type: Boolean, value: !0 })
|
|
951
949
|
], M.prototype, "disabled", 2);
|
|
952
950
|
H([
|
|
953
951
|
O({ type: Boolean, value: !1 })
|
|
@@ -975,7 +973,7 @@ const n = new M(), Ec = x`
|
|
|
975
973
|
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
|
|
976
974
|
width: 100%;
|
|
977
975
|
text-align: left;
|
|
978
|
-
color: rgba(255, 255, 255, 1);
|
|
976
|
+
color: var(--enegelai-bot-header-color, rgba(255, 255, 255, 1));
|
|
979
977
|
border-radius-top-left: 6px;
|
|
980
978
|
border-radius-top-right: 6px;
|
|
981
979
|
top: 0;
|
|
@@ -1003,7 +1001,15 @@ const n = new M(), Ec = x`
|
|
|
1003
1001
|
|
|
1004
1002
|
.cb-setting-button {
|
|
1005
1003
|
font-size: 1.5rem;
|
|
1006
|
-
color:
|
|
1004
|
+
color: var(--enegelai-bot-header-color, rgba(255, 255, 255, 1));
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
.cb-header-logo {
|
|
1008
|
+
color: var(--enegelai-bot-header-color, rgba(255, 255, 255, 1));
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.cb-header-close {
|
|
1012
|
+
color: var(--enegelai-bot-header-color, rgba(255, 255, 255, 1));
|
|
1007
1013
|
}
|
|
1008
1014
|
|
|
1009
1015
|
.cb-setting-button cb-icon {
|
|
@@ -1043,17 +1049,22 @@ let fe = class extends C {
|
|
|
1043
1049
|
constructor() {
|
|
1044
1050
|
super(...arguments), this.title = "ChatBot";
|
|
1045
1051
|
}
|
|
1052
|
+
/*
|
|
1053
|
+
createRenderRoot() {
|
|
1054
|
+
return this; //Render template without shadow DOM
|
|
1055
|
+
}
|
|
1056
|
+
*/
|
|
1046
1057
|
render() {
|
|
1047
1058
|
return s` <header class="cb-header" part="header">
|
|
1048
1059
|
<span class="left">
|
|
1049
|
-
<sl-button
|
|
1050
|
-
<cb-icon
|
|
1060
|
+
<sl-button class="cb-setting-button" variant="text" circle>
|
|
1061
|
+
<cb-icon class="cb-header-logo" svg="${n.setting.logoSvg}"></cb-icon>
|
|
1051
1062
|
</sl-button>
|
|
1052
1063
|
</span>
|
|
1053
1064
|
<span class="center title">${this.title}</span>
|
|
1054
1065
|
<span class="right">
|
|
1055
1066
|
<sl-button @click=${this._clickCloseHandler} class="cb-setting-button" variant="text" circle>
|
|
1056
|
-
<cb-icon
|
|
1067
|
+
<cb-icon class="cb-header-close" svg="${te}"></cb-icon>
|
|
1057
1068
|
</sl-button>
|
|
1058
1069
|
</span>
|
|
1059
1070
|
</header>`;
|
|
@@ -1091,8 +1102,8 @@ const qc = x`
|
|
|
1091
1102
|
color: var(--primary-color);
|
|
1092
1103
|
}
|
|
1093
1104
|
`;
|
|
1094
|
-
var Dc = Object.defineProperty,
|
|
1095
|
-
for (var t = f > 1 ? void 0 : f ?
|
|
1105
|
+
var Dc = Object.defineProperty, Uc = Object.getOwnPropertyDescriptor, Fc = (c, e, a, f) => {
|
|
1106
|
+
for (var t = f > 1 ? void 0 : f ? Uc(e, a) : e, o = c.length - 1, d; o >= 0; o--)
|
|
1096
1107
|
(d = c[o]) && (t = (f ? d(e, a, t) : d(t)) || t);
|
|
1097
1108
|
return f && t && Dc(e, a, t), t;
|
|
1098
1109
|
};
|
|
@@ -1132,7 +1143,7 @@ let ke = class extends C {
|
|
|
1132
1143
|
}
|
|
1133
1144
|
};
|
|
1134
1145
|
ke.styles = qc;
|
|
1135
|
-
ke =
|
|
1146
|
+
ke = Fc([
|
|
1136
1147
|
k("cb-footer")
|
|
1137
1148
|
], ke);
|
|
1138
1149
|
const Zc = x`
|
|
@@ -1354,7 +1365,7 @@ var Xc = Object.defineProperty, Qc = Object.getOwnPropertyDescriptor, Se = (c, e
|
|
|
1354
1365
|
(d = c[o]) && (t = (f ? d(e, a, t) : d(t)) || t);
|
|
1355
1366
|
return f && t && Xc(e, a, t), t;
|
|
1356
1367
|
};
|
|
1357
|
-
let
|
|
1368
|
+
let J = class extends ie {
|
|
1358
1369
|
constructor() {
|
|
1359
1370
|
super(...arguments), this.url = "", this.inverse = !1;
|
|
1360
1371
|
}
|
|
@@ -1374,7 +1385,7 @@ let K = class extends ie {
|
|
|
1374
1385
|
`;
|
|
1375
1386
|
}
|
|
1376
1387
|
};
|
|
1377
|
-
|
|
1388
|
+
J.styles = x`
|
|
1378
1389
|
:host {
|
|
1379
1390
|
--primary-color: var(--sl-color-primary-600);
|
|
1380
1391
|
}
|
|
@@ -1401,13 +1412,13 @@ K.styles = x`
|
|
|
1401
1412
|
`;
|
|
1402
1413
|
Se([
|
|
1403
1414
|
r({ type: String })
|
|
1404
|
-
],
|
|
1415
|
+
], J.prototype, "url", 2);
|
|
1405
1416
|
Se([
|
|
1406
1417
|
r({ type: Boolean })
|
|
1407
|
-
],
|
|
1408
|
-
|
|
1418
|
+
], J.prototype, "inverse", 2);
|
|
1419
|
+
J = Se([
|
|
1409
1420
|
k("cb-external-link")
|
|
1410
|
-
],
|
|
1421
|
+
], J);
|
|
1411
1422
|
const ea = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-2v-1h2a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM1.928 15.849v-3.337h1.136v-.662H0v.662h1.134v3.337h.794Zm4.689-3.999h-.894L4.9 13.289h-.035l-.832-1.439h-.932l1.228 1.983l-1.24 2.016h.862l.853-1.415h.035l.85 1.415h.907l-1.253-1.992l1.274-2.007Zm1.93.662v3.337h-.794v-3.337H6.619v-.662h3.064v.662H8.546Z"/></svg>', ca = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM1.6 11.85H0v3.999h.791v-1.342h.803c.287 0 .531-.057.732-.173c.203-.117.358-.275.463-.474a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.476-.158-.677a1.176 1.176 0 0 0-.46-.477c-.2-.12-.443-.179-.732-.179Zm.545 1.333a.795.795 0 0 1-.085.38a.574.574 0 0 1-.238.241a.794.794 0 0 1-.375.082H.788V12.48h.66c.218 0 .389.06.512.181c.123.122.185.296.185.522Zm1.217-1.333v3.999h1.46c.401 0 .734-.08.998-.237a1.45 1.45 0 0 0 .595-.689c.13-.3.196-.662.196-1.084c0-.42-.065-.778-.196-1.075a1.426 1.426 0 0 0-.589-.68c-.264-.156-.599-.234-1.005-.234H3.362Zm.791.645h.563c.248 0 .45.05.609.152a.89.89 0 0 1 .354.454c.079.201.118.452.118.753a2.3 2.3 0 0 1-.068.592a1.14 1.14 0 0 1-.196.422a.8.8 0 0 1-.334.252a1.298 1.298 0 0 1-.483.082h-.563v-2.707Zm3.743 1.763v1.591h-.79V11.85h2.548v.653H7.896v1.117h1.606v.638H7.896Z"/></svg>', aa = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2H9v-1h3a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM.706 13.189v2.66H0V11.85h.806l1.14 2.596h.026l1.14-2.596h.8v3.999h-.716v-2.66h-.038l-.946 2.159h-.516l-.952-2.16H.706Zm3.919 2.66V11.85h1.459c.406 0 .741.078 1.005.234c.263.157.46.383.589.68c.13.297.196.655.196 1.075c0 .422-.066.784-.196 1.084c-.131.301-.33.53-.595.689c-.264.158-.597.237-1 .237H4.626Zm1.353-3.354h-.562v2.707h.562c.186 0 .347-.028.484-.082a.8.8 0 0 0 .334-.252a1.14 1.14 0 0 0 .196-.422c.045-.168.067-.365.067-.592a2.1 2.1 0 0 0-.117-.753a.89.89 0 0 0-.354-.454c-.159-.102-.362-.152-.61-.152Z"/></svg>', ta = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM3.517 14.841a1.13 1.13 0 0 0 .401.823c.13.108.289.192.478.252c.19.061.411.091.665.091c.338 0 .624-.053.859-.158c.236-.105.416-.252.539-.44c.125-.189.187-.408.187-.656c0-.224-.045-.41-.134-.56a1.001 1.001 0 0 0-.375-.357a2.027 2.027 0 0 0-.566-.21l-.621-.144a.97.97 0 0 1-.404-.176a.37.37 0 0 1-.144-.299c0-.156.062-.284.185-.384c.125-.101.296-.152.512-.152c.143 0 .266.023.37.068a.624.624 0 0 1 .246.181a.56.56 0 0 1 .12.258h.75a1.092 1.092 0 0 0-.2-.566a1.21 1.21 0 0 0-.5-.41a1.813 1.813 0 0 0-.78-.152c-.293 0-.551.05-.776.15c-.225.099-.4.24-.527.421c-.127.182-.19.395-.19.639c0 .201.04.376.122.524c.082.149.2.27.352.367c.152.095.332.167.539.213l.618.144c.207.049.361.113.463.193a.387.387 0 0 1 .152.326a.505.505 0 0 1-.085.29a.559.559 0 0 1-.255.193c-.111.047-.249.07-.413.07c-.117 0-.223-.013-.32-.04a.838.838 0 0 1-.248-.115a.578.578 0 0 1-.255-.384h-.765ZM.806 13.693c0-.248.034-.46.102-.633a.868.868 0 0 1 .302-.399a.814.814 0 0 1 .475-.137c.15 0 .283.032.398.097a.7.7 0 0 1 .272.26a.85.85 0 0 1 .12.381h.765v-.072a1.33 1.33 0 0 0-.466-.964a1.441 1.441 0 0 0-.489-.272a1.838 1.838 0 0 0-.606-.097c-.356 0-.66.074-.911.223c-.25.148-.44.359-.572.632c-.13.274-.196.6-.196.979v.498c0 .379.064.704.193.976c.131.271.322.48.572.626c.25.145.554.217.914.217c.293 0 .554-.055.785-.164c.23-.11.414-.26.55-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.764a.799.799 0 0 1-.118.363a.7.7 0 0 1-.272.25a.874.874 0 0 1-.401.087a.845.845 0 0 1-.478-.132a.833.833 0 0 1-.299-.392a1.699 1.699 0 0 1-.102-.627v-.495Zm8.239 2.238h-.953l-1.338-3.999h.917l.896 3.138h.038l.888-3.138h.879l-1.327 4Z"/></svg>', fa = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM1.6 11.85H0v3.999h.791v-1.342h.803c.287 0 .531-.057.732-.173c.203-.117.358-.275.463-.474a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.476-.158-.677a1.176 1.176 0 0 0-.46-.477c-.2-.12-.443-.179-.732-.179Zm.545 1.333a.795.795 0 0 1-.085.38a.574.574 0 0 1-.238.241a.794.794 0 0 1-.375.082H.788V12.48h.66c.218 0 .389.06.512.181c.123.122.185.296.185.522Zm2.817-1.333h-1.6v3.999h.791v-1.342h.803c.287 0 .531-.057.732-.173c.203-.117.358-.275.463-.474c.108-.201.161-.427.161-.677c0-.25-.052-.476-.158-.677a1.176 1.176 0 0 0-.46-.477c-.2-.12-.443-.179-.732-.179Zm.545 1.333a.795.795 0 0 1-.085.38a.574.574 0 0 1-.238.241a.793.793 0 0 1-.375.082H4.15V12.48h.66c.218 0 .389.06.512.181c.123.122.185.296.185.522Zm2.767-.67v3.336H7.48v-3.337H6.346v-.662h3.065v.662H8.274Z"/></svg>', oa = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-7.839 9.166v.522c0 .256-.039.47-.117.641a.861.861 0 0 1-.322.387a.877.877 0 0 1-.469.126a.883.883 0 0 1-.471-.126a.868.868 0 0 1-.32-.386a1.55 1.55 0 0 1-.117-.642v-.522c0-.257.04-.471.117-.641a.868.868 0 0 1 .32-.387a.868.868 0 0 1 .471-.129c.176 0 .332.043.469.13a.861.861 0 0 1 .322.386c.078.17.117.384.117.641Zm.803.519v-.513c0-.377-.068-.7-.205-.972a1.46 1.46 0 0 0-.589-.63c-.254-.147-.56-.22-.917-.22c-.355 0-.662.073-.92.22a1.441 1.441 0 0 0-.589.627c-.136.271-.205.596-.205.975v.513c0 .375.069.7.205.973c.137.271.333.48.59.627c.257.144.564.216.92.216c.357 0 .662-.072.916-.216c.256-.147.452-.356.59-.627c.136-.274.204-.598.204-.973ZM0 11.926v4h1.459c.402 0 .735-.08.999-.238a1.45 1.45 0 0 0 .595-.689c.13-.3.196-.662.196-1.084c0-.42-.065-.778-.196-1.075a1.426 1.426 0 0 0-.59-.68c-.263-.156-.598-.234-1.004-.234H0Zm.791.645h.563c.248 0 .45.05.609.152a.89.89 0 0 1 .354.454c.079.201.118.452.118.753a2.3 2.3 0 0 1-.068.592a1.141 1.141 0 0 1-.196.422a.8.8 0 0 1-.334.252a1.298 1.298 0 0 1-.483.082H.79V12.57Zm7.422.483a1.732 1.732 0 0 0-.103.633v.495c0 .246.034.455.103.627a.834.834 0 0 0 .298.393a.845.845 0 0 0 .478.131a.868.868 0 0 0 .401-.088a.699.699 0 0 0 .273-.248a.8.8 0 0 0 .117-.364h.765v.076a1.268 1.268 0 0 1-.226.674c-.137.194-.32.345-.55.454a1.81 1.81 0 0 1-.786.164c-.36 0-.664-.072-.914-.216a1.424 1.424 0 0 1-.571-.627c-.13-.272-.194-.597-.194-.976v-.498c0-.379.066-.705.197-.978c.13-.274.321-.485.571-.633c.252-.149.556-.223.911-.223c.219 0 .421.032.607.097c.187.062.35.153.489.272a1.326 1.326 0 0 1 .466.964v.073H9.78a.85.85 0 0 0-.12-.38a.7.7 0 0 0-.273-.261a.802.802 0 0 0-.398-.097a.814.814 0 0 0-.475.138a.868.868 0 0 0-.301.398Z"/></svg>', da = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" fill-rule="evenodd" d="M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-6.839 9.688v-.522a1.54 1.54 0 0 0-.117-.641a.861.861 0 0 0-.322-.387a.862.862 0 0 0-.469-.129a.868.868 0 0 0-.471.13a.868.868 0 0 0-.32.386a1.54 1.54 0 0 0-.117.641v.522c0 .256.04.47.117.641a.868.868 0 0 0 .32.387a.883.883 0 0 0 .471.126a.877.877 0 0 0 .469-.126a.861.861 0 0 0 .322-.386a1.55 1.55 0 0 0 .117-.642Zm.803-.516v.513c0 .375-.068.7-.205.973a1.47 1.47 0 0 1-.589.627c-.254.144-.56.216-.917.216a1.86 1.86 0 0 1-.92-.216a1.463 1.463 0 0 1-.589-.627a2.151 2.151 0 0 1-.205-.973v-.513c0-.379.069-.704.205-.975c.137-.274.333-.483.59-.627c.257-.147.564-.22.92-.22c.357 0 .662.073.916.22c.256.146.452.356.59.63c.136.271.204.595.204.972ZM1 15.925v-3.999h1.459c.406 0 .741.078 1.005.235c.264.156.46.382.589.68c.13.296.196.655.196 1.074c0 .422-.065.784-.196 1.084c-.131.301-.33.53-.595.689c-.264.158-.597.237-.999.237H1Zm1.354-3.354H1.79v2.707h.563c.185 0 .346-.028.483-.082a.8.8 0 0 0 .334-.252c.088-.114.153-.254.196-.422a2.3 2.3 0 0 0 .068-.592c0-.3-.04-.552-.118-.753a.89.89 0 0 0-.354-.454c-.158-.102-.361-.152-.61-.152Zm6.756 1.116c0-.248.034-.46.103-.633a.868.868 0 0 1 .301-.398a.814.814 0 0 1 .475-.138c.15 0 .283.032.398.097a.7.7 0 0 1 .273.26a.85.85 0 0 1 .12.381h.765v-.073a1.33 1.33 0 0 0-.466-.964a1.44 1.44 0 0 0-.49-.272a1.836 1.836 0 0 0-.606-.097c-.355 0-.66.074-.911.223c-.25.148-.44.359-.571.633c-.131.273-.197.6-.197.978v.498c0 .379.065.704.194.976c.13.271.321.48.571.627c.25.144.555.216.914.216c.293 0 .555-.054.785-.164c.23-.11.414-.26.551-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.765a.8.8 0 0 1-.117.364a.699.699 0 0 1-.273.248a.874.874 0 0 1-.401.088a.845.845 0 0 1-.478-.131a.834.834 0 0 1-.298-.393a1.7 1.7 0 0 1-.103-.627v-.495Zm5.092-1.76h.894l-1.275 2.006l1.254 1.992h-.908l-.85-1.415h-.035l-.852 1.415h-.862l1.24-2.015l-1.228-1.984h.932l.832 1.439h.035l.823-1.439Z"/></svg>';
|
|
1412
1423
|
var ba = Object.defineProperty, ra = Object.getOwnPropertyDescriptor, Ae = (c, e, a, f) => {
|
|
1413
1424
|
for (var t = f > 1 ? void 0 : f ? ra(e, a) : e, o = c.length - 1, d; o >= 0; o--)
|
|
@@ -1423,7 +1434,7 @@ const Pe = {
|
|
|
1423
1434
|
doc: oa,
|
|
1424
1435
|
docx: da
|
|
1425
1436
|
};
|
|
1426
|
-
let
|
|
1437
|
+
let Y = class extends C {
|
|
1427
1438
|
constructor() {
|
|
1428
1439
|
super(...arguments), this.filename = "", this.url = "";
|
|
1429
1440
|
}
|
|
@@ -1453,16 +1464,16 @@ let J = class extends C {
|
|
|
1453
1464
|
`;
|
|
1454
1465
|
}
|
|
1455
1466
|
};
|
|
1456
|
-
|
|
1467
|
+
Y.styles = Gc;
|
|
1457
1468
|
Ae([
|
|
1458
1469
|
r({ type: String })
|
|
1459
|
-
],
|
|
1470
|
+
], Y.prototype, "filename", 2);
|
|
1460
1471
|
Ae([
|
|
1461
1472
|
r({ type: String })
|
|
1462
|
-
],
|
|
1463
|
-
|
|
1473
|
+
], Y.prototype, "url", 2);
|
|
1474
|
+
Y = Ae([
|
|
1464
1475
|
k("cb-file")
|
|
1465
|
-
],
|
|
1476
|
+
], Y);
|
|
1466
1477
|
const sa = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="currentColor"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6Z"/><path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1ZM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118ZM2.5 3h11V2h-11v1Z"/></g></svg>', na = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 8a3 3 0 1 0 0-6a3 3 0 0 0 0 6Zm2-3a2 2 0 1 1-4 0a2 2 0 0 1 4 0Zm4 8c0 1-1 1-1 1H3s-1 0-1-1s1-4 6-4s6 3 6 4Zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664h10Z"/></svg>', ia = x`
|
|
1467
1478
|
pre code.hljs {
|
|
1468
1479
|
display: block;
|
|
@@ -2722,7 +2733,8 @@ const sa = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="curr
|
|
|
2722
2733
|
.user-message {
|
|
2723
2734
|
//margin-right: 0px;
|
|
2724
2735
|
//margin-left: auto;
|
|
2725
|
-
color: rgb(255, 255, 255);
|
|
2736
|
+
//color: rgb(255, 255, 255);
|
|
2737
|
+
color: var(--enegelai-bot-message-user-color, rgb(255, 255, 255));
|
|
2726
2738
|
//background-color: var(--primary-color);
|
|
2727
2739
|
background-color: var(--enegelai-bot-message-user-background, rgba(0, 208, 117, 1));
|
|
2728
2740
|
text-align: left;
|
|
@@ -2738,7 +2750,8 @@ const sa = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="curr
|
|
|
2738
2750
|
//margin-left: -12px;
|
|
2739
2751
|
margin-left: 0px;
|
|
2740
2752
|
margin-top: 2px;
|
|
2741
|
-
color: rgb(34, 34, 34);
|
|
2753
|
+
//color: rgb(34, 34, 34);
|
|
2754
|
+
color: var(--enegelai-bot-message-bot-color, rgb(34, 34, 34));
|
|
2742
2755
|
background-color: var(--enegelai-bot-message-bot-background, rgba(234, 234, 234, 0.3));
|
|
2743
2756
|
padding: 4px 12px 6px 12px;
|
|
2744
2757
|
}
|
|
@@ -2748,7 +2761,8 @@ const sa = '<svg viewBox="0 0 16 16" width="1.2em" height="1.2em" ><g fill="curr
|
|
|
2748
2761
|
//margin-left: -12px;
|
|
2749
2762
|
margin-left: 0px;
|
|
2750
2763
|
margin-top: 2px;
|
|
2751
|
-
color: rgba(34, 34, 34, 0.6);
|
|
2764
|
+
//color: rgba(34, 34, 34, 0.6);
|
|
2765
|
+
color: var(--enegelai-bot-message-system-color, rgba(34, 34, 34, 0.6));
|
|
2752
2766
|
background-color: var(--enegelai-bot-message-system-background, rgba(254, 243, 199, 0.5));
|
|
2753
2767
|
padding: 4px 12px 6px 12px;
|
|
2754
2768
|
}
|
|
@@ -2788,18 +2802,18 @@ function pa() {
|
|
|
2788
2802
|
const c = new hc({
|
|
2789
2803
|
linkify: !0
|
|
2790
2804
|
});
|
|
2791
|
-
return c.use(
|
|
2805
|
+
return c.use(gc, { attrs: { target: "_blank", rel: "noopener" } }), c;
|
|
2792
2806
|
}
|
|
2793
2807
|
async function Ee(c) {
|
|
2794
2808
|
const e = pa();
|
|
2795
2809
|
return s`${B(e.render(c))}`;
|
|
2796
2810
|
}
|
|
2797
|
-
var ha = Object.defineProperty,
|
|
2798
|
-
for (var t = f > 1 ? void 0 : f ?
|
|
2811
|
+
var ha = Object.defineProperty, ga = Object.getOwnPropertyDescriptor, he = (c, e, a, f) => {
|
|
2812
|
+
for (var t = f > 1 ? void 0 : f ? ga(e, a) : e, o = c.length - 1, d; o >= 0; o--)
|
|
2799
2813
|
(d = c[o]) && (t = (f ? d(e, a, t) : d(t)) || t);
|
|
2800
2814
|
return f && t && ha(e, a, t), t;
|
|
2801
2815
|
};
|
|
2802
|
-
let
|
|
2816
|
+
let U = class extends C {
|
|
2803
2817
|
constructor() {
|
|
2804
2818
|
super(...arguments), this.type = "assistant";
|
|
2805
2819
|
}
|
|
@@ -2930,26 +2944,26 @@ let F = class extends C {
|
|
|
2930
2944
|
`;
|
|
2931
2945
|
}
|
|
2932
2946
|
};
|
|
2933
|
-
|
|
2947
|
+
U.styles = la;
|
|
2934
2948
|
he([
|
|
2935
2949
|
r({ type: Object })
|
|
2936
|
-
],
|
|
2950
|
+
], U.prototype, "message", 2);
|
|
2937
2951
|
he([
|
|
2938
2952
|
r({ type: String })
|
|
2939
|
-
],
|
|
2953
|
+
], U.prototype, "type", 2);
|
|
2940
2954
|
he([
|
|
2941
2955
|
pc(".code-block-header__copy")
|
|
2942
|
-
],
|
|
2943
|
-
|
|
2956
|
+
], U.prototype, "copyBtns", 2);
|
|
2957
|
+
U = he([
|
|
2944
2958
|
k("cb-message")
|
|
2945
|
-
],
|
|
2946
|
-
var
|
|
2959
|
+
], U);
|
|
2960
|
+
var ua = Object.defineProperty, ma = Object.getOwnPropertyDescriptor, Z = (c, e, a, f) => {
|
|
2947
2961
|
for (var t = f > 1 ? void 0 : f ? ma(e, a) : e, o = c.length - 1, d; o >= 0; o--)
|
|
2948
2962
|
(d = c[o]) && (t = (f ? d(e, a, t) : d(t)) || t);
|
|
2949
|
-
return f && t &&
|
|
2963
|
+
return f && t && ua(e, a, t), t;
|
|
2950
2964
|
};
|
|
2951
|
-
const
|
|
2952
|
-
|
|
2965
|
+
const ee = pe.noConflict();
|
|
2966
|
+
ee.setLevel("info");
|
|
2953
2967
|
let E = class extends C {
|
|
2954
2968
|
constructor() {
|
|
2955
2969
|
super(...arguments), this.messages = [], this.actions = [], this.calendlyInjected = !1, this.activeCalendlyAction = -1;
|
|
@@ -2991,7 +3005,7 @@ let E = class extends C {
|
|
|
2991
3005
|
return null;
|
|
2992
3006
|
}
|
|
2993
3007
|
handleCalendlyEvent(c) {
|
|
2994
|
-
switch (
|
|
3008
|
+
switch (ee.info("Got Calendly Event:", c.data), c.data.event) {
|
|
2995
3009
|
case "calendly.event_scheduled": {
|
|
2996
3010
|
const e = this.activeCalendlyAction;
|
|
2997
3011
|
e >= 0 && (n.removeAction(e), n.addSystemMessage("Your meeting has been scheduled!"), this.activeCalendlyAction = -1);
|
|
@@ -2999,10 +3013,10 @@ let E = class extends C {
|
|
|
2999
3013
|
}
|
|
3000
3014
|
}
|
|
3001
3015
|
invokeLinkAction(c = {}) {
|
|
3002
|
-
|
|
3016
|
+
ee.info("invokeLinkAction:", c), window.open(c.url, "_blank");
|
|
3003
3017
|
}
|
|
3004
3018
|
invokeCalendlyAction(c = {}) {
|
|
3005
|
-
return
|
|
3019
|
+
return ee.info("invokeCalendlyAction:", c), "Calendly" in window && (this.activeCalendlyAction = c.internalId, window.Calendly.initPopupWidget({ url: c.url })), !1;
|
|
3006
3020
|
}
|
|
3007
3021
|
renderCalendlyAction(c) {
|
|
3008
3022
|
if (!("Calendly" in window) && !this.calendlyInjected) {
|
|
@@ -3255,12 +3269,12 @@ const _a = x`
|
|
|
3255
3269
|
gap: 8px;
|
|
3256
3270
|
}
|
|
3257
3271
|
`;
|
|
3258
|
-
var Ca = Object.defineProperty, $a = Object.getOwnPropertyDescriptor,
|
|
3272
|
+
var Ca = Object.defineProperty, $a = Object.getOwnPropertyDescriptor, ge = (c, e, a, f) => {
|
|
3259
3273
|
for (var t = f > 1 ? void 0 : f ? $a(e, a) : e, o = c.length - 1, d; o >= 0; o--)
|
|
3260
3274
|
(d = c[o]) && (t = (f ? d(e, a, t) : d(t)) || t);
|
|
3261
3275
|
return f && t && Ca(e, a, t), t;
|
|
3262
3276
|
};
|
|
3263
|
-
let
|
|
3277
|
+
let F = class extends C {
|
|
3264
3278
|
constructor() {
|
|
3265
3279
|
super(...arguments), this.open = !1, this.label = "Dialog", this.zindex = 100;
|
|
3266
3280
|
}
|
|
@@ -3304,19 +3318,19 @@ let U = class extends C {
|
|
|
3304
3318
|
</sl-dialog>`;
|
|
3305
3319
|
}
|
|
3306
3320
|
};
|
|
3307
|
-
|
|
3308
|
-
|
|
3321
|
+
F.styles = _a;
|
|
3322
|
+
ge([
|
|
3309
3323
|
r({ type: Boolean })
|
|
3310
|
-
],
|
|
3311
|
-
|
|
3324
|
+
], F.prototype, "open", 2);
|
|
3325
|
+
ge([
|
|
3312
3326
|
r({ type: String, attribute: "label" })
|
|
3313
|
-
],
|
|
3314
|
-
|
|
3327
|
+
], F.prototype, "label", 2);
|
|
3328
|
+
ge([
|
|
3315
3329
|
r({ type: Number })
|
|
3316
|
-
],
|
|
3317
|
-
|
|
3330
|
+
], F.prototype, "zindex", 2);
|
|
3331
|
+
F = ge([
|
|
3318
3332
|
k("cb-dialog")
|
|
3319
|
-
],
|
|
3333
|
+
], F);
|
|
3320
3334
|
var ja = Object.defineProperty, Ma = Object.getOwnPropertyDescriptor, Je = (c, e, a, f) => {
|
|
3321
3335
|
for (var t = f > 1 ? void 0 : f ? Ma(e, a) : e, o = c.length - 1, d; o >= 0; o--)
|
|
3322
3336
|
(d = c[o]) && (t = (f ? d(e, a, t) : d(t)) || t);
|
|
@@ -3629,7 +3643,6 @@ const Oa = x`
|
|
|
3629
3643
|
width: var(--anchor-width);
|
|
3630
3644
|
height: var(--anchor-width);
|
|
3631
3645
|
//background-color: var(--primary-color);
|
|
3632
|
-
background: rgb(0, 208, 117);
|
|
3633
3646
|
|
|
3634
3647
|
position: fixed;
|
|
3635
3648
|
right: 25px;
|
|
@@ -3657,8 +3670,8 @@ const Oa = x`
|
|
|
3657
3670
|
}
|
|
3658
3671
|
|
|
3659
3672
|
sl-button[variant='primary']::part(base) {
|
|
3660
|
-
background
|
|
3661
|
-
border-color: rgb(0, 208, 117);
|
|
3673
|
+
background: var(--enegelai-bot-anchor-background, rgb(0, 208, 117));
|
|
3674
|
+
border-color: var(--enegelai-bot-anchor-border-color, rgb(0, 208, 117));
|
|
3662
3675
|
}
|
|
3663
3676
|
|
|
3664
3677
|
.cb-engage-popup {
|
|
@@ -3717,7 +3730,7 @@ var Ia = Object.defineProperty, Pa = Object.getOwnPropertyDescriptor, Ye = (c, e
|
|
|
3717
3730
|
};
|
|
3718
3731
|
let be = class extends C {
|
|
3719
3732
|
constructor() {
|
|
3720
|
-
super(...arguments), this.store = new
|
|
3733
|
+
super(...arguments), this.store = new Ue(this, n), this.open = !1;
|
|
3721
3734
|
}
|
|
3722
3735
|
// handler click
|
|
3723
3736
|
_clickHandler() {
|
|
@@ -3864,9 +3877,9 @@ class cc extends Error {
|
|
|
3864
3877
|
}), this.name = "TimeoutError", this.request = e;
|
|
3865
3878
|
}
|
|
3866
3879
|
}
|
|
3867
|
-
const
|
|
3880
|
+
const ce = (c) => c !== null && typeof c == "object", X = (...c) => {
|
|
3868
3881
|
for (const e of c)
|
|
3869
|
-
if ((!
|
|
3882
|
+
if ((!ce(e) || Array.isArray(e)) && typeof e < "u")
|
|
3870
3883
|
throw new TypeError("The `options` argument must be an object");
|
|
3871
3884
|
return Le({}, ...c);
|
|
3872
3885
|
}, ac = (c = {}, e = {}) => {
|
|
@@ -3879,10 +3892,10 @@ const ee = (c) => c !== null && typeof c == "object", G = (...c) => {
|
|
|
3879
3892
|
for (const f of c)
|
|
3880
3893
|
if (Array.isArray(f))
|
|
3881
3894
|
Array.isArray(e) || (e = []), e = [...e, ...f];
|
|
3882
|
-
else if (
|
|
3895
|
+
else if (ce(f)) {
|
|
3883
3896
|
for (let [t, o] of Object.entries(f))
|
|
3884
|
-
|
|
3885
|
-
|
|
3897
|
+
ce(o) && t in e && (o = Le(e[t], o)), e = { ...e, [t]: o };
|
|
3898
|
+
ce(f.headers) && (a = ac(a, f.headers), e.headers = a);
|
|
3886
3899
|
}
|
|
3887
3900
|
return e;
|
|
3888
3901
|
}, qa = (() => {
|
|
@@ -3896,7 +3909,7 @@ const ee = (c) => c !== null && typeof c == "object", G = (...c) => {
|
|
|
3896
3909
|
return c = !0, "half";
|
|
3897
3910
|
}
|
|
3898
3911
|
}).headers.has("Content-Type")), c && !e;
|
|
3899
|
-
})(), Da = typeof globalThis.AbortController == "function",
|
|
3912
|
+
})(), Da = typeof globalThis.AbortController == "function", Ua = typeof globalThis.ReadableStream == "function", Fa = typeof globalThis.FormData == "function", tc = ["get", "post", "put", "patch", "head", "delete"], Za = {
|
|
3900
3913
|
json: "application/json",
|
|
3901
3914
|
text: "text/*",
|
|
3902
3915
|
formData: "multipart/form-data",
|
|
@@ -3968,19 +3981,19 @@ class se {
|
|
|
3968
3981
|
await Promise.resolve();
|
|
3969
3982
|
let b = await f._fetch();
|
|
3970
3983
|
for (const h of f._options.hooks.afterResponse) {
|
|
3971
|
-
const
|
|
3972
|
-
|
|
3984
|
+
const u = await h(f.request, f._options, f._decorateResponse(b.clone()));
|
|
3985
|
+
u instanceof globalThis.Response && (b = u);
|
|
3973
3986
|
}
|
|
3974
3987
|
if (f._decorateResponse(b), !b.ok && f._options.throwHttpErrors) {
|
|
3975
3988
|
let h = new Te(b, f.request, f._options);
|
|
3976
|
-
for (const
|
|
3977
|
-
h = await
|
|
3989
|
+
for (const u of f._options.hooks.beforeError)
|
|
3990
|
+
h = await u(h);
|
|
3978
3991
|
throw h;
|
|
3979
3992
|
}
|
|
3980
3993
|
if (f._options.onDownloadProgress) {
|
|
3981
3994
|
if (typeof f._options.onDownloadProgress != "function")
|
|
3982
3995
|
throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
3983
|
-
if (!
|
|
3996
|
+
if (!Ua)
|
|
3984
3997
|
throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
|
|
3985
3998
|
return f._stream(b.clone(), f._options.onDownloadProgress);
|
|
3986
3999
|
}
|
|
@@ -4063,7 +4076,7 @@ class se {
|
|
|
4063
4076
|
}
|
|
4064
4077
|
if (qa && (this._options.duplex = "half"), this.request = new globalThis.Request(this._input, this._options), this._options.searchParams) {
|
|
4065
4078
|
const t = "?" + (typeof this._options.searchParams == "string" ? this._options.searchParams.replace(/^\?/, "") : new URLSearchParams(this._options.searchParams).toString()), o = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, t);
|
|
4066
|
-
(
|
|
4079
|
+
(Fa && this._options.body instanceof globalThis.FormData || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers["content-type"]) && this.request.headers.delete("content-type"), this.request = new globalThis.Request(new globalThis.Request(o, { ...this.request }), this._options);
|
|
4067
4080
|
}
|
|
4068
4081
|
this._options.json !== void 0 && (this._options.body = JSON.stringify(this._options.json), this.request.headers.set("content-type", this._options.headers.get("content-type") ?? "application/json"), this.request = new globalThis.Request(this.request, { body: this._options.body }));
|
|
4069
4082
|
}
|
|
@@ -4133,17 +4146,17 @@ class se {
|
|
|
4133
4146
|
const d = e.body.getReader();
|
|
4134
4147
|
a && a({ percent: 0, transferredBytes: 0, totalBytes: f }, new Uint8Array());
|
|
4135
4148
|
async function b() {
|
|
4136
|
-
const { done: h, value:
|
|
4149
|
+
const { done: h, value: u } = await d.read();
|
|
4137
4150
|
if (h) {
|
|
4138
4151
|
o.close();
|
|
4139
4152
|
return;
|
|
4140
4153
|
}
|
|
4141
4154
|
if (a) {
|
|
4142
|
-
t +=
|
|
4155
|
+
t += u.byteLength;
|
|
4143
4156
|
const m = f === 0 ? 0 : t / f;
|
|
4144
|
-
a({ percent: m, transferredBytes: t, totalBytes: f },
|
|
4157
|
+
a({ percent: m, transferredBytes: t, totalBytes: f }, u);
|
|
4145
4158
|
}
|
|
4146
|
-
o.enqueue(
|
|
4159
|
+
o.enqueue(u), await b();
|
|
4147
4160
|
}
|
|
4148
4161
|
await b();
|
|
4149
4162
|
}
|
|
@@ -4156,10 +4169,10 @@ class se {
|
|
|
4156
4169
|
}
|
|
4157
4170
|
/*! MIT License © Sindre Sorhus */
|
|
4158
4171
|
const je = (c) => {
|
|
4159
|
-
const e = (a, f) => se.create(a,
|
|
4172
|
+
const e = (a, f) => se.create(a, X(c, f));
|
|
4160
4173
|
for (const a of tc)
|
|
4161
|
-
e[a] = (f, t) => se.create(f,
|
|
4162
|
-
return e.create = (a) => je(
|
|
4174
|
+
e[a] = (f, t) => se.create(f, X(c, t, { method: a }));
|
|
4175
|
+
return e.create = (a) => je(X(a)), e.extend = (a) => je(X(c, a)), e.stop = fc, e;
|
|
4163
4176
|
}, Qa = je(), e1 = Qa, dc = e1.extend({
|
|
4164
4177
|
hooks: {
|
|
4165
4178
|
beforeRequest: [
|
|
@@ -4170,15 +4183,15 @@ const je = (c) => {
|
|
|
4170
4183
|
});
|
|
4171
4184
|
async function c1(c, e) {
|
|
4172
4185
|
const { onmessage: a, onclose: f, ...t } = e, o = async (d, b) => {
|
|
4173
|
-
const { value: h, done:
|
|
4174
|
-
|
|
4186
|
+
const { value: h, done: u } = await b.read();
|
|
4187
|
+
u ? (d.close(), f == null || f()) : (a == null || a(h), d.enqueue(h), o(d, b));
|
|
4175
4188
|
};
|
|
4176
4189
|
return t.body && typeof t.body == "object" && (t.body = JSON.stringify(t.body)), console.log("Fetching:", t), fetch(c, t).then((d) => {
|
|
4177
4190
|
const b = d.body.getReader();
|
|
4178
4191
|
return new ReadableStream({
|
|
4179
|
-
start(
|
|
4192
|
+
start(u) {
|
|
4180
4193
|
o(
|
|
4181
|
-
|
|
4194
|
+
u,
|
|
4182
4195
|
b
|
|
4183
4196
|
);
|
|
4184
4197
|
}
|
|
@@ -4247,9 +4260,9 @@ async function o1(c, e) {
|
|
|
4247
4260
|
const { value: o, done: d } = await a.read();
|
|
4248
4261
|
if (o) {
|
|
4249
4262
|
let b = f.decode(o);
|
|
4250
|
-
const h = b.lastIndexOf("data:"),
|
|
4263
|
+
const h = b.lastIndexOf("data:"), u = b.lastIndexOf(`
|
|
4251
4264
|
`);
|
|
4252
|
-
if (h !== -1 && (b = b.slice(h + 6)),
|
|
4265
|
+
if (h !== -1 && (b = b.slice(h + 6)), u !== -1 && (b = b.slice(0, u)), b = b.trim(), b === `
|
|
4253
4266
|
` || b === "")
|
|
4254
4267
|
continue;
|
|
4255
4268
|
if (b === "[DONE]") {
|
|
@@ -4297,11 +4310,11 @@ var b1 = Object.defineProperty, r1 = Object.getOwnPropertyDescriptor, v = (c, e,
|
|
|
4297
4310
|
(d = c[o]) && (t = (f ? d(e, a, t) : d(t)) || t);
|
|
4298
4311
|
return f && t && b1(e, a, t), t;
|
|
4299
4312
|
};
|
|
4300
|
-
const
|
|
4301
|
-
|
|
4302
|
-
let
|
|
4313
|
+
const W = pe.noConflict();
|
|
4314
|
+
W.setLevel("info");
|
|
4315
|
+
let g = class extends C {
|
|
4303
4316
|
constructor() {
|
|
4304
|
-
super(...arguments), this.store = new
|
|
4317
|
+
super(...arguments), this.store = new Ue(this, n), this.displayLicense = !1, this.name = "ChatBot", this.orgId = "", this.botId = "", this.url = "ws://localhost:3070", this.logoSvg = ` <svg width="24" height="24" viewBox="0 0 40 40">
|
|
4305
4318
|
<path
|
|
4306
4319
|
d="M34.728 0.275L2.245 15.267c-3.748 1.749 -2.498 7.246 1.499 7.246h13.743v13.743c0 3.998 5.497 5.248 7.246 1.499l14.992 -32.483c1.249 -2.999 -1.999 -6.248 -4.998 -4.998z"
|
|
4307
4320
|
fill="#E24D42"
|
|
@@ -4337,9 +4350,9 @@ let u = class extends C {
|
|
|
4337
4350
|
return n.addMessage(c), c;
|
|
4338
4351
|
}
|
|
4339
4352
|
render() {
|
|
4340
|
-
return s`
|
|
4353
|
+
return n.disabled ? (W.error("Bot is disabled"), null) : s`
|
|
4341
4354
|
<div class="cb-wrapper" style="${n.open ? "display:flex" : "display:none"}">
|
|
4342
|
-
<cb-header title="${this.name}"></cb-header>
|
|
4355
|
+
<cb-header title="${this.name}" exportparts="header"></cb-header>
|
|
4343
4356
|
<cb-message-list .messages=${n.messages} .actions=${n.actions}></cb-message-list>
|
|
4344
4357
|
<cb-user-input ?loading=${this.loading} ?disabled=${this.loading || this.showAuthAlert} ?enable-file-upload=${this.enableFileUpload}></cb-user-input>
|
|
4345
4358
|
</div>
|
|
@@ -4347,7 +4360,7 @@ let u = class extends C {
|
|
|
4347
4360
|
`;
|
|
4348
4361
|
}
|
|
4349
4362
|
connectedCallback() {
|
|
4350
|
-
super.connectedCallback(),
|
|
4363
|
+
super.connectedCallback(), W.info("connectedCallback"), addEventListener("setting:show", () => {
|
|
4351
4364
|
this.showSetting = !0;
|
|
4352
4365
|
}), addEventListener("message:send", this._addMessageHandler.bind(this)), addEventListener("message:remove", this._deleteMessageHandler.bind(this)), addEventListener("setting:confirm", this._settingConfirmHandler.bind(this)), addEventListener("setting:hide", () => {
|
|
4353
4366
|
this.showSetting = !1;
|
|
@@ -4364,7 +4377,7 @@ let u = class extends C {
|
|
|
4364
4377
|
// Use to initialize
|
|
4365
4378
|
// This is also called when state changes - ??? - i.e. when message added to the array
|
|
4366
4379
|
updated(c) {
|
|
4367
|
-
super.updated(c),
|
|
4380
|
+
super.updated(c), W.info("updated,_changedProperties:", c), c.size > 0 && (W.info("updated,_changedProperties:", c), this._initSetting()), setTimeout(() => {
|
|
4368
4381
|
this._scrollToBottom();
|
|
4369
4382
|
}, 0);
|
|
4370
4383
|
}
|
|
@@ -4480,64 +4493,64 @@ let u = class extends C {
|
|
|
4480
4493
|
console.log("Scrolling to bottom ..."), (e = this._messageList) == null || e.scrollToBottom();
|
|
4481
4494
|
}
|
|
4482
4495
|
};
|
|
4483
|
-
|
|
4496
|
+
g.styles = kc;
|
|
4484
4497
|
v([
|
|
4485
4498
|
r({ type: Boolean, attribute: "display-license" })
|
|
4486
|
-
],
|
|
4499
|
+
], g.prototype, "displayLicense", 2);
|
|
4487
4500
|
v([
|
|
4488
4501
|
r({ type: String, attribute: "name" })
|
|
4489
|
-
],
|
|
4502
|
+
], g.prototype, "name", 2);
|
|
4490
4503
|
v([
|
|
4491
4504
|
r({ type: String, attribute: "org-id" })
|
|
4492
|
-
],
|
|
4505
|
+
], g.prototype, "orgId", 2);
|
|
4493
4506
|
v([
|
|
4494
4507
|
r({ type: String, attribute: "bot-id" })
|
|
4495
|
-
],
|
|
4508
|
+
], g.prototype, "botId", 2);
|
|
4496
4509
|
v([
|
|
4497
4510
|
r({ type: String, attribute: "url" })
|
|
4498
|
-
],
|
|
4511
|
+
], g.prototype, "url", 2);
|
|
4499
4512
|
v([
|
|
4500
4513
|
r({ type: String, attribute: "logo-svg" })
|
|
4501
|
-
],
|
|
4514
|
+
], g.prototype, "logoSvg", 2);
|
|
4502
4515
|
v([
|
|
4503
4516
|
r({ type: String, attribute: "bot-icon-svg" })
|
|
4504
|
-
],
|
|
4517
|
+
], g.prototype, "botIconSvg", 2);
|
|
4505
4518
|
v([
|
|
4506
4519
|
r({ type: String, attribute: "user-icon-svg" })
|
|
4507
|
-
],
|
|
4520
|
+
], g.prototype, "userIconSvg", 2);
|
|
4508
4521
|
v([
|
|
4509
4522
|
r({ type: String, attribute: "system-icon-svg" })
|
|
4510
|
-
],
|
|
4523
|
+
], g.prototype, "systemIconSvg", 2);
|
|
4511
4524
|
v([
|
|
4512
4525
|
r({ type: Boolean, attribute: "stream" })
|
|
4513
|
-
],
|
|
4526
|
+
], g.prototype, "stream", 2);
|
|
4514
4527
|
v([
|
|
4515
4528
|
r({ type: Boolean, attribute: "custom-request" })
|
|
4516
|
-
],
|
|
4529
|
+
], g.prototype, "customRequest", 2);
|
|
4517
4530
|
v([
|
|
4518
4531
|
r({ type: Boolean, attribute: "enable-file-upload" })
|
|
4519
|
-
],
|
|
4532
|
+
], g.prototype, "enableFileUpload", 2);
|
|
4520
4533
|
v([
|
|
4521
4534
|
r({ type: String, attribute: "upload-file-url" })
|
|
4522
|
-
],
|
|
4535
|
+
], g.prototype, "uploadFileUrl", 2);
|
|
4523
4536
|
v([
|
|
4524
4537
|
r({ type: Boolean, attribute: "open" })
|
|
4525
|
-
],
|
|
4538
|
+
], g.prototype, "open", 2);
|
|
4526
4539
|
v([
|
|
4527
4540
|
r({ type: Boolean })
|
|
4528
|
-
],
|
|
4541
|
+
], g.prototype, "loading", 2);
|
|
4529
4542
|
v([
|
|
4530
4543
|
r({ type: Boolean })
|
|
4531
|
-
],
|
|
4544
|
+
], g.prototype, "showSetting", 2);
|
|
4532
4545
|
v([
|
|
4533
4546
|
r({ type: Boolean })
|
|
4534
|
-
],
|
|
4547
|
+
], g.prototype, "showAuthAlert", 2);
|
|
4535
4548
|
v([
|
|
4536
4549
|
le("cb-message-list")
|
|
4537
|
-
],
|
|
4538
|
-
|
|
4550
|
+
], g.prototype, "_messageList", 2);
|
|
4551
|
+
g = v([
|
|
4539
4552
|
k("enegelai-bot")
|
|
4540
|
-
],
|
|
4553
|
+
], g);
|
|
4541
4554
|
export {
|
|
4542
|
-
|
|
4555
|
+
g as default
|
|
4543
4556
|
};
|