@2uinc/frontend-component-xpert-chatbot 1.13.5 → 1.13.6-beta.2
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 +40 -44
- package/package.json +1 -2
package/dist/lib/index.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import tt, { createContext as ns, useMemo as rs, useState as
|
1
|
+
import tt, { createContext as ns, useMemo as rs, useState as ye, useCallback as vt, useEffect as xe, useContext as _e, useRef as We, forwardRef as To, createElement as sr } from "react";
|
2
2
|
const is = {
|
3
3
|
xpertKey: "edx",
|
4
4
|
chatApi: {
|
@@ -671,7 +671,7 @@ const I = /* @__PURE__ */ nt(Q);
|
|
671
671
|
var dn = { exports: {} };
|
672
672
|
dn.exports;
|
673
673
|
(function(e, t) {
|
674
|
-
var n = 200, r = "__lodash_hash_undefined__", i = 800, o = 16, a = 9007199254740991, l = "[object Arguments]", s = "[object Array]", u = "[object AsyncFunction]", c = "[object Boolean]", p = "[object Date]", m = "[object Error]", f = "[object Function]", v = "[object GeneratorFunction]", x = "[object Map]", k = "[object Number]", M = "[object Null]", z = "[object Object]", E = "[object Proxy]", _ = "[object RegExp]", U = "[object Set]", b = "[object String]", L = "[object Undefined]", $ = "[object WeakMap]", W = "[object ArrayBuffer]", X = "[object DataView]", A = "[object Float32Array]", w = "[object Float64Array]", j = "[object Int8Array]", O = "[object Int16Array]", F = "[object Int32Array]", B = "[object Uint8Array]", V = "[object Uint8ClampedArray]", q = "[object Uint16Array]", K = "[object Uint32Array]", g = /[\\^$.*+?()[\]{}|]/g, he = /^\[object .+?Constructor\]$/,
|
674
|
+
var n = 200, r = "__lodash_hash_undefined__", i = 800, o = 16, a = 9007199254740991, l = "[object Arguments]", s = "[object Array]", u = "[object AsyncFunction]", c = "[object Boolean]", p = "[object Date]", m = "[object Error]", f = "[object Function]", v = "[object GeneratorFunction]", x = "[object Map]", k = "[object Number]", M = "[object Null]", z = "[object Object]", E = "[object Proxy]", _ = "[object RegExp]", U = "[object Set]", b = "[object String]", L = "[object Undefined]", $ = "[object WeakMap]", W = "[object ArrayBuffer]", X = "[object DataView]", A = "[object Float32Array]", w = "[object Float64Array]", j = "[object Int8Array]", O = "[object Int16Array]", F = "[object Int32Array]", B = "[object Uint8Array]", V = "[object Uint8ClampedArray]", q = "[object Uint16Array]", K = "[object Uint32Array]", g = /[\\^$.*+?()[\]{}|]/g, he = /^\[object .+?Constructor\]$/, Me = /^(?:0|[1-9]\d*)$/, h = {};
|
675
675
|
h[A] = h[w] = h[j] = h[O] = h[F] = h[B] = h[V] = h[q] = h[K] = !0, h[l] = h[s] = h[W] = h[c] = h[X] = h[p] = h[m] = h[f] = h[x] = h[k] = h[z] = h[_] = h[U] = h[b] = h[$] = !1;
|
676
676
|
var ge = typeof en == "object" && en && en.Object === Object && en, De = typeof self == "object" && self && self.Object === Object && self, re = ge || De || Function("return this")(), we = t && !t.nodeType && t, ve = we && !0 && e && !e.nodeType && e, Be = ve && ve.exports === we, Ae = Be && ge.process, Ke = function() {
|
677
677
|
try {
|
@@ -1013,7 +1013,7 @@ dn.exports;
|
|
1013
1013
|
}
|
1014
1014
|
function oi(d, y) {
|
1015
1015
|
var T = typeof d;
|
1016
|
-
return y = y ?? a, !!y && (T == "number" || T != "symbol" &&
|
1016
|
+
return y = y ?? a, !!y && (T == "number" || T != "symbol" && Me.test(d)) && d > -1 && d % 1 == 0 && d < y;
|
1017
1017
|
}
|
1018
1018
|
function Bl(d, y, T) {
|
1019
1019
|
if (!ut(T))
|
@@ -1386,7 +1386,7 @@ var zo = { exports: {} };
|
|
1386
1386
|
})(zo);
|
1387
1387
|
var ks = zo.exports;
|
1388
1388
|
const Lo = /* @__PURE__ */ nt(ks), js = 576, Es = (e) => {
|
1389
|
-
const [t, n] =
|
1389
|
+
const [t, n] = ye(), r = vt(() => {
|
1390
1390
|
n(
|
1391
1391
|
window.matchMedia(
|
1392
1392
|
`(max-width: ${e || js}px)`
|
@@ -1407,6 +1407,8 @@ function wn({
|
|
1407
1407
|
return /* @__PURE__ */ N.jsx(
|
1408
1408
|
"button",
|
1409
1409
|
{
|
1410
|
+
id: "xpert_chatbot__floating-action-btn",
|
1411
|
+
tabIndex: -1,
|
1410
1412
|
type: "button",
|
1411
1413
|
"aria-label": e,
|
1412
1414
|
className: Lo(
|
@@ -1481,7 +1483,7 @@ eyes follow your mouse when you hover near it.`, Er = ({
|
|
1481
1483
|
var m, f, v, x, k, M, z;
|
1482
1484
|
const { xpertKey: t, launchButton: n } = _e(Fe), r = !Le.get(
|
1483
1485
|
`${t}-proactive-message-xpert-chatbot`
|
1484
|
-
), i = We(null), o = We(!1), a = r ? (m = n.animatedGraduate) == null ? void 0 : m.delayMs : ((f = n.animatedGraduate) == null ? void 0 : f.delayMs) * 2, [l, s] =
|
1486
|
+
), i = We(null), o = We(!1), a = r ? (m = n.animatedGraduate) == null ? void 0 : m.delayMs : ((f = n.animatedGraduate) == null ? void 0 : f.delayMs) * 2, [l, s] = ye(!1), u = rt(zs);
|
1485
1487
|
xe(() => {
|
1486
1488
|
const _ = setTimeout(
|
1487
1489
|
() => {
|
@@ -2114,12 +2116,12 @@ var Mi = {
|
|
2114
2116
|
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
2115
2117
|
*/
|
2116
2118
|
nextTabbableNode: function(he) {
|
2117
|
-
var
|
2118
|
-
return h < 0 ?
|
2119
|
+
var Me = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, h = j.indexOf(he);
|
2120
|
+
return h < 0 ? Me ? O.slice(O.indexOf(he) + 1).find(function(ge) {
|
2119
2121
|
return ct(ge);
|
2120
2122
|
}) : O.slice(0, O.indexOf(he)).reverse().find(function(ge) {
|
2121
2123
|
return ct(ge);
|
2122
|
-
}) : j[h + (
|
2124
|
+
}) : j[h + (Me ? 1 : -1)];
|
2123
2125
|
}
|
2124
2126
|
};
|
2125
2127
|
}), a.tabbableGroups = a.containerGroups.filter(function(w) {
|
@@ -2161,8 +2163,8 @@ var Mi = {
|
|
2161
2163
|
return j === we;
|
2162
2164
|
});
|
2163
2165
|
if (g < 0 && (K.container === j || sn(j, o.tabbableOptions) && !ct(j, o.tabbableOptions) && !K.nextTabbableNode(j, !1)) && (g = q), g >= 0) {
|
2164
|
-
var he = g === 0 ? a.tabbableGroups.length - 1 : g - 1,
|
2165
|
-
V = et(j) >= 0 ?
|
2166
|
+
var he = g === 0 ? a.tabbableGroups.length - 1 : g - 1, Me = a.tabbableGroups[he];
|
2167
|
+
V = et(j) >= 0 ? Me.lastTabbableNode : Me.lastDomTabbableNode;
|
2166
2168
|
} else
|
2167
2169
|
Ut(O) || (V = K.nextTabbableNode(j, !1));
|
2168
2170
|
} else {
|
@@ -3930,7 +3932,7 @@ if (typeof document < "u" && typeof window < "u") {
|
|
3930
3932
|
}
|
3931
3933
|
}
|
3932
3934
|
function sa(e) {
|
3933
|
-
const [t, n] =
|
3935
|
+
const [t, n] = ye(!!e.ssr), [r, i] = ye({});
|
3934
3936
|
function o(f) {
|
3935
3937
|
if (f) {
|
3936
3938
|
const v = e.icon;
|
@@ -3950,7 +3952,7 @@ function sa(e) {
|
|
3950
3952
|
name: ""
|
3951
3953
|
};
|
3952
3954
|
}
|
3953
|
-
const [a, l] =
|
3955
|
+
const [a, l] = ye(o(!!e.ssr));
|
3954
3956
|
function s() {
|
3955
3957
|
const f = r.callback;
|
3956
3958
|
f && (f(), i({}));
|
@@ -6214,7 +6216,7 @@ function uf(e, t, n) {
|
|
6214
6216
|
function w(h) {
|
6215
6217
|
return h === 45 && i === 2 ? (e.consume(h), B) : h === 60 && i === 1 ? (e.consume(h), V) : h === 62 && i === 4 ? (e.consume(h), he) : h === 63 && i === 3 ? (e.consume(h), g) : h === 93 && i === 5 ? (e.consume(h), K) : G(h) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(
|
6216
6218
|
af,
|
6217
|
-
|
6219
|
+
Me,
|
6218
6220
|
j
|
6219
6221
|
)(h)) : h === null || G(h) ? (e.exit("htmlFlowData"), j(h)) : (e.consume(h), w);
|
6220
6222
|
}
|
@@ -6222,7 +6224,7 @@ function uf(e, t, n) {
|
|
6222
6224
|
return e.check(
|
6223
6225
|
lf,
|
6224
6226
|
O,
|
6225
|
-
|
6227
|
+
Me
|
6226
6228
|
)(h);
|
6227
6229
|
}
|
6228
6230
|
function O(h) {
|
@@ -6251,9 +6253,9 @@ function uf(e, t, n) {
|
|
6251
6253
|
return h === 62 ? (e.consume(h), he) : h === 45 && i === 2 ? (e.consume(h), g) : w(h);
|
6252
6254
|
}
|
6253
6255
|
function he(h) {
|
6254
|
-
return h === null || G(h) ? (e.exit("htmlFlowData"),
|
6256
|
+
return h === null || G(h) ? (e.exit("htmlFlowData"), Me(h)) : (e.consume(h), he);
|
6255
6257
|
}
|
6256
|
-
function
|
6258
|
+
function Me(h) {
|
6257
6259
|
return e.exit("htmlFlow"), t(h);
|
6258
6260
|
}
|
6259
6261
|
}
|
@@ -7004,9 +7006,9 @@ function Hf(e, t, n) {
|
|
7004
7006
|
return j;
|
7005
7007
|
function j(O, F, B) {
|
7006
7008
|
let V, q, K, g;
|
7007
|
-
return Array.isArray(O) ?
|
7009
|
+
return Array.isArray(O) ? Me(O) : "tokenize" in O ? (
|
7008
7010
|
// @ts-expect-error Looks like a construct.
|
7009
|
-
|
7011
|
+
Me([O])
|
7010
7012
|
) : he(O);
|
7011
7013
|
function he(re) {
|
7012
7014
|
return we;
|
@@ -7017,10 +7019,10 @@ function Hf(e, t, n) {
|
|
7017
7019
|
...Array.isArray(Be) ? Be : Be ? [Be] : [],
|
7018
7020
|
...Array.isArray(Ae) ? Ae : Ae ? [Ae] : []
|
7019
7021
|
];
|
7020
|
-
return
|
7022
|
+
return Me(Ke)(ve);
|
7021
7023
|
}
|
7022
7024
|
}
|
7023
|
-
function
|
7025
|
+
function Me(re) {
|
7024
7026
|
return V = re, q = 0, re.length === 0 ? B : h(re[q]);
|
7025
7027
|
}
|
7026
7028
|
function h(re) {
|
@@ -7384,7 +7386,7 @@ function cd(e) {
|
|
7384
7386
|
listUnordered: c(),
|
7385
7387
|
paragraph: c(),
|
7386
7388
|
referenceString: re,
|
7387
|
-
resourceDestinationString:
|
7389
|
+
resourceDestinationString: Me,
|
7388
7390
|
resourceTitleString: h,
|
7389
7391
|
resource: ge,
|
7390
7392
|
setextHeading: c(X),
|
@@ -7658,7 +7660,7 @@ function cd(e) {
|
|
7658
7660
|
} else
|
7659
7661
|
Y.alt = S;
|
7660
7662
|
}
|
7661
|
-
function
|
7663
|
+
function Me() {
|
7662
7664
|
const D = this.resume(), S = this.stack[this.stack.length - 1];
|
7663
7665
|
S.url = D;
|
7664
7666
|
}
|
@@ -10282,7 +10284,7 @@ function _n({
|
|
10282
10284
|
text: a,
|
10283
10285
|
userTrackingName: l
|
10284
10286
|
}) {
|
10285
|
-
const [s, u] =
|
10287
|
+
const [s, u] = ye(!0), { primaryColor: c, xpertKey: p, userTracking: m, conversationScreen: f } = _e(Fe), v = vt(
|
10286
10288
|
(M) => {
|
10287
10289
|
var z, E, _, U;
|
10288
10290
|
((z = M == null ? void 0 : M.data) == null ? void 0 : z.who) === "customer" && (!(window != null && window.OnetrustActiveGroups) || (E = window == null ? void 0 : window.OnetrustActiveGroups) != null && E.includes("C0003")) && Le.set(`${p}-live-chat-open`, 1, {
|
@@ -10762,7 +10764,7 @@ function Ja({
|
|
10762
10764
|
style: o = {}
|
10763
10765
|
}) {
|
10764
10766
|
var v;
|
10765
|
-
const { proactiveMessage: a } = _e(Fe), [l, s] =
|
10767
|
+
const { proactiveMessage: a } = _e(Fe), [l, s] = ye(!0), [u, c] = ye(!1), p = l && (!(window != null && window.OnetrustActiveGroups) || ((v = window == null ? void 0 : window.OnetrustActiveGroups) == null ? void 0 : v.includes("C0003"))) && Le.get(t) === void 0;
|
10766
10768
|
xe(() => {
|
10767
10769
|
var x;
|
10768
10770
|
(x = window == null ? void 0 : window.OneTrust) == null || x.OnConsentChanged(() => {
|
@@ -10791,7 +10793,7 @@ function Ja({
|
|
10791
10793
|
};
|
10792
10794
|
Le.set(x, k, z);
|
10793
10795
|
};
|
10794
|
-
return u ? /* @__PURE__ */ N.jsx("div", { children:
|
10796
|
+
return !u || !p ? null : /* @__PURE__ */ N.jsx("div", { children: /* @__PURE__ */ N.jsxs(
|
10795
10797
|
"div",
|
10796
10798
|
{
|
10797
10799
|
role: "alertdialog",
|
@@ -10837,7 +10839,7 @@ function Ja({
|
|
10837
10839
|
)
|
10838
10840
|
]
|
10839
10841
|
}
|
10840
|
-
) })
|
10842
|
+
) });
|
10841
10843
|
}
|
10842
10844
|
Ja.propTypes = {
|
10843
10845
|
children: I.node.isRequired,
|
@@ -10878,16 +10880,15 @@ function ig(e, t, n) {
|
|
10878
10880
|
}, [e, t]);
|
10879
10881
|
}
|
10880
10882
|
function og(e) {
|
10881
|
-
const [t, n] =
|
10883
|
+
const [t, n] = ye(null);
|
10882
10884
|
return xe(() => {
|
10883
|
-
console.log("Chatbot - optimizely mount");
|
10884
10885
|
try {
|
10885
10886
|
(() => {
|
10886
10887
|
var i, o, a;
|
10887
|
-
(i = window.experiments) != null && i[e] ? (console.log("Chatbot -
|
10888
|
+
(i = window.experiments) != null && i[e] ? (console.log("Chatbot - Optimizely experiment variation exist"), n(
|
10888
10889
|
(a = (o = window.experiments) == null ? void 0 : o[e]) == null ? void 0 : a.variation
|
10889
10890
|
)) : (console.log(
|
10890
|
-
"Chatbot -
|
10891
|
+
"Chatbot - Optimizely experiment variation does not exist"
|
10891
10892
|
), window.experiments = window.experiments || {}, window.experiments[e] = {}, window.experiments[e].handleLoaded = () => {
|
10892
10893
|
var l, s;
|
10893
10894
|
/* istanbul ignore next @preserve */
|
@@ -10902,10 +10903,10 @@ function og(e) {
|
|
10902
10903
|
}
|
10903
10904
|
return () => {
|
10904
10905
|
var r, i;
|
10905
|
-
|
10906
|
+
window.experiments = {}, (i = (r = window == null ? void 0 : window.optimizely) == null ? void 0 : r.push) == null || i.call(r, { type: "activate" });
|
10906
10907
|
};
|
10907
10908
|
}, [e]), console.log(
|
10908
|
-
`Chatbot -
|
10909
|
+
`Chatbot - Optimizely experimentVariation: ${t}`
|
10909
10910
|
), t;
|
10910
10911
|
}
|
10911
10912
|
function ag(e) {
|
@@ -10942,7 +10943,7 @@ function ti({ submitEventExternal: e }) {
|
|
10942
10943
|
userTracking: o,
|
10943
10944
|
webExperimentation: a,
|
10944
10945
|
xpertKey: l
|
10945
|
-
} = _e(Fe), s = rt(cg), [, u] =
|
10946
|
+
} = _e(Fe), s = rt(cg), [, u] = ye(!1), [, c] = ye(!1), [p, m] = ye(pg), [f, v] = ye(!1), [x, k] = ye(!1), [M, z] = ye(!1), [E, _] = ye(""), [U, b] = ye(!1), [L, $] = ye(!0), [W, X] = ye(!1), [A, w] = ye(!1), [j, O] = ye(!1), F = We(null), B = We(null), V = We(null), q = Le.get(`${l}-test`) === "1";
|
10946
10947
|
ig(
|
10947
10948
|
n.liveChat.enabled,
|
10948
10949
|
M,
|
@@ -10996,7 +10997,6 @@ function ti({ submitEventExternal: e }) {
|
|
10996
10997
|
}
|
10997
10998
|
}, [l, t.endpoint]);
|
10998
10999
|
ag(g), xe(() => {
|
10999
|
-
console.log("Chatbot - Find Segment mount");
|
11000
11000
|
let R, ee;
|
11001
11001
|
return o.enabled && (R = setInterval(() => {
|
11002
11002
|
var le;
|
@@ -11004,17 +11004,16 @@ function ti({ submitEventExternal: e }) {
|
|
11004
11004
|
}, 1e3), ee = setTimeout(() => {
|
11005
11005
|
clearInterval(R);
|
11006
11006
|
}, 6e4)), () => {
|
11007
|
-
|
11007
|
+
clearInterval(R), clearTimeout(ee);
|
11008
11008
|
};
|
11009
11009
|
}, [o.enabled, o.prefix]), xe(() => {
|
11010
|
-
console.log("Chatbot - Find Optimizely mount");
|
11011
11010
|
let R, ee;
|
11012
11011
|
return R = setInterval(() => {
|
11013
11012
|
a.enabled && (console.log("Chatbot - Finding Optimizely"), window.optimizely && window.experiments && (console.log("Chatbot - Optimizely found"), clearInterval(R), clearTimeout(ee), c(!0)));
|
11014
11013
|
}, 1e3), ee = setTimeout(() => {
|
11015
11014
|
clearInterval(R);
|
11016
11015
|
}, 6e4), () => {
|
11017
|
-
|
11016
|
+
clearInterval(R), clearTimeout(ee);
|
11018
11017
|
};
|
11019
11018
|
}, [a.enabled, a.experimentName]);
|
11020
11019
|
const he = (R) => {
|
@@ -11028,18 +11027,15 @@ function ti({ submitEventExternal: e }) {
|
|
11028
11027
|
isTestUser: q
|
11029
11028
|
}
|
11030
11029
|
});
|
11031
|
-
},
|
11030
|
+
}, Me = og(
|
11032
11031
|
a.experimentName
|
11033
11032
|
);
|
11034
11033
|
if (a.enabled && !a.experimentName && !q)
|
11035
11034
|
return a.enabled && !a.experimentName && console.log(
|
11036
|
-
`Chatbot - Experiment not setup: ${l}, ${
|
11035
|
+
`Chatbot - Experiment not setup: ${l}, ${Me}, ${window.optimizely}`
|
11037
11036
|
), q || console.log(`Chatbot - Test user not setup: ${l}, ${q}`), null;
|
11038
11037
|
if (o.prefix && !((at = V == null ? void 0 : V.current) != null && at.track) && !e)
|
11039
11038
|
return console.log(`Chatbot - Segment not setup: ${l}`), null;
|
11040
|
-
console.log(
|
11041
|
-
`Chatbot - All things setup: ${l}, ${typeof window.analytics}, ${ye}, ${typeof window.optimizely}, ${typeof window.experiments}`
|
11042
|
-
);
|
11043
11039
|
const h = () => {
|
11044
11040
|
_(""), B.current.value = "", B.current.style.height = "auto";
|
11045
11041
|
}, ge = (R, ee) => {
|
@@ -11224,10 +11220,10 @@ function ti({ submitEventExternal: e }) {
|
|
11224
11220
|
feedbackThumbType: ee
|
11225
11221
|
}) : le);
|
11226
11222
|
m(me), w(!1);
|
11227
|
-
}, Xe = ((mt = r.animatedGraduate) == null ? void 0 : mt.enabled) && a.enabled &&
|
11223
|
+
}, Xe = ((mt = r.animatedGraduate) == null ? void 0 : mt.enabled) && a.enabled && Me === "A", gt = i.enabled ? Xe ? s ? i.style.mobile.animatedGraduateExperiment : i.style.animatedGraduateExperiment : s ? i.style.mobile : i.style : null;
|
11228
11224
|
return (
|
11229
11225
|
// do not remove this class as it's needed to turn off chatbot
|
11230
|
-
/* @__PURE__ */ N.jsxs("div", { className: "
|
11226
|
+
/* @__PURE__ */ N.jsxs("div", { className: "xpert_chatbot", children: [
|
11231
11227
|
i.enabled && /* @__PURE__ */ N.jsx(
|
11232
11228
|
Ja,
|
11233
11229
|
{
|
package/package.json
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@2uinc/frontend-component-xpert-chatbot",
|
3
|
-
"version": "1.13.
|
4
|
-
"homepage": "/app/plugins/xpert-chatbot/frontend/build/",
|
3
|
+
"version": "1.13.6-beta.2",
|
5
4
|
"repository": {
|
6
5
|
"type": "git",
|
7
6
|
"url": "git+https://github.com/2uinc/frontend-component-xpert-chatbot.git"
|