@telia-ace/widget-conversation 1.3.0-rc.9 → 1.3.1
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,75 +1,75 @@
|
|
|
1
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
|
|
3
|
+
import { Input as se, borderTabStyle as p, Button as A, SymbolBadge as w, useIsTabbing as ae, useDispatch as G, useProperties as C, useScroll as ie, useContainer as I, Typography as J, invertedHoverButton as xe, Html as Q, List as le, buttonCss as R, 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
4
|
import { appendClassNames as H, htmlParentContains as Ne } from "@telia-ace/widget-utilities";
|
|
5
|
-
import { css as
|
|
6
|
-
import de, { useState as q, useEffect as j, forwardRef as ee, useContext as
|
|
5
|
+
import { css as v, 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
|
|
8
|
+
import { ConversationMessageListItemType as S, 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, r] = q(""), [s, a] = q(0), [o, d] = q(0),
|
|
14
|
-
inputPlaceholder:
|
|
15
|
-
inputHidden:
|
|
16
|
-
inputDisabled:
|
|
17
|
-
sendButtonLabel:
|
|
18
|
-
inputMultiline:
|
|
13
|
+
const [e, r] = q(""), [s, a] = q(0), [o, d] = q(0), m = ae(), c = G(), {
|
|
14
|
+
inputPlaceholder: f = "Type your message",
|
|
15
|
+
inputHidden: x = !1,
|
|
16
|
+
inputDisabled: l = !1,
|
|
17
|
+
sendButtonLabel: u = "Send message",
|
|
18
|
+
inputMultiline: b = !0,
|
|
19
19
|
secondaryAction: $
|
|
20
|
-
} =
|
|
20
|
+
} = C(), [k, y] = ie(!0), O = I();
|
|
21
21
|
j(() => {
|
|
22
|
-
if (
|
|
23
|
-
const { lineHeight:
|
|
24
|
-
if (
|
|
25
|
-
const T =
|
|
22
|
+
if (y.current) {
|
|
23
|
+
const { lineHeight: g, maxHeight: z } = getComputedStyle(y.current);
|
|
24
|
+
if (g && g.indexOf("px") > -1) {
|
|
25
|
+
const T = g.split("px"), $e = parseInt(T[0], 10);
|
|
26
26
|
a($e);
|
|
27
|
-
const ve =
|
|
27
|
+
const ve = z.split("px");
|
|
28
28
|
d(parseInt(ve[0], 10));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
}, [
|
|
32
|
-
const P = (
|
|
33
|
-
!
|
|
34
|
-
}, pe = (
|
|
31
|
+
}, [y.current]);
|
|
32
|
+
const P = (g) => {
|
|
33
|
+
!g.shiftKey || !b ? (g.preventDefault(), e && e.length > 0 && (c("user-submit", { text: e }), r(""), W(""))) : e.length < 1 && g.preventDefault();
|
|
34
|
+
}, pe = (g) => {
|
|
35
35
|
if (!$)
|
|
36
36
|
return;
|
|
37
|
-
|
|
37
|
+
g.preventDefault(), c("action", {
|
|
38
38
|
actionKey: $.action,
|
|
39
39
|
...$
|
|
40
40
|
});
|
|
41
|
-
const { events:
|
|
42
|
-
|
|
43
|
-
}, be = (
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
let T =
|
|
49
|
-
|
|
41
|
+
const { events: z } = O.get("$widget");
|
|
42
|
+
z.dispatch("tracking:secondary-clicked", {});
|
|
43
|
+
}, be = (g) => {
|
|
44
|
+
if (b && y.current) {
|
|
45
|
+
const z = y.current.scrollHeight;
|
|
46
|
+
if (z > s) {
|
|
47
|
+
y.current.style.height = "auto";
|
|
48
|
+
let T = z;
|
|
49
|
+
g.length < 1 && (T = s), y.current.style.height = `${T}px`, T >= o ? y.current.style.overflowY = "scroll" : y.current.style.overflowY = "hidden";
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
}, W = (
|
|
53
|
-
be(
|
|
52
|
+
}, W = (g) => {
|
|
53
|
+
be(g), r(g), g && g.length > 0 && c("user-typing", { textLength: g.length });
|
|
54
54
|
};
|
|
55
|
-
return
|
|
55
|
+
return x ? null : /* @__PURE__ */ h(
|
|
56
56
|
Ke,
|
|
57
57
|
{
|
|
58
|
-
grow:
|
|
58
|
+
grow: b,
|
|
59
59
|
className: H("humany-conversation-input", t),
|
|
60
|
-
scrollableCss:
|
|
61
|
-
isTabbing:
|
|
60
|
+
scrollableCss: k,
|
|
61
|
+
isTabbing: m,
|
|
62
62
|
children: [
|
|
63
63
|
$ && /* @__PURE__ */ n(
|
|
64
|
-
|
|
64
|
+
Re,
|
|
65
65
|
{
|
|
66
66
|
className: "humany-secondary-button",
|
|
67
|
-
disabled:
|
|
67
|
+
disabled: l,
|
|
68
68
|
onClick: pe,
|
|
69
69
|
title: $.label,
|
|
70
70
|
"aria-label": $.label,
|
|
71
71
|
children: /* @__PURE__ */ n(
|
|
72
|
-
|
|
72
|
+
w,
|
|
73
73
|
{
|
|
74
74
|
size: 24,
|
|
75
75
|
symbol: { type: "Svg", content: $.icon || "browse" }
|
|
@@ -77,28 +77,28 @@ const Oe = ({ className: t }) => {
|
|
|
77
77
|
)
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
b ? /* @__PURE__ */ n(
|
|
81
|
+
Be,
|
|
82
82
|
{
|
|
83
83
|
value: e,
|
|
84
84
|
onChange: W,
|
|
85
85
|
onEnter: P,
|
|
86
|
-
disabled:
|
|
87
|
-
"aria-label":
|
|
88
|
-
placeholder:
|
|
86
|
+
disabled: l,
|
|
87
|
+
"aria-label": f,
|
|
88
|
+
placeholder: f,
|
|
89
89
|
type: "textarea",
|
|
90
90
|
rows: 1,
|
|
91
|
-
ref:
|
|
91
|
+
ref: y
|
|
92
92
|
}
|
|
93
93
|
) : /* @__PURE__ */ n(
|
|
94
|
-
|
|
94
|
+
Ee,
|
|
95
95
|
{
|
|
96
96
|
value: e,
|
|
97
97
|
onChange: W,
|
|
98
98
|
onEnter: P,
|
|
99
|
-
disabled:
|
|
100
|
-
"aria-label":
|
|
101
|
-
placeholder:
|
|
99
|
+
disabled: l,
|
|
100
|
+
"aria-label": f,
|
|
101
|
+
placeholder: f
|
|
102
102
|
}
|
|
103
103
|
),
|
|
104
104
|
/* @__PURE__ */ n(
|
|
@@ -107,8 +107,8 @@ const Oe = ({ className: t }) => {
|
|
|
107
107
|
className: "humany-send-button",
|
|
108
108
|
disabled: !1,
|
|
109
109
|
onClick: P,
|
|
110
|
-
title:
|
|
111
|
-
"aria-label":
|
|
110
|
+
title: u,
|
|
111
|
+
"aria-label": u,
|
|
112
112
|
children: /* @__PURE__ */ n(
|
|
113
113
|
De,
|
|
114
114
|
{
|
|
@@ -122,7 +122,7 @@ const Oe = ({ className: t }) => {
|
|
|
122
122
|
]
|
|
123
123
|
}
|
|
124
124
|
);
|
|
125
|
-
},
|
|
125
|
+
}, Be = 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
|
-
${
|
|
146
|
+
${p};
|
|
147
147
|
outline-offset: 12px;
|
|
148
148
|
}
|
|
149
|
-
`,
|
|
149
|
+
`, Ee = 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
|
-
`, he = 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
|
-
${
|
|
185
|
+
${p};
|
|
186
186
|
}
|
|
187
|
-
`,
|
|
187
|
+
`, Re = 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
193
|
`, Ke = i.div`
|
|
194
|
-
${(t) => t.grow ?
|
|
194
|
+
${(t) => t.grow ? v`
|
|
195
195
|
min-height: 50px;
|
|
196
196
|
max-height: 150px;
|
|
197
|
-
` :
|
|
197
|
+
` : v`
|
|
198
198
|
height: 50px;
|
|
199
199
|
`}
|
|
200
200
|
flex: 0 0 auto;
|
|
@@ -205,7 +205,7 @@ 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 &&
|
|
208
|
+
${(t) => t["data-has-focus"] && t.isTabbing && p}
|
|
209
209
|
textarea {
|
|
210
210
|
${(t) => !!t.scrollableCss && t.scrollableCss}
|
|
211
211
|
}
|
|
@@ -213,7 +213,7 @@ const Oe = ({ className: t }) => {
|
|
|
213
213
|
({
|
|
214
214
|
hasContent: t,
|
|
215
215
|
...e
|
|
216
|
-
}) => /* @__PURE__ */ n(
|
|
216
|
+
}) => /* @__PURE__ */ n(w, { ...e })
|
|
217
217
|
)`
|
|
218
218
|
line,
|
|
219
219
|
path {
|
|
@@ -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 r =
|
|
346
|
+
const r = v`
|
|
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 ?
|
|
351
|
+
return e.borderRadius ? v`
|
|
352
352
|
${r}
|
|
353
353
|
|
|
354
354
|
border-top-right-radius: ${e.borderRadius};
|
|
@@ -364,11 +364,11 @@ const Oe = ({ className: t }) => {
|
|
|
364
364
|
` : r;
|
|
365
365
|
}, Ve = (t, e) => {
|
|
366
366
|
var s, a;
|
|
367
|
-
const r =
|
|
367
|
+
const r = v`
|
|
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 ?
|
|
371
|
+
return e.borderRadius ? v`
|
|
372
372
|
${r}
|
|
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
|
` : r;
|
|
385
|
-
},
|
|
385
|
+
}, B = 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
|
-
`,
|
|
393
|
+
`, L = (t) => {
|
|
394
394
|
var e, r;
|
|
395
|
-
return
|
|
395
|
+
return v`
|
|
396
396
|
margin: ${(e = t.theme.sizes) == null ? void 0 : e.medium} 0;
|
|
397
397
|
padding: 0 ${(r = t.theme.sizes) == null ? void 0 : r.medium};
|
|
398
398
|
`;
|
|
@@ -431,7 +431,7 @@ const Oe = ({ className: t }) => {
|
|
|
431
431
|
&:focus {
|
|
432
432
|
${(t) => {
|
|
433
433
|
var e;
|
|
434
|
-
return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) &&
|
|
434
|
+
return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) && p;
|
|
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) =>
|
|
452
|
+
${(t) => R(t)};
|
|
453
453
|
display: block;
|
|
454
454
|
background-color: ${(t) => {
|
|
455
455
|
var e;
|
|
@@ -458,7 +458,7 @@ const Oe = ({ className: t }) => {
|
|
|
458
458
|
width: 100%;
|
|
459
459
|
color: #fff;
|
|
460
460
|
&:focus-visible {
|
|
461
|
-
${
|
|
461
|
+
${p}
|
|
462
462
|
background-color: transparent;
|
|
463
463
|
}
|
|
464
464
|
`, ne = ee(
|
|
@@ -498,7 +498,7 @@ const Oe = ({ className: t }) => {
|
|
|
498
498
|
timestamp: r,
|
|
499
499
|
ariaHidden: s = !1
|
|
500
500
|
}) => {
|
|
501
|
-
const a =
|
|
501
|
+
const a = Ae(ge);
|
|
502
502
|
if (!e && !r)
|
|
503
503
|
return null;
|
|
504
504
|
let o = "";
|
|
@@ -509,7 +509,7 @@ const Oe = ({ className: t }) => {
|
|
|
509
509
|
sender: r,
|
|
510
510
|
timestamp: s
|
|
511
511
|
}) => {
|
|
512
|
-
const { avatar: a, name: o } = r, { avatarSize: d } =
|
|
512
|
+
const { avatar: a, name: o } = r, { avatarSize: d, avatarLabel: m = "Avatar" } = C();
|
|
513
513
|
return /* @__PURE__ */ h(
|
|
514
514
|
Je,
|
|
515
515
|
{
|
|
@@ -521,8 +521,8 @@ const Oe = ({ className: t }) => {
|
|
|
521
521
|
children: [
|
|
522
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 })
|
|
525
|
-
) : /* @__PURE__ */ n(
|
|
524
|
+
/* @__PURE__ */ n("img", { src: a, alt: m })
|
|
525
|
+
) : /* @__PURE__ */ n(w, { symbol: a }) }),
|
|
526
526
|
e,
|
|
527
527
|
/* @__PURE__ */ n(
|
|
528
528
|
M,
|
|
@@ -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 ?
|
|
542
|
+
${(t) => t.hasAvatar ? v`
|
|
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
|
-
` :
|
|
548
|
+
` : v`
|
|
549
549
|
grid-template-columns: 1fr;
|
|
550
550
|
grid-template-rows: 1fr auto;
|
|
551
551
|
grid-template-areas:
|
|
@@ -593,7 +593,7 @@ const Oe = ({ className: t }) => {
|
|
|
593
593
|
margin: 0;
|
|
594
594
|
}
|
|
595
595
|
`, tt = ({ className: t, children: e, timestamp: r }) => {
|
|
596
|
-
const { userLabel: s = "" } =
|
|
596
|
+
const { userLabel: s = "" } = C();
|
|
597
597
|
return /* @__PURE__ */ h(
|
|
598
598
|
nt,
|
|
599
599
|
{
|
|
@@ -624,7 +624,7 @@ const Oe = ({ className: t }) => {
|
|
|
624
624
|
label: t[e],
|
|
625
625
|
actionKey: e
|
|
626
626
|
})), ot = ({ header: t, actions: e, dispatch: r }) => {
|
|
627
|
-
const s =
|
|
627
|
+
const s = I(), { events: a } = s.get("$widget");
|
|
628
628
|
return /* @__PURE__ */ n(
|
|
629
629
|
rt,
|
|
630
630
|
{
|
|
@@ -632,8 +632,8 @@ const Oe = ({ className: t }) => {
|
|
|
632
632
|
header: t,
|
|
633
633
|
items: te(e),
|
|
634
634
|
renderItem: (o) => {
|
|
635
|
-
var
|
|
636
|
-
const d = !!((
|
|
635
|
+
var m;
|
|
636
|
+
const d = !!((m = o == null ? void 0 : o.data) != null && m.href);
|
|
637
637
|
return /* @__PURE__ */ n("li", { children: d ? /* @__PURE__ */ h(
|
|
638
638
|
st,
|
|
639
639
|
{
|
|
@@ -642,7 +642,7 @@ const Oe = ({ className: t }) => {
|
|
|
642
642
|
"aria-label": o.label,
|
|
643
643
|
title: o.label,
|
|
644
644
|
children: [
|
|
645
|
-
/* @__PURE__ */ n(
|
|
645
|
+
/* @__PURE__ */ n(w, { symbol: o.symbol }),
|
|
646
646
|
o.label
|
|
647
647
|
]
|
|
648
648
|
}
|
|
@@ -655,7 +655,7 @@ const Oe = ({ className: t }) => {
|
|
|
655
655
|
"aria-label": o.label,
|
|
656
656
|
title: o.label,
|
|
657
657
|
children: [
|
|
658
|
-
/* @__PURE__ */ n(
|
|
658
|
+
/* @__PURE__ */ n(w, { symbol: o.symbol }),
|
|
659
659
|
o.label
|
|
660
660
|
]
|
|
661
661
|
}
|
|
@@ -676,9 +676,9 @@ const Oe = ({ className: t }) => {
|
|
|
676
676
|
margin: 0;
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
|
-
${
|
|
679
|
+
${L}
|
|
680
680
|
`, st = i(ke)`
|
|
681
|
-
${
|
|
681
|
+
${R};
|
|
682
682
|
|
|
683
683
|
display: block;
|
|
684
684
|
padding: ${(t) => {
|
|
@@ -694,7 +694,7 @@ const Oe = ({ className: t }) => {
|
|
|
694
694
|
overflow: hidden;
|
|
695
695
|
text-overflow: ellipsis;
|
|
696
696
|
&:focus-visible {
|
|
697
|
-
${
|
|
697
|
+
${p}
|
|
698
698
|
background-color: transparent;
|
|
699
699
|
}
|
|
700
700
|
|
|
@@ -705,8 +705,8 @@ const Oe = ({ className: t }) => {
|
|
|
705
705
|
return (e = t.theme.sizes) == null ? void 0 : e.small;
|
|
706
706
|
}};
|
|
707
707
|
}
|
|
708
|
-
`, at = i(
|
|
709
|
-
${
|
|
708
|
+
`, at = i(A)`
|
|
709
|
+
${R};
|
|
710
710
|
|
|
711
711
|
display: block;
|
|
712
712
|
padding: ${(t) => {
|
|
@@ -722,7 +722,7 @@ const Oe = ({ className: t }) => {
|
|
|
722
722
|
overflow: hidden;
|
|
723
723
|
text-overflow: ellipsis;
|
|
724
724
|
&:focus-visible {
|
|
725
|
-
${
|
|
725
|
+
${p}
|
|
726
726
|
background-color: transparent;
|
|
727
727
|
}
|
|
728
728
|
|
|
@@ -735,16 +735,16 @@ const Oe = ({ className: t }) => {
|
|
|
735
735
|
}
|
|
736
736
|
`, it = ({ type: t, content: e = {} }) => {
|
|
737
737
|
const r = we(t);
|
|
738
|
-
return !r || !t ? null : /* @__PURE__ */ n(
|
|
738
|
+
return !r || !t ? null : /* @__PURE__ */ n(Ie, { fallback: null, children: /* @__PURE__ */ n(r, { ...e }) });
|
|
739
739
|
}, lt = ({ body: t }) => /* @__PURE__ */ n(ct, { className: "humany-html", html: t }), ct = i(Q)`
|
|
740
740
|
${Se}
|
|
741
741
|
color: inherit;
|
|
742
742
|
white-space: normal;
|
|
743
|
-
${
|
|
743
|
+
${L}
|
|
744
744
|
a {
|
|
745
745
|
color: ${(t) => t.theme.colors.link};
|
|
746
746
|
&:focus-visible {
|
|
747
|
-
${
|
|
747
|
+
${p};
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
750
|
p {
|
|
@@ -760,7 +760,7 @@ const Oe = ({ className: t }) => {
|
|
|
760
760
|
var a;
|
|
761
761
|
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ut, { children: [
|
|
762
762
|
((a = s.symbol) == null ? void 0 : a.content) && /* @__PURE__ */ n("div", { className: "item-icon", children: /* @__PURE__ */ n(
|
|
763
|
-
|
|
763
|
+
w,
|
|
764
764
|
{
|
|
765
765
|
size: 22,
|
|
766
766
|
symbol: {
|
|
@@ -771,7 +771,7 @@ const Oe = ({ className: t }) => {
|
|
|
771
771
|
) }),
|
|
772
772
|
/* @__PURE__ */ h("div", { className: "item-body", children: [
|
|
773
773
|
/* @__PURE__ */ n(
|
|
774
|
-
|
|
774
|
+
A,
|
|
775
775
|
{
|
|
776
776
|
onClick: () => {
|
|
777
777
|
r("action", s);
|
|
@@ -790,7 +790,7 @@ const Oe = ({ className: t }) => {
|
|
|
790
790
|
${D}
|
|
791
791
|
|
|
792
792
|
> .humany-paragraph {
|
|
793
|
-
${
|
|
793
|
+
${L}
|
|
794
794
|
margin-bottom: 0;
|
|
795
795
|
|
|
796
796
|
h1 {
|
|
@@ -800,7 +800,7 @@ const Oe = ({ className: t }) => {
|
|
|
800
800
|
|
|
801
801
|
${(t) => Z(t)(
|
|
802
802
|
"h1",
|
|
803
|
-
|
|
803
|
+
v`
|
|
804
804
|
white-space: normal;
|
|
805
805
|
`
|
|
806
806
|
)}
|
|
@@ -830,7 +830,7 @@ const Oe = ({ className: t }) => {
|
|
|
830
830
|
var e;
|
|
831
831
|
return (e = t.theme.sizes) == null ? void 0 : e.medium;
|
|
832
832
|
}};
|
|
833
|
-
${
|
|
833
|
+
${L}
|
|
834
834
|
|
|
835
835
|
.item-icon {
|
|
836
836
|
}
|
|
@@ -863,7 +863,7 @@ const Oe = ({ className: t }) => {
|
|
|
863
863
|
margin: 0;
|
|
864
864
|
|
|
865
865
|
&:focus-visible {
|
|
866
|
-
${
|
|
866
|
+
${p}
|
|
867
867
|
span {
|
|
868
868
|
color: ${(t) => {
|
|
869
869
|
var e;
|
|
@@ -874,31 +874,31 @@ const Oe = ({ className: t }) => {
|
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
`, ht = ({ header: t, actions: e, dispatch: r }) => {
|
|
877
|
-
const s = Ce(e), a = me(), o = ae(), d =
|
|
877
|
+
const s = Ce(e), a = me(), o = ae(), d = I(), { events: m } = d.get("$widget");
|
|
878
878
|
return j(() => {
|
|
879
879
|
if (s && Array.isArray(e) && Array.isArray(s) && s.length < e.length && a.current) {
|
|
880
|
-
const
|
|
880
|
+
const c = a.current.querySelectorAll(
|
|
881
881
|
".humany-conversation-link-list > ul > li"
|
|
882
|
-
),
|
|
883
|
-
if (
|
|
884
|
-
const
|
|
885
|
-
if (
|
|
886
|
-
const
|
|
882
|
+
), f = c[s.length];
|
|
883
|
+
if (c.length === e.length && s.length) {
|
|
884
|
+
const x = c[s.length - 1];
|
|
885
|
+
if (x) {
|
|
886
|
+
const l = x.querySelector(
|
|
887
887
|
".humany-button"
|
|
888
888
|
);
|
|
889
|
-
|
|
889
|
+
l && l.focus();
|
|
890
890
|
}
|
|
891
891
|
} else
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
if (
|
|
892
|
+
f && new MutationObserver((l, u) => {
|
|
893
|
+
l.forEach((b) => {
|
|
894
|
+
if (b.addedNodes) {
|
|
895
895
|
const $ = Array.from(
|
|
896
|
-
|
|
897
|
-
).find((
|
|
898
|
-
$ && Ne(a.current, document.activeElement) && (o && $.focus(),
|
|
896
|
+
b.addedNodes
|
|
897
|
+
).find((k) => k.tagName === "BUTTON");
|
|
898
|
+
$ && Ne(a.current, document.activeElement) && (o && $.focus(), u.disconnect());
|
|
899
899
|
}
|
|
900
900
|
});
|
|
901
|
-
}).observe(
|
|
901
|
+
}).observe(f, {
|
|
902
902
|
attributes: !1,
|
|
903
903
|
characterData: !1,
|
|
904
904
|
childList: !0,
|
|
@@ -914,19 +914,19 @@ const Oe = ({ className: t }) => {
|
|
|
914
914
|
className: "humany-conversation-link-list",
|
|
915
915
|
header: t,
|
|
916
916
|
items: te(e),
|
|
917
|
-
renderItem: (
|
|
917
|
+
renderItem: (c) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
918
918
|
ft,
|
|
919
919
|
{
|
|
920
|
-
help:
|
|
920
|
+
help: c.actionKey === "help",
|
|
921
921
|
onClick: () => {
|
|
922
|
-
r("action",
|
|
922
|
+
r("action", c), m.dispatch("tracking:link-list-item-clicked", c);
|
|
923
923
|
},
|
|
924
|
-
"aria-label":
|
|
925
|
-
title:
|
|
924
|
+
"aria-label": c.label,
|
|
925
|
+
title: c.label,
|
|
926
926
|
children: [
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
927
|
+
c.label,
|
|
928
|
+
c.actionKey === "help" && /* @__PURE__ */ n(
|
|
929
|
+
w,
|
|
930
930
|
{
|
|
931
931
|
size: 14,
|
|
932
932
|
symbol: {
|
|
@@ -937,16 +937,16 @@ const Oe = ({ className: t }) => {
|
|
|
937
937
|
)
|
|
938
938
|
]
|
|
939
939
|
}
|
|
940
|
-
) },
|
|
940
|
+
) }, c.actionKey)
|
|
941
941
|
}
|
|
942
942
|
);
|
|
943
943
|
}, gt = i(K)`
|
|
944
944
|
${D}
|
|
945
|
-
${
|
|
945
|
+
${L}
|
|
946
946
|
|
|
947
947
|
${(t) => Z(t)(
|
|
948
948
|
"h1",
|
|
949
|
-
|
|
949
|
+
v`
|
|
950
950
|
white-space: normal;
|
|
951
951
|
`
|
|
952
952
|
)}
|
|
@@ -962,7 +962,7 @@ const Oe = ({ className: t }) => {
|
|
|
962
962
|
margin: 0;
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
|
-
`, ft = i(
|
|
965
|
+
`, ft = i(A)`
|
|
966
966
|
display: block;
|
|
967
967
|
text-align: left;
|
|
968
968
|
font-weight: 300;
|
|
@@ -976,7 +976,7 @@ const Oe = ({ className: t }) => {
|
|
|
976
976
|
|
|
977
977
|
${(t) => {
|
|
978
978
|
var e, r;
|
|
979
|
-
return t.help &&
|
|
979
|
+
return t.help && v`
|
|
980
980
|
color: ${(e = t.theme.colors) == null ? void 0 : e.text};
|
|
981
981
|
text-decoration: underline;
|
|
982
982
|
|
|
@@ -988,7 +988,7 @@ const Oe = ({ className: t }) => {
|
|
|
988
988
|
}}
|
|
989
989
|
|
|
990
990
|
&:focus-visible {
|
|
991
|
-
${
|
|
991
|
+
${p}
|
|
992
992
|
span {
|
|
993
993
|
color: ${(t) => {
|
|
994
994
|
var e;
|
|
@@ -1001,7 +1001,7 @@ const Oe = ({ className: t }) => {
|
|
|
1001
1001
|
${(t) => t.theme.border && `border-bottom: ${t.theme.border};`}
|
|
1002
1002
|
width: 100%;
|
|
1003
1003
|
`, bt = ({ text: t }) => /* @__PURE__ */ n($t, { className: "humany-conversation-text", variant: "span", children: t }), $t = i(J)`
|
|
1004
|
-
${
|
|
1004
|
+
${L}
|
|
1005
1005
|
`, vt = ({
|
|
1006
1006
|
header: t = "Video call",
|
|
1007
1007
|
acceptLabel: e = "Accept",
|
|
@@ -1043,7 +1043,7 @@ const Oe = ({ className: t }) => {
|
|
|
1043
1043
|
"aria-label": o.label,
|
|
1044
1044
|
title: o.label,
|
|
1045
1045
|
bgColor: d,
|
|
1046
|
-
children: /* @__PURE__ */ n(
|
|
1046
|
+
children: /* @__PURE__ */ n(w, { symbol: o.symbol, size: 25 })
|
|
1047
1047
|
}
|
|
1048
1048
|
) }, o.actionKey);
|
|
1049
1049
|
}
|
|
@@ -1062,9 +1062,9 @@ const Oe = ({ className: t }) => {
|
|
|
1062
1062
|
margin: 0;
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
${(t) =>
|
|
1066
|
-
`, kt = i(
|
|
1067
|
-
${
|
|
1065
|
+
${(t) => L(t)}
|
|
1066
|
+
`, kt = i(A)`
|
|
1067
|
+
${R};
|
|
1068
1068
|
|
|
1069
1069
|
background-color: ${(t) => t.bgColor};
|
|
1070
1070
|
display: flex;
|
|
@@ -1076,7 +1076,7 @@ const Oe = ({ className: t }) => {
|
|
|
1076
1076
|
border-radius: 100%;
|
|
1077
1077
|
|
|
1078
1078
|
&:focus-visible {
|
|
1079
|
-
${
|
|
1079
|
+
${p}
|
|
1080
1080
|
background-color: transparent;
|
|
1081
1081
|
|
|
1082
1082
|
i,
|
|
@@ -1103,15 +1103,15 @@ const Oe = ({ className: t }) => {
|
|
|
1103
1103
|
stroke: #fff;
|
|
1104
1104
|
}
|
|
1105
1105
|
}
|
|
1106
|
-
`,
|
|
1107
|
-
const r = t.map(
|
|
1108
|
-
return !!t.map(
|
|
1109
|
-
const d = o == null ? void 0 : o.content,
|
|
1110
|
-
return !!(
|
|
1111
|
-
}).length && r.push("humany-secondary-action-list"), !!t.map(
|
|
1112
|
-
var
|
|
1106
|
+
`, E = ([t, e]) => ({ type: t, content: e }), wt = ({ items: t, dispatch: e }) => {
|
|
1107
|
+
const r = t.map(E).filter((o) => o.type.includes("ace-knowledge")).map((o) => "humany-" + o.type.toString());
|
|
1108
|
+
return !!t.map(E).filter((o) => {
|
|
1109
|
+
const d = o == null ? void 0 : o.content, m = d == null ? void 0 : d.actions;
|
|
1110
|
+
return !!(m != null && m.filter((c) => c.actionKey === "contact").length);
|
|
1111
|
+
}).length && r.push("humany-secondary-action-list"), !!t.map(E).filter((o) => {
|
|
1112
|
+
var m;
|
|
1113
1113
|
const d = o == null ? void 0 : o.content;
|
|
1114
|
-
return !!((
|
|
1114
|
+
return !!((m = d == null ? void 0 : d.tags) != null && m.includes("category"));
|
|
1115
1115
|
}).length && r.push("humany-category-list"), /* @__PURE__ */ n(
|
|
1116
1116
|
St,
|
|
1117
1117
|
{
|
|
@@ -1120,23 +1120,23 @@ const Oe = ({ className: t }) => {
|
|
|
1120
1120
|
"humany-message-list",
|
|
1121
1121
|
r.join(" ")
|
|
1122
1122
|
),
|
|
1123
|
-
items: t.map(
|
|
1123
|
+
items: t.map(E),
|
|
1124
1124
|
renderLi: !0,
|
|
1125
1125
|
renderItem: (o) => {
|
|
1126
1126
|
switch (o.type) {
|
|
1127
|
-
case
|
|
1127
|
+
case S.Text:
|
|
1128
1128
|
return /* @__PURE__ */ n(bt, { text: o.content });
|
|
1129
|
-
case
|
|
1129
|
+
case S.HTML:
|
|
1130
1130
|
return /* @__PURE__ */ n(lt, { ...o.content });
|
|
1131
|
-
case
|
|
1131
|
+
case S.Separator:
|
|
1132
1132
|
return /* @__PURE__ */ n(yt, { ...o.content });
|
|
1133
|
-
case
|
|
1133
|
+
case S.ItemList:
|
|
1134
1134
|
return /* @__PURE__ */ n(dt, { ...o.content, dispatch: e });
|
|
1135
|
-
case
|
|
1135
|
+
case S.LinkList:
|
|
1136
1136
|
return /* @__PURE__ */ n(ht, { ...o.content, dispatch: e });
|
|
1137
|
-
case
|
|
1137
|
+
case S.ButtonList:
|
|
1138
1138
|
return /* @__PURE__ */ n(ot, { ...o.content, dispatch: e });
|
|
1139
|
-
case
|
|
1139
|
+
case S.VideoRequest:
|
|
1140
1140
|
return /* @__PURE__ */ n(vt, { ...o.content, dispatch: e });
|
|
1141
1141
|
default:
|
|
1142
1142
|
return /* @__PURE__ */ n(it, { type: o.type, content: o.content });
|
|
@@ -1145,7 +1145,7 @@ const Oe = ({ className: t }) => {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
);
|
|
1147
1147
|
}, St = i(le)`
|
|
1148
|
-
${
|
|
1148
|
+
${Le}
|
|
1149
1149
|
|
|
1150
1150
|
> li {
|
|
1151
1151
|
margin: 0;
|
|
@@ -1153,13 +1153,13 @@ const Oe = ({ className: t }) => {
|
|
|
1153
1153
|
`, Ct = ee(
|
|
1154
1154
|
({ className: t, timestamp: e, sender: r, type: s, content: a }, o) => {
|
|
1155
1155
|
const d = ue(
|
|
1156
|
-
(
|
|
1157
|
-
let
|
|
1158
|
-
return a.length > 1 && (
|
|
1156
|
+
(l) => {
|
|
1157
|
+
let u = "first";
|
|
1158
|
+
return a.length > 1 && (u = l === 0 ? "first" : l + 1 === a.length ? "last" : "middle"), u;
|
|
1159
1159
|
},
|
|
1160
1160
|
[a]
|
|
1161
|
-
), { userLabel:
|
|
1162
|
-
const { key:
|
|
1161
|
+
), { userLabel: m = "" } = C(), c = () => /* @__PURE__ */ n(N, { children: a.map((l) => {
|
|
1162
|
+
const { key: u, body: b, title: $, form: k, actions: y } = l, O = !!b && !$ && !k && !y;
|
|
1163
1163
|
return /* @__PURE__ */ n(
|
|
1164
1164
|
Qe,
|
|
1165
1165
|
{
|
|
@@ -1167,12 +1167,12 @@ const Oe = ({ className: t }) => {
|
|
|
1167
1167
|
discrete: O,
|
|
1168
1168
|
ref: o,
|
|
1169
1169
|
timestamp: e,
|
|
1170
|
-
fullWidth: !!
|
|
1171
|
-
children: O &&
|
|
1170
|
+
fullWidth: !!k || !!y,
|
|
1171
|
+
children: O && b ? /* @__PURE__ */ n(Q, { html: b }) : /* @__PURE__ */ n(V, { isSystem: !0, content: l })
|
|
1172
1172
|
},
|
|
1173
|
-
|
|
1173
|
+
u
|
|
1174
1174
|
);
|
|
1175
|
-
}) }),
|
|
1175
|
+
}) }), f = () => /* @__PURE__ */ h(N, { children: [
|
|
1176
1176
|
/* @__PURE__ */ n(re, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: r == null ? void 0 : r.name, timestamp: e }) }),
|
|
1177
1177
|
/* @__PURE__ */ n(
|
|
1178
1178
|
fe,
|
|
@@ -1180,7 +1180,7 @@ const Oe = ({ className: t }) => {
|
|
|
1180
1180
|
sender: r,
|
|
1181
1181
|
timestamp: e,
|
|
1182
1182
|
className: t,
|
|
1183
|
-
children: /* @__PURE__ */ n(F, { className: "humany-message-content-bundle", children: a.map((
|
|
1183
|
+
children: /* @__PURE__ */ n(F, { className: "humany-message-content-bundle", children: a.map((l, u) => /* @__PURE__ */ n(
|
|
1184
1184
|
Y,
|
|
1185
1185
|
{
|
|
1186
1186
|
className: "humany-message-container",
|
|
@@ -1189,18 +1189,18 @@ const Oe = ({ className: t }) => {
|
|
|
1189
1189
|
children: /* @__PURE__ */ n(
|
|
1190
1190
|
V,
|
|
1191
1191
|
{
|
|
1192
|
-
content:
|
|
1193
|
-
stacked: d(
|
|
1192
|
+
content: l,
|
|
1193
|
+
stacked: d(u)
|
|
1194
1194
|
}
|
|
1195
1195
|
)
|
|
1196
1196
|
},
|
|
1197
|
-
|
|
1197
|
+
l.key
|
|
1198
1198
|
)) })
|
|
1199
1199
|
}
|
|
1200
1200
|
)
|
|
1201
|
-
] }),
|
|
1202
|
-
/* @__PURE__ */ n(re, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name:
|
|
1203
|
-
/* @__PURE__ */ n(tt, { timestamp: e, className: t, children: /* @__PURE__ */ n(F, { className: "humany-message-content-bundle", children: a.map((
|
|
1201
|
+
] }), x = () => /* @__PURE__ */ h(N, { children: [
|
|
1202
|
+
/* @__PURE__ */ n(re, { className: "humany-sr-only", children: /* @__PURE__ */ n(M, { name: m, timestamp: e }) }),
|
|
1203
|
+
/* @__PURE__ */ n(tt, { timestamp: e, className: t, children: /* @__PURE__ */ n(F, { className: "humany-message-content-bundle", children: a.map((l, u) => /* @__PURE__ */ n(
|
|
1204
1204
|
Y,
|
|
1205
1205
|
{
|
|
1206
1206
|
className: "humany-message-container",
|
|
@@ -1210,21 +1210,21 @@ const Oe = ({ className: t }) => {
|
|
|
1210
1210
|
V,
|
|
1211
1211
|
{
|
|
1212
1212
|
isUser: !0,
|
|
1213
|
-
content:
|
|
1214
|
-
stacked: d(
|
|
1213
|
+
content: l,
|
|
1214
|
+
stacked: d(u)
|
|
1215
1215
|
}
|
|
1216
1216
|
)
|
|
1217
1217
|
},
|
|
1218
|
-
|
|
1218
|
+
l.key
|
|
1219
1219
|
)) }) })
|
|
1220
1220
|
] });
|
|
1221
1221
|
switch (s) {
|
|
1222
1222
|
case U.System:
|
|
1223
|
-
return
|
|
1223
|
+
return c();
|
|
1224
1224
|
case U.Agent:
|
|
1225
|
-
return
|
|
1225
|
+
return f();
|
|
1226
1226
|
case U.User:
|
|
1227
|
-
return
|
|
1227
|
+
return x();
|
|
1228
1228
|
default:
|
|
1229
1229
|
return null;
|
|
1230
1230
|
}
|
|
@@ -1235,14 +1235,14 @@ const Oe = ({ className: t }) => {
|
|
|
1235
1235
|
isSystem: r,
|
|
1236
1236
|
stacked: s
|
|
1237
1237
|
}) => {
|
|
1238
|
-
const a = G(), { title: o, body: d, actions:
|
|
1239
|
-
return
|
|
1238
|
+
const a = G(), { title: o, body: d, actions: m, form: c, items: f } = t;
|
|
1239
|
+
return f ? /* @__PURE__ */ n(
|
|
1240
1240
|
X,
|
|
1241
1241
|
{
|
|
1242
1242
|
className: "humany-message-content",
|
|
1243
1243
|
user: !!e,
|
|
1244
1244
|
stacked: s,
|
|
1245
|
-
children: /* @__PURE__ */ n(wt, { items:
|
|
1245
|
+
children: /* @__PURE__ */ n(wt, { items: f, dispatch: a })
|
|
1246
1246
|
}
|
|
1247
1247
|
) : /* @__PURE__ */ h(
|
|
1248
1248
|
X,
|
|
@@ -1251,36 +1251,36 @@ const Oe = ({ className: t }) => {
|
|
|
1251
1251
|
padded: !r,
|
|
1252
1252
|
user: !!e,
|
|
1253
1253
|
stacked: s,
|
|
1254
|
-
fullWidth: !!
|
|
1254
|
+
fullWidth: !!c || !!m,
|
|
1255
1255
|
children: [
|
|
1256
|
-
o && /* @__PURE__ */ n(
|
|
1257
|
-
d && /* @__PURE__ */ n(
|
|
1258
|
-
|
|
1256
|
+
o && /* @__PURE__ */ n(B, { children: /* @__PURE__ */ n(qe, { variant: "h2", children: o }) }),
|
|
1257
|
+
d && /* @__PURE__ */ n(B, { children: /* @__PURE__ */ n(Fe, { html: d }) }),
|
|
1258
|
+
c && /* @__PURE__ */ n(B, { children: /* @__PURE__ */ n(
|
|
1259
1259
|
_e,
|
|
1260
1260
|
{
|
|
1261
|
-
...
|
|
1262
|
-
onChange: (
|
|
1261
|
+
...c,
|
|
1262
|
+
onChange: (l, u) => {
|
|
1263
1263
|
a("form", {
|
|
1264
|
-
data:
|
|
1265
|
-
formKey:
|
|
1266
|
-
actionKey:
|
|
1264
|
+
data: u,
|
|
1265
|
+
formKey: c.schema.id,
|
|
1266
|
+
actionKey: l
|
|
1267
1267
|
});
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
1270
|
) }),
|
|
1271
|
-
|
|
1271
|
+
m && /* @__PURE__ */ n(B, { children: /* @__PURE__ */ n(
|
|
1272
1272
|
Ye,
|
|
1273
1273
|
{
|
|
1274
|
-
items: Object.keys(
|
|
1275
|
-
renderItem: (
|
|
1274
|
+
items: Object.keys(m).map((l) => ({ label: m[l], actionKey: l })),
|
|
1275
|
+
renderItem: (l) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
1276
1276
|
Xe,
|
|
1277
1277
|
{
|
|
1278
1278
|
onClick: () => {
|
|
1279
|
-
a("action",
|
|
1279
|
+
a("action", l.actionKey);
|
|
1280
1280
|
},
|
|
1281
|
-
children:
|
|
1281
|
+
children: l.label
|
|
1282
1282
|
}
|
|
1283
|
-
) },
|
|
1283
|
+
) }, l.actionKey)
|
|
1284
1284
|
}
|
|
1285
1285
|
) })
|
|
1286
1286
|
]
|
|
@@ -1295,8 +1295,8 @@ const Oe = ({ className: t }) => {
|
|
|
1295
1295
|
clip: rect(1px, 1px, 1px, 1px);
|
|
1296
1296
|
left: -10000000px;
|
|
1297
1297
|
top: auto;
|
|
1298
|
-
`,
|
|
1299
|
-
const { skipToLatestMessageLabel: t = "Skip to latest message" } =
|
|
1298
|
+
`, Lt = () => {
|
|
1299
|
+
const { skipToLatestMessageLabel: t = "Skip to latest message" } = C(), e = I(), r = () => {
|
|
1300
1300
|
const s = e.get("widgetDOMElement");
|
|
1301
1301
|
if (s) {
|
|
1302
1302
|
const a = s.querySelectorAll(
|
|
@@ -1306,7 +1306,7 @@ const Oe = ({ className: t }) => {
|
|
|
1306
1306
|
}
|
|
1307
1307
|
};
|
|
1308
1308
|
return /* @__PURE__ */ n(
|
|
1309
|
-
|
|
1309
|
+
zt,
|
|
1310
1310
|
{
|
|
1311
1311
|
className: "humany-skip-to-latest-message",
|
|
1312
1312
|
onKeyDown: (s) => {
|
|
@@ -1316,7 +1316,7 @@ const Oe = ({ className: t }) => {
|
|
|
1316
1316
|
children: t
|
|
1317
1317
|
}
|
|
1318
1318
|
);
|
|
1319
|
-
},
|
|
1319
|
+
}, zt = i.button`
|
|
1320
1320
|
position: absolute;
|
|
1321
1321
|
bottom: 60px;
|
|
1322
1322
|
text-align: center;
|
|
@@ -1334,12 +1334,12 @@ const Oe = ({ className: t }) => {
|
|
|
1334
1334
|
&:focus-visible {
|
|
1335
1335
|
left: 50%;
|
|
1336
1336
|
transform: translateX(-50%);
|
|
1337
|
-
${
|
|
1337
|
+
${p};
|
|
1338
1338
|
}
|
|
1339
1339
|
`, ye = () => {
|
|
1340
|
-
const t =
|
|
1341
|
-
|
|
1342
|
-
|
|
1340
|
+
const t = I(), e = ue((l) => {
|
|
1341
|
+
l && setTimeout(() => {
|
|
1342
|
+
l.scrollIntoView({
|
|
1343
1343
|
block: "start",
|
|
1344
1344
|
behavior: "smooth"
|
|
1345
1345
|
});
|
|
@@ -1347,12 +1347,13 @@ const Oe = ({ className: t }) => {
|
|
|
1347
1347
|
}, []), [r, s] = ie(!0), {
|
|
1348
1348
|
messages: a,
|
|
1349
1349
|
loading: o,
|
|
1350
|
-
typingActors: d = []
|
|
1351
|
-
|
|
1350
|
+
typingActors: d = [],
|
|
1351
|
+
providers: m = []
|
|
1352
|
+
} = C(), c = () => d && d.length ? d.map((l, u) => /* @__PURE__ */ n(
|
|
1352
1353
|
_,
|
|
1353
1354
|
{
|
|
1354
|
-
id: `typing_${
|
|
1355
|
-
children: /* @__PURE__ */ n(fe, { timestamp: Date.now(), sender:
|
|
1355
|
+
id: `typing_${l.name}`,
|
|
1356
|
+
children: /* @__PURE__ */ n(fe, { timestamp: Date.now(), sender: l, children: /* @__PURE__ */ n(
|
|
1356
1357
|
ne,
|
|
1357
1358
|
{
|
|
1358
1359
|
boxed: !0,
|
|
@@ -1360,35 +1361,35 @@ const Oe = ({ className: t }) => {
|
|
|
1360
1361
|
}
|
|
1361
1362
|
) })
|
|
1362
1363
|
},
|
|
1363
|
-
`typing_${
|
|
1364
|
-
)) : null,
|
|
1364
|
+
`typing_${l.name}`
|
|
1365
|
+
)) : null, f = de.useRef((a == null ? void 0 : a.length) || 0), x = m.includes("ace-knowledge-bot");
|
|
1365
1366
|
return j(() => {
|
|
1366
|
-
const
|
|
1367
|
-
if (
|
|
1368
|
-
const
|
|
1367
|
+
const l = t.get("widgetDOMElement");
|
|
1368
|
+
if (l && x) {
|
|
1369
|
+
const u = l.querySelectorAll(
|
|
1369
1370
|
".humany-conversation-entry"
|
|
1370
1371
|
);
|
|
1371
|
-
|
|
1372
|
+
u.length && u.length > f.current && (f.current = u.length, u[u.length - 1].focus());
|
|
1372
1373
|
}
|
|
1373
1374
|
}), /* @__PURE__ */ h(N, { children: [
|
|
1374
1375
|
/* @__PURE__ */ h(Nt, { tabIndex: 0, scrollableCss: r, ref: s, children: [
|
|
1375
|
-
a && a.length ? a.map((
|
|
1376
|
-
const { type:
|
|
1376
|
+
a && a.length ? a.map((l, u) => {
|
|
1377
|
+
const { type: b, timestamp: $, sender: k, content: y } = l;
|
|
1377
1378
|
return /* @__PURE__ */ n(
|
|
1378
1379
|
_,
|
|
1379
1380
|
{
|
|
1380
1381
|
className: "humany-conversation-entry",
|
|
1381
1382
|
tabIndex: -1,
|
|
1382
|
-
children: /* @__PURE__ */ n(Ct, { ...
|
|
1383
|
+
children: /* @__PURE__ */ n(Ct, { ...l, ref: e })
|
|
1383
1384
|
},
|
|
1384
|
-
`${
|
|
1385
|
+
`${b}_${k == null ? void 0 : k.name}_${$}_${y[0].key}`
|
|
1385
1386
|
);
|
|
1386
1387
|
}) : null,
|
|
1387
|
-
|
|
1388
|
+
c(),
|
|
1388
1389
|
o && /* @__PURE__ */ n(_, { children: /* @__PURE__ */ n(ne, { ref: e }) })
|
|
1389
1390
|
] }),
|
|
1390
1391
|
/* @__PURE__ */ n(Oe, {}),
|
|
1391
|
-
/* @__PURE__ */ n(
|
|
1392
|
+
/* @__PURE__ */ n(Lt, {})
|
|
1392
1393
|
] });
|
|
1393
1394
|
}, Nt = i.div`
|
|
1394
1395
|
display: flex;
|
|
@@ -1401,7 +1402,7 @@ const Oe = ({ className: t }) => {
|
|
|
1401
1402
|
}};
|
|
1402
1403
|
${(t) => !!t.scrollableCss && t.scrollableCss};
|
|
1403
1404
|
&:focus-visible {
|
|
1404
|
-
${(t) =>
|
|
1405
|
+
${(t) => p(t)};
|
|
1405
1406
|
}
|
|
1406
1407
|
`, _ = i.div`
|
|
1407
1408
|
margin: 0;
|
|
@@ -1437,7 +1438,7 @@ const Oe = ({ className: t }) => {
|
|
|
1437
1438
|
}
|
|
1438
1439
|
|
|
1439
1440
|
&:focus-visible {
|
|
1440
|
-
${
|
|
1441
|
+
${p}
|
|
1441
1442
|
border-radius: ${(t) => {
|
|
1442
1443
|
var e;
|
|
1443
1444
|
return (e = t.theme.sizes) == null ? void 0 : e.small;
|
|
@@ -1445,7 +1446,7 @@ const Oe = ({ className: t }) => {
|
|
|
1445
1446
|
}
|
|
1446
1447
|
${(t) => Z(t)(
|
|
1447
1448
|
"h1",
|
|
1448
|
-
|
|
1449
|
+
v`
|
|
1449
1450
|
font-weight: normal;
|
|
1450
1451
|
`
|
|
1451
1452
|
)}
|
|
@@ -1461,12 +1462,12 @@ const Oe = ({ className: t }) => {
|
|
|
1461
1462
|
ref: e
|
|
1462
1463
|
}
|
|
1463
1464
|
);
|
|
1464
|
-
},
|
|
1465
|
+
}, At = ({
|
|
1465
1466
|
dispatch: t,
|
|
1466
1467
|
header: e,
|
|
1467
1468
|
buttonLabel: r
|
|
1468
1469
|
}) => /* @__PURE__ */ h(
|
|
1469
|
-
|
|
1470
|
+
It,
|
|
1470
1471
|
{
|
|
1471
1472
|
portalId: "humany-conversation-portal",
|
|
1472
1473
|
className: "humany-conversation-outlet",
|
|
@@ -1480,7 +1481,7 @@ const Oe = ({ className: t }) => {
|
|
|
1480
1481
|
title: r,
|
|
1481
1482
|
onClick: () => t("hide-overlay-conversation"),
|
|
1482
1483
|
children: /* @__PURE__ */ n(
|
|
1483
|
-
|
|
1484
|
+
w,
|
|
1484
1485
|
{
|
|
1485
1486
|
symbol: {
|
|
1486
1487
|
type: "Svg",
|
|
@@ -1503,7 +1504,7 @@ const Oe = ({ className: t }) => {
|
|
|
1503
1504
|
/* @__PURE__ */ n(ye, {})
|
|
1504
1505
|
]
|
|
1505
1506
|
}
|
|
1506
|
-
),
|
|
1507
|
+
), It = i(ce)`
|
|
1507
1508
|
z-index: 11;
|
|
1508
1509
|
top: auto;
|
|
1509
1510
|
height: 65%;
|
|
@@ -1542,7 +1543,7 @@ const Oe = ({ className: t }) => {
|
|
|
1542
1543
|
return (e = t.theme.colors) == null ? void 0 : e.text;
|
|
1543
1544
|
}};
|
|
1544
1545
|
margin: 0;
|
|
1545
|
-
`, Ot = i(
|
|
1546
|
+
`, Ot = i(A)`
|
|
1546
1547
|
display: flex;
|
|
1547
1548
|
align-items: center;
|
|
1548
1549
|
justify-content: center;
|
|
@@ -1556,7 +1557,7 @@ const Oe = ({ className: t }) => {
|
|
|
1556
1557
|
${(t) => t.theme.borderRadius && `border-radius: ${t.theme.borderRadius};`}
|
|
1557
1558
|
|
|
1558
1559
|
&:focus-visible {
|
|
1559
|
-
${
|
|
1560
|
+
${p};
|
|
1560
1561
|
}
|
|
1561
1562
|
|
|
1562
1563
|
svg line {
|
|
@@ -1571,14 +1572,14 @@ const Oe = ({ className: t }) => {
|
|
|
1571
1572
|
overlayConversationHeader: s,
|
|
1572
1573
|
overlayConversationCloseLabel: a,
|
|
1573
1574
|
conversationControllerId: o
|
|
1574
|
-
} =
|
|
1575
|
+
} = C(), d = G(), c = I().get("$settings");
|
|
1575
1576
|
return /* @__PURE__ */ n(
|
|
1576
|
-
|
|
1577
|
+
ze.Provider,
|
|
1577
1578
|
{
|
|
1578
1579
|
value: o ? { id: o } : null,
|
|
1579
|
-
children: /* @__PURE__ */ h(ge.Provider, { value:
|
|
1580
|
+
children: /* @__PURE__ */ h(ge.Provider, { value: c == null ? void 0 : c.language, children: [
|
|
1580
1581
|
/* @__PURE__ */ n(
|
|
1581
|
-
|
|
1582
|
+
Bt,
|
|
1582
1583
|
{
|
|
1583
1584
|
"aria-live": "polite",
|
|
1584
1585
|
...e,
|
|
@@ -1592,7 +1593,7 @@ const Oe = ({ className: t }) => {
|
|
|
1592
1593
|
r && /* @__PURE__ */ h(N, { children: [
|
|
1593
1594
|
/* @__PURE__ */ n(Mt, { dispatch: d }),
|
|
1594
1595
|
r.conversation && /* @__PURE__ */ n(
|
|
1595
|
-
|
|
1596
|
+
At,
|
|
1596
1597
|
{
|
|
1597
1598
|
dispatch: d,
|
|
1598
1599
|
header: s,
|
|
@@ -1603,7 +1604,7 @@ const Oe = ({ className: t }) => {
|
|
|
1603
1604
|
] })
|
|
1604
1605
|
}
|
|
1605
1606
|
);
|
|
1606
|
-
},
|
|
1607
|
+
}, Bt = i.div`
|
|
1607
1608
|
position: absolute;
|
|
1608
1609
|
right: 0;
|
|
1609
1610
|
left: 0;
|