@telia-ace/widget-conversation 1.0.40 → 1.0.41
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.
|
@@ -2,42 +2,42 @@ var ve = Object.defineProperty, Ee = Object.defineProperties;
|
|
|
2
2
|
var xe = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var T = Object.getOwnPropertySymbols;
|
|
4
4
|
var ne = Object.prototype.hasOwnProperty, re = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var te = (e, t,
|
|
6
|
-
for (var
|
|
7
|
-
ne.call(t,
|
|
5
|
+
var te = (e, t, o) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, g = (e, t) => {
|
|
6
|
+
for (var o in t || (t = {}))
|
|
7
|
+
ne.call(t, o) && te(e, o, t[o]);
|
|
8
8
|
if (T)
|
|
9
|
-
for (var
|
|
10
|
-
re.call(t,
|
|
9
|
+
for (var o of T(t))
|
|
10
|
+
re.call(t, o) && te(e, o, t[o]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
for (var
|
|
16
|
-
ne.call(e,
|
|
12
|
+
}, x = (e, t) => Ee(e, xe(t));
|
|
13
|
+
var W = (e, t) => {
|
|
14
|
+
var o = {};
|
|
15
|
+
for (var r in e)
|
|
16
|
+
ne.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
|
|
17
17
|
if (e != null && T)
|
|
18
|
-
for (var
|
|
19
|
-
t.indexOf(
|
|
20
|
-
return
|
|
18
|
+
for (var r of T(e))
|
|
19
|
+
t.indexOf(r) < 0 && re.call(e, r) && (o[r] = e[r]);
|
|
20
|
+
return o;
|
|
21
21
|
};
|
|
22
|
-
import
|
|
23
|
-
import { useIsTabbing as ke, useDispatch as
|
|
22
|
+
import l from "@emotion/styled";
|
|
23
|
+
import { useIsTabbing as ke, useDispatch as G, useProperties as N, useScroll as le, SymbolBadge as v, Input as se, Button as z, borderTabStyle as f, Typography as J, invertedHoverButton as we, Html as Q, List as ie, buttonCss as K, ItemList as O, itemList as j, Link as Ce, useComponent as Se, genericHtml as ze, headingElement as X, list as Le, WidgetOverlayOutlet as ce, ConversationContext as Me } from "@telia-ace/widget-ui";
|
|
24
24
|
import { appendClassNames as I } from "@telia-ace/widget-utilities";
|
|
25
|
-
import n, { useState as A, useEffect as me, forwardRef as Z, Suspense as
|
|
26
|
-
import { css as y, keyframes as
|
|
27
|
-
import { FormComponent as
|
|
28
|
-
import { ConversationMessageListItemType as w, ConversationMessageType as
|
|
25
|
+
import n, { useState as A, useEffect as me, forwardRef as Z, Suspense as Ne, useMemo as Ie, useCallback as de, useRef as He } from "react";
|
|
26
|
+
import { css as y, keyframes as Te } from "@emotion/react";
|
|
27
|
+
import { FormComponent as Ae } from "@telia-ace/widget-forms";
|
|
28
|
+
import { ConversationMessageListItemType as w, ConversationMessageType as P } from "./index.js";
|
|
29
29
|
import "@telia-ace/widget-core";
|
|
30
30
|
import "@telia-ace/widget-services";
|
|
31
31
|
import "@telia-ace/widget-plugins";
|
|
32
|
-
const
|
|
33
|
-
const [t,
|
|
32
|
+
const Re = ({ className: e }) => {
|
|
33
|
+
const [t, o] = A(""), [r, a] = A(!1), [s, u] = A(0), [c, h] = A(0), E = ke(), m = G(), {
|
|
34
34
|
inputPlaceholder: i = "Type your message",
|
|
35
35
|
inputHidden: $ = !1,
|
|
36
36
|
inputDisabled: S = !1,
|
|
37
37
|
sendButtonLabel: L = "Send message",
|
|
38
38
|
inputMultiline: k = !0,
|
|
39
|
-
secondaryAction:
|
|
40
|
-
} = N(), [ye, b] =
|
|
39
|
+
secondaryAction: p
|
|
40
|
+
} = N(), [ye, b] = le(!0);
|
|
41
41
|
me(() => {
|
|
42
42
|
if (b.current) {
|
|
43
43
|
const { lineHeight: d, maxHeight: H } = getComputedStyle(b.current);
|
|
@@ -49,85 +49,85 @@ const Ae = ({ className: e }) => {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}, [b.current]);
|
|
52
|
-
const
|
|
53
|
-
!d.shiftKey || !k ? (d.preventDefault(), t && t.length > 0 && (m("user-submit", { text: t }),
|
|
54
|
-
}, pe = (d) => {
|
|
55
|
-
f && (d.preventDefault(), m("action", g({
|
|
56
|
-
actionKey: f.action
|
|
57
|
-
}, f)));
|
|
52
|
+
const D = (d) => {
|
|
53
|
+
!d.shiftKey || !k ? (d.preventDefault(), t && t.length > 0 && (m("user-submit", { text: t }), o(""), F(""))) : t.length < 1 && d.preventDefault();
|
|
58
54
|
}, fe = (d) => {
|
|
55
|
+
p && (d.preventDefault(), m("action", g({
|
|
56
|
+
actionKey: p.action
|
|
57
|
+
}, p)));
|
|
58
|
+
}, pe = (d) => {
|
|
59
59
|
if (k && b.current) {
|
|
60
60
|
const H = b.current.scrollHeight;
|
|
61
|
-
if (H >
|
|
61
|
+
if (H > s) {
|
|
62
62
|
b.current.style.height = "auto";
|
|
63
63
|
let M = H;
|
|
64
|
-
d.length < 1 && (M =
|
|
64
|
+
d.length < 1 && (M = s), b.current.style.height = `${M}px`, M >= c ? b.current.style.overflowY = "scroll" : b.current.style.overflowY = "hidden";
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
},
|
|
68
|
-
|
|
67
|
+
}, F = (d) => {
|
|
68
|
+
pe(d), o(d), d && d.length > 0 && m("user-typing", { textLength: d.length });
|
|
69
69
|
};
|
|
70
70
|
return $ ? null : /* @__PURE__ */ n.createElement(
|
|
71
|
-
|
|
71
|
+
je,
|
|
72
72
|
{
|
|
73
73
|
grow: k,
|
|
74
74
|
className: I("humany-conversation-input", e),
|
|
75
|
-
"data-has-focus":
|
|
75
|
+
"data-has-focus": r,
|
|
76
76
|
scrollableCss: ye,
|
|
77
|
-
isTabbing:
|
|
77
|
+
isTabbing: E
|
|
78
78
|
},
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
p && /* @__PURE__ */ n.createElement(
|
|
80
|
+
Oe,
|
|
81
81
|
{
|
|
82
82
|
disabled: S,
|
|
83
|
-
onClick:
|
|
84
|
-
title:
|
|
85
|
-
"aria-label":
|
|
83
|
+
onClick: fe,
|
|
84
|
+
title: p.label,
|
|
85
|
+
"aria-label": p.label
|
|
86
86
|
},
|
|
87
87
|
/* @__PURE__ */ n.createElement(
|
|
88
|
-
|
|
88
|
+
v,
|
|
89
89
|
{
|
|
90
90
|
size: 24,
|
|
91
|
-
symbol: { type: "Svg", content:
|
|
91
|
+
symbol: { type: "Svg", content: p.icon || "browse" }
|
|
92
92
|
}
|
|
93
93
|
)
|
|
94
94
|
),
|
|
95
95
|
k ? /* @__PURE__ */ n.createElement(
|
|
96
|
-
|
|
96
|
+
Be,
|
|
97
97
|
{
|
|
98
98
|
value: t,
|
|
99
|
-
onChange:
|
|
100
|
-
onEnter:
|
|
99
|
+
onChange: F,
|
|
100
|
+
onEnter: D,
|
|
101
101
|
disabled: S,
|
|
102
102
|
"aria-label": i,
|
|
103
103
|
placeholder: i,
|
|
104
|
-
onFocusChange:
|
|
104
|
+
onFocusChange: a,
|
|
105
105
|
type: "textarea",
|
|
106
106
|
rows: 1,
|
|
107
107
|
ref: b
|
|
108
108
|
}
|
|
109
109
|
) : /* @__PURE__ */ n.createElement(
|
|
110
|
-
|
|
110
|
+
Ke,
|
|
111
111
|
{
|
|
112
112
|
value: t,
|
|
113
|
-
onChange:
|
|
114
|
-
onEnter:
|
|
113
|
+
onChange: F,
|
|
114
|
+
onEnter: D,
|
|
115
115
|
disabled: S,
|
|
116
116
|
"aria-label": i,
|
|
117
117
|
placeholder: i,
|
|
118
|
-
onFocusChange:
|
|
118
|
+
onFocusChange: a
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
121
|
/* @__PURE__ */ n.createElement(
|
|
122
122
|
ue,
|
|
123
123
|
{
|
|
124
124
|
disabled: S,
|
|
125
|
-
onClick:
|
|
125
|
+
onClick: D,
|
|
126
126
|
title: L,
|
|
127
127
|
"aria-label": L
|
|
128
128
|
},
|
|
129
129
|
/* @__PURE__ */ n.createElement(
|
|
130
|
-
|
|
130
|
+
De,
|
|
131
131
|
{
|
|
132
132
|
size: 22,
|
|
133
133
|
symbol: { type: "Svg", content: "send" },
|
|
@@ -136,7 +136,7 @@ const Ae = ({ className: e }) => {
|
|
|
136
136
|
)
|
|
137
137
|
)
|
|
138
138
|
);
|
|
139
|
-
},
|
|
139
|
+
}, Be = l(se)`
|
|
140
140
|
resize: none;
|
|
141
141
|
flex: 1;
|
|
142
142
|
flex-shrink: 1;
|
|
@@ -156,7 +156,7 @@ const Ae = ({ className: e }) => {
|
|
|
156
156
|
border: none;
|
|
157
157
|
transition: height 200ms linear;
|
|
158
158
|
outline: none;
|
|
159
|
-
`,
|
|
159
|
+
`, Ke = l(se)`
|
|
160
160
|
flex: 1;
|
|
161
161
|
border: none;
|
|
162
162
|
background-color: transparent;
|
|
@@ -182,7 +182,7 @@ const Ae = ({ className: e }) => {
|
|
|
182
182
|
}};
|
|
183
183
|
font-style: italic;
|
|
184
184
|
}
|
|
185
|
-
`, ue =
|
|
185
|
+
`, ue = l(z)`
|
|
186
186
|
flex: 0 0 50px;
|
|
187
187
|
align-self: stretch;
|
|
188
188
|
background-color: transparent;
|
|
@@ -192,15 +192,15 @@ const Ae = ({ className: e }) => {
|
|
|
192
192
|
border: none;
|
|
193
193
|
color: #a6a6a6;
|
|
194
194
|
&:focus-visible {
|
|
195
|
-
${
|
|
195
|
+
${f};
|
|
196
196
|
}
|
|
197
|
-
`,
|
|
197
|
+
`, Oe = l(ue)`
|
|
198
198
|
border-right: ${(e) => e.theme.border};
|
|
199
199
|
margin: ${(e) => {
|
|
200
200
|
var t;
|
|
201
201
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
202
202
|
}} 0;
|
|
203
|
-
`,
|
|
203
|
+
`, je = l.div`
|
|
204
204
|
${(e) => e.grow ? y`
|
|
205
205
|
min-height: 50px;
|
|
206
206
|
max-height: 150px;
|
|
@@ -215,18 +215,18 @@ const Ae = ({ className: e }) => {
|
|
|
215
215
|
return (t = e.theme.colors) == null ? void 0 : t.accent;
|
|
216
216
|
}};
|
|
217
217
|
border-top: ${(e) => e.theme.inputBorder};
|
|
218
|
-
${(e) => e["data-has-focus"] && e.isTabbing &&
|
|
218
|
+
${(e) => e["data-has-focus"] && e.isTabbing && f}
|
|
219
219
|
textarea {
|
|
220
220
|
${(e) => !!e.scrollableCss && e.scrollableCss}
|
|
221
221
|
}
|
|
222
|
-
`,
|
|
223
|
-
(
|
|
224
|
-
var
|
|
222
|
+
`, De = l(
|
|
223
|
+
(o) => {
|
|
224
|
+
var r = o, {
|
|
225
225
|
hasContent: e
|
|
226
|
-
} =
|
|
226
|
+
} = r, t = W(r, [
|
|
227
227
|
"hasContent"
|
|
228
228
|
]);
|
|
229
|
-
return /* @__PURE__ */ n.createElement(
|
|
229
|
+
return /* @__PURE__ */ n.createElement(v, g({}, t));
|
|
230
230
|
}
|
|
231
231
|
)`
|
|
232
232
|
line,
|
|
@@ -240,7 +240,7 @@ const Ae = ({ className: e }) => {
|
|
|
240
240
|
return e.hasContent ? (t = e.theme.colors) == null ? void 0 : t.primary : "#a6a6a6";
|
|
241
241
|
}};
|
|
242
242
|
}
|
|
243
|
-
`,
|
|
243
|
+
`, Fe = Re, We = l.div`
|
|
244
244
|
width: ${(e) => e.avatarSize || "32px"};
|
|
245
245
|
height: ${(e) => e.avatarSize || "32px"};
|
|
246
246
|
border-radius: 50%;
|
|
@@ -287,7 +287,7 @@ const Ae = ({ className: e }) => {
|
|
|
287
287
|
}};
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
`,
|
|
290
|
+
`, Pe = Te`
|
|
291
291
|
0% {
|
|
292
292
|
opacity: 0;
|
|
293
293
|
}
|
|
@@ -297,7 +297,7 @@ const Ae = ({ className: e }) => {
|
|
|
297
297
|
100% {
|
|
298
298
|
opacity: 0;
|
|
299
299
|
}
|
|
300
|
-
`,
|
|
300
|
+
`, Ue = l.div`
|
|
301
301
|
display: flex;
|
|
302
302
|
justify-content: center;
|
|
303
303
|
> div {
|
|
@@ -309,7 +309,7 @@ const Ae = ({ className: e }) => {
|
|
|
309
309
|
var t;
|
|
310
310
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
311
311
|
}};
|
|
312
|
-
animation: ${
|
|
312
|
+
animation: ${Pe} 1s infinite;
|
|
313
313
|
}
|
|
314
314
|
> div:nth-of-type(2) {
|
|
315
315
|
animation-delay: 100ms;
|
|
@@ -317,29 +317,29 @@ const Ae = ({ className: e }) => {
|
|
|
317
317
|
> div:nth-of-type(3) {
|
|
318
318
|
animation-delay: 200ms;
|
|
319
319
|
}
|
|
320
|
-
`,
|
|
320
|
+
`, V = l.div`
|
|
321
321
|
grid-area: content;
|
|
322
322
|
max-width: 100%;
|
|
323
323
|
overflow: hidden;
|
|
324
|
-
`,
|
|
324
|
+
`, _e = l(J)`
|
|
325
325
|
font-size: ${(e) => {
|
|
326
326
|
var t;
|
|
327
327
|
return (t = e.theme.fonts) == null ? void 0 : t.normal;
|
|
328
328
|
}};
|
|
329
329
|
font-weight: normal;
|
|
330
330
|
margin: 0;
|
|
331
|
-
`,
|
|
331
|
+
`, q = l.div`
|
|
332
332
|
display: flex;
|
|
333
333
|
${(e) => e.left && "justify-content: start;"};
|
|
334
334
|
${(e) => e.center && "justify-content: center;"};
|
|
335
335
|
${(e) => e.right && "justify-content: end;"};
|
|
336
|
-
`,
|
|
336
|
+
`, Y = l.div`
|
|
337
337
|
${(e) => {
|
|
338
338
|
var t;
|
|
339
339
|
return e.padded && `padding: ${(t = e.theme.sizes) == null ? void 0 : t.medium};`;
|
|
340
340
|
}}
|
|
341
|
-
${(e) => !e.user && e.stacked &&
|
|
342
|
-
${(e) => e.user && e.stacked &&
|
|
341
|
+
${(e) => !e.user && e.stacked && Ve(e.stacked, e.theme)}
|
|
342
|
+
${(e) => e.user && e.stacked && qe(e.stacked, e.theme)}
|
|
343
343
|
|
|
344
344
|
display: inline-block;
|
|
345
345
|
margin-top: ${(e) => {
|
|
@@ -355,15 +355,15 @@ const Ae = ({ className: e }) => {
|
|
|
355
355
|
}
|
|
356
356
|
max-width: 100%;
|
|
357
357
|
${(e) => e.fullWidth && "width: 100%;"}
|
|
358
|
-
`,
|
|
359
|
-
var
|
|
360
|
-
const
|
|
361
|
-
background-color: ${(
|
|
362
|
-
color: ${(
|
|
358
|
+
`, Ve = (e, t) => {
|
|
359
|
+
var r, a;
|
|
360
|
+
const o = y`
|
|
361
|
+
background-color: ${(r = t.colors) == null ? void 0 : r.accent};
|
|
362
|
+
color: ${(a = t.colors) == null ? void 0 : a.text};
|
|
363
363
|
${t.border && `border: ${t.border};`};
|
|
364
364
|
`;
|
|
365
365
|
return t.borderRadius ? y`
|
|
366
|
-
${
|
|
366
|
+
${o}
|
|
367
367
|
|
|
368
368
|
border-top-right-radius: ${t.borderRadius};
|
|
369
369
|
border-bottom-right-radius: ${t.borderRadius};
|
|
@@ -375,15 +375,15 @@ const Ae = ({ className: e }) => {
|
|
|
375
375
|
${e === "last" && `
|
|
376
376
|
border-bottom-left-radius: ${t.borderRadius};
|
|
377
377
|
`}
|
|
378
|
-
` :
|
|
379
|
-
},
|
|
380
|
-
var
|
|
381
|
-
const
|
|
382
|
-
background-color: ${(
|
|
383
|
-
color: ${(
|
|
378
|
+
` : o;
|
|
379
|
+
}, qe = (e, t) => {
|
|
380
|
+
var r, a;
|
|
381
|
+
const o = y`
|
|
382
|
+
background-color: ${(r = t.colors) == null ? void 0 : r.primary};
|
|
383
|
+
color: ${(a = t.colors) == null ? void 0 : a.accent};
|
|
384
384
|
`;
|
|
385
385
|
return t.borderRadius ? y`
|
|
386
|
-
${
|
|
386
|
+
${o}
|
|
387
387
|
|
|
388
388
|
border-top-left-radius: ${t.borderRadius};
|
|
389
389
|
border-bottom-left-radius: ${t.borderRadius};
|
|
@@ -395,8 +395,8 @@ const Ae = ({ className: e }) => {
|
|
|
395
395
|
${e === "last" && `
|
|
396
396
|
border-bottom-right-radius: ${t.borderRadius};
|
|
397
397
|
`}
|
|
398
|
-
` :
|
|
399
|
-
}, R =
|
|
398
|
+
` : o;
|
|
399
|
+
}, R = l.div`
|
|
400
400
|
margin-bottom: ${(e) => {
|
|
401
401
|
var t;
|
|
402
402
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
@@ -405,19 +405,19 @@ const Ae = ({ className: e }) => {
|
|
|
405
405
|
margin-bottom: 0;
|
|
406
406
|
}
|
|
407
407
|
`, C = (e) => {
|
|
408
|
-
var t,
|
|
408
|
+
var t, o;
|
|
409
409
|
return y`
|
|
410
410
|
margin: ${(t = e.theme.sizes) == null ? void 0 : t.medium} 0;
|
|
411
|
-
padding: 0 ${(
|
|
411
|
+
padding: 0 ${(o = e.theme.sizes) == null ? void 0 : o.medium};
|
|
412
412
|
`;
|
|
413
|
-
},
|
|
413
|
+
}, Ye = l(Ae)`
|
|
414
414
|
& button.humany-form-component-button {
|
|
415
415
|
${(e) => {
|
|
416
|
-
var t,
|
|
417
|
-
return ((t = e.theme.colors) == null ? void 0 : t.primary) && ((
|
|
416
|
+
var t, o, r, a;
|
|
417
|
+
return ((t = e.theme.colors) == null ? void 0 : t.primary) && ((o = e.theme.colors) == null ? void 0 : o.accent) && we({
|
|
418
418
|
active: !1,
|
|
419
|
-
primaryColor: (
|
|
420
|
-
secondaryColor: (
|
|
419
|
+
primaryColor: (r = e.theme.colors) == null ? void 0 : r.primary,
|
|
420
|
+
secondaryColor: (a = e.theme.colors) == null ? void 0 : a.accent,
|
|
421
421
|
theme: e.theme
|
|
422
422
|
});
|
|
423
423
|
}};
|
|
@@ -438,18 +438,18 @@ const Ae = ({ className: e }) => {
|
|
|
438
438
|
}};
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
`,
|
|
441
|
+
`, Ge = l(Q)`
|
|
442
442
|
white-space: pre-wrap;
|
|
443
443
|
a {
|
|
444
444
|
color: ${(e) => e.theme.colors.link};
|
|
445
445
|
&:focus {
|
|
446
446
|
${(e) => {
|
|
447
447
|
var t;
|
|
448
|
-
return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) &&
|
|
448
|
+
return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) && f;
|
|
449
449
|
}};
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
`,
|
|
452
|
+
`, Je = l(ie)`
|
|
453
453
|
padding: 0;
|
|
454
454
|
list-style: none;
|
|
455
455
|
margin: 0 -${(e) => {
|
|
@@ -462,8 +462,8 @@ const Ae = ({ className: e }) => {
|
|
|
462
462
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
463
463
|
}};
|
|
464
464
|
}
|
|
465
|
-
`,
|
|
466
|
-
${(e) =>
|
|
465
|
+
`, Qe = l.button`
|
|
466
|
+
${(e) => K(e)};
|
|
467
467
|
display: block;
|
|
468
468
|
background-color: ${(e) => {
|
|
469
469
|
var t;
|
|
@@ -472,12 +472,12 @@ const Ae = ({ className: e }) => {
|
|
|
472
472
|
width: 100%;
|
|
473
473
|
color: #fff;
|
|
474
474
|
&:focus-visible {
|
|
475
|
-
${
|
|
475
|
+
${f}
|
|
476
476
|
background-color: transparent;
|
|
477
477
|
}
|
|
478
|
-
`,
|
|
479
|
-
({ boxed: e, className: t, agentData:
|
|
480
|
-
), oe =
|
|
478
|
+
`, Xe = Z(
|
|
479
|
+
({ boxed: e, className: t, agentData: o }, r) => /* @__PURE__ */ n.createElement(V, { ref: r }, /* @__PURE__ */ n.createElement(q, { left: e, center: !e }, /* @__PURE__ */ n.createElement(Y, { padded: !!e, stacked: e ? "first" : void 0 }, /* @__PURE__ */ n.createElement(Ue, null, /* @__PURE__ */ n.createElement("div", null), /* @__PURE__ */ n.createElement("div", null), /* @__PURE__ */ n.createElement("div", null)))))
|
|
480
|
+
), oe = Xe, Ze = l.p`
|
|
481
481
|
&& {
|
|
482
482
|
font-size: ${(e) => {
|
|
483
483
|
var t;
|
|
@@ -492,24 +492,24 @@ const Ae = ({ className: e }) => {
|
|
|
492
492
|
var t;
|
|
493
493
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
494
494
|
}};
|
|
495
|
-
`, ae = (e) => new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }),
|
|
496
|
-
if (!t && !
|
|
495
|
+
`, ae = (e) => new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }), et = ({ className: e, name: t, timestamp: o }) => {
|
|
496
|
+
if (!t && !o)
|
|
497
497
|
return null;
|
|
498
|
-
let
|
|
499
|
-
return t ?
|
|
500
|
-
}, B =
|
|
501
|
-
const { avatar:
|
|
498
|
+
let r = "";
|
|
499
|
+
return t ? o ? r = `${t}: ${ae(o)}` : r = t : o && (r = ae(o)), /* @__PURE__ */ n.createElement(Ze, null, r);
|
|
500
|
+
}, B = et, tt = ({ className: e, children: t, sender: o, timestamp: r }) => {
|
|
501
|
+
const { avatar: a, name: s } = o, { avatarSize: u } = N();
|
|
502
502
|
return /* @__PURE__ */ n.createElement(
|
|
503
|
-
|
|
503
|
+
nt,
|
|
504
504
|
{
|
|
505
|
-
hasAvatar: !!
|
|
505
|
+
hasAvatar: !!a,
|
|
506
506
|
className: I(e, "humany-conversation-agent-message")
|
|
507
507
|
},
|
|
508
|
-
|
|
508
|
+
a && /* @__PURE__ */ n.createElement(We, { avatarSize: u }, typeof a == "string" ? /* @__PURE__ */ n.createElement("img", { src: a }) : /* @__PURE__ */ n.createElement(v, { symbol: a })),
|
|
509
509
|
t,
|
|
510
|
-
/* @__PURE__ */ n.createElement(B, { name:
|
|
510
|
+
/* @__PURE__ */ n.createElement(B, { name: s, timestamp: r })
|
|
511
511
|
);
|
|
512
|
-
},
|
|
512
|
+
}, nt = l.div`
|
|
513
513
|
display: grid;
|
|
514
514
|
margin-right: 10%;
|
|
515
515
|
width: 90%;
|
|
@@ -526,24 +526,24 @@ const Ae = ({ className: e }) => {
|
|
|
526
526
|
'content'
|
|
527
527
|
'info';
|
|
528
528
|
`};
|
|
529
|
-
`, he =
|
|
530
|
-
({ className: e, children: t, timestamp:
|
|
531
|
-
|
|
529
|
+
`, he = tt, rt = Z(
|
|
530
|
+
({ className: e, children: t, timestamp: o, discrete: r, fullWidth: a }, s) => /* @__PURE__ */ n.createElement(
|
|
531
|
+
ot,
|
|
532
532
|
{
|
|
533
|
-
ref:
|
|
533
|
+
ref: s,
|
|
534
534
|
className: I(e, "humany-conversation-system-message"),
|
|
535
|
-
fullWidth:
|
|
535
|
+
fullWidth: a
|
|
536
536
|
},
|
|
537
|
-
|
|
537
|
+
r ? /* @__PURE__ */ n.createElement(at, { className: "humany-conversation-discrete-message" }, t, /* @__PURE__ */ n.createElement(B, { timestamp: o })) : /* @__PURE__ */ n.createElement(n.Fragment, null, t, /* @__PURE__ */ n.createElement(B, { timestamp: o }))
|
|
538
538
|
)
|
|
539
|
-
),
|
|
539
|
+
), ot = l.div`
|
|
540
540
|
${(e) => e.fullWidth && "width: 100%"};
|
|
541
541
|
padding: 0 ${(e) => {
|
|
542
542
|
var t;
|
|
543
543
|
return (t = e.theme.sizes) == null ? void 0 : t.large;
|
|
544
544
|
}};
|
|
545
545
|
overflow: auto;
|
|
546
|
-
`,
|
|
546
|
+
`, at = l.div`
|
|
547
547
|
text-align: center;
|
|
548
548
|
word-wrap: break-word;
|
|
549
549
|
font-size: ${(e) => {
|
|
@@ -557,46 +557,63 @@ const Ae = ({ className: e }) => {
|
|
|
557
557
|
> p {
|
|
558
558
|
margin: 0;
|
|
559
559
|
}
|
|
560
|
-
`,
|
|
561
|
-
const { userLabel:
|
|
560
|
+
`, lt = rt, st = ({ className: e, children: t, timestamp: o }) => {
|
|
561
|
+
const { userLabel: r = "" } = N();
|
|
562
562
|
return /* @__PURE__ */ n.createElement(
|
|
563
|
-
|
|
563
|
+
it,
|
|
564
564
|
{
|
|
565
565
|
className: I(e, "humany-conversation-user-message")
|
|
566
566
|
},
|
|
567
567
|
t,
|
|
568
|
-
/* @__PURE__ */ n.createElement(B, { name:
|
|
568
|
+
/* @__PURE__ */ n.createElement(B, { name: r, timestamp: o })
|
|
569
569
|
);
|
|
570
|
-
},
|
|
570
|
+
}, it = l.div`
|
|
571
571
|
margin-left: 10%;
|
|
572
572
|
width: 90%;
|
|
573
573
|
display: flex;
|
|
574
574
|
flex-direction: column;
|
|
575
575
|
align-items: flex-end;
|
|
576
|
-
`,
|
|
576
|
+
`, ct = st, ee = (e) => Array.isArray(e) ? e : Object.keys(e).map((t) => ({
|
|
577
577
|
label: e[t],
|
|
578
578
|
actionKey: t
|
|
579
|
-
})),
|
|
580
|
-
|
|
579
|
+
})), mt = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n.createElement(
|
|
580
|
+
dt,
|
|
581
581
|
{
|
|
582
582
|
className: "humany-conversation-button-list",
|
|
583
583
|
header: e,
|
|
584
584
|
items: ee(t),
|
|
585
|
-
renderItem: (
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
585
|
+
renderItem: (r) => {
|
|
586
|
+
var s;
|
|
587
|
+
const a = !!((s = r == null ? void 0 : r.data) != null && s.href);
|
|
588
|
+
return /* @__PURE__ */ n.createElement("li", { key: r.actionKey }, a ? /* @__PURE__ */ n.createElement(
|
|
589
|
+
ut,
|
|
590
|
+
{
|
|
591
|
+
onClick: () => {
|
|
592
|
+
o("action", r);
|
|
593
|
+
},
|
|
594
|
+
href: r.data.href,
|
|
595
|
+
target: r.data.target,
|
|
596
|
+
"aria-label": r.label,
|
|
597
|
+
title: r.label
|
|
590
598
|
},
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
599
|
+
/* @__PURE__ */ n.createElement(v, { symbol: r.symbol }),
|
|
600
|
+
r.label
|
|
601
|
+
) : /* @__PURE__ */ n.createElement(
|
|
602
|
+
ht,
|
|
603
|
+
{
|
|
604
|
+
onClick: () => {
|
|
605
|
+
o("action", r);
|
|
606
|
+
},
|
|
607
|
+
"aria-label": r.label,
|
|
608
|
+
title: r.label
|
|
609
|
+
},
|
|
610
|
+
/* @__PURE__ */ n.createElement(v, { symbol: r.symbol }),
|
|
611
|
+
r.label
|
|
612
|
+
));
|
|
613
|
+
}
|
|
597
614
|
}
|
|
598
|
-
),
|
|
599
|
-
${
|
|
615
|
+
), dt = l(O)`
|
|
616
|
+
${j}
|
|
600
617
|
> ul {
|
|
601
618
|
display: flex;
|
|
602
619
|
flex-wrap: wrap;
|
|
@@ -609,8 +626,36 @@ const Ae = ({ className: e }) => {
|
|
|
609
626
|
}
|
|
610
627
|
}
|
|
611
628
|
${C}
|
|
612
|
-
`,
|
|
613
|
-
${
|
|
629
|
+
`, ut = l(Ce)`
|
|
630
|
+
${K};
|
|
631
|
+
|
|
632
|
+
display: block;
|
|
633
|
+
padding: ${(e) => {
|
|
634
|
+
var t;
|
|
635
|
+
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
636
|
+
}};
|
|
637
|
+
background-color: ${(e) => {
|
|
638
|
+
var t;
|
|
639
|
+
return (t = e.theme.colors) == null ? void 0 : t.primary;
|
|
640
|
+
}};
|
|
641
|
+
width: 100%;
|
|
642
|
+
color: #ffffff;
|
|
643
|
+
overflow: hidden;
|
|
644
|
+
text-overflow: ellipsis;
|
|
645
|
+
&:focus-visible {
|
|
646
|
+
${f}
|
|
647
|
+
background-color: transparent;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
i,
|
|
651
|
+
svg {
|
|
652
|
+
margin-right: ${(e) => {
|
|
653
|
+
var t;
|
|
654
|
+
return (t = e.theme.sizes) == null ? void 0 : t.small;
|
|
655
|
+
}};
|
|
656
|
+
}
|
|
657
|
+
`, ht = l(z)`
|
|
658
|
+
${K};
|
|
614
659
|
|
|
615
660
|
display: block;
|
|
616
661
|
padding: ${(e) => {
|
|
@@ -626,7 +671,7 @@ const Ae = ({ className: e }) => {
|
|
|
626
671
|
overflow: hidden;
|
|
627
672
|
text-overflow: ellipsis;
|
|
628
673
|
&:focus-visible {
|
|
629
|
-
${
|
|
674
|
+
${f}
|
|
630
675
|
background-color: transparent;
|
|
631
676
|
}
|
|
632
677
|
|
|
@@ -637,52 +682,52 @@ const Ae = ({ className: e }) => {
|
|
|
637
682
|
return (t = e.theme.sizes) == null ? void 0 : t.small;
|
|
638
683
|
}};
|
|
639
684
|
}
|
|
640
|
-
`,
|
|
641
|
-
const
|
|
642
|
-
return !
|
|
643
|
-
},
|
|
644
|
-
${
|
|
685
|
+
`, gt = ({ type: e, content: t = {} }) => {
|
|
686
|
+
const o = Se(e);
|
|
687
|
+
return !o || !e ? null : /* @__PURE__ */ n.createElement(Ne, { fallback: null }, /* @__PURE__ */ n.createElement(o, g({}, t)));
|
|
688
|
+
}, yt = ({ body: e }) => /* @__PURE__ */ n.createElement(ft, { html: e }), ft = l(Q)`
|
|
689
|
+
${ze}
|
|
645
690
|
color: inherit;
|
|
646
691
|
white-space: pre-wrap;
|
|
647
692
|
${C}
|
|
648
693
|
a {
|
|
649
694
|
color: ${(e) => e.theme.colors.link};
|
|
650
695
|
&:focus-visible {
|
|
651
|
-
${
|
|
696
|
+
${f};
|
|
652
697
|
}
|
|
653
698
|
}
|
|
654
|
-
`,
|
|
655
|
-
|
|
699
|
+
`, pt = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n.createElement(
|
|
700
|
+
bt,
|
|
656
701
|
{
|
|
657
702
|
className: "humany-conversation-item-list",
|
|
658
703
|
header: e,
|
|
659
704
|
items: ee(t),
|
|
660
|
-
renderItem: (
|
|
661
|
-
var
|
|
662
|
-
return /* @__PURE__ */ n.createElement("li", { key:
|
|
663
|
-
|
|
705
|
+
renderItem: (r) => {
|
|
706
|
+
var a;
|
|
707
|
+
return /* @__PURE__ */ n.createElement("li", { key: r.actionKey }, /* @__PURE__ */ n.createElement($t, null, ((a = r.symbol) == null ? void 0 : a.content) && /* @__PURE__ */ n.createElement("div", { className: "item-icon" }, /* @__PURE__ */ n.createElement(
|
|
708
|
+
v,
|
|
664
709
|
{
|
|
665
710
|
size: 22,
|
|
666
711
|
symbol: {
|
|
667
|
-
type:
|
|
668
|
-
content:
|
|
712
|
+
type: r.symbol.type,
|
|
713
|
+
content: r.symbol.content
|
|
669
714
|
}
|
|
670
715
|
}
|
|
671
716
|
)), /* @__PURE__ */ n.createElement("div", { className: "item-body" }, /* @__PURE__ */ n.createElement(
|
|
672
717
|
z,
|
|
673
718
|
{
|
|
674
719
|
onClick: () => {
|
|
675
|
-
|
|
720
|
+
o("action", r);
|
|
676
721
|
},
|
|
677
|
-
"aria-label":
|
|
678
|
-
title:
|
|
722
|
+
"aria-label": r.label,
|
|
723
|
+
title: r.label
|
|
679
724
|
},
|
|
680
|
-
|
|
681
|
-
),
|
|
725
|
+
r.label
|
|
726
|
+
), r.description && /* @__PURE__ */ n.createElement("p", null, r.description))));
|
|
682
727
|
}
|
|
683
728
|
}
|
|
684
|
-
),
|
|
685
|
-
${
|
|
729
|
+
), bt = l(O)`
|
|
730
|
+
${j}
|
|
686
731
|
|
|
687
732
|
> .humany-paragraph {
|
|
688
733
|
${C}
|
|
@@ -719,7 +764,7 @@ const Ae = ({ className: e }) => {
|
|
|
719
764
|
border-bottom: none;
|
|
720
765
|
}
|
|
721
766
|
}
|
|
722
|
-
`,
|
|
767
|
+
`, $t = l.div`
|
|
723
768
|
display: flex;
|
|
724
769
|
gap: ${(e) => {
|
|
725
770
|
var t;
|
|
@@ -758,7 +803,7 @@ const Ae = ({ className: e }) => {
|
|
|
758
803
|
margin: 0;
|
|
759
804
|
|
|
760
805
|
&:focus-visible {
|
|
761
|
-
${
|
|
806
|
+
${f}
|
|
762
807
|
span {
|
|
763
808
|
color: ${(e) => {
|
|
764
809
|
var t;
|
|
@@ -768,25 +813,25 @@ const Ae = ({ className: e }) => {
|
|
|
768
813
|
}
|
|
769
814
|
}
|
|
770
815
|
}
|
|
771
|
-
`,
|
|
772
|
-
|
|
816
|
+
`, vt = ({ header: e, actions: t, dispatch: o }) => /* @__PURE__ */ n.createElement(
|
|
817
|
+
Et,
|
|
773
818
|
{
|
|
774
819
|
className: "humany-conversation-link-list",
|
|
775
820
|
header: e,
|
|
776
821
|
items: ee(t),
|
|
777
|
-
renderItem: (
|
|
778
|
-
|
|
822
|
+
renderItem: (r) => /* @__PURE__ */ n.createElement("li", { key: r.actionKey }, /* @__PURE__ */ n.createElement(
|
|
823
|
+
xt,
|
|
779
824
|
{
|
|
780
|
-
help:
|
|
825
|
+
help: r.actionKey === "help",
|
|
781
826
|
onClick: () => {
|
|
782
|
-
|
|
827
|
+
o("action", r);
|
|
783
828
|
},
|
|
784
|
-
"aria-label":
|
|
785
|
-
title:
|
|
829
|
+
"aria-label": r.label,
|
|
830
|
+
title: r.label
|
|
786
831
|
},
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
832
|
+
r.label,
|
|
833
|
+
r.actionKey === "help" && /* @__PURE__ */ n.createElement(
|
|
834
|
+
v,
|
|
790
835
|
{
|
|
791
836
|
size: 14,
|
|
792
837
|
symbol: {
|
|
@@ -797,8 +842,8 @@ const Ae = ({ className: e }) => {
|
|
|
797
842
|
)
|
|
798
843
|
))
|
|
799
844
|
}
|
|
800
|
-
),
|
|
801
|
-
${
|
|
845
|
+
), Et = l(O)`
|
|
846
|
+
${j}
|
|
802
847
|
${C}
|
|
803
848
|
|
|
804
849
|
${(e) => X(e)(
|
|
@@ -819,7 +864,7 @@ const Ae = ({ className: e }) => {
|
|
|
819
864
|
margin: 0;
|
|
820
865
|
}
|
|
821
866
|
}
|
|
822
|
-
`,
|
|
867
|
+
`, xt = l(z)`
|
|
823
868
|
display: block;
|
|
824
869
|
text-align: left;
|
|
825
870
|
font-weight: 300;
|
|
@@ -832,20 +877,20 @@ const Ae = ({ className: e }) => {
|
|
|
832
877
|
overflow: hidden;
|
|
833
878
|
|
|
834
879
|
${(e) => {
|
|
835
|
-
var t,
|
|
880
|
+
var t, o;
|
|
836
881
|
return e.help && y`
|
|
837
882
|
color: ${(t = e.theme.colors) == null ? void 0 : t.text};
|
|
838
883
|
text-decoration: underline;
|
|
839
884
|
|
|
840
885
|
i,
|
|
841
886
|
svg {
|
|
842
|
-
margin-left: ${(
|
|
887
|
+
margin-left: ${(o = e.theme.sizes) == null ? void 0 : o.small};
|
|
843
888
|
}
|
|
844
889
|
`;
|
|
845
890
|
}}
|
|
846
891
|
|
|
847
892
|
&:focus-visible {
|
|
848
|
-
${
|
|
893
|
+
${f}
|
|
849
894
|
span {
|
|
850
895
|
color: ${(e) => {
|
|
851
896
|
var t;
|
|
@@ -854,18 +899,18 @@ const Ae = ({ className: e }) => {
|
|
|
854
899
|
text-decoration: underline;
|
|
855
900
|
}
|
|
856
901
|
}
|
|
857
|
-
`,
|
|
902
|
+
`, kt = () => /* @__PURE__ */ n.createElement(wt, { className: "humany-conversation-separator" }), wt = l.div`
|
|
858
903
|
${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
|
|
859
904
|
width: 100%;
|
|
860
|
-
`,
|
|
905
|
+
`, Ct = ({ text: e }) => /* @__PURE__ */ n.createElement(St, { className: "humany-conversation-text", variant: "span" }, e), St = l(J)`
|
|
861
906
|
${C}
|
|
862
|
-
`,
|
|
907
|
+
`, zt = ({
|
|
863
908
|
header: e = "Video call",
|
|
864
909
|
acceptLabel: t = "Accept",
|
|
865
|
-
declineLabel:
|
|
866
|
-
dispatch:
|
|
910
|
+
declineLabel: o = "Decline",
|
|
911
|
+
dispatch: r
|
|
867
912
|
}) => {
|
|
868
|
-
const
|
|
913
|
+
const a = Ie(() => [
|
|
869
914
|
{
|
|
870
915
|
label: t,
|
|
871
916
|
actionKey: "accept-video-call",
|
|
@@ -875,39 +920,39 @@ const Ae = ({ className: e }) => {
|
|
|
875
920
|
}
|
|
876
921
|
},
|
|
877
922
|
{
|
|
878
|
-
label:
|
|
923
|
+
label: o,
|
|
879
924
|
actionKey: "decline-video-call",
|
|
880
925
|
symbol: {
|
|
881
926
|
type: "Svg",
|
|
882
927
|
content: "close"
|
|
883
928
|
}
|
|
884
929
|
}
|
|
885
|
-
], [t,
|
|
930
|
+
], [t, o]);
|
|
886
931
|
return /* @__PURE__ */ n.createElement(
|
|
887
|
-
|
|
932
|
+
Lt,
|
|
888
933
|
{
|
|
889
934
|
className: "humany-conversation-video-request",
|
|
890
935
|
header: e,
|
|
891
|
-
items:
|
|
892
|
-
renderItem: (
|
|
893
|
-
const u =
|
|
894
|
-
return /* @__PURE__ */ n.createElement("li", { key:
|
|
895
|
-
|
|
936
|
+
items: a,
|
|
937
|
+
renderItem: (s) => {
|
|
938
|
+
const u = s.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
|
|
939
|
+
return /* @__PURE__ */ n.createElement("li", { key: s.actionKey }, /* @__PURE__ */ n.createElement(
|
|
940
|
+
Mt,
|
|
896
941
|
{
|
|
897
942
|
onClick: () => {
|
|
898
|
-
|
|
943
|
+
r("action", s);
|
|
899
944
|
},
|
|
900
|
-
"aria-label":
|
|
901
|
-
title:
|
|
945
|
+
"aria-label": s.label,
|
|
946
|
+
title: s.label,
|
|
902
947
|
bgColor: u
|
|
903
948
|
},
|
|
904
|
-
/* @__PURE__ */ n.createElement(
|
|
949
|
+
/* @__PURE__ */ n.createElement(v, { symbol: s.symbol, size: 25 })
|
|
905
950
|
));
|
|
906
951
|
}
|
|
907
952
|
}
|
|
908
953
|
);
|
|
909
|
-
},
|
|
910
|
-
${(e) =>
|
|
954
|
+
}, Lt = l(O)`
|
|
955
|
+
${(e) => j(e)}
|
|
911
956
|
> ul {
|
|
912
957
|
display: flex;
|
|
913
958
|
flex-wrap: wrap;
|
|
@@ -920,8 +965,8 @@ const Ae = ({ className: e }) => {
|
|
|
920
965
|
}
|
|
921
966
|
}
|
|
922
967
|
${(e) => C(e)}
|
|
923
|
-
`,
|
|
924
|
-
${
|
|
968
|
+
`, Mt = l(z)`
|
|
969
|
+
${K};
|
|
925
970
|
|
|
926
971
|
background-color: ${(e) => e.bgColor};
|
|
927
972
|
display: flex;
|
|
@@ -933,7 +978,7 @@ const Ae = ({ className: e }) => {
|
|
|
933
978
|
border-radius: 100%;
|
|
934
979
|
|
|
935
980
|
&:focus-visible {
|
|
936
|
-
${
|
|
981
|
+
${f}
|
|
937
982
|
background-color: transparent;
|
|
938
983
|
|
|
939
984
|
i,
|
|
@@ -960,86 +1005,86 @@ const Ae = ({ className: e }) => {
|
|
|
960
1005
|
stroke: #fff;
|
|
961
1006
|
}
|
|
962
1007
|
}
|
|
963
|
-
`,
|
|
964
|
-
|
|
1008
|
+
`, Nt = ([e, t]) => ({ type: e, content: t }), It = ({ items: e, dispatch: t }) => /* @__PURE__ */ n.createElement(
|
|
1009
|
+
Ht,
|
|
965
1010
|
{
|
|
966
1011
|
className: "humany-message-list",
|
|
967
|
-
items: e.map(
|
|
1012
|
+
items: e.map(Nt),
|
|
968
1013
|
renderLi: !0,
|
|
969
|
-
renderItem: (
|
|
970
|
-
switch (
|
|
1014
|
+
renderItem: (o) => {
|
|
1015
|
+
switch (o.type) {
|
|
971
1016
|
case w.Text:
|
|
972
|
-
return /* @__PURE__ */ n.createElement(
|
|
1017
|
+
return /* @__PURE__ */ n.createElement(Ct, { text: o.content });
|
|
973
1018
|
case w.HTML:
|
|
974
|
-
return /* @__PURE__ */ n.createElement(
|
|
1019
|
+
return /* @__PURE__ */ n.createElement(yt, g({}, o.content));
|
|
975
1020
|
case w.Separator:
|
|
976
|
-
return /* @__PURE__ */ n.createElement(
|
|
1021
|
+
return /* @__PURE__ */ n.createElement(kt, g({}, o.content));
|
|
977
1022
|
case w.ItemList:
|
|
978
|
-
return /* @__PURE__ */ n.createElement(
|
|
1023
|
+
return /* @__PURE__ */ n.createElement(pt, x(g({}, o.content), { dispatch: t }));
|
|
979
1024
|
case w.LinkList:
|
|
980
|
-
return /* @__PURE__ */ n.createElement(
|
|
1025
|
+
return /* @__PURE__ */ n.createElement(vt, x(g({}, o.content), { dispatch: t }));
|
|
981
1026
|
case w.ButtonList:
|
|
982
|
-
return /* @__PURE__ */ n.createElement(
|
|
1027
|
+
return /* @__PURE__ */ n.createElement(mt, x(g({}, o.content), { dispatch: t }));
|
|
983
1028
|
case w.VideoRequest:
|
|
984
|
-
return /* @__PURE__ */ n.createElement(
|
|
1029
|
+
return /* @__PURE__ */ n.createElement(zt, x(g({}, o.content), { dispatch: t }));
|
|
985
1030
|
default:
|
|
986
|
-
return /* @__PURE__ */ n.createElement(
|
|
1031
|
+
return /* @__PURE__ */ n.createElement(gt, { type: o.type, content: o.content });
|
|
987
1032
|
}
|
|
988
1033
|
}
|
|
989
1034
|
}
|
|
990
|
-
),
|
|
991
|
-
${
|
|
1035
|
+
), Ht = l(ie)`
|
|
1036
|
+
${Le}
|
|
992
1037
|
|
|
993
1038
|
> li {
|
|
994
1039
|
margin: 0;
|
|
995
1040
|
}
|
|
996
|
-
`,
|
|
997
|
-
({ className: e, timestamp: t, sender:
|
|
1041
|
+
`, Tt = Z(
|
|
1042
|
+
({ className: e, timestamp: t, sender: o, type: r, content: a }, s) => {
|
|
998
1043
|
const u = de(
|
|
999
1044
|
(m) => {
|
|
1000
1045
|
let i = "first";
|
|
1001
|
-
return
|
|
1046
|
+
return a.length > 1 && (i = m === 0 ? "first" : m + 1 === a.length ? "last" : "middle"), i;
|
|
1002
1047
|
},
|
|
1003
|
-
[
|
|
1004
|
-
), c = () => /* @__PURE__ */ n.createElement(n.Fragment, null,
|
|
1005
|
-
const { key: i, body: $, title: S, form: L, actions: k } = m,
|
|
1048
|
+
[a]
|
|
1049
|
+
), c = () => /* @__PURE__ */ n.createElement(n.Fragment, null, a.map((m) => {
|
|
1050
|
+
const { key: i, body: $, title: S, form: L, actions: k } = m, p = !!$ && !S && !L && !k;
|
|
1006
1051
|
return /* @__PURE__ */ n.createElement(
|
|
1007
|
-
|
|
1052
|
+
lt,
|
|
1008
1053
|
{
|
|
1009
1054
|
className: e,
|
|
1010
1055
|
key: i,
|
|
1011
|
-
discrete:
|
|
1012
|
-
ref:
|
|
1056
|
+
discrete: p,
|
|
1057
|
+
ref: s,
|
|
1013
1058
|
timestamp: t,
|
|
1014
1059
|
fullWidth: !!L || !!k
|
|
1015
1060
|
},
|
|
1016
|
-
|
|
1061
|
+
p && $ ? /* @__PURE__ */ n.createElement(Q, { html: $ }) : /* @__PURE__ */ n.createElement(U, { isSystem: !0, content: m })
|
|
1017
1062
|
);
|
|
1018
|
-
})), h = () => /* @__PURE__ */ n.createElement(he, { sender:
|
|
1019
|
-
|
|
1063
|
+
})), h = () => /* @__PURE__ */ n.createElement(he, { sender: o, timestamp: t, className: e }, /* @__PURE__ */ n.createElement(V, { className: "humany-message-content-bundle" }, a.map((m, i) => /* @__PURE__ */ n.createElement(
|
|
1064
|
+
q,
|
|
1020
1065
|
{
|
|
1021
1066
|
className: "humany-message-container",
|
|
1022
1067
|
left: !0,
|
|
1023
1068
|
key: m.key,
|
|
1024
|
-
ref:
|
|
1069
|
+
ref: s
|
|
1025
1070
|
},
|
|
1026
1071
|
/* @__PURE__ */ n.createElement(
|
|
1027
|
-
|
|
1072
|
+
U,
|
|
1028
1073
|
{
|
|
1029
1074
|
content: m,
|
|
1030
1075
|
stacked: u(i)
|
|
1031
1076
|
}
|
|
1032
1077
|
)
|
|
1033
|
-
)))),
|
|
1034
|
-
|
|
1078
|
+
)))), E = () => /* @__PURE__ */ n.createElement(ct, { timestamp: t, className: e }, /* @__PURE__ */ n.createElement(V, { className: "humany-message-content-bundle" }, a.map((m, i) => /* @__PURE__ */ n.createElement(
|
|
1079
|
+
q,
|
|
1035
1080
|
{
|
|
1036
1081
|
className: "humany-message-container",
|
|
1037
1082
|
right: !0,
|
|
1038
1083
|
key: m.key,
|
|
1039
|
-
ref:
|
|
1084
|
+
ref: s
|
|
1040
1085
|
},
|
|
1041
1086
|
/* @__PURE__ */ n.createElement(
|
|
1042
|
-
|
|
1087
|
+
U,
|
|
1043
1088
|
{
|
|
1044
1089
|
isUser: !0,
|
|
1045
1090
|
content: m,
|
|
@@ -1047,35 +1092,35 @@ const Ae = ({ className: e }) => {
|
|
|
1047
1092
|
}
|
|
1048
1093
|
)
|
|
1049
1094
|
))));
|
|
1050
|
-
switch (
|
|
1051
|
-
case
|
|
1095
|
+
switch (r) {
|
|
1096
|
+
case P.System:
|
|
1052
1097
|
return c();
|
|
1053
|
-
case
|
|
1098
|
+
case P.Agent:
|
|
1054
1099
|
return h();
|
|
1055
|
-
case
|
|
1056
|
-
return
|
|
1100
|
+
case P.User:
|
|
1101
|
+
return E();
|
|
1057
1102
|
default:
|
|
1058
1103
|
return null;
|
|
1059
1104
|
}
|
|
1060
1105
|
}
|
|
1061
|
-
),
|
|
1062
|
-
const
|
|
1063
|
-
return
|
|
1064
|
-
|
|
1106
|
+
), U = ({ content: e, isUser: t, isSystem: o, stacked: r }) => {
|
|
1107
|
+
const a = G(), { title: s, body: u, actions: c, form: h, items: E } = e;
|
|
1108
|
+
return E ? /* @__PURE__ */ n.createElement(Y, { className: "humany-message-content", user: !!t, stacked: r }, /* @__PURE__ */ n.createElement(It, { items: E, dispatch: a })) : /* @__PURE__ */ n.createElement(
|
|
1109
|
+
Y,
|
|
1065
1110
|
{
|
|
1066
1111
|
className: "humany-message-content",
|
|
1067
|
-
padded: !
|
|
1112
|
+
padded: !o,
|
|
1068
1113
|
user: !!t,
|
|
1069
|
-
stacked:
|
|
1114
|
+
stacked: r,
|
|
1070
1115
|
fullWidth: !!h || !!c
|
|
1071
1116
|
},
|
|
1072
|
-
|
|
1073
|
-
u && /* @__PURE__ */ n.createElement(R, null, /* @__PURE__ */ n.createElement(
|
|
1117
|
+
s && /* @__PURE__ */ n.createElement(R, null, /* @__PURE__ */ n.createElement(_e, { variant: "h2" }, s)),
|
|
1118
|
+
u && /* @__PURE__ */ n.createElement(R, null, /* @__PURE__ */ n.createElement(Ge, { html: u })),
|
|
1074
1119
|
h && /* @__PURE__ */ n.createElement(R, null, /* @__PURE__ */ n.createElement(
|
|
1075
|
-
|
|
1076
|
-
|
|
1120
|
+
Ye,
|
|
1121
|
+
x(g({}, h), {
|
|
1077
1122
|
onChange: (i, $) => {
|
|
1078
|
-
|
|
1123
|
+
a("form", {
|
|
1079
1124
|
data: $,
|
|
1080
1125
|
formKey: h.schema.id,
|
|
1081
1126
|
actionKey: i
|
|
@@ -1084,14 +1129,14 @@ const Ae = ({ className: e }) => {
|
|
|
1084
1129
|
})
|
|
1085
1130
|
)),
|
|
1086
1131
|
c && /* @__PURE__ */ n.createElement(R, null, /* @__PURE__ */ n.createElement(
|
|
1087
|
-
|
|
1132
|
+
Je,
|
|
1088
1133
|
{
|
|
1089
1134
|
items: Object.keys(c).map((i) => ({ label: c[i], actionKey: i })),
|
|
1090
1135
|
renderItem: (i) => /* @__PURE__ */ n.createElement("li", { key: i.actionKey }, /* @__PURE__ */ n.createElement(
|
|
1091
|
-
|
|
1136
|
+
Qe,
|
|
1092
1137
|
{
|
|
1093
1138
|
onClick: () => {
|
|
1094
|
-
|
|
1139
|
+
a("action", i.actionKey);
|
|
1095
1140
|
}
|
|
1096
1141
|
},
|
|
1097
1142
|
i.label
|
|
@@ -1107,24 +1152,24 @@ const Ae = ({ className: e }) => {
|
|
|
1107
1152
|
behavior: "smooth"
|
|
1108
1153
|
});
|
|
1109
1154
|
}, 250);
|
|
1110
|
-
}, []), [t,
|
|
1111
|
-
messages:
|
|
1112
|
-
loading:
|
|
1113
|
-
typingActors:
|
|
1114
|
-
} = N(), u = () =>
|
|
1115
|
-
return /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
1116
|
-
const { type:
|
|
1155
|
+
}, []), [t, o] = le(!0), {
|
|
1156
|
+
messages: r,
|
|
1157
|
+
loading: a,
|
|
1158
|
+
typingActors: s = []
|
|
1159
|
+
} = N(), u = () => s && s.length ? s.map((c, h) => /* @__PURE__ */ n.createElement(_, { id: `typing_${c.name}`, key: `typing_${c.name}` }, /* @__PURE__ */ n.createElement(he, { timestamp: Date.now(), sender: c }, /* @__PURE__ */ n.createElement(oe, { boxed: !0, ref: e })))) : null;
|
|
1160
|
+
return /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(At, { tabIndex: 0, scrollableCss: t, ref: o }, r && r.length ? r.map((c, h) => {
|
|
1161
|
+
const { type: E, timestamp: m, sender: i, content: $ } = c;
|
|
1117
1162
|
return /* @__PURE__ */ n.createElement(
|
|
1118
|
-
|
|
1163
|
+
_,
|
|
1119
1164
|
{
|
|
1120
1165
|
className: "humany-conversation-entry",
|
|
1121
1166
|
tabIndex: -1,
|
|
1122
|
-
key: `${
|
|
1167
|
+
key: `${E}_${i == null ? void 0 : i.name}_${m}_${$[0].key}`
|
|
1123
1168
|
},
|
|
1124
|
-
/* @__PURE__ */ n.createElement(
|
|
1169
|
+
/* @__PURE__ */ n.createElement(Tt, x(g({}, c), { ref: e }))
|
|
1125
1170
|
);
|
|
1126
|
-
}) : null, u(),
|
|
1127
|
-
},
|
|
1171
|
+
}) : null, u(), a && /* @__PURE__ */ n.createElement(_, null, /* @__PURE__ */ n.createElement(oe, { ref: e }))), /* @__PURE__ */ n.createElement(Fe, null));
|
|
1172
|
+
}, At = l.div`
|
|
1128
1173
|
display: flex;
|
|
1129
1174
|
flex-direction: column;
|
|
1130
1175
|
align-items: stretch;
|
|
@@ -1135,9 +1180,9 @@ const Ae = ({ className: e }) => {
|
|
|
1135
1180
|
}};
|
|
1136
1181
|
${(e) => !!e.scrollableCss && e.scrollableCss};
|
|
1137
1182
|
&:focus-visible {
|
|
1138
|
-
${(e) =>
|
|
1183
|
+
${(e) => f(e)};
|
|
1139
1184
|
}
|
|
1140
|
-
`,
|
|
1185
|
+
`, _ = l.div`
|
|
1141
1186
|
margin: 0;
|
|
1142
1187
|
margin-bottom: ${(e) => {
|
|
1143
1188
|
var t;
|
|
@@ -1175,8 +1220,8 @@ const Ae = ({ className: e }) => {
|
|
|
1175
1220
|
font-weight: normal;
|
|
1176
1221
|
`
|
|
1177
1222
|
)}
|
|
1178
|
-
`,
|
|
1179
|
-
const t =
|
|
1223
|
+
`, Rt = ({ dispatch: e }) => {
|
|
1224
|
+
const t = He(null);
|
|
1180
1225
|
return me(() => {
|
|
1181
1226
|
t.current && t.current.parentNode && e("overlay-mounted", t.current);
|
|
1182
1227
|
}, [t]), /* @__PURE__ */ n.createElement(
|
|
@@ -1187,26 +1232,26 @@ const Ae = ({ className: e }) => {
|
|
|
1187
1232
|
ref: t
|
|
1188
1233
|
}
|
|
1189
1234
|
);
|
|
1190
|
-
},
|
|
1235
|
+
}, Bt = ({
|
|
1191
1236
|
dispatch: e,
|
|
1192
1237
|
header: t,
|
|
1193
|
-
buttonLabel:
|
|
1238
|
+
buttonLabel: o
|
|
1194
1239
|
}) => /* @__PURE__ */ n.createElement(
|
|
1195
|
-
|
|
1240
|
+
Kt,
|
|
1196
1241
|
{
|
|
1197
1242
|
portalId: "humany-conversation-portal",
|
|
1198
1243
|
className: "humany-conversation-outlet"
|
|
1199
1244
|
},
|
|
1200
|
-
/* @__PURE__ */ n.createElement(
|
|
1201
|
-
|
|
1245
|
+
/* @__PURE__ */ n.createElement(Ot, { className: "humany-conversation-outlet-head" }, /* @__PURE__ */ n.createElement(
|
|
1246
|
+
Dt,
|
|
1202
1247
|
{
|
|
1203
1248
|
className: "humany-conversation-outlet-head-button",
|
|
1204
|
-
"aria-label":
|
|
1205
|
-
title:
|
|
1249
|
+
"aria-label": o,
|
|
1250
|
+
title: o,
|
|
1206
1251
|
onClick: () => e("hide-overlay-conversation")
|
|
1207
1252
|
},
|
|
1208
1253
|
/* @__PURE__ */ n.createElement(
|
|
1209
|
-
|
|
1254
|
+
v,
|
|
1210
1255
|
{
|
|
1211
1256
|
symbol: {
|
|
1212
1257
|
type: "Svg",
|
|
@@ -1216,7 +1261,7 @@ const Ae = ({ className: e }) => {
|
|
|
1216
1261
|
}
|
|
1217
1262
|
)
|
|
1218
1263
|
), t && /* @__PURE__ */ n.createElement(
|
|
1219
|
-
|
|
1264
|
+
jt,
|
|
1220
1265
|
{
|
|
1221
1266
|
className: "humany-conversation-outlet-header",
|
|
1222
1267
|
variant: "h1"
|
|
@@ -1224,7 +1269,7 @@ const Ae = ({ className: e }) => {
|
|
|
1224
1269
|
t
|
|
1225
1270
|
)),
|
|
1226
1271
|
/* @__PURE__ */ n.createElement(ge, null)
|
|
1227
|
-
),
|
|
1272
|
+
), Kt = l(ce)`
|
|
1228
1273
|
z-index: 11;
|
|
1229
1274
|
top: auto;
|
|
1230
1275
|
height: 65%;
|
|
@@ -1239,7 +1284,7 @@ const Ae = ({ className: e }) => {
|
|
|
1239
1284
|
var t;
|
|
1240
1285
|
return (t = e.theme.sizes) == null ? void 0 : t.large;
|
|
1241
1286
|
}};
|
|
1242
|
-
`,
|
|
1287
|
+
`, Ot = l.div`
|
|
1243
1288
|
display: flex;
|
|
1244
1289
|
flex-direction: column;
|
|
1245
1290
|
justify-content: center;
|
|
@@ -1253,7 +1298,7 @@ const Ae = ({ className: e }) => {
|
|
|
1253
1298
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
1254
1299
|
}};
|
|
1255
1300
|
${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
|
|
1256
|
-
`,
|
|
1301
|
+
`, jt = l(J)`
|
|
1257
1302
|
font-size: ${(e) => {
|
|
1258
1303
|
var t;
|
|
1259
1304
|
return (t = e.theme.fonts) == null ? void 0 : t.medium;
|
|
@@ -1263,7 +1308,7 @@ const Ae = ({ className: e }) => {
|
|
|
1263
1308
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
1264
1309
|
}};
|
|
1265
1310
|
margin: 0;
|
|
1266
|
-
`,
|
|
1311
|
+
`, Dt = l(z)`
|
|
1267
1312
|
display: flex;
|
|
1268
1313
|
align-items: center;
|
|
1269
1314
|
justify-content: center;
|
|
@@ -1277,7 +1322,7 @@ const Ae = ({ className: e }) => {
|
|
|
1277
1322
|
${(e) => e.theme.borderRadius && `border-radius: ${e.theme.borderRadius};`}
|
|
1278
1323
|
|
|
1279
1324
|
&:focus-visible {
|
|
1280
|
-
${
|
|
1325
|
+
${f};
|
|
1281
1326
|
}
|
|
1282
1327
|
|
|
1283
1328
|
svg line {
|
|
@@ -1286,36 +1331,36 @@ const Ae = ({ className: e }) => {
|
|
|
1286
1331
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
1287
1332
|
}};
|
|
1288
1333
|
}
|
|
1289
|
-
`,
|
|
1290
|
-
var
|
|
1334
|
+
`, Zt = (o) => {
|
|
1335
|
+
var r = o, { className: e } = r, t = W(r, ["className"]);
|
|
1291
1336
|
const {
|
|
1292
|
-
overlay:
|
|
1293
|
-
overlayConversationHeader:
|
|
1337
|
+
overlay: a,
|
|
1338
|
+
overlayConversationHeader: s,
|
|
1294
1339
|
overlayConversationCloseLabel: u,
|
|
1295
1340
|
conversationControllerId: c
|
|
1296
|
-
} = N(), h =
|
|
1341
|
+
} = N(), h = G();
|
|
1297
1342
|
return /* @__PURE__ */ n.createElement(
|
|
1298
|
-
|
|
1343
|
+
Me.Provider,
|
|
1299
1344
|
{
|
|
1300
1345
|
value: c ? { id: c } : null
|
|
1301
1346
|
},
|
|
1302
1347
|
/* @__PURE__ */ n.createElement(
|
|
1303
|
-
|
|
1304
|
-
|
|
1348
|
+
Ft,
|
|
1349
|
+
x(g({}, t), {
|
|
1305
1350
|
className: I(e, "humany-conversation-component")
|
|
1306
1351
|
}),
|
|
1307
1352
|
/* @__PURE__ */ n.createElement(ge, null)
|
|
1308
1353
|
),
|
|
1309
|
-
|
|
1310
|
-
|
|
1354
|
+
a && /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(Rt, { dispatch: h }), a.conversation && /* @__PURE__ */ n.createElement(
|
|
1355
|
+
Bt,
|
|
1311
1356
|
{
|
|
1312
1357
|
dispatch: h,
|
|
1313
|
-
header:
|
|
1358
|
+
header: s,
|
|
1314
1359
|
buttonLabel: u
|
|
1315
1360
|
}
|
|
1316
1361
|
))
|
|
1317
1362
|
);
|
|
1318
|
-
},
|
|
1363
|
+
}, Ft = l.div`
|
|
1319
1364
|
position: absolute;
|
|
1320
1365
|
right: 0;
|
|
1321
1366
|
left: 0;
|
|
@@ -1326,6 +1371,6 @@ const Ae = ({ className: e }) => {
|
|
|
1326
1371
|
flex-direction: column;
|
|
1327
1372
|
`;
|
|
1328
1373
|
export {
|
|
1329
|
-
|
|
1374
|
+
Zt as default
|
|
1330
1375
|
};
|
|
1331
|
-
//# sourceMappingURL=conversation-
|
|
1376
|
+
//# sourceMappingURL=conversation-5f8374bf.js.map
|