@2uinc/frontend-component-xpert-chatbot 1.7.0-beta.1 → 1.7.0-beta.3

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.
Files changed (2) hide show
  1. package/dist/lib/index.min.js +152 -144
  2. package/package.json +1 -1
@@ -175,11 +175,9 @@ const Jl = {
175
175
  }, tu = {
176
176
  xpertKey: "get-smarter",
177
177
  chatApi: {
178
- endpoint: "https://xpert-platform-services-api.prod.ai.2u.com/xpert/chatservice",
178
+ endpoint: "https://xpert-platform-services-api.prod.ai.2u.com/xpert/omnichannel",
179
179
  payloadParams: {
180
- context: {
181
- uri: "five9_faq"
182
- }
180
+ use_case: "GET_SMARTER"
183
181
  }
184
182
  },
185
183
  primaryColor: "#E31A82",
@@ -405,9 +403,9 @@ const N = /* @__PURE__ */ nt(Q);
405
403
  var pn = { exports: {} };
406
404
  pn.exports;
407
405
  (function(e, t) {
408
- var n = 200, r = "__lodash_hash_undefined__", i = 800, o = 16, a = 9007199254740991, l = "[object Arguments]", u = "[object Array]", s = "[object AsyncFunction]", c = "[object Boolean]", p = "[object Date]", m = "[object Error]", d = "[object Function]", T = "[object GeneratorFunction]", x = "[object Map]", j = "[object Number]", v = "[object Null]", C = "[object Object]", S = "[object Proxy]", W = "[object RegExp]", q = "[object Set]", M = "[object String]", P = "[object Undefined]", H = "[object WeakMap]", G = "[object ArrayBuffer]", K = "[object DataView]", A = "[object Float32Array]", b = "[object Float64Array]", I = "[object Int8Array]", z = "[object Int16Array]", L = "[object Int32Array]", U = "[object Uint8Array]", _ = "[object Uint8ClampedArray]", V = "[object Uint16Array]", re = "[object Uint32Array]", g = /[\\^$.*+?()[\]{}|]/g, ue = /^\[object .+?Constructor\]$/, ye = /^(?:0|[1-9]\d*)$/, h = {};
409
- h[A] = h[b] = h[I] = h[z] = h[L] = h[U] = h[_] = h[V] = h[re] = !0, h[l] = h[u] = h[G] = h[c] = h[K] = h[p] = h[m] = h[d] = h[x] = h[j] = h[C] = h[W] = h[q] = h[M] = h[H] = !1;
410
- var ge = typeof Jt == "object" && Jt && Jt.Object === Object && Jt, De = typeof self == "object" && self && self.Object === Object && self, ie = ge || De || Function("return this")(), Te = t && !t.nodeType && t, be = Te && !0 && e && !e.nodeType && e, Be = be && be.exports === Te, ze = Be && ge.process, Ke = function() {
406
+ var n = 200, r = "__lodash_hash_undefined__", i = 800, o = 16, a = 9007199254740991, l = "[object Arguments]", u = "[object Array]", s = "[object AsyncFunction]", c = "[object Boolean]", p = "[object Date]", m = "[object Error]", d = "[object Function]", T = "[object GeneratorFunction]", x = "[object Map]", j = "[object Number]", v = "[object Null]", C = "[object Object]", S = "[object Proxy]", W = "[object RegExp]", q = "[object Set]", M = "[object String]", P = "[object Undefined]", H = "[object WeakMap]", G = "[object ArrayBuffer]", K = "[object DataView]", A = "[object Float32Array]", b = "[object Float64Array]", I = "[object Int8Array]", z = "[object Int16Array]", L = "[object Int32Array]", U = "[object Uint8Array]", _ = "[object Uint8ClampedArray]", V = "[object Uint16Array]", ie = "[object Uint32Array]", g = /[\\^$.*+?()[\]{}|]/g, ue = /^\[object .+?Constructor\]$/, ye = /^(?:0|[1-9]\d*)$/, h = {};
407
+ h[A] = h[b] = h[I] = h[z] = h[L] = h[U] = h[_] = h[V] = h[ie] = !0, h[l] = h[u] = h[G] = h[c] = h[K] = h[p] = h[m] = h[d] = h[x] = h[j] = h[C] = h[W] = h[q] = h[M] = h[H] = !1;
408
+ var me = typeof Jt == "object" && Jt && Jt.Object === Object && Jt, De = typeof self == "object" && self && self.Object === Object && self, oe = me || De || Function("return this")(), Te = t && !t.nodeType && t, be = Te && !0 && e && !e.nodeType && e, Be = be && be.exports === Te, ze = Be && me.process, Ke = function() {
411
409
  try {
412
410
  var f = be && be.require && be.require("util").types;
413
411
  return f || ze && ze.binding && ze.binding("util");
@@ -445,18 +443,18 @@ pn.exports;
445
443
  return f(y(w));
446
444
  };
447
445
  }
448
- var R = Array.prototype, oe = Function.prototype, me = Object.prototype, he = ie["__core-js_shared__"], je = oe.toString, xe = me.hasOwnProperty, kt = function() {
449
- var f = /[^.]+$/.exec(he && he.keys && he.keys.IE_PROTO || "");
446
+ var R = Array.prototype, ne = Function.prototype, he = Object.prototype, ge = oe["__core-js_shared__"], je = ne.toString, xe = he.hasOwnProperty, kt = function() {
447
+ var f = /[^.]+$/.exec(ge && ge.keys && ge.keys.IE_PROTO || "");
450
448
  return f ? "Symbol(src)_1." + f : "";
451
- }(), Xe = me.toString, jt = je.call(Object), D = RegExp(
449
+ }(), Xe = he.toString, jt = je.call(Object), D = RegExp(
452
450
  "^" + je.call(xe).replace(g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
453
- ), O = Be ? ie.Buffer : void 0, Y = ie.Symbol, ee = ie.Uint8Array, ne = O ? O.allocUnsafe : void 0, Ie = at(Object.getPrototypeOf, Object), Qe = Object.create, Ye = me.propertyIsEnumerable, lt = R.splice, Ee = Y ? Y.toStringTag : void 0, se = function() {
451
+ ), O = Be ? oe.Buffer : void 0, Y = oe.Symbol, ee = oe.Uint8Array, re = O ? O.allocUnsafe : void 0, Ie = at(Object.getPrototypeOf, Object), Qe = Object.create, Ye = he.propertyIsEnumerable, lt = R.splice, Ee = Y ? Y.toStringTag : void 0, se = function() {
454
452
  try {
455
453
  var f = Fn(Object, "defineProperty");
456
454
  return f({}, "", {}), f;
457
455
  } catch {
458
456
  }
459
- }(), Et = O ? O.isBuffer : void 0, Le = Math.max, Za = Date.now, Jr = Fn(ie, "Map"), At = Fn(Object, "create"), Ka = function() {
457
+ }(), Et = O ? O.isBuffer : void 0, Le = Math.max, Za = Date.now, Jr = Fn(oe, "Map"), At = Fn(Object, "create"), Ka = function() {
460
458
  function f() {
461
459
  }
462
460
  return function(y) {
@@ -678,7 +676,7 @@ pn.exports;
678
676
  function kl(f, y) {
679
677
  if (y)
680
678
  return f.slice();
681
- var w = f.length, F = ne ? ne(w) : new f.constructor(w);
679
+ var w = f.length, F = re ? re(w) : new f.constructor(w);
682
680
  return f.copy(F), F;
683
681
  }
684
682
  function jl(f) {
@@ -763,7 +761,7 @@ pn.exports;
763
761
  return !!kt && kt in f;
764
762
  }
765
763
  function ri(f) {
766
- var y = f && f.constructor, w = typeof y == "function" && y.prototype || me;
764
+ var y = f && f.constructor, w = typeof y == "function" && y.prototype || he;
767
765
  return f === w;
768
766
  }
769
767
  function Rl(f) {
@@ -883,7 +881,7 @@ var hu = pn.exports;
883
881
  const No = /* @__PURE__ */ nt(hu), gu = {
884
882
  xpertKey: "exec-ed-ss-olc-moodle",
885
883
  chatApi: {
886
- endpoint: "https://xpert-platform-services-api.stg.ai.2u.com/xpert/omnichannel",
884
+ endpoint: "https://xpert-platform-services-api.prod.ai.2u.com/xpert/omnichannel",
887
885
  payloadParams: {
888
886
  use_case: "LOG_OUT"
889
887
  }
@@ -905,11 +903,16 @@ const No = /* @__PURE__ */ nt(hu), gu = {
905
903
  launchButton: {
906
904
  message: {
907
905
  enabled: !0,
908
- text: "Chat with us",
906
+ text: "Chat to us",
909
907
  style: {
910
908
  color: "#E31A82",
911
- right: "1rem",
912
- fontFamily: "system-ui"
909
+ right: "1.5rem",
910
+ fontFamily: "system-ui",
911
+ mobile: {
912
+ color: "#E31A82",
913
+ right: "1.50rem",
914
+ fontFamily: "system-ui"
915
+ }
913
916
  }
914
917
  },
915
918
  style: {
@@ -4573,16 +4576,16 @@ function Kc(e, t, n) {
4573
4576
  return h === 45 ? (e.consume(h), r.interrupt ? t : g) : n(h);
4574
4577
  }
4575
4578
  function T(h) {
4576
- const ge = "CDATA[";
4577
- return h === ge.charCodeAt(l++) ? (e.consume(h), l === ge.length ? r.interrupt ? t : b : T) : n(h);
4579
+ const me = "CDATA[";
4580
+ return h === me.charCodeAt(l++) ? (e.consume(h), l === me.length ? r.interrupt ? t : b : T) : n(h);
4578
4581
  }
4579
4582
  function x(h) {
4580
4583
  return qe(h) ? (e.consume(h), a = String.fromCharCode(h), j) : n(h);
4581
4584
  }
4582
4585
  function j(h) {
4583
4586
  if (h === null || h === 47 || h === 62 || ke(h)) {
4584
- const ge = h === 47, De = a.toLowerCase();
4585
- return !ge && !o && Vi.includes(De) ? (i = 1, r.interrupt ? t(h) : b(h)) : qc.includes(a.toLowerCase()) ? (i = 6, ge ? (e.consume(h), v) : r.interrupt ? t(h) : b(h)) : (i = 7, r.interrupt && !r.parser.lazy[r.now().line] ? n(h) : o ? C(h) : S(h));
4587
+ const me = h === 47, De = a.toLowerCase();
4588
+ return !me && !o && Vi.includes(De) ? (i = 1, r.interrupt ? t(h) : b(h)) : qc.includes(a.toLowerCase()) ? (i = 6, me ? (e.consume(h), v) : r.interrupt ? t(h) : b(h)) : (i = 7, r.interrupt && !r.parser.lazy[r.now().line] ? n(h) : o ? C(h) : S(h));
4586
4589
  }
4587
4590
  return h === 45 || Se(h) ? (e.consume(h), a += String.fromCharCode(h), j) : n(h);
4588
4591
  }
@@ -4620,7 +4623,7 @@ function Kc(e, t, n) {
4620
4623
  return h === null || $(h) ? b(h) : te(h) ? (e.consume(h), A) : n(h);
4621
4624
  }
4622
4625
  function b(h) {
4623
- return h === 45 && i === 2 ? (e.consume(h), U) : h === 60 && i === 1 ? (e.consume(h), _) : h === 62 && i === 4 ? (e.consume(h), ue) : h === 63 && i === 3 ? (e.consume(h), g) : h === 93 && i === 5 ? (e.consume(h), re) : $(h) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(
4626
+ return h === 45 && i === 2 ? (e.consume(h), U) : h === 60 && i === 1 ? (e.consume(h), _) : h === 62 && i === 4 ? (e.consume(h), ue) : h === 63 && i === 3 ? (e.consume(h), g) : h === 93 && i === 5 ? (e.consume(h), ie) : $(h) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(
4624
4627
  Wc,
4625
4628
  ye,
4626
4629
  I
@@ -4647,12 +4650,12 @@ function Kc(e, t, n) {
4647
4650
  }
4648
4651
  function V(h) {
4649
4652
  if (h === 62) {
4650
- const ge = a.toLowerCase();
4651
- return Vi.includes(ge) ? (e.consume(h), ue) : b(h);
4653
+ const me = a.toLowerCase();
4654
+ return Vi.includes(me) ? (e.consume(h), ue) : b(h);
4652
4655
  }
4653
4656
  return qe(h) && a.length < 8 ? (e.consume(h), a += String.fromCharCode(h), V) : b(h);
4654
4657
  }
4655
- function re(h) {
4658
+ function ie(h) {
4656
4659
  return h === 93 ? (e.consume(h), g) : b(h);
4657
4660
  }
4658
4661
  function g(h) {
@@ -4774,12 +4777,12 @@ function tf(e, t, n) {
4774
4777
  function V(g) {
4775
4778
  return te(g) ? fe(
4776
4779
  e,
4777
- re,
4780
+ ie,
4778
4781
  "linePrefix",
4779
4782
  r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
4780
- )(g) : re(g);
4783
+ )(g) : ie(g);
4781
4784
  }
4782
- function re(g) {
4785
+ function ie(g) {
4783
4786
  return e.enter("htmlTextData"), a(g);
4784
4787
  }
4785
4788
  }
@@ -5411,15 +5414,15 @@ function Of(e, t, n) {
5411
5414
  function P(A, b) {
5412
5415
  return I;
5413
5416
  function I(z, L, U) {
5414
- let _, V, re, g;
5417
+ let _, V, ie, g;
5415
5418
  return Array.isArray(z) ? ye(z) : "tokenize" in z ? (
5416
5419
  // @ts-expect-error Looks like a construct.
5417
5420
  ye([z])
5418
5421
  ) : ue(z);
5419
- function ue(ie) {
5422
+ function ue(oe) {
5420
5423
  return Te;
5421
5424
  function Te(be) {
5422
- const Be = be !== null && ie[be], ze = be !== null && ie.null, Ke = [
5425
+ const Be = be !== null && oe[be], ze = be !== null && oe.null, Ke = [
5423
5426
  // To do: add more extension tests.
5424
5427
  /* c8 ignore next 2 */
5425
5428
  ...Array.isArray(Be) ? Be : Be ? [Be] : [],
@@ -5428,27 +5431,27 @@ function Of(e, t, n) {
5428
5431
  return ye(Ke)(be);
5429
5432
  }
5430
5433
  }
5431
- function ye(ie) {
5432
- return _ = ie, V = 0, ie.length === 0 ? U : h(ie[V]);
5434
+ function ye(oe) {
5435
+ return _ = oe, V = 0, oe.length === 0 ? U : h(oe[V]);
5433
5436
  }
5434
- function h(ie) {
5437
+ function h(oe) {
5435
5438
  return Te;
5436
5439
  function Te(be) {
5437
- return g = G(), re = ie, ie.partial || (s.currentConstruct = ie), ie.name && s.parser.constructs.disable.null.includes(ie.name) ? De() : ie.tokenize.call(
5440
+ return g = G(), ie = oe, oe.partial || (s.currentConstruct = oe), oe.name && s.parser.constructs.disable.null.includes(oe.name) ? De() : oe.tokenize.call(
5438
5441
  // If we do have fields, create an object w/ `context` as its
5439
5442
  // prototype.
5440
5443
  // This allows a “live binding”, which is needed for `interrupt`.
5441
5444
  b ? Object.assign(Object.create(s), b) : s,
5442
5445
  u,
5443
- ge,
5446
+ me,
5444
5447
  De
5445
5448
  )(be);
5446
5449
  }
5447
5450
  }
5448
- function ge(ie) {
5449
- return A(re, g), L;
5451
+ function me(oe) {
5452
+ return A(ie, g), L;
5450
5453
  }
5451
- function De(ie) {
5454
+ function De(oe) {
5452
5455
  return g.restore(), ++V < _.length ? h(_[V]) : U;
5453
5456
  }
5454
5457
  }
@@ -5709,7 +5712,7 @@ function Jf(e) {
5709
5712
  transforms: [],
5710
5713
  canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
5711
5714
  enter: {
5712
- autolink: l(me),
5715
+ autolink: l(he),
5713
5716
  autolinkProtocol: A,
5714
5717
  autolinkEmail: A,
5715
5718
  atxHeading: l(ot),
@@ -5735,13 +5738,13 @@ function Jf(e) {
5735
5738
  htmlFlowData: A,
5736
5739
  htmlText: l(R, u),
5737
5740
  htmlTextData: A,
5738
- image: l(oe),
5741
+ image: l(ne),
5739
5742
  label: u,
5740
- link: l(me),
5743
+ link: l(he),
5741
5744
  listItem: l(je),
5742
5745
  listItemValue: T,
5743
- listOrdered: l(he, d),
5744
- listUnordered: l(he),
5746
+ listOrdered: l(ge, d),
5747
+ listUnordered: l(ge),
5745
5748
  paragraph: l(xe),
5746
5749
  reference: De,
5747
5750
  referenceString: u,
@@ -5782,7 +5785,7 @@ function Jf(e) {
5782
5785
  htmlFlowData: b,
5783
5786
  htmlText: c(U),
5784
5787
  htmlTextData: b,
5785
- image: c(re),
5788
+ image: c(ie),
5786
5789
  label: ue,
5787
5790
  labelText: g,
5788
5791
  lineEnding: I,
@@ -5791,10 +5794,10 @@ function Jf(e) {
5791
5794
  listOrdered: c(),
5792
5795
  listUnordered: c(),
5793
5796
  paragraph: c(),
5794
- referenceString: ie,
5797
+ referenceString: oe,
5795
5798
  resourceDestinationString: ye,
5796
5799
  resourceTitleString: h,
5797
- resource: ge,
5800
+ resource: me,
5798
5801
  setextHeading: c(K),
5799
5802
  setextHeadingLineSequence: G,
5800
5803
  setextHeadingText: H,
@@ -5821,25 +5824,25 @@ function Jf(e) {
5821
5824
  setData: o,
5822
5825
  getData: a
5823
5826
  }, ee = [];
5824
- let ne = -1;
5825
- for (; ++ne < D.length; )
5826
- if (D[ne][1].type === "listOrdered" || D[ne][1].type === "listUnordered")
5827
- if (D[ne][0] === "enter")
5828
- ee.push(ne);
5827
+ let re = -1;
5828
+ for (; ++re < D.length; )
5829
+ if (D[re][1].type === "listOrdered" || D[re][1].type === "listUnordered")
5830
+ if (D[re][0] === "enter")
5831
+ ee.push(re);
5829
5832
  else {
5830
5833
  const Ie = ee.pop();
5831
- ne = i(D, Ie, ne);
5834
+ re = i(D, Ie, re);
5832
5835
  }
5833
- for (ne = -1; ++ne < D.length; ) {
5834
- const Ie = t[D[ne][0]];
5835
- pa.call(Ie, D[ne][1].type) && Ie[D[ne][1].type].call(
5836
+ for (re = -1; ++re < D.length; ) {
5837
+ const Ie = t[D[re][0]];
5838
+ pa.call(Ie, D[re][1].type) && Ie[D[re][1].type].call(
5836
5839
  Object.assign(
5837
5840
  {
5838
- sliceSerialize: D[ne][2].sliceSerialize
5841
+ sliceSerialize: D[re][2].sliceSerialize
5839
5842
  },
5840
5843
  Y
5841
5844
  ),
5842
- D[ne][1]
5845
+ D[re][1]
5843
5846
  );
5844
5847
  }
5845
5848
  if (Y.tokenStack.length > 0) {
@@ -5861,15 +5864,15 @@ function Jf(e) {
5861
5864
  offset: 0
5862
5865
  }
5863
5866
  )
5864
- }, ne = -1; ++ne < t.transforms.length; )
5865
- O = t.transforms[ne](O) || O;
5867
+ }, re = -1; ++re < t.transforms.length; )
5868
+ O = t.transforms[re](O) || O;
5866
5869
  return O;
5867
5870
  }
5868
5871
  function i(D, O, Y) {
5869
- let ee = O - 1, ne = -1, Ie = !1, Qe, Ye, lt, Ee;
5872
+ let ee = O - 1, re = -1, Ie = !1, Qe, Ye, lt, Ee;
5870
5873
  for (; ++ee <= Y; ) {
5871
5874
  const se = D[ee];
5872
- if (se[1].type === "listUnordered" || se[1].type === "listOrdered" || se[1].type === "blockQuote" ? (se[0] === "enter" ? ne++ : ne--, Ee = void 0) : se[1].type === "lineEndingBlank" ? se[0] === "enter" && (Qe && !Ee && !ne && !lt && (lt = ee), Ee = void 0) : se[1].type === "linePrefix" || se[1].type === "listItemValue" || se[1].type === "listItemMarker" || se[1].type === "listItemPrefix" || se[1].type === "listItemPrefixWhitespace" || (Ee = void 0), !ne && se[0] === "enter" && se[1].type === "listItemPrefix" || ne === -1 && se[0] === "exit" && (se[1].type === "listUnordered" || se[1].type === "listOrdered")) {
5875
+ if (se[1].type === "listUnordered" || se[1].type === "listOrdered" || se[1].type === "blockQuote" ? (se[0] === "enter" ? re++ : re--, Ee = void 0) : se[1].type === "lineEndingBlank" ? se[0] === "enter" && (Qe && !Ee && !re && !lt && (lt = ee), Ee = void 0) : se[1].type === "linePrefix" || se[1].type === "listItemValue" || se[1].type === "listItemMarker" || se[1].type === "listItemPrefix" || se[1].type === "listItemPrefixWhitespace" || (Ee = void 0), !re && se[0] === "enter" && se[1].type === "listItemPrefix" || re === -1 && se[0] === "exit" && (se[1].type === "listUnordered" || se[1].type === "listOrdered")) {
5873
5876
  if (Qe) {
5874
5877
  let Et = ee;
5875
5878
  for (Ye = void 0; Et--; ) {
@@ -6045,7 +6048,7 @@ function Jf(e) {
6045
6048
  delete D.identifier, delete D.label;
6046
6049
  o("referenceType");
6047
6050
  }
6048
- function re() {
6051
+ function ie() {
6049
6052
  const D = this.stack[this.stack.length - 1];
6050
6053
  if (a("inReference")) {
6051
6054
  const O = a("referenceType") || "shortcut";
@@ -6074,13 +6077,13 @@ function Jf(e) {
6074
6077
  const D = this.resume(), O = this.stack[this.stack.length - 1];
6075
6078
  O.title = D;
6076
6079
  }
6077
- function ge() {
6080
+ function me() {
6078
6081
  o("inReference");
6079
6082
  }
6080
6083
  function De() {
6081
6084
  o("referenceType", "collapsed");
6082
6085
  }
6083
- function ie(D) {
6086
+ function oe(D) {
6084
6087
  const O = this.resume(), Y = this.stack[this.stack.length - 1];
6085
6088
  Y.label = O, Y.identifier = Mt(
6086
6089
  this.sliceSerialize(D)
@@ -6096,8 +6099,8 @@ function Jf(e) {
6096
6099
  O,
6097
6100
  Y === "characterReferenceMarkerNumeric" ? 10 : 16
6098
6101
  ), o("characterReferenceType")) : ee = zr(O);
6099
- const ne = this.stack.pop();
6100
- ne.value += ee, ne.position.end = Je(D.end);
6102
+ const re = this.stack.pop();
6103
+ re.value += ee, re.position.end = Je(D.end);
6101
6104
  }
6102
6105
  function Be(D) {
6103
6106
  b.call(this, D);
@@ -6162,7 +6165,7 @@ function Jf(e) {
6162
6165
  value: ""
6163
6166
  };
6164
6167
  }
6165
- function oe() {
6168
+ function ne() {
6166
6169
  return {
6167
6170
  type: "image",
6168
6171
  title: null,
@@ -6170,7 +6173,7 @@ function Jf(e) {
6170
6173
  alt: null
6171
6174
  };
6172
6175
  }
6173
- function me() {
6176
+ function he() {
6174
6177
  return {
6175
6178
  type: "link",
6176
6179
  title: null,
@@ -6178,7 +6181,7 @@ function Jf(e) {
6178
6181
  children: []
6179
6182
  };
6180
6183
  }
6181
- function he(D) {
6184
+ function ge(D) {
6182
6185
  return {
6183
6186
  type: "list",
6184
6187
  ordered: D.type === "listOrdered",
@@ -9444,7 +9447,7 @@ var go = {
9444
9447
  return ct(g);
9445
9448
  }), V = z.slice().reverse().find(function(g) {
9446
9449
  return ct(g);
9447
- }), re = !!I.find(function(g) {
9450
+ }), ie = !!I.find(function(g) {
9448
9451
  return et(g) > 0;
9449
9452
  });
9450
9453
  return {
@@ -9452,7 +9455,7 @@ var go = {
9452
9455
  tabbableNodes: I,
9453
9456
  focusableNodes: z,
9454
9457
  /** True if at least one node with positive `tabindex` was found in this container. */
9455
- posTabIndexesFound: re,
9458
+ posTabIndexesFound: ie,
9456
9459
  /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
9457
9460
  firstTabbableNode: L,
9458
9461
  /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
@@ -9478,10 +9481,10 @@ var go = {
9478
9481
  */
9479
9482
  nextTabbableNode: function(ue) {
9480
9483
  var ye = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, h = I.indexOf(ue);
9481
- return h < 0 ? ye ? z.slice(z.indexOf(ue) + 1).find(function(ge) {
9482
- return ct(ge);
9483
- }) : z.slice(0, z.indexOf(ue)).reverse().find(function(ge) {
9484
- return ct(ge);
9484
+ return h < 0 ? ye ? z.slice(z.indexOf(ue) + 1).find(function(me) {
9485
+ return ct(me);
9486
+ }) : z.slice(0, z.indexOf(ue)).reverse().find(function(me) {
9487
+ return ct(me);
9485
9488
  }) : I[h + (ye ? 1 : -1)];
9486
9489
  }
9487
9490
  };
@@ -9515,29 +9518,29 @@ var go = {
9515
9518
  I = I || on(z), m();
9516
9519
  var _ = null;
9517
9520
  if (a.tabbableGroups.length > 0) {
9518
- var V = s(I, z), re = V >= 0 ? a.containerGroups[V] : void 0;
9521
+ var V = s(I, z), ie = V >= 0 ? a.containerGroups[V] : void 0;
9519
9522
  if (V < 0)
9520
9523
  U ? _ = a.tabbableGroups[a.tabbableGroups.length - 1].lastTabbableNode : _ = a.tabbableGroups[0].firstTabbableNode;
9521
9524
  else if (U) {
9522
- var g = yo(a.tabbableGroups, function(ie) {
9523
- var Te = ie.firstTabbableNode;
9525
+ var g = yo(a.tabbableGroups, function(oe) {
9526
+ var Te = oe.firstTabbableNode;
9524
9527
  return I === Te;
9525
9528
  });
9526
- if (g < 0 && (re.container === I || fn(I, o.tabbableOptions) && !ct(I, o.tabbableOptions) && !re.nextTabbableNode(I, !1)) && (g = V), g >= 0) {
9529
+ if (g < 0 && (ie.container === I || fn(I, o.tabbableOptions) && !ct(I, o.tabbableOptions) && !ie.nextTabbableNode(I, !1)) && (g = V), g >= 0) {
9527
9530
  var ue = g === 0 ? a.tabbableGroups.length - 1 : g - 1, ye = a.tabbableGroups[ue];
9528
9531
  _ = et(I) >= 0 ? ye.lastTabbableNode : ye.lastDomTabbableNode;
9529
9532
  } else
9530
- Qt(z) || (_ = re.nextTabbableNode(I, !1));
9533
+ Qt(z) || (_ = ie.nextTabbableNode(I, !1));
9531
9534
  } else {
9532
- var h = yo(a.tabbableGroups, function(ie) {
9533
- var Te = ie.lastTabbableNode;
9535
+ var h = yo(a.tabbableGroups, function(oe) {
9536
+ var Te = oe.lastTabbableNode;
9534
9537
  return I === Te;
9535
9538
  });
9536
- if (h < 0 && (re.container === I || fn(I, o.tabbableOptions) && !ct(I, o.tabbableOptions) && !re.nextTabbableNode(I)) && (h = V), h >= 0) {
9537
- var ge = h === a.tabbableGroups.length - 1 ? 0 : h + 1, De = a.tabbableGroups[ge];
9539
+ if (h < 0 && (ie.container === I || fn(I, o.tabbableOptions) && !ct(I, o.tabbableOptions) && !ie.nextTabbableNode(I)) && (h = V), h >= 0) {
9540
+ var me = h === a.tabbableGroups.length - 1 ? 0 : h + 1, De = a.tabbableGroups[me];
9538
9541
  _ = et(I) >= 0 ? De.firstTabbableNode : De.firstDomTabbableNode;
9539
9542
  } else
9540
- Qt(z) || (_ = re.nextTabbableNode(I));
9543
+ Qt(z) || (_ = ie.nextTabbableNode(I));
9541
9544
  }
9542
9545
  } else
9543
9546
  _ = c("fallbackFocus");
@@ -9570,10 +9573,10 @@ var go = {
9570
9573
  if (et(a.mostRecentlyFocusedNode) > 0) {
9571
9574
  var _ = s(a.mostRecentlyFocusedNode), V = a.containerGroups[_].tabbableNodes;
9572
9575
  if (V.length > 0) {
9573
- var re = V.findIndex(function(g) {
9576
+ var ie = V.findIndex(function(g) {
9574
9577
  return g === a.mostRecentlyFocusedNode;
9575
9578
  });
9576
- re >= 0 && (o.isKeyForward(a.recentNavEvent) ? re + 1 < V.length && (L = V[re + 1], U = !1) : re - 1 >= 0 && (L = V[re - 1], U = !1));
9579
+ ie >= 0 && (o.isKeyForward(a.recentNavEvent) ? ie + 1 < V.length && (L = V[ie + 1], U = !1) : ie - 1 >= 0 && (L = V[ie - 1], U = !1));
9577
9580
  }
9578
9581
  } else
9579
9582
  a.containerGroups.some(function(g) {
@@ -10361,7 +10364,7 @@ function Qh(e) {
10361
10364
  }
10362
10365
  const ir = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iNDgiPjxwYXRoIGQ9Ik0yODEtMjQwcS0xNCAwLTI3LjUtMTRUMjQwLTI4MnYtOThoNTAwdi0zNDBoMTAwcTE0IDAgMjcgMTR0MTMgMjl2NTk2TDcyMS0yNDBIMjgxWk04MC0yODB2LTU1OHEwLTE0IDEzLTI4dDI3LTE0aDUxOXExNSAwIDI4IDEzLjV0MTMgMjguNXYzNTZxMCAxNC0xMyAyOHQtMjggMTRIMjQwTDgwLTI4MFptNTQwLTIyMHYtMzIwSDE0MHYzMjBoNDgwWm0tNDgwIDB2LTMyMCAzMjBaIiBmaWxsPSIjRkZGRkZGIi8+PC9zdmc+";
10363
10366
  const Yh = 991, Hh = () => {
10364
- var n, r;
10367
+ var n;
10365
10368
  const e = vt(Yh), { launchButton: t } = We(Ge);
10366
10369
  return (n = t.message) != null && n.enabled ? /* @__PURE__ */ k.jsx(
10367
10370
  "div",
@@ -10370,7 +10373,7 @@ const Yh = 991, Hh = () => {
10370
10373
  "aria-live": "assertive",
10371
10374
  "aria-label": t == null ? void 0 : t.message.text,
10372
10375
  className: "xpert_chatbot__launch-button-message",
10373
- style: e ? { ...(r = t.message.mobile) == null ? void 0 : r.style } : { ...t.message.style },
10376
+ style: e ? { ...t.message.style.mobile } : { ...t.message.style },
10374
10377
  children: t.message.text
10375
10378
  }
10376
10379
  ) : null;
@@ -10391,16 +10394,21 @@ function Xr({ submitEventExternal: e }) {
10391
10394
  proactiveMessage: a,
10392
10395
  conversationScreen: l
10393
10396
  } = We(Ge), u = vt(Vh), [, s] = we(!1), [c, p] = we(Wh), [m, d] = we(!1), [T, x] = we(!1), [j, v] = we(!1), [C, S] = we(""), [W, q] = we(!1), [M, P] = we(!0), [H, G] = we(!1), [K, A] = we(!1), [b, I] = we(!1), z = tt(null), L = tt(null), U = tt(null), _ = He.get(`${t}-test`) === "1", V = Yt(
10394
- ({ name: R, payload: oe }) => {
10395
- const me = No(r.defaultProperties, oe);
10396
- e ? e({ name: R, payload: me }) : U.current.track(
10397
+ ({ name: R, payload: ne }) => {
10398
+ console.log(
10399
+ "userTracking.defaultProperties",
10400
+ r == null ? void 0 : r.defaultProperties,
10401
+ ne
10402
+ );
10403
+ const he = No(r.defaultProperties, ne);
10404
+ console.log("resolvedPayload", he), e ? (console.log("x1"), e({ name: R, payload: he })) : (console.log("x2"), U.current.track(
10397
10405
  // TODO: this is untestable - create a custom hook to get submit event function.
10398
10406
  R,
10399
- me
10400
- );
10407
+ he
10408
+ ));
10401
10409
  },
10402
10410
  [e, r.defaultProperties]
10403
- ), re = Yt(async () => {
10411
+ ), ie = Yt(async () => {
10404
10412
  if (window != null && window.OnetrustActiveGroups && window.OnetrustActiveGroups.split(",").includes("C0003"))
10405
10413
  try {
10406
10414
  const R = He.get(
@@ -10409,7 +10417,7 @@ function Xr({ submitEventExternal: e }) {
10409
10417
  if (!R)
10410
10418
  return;
10411
10419
  d(!0);
10412
- const oe = await fetch(
10420
+ const ne = await fetch(
10413
10421
  `${n.endpoint}/xpert-chat/${R}`,
10414
10422
  {
10415
10423
  method: "GET",
@@ -10418,16 +10426,16 @@ function Xr({ submitEventExternal: e }) {
10418
10426
  }
10419
10427
  }
10420
10428
  );
10421
- if (oe.status === 404) {
10429
+ if (ne.status === 404) {
10422
10430
  He.remove(`${t}-conversation-history-id`);
10423
10431
  return;
10424
10432
  }
10425
- if (!oe.ok)
10426
- throw new rr(`HTTPError: ${oe.status} ${oe.statusText}`);
10427
- const me = await oe.json();
10433
+ if (!ne.ok)
10434
+ throw new rr(`HTTPError: ${ne.status} ${ne.statusText}`);
10435
+ const he = await ne.json();
10428
10436
  p(
10429
- me.map((he) => ({
10430
- ...he,
10437
+ he.map((ge) => ({
10438
+ ...ge,
10431
10439
  disableFeedback: !0
10432
10440
  }))
10433
10441
  ), A(!0), I(!0);
@@ -10437,16 +10445,16 @@ function Xr({ submitEventExternal: e }) {
10437
10445
  d(!1);
10438
10446
  }
10439
10447
  }, [t, n.endpoint]);
10440
- Rh(re), Oe(() => {
10448
+ Rh(ie), Oe(() => {
10441
10449
  console.log("Chatbot - mount");
10442
- let R, oe;
10450
+ let R, ne;
10443
10451
  return r.enabled && (R = setInterval(() => {
10444
- var he;
10445
- console.log("Chatbot - intervalCheckForScripts"), (he = window.analytics) != null && he.track && (!i.enabled || i.enabled && window.optimizely && window.experiments) && (console.log("Chatbot - intervalCheckForScripts all found"), U.current = window.analytics, clearInterval(R), clearTimeout(oe), s(!0));
10446
- }, 1e3), oe = setTimeout(() => {
10452
+ var ge;
10453
+ console.log("Chatbot - intervalCheckForScripts"), (ge = window.analytics) != null && ge.track && (!i.enabled || i.enabled && window.optimizely && window.experiments) && (console.log("Chatbot - intervalCheckForScripts all found"), U.current = window.analytics, clearInterval(R), clearTimeout(ne), s(!0));
10454
+ }, 1e3), ne = setTimeout(() => {
10447
10455
  clearInterval(R);
10448
10456
  }, 6e4)), () => {
10449
- console.log("Chatbot - unmount"), clearInterval(R), clearTimeout(oe);
10457
+ console.log("Chatbot - unmount"), clearInterval(R), clearTimeout(ne);
10450
10458
  };
10451
10459
  }, [
10452
10460
  i.enabled,
@@ -10455,13 +10463,13 @@ function Xr({ submitEventExternal: e }) {
10455
10463
  r.prefix
10456
10464
  ]);
10457
10465
  const g = (R) => {
10458
- var oe, me;
10459
- (oe = R == null ? void 0 : R.target) != null && oe.href && V({
10466
+ var ne, he;
10467
+ (ne = R == null ? void 0 : R.target) != null && ne.href && V({
10460
10468
  name: `${r.prefix}.bi.xpert.chatbot.popup.chat.message.link.clicked`,
10461
10469
  payload: {
10462
10470
  category: "2u",
10463
10471
  label: "xpert-chatbot",
10464
- link: (me = R == null ? void 0 : R.target) == null ? void 0 : me.href,
10472
+ link: (he = R == null ? void 0 : R.target) == null ? void 0 : he.href,
10465
10473
  isTestUser: _
10466
10474
  }
10467
10475
  });
@@ -10479,7 +10487,7 @@ function Xr({ submitEventExternal: e }) {
10479
10487
  );
10480
10488
  const ye = () => {
10481
10489
  S(""), L.current.value = "", L.current.style.height = "auto";
10482
- }, h = (R, oe) => {
10490
+ }, h = (R, ne) => {
10483
10491
  V({
10484
10492
  name: `${r.prefix}.bi.xpert.chatbot.popup.chat.message.response`,
10485
10493
  payload: {
@@ -10488,14 +10496,14 @@ function Xr({ submitEventExternal: e }) {
10488
10496
  linkCount: Bh(R),
10489
10497
  apiResponseMessage: R,
10490
10498
  isTestUser: _,
10491
- conversationHistoryId: oe
10499
+ conversationHistoryId: ne
10492
10500
  }
10493
10501
  });
10494
- }, ge = ({
10502
+ }, me = ({
10495
10503
  conversationSize: R,
10496
- userInputMessage: oe,
10497
- apiResponseMessage: me,
10498
- elapsedSeconds: he,
10504
+ userInputMessage: ne,
10505
+ apiResponseMessage: he,
10506
+ elapsedSeconds: ge,
10499
10507
  conversationByteSize: je
10500
10508
  }) => {
10501
10509
  V({
@@ -10505,9 +10513,9 @@ function Xr({ submitEventExternal: e }) {
10505
10513
  label: "xpert-chatbot",
10506
10514
  isTestUser: _,
10507
10515
  conversationSize: R,
10508
- userInputMessage: oe,
10509
- apiResponseMessage: me,
10510
- elapsedSeconds: he,
10516
+ userInputMessage: ne,
10517
+ apiResponseMessage: he,
10518
+ elapsedSeconds: ge,
10511
10519
  conversationByteSize: je
10512
10520
  }
10513
10521
  });
@@ -10515,21 +10523,21 @@ function Xr({ submitEventExternal: e }) {
10515
10523
  try {
10516
10524
  if (R.trim().length === 0)
10517
10525
  return;
10518
- const oe = /* @__PURE__ */ new Date();
10526
+ const ne = /* @__PURE__ */ new Date();
10519
10527
  I(!1), q(!1);
10520
- const me = c.filter((D) => D.role === "user").length + 1;
10528
+ const he = c.filter((D) => D.role === "user").length + 1;
10521
10529
  V({
10522
10530
  name: `${r.prefix}.bi.xpert.chatbot.popup.chat.message.sent`,
10523
10531
  payload: {
10524
10532
  category: "2u",
10525
10533
  label: "xpert-chatbot",
10526
- totalUserInputMessagesSent: me,
10534
+ totalUserInputMessagesSent: he,
10527
10535
  userInputMessage: R,
10528
10536
  isTestUser: _
10529
10537
  }
10530
10538
  }), ye();
10531
- let he = He.get(`${t}-conversation-history-id`) || "";
10532
- !he && l.conversationHistory.enabled ? p([
10539
+ let ge = He.get(`${t}-conversation-history-id`) || "";
10540
+ !ge && l.conversationHistory.enabled ? p([
10533
10541
  {
10534
10542
  role: "user",
10535
10543
  content: R
@@ -10554,7 +10562,7 @@ function Xr({ submitEventExternal: e }) {
10554
10562
  method: "POST",
10555
10563
  headers: {
10556
10564
  "Content-Type": "application/json",
10557
- "Conversation-History-Id": he
10565
+ "Conversation-History-Id": ge
10558
10566
  },
10559
10567
  body: JSON.stringify({
10560
10568
  message_list: je,
@@ -10563,20 +10571,20 @@ function Xr({ submitEventExternal: e }) {
10563
10571
  });
10564
10572
  if (!xe.ok)
10565
10573
  throw new rr(`HTTPError: ${xe.status} ${xe.statusText}`);
10566
- he = xe.headers.get("Conversation-History-Id"), he && He.set(
10574
+ ge = xe.headers.get("Conversation-History-Id"), ge && He.set(
10567
10575
  `${t}-conversation-history-id`,
10568
- he,
10576
+ ge,
10569
10577
  { expires: 1 }
10570
10578
  );
10571
10579
  const Xe = (await xe.json()).content;
10572
- h(Xe, he);
10580
+ h(Xe, ge);
10573
10581
  const jt = /* @__PURE__ */ new Date();
10574
- ge({
10582
+ me({
10575
10583
  conversationByteSize: Qh(JSON.stringify(je)),
10576
10584
  conversationSize: c.length + 2,
10577
10585
  userInputMessage: R,
10578
10586
  apiResponseMessage: Xe,
10579
- elapsedSeconds: Uh(oe, jt)
10587
+ elapsedSeconds: Uh(ne, jt)
10580
10588
  }), p((D) => [
10581
10589
  ...D,
10582
10590
  {
@@ -10585,10 +10593,10 @@ function Xr({ submitEventExternal: e }) {
10585
10593
  createdAt: /* @__PURE__ */ new Date()
10586
10594
  }
10587
10595
  ]), A(!1), d(!1), ye(), I(!0);
10588
- } catch (oe) {
10589
- d(!1), ye(), q(!0), console.error(oe);
10596
+ } catch (ne) {
10597
+ d(!1), ye(), q(!0), console.error(ne);
10590
10598
  }
10591
- }, ie = () => {
10599
+ }, oe = () => {
10592
10600
  v(!1), x(!0), V({
10593
10601
  name: `${r.prefix}.bi.xpert.chatbot.action.button.clicked`,
10594
10602
  payload: {
@@ -10644,9 +10652,9 @@ function Xr({ submitEventExternal: e }) {
10644
10652
  S(R.target.value);
10645
10653
  }, It = (R) => {
10646
10654
  R.key === "Enter" && C.trim() === "" || R.key === "Enter" && !R.shiftKey && (R.preventDefault(), De(C));
10647
- }, Nt = (R, oe = "") => {
10648
- const me = c.map((he, je) => R === je ? (V({
10649
- name: `${r.prefix}.bi.xpert.chatbot.feedback.thumbs.${oe.toLowerCase()}.clicked`,
10655
+ }, Nt = (R, ne = "") => {
10656
+ const he = c.map((ge, je) => R === je ? (V({
10657
+ name: `${r.prefix}.bi.xpert.chatbot.feedback.thumbs.${ne.toLowerCase()}.clicked`,
10650
10658
  payload: {
10651
10659
  category: "2u",
10652
10660
  label: "xpert-chatbot",
@@ -10656,10 +10664,10 @@ function Xr({ submitEventExternal: e }) {
10656
10664
  isTestUser: _
10657
10665
  }
10658
10666
  }), {
10659
- ...he,
10660
- feedbackThumbType: oe
10661
- }) : he);
10662
- p(me), A(!1);
10667
+ ...ge,
10668
+ feedbackThumbType: ne
10669
+ }) : ge);
10670
+ p(he), A(!1);
10663
10671
  };
10664
10672
  return (
10665
10673
  // do not remove this class as it's needed to turn off chatbot
@@ -10694,7 +10702,7 @@ function Xr({ submitEventExternal: e }) {
10694
10702
  /* @__PURE__ */ k.jsx(
10695
10703
  Wr,
10696
10704
  {
10697
- onClick: ie,
10705
+ onClick: oe,
10698
10706
  label: "Open XPERT Chatbot",
10699
10707
  style: u ? { ...(ot = o.style) == null ? void 0 : ot.mobile } : { ...o.style },
10700
10708
  "aria-haspopup": "dialog",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2uinc/frontend-component-xpert-chatbot",
3
- "version": "1.7.0-beta.1",
3
+ "version": "1.7.0-beta.3",
4
4
  "homepage": "/app/plugins/xpert-chatbot/frontend/build/",
5
5
  "repository": {
6
6
  "type": "git",