@telia-ace/widget-conversation 1.1.1-rc.2 → 1.1.1-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{conversation-a6e3c255.mjs → conversation-b5103766.mjs} +367 -348
- package/conversation-cba1688c.js +588 -0
- package/index.js +3 -1
- package/index.mjs +1000 -17
- package/package.json +8 -8
- package/{return-button-6e4d528a.mjs → return-button-70a640cb.mjs} +10 -15
- package/{return-button-9eaa8113.js → return-button-cdc53d1f.js} +16 -16
- package/conversation-6ba99c32.js +0 -569
- package/index-4649598b.mjs +0 -7433
- package/index-a3c122bb.js +0 -1179
- package/use-dispatch-1d56ade2.js +0 -1
- package/use-dispatch-f89f5e06.mjs +0 -24
|
@@ -1,102 +1,74 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "react
|
|
7
|
-
import "
|
|
8
|
-
import {
|
|
9
|
-
import "
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let g;
|
|
15
|
-
return (t || r).getAsync("componentResolver").then((p) => {
|
|
16
|
-
if (m.current) {
|
|
17
|
-
const d = p.getComponent(c);
|
|
18
|
-
i(d);
|
|
19
|
-
}
|
|
20
|
-
g = p.registerResolver(c, (d) => {
|
|
21
|
-
m.current && i(d);
|
|
22
|
-
});
|
|
23
|
-
}), () => {
|
|
24
|
-
g && g();
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}, [m, c, t, r]), s;
|
|
28
|
-
}, Ie = () => {
|
|
29
|
-
const [e, t] = z(!1);
|
|
30
|
-
return O(() => {
|
|
31
|
-
const o = () => {
|
|
32
|
-
t(!1);
|
|
33
|
-
}, r = (s) => {
|
|
34
|
-
s.keyCode === 9 && t(!0);
|
|
35
|
-
};
|
|
36
|
-
return window.addEventListener("keydown", r), window.addEventListener("click", o), () => {
|
|
37
|
-
window.removeEventListener("keydown", r), window.removeEventListener("click", o);
|
|
38
|
-
};
|
|
39
|
-
}, []), e;
|
|
40
|
-
}, Me = ({ className: e }) => {
|
|
41
|
-
const [t, o] = z(""), [r, s] = z(!1), [i, m] = z(0), [c, g] = z(0), p = Ie(), d = X(), {
|
|
1
|
+
import { jsx as n, jsxs as m, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import s from "@emotion/styled";
|
|
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
|
+
import { appendClassNames as M } from "@telia-ace/widget-utilities";
|
|
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
|
+
import "@telia-ace/widget-core";
|
|
10
|
+
import "@telia-ace/widget-services";
|
|
11
|
+
import "@telia-ace/widget-plugins";
|
|
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(), {
|
|
42
14
|
inputPlaceholder: l = "Type your message",
|
|
43
|
-
inputHidden:
|
|
15
|
+
inputHidden: $ = !1,
|
|
44
16
|
inputDisabled: S = !1,
|
|
45
|
-
sendButtonLabel:
|
|
17
|
+
sendButtonLabel: L = "Send message",
|
|
46
18
|
inputMultiline: w = !0,
|
|
47
|
-
secondaryAction:
|
|
48
|
-
} =
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
const { lineHeight:
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
|
|
19
|
+
secondaryAction: y
|
|
20
|
+
} = I(), [de, b] = ne(!0);
|
|
21
|
+
se(() => {
|
|
22
|
+
if (b.current) {
|
|
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);
|
|
55
27
|
const ge = H.split("px");
|
|
56
|
-
|
|
28
|
+
p(parseInt(ge[0], 10));
|
|
57
29
|
}
|
|
58
30
|
}
|
|
59
|
-
}, [
|
|
60
|
-
const
|
|
61
|
-
!
|
|
62
|
-
}, me = (
|
|
63
|
-
|
|
64
|
-
actionKey:
|
|
65
|
-
...
|
|
31
|
+
}, [b.current]);
|
|
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
|
+
actionKey: y.action,
|
|
37
|
+
...y
|
|
66
38
|
}));
|
|
67
|
-
},
|
|
68
|
-
if (w &&
|
|
69
|
-
const H =
|
|
39
|
+
}, he = (h) => {
|
|
40
|
+
if (w && b.current) {
|
|
41
|
+
const H = b.current.scrollHeight;
|
|
70
42
|
if (H > i) {
|
|
71
|
-
|
|
72
|
-
let
|
|
73
|
-
|
|
43
|
+
b.current.style.height = "auto";
|
|
44
|
+
let N = H;
|
|
45
|
+
h.length < 1 && (N = i), b.current.style.height = `${N}px`, N >= c ? b.current.style.overflowY = "scroll" : b.current.style.overflowY = "hidden";
|
|
74
46
|
}
|
|
75
47
|
}
|
|
76
|
-
},
|
|
77
|
-
|
|
48
|
+
}, W = (h) => {
|
|
49
|
+
he(h), o(h), h && h.length > 0 && d("user-typing", { textLength: h.length });
|
|
78
50
|
};
|
|
79
|
-
return
|
|
80
|
-
|
|
51
|
+
return $ ? null : /* @__PURE__ */ m(
|
|
52
|
+
He,
|
|
81
53
|
{
|
|
82
54
|
grow: w,
|
|
83
|
-
className:
|
|
55
|
+
className: M("humany-conversation-input", e),
|
|
84
56
|
"data-has-focus": r,
|
|
85
57
|
scrollableCss: de,
|
|
86
|
-
isTabbing:
|
|
58
|
+
isTabbing: x,
|
|
87
59
|
children: [
|
|
88
|
-
|
|
89
|
-
|
|
60
|
+
y && /* @__PURE__ */ n(
|
|
61
|
+
Me,
|
|
90
62
|
{
|
|
91
63
|
disabled: S,
|
|
92
64
|
onClick: me,
|
|
93
|
-
title:
|
|
94
|
-
"aria-label":
|
|
65
|
+
title: y.label,
|
|
66
|
+
"aria-label": y.label,
|
|
95
67
|
children: /* @__PURE__ */ n(
|
|
96
|
-
|
|
68
|
+
v,
|
|
97
69
|
{
|
|
98
70
|
size: 24,
|
|
99
|
-
symbol: { type: "Svg", content:
|
|
71
|
+
symbol: { type: "Svg", content: y.icon || "browse" }
|
|
100
72
|
}
|
|
101
73
|
)
|
|
102
74
|
}
|
|
@@ -105,37 +77,37 @@ const Le = (e, t) => {
|
|
|
105
77
|
Ne,
|
|
106
78
|
{
|
|
107
79
|
value: t,
|
|
108
|
-
onChange:
|
|
109
|
-
onEnter:
|
|
80
|
+
onChange: W,
|
|
81
|
+
onEnter: D,
|
|
110
82
|
disabled: S,
|
|
111
83
|
"aria-label": l,
|
|
112
84
|
placeholder: l,
|
|
113
|
-
onFocusChange:
|
|
85
|
+
onFocusChange: a,
|
|
114
86
|
type: "textarea",
|
|
115
87
|
rows: 1,
|
|
116
|
-
ref:
|
|
88
|
+
ref: b
|
|
117
89
|
}
|
|
118
90
|
) : /* @__PURE__ */ n(
|
|
119
|
-
|
|
91
|
+
Ie,
|
|
120
92
|
{
|
|
121
93
|
value: t,
|
|
122
|
-
onChange:
|
|
123
|
-
onEnter:
|
|
94
|
+
onChange: W,
|
|
95
|
+
onEnter: D,
|
|
124
96
|
disabled: S,
|
|
125
97
|
"aria-label": l,
|
|
126
98
|
placeholder: l,
|
|
127
|
-
onFocusChange:
|
|
99
|
+
onFocusChange: a
|
|
128
100
|
}
|
|
129
101
|
),
|
|
130
102
|
/* @__PURE__ */ n(
|
|
131
103
|
ie,
|
|
132
104
|
{
|
|
133
105
|
disabled: S,
|
|
134
|
-
onClick:
|
|
135
|
-
title:
|
|
136
|
-
"aria-label":
|
|
106
|
+
onClick: D,
|
|
107
|
+
title: L,
|
|
108
|
+
"aria-label": L,
|
|
137
109
|
children: /* @__PURE__ */ n(
|
|
138
|
-
|
|
110
|
+
Te,
|
|
139
111
|
{
|
|
140
112
|
size: 22,
|
|
141
113
|
symbol: { type: "Svg", content: "send" },
|
|
@@ -147,7 +119,7 @@ const Le = (e, t) => {
|
|
|
147
119
|
]
|
|
148
120
|
}
|
|
149
121
|
);
|
|
150
|
-
}, Ne =
|
|
122
|
+
}, Ne = s(te)`
|
|
151
123
|
resize: none;
|
|
152
124
|
flex: 1;
|
|
153
125
|
flex-shrink: 1;
|
|
@@ -167,7 +139,7 @@ const Le = (e, t) => {
|
|
|
167
139
|
border: none;
|
|
168
140
|
transition: height 200ms linear;
|
|
169
141
|
outline: none;
|
|
170
|
-
`,
|
|
142
|
+
`, Ie = s(te)`
|
|
171
143
|
flex: 1;
|
|
172
144
|
border: none;
|
|
173
145
|
background-color: transparent;
|
|
@@ -193,7 +165,7 @@ const Le = (e, t) => {
|
|
|
193
165
|
}};
|
|
194
166
|
font-style: italic;
|
|
195
167
|
}
|
|
196
|
-
`, ie =
|
|
168
|
+
`, ie = s(z)`
|
|
197
169
|
flex: 0 0 50px;
|
|
198
170
|
align-self: stretch;
|
|
199
171
|
background-color: transparent;
|
|
@@ -203,19 +175,19 @@ const Le = (e, t) => {
|
|
|
203
175
|
border: none;
|
|
204
176
|
color: #a6a6a6;
|
|
205
177
|
&:focus-visible {
|
|
206
|
-
${
|
|
178
|
+
${f};
|
|
207
179
|
}
|
|
208
|
-
`,
|
|
180
|
+
`, Me = s(ie)`
|
|
209
181
|
border-right: ${(e) => e.theme.border};
|
|
210
182
|
margin: ${(e) => {
|
|
211
183
|
var t;
|
|
212
184
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
213
185
|
}} 0;
|
|
214
|
-
`,
|
|
215
|
-
${(e) => e.grow ?
|
|
186
|
+
`, He = s.div`
|
|
187
|
+
${(e) => e.grow ? g`
|
|
216
188
|
min-height: 50px;
|
|
217
189
|
max-height: 150px;
|
|
218
|
-
` :
|
|
190
|
+
` : g`
|
|
219
191
|
height: 50px;
|
|
220
192
|
`}
|
|
221
193
|
flex: 0 0 auto;
|
|
@@ -226,15 +198,15 @@ const Le = (e, t) => {
|
|
|
226
198
|
return (t = e.theme.colors) == null ? void 0 : t.accent;
|
|
227
199
|
}};
|
|
228
200
|
border-top: ${(e) => e.theme.inputBorder};
|
|
229
|
-
${(e) => e["data-has-focus"] && e.isTabbing &&
|
|
201
|
+
${(e) => e["data-has-focus"] && e.isTabbing && f}
|
|
230
202
|
textarea {
|
|
231
203
|
${(e) => !!e.scrollableCss && e.scrollableCss}
|
|
232
204
|
}
|
|
233
|
-
`,
|
|
205
|
+
`, Te = s(
|
|
234
206
|
({
|
|
235
207
|
hasContent: e,
|
|
236
208
|
...t
|
|
237
|
-
}) => /* @__PURE__ */ n(
|
|
209
|
+
}) => /* @__PURE__ */ n(v, { ...t })
|
|
238
210
|
)`
|
|
239
211
|
line,
|
|
240
212
|
path {
|
|
@@ -247,7 +219,7 @@ const Le = (e, t) => {
|
|
|
247
219
|
return e.hasContent ? (t = e.theme.colors) == null ? void 0 : t.primary : "#a6a6a6";
|
|
248
220
|
}};
|
|
249
221
|
}
|
|
250
|
-
`,
|
|
222
|
+
`, Ae = s.div`
|
|
251
223
|
width: ${(e) => e.avatarSize || "32px"};
|
|
252
224
|
height: ${(e) => e.avatarSize || "32px"};
|
|
253
225
|
border-radius: 50%;
|
|
@@ -294,7 +266,7 @@ const Le = (e, t) => {
|
|
|
294
266
|
}};
|
|
295
267
|
}
|
|
296
268
|
}
|
|
297
|
-
`,
|
|
269
|
+
`, Be = we`
|
|
298
270
|
0% {
|
|
299
271
|
opacity: 0;
|
|
300
272
|
}
|
|
@@ -304,7 +276,7 @@ const Le = (e, t) => {
|
|
|
304
276
|
100% {
|
|
305
277
|
opacity: 0;
|
|
306
278
|
}
|
|
307
|
-
`,
|
|
279
|
+
`, Re = s.div`
|
|
308
280
|
display: flex;
|
|
309
281
|
justify-content: center;
|
|
310
282
|
> div {
|
|
@@ -316,7 +288,7 @@ const Le = (e, t) => {
|
|
|
316
288
|
var t;
|
|
317
289
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
318
290
|
}};
|
|
319
|
-
animation: ${
|
|
291
|
+
animation: ${Be} 1s infinite;
|
|
320
292
|
}
|
|
321
293
|
> div:nth-of-type(2) {
|
|
322
294
|
animation-delay: 100ms;
|
|
@@ -324,29 +296,29 @@ const Le = (e, t) => {
|
|
|
324
296
|
> div:nth-of-type(3) {
|
|
325
297
|
animation-delay: 200ms;
|
|
326
298
|
}
|
|
327
|
-
`, U =
|
|
299
|
+
`, U = s.div`
|
|
328
300
|
grid-area: content;
|
|
329
301
|
max-width: 100%;
|
|
330
302
|
overflow: hidden;
|
|
331
|
-
`,
|
|
303
|
+
`, Ke = s(Y)`
|
|
332
304
|
font-size: ${(e) => {
|
|
333
305
|
var t;
|
|
334
306
|
return (t = e.theme.fonts) == null ? void 0 : t.normal;
|
|
335
307
|
}};
|
|
336
308
|
font-weight: normal;
|
|
337
309
|
margin: 0;
|
|
338
|
-
`, _ =
|
|
310
|
+
`, _ = s.div`
|
|
339
311
|
display: flex;
|
|
340
312
|
${(e) => e.left && "justify-content: start;"};
|
|
341
313
|
${(e) => e.center && "justify-content: center;"};
|
|
342
314
|
${(e) => e.right && "justify-content: end;"};
|
|
343
|
-
`, V =
|
|
315
|
+
`, V = s.div`
|
|
344
316
|
${(e) => {
|
|
345
317
|
var t;
|
|
346
318
|
return e.padded && `padding: ${(t = e.theme.sizes) == null ? void 0 : t.medium};`;
|
|
347
319
|
}}
|
|
348
|
-
${(e) => !e.user && e.stacked &&
|
|
349
|
-
${(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)}
|
|
350
322
|
|
|
351
323
|
display: inline-block;
|
|
352
324
|
margin-top: ${(e) => {
|
|
@@ -362,14 +334,14 @@ const Le = (e, t) => {
|
|
|
362
334
|
}
|
|
363
335
|
max-width: 100%;
|
|
364
336
|
${(e) => e.fullWidth && "width: 100%;"}
|
|
365
|
-
`,
|
|
366
|
-
var r,
|
|
367
|
-
const o =
|
|
337
|
+
`, je = (e, t) => {
|
|
338
|
+
var r, a;
|
|
339
|
+
const o = g`
|
|
368
340
|
background-color: ${(r = t.colors) == null ? void 0 : r.accent};
|
|
369
|
-
color: ${(
|
|
341
|
+
color: ${(a = t.colors) == null ? void 0 : a.text};
|
|
370
342
|
${t.border && `border: ${t.border};`};
|
|
371
343
|
`;
|
|
372
|
-
return t.borderRadius ?
|
|
344
|
+
return t.borderRadius ? g`
|
|
373
345
|
${o}
|
|
374
346
|
|
|
375
347
|
border-top-right-radius: ${t.borderRadius};
|
|
@@ -383,13 +355,13 @@ const Le = (e, t) => {
|
|
|
383
355
|
border-bottom-left-radius: ${t.borderRadius};
|
|
384
356
|
`}
|
|
385
357
|
` : o;
|
|
386
|
-
},
|
|
387
|
-
var r,
|
|
388
|
-
const o =
|
|
358
|
+
}, Oe = (e, t) => {
|
|
359
|
+
var r, a;
|
|
360
|
+
const o = g`
|
|
389
361
|
background-color: ${(r = t.colors) == null ? void 0 : r.primary};
|
|
390
|
-
color: ${(
|
|
362
|
+
color: ${(a = t.colors) == null ? void 0 : a.accent};
|
|
391
363
|
`;
|
|
392
|
-
return t.borderRadius ?
|
|
364
|
+
return t.borderRadius ? g`
|
|
393
365
|
${o}
|
|
394
366
|
|
|
395
367
|
border-top-left-radius: ${t.borderRadius};
|
|
@@ -403,7 +375,7 @@ const Le = (e, t) => {
|
|
|
403
375
|
border-bottom-right-radius: ${t.borderRadius};
|
|
404
376
|
`}
|
|
405
377
|
` : o;
|
|
406
|
-
}, A =
|
|
378
|
+
}, A = s.div`
|
|
407
379
|
margin-bottom: ${(e) => {
|
|
408
380
|
var t;
|
|
409
381
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
@@ -413,18 +385,18 @@ const Le = (e, t) => {
|
|
|
413
385
|
}
|
|
414
386
|
`, C = (e) => {
|
|
415
387
|
var t, o;
|
|
416
|
-
return
|
|
388
|
+
return g`
|
|
417
389
|
margin: ${(t = e.theme.sizes) == null ? void 0 : t.medium} 0;
|
|
418
390
|
padding: 0 ${(o = e.theme.sizes) == null ? void 0 : o.medium};
|
|
419
391
|
`;
|
|
420
|
-
},
|
|
392
|
+
}, De = s(ze)`
|
|
421
393
|
& button.humany-form-component-button {
|
|
422
394
|
${(e) => {
|
|
423
|
-
var t, o, r,
|
|
424
|
-
return ((t = e.theme.colors) == null ? void 0 : t.primary) && ((o = e.theme.colors) == null ? void 0 : o.accent) &&
|
|
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({
|
|
425
397
|
active: !1,
|
|
426
398
|
primaryColor: (r = e.theme.colors) == null ? void 0 : r.primary,
|
|
427
|
-
secondaryColor: (
|
|
399
|
+
secondaryColor: (a = e.theme.colors) == null ? void 0 : a.accent,
|
|
428
400
|
theme: e.theme
|
|
429
401
|
});
|
|
430
402
|
}};
|
|
@@ -445,18 +417,18 @@ const Le = (e, t) => {
|
|
|
445
417
|
}};
|
|
446
418
|
}
|
|
447
419
|
}
|
|
448
|
-
`,
|
|
420
|
+
`, We = s(G)`
|
|
449
421
|
white-space: pre-wrap;
|
|
450
422
|
a {
|
|
451
423
|
color: ${(e) => e.theme.colors.link};
|
|
452
424
|
&:focus {
|
|
453
425
|
${(e) => {
|
|
454
426
|
var t;
|
|
455
|
-
return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) &&
|
|
427
|
+
return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) && f;
|
|
456
428
|
}};
|
|
457
429
|
}
|
|
458
430
|
}
|
|
459
|
-
`,
|
|
431
|
+
`, Ee = s(re)`
|
|
460
432
|
padding: 0;
|
|
461
433
|
list-style: none;
|
|
462
434
|
margin: 0 -${(e) => {
|
|
@@ -469,8 +441,8 @@ const Le = (e, t) => {
|
|
|
469
441
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
470
442
|
}};
|
|
471
443
|
}
|
|
472
|
-
`,
|
|
473
|
-
${(e) =>
|
|
444
|
+
`, Fe = s.button`
|
|
445
|
+
${(e) => K(e)};
|
|
474
446
|
display: block;
|
|
475
447
|
background-color: ${(e) => {
|
|
476
448
|
var t;
|
|
@@ -479,16 +451,16 @@ const Le = (e, t) => {
|
|
|
479
451
|
width: 100%;
|
|
480
452
|
color: #fff;
|
|
481
453
|
&:focus-visible {
|
|
482
|
-
${
|
|
454
|
+
${f}
|
|
483
455
|
background-color: transparent;
|
|
484
456
|
}
|
|
485
|
-
`,
|
|
486
|
-
({ 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__ */
|
|
457
|
+
`, Z = Q(
|
|
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: [
|
|
487
459
|
/* @__PURE__ */ n("div", {}),
|
|
488
460
|
/* @__PURE__ */ n("div", {}),
|
|
489
461
|
/* @__PURE__ */ n("div", {})
|
|
490
462
|
] }) }) }) })
|
|
491
|
-
),
|
|
463
|
+
), Pe = s.p`
|
|
492
464
|
&& {
|
|
493
465
|
font-size: ${(e) => {
|
|
494
466
|
var t;
|
|
@@ -503,77 +475,77 @@ const Le = (e, t) => {
|
|
|
503
475
|
var t;
|
|
504
476
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
505
477
|
}};
|
|
506
|
-
`,
|
|
478
|
+
`, ee = (e) => new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }), B = ({ className: e, name: t, timestamp: o }) => {
|
|
507
479
|
if (!t && !o)
|
|
508
480
|
return null;
|
|
509
481
|
let r = "";
|
|
510
|
-
return t ? o ? r = `${t}: ${
|
|
482
|
+
return t ? o ? r = `${t}: ${ee(o)}` : r = t : o && (r = ee(o)), /* @__PURE__ */ n(Pe, { children: r });
|
|
511
483
|
}, le = ({
|
|
512
484
|
className: e,
|
|
513
485
|
children: t,
|
|
514
486
|
sender: o,
|
|
515
487
|
timestamp: r
|
|
516
488
|
}) => {
|
|
517
|
-
const { avatar:
|
|
518
|
-
return /* @__PURE__ */
|
|
519
|
-
|
|
489
|
+
const { avatar: a, name: i } = o, { avatarSize: u } = I();
|
|
490
|
+
return /* @__PURE__ */ m(
|
|
491
|
+
Ue,
|
|
520
492
|
{
|
|
521
|
-
hasAvatar: !!
|
|
522
|
-
className:
|
|
493
|
+
hasAvatar: !!a,
|
|
494
|
+
className: M(
|
|
523
495
|
e,
|
|
524
496
|
"humany-conversation-agent-message"
|
|
525
497
|
),
|
|
526
498
|
children: [
|
|
527
|
-
|
|
499
|
+
a && /* @__PURE__ */ n(Ae, { avatarSize: u, children: typeof a == "string" ? (
|
|
528
500
|
// eslint-disable-next-line jsx-a11y/alt-text
|
|
529
|
-
/* @__PURE__ */ n("img", { src:
|
|
530
|
-
) : /* @__PURE__ */ n(
|
|
501
|
+
/* @__PURE__ */ n("img", { src: a })
|
|
502
|
+
) : /* @__PURE__ */ n(v, { symbol: a }) }),
|
|
531
503
|
t,
|
|
532
|
-
/* @__PURE__ */ n(
|
|
504
|
+
/* @__PURE__ */ n(B, { name: i, timestamp: r })
|
|
533
505
|
]
|
|
534
506
|
}
|
|
535
507
|
);
|
|
536
|
-
},
|
|
508
|
+
}, Ue = s.div`
|
|
537
509
|
display: grid;
|
|
538
510
|
margin-right: 10%;
|
|
539
511
|
width: 90%;
|
|
540
|
-
${(e) => e.hasAvatar ?
|
|
512
|
+
${(e) => e.hasAvatar ? g`
|
|
541
513
|
grid-template-columns: auto 1fr;
|
|
542
514
|
grid-template-rows: 1fr auto;
|
|
543
515
|
grid-template-areas:
|
|
544
516
|
'avatar content'
|
|
545
517
|
'. info';
|
|
546
|
-
` :
|
|
518
|
+
` : g`
|
|
547
519
|
grid-template-columns: 1fr;
|
|
548
520
|
grid-template-rows: 1fr auto;
|
|
549
521
|
grid-template-areas:
|
|
550
522
|
'content'
|
|
551
523
|
'info';
|
|
552
524
|
`};
|
|
553
|
-
`,
|
|
554
|
-
({ className: e, children: t, timestamp: o, discrete: r, fullWidth:
|
|
555
|
-
|
|
525
|
+
`, _e = Q(
|
|
526
|
+
({ className: e, children: t, timestamp: o, discrete: r, fullWidth: a }, i) => /* @__PURE__ */ n(
|
|
527
|
+
Ve,
|
|
556
528
|
{
|
|
557
529
|
ref: i,
|
|
558
|
-
className:
|
|
559
|
-
fullWidth:
|
|
560
|
-
children: r ? /* @__PURE__ */
|
|
530
|
+
className: M(e, "humany-conversation-system-message"),
|
|
531
|
+
fullWidth: a,
|
|
532
|
+
children: r ? /* @__PURE__ */ m(qe, { className: "humany-conversation-discrete-message", children: [
|
|
561
533
|
t,
|
|
562
|
-
/* @__PURE__ */ n(
|
|
563
|
-
] }) : /* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ n(B, { timestamp: o })
|
|
535
|
+
] }) : /* @__PURE__ */ m(R, { children: [
|
|
564
536
|
t,
|
|
565
|
-
/* @__PURE__ */ n(
|
|
537
|
+
/* @__PURE__ */ n(B, { timestamp: o })
|
|
566
538
|
] })
|
|
567
539
|
}
|
|
568
540
|
)
|
|
569
|
-
),
|
|
541
|
+
), Ve = s.div`
|
|
570
542
|
${(e) => e.fullWidth && "width: 100%"};
|
|
571
543
|
padding: 0 ${(e) => {
|
|
572
544
|
var t;
|
|
573
545
|
return (t = e.theme.sizes) == null ? void 0 : t.large;
|
|
574
546
|
}};
|
|
575
547
|
overflow: auto;
|
|
576
|
-
`,
|
|
548
|
+
`, qe = s.div`
|
|
577
549
|
text-align: center;
|
|
578
550
|
word-wrap: break-word;
|
|
579
551
|
font-size: ${(e) => {
|
|
@@ -587,115 +559,162 @@ const Le = (e, t) => {
|
|
|
587
559
|
> p {
|
|
588
560
|
margin: 0;
|
|
589
561
|
}
|
|
590
|
-
`,
|
|
591
|
-
const { userLabel: r = "" } =
|
|
592
|
-
return /* @__PURE__ */
|
|
593
|
-
|
|
562
|
+
`, Ye = ({ className: e, children: t, timestamp: o }) => {
|
|
563
|
+
const { userLabel: r = "" } = I();
|
|
564
|
+
return /* @__PURE__ */ m(
|
|
565
|
+
Ge,
|
|
594
566
|
{
|
|
595
|
-
className:
|
|
567
|
+
className: M(e, "humany-conversation-user-message"),
|
|
596
568
|
children: [
|
|
597
569
|
t,
|
|
598
|
-
/* @__PURE__ */ n(
|
|
570
|
+
/* @__PURE__ */ n(B, { name: r, timestamp: o })
|
|
599
571
|
]
|
|
600
572
|
}
|
|
601
573
|
);
|
|
602
|
-
},
|
|
574
|
+
}, Ge = s.div`
|
|
603
575
|
margin-left: 10%;
|
|
604
576
|
width: 90%;
|
|
605
577
|
display: flex;
|
|
606
578
|
flex-direction: column;
|
|
607
579
|
align-items: flex-end;
|
|
608
|
-
`,
|
|
580
|
+
`, X = (e) => Array.isArray(e) ? e : Object.keys(e).map((t) => ({
|
|
609
581
|
label: e[t],
|
|
610
582
|
actionKey: t
|
|
611
|
-
})),
|
|
612
|
-
|
|
583
|
+
})), Je = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
|
|
584
|
+
Qe,
|
|
613
585
|
{
|
|
614
586
|
className: "humany-conversation-button-list",
|
|
615
587
|
header: e,
|
|
616
|
-
items:
|
|
617
|
-
renderItem: (r) =>
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
r.
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
588
|
+
items: X(t),
|
|
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
|
+
}
|
|
631
622
|
}
|
|
632
|
-
),
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
623
|
+
), Qe = s(j)`
|
|
624
|
+
${O}
|
|
625
|
+
> ul {
|
|
626
|
+
display: flex;
|
|
627
|
+
flex-wrap: wrap;
|
|
628
|
+
gap: ${(e) => {
|
|
638
629
|
var t;
|
|
639
630
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
640
631
|
}};
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}
|
|
632
|
+
> li {
|
|
633
|
+
margin: 0;
|
|
644
634
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
635
|
+
}
|
|
636
|
+
${C}
|
|
637
|
+
`, Xe = s(ye)`
|
|
638
|
+
${K};
|
|
648
639
|
|
|
649
|
-
|
|
650
|
-
|
|
640
|
+
display: block;
|
|
641
|
+
padding: ${(e) => {
|
|
651
642
|
var t;
|
|
652
643
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
653
644
|
}};
|
|
654
|
-
|
|
645
|
+
background-color: ${(e) => {
|
|
655
646
|
var t;
|
|
656
647
|
return (t = e.theme.colors) == null ? void 0 : t.primary;
|
|
657
648
|
}};
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
649
|
+
width: 100%;
|
|
650
|
+
color: #ffffff;
|
|
651
|
+
overflow: hidden;
|
|
652
|
+
text-overflow: ellipsis;
|
|
653
|
+
&:focus-visible {
|
|
654
|
+
${f}
|
|
655
|
+
background-color: transparent;
|
|
656
|
+
}
|
|
666
657
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
658
|
+
i,
|
|
659
|
+
svg {
|
|
660
|
+
margin-right: ${(e) => {
|
|
670
661
|
var t;
|
|
671
662
|
return (t = e.theme.sizes) == null ? void 0 : t.small;
|
|
672
663
|
}};
|
|
673
|
-
|
|
674
|
-
`,
|
|
675
|
-
|
|
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);
|
|
676
695
|
return !o || !e ? null : /* @__PURE__ */ n(ke, { fallback: null, children: /* @__PURE__ */ n(o, { ...t }) });
|
|
677
|
-
},
|
|
678
|
-
${
|
|
696
|
+
}, tt = ({ body: e }) => /* @__PURE__ */ n(nt, { html: e }), nt = s(G)`
|
|
697
|
+
${$e}
|
|
679
698
|
color: inherit;
|
|
680
699
|
white-space: pre-wrap;
|
|
681
700
|
${C}
|
|
682
701
|
a {
|
|
683
702
|
color: ${(e) => e.theme.colors.link};
|
|
684
703
|
&:focus-visible {
|
|
685
|
-
${
|
|
704
|
+
${f};
|
|
686
705
|
}
|
|
687
706
|
}
|
|
688
707
|
`, rt = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
|
|
689
|
-
|
|
708
|
+
ot,
|
|
690
709
|
{
|
|
691
710
|
className: "humany-conversation-item-list",
|
|
692
711
|
header: e,
|
|
693
|
-
items:
|
|
712
|
+
items: X(t),
|
|
694
713
|
renderItem: (r) => {
|
|
695
|
-
var
|
|
696
|
-
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */
|
|
697
|
-
((
|
|
698
|
-
|
|
714
|
+
var a;
|
|
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,
|
|
699
718
|
{
|
|
700
719
|
size: 22,
|
|
701
720
|
symbol: {
|
|
@@ -704,9 +723,9 @@ const Le = (e, t) => {
|
|
|
704
723
|
}
|
|
705
724
|
}
|
|
706
725
|
) }),
|
|
707
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ m("div", { className: "item-body", children: [
|
|
708
727
|
/* @__PURE__ */ n(
|
|
709
|
-
|
|
728
|
+
z,
|
|
710
729
|
{
|
|
711
730
|
onClick: () => {
|
|
712
731
|
o("action", r);
|
|
@@ -721,8 +740,8 @@ const Le = (e, t) => {
|
|
|
721
740
|
] }) }, r.actionKey);
|
|
722
741
|
}
|
|
723
742
|
}
|
|
724
|
-
),
|
|
725
|
-
${
|
|
743
|
+
), ot = s(j)`
|
|
744
|
+
${O}
|
|
726
745
|
|
|
727
746
|
> .humany-paragraph {
|
|
728
747
|
${C}
|
|
@@ -735,7 +754,7 @@ const Le = (e, t) => {
|
|
|
735
754
|
|
|
736
755
|
${(e) => J(e)(
|
|
737
756
|
"h1",
|
|
738
|
-
|
|
757
|
+
g`
|
|
739
758
|
white-space: normal;
|
|
740
759
|
`
|
|
741
760
|
)}
|
|
@@ -759,7 +778,7 @@ const Le = (e, t) => {
|
|
|
759
778
|
border-bottom: none;
|
|
760
779
|
}
|
|
761
780
|
}
|
|
762
|
-
`,
|
|
781
|
+
`, st = s.div`
|
|
763
782
|
display: flex;
|
|
764
783
|
gap: ${(e) => {
|
|
765
784
|
var t;
|
|
@@ -798,7 +817,7 @@ const Le = (e, t) => {
|
|
|
798
817
|
margin: 0;
|
|
799
818
|
|
|
800
819
|
&:focus-visible {
|
|
801
|
-
${
|
|
820
|
+
${f}
|
|
802
821
|
span {
|
|
803
822
|
color: ${(e) => {
|
|
804
823
|
var t;
|
|
@@ -808,14 +827,14 @@ const Le = (e, t) => {
|
|
|
808
827
|
}
|
|
809
828
|
}
|
|
810
829
|
}
|
|
811
|
-
`,
|
|
812
|
-
|
|
830
|
+
`, at = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n(
|
|
831
|
+
it,
|
|
813
832
|
{
|
|
814
833
|
className: "humany-conversation-link-list",
|
|
815
834
|
header: e,
|
|
816
|
-
items:
|
|
817
|
-
renderItem: (r) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */
|
|
818
|
-
|
|
835
|
+
items: X(t),
|
|
836
|
+
renderItem: (r) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(
|
|
837
|
+
lt,
|
|
819
838
|
{
|
|
820
839
|
help: r.actionKey === "help",
|
|
821
840
|
onClick: () => {
|
|
@@ -826,7 +845,7 @@ const Le = (e, t) => {
|
|
|
826
845
|
children: [
|
|
827
846
|
r.label,
|
|
828
847
|
r.actionKey === "help" && /* @__PURE__ */ n(
|
|
829
|
-
|
|
848
|
+
v,
|
|
830
849
|
{
|
|
831
850
|
size: 14,
|
|
832
851
|
symbol: {
|
|
@@ -839,13 +858,13 @@ const Le = (e, t) => {
|
|
|
839
858
|
}
|
|
840
859
|
) }, r.actionKey)
|
|
841
860
|
}
|
|
842
|
-
),
|
|
843
|
-
${
|
|
861
|
+
), it = s(j)`
|
|
862
|
+
${O}
|
|
844
863
|
${C}
|
|
845
864
|
|
|
846
865
|
${(e) => J(e)(
|
|
847
866
|
"h1",
|
|
848
|
-
|
|
867
|
+
g`
|
|
849
868
|
white-space: normal;
|
|
850
869
|
`
|
|
851
870
|
)}
|
|
@@ -861,7 +880,7 @@ const Le = (e, t) => {
|
|
|
861
880
|
margin: 0;
|
|
862
881
|
}
|
|
863
882
|
}
|
|
864
|
-
`,
|
|
883
|
+
`, lt = s(z)`
|
|
865
884
|
display: block;
|
|
866
885
|
text-align: left;
|
|
867
886
|
font-weight: 300;
|
|
@@ -875,7 +894,7 @@ const Le = (e, t) => {
|
|
|
875
894
|
|
|
876
895
|
${(e) => {
|
|
877
896
|
var t, o;
|
|
878
|
-
return e.help &&
|
|
897
|
+
return e.help && g`
|
|
879
898
|
color: ${(t = e.theme.colors) == null ? void 0 : t.text};
|
|
880
899
|
text-decoration: underline;
|
|
881
900
|
|
|
@@ -887,7 +906,7 @@ const Le = (e, t) => {
|
|
|
887
906
|
}}
|
|
888
907
|
|
|
889
908
|
&:focus-visible {
|
|
890
|
-
${
|
|
909
|
+
${f}
|
|
891
910
|
span {
|
|
892
911
|
color: ${(e) => {
|
|
893
912
|
var t;
|
|
@@ -896,18 +915,18 @@ const Le = (e, t) => {
|
|
|
896
915
|
text-decoration: underline;
|
|
897
916
|
}
|
|
898
917
|
}
|
|
899
|
-
`,
|
|
918
|
+
`, ct = () => /* @__PURE__ */ n(dt, { className: "humany-conversation-separator" }), dt = s.div`
|
|
900
919
|
${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
|
|
901
920
|
width: 100%;
|
|
902
|
-
`,
|
|
921
|
+
`, mt = ({ text: e }) => /* @__PURE__ */ n(ht, { className: "humany-conversation-text", variant: "span", children: e }), ht = s(Y)`
|
|
903
922
|
${C}
|
|
904
|
-
`,
|
|
923
|
+
`, ut = ({
|
|
905
924
|
header: e = "Video call",
|
|
906
925
|
acceptLabel: t = "Accept",
|
|
907
926
|
declineLabel: o = "Decline",
|
|
908
927
|
dispatch: r
|
|
909
928
|
}) => {
|
|
910
|
-
const
|
|
929
|
+
const a = Ce(() => [
|
|
911
930
|
{
|
|
912
931
|
label: t,
|
|
913
932
|
actionKey: "accept-video-call",
|
|
@@ -926,30 +945,30 @@ const Le = (e, t) => {
|
|
|
926
945
|
}
|
|
927
946
|
], [t, o]);
|
|
928
947
|
return /* @__PURE__ */ n(
|
|
929
|
-
|
|
948
|
+
gt,
|
|
930
949
|
{
|
|
931
950
|
className: "humany-conversation-video-request",
|
|
932
951
|
header: e,
|
|
933
|
-
items:
|
|
952
|
+
items: a,
|
|
934
953
|
renderItem: (i) => {
|
|
935
|
-
const
|
|
954
|
+
const u = i.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
|
|
936
955
|
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
937
|
-
|
|
956
|
+
ft,
|
|
938
957
|
{
|
|
939
958
|
onClick: () => {
|
|
940
959
|
r("action", i);
|
|
941
960
|
},
|
|
942
961
|
"aria-label": i.label,
|
|
943
962
|
title: i.label,
|
|
944
|
-
bgColor:
|
|
945
|
-
children: /* @__PURE__ */ n(
|
|
963
|
+
bgColor: u,
|
|
964
|
+
children: /* @__PURE__ */ n(v, { symbol: i.symbol, size: 25 })
|
|
946
965
|
}
|
|
947
966
|
) }, i.actionKey);
|
|
948
967
|
}
|
|
949
968
|
}
|
|
950
969
|
);
|
|
951
|
-
},
|
|
952
|
-
${(e) =>
|
|
970
|
+
}, gt = s(j)`
|
|
971
|
+
${(e) => O(e)}
|
|
953
972
|
> ul {
|
|
954
973
|
display: flex;
|
|
955
974
|
flex-wrap: wrap;
|
|
@@ -962,8 +981,8 @@ const Le = (e, t) => {
|
|
|
962
981
|
}
|
|
963
982
|
}
|
|
964
983
|
${(e) => C(e)}
|
|
965
|
-
`,
|
|
966
|
-
${
|
|
984
|
+
`, ft = s(z)`
|
|
985
|
+
${K};
|
|
967
986
|
|
|
968
987
|
background-color: ${(e) => e.bgColor};
|
|
969
988
|
display: flex;
|
|
@@ -975,7 +994,7 @@ const Le = (e, t) => {
|
|
|
975
994
|
border-radius: 100%;
|
|
976
995
|
|
|
977
996
|
&:focus-visible {
|
|
978
|
-
${
|
|
997
|
+
${f}
|
|
979
998
|
background-color: transparent;
|
|
980
999
|
|
|
981
1000
|
i,
|
|
@@ -1002,62 +1021,62 @@ const Le = (e, t) => {
|
|
|
1002
1021
|
stroke: #fff;
|
|
1003
1022
|
}
|
|
1004
1023
|
}
|
|
1005
|
-
`,
|
|
1006
|
-
|
|
1024
|
+
`, pt = ([e, t]) => ({ type: e, content: t }), yt = ({ items: e, dispatch: t }) => /* @__PURE__ */ n(
|
|
1025
|
+
bt,
|
|
1007
1026
|
{
|
|
1008
1027
|
className: "humany-message-list",
|
|
1009
|
-
items: e.map(
|
|
1028
|
+
items: e.map(pt),
|
|
1010
1029
|
renderLi: !0,
|
|
1011
1030
|
renderItem: (o) => {
|
|
1012
1031
|
switch (o.type) {
|
|
1013
1032
|
case k.Text:
|
|
1014
|
-
return /* @__PURE__ */ n(
|
|
1033
|
+
return /* @__PURE__ */ n(mt, { text: o.content });
|
|
1015
1034
|
case k.HTML:
|
|
1016
|
-
return /* @__PURE__ */ n(
|
|
1035
|
+
return /* @__PURE__ */ n(tt, { ...o.content });
|
|
1017
1036
|
case k.Separator:
|
|
1018
|
-
return /* @__PURE__ */ n(
|
|
1037
|
+
return /* @__PURE__ */ n(ct, { ...o.content });
|
|
1019
1038
|
case k.ItemList:
|
|
1020
1039
|
return /* @__PURE__ */ n(rt, { ...o.content, dispatch: t });
|
|
1021
1040
|
case k.LinkList:
|
|
1022
|
-
return /* @__PURE__ */ n(
|
|
1041
|
+
return /* @__PURE__ */ n(at, { ...o.content, dispatch: t });
|
|
1023
1042
|
case k.ButtonList:
|
|
1024
|
-
return /* @__PURE__ */ n(
|
|
1043
|
+
return /* @__PURE__ */ n(Je, { ...o.content, dispatch: t });
|
|
1025
1044
|
case k.VideoRequest:
|
|
1026
|
-
return /* @__PURE__ */ n(
|
|
1045
|
+
return /* @__PURE__ */ n(ut, { ...o.content, dispatch: t });
|
|
1027
1046
|
default:
|
|
1028
|
-
return /* @__PURE__ */ n(
|
|
1047
|
+
return /* @__PURE__ */ n(et, { type: o.type, content: o.content });
|
|
1029
1048
|
}
|
|
1030
1049
|
}
|
|
1031
1050
|
}
|
|
1032
|
-
),
|
|
1033
|
-
${
|
|
1051
|
+
), bt = s(re)`
|
|
1052
|
+
${ve}
|
|
1034
1053
|
|
|
1035
1054
|
> li {
|
|
1036
1055
|
margin: 0;
|
|
1037
1056
|
}
|
|
1038
|
-
`,
|
|
1039
|
-
({ className: e, timestamp: t, sender: o, type: r, content:
|
|
1040
|
-
const
|
|
1057
|
+
`, $t = Q(
|
|
1058
|
+
({ className: e, timestamp: t, sender: o, type: r, content: a }, i) => {
|
|
1059
|
+
const u = ae(
|
|
1041
1060
|
(d) => {
|
|
1042
1061
|
let l = "first";
|
|
1043
|
-
return
|
|
1062
|
+
return a.length > 1 && (l = d === 0 ? "first" : d + 1 === a.length ? "last" : "middle"), l;
|
|
1044
1063
|
},
|
|
1045
|
-
[
|
|
1046
|
-
), c = () => /* @__PURE__ */ n(
|
|
1047
|
-
const { key: l, body:
|
|
1064
|
+
[a]
|
|
1065
|
+
), c = () => /* @__PURE__ */ n(R, { children: a.map((d) => {
|
|
1066
|
+
const { key: l, body: $, title: S, form: L, actions: w } = d, y = !!$ && !S && !L && !w;
|
|
1048
1067
|
return /* @__PURE__ */ n(
|
|
1049
|
-
|
|
1068
|
+
_e,
|
|
1050
1069
|
{
|
|
1051
1070
|
className: e,
|
|
1052
|
-
discrete:
|
|
1071
|
+
discrete: y,
|
|
1053
1072
|
ref: i,
|
|
1054
1073
|
timestamp: t,
|
|
1055
|
-
fullWidth: !!
|
|
1056
|
-
children:
|
|
1074
|
+
fullWidth: !!L || !!w,
|
|
1075
|
+
children: y && $ ? /* @__PURE__ */ n(G, { html: $ }) : /* @__PURE__ */ n(F, { isSystem: !0, content: d })
|
|
1057
1076
|
},
|
|
1058
1077
|
l
|
|
1059
1078
|
);
|
|
1060
|
-
}) }),
|
|
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(
|
|
1061
1080
|
_,
|
|
1062
1081
|
{
|
|
1063
1082
|
className: "humany-message-container",
|
|
@@ -1067,12 +1086,12 @@ const Le = (e, t) => {
|
|
|
1067
1086
|
F,
|
|
1068
1087
|
{
|
|
1069
1088
|
content: d,
|
|
1070
|
-
stacked:
|
|
1089
|
+
stacked: u(l)
|
|
1071
1090
|
}
|
|
1072
1091
|
)
|
|
1073
1092
|
},
|
|
1074
1093
|
d.key
|
|
1075
|
-
)) }) }),
|
|
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(
|
|
1076
1095
|
_,
|
|
1077
1096
|
{
|
|
1078
1097
|
className: "humany-message-container",
|
|
@@ -1083,58 +1102,58 @@ const Le = (e, t) => {
|
|
|
1083
1102
|
{
|
|
1084
1103
|
isUser: !0,
|
|
1085
1104
|
content: d,
|
|
1086
|
-
stacked:
|
|
1105
|
+
stacked: u(l)
|
|
1087
1106
|
}
|
|
1088
1107
|
)
|
|
1089
1108
|
},
|
|
1090
1109
|
d.key
|
|
1091
1110
|
)) }) });
|
|
1092
1111
|
switch (r) {
|
|
1093
|
-
case
|
|
1112
|
+
case E.System:
|
|
1094
1113
|
return c();
|
|
1095
|
-
case
|
|
1096
|
-
return g();
|
|
1097
|
-
case W.User:
|
|
1114
|
+
case E.Agent:
|
|
1098
1115
|
return p();
|
|
1116
|
+
case E.User:
|
|
1117
|
+
return x();
|
|
1099
1118
|
default:
|
|
1100
1119
|
return null;
|
|
1101
1120
|
}
|
|
1102
1121
|
}
|
|
1103
1122
|
), F = ({ content: e, isUser: t, isSystem: o, stacked: r }) => {
|
|
1104
|
-
const
|
|
1105
|
-
return
|
|
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(
|
|
1106
1125
|
V,
|
|
1107
1126
|
{
|
|
1108
1127
|
className: "humany-message-content",
|
|
1109
1128
|
padded: !o,
|
|
1110
1129
|
user: !!t,
|
|
1111
1130
|
stacked: r,
|
|
1112
|
-
fullWidth: !!
|
|
1131
|
+
fullWidth: !!p || !!c,
|
|
1113
1132
|
children: [
|
|
1114
|
-
i && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1133
|
+
i && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(Ke, { variant: "h2", children: i }) }),
|
|
1134
|
+
u && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(We, { html: u }) }),
|
|
1135
|
+
p && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(
|
|
1136
|
+
De,
|
|
1118
1137
|
{
|
|
1119
|
-
...
|
|
1120
|
-
onChange: (l,
|
|
1121
|
-
|
|
1122
|
-
data:
|
|
1123
|
-
formKey:
|
|
1138
|
+
...p,
|
|
1139
|
+
onChange: (l, $) => {
|
|
1140
|
+
a("form", {
|
|
1141
|
+
data: $,
|
|
1142
|
+
formKey: p.schema.id,
|
|
1124
1143
|
actionKey: l
|
|
1125
1144
|
});
|
|
1126
1145
|
}
|
|
1127
1146
|
}
|
|
1128
1147
|
) }),
|
|
1129
1148
|
c && /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(
|
|
1130
|
-
|
|
1149
|
+
Ee,
|
|
1131
1150
|
{
|
|
1132
1151
|
items: Object.keys(c).map((l) => ({ label: c[l], actionKey: l })),
|
|
1133
1152
|
renderItem: (l) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
1134
|
-
|
|
1153
|
+
Fe,
|
|
1135
1154
|
{
|
|
1136
1155
|
onClick: () => {
|
|
1137
|
-
|
|
1156
|
+
a("action", l.actionKey);
|
|
1138
1157
|
},
|
|
1139
1158
|
children: l.label
|
|
1140
1159
|
}
|
|
@@ -1152,31 +1171,31 @@ const Le = (e, t) => {
|
|
|
1152
1171
|
behavior: "smooth"
|
|
1153
1172
|
});
|
|
1154
1173
|
}, 250);
|
|
1155
|
-
}, []), [t, o] =
|
|
1174
|
+
}, []), [t, o] = ne(!0), {
|
|
1156
1175
|
messages: r,
|
|
1157
|
-
loading:
|
|
1176
|
+
loading: a,
|
|
1158
1177
|
typingActors: i = []
|
|
1159
|
-
} =
|
|
1160
|
-
return /* @__PURE__ */
|
|
1161
|
-
/* @__PURE__ */
|
|
1162
|
-
r && r.length ? r.map((c,
|
|
1163
|
-
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;
|
|
1164
1183
|
return /* @__PURE__ */ n(
|
|
1165
1184
|
P,
|
|
1166
1185
|
{
|
|
1167
1186
|
className: "humany-conversation-entry",
|
|
1168
1187
|
tabIndex: -1,
|
|
1169
|
-
children: /* @__PURE__ */ n(
|
|
1188
|
+
children: /* @__PURE__ */ n($t, { ...c, ref: e })
|
|
1170
1189
|
},
|
|
1171
|
-
`${
|
|
1190
|
+
`${x}_${l == null ? void 0 : l.name}_${d}_${$[0].key}`
|
|
1172
1191
|
);
|
|
1173
1192
|
}) : null,
|
|
1174
|
-
|
|
1175
|
-
|
|
1193
|
+
u(),
|
|
1194
|
+
a && /* @__PURE__ */ n(P, { children: /* @__PURE__ */ n(Z, { ref: e }) })
|
|
1176
1195
|
] }),
|
|
1177
|
-
/* @__PURE__ */ n(
|
|
1196
|
+
/* @__PURE__ */ n(Le, {})
|
|
1178
1197
|
] });
|
|
1179
|
-
},
|
|
1198
|
+
}, vt = s.div`
|
|
1180
1199
|
display: flex;
|
|
1181
1200
|
flex-direction: column;
|
|
1182
1201
|
align-items: stretch;
|
|
@@ -1187,9 +1206,9 @@ const Le = (e, t) => {
|
|
|
1187
1206
|
}};
|
|
1188
1207
|
${(e) => !!e.scrollableCss && e.scrollableCss};
|
|
1189
1208
|
&:focus-visible {
|
|
1190
|
-
${(e) =>
|
|
1209
|
+
${(e) => f(e)};
|
|
1191
1210
|
}
|
|
1192
|
-
`, P =
|
|
1211
|
+
`, P = s.div`
|
|
1193
1212
|
margin: 0;
|
|
1194
1213
|
margin-bottom: ${(e) => {
|
|
1195
1214
|
var t;
|
|
@@ -1223,42 +1242,42 @@ const Le = (e, t) => {
|
|
|
1223
1242
|
}
|
|
1224
1243
|
${(e) => J(e)(
|
|
1225
1244
|
"h1",
|
|
1226
|
-
|
|
1245
|
+
g`
|
|
1227
1246
|
font-weight: normal;
|
|
1228
1247
|
`
|
|
1229
1248
|
)}
|
|
1230
|
-
`,
|
|
1249
|
+
`, xt = ({ dispatch: e }) => {
|
|
1231
1250
|
const t = Se(null);
|
|
1232
|
-
return
|
|
1251
|
+
return se(() => {
|
|
1233
1252
|
t.current && t.current.parentNode && e("overlay-mounted", t.current);
|
|
1234
1253
|
}, [t]), /* @__PURE__ */ n(
|
|
1235
|
-
|
|
1254
|
+
oe,
|
|
1236
1255
|
{
|
|
1237
1256
|
portalId: "humany-conversation-overlay-portal",
|
|
1238
1257
|
className: "humany-conversation-overlay-outlet",
|
|
1239
1258
|
ref: t
|
|
1240
1259
|
}
|
|
1241
1260
|
);
|
|
1242
|
-
},
|
|
1261
|
+
}, wt = ({
|
|
1243
1262
|
dispatch: e,
|
|
1244
1263
|
header: t,
|
|
1245
1264
|
buttonLabel: o
|
|
1246
|
-
}) => /* @__PURE__ */
|
|
1247
|
-
|
|
1265
|
+
}) => /* @__PURE__ */ m(
|
|
1266
|
+
kt,
|
|
1248
1267
|
{
|
|
1249
1268
|
portalId: "humany-conversation-portal",
|
|
1250
1269
|
className: "humany-conversation-outlet",
|
|
1251
1270
|
children: [
|
|
1252
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ m(Ct, { className: "humany-conversation-outlet-head", children: [
|
|
1253
1272
|
/* @__PURE__ */ n(
|
|
1254
|
-
|
|
1273
|
+
zt,
|
|
1255
1274
|
{
|
|
1256
1275
|
className: "humany-conversation-outlet-head-button",
|
|
1257
1276
|
"aria-label": o,
|
|
1258
1277
|
title: o,
|
|
1259
1278
|
onClick: () => e("hide-overlay-conversation"),
|
|
1260
1279
|
children: /* @__PURE__ */ n(
|
|
1261
|
-
|
|
1280
|
+
v,
|
|
1262
1281
|
{
|
|
1263
1282
|
symbol: {
|
|
1264
1283
|
type: "Svg",
|
|
@@ -1270,7 +1289,7 @@ const Le = (e, t) => {
|
|
|
1270
1289
|
}
|
|
1271
1290
|
),
|
|
1272
1291
|
t && /* @__PURE__ */ n(
|
|
1273
|
-
|
|
1292
|
+
St,
|
|
1274
1293
|
{
|
|
1275
1294
|
className: "humany-conversation-outlet-header",
|
|
1276
1295
|
variant: "h1",
|
|
@@ -1281,7 +1300,7 @@ const Le = (e, t) => {
|
|
|
1281
1300
|
/* @__PURE__ */ n(ce, {})
|
|
1282
1301
|
]
|
|
1283
1302
|
}
|
|
1284
|
-
),
|
|
1303
|
+
), kt = s(oe)`
|
|
1285
1304
|
z-index: 11;
|
|
1286
1305
|
top: auto;
|
|
1287
1306
|
height: 65%;
|
|
@@ -1296,7 +1315,7 @@ const Le = (e, t) => {
|
|
|
1296
1315
|
var t;
|
|
1297
1316
|
return (t = e.theme.sizes) == null ? void 0 : t.large;
|
|
1298
1317
|
}};
|
|
1299
|
-
`,
|
|
1318
|
+
`, Ct = s.div`
|
|
1300
1319
|
display: flex;
|
|
1301
1320
|
flex-direction: column;
|
|
1302
1321
|
justify-content: center;
|
|
@@ -1310,7 +1329,7 @@ const Le = (e, t) => {
|
|
|
1310
1329
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
1311
1330
|
}};
|
|
1312
1331
|
${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
|
|
1313
|
-
`,
|
|
1332
|
+
`, St = s(Y)`
|
|
1314
1333
|
font-size: ${(e) => {
|
|
1315
1334
|
var t;
|
|
1316
1335
|
return (t = e.theme.fonts) == null ? void 0 : t.medium;
|
|
@@ -1320,7 +1339,7 @@ const Le = (e, t) => {
|
|
|
1320
1339
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
1321
1340
|
}};
|
|
1322
1341
|
margin: 0;
|
|
1323
|
-
`,
|
|
1342
|
+
`, zt = s(z)`
|
|
1324
1343
|
display: flex;
|
|
1325
1344
|
align-items: center;
|
|
1326
1345
|
justify-content: center;
|
|
@@ -1334,7 +1353,7 @@ const Le = (e, t) => {
|
|
|
1334
1353
|
${(e) => e.theme.borderRadius && `border-radius: ${e.theme.borderRadius};`}
|
|
1335
1354
|
|
|
1336
1355
|
&:focus-visible {
|
|
1337
|
-
${
|
|
1356
|
+
${f};
|
|
1338
1357
|
}
|
|
1339
1358
|
|
|
1340
1359
|
svg line {
|
|
@@ -1343,41 +1362,41 @@ const Le = (e, t) => {
|
|
|
1343
1362
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
1344
1363
|
}};
|
|
1345
1364
|
}
|
|
1346
|
-
`,
|
|
1365
|
+
`, Dt = ({ className: e, ...t }) => {
|
|
1347
1366
|
const {
|
|
1348
1367
|
overlay: o,
|
|
1349
1368
|
overlayConversationHeader: r,
|
|
1350
|
-
overlayConversationCloseLabel:
|
|
1369
|
+
overlayConversationCloseLabel: a,
|
|
1351
1370
|
conversationControllerId: i
|
|
1352
|
-
} =
|
|
1353
|
-
return /* @__PURE__ */
|
|
1354
|
-
|
|
1371
|
+
} = I(), u = q();
|
|
1372
|
+
return /* @__PURE__ */ m(
|
|
1373
|
+
xe.Provider,
|
|
1355
1374
|
{
|
|
1356
1375
|
value: i ? { id: i } : null,
|
|
1357
1376
|
children: [
|
|
1358
1377
|
/* @__PURE__ */ n(
|
|
1359
|
-
|
|
1378
|
+
Lt,
|
|
1360
1379
|
{
|
|
1361
1380
|
...t,
|
|
1362
|
-
className:
|
|
1381
|
+
className: M(e, "humany-conversation-component"),
|
|
1363
1382
|
children: /* @__PURE__ */ n(ce, {})
|
|
1364
1383
|
}
|
|
1365
1384
|
),
|
|
1366
|
-
o && /* @__PURE__ */
|
|
1367
|
-
/* @__PURE__ */ n(
|
|
1385
|
+
o && /* @__PURE__ */ m(R, { children: [
|
|
1386
|
+
/* @__PURE__ */ n(xt, { dispatch: u }),
|
|
1368
1387
|
o.conversation && /* @__PURE__ */ n(
|
|
1369
|
-
|
|
1388
|
+
wt,
|
|
1370
1389
|
{
|
|
1371
|
-
dispatch:
|
|
1390
|
+
dispatch: u,
|
|
1372
1391
|
header: r,
|
|
1373
|
-
buttonLabel:
|
|
1392
|
+
buttonLabel: a
|
|
1374
1393
|
}
|
|
1375
1394
|
)
|
|
1376
1395
|
] })
|
|
1377
1396
|
]
|
|
1378
1397
|
}
|
|
1379
1398
|
);
|
|
1380
|
-
},
|
|
1399
|
+
}, Lt = s.div`
|
|
1381
1400
|
position: absolute;
|
|
1382
1401
|
right: 0;
|
|
1383
1402
|
left: 0;
|
|
@@ -1388,5 +1407,5 @@ const Le = (e, t) => {
|
|
|
1388
1407
|
flex-direction: column;
|
|
1389
1408
|
`;
|
|
1390
1409
|
export {
|
|
1391
|
-
|
|
1410
|
+
Dt as default
|
|
1392
1411
|
};
|