@epam/ai-dial-conversation-messages 1.3.0-dev.10 → 1.3.0-dev.103

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/index.js CHANGED
@@ -1,17 +1,17 @@
1
- import { AttachmentType as e, CopyIconButton as t, DeploymentIcon as n, MDMessageViewer as r, MessageRating as i, MessageRole as a, ResponseFormat as o, buildCssVars as s, mergeClasses as c, useCollapsedText as l } from "@epam/ai-dial-chat-shared";
2
- import { AttachmentGroup as u } from "@epam/ai-dial-attachment-input";
3
- import { Button as d, ButtonVariant as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, ElementSize as h, GhostIconButton as g, InfoMessageNotification as _, LinkButton as v, NeutralButton as y } from "@epam/ai-dial-ui-kit";
4
- import { useCallback as b, useEffect as x, useId as S, useLayoutEffect as C, useMemo as ee, useRef as w, useState as T } from "react";
5
- import { IconArrowBackUp as E, IconChevronDown as D, IconChevronUp as O, IconMarkdown as k, IconPencilMinus as A, IconRefresh as j, IconThumbDown as M, IconThumbDownFilled as N, IconThumbUp as P, IconThumbUpFilled as te, IconTrashX as ne } from "@tabler/icons-react";
6
- import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
7
- import { createPortal as R } from "react-dom";
1
+ import { AttachmentType as e, CopyIconButton as t, DeploymentIcon as n, MDMessageViewer as r, MessageRating as i, MessageRole as a, ResponseFormat as o, buildCssVars as s, buildInlineSegmentSource as c, createInlineSegmentComponents as l, createRehypeInlineSegments as u, mergeClasses as d, useCollapsedText as f } from "@epam/ai-dial-chat-shared";
2
+ import { AttachmentGroup as p } from "@epam/ai-dial-attachment-input";
3
+ import { Button as m, ButtonVariant as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, ElementSize as v, GhostIconButton as y, InfoMessageNotification as b, LinkButton as x, NeutralButton as S, Tooltip as C } from "@epam/ai-dial-ui-kit";
4
+ import { useCallback as w, useEffect as T, useId as ee, useLayoutEffect as E, useMemo as D, useRef as O, useState as k } from "react";
5
+ import { IconArrowBackUp as A, IconChevronDown as te, IconChevronUp as ne, IconMarkdown as re, IconPencilMinus as ie, IconRefresh as j, IconThumbDown as M, IconThumbDownFilled as ae, IconThumbUp as oe, IconThumbUpFilled as se, IconTrashX as N } from "@tabler/icons-react";
6
+ import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
7
+ import { createPortal as L } from "react-dom";
8
8
  //#region src/constants/public-class-names.ts
9
- var z = {
9
+ var ce = {
10
10
  userBubble: "dial-cm-user-bubble",
11
11
  assistantContent: "dial-cm-assistant-content"
12
- }, B = 4, V = (e) => {
13
- let t = w(null), [n, r] = T(0);
14
- return x(() => {
12
+ }, R = 4, le = (e) => {
13
+ let t = O(null), [n, r] = k(0);
14
+ return T(() => {
15
15
  if (!e) return;
16
16
  let n = t.current;
17
17
  if (n == null) return;
@@ -22,416 +22,528 @@ var z = {
22
22
  return i.observe(n), () => i.disconnect();
23
23
  }, [e]), {
24
24
  slotRef: t,
25
- firstLineIndent: e ? `calc(${n}px + ${B}px)` : void 0
25
+ firstLineIndent: e ? `calc(${n}px + ${R}px)` : void 0
26
26
  };
27
- }, H = [
27
+ }, ue = [
28
28
  "href",
29
29
  "src",
30
30
  "alt",
31
31
  "colspan",
32
32
  "rowspan",
33
33
  "start"
34
- ], U = new Set([
34
+ ], de = new Set([
35
35
  "pre",
36
36
  "pre-wrap",
37
37
  "pre-line",
38
38
  "break-spaces"
39
- ]), W = (e) => {
39
+ ]), z = (e) => {
40
40
  let t = document.createElement(e.tagName.toLowerCase());
41
- H.forEach((n) => {
41
+ ue.forEach((n) => {
42
42
  let r = e.getAttribute(n);
43
43
  r !== null && t.setAttribute(n, r);
44
44
  });
45
45
  let { whiteSpace: n } = window.getComputedStyle(e);
46
- return U.has(n) && (t.style.whiteSpace = "pre-wrap"), t;
47
- }, G = (e) => e instanceof SVGElement || window.getComputedStyle(e).display === "none", K = (e, t) => {
46
+ return de.has(n) && (t.style.whiteSpace = "pre-wrap"), t;
47
+ }, fe = (e) => e instanceof SVGElement || window.getComputedStyle(e).display === "none", B = (e, t) => {
48
48
  if (!t.intersectsNode(e)) return null;
49
49
  if (e.nodeType === Node.TEXT_NODE) {
50
50
  let n = e.data, r = e === t.startContainer ? t.startOffset : 0, i = e === t.endContainer ? t.endOffset : n.length;
51
51
  return document.createTextNode(n.slice(r, i));
52
52
  }
53
- if (!(e instanceof Element) || G(e)) return null;
54
- let n = W(e);
53
+ if (!(e instanceof Element) || fe(e)) return null;
54
+ let n = z(e);
55
55
  return e.childNodes.forEach((e) => {
56
- let r = K(e, t);
56
+ let r = B(e, t);
57
57
  r && n.appendChild(r);
58
58
  }), n;
59
- }, re = (e, t, n) => {
59
+ }, pe = (e, t, n) => {
60
60
  let r = e, i = t;
61
61
  for (; i && i !== n && n.contains(i);) {
62
- let e = W(i);
62
+ let e = z(i);
63
63
  e.appendChild(r), r = e, i = i.parentElement;
64
64
  }
65
65
  return r;
66
- }, ie = (e, t) => {
66
+ }, me = (e, t) => {
67
67
  let n = e.commonAncestorContainer, r = n instanceof Element ? n : n.parentElement;
68
68
  if (!r) return null;
69
- let i = K(r, e);
70
- return i ? re(i, r.parentElement, t) : null;
71
- }, ae = (e) => {
69
+ let i = B(r, e);
70
+ return i ? pe(i, r.parentElement, t) : null;
71
+ }, he = (e) => {
72
72
  let t = window.getSelection();
73
73
  if (!t || t.isCollapsed || t.rangeCount === 0 || !e.clipboardData) return;
74
74
  let n = t.toString();
75
75
  if (!n) return;
76
76
  let r = document.createElement("div");
77
77
  for (let n = 0; n < t.rangeCount; n++) {
78
- let i = ie(t.getRangeAt(n), e.currentTarget);
78
+ let i = me(t.getRangeAt(n), e.currentTarget);
79
79
  i && r.appendChild(i);
80
80
  }
81
81
  e.clipboardData.setData("text/html", r.innerHTML), e.clipboardData.setData("text/plain", n), e.preventDefault();
82
- }, q = { activeRating: "_activeRating_ygoee_1" }, J = 2e3, oe = ({ role: e = a.User, onEdit: n, onEditHover: r, onDelete: o, onRegenerate: l, onCopy: u, onCopyMarkdown: d, onLike: f, onDislike: _, activeRating: v, isAlwaysVisible: y, isDisabled: x = !1, className: S, labels: C, colors: ee }) => {
83
- let { tooltips: w, ariaLabels: E } = C ?? {}, [D, O] = T(null), [R, z] = T(""), B = n != null || o != null || l != null || u != null || d != null || f != null || _ != null, V = s({ "--ma-active-rating-text": ee?.activeRatingText }), H = b(() => {
84
- u?.(), O("copy"), z(e === a.User ? E?.copiedMessageStatus ?? "Message copied to clipboard" : E?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => O(null), J);
82
+ }, V = { activeRating: "_activeRating_ygoee_1" }, H = 2e3, ge = ({ role: e = a.User, onEdit: n, onEditHover: r, onDelete: o, onRegenerate: c, onCopy: l, onCopyMarkdown: u, onLike: f, onDislike: p, activeRating: m, isAlwaysVisible: h, leadingContent: b, trailingContent: x, isDisabled: S = !1, className: C, labels: T, colors: ee }) => {
83
+ let { tooltips: E, ariaLabels: D } = T ?? {}, [O, A] = k(null), [te, ne] = k(""), L = n != null || o != null || c != null || l != null || u != null || f != null || p != null || b != null || x != null, ce = s({ "--ma-active-rating-text": ee?.activeRatingText }), R = w(() => {
84
+ l?.(), A("copy"), ne(e === a.User ? D?.copiedMessageStatus ?? "Message copied to clipboard" : D?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => A(null), H);
85
85
  }, [
86
- u,
86
+ l,
87
87
  e,
88
- E?.copiedStatus,
89
- E?.copiedMessageStatus
90
- ]), U = b(() => {
91
- d?.(), O("markdown"), z(E?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => O(null), J);
92
- }, [d, E?.copiedMarkdownStatus]);
93
- return B ? /* @__PURE__ */ L("div", {
88
+ D?.copiedStatus,
89
+ D?.copiedMessageStatus
90
+ ]), le = w(() => {
91
+ u?.(), A("markdown"), ne(D?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => A(null), H);
92
+ }, [u, D?.copiedMarkdownStatus]);
93
+ return L ? /* @__PURE__ */ I("div", {
94
94
  role: "toolbar",
95
- "aria-label": E?.actionsGroup ?? "Message actions",
96
- style: V,
97
- className: c("flex gap-1", !y && "opacity-0 group-hover:opacity-100", S),
98
- children: [/* @__PURE__ */ I("span", {
99
- role: "status",
100
- "aria-live": "polite",
101
- className: "sr-only",
102
- children: R
103
- }), e === a.User ? /* @__PURE__ */ L(F, { children: [
104
- u && /* @__PURE__ */ I(t, {
105
- iconSize: p.SM,
106
- onClick: H,
107
- size: h.Small,
108
- isCopied: D === "copy",
109
- copyLabel: w?.copyMessage ?? "Copy message",
110
- copiedLabel: w?.copied ?? "Copied!",
111
- ariaLabel: E?.copyMessage ?? "Copy message",
112
- isDisabled: x
95
+ "aria-label": D?.actionsGroup ?? "Message actions",
96
+ style: ce,
97
+ className: d("flex items-center gap-1", !h && "opacity-0 group-hover:opacity-100", C),
98
+ children: [
99
+ b,
100
+ /* @__PURE__ */ F("span", {
101
+ role: "status",
102
+ "aria-live": "polite",
103
+ className: "sr-only",
104
+ children: te
113
105
  }),
114
- n && /* @__PURE__ */ I(g, {
115
- icon: /* @__PURE__ */ I(A, {
116
- size: p.SM,
117
- "aria-hidden": !0,
118
- stroke: m
106
+ e === a.User ? /* @__PURE__ */ I(P, { children: [
107
+ l && /* @__PURE__ */ F(t, {
108
+ iconSize: g.SM,
109
+ onClick: R,
110
+ size: v.Small,
111
+ isCopied: O === "copy",
112
+ copyLabel: E?.copyMessage ?? "Copy message",
113
+ copiedLabel: E?.copied ?? "Copied!",
114
+ ariaLabel: D?.copyMessage ?? "Copy message",
115
+ isDisabled: S
119
116
  }),
120
- size: h.Small,
121
- "aria-label": E?.editMessage ?? "Edit message",
122
- tooltipProps: { tooltip: w?.edit ?? "Edit" },
123
- onClick: n,
124
- onMouseEnter: r,
125
- onFocus: r,
126
- disabled: x
127
- }),
128
- o && /* @__PURE__ */ I(g, {
129
- icon: /* @__PURE__ */ I(ne, {
130
- size: p.SM,
131
- "aria-hidden": !0,
132
- stroke: m
117
+ n && /* @__PURE__ */ F(y, {
118
+ icon: /* @__PURE__ */ F(ie, {
119
+ size: g.SM,
120
+ "aria-hidden": !0,
121
+ stroke: _
122
+ }),
123
+ size: v.Small,
124
+ "aria-label": D?.editMessage ?? "Edit message",
125
+ tooltipProps: { tooltip: E?.edit ?? "Edit" },
126
+ onClick: n,
127
+ onMouseEnter: r,
128
+ onFocus: r,
129
+ disabled: S
133
130
  }),
134
- size: h.Small,
135
- "aria-label": E?.deleteMessage ?? "Delete message",
136
- tooltipProps: { tooltip: w?.delete ?? "Delete" },
137
- onClick: o,
138
- disabled: x
139
- })
140
- ] }) : /* @__PURE__ */ L(F, { children: [
141
- l && /* @__PURE__ */ I(g, {
142
- icon: /* @__PURE__ */ I(j, {
143
- size: p.SM,
144
- "aria-hidden": !0,
145
- stroke: m
131
+ o && /* @__PURE__ */ F(y, {
132
+ icon: /* @__PURE__ */ F(N, {
133
+ size: g.SM,
134
+ "aria-hidden": !0,
135
+ stroke: _
136
+ }),
137
+ size: v.Small,
138
+ "aria-label": D?.deleteMessage ?? "Delete message",
139
+ tooltipProps: { tooltip: E?.delete ?? "Delete" },
140
+ onClick: o,
141
+ disabled: S
142
+ })
143
+ ] }) : /* @__PURE__ */ I(P, { children: [
144
+ c && /* @__PURE__ */ F(y, {
145
+ icon: /* @__PURE__ */ F(j, {
146
+ size: g.SM,
147
+ "aria-hidden": !0,
148
+ stroke: _
149
+ }),
150
+ size: v.Small,
151
+ "aria-label": D?.regenerateResponse ?? "Regenerate response",
152
+ tooltipProps: { tooltip: E?.regenerate ?? "Regenerate" },
153
+ onClick: c,
154
+ disabled: S
146
155
  }),
147
- size: h.Small,
148
- "aria-label": E?.regenerateResponse ?? "Regenerate response",
149
- tooltipProps: { tooltip: w?.regenerate ?? "Regenerate" },
150
- onClick: l,
151
- disabled: x
152
- }),
153
- u && /* @__PURE__ */ I(t, {
154
- iconSize: p.SM,
155
- onClick: H,
156
- size: h.Small,
157
- isCopied: D === "copy",
158
- copyLabel: w?.copy ?? "Copy",
159
- copiedLabel: w?.copied ?? "Copied!",
160
- ariaLabel: E?.copyResponse ?? "Copy response",
161
- isDisabled: x
162
- }),
163
- d && /* @__PURE__ */ I(t, {
164
- iconSize: p.SM,
165
- onClick: U,
166
- size: h.Small,
167
- isCopied: D === "markdown",
168
- iconCopy: /* @__PURE__ */ I(k, {
169
- size: p.SM,
170
- "aria-hidden": !0,
171
- stroke: m
156
+ l && /* @__PURE__ */ F(t, {
157
+ iconSize: g.SM,
158
+ onClick: R,
159
+ size: v.Small,
160
+ isCopied: O === "copy",
161
+ copyLabel: E?.copy ?? "Copy",
162
+ copiedLabel: E?.copied ?? "Copied!",
163
+ ariaLabel: D?.copyResponse ?? "Copy response",
164
+ isDisabled: S
172
165
  }),
173
- copyLabel: w?.copyMarkdown ?? "Copy as Markdown",
174
- copiedLabel: w?.copiedMarkdown ?? "Copied!",
175
- ariaLabel: E?.copyAsMarkdown ?? "Copy as markdown",
176
- isDisabled: x
177
- }),
178
- f && /* @__PURE__ */ I(g, {
179
- icon: v === i.Like ? /* @__PURE__ */ I(te, {
180
- className: q.activeRating,
181
- size: p.SM,
182
- "aria-hidden": !0
183
- }) : /* @__PURE__ */ I(P, {
184
- size: p.SM,
185
- "aria-hidden": !0,
186
- stroke: m
166
+ u && /* @__PURE__ */ F(t, {
167
+ iconSize: g.SM,
168
+ onClick: le,
169
+ size: v.Small,
170
+ isCopied: O === "markdown",
171
+ iconCopy: /* @__PURE__ */ F(re, {
172
+ size: g.SM,
173
+ "aria-hidden": !0,
174
+ stroke: _
175
+ }),
176
+ copyLabel: E?.copyMarkdown ?? "Copy as Markdown",
177
+ copiedLabel: E?.copiedMarkdown ?? "Copied!",
178
+ ariaLabel: D?.copyAsMarkdown ?? "Copy as markdown",
179
+ isDisabled: S
187
180
  }),
188
- size: h.Small,
189
- "aria-label": E?.likeResponse ?? "Like response",
190
- "aria-pressed": v === i.Like,
191
- tooltipProps: { tooltip: w?.like ?? "Like" },
192
- onClick: f,
193
- disabled: x
194
- }),
195
- _ && /* @__PURE__ */ I(g, {
196
- icon: v === i.Dislike ? /* @__PURE__ */ I(N, {
197
- className: q.activeRating,
198
- size: p.SM,
199
- "aria-hidden": !0
200
- }) : /* @__PURE__ */ I(M, {
201
- size: p.SM,
202
- "aria-hidden": !0,
203
- stroke: m
181
+ f && /* @__PURE__ */ F(y, {
182
+ icon: m === i.Like ? /* @__PURE__ */ F(se, {
183
+ className: V.activeRating,
184
+ size: g.SM,
185
+ "aria-hidden": !0
186
+ }) : /* @__PURE__ */ F(oe, {
187
+ size: g.SM,
188
+ "aria-hidden": !0,
189
+ stroke: _
190
+ }),
191
+ size: v.Small,
192
+ "aria-label": D?.likeResponse ?? "Like response",
193
+ "aria-pressed": m === i.Like,
194
+ tooltipProps: { tooltip: E?.like ?? "Like" },
195
+ onClick: f,
196
+ disabled: S
204
197
  }),
205
- size: h.Small,
206
- "aria-label": E?.dislikeResponse ?? "Dislike response",
207
- "aria-pressed": v === i.Dislike,
208
- tooltipProps: { tooltip: w?.dislike ?? "Dislike" },
209
- onClick: _,
210
- disabled: x
211
- })
212
- ] })]
198
+ p && /* @__PURE__ */ F(y, {
199
+ icon: m === i.Dislike ? /* @__PURE__ */ F(ae, {
200
+ className: V.activeRating,
201
+ size: g.SM,
202
+ "aria-hidden": !0
203
+ }) : /* @__PURE__ */ F(M, {
204
+ size: g.SM,
205
+ "aria-hidden": !0,
206
+ stroke: _
207
+ }),
208
+ size: v.Small,
209
+ "aria-label": D?.dislikeResponse ?? "Dislike response",
210
+ "aria-pressed": m === i.Dislike,
211
+ tooltipProps: { tooltip: E?.dislike ?? "Dislike" },
212
+ onClick: p,
213
+ disabled: S
214
+ })
215
+ ] }),
216
+ x
217
+ ]
213
218
  }) : null;
214
- }, Y = {
215
- userBubble: "_userBubble_cq829_1",
216
- collapsibleText: "_collapsibleText_cq829_6",
217
- expandedText: "_expandedText_cq829_11",
218
- collapsedText: "_collapsedText_cq829_15",
219
- startersDivider: "_startersDivider_cq829_26",
220
- text: "_text_cq829_30"
221
- }, se = "[&>.cm-bubble-markdown>div>*:first-child]:indent-[var(--cm-bubble-first-line-indent,0px)]", X = ({ text: t, contentRef: i, styles: l, actions: d, hasAlwaysVisibleActions: f, isStreaming: p, attachments: m, beforeContent: h, responseFormat: g, afterContent: _, hasThinkingPlaceholder: v = !0, starters: b, onSelectStarter: x, deploymentIconUrl: S, deploymentDisplayName: C, markdownComponents: w, markdownClassNames: T, markdownUrlTransform: E, onAttachmentClick: D, onDownloadAll: O, onAttachmentRetry: k, codeBlockTheme: A, tableOnOpenInCanvas: j, labels: M, selectedAttachmentId: N }) => {
222
- let { colors: P, typography: te, className: ne, bubbleClassName: F } = l ?? {}, { attachmentClickLabel: R, attachmentDownloadLabel: B, attachmentRetryLabel: H, attachmentOpenInNewTabLabel: U, startersAriaLabel: W = "Quick reply buttons", thinkingLabel: G, codeBlockCopyLabel: K, codeBlockCopiedLabel: re, codeBlockDownloadLabel: ie, tableCopyLabel: q, tableCopiedLabel: J, tableDownloadCsvLabel: X, tableOpenInCanvasLabel: Z, tableDownloadFilename: Q, tableScrollRegionAriaLabel: ce, mathScrollRegionAriaLabel: $, assistantMessageAriaLabel: le = "Assistant message", deploymentIconFallbackLabel: ue = "AI" } = M ?? {}, de = ee(() => ({
223
- copyLabel: q,
224
- copiedLabel: J,
225
- downloadCsvLabel: X,
226
- openInCanvasLabel: Z
219
+ }, U = (e) => {
220
+ let [t, n] = k(() => /* @__PURE__ */ new Date());
221
+ return T(() => {
222
+ let t = setInterval(() => n(/* @__PURE__ */ new Date()), e);
223
+ return () => clearInterval(t);
224
+ }, [e]), t;
225
+ }, W = /* @__PURE__ */ function(e) {
226
+ return e.Today = "today", e.Yesterday = "yesterday", e.Absolute = "absolute", e;
227
+ }({}), G = {
228
+ hour: "numeric",
229
+ minute: "2-digit"
230
+ }, K = {
231
+ year: "numeric",
232
+ month: "short",
233
+ day: "numeric",
234
+ ...G
235
+ }, q = 60, J = 60 * q, Y = 24 * J, _e = [
236
+ ["year", 365 * Y],
237
+ ["month", 30 * Y],
238
+ ["week", 7 * Y],
239
+ ["day", Y],
240
+ ["hour", J],
241
+ ["minute", q]
242
+ ], ve = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), ye = (e) => {
243
+ if (!e) return null;
244
+ let t = new Date(e);
245
+ return Number.isNaN(t.getTime()) ? null : t;
246
+ }, X = (e, t) => new Intl.DateTimeFormat(t, K).format(e), be = (e, t, n) => {
247
+ let r = new Date(t.getFullYear(), t.getMonth(), t.getDate() - 1);
248
+ return ve(e, t) ? {
249
+ kind: W.Today,
250
+ text: new Intl.DateTimeFormat(n, G).format(e)
251
+ } : ve(e, r) ? {
252
+ kind: W.Yesterday,
253
+ text: new Intl.DateTimeFormat(n, G).format(e)
254
+ } : {
255
+ kind: W.Absolute,
256
+ text: X(e, n)
257
+ };
258
+ }, xe = (e, t, n) => {
259
+ let r = new Intl.RelativeTimeFormat(n, { numeric: "auto" }), i = (t.getTime() - e.getTime()) / 1e3;
260
+ for (let [e, t] of _e) {
261
+ let n = Math.floor(i / t);
262
+ if (n >= 1) return r.format(-n, e);
263
+ }
264
+ return r.format(0, "second");
265
+ }, Z = 6e4, Se = "opacity-0 transition-opacity group-hover/message:opacity-100 group-focus-within/message:opacity-100 [@media(hover:none)]:opacity-100", Ce = ({ timestamp: e, locale: t, className: n = "dial-small-text text-secondary" }) => {
266
+ let r = U(Z), i = ye(e);
267
+ return i == null ? null : /* @__PURE__ */ F(C, {
268
+ tooltip: X(i, t),
269
+ asChild: !0,
270
+ children: /* @__PURE__ */ F("time", {
271
+ dateTime: e,
272
+ tabIndex: 0,
273
+ className: d("px-1 whitespace-nowrap", n, Se),
274
+ children: xe(i, r, t)
275
+ })
276
+ });
277
+ }, Q = {
278
+ userBubble: "_userBubble_17fln_1",
279
+ collapsibleText: "_collapsibleText_17fln_6",
280
+ expandedText: "_expandedText_17fln_11",
281
+ collapsedText: "_collapsedText_17fln_15",
282
+ startersDivider: "_startersDivider_17fln_31",
283
+ text: "_text_17fln_35"
284
+ }, we = "[&>.cm-bubble-markdown>div>*:first-child]:indent-[var(--cm-bubble-first-line-indent,0px)]", $ = ({ text: t, contentRef: i, styles: c, actions: l, hasAlwaysVisibleActions: u, timestamp: f, locale: m, isStreaming: h, attachments: g, beforeContent: _, responseFormat: v, afterContent: y, hasThinkingPlaceholder: b = !0, starters: x, onSelectStarter: C, deploymentIconUrl: w, deploymentDisplayName: T, markdownComponents: ee, markdownClassNames: E, markdownUrlTransform: O, onAttachmentClick: k, onDownloadAll: A, onAttachmentRetry: te, codeBlockTheme: ne, tableOnOpenInCanvas: re, labels: ie, selectedAttachmentId: j }) => {
285
+ let { colors: M, typography: ae, className: oe, bubbleClassName: se, timestampClassName: N } = c ?? {}, L = f == null ? void 0 : /* @__PURE__ */ F(Ce, {
286
+ timestamp: f,
287
+ locale: m,
288
+ className: N
289
+ }), { attachmentClickLabel: R, attachmentDownloadLabel: ue, attachmentRetryLabel: de, attachmentOpenInNewTabLabel: z, startersAriaLabel: fe = "Quick reply buttons", thinkingLabel: B, codeBlockCopyLabel: pe, codeBlockCopiedLabel: me, codeBlockDownloadLabel: V, tableCopyLabel: H, tableCopiedLabel: U, tableDownloadCsvLabel: W, tableOpenInCanvasLabel: G, tableDownloadFilename: K, tableScrollRegionAriaLabel: q, mathScrollRegionAriaLabel: J, assistantMessageAriaLabel: Y = "Assistant message", deploymentIconFallbackLabel: _e = "AI" } = ie ?? {}, ve = D(() => ({
290
+ copyLabel: H,
291
+ copiedLabel: U,
292
+ downloadCsvLabel: W,
293
+ openInCanvasLabel: G
227
294
  }), [
228
- q,
229
- J,
230
- X,
231
- Z
232
- ]), fe = p ? (m ?? []).filter((t) => t.type !== e.Audio) : m ?? [], { slotRef: pe, firstLineIndent: me } = V(h != null && !!t), he = s({
233
- "--cm-bubble-text": P?.text,
234
- "--cm-starters-divider": P?.startersDivider,
235
- "--cm-bubble-first-line-indent": me
236
- }), ge = c(Y.text, te?.fontClassName), _e = !!(S || C);
237
- return /* @__PURE__ */ L("div", {
295
+ H,
296
+ U,
297
+ W,
298
+ G
299
+ ]), ye = h ? (g ?? []).filter((t) => t.type !== e.Audio) : g ?? [], X = !!t?.trim(), { slotRef: be, firstLineIndent: xe } = le(_ != null && X), Z = s({
300
+ "--cm-bubble-text": M?.text,
301
+ "--cm-starters-divider": M?.startersDivider,
302
+ "--cm-bubble-first-line-indent": xe
303
+ }), Se = d(Q.text, ae?.fontClassName), $ = !!(w || T);
304
+ return /* @__PURE__ */ I("div", {
238
305
  role: "group",
239
- "aria-label": le,
240
- style: he,
241
- onCopy: ae,
242
- className: c("flex w-full items-start gap-3", ne),
243
- children: [_e && /* @__PURE__ */ I(n, {
244
- src: S,
306
+ "aria-label": Y,
307
+ style: Z,
308
+ onCopy: he,
309
+ className: d("group/message flex w-full items-start gap-3", oe),
310
+ children: [$ && /* @__PURE__ */ F(n, {
311
+ src: w,
245
312
  size: 28,
246
- initialsName: C || ue,
247
- labels: { tooltip: C ?? ue }
248
- }), /* @__PURE__ */ L("div", {
249
- className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
250
- children: [/* @__PURE__ */ L("div", {
251
- className: c("flex w-full min-w-0 max-w-full flex-col items-start gap-4", F),
313
+ initialsName: T || _e,
314
+ labels: { tooltip: T ?? _e }
315
+ }), /* @__PURE__ */ I("div", {
316
+ className: "flex w-full max-w-full min-w-0 flex-col items-start gap-5",
317
+ children: [/* @__PURE__ */ I("div", {
318
+ className: d("flex w-full max-w-full min-w-0 flex-col items-start gap-4", se),
252
319
  children: [
253
- h != null && !t && /* @__PURE__ */ I("div", {
320
+ _ != null && !X && /* @__PURE__ */ F("div", {
254
321
  className: "min-w-0",
255
- children: h
322
+ children: _
256
323
  }),
257
- (t || p && v) && /* @__PURE__ */ L("div", {
324
+ (X || h && b) && /* @__PURE__ */ I("div", {
258
325
  "aria-live": "polite",
259
326
  "aria-atomic": "false",
260
- className: c(ge, "relative min-w-0 max-w-full text-start", h != null && t && se, z.assistantContent),
261
- children: [h != null && t && /* @__PURE__ */ I("div", {
262
- ref: pe,
263
- className: "absolute start-0 top-0",
264
- children: h
265
- }), /* @__PURE__ */ I("div", {
327
+ className: d(Se, "relative max-w-full min-w-0 text-start", _ != null && X && we, ce.assistantContent),
328
+ children: [_ != null && X && /* @__PURE__ */ F("div", {
329
+ ref: be,
330
+ className: "absolute inset-s-0 top-0",
331
+ children: _
332
+ }), /* @__PURE__ */ F("div", {
266
333
  ref: i,
267
- className: "cm-bubble-markdown min-w-0 max-w-full",
268
- children: /* @__PURE__ */ I(r, {
334
+ className: "cm-bubble-markdown max-w-full min-w-0",
335
+ children: /* @__PURE__ */ F(r, {
269
336
  content: t ?? "",
270
- isPlainText: g === o.PlainText,
271
- isStreaming: p,
272
- thinkingLabel: G,
273
- components: w,
274
- classNames: T,
275
- urlTransform: E,
276
- codeBlockCopyLabel: K,
277
- codeBlockCopiedLabel: re,
278
- codeBlockDownloadLabel: ie,
279
- codeBlockTheme: A,
280
- tableActionLabels: de,
281
- tableDownloadFilename: Q,
282
- tableOnOpenInCanvas: j,
283
- tableScrollRegionAriaLabel: ce,
284
- mathScrollRegionAriaLabel: $
337
+ isPlainText: v === o.PlainText,
338
+ isStreaming: h,
339
+ thinkingLabel: B,
340
+ components: ee,
341
+ classNames: E,
342
+ urlTransform: O,
343
+ codeBlockCopyLabel: pe,
344
+ codeBlockCopiedLabel: me,
345
+ codeBlockDownloadLabel: V,
346
+ codeBlockTheme: ne,
347
+ tableActionLabels: ve,
348
+ tableDownloadFilename: K,
349
+ tableOnOpenInCanvas: re,
350
+ tableScrollRegionAriaLabel: q,
351
+ mathScrollRegionAriaLabel: J
285
352
  })
286
353
  })]
287
354
  }),
288
- /* @__PURE__ */ I(u, {
289
- attachments: fe,
290
- onAttachmentClick: D ? (e) => {
291
- let t = m?.find((t) => t.id === e);
292
- t && D(t);
355
+ /* @__PURE__ */ F(p, {
356
+ attachments: ye,
357
+ onAttachmentClick: k ? (e) => {
358
+ let t = g?.find((t) => t.id === e);
359
+ t && k(t);
293
360
  } : void 0,
294
- onDownloadAll: O,
295
- onRetry: k,
361
+ onDownloadAll: A,
362
+ onRetry: te,
296
363
  labels: {
297
364
  clickLabel: R,
298
- downloadLabel: B,
299
- retryLabel: H,
300
- openInNewTabLabel: U
365
+ downloadLabel: ue,
366
+ retryLabel: de,
367
+ openInNewTabLabel: z
301
368
  },
302
- selectedAttachmentId: N
369
+ selectedAttachmentId: j
303
370
  }),
304
- _,
305
- /* @__PURE__ */ I(oe, {
306
- ...d,
307
- isAlwaysVisible: f,
371
+ y,
372
+ /* @__PURE__ */ F(ge, {
373
+ ...l,
374
+ isAlwaysVisible: u,
375
+ trailingContent: L == null ? l?.trailingContent : /* @__PURE__ */ I(P, { children: [l?.trailingContent, L] }),
308
376
  role: a.Assistant
309
377
  })
310
378
  ]
311
- }), b && b.length > 0 && x && /* @__PURE__ */ I("div", {
379
+ }), x && x.length > 0 && C && /* @__PURE__ */ F("div", {
312
380
  role: "list",
313
- "aria-label": W,
314
- className: c("flex w-full flex-wrap gap-2 border-t pt-5", Y.startersDivider),
315
- children: b.map((e, t) => /* @__PURE__ */ I("div", {
381
+ "aria-label": fe,
382
+ className: d("flex w-full flex-wrap gap-2 border-t pt-5", Q.startersDivider),
383
+ children: x.map((e, t) => /* @__PURE__ */ F("div", {
316
384
  role: "listitem",
317
385
  className: "min-w-[40px]",
318
- children: /* @__PURE__ */ I(y, {
386
+ children: /* @__PURE__ */ F(S, {
319
387
  label: e.title,
320
388
  className: "min-w-[40px]",
321
- onClick: () => x(e)
389
+ onClick: () => C(e)
322
390
  })
323
391
  }, t))
324
392
  })]
325
393
  })]
326
394
  });
327
- }, Z = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ I("div", {
395
+ }, Te = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ F("div", {
328
396
  role: "status",
329
397
  "aria-live": "polite",
330
- children: /* @__PURE__ */ I(_, {
398
+ children: /* @__PURE__ */ F(b, {
331
399
  title: e,
332
400
  message: t,
333
401
  textClassName: "flex-row flex-wrap gap-1"
334
402
  })
335
- }), Q = /* @__PURE__ */ function(e) {
403
+ }), Ee = /* @__PURE__ */ function(e) {
336
404
  return e.Bottom = "Bottom", e.Top = "Top", e;
337
- }({}), ce = 10, $ = ({ text: e, contentRef: t, position: n = Q.Bottom, styles: r, actions: i, hasAlwaysVisibleActions: o, attachments: d, collapsedLineCount: f = ce, labels: m, textSegments: g, onAttachmentClick: _, onDownloadAll: y, onAttachmentRetry: b, selectedAttachmentId: x }) => {
338
- let { colors: C, typography: ee, className: w, bubbleClassName: T } = r ?? {}, { showMoreLabel: E = "Show more", showLessLabel: k = "Show less", showMoreAriaLabel: A, showLessAriaLabel: j, attachmentClickLabel: M, attachmentDownloadLabel: N, attachmentRetryLabel: P, attachmentOpenInNewTabLabel: te, userMessageAriaLabel: ne = "User message" } = m ?? {}, { textRef: R, isTextCollapsed: B, isOverflowing: V, collapsedMaxHeight: H, expandedMaxHeight: U, isCollapsed: W, toggleCollapsed: G } = l({
405
+ }({}), De = 10, Oe = "[&>div>*:first-child]:mt-0 [&>div>*:last-child]:mb-0", ke = [], Ae = ({ text: e, contentRef: t, position: n = Ee.Bottom, styles: i, actions: o, hasAlwaysVisibleActions: m, timestamp: h, locale: _, attachments: y, collapsedLineCount: b = De, labels: S, textSegments: C, onAttachmentClick: w, onDownloadAll: T, onAttachmentRetry: E, selectedAttachmentId: O, markdownClassNames: k, markdownUrlTransform: A, codeBlockTheme: re, tableOnOpenInCanvas: ie }) => {
406
+ let { colors: j, typography: M, className: ae, bubbleClassName: oe, timestampClassName: se } = i ?? {}, N = h == null ? void 0 : /* @__PURE__ */ F(Ce, {
407
+ timestamp: h,
408
+ locale: _,
409
+ className: se
410
+ }), { showMoreLabel: L = "Show more", showLessLabel: R = "Show less", showMoreAriaLabel: le, showLessAriaLabel: ue, attachmentClickLabel: de, attachmentDownloadLabel: z, attachmentRetryLabel: fe, attachmentOpenInNewTabLabel: B, userMessageAriaLabel: pe = "User message", codeBlockCopyLabel: me, codeBlockCopiedLabel: V, codeBlockDownloadLabel: H, tableCopyLabel: U, tableCopiedLabel: W, tableDownloadCsvLabel: G, tableOpenInCanvasLabel: K, tableDownloadFilename: q, tableScrollRegionAriaLabel: J, mathScrollRegionAriaLabel: Y } = S ?? {}, _e = D(() => ({
411
+ copyLabel: U,
412
+ copiedLabel: W,
413
+ downloadCsvLabel: G,
414
+ openInCanvasLabel: K
415
+ }), [
416
+ U,
417
+ W,
418
+ G,
419
+ K
420
+ ]), { textRef: ve, isTextCollapsed: ye, isOverflowing: X, collapsedMaxHeight: be, expandedMaxHeight: xe, isCollapsed: Z, toggleCollapsed: Se } = f({
339
421
  text: e ?? "",
340
- collapsedLineCount: f
341
- }), K = s({
342
- "--cm-bubble-user-bg": C?.userBackground,
343
- "--cm-bubble-user-border": C?.userBorder,
344
- "--cm-bubble-fade-start": C?.fadeStart,
345
- "--cm-bubble-text": C?.text,
346
- "--cm-bubble-collapsed-height": V ? `${H}px` : void 0,
347
- "--cm-bubble-expanded-height": V ? `${U}px` : void 0
348
- }), re = n === Q.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", ie = c(Y.text, ee?.fontClassName), q = A ?? E, J = j ?? k, se = W ? E : k, X = W ? q : J, Z = W ? D : O, $ = S();
349
- return /* @__PURE__ */ I("div", {
422
+ collapsedLineCount: b
423
+ }), we = s({
424
+ "--cm-bubble-user-bg": j?.userBackground,
425
+ "--cm-bubble-user-border": j?.userBorder,
426
+ "--cm-bubble-fade-start": j?.fadeStart,
427
+ "--cm-bubble-text": j?.text,
428
+ "--cm-bubble-collapsed-height": X ? `${be}px` : void 0,
429
+ "--cm-bubble-expanded-height": X ? `${xe}px` : void 0
430
+ }), $ = n === Ee.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", Te = d(Q.text, M?.fontClassName), { markdownSource: Ae, segmentRehypePlugins: je, segmentComponents: Me } = D(() => {
431
+ if (C == null) return {
432
+ markdownSource: e ?? "",
433
+ segmentRehypePlugins: ke,
434
+ segmentComponents: void 0
435
+ };
436
+ let { source: t, inlineSegments: n } = c(C);
437
+ return {
438
+ markdownSource: t,
439
+ segmentRehypePlugins: [u(n)],
440
+ segmentComponents: l(n)
441
+ };
442
+ }, [e, C]), Ne = le ?? L, Pe = ue ?? R, Fe = Z ? L : R, Ie = Z ? Ne : Pe, Le = Z ? te : ne, Re = ee();
443
+ return /* @__PURE__ */ F("div", {
350
444
  role: "group",
351
- "aria-label": ne,
352
- style: K,
353
- onCopy: ae,
354
- className: c("flex w-full", w),
355
- children: /* @__PURE__ */ L("div", {
356
- className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
445
+ "aria-label": pe,
446
+ style: we,
447
+ onCopy: he,
448
+ className: d("group/message flex w-full", ae),
449
+ children: /* @__PURE__ */ I("div", {
450
+ className: "ms-auto flex w-fit max-w-full min-w-0 flex-col items-end gap-4",
357
451
  children: [
358
- /* @__PURE__ */ I(u, {
359
- attachments: d ?? [],
360
- onAttachmentClick: _ ? (e) => {
361
- let t = d?.find((t) => t.id === e);
362
- t && _(t);
452
+ /* @__PURE__ */ F(p, {
453
+ attachments: y ?? [],
454
+ onAttachmentClick: w ? (e) => {
455
+ let t = y?.find((t) => t.id === e);
456
+ t && w(t);
363
457
  } : void 0,
364
- onDownloadAll: y,
365
- onRetry: b,
458
+ onDownloadAll: T,
459
+ onRetry: E,
366
460
  labels: {
367
- clickLabel: M,
368
- downloadLabel: N,
369
- retryLabel: P,
370
- openInNewTabLabel: te
461
+ clickLabel: de,
462
+ downloadLabel: z,
463
+ retryLabel: fe,
464
+ openInNewTabLabel: B
371
465
  },
372
466
  styles: { className: "max-w-[640px]" },
373
- selectedAttachmentId: x
467
+ selectedAttachmentId: O
374
468
  }),
375
- e && /* @__PURE__ */ I("div", {
376
- className: c(Y.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", re, T, z.userBubble),
377
- children: /* @__PURE__ */ L("div", {
469
+ e && /* @__PURE__ */ F("div", {
470
+ className: d(Q.userBubble, "flex w-fit items-center justify-end rounded-ss-2xl rounded-es-2xl border px-6 py-4", $, oe, ce.userBubble),
471
+ children: /* @__PURE__ */ I("div", {
378
472
  className: "flex min-w-0 flex-col items-start",
379
- children: [/* @__PURE__ */ I("div", {
380
- id: $,
473
+ children: [/* @__PURE__ */ F("div", {
474
+ id: Re,
381
475
  ref: t,
382
- className: c("relative -me-1 -ms-1 w-[calc(100%+8px)] overflow-hidden pe-1 ps-1", V && Y.collapsibleText, V && !W && Y.expandedText, B && Y.collapsedText),
383
- children: /* @__PURE__ */ I("p", {
384
- ref: R,
385
- className: c(ie, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
386
- children: g ?? e
476
+ className: d("relative -ms-1 -me-1 w-[calc(100%+8px)] overflow-hidden ps-1 pe-1", X && Q.collapsibleText, X && !Z && Q.expandedText, ye && Q.collapsedText),
477
+ children: /* @__PURE__ */ F("div", {
478
+ ref: ve,
479
+ className: d(Te, "max-w-full min-w-0 text-start", Oe),
480
+ children: /* @__PURE__ */ F(r, {
481
+ content: Ae,
482
+ isRawHtmlEnabled: !1,
483
+ rehypePlugins: je,
484
+ components: Me,
485
+ classNames: k,
486
+ urlTransform: A,
487
+ codeBlockCopyLabel: me,
488
+ codeBlockCopiedLabel: V,
489
+ codeBlockDownloadLabel: H,
490
+ codeBlockTheme: re,
491
+ tableActionLabels: _e,
492
+ tableDownloadFilename: q,
493
+ tableOnOpenInCanvas: ie,
494
+ tableScrollRegionAriaLabel: J,
495
+ mathScrollRegionAriaLabel: Y
496
+ })
387
497
  })
388
- }), V && /* @__PURE__ */ I(v, {
389
- label: /* @__PURE__ */ I(F, { children: se }),
390
- iconBefore: /* @__PURE__ */ I(Z, {
391
- size: p.SM,
498
+ }), X && /* @__PURE__ */ F(x, {
499
+ label: /* @__PURE__ */ F(P, { children: Fe }),
500
+ iconBefore: /* @__PURE__ */ F(Le, {
501
+ size: g.SM,
392
502
  "aria-hidden": "true"
393
503
  }),
394
- "aria-label": X,
395
- "aria-expanded": !W,
396
- "aria-controls": $,
504
+ "aria-label": Ie,
505
+ "aria-expanded": !Z,
506
+ "aria-controls": Re,
397
507
  className: "mt-3",
398
- onClick: G,
399
- size: h.Small
508
+ onClick: Se,
509
+ size: v.Small
400
510
  })]
401
511
  })
402
512
  }),
403
- /* @__PURE__ */ I(oe, {
404
- ...i,
405
- isAlwaysVisible: o,
513
+ /* @__PURE__ */ F(ge, {
514
+ ...o,
515
+ isAlwaysVisible: m,
516
+ leadingContent: N == null ? o?.leadingContent : /* @__PURE__ */ I(P, { children: [N, o?.leadingContent] }),
406
517
  role: a.User
407
518
  })
408
519
  ]
409
520
  })
410
521
  });
411
- }, le = ({ role: e, beforeContent: t, textSegments: n, onAttachmentClick: r, responseFormat: i, markdownComponents: o, markdownUrlTransform: s, ...c }) => e === a.Status ? /* @__PURE__ */ I(Z, { labels: {
522
+ }, je = ({ role: e, beforeContent: t, textSegments: n, onAttachmentClick: r, responseFormat: i, markdownComponents: o, markdownUrlTransform: s, ...c }) => e === a.Status ? /* @__PURE__ */ F(Te, { labels: {
412
523
  titleText: c.labels?.statusTitleText,
413
524
  bodyText: c.labels?.statusBodyText ?? ""
414
- } }) : e === a.User ? /* @__PURE__ */ I($, {
525
+ } }) : e === a.User ? /* @__PURE__ */ F(Ae, {
415
526
  ...c,
416
527
  textSegments: n,
528
+ markdownUrlTransform: s,
417
529
  onAttachmentClick: r
418
- }) : /* @__PURE__ */ I(X, {
530
+ }) : /* @__PURE__ */ F($, {
419
531
  ...c,
420
532
  beforeContent: t,
421
533
  responseFormat: i,
422
534
  markdownComponents: o,
423
535
  markdownUrlTransform: s,
424
536
  onAttachmentClick: r
425
- }), ue = { button: "_button_tqo4d_3" }, de = ({ rect: e, actionRef: t, onReply: n, addedRevision: r, labels: i, styles: a, portalContainer: o }) => {
426
- let { colors: l, typography: u, className: p, buttonClassName: g } = a ?? {}, _ = u?.fontClassName ?? "dial-small-text", v = o === void 0 ? typeof document > "u" ? null : document.body : o, y = s({
427
- "--cm-reply-background": l?.background,
428
- "--cm-reply-hover-background": l?.hoverBackground,
429
- "--cm-reply-text": l?.text
430
- }), [b, x] = T({
537
+ }), Me = { button: "_button_tqo4d_3" }, Ne = ({ rect: e, actionRef: t, onReply: n, addedRevision: r, labels: i, styles: a, portalContainer: o }) => {
538
+ let { colors: c, typography: l, className: u, buttonClassName: f } = a ?? {}, p = l?.fontClassName ?? "dial-small-text", g = o === void 0 ? typeof document > "u" ? null : document.body : o, y = s({
539
+ "--cm-reply-background": c?.background,
540
+ "--cm-reply-hover-background": c?.hoverBackground,
541
+ "--cm-reply-text": c?.text
542
+ }), [b, x] = k({
431
543
  x: 0,
432
544
  y: 0
433
545
  });
434
- return C(() => {
546
+ return E(() => {
435
547
  if (!e || !t.current) return;
436
548
  let n = t.current.getBoundingClientRect(), r = window.visualViewport, i = r?.offsetLeft ?? 0, a = r?.offsetTop ?? 0, o = r?.width ?? document.documentElement.clientWidth, s = r?.height ?? document.documentElement.clientHeight, c = e.top - n.height - 8 >= a + 8 ? e.top - n.height - 8 : e.bottom + 8;
437
549
  x({
@@ -441,38 +553,47 @@ var z = {
441
553
  }, [
442
554
  e,
443
555
  t,
444
- v,
445
- p,
446
556
  g,
447
- _,
557
+ u,
558
+ f,
559
+ p,
448
560
  i.reply
449
- ]), v ? R(/* @__PURE__ */ L(F, { children: [e && /* @__PURE__ */ I("div", {
561
+ ]), g ? L(/* @__PURE__ */ I(P, { children: [e && /* @__PURE__ */ F("div", {
450
562
  ref: t,
451
- className: c("fixed left-0 top-0 z-50 max-w-[calc(100vw-16px)]", p),
563
+ className: d("fixed top-0 left-0 z-50 max-w-[calc(100vw-16px)]", u),
452
564
  style: {
453
565
  ...y,
454
566
  transform: `translate(${b.x}px, ${b.y}px)`
455
567
  },
456
- children: /* @__PURE__ */ I(d, {
457
- variant: f.Neutral,
458
- size: h.Small,
568
+ children: /* @__PURE__ */ F(m, {
569
+ variant: h.Neutral,
570
+ size: v.Small,
459
571
  label: i.reply,
460
572
  onClick: n,
461
- textClassName: _,
462
- className: c(ue.button, "h-8 min-h-8 min-w-11 px-2 shadow-lg mobile:h-11 mobile:min-h-11", g),
463
- iconAfter: /* @__PURE__ */ I(E, {
573
+ textClassName: p,
574
+ className: d(Me.button, "h-8 min-h-8 min-w-11 px-2 shadow-lg mobile:h-11 mobile:min-h-11", f),
575
+ iconAfter: /* @__PURE__ */ F(A, {
464
576
  size: 16,
465
- stroke: m,
577
+ stroke: _,
466
578
  "aria-hidden": "true",
467
579
  className: "rtl:scale-x-[-1]"
468
580
  })
469
581
  })
470
- }), /* @__PURE__ */ I("div", {
582
+ }), /* @__PURE__ */ F("div", {
471
583
  role: "status",
472
584
  "aria-live": "polite",
473
585
  className: "sr-only",
474
- children: e ? i.selectionAvailable : r > 0 ? /* @__PURE__ */ I("span", { children: i.attachmentAdded }, r) : null
475
- })] }), v) : null;
586
+ children: e ? i.selectionAvailable : r > 0 ? /* @__PURE__ */ F("span", { children: i.attachmentAdded }, r) : null
587
+ })] }), g) : null;
588
+ }, Pe = (e) => `Today ${e}`, Fe = (e) => `Yesterday ${e}`, Ie = ({ timestamp: e, locale: t, labels: n, className: r = "dial-small-text text-secondary" }) => {
589
+ let i = ye(e);
590
+ if (i == null) return null;
591
+ let { kind: a, text: o } = be(i, /* @__PURE__ */ new Date(), t), s = o;
592
+ return a === W.Today ? s = (n?.today ?? Pe)(o) : a === W.Yesterday && (s = (n?.yesterday ?? Fe)(o)), /* @__PURE__ */ F("time", {
593
+ dateTime: e,
594
+ className: d("self-center text-center", r),
595
+ children: s
596
+ });
476
597
  };
477
598
  //#endregion
478
- export { X as AssistantMessageBubble, Q as BubblePosition, z as CONVERSATION_MESSAGES_CLASS, oe as MessageActions, le as MessageBubble, de as MessageSelectionReply, Z as StatusMessageBubble, $ as UserMessageBubble };
599
+ export { $ as AssistantMessageBubble, Ee as BubblePosition, ce as CONVERSATION_MESSAGES_CLASS, Ie as ConversationStartTimestamp, ge as MessageActions, je as MessageBubble, Ne as MessageSelectionReply, Te as StatusMessageBubble, Ae as UserMessageBubble };