@epam/ai-dial-conversation-input 1.0.0-dev.492 → 1.0.0-dev.494

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,46 +1,46 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, Highlight as r, RequestStatus as i, ResponseFormat as a, buildCssVars as o, mergeClasses as s, useIsMobile as c } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as l, ButtonAppearance as u, ButtonVariant as d, DIAL_ICON_SIZE as f, DialButton as p, DialCloseButton as m, DialDropdown as h, DialDropdownIcon as g, DialErrorText as _, DialGhostIconButton as v, DialInput as y, DialPopup as b, DialPrimaryButton as x, DialRadioGroup as S, DialSearch as C, DialSkeleton as w, DialSkeletonVariant as T, DialSlider as E, DialSpinner as D, DialTag as O, DialTooltip as k, ElementSize as A, PopupSize as ee, RadioGroupOrientation as j } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowLeft as te, IconArrowNarrowRight as ne, IconCheck as re, IconChevronDown as ie, IconChevronRight as ae, IconFile as oe, IconMicrophone as se, IconPaperclip as ce, IconPlaystationSquare as le, IconPlus as ue, IconSettings as de, IconX as M } from "@tabler/icons-react";
4
- import { createPortal as fe } from "react-dom";
5
- import { createElement as pe, memo as me, useCallback as N, useEffect as P, useImperativeHandle as he, useLayoutEffect as F, useMemo as I, useRef as L, useState as R } from "react";
6
- import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
7
- import { AttachmentCard as ge, AttachmentGroup as _e, AttachmentTray as ve, AttachmentTray as ye, FileDndOverlay as be, MAX_UPLOADS_PER_MINUTE as xe, generateAttachmentId as Se, getAttachmentIcon as Ce, useClipboardPaste as we } from "@epam/ai-dial-attachment-input";
2
+ import { BASE_ICON_SIZE as l, ButtonAppearance as u, ButtonVariant as d, DIAL_ICON_SIZE as f, DialButton as p, DialCloseButton as m, DialDropdown as h, DialDropdownIcon as g, DialErrorText as _, DialGhostIconButton as v, DialInput as y, DialPopup as b, DialPrimaryButton as x, DialRadioGroup as S, DialSearch as C, DialSkeleton as w, DialSkeletonVariant as T, DialSlider as E, DialSpinner as D, DialTag as ee, DialTooltip as O, ElementSize as k, PopupSize as te, RadioGroupOrientation as ne } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowLeft as re, IconArrowNarrowRight as ie, IconCheck as ae, IconChevronDown as oe, IconChevronRight as se, IconFile as ce, IconMicrophone as le, IconPaperclip as ue, IconPlaystationSquare as de, IconPlus as fe, IconSettings as pe, IconX as me } from "@tabler/icons-react";
4
+ import { createPortal as A } from "react-dom";
5
+ import { createElement as he, memo as ge, useCallback as j, useEffect as M, useImperativeHandle as _e, useLayoutEffect as ve, useMemo as N, useRef as P, useState as F } from "react";
6
+ import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
7
+ import { AttachmentCard as ye, AttachmentGroup as be, AttachmentTray as xe, AttachmentTray as Se, FileDndOverlay as Ce, MAX_UPLOADS_PER_MINUTE as we, generateAttachmentId as Te, getAttachmentIcon as Ee, useClipboardPaste as De } from "@epam/ai-dial-attachment-input";
8
8
  //#region src/hooks/useBottomSheet.ts
9
- var Te = (e, t) => {
10
- P(() => {
9
+ var Oe = (e, t) => {
10
+ M(() => {
11
11
  if (!e) return;
12
12
  let n = (e) => {
13
13
  e.key === "Escape" && t();
14
14
  };
15
15
  return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
16
- }, [e, t]), P(() => {
16
+ }, [e, t]), M(() => {
17
17
  if (e) return document.body.style.overflow = "hidden", () => {
18
18
  document.body.style.overflow = "";
19
19
  };
20
20
  }, [e]);
21
- }, Ee = {
21
+ }, z = {
22
22
  backdrop: "_backdrop_3xrn0_9",
23
23
  sheet: "_sheet_3xrn0_13",
24
24
  "slide-up": "_slide-up_3xrn0_1",
25
25
  title: "_title_3xrn0_18",
26
26
  divider: "_divider_3xrn0_22"
27
- }, H = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: c, titleClassName: l = "dial-body-semi-text", className: u, children: d }) => (Te(e, r), !e || typeof document > "u" ? null : fe(/* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("div", {
28
- className: s(Ee.backdrop, "fixed inset-0 z-[55]"),
27
+ }, B = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: c, titleClassName: l = "dial-body-semi-text", className: u, children: d }) => (Oe(e, r), !e || typeof document > "u" ? null : A(/* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("div", {
28
+ className: s(z.backdrop, "fixed inset-0 z-[55]"),
29
29
  onPointerDown: r,
30
30
  "aria-hidden": !0
31
- }), /* @__PURE__ */ V("div", {
31
+ }), /* @__PURE__ */ R("div", {
32
32
  role: "dialog",
33
33
  "aria-modal": !0,
34
34
  "aria-label": t ?? o,
35
35
  style: c,
36
- className: s(Ee.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col", u),
37
- children: [t != null && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ V("div", {
36
+ className: s(z.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col", u),
37
+ children: [t != null && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ R("div", {
38
38
  className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
39
39
  children: [
40
- i && /* @__PURE__ */ B("div", {
40
+ i && /* @__PURE__ */ L("div", {
41
41
  className: "absolute start-4",
42
- children: /* @__PURE__ */ B(v, {
43
- icon: /* @__PURE__ */ B(te, {
42
+ children: /* @__PURE__ */ L(v, {
43
+ icon: /* @__PURE__ */ L(re, {
44
44
  size: f.LG,
45
45
  stroke: 1.5,
46
46
  className: "rtl:scale-x-[-1]"
@@ -49,40 +49,40 @@ var Te = (e, t) => {
49
49
  onClick: i
50
50
  })
51
51
  }),
52
- /* @__PURE__ */ B("span", {
53
- className: s(Ee.title, l),
52
+ /* @__PURE__ */ L("span", {
53
+ className: s(z.title, l),
54
54
  children: t
55
55
  }),
56
- /* @__PURE__ */ B("div", {
56
+ /* @__PURE__ */ L("div", {
57
57
  className: "absolute end-4 m-2",
58
- children: /* @__PURE__ */ B(m, {
58
+ children: /* @__PURE__ */ L(m, {
59
59
  ariaLabel: n,
60
60
  size: f.LG,
61
61
  onClose: r
62
62
  })
63
63
  })
64
64
  ]
65
- }), /* @__PURE__ */ B("div", { className: "h-px flex-shrink-0" })] }), /* @__PURE__ */ B("div", {
65
+ }), /* @__PURE__ */ L("div", { className: "h-px flex-shrink-0" })] }), /* @__PURE__ */ L("div", {
66
66
  className: "overflow-y-auto",
67
67
  children: d
68
68
  })]
69
- })] }), document.body)), De = async (e, t, n) => {
69
+ })] }), document.body)), ke = async (e, t, n) => {
70
70
  let r = 6e4 / t, i = [];
71
71
  for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
72
72
  await Promise.allSettled(i);
73
- }, Oe = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d }) => {
74
- let [f, p] = R(n), m = L(f);
75
- P(() => {
73
+ }, Ae = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d }) => {
74
+ let [f, p] = F(n), m = P(f);
75
+ M(() => {
76
76
  m.current = f;
77
- }, [f]), P(() => () => {
77
+ }, [f]), M(() => () => {
78
78
  m.current.forEach((e) => {
79
79
  e.previewUrl && URL.revokeObjectURL(e.previewUrl);
80
80
  });
81
81
  }, []);
82
- let h = N((e) => e.map((e) => {
82
+ let h = j((e) => e.map((e) => {
83
83
  let n = e.type.startsWith("image/"), r = n ? URL.createObjectURL(e) : void 0;
84
84
  return {
85
- id: Se(),
85
+ id: Te(),
86
86
  name: e.name,
87
87
  contentType: e.type,
88
88
  file: e,
@@ -90,14 +90,14 @@ var Te = (e, t) => {
90
90
  status: i.Idle,
91
91
  previewUrl: r
92
92
  };
93
- }), []), g = N((e) => {
93
+ }), []), g = j((e) => {
94
94
  p((t) => {
95
95
  let n = e(t);
96
96
  return a?.(n), n;
97
97
  });
98
- }, [a]), _ = N((e) => {
98
+ }, [a]), _ = j((e) => {
99
99
  p(e), a?.(e);
100
- }, [a]), v = N(async (t) => {
100
+ }, [a]), v = j(async (t) => {
101
101
  if (r) {
102
102
  g((e) => e.map((e) => e.id === t.id ? {
103
103
  ...e,
@@ -119,7 +119,7 @@ var Te = (e, t) => {
119
119
  } : e));
120
120
  }
121
121
  }
122
- }, [r, g]), y = N((e, t = !0) => {
122
+ }, [r, g]), y = j((e, t = !0) => {
123
123
  let n = [];
124
124
  if (g((t) => {
125
125
  let r = new Set(t.map((e) => e.id));
@@ -133,27 +133,27 @@ var Te = (e, t) => {
133
133
  status: i.Error,
134
134
  errorReason: n
135
135
  } : e));
136
- }), De(e, xe, v);
136
+ }), ke(e, we, v);
137
137
  }
138
138
  }, [
139
139
  g,
140
140
  v,
141
141
  o
142
142
  ]);
143
- P(() => {
143
+ M(() => {
144
144
  s.length !== 0 && (y(h(s)), c?.());
145
145
  }, [
146
146
  y,
147
147
  h,
148
148
  c,
149
149
  s
150
- ]), P(() => {
150
+ ]), M(() => {
151
151
  l.length !== 0 && (y(l, !1), u?.());
152
152
  }, [
153
153
  y,
154
154
  u,
155
155
  l
156
- ]), P(() => {
156
+ ]), M(() => {
157
157
  if (!o) return;
158
158
  let t = !1, n = [], r = m.current.map((r) => {
159
159
  if (r.status === i.Loading) return r;
@@ -180,7 +180,7 @@ var Te = (e, t) => {
180
180
  g,
181
181
  v
182
182
  ]);
183
- let b = N((e) => {
183
+ let b = j((e) => {
184
184
  g((t) => {
185
185
  let n = t.find((t) => t.id === e);
186
186
  return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), t.filter((t) => t.id !== e);
@@ -192,11 +192,11 @@ var Te = (e, t) => {
192
192
  addAttachments: y,
193
193
  resetAttachments: _,
194
194
  handleRemove: b,
195
- handleRetry: N((e) => {
195
+ handleRetry: j((e) => {
196
196
  let t = f.find((t) => t.id === e);
197
197
  t && v(t);
198
198
  }, [f, v]),
199
- handleExpand: N(async (e) => {
199
+ handleExpand: j(async (e) => {
200
200
  let n = f.find((t) => t.id === e);
201
201
  if (!n || n.type !== t.Pasted) return;
202
202
  let r = await n.file.text();
@@ -208,9 +208,9 @@ var Te = (e, t) => {
208
208
  ]),
209
209
  hasBlockedAttachments: f.some((e) => e.status === i.Loading || e.status === i.Error)
210
210
  };
211
- }, ke = (e, t) => {
212
- let [n, r] = R(e), [i, a] = R(!1), [o, s] = R(0);
213
- return P(() => {
211
+ }, je = (e, t) => {
212
+ let [n, r] = F(e), [i, a] = F(!1), [o, s] = F(0);
213
+ return M(() => {
214
214
  if (e) {
215
215
  r(!0), a(!1), s((e) => e + 1);
216
216
  return;
@@ -226,18 +226,18 @@ var Te = (e, t) => {
226
226
  isExiting: i,
227
227
  instanceKey: o
228
228
  };
229
- }, Ae = (e, t) => !e.slice(0, t).includes("\n"), je = (e, t) => !e.slice(t).includes("\n"), Me = (e) => {
230
- let t = L(e);
229
+ }, Me = (e, t) => !e.slice(0, t).includes("\n"), Ne = (e, t) => !e.slice(t).includes("\n"), Pe = (e) => {
230
+ let t = P(e);
231
231
  t.current = e;
232
- let n = L(-1), r = L(""), i = N((e, i, a) => {
232
+ let n = P(-1), r = P(""), i = j((e, i, a) => {
233
233
  let o = t.current;
234
- return !o || o.length === 0 ? null : e === "up" ? !Ae(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !je(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
235
- }, []), a = N(() => {
234
+ return !o || o.length === 0 ? null : e === "up" ? !Me(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !Ne(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
235
+ }, []), a = j(() => {
236
236
  n.current = -1, r.current = "";
237
- }, []), o = N(() => {
237
+ }, []), o = j(() => {
238
238
  n.current = -1, r.current = "";
239
239
  }, []);
240
- return I(() => ({
240
+ return N(() => ({
241
241
  navigate: i,
242
242
  notifyChange: a,
243
243
  reset: o
@@ -246,13 +246,13 @@ var Te = (e, t) => {
246
246
  a,
247
247
  o
248
248
  ]);
249
- }, Ne = ({ messageProp: e }) => {
250
- let [t, n] = R(e), r = L(null), i = L(0), [a, o] = R(!1);
251
- return P(() => {
249
+ }, Fe = ({ messageProp: e }) => {
250
+ let [t, n] = F(e), r = P(null), i = P(0), [a, o] = F(!1);
251
+ return M(() => {
252
252
  e && n(e);
253
- }, [e]), P(() => {
253
+ }, [e]), M(() => {
254
254
  r.current && (i.current = r.current.offsetHeight);
255
- }, []), F(() => {
255
+ }, []), ve(() => {
256
256
  if (!r.current || i.current === 0) return;
257
257
  let e = r.current.offsetHeight > i.current;
258
258
  o((n) => e ? !0 : t === "" ? !1 : n);
@@ -262,18 +262,18 @@ var Te = (e, t) => {
262
262
  textareaRef: r,
263
263
  isMultiLine: a
264
264
  };
265
- }, U = /* @__PURE__ */ function(e) {
265
+ }, V = /* @__PURE__ */ function(e) {
266
266
  return e.Idle = "idle", e.Recording = "recording", e.Stopped = "stopped", e.Uploading = "uploading", e.Error = "error", e;
267
- }({}), Pe = [
267
+ }({}), H = [
268
268
  "audio/webm;codecs=opus",
269
269
  "audio/ogg;codecs=opus",
270
270
  "audio/webm"
271
- ], W = () => Pe.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Fe = ({ onUploadAudio: e, onTranscribeAudio: t, onTranscript: n }) => {
272
- let [r, i] = R("idle"), [a, o] = R(null), [s, c] = R(null), l = L(null), u = L(null), d = L(null), f = L(null), p = L([]), m = L(""), h = L(null), g = L(null), _ = L([]), v = L(!1), y = N(() => {
271
+ ], Ie = () => H.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Le = ({ onUploadAudio: e, onTranscribeAudio: t, onTranscript: n }) => {
272
+ let [r, i] = F("idle"), [a, o] = F(null), [s, c] = F(null), l = P(null), u = P(null), d = P(null), f = P(null), p = P([]), m = P(""), h = P(null), g = P(null), _ = P([]), v = P(!1), y = j(() => {
273
273
  h.current != null && (cancelAnimationFrame(h.current), h.current = null);
274
- }, []), b = N(() => {
274
+ }, []), b = j(() => {
275
275
  y(), l.current &&= (l.current.getTracks().forEach((e) => e.stop()), null), u.current &&= (u.current.close(), null), d.current = null, f.current = null;
276
- }, [y]), x = N(() => {
276
+ }, [y]), x = j(() => {
277
277
  (async () => {
278
278
  try {
279
279
  let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
@@ -282,7 +282,7 @@ var Te = (e, t) => {
282
282
  u.current = t;
283
283
  let n = t.createAnalyser();
284
284
  n.fftSize = 256, d.current = n, t.createMediaStreamSource(e).connect(n);
285
- let r = W();
285
+ let r = Ie();
286
286
  m.current = r, p.current = [], _.current = [];
287
287
  let a = new MediaRecorder(e, r ? { mimeType: r } : void 0);
288
288
  f.current = a, a.ondataavailable = (e) => {
@@ -305,13 +305,13 @@ var Te = (e, t) => {
305
305
  c(e instanceof Error ? e.message : "Microphone access denied"), i("error");
306
306
  }
307
307
  })();
308
- }, []), S = N(() => {
308
+ }, []), S = j(() => {
309
309
  let e = f.current;
310
310
  !e || e.state !== "recording" || (y(), e.onstop = () => {
311
311
  let e = m.current || "audio/webm", t = new Blob(p.current, { type: e }), n = e.split(";")[0].split("/")[1] ?? "webm";
312
312
  g.current = new File([t], `recording.${n}`, { type: e }), i("stopped");
313
313
  }, e.stop());
314
- }, [y]), C = N(() => {
314
+ }, [y]), C = j(() => {
315
315
  let r = g.current;
316
316
  !r || !e || !t || (v.current = !1, i("uploading"), (async () => {
317
317
  try {
@@ -330,10 +330,10 @@ var Te = (e, t) => {
330
330
  t,
331
331
  n,
332
332
  b
333
- ]), w = N(() => {
333
+ ]), w = j(() => {
334
334
  v.current = !0, b(), g.current = null, o(null), c(null), i("idle");
335
335
  }, [b]);
336
- return P(() => () => {
336
+ return M(() => () => {
337
337
  v.current = !0, b();
338
338
  }, [b]), {
339
339
  state: r,
@@ -344,16 +344,16 @@ var Te = (e, t) => {
344
344
  confirmRecording: C,
345
345
  discardRecording: w
346
346
  };
347
- }, Ie = /* @__PURE__ */ function(e) {
347
+ }, Re = /* @__PURE__ */ function(e) {
348
348
  return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
349
- }({}), G = {
349
+ }({}), U = {
350
350
  item: "_item_vou13_1",
351
351
  itemIcon: "_itemIcon_vou13_11"
352
- }, Le = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: c = "dial-body-semi-text", itemLabelClassName: l = "dial-small-text", btnTextClassName: u = "" }) => {
352
+ }, W = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: c = "dial-body-semi-text", itemLabelClassName: l = "dial-small-text", btnTextClassName: u = "" }) => {
353
353
  let d = (e) => {
354
354
  e(), r();
355
355
  };
356
- return /* @__PURE__ */ B(H, {
356
+ return /* @__PURE__ */ L(B, {
357
357
  isOpen: e,
358
358
  title: t,
359
359
  closeLabel: n,
@@ -361,22 +361,22 @@ var Te = (e, t) => {
361
361
  style: i,
362
362
  className: o,
363
363
  titleClassName: c,
364
- children: /* @__PURE__ */ B("ul", {
364
+ children: /* @__PURE__ */ L("ul", {
365
365
  role: "list",
366
366
  className: "flex flex-col",
367
- children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(p, {
367
+ children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ L(p, {
368
368
  type: "button",
369
- className: s(G.item, "flex w-full items-center gap-3 px-4 py-[10px] text-left"),
370
- iconBefore: /* @__PURE__ */ B("span", {
371
- className: G.itemIcon,
369
+ className: s(U.item, "flex w-full items-center gap-3 px-4 py-[10px] text-left"),
370
+ iconBefore: /* @__PURE__ */ L("span", {
371
+ className: U.itemIcon,
372
372
  children: n
373
373
  }),
374
- iconAfter: r ? /* @__PURE__ */ B("span", {
374
+ iconAfter: r ? /* @__PURE__ */ L("span", {
375
375
  className: "ml-auto",
376
376
  children: r
377
377
  }) : null,
378
378
  textClassName: u,
379
- label: /* @__PURE__ */ B("span", {
379
+ label: /* @__PURE__ */ L("span", {
380
380
  className: l,
381
381
  children: t
382
382
  }),
@@ -384,58 +384,58 @@ var Te = (e, t) => {
384
384
  }) }, e))
385
385
  })
386
386
  });
387
- }, Re = ({ gradientId: e = "gradient-check-icon" }) => /* @__PURE__ */ V("svg", {
387
+ }, ze = ({ gradientId: e = "gradient-check-icon" }) => /* @__PURE__ */ R("svg", {
388
388
  width: f.SM,
389
389
  height: f.SM,
390
390
  viewBox: "0 0 24 24",
391
391
  fill: "none",
392
392
  "aria-hidden": !0,
393
- children: [/* @__PURE__ */ B("defs", { children: /* @__PURE__ */ V("linearGradient", {
393
+ children: [/* @__PURE__ */ L("defs", { children: /* @__PURE__ */ R("linearGradient", {
394
394
  id: e,
395
395
  x1: "0",
396
396
  y1: "0",
397
397
  x2: "24",
398
398
  y2: "24",
399
399
  gradientUnits: "userSpaceOnUse",
400
- children: [/* @__PURE__ */ B("stop", {
400
+ children: [/* @__PURE__ */ L("stop", {
401
401
  offset: "0%",
402
402
  stopColor: "#4b7be6"
403
- }), /* @__PURE__ */ B("stop", {
403
+ }), /* @__PURE__ */ L("stop", {
404
404
  offset: "100%",
405
405
  stopColor: "#9355f4"
406
406
  })]
407
- }) }), /* @__PURE__ */ B("path", {
407
+ }) }), /* @__PURE__ */ L("path", {
408
408
  d: "M5 12l5 5L20 7",
409
409
  stroke: `url(#${e})`,
410
410
  strokeWidth: "2",
411
411
  strokeLinecap: "round",
412
412
  strokeLinejoin: "round"
413
413
  })]
414
- }), K = {
414
+ }), Be = {
415
415
  tab: "_tab_1mi6x_1",
416
416
  tabActive: "_tabActive_1mi6x_13"
417
417
  };
418
- me(({ tabs: e, activeTabId: t, onTabChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ B("div", {
418
+ ge(({ tabs: e, activeTabId: t, onTabChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ L("div", {
419
419
  className: "flex flex-nowrap gap-1",
420
420
  children: e.map((e) => {
421
421
  let i = t === e.id;
422
- return /* @__PURE__ */ B(O, {
422
+ return /* @__PURE__ */ L(ee, {
423
423
  label: e.label,
424
424
  selected: i,
425
425
  onClick: () => n(e.id),
426
- className: s("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", r, K.tab, i && K.tabActive)
426
+ className: s("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", r, Be.tab, i && Be.tabActive)
427
427
  }, e.id);
428
428
  })
429
429
  }));
430
430
  //#endregion
431
431
  //#region ../ai-dial-kit/src/components/Button/Buttons.tsx
432
- var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p, {
432
+ var G = (e) => /* @__PURE__ */ L(x, { ...e }), Ve = (e) => /* @__PURE__ */ L(p, {
433
433
  ...e,
434
434
  variant: d.Neutral,
435
435
  appearance: u.Outlined
436
- }), Ve = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
437
- let [s, c] = R(t), [l, u] = R(n), [d, f] = R(r), p = L(o);
438
- P(() => {
436
+ }), He = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
437
+ let [s, c] = F(t), [l, u] = F(n), [d, f] = F(r), p = P(o);
438
+ M(() => {
439
439
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
440
440
  }, [
441
441
  o,
@@ -452,7 +452,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
452
452
  setResponseFormat: c,
453
453
  setSystemPrompt: u,
454
454
  setTemperature: f,
455
- handleSubmit: N(() => {
455
+ handleSubmit: j(() => {
456
456
  if (!m) return;
457
457
  let t = {};
458
458
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -466,18 +466,18 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
466
466
  a
467
467
  ])
468
468
  };
469
- }, He = "!text-[14px] !leading-[20px] font-semibold !text-primary gap-1", Ue = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: o, onTemperatureChange: s, responseFormatLabel: c = "Response format", responseFormatHint: l = "Applies to new and existing messages", responseFormatMarkdownLabel: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: h = [
469
+ }, Ue = "!text-[14px] !leading-[20px] font-semibold !text-primary gap-1", We = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: o, onTemperatureChange: s, responseFormatLabel: c = "Response format", responseFormatHint: l = "Applies to new and existing messages", responseFormatMarkdownLabel: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: h = [
470
470
  "Precise",
471
471
  "Neutral",
472
472
  "Creative"
473
- ], temperatureHint: g }) => /* @__PURE__ */ V("div", {
473
+ ], temperatureHint: g }) => /* @__PURE__ */ R("div", {
474
474
  className: "flex flex-col gap-4 px-6 py-3",
475
475
  children: [
476
- e.responseFormat && /* @__PURE__ */ B(S, {
476
+ e.responseFormat && /* @__PURE__ */ L(S, {
477
477
  fieldTitle: c,
478
- labelClassName: He,
478
+ labelClassName: Ue,
479
479
  elementId: "response-format",
480
- orientation: j.Column,
480
+ orientation: ne.Column,
481
481
  activeRadioButton: t ?? a.Markdown,
482
482
  labelDescription: l,
483
483
  radioButtons: [{
@@ -489,19 +489,19 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
489
489
  }],
490
490
  onChange: (e) => i(e)
491
491
  }),
492
- e.systemPrompt && /* @__PURE__ */ B(y, {
492
+ e.systemPrompt && /* @__PURE__ */ L(y, {
493
493
  value: n,
494
494
  placeholder: p,
495
495
  labelProps: {
496
- className: He,
496
+ className: Ue,
497
497
  label: f
498
498
  },
499
499
  onChange: (e) => o(e ?? "")
500
500
  }),
501
- e.temperature && /* @__PURE__ */ B(E, {
501
+ e.temperature && /* @__PURE__ */ L(E, {
502
502
  labelProps: {
503
503
  label: m,
504
- className: He,
504
+ className: Ue,
505
505
  caption: g
506
506
  },
507
507
  value: r,
@@ -512,8 +512,8 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
512
512
  onChange: s
513
513
  })
514
514
  ]
515
- }), We = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
516
- let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: A, setTemperature: ee, handleSubmit: j } = Ve({
515
+ }), Ge = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
516
+ let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: ee, setSystemPrompt: k, setTemperature: te, handleSubmit: ne } = He({
517
517
  isOpen: e,
518
518
  features: o,
519
519
  initialResponseFormat: c,
@@ -522,7 +522,7 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
522
522
  onSave: d,
523
523
  onClose: r
524
524
  });
525
- return /* @__PURE__ */ V(H, {
525
+ return /* @__PURE__ */ R(B, {
526
526
  isOpen: e,
527
527
  title: f,
528
528
  closeLabel: i,
@@ -530,14 +530,14 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
530
530
  onBack: t,
531
531
  backLabel: n,
532
532
  style: a,
533
- children: [/* @__PURE__ */ B(Ue, {
533
+ children: [/* @__PURE__ */ L(We, {
534
534
  features: o,
535
535
  responseFormat: w,
536
536
  systemPrompt: T,
537
537
  temperature: E,
538
- onResponseFormatChange: O,
539
- onSystemPromptChange: A,
540
- onTemperatureChange: ee,
538
+ onResponseFormatChange: ee,
539
+ onSystemPromptChange: k,
540
+ onTemperatureChange: te,
541
541
  responseFormatLabel: p,
542
542
  responseFormatHint: m,
543
543
  responseFormatMarkdownLabel: h,
@@ -547,23 +547,23 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
547
547
  temperatureLabel: y,
548
548
  temperatureLabels: b,
549
549
  temperatureHint: x
550
- }), /* @__PURE__ */ B("div", {
550
+ }), /* @__PURE__ */ L("div", {
551
551
  className: s("px-6 py-4 mobile:pb-8"),
552
- children: /* @__PURE__ */ B(k, {
552
+ children: /* @__PURE__ */ L(O, {
553
553
  tooltip: C,
554
554
  hideTooltip: D || !C,
555
555
  triggerClassName: "w-full",
556
- children: /* @__PURE__ */ B(ze, {
556
+ children: /* @__PURE__ */ L(G, {
557
557
  label: S,
558
- onClick: j,
558
+ onClick: ne,
559
559
  disabled: !D,
560
560
  className: "w-full"
561
561
  })
562
562
  })
563
563
  })]
564
564
  });
565
- }, Ge = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: g = "Apply changes", saveDisabledTooltip: _ }) => {
566
- let { responseFormat: v, systemPrompt: y, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } = Ve({
565
+ }, Ke = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: g = "Apply changes", saveDisabledTooltip: _ }) => {
566
+ let { responseFormat: v, systemPrompt: y, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } = He({
567
567
  features: e,
568
568
  initialResponseFormat: t,
569
569
  initialSystemPrompt: n,
@@ -571,25 +571,25 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
571
571
  onSave: i,
572
572
  onClose: a
573
573
  });
574
- return /* @__PURE__ */ B(b, {
574
+ return /* @__PURE__ */ L(b, {
575
575
  open: !0,
576
576
  header: o,
577
- size: ee.Sm,
577
+ size: te.Sm,
578
578
  onClose: a,
579
579
  className: "!bg-layer-2",
580
- footer: /* @__PURE__ */ B("div", {
580
+ footer: /* @__PURE__ */ L("div", {
581
581
  className: "flex justify-end px-6 py-4",
582
- children: /* @__PURE__ */ B(k, {
582
+ children: /* @__PURE__ */ L(O, {
583
583
  tooltip: _,
584
584
  hideTooltip: S || !_,
585
- children: /* @__PURE__ */ B(ze, {
585
+ children: /* @__PURE__ */ L(G, {
586
586
  label: g,
587
587
  onClick: E,
588
588
  disabled: !S
589
589
  })
590
590
  })
591
591
  }),
592
- children: /* @__PURE__ */ B(Ue, {
592
+ children: /* @__PURE__ */ L(We, {
593
593
  features: e,
594
594
  responseFormat: v,
595
595
  systemPrompt: y,
@@ -609,15 +609,15 @@ var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p,
609
609
  })
610
610
  });
611
611
  };
612
- me(Ge);
612
+ ge(Ke);
613
613
  //#endregion
614
614
  //#region src/components/AddAttachmentButton/AddAttachmentButton.tsx
615
- var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: i, style: o, listClassName: u = "cp-dropdown-overlay !w-[240px]", isDisabled: d = !1, chatSettings: p, extraMenuItems: m }) => {
616
- let g = c(), [_, y] = R(!1), [b, x] = R(!1), S = I(() => [
615
+ var qe = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: i, style: o, listClassName: u = "cp-dropdown-overlay !w-[240px]", isDisabled: d = !1, chatSettings: p, extraMenuItems: m }) => {
616
+ let g = c(), [_, y] = F(!1), [b, x] = F(!1), S = N(() => [
617
617
  ...e == null ? [] : [{
618
618
  key: "attach",
619
619
  label: t,
620
- icon: /* @__PURE__ */ B(ce, {
620
+ icon: /* @__PURE__ */ L(ue, {
621
621
  size: l,
622
622
  "aria-hidden": !0
623
623
  }),
@@ -627,11 +627,11 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
627
627
  ...p == null ? [] : [{
628
628
  key: "chat-settings",
629
629
  label: p.menuItemLabel ?? "Chat settings",
630
- icon: /* @__PURE__ */ B(de, {
630
+ icon: /* @__PURE__ */ L(pe, {
631
631
  size: l,
632
632
  "aria-hidden": !0
633
633
  }),
634
- iconAfter: g ? /* @__PURE__ */ B(ae, {
634
+ iconAfter: g ? /* @__PURE__ */ L(se, {
635
635
  size: l,
636
636
  stroke: 1.5,
637
637
  className: "text-secondary",
@@ -646,9 +646,9 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
646
646
  m,
647
647
  g
648
648
  ]);
649
- return S.length === 0 ? null : /* @__PURE__ */ B(z, { children: g ? /* @__PURE__ */ V(z, { children: [
650
- /* @__PURE__ */ B(v, {
651
- icon: /* @__PURE__ */ B(ue, {
649
+ return S.length === 0 ? null : /* @__PURE__ */ L(I, { children: g ? /* @__PURE__ */ R(I, { children: [
650
+ /* @__PURE__ */ L(v, {
651
+ icon: /* @__PURE__ */ L(fe, {
652
652
  size: f.LG,
653
653
  "aria-hidden": !0
654
654
  }),
@@ -657,7 +657,7 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
657
657
  className: s("size-10 flex-shrink-0", d && "pointer-events-none opacity-50"),
658
658
  onClick: () => y(!0)
659
659
  }),
660
- /* @__PURE__ */ B(Le, {
660
+ /* @__PURE__ */ L(W, {
661
661
  isOpen: _,
662
662
  title: r,
663
663
  closeLabel: i,
@@ -667,7 +667,7 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
667
667
  className: "pb-4",
668
668
  btnTextClassName: "flex-1"
669
669
  }),
670
- p != null && /* @__PURE__ */ B(We, {
670
+ p != null && /* @__PURE__ */ L(Ge, {
671
671
  isOpen: b,
672
672
  onBack: () => {
673
673
  x(!1), y(!0);
@@ -694,13 +694,13 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
694
694
  saveLabel: p.saveLabel,
695
695
  saveDisabledTooltip: p.saveDisabledTooltip
696
696
  })
697
- ] }) : /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(h, {
697
+ ] }) : /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(h, {
698
698
  matchReferenceWidth: !1,
699
699
  placement: "bottom-start",
700
700
  listClassName: u,
701
701
  items: S,
702
- children: /* @__PURE__ */ B(v, {
703
- icon: /* @__PURE__ */ B(ue, {
702
+ children: /* @__PURE__ */ L(v, {
703
+ icon: /* @__PURE__ */ L(fe, {
704
704
  size: f.LG,
705
705
  "aria-hidden": !0
706
706
  }),
@@ -709,7 +709,7 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
709
709
  className: "size-10 flex-shrink-0",
710
710
  disabled: d
711
711
  })
712
- }), p != null && b && /* @__PURE__ */ B(Ge, {
712
+ }), p != null && b && /* @__PURE__ */ L(Ke, {
713
713
  features: p.features,
714
714
  initialResponseFormat: p.responseFormat ?? a.Markdown,
715
715
  initialSystemPrompt: p.systemPrompt,
@@ -729,16 +729,16 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
729
729
  saveLabel: p.saveLabel,
730
730
  saveDisabledTooltip: p.saveDisabledTooltip
731
731
  })] }) });
732
- }, q = {
732
+ }, K = {
733
733
  container: "_container_15iwh_1",
734
734
  containerError: "_containerError_15iwh_5",
735
735
  waveformCanvas: "_waveformCanvas_15iwh_9",
736
736
  recordingDot: "_recordingDot_15iwh_17",
737
737
  micRecordingIcon: "_micRecordingIcon_15iwh_21"
738
- }, qe = 3, Je = 6, Ye = .12, Xe = ({ state: e, waveformData: t, errorMessage: n, onStop: r, onConfirm: i, onDiscard: a, stopLabel: o = "Stop recording", confirmLabel: c = "Send voice message", discardLabel: l = "Discard recording", uploadingLabel: u = "Uploading…", style: d, className: p }) => {
739
- let m = L(null), h = L(null), g = L(!1), y = e === U.Recording, b = e === U.Uploading, x = e === U.Error;
738
+ }, Je = 3, Ye = 6, Xe = .12, Ze = ({ state: e, waveformData: t, errorMessage: n, onStop: r, onConfirm: i, onDiscard: a, stopLabel: o = "Stop recording", confirmLabel: c = "Send voice message", discardLabel: l = "Discard recording", uploadingLabel: u = "Uploading…", style: d, className: p }) => {
739
+ let m = P(null), h = P(null), g = P(!1), y = e === V.Recording, b = e === V.Uploading, x = e === V.Error;
740
740
  g.current = y;
741
- let S = N((e, t) => {
741
+ let S = j((e, t) => {
742
742
  let n = e.getContext("2d");
743
743
  if (!n) return;
744
744
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
@@ -746,10 +746,10 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
746
746
  n.clearRect(0, 0, r, i), n.fillStyle = getComputedStyle(e).color;
747
747
  let a = Math.min(1, t * 6), o = Math.max(1, Math.floor(r / 4));
748
748
  for (let e = 0; e < o; e++) {
749
- let t = e / o * Je * Math.PI, r = Math.max(Ye, Math.abs(Math.sin(t)) * a), s = Math.max(3, r * i);
750
- n.fillRect(e * 4, (i - s) / 2, qe, s);
749
+ let t = e / o * Ye * Math.PI, r = Math.max(Xe, Math.abs(Math.sin(t)) * a), s = Math.max(3, r * i);
750
+ n.fillRect(e * 4, (i - s) / 2, Je, s);
751
751
  }
752
- }, []), C = N((e, t) => {
752
+ }, []), C = j((e, t) => {
753
753
  let n = e.getContext("2d");
754
754
  if (!n) return;
755
755
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
@@ -759,10 +759,10 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
759
759
  let a = Math.max(1, Math.floor(r / 4));
760
760
  for (let e = 0; e < a; e++) {
761
761
  let r = t[Math.floor(e / a * t.length)] ?? 0, o = Math.min(1, r * 6), s = Math.max(3, o * i);
762
- n.fillRect(e * 4, (i - s) / 2, qe, s);
762
+ n.fillRect(e * 4, (i - s) / 2, Je, s);
763
763
  }
764
764
  }, []);
765
- P(() => {
765
+ M(() => {
766
766
  h.current = t;
767
767
  let e = m.current;
768
768
  e && (g.current ? S(e, t?.[t.length - 1] ?? 0) : C(e, t));
@@ -770,7 +770,7 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
770
770
  t,
771
771
  S,
772
772
  C
773
- ]), P(() => {
773
+ ]), M(() => {
774
774
  let e = m.current;
775
775
  if (!e) return;
776
776
  let t = new ResizeObserver(() => {
@@ -781,34 +781,34 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
781
781
  });
782
782
  return t.observe(e), () => t.disconnect();
783
783
  }, [S, C]);
784
- let w = /* @__PURE__ */ B("div", {
784
+ let w = /* @__PURE__ */ L("div", {
785
785
  className: "flex flex-shrink-0 items-center justify-end gap-1",
786
- children: y ? /* @__PURE__ */ B(v, {
787
- icon: /* @__PURE__ */ B(se, {
786
+ children: y ? /* @__PURE__ */ L(v, {
787
+ icon: /* @__PURE__ */ L(le, {
788
788
  size: f.LG,
789
- className: q.micRecordingIcon,
789
+ className: K.micRecordingIcon,
790
790
  "aria-hidden": !0
791
791
  }),
792
792
  "aria-label": o,
793
793
  className: "size-10 flex-shrink-0",
794
794
  onClick: r
795
- }) : /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(v, {
796
- icon: /* @__PURE__ */ B(M, {
795
+ }) : /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(v, {
796
+ icon: /* @__PURE__ */ L(me, {
797
797
  size: f.LG,
798
798
  "aria-hidden": !0
799
799
  }),
800
800
  "aria-label": l,
801
801
  className: "size-10 flex-shrink-0",
802
802
  onClick: a
803
- }), b ? /* @__PURE__ */ B(D, {
803
+ }), b ? /* @__PURE__ */ L(D, {
804
804
  fullWidth: !1,
805
805
  size: f.LG,
806
806
  ariaLabel: u,
807
807
  className: "flex size-10 flex-shrink-0 items-center justify-center"
808
- }) : /* @__PURE__ */ B(v, {
809
- icon: /* @__PURE__ */ B("div", {
808
+ }) : /* @__PURE__ */ L(v, {
809
+ icon: /* @__PURE__ */ L("div", {
810
810
  className: "flex size-8 items-center justify-center rounded-full bg-controls-accent-primary",
811
- children: /* @__PURE__ */ B(re, {
811
+ children: /* @__PURE__ */ L(ae, {
812
812
  size: 24,
813
813
  "aria-hidden": !0,
814
814
  className: "rounded-full bg-controls-accent-primary text-controls-permanent"
@@ -819,28 +819,28 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
819
819
  onClick: i
820
820
  })] })
821
821
  });
822
- return /* @__PURE__ */ V("div", {
822
+ return /* @__PURE__ */ R("div", {
823
823
  className: p,
824
- children: [/* @__PURE__ */ V("div", {
824
+ children: [/* @__PURE__ */ R("div", {
825
825
  style: d,
826
- className: s(q.container, "flex min-h-[56px] w-full flex-col gap-3 rounded border px-3 py-3 desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", x && q.containerError),
827
- children: [/* @__PURE__ */ V("div", {
826
+ className: s(K.container, "flex min-h-[56px] w-full flex-col gap-3 rounded border px-3 py-3 desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", x && K.containerError),
827
+ children: [/* @__PURE__ */ R("div", {
828
828
  className: "flex min-w-0 flex-1 items-center gap-2",
829
- children: [y && /* @__PURE__ */ B("span", {
830
- className: s(q.recordingDot, "size-2 flex-shrink-0 rounded-full"),
829
+ children: [y && /* @__PURE__ */ L("span", {
830
+ className: s(K.recordingDot, "size-2 flex-shrink-0 rounded-full"),
831
831
  "aria-hidden": !0
832
- }), /* @__PURE__ */ B("canvas", {
832
+ }), /* @__PURE__ */ L("canvas", {
833
833
  ref: m,
834
834
  height: 32,
835
- className: s(q.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
835
+ className: s(K.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
836
836
  })]
837
837
  }), w]
838
- }), x && n && /* @__PURE__ */ B(_, {
838
+ }), x && n && /* @__PURE__ */ L(_, {
839
839
  text: n,
840
840
  className: "mt-1 px-1"
841
841
  })]
842
842
  });
843
- }, J = {
843
+ }, q = {
844
844
  wrapper: "_wrapper_1q2nu_2",
845
845
  wrapperDisabled: "_wrapperDisabled_1q2nu_15",
846
846
  textarea: "_textarea_1q2nu_20",
@@ -852,70 +852,70 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
852
852
  sendButtonEnter: "_sendButtonEnter_1q2nu_1",
853
853
  sendButtonExiting: "_sendButtonExiting_1q2nu_55",
854
854
  sendButtonExit: "_sendButtonExit_1q2nu_55"
855
- }, Ze = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", title: r, isExiting: i = !1 }) => /* @__PURE__ */ B(k, {
855
+ }, Qe = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", title: r, isExiting: i = !1 }) => /* @__PURE__ */ L(O, {
856
856
  tooltip: r,
857
857
  hideTooltip: !r,
858
- children: /* @__PURE__ */ B("button", {
859
- className: s("flex size-[32px] cursor-pointer items-center justify-center rounded-full disabled:cursor-not-allowed", J.sendButton, i && J.sendButtonExiting),
858
+ children: /* @__PURE__ */ L("button", {
859
+ className: s("flex size-[32px] cursor-pointer items-center justify-center rounded-full disabled:cursor-not-allowed", q.sendButton, i && q.sendButtonExiting),
860
860
  "aria-label": n,
861
861
  onClick: () => e?.(),
862
862
  type: "button",
863
863
  disabled: t,
864
864
  "aria-hidden": i,
865
- children: /* @__PURE__ */ B(ne, { size: f.LG })
865
+ children: /* @__PURE__ */ L(ie, { size: f.LG })
866
866
  })
867
- }), Qe = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ B("button", {
867
+ }), $e = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ L("button", {
868
868
  className: s("flex cursor-pointer items-center justify-center disabled:cursor-not-allowed"),
869
869
  "aria-label": t,
870
870
  onClick: () => e?.(),
871
871
  type: "button",
872
- children: /* @__PURE__ */ B(le, {
872
+ children: /* @__PURE__ */ L(de, {
873
873
  size: f.LG,
874
- className: J.stopIcon
874
+ className: q.stopIcon
875
875
  })
876
- }), $e = ({ size: e = 20 }) => /* @__PURE__ */ B(w, {
876
+ }), et = ({ size: e = 20 }) => /* @__PURE__ */ L(w, {
877
877
  variant: T.Circular,
878
878
  width: e,
879
879
  height: e,
880
880
  active: !0
881
- }), et = ({ loadingLabel: e }) => /* @__PURE__ */ V("span", {
881
+ }), tt = ({ loadingLabel: e }) => /* @__PURE__ */ R("span", {
882
882
  className: "flex min-w-0 flex-1 items-center",
883
- children: [/* @__PURE__ */ B(w, {
883
+ children: [/* @__PURE__ */ L(w, {
884
884
  variant: T.Text,
885
885
  width: "100%",
886
886
  height: 16,
887
887
  active: !0
888
- }), e && /* @__PURE__ */ B("span", {
888
+ }), e && /* @__PURE__ */ L("span", {
889
889
  className: "sr-only",
890
890
  children: e
891
891
  })]
892
- }), tt = ({ loadingLabel: e }) => /* @__PURE__ */ B("div", {
892
+ }), nt = ({ loadingLabel: e }) => /* @__PURE__ */ L("div", {
893
893
  role: "status",
894
894
  "aria-label": e,
895
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ V("div", {
895
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ R("div", {
896
896
  className: "flex h-11 items-center gap-3 px-4",
897
897
  "aria-hidden": "true",
898
- children: [/* @__PURE__ */ B($e, {}), /* @__PURE__ */ B(et, {})]
898
+ children: [/* @__PURE__ */ L(et, {}), /* @__PURE__ */ L(tt, {})]
899
899
  }, t))
900
- }), nt = (e) => e.displayName ?? e.id, rt = (e, t) => {
900
+ }), rt = (e) => e.displayName ?? e.id, it = (e, t) => {
901
901
  let n = t.trim().toLowerCase();
902
- return n ? e.filter((e) => nt(e).toLowerCase().includes(n)) : e;
903
- }, it = (e, t, r, i = 18, a) => /* @__PURE__ */ B(n, {
902
+ return n ? e.filter((e) => rt(e).toLowerCase().includes(n)) : e;
903
+ }, at = (e, t, r, i = 18, a) => /* @__PURE__ */ L(n, {
904
904
  src: e,
905
905
  size: i,
906
906
  tooltip: a,
907
907
  initialsName: r
908
- }), at = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: i, searchHeaderClassName: a = "bg-layer-0" }) => {
909
- let [o, c] = R(""), l = I(() => e?.find((e) => e.id === t), [e, t]), u = i?.loading !== void 0, d = I(() => u ? /* @__PURE__ */ B($e, { size: f.LG }) : it(l?.iconUrl, l?.type, l?.displayName ?? l?.id ?? "", f.LG), [u, l]), p = l?.displayName ?? l?.id;
908
+ }), ot = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: i, searchHeaderClassName: a = "bg-layer-0" }) => {
909
+ let [o, c] = F(""), l = N(() => e?.find((e) => e.id === t), [e, t]), u = i?.loading !== void 0, d = N(() => u ? /* @__PURE__ */ L(et, { size: f.LG }) : at(l?.iconUrl, l?.type, l?.displayName ?? l?.id ?? "", f.LG), [u, l]), p = l?.displayName ?? l?.id;
910
910
  return {
911
911
  selectorIcon: d,
912
912
  selectorAriaLabel: p ? `${i?.ariaLabel ?? "Select model"}: ${p}` : i?.ariaLabel ?? "Select model",
913
913
  selectedLabel: p,
914
- menuItems: I(() => {
914
+ menuItems: N(() => {
915
915
  if (u) return Array.from({ length: 7 }, (e, t) => ({
916
916
  key: `__loading-${t}`,
917
- icon: /* @__PURE__ */ B($e, {}),
918
- label: /* @__PURE__ */ B(et, { loadingLabel: t === 0 ? i?.loading : void 0 }),
917
+ icon: /* @__PURE__ */ L(et, {}),
918
+ label: /* @__PURE__ */ L(tt, { loadingLabel: t === 0 ? i?.loading : void 0 }),
919
919
  disabled: !0
920
920
  }));
921
921
  if (!e || e.length === 0) {
@@ -926,19 +926,19 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
926
926
  disabled: !0
927
927
  }] : [];
928
928
  }
929
- return rt(e, o).map((e) => {
929
+ return it(e, o).map((e) => {
930
930
  let i = e.id === t;
931
931
  return {
932
932
  key: e.id,
933
- label: /* @__PURE__ */ V("span", {
933
+ label: /* @__PURE__ */ R("span", {
934
934
  className: "flex w-full items-center justify-between gap-2",
935
- children: [/* @__PURE__ */ B(r, {
936
- text: nt(e),
935
+ children: [/* @__PURE__ */ L(r, {
936
+ text: rt(e),
937
937
  query: o,
938
938
  maxLines: 1
939
- }), i && /* @__PURE__ */ B(Re, { gradientId: "ms-check-grad" })]
939
+ }), i && /* @__PURE__ */ L(ze, { gradientId: "ms-check-grad" })]
940
940
  }),
941
- icon: it(e.iconUrl, e.type, e.displayName ?? e.id),
941
+ icon: at(e.iconUrl, e.type, e.displayName ?? e.id),
942
942
  onClick: () => n?.(e.id),
943
943
  className: i ? "bg-accent-primary-alpha" : void 0
944
944
  };
@@ -951,12 +951,12 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
951
951
  i,
952
952
  n
953
953
  ]),
954
- menuHeader: I(() => !u && e && e.length > 0 ? /* @__PURE__ */ B("div", {
954
+ menuHeader: N(() => !u && e && e.length > 0 ? /* @__PURE__ */ L("div", {
955
955
  className: s("sticky top-0 z-10 pb-1 pr-2 pt-2", a),
956
- children: /* @__PURE__ */ B(C, {
956
+ children: /* @__PURE__ */ L(C, {
957
957
  value: o,
958
958
  placeholder: i?.searchPlaceholder ?? "Search",
959
- size: A.Small,
959
+ size: k.Small,
960
960
  wrapperClassName: "border-0",
961
961
  onChange: c
962
962
  })
@@ -971,8 +971,8 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
971
971
  e || c("");
972
972
  }
973
973
  };
974
- }, Y = typeof window < "u" ? F : P;
975
- function ot(e) {
974
+ }, J = typeof window < "u" ? ve : M;
975
+ function st(e) {
976
976
  if (e !== void 0) switch (typeof e) {
977
977
  case "number": return e;
978
978
  case "string":
@@ -980,15 +980,15 @@ function ot(e) {
980
980
  break;
981
981
  }
982
982
  }
983
- function st({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
984
- let { styleHeight: s, styleWidth: c } = I(() => ({
985
- styleHeight: ot(o?.height),
986
- styleWidth: ot(o?.width)
987
- }), [o?.height, o?.width]), [l, u] = R({
983
+ function ct({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
984
+ let { styleHeight: s, styleWidth: c } = N(() => ({
985
+ styleHeight: st(o?.height),
986
+ styleWidth: st(o?.width)
987
+ }), [o?.height, o?.width]), [l, u] = F({
988
988
  height: t,
989
989
  width: n
990
990
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
991
- return Y(() => {
991
+ return J(() => {
992
992
  if (i === null || d) return;
993
993
  let t = new ResizeObserver((e) => {
994
994
  for (let t of e) {
@@ -1008,7 +1008,7 @@ function st({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1008
1008
  i,
1009
1009
  s,
1010
1010
  c
1011
- ]), I(() => ({
1011
+ ]), N(() => ({
1012
1012
  height: s ?? l.height,
1013
1013
  width: c ?? l.width
1014
1014
  }), [
@@ -1017,26 +1017,26 @@ function st({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1017
1017
  c
1018
1018
  ]);
1019
1019
  }
1020
- function ct(e) {
1021
- let t = L(() => {
1020
+ function lt(e) {
1021
+ let t = P(() => {
1022
1022
  throw Error("Cannot call during render.");
1023
1023
  });
1024
- return Y(() => {
1024
+ return J(() => {
1025
1025
  t.current = e;
1026
- }, [e]), N((e) => t.current?.(e), [t]);
1026
+ }, [e]), j((e) => t.current?.(e), [t]);
1027
1027
  }
1028
- var X = null;
1029
- function lt(e = !1) {
1030
- if (X === null || e) {
1028
+ var Y = null;
1029
+ function X(e = !1) {
1030
+ if (Y === null || e) {
1031
1031
  let e = document.createElement("div"), t = e.style;
1032
1032
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
1033
1033
  let n = document.createElement("div"), r = n.style;
1034
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? X = "positive-descending" : (e.scrollLeft = 1, X = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), X;
1034
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? Y = "positive-descending" : (e.scrollLeft = 1, Y = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), Y;
1035
1035
  }
1036
- return X;
1036
+ return Y;
1037
1037
  }
1038
- function Z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1039
- if (t === "horizontal" && n) switch (lt()) {
1038
+ function ut({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1039
+ if (t === "horizontal" && n) switch (X()) {
1040
1040
  case "negative": return -r;
1041
1041
  case "positive-descending":
1042
1042
  if (e) {
@@ -1047,26 +1047,26 @@ function Z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1047
1047
  }
1048
1048
  return r;
1049
1049
  }
1050
- function Q(e, t = "Assertion error") {
1050
+ function Z(e, t = "Assertion error") {
1051
1051
  if (!e) throw console.error(t), Error(t);
1052
1052
  }
1053
- function $(e, t) {
1053
+ function Q(e, t) {
1054
1054
  if (e === t) return !0;
1055
- if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1055
+ if (!!e != !!t || (Z(e !== void 0), Z(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1056
1056
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
1057
1057
  return !0;
1058
1058
  }
1059
- function ut({ cachedBounds: e, itemCount: t, itemSize: n }) {
1059
+ function dt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1060
1060
  if (t === 0) return 0;
1061
1061
  if (typeof n == "number") return t * n;
1062
1062
  {
1063
1063
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
1064
- return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1064
+ return Z(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1065
1065
  }
1066
1066
  }
1067
- function dt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1067
+ function ft({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1068
1068
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
1069
- let s = ut({
1069
+ let s = dt({
1070
1070
  cachedBounds: t,
1071
1071
  itemCount: r,
1072
1072
  itemSize: i
@@ -1078,7 +1078,7 @@ function dt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
1078
1078
  default: return a >= u && a <= l ? a : a < u ? u : l;
1079
1079
  }
1080
1080
  }
1081
- function ft({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1081
+ function pt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1082
1082
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
1083
1083
  for (; u < a;) {
1084
1084
  let n = e.get(u);
@@ -1097,11 +1097,11 @@ function ft({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
1097
1097
  stopIndexOverscan: l
1098
1098
  };
1099
1099
  }
1100
- function pt({ itemCount: e, itemProps: t, itemSize: n }) {
1100
+ function mt({ itemCount: e, itemProps: t, itemSize: n }) {
1101
1101
  let r = /* @__PURE__ */ new Map();
1102
1102
  return {
1103
1103
  get(i) {
1104
- for (Q(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1104
+ for (Z(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1105
1105
  let e = r.size, a;
1106
1106
  switch (typeof n) {
1107
1107
  case "function":
@@ -1117,14 +1117,14 @@ function pt({ itemCount: e, itemProps: t, itemSize: n }) {
1117
1117
  });
1118
1118
  else {
1119
1119
  let t = r.get(e - 1);
1120
- Q(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1120
+ Z(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1121
1121
  scrollOffset: t.scrollOffset + t.size,
1122
1122
  size: a
1123
1123
  });
1124
1124
  }
1125
1125
  }
1126
1126
  let a = r.get(i);
1127
- return Q(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1127
+ return Z(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1128
1128
  },
1129
1129
  set(e, t) {
1130
1130
  r.set(e, t);
@@ -1134,8 +1134,8 @@ function pt({ itemCount: e, itemProps: t, itemSize: n }) {
1134
1134
  }
1135
1135
  };
1136
1136
  }
1137
- function mt({ itemCount: e, itemProps: t, itemSize: n }) {
1138
- return I(() => pt({
1137
+ function ht({ itemCount: e, itemProps: t, itemSize: n }) {
1138
+ return N(() => mt({
1139
1139
  itemCount: e,
1140
1140
  itemProps: t,
1141
1141
  itemSize: n
@@ -1145,11 +1145,11 @@ function mt({ itemCount: e, itemProps: t, itemSize: n }) {
1145
1145
  n
1146
1146
  ]);
1147
1147
  }
1148
- function ht({ containerSize: e, itemSize: t }) {
1148
+ function gt({ containerSize: e, itemSize: t }) {
1149
1149
  let n;
1150
1150
  switch (typeof t) {
1151
1151
  case "string":
1152
- Q(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Q(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
1152
+ Z(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Z(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
1153
1153
  break;
1154
1154
  default:
1155
1155
  n = t;
@@ -1157,21 +1157,21 @@ function ht({ containerSize: e, itemSize: t }) {
1157
1157
  }
1158
1158
  return n;
1159
1159
  }
1160
- function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1161
- let { height: u = n, width: d = n } = st({
1160
+ function _t({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1161
+ let { height: u = n, width: d = n } = ct({
1162
1162
  defaultHeight: r === "vertical" ? n : void 0,
1163
1163
  defaultWidth: r === "horizontal" ? n : void 0,
1164
1164
  element: e,
1165
1165
  mode: r === "vertical" ? "only-height" : "only-width",
1166
1166
  style: t
1167
- }), f = L({
1167
+ }), f = P({
1168
1168
  height: 0,
1169
1169
  width: 0
1170
- }), p = r === "vertical" ? u : d, m = ht({
1170
+ }), p = r === "vertical" ? u : d, m = gt({
1171
1171
  containerSize: p,
1172
1172
  itemSize: s
1173
1173
  });
1174
- F(() => {
1174
+ ve(() => {
1175
1175
  if (typeof c == "function") {
1176
1176
  let e = f.current;
1177
1177
  (e.height !== u || e.width !== d) && (c({
@@ -1184,11 +1184,11 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1184
1184
  c,
1185
1185
  d
1186
1186
  ]);
1187
- let h = mt({
1187
+ let h = ht({
1188
1188
  itemCount: a,
1189
1189
  itemProps: o,
1190
1190
  itemSize: m
1191
- }), g = N((e) => h.get(e), [h]), [_, v] = R(() => ft({
1191
+ }), g = j((e) => h.get(e), [h]), [_, v] = F(() => pt({
1192
1192
  cachedBounds: h,
1193
1193
  containerScrollOffset: 0,
1194
1194
  containerSize: p,
@@ -1199,7 +1199,7 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1199
1199
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1200
1200
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1201
1201
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1202
- }, C = N(() => ut({
1202
+ }, C = j(() => dt({
1203
1203
  cachedBounds: h,
1204
1204
  itemCount: a,
1205
1205
  itemSize: m
@@ -1207,9 +1207,9 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1207
1207
  h,
1208
1208
  a,
1209
1209
  m
1210
- ]), w = N((t) => ft({
1210
+ ]), w = j((t) => pt({
1211
1211
  cachedBounds: h,
1212
- containerScrollOffset: Z({
1212
+ containerScrollOffset: ut({
1213
1213
  containerElement: e,
1214
1214
  direction: r,
1215
1215
  isRtl: i,
@@ -1227,19 +1227,19 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1227
1227
  a,
1228
1228
  l
1229
1229
  ]);
1230
- return Y(() => {
1230
+ return J(() => {
1231
1231
  v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
1232
1232
  }, [
1233
1233
  e,
1234
1234
  r,
1235
1235
  w
1236
- ]), Y(() => {
1236
+ ]), J(() => {
1237
1237
  if (!e) return;
1238
1238
  let t = () => {
1239
1239
  v((t) => {
1240
- let { scrollLeft: n, scrollTop: o } = e, s = ft({
1240
+ let { scrollLeft: n, scrollTop: o } = e, s = pt({
1241
1241
  cachedBounds: h,
1242
- containerScrollOffset: Z({
1242
+ containerScrollOffset: ut({
1243
1243
  containerElement: e,
1244
1244
  direction: r,
1245
1245
  isRtl: i,
@@ -1249,7 +1249,7 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1249
1249
  itemCount: a,
1250
1250
  overscanCount: l
1251
1251
  });
1252
- return $(s, t) ? t : s;
1252
+ return Q(s, t) ? t : s;
1253
1253
  });
1254
1254
  };
1255
1255
  return e.addEventListener("scroll", t), () => {
@@ -1265,8 +1265,8 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1265
1265
  ]), {
1266
1266
  getCellBounds: g,
1267
1267
  getEstimatedSize: C,
1268
- scrollToIndex: ct(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1269
- let s = dt({
1268
+ scrollToIndex: lt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1269
+ let s = ft({
1270
1270
  align: t,
1271
1271
  cachedBounds: h,
1272
1272
  containerScrollOffset: n,
@@ -1276,14 +1276,14 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1276
1276
  itemSize: m
1277
1277
  });
1278
1278
  if (e) {
1279
- if (s = Z({
1279
+ if (s = ut({
1280
1280
  containerElement: e,
1281
1281
  direction: r,
1282
1282
  isRtl: i,
1283
1283
  scrollOffset: s
1284
1284
  }), typeof e.scrollTo != "function") {
1285
1285
  let e = w(s);
1286
- $(_, e) || v(e);
1286
+ Q(_, e) || v(e);
1287
1287
  }
1288
1288
  return s;
1289
1289
  }
@@ -1294,30 +1294,30 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1294
1294
  stopIndexVisible: x
1295
1295
  };
1296
1296
  }
1297
- function _t(e) {
1298
- return I(() => e, Object.values(e));
1297
+ function vt(e) {
1298
+ return N(() => e, Object.values(e));
1299
1299
  }
1300
- function vt(e, t) {
1300
+ function yt(e, t) {
1301
1301
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
1302
- return $(n, a) && $(r, o) && $(i, s);
1302
+ return Q(n, a) && Q(r, o) && Q(i, s);
1303
1303
  }
1304
- function yt(e) {
1304
+ function bt(e) {
1305
1305
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1306
1306
  }
1307
- var bt = "data-react-window-index";
1308
- function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
1309
- let m = _t(u), h = I(() => me(s, vt), [s]), [g, _] = R(null), v = yt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = gt({
1307
+ var xt = "data-react-window-index";
1308
+ function St({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
1309
+ let m = vt(u), h = N(() => ge(s, yt), [s]), [g, _] = F(null), v = bt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = _t({
1310
1310
  containerElement: g,
1311
1311
  containerStyle: f,
1312
1312
  defaultContainerSize: n,
1313
1313
  direction: "vertical",
1314
1314
  itemCount: c,
1315
1315
  itemProps: m,
1316
- itemSize: I(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1316
+ itemSize: N(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1317
1317
  onResize: i,
1318
1318
  overscanCount: o
1319
1319
  });
1320
- he(r, () => ({
1320
+ _e(r, () => ({
1321
1321
  get element() {
1322
1322
  return g;
1323
1323
  },
@@ -1332,12 +1332,12 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1332
1332
  top: r
1333
1333
  });
1334
1334
  }
1335
- }), [g, x]), Y(() => {
1335
+ }), [g, x]), J(() => {
1336
1336
  if (!g) return;
1337
1337
  let e = Array.from(g.children).filter((e, t) => {
1338
1338
  if (e.hasAttribute("aria-hidden")) return !1;
1339
1339
  let n = `${S + t}`;
1340
- return e.setAttribute(bt, n), !0;
1340
+ return e.setAttribute(xt, n), !0;
1341
1341
  });
1342
1342
  if (v) return l.observeRowElements(e);
1343
1343
  }, [
@@ -1346,7 +1346,7 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1346
1346
  l,
1347
1347
  S,
1348
1348
  w
1349
- ]), P(() => {
1349
+ ]), M(() => {
1350
1350
  S >= 0 && w >= 0 && a && a({
1351
1351
  startIndex: C,
1352
1352
  stopIndex: T
@@ -1361,11 +1361,11 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1361
1361
  w,
1362
1362
  T
1363
1363
  ]);
1364
- let E = I(() => {
1364
+ let E = N(() => {
1365
1365
  let e = [];
1366
1366
  if (c > 0) for (let t = S; t <= w; t++) {
1367
1367
  let n = y(t);
1368
- e.push(/* @__PURE__ */ pe(h, {
1368
+ e.push(/* @__PURE__ */ he(h, {
1369
1369
  ...m,
1370
1370
  ariaAttributes: {
1371
1371
  "aria-posinset": t + 1,
@@ -1392,7 +1392,7 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1392
1392
  m,
1393
1393
  S,
1394
1394
  w
1395
- ]), D = /* @__PURE__ */ B("div", {
1395
+ ]), D = /* @__PURE__ */ L("div", {
1396
1396
  "aria-hidden": !0,
1397
1397
  style: {
1398
1398
  height: b(),
@@ -1400,7 +1400,7 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1400
1400
  zIndex: -1
1401
1401
  }
1402
1402
  });
1403
- return pe(d, {
1403
+ return he(d, {
1404
1404
  role: "list",
1405
1405
  ...p,
1406
1406
  className: t,
@@ -1414,34 +1414,34 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1414
1414
  }
1415
1415
  }, E, e, D);
1416
1416
  }
1417
- var St = {
1417
+ var $ = {
1418
1418
  divider: "_divider_3wv6u_1",
1419
1419
  item: "_item_3wv6u_5",
1420
1420
  itemIcon: "_itemIcon_3wv6u_15",
1421
1421
  checkIcon: "_checkIcon_3wv6u_19",
1422
1422
  stateLabel: "_stateLabel_3wv6u_23"
1423
1423
  }, Ct = 44, wt = 8, Tt = ({ index: e, style: t, ariaAttributes: n, items: i, selectedDeploymentId: a, labelClassName: o, query: c, onSelect: l }) => {
1424
- let u = i[e], d = it(u.iconUrl, u.type, u.displayName ?? u.id, f.SM), m = u.id === a;
1425
- return /* @__PURE__ */ B("div", {
1424
+ let u = i[e], d = at(u.iconUrl, u.type, u.displayName ?? u.id, f.SM), m = u.id === a;
1425
+ return /* @__PURE__ */ L("div", {
1426
1426
  style: t,
1427
1427
  ...n,
1428
- children: /* @__PURE__ */ B(p, {
1428
+ children: /* @__PURE__ */ L(p, {
1429
1429
  type: "button",
1430
- className: s(St.item, "flex h-full w-full items-center gap-3 px-4"),
1431
- iconBefore: /* @__PURE__ */ B("span", {
1432
- className: St.itemIcon,
1430
+ className: s($.item, "flex h-full w-full items-center gap-3 px-4"),
1431
+ iconBefore: /* @__PURE__ */ L("span", {
1432
+ className: $.itemIcon,
1433
1433
  children: d
1434
1434
  }),
1435
- label: /* @__PURE__ */ V("span", {
1435
+ label: /* @__PURE__ */ R("span", {
1436
1436
  className: "flex flex-1 items-center justify-between gap-2",
1437
- children: [/* @__PURE__ */ B(r, {
1437
+ children: [/* @__PURE__ */ L(r, {
1438
1438
  text: u.displayName ?? u.id,
1439
1439
  query: c,
1440
1440
  maxLines: 1,
1441
1441
  className: s(o, "min-w-0 flex-1 text-left")
1442
- }), m && /* @__PURE__ */ B(re, {
1442
+ }), m && /* @__PURE__ */ L(ae, {
1443
1443
  size: f.SM,
1444
- className: St.checkIcon,
1444
+ className: $.checkIcon,
1445
1445
  "aria-hidden": !0
1446
1446
  })]
1447
1447
  }),
@@ -1449,12 +1449,12 @@ var St = {
1449
1449
  })
1450
1450
  });
1451
1451
  }, Et = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: c, loadingLabel: l, errorLabel: u, emptyLabel: d, style: f, titleClassName: p = "dial-body-semi-text", labelClassName: m = "dial-small-text" }) => {
1452
- let [h, g] = R("");
1453
- P(() => {
1452
+ let [h, g] = F("");
1453
+ M(() => {
1454
1454
  e || g("");
1455
1455
  }, [e]);
1456
- let _ = a && a.length > 0, v = l !== void 0, y = !_ && !v ? u ?? d : void 0, b = _ ? rt(a, h) : [];
1457
- return /* @__PURE__ */ V(H, {
1456
+ let _ = a && a.length > 0, v = l !== void 0, y = !_ && !v ? u ?? d : void 0, b = _ ? it(a, h) : [];
1457
+ return /* @__PURE__ */ R(B, {
1458
1458
  isOpen: e,
1459
1459
  title: t,
1460
1460
  closeLabel: n,
@@ -1462,19 +1462,19 @@ var St = {
1462
1462
  style: f,
1463
1463
  titleClassName: p,
1464
1464
  className: "max-h-[80dvh]",
1465
- children: [_ && !v && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("div", {
1465
+ children: [_ && !v && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("div", {
1466
1466
  className: "flex-shrink-0 px-4 py-[10px]",
1467
- children: /* @__PURE__ */ B(C, {
1467
+ children: /* @__PURE__ */ L(C, {
1468
1468
  value: h,
1469
1469
  placeholder: r,
1470
- size: A.Standard,
1470
+ size: k.Standard,
1471
1471
  onChange: g
1472
1472
  })
1473
- }), /* @__PURE__ */ B("div", { className: s(St.divider, "h-px flex-shrink-0") })] }), v ? /* @__PURE__ */ B(tt, { loadingLabel: l }) : y ? /* @__PURE__ */ B("div", {
1473
+ }), /* @__PURE__ */ L("div", { className: s($.divider, "h-px flex-shrink-0") })] }), v ? /* @__PURE__ */ L(nt, { loadingLabel: l }) : y ? /* @__PURE__ */ L("div", {
1474
1474
  role: "list",
1475
- className: s(St.stateLabel, m, "px-4 py-4"),
1475
+ className: s($.stateLabel, m, "px-4 py-4"),
1476
1476
  children: y
1477
- }) : /* @__PURE__ */ B(xt, {
1477
+ }) : /* @__PURE__ */ L(St, {
1478
1478
  role: "list",
1479
1479
  className: "overflow-y-auto",
1480
1480
  style: { height: Math.min(b.length, wt) * Ct },
@@ -1493,22 +1493,22 @@ var St = {
1493
1493
  })]
1494
1494
  });
1495
1495
  }, Dt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isInputDisabled: o = !1, isDisabled: c = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: p, onPickerOpenChange: m }) => {
1496
- let [_, y] = R(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = at({
1496
+ let [_, y] = F(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = ot({
1497
1497
  deployments: e,
1498
1498
  selectedDeploymentId: t,
1499
1499
  onDeploymentChange: n,
1500
1500
  modelSelectorLabels: r
1501
1501
  });
1502
1502
  if (!e) return null;
1503
- let E = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ B(ie, {
1503
+ let E = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ L(oe, {
1504
1504
  size: f.SM,
1505
- className: J.modelSelectorCaret,
1505
+ className: q.modelSelectorCaret,
1506
1506
  "aria-hidden": !0
1507
1507
  });
1508
- return a ? /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(k, {
1508
+ return a ? /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(O, {
1509
1509
  tooltip: S,
1510
- children: /* @__PURE__ */ B(v, {
1511
- icon: /* @__PURE__ */ V("div", {
1510
+ children: /* @__PURE__ */ L(v, {
1511
+ icon: /* @__PURE__ */ R("div", {
1512
1512
  className: "flex items-center gap-1",
1513
1513
  children: [b, D]
1514
1514
  }),
@@ -1516,16 +1516,16 @@ var St = {
1516
1516
  onClick: () => {
1517
1517
  c || y(!0);
1518
1518
  },
1519
- className: s(J.modelSelectorButton, E)
1519
+ className: s(q.modelSelectorButton, E)
1520
1520
  })
1521
- }), u ? /* @__PURE__ */ B(H, {
1521
+ }), u ? /* @__PURE__ */ L(B, {
1522
1522
  isOpen: _,
1523
1523
  title: r?.ariaLabel ?? "Select model",
1524
1524
  closeLabel: r?.closeLabel ?? "Close",
1525
1525
  onClose: () => y(!1),
1526
1526
  style: l,
1527
1527
  children: u(() => y(!1))
1528
- }) : /* @__PURE__ */ B(Et, {
1528
+ }) : /* @__PURE__ */ L(Et, {
1529
1529
  isOpen: _,
1530
1530
  title: r?.ariaLabel ?? "Select model",
1531
1531
  closeLabel: r?.closeLabel ?? "Close",
@@ -1538,7 +1538,7 @@ var St = {
1538
1538
  errorLabel: r?.error,
1539
1539
  emptyLabel: r?.empty,
1540
1540
  style: l
1541
- })] }) : u ? /* @__PURE__ */ B(h, {
1541
+ })] }) : u ? /* @__PURE__ */ L(h, {
1542
1542
  placement: "top-end",
1543
1543
  matchReferenceWidth: !1,
1544
1544
  open: d,
@@ -1547,24 +1547,24 @@ var St = {
1547
1547
  outsideClosable: !0,
1548
1548
  renderOverlay: () => u(() => m?.(!1)),
1549
1549
  listClassName: "cp-dropdown-overlay !w-[320px]",
1550
- children: /* @__PURE__ */ B(k, {
1550
+ children: /* @__PURE__ */ L(O, {
1551
1551
  tooltip: S,
1552
- children: /* @__PURE__ */ V("button", {
1552
+ children: /* @__PURE__ */ R("button", {
1553
1553
  type: "button",
1554
1554
  "aria-label": x,
1555
- className: s("flex items-center justify-center gap-1 rounded-md p-2", J.modelSelectorButton, o || i || c ? E : void 0, (o || c) && J.modelSelectorButtonDisabled),
1555
+ className: s("flex items-center justify-center gap-1 rounded-md p-2", q.modelSelectorButton, o || i || c ? E : void 0, (o || c) && q.modelSelectorButtonDisabled),
1556
1556
  onClick: () => {
1557
1557
  !o && !i && !c && p?.();
1558
1558
  },
1559
1559
  children: [b, D]
1560
1560
  })
1561
1561
  })
1562
- }) : /* @__PURE__ */ B("div", {
1562
+ }) : /* @__PURE__ */ L("div", {
1563
1563
  className: s(c && E),
1564
1564
  "aria-disabled": c || void 0,
1565
- children: /* @__PURE__ */ B(k, {
1565
+ children: /* @__PURE__ */ L(O, {
1566
1566
  tooltip: S,
1567
- children: /* @__PURE__ */ B(g, {
1567
+ children: /* @__PURE__ */ L(g, {
1568
1568
  icon: b,
1569
1569
  ariaLabel: x,
1570
1570
  items: C,
@@ -1573,187 +1573,188 @@ var St = {
1573
1573
  matchReferenceWidth: !1,
1574
1574
  listClassName: "cp-dropdown-overlay !w-[240px] !max-h-80",
1575
1575
  onOpenChange: c ? void 0 : T,
1576
- size: A.Standard,
1576
+ size: k.Standard,
1577
1577
  caretIcon: D,
1578
1578
  iconClassName: o || c ? E : void 0,
1579
- buttonClassName: s("bg-transparent", J.modelSelectorButton, (o || c) && E && J.modelSelectorButtonDisabled)
1579
+ buttonClassName: s("bg-transparent", q.modelSelectorButton, (o || c) && E && q.modelSelectorButtonDisabled)
1580
1580
  })
1581
1581
  })
1582
1582
  });
1583
- }, Ot = 160, kt = ({ message: e = "", onSend: t, onUploadAttachment: n, onStop: r, isStreaming: i = !1, onChange: a, onAttachmentsChange: u, placeholder: d = "Type a message...", ariaLabel: p, attachLabel: m = "Attach file", addMenuTitle: h = "Add", menuTitle: g = "Menu", menuCloseLabel: _ = "Close", removeLabel: y, retryLabel: b, sendLabel: x, stopLabel: S, micLabel: C = "Record voice message", colors: w, typography: T, className: E, pendingDropFiles: D = [], onDropFilesConsumed: O, pendingAttachments: k = [], onPendingAttachmentsConsumed: A, pasteTextThreshold: ee = 4e3, deployments: j, selectedDeploymentId: te, onDeploymentChange: ne, modelSelectorLabels: re, initialAttachments: ie = [], isStacked: ae = !1, hideAddButton: ce = !1, hideAttachFile: le = !1, hideActionBar: ue = !1, renderFooterActions: de, isInputDisabled: M = !1, isModelSelectorDisabled: fe = !1, isTranscriptionSupported: pe = !1, onUploadAudio: me, onTranscribeAudio: P, sendOnEnter: he = Ie.Enter, prefixAttachments: F = [], onRemovePrefixAttachment: ge, chatSettings: _e, autoFocus: ve = !1, messageHistory: be, onDialFileSystemClick: xe, dialFileSystemLabel: Se, validateAttachment: Ce, onAttachmentClick: Te, modelPickerOverlay: Ee }) => {
1584
- let H = c(), [De, Ae] = R(!1), je = Me(be), U = I(() => o({
1585
- "--ci-bg": w?.background,
1586
- "--ci-text": w?.text,
1587
- "--ci-border": w?.border,
1588
- "--ci-border-hover": w?.borderHover,
1589
- "--ci-border-focus": w?.borderFocus,
1590
- "--ci-placeholder": w?.placeholder,
1591
- "--ci-shadow": w?.shadow,
1592
- "--ci-shadow-focus": w?.shadowFocus,
1593
- "--ci-send-bg": w?.sendBackground,
1594
- "--ci-send-text": w?.sendText,
1595
- "--ci-stop-color": w?.stopColor
1596
- }), [w]), Pe = I(() => xe ? [{
1583
+ }, Ot = 160, kt = ({ message: e = "", onSend: t, onUploadAttachment: n, onStop: r, isStreaming: i = !1, onChange: a, onAttachmentsChange: u, placeholder: d = "Type a message...", ariaLabel: p, attachLabel: m = "Attach file", fileAccept: h, addMenuTitle: g = "Add", menuTitle: _ = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", colors: T, typography: E, className: D, pendingDropFiles: ee = [], onDropFilesConsumed: O, pendingAttachments: k = [], onPendingAttachmentsConsumed: te, pasteTextThreshold: ne = 4e3, deployments: re, selectedDeploymentId: ie, onDeploymentChange: ae, modelSelectorLabels: oe, initialAttachments: se = [], isStacked: ue = !1, hideAddButton: de = !1, hideAttachFile: fe = !1, hideActionBar: pe = !1, renderFooterActions: me, isInputDisabled: A = !1, isModelSelectorDisabled: he = !1, isTranscriptionSupported: ge = !1, onUploadAudio: M, onTranscribeAudio: _e, sendOnEnter: ve = Re.Enter, prefixAttachments: ye = [], onRemovePrefixAttachment: be, chatSettings: xe, autoFocus: Ce = !1, messageHistory: we, onDialFileSystemClick: Te, dialFileSystemLabel: Ee, validateAttachment: Oe, onAttachmentClick: z, modelPickerOverlay: B }) => {
1584
+ let ke = c(), [Me, Ne] = F(!1), V = Pe(we), H = N(() => o({
1585
+ "--ci-bg": T?.background,
1586
+ "--ci-text": T?.text,
1587
+ "--ci-border": T?.border,
1588
+ "--ci-border-hover": T?.borderHover,
1589
+ "--ci-border-focus": T?.borderFocus,
1590
+ "--ci-placeholder": T?.placeholder,
1591
+ "--ci-shadow": T?.shadow,
1592
+ "--ci-shadow-focus": T?.shadowFocus,
1593
+ "--ci-send-bg": T?.sendBackground,
1594
+ "--ci-send-text": T?.sendText,
1595
+ "--ci-stop-color": T?.stopColor
1596
+ }), [T]), Ie = N(() => Te ? [{
1597
1597
  key: "dial-fs",
1598
- label: Se ?? "DIAL file system",
1599
- icon: /* @__PURE__ */ B(oe, {
1598
+ label: Ee ?? "DIAL file system",
1599
+ icon: /* @__PURE__ */ L(ce, {
1600
1600
  size: l,
1601
1601
  "aria-hidden": !0
1602
1602
  }),
1603
- onClick: xe
1604
- }] : [], [xe, Se]), { message: W, setMessage: G, textareaRef: Le, isMultiLine: Re } = Ne({ messageProp: e }), { attachments: K, buildAttachments: ze, addAttachments: Be, resetAttachments: Ve, handleRemove: He, handleRetry: Ue, handleExpand: We, hasBlockedAttachments: Ge } = Oe({
1605
- initialAttachments: ie,
1603
+ onClick: Te
1604
+ }] : [], [Te, Ee]), { message: U, setMessage: W, textareaRef: ze, isMultiLine: Be } = Fe({ messageProp: e }), { attachments: G, buildAttachments: Ve, addAttachments: He, resetAttachments: Ue, handleRemove: We, handleRetry: Ge, handleExpand: Ke, hasBlockedAttachments: K } = Ae({
1605
+ initialAttachments: se,
1606
1606
  onUploadAttachment: n,
1607
1607
  onAttachmentsChange: u,
1608
- validateAttachment: Ce,
1609
- pendingDropFiles: D,
1608
+ validateAttachment: Oe,
1609
+ pendingDropFiles: ee,
1610
1610
  onDropFilesConsumed: O,
1611
1611
  pendingAttachments: k,
1612
- onPendingAttachmentsConsumed: A,
1613
- onExpandPastedText: N((e) => {
1614
- G((t) => t ? `${t}\n${e}` : e);
1615
- }, [G])
1616
- }), { state: q, waveformData: qe, errorMessage: Je, startRecording: Ye, stopRecording: $e, confirmRecording: et, discardRecording: tt } = Fe({
1617
- onUploadAudio: me,
1618
- onTranscribeAudio: P,
1619
- onTranscript: N((e) => {
1620
- G(e), a?.(e);
1621
- }, [a, G])
1622
- }), nt = L(null), rt = L(null), { handlePaste: it } = we(Be, ee), at = W.trim().length > 0 || K.length > 0, Y = at && !Ge, { shouldRender: ot, isExiting: st, instanceKey: ct } = ke(!i && at, Ot), X = ae || K.length > 0 || W.includes("\n") || Re, lt = j === void 0 || te != null, Z = async () => {
1623
- if (M) return;
1624
- let e = W, n = K;
1625
- G(""), je.reset();
1612
+ onPendingAttachmentsConsumed: te,
1613
+ onExpandPastedText: j((e) => {
1614
+ W((t) => t ? `${t}\n${e}` : e);
1615
+ }, [W])
1616
+ }), { state: Je, waveformData: Ye, errorMessage: Xe, startRecording: et, stopRecording: tt, confirmRecording: nt, discardRecording: rt } = Le({
1617
+ onUploadAudio: M,
1618
+ onTranscribeAudio: _e,
1619
+ onTranscript: j((e) => {
1620
+ W(e), a?.(e);
1621
+ }, [a, W])
1622
+ }), it = P(null), at = P(null), { handlePaste: ot } = De(He, ne), J = U.trim().length > 0 || G.length > 0, st = J && !K, { shouldRender: ct, isExiting: lt, instanceKey: Y } = je(!i && J, Ot), X = ue || G.length > 0 || U.includes("\n") || Be, ut = re === void 0 || ie != null, Z = async () => {
1623
+ if (A) return;
1624
+ let e = U, n = G;
1625
+ W(""), V.reset();
1626
1626
  try {
1627
1627
  await t?.(e, n), n.forEach((e) => {
1628
1628
  e.previewUrl && URL.revokeObjectURL(e.previewUrl);
1629
- }), Ve([]);
1629
+ }), Ue([]);
1630
1630
  } catch {
1631
- G(e), Ve(n);
1631
+ W(e), Ue(n);
1632
1632
  }
1633
1633
  }, Q = (e) => {
1634
- if (!e.nativeEvent.isComposing && !M && !i && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
1635
- let t = e.currentTarget.selectionStart ?? 0, n = je.navigate(e.key === "ArrowUp" ? "up" : "down", W, t);
1634
+ if (!e.nativeEvent.isComposing && !A && !i && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
1635
+ let t = e.currentTarget.selectionStart ?? 0, n = V.navigate(e.key === "ArrowUp" ? "up" : "down", U, t);
1636
1636
  if (n !== null) {
1637
- e.preventDefault(), G(n);
1637
+ e.preventDefault(), W(n);
1638
1638
  return;
1639
1639
  }
1640
1640
  }
1641
- e.key === "Enter" && (he === Ie.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !i && Y && lt && Z());
1642
- }, $ = (e) => {
1641
+ e.key === "Enter" && (ve === Re.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !i && st && ut && Z());
1642
+ }, dt = (e) => {
1643
1643
  let t = Array.from(e.target.files ?? []);
1644
1644
  if (t.length === 0) return;
1645
- let n = ze(t);
1646
- e.target.value = "", Be(n);
1645
+ let n = Ve(t);
1646
+ e.target.value = "", He(n);
1647
1647
  };
1648
- if (q !== "idle") return /* @__PURE__ */ B(Xe, {
1649
- state: q,
1650
- waveformData: qe,
1651
- errorMessage: Je,
1652
- onStop: $e,
1653
- onConfirm: et,
1654
- onDiscard: tt,
1655
- style: U,
1656
- className: E
1648
+ if (Je !== "idle") return /* @__PURE__ */ L(Ze, {
1649
+ state: Je,
1650
+ waveformData: Ye,
1651
+ errorMessage: Xe,
1652
+ onStop: tt,
1653
+ onConfirm: nt,
1654
+ onDiscard: rt,
1655
+ style: H,
1656
+ className: D
1657
1657
  });
1658
- let ut = /* @__PURE__ */ B("textarea", {
1659
- className: s(J.textarea, T?.fontClassName, "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
1660
- ref: Le,
1661
- autoFocus: ve,
1662
- value: W,
1658
+ let ft = /* @__PURE__ */ L("textarea", {
1659
+ className: s(q.textarea, E?.fontClassName, "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
1660
+ ref: ze,
1661
+ autoFocus: Ce,
1662
+ value: U,
1663
1663
  onChange: (e) => {
1664
- G(e.target.value), je.notifyChange(), a?.(e.target.value);
1664
+ W(e.target.value), V.notifyChange(), a?.(e.target.value);
1665
1665
  },
1666
1666
  onKeyDown: Q,
1667
- onPaste: it,
1667
+ onPaste: ot,
1668
1668
  placeholder: d,
1669
1669
  "aria-label": p,
1670
- disabled: M,
1670
+ disabled: A,
1671
1671
  rows: 1
1672
1672
  });
1673
- return /* @__PURE__ */ V("div", {
1674
- ref: rt,
1675
- style: U,
1676
- className: s(J.wrapper, M && J.wrapperDisabled, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", K.length > 6 ? "py-3 pl-3" : "p-3", E),
1677
- children: [(F.length > 0 || K.length > 0) && /* @__PURE__ */ B(ye, {
1678
- attachments: [...F, ...K],
1673
+ return /* @__PURE__ */ R("div", {
1674
+ ref: at,
1675
+ style: H,
1676
+ className: s(q.wrapper, A && q.wrapperDisabled, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", G.length > 6 ? "py-3 pl-3" : "p-3", D),
1677
+ children: [(ye.length > 0 || G.length > 0) && /* @__PURE__ */ L(Se, {
1678
+ attachments: [...ye, ...G],
1679
1679
  onRemove: (e) => {
1680
- F.some((t) => t.id === e) ? ge?.(e) : He(e);
1680
+ ye.some((t) => t.id === e) ? be?.(e) : We(e);
1681
1681
  },
1682
- onRetry: Ue,
1683
- onExpand: We,
1682
+ onRetry: Ge,
1683
+ onExpand: Ke,
1684
1684
  labels: {
1685
- removeLabel: y,
1686
- retryLabel: b
1685
+ removeLabel: b,
1686
+ retryLabel: x
1687
1687
  },
1688
- onAttachmentClick: Te == null ? void 0 : (e) => {
1689
- let t = K.find((t) => t.id === e.id);
1690
- t != null && Te(t);
1688
+ onAttachmentClick: z == null ? void 0 : (e) => {
1689
+ let t = G.find((t) => t.id === e.id);
1690
+ t != null && z(t);
1691
1691
  }
1692
- }), ue ? X && ut : /* @__PURE__ */ V("div", {
1692
+ }), pe ? X && ft : /* @__PURE__ */ R("div", {
1693
1693
  className: s("flex items-center gap-2", X ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
1694
1694
  children: [
1695
- !ce && /* @__PURE__ */ V("div", {
1695
+ !de && /* @__PURE__ */ R("div", {
1696
1696
  className: s("order-2 flex", !X && "desktop:order-1"),
1697
- children: [/* @__PURE__ */ B("input", {
1698
- ref: nt,
1697
+ children: [/* @__PURE__ */ L("input", {
1698
+ ref: it,
1699
1699
  type: "file",
1700
1700
  multiple: !0,
1701
+ accept: h,
1701
1702
  className: "sr-only",
1702
1703
  "aria-hidden": !0,
1703
1704
  tabIndex: -1,
1704
- onChange: $
1705
- }), /* @__PURE__ */ B(Ke, {
1706
- onAttachClick: le ? void 0 : () => nt.current?.click(),
1705
+ onChange: dt
1706
+ }), /* @__PURE__ */ L(qe, {
1707
+ onAttachClick: fe ? void 0 : () => it.current?.click(),
1707
1708
  attachLabel: m,
1708
- addMenuTitle: h,
1709
- menuTitle: g,
1710
- menuCloseLabel: _,
1711
- style: U,
1712
- isDisabled: M,
1713
- chatSettings: _e,
1714
- extraMenuItems: Pe
1709
+ addMenuTitle: g,
1710
+ menuTitle: _,
1711
+ menuCloseLabel: y,
1712
+ style: H,
1713
+ isDisabled: A,
1714
+ chatSettings: xe,
1715
+ extraMenuItems: Ie
1715
1716
  })]
1716
1717
  }),
1717
- /* @__PURE__ */ B("div", {
1718
+ /* @__PURE__ */ L("div", {
1718
1719
  className: s("order-1 flex w-full min-w-0 items-center self-stretch", !X && "desktop:order-2 desktop:w-auto desktop:flex-1"),
1719
- children: ut
1720
+ children: ft
1720
1721
  }),
1721
- /* @__PURE__ */ V("div", {
1722
+ /* @__PURE__ */ R("div", {
1722
1723
  className: s("flex flex-shrink-0 items-center gap-2", "order-3 ms-auto", !X && "desktop:ms-0"),
1723
- children: [de ? de({
1724
- canSend: Y,
1724
+ children: [me ? me({
1725
+ canSend: st,
1725
1726
  onSend: Z
1726
- }) : /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(Dt, {
1727
- deployments: j,
1728
- selectedDeploymentId: te,
1729
- onDeploymentChange: ne,
1730
- modelSelectorLabels: re,
1727
+ }) : /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(Dt, {
1728
+ deployments: re,
1729
+ selectedDeploymentId: ie,
1730
+ onDeploymentChange: ae,
1731
+ modelSelectorLabels: oe,
1731
1732
  isStreaming: i,
1732
- isMobile: H,
1733
- isInputDisabled: M,
1734
- isDisabled: fe,
1735
- style: U,
1736
- modelPickerOverlay: Ee,
1737
- isPickerOpen: De,
1738
- onPickerToggle: () => Ae((e) => !e),
1739
- onPickerOpenChange: Ae
1740
- }), i && r ? /* @__PURE__ */ B(Qe, {
1733
+ isMobile: ke,
1734
+ isInputDisabled: A,
1735
+ isDisabled: he,
1736
+ style: H,
1737
+ modelPickerOverlay: B,
1738
+ isPickerOpen: Me,
1739
+ onPickerToggle: () => Ne((e) => !e),
1740
+ onPickerOpenChange: Ne
1741
+ }), i && r ? /* @__PURE__ */ L($e, {
1741
1742
  onStop: r,
1742
- ariaLabel: S
1743
- }) : !i && ot && /* @__PURE__ */ B(Ze, {
1743
+ ariaLabel: C
1744
+ }) : !i && ct && /* @__PURE__ */ L(Qe, {
1744
1745
  onSend: Z,
1745
- isDisabled: M || !lt || Ge,
1746
- ariaLabel: x,
1747
- isExiting: st
1748
- }, ct)] }), pe && !W.trim() && !st && /* @__PURE__ */ B(v, {
1749
- icon: /* @__PURE__ */ B(se, {
1746
+ isDisabled: A || !ut || K,
1747
+ ariaLabel: S,
1748
+ isExiting: lt
1749
+ }, Y)] }), ge && !U.trim() && !lt && /* @__PURE__ */ L(v, {
1750
+ icon: /* @__PURE__ */ L(le, {
1750
1751
  size: f.LG,
1751
1752
  "aria-hidden": !0
1752
1753
  }),
1753
- "aria-label": C,
1754
+ "aria-label": w,
1754
1755
  className: "size-8 flex-shrink-0",
1755
- onClick: Ye,
1756
- disabled: M || i
1756
+ onClick: et,
1757
+ disabled: A || i
1757
1758
  })]
1758
1759
  })
1759
1760
  ]
@@ -1761,18 +1762,18 @@ var St = {
1761
1762
  });
1762
1763
  }, At = { welcome: "_welcome_n2ph8_1" }, jt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, isInputDisabled: a = !1, ...c }) => {
1763
1764
  let { colors: l, typography: u } = r ?? {};
1764
- return /* @__PURE__ */ V("div", {
1765
+ return /* @__PURE__ */ R("div", {
1765
1766
  style: o({
1766
1767
  "--ci-root-bg": l?.background,
1767
1768
  "--ci-welcome-color": l?.welcomeText
1768
1769
  }),
1769
1770
  className: s("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
1770
- children: [n && /* @__PURE__ */ B("h1", {
1771
+ children: [n && /* @__PURE__ */ L("h1", {
1771
1772
  className: s(At.welcome, "m-0 text-center", u?.welcomeClassName),
1772
1773
  children: n
1773
- }), /* @__PURE__ */ B("div", {
1774
+ }), /* @__PURE__ */ L("div", {
1774
1775
  className: "relative w-full max-w-[748px]",
1775
- children: /* @__PURE__ */ B(kt, {
1776
+ children: /* @__PURE__ */ L(kt, {
1776
1777
  placeholder: t,
1777
1778
  isStreaming: e,
1778
1779
  isInputDisabled: a,
@@ -1782,72 +1783,73 @@ var St = {
1782
1783
  })
1783
1784
  })]
1784
1785
  });
1785
- }, Mt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: r, onUploadAttachment: a, cancelLabel: o = "Cancel", saveLabel: c = "Save & Submit", ariaLabel: l, removeLabel: u, retryLabel: d, addMenuTitle: f = "Add", attachLabel: p = "Attach file", menuTitle: m = "Menu", menuCloseLabel: h = "Close", className: g, pendingDropFiles: _, onDropFilesConsumed: v, validateAttachment: y, hideAttachFile: b = !1 }) => {
1786
- let x = L(null), [S, C] = R([]);
1787
- P(() => {
1788
- _?.length && (C(_), v?.());
1786
+ }, Mt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: r, onUploadAttachment: a, cancelLabel: o = "Cancel", saveLabel: c = "Save & Submit", ariaLabel: l, removeLabel: u, retryLabel: d, addMenuTitle: f = "Add", attachLabel: p = "Attach file", menuTitle: m = "Menu", menuCloseLabel: h = "Close", className: g, pendingDropFiles: _, onDropFilesConsumed: v, validateAttachment: y, hideAttachFile: b = !1, fileAccept: x }) => {
1787
+ let S = P(null), [C, w] = F([]);
1788
+ M(() => {
1789
+ _?.length && (w(_), v?.());
1789
1790
  }, [_, v]);
1790
- let [w, T] = R(e ?? ""), [E, D] = R([]), [O, k] = R(t), A = E.some((e) => e.status === i.Loading || e.status === i.Error), ee = (w.trim().length > 0 || E.length > 0 || O.length > 0) && !A, j = (e) => {
1791
+ let [T, E] = F(e ?? ""), [D, ee] = F([]), [O, k] = F(t), te = D.some((e) => e.status === i.Loading || e.status === i.Error), ne = (T.trim().length > 0 || D.length > 0 || O.length > 0) && !te, re = (e) => {
1791
1792
  k((t) => t.filter((t) => t.id !== e));
1792
- }, te = N((e, t) => {
1793
+ }, ie = j((e, t) => {
1793
1794
  r(e, O, t);
1794
- }, [O, r]), ne = () => {
1795
- ee && te(w, E);
1796
- }, re = N(() => C([]), []), ie = N((e) => {
1795
+ }, [O, r]), ae = () => {
1796
+ ne && ie(T, D);
1797
+ }, oe = j(() => w([]), []), se = j((e) => {
1797
1798
  let t = Array.from(e.target.files ?? []);
1798
- t.length !== 0 && (e.target.value = "", C(t));
1799
+ t.length !== 0 && (e.target.value = "", w(t));
1799
1800
  }, []);
1800
- return /* @__PURE__ */ V("div", {
1801
+ return /* @__PURE__ */ R("div", {
1801
1802
  className: s("flex w-full flex-col gap-2", g),
1802
- children: [/* @__PURE__ */ B(kt, {
1803
+ children: [/* @__PURE__ */ L(kt, {
1803
1804
  message: e,
1804
1805
  ariaLabel: l,
1805
1806
  isStacked: !0,
1806
1807
  hideActionBar: !0,
1807
- pendingDropFiles: S,
1808
- onDropFilesConsumed: re,
1809
- onSend: te,
1808
+ pendingDropFiles: C,
1809
+ onDropFilesConsumed: oe,
1810
+ onSend: ie,
1810
1811
  onUploadAttachment: a,
1811
- onChange: T,
1812
- onAttachmentsChange: D,
1812
+ onChange: E,
1813
+ onAttachmentsChange: ee,
1813
1814
  removeLabel: u,
1814
1815
  retryLabel: d,
1815
1816
  className: "max-w-full",
1816
1817
  prefixAttachments: O,
1817
- onRemovePrefixAttachment: j,
1818
+ onRemovePrefixAttachment: re,
1818
1819
  validateAttachment: y
1819
- }), /* @__PURE__ */ V("div", {
1820
+ }), /* @__PURE__ */ R("div", {
1820
1821
  className: "flex items-center justify-between",
1821
- children: [/* @__PURE__ */ B("div", {
1822
+ children: [/* @__PURE__ */ L("div", {
1822
1823
  className: "flex",
1823
- children: !b && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("input", {
1824
- ref: x,
1824
+ children: !b && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("input", {
1825
+ ref: S,
1825
1826
  type: "file",
1826
1827
  multiple: !0,
1828
+ accept: x,
1827
1829
  className: "sr-only",
1828
1830
  "aria-hidden": !0,
1829
1831
  tabIndex: -1,
1830
- onChange: ie
1831
- }), /* @__PURE__ */ B(Ke, {
1832
- onAttachClick: () => x.current?.click(),
1832
+ onChange: se
1833
+ }), /* @__PURE__ */ L(qe, {
1834
+ onAttachClick: () => S.current?.click(),
1833
1835
  attachLabel: p,
1834
1836
  addMenuTitle: f,
1835
1837
  menuTitle: m,
1836
1838
  menuCloseLabel: h
1837
1839
  })] })
1838
- }), /* @__PURE__ */ V("div", {
1840
+ }), /* @__PURE__ */ R("div", {
1839
1841
  className: "flex gap-2",
1840
- children: [/* @__PURE__ */ B(Be, {
1842
+ children: [/* @__PURE__ */ L(Ve, {
1841
1843
  label: o,
1842
1844
  onClick: n
1843
- }), /* @__PURE__ */ B(ze, {
1845
+ }), /* @__PURE__ */ L(G, {
1844
1846
  label: c,
1845
- onClick: ne,
1846
- disabled: !ee
1847
+ onClick: ae,
1848
+ disabled: !ne
1847
1849
  })]
1848
1850
  })]
1849
1851
  })]
1850
1852
  });
1851
1853
  };
1852
1854
  //#endregion
1853
- export { ge as AttachmentCard, _e as AttachmentGroup, ve as AttachmentTray, H as BottomSheetShell, Ge as ChatSettingsModal, jt as ConversationInput, Mt as EditMessageInput, be as FileDndOverlay, kt as Input, Ie as SendOnEnter, Ce as getAttachmentIcon };
1855
+ export { ye as AttachmentCard, be as AttachmentGroup, xe as AttachmentTray, B as BottomSheetShell, Ke as ChatSettingsModal, jt as ConversationInput, Mt as EditMessageInput, Ce as FileDndOverlay, kt as Input, Re as SendOnEnter, Ee as getAttachmentIcon };