@botpress/webchat 4.4.8 → 4.4.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/dist/index.js CHANGED
@@ -478,8 +478,8 @@ var dh = { exports: {} };
478
478
  return this.$d.getTime();
479
479
  }, _.startOf = function(D, U) {
480
480
  var B = this, j = !!O.u(U) || U, b = O.p(D), M = function(ie, Y) {
481
- var ee = O.w(B.$u ? Date.UTC(B.$y, Y, ie) : new Date(B.$y, Y, ie), B);
482
- return j ? ee : ee.endOf(u);
481
+ var te = O.w(B.$u ? Date.UTC(B.$y, Y, ie) : new Date(B.$y, Y, ie), B);
482
+ return j ? te : te.endOf(u);
483
483
  }, $ = function(ie, Y) {
484
484
  return O.w(B.toDate()[ie].apply(B.toDate("s"), (j ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(Y)), B);
485
485
  }, x = this.$W, V = this.$M, Z = this.$D, q = "set" + (this.$u ? "UTC" : "");
@@ -534,16 +534,16 @@ var dh = { exports: {} };
534
534
  }, _.format = function(D) {
535
535
  var U = this, B = this.$locale();
536
536
  if (!this.isValid()) return B.invalidDate || m;
537
- var j = D || "YYYY-MM-DDTHH:mm:ssZ", b = O.z(this), M = this.$H, $ = this.$m, x = this.$M, V = B.weekdays, Z = B.months, q = B.meridiem, K = function(Y, ee, F, te) {
538
- return Y && (Y[ee] || Y(U, j)) || F[ee].slice(0, te);
537
+ var j = D || "YYYY-MM-DDTHH:mm:ssZ", b = O.z(this), M = this.$H, $ = this.$m, x = this.$M, V = B.weekdays, Z = B.months, q = B.meridiem, K = function(Y, te, F, ee) {
538
+ return Y && (Y[te] || Y(U, j)) || F[te].slice(0, ee);
539
539
  }, J = function(Y) {
540
540
  return O.s(M % 12 || 12, Y, "0");
541
- }, ie = q || function(Y, ee, F) {
542
- var te = Y < 12 ? "AM" : "PM";
543
- return F ? te.toLowerCase() : te;
541
+ }, ie = q || function(Y, te, F) {
542
+ var ee = Y < 12 ? "AM" : "PM";
543
+ return F ? ee.toLowerCase() : ee;
544
544
  };
545
- return j.replace(v, function(Y, ee) {
546
- return ee || function(F) {
545
+ return j.replace(v, function(Y, te) {
546
+ return te || function(F) {
547
547
  switch (F) {
548
548
  case "YY":
549
549
  return String(U.$y).slice(-2);
@@ -9648,13 +9648,13 @@ function US(e, t, n) {
9648
9648
  function M(q) {
9649
9649
  return K;
9650
9650
  function K(J) {
9651
- const ie = J !== null && q[J], Y = J !== null && q.null, ee = [
9651
+ const ie = J !== null && q[J], Y = J !== null && q.null, te = [
9652
9652
  // To do: add more extension tests.
9653
9653
  /* c8 ignore next 2 */
9654
9654
  ...Array.isArray(ie) ? ie : ie ? [ie] : [],
9655
9655
  ...Array.isArray(Y) ? Y : Y ? [Y] : []
9656
9656
  ];
9657
- return $(ee)(J);
9657
+ return $(te)(J);
9658
9658
  }
9659
9659
  }
9660
9660
  function $(q) {
@@ -9845,15 +9845,15 @@ function JS(e) {
9845
9845
  blockQuote: o(Y),
9846
9846
  characterEscape: N,
9847
9847
  characterReference: N,
9848
- codeFenced: o(ee),
9848
+ codeFenced: o(te),
9849
9849
  codeFencedFenceInfo: s,
9850
9850
  codeFencedFenceMeta: s,
9851
- codeIndented: o(ee, s),
9851
+ codeIndented: o(te, s),
9852
9852
  codeText: o(F, s),
9853
9853
  codeTextData: N,
9854
9854
  data: N,
9855
9855
  codeFlowValue: N,
9856
- definition: o(te),
9856
+ definition: o(ee),
9857
9857
  definitionDestinationString: s,
9858
9858
  definitionLabelString: s,
9859
9859
  definitionTitleString: s,
@@ -10244,7 +10244,7 @@ function JS(e) {
10244
10244
  children: []
10245
10245
  };
10246
10246
  }
10247
- function ee() {
10247
+ function te() {
10248
10248
  return {
10249
10249
  type: "code",
10250
10250
  lang: null,
@@ -10258,7 +10258,7 @@ function JS(e) {
10258
10258
  value: ""
10259
10259
  };
10260
10260
  }
10261
- function te() {
10261
+ function ee() {
10262
10262
  return {
10263
10263
  type: "definition",
10264
10264
  identifier: "",
@@ -17313,13 +17313,13 @@ function DI(e, t, n, r, i, o, s, a, l, u, f, c, h, d, p, m, g, v, y) {
17313
17313
  let P = !1, L = 0, _ = 0, D = !1, U = !1, B = !1, j = !1;
17314
17314
  function b(F) {
17315
17315
  if (!y) return;
17316
- function te(Ie) {
17316
+ function ee(Ie) {
17317
17317
  (Qo(y) || y(F, Ie)) && q(Ie);
17318
17318
  }
17319
17319
  const pe = t;
17320
17320
  I.add(pe, "dragstart", (Ie) => Ie.preventDefault(), k).add(pe, "touchmove", () => {
17321
17321
  }, k).add(pe, "touchend", () => {
17322
- }).add(pe, "touchstart", te).add(pe, "mousedown", te).add(pe, "touchcancel", J).add(pe, "contextmenu", J).add(pe, "click", ie, !0);
17322
+ }).add(pe, "touchstart", ee).add(pe, "mousedown", ee).add(pe, "touchcancel", J).add(pe, "contextmenu", J).add(pe, "click", ie, !0);
17323
17323
  }
17324
17324
  function M() {
17325
17325
  I.clear(), R.clear();
@@ -17329,19 +17329,19 @@ function DI(e, t, n, r, i, o, s, a, l, u, f, c, h, d, p, m, g, v, y) {
17329
17329
  R.add(F, "touchmove", K, k).add(F, "touchend", J).add(F, "mousemove", K, k).add(F, "mouseup", J);
17330
17330
  }
17331
17331
  function x(F) {
17332
- const te = F.nodeName || "";
17333
- return S.includes(te);
17332
+ const ee = F.nodeName || "";
17333
+ return S.includes(ee);
17334
17334
  }
17335
17335
  function V() {
17336
17336
  return (p ? O : A)[j ? "mouse" : "touch"];
17337
17337
  }
17338
- function Z(F, te) {
17338
+ function Z(F, ee) {
17339
17339
  const pe = c.add(du(F) * -1), Ie = f.byDistance(F, !p).distance;
17340
- return p || Ue(F) < N ? Ie : g && te ? Ie * 0.5 : f.byIndex(pe.get(), 0).distance;
17340
+ return p || Ue(F) < N ? Ie : g && ee ? Ie * 0.5 : f.byIndex(pe.get(), 0).distance;
17341
17341
  }
17342
17342
  function q(F) {
17343
- const te = Za(F, r);
17344
- j = te, B = p && te && !F.buttons && P, P = qr(i.get(), s.get()) >= 2, !(te && F.button !== 0) && (x(F.target) || (D = !0, o.pointerDown(F), u.useFriction(0).useDuration(0), i.set(s), $(), L = o.readPoint(F), _ = o.readPoint(F, w), h.emit("pointerDown")));
17343
+ const ee = Za(F, r);
17344
+ j = ee, B = p && ee && !F.buttons && P, P = qr(i.get(), s.get()) >= 2, !(ee && F.button !== 0) && (x(F.target) || (D = !0, o.pointerDown(F), u.useFriction(0).useDuration(0), i.set(s), $(), L = o.readPoint(F), _ = o.readPoint(F, w), h.emit("pointerDown")));
17345
17345
  }
17346
17346
  function K(F) {
17347
17347
  if (!Za(F, r) && F.touches.length >= 2) return J(F);
@@ -17998,7 +17998,7 @@ function JI(e, t, n, r, i, o, s) {
17998
17998
  scrollContainLimit: q
17999
17999
  } = $I(z, V, x, y, I), K = _ ? Z : x, {
18000
18000
  limit: J
18001
- } = BI(V, K, c), ie = Qm(yi(K), f, c), Y = ie.clone(), ee = ti(n), F = ({
18001
+ } = BI(V, K, c), ie = Qm(yi(K), f, c), Y = ie.clone(), te = ti(n), F = ({
18002
18002
  dragHandler: de,
18003
18003
  scrollBody: qe,
18004
18004
  scrollBounds: Ge,
@@ -18007,7 +18007,7 @@ function JI(e, t, n, r, i, o, s) {
18007
18007
  }
18008
18008
  }) => {
18009
18009
  et || Ge.constrain(de.pointerDown()), qe.seek();
18010
- }, te = ({
18010
+ }, ee = ({
18011
18011
  scrollBody: de,
18012
18012
  translate: qe,
18013
18013
  location: Ge,
@@ -18027,9 +18027,9 @@ function JI(e, t, n, r, i, o, s) {
18027
18027
  Hu && lt.stop();
18028
18028
  const vv = Ge.get() * $u + Et.get() * (1 - $u);
18029
18029
  et.set(vv), Fu && (Nt.loop(de.direction()), Qe.loop()), qe.to(et.get()), Hu && Ai.emit("settle"), zu || Ai.emit("scroll");
18030
- }, pe = OI(r, i, () => F(se), (de) => te(se, de)), Ie = 0.68, Q = K[ie.get()], le = $r(Q), fe = $r(Q), ce = $r(Q), Ce = $r(Q), $e = _I(le, ce, fe, Ce, h, Ie), Oe = VI(c, K, V, J, Ce), je = WI(pe, ie, Y, $e, Oe, Ce, s), X = HI(J), oe = ri(), H = GI(t, n, s, m), {
18030
+ }, pe = OI(r, i, () => F(se), (de) => ee(se, de)), Ie = 0.68, Q = K[ie.get()], le = $r(Q), fe = $r(Q), ce = $r(Q), Ce = $r(Q), $e = _I(le, ce, fe, Ce, h, Ie), Oe = VI(c, K, V, J, Ce), je = WI(pe, ie, Y, $e, Oe, Ce, s), X = HI(J), oe = ri(), H = GI(t, n, s, m), {
18031
18031
  slideRegistry: W
18032
- } = jI(_, y, K, q, M, ee), re = qI(e, n, W, je, $e, oe, s, k), se = {
18032
+ } = jI(_, y, K, q, M, te), re = qI(e, n, W, je, $e, oe, s, k), se = {
18033
18033
  ownerDocument: r,
18034
18034
  ownerWindow: i,
18035
18035
  eventHandler: s,
@@ -18060,7 +18060,7 @@ function JI(e, t, n, r, i, o, s) {
18060
18060
  slideFocus: re,
18061
18061
  slidesHandler: KI(t, s, E),
18062
18062
  slidesInView: H,
18063
- slideIndexes: ee,
18063
+ slideIndexes: te,
18064
18064
  slideRegistry: W,
18065
18065
  slidesToScroll: M,
18066
18066
  target: Ce,
@@ -18166,33 +18166,33 @@ function So(e, t, n) {
18166
18166
  let g = !1, v, y = u(eO, So.globalOptions), w = u(y), E = [], S, k, I;
18167
18167
  function R() {
18168
18168
  const {
18169
- container: ee,
18169
+ container: te,
18170
18170
  slides: F
18171
18171
  } = w;
18172
- k = (Qa(ee) ? e.querySelector(ee) : ee) || e.children[0];
18172
+ k = (Qa(te) ? e.querySelector(te) : te) || e.children[0];
18173
18173
  const pe = Qa(F) ? k.querySelectorAll(F) : F;
18174
18174
  I = [].slice.call(pe || k.children);
18175
18175
  }
18176
- function N(ee) {
18177
- const F = JI(e, k, I, r, i, ee, l);
18178
- if (ee.loop && !F.slideLooper.canLoop()) {
18179
- const te = Object.assign({}, ee, {
18176
+ function N(te) {
18177
+ const F = JI(e, k, I, r, i, te, l);
18178
+ if (te.loop && !F.slideLooper.canLoop()) {
18179
+ const ee = Object.assign({}, te, {
18180
18180
  loop: !1
18181
18181
  });
18182
- return N(te);
18182
+ return N(ee);
18183
18183
  }
18184
18184
  return F;
18185
18185
  }
18186
- function A(ee, F) {
18187
- g || (y = u(y, ee), w = f(y), E = F || E, R(), v = N(w), c([y, ...E.map(({
18188
- options: te
18189
- }) => te)]).forEach((te) => a.add(te, "change", O)), w.active && (v.translate.to(v.location.get()), v.animation.init(), v.slidesInView.init(), v.slideFocus.init(Y), v.eventHandler.init(Y), v.resizeHandler.init(Y), v.slidesHandler.init(Y), v.options.loop && v.slideLooper.loop(), k.offsetParent && I.length && v.dragHandler.init(Y), S = s.init(Y, E)));
18186
+ function A(te, F) {
18187
+ g || (y = u(y, te), w = f(y), E = F || E, R(), v = N(w), c([y, ...E.map(({
18188
+ options: ee
18189
+ }) => ee)]).forEach((ee) => a.add(ee, "change", O)), w.active && (v.translate.to(v.location.get()), v.animation.init(), v.slidesInView.init(), v.slideFocus.init(Y), v.eventHandler.init(Y), v.resizeHandler.init(Y), v.slidesHandler.init(Y), v.options.loop && v.slideLooper.loop(), k.offsetParent && I.length && v.dragHandler.init(Y), S = s.init(Y, E)));
18190
18190
  }
18191
- function O(ee, F) {
18192
- const te = M();
18191
+ function O(te, F) {
18192
+ const ee = M();
18193
18193
  z(), A(u({
18194
- startIndex: te
18195
- }, ee), F), l.emit("reInit");
18194
+ startIndex: ee
18195
+ }, te), F), l.emit("reInit");
18196
18196
  }
18197
18197
  function z() {
18198
18198
  v.dragHandler.destroy(), v.eventStore.clear(), v.translate.clear(), v.slideLooper.clear(), v.resizeHandler.destroy(), v.slidesHandler.destroy(), v.slidesInView.destroy(), v.animation.destroy(), s.destroy(), a.clear();
@@ -18200,16 +18200,16 @@ function So(e, t, n) {
18200
18200
  function P() {
18201
18201
  g || (g = !0, a.clear(), z(), l.emit("destroy"), l.clear());
18202
18202
  }
18203
- function L(ee, F, te) {
18204
- !w.active || g || (v.scrollBody.useBaseFriction().useDuration(F === !0 ? 0 : w.duration), v.scrollTo.index(ee, te || 0));
18203
+ function L(te, F, ee) {
18204
+ !w.active || g || (v.scrollBody.useBaseFriction().useDuration(F === !0 ? 0 : w.duration), v.scrollTo.index(te, ee || 0));
18205
18205
  }
18206
- function _(ee) {
18206
+ function _(te) {
18207
18207
  const F = v.index.add(1).get();
18208
- L(F, ee, -1);
18208
+ L(F, te, -1);
18209
18209
  }
18210
- function D(ee) {
18210
+ function D(te) {
18211
18211
  const F = v.index.add(-1).get();
18212
- L(F, ee, 1);
18212
+ L(F, te, 1);
18213
18213
  }
18214
18214
  function U() {
18215
18215
  return v.index.add(1).get() !== M();
@@ -20649,10 +20649,10 @@ function QR(e, t) {
20649
20649
  virtualItemRef: R
20650
20650
  } = t;
20651
20651
  process.env.NODE_ENV !== "production" && (h && (d || console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow", "escaping."].join(" ")), g || console.warn(["Floating UI: `useListNavigation` must be virtual to allow", "escaping."].join(" "))), S === "vertical" && k > 1 && console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the", '`orientation` should be either "horizontal" or "both".'].join(" ")));
20652
- const N = kg(), A = rs(), O = yn(u), z = C.useRef(v), P = C.useRef(c ?? -1), L = C.useRef(null), _ = C.useRef(!0), D = C.useRef(O), U = C.useRef(!!s), B = C.useRef(!1), j = C.useRef(!1), b = gn(E), M = gn(n), $ = gn(I), [x, V] = C.useState(), [Z, q] = C.useState(), K = yn(function(Y, ee, F) {
20652
+ const N = kg(), A = rs(), O = yn(u), z = C.useRef(v), P = C.useRef(c ?? -1), L = C.useRef(null), _ = C.useRef(!0), D = C.useRef(O), U = C.useRef(!!s), B = C.useRef(!1), j = C.useRef(!1), b = gn(E), M = gn(n), $ = gn(I), [x, V] = C.useState(), [Z, q] = C.useState(), K = yn(function(Y, te, F) {
20653
20653
  F === void 0 && (F = !1);
20654
- const te = Y.current[ee.current];
20655
- te && (g ? (V(te.id), A == null || A.events.emit("virtualfocus", te), R && (R.current = te)) : en(te, {
20654
+ const ee = Y.current[te.current];
20655
+ ee && (g ? (V(ee.id), A == null || A.events.emit("virtualfocus", ee), R && (R.current = ee)) : en(ee, {
20656
20656
  preventScroll: !0,
20657
20657
  // Mac Safari does not move the virtual cursor unless the focus call
20658
20658
  // is sync. However, for the very first focus call, we need to wait
@@ -20665,7 +20665,7 @@ function QR(e, t) {
20665
20665
  sync: lO() && ig() ? rd || B.current : !1
20666
20666
  }), requestAnimationFrame(() => {
20667
20667
  const pe = $.current;
20668
- pe && te && (F || !_.current) && (te.scrollIntoView == null || te.scrollIntoView(typeof pe == "boolean" ? {
20668
+ pe && ee && (F || !_.current) && (ee.scrollIntoView == null || ee.scrollIntoView(typeof pe == "boolean" ? {
20669
20669
  block: "nearest",
20670
20670
  inline: "nearest"
20671
20671
  } : pe));
@@ -20686,24 +20686,24 @@ function QR(e, t) {
20686
20686
  return;
20687
20687
  if (U.current && (P.current = -1, K(a, P)), !U.current && z.current && (L.current != null || z.current === !0 && L.current == null)) {
20688
20688
  let Y = 0;
20689
- const ee = () => {
20690
- a.current[0] == null ? (Y < 2 && (Y ? requestAnimationFrame : queueMicrotask)(ee), Y++) : (P.current = L.current == null || ea(L.current, S, m) || p ? Qs(a, b.current) : Qf(a, b.current), L.current = null, O(P.current));
20689
+ const te = () => {
20690
+ a.current[0] == null ? (Y < 2 && (Y ? requestAnimationFrame : queueMicrotask)(te), Y++) : (P.current = L.current == null || ea(L.current, S, m) || p ? Qs(a, b.current) : Qf(a, b.current), L.current = null, O(P.current));
20691
20691
  };
20692
- ee();
20692
+ te();
20693
20693
  }
20694
20694
  } else Yr(a, l) || (P.current = l, K(a, P, j.current), j.current = !1);
20695
20695
  }, [f, n, s, l, c, p, a, S, m, O, K, b]), Xe(() => {
20696
- var Y, ee;
20696
+ var Y, te;
20697
20697
  if (!f || s || !A || g || !U.current)
20698
20698
  return;
20699
- const F = A.nodesRef.current, te = (Y = F.find((Q) => Q.id === N)) == null || (ee = Y.context) == null ? void 0 : ee.elements.floating, pe = hn(Ft(s)), Ie = F.some((Q) => Q.context && pt(Q.context.elements.floating, pe));
20700
- te && !Ie && _.current && te.focus({
20699
+ const F = A.nodesRef.current, ee = (Y = F.find((Q) => Q.id === N)) == null || (te = Y.context) == null ? void 0 : te.elements.floating, pe = hn(Ft(s)), Ie = F.some((Q) => Q.context && pt(Q.context.elements.floating, pe));
20700
+ ee && !Ie && _.current && ee.focus({
20701
20701
  preventScroll: !0
20702
20702
  });
20703
20703
  }, [f, s, A, N, g]), Xe(() => {
20704
20704
  if (!f || !A || !g || N) return;
20705
- function Y(ee) {
20706
- q(ee.id), R && (R.current = ee);
20705
+ function Y(te) {
20706
+ q(te.id), R && (R.current = te);
20707
20707
  }
20708
20708
  return A.events.on("virtualfocus", Y), () => {
20709
20709
  A.events.off("virtualfocus", Y);
@@ -20716,21 +20716,21 @@ function QR(e, t) {
20716
20716
  const J = l != null, ie = C.useMemo(() => {
20717
20717
  function Y(F) {
20718
20718
  if (!n) return;
20719
- const te = a.current.indexOf(F);
20720
- te !== -1 && O(te);
20719
+ const ee = a.current.indexOf(F);
20720
+ ee !== -1 && O(ee);
20721
20721
  }
20722
20722
  return {
20723
20723
  onFocus(F) {
20724
20724
  let {
20725
- currentTarget: te
20725
+ currentTarget: ee
20726
20726
  } = F;
20727
- Y(te);
20727
+ Y(ee);
20728
20728
  },
20729
20729
  onClick: (F) => {
20730
20730
  let {
20731
- currentTarget: te
20731
+ currentTarget: ee
20732
20732
  } = F;
20733
- return te.focus({
20733
+ return ee.focus({
20734
20734
  preventScroll: !0
20735
20735
  });
20736
20736
  },
@@ -20738,15 +20738,15 @@ function QR(e, t) {
20738
20738
  ...y && {
20739
20739
  onMouseMove(F) {
20740
20740
  let {
20741
- currentTarget: te
20741
+ currentTarget: ee
20742
20742
  } = F;
20743
- Y(te);
20743
+ Y(ee);
20744
20744
  },
20745
20745
  onPointerLeave(F) {
20746
20746
  let {
20747
- pointerType: te
20747
+ pointerType: ee
20748
20748
  } = F;
20749
- !_.current || te === "touch" || (P.current = -1, K(a, P), O(null), g || en(i.floating.current, {
20749
+ !_.current || ee === "touch" || (P.current = -1, K(a, P), O(null), g || en(i.floating.current, {
20750
20750
  preventScroll: !0
20751
20751
  }));
20752
20752
  }
@@ -20757,7 +20757,7 @@ function QR(e, t) {
20757
20757
  if (!f)
20758
20758
  return {};
20759
20759
  const Y = b.current;
20760
- function ee(Q) {
20760
+ function te(Q) {
20761
20761
  if (_.current = !1, B.current = !0, !M.current && Q.currentTarget === i.floating.current)
20762
20762
  return;
20763
20763
  if (p && od(Q.key, S, m)) {
@@ -20800,7 +20800,7 @@ function QR(e, t) {
20800
20800
  function F(Q) {
20801
20801
  v === "auto" && ng(Q.nativeEvent) && (z.current = !0);
20802
20802
  }
20803
- function te(Q) {
20803
+ function ee(Q) {
20804
20804
  z.current = v, v === "auto" && rg(Q.nativeEvent) && (z.current = !0);
20805
20805
  }
20806
20806
  const pe = g && n && J && {
@@ -20830,27 +20830,27 @@ function QR(e, t) {
20830
20830
  return;
20831
20831
  }
20832
20832
  }
20833
- return ee(Q);
20833
+ return te(Q);
20834
20834
  }
20835
20835
  if (!(!n && !w && le)) {
20836
20836
  if ($e && (L.current = p && Ce ? null : Q.key), p) {
20837
20837
  fe && (nt(Q), n ? (P.current = Qs(a, Y), O(P.current)) : r(!0, Q.nativeEvent));
20838
20838
  return;
20839
20839
  }
20840
- Ce && (c != null && (P.current = c), nt(Q), !n && w ? r(!0, Q.nativeEvent) : ee(Q), n && O(P.current));
20840
+ Ce && (c != null && (P.current = c), nt(Q), !n && w ? r(!0, Q.nativeEvent) : te(Q), n && O(P.current));
20841
20841
  }
20842
20842
  },
20843
20843
  onFocus() {
20844
20844
  n && O(null);
20845
20845
  },
20846
- onPointerDown: te,
20846
+ onPointerDown: ee,
20847
20847
  onMouseDown: F,
20848
20848
  onClick: F
20849
20849
  },
20850
20850
  floating: {
20851
20851
  "aria-orientation": S === "both" ? void 0 : S,
20852
20852
  ...pe,
20853
- onKeyDown: ee,
20853
+ onKeyDown: te,
20854
20854
  onPointerMove() {
20855
20855
  _.current = !0;
20856
20856
  }
@@ -21681,8 +21681,8 @@ function CD() {
21681
21681
  }
21682
21682
  function E(F) {
21683
21683
  if (typeof F == "object" && F !== null) {
21684
- var te = F.$$typeof;
21685
- switch (te) {
21684
+ var ee = F.$$typeof;
21685
+ switch (ee) {
21686
21686
  case t:
21687
21687
  var pe = F.type;
21688
21688
  switch (pe) {
@@ -21703,11 +21703,11 @@ function CD() {
21703
21703
  case s:
21704
21704
  return Ie;
21705
21705
  default:
21706
- return te;
21706
+ return ee;
21707
21707
  }
21708
21708
  }
21709
21709
  case n:
21710
- return te;
21710
+ return ee;
21711
21711
  }
21712
21712
  }
21713
21713
  }
@@ -21748,10 +21748,10 @@ function CD() {
21748
21748
  function Y(F) {
21749
21749
  return E(F) === i;
21750
21750
  }
21751
- function ee(F) {
21751
+ function te(F) {
21752
21752
  return E(F) === c;
21753
21753
  }
21754
- De.AsyncMode = S, De.ConcurrentMode = k, De.ContextConsumer = I, De.ContextProvider = R, De.Element = N, De.ForwardRef = A, De.Fragment = O, De.Lazy = z, De.Memo = P, De.Portal = L, De.Profiler = _, De.StrictMode = D, De.Suspense = U, De.isAsyncMode = j, De.isConcurrentMode = b, De.isContextConsumer = M, De.isContextProvider = $, De.isElement = x, De.isForwardRef = V, De.isFragment = Z, De.isLazy = q, De.isMemo = K, De.isPortal = J, De.isProfiler = ie, De.isStrictMode = Y, De.isSuspense = ee, De.isValidElementType = w, De.typeOf = E;
21754
+ De.AsyncMode = S, De.ConcurrentMode = k, De.ContextConsumer = I, De.ContextProvider = R, De.Element = N, De.ForwardRef = A, De.Fragment = O, De.Lazy = z, De.Memo = P, De.Portal = L, De.Profiler = _, De.StrictMode = D, De.Suspense = U, De.isAsyncMode = j, De.isConcurrentMode = b, De.isContextConsumer = M, De.isContextProvider = $, De.isElement = x, De.isForwardRef = V, De.isFragment = Z, De.isLazy = q, De.isMemo = K, De.isPortal = J, De.isProfiler = ie, De.isStrictMode = Y, De.isSuspense = te, De.isValidElementType = w, De.typeOf = E;
21755
21755
  }()), De;
21756
21756
  }
21757
21757
  var pd;
@@ -21924,19 +21924,19 @@ function ID() {
21924
21924
  function g(b) {
21925
21925
  if (process.env.NODE_ENV !== "production")
21926
21926
  var M = {}, $ = 0;
21927
- function x(Z, q, K, J, ie, Y, ee) {
21928
- if (J = J || h, Y = Y || K, ee !== n) {
21927
+ function x(Z, q, K, J, ie, Y, te) {
21928
+ if (J = J || h, Y = Y || K, te !== n) {
21929
21929
  if (l) {
21930
21930
  var F = new Error(
21931
21931
  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
21932
21932
  );
21933
21933
  throw F.name = "Invariant Violation", F;
21934
21934
  } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
21935
- var te = J + ":" + K;
21936
- !M[te] && // Avoid spamming the console because they are often not actionable except for lib authors
21935
+ var ee = J + ":" + K;
21936
+ !M[ee] && // Avoid spamming the console because they are often not actionable except for lib authors
21937
21937
  $ < 3 && (o(
21938
21938
  "You are manually calling a React.PropTypes validation function for the `" + Y + "` prop on `" + J + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
21939
- ), M[te] = !0, $++);
21939
+ ), M[ee] = !0, $++);
21940
21940
  }
21941
21941
  }
21942
21942
  return q[K] == null ? Z ? q[K] === null ? new m("The " + ie + " `" + Y + "` is marked as required " + ("in `" + J + "`, but its value is `null`.")) : new m("The " + ie + " `" + Y + "` is marked as required in " + ("`" + J + "`, but its value is `undefined`.")) : null : b(q, K, J, ie, Y);
@@ -22020,9 +22020,9 @@ function ID() {
22020
22020
  for (var K = $[x], J = 0; J < b.length; J++)
22021
22021
  if (p(K, b[J]))
22022
22022
  return null;
22023
- var ie = JSON.stringify(b, function(ee, F) {
22024
- var te = U(F);
22025
- return te === "symbol" ? String(F) : F;
22023
+ var ie = JSON.stringify(b, function(te, F) {
22024
+ var ee = U(F);
22025
+ return ee === "symbol" ? String(F) : F;
22026
22026
  });
22027
22027
  return new m("Invalid " + Z + " `" + q + "` of value `" + String(K) + "` " + ("supplied to `" + V + "`, expected one of " + ie + "."));
22028
22028
  }
@@ -22057,13 +22057,13 @@ function ID() {
22057
22057
  }
22058
22058
  function x(V, Z, q, K, J) {
22059
22059
  for (var ie = [], Y = 0; Y < b.length; Y++) {
22060
- var ee = b[Y], F = ee(V, Z, q, K, J, n);
22060
+ var te = b[Y], F = te(V, Z, q, K, J, n);
22061
22061
  if (F == null)
22062
22062
  return null;
22063
22063
  F.data && r(F.data, "expectedType") && ie.push(F.data.expectedType);
22064
22064
  }
22065
- var te = ie.length > 0 ? ", expected one of type [" + ie.join(", ") + "]" : "";
22066
- return new m("Invalid " + K + " `" + J + "` supplied to " + ("`" + q + "`" + te + "."));
22065
+ var ee = ie.length > 0 ? ", expected one of type [" + ie.join(", ") + "]" : "";
22066
+ return new m("Invalid " + K + " `" + J + "` supplied to " + ("`" + q + "`" + ee + "."));
22067
22067
  }
22068
22068
  return g(x);
22069
22069
  }
@@ -22087,9 +22087,9 @@ function ID() {
22087
22087
  var Y = b[ie];
22088
22088
  if (typeof Y != "function")
22089
22089
  return O(V, Z, q, ie, U(Y));
22090
- var ee = Y(K, ie, V, Z, q + "." + ie, n);
22091
- if (ee)
22092
- return ee;
22090
+ var te = Y(K, ie, V, Z, q + "." + ie, n);
22091
+ if (te)
22092
+ return te;
22093
22093
  }
22094
22094
  return null;
22095
22095
  }
@@ -22102,15 +22102,15 @@ function ID() {
22102
22102
  return new m("Invalid " + Z + " `" + q + "` of type `" + J + "` " + ("supplied to `" + V + "`, expected `object`."));
22103
22103
  var ie = t({}, $[x], b);
22104
22104
  for (var Y in ie) {
22105
- var ee = b[Y];
22106
- if (r(b, Y) && typeof ee != "function")
22107
- return O(V, Z, q, Y, U(ee));
22108
- if (!ee)
22105
+ var te = b[Y];
22106
+ if (r(b, Y) && typeof te != "function")
22107
+ return O(V, Z, q, Y, U(te));
22108
+ if (!te)
22109
22109
  return new m(
22110
22110
  "Invalid " + Z + " `" + q + "` key `" + Y + "` supplied to `" + V + "`.\nBad object: " + JSON.stringify($[x], null, " ") + `
22111
22111
  Valid keys: ` + JSON.stringify(Object.keys(b), null, " ")
22112
22112
  );
22113
- var F = ee(K, Y, V, Z, q + "." + Y, n);
22113
+ var F = te(K, Y, V, Z, q + "." + Y, n);
22114
22114
  if (F)
22115
22115
  return F;
22116
22116
  }
@@ -23131,7 +23131,7 @@ function Wg() {
23131
23131
  fileRejections: W,
23132
23132
  type: "setFiles"
23133
23133
  }), h && h(H, W, oe), W.length > 0 && p && p(W, oe), H.length > 0 && d && d(H, oe);
23134
- }, [j, a, A, s, o, l, h, d, p, N]), ee = Me(function(X) {
23134
+ }, [j, a, A, s, o, l, h, d, p, N]), te = Me(function(X) {
23135
23135
  X.preventDefault(), X.persist(), Ce(X), V.current = [], qi(X) && Promise.resolve(i(X)).then(function(oe) {
23136
23136
  Ro(X) && !I || Y(oe, X);
23137
23137
  }).catch(function(oe) {
@@ -23164,7 +23164,7 @@ function Wg() {
23164
23164
  _.current && (j({
23165
23165
  type: "openDialog"
23166
23166
  }), z(), _.current.value = null, _.current.click());
23167
- }, [j, z, P, v, Y, q, O, a]), te = Me(function(X) {
23167
+ }, [j, z, P, v, Y, q, O, a]), ee = Me(function(X) {
23168
23168
  !L.current || !L.current.isEqualNode(X.target) || (X.key === " " || X.key === "Enter" || X.keyCode === 32 || X.keyCode === 13) && (X.preventDefault(), F());
23169
23169
  }, [L, F]), pe = Me(function() {
23170
23170
  j({
@@ -23188,20 +23188,20 @@ function Wg() {
23188
23188
  return function() {
23189
23189
  var X = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, oe = X.refKey, H = oe === void 0 ? "ref" : oe, W = X.role, re = X.onKeyDown, se = X.onFocus, de = X.onBlur, qe = X.onClick, Ge = X.onDragEnter, et = X.onDragOver, Et = X.onDragLeave, Nt = X.onDrop, Qe = Do(X, mM);
23190
23190
  return ze(ze(ll({
23191
- onKeyDown: fe(Wt(re, te)),
23191
+ onKeyDown: fe(Wt(re, ee)),
23192
23192
  onFocus: fe(Wt(se, pe)),
23193
23193
  onBlur: fe(Wt(de, Ie)),
23194
23194
  onClick: le(Wt(qe, Q)),
23195
23195
  onDragEnter: ce(Wt(Ge, K)),
23196
23196
  onDragOver: ce(Wt(et, J)),
23197
23197
  onDragLeave: ce(Wt(Et, ie)),
23198
- onDrop: ce(Wt(Nt, ee)),
23198
+ onDrop: ce(Wt(Nt, te)),
23199
23199
  role: typeof W == "string" && W !== "" ? W : "presentation"
23200
23200
  }, H, L), !r && !S ? {
23201
23201
  tabIndex: 0
23202
23202
  } : {}), Qe);
23203
23203
  };
23204
- }, [L, te, pe, Ie, Q, K, J, ie, ee, S, k, r]), Oe = Me(function(X) {
23204
+ }, [L, ee, pe, Ie, Q, K, J, ie, te, S, k, r]), Oe = Me(function(X) {
23205
23205
  X.stopPropagation();
23206
23206
  }, []), je = ct(function() {
23207
23207
  return function() {
@@ -23212,13 +23212,13 @@ function Wg() {
23212
23212
  style: {
23213
23213
  display: "none"
23214
23214
  },
23215
- onChange: le(Wt(W, ee)),
23215
+ onChange: le(Wt(W, te)),
23216
23216
  onClick: le(Wt(re, Oe)),
23217
23217
  tabIndex: -1
23218
23218
  }, H, _);
23219
23219
  return ze(ze({}, de), se);
23220
23220
  };
23221
- }, [_, n, a, ee, r]);
23221
+ }, [_, n, a, te, r]);
23222
23222
  return ze(ze({}, B), {}, {
23223
23223
  isFocused: b && !r,
23224
23224
  getRootProps: $e,
@@ -23338,19 +23338,20 @@ const AM = ({ children: e }) => {
23338
23338
  themeMode: r,
23339
23339
  variant: i,
23340
23340
  headerVariant: o,
23341
- additionalStylesheetUrl: s
23341
+ additionalStylesheet: s,
23342
+ additionalStylesheetUrl: a
23342
23343
  }) => {
23343
23344
  ct(() => {
23344
23345
  t && TM(t, ["100", "200", "300", "400", "500", "600", "700", "800"]);
23345
23346
  }, [t]);
23346
- const a = ct(
23347
+ const l = ct(
23347
23348
  () => bw({ color: e, fontFamily: t, radius: n, themeMode: r, variant: i, headerVariant: o }),
23348
23349
  [e, t, n, r, i, o]
23349
23350
  );
23350
23351
  return /* @__PURE__ */ ae(Mt, { children: [
23351
- s && /* @__PURE__ */ T("link", { rel: "stylesheet", href: s }),
23352
+ a && /* @__PURE__ */ T("link", { rel: "stylesheet", href: a }),
23352
23353
  /* @__PURE__ */ ae("style", { children: [
23353
- a,
23354
+ l,
23354
23355
  `
23355
23356
  .bpWebchat {
23356
23357
  border-radius: ${0.375 * (n ?? 1)}rem;
@@ -23359,7 +23360,8 @@ const AM = ({ children: e }) => {
23359
23360
  border-radius: ${0.125 * (n ?? 1)}rem;
23360
23361
  }
23361
23362
  `
23362
- ] })
23363
+ ] }),
23364
+ s && /* @__PURE__ */ T("style", { children: s })
23363
23365
  ] });
23364
23366
  };
23365
23367
  let Yi;
@@ -26331,7 +26333,7 @@ const ma = yt.use || // This extra generic is to avoid TypeScript mixing up the
26331
26333
  Aa.useSyncExternalStore(nP, () => (J.current = !1, J), () => (J.current = !0, J));
26332
26334
  const ie = J.current;
26333
26335
  d && ie && !o && K && console.warn(`Missing pre-initiated data for serialized key "${y}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);
26334
- const Y = !y || !t || N().isPaused() || M && !be(V) ? !1 : B && !be(a) ? a : o ? be(x) ? !1 : l : be(x) || l, ee = be(b.isValidating) ? Y : b.isValidating, F = be(b.isLoading) ? Y : b.isLoading, te = Me(
26336
+ const Y = !y || !t || N().isPaused() || M && !be(V) ? !1 : B && !be(a) ? a : o ? be(x) ? !1 : l : be(x) || l, te = be(b.isValidating) ? Y : b.isValidating, F = be(b.isLoading) ? Y : b.isLoading, ee = Me(
26335
26337
  async (Q) => {
26336
26338
  const le = I.current;
26337
26339
  if (!y || !le || S.current || N().isPaused())
@@ -26404,7 +26406,7 @@ const ma = yt.use || // This extra generic is to avoid TypeScript mixing up the
26404
26406
  I.current = t, R.current = n, be($) || (Z.current = $);
26405
26407
  }), da(() => {
26406
26408
  if (!y) return;
26407
- const Q = te.bind(ot, ga);
26409
+ const Q = ee.bind(ot, ga);
26408
26410
  let le = 0;
26409
26411
  N().revalidateOnFocus && (le = Date.now() + N().focusThrottleInterval);
26410
26412
  const ce = tP(y, p, (Ce, $e = {}) => {
@@ -26415,9 +26417,9 @@ const ma = yt.use || // This extra generic is to avoid TypeScript mixing up the
26415
26417
  N().revalidateOnReconnect && A() && Q();
26416
26418
  else {
26417
26419
  if (Ce == _y)
26418
- return te();
26420
+ return ee();
26419
26421
  if (Ce == Hd)
26420
- return te($e);
26422
+ return ee($e);
26421
26423
  }
26422
26424
  });
26423
26425
  return S.current = !1, k.current = y, E.current = !0, z({
@@ -26434,7 +26436,7 @@ const ma = yt.use || // This extra generic is to avoid TypeScript mixing up the
26434
26436
  ce && Q !== -1 && (Q = setTimeout(fe, ce));
26435
26437
  }
26436
26438
  function fe() {
26437
- !O().error && (f || N().isVisible()) && (c || N().isOnline()) ? te(ga).then(le) : le();
26439
+ !O().error && (f || N().isVisible()) && (c || N().isOnline()) ? ee(ga).then(le) : le();
26438
26440
  }
26439
26441
  return le(), () => {
26440
26442
  Q && (clearTimeout(Q), Q = -1);
@@ -26451,7 +26453,7 @@ const ma = yt.use || // This extra generic is to avoid TypeScript mixing up the
26451
26453
  const Q = v[y], le = !be(Q) && K ? pe(Q) : qd;
26452
26454
  if (ma(le), !be(V) && K)
26453
26455
  throw V;
26454
- const fe = K ? te(ga) : qd;
26456
+ const fe = K ? ee(ga) : qd;
26455
26457
  !be(q) && K && (fe.status = "fulfilled", fe.value = !0), ma(fe);
26456
26458
  }
26457
26459
  return {
@@ -26463,7 +26465,7 @@ const ma = yt.use || // This extra generic is to avoid TypeScript mixing up the
26463
26465
  return _.error = !0, V;
26464
26466
  },
26465
26467
  get isValidating() {
26466
- return _.isValidating = !0, ee;
26468
+ return _.isValidating = !0, te;
26467
26469
  },
26468
26470
  get isLoading() {
26469
26471
  return _.isLoading = !0, F;
@@ -26611,37 +26613,39 @@ const lP = ({
26611
26613
  composerPlaceholder: U,
26612
26614
  footer: B,
26613
26615
  feedbackEnabled: j,
26614
- additionalStylesheetUrl: b,
26615
- allowFileUpload: M,
26616
- conversationHistory: $
26617
- } = t, x = {
26616
+ additionalStylesheet: b,
26617
+ additionalStylesheetUrl: M,
26618
+ allowFileUpload: $,
26619
+ conversationHistory: x
26620
+ } = t, V = {
26618
26621
  color: R,
26619
26622
  fontFamily: N,
26620
26623
  radius: A,
26621
26624
  themeMode: O,
26622
26625
  variant: z,
26623
26626
  headerVariant: P,
26624
- additionalStylesheetUrl: b
26625
- }, [V, Z] = Te("chat"), q = oP({
26627
+ additionalStylesheet: b,
26628
+ additionalStylesheetUrl: M
26629
+ }, [Z, q] = Te("chat"), K = oP({
26626
26630
  clientId: v,
26627
26631
  listConversations: m,
26628
26632
  userCredentials: i
26629
26633
  });
26630
26634
  _e(() => {
26631
- V === "conversations" && q.refresh();
26632
- }, [V]), j || (p = void 0);
26633
- const K = ct(() => i ? Gv(r, f, i.userId, D, L) : [], [L, D, r, i, f]), J = ct(() => {
26634
- var ee, F;
26635
- return ((F = (ee = r.at(-1)) == null ? void 0 : ee.metadata) == null ? void 0 : F.conversationStatus) === "closed";
26636
- }, [r]), ie = Se(null), Y = ei((ee) => ee.setPortalContainer);
26637
- return _e(() => (Y(ie.current), () => {
26638
- Y(null);
26639
- }), [Y]), /* @__PURE__ */ ae(Mt, { children: [
26640
- /* @__PURE__ */ T(IM, { ...x }),
26635
+ Z === "conversations" && K.refresh();
26636
+ }, [Z]), j || (p = void 0);
26637
+ const J = ct(() => i ? Gv(r, f, i.userId, D, L) : [], [L, D, r, i, f]), ie = ct(() => {
26638
+ var F, ee;
26639
+ return ((ee = (F = r.at(-1)) == null ? void 0 : F.metadata) == null ? void 0 : ee.conversationStatus) === "closed";
26640
+ }, [r]), Y = Se(null), te = ei((F) => F.setPortalContainer);
26641
+ return _e(() => (te(Y.current), () => {
26642
+ te(null);
26643
+ }), [te]), /* @__PURE__ */ ae(Mt, { children: [
26644
+ /* @__PURE__ */ T(IM, { ...V }),
26641
26645
  /* @__PURE__ */ T(
26642
26646
  "div",
26643
26647
  {
26644
- ref: ie,
26648
+ ref: Y,
26645
26649
  style: {
26646
26650
  position: "fixed",
26647
26651
  top: 0,
@@ -26657,29 +26661,29 @@ const lP = ({
26657
26661
  gy,
26658
26662
  {
26659
26663
  connected: e,
26660
- allowFileUpload: M,
26664
+ allowFileUpload: $,
26661
26665
  uploadFile: d,
26662
26666
  storageKey: y,
26663
26667
  conversationId: k,
26664
26668
  ...I,
26665
- children: u || q.error ? /* @__PURE__ */ T(
26669
+ children: u || K.error ? /* @__PURE__ */ T(
26666
26670
  w2,
26667
26671
  {
26668
- error: u || q.error,
26672
+ error: u || K.error,
26669
26673
  restartConversation: g,
26670
26674
  closeWindow: c
26671
26675
  }
26672
- ) : V === "conversations" ? /* @__PURE__ */ T(
26676
+ ) : Z === "conversations" ? /* @__PURE__ */ T(
26673
26677
  Uy,
26674
26678
  {
26675
26679
  onClose: c,
26676
- conversations: q.conversations,
26677
- isLoading: q.isLoading,
26680
+ conversations: K.conversations,
26681
+ isLoading: K.isLoading,
26678
26682
  onNewConversation: () => {
26679
- g == null || g(), Z("chat");
26683
+ g == null || g(), q("chat");
26680
26684
  },
26681
- onConversationClick: (ee) => {
26682
- g == null || g(ee), Z("chat");
26685
+ onConversationClick: (F) => {
26686
+ g == null || g(F), q("chat");
26683
26687
  },
26684
26688
  botAvatar: L,
26685
26689
  botName: D
@@ -26688,7 +26692,7 @@ const lP = ({
26688
26692
  /* @__PURE__ */ T(
26689
26693
  p2,
26690
26694
  {
26691
- showConversationHistory: $ ? () => Z("conversations") : void 0,
26695
+ showConversationHistory: x ? () => q("conversations") : void 0,
26692
26696
  closeWindow: c,
26693
26697
  configuration: t,
26694
26698
  restartConversation: g,
@@ -26707,11 +26711,11 @@ const lP = ({
26707
26711
  isTyping: n,
26708
26712
  sendMessage: h,
26709
26713
  addMessageFeedback: p,
26710
- messages: K
26714
+ messages: J
26711
26715
  },
26712
26716
  k
26713
26717
  ),
26714
- !J && /* @__PURE__ */ T(
26718
+ !ie && /* @__PURE__ */ T(
26715
26719
  kD,
26716
26720
  {
26717
26721
  sendMessage: h,
@@ -26721,7 +26725,7 @@ const lP = ({
26721
26725
  disableComposer: l,
26722
26726
  footer: B,
26723
26727
  composerPlaceholder: U,
26724
- allowFileUpload: M,
26728
+ allowFileUpload: $,
26725
26729
  storageKey: y,
26726
26730
  disableSendButton: S,
26727
26731
  conversationId: k