@telia-ace/widget-conversation 1.1.1-rc.3 → 1.1.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,16 +1,16 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
1
|
+
import { jsx as n, jsxs as m, Fragment as R } from "react/jsx-runtime";
|
|
2
2
|
import s from "@emotion/styled";
|
|
3
|
-
import { Input as te, Button as z, borderTabStyle as f, SymbolBadge as
|
|
3
|
+
import { Input as te, Button as z, borderTabStyle as f, SymbolBadge as v, useIsTabbing as fe, useDispatch as q, useProperties as I, useScroll as ne, Typography as Y, invertedHoverButton as pe, Html as G, List as re, buttonCss as K, ItemList as j, itemList as O, Link as ye, useComponent as be, genericHtml as $e, headingElement as J, list as ve, WidgetOverlayOutlet as oe, ConversationContext as xe } from "@telia-ace/widget-ui";
|
|
4
4
|
import { appendClassNames as M } from "@telia-ace/widget-utilities";
|
|
5
|
-
import { css as g, keyframes as
|
|
6
|
-
import { useState as T, useEffect as se, forwardRef as Q, Suspense as
|
|
7
|
-
import { FormComponent as
|
|
8
|
-
import { ConversationMessageListItemType as k, ConversationMessageType as
|
|
5
|
+
import { css as g, keyframes as we } from "@emotion/react";
|
|
6
|
+
import { useState as T, useEffect as se, forwardRef as Q, Suspense as ke, useMemo as Ce, useCallback as ae, useRef as Se } from "react";
|
|
7
|
+
import { FormComponent as ze } from "@telia-ace/widget-forms";
|
|
8
|
+
import { ConversationMessageListItemType as k, ConversationMessageType as E } 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
|
|
13
|
-
const [t,
|
|
12
|
+
const Le = ({ className: e }) => {
|
|
13
|
+
const [t, o] = T(""), [r, a] = T(!1), [i, u] = T(0), [c, p] = T(0), x = fe(), d = q(), {
|
|
14
14
|
inputPlaceholder: l = "Type your message",
|
|
15
15
|
inputHidden: $ = !1,
|
|
16
16
|
inputDisabled: S = !1,
|
|
@@ -20,52 +20,52 @@ const ze = ({ className: e }) => {
|
|
|
20
20
|
} = I(), [de, b] = ne(!0);
|
|
21
21
|
se(() => {
|
|
22
22
|
if (b.current) {
|
|
23
|
-
const { lineHeight:
|
|
24
|
-
if (
|
|
25
|
-
const N =
|
|
26
|
-
|
|
23
|
+
const { lineHeight: h, maxHeight: H } = getComputedStyle(b.current);
|
|
24
|
+
if (h && h.indexOf("px") > -1) {
|
|
25
|
+
const N = h.split("px"), ue = parseInt(N[0], 10);
|
|
26
|
+
u(ue);
|
|
27
27
|
const ge = H.split("px");
|
|
28
28
|
p(parseInt(ge[0], 10));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}, [b.current]);
|
|
32
|
-
const
|
|
33
|
-
!
|
|
34
|
-
}, me = (
|
|
35
|
-
y && (
|
|
32
|
+
const D = (h) => {
|
|
33
|
+
!h.shiftKey || !w ? (h.preventDefault(), t && t.length > 0 && (d("user-submit", { text: t }), o(""), W(""))) : t.length < 1 && h.preventDefault();
|
|
34
|
+
}, me = (h) => {
|
|
35
|
+
y && (h.preventDefault(), d("action", {
|
|
36
36
|
actionKey: y.action,
|
|
37
37
|
...y
|
|
38
38
|
}));
|
|
39
|
-
},
|
|
39
|
+
}, he = (h) => {
|
|
40
40
|
if (w && b.current) {
|
|
41
41
|
const H = b.current.scrollHeight;
|
|
42
42
|
if (H > i) {
|
|
43
43
|
b.current.style.height = "auto";
|
|
44
44
|
let N = H;
|
|
45
|
-
|
|
45
|
+
h.length < 1 && (N = i), b.current.style.height = `${N}px`, N >= c ? b.current.style.overflowY = "scroll" : b.current.style.overflowY = "hidden";
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
},
|
|
49
|
-
|
|
48
|
+
}, W = (h) => {
|
|
49
|
+
he(h), o(h), h && h.length > 0 && d("user-typing", { textLength: h.length });
|
|
50
50
|
};
|
|
51
|
-
return $ ? null : /* @__PURE__ */
|
|
52
|
-
|
|
51
|
+
return $ ? null : /* @__PURE__ */ m(
|
|
52
|
+
He,
|
|
53
53
|
{
|
|
54
54
|
grow: w,
|
|
55
55
|
className: M("humany-conversation-input", e),
|
|
56
|
-
"data-has-focus":
|
|
56
|
+
"data-has-focus": r,
|
|
57
57
|
scrollableCss: de,
|
|
58
|
-
isTabbing:
|
|
58
|
+
isTabbing: x,
|
|
59
59
|
children: [
|
|
60
60
|
y && /* @__PURE__ */ n(
|
|
61
|
-
|
|
61
|
+
Me,
|
|
62
62
|
{
|
|
63
63
|
disabled: S,
|
|
64
64
|
onClick: me,
|
|
65
65
|
title: y.label,
|
|
66
66
|
"aria-label": y.label,
|
|
67
67
|
children: /* @__PURE__ */ n(
|
|
68
|
-
|
|
68
|
+
v,
|
|
69
69
|
{
|
|
70
70
|
size: 24,
|
|
71
71
|
symbol: { type: "Svg", content: y.icon || "browse" }
|
|
@@ -74,11 +74,11 @@ const ze = ({ className: e }) => {
|
|
|
74
74
|
}
|
|
75
75
|
),
|
|
76
76
|
w ? /* @__PURE__ */ n(
|
|
77
|
-
|
|
77
|
+
Ne,
|
|
78
78
|
{
|
|
79
79
|
value: t,
|
|
80
|
-
onChange:
|
|
81
|
-
onEnter:
|
|
80
|
+
onChange: W,
|
|
81
|
+
onEnter: D,
|
|
82
82
|
disabled: S,
|
|
83
83
|
"aria-label": l,
|
|
84
84
|
placeholder: l,
|
|
@@ -88,11 +88,11 @@ const ze = ({ className: e }) => {
|
|
|
88
88
|
ref: b
|
|
89
89
|
}
|
|
90
90
|
) : /* @__PURE__ */ n(
|
|
91
|
-
|
|
91
|
+
Ie,
|
|
92
92
|
{
|
|
93
93
|
value: t,
|
|
94
|
-
onChange:
|
|
95
|
-
onEnter:
|
|
94
|
+
onChange: W,
|
|
95
|
+
onEnter: D,
|
|
96
96
|
disabled: S,
|
|
97
97
|
"aria-label": l,
|
|
98
98
|
placeholder: l,
|
|
@@ -103,11 +103,11 @@ const ze = ({ className: e }) => {
|
|
|
103
103
|
ie,
|
|
104
104
|
{
|
|
105
105
|
disabled: S,
|
|
106
|
-
onClick:
|
|
106
|
+
onClick: D,
|
|
107
107
|
title: L,
|
|
108
108
|
"aria-label": L,
|
|
109
109
|
children: /* @__PURE__ */ n(
|
|
110
|
-
|
|
110
|
+
Te,
|
|
111
111
|
{
|
|
112
112
|
size: 22,
|
|
113
113
|
symbol: { type: "Svg", content: "send" },
|
|
@@ -119,7 +119,7 @@ const ze = ({ className: e }) => {
|
|
|
119
119
|
]
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
|
-
},
|
|
122
|
+
}, Ne = s(te)`
|
|
123
123
|
resize: none;
|
|
124
124
|
flex: 1;
|
|
125
125
|
flex-shrink: 1;
|
|
@@ -139,7 +139,7 @@ const ze = ({ className: e }) => {
|
|
|
139
139
|
border: none;
|
|
140
140
|
transition: height 200ms linear;
|
|
141
141
|
outline: none;
|
|
142
|
-
`,
|
|
142
|
+
`, Ie = s(te)`
|
|
143
143
|
flex: 1;
|
|
144
144
|
border: none;
|
|
145
145
|
background-color: transparent;
|
|
@@ -177,13 +177,13 @@ const ze = ({ className: e }) => {
|
|
|
177
177
|
&:focus-visible {
|
|
178
178
|
${f};
|
|
179
179
|
}
|
|
180
|
-
`,
|
|
180
|
+
`, Me = s(ie)`
|
|
181
181
|
border-right: ${(e) => e.theme.border};
|
|
182
182
|
margin: ${(e) => {
|
|
183
183
|
var t;
|
|
184
184
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
185
185
|
}} 0;
|
|
186
|
-
`,
|
|
186
|
+
`, He = s.div`
|
|
187
187
|
${(e) => e.grow ? g`
|
|
188
188
|
min-height: 50px;
|
|
189
189
|
max-height: 150px;
|
|
@@ -202,11 +202,11 @@ const ze = ({ className: e }) => {
|
|
|
202
202
|
textarea {
|
|
203
203
|
${(e) => !!e.scrollableCss && e.scrollableCss}
|
|
204
204
|
}
|
|
205
|
-
`,
|
|
205
|
+
`, Te = s(
|
|
206
206
|
({
|
|
207
207
|
hasContent: e,
|
|
208
208
|
...t
|
|
209
|
-
}) => /* @__PURE__ */ n(
|
|
209
|
+
}) => /* @__PURE__ */ n(v, { ...t })
|
|
210
210
|
)`
|
|
211
211
|
line,
|
|
212
212
|
path {
|
|
@@ -219,7 +219,7 @@ const ze = ({ className: e }) => {
|
|
|
219
219
|
return e.hasContent ? (t = e.theme.colors) == null ? void 0 : t.primary : "#a6a6a6";
|
|
220
220
|
}};
|
|
221
221
|
}
|
|
222
|
-
`,
|
|
222
|
+
`, Ae = s.div`
|
|
223
223
|
width: ${(e) => e.avatarSize || "32px"};
|
|
224
224
|
height: ${(e) => e.avatarSize || "32px"};
|
|
225
225
|
border-radius: 50%;
|
|
@@ -266,7 +266,7 @@ const ze = ({ className: e }) => {
|
|
|
266
266
|
}};
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
`,
|
|
269
|
+
`, Be = we`
|
|
270
270
|
0% {
|
|
271
271
|
opacity: 0;
|
|
272
272
|
}
|
|
@@ -288,7 +288,7 @@ const ze = ({ className: e }) => {
|
|
|
288
288
|
var t;
|
|
289
289
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
290
290
|
}};
|
|
291
|
-
animation: ${
|
|
291
|
+
animation: ${Be} 1s infinite;
|
|
292
292
|
}
|
|
293
293
|
> div:nth-of-type(2) {
|
|
294
294
|
animation-delay: 100ms;
|
|
@@ -296,29 +296,29 @@ const ze = ({ className: e }) => {
|
|
|
296
296
|
> div:nth-of-type(3) {
|
|
297
297
|
animation-delay: 200ms;
|
|
298
298
|
}
|
|
299
|
-
`,
|
|
299
|
+
`, U = s.div`
|
|
300
300
|
grid-area: content;
|
|
301
301
|
max-width: 100%;
|
|
302
302
|
overflow: hidden;
|
|
303
|
-
`,
|
|
303
|
+
`, Ke = s(Y)`
|
|
304
304
|
font-size: ${(e) => {
|
|
305
305
|
var t;
|
|
306
306
|
return (t = e.theme.fonts) == null ? void 0 : t.normal;
|
|
307
307
|
}};
|
|
308
308
|
font-weight: normal;
|
|
309
309
|
margin: 0;
|
|
310
|
-
`,
|
|
310
|
+
`, _ = s.div`
|
|
311
311
|
display: flex;
|
|
312
312
|
${(e) => e.left && "justify-content: start;"};
|
|
313
313
|
${(e) => e.center && "justify-content: center;"};
|
|
314
314
|
${(e) => e.right && "justify-content: end;"};
|
|
315
|
-
`,
|
|
315
|
+
`, V = s.div`
|
|
316
316
|
${(e) => {
|
|
317
317
|
var t;
|
|
318
318
|
return e.padded && `padding: ${(t = e.theme.sizes) == null ? void 0 : t.medium};`;
|
|
319
319
|
}}
|
|
320
|
-
${(e) => !e.user && e.stacked &&
|
|
321
|
-
${(e) => e.user && e.stacked &&
|
|
320
|
+
${(e) => !e.user && e.stacked && je(e.stacked, e.theme)}
|
|
321
|
+
${(e) => e.user && e.stacked && Oe(e.stacked, e.theme)}
|
|
322
322
|
|
|
323
323
|
display: inline-block;
|
|
324
324
|
margin-top: ${(e) => {
|
|
@@ -334,15 +334,15 @@ const ze = ({ className: e }) => {
|
|
|
334
334
|
}
|
|
335
335
|
max-width: 100%;
|
|
336
336
|
${(e) => e.fullWidth && "width: 100%;"}
|
|
337
|
-
`,
|
|
338
|
-
var
|
|
339
|
-
const
|
|
340
|
-
background-color: ${(
|
|
337
|
+
`, je = (e, t) => {
|
|
338
|
+
var r, a;
|
|
339
|
+
const o = g`
|
|
340
|
+
background-color: ${(r = t.colors) == null ? void 0 : r.accent};
|
|
341
341
|
color: ${(a = t.colors) == null ? void 0 : a.text};
|
|
342
342
|
${t.border && `border: ${t.border};`};
|
|
343
343
|
`;
|
|
344
344
|
return t.borderRadius ? g`
|
|
345
|
-
${
|
|
345
|
+
${o}
|
|
346
346
|
|
|
347
347
|
border-top-right-radius: ${t.borderRadius};
|
|
348
348
|
border-bottom-right-radius: ${t.borderRadius};
|
|
@@ -354,15 +354,15 @@ const ze = ({ className: e }) => {
|
|
|
354
354
|
${e === "last" && `
|
|
355
355
|
border-bottom-left-radius: ${t.borderRadius};
|
|
356
356
|
`}
|
|
357
|
-
` :
|
|
358
|
-
},
|
|
359
|
-
var
|
|
360
|
-
const
|
|
361
|
-
background-color: ${(
|
|
357
|
+
` : o;
|
|
358
|
+
}, Oe = (e, t) => {
|
|
359
|
+
var r, a;
|
|
360
|
+
const o = g`
|
|
361
|
+
background-color: ${(r = t.colors) == null ? void 0 : r.primary};
|
|
362
362
|
color: ${(a = t.colors) == null ? void 0 : a.accent};
|
|
363
363
|
`;
|
|
364
364
|
return t.borderRadius ? g`
|
|
365
|
-
${
|
|
365
|
+
${o}
|
|
366
366
|
|
|
367
367
|
border-top-left-radius: ${t.borderRadius};
|
|
368
368
|
border-bottom-left-radius: ${t.borderRadius};
|
|
@@ -374,7 +374,7 @@ const ze = ({ className: e }) => {
|
|
|
374
374
|
${e === "last" && `
|
|
375
375
|
border-bottom-right-radius: ${t.borderRadius};
|
|
376
376
|
`}
|
|
377
|
-
` :
|
|
377
|
+
` : o;
|
|
378
378
|
}, A = s.div`
|
|
379
379
|
margin-bottom: ${(e) => {
|
|
380
380
|
var t;
|
|
@@ -384,18 +384,18 @@ const ze = ({ className: e }) => {
|
|
|
384
384
|
margin-bottom: 0;
|
|
385
385
|
}
|
|
386
386
|
`, C = (e) => {
|
|
387
|
-
var t,
|
|
387
|
+
var t, o;
|
|
388
388
|
return g`
|
|
389
389
|
margin: ${(t = e.theme.sizes) == null ? void 0 : t.medium} 0;
|
|
390
|
-
padding: 0 ${(
|
|
390
|
+
padding: 0 ${(o = e.theme.sizes) == null ? void 0 : o.medium};
|
|
391
391
|
`;
|
|
392
|
-
},
|
|
392
|
+
}, De = s(ze)`
|
|
393
393
|
& button.humany-form-component-button {
|
|
394
394
|
${(e) => {
|
|
395
|
-
var t,
|
|
396
|
-
return ((t = e.theme.colors) == null ? void 0 : t.primary) && ((
|
|
395
|
+
var t, o, r, a;
|
|
396
|
+
return ((t = e.theme.colors) == null ? void 0 : t.primary) && ((o = e.theme.colors) == null ? void 0 : o.accent) && pe({
|
|
397
397
|
active: !1,
|
|
398
|
-
primaryColor: (
|
|
398
|
+
primaryColor: (r = e.theme.colors) == null ? void 0 : r.primary,
|
|
399
399
|
secondaryColor: (a = e.theme.colors) == null ? void 0 : a.accent,
|
|
400
400
|
theme: e.theme
|
|
401
401
|
});
|
|
@@ -417,7 +417,7 @@ const ze = ({ className: e }) => {
|
|
|
417
417
|
}};
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
`,
|
|
420
|
+
`, We = s(G)`
|
|
421
421
|
white-space: pre-wrap;
|
|
422
422
|
a {
|
|
423
423
|
color: ${(e) => e.theme.colors.link};
|
|
@@ -428,7 +428,7 @@ const ze = ({ className: e }) => {
|
|
|
428
428
|
}};
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
`,
|
|
431
|
+
`, Ee = s(re)`
|
|
432
432
|
padding: 0;
|
|
433
433
|
list-style: none;
|
|
434
434
|
margin: 0 -${(e) => {
|
|
@@ -441,8 +441,8 @@ const ze = ({ className: e }) => {
|
|
|
441
441
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
442
442
|
}};
|
|
443
443
|
}
|
|
444
|
-
`,
|
|
445
|
-
${(e) =>
|
|
444
|
+
`, Fe = s.button`
|
|
445
|
+
${(e) => K(e)};
|
|
446
446
|
display: block;
|
|
447
447
|
background-color: ${(e) => {
|
|
448
448
|
var t;
|
|
@@ -455,12 +455,12 @@ const ze = ({ className: e }) => {
|
|
|
455
455
|
background-color: transparent;
|
|
456
456
|
}
|
|
457
457
|
`, Z = Q(
|
|
458
|
-
({ boxed: e, className: t, agentData:
|
|
458
|
+
({ boxed: e, className: t, agentData: o }, r) => /* @__PURE__ */ n(U, { ref: r, children: /* @__PURE__ */ n(_, { left: e, center: !e, children: /* @__PURE__ */ n(V, { padded: !!e, stacked: e ? "first" : void 0, children: /* @__PURE__ */ m(Re, { children: [
|
|
459
459
|
/* @__PURE__ */ n("div", {}),
|
|
460
460
|
/* @__PURE__ */ n("div", {}),
|
|
461
461
|
/* @__PURE__ */ n("div", {})
|
|
462
462
|
] }) }) }) })
|
|
463
|
-
),
|
|
463
|
+
), Pe = s.p`
|
|
464
464
|
&& {
|
|
465
465
|
font-size: ${(e) => {
|
|
466
466
|
var t;
|
|
@@ -475,20 +475,20 @@ const ze = ({ className: e }) => {
|
|
|
475
475
|
var t;
|
|
476
476
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
477
477
|
}};
|
|
478
|
-
`, ee = (e) => new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }),
|
|
479
|
-
if (!t && !
|
|
478
|
+
`, ee = (e) => new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }), B = ({ className: e, name: t, timestamp: o }) => {
|
|
479
|
+
if (!t && !o)
|
|
480
480
|
return null;
|
|
481
|
-
let
|
|
482
|
-
return t ?
|
|
481
|
+
let r = "";
|
|
482
|
+
return t ? o ? r = `${t}: ${ee(o)}` : r = t : o && (r = ee(o)), /* @__PURE__ */ n(Pe, { children: r });
|
|
483
483
|
}, le = ({
|
|
484
484
|
className: e,
|
|
485
485
|
children: t,
|
|
486
|
-
sender:
|
|
487
|
-
timestamp:
|
|
486
|
+
sender: o,
|
|
487
|
+
timestamp: r
|
|
488
488
|
}) => {
|
|
489
|
-
const { avatar: a, name: i } =
|
|
490
|
-
return /* @__PURE__ */
|
|
491
|
-
|
|
489
|
+
const { avatar: a, name: i } = o, { avatarSize: u } = I();
|
|
490
|
+
return /* @__PURE__ */ m(
|
|
491
|
+
Ue,
|
|
492
492
|
{
|
|
493
493
|
hasAvatar: !!a,
|
|
494
494
|
className: M(
|
|
@@ -496,16 +496,16 @@ const ze = ({ className: e }) => {
|
|
|
496
496
|
"humany-conversation-agent-message"
|
|
497
497
|
),
|
|
498
498
|
children: [
|
|
499
|
-
a && /* @__PURE__ */ n(
|
|
499
|
+
a && /* @__PURE__ */ n(Ae, { avatarSize: u, children: typeof a == "string" ? (
|
|
500
500
|
// eslint-disable-next-line jsx-a11y/alt-text
|
|
501
501
|
/* @__PURE__ */ n("img", { src: a })
|
|
502
|
-
) : /* @__PURE__ */ n(
|
|
502
|
+
) : /* @__PURE__ */ n(v, { symbol: a }) }),
|
|
503
503
|
t,
|
|
504
|
-
/* @__PURE__ */ n(
|
|
504
|
+
/* @__PURE__ */ n(B, { name: i, timestamp: r })
|
|
505
505
|
]
|
|
506
506
|
}
|
|
507
507
|
);
|
|
508
|
-
},
|
|
508
|
+
}, Ue = s.div`
|
|
509
509
|
display: grid;
|
|
510
510
|
margin-right: 10%;
|
|
511
511
|
width: 90%;
|
|
@@ -522,30 +522,30 @@ const ze = ({ className: e }) => {
|
|
|
522
522
|
'content'
|
|
523
523
|
'info';
|
|
524
524
|
`};
|
|
525
|
-
`,
|
|
526
|
-
({ className: e, children: t, timestamp:
|
|
527
|
-
|
|
525
|
+
`, _e = Q(
|
|
526
|
+
({ className: e, children: t, timestamp: o, discrete: r, fullWidth: a }, i) => /* @__PURE__ */ n(
|
|
527
|
+
Ve,
|
|
528
528
|
{
|
|
529
529
|
ref: i,
|
|
530
530
|
className: M(e, "humany-conversation-system-message"),
|
|
531
531
|
fullWidth: a,
|
|
532
|
-
children:
|
|
532
|
+
children: r ? /* @__PURE__ */ m(qe, { className: "humany-conversation-discrete-message", children: [
|
|
533
533
|
t,
|
|
534
|
-
/* @__PURE__ */ n(
|
|
535
|
-
] }) : /* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ n(B, { timestamp: o })
|
|
535
|
+
] }) : /* @__PURE__ */ m(R, { children: [
|
|
536
536
|
t,
|
|
537
|
-
/* @__PURE__ */ n(
|
|
537
|
+
/* @__PURE__ */ n(B, { timestamp: o })
|
|
538
538
|
] })
|
|
539
539
|
}
|
|
540
540
|
)
|
|
541
|
-
),
|
|
541
|
+
), Ve = s.div`
|
|
542
542
|
${(e) => e.fullWidth && "width: 100%"};
|
|
543
543
|
padding: 0 ${(e) => {
|
|
544
544
|
var t;
|
|
545
545
|
return (t = e.theme.sizes) == null ? void 0 : t.large;
|
|
546
546
|
}};
|
|
547
547
|
overflow: auto;
|
|
548
|
-
`,
|
|
548
|
+
`, qe = s.div`
|
|
549
549
|
text-align: center;
|
|
550
550
|
word-wrap: break-word;
|
|
551
551
|
font-size: ${(e) => {
|
|
@@ -559,19 +559,19 @@ const ze = ({ className: e }) => {
|
|
|
559
559
|
> p {
|
|
560
560
|
margin: 0;
|
|
561
561
|
}
|
|
562
|
-
`,
|
|
563
|
-
const { userLabel:
|
|
564
|
-
return /* @__PURE__ */
|
|
565
|
-
|
|
562
|
+
`, Ye = ({ className: e, children: t, timestamp: o }) => {
|
|
563
|
+
const { userLabel: r = "" } = I();
|
|
564
|
+
return /* @__PURE__ */ m(
|
|
565
|
+
Ge,
|
|
566
566
|
{
|
|
567
567
|
className: M(e, "humany-conversation-user-message"),
|
|
568
568
|
children: [
|
|
569
569
|
t,
|
|
570
|
-
/* @__PURE__ */ n(
|
|
570
|
+
/* @__PURE__ */ n(B, { name: r, timestamp: o })
|
|
571
571
|
]
|
|
572
572
|
}
|
|
573
573
|
);
|
|
574
|
-
},
|
|
574
|
+
}, Ge = s.div`
|
|
575
575
|
margin-left: 10%;
|
|
576
576
|
width: 90%;
|
|
577
577
|
display: flex;
|
|
@@ -580,74 +580,121 @@ const ze = ({ className: e }) => {
|
|
|
580
580
|
`, X = (e) => Array.isArray(e) ? e : Object.keys(e).map((t) => ({
|
|
581
581
|
label: e[t],
|
|
582
582
|
actionKey: t
|
|
583
|
-
})),
|
|
584
|
-
|
|
583
|
+
})), Je = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
|
|
584
|
+
Qe,
|
|
585
585
|
{
|
|
586
586
|
className: "humany-conversation-button-list",
|
|
587
587
|
header: e,
|
|
588
588
|
items: X(t),
|
|
589
|
-
renderItem: (
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
589
|
+
renderItem: (r) => {
|
|
590
|
+
var i;
|
|
591
|
+
const a = !!((i = r == null ? void 0 : r.data) != null && i.href);
|
|
592
|
+
return /* @__PURE__ */ n("li", { children: a ? /* @__PURE__ */ m(
|
|
593
|
+
Xe,
|
|
594
|
+
{
|
|
595
|
+
onClick: () => {
|
|
596
|
+
o("action", r);
|
|
597
|
+
},
|
|
598
|
+
href: r.data.href,
|
|
599
|
+
target: r.data.target,
|
|
600
|
+
"aria-label": r.label,
|
|
601
|
+
title: r.label,
|
|
602
|
+
children: [
|
|
603
|
+
/* @__PURE__ */ n(v, { symbol: r.symbol }),
|
|
604
|
+
r.label
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
) : /* @__PURE__ */ m(
|
|
608
|
+
Ze,
|
|
609
|
+
{
|
|
610
|
+
onClick: () => {
|
|
611
|
+
o("action", r);
|
|
612
|
+
},
|
|
613
|
+
"aria-label": r.label,
|
|
614
|
+
title: r.label,
|
|
615
|
+
children: [
|
|
616
|
+
/* @__PURE__ */ n(v, { symbol: r.symbol }),
|
|
617
|
+
r.label
|
|
618
|
+
]
|
|
619
|
+
}
|
|
620
|
+
) }, r.actionKey);
|
|
621
|
+
}
|
|
603
622
|
}
|
|
604
|
-
),
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
623
|
+
), Qe = s(j)`
|
|
624
|
+
${O}
|
|
625
|
+
> ul {
|
|
626
|
+
display: flex;
|
|
627
|
+
flex-wrap: wrap;
|
|
628
|
+
gap: ${(e) => {
|
|
610
629
|
var t;
|
|
611
630
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
612
631
|
}};
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}
|
|
632
|
+
> li {
|
|
633
|
+
margin: 0;
|
|
616
634
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
635
|
+
}
|
|
636
|
+
${C}
|
|
637
|
+
`, Xe = s(ye)`
|
|
638
|
+
${K};
|
|
620
639
|
|
|
621
|
-
|
|
622
|
-
|
|
640
|
+
display: block;
|
|
641
|
+
padding: ${(e) => {
|
|
623
642
|
var t;
|
|
624
643
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
625
644
|
}};
|
|
626
|
-
|
|
645
|
+
background-color: ${(e) => {
|
|
627
646
|
var t;
|
|
628
647
|
return (t = e.theme.colors) == null ? void 0 : t.primary;
|
|
629
648
|
}};
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
649
|
+
width: 100%;
|
|
650
|
+
color: #ffffff;
|
|
651
|
+
overflow: hidden;
|
|
652
|
+
text-overflow: ellipsis;
|
|
653
|
+
&:focus-visible {
|
|
654
|
+
${f}
|
|
655
|
+
background-color: transparent;
|
|
656
|
+
}
|
|
638
657
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
658
|
+
i,
|
|
659
|
+
svg {
|
|
660
|
+
margin-right: ${(e) => {
|
|
642
661
|
var t;
|
|
643
662
|
return (t = e.theme.sizes) == null ? void 0 : t.small;
|
|
644
663
|
}};
|
|
645
|
-
|
|
646
|
-
`,
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
664
|
+
}
|
|
665
|
+
`, Ze = s(z)`
|
|
666
|
+
${K};
|
|
667
|
+
|
|
668
|
+
display: block;
|
|
669
|
+
padding: ${(e) => {
|
|
670
|
+
var t;
|
|
671
|
+
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
672
|
+
}};
|
|
673
|
+
background-color: ${(e) => {
|
|
674
|
+
var t;
|
|
675
|
+
return (t = e.theme.colors) == null ? void 0 : t.primary;
|
|
676
|
+
}};
|
|
677
|
+
width: 100%;
|
|
678
|
+
color: #ffffff;
|
|
679
|
+
overflow: hidden;
|
|
680
|
+
text-overflow: ellipsis;
|
|
681
|
+
&:focus-visible {
|
|
682
|
+
${f}
|
|
683
|
+
background-color: transparent;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
i,
|
|
687
|
+
svg {
|
|
688
|
+
margin-right: ${(e) => {
|
|
689
|
+
var t;
|
|
690
|
+
return (t = e.theme.sizes) == null ? void 0 : t.small;
|
|
691
|
+
}};
|
|
692
|
+
}
|
|
693
|
+
`, et = ({ type: e, content: t = {} }) => {
|
|
694
|
+
const o = be(e);
|
|
695
|
+
return !o || !e ? null : /* @__PURE__ */ n(ke, { fallback: null, children: /* @__PURE__ */ n(o, { ...t }) });
|
|
696
|
+
}, tt = ({ body: e }) => /* @__PURE__ */ n(nt, { html: e }), nt = s(G)`
|
|
697
|
+
${$e}
|
|
651
698
|
color: inherit;
|
|
652
699
|
white-space: pre-wrap;
|
|
653
700
|
${C}
|
|
@@ -657,44 +704,44 @@ const ze = ({ className: e }) => {
|
|
|
657
704
|
${f};
|
|
658
705
|
}
|
|
659
706
|
}
|
|
660
|
-
`,
|
|
661
|
-
|
|
707
|
+
`, rt = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
|
|
708
|
+
ot,
|
|
662
709
|
{
|
|
663
710
|
className: "humany-conversation-item-list",
|
|
664
711
|
header: e,
|
|
665
712
|
items: X(t),
|
|
666
|
-
renderItem: (
|
|
713
|
+
renderItem: (r) => {
|
|
667
714
|
var a;
|
|
668
|
-
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */
|
|
669
|
-
((a =
|
|
670
|
-
|
|
715
|
+
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(st, { children: [
|
|
716
|
+
((a = r.symbol) == null ? void 0 : a.content) && /* @__PURE__ */ n("div", { className: "item-icon", children: /* @__PURE__ */ n(
|
|
717
|
+
v,
|
|
671
718
|
{
|
|
672
719
|
size: 22,
|
|
673
720
|
symbol: {
|
|
674
|
-
type:
|
|
675
|
-
content:
|
|
721
|
+
type: r.symbol.type,
|
|
722
|
+
content: r.symbol.content
|
|
676
723
|
}
|
|
677
724
|
}
|
|
678
725
|
) }),
|
|
679
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ m("div", { className: "item-body", children: [
|
|
680
727
|
/* @__PURE__ */ n(
|
|
681
728
|
z,
|
|
682
729
|
{
|
|
683
730
|
onClick: () => {
|
|
684
|
-
|
|
731
|
+
o("action", r);
|
|
685
732
|
},
|
|
686
|
-
"aria-label":
|
|
687
|
-
title:
|
|
688
|
-
children:
|
|
733
|
+
"aria-label": r.label,
|
|
734
|
+
title: r.label,
|
|
735
|
+
children: r.label
|
|
689
736
|
}
|
|
690
737
|
),
|
|
691
|
-
|
|
738
|
+
r.description && /* @__PURE__ */ n("p", { children: r.description })
|
|
692
739
|
] })
|
|
693
|
-
] }) },
|
|
740
|
+
] }) }, r.actionKey);
|
|
694
741
|
}
|
|
695
742
|
}
|
|
696
|
-
),
|
|
697
|
-
${
|
|
743
|
+
), ot = s(j)`
|
|
744
|
+
${O}
|
|
698
745
|
|
|
699
746
|
> .humany-paragraph {
|
|
700
747
|
${C}
|
|
@@ -731,7 +778,7 @@ const ze = ({ className: e }) => {
|
|
|
731
778
|
border-bottom: none;
|
|
732
779
|
}
|
|
733
780
|
}
|
|
734
|
-
`,
|
|
781
|
+
`, st = s.div`
|
|
735
782
|
display: flex;
|
|
736
783
|
gap: ${(e) => {
|
|
737
784
|
var t;
|
|
@@ -780,25 +827,25 @@ const ze = ({ className: e }) => {
|
|
|
780
827
|
}
|
|
781
828
|
}
|
|
782
829
|
}
|
|
783
|
-
`,
|
|
784
|
-
|
|
830
|
+
`, at = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
|
|
831
|
+
it,
|
|
785
832
|
{
|
|
786
833
|
className: "humany-conversation-link-list",
|
|
787
834
|
header: e,
|
|
788
835
|
items: X(t),
|
|
789
|
-
renderItem: (
|
|
790
|
-
|
|
836
|
+
renderItem: (r) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(
|
|
837
|
+
lt,
|
|
791
838
|
{
|
|
792
|
-
help:
|
|
839
|
+
help: r.actionKey === "help",
|
|
793
840
|
onClick: () => {
|
|
794
|
-
|
|
841
|
+
o("action", r);
|
|
795
842
|
},
|
|
796
|
-
"aria-label":
|
|
797
|
-
title:
|
|
843
|
+
"aria-label": r.label,
|
|
844
|
+
title: r.label,
|
|
798
845
|
children: [
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
846
|
+
r.label,
|
|
847
|
+
r.actionKey === "help" && /* @__PURE__ */ n(
|
|
848
|
+
v,
|
|
802
849
|
{
|
|
803
850
|
size: 14,
|
|
804
851
|
symbol: {
|
|
@@ -809,10 +856,10 @@ const ze = ({ className: e }) => {
|
|
|
809
856
|
)
|
|
810
857
|
]
|
|
811
858
|
}
|
|
812
|
-
) },
|
|
859
|
+
) }, r.actionKey)
|
|
813
860
|
}
|
|
814
|
-
),
|
|
815
|
-
${
|
|
861
|
+
), it = s(j)`
|
|
862
|
+
${O}
|
|
816
863
|
${C}
|
|
817
864
|
|
|
818
865
|
${(e) => J(e)(
|
|
@@ -833,7 +880,7 @@ const ze = ({ className: e }) => {
|
|
|
833
880
|
margin: 0;
|
|
834
881
|
}
|
|
835
882
|
}
|
|
836
|
-
`,
|
|
883
|
+
`, lt = s(z)`
|
|
837
884
|
display: block;
|
|
838
885
|
text-align: left;
|
|
839
886
|
font-weight: 300;
|
|
@@ -846,14 +893,14 @@ const ze = ({ className: e }) => {
|
|
|
846
893
|
overflow: hidden;
|
|
847
894
|
|
|
848
895
|
${(e) => {
|
|
849
|
-
var t,
|
|
896
|
+
var t, o;
|
|
850
897
|
return e.help && g`
|
|
851
898
|
color: ${(t = e.theme.colors) == null ? void 0 : t.text};
|
|
852
899
|
text-decoration: underline;
|
|
853
900
|
|
|
854
901
|
i,
|
|
855
902
|
svg {
|
|
856
|
-
margin-left: ${(
|
|
903
|
+
margin-left: ${(o = e.theme.sizes) == null ? void 0 : o.small};
|
|
857
904
|
}
|
|
858
905
|
`;
|
|
859
906
|
}}
|
|
@@ -868,18 +915,18 @@ const ze = ({ className: e }) => {
|
|
|
868
915
|
text-decoration: underline;
|
|
869
916
|
}
|
|
870
917
|
}
|
|
871
|
-
`,
|
|
918
|
+
`, ct = () => /* @__PURE__ */ n(dt, { className: "humany-conversation-separator" }), dt = s.div`
|
|
872
919
|
${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
|
|
873
920
|
width: 100%;
|
|
874
|
-
`,
|
|
921
|
+
`, mt = ({ text: e }) => /* @__PURE__ */ n(ht, { className: "humany-conversation-text", variant: "span", children: e }), ht = s(Y)`
|
|
875
922
|
${C}
|
|
876
|
-
`,
|
|
923
|
+
`, ut = ({
|
|
877
924
|
header: e = "Video call",
|
|
878
925
|
acceptLabel: t = "Accept",
|
|
879
|
-
declineLabel:
|
|
880
|
-
dispatch:
|
|
926
|
+
declineLabel: o = "Decline",
|
|
927
|
+
dispatch: r
|
|
881
928
|
}) => {
|
|
882
|
-
const a =
|
|
929
|
+
const a = Ce(() => [
|
|
883
930
|
{
|
|
884
931
|
label: t,
|
|
885
932
|
actionKey: "accept-video-call",
|
|
@@ -889,39 +936,39 @@ const ze = ({ className: e }) => {
|
|
|
889
936
|
}
|
|
890
937
|
},
|
|
891
938
|
{
|
|
892
|
-
label:
|
|
939
|
+
label: o,
|
|
893
940
|
actionKey: "decline-video-call",
|
|
894
941
|
symbol: {
|
|
895
942
|
type: "Svg",
|
|
896
943
|
content: "close"
|
|
897
944
|
}
|
|
898
945
|
}
|
|
899
|
-
], [t,
|
|
946
|
+
], [t, o]);
|
|
900
947
|
return /* @__PURE__ */ n(
|
|
901
|
-
|
|
948
|
+
gt,
|
|
902
949
|
{
|
|
903
950
|
className: "humany-conversation-video-request",
|
|
904
951
|
header: e,
|
|
905
952
|
items: a,
|
|
906
953
|
renderItem: (i) => {
|
|
907
|
-
const
|
|
954
|
+
const u = i.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
|
|
908
955
|
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
909
|
-
|
|
956
|
+
ft,
|
|
910
957
|
{
|
|
911
958
|
onClick: () => {
|
|
912
|
-
|
|
959
|
+
r("action", i);
|
|
913
960
|
},
|
|
914
961
|
"aria-label": i.label,
|
|
915
962
|
title: i.label,
|
|
916
|
-
bgColor:
|
|
917
|
-
children: /* @__PURE__ */ n(
|
|
963
|
+
bgColor: u,
|
|
964
|
+
children: /* @__PURE__ */ n(v, { symbol: i.symbol, size: 25 })
|
|
918
965
|
}
|
|
919
966
|
) }, i.actionKey);
|
|
920
967
|
}
|
|
921
968
|
}
|
|
922
969
|
);
|
|
923
|
-
},
|
|
924
|
-
${(e) =>
|
|
970
|
+
}, gt = s(j)`
|
|
971
|
+
${(e) => O(e)}
|
|
925
972
|
> ul {
|
|
926
973
|
display: flex;
|
|
927
974
|
flex-wrap: wrap;
|
|
@@ -934,8 +981,8 @@ const ze = ({ className: e }) => {
|
|
|
934
981
|
}
|
|
935
982
|
}
|
|
936
983
|
${(e) => C(e)}
|
|
937
|
-
`,
|
|
938
|
-
${
|
|
984
|
+
`, ft = s(z)`
|
|
985
|
+
${K};
|
|
939
986
|
|
|
940
987
|
background-color: ${(e) => e.bgColor};
|
|
941
988
|
display: flex;
|
|
@@ -974,119 +1021,119 @@ const ze = ({ className: e }) => {
|
|
|
974
1021
|
stroke: #fff;
|
|
975
1022
|
}
|
|
976
1023
|
}
|
|
977
|
-
`,
|
|
978
|
-
|
|
1024
|
+
`, pt = ([e, t]) => ({ type: e, content: t }), yt = ({ items: e, dispatch: t }) => /* @__PURE__ */ n(
|
|
1025
|
+
bt,
|
|
979
1026
|
{
|
|
980
1027
|
className: "humany-message-list",
|
|
981
|
-
items: e.map(
|
|
1028
|
+
items: e.map(pt),
|
|
982
1029
|
renderLi: !0,
|
|
983
|
-
renderItem: (
|
|
984
|
-
switch (
|
|
1030
|
+
renderItem: (o) => {
|
|
1031
|
+
switch (o.type) {
|
|
985
1032
|
case k.Text:
|
|
986
|
-
return /* @__PURE__ */ n(
|
|
1033
|
+
return /* @__PURE__ */ n(mt, { text: o.content });
|
|
987
1034
|
case k.HTML:
|
|
988
|
-
return /* @__PURE__ */ n(
|
|
1035
|
+
return /* @__PURE__ */ n(tt, { ...o.content });
|
|
989
1036
|
case k.Separator:
|
|
990
|
-
return /* @__PURE__ */ n(
|
|
1037
|
+
return /* @__PURE__ */ n(ct, { ...o.content });
|
|
991
1038
|
case k.ItemList:
|
|
992
|
-
return /* @__PURE__ */ n(
|
|
1039
|
+
return /* @__PURE__ */ n(rt, { ...o.content, dispatch: t });
|
|
993
1040
|
case k.LinkList:
|
|
994
|
-
return /* @__PURE__ */ n(
|
|
1041
|
+
return /* @__PURE__ */ n(at, { ...o.content, dispatch: t });
|
|
995
1042
|
case k.ButtonList:
|
|
996
|
-
return /* @__PURE__ */ n(
|
|
1043
|
+
return /* @__PURE__ */ n(Je, { ...o.content, dispatch: t });
|
|
997
1044
|
case k.VideoRequest:
|
|
998
|
-
return /* @__PURE__ */ n(
|
|
1045
|
+
return /* @__PURE__ */ n(ut, { ...o.content, dispatch: t });
|
|
999
1046
|
default:
|
|
1000
|
-
return /* @__PURE__ */ n(
|
|
1047
|
+
return /* @__PURE__ */ n(et, { type: o.type, content: o.content });
|
|
1001
1048
|
}
|
|
1002
1049
|
}
|
|
1003
1050
|
}
|
|
1004
|
-
),
|
|
1005
|
-
${
|
|
1051
|
+
), bt = s(re)`
|
|
1052
|
+
${ve}
|
|
1006
1053
|
|
|
1007
1054
|
> li {
|
|
1008
1055
|
margin: 0;
|
|
1009
1056
|
}
|
|
1010
|
-
`,
|
|
1011
|
-
({ className: e, timestamp: t, sender:
|
|
1012
|
-
const
|
|
1057
|
+
`, $t = Q(
|
|
1058
|
+
({ className: e, timestamp: t, sender: o, type: r, content: a }, i) => {
|
|
1059
|
+
const u = ae(
|
|
1013
1060
|
(d) => {
|
|
1014
1061
|
let l = "first";
|
|
1015
1062
|
return a.length > 1 && (l = d === 0 ? "first" : d + 1 === a.length ? "last" : "middle"), l;
|
|
1016
1063
|
},
|
|
1017
1064
|
[a]
|
|
1018
|
-
), c = () => /* @__PURE__ */ n(
|
|
1065
|
+
), c = () => /* @__PURE__ */ n(R, { children: a.map((d) => {
|
|
1019
1066
|
const { key: l, body: $, title: S, form: L, actions: w } = d, y = !!$ && !S && !L && !w;
|
|
1020
1067
|
return /* @__PURE__ */ n(
|
|
1021
|
-
|
|
1068
|
+
_e,
|
|
1022
1069
|
{
|
|
1023
1070
|
className: e,
|
|
1024
1071
|
discrete: y,
|
|
1025
1072
|
ref: i,
|
|
1026
1073
|
timestamp: t,
|
|
1027
1074
|
fullWidth: !!L || !!w,
|
|
1028
|
-
children: y && $ ? /* @__PURE__ */ n(
|
|
1075
|
+
children: y && $ ? /* @__PURE__ */ n(G, { html: $ }) : /* @__PURE__ */ n(F, { isSystem: !0, content: d })
|
|
1029
1076
|
},
|
|
1030
1077
|
l
|
|
1031
1078
|
);
|
|
1032
|
-
}) }), p = () => /* @__PURE__ */ n(le, { sender:
|
|
1033
|
-
|
|
1079
|
+
}) }), p = () => /* @__PURE__ */ n(le, { sender: o, timestamp: t, className: e, children: /* @__PURE__ */ n(U, { className: "humany-message-content-bundle", children: a.map((d, l) => /* @__PURE__ */ n(
|
|
1080
|
+
_,
|
|
1034
1081
|
{
|
|
1035
1082
|
className: "humany-message-container",
|
|
1036
1083
|
left: !0,
|
|
1037
1084
|
ref: i,
|
|
1038
1085
|
children: /* @__PURE__ */ n(
|
|
1039
|
-
|
|
1086
|
+
F,
|
|
1040
1087
|
{
|
|
1041
1088
|
content: d,
|
|
1042
|
-
stacked:
|
|
1089
|
+
stacked: u(l)
|
|
1043
1090
|
}
|
|
1044
1091
|
)
|
|
1045
1092
|
},
|
|
1046
1093
|
d.key
|
|
1047
|
-
)) }) }),
|
|
1048
|
-
|
|
1094
|
+
)) }) }), x = () => /* @__PURE__ */ n(Ye, { timestamp: t, className: e, children: /* @__PURE__ */ n(U, { className: "humany-message-content-bundle", children: a.map((d, l) => /* @__PURE__ */ n(
|
|
1095
|
+
_,
|
|
1049
1096
|
{
|
|
1050
1097
|
className: "humany-message-container",
|
|
1051
1098
|
right: !0,
|
|
1052
1099
|
ref: i,
|
|
1053
1100
|
children: /* @__PURE__ */ n(
|
|
1054
|
-
|
|
1101
|
+
F,
|
|
1055
1102
|
{
|
|
1056
1103
|
isUser: !0,
|
|
1057
1104
|
content: d,
|
|
1058
|
-
stacked:
|
|
1105
|
+
stacked: u(l)
|
|
1059
1106
|
}
|
|
1060
1107
|
)
|
|
1061
1108
|
},
|
|
1062
1109
|
d.key
|
|
1063
1110
|
)) }) });
|
|
1064
|
-
switch (
|
|
1065
|
-
case
|
|
1111
|
+
switch (r) {
|
|
1112
|
+
case E.System:
|
|
1066
1113
|
return c();
|
|
1067
|
-
case
|
|
1114
|
+
case E.Agent:
|
|
1068
1115
|
return p();
|
|
1069
|
-
case
|
|
1070
|
-
return
|
|
1116
|
+
case E.User:
|
|
1117
|
+
return x();
|
|
1071
1118
|
default:
|
|
1072
1119
|
return null;
|
|
1073
1120
|
}
|
|
1074
1121
|
}
|
|
1075
|
-
),
|
|
1076
|
-
const a =
|
|
1077
|
-
return
|
|
1078
|
-
|
|
1122
|
+
), F = ({ content: e, isUser: t, isSystem: o, stacked: r }) => {
|
|
1123
|
+
const a = q(), { title: i, body: u, actions: c, form: p, items: x } = e;
|
|
1124
|
+
return x ? /* @__PURE__ */ n(V, { className: "humany-message-content", user: !!t, stacked: r, children: /* @__PURE__ */ n(yt, { items: x, dispatch: a }) }) : /* @__PURE__ */ m(
|
|
1125
|
+
V,
|
|
1079
1126
|
{
|
|
1080
1127
|
className: "humany-message-content",
|
|
1081
|
-
padded: !
|
|
1128
|
+
padded: !o,
|
|
1082
1129
|
user: !!t,
|
|
1083
|
-
stacked:
|
|
1130
|
+
stacked: r,
|
|
1084
1131
|
fullWidth: !!p || !!c,
|
|
1085
1132
|
children: [
|
|
1086
|
-
i && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(
|
|
1087
|
-
|
|
1133
|
+
i && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(Ke, { variant: "h2", children: i }) }),
|
|
1134
|
+
u && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(We, { html: u }) }),
|
|
1088
1135
|
p && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(
|
|
1089
|
-
|
|
1136
|
+
De,
|
|
1090
1137
|
{
|
|
1091
1138
|
...p,
|
|
1092
1139
|
onChange: (l, $) => {
|
|
@@ -1099,11 +1146,11 @@ const ze = ({ className: e }) => {
|
|
|
1099
1146
|
}
|
|
1100
1147
|
) }),
|
|
1101
1148
|
c && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(
|
|
1102
|
-
|
|
1149
|
+
Ee,
|
|
1103
1150
|
{
|
|
1104
1151
|
items: Object.keys(c).map((l) => ({ label: c[l], actionKey: l })),
|
|
1105
1152
|
renderItem: (l) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
1106
|
-
|
|
1153
|
+
Fe,
|
|
1107
1154
|
{
|
|
1108
1155
|
onClick: () => {
|
|
1109
1156
|
a("action", l.actionKey);
|
|
@@ -1124,31 +1171,31 @@ const ze = ({ className: e }) => {
|
|
|
1124
1171
|
behavior: "smooth"
|
|
1125
1172
|
});
|
|
1126
1173
|
}, 250);
|
|
1127
|
-
}, []), [t,
|
|
1128
|
-
messages:
|
|
1174
|
+
}, []), [t, o] = ne(!0), {
|
|
1175
|
+
messages: r,
|
|
1129
1176
|
loading: a,
|
|
1130
1177
|
typingActors: i = []
|
|
1131
|
-
} = I(),
|
|
1132
|
-
return /* @__PURE__ */
|
|
1133
|
-
/* @__PURE__ */
|
|
1134
|
-
|
|
1135
|
-
const { type:
|
|
1178
|
+
} = I(), u = () => i && i.length ? i.map((c, p) => /* @__PURE__ */ n(P, { id: `typing_${c.name}`, children: /* @__PURE__ */ n(le, { timestamp: Date.now(), sender: c, children: /* @__PURE__ */ n(Z, { boxed: !0, ref: e }) }) }, `typing_${c.name}`)) : null;
|
|
1179
|
+
return /* @__PURE__ */ m(R, { children: [
|
|
1180
|
+
/* @__PURE__ */ m(vt, { tabIndex: 0, scrollableCss: t, ref: o, children: [
|
|
1181
|
+
r && r.length ? r.map((c, p) => {
|
|
1182
|
+
const { type: x, timestamp: d, sender: l, content: $ } = c;
|
|
1136
1183
|
return /* @__PURE__ */ n(
|
|
1137
|
-
|
|
1184
|
+
P,
|
|
1138
1185
|
{
|
|
1139
1186
|
className: "humany-conversation-entry",
|
|
1140
1187
|
tabIndex: -1,
|
|
1141
|
-
children: /* @__PURE__ */ n(
|
|
1188
|
+
children: /* @__PURE__ */ n($t, { ...c, ref: e })
|
|
1142
1189
|
},
|
|
1143
|
-
`${
|
|
1190
|
+
`${x}_${l == null ? void 0 : l.name}_${d}_${$[0].key}`
|
|
1144
1191
|
);
|
|
1145
1192
|
}) : null,
|
|
1146
|
-
|
|
1147
|
-
a && /* @__PURE__ */ n(
|
|
1193
|
+
u(),
|
|
1194
|
+
a && /* @__PURE__ */ n(P, { children: /* @__PURE__ */ n(Z, { ref: e }) })
|
|
1148
1195
|
] }),
|
|
1149
|
-
/* @__PURE__ */ n(
|
|
1196
|
+
/* @__PURE__ */ n(Le, {})
|
|
1150
1197
|
] });
|
|
1151
|
-
},
|
|
1198
|
+
}, vt = s.div`
|
|
1152
1199
|
display: flex;
|
|
1153
1200
|
flex-direction: column;
|
|
1154
1201
|
align-items: stretch;
|
|
@@ -1161,7 +1208,7 @@ const ze = ({ className: e }) => {
|
|
|
1161
1208
|
&:focus-visible {
|
|
1162
1209
|
${(e) => f(e)};
|
|
1163
1210
|
}
|
|
1164
|
-
`,
|
|
1211
|
+
`, P = s.div`
|
|
1165
1212
|
margin: 0;
|
|
1166
1213
|
margin-bottom: ${(e) => {
|
|
1167
1214
|
var t;
|
|
@@ -1199,8 +1246,8 @@ const ze = ({ className: e }) => {
|
|
|
1199
1246
|
font-weight: normal;
|
|
1200
1247
|
`
|
|
1201
1248
|
)}
|
|
1202
|
-
`,
|
|
1203
|
-
const t =
|
|
1249
|
+
`, xt = ({ dispatch: e }) => {
|
|
1250
|
+
const t = Se(null);
|
|
1204
1251
|
return se(() => {
|
|
1205
1252
|
t.current && t.current.parentNode && e("overlay-mounted", t.current);
|
|
1206
1253
|
}, [t]), /* @__PURE__ */ n(
|
|
@@ -1211,26 +1258,26 @@ const ze = ({ className: e }) => {
|
|
|
1211
1258
|
ref: t
|
|
1212
1259
|
}
|
|
1213
1260
|
);
|
|
1214
|
-
},
|
|
1261
|
+
}, wt = ({
|
|
1215
1262
|
dispatch: e,
|
|
1216
1263
|
header: t,
|
|
1217
|
-
buttonLabel:
|
|
1218
|
-
}) => /* @__PURE__ */
|
|
1219
|
-
|
|
1264
|
+
buttonLabel: o
|
|
1265
|
+
}) => /* @__PURE__ */ m(
|
|
1266
|
+
kt,
|
|
1220
1267
|
{
|
|
1221
1268
|
portalId: "humany-conversation-portal",
|
|
1222
1269
|
className: "humany-conversation-outlet",
|
|
1223
1270
|
children: [
|
|
1224
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ m(Ct, { className: "humany-conversation-outlet-head", children: [
|
|
1225
1272
|
/* @__PURE__ */ n(
|
|
1226
|
-
|
|
1273
|
+
zt,
|
|
1227
1274
|
{
|
|
1228
1275
|
className: "humany-conversation-outlet-head-button",
|
|
1229
|
-
"aria-label":
|
|
1230
|
-
title:
|
|
1276
|
+
"aria-label": o,
|
|
1277
|
+
title: o,
|
|
1231
1278
|
onClick: () => e("hide-overlay-conversation"),
|
|
1232
1279
|
children: /* @__PURE__ */ n(
|
|
1233
|
-
|
|
1280
|
+
v,
|
|
1234
1281
|
{
|
|
1235
1282
|
symbol: {
|
|
1236
1283
|
type: "Svg",
|
|
@@ -1242,7 +1289,7 @@ const ze = ({ className: e }) => {
|
|
|
1242
1289
|
}
|
|
1243
1290
|
),
|
|
1244
1291
|
t && /* @__PURE__ */ n(
|
|
1245
|
-
|
|
1292
|
+
St,
|
|
1246
1293
|
{
|
|
1247
1294
|
className: "humany-conversation-outlet-header",
|
|
1248
1295
|
variant: "h1",
|
|
@@ -1253,7 +1300,7 @@ const ze = ({ className: e }) => {
|
|
|
1253
1300
|
/* @__PURE__ */ n(ce, {})
|
|
1254
1301
|
]
|
|
1255
1302
|
}
|
|
1256
|
-
),
|
|
1303
|
+
), kt = s(oe)`
|
|
1257
1304
|
z-index: 11;
|
|
1258
1305
|
top: auto;
|
|
1259
1306
|
height: 65%;
|
|
@@ -1268,7 +1315,7 @@ const ze = ({ className: e }) => {
|
|
|
1268
1315
|
var t;
|
|
1269
1316
|
return (t = e.theme.sizes) == null ? void 0 : t.large;
|
|
1270
1317
|
}};
|
|
1271
|
-
`,
|
|
1318
|
+
`, Ct = s.div`
|
|
1272
1319
|
display: flex;
|
|
1273
1320
|
flex-direction: column;
|
|
1274
1321
|
justify-content: center;
|
|
@@ -1282,7 +1329,7 @@ const ze = ({ className: e }) => {
|
|
|
1282
1329
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
1283
1330
|
}};
|
|
1284
1331
|
${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
|
|
1285
|
-
`,
|
|
1332
|
+
`, St = s(Y)`
|
|
1286
1333
|
font-size: ${(e) => {
|
|
1287
1334
|
var t;
|
|
1288
1335
|
return (t = e.theme.fonts) == null ? void 0 : t.medium;
|
|
@@ -1292,7 +1339,7 @@ const ze = ({ className: e }) => {
|
|
|
1292
1339
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
1293
1340
|
}};
|
|
1294
1341
|
margin: 0;
|
|
1295
|
-
`,
|
|
1342
|
+
`, zt = s(z)`
|
|
1296
1343
|
display: flex;
|
|
1297
1344
|
align-items: center;
|
|
1298
1345
|
justify-content: center;
|
|
@@ -1315,33 +1362,33 @@ const ze = ({ className: e }) => {
|
|
|
1315
1362
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
1316
1363
|
}};
|
|
1317
1364
|
}
|
|
1318
|
-
`,
|
|
1365
|
+
`, Dt = ({ className: e, ...t }) => {
|
|
1319
1366
|
const {
|
|
1320
|
-
overlay:
|
|
1321
|
-
overlayConversationHeader:
|
|
1367
|
+
overlay: o,
|
|
1368
|
+
overlayConversationHeader: r,
|
|
1322
1369
|
overlayConversationCloseLabel: a,
|
|
1323
1370
|
conversationControllerId: i
|
|
1324
|
-
} = I(),
|
|
1325
|
-
return /* @__PURE__ */
|
|
1326
|
-
|
|
1371
|
+
} = I(), u = q();
|
|
1372
|
+
return /* @__PURE__ */ m(
|
|
1373
|
+
xe.Provider,
|
|
1327
1374
|
{
|
|
1328
1375
|
value: i ? { id: i } : null,
|
|
1329
1376
|
children: [
|
|
1330
1377
|
/* @__PURE__ */ n(
|
|
1331
|
-
|
|
1378
|
+
Lt,
|
|
1332
1379
|
{
|
|
1333
1380
|
...t,
|
|
1334
1381
|
className: M(e, "humany-conversation-component"),
|
|
1335
1382
|
children: /* @__PURE__ */ n(ce, {})
|
|
1336
1383
|
}
|
|
1337
1384
|
),
|
|
1338
|
-
|
|
1339
|
-
/* @__PURE__ */ n(
|
|
1340
|
-
|
|
1341
|
-
|
|
1385
|
+
o && /* @__PURE__ */ m(R, { children: [
|
|
1386
|
+
/* @__PURE__ */ n(xt, { dispatch: u }),
|
|
1387
|
+
o.conversation && /* @__PURE__ */ n(
|
|
1388
|
+
wt,
|
|
1342
1389
|
{
|
|
1343
|
-
dispatch:
|
|
1344
|
-
header:
|
|
1390
|
+
dispatch: u,
|
|
1391
|
+
header: r,
|
|
1345
1392
|
buttonLabel: a
|
|
1346
1393
|
}
|
|
1347
1394
|
)
|
|
@@ -1349,7 +1396,7 @@ const ze = ({ className: e }) => {
|
|
|
1349
1396
|
]
|
|
1350
1397
|
}
|
|
1351
1398
|
);
|
|
1352
|
-
},
|
|
1399
|
+
}, Lt = s.div`
|
|
1353
1400
|
position: absolute;
|
|
1354
1401
|
right: 0;
|
|
1355
1402
|
left: 0;
|
|
@@ -1360,5 +1407,5 @@ const ze = ({ className: e }) => {
|
|
|
1360
1407
|
flex-direction: column;
|
|
1361
1408
|
`;
|
|
1362
1409
|
export {
|
|
1363
|
-
|
|
1410
|
+
Dt as default
|
|
1364
1411
|
};
|