@2uinc/frontend-component-xpert-chatbot 1.36.0-alpha.14 → 1.36.0-alpha.15
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/lib/index.min.js +110 -116
- package/package.json +1 -1
package/dist/lib/index.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import yt, { createContext as Kr, useState as ce, useCallback as st, useEffect as
|
1
|
+
import yt, { createContext as Kr, useState as ce, useCallback as st, useEffect as Ne, useMemo as cn, useRef as tt, useContext as oe, forwardRef as ws, createElement as Za, useLayoutEffect as O0, memo as I0, Suspense as N0, Fragment as k0, StrictMode as L0 } from "react";
|
2
2
|
import w0, { render as R0 } from "react-dom";
|
3
3
|
var Sr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
4
4
|
function Mt(e) {
|
@@ -245,10 +245,10 @@ function j0() {
|
|
245
245
|
return Ou || (Ou = 1, function(e, t) {
|
246
246
|
var n = 200, r = "__lodash_hash_undefined__", a = 800, i = 16, u = 9007199254740991, s = "[object Arguments]", l = "[object Array]", c = "[object AsyncFunction]", d = "[object Boolean]", f = "[object Date]", p = "[object Error]", h = "[object Function]", E = "[object GeneratorFunction]", m = "[object Map]", y = "[object Number]", g = "[object Null]", P = "[object Object]", M = "[object Proxy]", W = "[object RegExp]", R = "[object Set]", _ = "[object String]", N = "[object Undefined]", $ = "[object WeakMap]", H = "[object ArrayBuffer]", te = "[object DataView]", Y = "[object Float32Array]", V = "[object Float64Array]", L = "[object Int8Array]", I = "[object Int16Array]", w = "[object Int32Array]", B = "[object Uint8Array]", G = "[object Uint8ClampedArray]", j = "[object Uint16Array]", q = "[object Uint32Array]", b = /[\\^$.*+?()[\]{}|]/g, ne = /^\[object .+?Constructor\]$/, le = /^(?:0|[1-9]\d*)$/, x = {};
|
247
247
|
x[Y] = x[V] = x[L] = x[I] = x[w] = x[B] = x[G] = x[j] = x[q] = !0, x[s] = x[l] = x[H] = x[d] = x[te] = x[f] = x[p] = x[h] = x[m] = x[y] = x[P] = x[W] = x[R] = x[_] = x[$] = !1;
|
248
|
-
var se = typeof Sr == "object" && Sr && Sr.Object === Object && Sr, ye = typeof self == "object" && self && self.Object === Object && self, me = se || ye || Function("return this")(), Ae = t && !t.nodeType && t,
|
248
|
+
var se = typeof Sr == "object" && Sr && Sr.Object === Object && Sr, ye = typeof self == "object" && self && self.Object === Object && self, me = se || ye || Function("return this")(), Ae = t && !t.nodeType && t, xe = Ae && !0 && e && !e.nodeType && e, Ue = xe && xe.exports === Ae, ve = Ue && se.process, Ze = function() {
|
249
249
|
try {
|
250
|
-
var A =
|
251
|
-
return A ||
|
250
|
+
var A = xe && xe.require && xe.require("util").types;
|
251
|
+
return A || ve && ve.binding && ve.binding("util");
|
252
252
|
} catch {
|
253
253
|
}
|
254
254
|
}(), ft = Ze && Ze.isTypedArray;
|
@@ -296,7 +296,7 @@ function j0() {
|
|
296
296
|
return A({}, "", {}), A;
|
297
297
|
} catch {
|
298
298
|
}
|
299
|
-
}(),
|
299
|
+
}(), Oe = X ? X.isBuffer : void 0, nt = Math.max, ze = Date.now, Vt = ca(me, "Map"), tn = ca(Object, "create"), kt = /* @__PURE__ */ function() {
|
300
300
|
function A() {
|
301
301
|
}
|
302
302
|
return function(k) {
|
@@ -667,7 +667,7 @@ function j0() {
|
|
667
667
|
function _0(A) {
|
668
668
|
return qn(A) && pa(A);
|
669
669
|
}
|
670
|
-
var mu =
|
670
|
+
var mu = Oe || v0;
|
671
671
|
function ma(A) {
|
672
672
|
if (!rn(A))
|
673
673
|
return !1;
|
@@ -1466,7 +1466,7 @@ const Ps = /* @__PURE__ */ Mt(q0), z0 = {
|
|
1466
1466
|
u(!0);
|
1467
1467
|
}
|
1468
1468
|
}, [t, r]);
|
1469
|
-
|
1469
|
+
Ne(() => {
|
1470
1470
|
c();
|
1471
1471
|
}, [c]);
|
1472
1472
|
const d = cn(
|
@@ -1581,7 +1581,7 @@ Ms.propTypes = {
|
|
1581
1581
|
xpertKey: v.string,
|
1582
1582
|
widgetMode: v.bool
|
1583
1583
|
};
|
1584
|
-
const Zt = Kr({}),
|
1584
|
+
const Zt = Kr({}), Ie = {
|
1585
1585
|
AGENT: "agent",
|
1586
1586
|
ASSISTANT: "assistant",
|
1587
1587
|
ERROR: "error",
|
@@ -1596,7 +1596,7 @@ const Zt = Kr({}), Ne = {
|
|
1596
1596
|
content: v.string.isRequired,
|
1597
1597
|
feedbackThumbType: v.oneOf(["DOWN", "UP"]),
|
1598
1598
|
liveAgent: v.bool,
|
1599
|
-
role: v.oneOf(Object.values(
|
1599
|
+
role: v.oneOf(Object.values(Ie)).isRequired,
|
1600
1600
|
timestamp: v.instanceOf(Date),
|
1601
1601
|
toolCalls: v.arrayOf(
|
1602
1602
|
v.shape({
|
@@ -1639,7 +1639,7 @@ const Iu = 991, Z0 = () => {
|
|
1639
1639
|
const [e, t] = ce(
|
1640
1640
|
window.innerWidth < Iu
|
1641
1641
|
);
|
1642
|
-
return
|
1642
|
+
return Ne(() => {
|
1643
1643
|
const n = () => {
|
1644
1644
|
t(window.innerWidth < Iu);
|
1645
1645
|
};
|
@@ -1765,7 +1765,7 @@ eyes follow your mouse when you hover near it.`, qs = ({
|
|
1765
1765
|
), i = tt(null), u = tt(!1), s = a ? (h = n == null ? void 0 : n.animatedGraduate) == null ? void 0 : h.delayMs : ((E = n == null ? void 0 : n.animatedGraduate) == null ? void 0 : E.delayMs) * 2, [l, c] = ce(!1), d = window.matchMedia(
|
1766
1766
|
`(max-width: ${tf}px)`
|
1767
1767
|
).matches;
|
1768
|
-
|
1768
|
+
Ne(() => {
|
1769
1769
|
const P = setTimeout(
|
1770
1770
|
() => {
|
1771
1771
|
c(!0);
|
@@ -1775,7 +1775,7 @@ eyes follow your mouse when you hover near it.`, qs = ({
|
|
1775
1775
|
return () => {
|
1776
1776
|
clearTimeout(P);
|
1777
1777
|
};
|
1778
|
-
}, [s]),
|
1778
|
+
}, [s]), Ne(() => {
|
1779
1779
|
const g = (P) => {
|
1780
1780
|
const M = window.devicePixelRatio > 1.5;
|
1781
1781
|
if (!(u != null && u.current) || d || M)
|
@@ -2479,8 +2479,8 @@ var Ru = {
|
|
2479
2479
|
G ? j = u.tabbableGroups[u.tabbableGroups.length - 1].lastTabbableNode : j = u.tabbableGroups[0].firstTabbableNode;
|
2480
2480
|
else if (G) {
|
2481
2481
|
var ne = u.tabbableGroups.findIndex(function(Ae) {
|
2482
|
-
var
|
2483
|
-
return I ===
|
2482
|
+
var xe = Ae.firstTabbableNode;
|
2483
|
+
return I === xe;
|
2484
2484
|
});
|
2485
2485
|
if (ne < 0 && (b.container === I || Rr(I, i.tabbableOptions) && !sn(I, i.tabbableOptions) && !b.nextTabbableNode(I, !1)) && (ne = q), ne >= 0) {
|
2486
2486
|
var le = ne === 0 ? u.tabbableGroups.length - 1 : ne - 1, x = u.tabbableGroups[le];
|
@@ -2488,8 +2488,8 @@ var Ru = {
|
|
2488
2488
|
} else tr(w) || (j = b.nextTabbableNode(I, !1));
|
2489
2489
|
} else {
|
2490
2490
|
var se = u.tabbableGroups.findIndex(function(Ae) {
|
2491
|
-
var
|
2492
|
-
return I ===
|
2491
|
+
var xe = Ae.lastTabbableNode;
|
2492
|
+
return I === xe;
|
2493
2493
|
});
|
2494
2494
|
if (se < 0 && (b.container === I || Rr(I, i.tabbableOptions) && !sn(I, i.tabbableOptions) && !b.nextTabbableNode(I)) && (se = q), se >= 0) {
|
2495
2495
|
var ye = se === u.tabbableGroups.length - 1 ? 0 : se + 1, me = u.tabbableGroups[ye];
|
@@ -3047,7 +3047,7 @@ el.propTypes = {
|
|
3047
3047
|
};
|
3048
3048
|
const tl = () => {
|
3049
3049
|
const { disclaimer: e } = oe(Ye), t = tt(null);
|
3050
|
-
return
|
3050
|
+
return Ne(() => {
|
3051
3051
|
var n;
|
3052
3052
|
(n = t == null ? void 0 : t.current) == null || n.focus();
|
3053
3053
|
}, []), /* @__PURE__ */ S.jsxs(
|
@@ -4262,7 +4262,7 @@ function pl(e) {
|
|
4262
4262
|
});
|
4263
4263
|
} else m && ((h = e.onLoad) === null || h === void 0 || h.call(e, E));
|
4264
4264
|
}
|
4265
|
-
|
4265
|
+
Ne(() => (n(!0), l), []), Ne(() => {
|
4266
4266
|
t && d();
|
4267
4267
|
}, [e.icon, t]);
|
4268
4268
|
const { name: f, data: p } = u;
|
@@ -4296,10 +4296,10 @@ function Li({
|
|
4296
4296
|
), m = () => {
|
4297
4297
|
h(""), r.current && (r.current.style.height = "auto");
|
4298
4298
|
}, y = e || d || f;
|
4299
|
-
|
4299
|
+
Ne(() => {
|
4300
4300
|
var W;
|
4301
4301
|
i.current && !y && ((W = r.current) == null || W.focus()), i.current = y;
|
4302
|
-
}, [y, r]),
|
4302
|
+
}, [y, r]), Ne(() => {
|
4303
4303
|
var W;
|
4304
4304
|
(l || c) && ((W = r.current) == null || W.focus());
|
4305
4305
|
}, [c, l, r]);
|
@@ -4371,7 +4371,7 @@ Li.propTypes = {
|
|
4371
4371
|
};
|
4372
4372
|
const ui = ({ content: e = "Please try again later." }) => {
|
4373
4373
|
const t = tt(null);
|
4374
|
-
return
|
4374
|
+
return Ne(() => {
|
4375
4375
|
var n;
|
4376
4376
|
(n = t.current) == null || n.scrollIntoView({
|
4377
4377
|
behavior: "instant"
|
@@ -7182,14 +7182,14 @@ function tm(e, t, n) {
|
|
7182
7182
|
) : ne(I);
|
7183
7183
|
function ne(me) {
|
7184
7184
|
return Ae;
|
7185
|
-
function Ae(
|
7186
|
-
const Ue =
|
7185
|
+
function Ae(xe) {
|
7186
|
+
const Ue = xe !== null && me[xe], ve = xe !== null && me.null, Ze = [
|
7187
7187
|
// To do: add more extension tests.
|
7188
7188
|
/* c8 ignore next 2 */
|
7189
7189
|
...Array.isArray(Ue) ? Ue : Ue ? [Ue] : [],
|
7190
|
-
...Array.isArray(
|
7190
|
+
...Array.isArray(ve) ? ve : ve ? [ve] : []
|
7191
7191
|
];
|
7192
|
-
return le(Ze)(
|
7192
|
+
return le(Ze)(xe);
|
7193
7193
|
}
|
7194
7194
|
}
|
7195
7195
|
function le(me) {
|
@@ -7197,7 +7197,7 @@ function tm(e, t, n) {
|
|
7197
7197
|
}
|
7198
7198
|
function x(me) {
|
7199
7199
|
return Ae;
|
7200
|
-
function Ae(
|
7200
|
+
function Ae(xe) {
|
7201
7201
|
return b = H(), q = me, me.partial || (c.currentConstruct = me), me.name && c.parser.constructs.disable.null.includes(me.name) ? ye() : me.tokenize.call(
|
7202
7202
|
// If we do have fields, create an object w/ `context` as its
|
7203
7203
|
// prototype.
|
@@ -7206,7 +7206,7 @@ function tm(e, t, n) {
|
|
7206
7206
|
l,
|
7207
7207
|
se,
|
7208
7208
|
ye
|
7209
|
-
)(
|
7209
|
+
)(xe);
|
7210
7210
|
}
|
7211
7211
|
}
|
7212
7212
|
function se(me) {
|
@@ -7517,13 +7517,13 @@ function _m(e) {
|
|
7517
7517
|
atxHeading: d(),
|
7518
7518
|
atxHeadingSequence: N,
|
7519
7519
|
autolink: d(),
|
7520
|
-
autolinkEmail:
|
7520
|
+
autolinkEmail: ve,
|
7521
7521
|
autolinkProtocol: Ue,
|
7522
7522
|
blockQuote: d(),
|
7523
7523
|
characterEscapeValue: V,
|
7524
7524
|
characterReferenceMarkerHexadecimal: Ae,
|
7525
7525
|
characterReferenceMarkerNumeric: Ae,
|
7526
|
-
characterReferenceValue:
|
7526
|
+
characterReferenceValue: xe,
|
7527
7527
|
codeFenced: d(P),
|
7528
7528
|
codeFencedFence: g,
|
7529
7529
|
codeFencedFenceInfo: m,
|
@@ -7630,8 +7630,8 @@ function _m(e) {
|
|
7630
7630
|
function a(F, X, re) {
|
7631
7631
|
let ue = X - 1, pe = -1, Me = !1, at, je, Je, it;
|
7632
7632
|
for (; ++ue <= re; ) {
|
7633
|
-
const
|
7634
|
-
if (
|
7633
|
+
const Oe = F[ue];
|
7634
|
+
if (Oe[1].type === "listUnordered" || Oe[1].type === "listOrdered" || Oe[1].type === "blockQuote" ? (Oe[0] === "enter" ? pe++ : pe--, it = void 0) : Oe[1].type === "lineEndingBlank" ? Oe[0] === "enter" && (at && !it && !pe && !Je && (Je = ue), it = void 0) : Oe[1].type === "linePrefix" || Oe[1].type === "listItemValue" || Oe[1].type === "listItemMarker" || Oe[1].type === "listItemPrefix" || Oe[1].type === "listItemPrefixWhitespace" || (it = void 0), !pe && Oe[0] === "enter" && Oe[1].type === "listItemPrefix" || pe === -1 && Oe[0] === "exit" && (Oe[1].type === "listUnordered" || Oe[1].type === "listOrdered")) {
|
7635
7635
|
if (at) {
|
7636
7636
|
let nt = ue;
|
7637
7637
|
for (je = void 0; nt--; ) {
|
@@ -7643,16 +7643,16 @@ function _m(e) {
|
|
7643
7643
|
}
|
7644
7644
|
Je && (!je || Je < je) && (at._spread = !0), at.end = Object.assign(
|
7645
7645
|
{},
|
7646
|
-
je ? F[je][1].start :
|
7647
|
-
), F.splice(je || ue, 0, ["exit", at,
|
7646
|
+
je ? F[je][1].start : Oe[1].end
|
7647
|
+
), F.splice(je || ue, 0, ["exit", at, Oe[2]]), ue++, re++;
|
7648
7648
|
}
|
7649
|
-
|
7649
|
+
Oe[1].type === "listItemPrefix" && (at = {
|
7650
7650
|
type: "listItem",
|
7651
7651
|
_spread: !1,
|
7652
|
-
start: Object.assign({},
|
7652
|
+
start: Object.assign({}, Oe[1].start),
|
7653
7653
|
// @ts-expect-error: we’ll add `end` in a second.
|
7654
7654
|
end: void 0
|
7655
|
-
}, F.splice(ue, 0, ["enter", at,
|
7655
|
+
}, F.splice(ue, 0, ["enter", at, Oe[2]]), ue++, re++, Je = void 0, it = !0);
|
7656
7656
|
}
|
7657
7657
|
}
|
7658
7658
|
return F[X][1]._spread = Me, re;
|
@@ -7848,7 +7848,7 @@ function _m(e) {
|
|
7848
7848
|
function Ae(F) {
|
7849
7849
|
i("characterReferenceType", F.type);
|
7850
7850
|
}
|
7851
|
-
function
|
7851
|
+
function xe(F) {
|
7852
7852
|
const X = this.sliceSerialize(F), re = u("characterReferenceType");
|
7853
7853
|
let ue;
|
7854
7854
|
re ? (ue = kl(
|
@@ -7863,7 +7863,7 @@ function _m(e) {
|
|
7863
7863
|
const X = this.stack[this.stack.length - 1];
|
7864
7864
|
X.url = this.sliceSerialize(F);
|
7865
7865
|
}
|
7866
|
-
function
|
7866
|
+
function ve(F) {
|
7867
7867
|
V.call(this, F);
|
7868
7868
|
const X = this.stack[this.stack.length - 1];
|
7869
7869
|
X.url = "mailto:" + this.sliceSerialize(F);
|
@@ -19406,11 +19406,11 @@ function DT() {
|
|
19406
19406
|
}, w.valueOf = function() {
|
19407
19407
|
return this.$d.getTime();
|
19408
19408
|
}, w.startOf = function(B, G) {
|
19409
|
-
var j = this, q = !!Y.u(G) || G, b = Y.p(B), ne = function(Ue,
|
19410
|
-
var Ze = Y.w(j.$u ? Date.UTC(j.$y,
|
19409
|
+
var j = this, q = !!Y.u(G) || G, b = Y.p(B), ne = function(Ue, ve) {
|
19410
|
+
var Ze = Y.w(j.$u ? Date.UTC(j.$y, ve, Ue) : new Date(j.$y, ve, Ue), j);
|
19411
19411
|
return q ? Ze : Ze.endOf(c);
|
19412
|
-
}, le = function(Ue,
|
19413
|
-
return Y.w(j.toDate()[Ue].apply(j.toDate("s"), (q ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(
|
19412
|
+
}, le = function(Ue, ve) {
|
19413
|
+
return Y.w(j.toDate()[Ue].apply(j.toDate("s"), (q ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ve)), j);
|
19414
19414
|
}, x = this.$W, se = this.$M, ye = this.$D, me = "set" + (this.$u ? "UTC" : "");
|
19415
19415
|
switch (b) {
|
19416
19416
|
case h:
|
@@ -19418,8 +19418,8 @@ function DT() {
|
|
19418
19418
|
case f:
|
19419
19419
|
return q ? ne(1, se) : ne(0, se + 1);
|
19420
19420
|
case d:
|
19421
|
-
var Ae = this.$locale().weekStart || 0,
|
19422
|
-
return ne(q ? ye -
|
19421
|
+
var Ae = this.$locale().weekStart || 0, xe = (x < Ae ? x + 7 : x) - Ae;
|
19422
|
+
return ne(q ? ye - xe : ye + (6 - xe), se);
|
19423
19423
|
case c:
|
19424
19424
|
case E:
|
19425
19425
|
return le(me + "Hours", 0);
|
@@ -19463,15 +19463,15 @@ function DT() {
|
|
19463
19463
|
}, w.format = function(B) {
|
19464
19464
|
var G = this, j = this.$locale();
|
19465
19465
|
if (!this.isValid()) return j.invalidDate || m;
|
19466
|
-
var q = B || "YYYY-MM-DDTHH:mm:ssZ", b = Y.z(this), ne = this.$H, le = this.$m, x = this.$M, se = j.weekdays, ye = j.months, me = j.meridiem, Ae = function(
|
19467
|
-
return
|
19468
|
-
},
|
19469
|
-
return Y.s(ne % 12 || 12,
|
19470
|
-
}, Ue = me || function(
|
19471
|
-
var It =
|
19466
|
+
var q = B || "YYYY-MM-DDTHH:mm:ssZ", b = Y.z(this), ne = this.$H, le = this.$m, x = this.$M, se = j.weekdays, ye = j.months, me = j.meridiem, Ae = function(ve, Ze, ft, It) {
|
19467
|
+
return ve && (ve[Ze] || ve(G, q)) || ft[Ze].slice(0, It);
|
19468
|
+
}, xe = function(ve) {
|
19469
|
+
return Y.s(ne % 12 || 12, ve, "0");
|
19470
|
+
}, Ue = me || function(ve, Ze, ft) {
|
19471
|
+
var It = ve < 12 ? "AM" : "PM";
|
19472
19472
|
return ft ? It.toLowerCase() : It;
|
19473
19473
|
};
|
19474
|
-
return q.replace(g, function(
|
19474
|
+
return q.replace(g, function(ve, Ze) {
|
19475
19475
|
return Ze || function(ft) {
|
19476
19476
|
switch (ft) {
|
19477
19477
|
case "YY":
|
@@ -19503,9 +19503,9 @@ function DT() {
|
|
19503
19503
|
case "HH":
|
19504
19504
|
return Y.s(ne, 2, "0");
|
19505
19505
|
case "h":
|
19506
|
-
return
|
19506
|
+
return xe(1);
|
19507
19507
|
case "hh":
|
19508
|
-
return
|
19508
|
+
return xe(2);
|
19509
19509
|
case "a":
|
19510
19510
|
return Ue(ne, le, !0);
|
19511
19511
|
case "A":
|
@@ -19524,7 +19524,7 @@ function DT() {
|
|
19524
19524
|
return b;
|
19525
19525
|
}
|
19526
19526
|
return null;
|
19527
|
-
}(
|
19527
|
+
}(ve) || b.replace(":", "");
|
19528
19528
|
});
|
19529
19529
|
}, w.utcOffset = function() {
|
19530
19530
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
@@ -19665,7 +19665,7 @@ function tu({
|
|
19665
19665
|
},
|
19666
19666
|
[a]
|
19667
19667
|
);
|
19668
|
-
|
19668
|
+
Ne(() => {
|
19669
19669
|
var N, $, H, te;
|
19670
19670
|
let R, _;
|
19671
19671
|
return (N = h == null ? void 0 : h.liveChat) != null && N.useOwnChat && (_ = setTimeout(() => {
|
@@ -19917,7 +19917,7 @@ const zT = () => /* @__PURE__ */ S.jsx(
|
|
19917
19917
|
}
|
19918
19918
|
), od = ({ src: e, alt: t, ...n }) => {
|
19919
19919
|
const { streaming: r } = oe(Xe), a = tt(null), [i, u] = ce(!1), [s, l] = ce(!0), [c, d] = ce(!1);
|
19920
|
-
return
|
19920
|
+
return Ne(() => {
|
19921
19921
|
const f = a.current;
|
19922
19922
|
if (!f) return;
|
19923
19923
|
const p = new IntersectionObserver(
|
@@ -19929,9 +19929,7 @@ const zT = () => /* @__PURE__ */ S.jsx(
|
|
19929
19929
|
return p.observe(f), () => {
|
19930
19930
|
p.disconnect();
|
19931
19931
|
};
|
19932
|
-
}, []),
|
19933
|
-
!i || !s || l(!1);
|
19934
|
-
}, [i, s]), /* @__PURE__ */ S.jsxs(
|
19932
|
+
}, []), /* @__PURE__ */ S.jsxs(
|
19935
19933
|
"div",
|
19936
19934
|
{
|
19937
19935
|
ref: a,
|
@@ -19963,7 +19961,6 @@ const zT = () => /* @__PURE__ */ S.jsx(
|
|
19963
19961
|
maxWidth: "100%",
|
19964
19962
|
maxHeight: "1280px",
|
19965
19963
|
objectFit: "contain",
|
19966
|
-
display: s ? "none" : "block",
|
19967
19964
|
borderRadius: "8px",
|
19968
19965
|
margin: "0.5rem 0",
|
19969
19966
|
alignSelf: "center"
|
@@ -20006,10 +20003,7 @@ const WT = (e) => ({
|
|
20006
20003
|
}
|
20007
20004
|
}
|
20008
20005
|
})[e] ?? ((n) => n), GT = (e, t = !1) => {
|
20009
|
-
t && (e = e.replace(
|
20010
|
-
/!\[[^\]]*(?:\][^(]*)?(?:\([^)]+)?\)?/g,
|
20011
|
-
""
|
20012
|
-
));
|
20006
|
+
t && (e = e.replace(/!\[[^\]]*(?:\][^(]*)?(?:\([^)]+)?\)?/g, "![]()"));
|
20013
20007
|
const r = new DOMParser().parseFromString(e, "text/html");
|
20014
20008
|
let a = 1;
|
20015
20009
|
const i = (u) => {
|
@@ -20083,9 +20077,9 @@ const WT = (e) => ({
|
|
20083
20077
|
content: p,
|
20084
20078
|
disableFeedback: h,
|
20085
20079
|
liveAgent: E,
|
20086
|
-
role: m =
|
20080
|
+
role: m = Ie.ASSISTANT,
|
20087
20081
|
timestamp: y
|
20088
|
-
} = n ?? {}, g = m ===
|
20082
|
+
} = n ?? {}, g = m === Ie.TOOL ? Ie.ASSISTANT : m, P = E || l === Fs.ESCALATE_TO_AN_AGENT, M = !P && !!p, W = cn(
|
20089
20083
|
() => {
|
20090
20084
|
var $;
|
20091
20085
|
return KT(
|
@@ -20134,7 +20128,7 @@ const WT = (e) => ({
|
|
20134
20128
|
className: "xpert-chatbot-popup__bubble--group-inner",
|
20135
20129
|
style: W[g].innerStyle,
|
20136
20130
|
children: [
|
20137
|
-
g ===
|
20131
|
+
g === Ie.AGENT && /* @__PURE__ */ S.jsx(
|
20138
20132
|
xi,
|
20139
20133
|
{
|
20140
20134
|
alignSelf: "flex-end",
|
@@ -20168,7 +20162,7 @@ const WT = (e) => ({
|
|
20168
20162
|
]
|
20169
20163
|
}
|
20170
20164
|
),
|
20171
|
-
g ===
|
20165
|
+
g === Ie.USER && /* @__PURE__ */ S.jsx(
|
20172
20166
|
xi,
|
20173
20167
|
{
|
20174
20168
|
alignSelf: "flex-end",
|
@@ -20180,7 +20174,7 @@ const WT = (e) => ({
|
|
20180
20174
|
}
|
20181
20175
|
),
|
20182
20176
|
y && /* @__PURE__ */ S.jsx("div", { className: "xpert-chatbot-popup__bubble--timestamp", children: MT(y).format("hh:mm a") }),
|
20183
|
-
!h && a && g ===
|
20177
|
+
!h && a && g === Ie.ASSISTANT && /* @__PURE__ */ S.jsx(
|
20184
20178
|
ad,
|
20185
20179
|
{
|
20186
20180
|
id: e,
|
@@ -20207,7 +20201,7 @@ ru.displayName = "MessageBubble";
|
|
20207
20201
|
const sd = I0(ru);
|
20208
20202
|
function au({ message: e }) {
|
20209
20203
|
const { content: t, icon: n, iconColor: r, role: a } = e;
|
20210
|
-
return a !==
|
20204
|
+
return a !== Ie.NOTIFICATION ? null : /* @__PURE__ */ S.jsxs("div", { className: "notification-container", children: [
|
20211
20205
|
/* @__PURE__ */ S.jsx(
|
20212
20206
|
"div",
|
20213
20207
|
{
|
@@ -20224,13 +20218,13 @@ au.propTypes = {
|
|
20224
20218
|
content: v.string,
|
20225
20219
|
icon: v.string,
|
20226
20220
|
iconColor: v.string,
|
20227
|
-
role: v.oneOf([
|
20221
|
+
role: v.oneOf([Ie.NOTIFICATION])
|
20228
20222
|
}).isRequired
|
20229
20223
|
};
|
20230
20224
|
au.displayName = "NotificationMessage";
|
20231
20225
|
function ld({ disableScroll: e }) {
|
20232
20226
|
const t = tt(null), { streaming: n } = oe(Xe);
|
20233
|
-
return
|
20227
|
+
return Ne(() => {
|
20234
20228
|
var r;
|
20235
20229
|
e || (r = t.current) == null || r.scrollIntoView({
|
20236
20230
|
behavior: "smooth",
|
@@ -20283,16 +20277,16 @@ const oa = ({
|
|
20283
20277
|
style: { display: "flex", flexDirection: "column" },
|
20284
20278
|
children: n.map((f, p) => {
|
20285
20279
|
const { role: h } = f, E = `${h}-${p}`;
|
20286
|
-
if (h ===
|
20280
|
+
if (h === Ie.ERROR)
|
20287
20281
|
return /* @__PURE__ */ S.jsx(ui, { content: f == null ? void 0 : f.content }, E);
|
20288
|
-
if (h ===
|
20282
|
+
if (h === Ie.NOTIFICATION)
|
20289
20283
|
return /* @__PURE__ */ S.jsx(au, { message: f }, E);
|
20290
20284
|
if (![
|
20291
|
-
|
20292
|
-
|
20293
|
-
|
20294
|
-
|
20295
|
-
|
20285
|
+
Ie.AGENT,
|
20286
|
+
Ie.ASSISTANT,
|
20287
|
+
Ie.INFO,
|
20288
|
+
Ie.TOOL,
|
20289
|
+
Ie.USER
|
20296
20290
|
].includes(h) || !f.content) return null;
|
20297
20291
|
const m = d[f.toolCallId];
|
20298
20292
|
return /* @__PURE__ */ S.jsx(
|
@@ -20422,16 +20416,16 @@ const dd = ({ chatContentRef: e, messages: t }) => {
|
|
20422
20416
|
behavior: "smooth"
|
20423
20417
|
}), u.current && u.current.focus();
|
20424
20418
|
};
|
20425
|
-
return
|
20419
|
+
return Ne(() => {
|
20426
20420
|
const c = e.current;
|
20427
20421
|
if (c)
|
20428
20422
|
return c.addEventListener("scroll", s), () => c.removeEventListener("scroll", s);
|
20429
|
-
}, [e, s]),
|
20423
|
+
}, [e, s]), Ne(() => {
|
20430
20424
|
!n && e.current && e.current.scrollTo({
|
20431
20425
|
top: e.current.scrollHeight,
|
20432
20426
|
behavior: "smooth"
|
20433
20427
|
});
|
20434
|
-
}, [n, e]), n ? null : /* @__PURE__ */ S.jsx("div", { ref: u, tabIndex: -1, children: (a || r) && t.find((c) => c.role ===
|
20428
|
+
}, [n, e]), n ? null : /* @__PURE__ */ S.jsx("div", { ref: u, tabIndex: -1, children: (a || r) && t.find((c) => c.role === Ie.ASSISTANT) && /* @__PURE__ */ S.jsx(
|
20435
20429
|
"button",
|
20436
20430
|
{
|
20437
20431
|
onClick: l,
|
@@ -20479,7 +20473,7 @@ function fd({
|
|
20479
20473
|
{
|
20480
20474
|
message: {
|
20481
20475
|
content: s == null ? void 0 : s.systemMessage,
|
20482
|
-
role:
|
20476
|
+
role: Ie.ASSISTANT
|
20483
20477
|
}
|
20484
20478
|
}
|
20485
20479
|
),
|
@@ -21176,9 +21170,9 @@ function cu() {
|
|
21176
21170
|
});
|
21177
21171
|
}, ye = function(Ae) {
|
21178
21172
|
b || (0, i.flushSync)(function() {
|
21179
|
-
return W(function(
|
21173
|
+
return W(function(xe) {
|
21180
21174
|
var Ue;
|
21181
|
-
return e(e({},
|
21175
|
+
return e(e({}, xe), _.current && (Ue = {}, Ue[_.current] = Ae, Ue));
|
21182
21176
|
});
|
21183
21177
|
});
|
21184
21178
|
}, ne && (q = (0, s.createOrJoinSocket)(N, _.current, ye, L, se, $, H, te, B)), [
|
@@ -21390,7 +21384,7 @@ const l3 = "This conversation with a live agent has ended. Please note that a tr
|
|
21390
21384
|
}, $ = () => {
|
21391
21385
|
r({
|
21392
21386
|
content: l3,
|
21393
|
-
role:
|
21387
|
+
role: Ie.INFO
|
21394
21388
|
}), H();
|
21395
21389
|
}, H = () => {
|
21396
21390
|
d(""), E(null), y($t.FORM), i(vt.XPERT);
|
@@ -21408,7 +21402,7 @@ const l3 = "This conversation with a live agent has ended. Please note that a tr
|
|
21408
21402
|
M({
|
21409
21403
|
content: b ?? "",
|
21410
21404
|
id: q ?? "",
|
21411
|
-
role:
|
21405
|
+
role: Ie.AGENT,
|
21412
21406
|
timestamp: ne ? new Date(ne) : void 0
|
21413
21407
|
}), R({
|
21414
21408
|
action: "sendmessage",
|
@@ -21431,7 +21425,7 @@ const l3 = "This conversation with a live agent has ended. Please note that a tr
|
|
21431
21425
|
M({
|
21432
21426
|
content: j,
|
21433
21427
|
id: "",
|
21434
|
-
role:
|
21428
|
+
role: Ie.USER,
|
21435
21429
|
timestamp: /* @__PURE__ */ new Date()
|
21436
21430
|
}), R({
|
21437
21431
|
action: "sendmessage",
|
@@ -21465,7 +21459,7 @@ const l3 = "This conversation with a live agent has ended. Please note that a tr
|
|
21465
21459
|
content: "Feedback submitted",
|
21466
21460
|
icon: "check",
|
21467
21461
|
iconColor: "#30A171",
|
21468
|
-
role:
|
21462
|
+
role: Ie.NOTIFICATION
|
21469
21463
|
}), $();
|
21470
21464
|
},
|
21471
21465
|
terminateConversation: N
|
@@ -21624,7 +21618,7 @@ function Ed({
|
|
21624
21618
|
}) {
|
21625
21619
|
var c, d, f, p, h, E, m, y, g, P, M, W, R, _, N;
|
21626
21620
|
const { primaryColor: a, conversationScreen: i } = oe(Ye), { isMobile: u, mode: s } = oe(Xe), { step: l } = oe(En);
|
21627
|
-
return
|
21621
|
+
return Ne(() => {
|
21628
21622
|
const $ = document.getElementById("header-mobile");
|
21629
21623
|
return $ && ($.style.display = "none"), () => {
|
21630
21624
|
$ && ($.style.display = "");
|
@@ -21885,7 +21879,7 @@ function g3(e, t) {
|
|
21885
21879
|
},
|
21886
21880
|
[n, e, t]
|
21887
21881
|
);
|
21888
|
-
return
|
21882
|
+
return Ne(() => () => {
|
21889
21883
|
clearTimeout(a.current);
|
21890
21884
|
}, []), i;
|
21891
21885
|
}
|
@@ -22004,7 +21998,7 @@ function Cd() {
|
|
22004
21998
|
}, M = () => {
|
22005
21999
|
W() && n(l);
|
22006
22000
|
};
|
22007
|
-
|
22001
|
+
Ne(() => {
|
22008
22002
|
(!a || a.length === 0) && n();
|
22009
22003
|
}, [a, n]);
|
22010
22004
|
const W = () => {
|
@@ -22123,16 +22117,16 @@ function Sd({
|
|
22123
22117
|
}) {
|
22124
22118
|
var E;
|
22125
22119
|
const { proactiveMessage: u } = oe(Ye), [s, l] = ce(!0), [c, d] = ce(!1), f = s && (!(window != null && window.OnetrustActiveGroups) || ((E = window == null ? void 0 : window.OnetrustActiveGroups) == null ? void 0 : E.includes("C0003"))) && lt.get(t) === void 0;
|
22126
|
-
|
22120
|
+
Ne(() => {
|
22127
22121
|
var m;
|
22128
22122
|
(m = window == null ? void 0 : window.OneTrust) == null || m.OnConsentChanged(() => {
|
22129
22123
|
var y;
|
22130
22124
|
!((y = window == null ? void 0 : window.OnetrustActiveGroups) != null && y.includes("C0003")) && lt.get(t) !== void 0 && lt.remove(t);
|
22131
22125
|
});
|
22132
|
-
}, [t]),
|
22126
|
+
}, [t]), Ne(() => {
|
22133
22127
|
var m;
|
22134
22128
|
a || (!(window != null && window.OnetrustActiveGroups) || (m = window == null ? void 0 : window.OnetrustActiveGroups) != null && m.includes("C0003")) && h(t, 1, 1);
|
22135
|
-
}, [t, a]),
|
22129
|
+
}, [t, a]), Ne(() => {
|
22136
22130
|
if (u != null && u.enabled && (u == null ? void 0 : u.delayMs) > 0) {
|
22137
22131
|
const m = setTimeout(() => {
|
22138
22132
|
d(!0);
|
@@ -22209,9 +22203,9 @@ function _3(e, t, n) {
|
|
22209
22203
|
},
|
22210
22204
|
[n]
|
22211
22205
|
);
|
22212
|
-
|
22206
|
+
Ne(() => (e && window.addEventListener("message", r), () => {
|
22213
22207
|
window.removeEventListener("message", r);
|
22214
|
-
}), [e, r]),
|
22208
|
+
}), [e, r]), Ne(() => {
|
22215
22209
|
let a;
|
22216
22210
|
return e && (a = document.createElement("style"), document.head.appendChild(a), ((u) => {
|
22217
22211
|
a.innerHTML = `
|
@@ -22233,7 +22227,7 @@ function _3(e, t, n) {
|
|
22233
22227
|
}
|
22234
22228
|
function C3(e) {
|
22235
22229
|
const [t, n] = ce(null);
|
22236
|
-
return
|
22230
|
+
return Ne(() => {
|
22237
22231
|
try {
|
22238
22232
|
(() => {
|
22239
22233
|
var a, i, u;
|
@@ -22258,7 +22252,7 @@ function C3(e) {
|
|
22258
22252
|
}, [e]), t;
|
22259
22253
|
}
|
22260
22254
|
function A3(e) {
|
22261
|
-
|
22255
|
+
Ne(() => {
|
22262
22256
|
const t = () => document.visibilityState === "visible" && e();
|
22263
22257
|
return document.addEventListener("visibilitychange", t), () => {
|
22264
22258
|
document.removeEventListener("visibilitychange", t);
|
@@ -22315,7 +22309,7 @@ function xd({ submitEventExternal: e = null }) {
|
|
22315
22309
|
setLoading: _,
|
22316
22310
|
setStreaming: N
|
22317
22311
|
} = oe(Xe), [, $] = ce(!1), [, H] = ce(!1), [te, Y] = ce(!1), [V, L] = ce(!1), [I, w] = ce(!1), B = te || !c, G = tt(null), j = tt(null), q = lt.get(`${a}-test`) === "1";
|
22318
|
-
|
22312
|
+
Ne(() => {
|
22319
22313
|
g === vt.XPERT && B && G.current && G.current.focus();
|
22320
22314
|
}, [g, B]), _3(
|
22321
22315
|
(en = r == null ? void 0 : r.liveChat) == null ? void 0 : en.enabled,
|
@@ -22391,7 +22385,7 @@ function xd({ submitEventExternal: e = null }) {
|
|
22391
22385
|
}, le = ((yn = r == null ? void 0 : r.conversationHistory) == null ? void 0 : yn.enabled) && B && !V;
|
22392
22386
|
A3(
|
22393
22387
|
() => le && ne()
|
22394
|
-
),
|
22388
|
+
), Ne(() => {
|
22395
22389
|
let ie, Ee;
|
22396
22390
|
if (n)
|
22397
22391
|
return s != null && s.enabled && (ie = setInterval(() => {
|
@@ -22407,7 +22401,7 @@ function xd({ submitEventExternal: e = null }) {
|
|
22407
22401
|
e,
|
22408
22402
|
s == null ? void 0 : s.enabled,
|
22409
22403
|
s == null ? void 0 : s.prefix
|
22410
|
-
]),
|
22404
|
+
]), Ne(() => {
|
22411
22405
|
let ie, Ee;
|
22412
22406
|
const Se = () => {
|
22413
22407
|
l != null && l.enabled && window.optimizely && window.experiments && (clearInterval(ie), clearTimeout(Ee), H(!0));
|
@@ -22478,7 +22472,7 @@ function xd({ submitEventExternal: e = null }) {
|
|
22478
22472
|
content: je,
|
22479
22473
|
live_agent: Je,
|
22480
22474
|
role: it,
|
22481
|
-
tool_calls:
|
22475
|
+
tool_calls: Oe,
|
22482
22476
|
tool_call_id: nt
|
22483
22477
|
}) => {
|
22484
22478
|
h({
|
@@ -22486,7 +22480,7 @@ function xd({ submitEventExternal: e = null }) {
|
|
22486
22480
|
createdAt: /* @__PURE__ */ new Date(),
|
22487
22481
|
liveAgent: Je,
|
22488
22482
|
role: it,
|
22489
|
-
toolCalls:
|
22483
|
+
toolCalls: Oe,
|
22490
22484
|
toolCallId: nt
|
22491
22485
|
});
|
22492
22486
|
}
|
@@ -22512,7 +22506,7 @@ function xd({ submitEventExternal: e = null }) {
|
|
22512
22506
|
if (Je) break;
|
22513
22507
|
const it = X.decode(je, { stream: !0 });
|
22514
22508
|
try {
|
22515
|
-
const
|
22509
|
+
const Oe = it.match(/\[.*?\](?=\[|$)/gs), nt = JSON.parse(Oe[Oe.length - 1]).map(
|
22516
22510
|
(ze) => ({
|
22517
22511
|
content: ze.content,
|
22518
22512
|
createdAt: pe,
|
@@ -22553,7 +22547,7 @@ function xd({ submitEventExternal: e = null }) {
|
|
22553
22547
|
}
|
22554
22548
|
const Me = ((at = re.find((je) => je.content)) == null ? void 0 : at.content) || "";
|
22555
22549
|
return se(Me, Ee), re;
|
22556
|
-
},
|
22550
|
+
}, xe = async (ie, Ee, Se, qe, F) => {
|
22557
22551
|
N(!0);
|
22558
22552
|
const X = ie.body.getReader(), re = await Ae(
|
22559
22553
|
X,
|
@@ -22570,7 +22564,7 @@ function xd({ submitEventExternal: e = null }) {
|
|
22570
22564
|
return;
|
22571
22565
|
const Se = /* @__PURE__ */ new Date();
|
22572
22566
|
W(!1), M(!1);
|
22573
|
-
const qe = m.filter((ue) => ue.role ===
|
22567
|
+
const qe = m.filter((ue) => ue.role === Ie.USER).length + 1;
|
22574
22568
|
if (b({
|
22575
22569
|
name: `${s.prefix}.bi.xpert.chatbot.popup.chat.message.sent`,
|
22576
22570
|
payload: {
|
@@ -22585,10 +22579,10 @@ function xd({ submitEventExternal: e = null }) {
|
|
22585
22579
|
return;
|
22586
22580
|
}
|
22587
22581
|
let F = null;
|
22588
|
-
r.conversationHistory.enabled && (F = Ls(a)), h({ role:
|
22582
|
+
r.conversationHistory.enabled && (F = Ls(a)), h({ role: Ie.USER, content: ie });
|
22589
22583
|
const X = [
|
22590
22584
|
...m,
|
22591
|
-
{ role:
|
22585
|
+
{ role: Ie.USER, content: ie }
|
22592
22586
|
].map((ue) => ({
|
22593
22587
|
role: ue.role,
|
22594
22588
|
content: ue.content,
|
@@ -22596,9 +22590,9 @@ function xd({ submitEventExternal: e = null }) {
|
|
22596
22590
|
...ue.toolCallId && { tool_call_id: ue.toolCallId }
|
22597
22591
|
})).filter(
|
22598
22592
|
({ role: ue }) => [
|
22599
|
-
|
22600
|
-
|
22601
|
-
|
22593
|
+
Ie.ASSISTANT,
|
22594
|
+
Ie.TOOL,
|
22595
|
+
Ie.USER
|
22602
22596
|
].includes(ue)
|
22603
22597
|
), re = await fetch(t.endpoint, {
|
22604
22598
|
method: "POST",
|
@@ -22613,7 +22607,7 @@ function xd({ submitEventExternal: e = null }) {
|
|
22613
22607
|
});
|
22614
22608
|
if (!re.ok)
|
22615
22609
|
throw new Error(`HTTPError: ${re.status} ${re.statusText}`);
|
22616
|
-
_(!1), (Ee = t.payloadParams) != null && Ee.stream ? await
|
22610
|
+
_(!1), (Ee = t.payloadParams) != null && Ee.stream ? await xe(
|
22617
22611
|
re,
|
22618
22612
|
F,
|
22619
22613
|
ie,
|
@@ -22629,7 +22623,7 @@ function xd({ submitEventExternal: e = null }) {
|
|
22629
22623
|
} catch (Se) {
|
22630
22624
|
_(!1), M(!0), console.error(Se);
|
22631
22625
|
}
|
22632
|
-
},
|
22626
|
+
}, ve = () => {
|
22633
22627
|
L(!1), Y(!0), R(!0), ne(), b({
|
22634
22628
|
name: `${s.prefix}.bi.xpert.chatbot.action.button.clicked`,
|
22635
22629
|
payload: {
|
@@ -22735,13 +22729,13 @@ function xd({ submitEventExternal: e = null }) {
|
|
22735
22729
|
Jt && c && /* @__PURE__ */ S.jsx(
|
22736
22730
|
qs,
|
22737
22731
|
{
|
22738
|
-
handleFloatingActionButtonClick:
|
22732
|
+
handleFloatingActionButtonClick: ve
|
22739
22733
|
}
|
22740
22734
|
),
|
22741
22735
|
!Jt && c && /* @__PURE__ */ S.jsx(
|
22742
22736
|
Ys,
|
22743
22737
|
{
|
22744
|
-
handleFloatingActionButtonClick:
|
22738
|
+
handleFloatingActionButtonClick: ve
|
22745
22739
|
}
|
22746
22740
|
),
|
22747
22741
|
c && /* @__PURE__ */ S.jsx(h3, {}),
|