@epam/ai-dial-conversation-input 1.2.0-dev.48 → 1.2.0-dev.58

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,29 +1,41 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RESIZABLE_TEXTAREA_CLASS_NAME as r, RequestStatus as i, ResponseFormat as a, SELECT_LIST_MAX_HEIGHT_PX as o, buildCssVars as s, mergeClasses as c, useIsMobile as l } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as u, Button as d, CloseButton as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, ErrorText as _, GhostIconButton as v, Highlight as y, MenuItemMark as b, NeutralButton as x, Popup as S, PopupSize as C, PrimaryButton as w, PrimaryIconButton as T, RadioGroup as E, RadioGroupOrientation as D, Search as O, Skeleton as k, SkeletonVariant as ee, Slider as A, Spinner as te, StaticIconButton as j, Textarea as ne, TextareaResize as M, Tooltip as N } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowLeft as re, IconArrowNarrowRight as ie, IconCheck as P, IconChevronDown as F, IconChevronRight as ae, IconFile as oe, IconMicrophone as se, IconPaperclip as ce, IconPlayerStopFilled as I, IconPlaystationSquare as le, IconPlus as ue, IconSettings as de, IconTool as fe, IconX as pe } from "@tabler/icons-react";
4
- import { createElement as me, memo as he, useCallback as L, useEffect as R, useImperativeHandle as ge, useLayoutEffect as _e, useMemo as z, useRef as B, useState as V } from "react";
5
- import { createPortal as H } from "react-dom";
6
- import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
7
- import { AttachmentTray as ve, MAX_UPLOADS_PER_MINUTE as ye, generateAttachmentId as be, useClipboardPaste as xe } from "@epam/ai-dial-attachment-input";
8
- //#region src/hooks/useBottomSheet.ts
9
- var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Ce = (e, t, n) => {
10
- R(() => {
2
+ import { BASE_ICON_SIZE as u, Button as d, CloseButton as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, ErrorText as _, GhostIconButton as v, Highlight as y, MenuItemMark as b, NeutralButton as x, Popup as S, PopupSize as C, PrimaryButton as w, PrimaryIconButton as T, RadioGroup as E, RadioGroupOrientation as D, Search as O, Skeleton as k, SkeletonVariant as ee, Slider as A, Spinner as te, StaticIconButton as j, Textarea as ne, TextareaResize as re, Tooltip as M } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowLeft as ie, IconArrowNarrowRight as ae, IconCheck as N, IconChevronDown as P, IconChevronRight as oe, IconFile as se, IconMicrophone as ce, IconPaperclip as le, IconPlayerStopFilled as ue, IconPlaystationSquare as F, IconPlus as de, IconSettings as fe, IconTool as pe, IconX as me } from "@tabler/icons-react";
4
+ import { createElement as he, memo as ge, useCallback as I, useEffect as L, useImperativeHandle as _e, useLayoutEffect as ve, useMemo as R, useRef as z, useState as B } from "react";
5
+ import { createPortal as ye } from "react-dom";
6
+ import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
7
+ import { AttachmentTray as be, MAX_UPLOADS_PER_MINUTE as xe, generateAttachmentId as W, useClipboardPaste as Se } from "@epam/ai-dial-attachment-input";
8
+ //#region src/constants/public-class-names.ts
9
+ var G = {
10
+ wrapper: "dial-ci-wrapper",
11
+ actionRow: "dial-ci-action-row",
12
+ textareaWrap: "dial-ci-textarea-wrap",
13
+ addCluster: "dial-ci-add-cluster",
14
+ toolsChips: "dial-ci-tools-chips",
15
+ footerActions: "dial-ci-footer-actions",
16
+ modelSelectorButton: "dial-ci-model-selector-button",
17
+ modelMenu: "dial-ci-model-menu",
18
+ modelMenuSearch: "dial-ci-model-menu-search",
19
+ modelMenuItem: "dial-ci-model-menu-item",
20
+ modelMenuItemSelected: "dial-ci-model-menu-item-selected"
21
+ }, Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", we = (e, t, n) => {
22
+ L(() => {
11
23
  if (!e) return;
12
24
  let n = (e) => {
13
25
  e.key === "Escape" && t();
14
26
  };
15
27
  return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
16
- }, [e, t]), R(() => {
28
+ }, [e, t]), L(() => {
17
29
  if (e) return document.body.style.overflow = "hidden", () => {
18
30
  document.body.style.overflow = "";
19
31
  };
20
- }, [e]), R(() => {
32
+ }, [e]), L(() => {
21
33
  if (!e || n?.current == null) return;
22
34
  let t = n.current, r = document.activeElement instanceof HTMLElement ? document.activeElement : null;
23
- (t.querySelector(Se) ?? t).focus();
35
+ (t.querySelector(Ce) ?? t).focus();
24
36
  let i = (e) => {
25
37
  if (e.key !== "Tab") return;
26
- let n = Array.from(t.querySelectorAll(Se));
38
+ let n = Array.from(t.querySelectorAll(Ce));
27
39
  if (n.length === 0) {
28
40
  e.preventDefault(), t.focus();
29
41
  return;
@@ -35,27 +47,27 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
35
47
  document.removeEventListener("keydown", i), r?.focus();
36
48
  };
37
49
  }, [e, n]);
38
- }, we = {
50
+ }, Te = {
39
51
  backdrop: "_backdrop_1d50f_9",
40
52
  sheet: "_sheet_1d50f_13",
41
53
  "slide-up": "_slide-up_1d50f_1",
42
54
  title: "_title_1d50f_18",
43
55
  divider: "_divider_1d50f_22"
44
- }, Te = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: l, titleClassName: u = "dial-body-semi-text", className: d, colors: h, children: _ }) => {
45
- let y = B(null);
46
- if (Ce(e, r, y), !e || typeof document > "u") return null;
56
+ }, K = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: l, titleClassName: u = "dial-body-semi-text", className: d, colors: h, children: _ }) => {
57
+ let y = z(null);
58
+ if (we(e, r, y), !e || typeof document > "u") return null;
47
59
  let b = s({
48
60
  "--ci-backdrop": h?.backdrop,
49
61
  "--ci-sheet-bg": h?.sheetBg,
50
62
  "--ci-sheet-text": h?.sheetText,
51
63
  "--ci-sheet-divider": h?.divider
52
64
  });
53
- return H(/* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
54
- className: c(we.backdrop, "fixed inset-0 z-[55]"),
65
+ return ye(/* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
66
+ className: c(Te.backdrop, "fixed inset-0 z-[55]"),
55
67
  style: b,
56
68
  onPointerDown: r,
57
69
  "aria-hidden": !0
58
- }), /* @__PURE__ */ G("div", {
70
+ }), /* @__PURE__ */ U("div", {
59
71
  ref: y,
60
72
  role: "dialog",
61
73
  "aria-modal": !0,
@@ -65,14 +77,14 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
65
77
  ...b,
66
78
  ...l
67
79
  },
68
- className: c(we.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", d),
69
- children: [t != null && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("div", {
80
+ className: c(Te.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", d),
81
+ children: [t != null && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
70
82
  className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
71
83
  children: [
72
- i && /* @__PURE__ */ W("div", {
84
+ i && /* @__PURE__ */ H("div", {
73
85
  className: "absolute start-4",
74
- children: /* @__PURE__ */ W(v, {
75
- icon: /* @__PURE__ */ W(re, {
86
+ children: /* @__PURE__ */ H(v, {
87
+ icon: /* @__PURE__ */ H(ie, {
76
88
  size: p.LG,
77
89
  stroke: m,
78
90
  className: "rtl:scale-x-[-1]"
@@ -81,20 +93,20 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
81
93
  onClick: i
82
94
  })
83
95
  }),
84
- /* @__PURE__ */ W("span", {
85
- className: c(we.title, u),
96
+ /* @__PURE__ */ H("span", {
97
+ className: c(Te.title, u),
86
98
  children: t
87
99
  }),
88
- /* @__PURE__ */ W("div", {
100
+ /* @__PURE__ */ H("div", {
89
101
  className: "absolute end-4 m-2",
90
- children: /* @__PURE__ */ W(f, {
102
+ children: /* @__PURE__ */ H(f, {
91
103
  ariaLabel: n,
92
104
  onClose: r,
93
105
  size: g.Standard
94
106
  })
95
107
  })
96
108
  ]
97
- }), /* @__PURE__ */ W("div", { className: c(we.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ W("div", {
109
+ }), /* @__PURE__ */ H("div", { className: c(Te.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ H("div", {
98
110
  className: "overflow-y-auto",
99
111
  children: _
100
112
  })]
@@ -104,18 +116,18 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
104
116
  for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
105
117
  await Promise.allSettled(i);
106
118
  }, De = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
107
- let [h, g] = V(n), _ = B(h);
108
- R(() => {
119
+ let [h, g] = B(n), _ = z(h);
120
+ L(() => {
109
121
  _.current = h;
110
- }, [h]), R(() => () => {
122
+ }, [h]), L(() => () => {
111
123
  _.current.forEach((e) => {
112
124
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
113
125
  });
114
126
  }, []);
115
- let v = L((e) => e.map((e) => {
127
+ let v = I((e) => e.map((e) => {
116
128
  let n = e.type.startsWith("image/"), r = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = r ? URL.createObjectURL(e) : void 0;
117
129
  return {
118
- id: be(),
130
+ id: W(),
119
131
  name: e.name,
120
132
  contentType: e.type,
121
133
  file: e,
@@ -124,26 +136,26 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
124
136
  previewUrl: a,
125
137
  playUrl: o
126
138
  };
127
- }), []), y = B(a);
128
- R(() => {
139
+ }), []), y = z(a);
140
+ L(() => {
129
141
  y.current = a;
130
142
  }, [a]);
131
- let b = B(!0), x = L((e) => {
143
+ let b = z(!0), x = I((e) => {
132
144
  g((t) => {
133
145
  let n = e(t);
134
146
  return n === t ? t : n;
135
147
  });
136
148
  }, []);
137
- R(() => {
149
+ L(() => {
138
150
  if (b.current) {
139
151
  b.current = !1;
140
152
  return;
141
153
  }
142
154
  y.current?.(h);
143
155
  }, [h]);
144
- let S = L((e) => {
156
+ let S = I((e) => {
145
157
  g(e);
146
- }, []), C = L(async (t) => {
158
+ }, []), C = I(async (t) => {
147
159
  if (r) {
148
160
  x((e) => e.map((e) => e.id === t.id ? {
149
161
  ...e,
@@ -166,7 +178,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
166
178
  } : e));
167
179
  }
168
180
  }
169
- }, [r, x]), w = L((e, t = !0) => {
181
+ }, [r, x]), w = I((e, t = !0) => {
170
182
  let n = new Set(_.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
171
183
  if (r.length !== 0) {
172
184
  if (f != null && f > 0 && Number.isFinite(f)) {
@@ -187,7 +199,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
187
199
  status: i.Error,
188
200
  errorReason: n
189
201
  } : e));
190
- }), Ee(e, ye, C);
202
+ }), Ee(e, xe, C);
191
203
  }
192
204
  }
193
205
  }, [
@@ -198,20 +210,20 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
198
210
  C,
199
211
  o
200
212
  ]);
201
- R(() => {
213
+ L(() => {
202
214
  s.length !== 0 && (w(v(s)), c?.());
203
215
  }, [
204
216
  w,
205
217
  v,
206
218
  c,
207
219
  s
208
- ]), R(() => {
220
+ ]), L(() => {
209
221
  l.length !== 0 && (w(l, !1), u?.());
210
222
  }, [
211
223
  w,
212
224
  u,
213
225
  l
214
- ]), R(() => {
226
+ ]), L(() => {
215
227
  if (!o) return;
216
228
  let t = !1, n = [], r = _.current.map((r) => {
217
229
  if (r.status === i.Loading) return r;
@@ -238,7 +250,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
238
250
  x,
239
251
  C
240
252
  ]);
241
- let T = L((e) => {
253
+ let T = I((e) => {
242
254
  x((t) => {
243
255
  let n = t.find((t) => t.id === e);
244
256
  return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
@@ -250,11 +262,11 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
250
262
  addAttachments: w,
251
263
  resetAttachments: S,
252
264
  handleRemove: T,
253
- handleRetry: L((e) => {
265
+ handleRetry: I((e) => {
254
266
  let t = h.find((t) => t.id === e);
255
267
  t && C(t);
256
268
  }, [h, C]),
257
- handleExpand: L(async (e) => {
269
+ handleExpand: I(async (e) => {
258
270
  let n = h.find((t) => t.id === e);
259
271
  if (!n || n.type !== t.Pasted) return;
260
272
  let r = await n.file.text();
@@ -271,7 +283,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
271
283
  let n = e.slice(t.length);
272
284
  return !/\s/.test(n) && !n.includes(t);
273
285
  }, ke = ({ config: e, message: t }) => {
274
- let [n, r] = V(!1), [i, a] = V(!1), o = e != null && Oe(t, e.triggerPrefix) ? t.slice(e.triggerPrefix.length) : "", s = L((n, a, o) => {
286
+ let [n, r] = B(!1), [i, a] = B(!1), o = e != null && Oe(t, e.triggerPrefix) ? t.slice(e.triggerPrefix.length) : "", s = I((n, a, o) => {
275
287
  if (e == null || a || t !== "" || i) return;
276
288
  let s = n === e.triggerPrefix, c = o === "insertFromPaste" && Oe(n, e.triggerPrefix);
277
289
  (s || c) && r(!0);
@@ -280,7 +292,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
280
292
  t,
281
293
  i
282
294
  ]);
283
- return R(() => {
295
+ return L(() => {
284
296
  if (e == null) {
285
297
  r(!1), a(!1);
286
298
  return;
@@ -289,23 +301,23 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
289
301
  }, [e, t]), {
290
302
  isMenuOpen: n,
291
303
  query: o,
292
- dismiss: L(() => {
304
+ dismiss: I(() => {
293
305
  r(!1), a(!0);
294
306
  }, []),
295
307
  handleValueChange: s
296
308
  };
297
309
  }, Ae = (e, t) => !e.slice(0, t).includes("\n"), je = (e, t) => !e.slice(t).includes("\n"), Me = (e) => {
298
- let t = B(e);
310
+ let t = z(e);
299
311
  t.current = e;
300
- let n = B(-1), r = B(""), i = L((e, i, a) => {
312
+ let n = z(-1), r = z(""), i = I((e, i, a) => {
301
313
  let o = t.current;
302
314
  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);
303
- }, []), a = L(() => {
315
+ }, []), a = I(() => {
304
316
  n.current = -1, r.current = "";
305
- }, []), o = L(() => {
317
+ }, []), o = I(() => {
306
318
  n.current = -1, r.current = "";
307
319
  }, []);
308
- return z(() => ({
320
+ return R(() => ({
309
321
  navigate: i,
310
322
  notifyChange: a,
311
323
  reset: o
@@ -315,8 +327,8 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
315
327
  o
316
328
  ]);
317
329
  }, Ne = ({ messageProp: e, messageRevision: t }) => {
318
- let [n, r] = V(e), i = B(null);
319
- return R(() => {
330
+ let [n, r] = B(e), i = z(null);
331
+ return L(() => {
320
332
  r(e);
321
333
  }, [e, t]), {
322
334
  message: n,
@@ -327,10 +339,10 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
327
339
  let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
328
340
  i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
329
341
  }, Fe = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Ie = ({ insertion: e, textareaRef: t }) => {
330
- let n = e?.revision, r = B(e?.text);
342
+ let n = e?.revision, r = z(e?.text);
331
343
  r.current = e?.text;
332
- let i = B(n), a = B(null);
333
- return R(() => {
344
+ let i = z(n), a = z(null);
345
+ return L(() => {
334
346
  if (n === i.current) return;
335
347
  i.current = n;
336
348
  let e = r.current;
@@ -360,7 +372,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
360
372
  "audio/ogg;codecs=opus",
361
373
  "audio/webm"
362
374
  ], Be = 100, Ve = 100, He = .01, Ue = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: r = "Voice input failed" }) => {
363
- let [i, a] = V("idle"), [o, s] = V(null), c = B(null), l = B(null), u = B({
375
+ let [i, a] = B("idle"), [o, s] = B(null), c = z(null), l = z(null), u = z({
364
376
  onAttachAudio: e,
365
377
  onTranscribeAudio: t,
366
378
  onTranscript: n,
@@ -372,7 +384,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
372
384
  onTranscript: n,
373
385
  errorLabel: r
374
386
  };
375
- let d = L((e = "dictation") => {
387
+ let d = I((e = "dictation") => {
376
388
  if (l.current) return;
377
389
  let t = { controller: new AbortController() };
378
390
  l.current = t, s(null), a("recording");
@@ -443,10 +455,10 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
443
455
  y(e);
444
456
  }
445
457
  })();
446
- }, []), f = L(() => l.current?.stop?.(), []), p = L(() => {
458
+ }, []), f = I(() => l.current?.stop?.(), []), p = I(() => {
447
459
  l.current?.controller.abort(), l.current = null, s(null), a("idle");
448
460
  }, []);
449
- return R(() => () => {
461
+ return L(() => () => {
450
462
  l.current?.controller.abort(), l.current = null;
451
463
  }, []), {
452
464
  state: i,
@@ -458,10 +470,12 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
458
470
  };
459
471
  }, We = /* @__PURE__ */ function(e) {
460
472
  return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
461
- }({}), Ge = {
473
+ }({}), Ge = /* @__PURE__ */ function(e) {
474
+ return e.Stacked = "stacked", e.Inline = "inline", e;
475
+ }({}), Ke = {
462
476
  item: "_item_1sr2n_1",
463
477
  itemIcon: "_itemIcon_1sr2n_11"
464
- }, Ke = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: l = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
478
+ }, qe = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: l = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
465
479
  let m = (e) => {
466
480
  e(), r();
467
481
  }, h = s({
@@ -470,7 +484,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
470
484
  "--ci-sheet-item-active": p?.itemActiveBg,
471
485
  "--ci-sheet-icon": p?.itemIcon
472
486
  });
473
- return /* @__PURE__ */ W(Te, {
487
+ return /* @__PURE__ */ H(K, {
474
488
  isOpen: e,
475
489
  title: t,
476
490
  closeLabel: n,
@@ -479,23 +493,23 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
479
493
  className: o,
480
494
  titleClassName: l,
481
495
  colors: p?.shell,
482
- children: /* @__PURE__ */ W("ul", {
496
+ children: /* @__PURE__ */ H("ul", {
483
497
  role: "list",
484
498
  className: "flex flex-col",
485
499
  style: h,
486
- children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ W(d, {
500
+ children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(d, {
487
501
  type: "button",
488
- className: c(Ge.item, "w-full gap-3 px-4 py-[10px] text-start"),
489
- iconBefore: /* @__PURE__ */ W("span", {
490
- className: Ge.itemIcon,
502
+ className: c(Ke.item, "w-full gap-3 px-4 py-[10px] text-start"),
503
+ iconBefore: /* @__PURE__ */ H("span", {
504
+ className: Ke.itemIcon,
491
505
  children: n
492
506
  }),
493
- iconAfter: r ? /* @__PURE__ */ W("span", {
507
+ iconAfter: r ? /* @__PURE__ */ H("span", {
494
508
  className: "ms-auto",
495
509
  children: r
496
510
  }) : null,
497
511
  textClassName: f,
498
- label: /* @__PURE__ */ W("span", {
512
+ label: /* @__PURE__ */ H("span", {
499
513
  className: u,
500
514
  children: t
501
515
  }),
@@ -503,9 +517,9 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
503
517
  }) }, e))
504
518
  })
505
519
  });
506
- }, qe = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
507
- let [s, c] = V(t), [l, u] = V(n), [d, f] = V(r), p = B(o);
508
- R(() => {
520
+ }, Je = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
521
+ let [s, c] = B(t), [l, u] = B(n), [d, f] = B(r), p = z(o);
522
+ L(() => {
509
523
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
510
524
  }, [
511
525
  o,
@@ -522,7 +536,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
522
536
  setResponseFormat: c,
523
537
  setSystemPrompt: u,
524
538
  setTemperature: f,
525
- handleSubmit: L(() => {
539
+ handleSubmit: I(() => {
526
540
  if (!m) return;
527
541
  let t = {};
528
542
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -536,17 +550,17 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
536
550
  a
537
551
  ])
538
552
  };
539
- }, Je = { label: "_label_14i7c_1" }, K = ({ features: e, responseFormat: t, systemPrompt: n, temperature: i, onResponseFormatChange: o, onSystemPromptChange: l, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
553
+ }, Ye = { label: "_label_14i7c_1" }, Xe = ({ features: e, responseFormat: t, systemPrompt: n, temperature: i, onResponseFormatChange: o, onSystemPromptChange: l, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
540
554
  "Precise",
541
555
  "Neutral",
542
556
  "Creative"
543
557
  ], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
544
- let S = s({ "--csf-label-text": x?.labelText }), C = c(b, Je.label, "gap-1");
545
- return /* @__PURE__ */ G("div", {
558
+ let S = s({ "--csf-label-text": x?.labelText }), C = c(b, Ye.label, "gap-1");
559
+ return /* @__PURE__ */ U("div", {
546
560
  className: "flex flex-col gap-4 px-6 pb-3",
547
561
  style: S,
548
562
  children: [
549
- e.responseFormat && /* @__PURE__ */ W(E, {
563
+ e.responseFormat && /* @__PURE__ */ H(E, {
550
564
  id: "response-format",
551
565
  labelProps: {
552
566
  label: d,
@@ -565,18 +579,18 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
565
579
  }],
566
580
  onChange: (e) => o(e)
567
581
  }),
568
- e.systemPrompt && /* @__PURE__ */ W(ne, {
582
+ e.systemPrompt && /* @__PURE__ */ H(ne, {
569
583
  value: n,
570
584
  placeholder: g,
571
585
  className: r,
572
- resize: M.Vertical,
586
+ resize: re.Vertical,
573
587
  labelProps: {
574
588
  className: C,
575
589
  label: h
576
590
  },
577
591
  onChange: (e) => l(e ?? "")
578
592
  }),
579
- e.temperature && /* @__PURE__ */ W(A, {
593
+ e.temperature && /* @__PURE__ */ H(A, {
580
594
  labelProps: {
581
595
  label: _,
582
596
  className: C,
@@ -592,8 +606,8 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
592
606
  })
593
607
  ]
594
608
  });
595
- }, Ye = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, 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 }) => {
596
- let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: ee, setTemperature: A, handleSubmit: te } = qe({
609
+ }, Ze = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, 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 }) => {
610
+ let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: ee, setTemperature: A, handleSubmit: te } = Je({
597
611
  isOpen: e,
598
612
  features: o,
599
613
  initialResponseFormat: s,
@@ -602,7 +616,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
602
616
  onSave: d,
603
617
  onClose: r
604
618
  });
605
- return /* @__PURE__ */ G(Te, {
619
+ return /* @__PURE__ */ U(K, {
606
620
  isOpen: e,
607
621
  title: f,
608
622
  closeLabel: i,
@@ -610,7 +624,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
610
624
  onBack: t,
611
625
  backLabel: n,
612
626
  style: a,
613
- children: [/* @__PURE__ */ W(K, {
627
+ children: [/* @__PURE__ */ H(Xe, {
614
628
  features: o,
615
629
  responseFormat: T,
616
630
  systemPrompt: E,
@@ -627,13 +641,13 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
627
641
  temperatureLabel: y,
628
642
  temperatureLabels: b,
629
643
  temperatureHint: x
630
- }), /* @__PURE__ */ W("div", {
644
+ }), /* @__PURE__ */ H("div", {
631
645
  className: c("px-6 py-4 mobile:pb-8"),
632
- children: /* @__PURE__ */ W(N, {
646
+ children: /* @__PURE__ */ H(M, {
633
647
  tooltip: C,
634
648
  hideTooltip: O || !C,
635
649
  triggerClassName: "w-full",
636
- children: /* @__PURE__ */ W(w, {
650
+ children: /* @__PURE__ */ H(w, {
637
651
  label: S,
638
652
  onClick: te,
639
653
  disabled: !O,
@@ -642,8 +656,8 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
642
656
  })
643
657
  })]
644
658
  });
645
- }, Xe = { modal: "_modal_kl0h0_1" }, Ze = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: h, temperatureHint: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = Xe.modal }) => {
646
- let { responseFormat: b, systemPrompt: x, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } = qe({
659
+ }, q = { modal: "_modal_kl0h0_1" }, Qe = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: h, temperatureHint: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = q.modal }) => {
660
+ let { responseFormat: b, systemPrompt: x, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } = Je({
647
661
  features: e,
648
662
  initialResponseFormat: t,
649
663
  initialSystemPrompt: n,
@@ -651,26 +665,26 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
651
665
  onSave: i,
652
666
  onClose: a
653
667
  });
654
- return /* @__PURE__ */ W(S, {
668
+ return /* @__PURE__ */ H(S, {
655
669
  open: !0,
656
670
  header: o,
657
671
  titleClassName: s,
658
672
  size: C.Sm,
659
673
  onClose: a,
660
674
  className: y,
661
- footer: /* @__PURE__ */ W("div", {
675
+ footer: /* @__PURE__ */ H("div", {
662
676
  className: "flex justify-end px-6 py-4",
663
- children: /* @__PURE__ */ W(N, {
677
+ children: /* @__PURE__ */ H(M, {
664
678
  tooltip: v,
665
679
  hideTooltip: E || !v,
666
- children: /* @__PURE__ */ W(w, {
680
+ children: /* @__PURE__ */ H(w, {
667
681
  label: _,
668
682
  onClick: ee,
669
683
  disabled: !E
670
684
  })
671
685
  })
672
686
  }),
673
- children: /* @__PURE__ */ W(K, {
687
+ children: /* @__PURE__ */ H(Xe, {
674
688
  features: e,
675
689
  responseFormat: b,
676
690
  systemPrompt: x,
@@ -689,10 +703,10 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
689
703
  temperatureHint: g
690
704
  })
691
705
  });
692
- }, Qe = {
706
+ }, $e = {
693
707
  icon: "_icon_1fv6z_1",
694
708
  selectedIcon: "_selectedIcon_1fv6z_5"
695
- }, $e = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: l, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: h }) => /* @__PURE__ */ W(Te, {
709
+ }, et = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: l, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: h }) => /* @__PURE__ */ H(K, {
696
710
  isOpen: e,
697
711
  title: o,
698
712
  closeLabel: i,
@@ -700,33 +714,33 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
700
714
  onBack: t,
701
715
  backLabel: n,
702
716
  style: a,
703
- children: /* @__PURE__ */ W("ul", {
717
+ children: /* @__PURE__ */ H("ul", {
704
718
  role: "menu",
705
719
  className: "flex flex-col pb-4",
706
720
  style: s({
707
721
  "--tbs-icon-text": h?.iconText,
708
722
  "--tbs-selected-icon-text": h?.selectedIconText
709
723
  }),
710
- children: l.map((e) => /* @__PURE__ */ W("li", {
724
+ children: l.map((e) => /* @__PURE__ */ H("li", {
711
725
  role: "none",
712
- children: /* @__PURE__ */ W(d, {
726
+ children: /* @__PURE__ */ H(d, {
713
727
  type: "button",
714
728
  role: "menuitemcheckbox",
715
729
  "aria-checked": e.isSelected,
716
730
  className: "w-full gap-3 px-4 py-[10px] text-start",
717
- iconBefore: /* @__PURE__ */ W("span", {
718
- className: c("flex items-center", Qe.icon),
731
+ iconBefore: /* @__PURE__ */ H("span", {
732
+ className: c("flex items-center", $e.icon),
719
733
  children: e.icon
720
734
  }),
721
- iconAfter: e.isSelected ? /* @__PURE__ */ W("span", {
722
- className: c("ms-auto", Qe.selectedIcon),
723
- children: /* @__PURE__ */ W(P, {
735
+ iconAfter: e.isSelected ? /* @__PURE__ */ H("span", {
736
+ className: c("ms-auto", $e.selectedIcon),
737
+ children: /* @__PURE__ */ H(N, {
724
738
  size: u,
725
739
  "aria-hidden": !0,
726
740
  stroke: m
727
741
  })
728
742
  }) : null,
729
- label: /* @__PURE__ */ W("span", {
743
+ label: /* @__PURE__ */ H("span", {
730
744
  className: p,
731
745
  children: e.label
732
746
  }),
@@ -734,19 +748,19 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
734
748
  })
735
749
  }, e.id))
736
750
  })
737
- }), et = {
751
+ }), tt = {
738
752
  toolIcon: "_toolIcon_ma5s5_1",
739
753
  chevronIcon: "_chevronIcon_ma5s5_5"
740
- }, tt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: o, menuCloseLabel: d, style: f, listClassName: _ = "w-[240px]", isDisabled: y = !1, chatSettings: x, extraMenuItems: S, toolsMenuItems: C = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, colors: O }) => {
741
- let k = l(), [ee, A] = V(!1), [te, j] = V(!1), [ne, M] = V(!1), [N, re] = V(null), [ie, P] = V(!1), F = z(() => s({
754
+ }, nt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: o, menuCloseLabel: d, style: f, listClassName: _ = "w-[240px]", isDisabled: y = !1, chatSettings: x, extraMenuItems: S, toolsMenuItems: C = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, colors: O }) => {
755
+ let k = l(), [ee, A] = B(!1), [te, j] = B(!1), [ne, re] = B(!1), [M, ie] = B(null), [ae, N] = B(!1), P = R(() => s({
742
756
  "--aab-tool-icon": O?.toolIcon,
743
757
  "--aab-chevron-icon": O?.chevronIcon
744
- }), [O?.toolIcon, O?.chevronIcon]), oe = C.length > 0 && w != null, I = D != null && D.length > 0, le = z(() => C.map((e) => ({
758
+ }), [O?.toolIcon, O?.chevronIcon]), se = C.length > 0 && w != null, ue = D != null && D.length > 0, F = R(() => C.map((e) => ({
745
759
  key: e.id,
746
760
  label: e.label,
747
- icon: /* @__PURE__ */ W("span", {
748
- style: F,
749
- className: c("flex items-center", et.toolIcon),
761
+ icon: /* @__PURE__ */ H("span", {
762
+ style: P,
763
+ className: c("flex items-center", tt.toolIcon),
750
764
  children: e.icon
751
765
  }),
752
766
  selectable: !0,
@@ -756,12 +770,12 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
756
770
  })), [
757
771
  C,
758
772
  w,
759
- F
760
- ]), pe = z(() => [
773
+ P
774
+ ]), me = R(() => [
761
775
  ...e == null ? [] : [{
762
776
  key: "attach",
763
777
  label: r,
764
- icon: /* @__PURE__ */ W(ce, {
778
+ icon: /* @__PURE__ */ H(le, {
765
779
  size: u,
766
780
  "aria-hidden": !0,
767
781
  stroke: m
@@ -769,71 +783,71 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
769
783
  onClick: e
770
784
  }],
771
785
  ...S ?? [],
772
- ...oe ? [{
786
+ ...se ? [{
773
787
  key: "tools",
774
788
  label: T,
775
- icon: /* @__PURE__ */ W(fe, {
789
+ icon: /* @__PURE__ */ H(pe, {
776
790
  size: u,
777
791
  "aria-hidden": !0,
778
792
  stroke: m
779
793
  }),
780
794
  onClick: k ? () => {
781
- M(!0), A(!1);
795
+ re(!0), A(!1);
782
796
  } : () => void 0,
783
- ...k ? { iconAfter: /* @__PURE__ */ W(ae, {
797
+ ...k ? { iconAfter: /* @__PURE__ */ H(oe, {
784
798
  size: u,
785
799
  stroke: m,
786
- style: F,
787
- className: c("rtl:scale-x-[-1]", et.chevronIcon),
800
+ style: P,
801
+ className: c("rtl:scale-x-[-1]", tt.chevronIcon),
788
802
  "aria-hidden": !0
789
- }) } : { children: le }
803
+ }) } : { children: F }
790
804
  }] : [],
791
805
  ...(D ?? []).map((e) => ({
792
806
  key: e.key,
793
807
  label: e.title,
794
808
  icon: e.icon,
795
809
  onClick: k ? () => {
796
- re(e.key), A(!1);
810
+ ie(e.key), A(!1);
797
811
  } : () => void 0,
798
- ...k ? { iconAfter: /* @__PURE__ */ W(ae, {
812
+ ...k ? { iconAfter: /* @__PURE__ */ H(oe, {
799
813
  size: u,
800
814
  stroke: m,
801
- style: F,
802
- className: c("rtl:scale-x-[-1]", et.chevronIcon),
815
+ style: P,
816
+ className: c("rtl:scale-x-[-1]", tt.chevronIcon),
803
817
  "aria-hidden": !0
804
818
  }) } : {
805
819
  children: [{
806
820
  key: `${e.key}-panel`,
807
821
  label: ""
808
822
  }],
809
- renderSubMenu: () => e.renderOverlay(() => P(!1))
823
+ renderSubMenu: () => e.renderOverlay(() => N(!1))
810
824
  }
811
825
  })),
812
826
  ...t == null ? [] : [{
813
827
  key: "record-voice",
814
828
  label: n,
815
- icon: /* @__PURE__ */ W(se, {
829
+ icon: /* @__PURE__ */ H(ce, {
816
830
  size: u,
817
831
  "aria-hidden": !0,
818
832
  stroke: m
819
833
  }),
820
834
  onClick: () => {
821
- A(!1), P(!1), t();
835
+ A(!1), N(!1), t();
822
836
  }
823
837
  }],
824
838
  ...x == null ? [] : [{
825
839
  key: "chat-settings",
826
840
  label: x.menuItemLabel ?? "Chat settings",
827
- icon: /* @__PURE__ */ W(de, {
841
+ icon: /* @__PURE__ */ H(fe, {
828
842
  size: u,
829
843
  "aria-hidden": !0,
830
844
  stroke: m
831
845
  }),
832
- iconAfter: k ? /* @__PURE__ */ W(ae, {
846
+ iconAfter: k ? /* @__PURE__ */ H(oe, {
833
847
  size: u,
834
848
  stroke: m,
835
- style: F,
836
- className: c("rtl:scale-x-[-1]", et.chevronIcon),
849
+ style: P,
850
+ className: c("rtl:scale-x-[-1]", tt.chevronIcon),
837
851
  "aria-hidden": !0
838
852
  }) : null,
839
853
  onClick: () => j(!0)
@@ -846,22 +860,22 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
846
860
  x,
847
861
  S,
848
862
  k,
849
- oe,
863
+ se,
850
864
  T,
851
- le,
865
+ F,
852
866
  D,
853
- F
867
+ P
854
868
  ]);
855
- if (pe.length === 0) return null;
856
- let me = /* @__PURE__ */ W(h, {
869
+ if (me.length === 0) return null;
870
+ let he = /* @__PURE__ */ H(h, {
857
871
  matchReferenceWidth: !1,
858
872
  placement: "bottom-start",
859
873
  listClassName: _,
860
- items: pe,
861
- open: I ? ie : void 0,
862
- onOpenChange: I ? P : void 0,
863
- children: /* @__PURE__ */ W(v, {
864
- icon: /* @__PURE__ */ W(ue, {
874
+ items: me,
875
+ open: ue ? ae : void 0,
876
+ onOpenChange: ue ? N : void 0,
877
+ children: /* @__PURE__ */ H(v, {
878
+ icon: /* @__PURE__ */ H(de, {
865
879
  size: p.LG,
866
880
  "aria-hidden": !0,
867
881
  stroke: m
@@ -871,9 +885,9 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
871
885
  disabled: y
872
886
  })
873
887
  });
874
- return /* @__PURE__ */ W(U, { children: k ? /* @__PURE__ */ G(U, { children: [
875
- /* @__PURE__ */ W(v, {
876
- icon: /* @__PURE__ */ W(ue, {
888
+ return /* @__PURE__ */ H(V, { children: k ? /* @__PURE__ */ U(V, { children: [
889
+ /* @__PURE__ */ H(v, {
890
+ icon: /* @__PURE__ */ H(de, {
877
891
  size: p.LG,
878
892
  "aria-hidden": !0,
879
893
  stroke: m
@@ -884,42 +898,42 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
884
898
  disabled: y,
885
899
  onClick: () => A(!0)
886
900
  }),
887
- /* @__PURE__ */ W(Ke, {
901
+ /* @__PURE__ */ H(qe, {
888
902
  isOpen: ee,
889
903
  title: o,
890
904
  closeLabel: d,
891
905
  onClose: () => A(!1),
892
906
  style: f,
893
- items: pe,
907
+ items: me,
894
908
  className: "pb-4",
895
909
  btnTextClassName: "flex-1"
896
910
  }),
897
- oe && /* @__PURE__ */ W($e, {
911
+ se && /* @__PURE__ */ H(et, {
898
912
  isOpen: ne,
899
913
  onBack: () => {
900
- M(!1), A(!0);
914
+ re(!1), A(!0);
901
915
  },
902
916
  backLabel: E,
903
- onClose: () => M(!1),
917
+ onClose: () => re(!1),
904
918
  closeLabel: d,
905
919
  style: f,
906
920
  title: T,
907
921
  items: C,
908
922
  onToolToggle: w
909
923
  }),
910
- D?.map((e) => /* @__PURE__ */ W(Te, {
911
- isOpen: N === e.key,
924
+ D?.map((e) => /* @__PURE__ */ H(K, {
925
+ isOpen: M === e.key,
912
926
  title: e.title,
913
927
  closeLabel: d,
914
928
  onBack: () => {
915
- re(null), A(!0);
929
+ ie(null), A(!0);
916
930
  },
917
931
  backLabel: e.backLabel ?? "Back",
918
- onClose: () => re(null),
932
+ onClose: () => ie(null),
919
933
  style: f,
920
- children: e.renderOverlay(() => re(null))
934
+ children: e.renderOverlay(() => ie(null))
921
935
  }, e.key)),
922
- x != null && /* @__PURE__ */ W(Ye, {
936
+ x != null && /* @__PURE__ */ H(Ze, {
923
937
  isOpen: te,
924
938
  onBack: () => {
925
939
  j(!1), A(!0);
@@ -946,7 +960,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
946
960
  saveLabel: x.saveLabel,
947
961
  saveDisabledTooltip: x.saveDisabledTooltip
948
962
  })
949
- ] }) : /* @__PURE__ */ G(U, { children: [me, x != null && te && /* @__PURE__ */ W(Ze, {
963
+ ] }) : /* @__PURE__ */ U(V, { children: [he, x != null && te && /* @__PURE__ */ H(Qe, {
950
964
  features: x.features,
951
965
  initialResponseFormat: x.responseFormat ?? a.Markdown,
952
966
  initialSystemPrompt: x.systemPrompt,
@@ -966,13 +980,13 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
966
980
  saveLabel: x.saveLabel,
967
981
  saveDisabledTooltip: x.saveDisabledTooltip
968
982
  })] }) });
969
- }, nt = {
983
+ }, rt = {
970
984
  chip: "_chip_ydmd8_1",
971
985
  chipSelected: "_chipSelected_ydmd8_9",
972
986
  chipIcon: "_chipIcon_ydmd8_16",
973
987
  chipText: "_chipText_ydmd8_19",
974
988
  chipClose: "_chipClose_ydmd8_22"
975
- }, rt = (e) => `Remove ${e}`, it = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = rt, typography: a, colors: o }) => e.length === 0 ? null : /* @__PURE__ */ W("div", {
989
+ }, it = (e) => `Remove ${e}`, at = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = it, typography: a, colors: o }) => e.length === 0 ? null : /* @__PURE__ */ H("div", {
976
990
  className: "flex flex-wrap items-center gap-2",
977
991
  style: s({
978
992
  "--ci-chip-bg": o?.chipBg,
@@ -987,34 +1001,34 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
987
1001
  "--ci-chip-close": o?.chipClose,
988
1002
  "--ci-chip-close-hover": o?.chipCloseHover
989
1003
  }),
990
- children: e.map((e) => /* @__PURE__ */ G("div", {
991
- className: c(nt.chip, e.isSelected && nt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "pe-1 ps-2" : "px-2"),
992
- children: [/* @__PURE__ */ G("button", {
1004
+ children: e.map((e) => /* @__PURE__ */ U("div", {
1005
+ className: c(rt.chip, e.isSelected && rt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "pe-1 ps-2" : "px-2"),
1006
+ children: [/* @__PURE__ */ U("button", {
993
1007
  type: "button",
994
1008
  onClick: () => t(e.id),
995
1009
  "aria-pressed": e.isSelected,
996
1010
  className: "flex min-w-0 items-center gap-1.5",
997
- children: [/* @__PURE__ */ W("span", {
998
- className: c(nt.chipIcon, "shrink-0"),
1011
+ children: [/* @__PURE__ */ H("span", {
1012
+ className: c(rt.chipIcon, "shrink-0"),
999
1013
  "aria-hidden": !0,
1000
1014
  children: e.icon
1001
- }), /* @__PURE__ */ W("span", {
1002
- className: c(nt.chipText, a?.fontClassName || "dial-small-paragraph-text", "truncate"),
1015
+ }), /* @__PURE__ */ H("span", {
1016
+ className: c(rt.chipText, a?.fontClassName || "dial-small-paragraph-text", "truncate"),
1003
1017
  children: e.label
1004
1018
  })]
1005
- }), r && /* @__PURE__ */ W("button", {
1019
+ }), r && /* @__PURE__ */ H("button", {
1006
1020
  type: "button",
1007
1021
  onClick: () => n(e.id),
1008
1022
  "aria-label": i(e.label),
1009
- className: c(nt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
1010
- children: /* @__PURE__ */ W(pe, {
1023
+ className: c(rt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
1024
+ children: /* @__PURE__ */ H(me, {
1011
1025
  size: 12,
1012
1026
  "aria-hidden": !0,
1013
1027
  stroke: m
1014
1028
  })
1015
1029
  })]
1016
1030
  }, e.id))
1017
- }), q = {
1031
+ }), J = {
1018
1032
  wrapper: "_wrapper_q1jcl_2",
1019
1033
  wrapperDisabled: "_wrapperDisabled_q1jcl_9",
1020
1034
  textarea: "_textarea_q1jcl_13",
@@ -1025,34 +1039,34 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
1025
1039
  modelSelectorName: "_modelSelectorName_q1jcl_50",
1026
1040
  modelSelectorVersion: "_modelSelectorVersion_q1jcl_53",
1027
1041
  modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_q1jcl_62"
1028
- }, at = {
1042
+ }, ot = {
1029
1043
  wrapperError: "_wrapperError_129ri_1",
1030
1044
  waveformCanvas: "_waveformCanvas_129ri_5",
1031
1045
  recordingDot: "_recordingDot_129ri_19",
1032
1046
  "recording-pulse": "_recording-pulse_129ri_1"
1033
- }, ot = 3, st = 4, ct = 200, lt = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, attachButton: a, stopLabel: o = "Stop recording", discardLabel: s = "Discard recording", processingLabel: l = "Transcribing audio…", style: u, className: d, embedded: f = !1 }) => {
1034
- let h = B(null), g = B(new Float32Array(ct)), y = B(0), b = B(0), x = e === Le.Recording, S = e === Le.Error, C = e === Le.Processing, w = L((e) => {
1047
+ }, st = 3, ct = 4, lt = 200, ut = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, attachButton: a, stopLabel: o = "Stop recording", discardLabel: s = "Discard recording", processingLabel: l = "Transcribing audio…", style: u, className: d, embedded: f = !1 }) => {
1048
+ let h = z(null), g = z(new Float32Array(lt)), y = z(0), b = z(0), x = e === Le.Recording, S = e === Le.Error, C = e === Le.Processing, w = I((e) => {
1035
1049
  let t = e.getContext("2d");
1036
1050
  if (!t) return;
1037
1051
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
1038
1052
  let { width: n, height: r } = e;
1039
1053
  t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
1040
- let i = Math.min(Math.max(1, Math.floor(n / st)), ct - 1), a = y.current, o = b.current;
1054
+ let i = Math.min(Math.max(1, Math.floor(n / ct)), lt - 1), a = y.current, o = b.current;
1041
1055
  t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
1042
1056
  for (let e = 0; e <= i; e++) {
1043
- let n = ((a - i + e) % ct + ct) % ct, o = g.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
1044
- t.fillRect(e * st, (r - c) / 2, ot, c);
1057
+ let n = ((a - i + e) % lt + lt) % lt, o = g.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
1058
+ t.fillRect(e * ct, (r - c) / 2, st, c);
1045
1059
  }
1046
1060
  t.restore();
1047
1061
  }, []);
1048
- R(() => {
1062
+ L(() => {
1049
1063
  if (!x) return;
1050
1064
  let e = h.current;
1051
1065
  if (!e) return;
1052
1066
  g.current.fill(0), y.current = 0, b.current = 0;
1053
1067
  let n, r = () => {
1054
- if (b.current += 1, b.current >= st) {
1055
- b.current -= st;
1068
+ if (b.current += 1, b.current >= ct) {
1069
+ b.current -= ct;
1056
1070
  let e = t.current;
1057
1071
  if (e) {
1058
1072
  let t = new Uint8Array(e.frequencyBinCount);
@@ -1062,7 +1076,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
1062
1076
  let r = (t[e] - 128) / 128;
1063
1077
  n += r * r;
1064
1078
  }
1065
- g.current[y.current % ct] = Math.sqrt(n / t.length), y.current++;
1079
+ g.current[y.current % lt] = Math.sqrt(n / t.length), y.current++;
1066
1080
  }
1067
1081
  }
1068
1082
  w(e), n = requestAnimationFrame(r);
@@ -1074,7 +1088,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
1074
1088
  x,
1075
1089
  t,
1076
1090
  w
1077
- ]), R(() => {
1091
+ ]), L(() => {
1078
1092
  let e = h.current;
1079
1093
  if (!e) return;
1080
1094
  let t = new ResizeObserver(() => {
@@ -1082,11 +1096,11 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
1082
1096
  });
1083
1097
  return t.observe(e), () => t.disconnect();
1084
1098
  }, [w]);
1085
- let E = /* @__PURE__ */ G("div", {
1099
+ let E = /* @__PURE__ */ U("div", {
1086
1100
  className: "flex flex-shrink-0 items-center justify-end gap-1",
1087
1101
  children: [
1088
- /* @__PURE__ */ W(v, {
1089
- icon: /* @__PURE__ */ W(pe, {
1102
+ /* @__PURE__ */ H(v, {
1103
+ icon: /* @__PURE__ */ H(me, {
1090
1104
  size: p.LG,
1091
1105
  "aria-hidden": !0,
1092
1106
  stroke: m
@@ -1095,8 +1109,8 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
1095
1109
  className: "mobile:min-h-11 mobile:min-w-11",
1096
1110
  onClick: i
1097
1111
  }),
1098
- x && /* @__PURE__ */ W(T, {
1099
- icon: /* @__PURE__ */ W(I, {
1112
+ x && /* @__PURE__ */ H(T, {
1113
+ icon: /* @__PURE__ */ H(ue, {
1100
1114
  size: p.LG,
1101
1115
  "aria-hidden": !0
1102
1116
  }),
@@ -1105,94 +1119,94 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
1105
1119
  "aria-label": o,
1106
1120
  className: "mobile:min-h-11 mobile:min-w-11"
1107
1121
  }),
1108
- C && /* @__PURE__ */ W("span", {
1122
+ C && /* @__PURE__ */ H("span", {
1109
1123
  className: "flex size-[40px] flex-shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
1110
- children: /* @__PURE__ */ W(te, {
1124
+ children: /* @__PURE__ */ H(te, {
1111
1125
  size: 20,
1112
1126
  ariaLabel: l
1113
1127
  })
1114
1128
  })
1115
1129
  ]
1116
1130
  });
1117
- return /* @__PURE__ */ G("div", {
1131
+ return /* @__PURE__ */ U("div", {
1118
1132
  className: d,
1119
- children: [/* @__PURE__ */ G("div", {
1133
+ children: [/* @__PURE__ */ U("div", {
1120
1134
  style: u,
1121
- className: c("flex w-full min-w-0 flex-col justify-center gap-2", !f && q.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && at.wrapperError),
1122
- children: [/* @__PURE__ */ G("div", {
1135
+ className: c("flex w-full min-w-0 flex-col justify-center gap-2", !f && J.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && ot.wrapperError),
1136
+ children: [/* @__PURE__ */ U("div", {
1123
1137
  className: "flex min-w-0 flex-1 items-center gap-3",
1124
- children: [x && /* @__PURE__ */ W("span", {
1125
- className: c(at.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1138
+ children: [x && /* @__PURE__ */ H("span", {
1139
+ className: c(ot.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1126
1140
  "aria-hidden": !0
1127
- }), /* @__PURE__ */ W("canvas", {
1141
+ }), /* @__PURE__ */ H("canvas", {
1128
1142
  ref: h,
1129
1143
  height: 26,
1130
1144
  "aria-hidden": !0,
1131
- className: c(at.waveformCanvas, "h-[26px] min-w-0 flex-1")
1145
+ className: c(ot.waveformCanvas, "h-[26px] min-w-0 flex-1")
1132
1146
  })]
1133
- }), /* @__PURE__ */ G("div", {
1147
+ }), /* @__PURE__ */ U("div", {
1134
1148
  className: "flex items-center justify-between gap-2",
1135
- children: [a ?? /* @__PURE__ */ W("span", { "aria-hidden": !0 }), E]
1149
+ children: [a ?? /* @__PURE__ */ H("span", { "aria-hidden": !0 }), E]
1136
1150
  })]
1137
- }), S && n && /* @__PURE__ */ W("div", {
1151
+ }), S && n && /* @__PURE__ */ H("div", {
1138
1152
  role: "alert",
1139
- children: /* @__PURE__ */ W(_, {
1153
+ children: /* @__PURE__ */ H(_, {
1140
1154
  text: n,
1141
1155
  className: "mt-1 px-1"
1142
1156
  })
1143
1157
  })]
1144
1158
  });
1145
- }, ut = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ W(T, {
1159
+ }, dt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ H(T, {
1146
1160
  "aria-label": n,
1147
1161
  onClick: () => e?.(),
1148
1162
  disabled: t,
1149
1163
  tooltipProps: r ? { tooltip: r } : void 0,
1150
- icon: /* @__PURE__ */ W(ie, {
1164
+ icon: /* @__PURE__ */ H(ae, {
1151
1165
  size: p.LG,
1152
1166
  className: "rtl:scale-x-[-1]",
1153
1167
  stroke: m
1154
1168
  })
1155
- }), dt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ W(j, {
1156
- icon: /* @__PURE__ */ W(le, {
1169
+ }), ft = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ H(j, {
1170
+ icon: /* @__PURE__ */ H(F, {
1157
1171
  size: p.LG,
1158
1172
  stroke: m
1159
1173
  }),
1160
1174
  onClick: () => e?.(),
1161
1175
  "aria-label": t
1162
- }), ft = ({ size: e = 20 }) => /* @__PURE__ */ W(k, {
1176
+ }), pt = ({ size: e = 20 }) => /* @__PURE__ */ H(k, {
1163
1177
  variant: ee.Circular,
1164
1178
  width: e,
1165
1179
  height: e,
1166
1180
  active: !0
1167
- }), pt = ({ loadingLabel: e }) => /* @__PURE__ */ G("span", {
1181
+ }), mt = ({ loadingLabel: e }) => /* @__PURE__ */ U("span", {
1168
1182
  className: "flex min-w-0 flex-1 items-center",
1169
- children: [/* @__PURE__ */ W(k, {
1183
+ children: [/* @__PURE__ */ H(k, {
1170
1184
  variant: ee.Text,
1171
1185
  width: "100%",
1172
1186
  height: 16,
1173
1187
  active: !0
1174
- }), e && /* @__PURE__ */ W("span", {
1188
+ }), e && /* @__PURE__ */ H("span", {
1175
1189
  className: "sr-only",
1176
1190
  children: e
1177
1191
  })]
1178
- }), mt = ({ loadingLabel: e }) => /* @__PURE__ */ W("div", {
1192
+ }), ht = ({ loadingLabel: e }) => /* @__PURE__ */ H("div", {
1179
1193
  role: "status",
1180
1194
  "aria-label": e,
1181
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ G("div", {
1195
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ U("div", {
1182
1196
  className: "flex h-11 items-center gap-3 px-4",
1183
1197
  "aria-hidden": "true",
1184
- children: [/* @__PURE__ */ W(ft, {}), /* @__PURE__ */ W(pt, {})]
1198
+ children: [/* @__PURE__ */ H(pt, {}), /* @__PURE__ */ H(mt, {})]
1185
1199
  }, t))
1186
- }), ht = (e) => e.displayName ?? e.id, J = (e, t) => {
1200
+ }), gt = (e) => e.displayName ?? e.id, _t = (e, t) => {
1187
1201
  let n = t.trim().toLowerCase();
1188
- return n ? e.filter((e) => ht(e).toLowerCase().includes(n)) : e;
1189
- }, Y = (e, t, r, i = 18, a) => /* @__PURE__ */ W(n, {
1202
+ return n ? e.filter((e) => gt(e).toLowerCase().includes(n)) : e;
1203
+ }, vt = (e, t, r, i = 18, a) => /* @__PURE__ */ H(n, {
1190
1204
  src: e,
1191
1205
  size: i,
1192
1206
  labels: { tooltip: a },
1193
1207
  initialsName: r
1194
- }), gt = { searchHeader: "_searchHeader_1728o_1" }, _t = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = gt.searchHeader, colors: a }) => {
1195
- let [o, l] = V(""), u = z(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = !d && !u && !!t, m = z(() => d ? /* @__PURE__ */ W(ft, { size: p.LG }) : Y(u?.iconUrl, u?.type, u?.displayName ?? u?.id ?? "", p.LG, f ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1208
+ }), yt = { searchHeader: "_searchHeader_1728o_1" }, Y = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = yt.searchHeader, colors: a }) => {
1209
+ let [o, l] = B(""), u = R(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = !d && !u && !!t, m = R(() => d ? /* @__PURE__ */ H(pt, { size: p.LG }) : vt(u?.iconUrl, u?.type, u?.displayName ?? u?.id ?? "", p.LG, f ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1196
1210
  d,
1197
1211
  u,
1198
1212
  f,
@@ -1203,11 +1217,11 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
1203
1217
  selectorAriaLabel: h ? `${r?.ariaLabel ?? "Select model"}: ${h}` : r?.ariaLabel ?? "Select model",
1204
1218
  selectedLabel: h,
1205
1219
  selectedVersion: _,
1206
- menuItems: z(() => {
1220
+ menuItems: R(() => {
1207
1221
  if (d) return Array.from({ length: 7 }, (e, t) => ({
1208
1222
  key: `__loading-${t}`,
1209
- icon: /* @__PURE__ */ W(ft, {}),
1210
- label: /* @__PURE__ */ W(pt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1223
+ icon: /* @__PURE__ */ H(pt, {}),
1224
+ label: /* @__PURE__ */ H(mt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1211
1225
  disabled: !0
1212
1226
  }));
1213
1227
  if (!e || e.length === 0) {
@@ -1218,16 +1232,17 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
1218
1232
  disabled: !0
1219
1233
  }] : [];
1220
1234
  }
1221
- return J(e, o).map((e) => ({
1235
+ return _t(e, o).map((e) => ({
1222
1236
  key: e.id,
1223
- label: /* @__PURE__ */ W(y, {
1224
- text: ht(e),
1237
+ label: /* @__PURE__ */ H(y, {
1238
+ text: gt(e),
1225
1239
  query: o,
1226
1240
  maxLines: 1
1227
1241
  }),
1228
- icon: Y(e.iconUrl, e.type, e.displayName ?? e.id),
1242
+ icon: vt(e.iconUrl, e.type, e.displayName ?? e.id),
1229
1243
  mark: b.Check,
1230
1244
  checked: e.id === t,
1245
+ className: c(G.modelMenuItem, e.id === t && G.modelMenuItemSelected),
1231
1246
  onClick: () => n?.(e.id)
1232
1247
  }));
1233
1248
  }, [
@@ -1238,10 +1253,10 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
1238
1253
  r,
1239
1254
  n
1240
1255
  ]),
1241
- menuHeader: z(() => !d && e && e.length > 0 ? /* @__PURE__ */ W("div", {
1256
+ menuHeader: R(() => !d && e && e.length > 0 ? /* @__PURE__ */ H("div", {
1242
1257
  style: s({ "--ms-search-header-bg": a?.searchHeaderBackground }),
1243
- className: c("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
1244
- children: /* @__PURE__ */ W(O, {
1258
+ className: c("sticky top-0 z-10 pb-1 pe-2 pt-2", i, G.modelMenuSearch),
1259
+ children: /* @__PURE__ */ H(O, {
1245
1260
  value: o,
1246
1261
  placeholder: r?.searchPlaceholder ?? "Search",
1247
1262
  size: g.Small,
@@ -1260,8 +1275,8 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
1260
1275
  e || l("");
1261
1276
  }
1262
1277
  };
1263
- }, vt = typeof window < "u" ? _e : R;
1264
- function yt(e) {
1278
+ }, bt = typeof window < "u" ? ve : L;
1279
+ function xt(e) {
1265
1280
  if (e !== void 0) switch (typeof e) {
1266
1281
  case "number": return e;
1267
1282
  case "string":
@@ -1269,15 +1284,15 @@ function yt(e) {
1269
1284
  break;
1270
1285
  }
1271
1286
  }
1272
- function bt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1273
- let { styleHeight: s, styleWidth: c } = z(() => ({
1274
- styleHeight: yt(o?.height),
1275
- styleWidth: yt(o?.width)
1276
- }), [o?.height, o?.width]), [l, u] = V({
1287
+ function St({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1288
+ let { styleHeight: s, styleWidth: c } = R(() => ({
1289
+ styleHeight: xt(o?.height),
1290
+ styleWidth: xt(o?.width)
1291
+ }), [o?.height, o?.width]), [l, u] = B({
1277
1292
  height: t,
1278
1293
  width: n
1279
1294
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
1280
- return vt(() => {
1295
+ return bt(() => {
1281
1296
  if (i === null || d) return;
1282
1297
  let t = new ResizeObserver((e) => {
1283
1298
  for (let t of e) {
@@ -1297,7 +1312,7 @@ function bt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1297
1312
  i,
1298
1313
  s,
1299
1314
  c
1300
- ]), z(() => ({
1315
+ ]), R(() => ({
1301
1316
  height: s ?? l.height,
1302
1317
  width: c ?? l.width
1303
1318
  }), [
@@ -1306,26 +1321,26 @@ function bt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1306
1321
  c
1307
1322
  ]);
1308
1323
  }
1309
- function xt(e) {
1310
- let t = B(() => {
1324
+ function Ct(e) {
1325
+ let t = z(() => {
1311
1326
  throw Error("Cannot call during render.");
1312
1327
  });
1313
- return vt(() => {
1328
+ return bt(() => {
1314
1329
  t.current = e;
1315
- }, [e]), L((e) => t.current?.(e), [t]);
1330
+ }, [e]), I((e) => t.current?.(e), [t]);
1316
1331
  }
1317
- var X = null;
1318
- function Z(e = !1) {
1319
- if (X === null || e) {
1332
+ var wt = null;
1333
+ function Tt(e = !1) {
1334
+ if (wt === null || e) {
1320
1335
  let e = document.createElement("div"), t = e.style;
1321
1336
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
1322
1337
  let n = document.createElement("div"), r = n.style;
1323
- 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;
1338
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? wt = "positive-descending" : (e.scrollLeft = 1, wt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), wt;
1324
1339
  }
1325
- return X;
1340
+ return wt;
1326
1341
  }
1327
- function Q({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1328
- if (t === "horizontal" && n) switch (Z()) {
1342
+ function X({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1343
+ if (t === "horizontal" && n) switch (Tt()) {
1329
1344
  case "negative": return -r;
1330
1345
  case "positive-descending":
1331
1346
  if (e) {
@@ -1336,26 +1351,26 @@ function Q({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1336
1351
  }
1337
1352
  return r;
1338
1353
  }
1339
- function $(e, t = "Assertion error") {
1354
+ function Z(e, t = "Assertion error") {
1340
1355
  if (!e) throw console.error(t), Error(t);
1341
1356
  }
1342
- function St(e, t) {
1357
+ function Q(e, t) {
1343
1358
  if (e === t) return !0;
1344
- if (!!e != !!t || ($(e !== void 0), $(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1359
+ if (!!e != !!t || (Z(e !== void 0), Z(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1345
1360
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
1346
1361
  return !0;
1347
1362
  }
1348
- function Ct({ cachedBounds: e, itemCount: t, itemSize: n }) {
1363
+ function Et({ cachedBounds: e, itemCount: t, itemSize: n }) {
1349
1364
  if (t === 0) return 0;
1350
1365
  if (typeof n == "number") return t * n;
1351
1366
  {
1352
1367
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
1353
- return $(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1368
+ return Z(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1354
1369
  }
1355
1370
  }
1356
- function wt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1371
+ function Dt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1357
1372
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
1358
- let s = Ct({
1373
+ let s = Et({
1359
1374
  cachedBounds: t,
1360
1375
  itemCount: r,
1361
1376
  itemSize: i
@@ -1367,7 +1382,7 @@ function wt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
1367
1382
  default: return a >= u && a <= l ? a : a < u ? u : l;
1368
1383
  }
1369
1384
  }
1370
- function Tt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1385
+ function Ot({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1371
1386
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
1372
1387
  for (; u < a;) {
1373
1388
  let n = e.get(u);
@@ -1386,11 +1401,11 @@ function Tt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
1386
1401
  stopIndexOverscan: l
1387
1402
  };
1388
1403
  }
1389
- function Et({ itemCount: e, itemProps: t, itemSize: n }) {
1404
+ function kt({ itemCount: e, itemProps: t, itemSize: n }) {
1390
1405
  let r = /* @__PURE__ */ new Map();
1391
1406
  return {
1392
1407
  get(i) {
1393
- for ($(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1408
+ for (Z(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1394
1409
  let e = r.size, a;
1395
1410
  switch (typeof n) {
1396
1411
  case "function":
@@ -1406,14 +1421,14 @@ function Et({ itemCount: e, itemProps: t, itemSize: n }) {
1406
1421
  });
1407
1422
  else {
1408
1423
  let t = r.get(e - 1);
1409
- $(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1424
+ Z(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1410
1425
  scrollOffset: t.scrollOffset + t.size,
1411
1426
  size: a
1412
1427
  });
1413
1428
  }
1414
1429
  }
1415
1430
  let a = r.get(i);
1416
- return $(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1431
+ return Z(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1417
1432
  },
1418
1433
  set(e, t) {
1419
1434
  r.set(e, t);
@@ -1423,8 +1438,8 @@ function Et({ itemCount: e, itemProps: t, itemSize: n }) {
1423
1438
  }
1424
1439
  };
1425
1440
  }
1426
- function Dt({ itemCount: e, itemProps: t, itemSize: n }) {
1427
- return z(() => Et({
1441
+ function At({ itemCount: e, itemProps: t, itemSize: n }) {
1442
+ return R(() => kt({
1428
1443
  itemCount: e,
1429
1444
  itemProps: t,
1430
1445
  itemSize: n
@@ -1434,11 +1449,11 @@ function Dt({ itemCount: e, itemProps: t, itemSize: n }) {
1434
1449
  n
1435
1450
  ]);
1436
1451
  }
1437
- function Ot({ containerSize: e, itemSize: t }) {
1452
+ function jt({ containerSize: e, itemSize: t }) {
1438
1453
  let n;
1439
1454
  switch (typeof t) {
1440
1455
  case "string":
1441
- $(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), $(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
1456
+ 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;
1442
1457
  break;
1443
1458
  default:
1444
1459
  n = t;
@@ -1446,21 +1461,21 @@ function Ot({ containerSize: e, itemSize: t }) {
1446
1461
  }
1447
1462
  return n;
1448
1463
  }
1449
- function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1450
- let { height: u = n, width: d = n } = bt({
1464
+ function Mt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1465
+ let { height: u = n, width: d = n } = St({
1451
1466
  defaultHeight: r === "vertical" ? n : void 0,
1452
1467
  defaultWidth: r === "horizontal" ? n : void 0,
1453
1468
  element: e,
1454
1469
  mode: r === "vertical" ? "only-height" : "only-width",
1455
1470
  style: t
1456
- }), f = B({
1471
+ }), f = z({
1457
1472
  height: 0,
1458
1473
  width: 0
1459
- }), p = r === "vertical" ? u : d, m = Ot({
1474
+ }), p = r === "vertical" ? u : d, m = jt({
1460
1475
  containerSize: p,
1461
1476
  itemSize: s
1462
1477
  });
1463
- _e(() => {
1478
+ ve(() => {
1464
1479
  if (typeof c == "function") {
1465
1480
  let e = f.current;
1466
1481
  (e.height !== u || e.width !== d) && (c({
@@ -1473,11 +1488,11 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1473
1488
  c,
1474
1489
  d
1475
1490
  ]);
1476
- let h = Dt({
1491
+ let h = At({
1477
1492
  itemCount: a,
1478
1493
  itemProps: o,
1479
1494
  itemSize: m
1480
- }), g = L((e) => h.get(e), [h]), [_, v] = V(() => Tt({
1495
+ }), g = I((e) => h.get(e), [h]), [_, v] = B(() => Ot({
1481
1496
  cachedBounds: h,
1482
1497
  containerScrollOffset: 0,
1483
1498
  containerSize: p,
@@ -1488,7 +1503,7 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1488
1503
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1489
1504
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1490
1505
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1491
- }, C = L(() => Ct({
1506
+ }, C = I(() => Et({
1492
1507
  cachedBounds: h,
1493
1508
  itemCount: a,
1494
1509
  itemSize: m
@@ -1496,9 +1511,9 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1496
1511
  h,
1497
1512
  a,
1498
1513
  m
1499
- ]), w = L((t) => Tt({
1514
+ ]), w = I((t) => Ot({
1500
1515
  cachedBounds: h,
1501
- containerScrollOffset: Q({
1516
+ containerScrollOffset: X({
1502
1517
  containerElement: e,
1503
1518
  direction: r,
1504
1519
  isRtl: i,
@@ -1516,19 +1531,19 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1516
1531
  a,
1517
1532
  l
1518
1533
  ]);
1519
- return vt(() => {
1534
+ return bt(() => {
1520
1535
  v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
1521
1536
  }, [
1522
1537
  e,
1523
1538
  r,
1524
1539
  w
1525
- ]), vt(() => {
1540
+ ]), bt(() => {
1526
1541
  if (!e) return;
1527
1542
  let t = () => {
1528
1543
  v((t) => {
1529
- let { scrollLeft: n, scrollTop: o } = e, s = Tt({
1544
+ let { scrollLeft: n, scrollTop: o } = e, s = Ot({
1530
1545
  cachedBounds: h,
1531
- containerScrollOffset: Q({
1546
+ containerScrollOffset: X({
1532
1547
  containerElement: e,
1533
1548
  direction: r,
1534
1549
  isRtl: i,
@@ -1538,7 +1553,7 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1538
1553
  itemCount: a,
1539
1554
  overscanCount: l
1540
1555
  });
1541
- return St(s, t) ? t : s;
1556
+ return Q(s, t) ? t : s;
1542
1557
  });
1543
1558
  };
1544
1559
  return e.addEventListener("scroll", t), () => {
@@ -1554,8 +1569,8 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1554
1569
  ]), {
1555
1570
  getCellBounds: g,
1556
1571
  getEstimatedSize: C,
1557
- scrollToIndex: xt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1558
- let s = wt({
1572
+ scrollToIndex: Ct(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1573
+ let s = Dt({
1559
1574
  align: t,
1560
1575
  cachedBounds: h,
1561
1576
  containerScrollOffset: n,
@@ -1565,14 +1580,14 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1565
1580
  itemSize: m
1566
1581
  });
1567
1582
  if (e) {
1568
- if (s = Q({
1583
+ if (s = X({
1569
1584
  containerElement: e,
1570
1585
  direction: r,
1571
1586
  isRtl: i,
1572
1587
  scrollOffset: s
1573
1588
  }), typeof e.scrollTo != "function") {
1574
1589
  let e = w(s);
1575
- St(_, e) || v(e);
1590
+ Q(_, e) || v(e);
1576
1591
  }
1577
1592
  return s;
1578
1593
  }
@@ -1583,30 +1598,30 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1583
1598
  stopIndexVisible: x
1584
1599
  };
1585
1600
  }
1586
- function At(e) {
1587
- return z(() => e, Object.values(e));
1601
+ function Nt(e) {
1602
+ return R(() => e, Object.values(e));
1588
1603
  }
1589
- function jt(e, t) {
1604
+ function Pt(e, t) {
1590
1605
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
1591
- return St(n, a) && St(r, o) && St(i, s);
1606
+ return Q(n, a) && Q(r, o) && Q(i, s);
1592
1607
  }
1593
- function Mt(e) {
1608
+ function Ft(e) {
1594
1609
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1595
1610
  }
1596
- var Nt = "data-react-window-index";
1597
- function Pt({ 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 }) {
1598
- let m = At(u), h = z(() => he(s, jt), [s]), [g, _] = V(null), v = Mt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = kt({
1611
+ var It = "data-react-window-index";
1612
+ function Lt({ 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 }) {
1613
+ let m = Nt(u), h = R(() => ge(s, Pt), [s]), [g, _] = B(null), v = Ft(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Mt({
1599
1614
  containerElement: g,
1600
1615
  containerStyle: f,
1601
1616
  defaultContainerSize: n,
1602
1617
  direction: "vertical",
1603
1618
  itemCount: c,
1604
1619
  itemProps: m,
1605
- itemSize: z(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1620
+ itemSize: R(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1606
1621
  onResize: i,
1607
1622
  overscanCount: o
1608
1623
  });
1609
- ge(r, () => ({
1624
+ _e(r, () => ({
1610
1625
  get element() {
1611
1626
  return g;
1612
1627
  },
@@ -1621,12 +1636,12 @@ function Pt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1621
1636
  top: r
1622
1637
  });
1623
1638
  }
1624
- }), [g, x]), vt(() => {
1639
+ }), [g, x]), bt(() => {
1625
1640
  if (!g) return;
1626
1641
  let e = Array.from(g.children).filter((e, t) => {
1627
1642
  if (e.hasAttribute("aria-hidden")) return !1;
1628
1643
  let n = `${S + t}`;
1629
- return e.setAttribute(Nt, n), !0;
1644
+ return e.setAttribute(It, n), !0;
1630
1645
  });
1631
1646
  if (v) return l.observeRowElements(e);
1632
1647
  }, [
@@ -1635,7 +1650,7 @@ function Pt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1635
1650
  l,
1636
1651
  S,
1637
1652
  w
1638
- ]), R(() => {
1653
+ ]), L(() => {
1639
1654
  S >= 0 && w >= 0 && a && a({
1640
1655
  startIndex: C,
1641
1656
  stopIndex: T
@@ -1650,11 +1665,11 @@ function Pt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1650
1665
  w,
1651
1666
  T
1652
1667
  ]);
1653
- let E = z(() => {
1668
+ let E = R(() => {
1654
1669
  let e = [];
1655
1670
  if (c > 0) for (let t = S; t <= w; t++) {
1656
1671
  let n = y(t);
1657
- e.push(/* @__PURE__ */ me(h, {
1672
+ e.push(/* @__PURE__ */ he(h, {
1658
1673
  ...m,
1659
1674
  ariaAttributes: {
1660
1675
  "aria-posinset": t + 1,
@@ -1681,7 +1696,7 @@ function Pt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1681
1696
  m,
1682
1697
  S,
1683
1698
  w
1684
- ]), D = /* @__PURE__ */ W("div", {
1699
+ ]), D = /* @__PURE__ */ H("div", {
1685
1700
  "aria-hidden": !0,
1686
1701
  style: {
1687
1702
  height: b(),
@@ -1689,7 +1704,7 @@ function Pt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1689
1704
  zIndex: -1
1690
1705
  }
1691
1706
  });
1692
- return me(d, {
1707
+ return he(d, {
1693
1708
  role: "list",
1694
1709
  ...p,
1695
1710
  className: t,
@@ -1703,35 +1718,35 @@ function Pt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1703
1718
  }
1704
1719
  }, E, e, D);
1705
1720
  }
1706
- var Ft = {
1721
+ var Rt = {
1707
1722
  divider: "_divider_1tiyp_1",
1708
1723
  item: "_item_1tiyp_5",
1709
1724
  itemIcon: "_itemIcon_1tiyp_15",
1710
1725
  checkIcon: "_checkIcon_1tiyp_19",
1711
1726
  stateLabel: "_stateLabel_1tiyp_23"
1712
- }, It = 44, Lt = 8, Rt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, onSelect: s }) => {
1713
- let l = r[e], u = Y(l.iconUrl, l.type, l.displayName ?? l.id, p.SM), f = l.id === i;
1714
- return /* @__PURE__ */ W("div", {
1727
+ }, zt = 44, Bt = 8, Vt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, onSelect: s }) => {
1728
+ let l = r[e], u = vt(l.iconUrl, l.type, l.displayName ?? l.id, p.SM), f = l.id === i;
1729
+ return /* @__PURE__ */ H("div", {
1715
1730
  style: t,
1716
1731
  ...n,
1717
- children: /* @__PURE__ */ W(d, {
1732
+ children: /* @__PURE__ */ H(d, {
1718
1733
  type: "button",
1719
1734
  "aria-current": f ? "true" : void 0,
1720
- className: c(Ft.item, "h-full w-full gap-3 px-4"),
1721
- iconBefore: /* @__PURE__ */ W("span", {
1722
- className: Ft.itemIcon,
1735
+ className: c(Rt.item, "h-full w-full gap-3 px-4"),
1736
+ iconBefore: /* @__PURE__ */ H("span", {
1737
+ className: Rt.itemIcon,
1723
1738
  children: u
1724
1739
  }),
1725
- label: /* @__PURE__ */ G("span", {
1740
+ label: /* @__PURE__ */ U("span", {
1726
1741
  className: "flex flex-1 items-center justify-between gap-2",
1727
- children: [/* @__PURE__ */ W(y, {
1742
+ children: [/* @__PURE__ */ H(y, {
1728
1743
  text: l.displayName ?? l.id,
1729
1744
  query: o,
1730
1745
  maxLines: 1,
1731
1746
  className: c(a, "min-w-0 flex-1 text-start")
1732
- }), f && /* @__PURE__ */ W(P, {
1747
+ }), f && /* @__PURE__ */ H(N, {
1733
1748
  size: p.SM,
1734
- className: Ft.checkIcon,
1749
+ className: Rt.checkIcon,
1735
1750
  "aria-hidden": !0,
1736
1751
  stroke: m
1737
1752
  })]
@@ -1739,12 +1754,12 @@ var Ft = {
1739
1754
  onClick: () => s(l.id)
1740
1755
  })
1741
1756
  });
1742
- }, zt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: _ }) => {
1743
- let [v, y] = V("");
1744
- R(() => {
1757
+ }, Ht = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: _ }) => {
1758
+ let [v, y] = B("");
1759
+ L(() => {
1745
1760
  e || y("");
1746
1761
  }, [e]);
1747
- let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? J(a, v) : [], w = (e) => {
1762
+ let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? _t(a, v) : [], w = (e) => {
1748
1763
  l(e), i();
1749
1764
  }, T = s({
1750
1765
  "--ci-sheet-divider": _?.divider,
@@ -1754,37 +1769,37 @@ var Ft = {
1754
1769
  "--ci-sheet-icon": _?.itemIcon,
1755
1770
  "--ci-check-icon": _?.checkIcon
1756
1771
  });
1757
- return /* @__PURE__ */ W(Te, {
1772
+ return /* @__PURE__ */ H(K, {
1758
1773
  isOpen: e,
1759
1774
  title: t,
1760
1775
  closeLabel: n,
1761
1776
  onClose: i,
1762
1777
  style: p,
1763
1778
  titleClassName: m,
1764
- className: "max-h-[80dvh]",
1779
+ className: c("max-h-[80dvh]", G.modelMenu),
1765
1780
  colors: _?.shell,
1766
- children: /* @__PURE__ */ G("div", {
1781
+ children: /* @__PURE__ */ U("div", {
1767
1782
  className: "contents",
1768
1783
  style: T,
1769
- children: [b && !x && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
1784
+ children: [b && !x && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
1770
1785
  className: "flex-shrink-0 px-4 py-[10px]",
1771
- children: /* @__PURE__ */ W(O, {
1786
+ children: /* @__PURE__ */ H(O, {
1772
1787
  value: v,
1773
1788
  placeholder: r,
1774
1789
  size: g.Standard,
1775
1790
  onChange: (e) => y(e ?? "")
1776
1791
  })
1777
- }), /* @__PURE__ */ W("div", { className: c(Ft.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ W(mt, { loadingLabel: u }) : S ? /* @__PURE__ */ W("div", {
1792
+ }), /* @__PURE__ */ H("div", { className: c(Rt.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ H(ht, { loadingLabel: u }) : S ? /* @__PURE__ */ H("div", {
1778
1793
  role: "list",
1779
- className: c(Ft.stateLabel, h, "px-4 py-4"),
1794
+ className: c(Rt.stateLabel, h, "px-4 py-4"),
1780
1795
  children: S
1781
- }) : /* @__PURE__ */ W(Pt, {
1796
+ }) : /* @__PURE__ */ H(Lt, {
1782
1797
  role: "list",
1783
1798
  className: "overflow-y-auto",
1784
- style: { height: Math.min(C.length, Lt) * It },
1785
- rowComponent: Rt,
1799
+ style: { height: Math.min(C.length, Bt) * zt },
1800
+ rowComponent: Vt,
1786
1801
  rowCount: C.length,
1787
- rowHeight: It,
1802
+ rowHeight: zt,
1788
1803
  rowProps: {
1789
1804
  items: C,
1790
1805
  selectedDeploymentId: o,
@@ -1795,24 +1810,24 @@ var Ft = {
1795
1810
  })]
1796
1811
  })
1797
1812
  });
1798
- }, Bt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: f, onPickerOpenChange: g }) => {
1799
- let [_, y] = V(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, selectedVersion: C, menuItems: w, menuHeader: T, onOpenChange: E } = _t({
1813
+ }, Ut = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: f, onPickerOpenChange: g }) => {
1814
+ let [_, y] = B(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, selectedVersion: C, menuItems: w, menuHeader: T, onOpenChange: E } = Y({
1800
1815
  deployments: e,
1801
1816
  selectedDeploymentId: t,
1802
1817
  onDeploymentChange: n,
1803
1818
  modelSelectorLabels: r
1804
1819
  });
1805
1820
  if (!e) return null;
1806
- let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ W(F, {
1821
+ let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ H(P, {
1807
1822
  size: p.SM,
1808
- className: q.modelSelectorCaret,
1823
+ className: J.modelSelectorCaret,
1809
1824
  "aria-hidden": !0,
1810
1825
  stroke: m
1811
1826
  });
1812
- return a ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(N, {
1827
+ if (a) return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(M, {
1813
1828
  tooltip: S,
1814
- children: /* @__PURE__ */ W(v, {
1815
- icon: /* @__PURE__ */ G("div", {
1829
+ children: /* @__PURE__ */ H(v, {
1830
+ icon: /* @__PURE__ */ U("div", {
1816
1831
  className: "flex items-center gap-1",
1817
1832
  children: [b, O]
1818
1833
  }),
@@ -1820,16 +1835,17 @@ var Ft = {
1820
1835
  onClick: () => {
1821
1836
  s || y(!0);
1822
1837
  },
1823
- className: c("w-[50px]", q.modelSelectorButton, D)
1838
+ className: c("w-[50px]", J.modelSelectorButton, D, G.modelSelectorButton)
1824
1839
  })
1825
- }), u ? /* @__PURE__ */ W(Te, {
1840
+ }), u ? /* @__PURE__ */ H(K, {
1826
1841
  isOpen: _,
1827
1842
  title: r?.ariaLabel ?? "Select model",
1828
1843
  closeLabel: r?.closeLabel ?? "Close",
1829
1844
  onClose: () => y(!1),
1830
1845
  style: l,
1846
+ className: G.modelMenu,
1831
1847
  children: u(() => y(!1))
1832
- }) : /* @__PURE__ */ W(zt, {
1848
+ }) : /* @__PURE__ */ H(Ht, {
1833
1849
  isOpen: _,
1834
1850
  title: r?.ariaLabel ?? "Select model",
1835
1851
  closeLabel: r?.closeLabel ?? "Close",
@@ -1842,67 +1858,72 @@ var Ft = {
1842
1858
  errorLabel: r?.error,
1843
1859
  emptyLabel: r?.empty,
1844
1860
  style: l
1845
- })] }) : u ? /* @__PURE__ */ W(h, {
1846
- placement: "top-end",
1847
- matchReferenceWidth: !1,
1848
- open: d,
1849
- onOpenChange: g,
1850
- trigger: [],
1851
- outsideClosable: !0,
1852
- renderOverlay: () => u(() => g?.(!1)),
1853
- listClassName: "!w-[368px] !bg-layer-raised",
1854
- children: /* @__PURE__ */ W(N, {
1855
- tooltip: C ? `${S} · ${C}` : S,
1856
- children: /* @__PURE__ */ G("button", {
1857
- type: "button",
1858
- "aria-label": x,
1859
- "aria-disabled": s || void 0,
1860
- className: c("flex min-w-0 items-center gap-1.5 rounded-full py-1.5 pe-2 ps-1.5", q.modelSelectorButton, D, s && q.modelSelectorButtonDisabled),
1861
- onClick: () => {
1862
- !i && !s && f?.();
1863
- },
1864
- children: [
1865
- b,
1866
- /* @__PURE__ */ G("span", {
1867
- className: "flex min-w-0 max-w-[180px] items-baseline gap-1",
1868
- children: [/* @__PURE__ */ W("span", {
1869
- className: c("dial-small-text max-w-[180px] shrink-0 truncate", q.modelSelectorName),
1870
- children: S
1871
- }), C && /* @__PURE__ */ W("span", {
1872
- className: c("dial-tiny-text min-w-0 truncate", q.modelSelectorVersion),
1873
- children: C
1874
- })]
1875
- }),
1876
- O
1877
- ]
1861
+ })] });
1862
+ if (u) {
1863
+ let e = C ? `${S} · ${C}` : S;
1864
+ return /* @__PURE__ */ H(h, {
1865
+ placement: "top-end",
1866
+ matchReferenceWidth: !1,
1867
+ open: d,
1868
+ onOpenChange: g,
1869
+ trigger: [],
1870
+ outsideClosable: !0,
1871
+ renderOverlay: () => u(() => g?.(!1)),
1872
+ listClassName: c("!w-[368px] !bg-layer-raised", G.modelMenu),
1873
+ children: /* @__PURE__ */ H(M, {
1874
+ tooltip: e,
1875
+ children: /* @__PURE__ */ U("button", {
1876
+ type: "button",
1877
+ "aria-label": x,
1878
+ "aria-disabled": s || void 0,
1879
+ className: c("flex min-w-0 items-center gap-1.5 rounded-full py-1.5 pe-2 ps-1.5", J.modelSelectorButton, D, s && J.modelSelectorButtonDisabled, G.modelSelectorButton),
1880
+ onClick: () => {
1881
+ !i && !s && f?.();
1882
+ },
1883
+ children: [
1884
+ b,
1885
+ /* @__PURE__ */ U("span", {
1886
+ className: "flex min-w-0 max-w-[180px] items-baseline gap-1",
1887
+ children: [/* @__PURE__ */ H("span", {
1888
+ className: c("dial-small-text max-w-[180px] shrink-0 truncate", J.modelSelectorName),
1889
+ children: S
1890
+ }), C && /* @__PURE__ */ H("span", {
1891
+ className: c("dial-tiny-text min-w-0 truncate", J.modelSelectorVersion),
1892
+ children: C
1893
+ })]
1894
+ }),
1895
+ O
1896
+ ]
1897
+ })
1878
1898
  })
1879
- })
1880
- }) : /* @__PURE__ */ W("div", {
1899
+ });
1900
+ }
1901
+ return /* @__PURE__ */ H("div", {
1881
1902
  className: c(s && D),
1882
1903
  "aria-disabled": s || void 0,
1883
- children: /* @__PURE__ */ W(h, {
1904
+ children: /* @__PURE__ */ H(h, {
1884
1905
  items: w,
1885
1906
  menuHeader: T,
1886
1907
  placement: "bottom-end",
1887
1908
  matchReferenceWidth: !1,
1888
1909
  maxDropdownHeight: o,
1889
- listClassName: "!w-[240px]",
1910
+ listClassName: c("!w-[240px]", G.modelMenu),
1890
1911
  disabled: s,
1891
1912
  onOpenChange: s ? void 0 : E,
1892
- children: /* @__PURE__ */ W(N, {
1913
+ children: /* @__PURE__ */ H(M, {
1893
1914
  tooltip: S,
1894
- children: /* @__PURE__ */ G("button", {
1915
+ children: /* @__PURE__ */ U("button", {
1895
1916
  type: "button",
1896
1917
  "aria-label": x,
1897
1918
  "aria-disabled": s || void 0,
1898
- className: c("flex items-center gap-1 rounded-full p-1.5", q.modelSelectorButton, s && q.modelSelectorButtonDisabled),
1919
+ className: c("flex items-center gap-1 rounded-full p-1.5", J.modelSelectorButton, s && J.modelSelectorButtonDisabled, G.modelSelectorButton),
1899
1920
  children: [b, O]
1900
1921
  })
1901
1922
  })
1902
1923
  })
1903
1924
  });
1904
- }, Vt = ({ message: e = "", messageRevision: t, textInsertion: n, onSend: r, onUploadAttachment: i, onStop: a, isStreaming: o = !1, onChange: d, onAttachmentsChange: f, placeholder: g = "Type a message...", ariaLabel: y, attachLabel: b = "Attach file", fileAccept: x, addMenuTitle: S = "Add", menuTitle: C = "Menu", menuCloseLabel: w = "Close", removeLabel: T, retryLabel: E, uploadingLabel: D, sendLabel: O, sendTooltip: k, stopLabel: ee, micLabel: A = "Dictate", recordVoiceLabel: te = "Record voice", stopRecordingLabel: j, discardRecordingLabel: ne, colors: M, typography: N, className: re, pendingDropFiles: ie = [], onDropFilesConsumed: P, pendingAttachments: F = [], onPendingAttachmentsConsumed: ae, pasteTextThreshold: ce = 4e3, maxMessageLength: I = 5e4, deployments: le, selectedDeploymentId: ue, onDeploymentChange: de, modelSelectorLabels: fe, initialAttachments: pe = [], hideAddButton: me = !1, hideAttachFile: he = !1, hideActionBar: ge = !1, renderFooterActions: _e, isInputDisabled: H = !1, isModelSelectorDisabled: ye = !1, isSendDisabled: be = !1, isAudioMessageSupported: Se = !1, isVoiceRecordingSupported: Ce = Se, onTranscribeAudio: we, transcribingLabel: Te, voiceErrorLabel: Ee, sendOnEnter: Oe = We.Enter, prefixAttachments: Ae = [], onRemovePrefixAttachment: je, chatSettings: Pe, toolsMenuItems: Fe, onToolToggle: ze, canRemoveTools: Be = !0, toolsMenuTitle: Ve, toolsBackLabel: He, toolsChipLabels: Ge, menuOverlays: Ke, inlineStartSlot: qe, onInlineStartRemove: Je, commandMenu: K, autoFocus: Ye = !1, messageHistory: Xe, onDialFileSystemClick: Ze, dialFileSystemLabel: Qe, validateAttachment: $e, onAttachmentClick: et, modelPickerOverlay: nt, maximumAttachmentsAmount: rt, onAttachmentsLimitExceeded: at, isAttachmentsEnabled: ot = !0, isTextAttachmentsAllowed: st = !0, usageLimitsSlot: ct, onMessageTooLong: ft }) => {
1905
- let pt = l(), [mt, ht] = V(!1), J = Me(Xe), Y = qe != null, [gt, _t] = V(null), [vt, yt] = V(0), bt = z(() => s({
1925
+ }, Wt = ({ message: e = "", messageRevision: t, textInsertion: n, onSend: r, onUploadAttachment: i, onStop: a, isStreaming: o = !1, onChange: d, onAttachmentsChange: f, placeholder: g = "Type a message...", ariaLabel: y, attachLabel: b = "Attach file", fileAccept: x, addMenuTitle: S = "Add", menuTitle: C = "Menu", menuCloseLabel: w = "Close", removeLabel: T, retryLabel: E, uploadingLabel: D, sendLabel: O, sendTooltip: k, emptyMessageTooltip: ee, stopLabel: A, micLabel: te = "Dictate", recordVoiceLabel: j = "Record voice", stopRecordingLabel: ne, discardRecordingLabel: re, colors: M, typography: ie, className: ae, pendingDropFiles: N = [], onDropFilesConsumed: P, pendingAttachments: oe = [], onPendingAttachmentsConsumed: le, pasteTextThreshold: ue = 4e3, maxMessageLength: F = 5e4, deployments: de, selectedDeploymentId: fe, onDeploymentChange: pe, modelSelectorLabels: me, initialAttachments: he = [], hideAddButton: ge = !1, hideAttachFile: _e = !1, hideActionBar: ve = !1, actionRowLayout: ye = Ge.Stacked, renderFooterActions: xe, isInputDisabled: W = !1, isModelSelectorDisabled: Ce = !1, isSendDisabled: we = !1, isAudioMessageSupported: Te = !1, isVoiceRecordingSupported: K = Te, onTranscribeAudio: Ee, transcribingLabel: Oe, voiceErrorLabel: Ae, sendOnEnter: je = We.Enter, prefixAttachments: Pe = [], onRemovePrefixAttachment: Fe, chatSettings: ze, toolsMenuItems: Be, onToolToggle: Ve, canRemoveTools: He = !0, toolsMenuTitle: Ke, toolsBackLabel: qe, toolsChipLabels: Je, menuOverlays: Ye, inlineStartSlot: Xe, onInlineStartRemove: Ze, commandMenu: q, autoFocus: Qe = !1, messageHistory: $e, onDialFileSystemClick: et, dialFileSystemLabel: tt, validateAttachment: rt, onAttachmentClick: it, modelPickerOverlay: ot, maximumAttachmentsAmount: st, onAttachmentsLimitExceeded: ct, isAttachmentsEnabled: lt = !0, isTextAttachmentsAllowed: pt = !0, usageLimitsSlot: mt, onMessageTooLong: ht }) => {
1926
+ let gt = l(), [_t, vt] = B(!1), yt = Me($e), Y = Xe != null, [bt, xt] = B(null), [St, Ct] = B(0), wt = R(() => s({
1906
1927
  "--ci-bg": M?.background,
1907
1928
  "--ci-text": M?.text,
1908
1929
  "--ci-border": M?.border,
@@ -1917,182 +1938,182 @@ var Ft = {
1917
1938
  "--ci-voice-error": M?.voiceError,
1918
1939
  "--ci-voice-waveform": M?.voiceWaveform,
1919
1940
  "--ci-voice-accent": M?.voiceAccent,
1920
- "--ci-first-line-indent": Y ? `calc(${vt}px + 4px)` : void 0
1941
+ "--ci-first-line-indent": Y ? `calc(${St}px + 4px)` : void 0
1921
1942
  }), [
1922
1943
  M,
1923
1944
  Y,
1924
- vt
1925
- ]), xt = z(() => Ze ? [{
1945
+ St
1946
+ ]), Tt = R(() => et ? [{
1926
1947
  key: "dial-fs",
1927
- label: Qe ?? "DIAL file system",
1928
- icon: /* @__PURE__ */ W(oe, {
1948
+ label: tt ?? "DIAL file system",
1949
+ icon: /* @__PURE__ */ H(se, {
1929
1950
  size: u,
1930
1951
  "aria-hidden": !0,
1931
1952
  stroke: m
1932
1953
  }),
1933
- onClick: Ze
1934
- }] : [], [Ze, Qe]), { message: X, setMessage: Z, textareaRef: Q } = Ne({
1954
+ onClick: et
1955
+ }] : [], [et, tt]), { message: X, setMessage: Z, textareaRef: Q } = Ne({
1935
1956
  messageProp: e,
1936
1957
  messageRevision: t
1937
- }), { handleUndoKeyDown: $ } = Ie({
1958
+ }), { handleUndoKeyDown: Et } = Ie({
1938
1959
  insertion: n,
1939
1960
  textareaRef: Q
1940
- }), { isMenuOpen: St, query: Ct, dismiss: wt, handleValueChange: Tt } = ke({
1941
- config: K,
1961
+ }), { isMenuOpen: Dt, query: Ot, dismiss: kt, handleValueChange: At } = ke({
1962
+ config: q,
1942
1963
  message: X
1943
- }), Et = K?.emptyQueryHint != null, Dt = Et && St && Ct === "", Ot = L((e) => {
1944
- if (K == null || (wt(), !e?.consumeQuery)) return;
1964
+ }), jt = q?.emptyQueryHint != null, Mt = jt && Dt && Ot === "", Nt = I((e) => {
1965
+ if (q == null || (kt(), !e?.consumeQuery)) return;
1945
1966
  Q.current?.focus();
1946
- let t = `${K.triggerPrefix}${Ct}`;
1967
+ let t = `${q.triggerPrefix}${Ot}`;
1947
1968
  if (!X.startsWith(t)) return;
1948
1969
  let n = X.slice(t.length);
1949
- Z(n), J.notifyChange(), d?.(n);
1970
+ Z(n), yt.notifyChange(), d?.(n);
1950
1971
  }, [
1951
- K,
1952
- wt,
1953
- Ct,
1972
+ q,
1973
+ kt,
1974
+ Ot,
1954
1975
  X,
1955
1976
  Z,
1956
- J,
1977
+ yt,
1957
1978
  d,
1958
1979
  Q
1959
1980
  ]);
1960
- R(() => {
1961
- if (gt == null) return;
1981
+ L(() => {
1982
+ if (bt == null) return;
1962
1983
  let e = new ResizeObserver((e) => {
1963
1984
  let t = e[0];
1964
- t != null && yt(t.contentRect.width);
1985
+ t != null && Ct(t.contentRect.width);
1965
1986
  });
1966
- return e.observe(gt), () => e.disconnect();
1967
- }, [gt]);
1968
- let { attachments: kt, buildAttachments: At, addAttachments: jt, resetAttachments: Mt, handleRemove: Nt, handleRetry: Pt, handleExpand: Ft, hasBlockedAttachments: It } = De({
1969
- initialAttachments: pe,
1987
+ return e.observe(bt), () => e.disconnect();
1988
+ }, [bt]);
1989
+ let { attachments: Pt, buildAttachments: Ft, addAttachments: It, resetAttachments: Lt, handleRemove: Rt, handleRetry: zt, handleExpand: Bt, hasBlockedAttachments: Vt } = De({
1990
+ initialAttachments: he,
1970
1991
  onUploadAttachment: i,
1971
1992
  onAttachmentsChange: f,
1972
- validateAttachment: $e,
1973
- pendingDropFiles: ie,
1993
+ validateAttachment: rt,
1994
+ pendingDropFiles: N,
1974
1995
  onDropFilesConsumed: P,
1975
- pendingAttachments: F,
1976
- onPendingAttachmentsConsumed: ae,
1977
- onExpandPastedText: L((e) => {
1996
+ pendingAttachments: oe,
1997
+ onPendingAttachmentsConsumed: le,
1998
+ onExpandPastedText: I((e) => {
1978
1999
  Z((t) => t ? `${t}\n${e}` : e);
1979
2000
  }, [Z]),
1980
- maximumAttachmentsAmount: rt,
1981
- baseAttachmentsAmount: Ae.length,
1982
- onAttachmentsLimitExceeded: at
1983
- }), Lt = L((e) => {
1984
- jt(At([e]));
1985
- }, [jt, At]), Rt = B(!1), zt = B(X);
1986
- zt.current = X;
1987
- let [Vt, Ht] = V({
2001
+ maximumAttachmentsAmount: st,
2002
+ baseAttachmentsAmount: Pe.length,
2003
+ onAttachmentsLimitExceeded: ct
2004
+ }), Ht = I((e) => {
2005
+ It(Ft([e]));
2006
+ }, [It, Ft]), Wt = z(!1), Gt = z(X);
2007
+ Gt.current = X;
2008
+ let [Kt, qt] = B({
1988
2009
  text: "",
1989
2010
  revision: 0
1990
- }), { state: Ut, analyserNodeRef: Wt, errorMessage: Gt, startRecording: Kt, stopRecording: qt, discardRecording: Jt } = Ue({
1991
- onAttachAudio: Lt,
1992
- onTranscribeAudio: we,
1993
- onTranscript: L((e) => {
2011
+ }), { state: Jt, analyserNodeRef: Yt, errorMessage: Xt, startRecording: Zt, stopRecording: Qt, discardRecording: $t } = Ue({
2012
+ onAttachAudio: Ht,
2013
+ onTranscribeAudio: Ee,
2014
+ onTranscript: I((e) => {
1994
2015
  let t = e.trim();
1995
2016
  if (t) {
1996
- let e = zt.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
1997
- zt.current = n, Z(n), Ht((e) => ({
2017
+ let e = Gt.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
2018
+ Gt.current = n, Z(n), qt((e) => ({
1998
2019
  text: t,
1999
2020
  revision: e.revision + 1
2000
- })), J.notifyChange(), d?.(n);
2021
+ })), yt.notifyChange(), d?.(n);
2001
2022
  }
2002
- Rt.current = !0;
2023
+ Wt.current = !0;
2003
2024
  }, [
2004
2025
  Z,
2005
- J,
2026
+ yt,
2006
2027
  d
2007
2028
  ]),
2008
- errorLabel: Ee
2009
- }), Yt = Ut === Le.Recording || Ut === Le.Processing;
2010
- R(() => {
2011
- (Ut === Le.Error || Ut === Le.Idle && Rt.current) && (Rt.current = !1, Q.current?.focus());
2012
- }, [Ut, Q]);
2013
- let Xt = B(null), Zt = B(null), Qt = ot && st, { handlePaste: $t } = xe(jt, Qt ? ce : Infinity), en = L((e) => {
2014
- if (!Qt) {
2029
+ errorLabel: Ae
2030
+ }), $ = Jt === Le.Recording || Jt === Le.Processing;
2031
+ L(() => {
2032
+ (Jt === Le.Error || Jt === Le.Idle && Wt.current) && (Wt.current = !1, Q.current?.focus());
2033
+ }, [Jt, Q]);
2034
+ let en = z(null), tn = z(null), nn = lt && pt, { handlePaste: rn } = Se(It, nn ? ue : Infinity), an = I((e) => {
2035
+ if (!nn) {
2015
2036
  let t = e.clipboardData.getData("text/plain");
2016
- t.length >= I && ft?.(t.length, I);
2037
+ t.length >= F && ht?.(t.length, F);
2017
2038
  }
2018
- $t(e);
2019
- }, [
2020
- Qt,
2021
- I,
2022
- ft,
2023
- $t
2024
- ]), tn = (X.trim().length > 0 || kt.length > 0 || Y) && !It && !be && !Yt, [nn, rn] = V([]);
2025
- R(() => {
2026
- rn([]);
2027
- }, [(Fe ?? []).map((e) => e.id).join("|")]);
2028
- let an = z(() => {
2029
- let e = Fe ?? [];
2030
- return Be ? e.filter((e) => e.isSelected || !nn.includes(e.id)) : e;
2039
+ rn(e);
2031
2040
  }, [
2032
- Fe,
2033
2041
  nn,
2034
- Be
2035
- ]), on = L((e) => {
2036
- rn((t) => t.includes(e) ? t : [...t, e]), Fe?.find((t) => t.id === e)?.isSelected && ze?.(e);
2037
- }, [Fe, ze]), sn = le === void 0 || ue != null, cn = Se && !o, ln = async () => {
2038
- if (be || Yt) return;
2039
- if (X.length >= I) {
2040
- ft?.(X.length, I);
2042
+ F,
2043
+ ht,
2044
+ rn
2045
+ ]), on = X.trim().length > 0 || Pt.length > 0 || Y, sn = on && !Vt && !we && !$, [cn, ln] = B([]);
2046
+ L(() => {
2047
+ ln([]);
2048
+ }, [(Be ?? []).map((e) => e.id).join("|")]);
2049
+ let un = R(() => {
2050
+ let e = Be ?? [];
2051
+ return He ? e.filter((e) => e.isSelected || !cn.includes(e.id)) : e;
2052
+ }, [
2053
+ Be,
2054
+ cn,
2055
+ He
2056
+ ]), dn = I((e) => {
2057
+ ln((t) => t.includes(e) ? t : [...t, e]), Be?.find((t) => t.id === e)?.isSelected && Ve?.(e);
2058
+ }, [Be, Ve]), fn = de === void 0 || fe != null, pn = Te && !o, mn = async () => {
2059
+ if (we || $) return;
2060
+ if (X.length >= F) {
2061
+ ht?.(X.length, F);
2041
2062
  return;
2042
2063
  }
2043
- let e = X, t = kt;
2044
- Z(""), J.reset();
2064
+ let e = X, t = Pt;
2065
+ Z(""), yt.reset();
2045
2066
  try {
2046
2067
  await r?.(e, t), t.forEach((e) => {
2047
2068
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
2048
- }), Mt([]);
2069
+ }), Lt([]);
2049
2070
  } catch {
2050
- Z(e), Mt(t);
2071
+ Z(e), Lt(t);
2051
2072
  }
2052
- }, un = (e) => {
2053
- if (!Yt && !$(e)) {
2054
- if (!e.nativeEvent.isComposing && !H && !o) {
2073
+ }, hn = (e) => {
2074
+ if (!$ && !Et(e)) {
2075
+ if (!e.nativeEvent.isComposing && !W && !o) {
2055
2076
  if (e.key === "ArrowUp" || e.key === "ArrowDown") {
2056
- let t = e.currentTarget.selectionStart ?? 0, n = J.navigate(e.key === "ArrowUp" ? "up" : "down", X, t);
2077
+ let t = e.currentTarget.selectionStart ?? 0, n = yt.navigate(e.key === "ArrowUp" ? "up" : "down", X, t);
2057
2078
  if (n !== null) {
2058
2079
  e.preventDefault(), Z(n);
2059
2080
  return;
2060
2081
  }
2061
2082
  }
2062
- if (e.key === "Backspace" && Y && Je != null && e.currentTarget.selectionStart === 0 && e.currentTarget.selectionEnd === 0) {
2063
- e.preventDefault(), Je();
2083
+ if (e.key === "Backspace" && Y && Ze != null && e.currentTarget.selectionStart === 0 && e.currentTarget.selectionEnd === 0) {
2084
+ e.preventDefault(), Ze();
2064
2085
  return;
2065
2086
  }
2066
2087
  }
2067
- e.key === "Enter" && (Oe === We.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !o && tn && sn && !H && ln());
2088
+ e.key === "Enter" && (je === We.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !o && sn && fn && !W && mn());
2068
2089
  }
2069
- }, dn = (e) => {
2090
+ }, gn = (e) => {
2070
2091
  let t = Array.from(e.target.files ?? []);
2071
2092
  if (t.length === 0) return;
2072
- let n = At(t);
2073
- e.target.value = "", jt(n);
2074
- }, fn = /* @__PURE__ */ W("textarea", {
2075
- className: c(q.textarea, Y && q.textareaIndented, N?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
2093
+ let n = Ft(t);
2094
+ e.target.value = "", It(n);
2095
+ }, _n = /* @__PURE__ */ H("textarea", {
2096
+ className: c(J.textarea, Y && J.textareaIndented, ie?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
2076
2097
  ref: Q,
2077
- autoFocus: Ye,
2098
+ autoFocus: Qe,
2078
2099
  value: X,
2079
2100
  onChange: (e) => {
2080
- Z(e.target.value), J.notifyChange();
2101
+ Z(e.target.value), yt.notifyChange();
2081
2102
  let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
2082
- Tt(e.target.value, t?.isComposing ?? !1, t?.inputType), d?.(e.target.value);
2103
+ At(e.target.value, t?.isComposing ?? !1, t?.inputType), d?.(e.target.value);
2083
2104
  },
2084
- onKeyDown: un,
2085
- onPaste: en,
2105
+ onKeyDown: hn,
2106
+ onPaste: an,
2086
2107
  placeholder: Y ? void 0 : g,
2087
2108
  "aria-label": y,
2088
- disabled: H,
2089
- readOnly: Yt,
2109
+ disabled: W,
2110
+ readOnly: $,
2090
2111
  rows: 1
2091
- }), pn = K == null ? fn : /* @__PURE__ */ W(h, {
2112
+ }), vn = q == null ? _n : /* @__PURE__ */ H(h, {
2092
2113
  className: "w-full",
2093
- open: St,
2114
+ open: Dt,
2094
2115
  onOpenChange: (e) => {
2095
- e || wt();
2116
+ e || kt();
2096
2117
  },
2097
2118
  placement: "top-start",
2098
2119
  trigger: [],
@@ -2100,201 +2121,206 @@ var Ft = {
2100
2121
  matchReferenceWidth: !1,
2101
2122
  outsidePressIgnoreRef: Q,
2102
2123
  renderOverlay: () => {
2103
- let e = K.renderMenu({
2104
- query: Ct,
2105
- close: Ot
2124
+ let e = q.renderMenu({
2125
+ query: Ot,
2126
+ close: Nt
2106
2127
  });
2107
- return K.menuLabel == null ? e : /* @__PURE__ */ W("div", {
2128
+ return q.menuLabel == null ? e : /* @__PURE__ */ H("div", {
2108
2129
  role: "group",
2109
- "aria-label": K.menuLabel,
2130
+ "aria-label": q.menuLabel,
2110
2131
  children: e
2111
2132
  });
2112
2133
  },
2113
- children: fn
2114
- }), mn = Y || Et ? /* @__PURE__ */ G("div", {
2134
+ children: _n
2135
+ }), yn = Y || jt ? /* @__PURE__ */ U("div", {
2115
2136
  className: "relative w-full",
2116
2137
  children: [
2117
- Y && /* @__PURE__ */ W("div", {
2118
- ref: _t,
2138
+ Y && /* @__PURE__ */ H("div", {
2139
+ ref: xt,
2119
2140
  className: "absolute start-0 top-0",
2120
- children: qe
2141
+ children: Xe
2121
2142
  }),
2122
- Dt && K != null && /* @__PURE__ */ G("span", {
2123
- className: c(q.commandHint, "pointer-events-none absolute start-[var(--ci-first-line-indent,0px)] top-0", N?.fontClassName || "dial-body-paragraph-text"),
2143
+ Mt && q != null && /* @__PURE__ */ U("span", {
2144
+ className: c(J.commandHint, "pointer-events-none absolute start-[var(--ci-first-line-indent,0px)] top-0", ie?.fontClassName || "dial-body-paragraph-text"),
2124
2145
  "aria-hidden": !0,
2125
- children: [/* @__PURE__ */ W("span", {
2146
+ children: [/* @__PURE__ */ H("span", {
2126
2147
  className: "invisible",
2127
- children: K.triggerPrefix
2128
- }), K.emptyQueryHint]
2148
+ children: q.triggerPrefix
2149
+ }), q.emptyQueryHint]
2129
2150
  }),
2130
- pn
2151
+ vn
2131
2152
  ]
2132
- }) : pn, hn = me ? void 0 : /* @__PURE__ */ W(tt, {
2133
- onAttachClick: he ? void 0 : () => Xt.current?.click(),
2153
+ }) : vn, bn = ge ? void 0 : /* @__PURE__ */ H(nt, {
2154
+ onAttachClick: _e ? void 0 : () => en.current?.click(),
2134
2155
  attachLabel: b,
2135
2156
  addMenuTitle: S,
2136
2157
  menuTitle: C,
2137
2158
  menuCloseLabel: w,
2138
- style: bt,
2139
- isDisabled: H || Yt,
2140
- chatSettings: Pe,
2141
- extraMenuItems: xt,
2142
- onRecordVoice: Ce && ot && !o && !Yt ? () => Kt(Re.Attachment) : void 0,
2143
- recordVoiceLabel: te,
2144
- toolsMenuItems: Be ? Fe : void 0,
2145
- onToolToggle: ze,
2146
- toolsMenuTitle: Ve,
2147
- toolsBackLabel: He,
2148
- menuOverlays: Ke
2159
+ style: wt,
2160
+ isDisabled: W || $,
2161
+ chatSettings: ze,
2162
+ extraMenuItems: Tt,
2163
+ onRecordVoice: K && lt && !o && !$ ? () => Zt(Re.Attachment) : void 0,
2164
+ recordVoiceLabel: j,
2165
+ toolsMenuItems: He ? Be : void 0,
2166
+ onToolToggle: Ve,
2167
+ toolsMenuTitle: Ke,
2168
+ toolsBackLabel: qe,
2169
+ menuOverlays: Ye
2170
+ }), xn = ye === Ge.Inline && !gt, Sn = bn && /* @__PURE__ */ H("div", {
2171
+ className: c("flex", G.addCluster),
2172
+ children: bn
2173
+ }), Cn = un.length > 0 && Ve != null && /* @__PURE__ */ H("div", {
2174
+ className: c("min-w-0 flex-1", G.toolsChips),
2175
+ children: /* @__PURE__ */ H(at, {
2176
+ items: un,
2177
+ onToolToggle: Ve,
2178
+ onToolDismiss: dn,
2179
+ canRemove: He,
2180
+ removeLabel: Je?.removeLabel
2181
+ })
2149
2182
  });
2150
- return /* @__PURE__ */ G("div", {
2151
- ref: Zt,
2152
- style: bt,
2153
- className: c(q.wrapper, H && q.wrapperDisabled, H && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", kt.length > 6 ? "py-4 ps-4" : "p-4", re),
2183
+ return /* @__PURE__ */ U("div", {
2184
+ ref: tn,
2185
+ style: wt,
2186
+ className: c(J.wrapper, W && J.wrapperDisabled, W && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", Pt.length > 6 ? "py-4 ps-4" : "p-4", ae, G.wrapper),
2154
2187
  children: [
2155
- (Ae.length > 0 || kt.length > 0) && /* @__PURE__ */ W(ve, {
2156
- attachments: [...Ae, ...kt],
2188
+ (Pe.length > 0 || Pt.length > 0) && /* @__PURE__ */ H(be, {
2189
+ attachments: [...Pe, ...Pt],
2157
2190
  onRemove: (e) => {
2158
- Ae.some((t) => t.id === e) ? je?.(e) : Nt(e);
2191
+ Pe.some((t) => t.id === e) ? Fe?.(e) : Rt(e);
2159
2192
  },
2160
- onRetry: Pt,
2161
- onExpand: Ft,
2193
+ onRetry: zt,
2194
+ onExpand: Bt,
2162
2195
  labels: {
2163
2196
  removeLabel: T,
2164
2197
  retryLabel: E,
2165
2198
  uploadingLabel: D
2166
2199
  },
2167
- onAttachmentClick: et == null ? void 0 : (e) => {
2168
- let t = [...Ae, ...kt].find((t) => t.id === e);
2169
- t != null && et(t);
2200
+ onAttachmentClick: it == null ? void 0 : (e) => {
2201
+ let t = [...Pe, ...Pt].find((t) => t.id === e);
2202
+ t != null && it(t);
2170
2203
  }
2171
2204
  }),
2172
- !me && /* @__PURE__ */ W("input", {
2173
- ref: Xt,
2205
+ !ge && /* @__PURE__ */ H("input", {
2206
+ ref: en,
2174
2207
  type: "file",
2175
2208
  multiple: !0,
2176
2209
  accept: x,
2177
2210
  className: "sr-only",
2178
2211
  "aria-hidden": !0,
2179
2212
  tabIndex: -1,
2180
- onChange: dn
2213
+ onChange: gn
2181
2214
  }),
2182
- Gt && /* @__PURE__ */ W(_, {
2183
- text: Gt,
2215
+ Xt && /* @__PURE__ */ H(_, {
2216
+ text: Xt,
2184
2217
  className: "min-w-0 break-words px-1"
2185
2218
  }),
2186
- Yt && /* @__PURE__ */ W(lt, {
2219
+ $ && /* @__PURE__ */ H(ut, {
2187
2220
  embedded: !0,
2188
- state: Ut,
2189
- analyserNodeRef: Wt,
2190
- errorMessage: Gt,
2191
- onStop: qt,
2192
- onDiscard: Jt,
2193
- attachButton: hn,
2194
- stopLabel: j,
2195
- discardLabel: ne,
2196
- processingLabel: Te
2221
+ state: Jt,
2222
+ analyserNodeRef: Yt,
2223
+ errorMessage: Xt,
2224
+ onStop: Qt,
2225
+ onDiscard: $t,
2226
+ attachButton: bn,
2227
+ stopLabel: ne,
2228
+ discardLabel: re,
2229
+ processingLabel: Oe
2230
+ }),
2231
+ !$ && ve && yn,
2232
+ !$ && !ve && xn && Cn && /* @__PURE__ */ H("div", {
2233
+ className: "flex",
2234
+ children: Cn
2197
2235
  }),
2198
- !Yt && ge && mn,
2199
- !Yt && !ge && /* @__PURE__ */ G("div", {
2200
- className: "flex flex-wrap items-center gap-2",
2236
+ !$ && !ve && /* @__PURE__ */ U("div", {
2237
+ className: c("flex items-center gap-2", xn ? "flex-nowrap" : "flex-wrap", G.actionRow),
2201
2238
  children: [
2202
- /* @__PURE__ */ W("div", {
2203
- className: "flex w-full min-w-0 items-center self-stretch",
2204
- children: mn
2205
- }),
2206
- hn && /* @__PURE__ */ W("div", {
2207
- className: "flex",
2208
- children: hn
2209
- }),
2210
- an.length > 0 && ze != null && /* @__PURE__ */ W("div", {
2211
- className: "min-w-0 flex-1",
2212
- children: /* @__PURE__ */ W(it, {
2213
- items: an,
2214
- onToolToggle: ze,
2215
- onToolDismiss: on,
2216
- canRemove: Be,
2217
- removeLabel: Ge?.removeLabel
2218
- })
2239
+ xn && Sn,
2240
+ /* @__PURE__ */ H("div", {
2241
+ className: c("flex min-w-0 items-center self-stretch", xn ? "flex-1" : "w-full", G.textareaWrap),
2242
+ children: yn
2219
2243
  }),
2220
- /* @__PURE__ */ W("div", {
2221
- className: "ms-auto flex flex-shrink-0 items-center gap-2",
2222
- children: _e ? _e({
2223
- canSend: tn,
2224
- onSend: ln
2225
- }) : /* @__PURE__ */ G(U, { children: [
2226
- ct,
2227
- /* @__PURE__ */ W(Bt, {
2228
- deployments: le,
2229
- selectedDeploymentId: ue,
2230
- onDeploymentChange: de,
2231
- modelSelectorLabels: fe,
2244
+ !xn && Sn,
2245
+ !xn && Cn,
2246
+ /* @__PURE__ */ H("div", {
2247
+ className: c("ms-auto flex flex-shrink-0 items-center gap-2", G.footerActions),
2248
+ children: xe ? xe({
2249
+ canSend: sn,
2250
+ onSend: mn
2251
+ }) : /* @__PURE__ */ U(V, { children: [
2252
+ mt,
2253
+ /* @__PURE__ */ H(Ut, {
2254
+ deployments: de,
2255
+ selectedDeploymentId: fe,
2256
+ onDeploymentChange: pe,
2257
+ modelSelectorLabels: me,
2232
2258
  isStreaming: o,
2233
- isMobile: pt,
2234
- isDisabled: ye,
2235
- style: bt,
2236
- modelPickerOverlay: nt,
2237
- isPickerOpen: mt,
2238
- onPickerToggle: () => ht((e) => !e),
2239
- onPickerOpenChange: ht
2259
+ isMobile: gt,
2260
+ isDisabled: Ce,
2261
+ style: wt,
2262
+ modelPickerOverlay: ot,
2263
+ isPickerOpen: _t,
2264
+ onPickerToggle: () => vt((e) => !e),
2265
+ onPickerOpenChange: vt
2240
2266
  }),
2241
- cn && /* @__PURE__ */ W(v, {
2242
- icon: /* @__PURE__ */ W(se, {
2267
+ pn && /* @__PURE__ */ H(v, {
2268
+ icon: /* @__PURE__ */ H(ce, {
2243
2269
  size: p.LG,
2244
2270
  stroke: m,
2245
2271
  "aria-hidden": !0
2246
2272
  }),
2247
- "aria-label": A,
2248
- tooltipProps: { tooltip: A },
2273
+ "aria-label": te,
2274
+ tooltipProps: { tooltip: te },
2249
2275
  className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
2250
- onClick: () => Kt(Re.Dictation),
2251
- disabled: H || o
2276
+ onClick: () => Zt(Re.Dictation),
2277
+ disabled: W || o
2252
2278
  }),
2253
- o && a ? /* @__PURE__ */ W(dt, {
2279
+ o && a ? /* @__PURE__ */ H(ft, {
2254
2280
  onStop: a,
2255
- ariaLabel: ee
2256
- }) : !o && /* @__PURE__ */ W(ut, {
2257
- onSend: ln,
2258
- isDisabled: !sn || !tn,
2281
+ ariaLabel: A
2282
+ }) : !o && /* @__PURE__ */ H(dt, {
2283
+ onSend: mn,
2284
+ isDisabled: !fn || !sn,
2259
2285
  ariaLabel: O,
2260
- sendTooltip: k
2286
+ sendTooltip: on ? k : ee ?? k
2261
2287
  })
2262
2288
  ] })
2263
2289
  })
2264
2290
  ]
2265
2291
  }),
2266
- /* @__PURE__ */ W("span", {
2292
+ /* @__PURE__ */ H("span", {
2267
2293
  className: "sr-only",
2268
2294
  role: "status",
2269
2295
  "aria-live": "polite",
2270
2296
  "aria-atomic": "true",
2271
- children: /* @__PURE__ */ W("span", { children: Vt.text }, Vt.revision)
2297
+ children: /* @__PURE__ */ H("span", { children: Kt.text }, Kt.revision)
2272
2298
  })
2273
2299
  ]
2274
2300
  });
2275
- }, Ht = {
2301
+ }, Gt = {
2276
2302
  welcome: "_welcome_1icyo_1",
2277
2303
  description: "_description_1icyo_5"
2278
- }, Ut = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, styles: i, className: a, inputClassName: o, isInputDisabled: l = !1, ...u }) => {
2304
+ }, Kt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, styles: i, className: a, inputClassName: o, isInputDisabled: l = !1, ...u }) => {
2279
2305
  let { colors: d, typography: f } = i ?? {};
2280
- return /* @__PURE__ */ G("div", {
2306
+ return /* @__PURE__ */ U("div", {
2281
2307
  style: s({
2282
2308
  "--ci-welcome-color": d?.welcomeText,
2283
2309
  "--ci-description-color": d?.descriptionText
2284
2310
  }),
2285
2311
  className: c("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", a),
2286
- children: [n && /* @__PURE__ */ G("div", {
2312
+ children: [n && /* @__PURE__ */ U("div", {
2287
2313
  className: "flex flex-col items-center gap-4 text-center",
2288
- children: [/* @__PURE__ */ W("h1", {
2289
- className: c(Ht.welcome, "m-0", f?.welcomeClassName || "dial-display2-text"),
2314
+ children: [/* @__PURE__ */ H("h1", {
2315
+ className: c(Gt.welcome, "m-0", f?.welcomeClassName || "dial-display2-text"),
2290
2316
  children: n
2291
- }), r && /* @__PURE__ */ W("p", {
2292
- className: c(Ht.description, "m-0 max-w-[540px]", f?.descriptionClassName || "dial-body-paragraph-text"),
2317
+ }), r && /* @__PURE__ */ H("p", {
2318
+ className: c(Gt.description, "m-0 max-w-[540px]", f?.descriptionClassName || "dial-body-paragraph-text"),
2293
2319
  children: r
2294
2320
  })]
2295
- }), /* @__PURE__ */ W("div", {
2321
+ }), /* @__PURE__ */ H("div", {
2296
2322
  className: c("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
2297
- children: /* @__PURE__ */ W(Vt, {
2323
+ children: /* @__PURE__ */ H(Wt, {
2298
2324
  placeholder: t,
2299
2325
  isStreaming: e,
2300
2326
  isInputDisabled: l,
@@ -2305,101 +2331,101 @@ var Ft = {
2305
2331
  })
2306
2332
  })]
2307
2333
  });
2308
- }, Wt = ({ message: e, inlineStartSlot: t, onInlineStartRemove: n, initialAttachments: r = [], onCancel: a, onSave: o, onUploadAttachment: s, cancelLabel: l = "Cancel", saveLabel: d = "Save & Submit", ariaLabel: f, removeLabel: p, retryLabel: h, uploadingLabel: g, addMenuTitle: _ = "Add", attachLabel: v = "Attach file", menuTitle: y = "Menu", menuCloseLabel: b = "Close", className: S, pendingDropFiles: C, onDropFilesConsumed: T, validateAttachment: E, isAttachmentsEnabled: D, isTextAttachmentsAllowed: O, hideAttachFile: k = !1, fileAccept: ee, maximumAttachmentsAmount: A, onAttachmentsLimitExceeded: te, onDialFileSystemClick: j, dialFileSystemLabel: ne, pendingAttachments: M, onPendingAttachmentsConsumed: N, onAttachmentClick: re, pasteTextThreshold: ie, maxMessageLength: P = 5e4, onMessageTooLong: F }) => {
2309
- let ae = B(null), [se, ce] = V([]);
2310
- R(() => {
2311
- C?.length && (ce(C), T?.());
2334
+ }, qt = ({ message: e, inlineStartSlot: t, onInlineStartRemove: n, initialAttachments: r = [], onCancel: a, onSave: o, onUploadAttachment: s, cancelLabel: l = "Cancel", saveLabel: d = "Save & Submit", ariaLabel: f, removeLabel: p, retryLabel: h, uploadingLabel: g, addMenuTitle: _ = "Add", attachLabel: v = "Attach file", menuTitle: y = "Menu", menuCloseLabel: b = "Close", className: S, pendingDropFiles: C, onDropFilesConsumed: T, validateAttachment: E, isAttachmentsEnabled: D, isTextAttachmentsAllowed: O, hideAttachFile: k = !1, fileAccept: ee, maximumAttachmentsAmount: A, onAttachmentsLimitExceeded: te, onDialFileSystemClick: j, dialFileSystemLabel: ne, pendingAttachments: re, onPendingAttachmentsConsumed: M, onAttachmentClick: ie, pasteTextThreshold: ae, maxMessageLength: N = 5e4, onMessageTooLong: P }) => {
2335
+ let oe = z(null), [ce, le] = B([]);
2336
+ L(() => {
2337
+ C?.length && (le(C), T?.());
2312
2338
  }, [C, T]);
2313
- let [I, le] = V(e ?? ""), [ue, de] = V([]), [fe, pe] = V(r), me = ue.some((e) => e.status === i.Loading || e.status === i.Error), he = (I.trim().length > 0 || ue.length > 0 || fe.length > 0) && !me, ge = (e) => {
2314
- pe((t) => t.filter((t) => t.id !== e));
2315
- }, _e = L((e, t) => {
2316
- o(e, fe, t);
2317
- }, [fe, o]), H = () => {
2318
- if (he) {
2319
- if (I.length >= P) {
2320
- F?.(I.length, P);
2339
+ let [ue, F] = B(e ?? ""), [de, fe] = B([]), [pe, me] = B(r), he = de.some((e) => e.status === i.Loading || e.status === i.Error), ge = (ue.trim().length > 0 || de.length > 0 || pe.length > 0) && !he, _e = (e) => {
2340
+ me((t) => t.filter((t) => t.id !== e));
2341
+ }, ve = I((e, t) => {
2342
+ o(e, pe, t);
2343
+ }, [pe, o]), ye = () => {
2344
+ if (ge) {
2345
+ if (ue.length >= N) {
2346
+ P?.(ue.length, N);
2321
2347
  return;
2322
2348
  }
2323
- _e(I, ue);
2349
+ ve(ue, de);
2324
2350
  }
2325
- }, ve = L(() => ce([]), []), ye = L((e) => {
2351
+ }, be = I(() => le([]), []), xe = I((e) => {
2326
2352
  let t = Array.from(e.target.files ?? []);
2327
- t.length !== 0 && (e.target.value = "", ce(t));
2328
- }, []), be = z(() => j ? [{
2353
+ t.length !== 0 && (e.target.value = "", le(t));
2354
+ }, []), W = R(() => j ? [{
2329
2355
  key: "dial-fs",
2330
2356
  label: ne ?? "DIAL file system",
2331
- icon: /* @__PURE__ */ W(oe, {
2357
+ icon: /* @__PURE__ */ H(se, {
2332
2358
  size: u,
2333
2359
  "aria-hidden": !0,
2334
2360
  stroke: m
2335
2361
  }),
2336
2362
  onClick: j
2337
2363
  }] : [], [j, ne]);
2338
- return /* @__PURE__ */ G("div", {
2364
+ return /* @__PURE__ */ U("div", {
2339
2365
  className: c("flex w-full flex-col gap-2", S),
2340
- children: [/* @__PURE__ */ W(Vt, {
2366
+ children: [/* @__PURE__ */ H(Wt, {
2341
2367
  message: e,
2342
2368
  inlineStartSlot: t,
2343
2369
  onInlineStartRemove: n,
2344
2370
  ariaLabel: f,
2345
2371
  hideActionBar: !0,
2346
- pendingDropFiles: se,
2347
- onDropFilesConsumed: ve,
2348
- onSend: _e,
2372
+ pendingDropFiles: ce,
2373
+ onDropFilesConsumed: be,
2374
+ onSend: ve,
2349
2375
  onUploadAttachment: s,
2350
- onChange: le,
2351
- onAttachmentsChange: de,
2376
+ onChange: F,
2377
+ onAttachmentsChange: fe,
2352
2378
  removeLabel: p,
2353
2379
  retryLabel: h,
2354
2380
  uploadingLabel: g,
2355
2381
  className: "max-w-full",
2356
- prefixAttachments: fe,
2357
- onRemovePrefixAttachment: ge,
2382
+ prefixAttachments: pe,
2383
+ onRemovePrefixAttachment: _e,
2358
2384
  validateAttachment: E,
2359
2385
  isAttachmentsEnabled: D,
2360
2386
  isTextAttachmentsAllowed: O,
2361
2387
  maximumAttachmentsAmount: A,
2362
2388
  onAttachmentsLimitExceeded: te,
2363
- pendingAttachments: M,
2364
- onPendingAttachmentsConsumed: N,
2365
- onAttachmentClick: re,
2366
- pasteTextThreshold: ie,
2367
- maxMessageLength: P,
2368
- onMessageTooLong: F
2369
- }), /* @__PURE__ */ G("div", {
2389
+ pendingAttachments: re,
2390
+ onPendingAttachmentsConsumed: M,
2391
+ onAttachmentClick: ie,
2392
+ pasteTextThreshold: ae,
2393
+ maxMessageLength: N,
2394
+ onMessageTooLong: P
2395
+ }), /* @__PURE__ */ U("div", {
2370
2396
  className: "flex items-center justify-between",
2371
- children: [/* @__PURE__ */ W("div", {
2397
+ children: [/* @__PURE__ */ H("div", {
2372
2398
  className: "flex",
2373
- children: !k && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("input", {
2374
- ref: ae,
2399
+ children: !k && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("input", {
2400
+ ref: oe,
2375
2401
  type: "file",
2376
2402
  multiple: !0,
2377
2403
  accept: ee,
2378
2404
  className: "sr-only",
2379
2405
  "aria-hidden": !0,
2380
2406
  tabIndex: -1,
2381
- onChange: ye
2382
- }), /* @__PURE__ */ W(tt, {
2383
- onAttachClick: () => ae.current?.click(),
2407
+ onChange: xe
2408
+ }), /* @__PURE__ */ H(nt, {
2409
+ onAttachClick: () => oe.current?.click(),
2384
2410
  attachLabel: v,
2385
2411
  addMenuTitle: _,
2386
2412
  menuTitle: y,
2387
2413
  menuCloseLabel: b,
2388
- extraMenuItems: be
2414
+ extraMenuItems: W
2389
2415
  })] })
2390
- }), /* @__PURE__ */ G("div", {
2416
+ }), /* @__PURE__ */ U("div", {
2391
2417
  className: "flex gap-2",
2392
- children: [/* @__PURE__ */ W(x, {
2418
+ children: [/* @__PURE__ */ H(x, {
2393
2419
  label: l,
2394
2420
  onClick: a
2395
- }), /* @__PURE__ */ W(w, {
2421
+ }), /* @__PURE__ */ H(w, {
2396
2422
  label: d,
2397
- onClick: H,
2398
- disabled: !he
2423
+ onClick: ye,
2424
+ disabled: !ge
2399
2425
  })]
2400
2426
  })]
2401
2427
  })]
2402
2428
  });
2403
2429
  };
2404
2430
  //#endregion
2405
- export { Te as BottomSheetShell, Ze as ChatSettingsModal, Ut as ConversationInput, Wt as EditMessageInput, Vt as Input, We as SendOnEnter };
2431
+ export { Ge as ActionRowLayout, K as BottomSheetShell, G as CONVERSATION_INPUT_CLASS, Qe as ChatSettingsModal, Kt as ConversationInput, qt as EditMessageInput, Wt as Input, We as SendOnEnter };