@telia-ace/widget-conversation 1.2.9-rc.0 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,71 +1,71 @@
1
- import { jsx as n, jsxs as u, Fragment as N } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as h, Fragment as N } from "react/jsx-runtime";
2
2
  import i from "@emotion/styled";
3
- import { Input as se, borderTabStyle as f, Button as I, SymbolBadge as k, useIsTabbing as ae, useDispatch as X, useProperties as C, useScroll as ie, useContainer as T, Typography as G, invertedHoverButton as ve, Html as J, List as le, buttonCss as K, ItemList as E, itemList as j, Link as xe, useComponent as ke, genericHtml as we, headingElement as Q, usePrevious as Ce, list as Se, WidgetOverlayOutlet as ce, ConversationContext as ze } from "@telia-ace/widget-ui";
4
- import { appendClassNames as A, htmlParentContains as Le } from "@telia-ace/widget-utilities";
5
- import { css as b, keyframes as Ne } from "@emotion/react";
6
- import Me, { useState as W, useEffect as Z, forwardRef as ee, useContext as Ie, Suspense as Ae, useRef as de, useMemo as He, useCallback as me } from "react";
3
+ import { Input as se, borderTabStyle as b, Button as A, SymbolBadge as k, useIsTabbing as ae, useDispatch as G, useProperties as S, useScroll as ie, useContainer as I, Typography as J, invertedHoverButton as xe, Html as Q, List as le, buttonCss as B, ItemList as K, itemList as D, Link as ke, useComponent as we, genericHtml as Se, headingElement as Z, usePrevious as Ce, list as Le, WidgetOverlayOutlet as ce, ConversationContext as ze } from "@telia-ace/widget-ui";
4
+ import { appendClassNames as H, htmlParentContains as Ne } from "@telia-ace/widget-utilities";
5
+ import { css as x, keyframes as Me } from "@emotion/react";
6
+ import de, { useState as q, useEffect as j, forwardRef as ee, useContext as Ae, Suspense as Ie, useRef as me, useMemo as He, useCallback as ue } from "react";
7
7
  import { FormComponent as Te } from "@telia-ace/widget-forms";
8
- import { ConversationMessageListItemType as w, ConversationMessageType as q } from "./index.mjs";
8
+ import { ConversationMessageListItemType as w, ConversationMessageType as U } from "./index.mjs";
9
9
  import "@telia-ace/widget-core";
10
10
  import "@telia-ace/widget-services";
11
11
  import "@telia-ace/widget-plugins";
12
12
  const Oe = ({ className: t }) => {
13
- const [e, o] = W(""), [s, a] = W(0), [r, m] = W(0), c = ae(), d = X(), {
14
- inputPlaceholder: y = "Type your message",
15
- inputHidden: x = !1,
16
- inputDisabled: l = !1,
17
- sendButtonLabel: h = "Send message",
18
- inputMultiline: v = !0,
13
+ const [e, o] = q(""), [s, a] = q(0), [r, d] = q(0), u = ae(), l = G(), {
14
+ inputPlaceholder: m = "Type your message",
15
+ inputHidden: y = !1,
16
+ inputDisabled: c = !1,
17
+ sendButtonLabel: g = "Send message",
18
+ inputMultiline: p = !0,
19
19
  secondaryAction: $
20
- } = C(), [z, p] = ie(!0), O = T();
21
- Z(() => {
22
- if (p.current) {
23
- const { lineHeight: g, maxHeight: L } = getComputedStyle(p.current);
24
- if (g && g.indexOf("px") > -1) {
25
- const H = g.split("px"), be = parseInt(H[0], 10);
26
- a(be);
27
- const $e = L.split("px");
28
- m(parseInt($e[0], 10));
20
+ } = S(), [L, v] = ie(!0), O = I();
21
+ j(() => {
22
+ if (v.current) {
23
+ const { lineHeight: f, maxHeight: z } = getComputedStyle(v.current);
24
+ if (f && f.indexOf("px") > -1) {
25
+ const T = f.split("px"), $e = parseInt(T[0], 10);
26
+ a($e);
27
+ const ve = z.split("px");
28
+ d(parseInt(ve[0], 10));
29
29
  }
30
30
  }
31
- }, [p.current]);
32
- const D = (g) => {
33
- !g.shiftKey || !v ? (g.preventDefault(), e && e.length > 0 && (d("user-submit", { text: e }), o(""), P(""))) : e.length < 1 && g.preventDefault();
34
- }, ye = (g) => {
31
+ }, [v.current]);
32
+ const P = (f) => {
33
+ !f.shiftKey || !p ? (f.preventDefault(), e && e.length > 0 && (l("user-submit", { text: e }), o(""), W(""))) : e.length < 1 && f.preventDefault();
34
+ }, pe = (f) => {
35
35
  if (!$)
36
36
  return;
37
- g.preventDefault(), d("action", {
37
+ f.preventDefault(), l("action", {
38
38
  actionKey: $.action,
39
39
  ...$
40
40
  });
41
- const { events: L } = O.get("$widget");
42
- L.dispatch("tracking:secondary-clicked", {});
43
- }, pe = (g) => {
44
- if (v && p.current) {
45
- const L = p.current.scrollHeight;
46
- if (L > s) {
47
- p.current.style.height = "auto";
48
- let H = L;
49
- g.length < 1 && (H = s), p.current.style.height = `${H}px`, H >= r ? p.current.style.overflowY = "scroll" : p.current.style.overflowY = "hidden";
41
+ const { events: z } = O.get("$widget");
42
+ z.dispatch("tracking:secondary-clicked", {});
43
+ }, be = (f) => {
44
+ if (p && v.current) {
45
+ const z = v.current.scrollHeight;
46
+ if (z > s) {
47
+ v.current.style.height = "auto";
48
+ let T = z;
49
+ f.length < 1 && (T = s), v.current.style.height = `${T}px`, T >= r ? v.current.style.overflowY = "scroll" : v.current.style.overflowY = "hidden";
50
50
  }
51
51
  }
52
- }, P = (g) => {
53
- pe(g), o(g), g && g.length > 0 && d("user-typing", { textLength: g.length });
52
+ }, W = (f) => {
53
+ be(f), o(f), f && f.length > 0 && l("user-typing", { textLength: f.length });
54
54
  };
55
- return x ? null : /* @__PURE__ */ u(
56
- Ee,
55
+ return y ? null : /* @__PURE__ */ h(
56
+ Ke,
57
57
  {
58
- grow: v,
59
- className: A("humany-conversation-input", t),
60
- scrollableCss: z,
61
- isTabbing: c,
58
+ grow: p,
59
+ className: H("humany-conversation-input", t),
60
+ scrollableCss: L,
61
+ isTabbing: u,
62
62
  children: [
63
63
  $ && /* @__PURE__ */ n(
64
- Ke,
64
+ Be,
65
65
  {
66
66
  className: "humany-secondary-button",
67
- disabled: l,
68
- onClick: ye,
67
+ disabled: c,
68
+ onClick: pe,
69
69
  title: $.label,
70
70
  "aria-label": $.label,
71
71
  children: /* @__PURE__ */ n(
@@ -77,40 +77,40 @@ const Oe = ({ className: t }) => {
77
77
  )
78
78
  }
79
79
  ),
80
- v ? /* @__PURE__ */ n(
81
- Re,
80
+ p ? /* @__PURE__ */ n(
81
+ Ee,
82
82
  {
83
83
  value: e,
84
- onChange: P,
85
- onEnter: D,
86
- disabled: l,
87
- "aria-label": y,
88
- placeholder: y,
84
+ onChange: W,
85
+ onEnter: P,
86
+ disabled: c,
87
+ "aria-label": m,
88
+ placeholder: m,
89
89
  type: "textarea",
90
90
  rows: 1,
91
- ref: p
91
+ ref: v
92
92
  }
93
93
  ) : /* @__PURE__ */ n(
94
- Be,
94
+ Re,
95
95
  {
96
96
  value: e,
97
- onChange: P,
98
- onEnter: D,
99
- disabled: l,
100
- "aria-label": y,
101
- placeholder: y
97
+ onChange: W,
98
+ onEnter: P,
99
+ disabled: c,
100
+ "aria-label": m,
101
+ placeholder: m
102
102
  }
103
103
  ),
104
104
  /* @__PURE__ */ n(
105
- ue,
105
+ he,
106
106
  {
107
107
  className: "humany-send-button",
108
108
  disabled: !1,
109
- onClick: D,
110
- title: h,
111
- "aria-label": h,
109
+ onClick: P,
110
+ title: g,
111
+ "aria-label": g,
112
112
  children: /* @__PURE__ */ n(
113
- je,
113
+ De,
114
114
  {
115
115
  size: 22,
116
116
  symbol: { type: "Svg", content: "send" },
@@ -122,7 +122,7 @@ const Oe = ({ className: t }) => {
122
122
  ]
123
123
  }
124
124
  );
125
- }, Re = i(se)`
125
+ }, Ee = i(se)`
126
126
  resize: none;
127
127
  flex: 1;
128
128
  flex-shrink: 1;
@@ -143,10 +143,10 @@ const Oe = ({ className: t }) => {
143
143
  transition: height 200ms linear;
144
144
  outline: none;
145
145
  &:focus-visible {
146
- ${f};
146
+ ${b};
147
147
  outline-offset: 12px;
148
148
  }
149
- `, Be = i(se)`
149
+ `, Re = i(se)`
150
150
  flex: 1;
151
151
  border: none;
152
152
  background-color: transparent;
@@ -172,7 +172,7 @@ const Oe = ({ className: t }) => {
172
172
  }};
173
173
  font-style: italic;
174
174
  }
175
- `, ue = i(I)`
175
+ `, he = i(A)`
176
176
  flex: 0 0 50px;
177
177
  align-self: stretch;
178
178
  background-color: transparent;
@@ -182,19 +182,19 @@ const Oe = ({ className: t }) => {
182
182
  border: none;
183
183
  color: #a6a6a6;
184
184
  &:focus-visible {
185
- ${f};
185
+ ${b};
186
186
  }
187
- `, Ke = i(ue)`
187
+ `, Be = i(he)`
188
188
  border-right: ${(t) => t.theme.border};
189
189
  margin: ${(t) => {
190
190
  var e;
191
191
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
192
192
  }} 0;
193
- `, Ee = i.div`
194
- ${(t) => t.grow ? b`
193
+ `, Ke = i.div`
194
+ ${(t) => t.grow ? x`
195
195
  min-height: 50px;
196
196
  max-height: 150px;
197
- ` : b`
197
+ ` : x`
198
198
  height: 50px;
199
199
  `}
200
200
  flex: 0 0 auto;
@@ -205,11 +205,11 @@ const Oe = ({ className: t }) => {
205
205
  return (e = t.theme.colors) == null ? void 0 : e.accent;
206
206
  }};
207
207
  border-top: ${(t) => t.theme.inputBorder};
208
- ${(t) => t["data-has-focus"] && t.isTabbing && f}
208
+ ${(t) => t["data-has-focus"] && t.isTabbing && b}
209
209
  textarea {
210
210
  ${(t) => !!t.scrollableCss && t.scrollableCss}
211
211
  }
212
- `, je = i(
212
+ `, De = i(
213
213
  ({
214
214
  hasContent: t,
215
215
  ...e
@@ -226,7 +226,7 @@ const Oe = ({ className: t }) => {
226
226
  return t.hasContent ? (e = t.theme.colors) == null ? void 0 : e.primary : "#a6a6a6";
227
227
  }};
228
228
  }
229
- `, De = i.div`
229
+ `, je = i.div`
230
230
  width: ${(t) => t.avatarSize || "32px"};
231
231
  height: ${(t) => t.avatarSize || "32px"};
232
232
  border-radius: 50%;
@@ -273,7 +273,7 @@ const Oe = ({ className: t }) => {
273
273
  }};
274
274
  }
275
275
  }
276
- `, Pe = Ne`
276
+ `, Pe = Me`
277
277
  0% {
278
278
  opacity: 0;
279
279
  }
@@ -303,23 +303,23 @@ const Oe = ({ className: t }) => {
303
303
  > div:nth-of-type(3) {
304
304
  animation-delay: 200ms;
305
305
  }
306
- `, _ = i.div`
306
+ `, F = i.div`
307
307
  grid-area: content;
308
308
  max-width: 100%;
309
309
  overflow: hidden;
310
- `, qe = i(G)`
310
+ `, qe = i(J)`
311
311
  font-size: ${(t) => {
312
312
  var e;
313
313
  return (e = t.theme.fonts) == null ? void 0 : e.normal;
314
314
  }};
315
315
  font-weight: normal;
316
316
  margin: 0;
317
- `, F = i.div`
317
+ `, Y = i.div`
318
318
  display: flex;
319
319
  ${(t) => t.left && "justify-content: start;"};
320
320
  ${(t) => t.center && "justify-content: center;"};
321
321
  ${(t) => t.right && "justify-content: end;"};
322
- `, Y = i.div`
322
+ `, X = i.div`
323
323
  ${(t) => {
324
324
  var e;
325
325
  return t.padded && `padding: ${(e = t.theme.sizes) == null ? void 0 : e.medium};`;
@@ -343,12 +343,12 @@ const Oe = ({ className: t }) => {
343
343
  ${(t) => t.fullWidth && "width: 100%;"}
344
344
  `, Ue = (t, e) => {
345
345
  var s, a;
346
- const o = b`
346
+ const o = x`
347
347
  background-color: ${(s = e.colors) == null ? void 0 : s.accent};
348
348
  color: ${(a = e.colors) == null ? void 0 : a.text};
349
349
  ${e.border && `border: ${e.border};`};
350
350
  `;
351
- return e.borderRadius ? b`
351
+ return e.borderRadius ? x`
352
352
  ${o}
353
353
 
354
354
  border-top-right-radius: ${e.borderRadius};
@@ -364,11 +364,11 @@ const Oe = ({ className: t }) => {
364
364
  ` : o;
365
365
  }, Ve = (t, e) => {
366
366
  var s, a;
367
- const o = b`
367
+ const o = x`
368
368
  background-color: ${(s = e.colors) == null ? void 0 : s.primary};
369
369
  color: ${(a = e.colors) == null ? void 0 : a.accent};
370
370
  `;
371
- return e.borderRadius ? b`
371
+ return e.borderRadius ? x`
372
372
  ${o}
373
373
 
374
374
  border-top-left-radius: ${e.borderRadius};
@@ -382,7 +382,7 @@ const Oe = ({ className: t }) => {
382
382
  border-bottom-right-radius: ${e.borderRadius};
383
383
  `}
384
384
  ` : o;
385
- }, R = i.div`
385
+ }, E = i.div`
386
386
  margin-bottom: ${(t) => {
387
387
  var e;
388
388
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
@@ -390,9 +390,9 @@ const Oe = ({ className: t }) => {
390
390
  &:last-child {
391
391
  margin-bottom: 0;
392
392
  }
393
- `, S = (t) => {
393
+ `, C = (t) => {
394
394
  var e, o;
395
- return b`
395
+ return x`
396
396
  margin: ${(e = t.theme.sizes) == null ? void 0 : e.medium} 0;
397
397
  padding: 0 ${(o = t.theme.sizes) == null ? void 0 : o.medium};
398
398
  `;
@@ -400,7 +400,7 @@ const Oe = ({ className: t }) => {
400
400
  & button.humany-form-component-button {
401
401
  ${(t) => {
402
402
  var e, o, s, a;
403
- return ((e = t.theme.colors) == null ? void 0 : e.primary) && ((o = t.theme.colors) == null ? void 0 : o.accent) && ve({
403
+ return ((e = t.theme.colors) == null ? void 0 : e.primary) && ((o = t.theme.colors) == null ? void 0 : o.accent) && xe({
404
404
  active: !1,
405
405
  primaryColor: (s = t.theme.colors) == null ? void 0 : s.primary,
406
406
  secondaryColor: (a = t.theme.colors) == null ? void 0 : a.accent,
@@ -424,14 +424,14 @@ const Oe = ({ className: t }) => {
424
424
  }};
425
425
  }
426
426
  }
427
- `, Fe = i(J)`
427
+ `, Fe = i(Q)`
428
428
  white-space: pre-wrap;
429
429
  a {
430
430
  color: ${(t) => t.theme.colors.link};
431
431
  &:focus {
432
432
  ${(t) => {
433
433
  var e;
434
- return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) && f;
434
+ return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) && b;
435
435
  }};
436
436
  }
437
437
  }
@@ -449,7 +449,7 @@ const Oe = ({ className: t }) => {
449
449
  }};
450
450
  }
451
451
  `, Xe = i.button`
452
- ${(t) => K(t)};
452
+ ${(t) => B(t)};
453
453
  display: block;
454
454
  background-color: ${(t) => {
455
455
  var e;
@@ -458,23 +458,23 @@ const Oe = ({ className: t }) => {
458
458
  width: 100%;
459
459
  color: #fff;
460
460
  &:focus-visible {
461
- ${f}
461
+ ${b}
462
462
  background-color: transparent;
463
463
  }
464
464
  `, ne = ee(
465
- ({ boxed: t, className: e, agentData: o }, s) => /* @__PURE__ */ n(_, { ref: s, children: /* @__PURE__ */ n(F, { left: t, center: !t, children: /* @__PURE__ */ n(
466
- Y,
465
+ ({ boxed: t, className: e, agentData: o }, s) => /* @__PURE__ */ n(F, { ref: s, children: /* @__PURE__ */ n(Y, { left: t, center: !t, children: /* @__PURE__ */ n(
466
+ X,
467
467
  {
468
468
  padded: !!t,
469
469
  stacked: t ? "first" : void 0,
470
- children: /* @__PURE__ */ u(We, { children: [
470
+ children: /* @__PURE__ */ h(We, { children: [
471
471
  /* @__PURE__ */ n("div", {}),
472
472
  /* @__PURE__ */ n("div", {}),
473
473
  /* @__PURE__ */ n("div", {})
474
474
  ] })
475
475
  }
476
476
  ) }) })
477
- ), he = Me.createContext(null), Ge = i.p`
477
+ ), ge = de.createContext(null), Ge = i.p`
478
478
  && {
479
479
  font-size: ${(t) => {
480
480
  var e;
@@ -498,30 +498,30 @@ const Oe = ({ className: t }) => {
498
498
  timestamp: o,
499
499
  ariaHidden: s = !1
500
500
  }) => {
501
- const a = Ie(he);
501
+ const a = Ae(ge);
502
502
  if (!e && !o)
503
503
  return null;
504
504
  let r = "";
505
505
  return e ? o ? r = `${e}: ${re(o, a)}` : r = e : o && (r = re(o, a)), /* @__PURE__ */ n(Ge, { "aria-hidden": s, children: r });
506
- }, ge = ({
506
+ }, fe = ({
507
507
  className: t,
508
508
  children: e,
509
509
  sender: o,
510
510
  timestamp: s
511
511
  }) => {
512
- const { avatar: a, name: r } = o, { avatarSize: m } = C();
513
- return /* @__PURE__ */ u(
512
+ const { avatar: a, name: r } = o, { avatarSize: d, avatarLabel: u = "Avatar" } = S();
513
+ return /* @__PURE__ */ h(
514
514
  Je,
515
515
  {
516
516
  hasAvatar: !!a,
517
- className: A(
517
+ className: H(
518
518
  t,
519
519
  "humany-conversation-agent-message"
520
520
  ),
521
521
  children: [
522
- a && /* @__PURE__ */ n(De, { className: "humany-agent-avatar", avatarSize: m, children: typeof a == "string" ? (
522
+ a && /* @__PURE__ */ n(je, { className: "humany-agent-avatar", avatarSize: d, children: typeof a == "string" ? (
523
523
  // eslint-disable-next-line jsx-a11y/alt-text
524
- /* @__PURE__ */ n("img", { src: a })
524
+ /* @__PURE__ */ n("img", { src: a, alt: u })
525
525
  ) : /* @__PURE__ */ n(k, { symbol: a }) }),
526
526
  e,
527
527
  /* @__PURE__ */ n(
@@ -539,13 +539,13 @@ const Oe = ({ className: t }) => {
539
539
  display: grid;
540
540
  margin-right: 10%;
541
541
  width: 90%;
542
- ${(t) => t.hasAvatar ? b`
542
+ ${(t) => t.hasAvatar ? x`
543
543
  grid-template-columns: auto 1fr;
544
544
  grid-template-rows: 1fr auto;
545
545
  grid-template-areas:
546
546
  'avatar content'
547
547
  '. info';
548
- ` : b`
548
+ ` : x`
549
549
  grid-template-columns: 1fr;
550
550
  grid-template-rows: 1fr auto;
551
551
  grid-template-areas:
@@ -557,15 +557,15 @@ const Oe = ({ className: t }) => {
557
557
  Ze,
558
558
  {
559
559
  ref: r,
560
- className: A(
560
+ className: H(
561
561
  t,
562
562
  "humany-conversation-system-message"
563
563
  ),
564
564
  fullWidth: a,
565
- children: s ? /* @__PURE__ */ u(et, { className: "humany-conversation-discrete-message", children: [
565
+ children: s ? /* @__PURE__ */ h(et, { className: "humany-conversation-discrete-message", children: [
566
566
  e,
567
567
  /* @__PURE__ */ n(M, { timestamp: o })
568
- ] }) : /* @__PURE__ */ u(N, { children: [
568
+ ] }) : /* @__PURE__ */ h(N, { children: [
569
569
  e,
570
570
  /* @__PURE__ */ n(M, { timestamp: o })
571
571
  ] })
@@ -593,11 +593,11 @@ const Oe = ({ className: t }) => {
593
593
  margin: 0;
594
594
  }
595
595
  `, tt = ({ className: t, children: e, timestamp: o }) => {
596
- const { userLabel: s = "" } = C();
597
- return /* @__PURE__ */ u(
596
+ const { userLabel: s = "" } = S();
597
+ return /* @__PURE__ */ h(
598
598
  nt,
599
599
  {
600
- className: A(
600
+ className: H(
601
601
  t,
602
602
  "humany-conversation-user-message"
603
603
  ),
@@ -624,7 +624,7 @@ const Oe = ({ className: t }) => {
624
624
  label: t[e],
625
625
  actionKey: e
626
626
  })), rt = ({ header: t, actions: e, dispatch: o }) => {
627
- const s = T(), { events: a } = s.get("$widget");
627
+ const s = I(), { events: a } = s.get("$widget");
628
628
  return /* @__PURE__ */ n(
629
629
  ot,
630
630
  {
@@ -632,14 +632,11 @@ const Oe = ({ className: t }) => {
632
632
  header: t,
633
633
  items: te(e),
634
634
  renderItem: (r) => {
635
- var c;
636
- const m = !!((c = r == null ? void 0 : r.data) != null && c.href);
637
- return /* @__PURE__ */ n("li", { children: m ? /* @__PURE__ */ u(
635
+ var u;
636
+ const d = !!((u = r == null ? void 0 : r.data) != null && u.href);
637
+ return /* @__PURE__ */ n("li", { children: d ? /* @__PURE__ */ h(
638
638
  st,
639
639
  {
640
- onClick: () => {
641
- o("action", r), a.dispatch("tracking:button-list-item-clicked", r);
642
- },
643
640
  href: r.data.href,
644
641
  target: r.data.target,
645
642
  "aria-label": r.label,
@@ -649,7 +646,7 @@ const Oe = ({ className: t }) => {
649
646
  r.label
650
647
  ]
651
648
  }
652
- ) : /* @__PURE__ */ u(
649
+ ) : /* @__PURE__ */ h(
653
650
  at,
654
651
  {
655
652
  onClick: () => {
@@ -666,8 +663,8 @@ const Oe = ({ className: t }) => {
666
663
  }
667
664
  }
668
665
  );
669
- }, ot = i(E)`
670
- ${j}
666
+ }, ot = i(K)`
667
+ ${D}
671
668
  > ul {
672
669
  display: flex;
673
670
  flex-wrap: wrap;
@@ -679,9 +676,9 @@ const Oe = ({ className: t }) => {
679
676
  margin: 0;
680
677
  }
681
678
  }
682
- ${S}
683
- `, st = i(xe)`
684
- ${K};
679
+ ${C}
680
+ `, st = i(ke)`
681
+ ${B};
685
682
 
686
683
  display: block;
687
684
  padding: ${(t) => {
@@ -697,7 +694,7 @@ const Oe = ({ className: t }) => {
697
694
  overflow: hidden;
698
695
  text-overflow: ellipsis;
699
696
  &:focus-visible {
700
- ${f}
697
+ ${b}
701
698
  background-color: transparent;
702
699
  }
703
700
 
@@ -708,8 +705,8 @@ const Oe = ({ className: t }) => {
708
705
  return (e = t.theme.sizes) == null ? void 0 : e.small;
709
706
  }};
710
707
  }
711
- `, at = i(I)`
712
- ${K};
708
+ `, at = i(A)`
709
+ ${B};
713
710
 
714
711
  display: block;
715
712
  padding: ${(t) => {
@@ -725,7 +722,7 @@ const Oe = ({ className: t }) => {
725
722
  overflow: hidden;
726
723
  text-overflow: ellipsis;
727
724
  &:focus-visible {
728
- ${f}
725
+ ${b}
729
726
  background-color: transparent;
730
727
  }
731
728
 
@@ -737,17 +734,17 @@ const Oe = ({ className: t }) => {
737
734
  }};
738
735
  }
739
736
  `, it = ({ type: t, content: e = {} }) => {
740
- const o = ke(t);
741
- return !o || !t ? null : /* @__PURE__ */ n(Ae, { fallback: null, children: /* @__PURE__ */ n(o, { ...e }) });
742
- }, lt = ({ body: t }) => /* @__PURE__ */ n(ct, { className: "humany-html", html: t }), ct = i(J)`
743
- ${we}
737
+ const o = we(t);
738
+ return !o || !t ? null : /* @__PURE__ */ n(Ie, { fallback: null, children: /* @__PURE__ */ n(o, { ...e }) });
739
+ }, lt = ({ body: t }) => /* @__PURE__ */ n(ct, { className: "humany-html", html: t }), ct = i(Q)`
740
+ ${Se}
744
741
  color: inherit;
745
742
  white-space: normal;
746
- ${S}
743
+ ${C}
747
744
  a {
748
745
  color: ${(t) => t.theme.colors.link};
749
746
  &:focus-visible {
750
- ${f};
747
+ ${b};
751
748
  }
752
749
  }
753
750
  p {
@@ -761,7 +758,7 @@ const Oe = ({ className: t }) => {
761
758
  items: te(e),
762
759
  renderItem: (s) => {
763
760
  var a;
764
- return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(ut, { children: [
761
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ut, { children: [
765
762
  ((a = s.symbol) == null ? void 0 : a.content) && /* @__PURE__ */ n("div", { className: "item-icon", children: /* @__PURE__ */ n(
766
763
  k,
767
764
  {
@@ -772,9 +769,9 @@ const Oe = ({ className: t }) => {
772
769
  }
773
770
  }
774
771
  ) }),
775
- /* @__PURE__ */ u("div", { className: "item-body", children: [
772
+ /* @__PURE__ */ h("div", { className: "item-body", children: [
776
773
  /* @__PURE__ */ n(
777
- I,
774
+ A,
778
775
  {
779
776
  onClick: () => {
780
777
  o("action", s);
@@ -789,11 +786,11 @@ const Oe = ({ className: t }) => {
789
786
  ] }) }, s.actionKey);
790
787
  }
791
788
  }
792
- ), mt = i(E)`
793
- ${j}
789
+ ), mt = i(K)`
790
+ ${D}
794
791
 
795
792
  > .humany-paragraph {
796
- ${S}
793
+ ${C}
797
794
  margin-bottom: 0;
798
795
 
799
796
  h1 {
@@ -801,9 +798,9 @@ const Oe = ({ className: t }) => {
801
798
  }
802
799
  }
803
800
 
804
- ${(t) => Q(t)(
801
+ ${(t) => Z(t)(
805
802
  "h1",
806
- b`
803
+ x`
807
804
  white-space: normal;
808
805
  `
809
806
  )}
@@ -833,7 +830,7 @@ const Oe = ({ className: t }) => {
833
830
  var e;
834
831
  return (e = t.theme.sizes) == null ? void 0 : e.medium;
835
832
  }};
836
- ${S}
833
+ ${C}
837
834
 
838
835
  .item-icon {
839
836
  }
@@ -866,7 +863,7 @@ const Oe = ({ className: t }) => {
866
863
  margin: 0;
867
864
 
868
865
  &:focus-visible {
869
- ${f}
866
+ ${b}
870
867
  span {
871
868
  color: ${(t) => {
872
869
  var e;
@@ -877,31 +874,31 @@ const Oe = ({ className: t }) => {
877
874
  }
878
875
  }
879
876
  `, ht = ({ header: t, actions: e, dispatch: o }) => {
880
- const s = Ce(e), a = de(), r = ae(), m = T(), { events: c } = m.get("$widget");
881
- return Z(() => {
877
+ const s = Ce(e), a = me(), r = ae(), d = I(), { events: u } = d.get("$widget");
878
+ return j(() => {
882
879
  if (s && Array.isArray(e) && Array.isArray(s) && s.length < e.length && a.current) {
883
- const d = a.current.querySelectorAll(
880
+ const l = a.current.querySelectorAll(
884
881
  ".humany-conversation-link-list > ul > li"
885
- ), y = d[s.length];
886
- if (d.length === e.length && s.length) {
887
- const x = d[s.length - 1];
888
- if (x) {
889
- const l = x.querySelector(
882
+ ), m = l[s.length];
883
+ if (l.length === e.length && s.length) {
884
+ const y = l[s.length - 1];
885
+ if (y) {
886
+ const c = y.querySelector(
890
887
  ".humany-button"
891
888
  );
892
- l && l.focus();
889
+ c && c.focus();
893
890
  }
894
891
  } else
895
- y && new MutationObserver((l, h) => {
896
- l.forEach((v) => {
897
- if (v.addedNodes) {
892
+ m && new MutationObserver((c, g) => {
893
+ c.forEach((p) => {
894
+ if (p.addedNodes) {
898
895
  const $ = Array.from(
899
- v.addedNodes
900
- ).find((z) => z.tagName === "BUTTON");
901
- $ && Le(a.current, document.activeElement) && (r && $.focus(), h.disconnect());
896
+ p.addedNodes
897
+ ).find((L) => L.tagName === "BUTTON");
898
+ $ && Ne(a.current, document.activeElement) && (r && $.focus(), g.disconnect());
902
899
  }
903
900
  });
904
- }).observe(y, {
901
+ }).observe(m, {
905
902
  attributes: !1,
906
903
  characterData: !1,
907
904
  childList: !0,
@@ -917,18 +914,18 @@ const Oe = ({ className: t }) => {
917
914
  className: "humany-conversation-link-list",
918
915
  header: t,
919
916
  items: te(e),
920
- renderItem: (d) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(
917
+ renderItem: (l) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
921
918
  ft,
922
919
  {
923
- help: d.actionKey === "help",
920
+ help: l.actionKey === "help",
924
921
  onClick: () => {
925
- o("action", d), c.dispatch("tracking:link-list-item-clicked", d);
922
+ o("action", l), u.dispatch("tracking:link-list-item-clicked", l);
926
923
  },
927
- "aria-label": d.label,
928
- title: d.label,
924
+ "aria-label": l.label,
925
+ title: l.label,
929
926
  children: [
930
- d.label,
931
- d.actionKey === "help" && /* @__PURE__ */ n(
927
+ l.label,
928
+ l.actionKey === "help" && /* @__PURE__ */ n(
932
929
  k,
933
930
  {
934
931
  size: 14,
@@ -940,16 +937,16 @@ const Oe = ({ className: t }) => {
940
937
  )
941
938
  ]
942
939
  }
943
- ) }, d.actionKey)
940
+ ) }, l.actionKey)
944
941
  }
945
942
  );
946
- }, gt = i(E)`
947
- ${j}
948
- ${S}
943
+ }, gt = i(K)`
944
+ ${D}
945
+ ${C}
949
946
 
950
- ${(t) => Q(t)(
947
+ ${(t) => Z(t)(
951
948
  "h1",
952
- b`
949
+ x`
953
950
  white-space: normal;
954
951
  `
955
952
  )}
@@ -965,7 +962,7 @@ const Oe = ({ className: t }) => {
965
962
  margin: 0;
966
963
  }
967
964
  }
968
- `, ft = i(I)`
965
+ `, ft = i(A)`
969
966
  display: block;
970
967
  text-align: left;
971
968
  font-weight: 300;
@@ -979,7 +976,7 @@ const Oe = ({ className: t }) => {
979
976
 
980
977
  ${(t) => {
981
978
  var e, o;
982
- return t.help && b`
979
+ return t.help && x`
983
980
  color: ${(e = t.theme.colors) == null ? void 0 : e.text};
984
981
  text-decoration: underline;
985
982
 
@@ -991,7 +988,7 @@ const Oe = ({ className: t }) => {
991
988
  }}
992
989
 
993
990
  &:focus-visible {
994
- ${f}
991
+ ${b}
995
992
  span {
996
993
  color: ${(t) => {
997
994
  var e;
@@ -1003,8 +1000,8 @@ const Oe = ({ className: t }) => {
1003
1000
  `, yt = () => /* @__PURE__ */ n(pt, { className: "humany-conversation-separator" }), pt = i.div`
1004
1001
  ${(t) => t.theme.border && `border-bottom: ${t.theme.border};`}
1005
1002
  width: 100%;
1006
- `, bt = ({ text: t }) => /* @__PURE__ */ n($t, { className: "humany-conversation-text", variant: "span", children: t }), $t = i(G)`
1007
- ${S}
1003
+ `, bt = ({ text: t }) => /* @__PURE__ */ n($t, { className: "humany-conversation-text", variant: "span", children: t }), $t = i(J)`
1004
+ ${C}
1008
1005
  `, vt = ({
1009
1006
  header: t = "Video call",
1010
1007
  acceptLabel: e = "Accept",
@@ -1036,7 +1033,7 @@ const Oe = ({ className: t }) => {
1036
1033
  header: t,
1037
1034
  items: a,
1038
1035
  renderItem: (r) => {
1039
- const m = r.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
1036
+ const d = r.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
1040
1037
  return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1041
1038
  kt,
1042
1039
  {
@@ -1045,15 +1042,15 @@ const Oe = ({ className: t }) => {
1045
1042
  },
1046
1043
  "aria-label": r.label,
1047
1044
  title: r.label,
1048
- bgColor: m,
1045
+ bgColor: d,
1049
1046
  children: /* @__PURE__ */ n(k, { symbol: r.symbol, size: 25 })
1050
1047
  }
1051
1048
  ) }, r.actionKey);
1052
1049
  }
1053
1050
  }
1054
1051
  );
1055
- }, xt = i(E)`
1056
- ${(t) => j(t)}
1052
+ }, xt = i(K)`
1053
+ ${(t) => D(t)}
1057
1054
  > ul {
1058
1055
  display: flex;
1059
1056
  flex-wrap: wrap;
@@ -1065,9 +1062,9 @@ const Oe = ({ className: t }) => {
1065
1062
  margin: 0;
1066
1063
  }
1067
1064
  }
1068
- ${(t) => S(t)}
1069
- `, kt = i(I)`
1070
- ${K};
1065
+ ${(t) => C(t)}
1066
+ `, kt = i(A)`
1067
+ ${B};
1071
1068
 
1072
1069
  background-color: ${(t) => t.bgColor};
1073
1070
  display: flex;
@@ -1079,7 +1076,7 @@ const Oe = ({ className: t }) => {
1079
1076
  border-radius: 100%;
1080
1077
 
1081
1078
  &:focus-visible {
1082
- ${f}
1079
+ ${b}
1083
1080
  background-color: transparent;
1084
1081
 
1085
1082
  i,
@@ -1106,24 +1103,24 @@ const Oe = ({ className: t }) => {
1106
1103
  stroke: #fff;
1107
1104
  }
1108
1105
  }
1109
- `, B = ([t, e]) => ({ type: t, content: e }), wt = ({ items: t, dispatch: e }) => {
1110
- const o = t.map(B).filter((r) => r.type.includes("ace-knowledge")).map((r) => "humany-" + r.type.toString());
1111
- return !!t.map(B).filter((r) => {
1112
- const m = r == null ? void 0 : r.content, c = m == null ? void 0 : m.actions;
1113
- return !!(c != null && c.filter((d) => d.actionKey === "contact").length);
1114
- }).length && o.push("humany-secondary-action-list"), !!t.map(B).filter((r) => {
1115
- var c;
1116
- const m = r == null ? void 0 : r.content;
1117
- return !!((c = m == null ? void 0 : m.tags) != null && c.includes("category"));
1106
+ `, R = ([t, e]) => ({ type: t, content: e }), wt = ({ items: t, dispatch: e }) => {
1107
+ const o = t.map(R).filter((r) => r.type.includes("ace-knowledge")).map((r) => "humany-" + r.type.toString());
1108
+ return !!t.map(R).filter((r) => {
1109
+ const d = r == null ? void 0 : r.content, u = d == null ? void 0 : d.actions;
1110
+ return !!(u != null && u.filter((l) => l.actionKey === "contact").length);
1111
+ }).length && o.push("humany-secondary-action-list"), !!t.map(R).filter((r) => {
1112
+ var u;
1113
+ const d = r == null ? void 0 : r.content;
1114
+ return !!((u = d == null ? void 0 : d.tags) != null && u.includes("category"));
1118
1115
  }).length && o.push("humany-category-list"), /* @__PURE__ */ n(
1119
- Ct,
1116
+ St,
1120
1117
  {
1121
1118
  role: "none",
1122
- className: A(
1119
+ className: H(
1123
1120
  "humany-message-list",
1124
1121
  o.join(" ")
1125
1122
  ),
1126
- items: t.map(B),
1123
+ items: t.map(R),
1127
1124
  renderLi: !0,
1128
1125
  renderItem: (r) => {
1129
1126
  switch (r.type) {
@@ -1147,22 +1144,22 @@ const Oe = ({ className: t }) => {
1147
1144
  }
1148
1145
  }
1149
1146
  );
1150
- }, Ct = i(le)`
1151
- ${Se}
1147
+ }, St = i(le)`
1148
+ ${Le}
1152
1149
 
1153
1150
  > li {
1154
1151
  margin: 0;
1155
1152
  }
1156
- `, St = ee(
1153
+ `, Ct = ee(
1157
1154
  ({ className: t, timestamp: e, sender: o, type: s, content: a }, r) => {
1158
- const m = me(
1159
- (l) => {
1160
- let h = "first";
1161
- return a.length > 1 && (h = l === 0 ? "first" : l + 1 === a.length ? "last" : "middle"), h;
1155
+ const d = ue(
1156
+ (c) => {
1157
+ let g = "first";
1158
+ return a.length > 1 && (g = c === 0 ? "first" : c + 1 === a.length ? "last" : "middle"), g;
1162
1159
  },
1163
1160
  [a]
1164
- ), { userLabel: c = "" } = C(), d = () => /* @__PURE__ */ n(N, { children: a.map((l) => {
1165
- const { key: h, body: v, title: $, form: z, actions: p } = l, O = !!v && !$ && !z && !p;
1161
+ ), { userLabel: u = "" } = S(), l = () => /* @__PURE__ */ n(N, { children: a.map((c) => {
1162
+ const { key: g, body: p, title: $, form: L, actions: v } = c, O = !!p && !$ && !L && !v;
1166
1163
  return /* @__PURE__ */ n(
1167
1164
  Qe,
1168
1165
  {
@@ -1170,120 +1167,120 @@ const Oe = ({ className: t }) => {
1170
1167
  discrete: O,
1171
1168
  ref: r,
1172
1169
  timestamp: e,
1173
- fullWidth: !!z || !!p,
1174
- children: O && v ? /* @__PURE__ */ n(J, { html: v }) : /* @__PURE__ */ n(U, { isSystem: !0, content: l })
1170
+ fullWidth: !!L || !!v,
1171
+ children: O && p ? /* @__PURE__ */ n(Q, { html: p }) : /* @__PURE__ */ n(V, { isSystem: !0, content: c })
1175
1172
  },
1176
- h
1173
+ g
1177
1174
  );
1178
- }) }), y = () => /* @__PURE__ */ u(N, { children: [
1175
+ }) }), m = () => /* @__PURE__ */ h(N, { children: [
1179
1176
  /* @__PURE__ */ n(oe, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: o == null ? void 0 : o.name, timestamp: e }) }),
1180
1177
  /* @__PURE__ */ n(
1181
- ge,
1178
+ fe,
1182
1179
  {
1183
1180
  sender: o,
1184
1181
  timestamp: e,
1185
1182
  className: t,
1186
- children: /* @__PURE__ */ n(_, { className: "humany-message-content-bundle", children: a.map((l, h) => /* @__PURE__ */ n(
1187
- F,
1183
+ children: /* @__PURE__ */ n(F, { className: "humany-message-content-bundle", children: a.map((c, g) => /* @__PURE__ */ n(
1184
+ Y,
1188
1185
  {
1189
1186
  className: "humany-message-container",
1190
1187
  left: !0,
1191
1188
  ref: r,
1192
1189
  children: /* @__PURE__ */ n(
1193
- U,
1190
+ V,
1194
1191
  {
1195
- content: l,
1196
- stacked: m(h)
1192
+ content: c,
1193
+ stacked: d(g)
1197
1194
  }
1198
1195
  )
1199
1196
  },
1200
- l.key
1197
+ c.key
1201
1198
  )) })
1202
1199
  }
1203
1200
  )
1204
- ] }), x = () => /* @__PURE__ */ u(N, { children: [
1205
- /* @__PURE__ */ n(oe, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: c, timestamp: e }) }),
1206
- /* @__PURE__ */ n(tt, { timestamp: e, className: t, children: /* @__PURE__ */ n(_, { className: "humany-message-content-bundle", children: a.map((l, h) => /* @__PURE__ */ n(
1207
- F,
1201
+ ] }), y = () => /* @__PURE__ */ h(N, { children: [
1202
+ /* @__PURE__ */ n(oe, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: u, timestamp: e }) }),
1203
+ /* @__PURE__ */ n(tt, { timestamp: e, className: t, children: /* @__PURE__ */ n(F, { className: "humany-message-content-bundle", children: a.map((c, g) => /* @__PURE__ */ n(
1204
+ Y,
1208
1205
  {
1209
1206
  className: "humany-message-container",
1210
1207
  right: !0,
1211
1208
  ref: r,
1212
1209
  children: /* @__PURE__ */ n(
1213
- U,
1210
+ V,
1214
1211
  {
1215
1212
  isUser: !0,
1216
- content: l,
1217
- stacked: m(h)
1213
+ content: c,
1214
+ stacked: d(g)
1218
1215
  }
1219
1216
  )
1220
1217
  },
1221
- l.key
1218
+ c.key
1222
1219
  )) }) })
1223
1220
  ] });
1224
1221
  switch (s) {
1225
- case q.System:
1226
- return d();
1227
- case q.Agent:
1222
+ case U.System:
1223
+ return l();
1224
+ case U.Agent:
1225
+ return m();
1226
+ case U.User:
1228
1227
  return y();
1229
- case q.User:
1230
- return x();
1231
1228
  default:
1232
1229
  return null;
1233
1230
  }
1234
1231
  }
1235
- ), U = ({
1232
+ ), V = ({
1236
1233
  content: t,
1237
1234
  isUser: e,
1238
1235
  isSystem: o,
1239
1236
  stacked: s
1240
1237
  }) => {
1241
- const a = X(), { title: r, body: m, actions: c, form: d, items: y } = t;
1242
- return y ? /* @__PURE__ */ n(
1243
- Y,
1238
+ const a = G(), { title: r, body: d, actions: u, form: l, items: m } = t;
1239
+ return m ? /* @__PURE__ */ n(
1240
+ X,
1244
1241
  {
1245
1242
  className: "humany-message-content",
1246
1243
  user: !!e,
1247
1244
  stacked: s,
1248
- children: /* @__PURE__ */ n(wt, { items: y, dispatch: a })
1245
+ children: /* @__PURE__ */ n(wt, { items: m, dispatch: a })
1249
1246
  }
1250
- ) : /* @__PURE__ */ u(
1251
- Y,
1247
+ ) : /* @__PURE__ */ h(
1248
+ X,
1252
1249
  {
1253
1250
  className: "humany-message-content",
1254
1251
  padded: !o,
1255
1252
  user: !!e,
1256
1253
  stacked: s,
1257
- fullWidth: !!d || !!c,
1254
+ fullWidth: !!l || !!u,
1258
1255
  children: [
1259
- r && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(qe, { variant: "h2", children: r }) }),
1260
- m && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(Fe, { html: m }) }),
1261
- d && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
1256
+ r && /* @__PURE__ */ n(E, { children: /* @__PURE__ */ n(qe, { variant: "h2", children: r }) }),
1257
+ d && /* @__PURE__ */ n(E, { children: /* @__PURE__ */ n(Fe, { html: d }) }),
1258
+ l && /* @__PURE__ */ n(E, { children: /* @__PURE__ */ n(
1262
1259
  _e,
1263
1260
  {
1264
- ...d,
1265
- onChange: (l, h) => {
1261
+ ...l,
1262
+ onChange: (c, g) => {
1266
1263
  a("form", {
1267
- data: h,
1268
- formKey: d.schema.id,
1269
- actionKey: l
1264
+ data: g,
1265
+ formKey: l.schema.id,
1266
+ actionKey: c
1270
1267
  });
1271
1268
  }
1272
1269
  }
1273
1270
  ) }),
1274
- c && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
1271
+ u && /* @__PURE__ */ n(E, { children: /* @__PURE__ */ n(
1275
1272
  Ye,
1276
1273
  {
1277
- items: Object.keys(c).map((l) => ({ label: c[l], actionKey: l })),
1278
- renderItem: (l) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1274
+ items: Object.keys(u).map((c) => ({ label: u[c], actionKey: c })),
1275
+ renderItem: (c) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1279
1276
  Xe,
1280
1277
  {
1281
1278
  onClick: () => {
1282
- a("action", l.actionKey);
1279
+ a("action", c.actionKey);
1283
1280
  },
1284
- children: l.label
1281
+ children: c.label
1285
1282
  }
1286
- ) }, l.actionKey)
1283
+ ) }, c.actionKey)
1287
1284
  }
1288
1285
  ) })
1289
1286
  ]
@@ -1298,8 +1295,8 @@ const Oe = ({ className: t }) => {
1298
1295
  clip: rect(1px, 1px, 1px, 1px);
1299
1296
  left: -10000000px;
1300
1297
  top: auto;
1301
- `, zt = () => {
1302
- const { skipToLatestMessageLabel: t = "Skip to latest message" } = C(), e = T(), o = () => {
1298
+ `, Lt = () => {
1299
+ const { skipToLatestMessageLabel: t = "Skip to latest message" } = S(), e = I(), o = () => {
1303
1300
  const s = e.get("widgetDOMElement");
1304
1301
  if (s) {
1305
1302
  const a = s.querySelectorAll(
@@ -1309,7 +1306,7 @@ const Oe = ({ className: t }) => {
1309
1306
  }
1310
1307
  };
1311
1308
  return /* @__PURE__ */ n(
1312
- Lt,
1309
+ zt,
1313
1310
  {
1314
1311
  className: "humany-skip-to-latest-message",
1315
1312
  onKeyDown: (s) => {
@@ -1319,7 +1316,7 @@ const Oe = ({ className: t }) => {
1319
1316
  children: t
1320
1317
  }
1321
1318
  );
1322
- }, Lt = i.button`
1319
+ }, zt = i.button`
1323
1320
  position: absolute;
1324
1321
  bottom: 60px;
1325
1322
  text-align: center;
@@ -1337,53 +1334,61 @@ const Oe = ({ className: t }) => {
1337
1334
  &:focus-visible {
1338
1335
  left: 50%;
1339
1336
  transform: translateX(-50%);
1340
- ${f};
1337
+ ${b};
1341
1338
  }
1342
- `, fe = () => {
1343
- const t = me((c) => {
1344
- c && setTimeout(() => {
1345
- c.scrollIntoView({
1339
+ `, ye = () => {
1340
+ const t = I(), e = ue((m) => {
1341
+ m && setTimeout(() => {
1342
+ m.scrollIntoView({
1346
1343
  block: "start",
1347
1344
  behavior: "smooth"
1348
1345
  });
1349
1346
  }, 250);
1350
- }, []), [e, o] = ie(!0), {
1351
- messages: s,
1352
- loading: a,
1353
- typingActors: r = []
1354
- } = C(), m = () => r && r.length ? r.map((c, d) => /* @__PURE__ */ n(
1355
- V,
1347
+ }, []), [o, s] = ie(!0), {
1348
+ messages: a,
1349
+ loading: r,
1350
+ typingActors: d = []
1351
+ } = S(), u = () => d && d.length ? d.map((m, y) => /* @__PURE__ */ n(
1352
+ _,
1356
1353
  {
1357
- id: `typing_${c.name}`,
1358
- children: /* @__PURE__ */ n(ge, { timestamp: Date.now(), sender: c, children: /* @__PURE__ */ n(
1354
+ id: `typing_${m.name}`,
1355
+ children: /* @__PURE__ */ n(fe, { timestamp: Date.now(), sender: m, children: /* @__PURE__ */ n(
1359
1356
  ne,
1360
1357
  {
1361
1358
  boxed: !0,
1362
- ref: t
1359
+ ref: e
1363
1360
  }
1364
1361
  ) })
1365
1362
  },
1366
- `typing_${c.name}`
1367
- )) : null;
1368
- return /* @__PURE__ */ u(N, { children: [
1369
- /* @__PURE__ */ u(Nt, { tabIndex: 0, scrollableCss: e, ref: o, children: [
1370
- s && s.length ? s.map((c, d) => {
1371
- const { type: y, timestamp: x, sender: l, content: h } = c;
1363
+ `typing_${m.name}`
1364
+ )) : null, l = de.useRef((a == null ? void 0 : a.length) || 0);
1365
+ return j(() => {
1366
+ const m = t.get("widgetDOMElement");
1367
+ if (m && m.id === "humany_bot") {
1368
+ const y = m.querySelectorAll(
1369
+ ".humany-conversation-entry"
1370
+ );
1371
+ y.length && y.length > l.current && (l.current = y.length, y[y.length - 1].focus());
1372
+ }
1373
+ }), /* @__PURE__ */ h(N, { children: [
1374
+ /* @__PURE__ */ h(Nt, { tabIndex: 0, scrollableCss: o, ref: s, children: [
1375
+ a && a.length ? a.map((m, y) => {
1376
+ const { type: c, timestamp: g, sender: p, content: $ } = m;
1372
1377
  return /* @__PURE__ */ n(
1373
- V,
1378
+ _,
1374
1379
  {
1375
1380
  className: "humany-conversation-entry",
1376
1381
  tabIndex: -1,
1377
- children: /* @__PURE__ */ n(St, { ...c, ref: t })
1382
+ children: /* @__PURE__ */ n(Ct, { ...m, ref: e })
1378
1383
  },
1379
- `${y}_${l == null ? void 0 : l.name}_${x}_${h[0].key}`
1384
+ `${c}_${p == null ? void 0 : p.name}_${g}_${$[0].key}`
1380
1385
  );
1381
1386
  }) : null,
1382
- m(),
1383
- a && /* @__PURE__ */ n(V, { children: /* @__PURE__ */ n(ne, { ref: t }) })
1387
+ u(),
1388
+ r && /* @__PURE__ */ n(_, { children: /* @__PURE__ */ n(ne, { ref: e }) })
1384
1389
  ] }),
1385
1390
  /* @__PURE__ */ n(Oe, {}),
1386
- /* @__PURE__ */ n(zt, {})
1391
+ /* @__PURE__ */ n(Lt, {})
1387
1392
  ] });
1388
1393
  }, Nt = i.div`
1389
1394
  display: flex;
@@ -1396,9 +1401,9 @@ const Oe = ({ className: t }) => {
1396
1401
  }};
1397
1402
  ${(t) => !!t.scrollableCss && t.scrollableCss};
1398
1403
  &:focus-visible {
1399
- ${(t) => f(t)};
1404
+ ${(t) => b(t)};
1400
1405
  }
1401
- `, V = i.div`
1406
+ `, _ = i.div`
1402
1407
  margin: 0;
1403
1408
  margin-bottom: ${(t) => {
1404
1409
  var e;
@@ -1432,21 +1437,21 @@ const Oe = ({ className: t }) => {
1432
1437
  }
1433
1438
 
1434
1439
  &:focus-visible {
1435
- ${f}
1440
+ ${b}
1436
1441
  border-radius: ${(t) => {
1437
1442
  var e;
1438
1443
  return (e = t.theme.sizes) == null ? void 0 : e.small;
1439
1444
  }};
1440
1445
  }
1441
- ${(t) => Q(t)(
1446
+ ${(t) => Z(t)(
1442
1447
  "h1",
1443
- b`
1448
+ x`
1444
1449
  font-weight: normal;
1445
1450
  `
1446
1451
  )}
1447
1452
  `, Mt = ({ dispatch: t }) => {
1448
- const e = de(null);
1449
- return Z(() => {
1453
+ const e = me(null);
1454
+ return j(() => {
1450
1455
  e.current && e.current.parentNode && t("overlay-mounted", e.current);
1451
1456
  }, [e]), /* @__PURE__ */ n(
1452
1457
  ce,
@@ -1456,17 +1461,17 @@ const Oe = ({ className: t }) => {
1456
1461
  ref: e
1457
1462
  }
1458
1463
  );
1459
- }, It = ({
1464
+ }, At = ({
1460
1465
  dispatch: t,
1461
1466
  header: e,
1462
1467
  buttonLabel: o
1463
- }) => /* @__PURE__ */ u(
1464
- At,
1468
+ }) => /* @__PURE__ */ h(
1469
+ It,
1465
1470
  {
1466
1471
  portalId: "humany-conversation-portal",
1467
1472
  className: "humany-conversation-outlet",
1468
1473
  children: [
1469
- /* @__PURE__ */ u(Ht, { className: "humany-conversation-outlet-head", children: [
1474
+ /* @__PURE__ */ h(Ht, { className: "humany-conversation-outlet-head", children: [
1470
1475
  /* @__PURE__ */ n(
1471
1476
  Ot,
1472
1477
  {
@@ -1495,10 +1500,10 @@ const Oe = ({ className: t }) => {
1495
1500
  }
1496
1501
  )
1497
1502
  ] }),
1498
- /* @__PURE__ */ n(fe, {})
1503
+ /* @__PURE__ */ n(ye, {})
1499
1504
  ]
1500
1505
  }
1501
- ), At = i(ce)`
1506
+ ), It = i(ce)`
1502
1507
  z-index: 11;
1503
1508
  top: auto;
1504
1509
  height: 65%;
@@ -1527,7 +1532,7 @@ const Oe = ({ className: t }) => {
1527
1532
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
1528
1533
  }};
1529
1534
  ${(t) => t.theme.border && `border-bottom: ${t.theme.border};`}
1530
- `, Tt = i(G)`
1535
+ `, Tt = i(J)`
1531
1536
  font-size: ${(t) => {
1532
1537
  var e;
1533
1538
  return (e = t.theme.fonts) == null ? void 0 : e.medium;
@@ -1537,7 +1542,7 @@ const Oe = ({ className: t }) => {
1537
1542
  return (e = t.theme.colors) == null ? void 0 : e.text;
1538
1543
  }};
1539
1544
  margin: 0;
1540
- `, Ot = i(I)`
1545
+ `, Ot = i(A)`
1541
1546
  display: flex;
1542
1547
  align-items: center;
1543
1548
  justify-content: center;
@@ -1551,7 +1556,7 @@ const Oe = ({ className: t }) => {
1551
1556
  ${(t) => t.theme.borderRadius && `border-radius: ${t.theme.borderRadius};`}
1552
1557
 
1553
1558
  &:focus-visible {
1554
- ${f};
1559
+ ${b};
1555
1560
  }
1556
1561
 
1557
1562
  svg line {
@@ -1566,30 +1571,30 @@ const Oe = ({ className: t }) => {
1566
1571
  overlayConversationHeader: s,
1567
1572
  overlayConversationCloseLabel: a,
1568
1573
  conversationControllerId: r
1569
- } = C(), m = X(), d = T().get("$settings");
1574
+ } = S(), d = G(), l = I().get("$settings");
1570
1575
  return /* @__PURE__ */ n(
1571
1576
  ze.Provider,
1572
1577
  {
1573
1578
  value: r ? { id: r } : null,
1574
- children: /* @__PURE__ */ u(he.Provider, { value: d == null ? void 0 : d.language, children: [
1579
+ children: /* @__PURE__ */ h(ge.Provider, { value: l == null ? void 0 : l.language, children: [
1575
1580
  /* @__PURE__ */ n(
1576
- Rt,
1581
+ Et,
1577
1582
  {
1578
- "aria-live": "assertive",
1583
+ "aria-live": "polite",
1579
1584
  ...e,
1580
- className: A(
1585
+ className: H(
1581
1586
  t,
1582
1587
  "humany-conversation-component"
1583
1588
  ),
1584
- children: /* @__PURE__ */ n(fe, {})
1589
+ children: /* @__PURE__ */ n(ye, {})
1585
1590
  }
1586
1591
  ),
1587
- o && /* @__PURE__ */ u(N, { children: [
1588
- /* @__PURE__ */ n(Mt, { dispatch: m }),
1592
+ o && /* @__PURE__ */ h(N, { children: [
1593
+ /* @__PURE__ */ n(Mt, { dispatch: d }),
1589
1594
  o.conversation && /* @__PURE__ */ n(
1590
- It,
1595
+ At,
1591
1596
  {
1592
- dispatch: m,
1597
+ dispatch: d,
1593
1598
  header: s,
1594
1599
  buttonLabel: a
1595
1600
  }
@@ -1598,7 +1603,7 @@ const Oe = ({ className: t }) => {
1598
1603
  ] })
1599
1604
  }
1600
1605
  );
1601
- }, Rt = i.div`
1606
+ }, Et = i.div`
1602
1607
  position: absolute;
1603
1608
  right: 0;
1604
1609
  left: 0;