@telia-ace/widget-conversation 1.1.7-rc.1 → 1.1.7-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,70 +1,71 @@
1
1
  import { jsx as n, jsxs as u, Fragment as N } from "react/jsx-runtime";
2
2
  import i from "@emotion/styled";
3
- import { Input as oe, borderTabStyle as f, Button as I, SymbolBadge as k, useIsTabbing as se, useDispatch as Y, useProperties as C, useScroll as ae, useContainer as T, Typography as X, invertedHoverButton as $e, Html as G, List as ie, buttonCss as B, ItemList as K, itemList as E, Link as ve, useComponent as xe, genericHtml as ke, headingElement as J, usePrevious as we, list as Ce, WidgetOverlayOutlet as le, ConversationContext as Se } from "@telia-ace/widget-ui";
4
- import { appendClassNames as A, htmlParentContains as ze } from "@telia-ace/widget-utilities";
5
- import { css as b, keyframes as Le } from "@emotion/react";
6
- import Ne, { useState as P, useEffect as Q, forwardRef as Z, useContext as Me, Suspense as Ie, useRef as ce, useMemo as He, useCallback as de } from "react";
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";
7
7
  import { FormComponent as Te } from "@telia-ace/widget-forms";
8
- import { ConversationMessageListItemType as w, ConversationMessageType as W } from "./index.mjs";
8
+ import { ConversationMessageListItemType as w, ConversationMessageType as q } 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
- const Ae = ({ className: t }) => {
13
- const [e, r] = P(""), [o, s] = P(0), [a, m] = P(0), d = se(), c = Y(), {
14
- inputPlaceholder: p = "Type your message",
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
15
  inputHidden: x = !1,
16
16
  inputDisabled: l = !1,
17
17
  sendButtonLabel: h = "Send message",
18
18
  inputMultiline: v = !0,
19
19
  secondaryAction: $
20
- } = C(), [z, y] = ae(!0), O = T();
21
- Q(() => {
22
- if (y.current) {
23
- const { lineHeight: g, maxHeight: L } = getComputedStyle(y.current);
20
+ } = C(), [z, p] = ie(!0), O = T();
21
+ Z(() => {
22
+ if (p.current) {
23
+ const { lineHeight: g, maxHeight: L } = getComputedStyle(p.current);
24
24
  if (g && g.indexOf("px") > -1) {
25
- const H = g.split("px"), ye = parseInt(H[0], 10);
26
- s(ye);
27
- const be = L.split("px");
28
- m(parseInt(be[0], 10));
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));
29
29
  }
30
30
  }
31
- }, [y.current]);
31
+ }, [p.current]);
32
32
  const D = (g) => {
33
- !g.shiftKey || !v ? (g.preventDefault(), e && e.length > 0 && (c("user-submit", { text: e }), r(""), j(""))) : e.length < 1 && g.preventDefault();
34
- }, fe = (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) => {
35
35
  if (!$)
36
36
  return;
37
- g.preventDefault(), c("action", {
37
+ g.preventDefault(), d("action", {
38
38
  actionKey: $.action,
39
39
  ...$
40
40
  });
41
41
  const { events: L } = O.get("$widget");
42
42
  L.dispatch("tracking:secondary-clicked", {});
43
43
  }, pe = (g) => {
44
- if (v && y.current) {
45
- const L = y.current.scrollHeight;
46
- if (L > o) {
47
- y.current.style.height = "auto";
44
+ if (v && p.current) {
45
+ const L = p.current.scrollHeight;
46
+ if (L > s) {
47
+ p.current.style.height = "auto";
48
48
  let H = L;
49
- g.length < 1 && (H = o), y.current.style.height = `${H}px`, H >= a ? y.current.style.overflowY = "scroll" : y.current.style.overflowY = "hidden";
49
+ g.length < 1 && (H = s), p.current.style.height = `${H}px`, H >= r ? p.current.style.overflowY = "scroll" : p.current.style.overflowY = "hidden";
50
50
  }
51
51
  }
52
- }, j = (g) => {
53
- pe(g), r(g), g && g.length > 0 && c("user-typing", { textLength: g.length });
52
+ }, P = (g) => {
53
+ pe(g), o(g), g && g.length > 0 && d("user-typing", { textLength: g.length });
54
54
  };
55
55
  return x ? null : /* @__PURE__ */ u(
56
- Ke,
56
+ Ee,
57
57
  {
58
58
  grow: v,
59
59
  className: A("humany-conversation-input", t),
60
60
  scrollableCss: z,
61
- isTabbing: d,
61
+ isTabbing: c,
62
62
  children: [
63
63
  $ && /* @__PURE__ */ n(
64
- Be,
64
+ Ke,
65
65
  {
66
+ className: "humany-secondary-button",
66
67
  disabled: l,
67
- onClick: fe,
68
+ onClick: ye,
68
69
  title: $.label,
69
70
  "aria-label": $.label,
70
71
  children: /* @__PURE__ */ n(
@@ -77,38 +78,39 @@ const Ae = ({ className: t }) => {
77
78
  }
78
79
  ),
79
80
  v ? /* @__PURE__ */ n(
80
- Oe,
81
+ Re,
81
82
  {
82
83
  value: e,
83
- onChange: j,
84
+ onChange: P,
84
85
  onEnter: D,
85
86
  disabled: l,
86
- "aria-label": p,
87
- placeholder: p,
87
+ "aria-label": y,
88
+ placeholder: y,
88
89
  type: "textarea",
89
90
  rows: 1,
90
- ref: y
91
+ ref: p
91
92
  }
92
93
  ) : /* @__PURE__ */ n(
93
- Re,
94
+ Be,
94
95
  {
95
96
  value: e,
96
- onChange: j,
97
+ onChange: P,
97
98
  onEnter: D,
98
99
  disabled: l,
99
- "aria-label": p,
100
- placeholder: p
100
+ "aria-label": y,
101
+ placeholder: y
101
102
  }
102
103
  ),
103
104
  /* @__PURE__ */ n(
104
- me,
105
+ ue,
105
106
  {
107
+ className: "humany-send-button",
106
108
  disabled: !1,
107
109
  onClick: D,
108
110
  title: h,
109
111
  "aria-label": h,
110
112
  children: /* @__PURE__ */ n(
111
- Ee,
113
+ je,
112
114
  {
113
115
  size: 22,
114
116
  symbol: { type: "Svg", content: "send" },
@@ -120,7 +122,7 @@ const Ae = ({ className: t }) => {
120
122
  ]
121
123
  }
122
124
  );
123
- }, Oe = i(oe)`
125
+ }, Re = i(se)`
124
126
  resize: none;
125
127
  flex: 1;
126
128
  flex-shrink: 1;
@@ -144,7 +146,7 @@ const Ae = ({ className: t }) => {
144
146
  ${f};
145
147
  outline-offset: 12px;
146
148
  }
147
- `, Re = i(oe)`
149
+ `, Be = i(se)`
148
150
  flex: 1;
149
151
  border: none;
150
152
  background-color: transparent;
@@ -170,7 +172,7 @@ const Ae = ({ className: t }) => {
170
172
  }};
171
173
  font-style: italic;
172
174
  }
173
- `, me = i(I)`
175
+ `, ue = i(I)`
174
176
  flex: 0 0 50px;
175
177
  align-self: stretch;
176
178
  background-color: transparent;
@@ -182,13 +184,13 @@ const Ae = ({ className: t }) => {
182
184
  &:focus-visible {
183
185
  ${f};
184
186
  }
185
- `, Be = i(me)`
187
+ `, Ke = i(ue)`
186
188
  border-right: ${(t) => t.theme.border};
187
189
  margin: ${(t) => {
188
190
  var e;
189
191
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
190
192
  }} 0;
191
- `, Ke = i.div`
193
+ `, Ee = i.div`
192
194
  ${(t) => t.grow ? b`
193
195
  min-height: 50px;
194
196
  max-height: 150px;
@@ -207,7 +209,7 @@ const Ae = ({ className: t }) => {
207
209
  textarea {
208
210
  ${(t) => !!t.scrollableCss && t.scrollableCss}
209
211
  }
210
- `, Ee = i(
212
+ `, je = i(
211
213
  ({
212
214
  hasContent: t,
213
215
  ...e
@@ -271,7 +273,7 @@ const Ae = ({ className: t }) => {
271
273
  }};
272
274
  }
273
275
  }
274
- `, je = Le`
276
+ `, Pe = Ne`
275
277
  0% {
276
278
  opacity: 0;
277
279
  }
@@ -281,7 +283,7 @@ const Ae = ({ className: t }) => {
281
283
  100% {
282
284
  opacity: 0;
283
285
  }
284
- `, Pe = i.div`
286
+ `, We = i.div`
285
287
  display: flex;
286
288
  justify-content: center;
287
289
  > div {
@@ -293,7 +295,7 @@ const Ae = ({ className: t }) => {
293
295
  var e;
294
296
  return (e = t.theme.colors) == null ? void 0 : e.text;
295
297
  }};
296
- animation: ${je} 1s infinite;
298
+ animation: ${Pe} 1s infinite;
297
299
  }
298
300
  > div:nth-of-type(2) {
299
301
  animation-delay: 100ms;
@@ -301,29 +303,29 @@ const Ae = ({ className: t }) => {
301
303
  > div:nth-of-type(3) {
302
304
  animation-delay: 200ms;
303
305
  }
304
- `, V = i.div`
306
+ `, _ = i.div`
305
307
  grid-area: content;
306
308
  max-width: 100%;
307
309
  overflow: hidden;
308
- `, We = i(X)`
310
+ `, qe = i(G)`
309
311
  font-size: ${(t) => {
310
312
  var e;
311
313
  return (e = t.theme.fonts) == null ? void 0 : e.normal;
312
314
  }};
313
315
  font-weight: normal;
314
316
  margin: 0;
315
- `, _ = i.div`
317
+ `, F = i.div`
316
318
  display: flex;
317
319
  ${(t) => t.left && "justify-content: start;"};
318
320
  ${(t) => t.center && "justify-content: center;"};
319
321
  ${(t) => t.right && "justify-content: end;"};
320
- `, F = i.div`
322
+ `, Y = i.div`
321
323
  ${(t) => {
322
324
  var e;
323
325
  return t.padded && `padding: ${(e = t.theme.sizes) == null ? void 0 : e.medium};`;
324
326
  }}
325
- ${(t) => !t.user && t.stacked && qe(t.stacked, t.theme)}
326
- ${(t) => t.user && t.stacked && Ue(t.stacked, t.theme)}
327
+ ${(t) => !t.user && t.stacked && Ue(t.stacked, t.theme)}
328
+ ${(t) => t.user && t.stacked && Ve(t.stacked, t.theme)}
327
329
 
328
330
  display: inline-block;
329
331
  margin-top: ${(t) => {
@@ -339,15 +341,15 @@ const Ae = ({ className: t }) => {
339
341
  }
340
342
  max-width: 100%;
341
343
  ${(t) => t.fullWidth && "width: 100%;"}
342
- `, qe = (t, e) => {
343
- var o, s;
344
- const r = b`
345
- background-color: ${(o = e.colors) == null ? void 0 : o.accent};
346
- color: ${(s = e.colors) == null ? void 0 : s.text};
344
+ `, Ue = (t, e) => {
345
+ var s, a;
346
+ const o = b`
347
+ background-color: ${(s = e.colors) == null ? void 0 : s.accent};
348
+ color: ${(a = e.colors) == null ? void 0 : a.text};
347
349
  ${e.border && `border: ${e.border};`};
348
350
  `;
349
351
  return e.borderRadius ? b`
350
- ${r}
352
+ ${o}
351
353
 
352
354
  border-top-right-radius: ${e.borderRadius};
353
355
  border-bottom-right-radius: ${e.borderRadius};
@@ -359,15 +361,15 @@ const Ae = ({ className: t }) => {
359
361
  ${t === "last" && `
360
362
  border-bottom-left-radius: ${e.borderRadius};
361
363
  `}
362
- ` : r;
363
- }, Ue = (t, e) => {
364
- var o, s;
365
- const r = b`
366
- background-color: ${(o = e.colors) == null ? void 0 : o.primary};
367
- color: ${(s = e.colors) == null ? void 0 : s.accent};
364
+ ` : o;
365
+ }, Ve = (t, e) => {
366
+ var s, a;
367
+ const o = b`
368
+ background-color: ${(s = e.colors) == null ? void 0 : s.primary};
369
+ color: ${(a = e.colors) == null ? void 0 : a.accent};
368
370
  `;
369
371
  return e.borderRadius ? b`
370
- ${r}
372
+ ${o}
371
373
 
372
374
  border-top-left-radius: ${e.borderRadius};
373
375
  border-bottom-left-radius: ${e.borderRadius};
@@ -379,7 +381,7 @@ const Ae = ({ className: t }) => {
379
381
  ${t === "last" && `
380
382
  border-bottom-right-radius: ${e.borderRadius};
381
383
  `}
382
- ` : r;
384
+ ` : o;
383
385
  }, R = i.div`
384
386
  margin-bottom: ${(t) => {
385
387
  var e;
@@ -389,19 +391,19 @@ const Ae = ({ className: t }) => {
389
391
  margin-bottom: 0;
390
392
  }
391
393
  `, S = (t) => {
392
- var e, r;
394
+ var e, o;
393
395
  return b`
394
396
  margin: ${(e = t.theme.sizes) == null ? void 0 : e.medium} 0;
395
- padding: 0 ${(r = t.theme.sizes) == null ? void 0 : r.medium};
397
+ padding: 0 ${(o = t.theme.sizes) == null ? void 0 : o.medium};
396
398
  `;
397
- }, Ve = i(Te)`
399
+ }, _e = i(Te)`
398
400
  & button.humany-form-component-button {
399
401
  ${(t) => {
400
- var e, r, o, s;
401
- return ((e = t.theme.colors) == null ? void 0 : e.primary) && ((r = t.theme.colors) == null ? void 0 : r.accent) && $e({
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({
402
404
  active: !1,
403
- primaryColor: (o = t.theme.colors) == null ? void 0 : o.primary,
404
- secondaryColor: (s = t.theme.colors) == null ? void 0 : s.accent,
405
+ primaryColor: (s = t.theme.colors) == null ? void 0 : s.primary,
406
+ secondaryColor: (a = t.theme.colors) == null ? void 0 : a.accent,
405
407
  theme: t.theme
406
408
  });
407
409
  }};
@@ -422,7 +424,7 @@ const Ae = ({ className: t }) => {
422
424
  }};
423
425
  }
424
426
  }
425
- `, _e = i(G)`
427
+ `, Fe = i(J)`
426
428
  white-space: pre-wrap;
427
429
  a {
428
430
  color: ${(t) => t.theme.colors.link};
@@ -433,7 +435,7 @@ const Ae = ({ className: t }) => {
433
435
  }};
434
436
  }
435
437
  }
436
- `, Fe = i(ie)`
438
+ `, Ye = i(le)`
437
439
  padding: 0;
438
440
  list-style: none;
439
441
  margin: 0 -${(t) => {
@@ -446,8 +448,8 @@ const Ae = ({ className: t }) => {
446
448
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
447
449
  }};
448
450
  }
449
- `, Ye = i.button`
450
- ${(t) => B(t)};
451
+ `, Xe = i.button`
452
+ ${(t) => K(t)};
451
453
  display: block;
452
454
  background-color: ${(t) => {
453
455
  var e;
@@ -459,20 +461,20 @@ const Ae = ({ className: t }) => {
459
461
  ${f}
460
462
  background-color: transparent;
461
463
  }
462
- `, te = Z(
463
- ({ boxed: t, className: e, agentData: r }, o) => /* @__PURE__ */ n(V, { ref: o, children: /* @__PURE__ */ n(_, { left: t, center: !t, children: /* @__PURE__ */ n(
464
- F,
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
467
  {
466
468
  padded: !!t,
467
469
  stacked: t ? "first" : void 0,
468
- children: /* @__PURE__ */ u(Pe, { children: [
470
+ children: /* @__PURE__ */ u(We, { children: [
469
471
  /* @__PURE__ */ n("div", {}),
470
472
  /* @__PURE__ */ n("div", {}),
471
473
  /* @__PURE__ */ n("div", {})
472
474
  ] })
473
475
  }
474
476
  ) }) })
475
- ), ue = Ne.createContext(null), Xe = i.p`
477
+ ), he = Me.createContext(null), Ge = i.p`
476
478
  && {
477
479
  font-size: ${(t) => {
478
480
  var e;
@@ -487,53 +489,53 @@ const Ae = ({ className: t }) => {
487
489
  var e;
488
490
  return (e = t.theme.colors) == null ? void 0 : e.text;
489
491
  }};
490
- `, ne = (t, e) => new Date(t).toLocaleTimeString(e || [], {
492
+ `, re = (t, e) => new Date(t).toLocaleTimeString(e || [], {
491
493
  hour: "numeric",
492
494
  minute: "2-digit"
493
495
  }), M = ({
494
496
  className: t,
495
497
  name: e,
496
- timestamp: r,
497
- ariaHidden: o = !1
498
+ timestamp: o,
499
+ ariaHidden: s = !1
498
500
  }) => {
499
- const s = Me(ue);
500
- if (!e && !r)
501
+ const a = Ie(he);
502
+ if (!e && !o)
501
503
  return null;
502
- let a = "";
503
- return e ? r ? a = `${e}: ${ne(r, s)}` : a = e : r && (a = ne(r, s)), /* @__PURE__ */ n(Xe, { "aria-hidden": o, children: a });
504
- }, he = ({
504
+ let r = "";
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 = ({
505
507
  className: t,
506
508
  children: e,
507
- sender: r,
508
- timestamp: o
509
+ sender: o,
510
+ timestamp: s
509
511
  }) => {
510
- const { avatar: s, name: a } = r, { avatarSize: m } = C();
512
+ const { avatar: a, name: r } = o, { avatarSize: m } = C();
511
513
  return /* @__PURE__ */ u(
512
- Ge,
514
+ Je,
513
515
  {
514
- hasAvatar: !!s,
516
+ hasAvatar: !!a,
515
517
  className: A(
516
518
  t,
517
519
  "humany-conversation-agent-message"
518
520
  ),
519
521
  children: [
520
- s && /* @__PURE__ */ n(De, { avatarSize: m, children: typeof s == "string" ? (
522
+ a && /* @__PURE__ */ n(De, { className: "humany-agent-avatar", avatarSize: m, children: typeof a == "string" ? (
521
523
  // eslint-disable-next-line jsx-a11y/alt-text
522
- /* @__PURE__ */ n("img", { src: s })
523
- ) : /* @__PURE__ */ n(k, { symbol: s }) }),
524
+ /* @__PURE__ */ n("img", { src: a })
525
+ ) : /* @__PURE__ */ n(k, { symbol: a }) }),
524
526
  e,
525
527
  /* @__PURE__ */ n(
526
528
  M,
527
529
  {
528
- name: a,
529
- timestamp: o,
530
+ name: r,
531
+ timestamp: s,
530
532
  ariaHidden: !0
531
533
  }
532
534
  )
533
535
  ]
534
536
  }
535
537
  );
536
- }, Ge = i.div`
538
+ }, Je = i.div`
537
539
  display: grid;
538
540
  margin-right: 10%;
539
541
  width: 90%;
@@ -550,33 +552,33 @@ const Ae = ({ className: t }) => {
550
552
  'content'
551
553
  'info';
552
554
  `};
553
- `, Je = Z(
554
- ({ className: t, children: e, timestamp: r, discrete: o, fullWidth: s }, a) => /* @__PURE__ */ n(
555
- Qe,
555
+ `, Qe = ee(
556
+ ({ className: t, children: e, timestamp: o, discrete: s, fullWidth: a }, r) => /* @__PURE__ */ n(
557
+ Ze,
556
558
  {
557
- ref: a,
559
+ ref: r,
558
560
  className: A(
559
561
  t,
560
562
  "humany-conversation-system-message"
561
563
  ),
562
- fullWidth: s,
563
- children: o ? /* @__PURE__ */ u(Ze, { className: "humany-conversation-discrete-message", children: [
564
+ fullWidth: a,
565
+ children: s ? /* @__PURE__ */ u(et, { className: "humany-conversation-discrete-message", children: [
564
566
  e,
565
- /* @__PURE__ */ n(M, { timestamp: r })
567
+ /* @__PURE__ */ n(M, { timestamp: o })
566
568
  ] }) : /* @__PURE__ */ u(N, { children: [
567
569
  e,
568
- /* @__PURE__ */ n(M, { timestamp: r })
570
+ /* @__PURE__ */ n(M, { timestamp: o })
569
571
  ] })
570
572
  }
571
573
  )
572
- ), Qe = i.div`
574
+ ), Ze = i.div`
573
575
  ${(t) => t.fullWidth && "width: 100%"};
574
576
  padding: 0 ${(t) => {
575
577
  var e;
576
578
  return (e = t.theme.sizes) == null ? void 0 : e.large;
577
579
  }};
578
580
  overflow: auto;
579
- `, Ze = i.div`
581
+ `, et = i.div`
580
582
  text-align: center;
581
583
  word-wrap: break-word;
582
584
  font-size: ${(t) => {
@@ -590,10 +592,10 @@ const Ae = ({ className: t }) => {
590
592
  > p {
591
593
  margin: 0;
592
594
  }
593
- `, et = ({ className: t, children: e, timestamp: r }) => {
594
- const { userLabel: o = "" } = C();
595
+ `, tt = ({ className: t, children: e, timestamp: o }) => {
596
+ const { userLabel: s = "" } = C();
595
597
  return /* @__PURE__ */ u(
596
- tt,
598
+ nt,
597
599
  {
598
600
  className: A(
599
601
  t,
@@ -604,68 +606,68 @@ const Ae = ({ className: t }) => {
604
606
  /* @__PURE__ */ n(
605
607
  M,
606
608
  {
607
- name: o,
608
- timestamp: r,
609
+ name: s,
610
+ timestamp: o,
609
611
  ariaHidden: !0
610
612
  }
611
613
  )
612
614
  ]
613
615
  }
614
616
  );
615
- }, tt = i.div`
617
+ }, nt = i.div`
616
618
  margin-left: 10%;
617
619
  width: 90%;
618
620
  display: flex;
619
621
  flex-direction: column;
620
622
  align-items: flex-end;
621
- `, ee = (t) => Array.isArray(t) ? t : Object.keys(t).map((e) => ({
623
+ `, te = (t) => Array.isArray(t) ? t : Object.keys(t).map((e) => ({
622
624
  label: t[e],
623
625
  actionKey: e
624
- })), nt = ({ header: t, actions: e, dispatch: r }) => {
625
- const o = T(), { events: s } = o.get("$widget");
626
+ })), rt = ({ header: t, actions: e, dispatch: o }) => {
627
+ const s = T(), { events: a } = s.get("$widget");
626
628
  return /* @__PURE__ */ n(
627
- rt,
629
+ ot,
628
630
  {
629
631
  className: "humany-conversation-button-list",
630
632
  header: t,
631
- items: ee(e),
632
- renderItem: (a) => {
633
- var d;
634
- const m = !!((d = a == null ? void 0 : a.data) != null && d.href);
633
+ items: te(e),
634
+ renderItem: (r) => {
635
+ var c;
636
+ const m = !!((c = r == null ? void 0 : r.data) != null && c.href);
635
637
  return /* @__PURE__ */ n("li", { children: m ? /* @__PURE__ */ u(
636
- ot,
638
+ st,
637
639
  {
638
640
  onClick: () => {
639
- r("action", a), s.dispatch("tracking:button-list-item-clicked", a);
641
+ o("action", r), a.dispatch("tracking:button-list-item-clicked", r);
640
642
  },
641
- href: a.data.href,
642
- target: a.data.target,
643
- "aria-label": a.label,
644
- title: a.label,
643
+ href: r.data.href,
644
+ target: r.data.target,
645
+ "aria-label": r.label,
646
+ title: r.label,
645
647
  children: [
646
- /* @__PURE__ */ n(k, { symbol: a.symbol }),
647
- a.label
648
+ /* @__PURE__ */ n(k, { symbol: r.symbol }),
649
+ r.label
648
650
  ]
649
651
  }
650
652
  ) : /* @__PURE__ */ u(
651
- st,
653
+ at,
652
654
  {
653
655
  onClick: () => {
654
- r("action", a), s.dispatch("tracking:button-list-item-clicked", a);
656
+ o("action", r), a.dispatch("tracking:button-list-item-clicked", r);
655
657
  },
656
- "aria-label": a.label,
657
- title: a.label,
658
+ "aria-label": r.label,
659
+ title: r.label,
658
660
  children: [
659
- /* @__PURE__ */ n(k, { symbol: a.symbol }),
660
- a.label
661
+ /* @__PURE__ */ n(k, { symbol: r.symbol }),
662
+ r.label
661
663
  ]
662
664
  }
663
- ) }, a.actionKey);
665
+ ) }, r.actionKey);
664
666
  }
665
667
  }
666
668
  );
667
- }, rt = i(K)`
668
- ${E}
669
+ }, ot = i(E)`
670
+ ${j}
669
671
  > ul {
670
672
  display: flex;
671
673
  flex-wrap: wrap;
@@ -678,8 +680,8 @@ const Ae = ({ className: t }) => {
678
680
  }
679
681
  }
680
682
  ${S}
681
- `, ot = i(ve)`
682
- ${B};
683
+ `, st = i(xe)`
684
+ ${K};
683
685
 
684
686
  display: block;
685
687
  padding: ${(t) => {
@@ -706,8 +708,8 @@ const Ae = ({ className: t }) => {
706
708
  return (e = t.theme.sizes) == null ? void 0 : e.small;
707
709
  }};
708
710
  }
709
- `, st = i(I)`
710
- ${B};
711
+ `, at = i(I)`
712
+ ${K};
711
713
 
712
714
  display: block;
713
715
  padding: ${(t) => {
@@ -734,11 +736,11 @@ const Ae = ({ className: t }) => {
734
736
  return (e = t.theme.sizes) == null ? void 0 : e.small;
735
737
  }};
736
738
  }
737
- `, at = ({ type: t, content: e = {} }) => {
738
- const r = xe(t);
739
- return !r || !t ? null : /* @__PURE__ */ n(Ie, { fallback: null, children: /* @__PURE__ */ n(r, { ...e }) });
740
- }, it = ({ body: t }) => /* @__PURE__ */ n(lt, { html: t }), lt = i(G)`
741
- ${ke}
739
+ `, 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}
742
744
  color: inherit;
743
745
  white-space: normal;
744
746
  ${S}
@@ -751,22 +753,22 @@ const Ae = ({ className: t }) => {
751
753
  p {
752
754
  word-break: auto-phrase;
753
755
  }
754
- `, ct = ({ header: t, actions: e, dispatch: r }) => /* @__PURE__ */ n(
755
- dt,
756
+ `, dt = ({ header: t, actions: e, dispatch: o }) => /* @__PURE__ */ n(
757
+ mt,
756
758
  {
757
759
  className: "humany-conversation-item-list",
758
760
  header: t,
759
- items: ee(e),
760
- renderItem: (o) => {
761
- var s;
762
- return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(mt, { children: [
763
- ((s = o.symbol) == null ? void 0 : s.content) && /* @__PURE__ */ n("div", { className: "item-icon", children: /* @__PURE__ */ n(
761
+ items: te(e),
762
+ renderItem: (s) => {
763
+ var a;
764
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(ut, { children: [
765
+ ((a = s.symbol) == null ? void 0 : a.content) && /* @__PURE__ */ n("div", { className: "item-icon", children: /* @__PURE__ */ n(
764
766
  k,
765
767
  {
766
768
  size: 22,
767
769
  symbol: {
768
- type: o.symbol.type,
769
- content: o.symbol.content
770
+ type: s.symbol.type,
771
+ content: s.symbol.content
770
772
  }
771
773
  }
772
774
  ) }),
@@ -775,20 +777,20 @@ const Ae = ({ className: t }) => {
775
777
  I,
776
778
  {
777
779
  onClick: () => {
778
- r("action", o);
780
+ o("action", s);
779
781
  },
780
- "aria-label": o.label,
781
- title: o.label,
782
- children: o.label
782
+ "aria-label": s.label,
783
+ title: s.label,
784
+ children: s.label
783
785
  }
784
786
  ),
785
- o.description && /* @__PURE__ */ n("p", { children: o.description })
787
+ s.description && /* @__PURE__ */ n("p", { children: s.description })
786
788
  ] })
787
- ] }) }, o.actionKey);
789
+ ] }) }, s.actionKey);
788
790
  }
789
791
  }
790
- ), dt = i(K)`
791
- ${E}
792
+ ), mt = i(E)`
793
+ ${j}
792
794
 
793
795
  > .humany-paragraph {
794
796
  ${S}
@@ -799,7 +801,7 @@ const Ae = ({ className: t }) => {
799
801
  }
800
802
  }
801
803
 
802
- ${(t) => J(t)(
804
+ ${(t) => Q(t)(
803
805
  "h1",
804
806
  b`
805
807
  white-space: normal;
@@ -825,7 +827,7 @@ const Ae = ({ className: t }) => {
825
827
  border-bottom: none;
826
828
  }
827
829
  }
828
- `, mt = i.div`
830
+ `, ut = i.div`
829
831
  display: flex;
830
832
  gap: ${(t) => {
831
833
  var e;
@@ -874,15 +876,15 @@ const Ae = ({ className: t }) => {
874
876
  }
875
877
  }
876
878
  }
877
- `, ut = ({ header: t, actions: e, dispatch: r }) => {
878
- const o = we(e), s = ce(), a = se(), m = T(), { events: d } = m.get("$widget");
879
- return Q(() => {
880
- if (o && Array.isArray(e) && Array.isArray(o) && o.length < e.length && s.current) {
881
- const c = s.current.querySelectorAll(
879
+ `, 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(() => {
882
+ if (s && Array.isArray(e) && Array.isArray(s) && s.length < e.length && a.current) {
883
+ const d = a.current.querySelectorAll(
882
884
  ".humany-conversation-link-list > ul > li"
883
- ), p = c[o.length];
884
- if (c.length === e.length && o.length) {
885
- const x = c[o.length - 1];
885
+ ), y = d[s.length];
886
+ if (d.length === e.length && s.length) {
887
+ const x = d[s.length - 1];
886
888
  if (x) {
887
889
  const l = x.querySelector(
888
890
  ".humany-button"
@@ -890,16 +892,16 @@ const Ae = ({ className: t }) => {
890
892
  l && l.focus();
891
893
  }
892
894
  } else
893
- p && new MutationObserver((l, h) => {
895
+ y && new MutationObserver((l, h) => {
894
896
  l.forEach((v) => {
895
897
  if (v.addedNodes) {
896
898
  const $ = Array.from(
897
899
  v.addedNodes
898
900
  ).find((z) => z.tagName === "BUTTON");
899
- $ && ze(s.current, document.activeElement) && (a && $.focus(), h.disconnect());
901
+ $ && Le(a.current, document.activeElement) && (r && $.focus(), h.disconnect());
900
902
  }
901
903
  });
902
- }).observe(p, {
904
+ }).observe(y, {
903
905
  attributes: !1,
904
906
  characterData: !1,
905
907
  childList: !0,
@@ -909,24 +911,24 @@ const Ae = ({ className: t }) => {
909
911
  });
910
912
  }
911
913
  }), /* @__PURE__ */ n(
912
- ht,
914
+ gt,
913
915
  {
914
- ref: s,
916
+ ref: a,
915
917
  className: "humany-conversation-link-list",
916
918
  header: t,
917
- items: ee(e),
918
- renderItem: (c) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(
919
- gt,
919
+ items: te(e),
920
+ renderItem: (d) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(
921
+ ft,
920
922
  {
921
- help: c.actionKey === "help",
923
+ help: d.actionKey === "help",
922
924
  onClick: () => {
923
- r("action", c), d.dispatch("tracking:link-list-item-clicked", c);
925
+ o("action", d), c.dispatch("tracking:link-list-item-clicked", d);
924
926
  },
925
- "aria-label": c.label,
926
- title: c.label,
927
+ "aria-label": d.label,
928
+ title: d.label,
927
929
  children: [
928
- c.label,
929
- c.actionKey === "help" && /* @__PURE__ */ n(
930
+ d.label,
931
+ d.actionKey === "help" && /* @__PURE__ */ n(
930
932
  k,
931
933
  {
932
934
  size: 14,
@@ -938,14 +940,14 @@ const Ae = ({ className: t }) => {
938
940
  )
939
941
  ]
940
942
  }
941
- ) }, c.actionKey)
943
+ ) }, d.actionKey)
942
944
  }
943
945
  );
944
- }, ht = i(K)`
945
- ${E}
946
+ }, gt = i(E)`
947
+ ${j}
946
948
  ${S}
947
949
 
948
- ${(t) => J(t)(
950
+ ${(t) => Q(t)(
949
951
  "h1",
950
952
  b`
951
953
  white-space: normal;
@@ -963,7 +965,7 @@ const Ae = ({ className: t }) => {
963
965
  margin: 0;
964
966
  }
965
967
  }
966
- `, gt = i(I)`
968
+ `, ft = i(I)`
967
969
  display: block;
968
970
  text-align: left;
969
971
  font-weight: 300;
@@ -976,14 +978,14 @@ const Ae = ({ className: t }) => {
976
978
  overflow: hidden;
977
979
 
978
980
  ${(t) => {
979
- var e, r;
981
+ var e, o;
980
982
  return t.help && b`
981
983
  color: ${(e = t.theme.colors) == null ? void 0 : e.text};
982
984
  text-decoration: underline;
983
985
 
984
986
  i,
985
987
  svg {
986
- margin-left: ${(r = t.theme.sizes) == null ? void 0 : r.small};
988
+ margin-left: ${(o = t.theme.sizes) == null ? void 0 : o.small};
987
989
  }
988
990
  `;
989
991
  }}
@@ -998,18 +1000,18 @@ const Ae = ({ className: t }) => {
998
1000
  text-decoration: underline;
999
1001
  }
1000
1002
  }
1001
- `, ft = () => /* @__PURE__ */ n(pt, { className: "humany-conversation-separator" }), pt = i.div`
1003
+ `, yt = () => /* @__PURE__ */ n(pt, { className: "humany-conversation-separator" }), pt = i.div`
1002
1004
  ${(t) => t.theme.border && `border-bottom: ${t.theme.border};`}
1003
1005
  width: 100%;
1004
- `, yt = ({ text: t }) => /* @__PURE__ */ n(bt, { className: "humany-conversation-text", variant: "span", children: t }), bt = i(X)`
1006
+ `, bt = ({ text: t }) => /* @__PURE__ */ n($t, { className: "humany-conversation-text", variant: "span", children: t }), $t = i(G)`
1005
1007
  ${S}
1006
- `, $t = ({
1008
+ `, vt = ({
1007
1009
  header: t = "Video call",
1008
1010
  acceptLabel: e = "Accept",
1009
- declineLabel: r = "Decline",
1010
- dispatch: o
1011
+ declineLabel: o = "Decline",
1012
+ dispatch: s
1011
1013
  }) => {
1012
- const s = He(() => [
1014
+ const a = He(() => [
1013
1015
  {
1014
1016
  label: e,
1015
1017
  actionKey: "accept-video-call",
@@ -1019,39 +1021,39 @@ const Ae = ({ className: t }) => {
1019
1021
  }
1020
1022
  },
1021
1023
  {
1022
- label: r,
1024
+ label: o,
1023
1025
  actionKey: "decline-video-call",
1024
1026
  symbol: {
1025
1027
  type: "Svg",
1026
1028
  content: "close"
1027
1029
  }
1028
1030
  }
1029
- ], [e, r]);
1031
+ ], [e, o]);
1030
1032
  return /* @__PURE__ */ n(
1031
- vt,
1033
+ xt,
1032
1034
  {
1033
1035
  className: "humany-conversation-video-request",
1034
1036
  header: t,
1035
- items: s,
1036
- renderItem: (a) => {
1037
- const m = a.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
1037
+ items: a,
1038
+ renderItem: (r) => {
1039
+ const m = r.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
1038
1040
  return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1039
- xt,
1041
+ kt,
1040
1042
  {
1041
1043
  onClick: () => {
1042
- o("action", a);
1044
+ s("action", r);
1043
1045
  },
1044
- "aria-label": a.label,
1045
- title: a.label,
1046
+ "aria-label": r.label,
1047
+ title: r.label,
1046
1048
  bgColor: m,
1047
- children: /* @__PURE__ */ n(k, { symbol: a.symbol, size: 25 })
1049
+ children: /* @__PURE__ */ n(k, { symbol: r.symbol, size: 25 })
1048
1050
  }
1049
- ) }, a.actionKey);
1051
+ ) }, r.actionKey);
1050
1052
  }
1051
1053
  }
1052
1054
  );
1053
- }, vt = i(K)`
1054
- ${(t) => E(t)}
1055
+ }, xt = i(E)`
1056
+ ${(t) => j(t)}
1055
1057
  > ul {
1056
1058
  display: flex;
1057
1059
  flex-wrap: wrap;
@@ -1064,8 +1066,8 @@ const Ae = ({ className: t }) => {
1064
1066
  }
1065
1067
  }
1066
1068
  ${(t) => S(t)}
1067
- `, xt = i(I)`
1068
- ${B};
1069
+ `, kt = i(I)`
1070
+ ${K};
1069
1071
 
1070
1072
  background-color: ${(t) => t.bgColor};
1071
1073
  display: flex;
@@ -1104,78 +1106,91 @@ const Ae = ({ className: t }) => {
1104
1106
  stroke: #fff;
1105
1107
  }
1106
1108
  }
1107
- `, kt = ([t, e]) => ({ type: t, content: e }), wt = ({ items: t, dispatch: e }) => /* @__PURE__ */ n(
1108
- Ct,
1109
- {
1110
- role: "none",
1111
- className: "humany-message-list",
1112
- items: t.map(kt),
1113
- renderLi: !0,
1114
- renderItem: (r) => {
1115
- switch (r.type) {
1116
- case w.Text:
1117
- return /* @__PURE__ */ n(yt, { text: r.content });
1118
- case w.HTML:
1119
- return /* @__PURE__ */ n(it, { ...r.content });
1120
- case w.Separator:
1121
- return /* @__PURE__ */ n(ft, { ...r.content });
1122
- case w.ItemList:
1123
- return /* @__PURE__ */ n(ct, { ...r.content, dispatch: e });
1124
- case w.LinkList:
1125
- return /* @__PURE__ */ n(ut, { ...r.content, dispatch: e });
1126
- case w.ButtonList:
1127
- return /* @__PURE__ */ n(nt, { ...r.content, dispatch: e });
1128
- case w.VideoRequest:
1129
- return /* @__PURE__ */ n($t, { ...r.content, dispatch: e });
1130
- default:
1131
- return /* @__PURE__ */ n(at, { type: r.type, content: r.content });
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"));
1118
+ }).length && o.push("humany-category-list"), /* @__PURE__ */ n(
1119
+ Ct,
1120
+ {
1121
+ role: "none",
1122
+ className: A(
1123
+ "humany-message-list",
1124
+ o.join(" ")
1125
+ ),
1126
+ items: t.map(B),
1127
+ renderLi: !0,
1128
+ renderItem: (r) => {
1129
+ switch (r.type) {
1130
+ case w.Text:
1131
+ return /* @__PURE__ */ n(bt, { text: r.content });
1132
+ case w.HTML:
1133
+ return /* @__PURE__ */ n(lt, { ...r.content });
1134
+ case w.Separator:
1135
+ return /* @__PURE__ */ n(yt, { ...r.content });
1136
+ case w.ItemList:
1137
+ return /* @__PURE__ */ n(dt, { ...r.content, dispatch: e });
1138
+ case w.LinkList:
1139
+ return /* @__PURE__ */ n(ht, { ...r.content, dispatch: e });
1140
+ case w.ButtonList:
1141
+ return /* @__PURE__ */ n(rt, { ...r.content, dispatch: e });
1142
+ case w.VideoRequest:
1143
+ return /* @__PURE__ */ n(vt, { ...r.content, dispatch: e });
1144
+ default:
1145
+ return /* @__PURE__ */ n(it, { type: r.type, content: r.content });
1146
+ }
1132
1147
  }
1133
1148
  }
1134
- }
1135
- ), Ct = i(ie)`
1136
- ${Ce}
1149
+ );
1150
+ }, Ct = i(le)`
1151
+ ${Se}
1137
1152
 
1138
1153
  > li {
1139
1154
  margin: 0;
1140
1155
  }
1141
- `, St = Z(
1142
- ({ className: t, timestamp: e, sender: r, type: o, content: s }, a) => {
1143
- const m = de(
1156
+ `, St = ee(
1157
+ ({ className: t, timestamp: e, sender: o, type: s, content: a }, r) => {
1158
+ const m = me(
1144
1159
  (l) => {
1145
1160
  let h = "first";
1146
- return s.length > 1 && (h = l === 0 ? "first" : l + 1 === s.length ? "last" : "middle"), h;
1161
+ return a.length > 1 && (h = l === 0 ? "first" : l + 1 === a.length ? "last" : "middle"), h;
1147
1162
  },
1148
- [s]
1149
- ), { userLabel: d = "" } = C(), c = () => /* @__PURE__ */ n(N, { children: s.map((l) => {
1150
- const { key: h, body: v, title: $, form: z, actions: y } = l, O = !!v && !$ && !z && !y;
1163
+ [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;
1151
1166
  return /* @__PURE__ */ n(
1152
- Je,
1167
+ Qe,
1153
1168
  {
1154
1169
  className: t,
1155
1170
  discrete: O,
1156
- ref: a,
1171
+ ref: r,
1157
1172
  timestamp: e,
1158
- fullWidth: !!z || !!y,
1159
- children: O && v ? /* @__PURE__ */ n(G, { html: v }) : /* @__PURE__ */ n(q, { isSystem: !0, content: l })
1173
+ fullWidth: !!z || !!p,
1174
+ children: O && v ? /* @__PURE__ */ n(J, { html: v }) : /* @__PURE__ */ n(U, { isSystem: !0, content: l })
1160
1175
  },
1161
1176
  h
1162
1177
  );
1163
- }) }), p = () => /* @__PURE__ */ u(N, { children: [
1164
- /* @__PURE__ */ n(re, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: r == null ? void 0 : r.name, timestamp: e }) }),
1178
+ }) }), y = () => /* @__PURE__ */ u(N, { children: [
1179
+ /* @__PURE__ */ n(oe, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: o == null ? void 0 : o.name, timestamp: e }) }),
1165
1180
  /* @__PURE__ */ n(
1166
- he,
1181
+ ge,
1167
1182
  {
1168
- sender: r,
1183
+ sender: o,
1169
1184
  timestamp: e,
1170
1185
  className: t,
1171
- children: /* @__PURE__ */ n(V, { className: "humany-message-content-bundle", children: s.map((l, h) => /* @__PURE__ */ n(
1172
- _,
1186
+ children: /* @__PURE__ */ n(_, { className: "humany-message-content-bundle", children: a.map((l, h) => /* @__PURE__ */ n(
1187
+ F,
1173
1188
  {
1174
1189
  className: "humany-message-container",
1175
1190
  left: !0,
1176
- ref: a,
1191
+ ref: r,
1177
1192
  children: /* @__PURE__ */ n(
1178
- q,
1193
+ U,
1179
1194
  {
1180
1195
  content: l,
1181
1196
  stacked: m(h)
@@ -1187,15 +1202,15 @@ const Ae = ({ className: t }) => {
1187
1202
  }
1188
1203
  )
1189
1204
  ] }), x = () => /* @__PURE__ */ u(N, { children: [
1190
- /* @__PURE__ */ n(re, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: d, timestamp: e }) }),
1191
- /* @__PURE__ */ n(et, { timestamp: e, className: t, children: /* @__PURE__ */ n(V, { className: "humany-message-content-bundle", children: s.map((l, h) => /* @__PURE__ */ n(
1192
- _,
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,
1193
1208
  {
1194
1209
  className: "humany-message-container",
1195
1210
  right: !0,
1196
- ref: a,
1211
+ ref: r,
1197
1212
  children: /* @__PURE__ */ n(
1198
- q,
1213
+ U,
1199
1214
  {
1200
1215
  isUser: !0,
1201
1216
  content: l,
@@ -1206,65 +1221,65 @@ const Ae = ({ className: t }) => {
1206
1221
  l.key
1207
1222
  )) }) })
1208
1223
  ] });
1209
- switch (o) {
1210
- case W.System:
1211
- return c();
1212
- case W.Agent:
1213
- return p();
1214
- case W.User:
1224
+ switch (s) {
1225
+ case q.System:
1226
+ return d();
1227
+ case q.Agent:
1228
+ return y();
1229
+ case q.User:
1215
1230
  return x();
1216
1231
  default:
1217
1232
  return null;
1218
1233
  }
1219
1234
  }
1220
- ), q = ({
1235
+ ), U = ({
1221
1236
  content: t,
1222
1237
  isUser: e,
1223
- isSystem: r,
1224
- stacked: o
1238
+ isSystem: o,
1239
+ stacked: s
1225
1240
  }) => {
1226
- const s = Y(), { title: a, body: m, actions: d, form: c, items: p } = t;
1227
- return p ? /* @__PURE__ */ n(
1228
- F,
1241
+ const a = X(), { title: r, body: m, actions: c, form: d, items: y } = t;
1242
+ return y ? /* @__PURE__ */ n(
1243
+ Y,
1229
1244
  {
1230
1245
  className: "humany-message-content",
1231
1246
  user: !!e,
1232
- stacked: o,
1233
- children: /* @__PURE__ */ n(wt, { items: p, dispatch: s })
1247
+ stacked: s,
1248
+ children: /* @__PURE__ */ n(wt, { items: y, dispatch: a })
1234
1249
  }
1235
1250
  ) : /* @__PURE__ */ u(
1236
- F,
1251
+ Y,
1237
1252
  {
1238
1253
  className: "humany-message-content",
1239
- padded: !r,
1254
+ padded: !o,
1240
1255
  user: !!e,
1241
- stacked: o,
1242
- fullWidth: !!c || !!d,
1256
+ stacked: s,
1257
+ fullWidth: !!d || !!c,
1243
1258
  children: [
1244
- a && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(We, { variant: "h2", children: a }) }),
1245
- m && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(_e, { html: m }) }),
1246
- c && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
1247
- Ve,
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(
1262
+ _e,
1248
1263
  {
1249
- ...c,
1264
+ ...d,
1250
1265
  onChange: (l, h) => {
1251
- s("form", {
1266
+ a("form", {
1252
1267
  data: h,
1253
- formKey: c.schema.id,
1268
+ formKey: d.schema.id,
1254
1269
  actionKey: l
1255
1270
  });
1256
1271
  }
1257
1272
  }
1258
1273
  ) }),
1259
- d && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
1260
- Fe,
1274
+ c && /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
1275
+ Ye,
1261
1276
  {
1262
- items: Object.keys(d).map((l) => ({ label: d[l], actionKey: l })),
1277
+ items: Object.keys(c).map((l) => ({ label: c[l], actionKey: l })),
1263
1278
  renderItem: (l) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1264
- Ye,
1279
+ Xe,
1265
1280
  {
1266
1281
  onClick: () => {
1267
- s("action", l.actionKey);
1282
+ a("action", l.actionKey);
1268
1283
  },
1269
1284
  children: l.label
1270
1285
  }
@@ -1274,7 +1289,7 @@ const Ae = ({ className: t }) => {
1274
1289
  ]
1275
1290
  }
1276
1291
  );
1277
- }, re = i.div`
1292
+ }, oe = i.div`
1278
1293
  position: absolute !important;
1279
1294
  height: 1px;
1280
1295
  width: 1px;
@@ -1284,23 +1299,23 @@ const Ae = ({ className: t }) => {
1284
1299
  left: -10000000px;
1285
1300
  top: auto;
1286
1301
  `, zt = () => {
1287
- const { skipToLatestMessageLabel: t = "Skip to latest message" } = C(), e = T(), r = () => {
1288
- const o = e.get("widgetDOMElement");
1289
- if (o) {
1290
- const s = o.querySelectorAll(
1302
+ const { skipToLatestMessageLabel: t = "Skip to latest message" } = C(), e = T(), o = () => {
1303
+ const s = e.get("widgetDOMElement");
1304
+ if (s) {
1305
+ const a = s.querySelectorAll(
1291
1306
  ".humany-conversation-entry"
1292
1307
  );
1293
- s.length && s[s.length - 1].focus();
1308
+ a.length && a[a.length - 1].focus();
1294
1309
  }
1295
1310
  };
1296
1311
  return /* @__PURE__ */ n(
1297
1312
  Lt,
1298
1313
  {
1299
1314
  className: "humany-skip-to-latest-message",
1300
- onKeyDown: (o) => {
1301
- (o.key === "Enter" || o.keyCode === 13) && r();
1315
+ onKeyDown: (s) => {
1316
+ (s.key === "Enter" || s.keyCode === 13) && o();
1302
1317
  },
1303
- onClick: r,
1318
+ onClick: o,
1304
1319
  children: t
1305
1320
  }
1306
1321
  );
@@ -1324,50 +1339,50 @@ const Ae = ({ className: t }) => {
1324
1339
  transform: translateX(-50%);
1325
1340
  ${f};
1326
1341
  }
1327
- `, ge = () => {
1328
- const t = de((d) => {
1329
- d && setTimeout(() => {
1330
- d.scrollIntoView({
1342
+ `, fe = () => {
1343
+ const t = me((c) => {
1344
+ c && setTimeout(() => {
1345
+ c.scrollIntoView({
1331
1346
  block: "start",
1332
1347
  behavior: "smooth"
1333
1348
  });
1334
1349
  }, 250);
1335
- }, []), [e, r] = ae(!0), {
1336
- messages: o,
1337
- loading: s,
1338
- typingActors: a = []
1339
- } = C(), m = () => a && a.length ? a.map((d, c) => /* @__PURE__ */ n(
1340
- U,
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,
1341
1356
  {
1342
- id: `typing_${d.name}`,
1343
- children: /* @__PURE__ */ n(he, { timestamp: Date.now(), sender: d, children: /* @__PURE__ */ n(
1344
- te,
1357
+ id: `typing_${c.name}`,
1358
+ children: /* @__PURE__ */ n(ge, { timestamp: Date.now(), sender: c, children: /* @__PURE__ */ n(
1359
+ ne,
1345
1360
  {
1346
1361
  boxed: !0,
1347
1362
  ref: t
1348
1363
  }
1349
1364
  ) })
1350
1365
  },
1351
- `typing_${d.name}`
1366
+ `typing_${c.name}`
1352
1367
  )) : null;
1353
1368
  return /* @__PURE__ */ u(N, { children: [
1354
- /* @__PURE__ */ u(Nt, { tabIndex: 0, scrollableCss: e, ref: r, children: [
1355
- o && o.length ? o.map((d, c) => {
1356
- const { type: p, timestamp: x, sender: l, content: h } = d;
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;
1357
1372
  return /* @__PURE__ */ n(
1358
- U,
1373
+ V,
1359
1374
  {
1360
1375
  className: "humany-conversation-entry",
1361
1376
  tabIndex: -1,
1362
- children: /* @__PURE__ */ n(St, { ...d, ref: t })
1377
+ children: /* @__PURE__ */ n(St, { ...c, ref: t })
1363
1378
  },
1364
- `${p}_${l == null ? void 0 : l.name}_${x}_${h[0].key}`
1379
+ `${y}_${l == null ? void 0 : l.name}_${x}_${h[0].key}`
1365
1380
  );
1366
1381
  }) : null,
1367
1382
  m(),
1368
- s && /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(te, { ref: t }) })
1383
+ a && /* @__PURE__ */ n(V, { children: /* @__PURE__ */ n(ne, { ref: t }) })
1369
1384
  ] }),
1370
- /* @__PURE__ */ n(Ae, {}),
1385
+ /* @__PURE__ */ n(Oe, {}),
1371
1386
  /* @__PURE__ */ n(zt, {})
1372
1387
  ] });
1373
1388
  }, Nt = i.div`
@@ -1383,7 +1398,7 @@ const Ae = ({ className: t }) => {
1383
1398
  &:focus-visible {
1384
1399
  ${(t) => f(t)};
1385
1400
  }
1386
- `, U = i.div`
1401
+ `, V = i.div`
1387
1402
  margin: 0;
1388
1403
  margin-bottom: ${(t) => {
1389
1404
  var e;
@@ -1423,18 +1438,18 @@ const Ae = ({ className: t }) => {
1423
1438
  return (e = t.theme.sizes) == null ? void 0 : e.small;
1424
1439
  }};
1425
1440
  }
1426
- ${(t) => J(t)(
1441
+ ${(t) => Q(t)(
1427
1442
  "h1",
1428
1443
  b`
1429
1444
  font-weight: normal;
1430
1445
  `
1431
1446
  )}
1432
1447
  `, Mt = ({ dispatch: t }) => {
1433
- const e = ce(null);
1434
- return Q(() => {
1448
+ const e = de(null);
1449
+ return Z(() => {
1435
1450
  e.current && e.current.parentNode && t("overlay-mounted", e.current);
1436
1451
  }, [e]), /* @__PURE__ */ n(
1437
- le,
1452
+ ce,
1438
1453
  {
1439
1454
  portalId: "humany-conversation-overlay-portal",
1440
1455
  className: "humany-conversation-overlay-outlet",
@@ -1444,20 +1459,20 @@ const Ae = ({ className: t }) => {
1444
1459
  }, It = ({
1445
1460
  dispatch: t,
1446
1461
  header: e,
1447
- buttonLabel: r
1462
+ buttonLabel: o
1448
1463
  }) => /* @__PURE__ */ u(
1449
- Ht,
1464
+ At,
1450
1465
  {
1451
1466
  portalId: "humany-conversation-portal",
1452
1467
  className: "humany-conversation-outlet",
1453
1468
  children: [
1454
- /* @__PURE__ */ u(Tt, { className: "humany-conversation-outlet-head", children: [
1469
+ /* @__PURE__ */ u(Ht, { className: "humany-conversation-outlet-head", children: [
1455
1470
  /* @__PURE__ */ n(
1456
1471
  Ot,
1457
1472
  {
1458
1473
  className: "humany-conversation-outlet-head-button",
1459
- "aria-label": r,
1460
- title: r,
1474
+ "aria-label": o,
1475
+ title: o,
1461
1476
  onClick: () => t("hide-overlay-conversation"),
1462
1477
  children: /* @__PURE__ */ n(
1463
1478
  k,
@@ -1472,7 +1487,7 @@ const Ae = ({ className: t }) => {
1472
1487
  }
1473
1488
  ),
1474
1489
  e && /* @__PURE__ */ n(
1475
- At,
1490
+ Tt,
1476
1491
  {
1477
1492
  className: "humany-conversation-outlet-header",
1478
1493
  variant: "h1",
@@ -1480,10 +1495,10 @@ const Ae = ({ className: t }) => {
1480
1495
  }
1481
1496
  )
1482
1497
  ] }),
1483
- /* @__PURE__ */ n(ge, {})
1498
+ /* @__PURE__ */ n(fe, {})
1484
1499
  ]
1485
1500
  }
1486
- ), Ht = i(le)`
1501
+ ), At = i(ce)`
1487
1502
  z-index: 11;
1488
1503
  top: auto;
1489
1504
  height: 65%;
@@ -1498,7 +1513,7 @@ const Ae = ({ className: t }) => {
1498
1513
  var e;
1499
1514
  return (e = t.theme.sizes) == null ? void 0 : e.large;
1500
1515
  }};
1501
- `, Tt = i.div`
1516
+ `, Ht = i.div`
1502
1517
  display: flex;
1503
1518
  flex-direction: column;
1504
1519
  justify-content: center;
@@ -1512,7 +1527,7 @@ const Ae = ({ className: t }) => {
1512
1527
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
1513
1528
  }};
1514
1529
  ${(t) => t.theme.border && `border-bottom: ${t.theme.border};`}
1515
- `, At = i(X)`
1530
+ `, Tt = i(G)`
1516
1531
  font-size: ${(t) => {
1517
1532
  var e;
1518
1533
  return (e = t.theme.fonts) == null ? void 0 : e.medium;
@@ -1547,16 +1562,16 @@ const Ae = ({ className: t }) => {
1547
1562
  }
1548
1563
  `, Ft = ({ className: t, ...e }) => {
1549
1564
  const {
1550
- overlay: r,
1551
- overlayConversationHeader: o,
1552
- overlayConversationCloseLabel: s,
1553
- conversationControllerId: a
1554
- } = C(), m = Y(), c = T().get("$settings");
1565
+ overlay: o,
1566
+ overlayConversationHeader: s,
1567
+ overlayConversationCloseLabel: a,
1568
+ conversationControllerId: r
1569
+ } = C(), m = X(), d = T().get("$settings");
1555
1570
  return /* @__PURE__ */ n(
1556
- Se.Provider,
1571
+ ze.Provider,
1557
1572
  {
1558
- value: a ? { id: a } : null,
1559
- children: /* @__PURE__ */ u(ue.Provider, { value: c == null ? void 0 : c.language, children: [
1573
+ value: r ? { id: r } : null,
1574
+ children: /* @__PURE__ */ u(he.Provider, { value: d == null ? void 0 : d.language, children: [
1560
1575
  /* @__PURE__ */ n(
1561
1576
  Rt,
1562
1577
  {
@@ -1566,17 +1581,17 @@ const Ae = ({ className: t }) => {
1566
1581
  t,
1567
1582
  "humany-conversation-component"
1568
1583
  ),
1569
- children: /* @__PURE__ */ n(ge, {})
1584
+ children: /* @__PURE__ */ n(fe, {})
1570
1585
  }
1571
1586
  ),
1572
- r && /* @__PURE__ */ u(N, { children: [
1587
+ o && /* @__PURE__ */ u(N, { children: [
1573
1588
  /* @__PURE__ */ n(Mt, { dispatch: m }),
1574
- r.conversation && /* @__PURE__ */ n(
1589
+ o.conversation && /* @__PURE__ */ n(
1575
1590
  It,
1576
1591
  {
1577
1592
  dispatch: m,
1578
- header: o,
1579
- buttonLabel: s
1593
+ header: s,
1594
+ buttonLabel: a
1580
1595
  }
1581
1596
  )
1582
1597
  ] })