@automattic/agenttic-ui 0.1.10 → 0.1.12

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.
Files changed (50) hide show
  1. package/README.md +281 -387
  2. package/dist/components/AgentUI.d.ts +19 -1
  3. package/dist/components/AgentUI.d.ts.map +1 -1
  4. package/dist/components/AgentUIContainer.d.ts +8 -0
  5. package/dist/components/AgentUIContainer.d.ts.map +1 -0
  6. package/dist/components/chat/Chat.d.ts.map +1 -1
  7. package/dist/components/chat/ChatFooter.stories.d.ts.map +1 -1
  8. package/dist/components/chat/ChatHeader.d.ts +2 -1
  9. package/dist/components/chat/ChatHeader.d.ts.map +1 -1
  10. package/dist/components/chat/ChatInput.d.ts +2 -1
  11. package/dist/components/chat/ChatInput.d.ts.map +1 -1
  12. package/dist/components/chat/ChatInput.stories.d.ts +39 -1
  13. package/dist/components/chat/ChatInput.stories.d.ts.map +1 -1
  14. package/dist/components/chat/Messages.d.ts +2 -1
  15. package/dist/components/chat/Messages.d.ts.map +1 -1
  16. package/dist/components/chat/Notice.d.ts +3 -1
  17. package/dist/components/chat/Notice.d.ts.map +1 -1
  18. package/dist/components/chat/Notice.stories.d.ts +3 -0
  19. package/dist/components/chat/Notice.stories.d.ts.map +1 -1
  20. package/dist/components/chat/Suggestions.d.ts +2 -0
  21. package/dist/components/chat/Suggestions.d.ts.map +1 -1
  22. package/dist/components/composable/AgentUIConversationView.d.ts +8 -0
  23. package/dist/components/composable/AgentUIConversationView.d.ts.map +1 -0
  24. package/dist/components/composable/AgentUIFooter.d.ts +7 -0
  25. package/dist/components/composable/AgentUIFooter.d.ts.map +1 -0
  26. package/dist/components/composable/AgentUIHeader.d.ts +5 -0
  27. package/dist/components/composable/AgentUIHeader.d.ts.map +1 -0
  28. package/dist/components/composable/AgentUIInput.d.ts +9 -0
  29. package/dist/components/composable/AgentUIInput.d.ts.map +1 -0
  30. package/dist/components/composable/AgentUIMessages.d.ts +5 -0
  31. package/dist/components/composable/AgentUIMessages.d.ts.map +1 -0
  32. package/dist/components/composable/AgentUINotice.d.ts +5 -0
  33. package/dist/components/composable/AgentUINotice.d.ts.map +1 -0
  34. package/dist/components/composable/AgentUISuggestions.d.ts +6 -0
  35. package/dist/components/composable/AgentUISuggestions.d.ts.map +1 -0
  36. package/dist/components/ui/button.d.ts +2 -2
  37. package/dist/components/ui/button.d.ts.map +1 -1
  38. package/dist/components/views/CompactView.d.ts +4 -1
  39. package/dist/components/views/CompactView.d.ts.map +1 -1
  40. package/dist/context/AgentUIContext.d.ts +41 -0
  41. package/dist/context/AgentUIContext.d.ts.map +1 -0
  42. package/dist/hooks/useMultiTimeout.d.ts +11 -0
  43. package/dist/hooks/useMultiTimeout.d.ts.map +1 -0
  44. package/dist/index.css +1 -1
  45. package/dist/index.d.ts +19 -1
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +1388 -1852
  48. package/dist/types/index.d.ts +2 -0
  49. package/dist/types/index.d.ts.map +1 -1
  50. package/package.json +3 -6
package/dist/index.js CHANGED
@@ -1,1206 +1,188 @@
1
- import * as Mt from "react";
2
- import Ze, { useState as Ee, useEffect as J, useCallback as V, useRef as W, useId as dn, memo as hn, useMemo as pn } from "react";
3
- import { motion as q, AnimatePresence as Ue, useMotionValue as _t, useDragControls as vn, animate as xt } from "framer-motion";
4
- import { useRef as mn, useCallback as et, useEffect as gn } from "@wordpress/element";
5
- import { Slot as yn } from "@radix-ui/react-slot";
6
- import Cn from "react-markdown";
7
- import './index.css';var rt = { exports: {} }, je = {};
8
- /**
9
- * @license React
10
- * react-jsx-runtime.production.min.js
11
- *
12
- * Copyright (c) Facebook, Inc. and its affiliates.
13
- *
14
- * This source code is licensed under the MIT license found in the
15
- * LICENSE file in the root directory of this source tree.
16
- */
17
- var bt;
18
- function _n() {
19
- if (bt) return je;
20
- bt = 1;
21
- var n = Ze, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
22
- function u(h, f, p) {
23
- var m, g = {}, C = null, E = null;
24
- p !== void 0 && (C = "" + p), f.key !== void 0 && (C = "" + f.key), f.ref !== void 0 && (E = f.ref);
25
- for (m in f) i.call(f, m) && !s.hasOwnProperty(m) && (g[m] = f[m]);
26
- if (h && h.defaultProps) for (m in f = h.defaultProps, f) g[m] === void 0 && (g[m] = f[m]);
27
- return { $$typeof: t, type: h, key: C, ref: E, props: g, _owner: a.current };
28
- }
29
- return je.Fragment = r, je.jsx = u, je.jsxs = u, je;
1
+ import { jsxs as _, jsx as n, Fragment as Ht } from "react/jsx-runtime";
2
+ import * as te from "react";
3
+ import ee, { useState as W, useEffect as E, useCallback as p, useRef as I, createContext as Ee, useContext as Ae, useId as Se, memo as xe, useMemo as Oe } from "react";
4
+ import { motion as M, AnimatePresence as _t, useMotionValue as Mt, useDragControls as ne, animate as Pt } from "framer-motion";
5
+ import { __ as Ct } from "@wordpress/i18n";
6
+ import { Slot as Ne } from "@radix-ui/react-slot";
7
+ import Re from "streamdown";
8
+ import './index.css';function V(...e) {
9
+ return e.flat().filter(Boolean).map((t) => typeof t == "string" ? t : typeof t == "object" && !Array.isArray(t) && t !== null ? Object.entries(t).filter(([a, i]) => i).map(([a]) => a).join(" ") : "").join(" ").trim();
30
10
  }
31
- var Le = {};
32
- /**
33
- * @license React
34
- * react-jsx-runtime.development.js
35
- *
36
- * Copyright (c) Facebook, Inc. and its affiliates.
37
- *
38
- * This source code is licensed under the MIT license found in the
39
- * LICENSE file in the root directory of this source tree.
40
- */
41
- var wt;
42
- function xn() {
43
- return wt || (wt = 1, process.env.NODE_ENV !== "production" && function() {
44
- var n = Ze, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), h = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), D = Symbol.iterator, H = "@@iterator";
45
- function B(e) {
46
- if (e === null || typeof e != "object")
47
- return null;
48
- var c = D && e[D] || e[H];
49
- return typeof c == "function" ? c : null;
50
- }
51
- var M = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
- function j(e) {
53
- {
54
- for (var c = arguments.length, d = new Array(c > 1 ? c - 1 : 0), y = 1; y < c; y++)
55
- d[y - 1] = arguments[y];
56
- K("error", e, d);
57
- }
58
- }
59
- function K(e, c, d) {
60
- {
61
- var y = M.ReactDebugCurrentFrame, R = y.getStackAddendum();
62
- R !== "" && (c += "%s", d = d.concat([R]));
63
- var L = d.map(function(w) {
64
- return String(w);
65
- });
66
- L.unshift("Warning: " + c), Function.prototype.apply.call(console[e], console, L);
67
- }
68
- }
69
- var l = !1, v = !1, _ = !1, A = !1, O = !1, T;
70
- T = Symbol.for("react.module.reference");
71
- function Z(e) {
72
- return !!(typeof e == "string" || typeof e == "function" || e === i || e === s || O || e === a || e === p || e === m || A || e === E || l || v || _ || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === g || e.$$typeof === u || e.$$typeof === h || e.$$typeof === f || // This needs to include all possible module reference object
73
- // types supported by any Flight configuration anywhere since
74
- // we don't know which Flight build this will end up being used
75
- // with.
76
- e.$$typeof === T || e.getModuleId !== void 0));
77
- }
78
- function Pe(e, c, d) {
79
- var y = e.displayName;
80
- if (y)
81
- return y;
82
- var R = c.displayName || c.name || "";
83
- return R !== "" ? d + "(" + R + ")" : d;
84
- }
85
- function S(e) {
86
- return e.displayName || "Context";
87
- }
88
- function z(e) {
89
- if (e == null)
90
- return null;
91
- if (typeof e.tag == "number" && j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
92
- return e.displayName || e.name || null;
93
- if (typeof e == "string")
94
- return e;
95
- switch (e) {
96
- case i:
97
- return "Fragment";
98
- case r:
99
- return "Portal";
100
- case s:
101
- return "Profiler";
102
- case a:
103
- return "StrictMode";
104
- case p:
105
- return "Suspense";
106
- case m:
107
- return "SuspenseList";
108
- }
109
- if (typeof e == "object")
110
- switch (e.$$typeof) {
111
- case h:
112
- var c = e;
113
- return S(c) + ".Consumer";
114
- case u:
115
- var d = e;
116
- return S(d._context) + ".Provider";
117
- case f:
118
- return Pe(e, e.render, "ForwardRef");
119
- case g:
120
- var y = e.displayName || null;
121
- return y !== null ? y : z(e.type) || "Memo";
122
- case C: {
123
- var R = e, L = R._payload, w = R._init;
124
- try {
125
- return z(w(L));
126
- } catch {
127
- return null;
128
- }
129
- }
130
- }
131
- return null;
132
- }
133
- var te = Object.assign, ne = 0, Fe, de, le, Q, re, ie, he;
134
- function Me() {
135
- }
136
- Me.__reactDisabledLog = !0;
137
- function ce() {
138
- {
139
- if (ne === 0) {
140
- Fe = console.log, de = console.info, le = console.warn, Q = console.error, re = console.group, ie = console.groupCollapsed, he = console.groupEnd;
141
- var e = {
142
- configurable: !0,
143
- enumerable: !0,
144
- value: Me,
145
- writable: !0
146
- };
147
- Object.defineProperties(console, {
148
- info: e,
149
- log: e,
150
- warn: e,
151
- error: e,
152
- group: e,
153
- groupCollapsed: e,
154
- groupEnd: e
155
- });
156
- }
157
- ne++;
158
- }
159
- }
160
- function Ge() {
161
- {
162
- if (ne--, ne === 0) {
163
- var e = {
164
- configurable: !0,
165
- enumerable: !0,
166
- writable: !0
167
- };
168
- Object.defineProperties(console, {
169
- log: te({}, e, {
170
- value: Fe
171
- }),
172
- info: te({}, e, {
173
- value: de
174
- }),
175
- warn: te({}, e, {
176
- value: le
177
- }),
178
- error: te({}, e, {
179
- value: Q
180
- }),
181
- group: te({}, e, {
182
- value: re
183
- }),
184
- groupCollapsed: te({}, e, {
185
- value: ie
186
- }),
187
- groupEnd: te({}, e, {
188
- value: he
189
- })
190
- });
191
- }
192
- ne < 0 && j("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
- }
194
- }
195
- var Te = M.ReactCurrentDispatcher, pe;
196
- function ae(e, c, d) {
197
- {
198
- if (pe === void 0)
199
- try {
200
- throw Error();
201
- } catch (R) {
202
- var y = R.stack.trim().match(/\n( *(at )?)/);
203
- pe = y && y[1] || "";
204
- }
205
- return `
206
- ` + pe + e;
207
- }
208
- }
209
- var ue = !1, ve;
210
- {
211
- var me = typeof WeakMap == "function" ? WeakMap : Map;
212
- ve = new me();
213
- }
214
- function ke(e, c) {
215
- if (!e || ue)
216
- return "";
217
- {
218
- var d = ve.get(e);
219
- if (d !== void 0)
220
- return d;
221
- }
222
- var y;
223
- ue = !0;
224
- var R = Error.prepareStackTrace;
225
- Error.prepareStackTrace = void 0;
226
- var L;
227
- L = Te.current, Te.current = null, ce();
228
- try {
229
- if (c) {
230
- var w = function() {
231
- throw Error();
232
- };
233
- if (Object.defineProperty(w.prototype, "props", {
234
- set: function() {
235
- throw Error();
236
- }
237
- }), typeof Reflect == "object" && Reflect.construct) {
238
- try {
239
- Reflect.construct(w, []);
240
- } catch (Y) {
241
- y = Y;
242
- }
243
- Reflect.construct(e, [], w);
244
- } else {
245
- try {
246
- w.call();
247
- } catch (Y) {
248
- y = Y;
249
- }
250
- e.call(w.prototype);
251
- }
252
- } else {
253
- try {
254
- throw Error();
255
- } catch (Y) {
256
- y = Y;
257
- }
258
- e();
259
- }
260
- } catch (Y) {
261
- if (Y && y && typeof Y.stack == "string") {
262
- for (var b = Y.stack.split(`
263
- `), N = y.stack.split(`
264
- `), I = b.length - 1, P = N.length - 1; I >= 1 && P >= 0 && b[I] !== N[P]; )
265
- P--;
266
- for (; I >= 1 && P >= 0; I--, P--)
267
- if (b[I] !== N[P]) {
268
- if (I !== 1 || P !== 1)
269
- do
270
- if (I--, P--, P < 0 || b[I] !== N[P]) {
271
- var G = `
272
- ` + b[I].replace(" at new ", " at ");
273
- return e.displayName && G.includes("<anonymous>") && (G = G.replace("<anonymous>", e.displayName)), typeof e == "function" && ve.set(e, G), G;
274
- }
275
- while (I >= 1 && P >= 0);
276
- break;
277
- }
278
- }
279
- } finally {
280
- ue = !1, Te.current = L, Ge(), Error.prepareStackTrace = R;
281
- }
282
- var xe = e ? e.displayName || e.name : "", fe = xe ? ae(xe) : "";
283
- return typeof e == "function" && ve.set(e, fe), fe;
284
- }
285
- function Ke(e, c, d) {
286
- return ke(e, !1);
287
- }
288
- function $e(e) {
289
- var c = e.prototype;
290
- return !!(c && c.isReactComponent);
291
- }
292
- function ge(e, c, d) {
293
- if (e == null)
294
- return "";
295
- if (typeof e == "function")
296
- return ke(e, $e(e));
297
- if (typeof e == "string")
298
- return ae(e);
299
- switch (e) {
300
- case p:
301
- return ae("Suspense");
302
- case m:
303
- return ae("SuspenseList");
304
- }
305
- if (typeof e == "object")
306
- switch (e.$$typeof) {
307
- case f:
308
- return Ke(e.render);
309
- case g:
310
- return ge(e.type, c, d);
311
- case C: {
312
- var y = e, R = y._payload, L = y._init;
313
- try {
314
- return ge(L(R), c, d);
315
- } catch {
316
- }
317
- }
318
- }
319
- return "";
320
- }
321
- var x = Object.prototype.hasOwnProperty, k = {}, U = M.ReactDebugCurrentFrame;
322
- function X(e) {
323
- if (e) {
324
- var c = e._owner, d = ge(e.type, e._source, c ? c.type : null);
325
- U.setExtraStackFrame(d);
326
- } else
327
- U.setExtraStackFrame(null);
328
- }
329
- function ye(e, c, d, y, R) {
330
- {
331
- var L = Function.call.bind(x);
332
- for (var w in e)
333
- if (L(e, w)) {
334
- var b = void 0;
335
- try {
336
- if (typeof e[w] != "function") {
337
- var N = Error((y || "React class") + ": " + d + " type `" + w + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[w] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
- throw N.name = "Invariant Violation", N;
339
- }
340
- b = e[w](c, w, y, d, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
- } catch (I) {
342
- b = I;
343
- }
344
- b && !(b instanceof Error) && (X(R), j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", y || "React class", d, w, typeof b), X(null)), b instanceof Error && !(b.message in k) && (k[b.message] = !0, X(R), j("Failed %s type: %s", d, b.message), X(null));
345
- }
346
- }
347
- }
348
- var He = Array.isArray;
349
- function oe(e) {
350
- return He(e);
351
- }
352
- function Ce(e) {
353
- {
354
- var c = typeof Symbol == "function" && Symbol.toStringTag, d = c && e[Symbol.toStringTag] || e.constructor.name || "Object";
355
- return d;
356
- }
357
- }
358
- function Xe(e) {
359
- try {
360
- return Ne(e), !1;
361
- } catch {
362
- return !0;
363
- }
364
- }
365
- function Ne(e) {
366
- return "" + e;
367
- }
368
- function ct(e) {
369
- if (Xe(e))
370
- return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ce(e)), Ne(e);
371
- }
372
- var ut = M.ReactCurrentOwner, Gt = {
373
- key: !0,
374
- ref: !0,
375
- __self: !0,
376
- __source: !0
377
- }, ft, dt;
378
- function Kt(e) {
379
- if (x.call(e, "ref")) {
380
- var c = Object.getOwnPropertyDescriptor(e, "ref").get;
381
- if (c && c.isReactWarning)
382
- return !1;
383
- }
384
- return e.ref !== void 0;
385
- }
386
- function Xt(e) {
387
- if (x.call(e, "key")) {
388
- var c = Object.getOwnPropertyDescriptor(e, "key").get;
389
- if (c && c.isReactWarning)
390
- return !1;
391
- }
392
- return e.key !== void 0;
393
- }
394
- function Jt(e, c) {
395
- typeof e.ref == "string" && ut.current;
396
- }
397
- function qt(e, c) {
398
- {
399
- var d = function() {
400
- ft || (ft = !0, j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
401
- };
402
- d.isReactWarning = !0, Object.defineProperty(e, "key", {
403
- get: d,
404
- configurable: !0
405
- });
406
- }
407
- }
408
- function zt(e, c) {
409
- {
410
- var d = function() {
411
- dt || (dt = !0, j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
412
- };
413
- d.isReactWarning = !0, Object.defineProperty(e, "ref", {
414
- get: d,
415
- configurable: !0
416
- });
417
- }
418
- }
419
- var Qt = function(e, c, d, y, R, L, w) {
420
- var b = {
421
- // This tag allows us to uniquely identify this as a React Element
422
- $$typeof: t,
423
- // Built-in properties that belong on the element
424
- type: e,
425
- key: c,
426
- ref: d,
427
- props: w,
428
- // Record the component responsible for creating this element.
429
- _owner: L
430
- };
431
- return b._store = {}, Object.defineProperty(b._store, "validated", {
432
- configurable: !1,
433
- enumerable: !1,
434
- writable: !0,
435
- value: !1
436
- }), Object.defineProperty(b, "_self", {
437
- configurable: !1,
438
- enumerable: !1,
439
- writable: !1,
440
- value: y
441
- }), Object.defineProperty(b, "_source", {
442
- configurable: !1,
443
- enumerable: !1,
444
- writable: !1,
445
- value: R
446
- }), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
447
- };
448
- function en(e, c, d, y, R) {
449
- {
450
- var L, w = {}, b = null, N = null;
451
- d !== void 0 && (ct(d), b = "" + d), Xt(c) && (ct(c.key), b = "" + c.key), Kt(c) && (N = c.ref, Jt(c, R));
452
- for (L in c)
453
- x.call(c, L) && !Gt.hasOwnProperty(L) && (w[L] = c[L]);
454
- if (e && e.defaultProps) {
455
- var I = e.defaultProps;
456
- for (L in I)
457
- w[L] === void 0 && (w[L] = I[L]);
458
- }
459
- if (b || N) {
460
- var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
461
- b && qt(w, P), N && zt(w, P);
462
- }
463
- return Qt(e, b, N, R, y, ut.current, w);
464
- }
465
- }
466
- var Je = M.ReactCurrentOwner, ht = M.ReactDebugCurrentFrame;
467
- function _e(e) {
468
- if (e) {
469
- var c = e._owner, d = ge(e.type, e._source, c ? c.type : null);
470
- ht.setExtraStackFrame(d);
471
- } else
472
- ht.setExtraStackFrame(null);
473
- }
474
- var qe;
475
- qe = !1;
476
- function ze(e) {
477
- return typeof e == "object" && e !== null && e.$$typeof === t;
478
- }
479
- function pt() {
480
- {
481
- if (Je.current) {
482
- var e = z(Je.current.type);
483
- if (e)
484
- return `
485
-
486
- Check the render method of \`` + e + "`.";
487
- }
488
- return "";
489
- }
490
- }
491
- function tn(e) {
492
- return "";
493
- }
494
- var vt = {};
495
- function nn(e) {
496
- {
497
- var c = pt();
498
- if (!c) {
499
- var d = typeof e == "string" ? e : e.displayName || e.name;
500
- d && (c = `
501
-
502
- Check the top-level render call using <` + d + ">.");
503
- }
504
- return c;
505
- }
506
- }
507
- function mt(e, c) {
508
- {
509
- if (!e._store || e._store.validated || e.key != null)
510
- return;
511
- e._store.validated = !0;
512
- var d = nn(c);
513
- if (vt[d])
514
- return;
515
- vt[d] = !0;
516
- var y = "";
517
- e && e._owner && e._owner !== Je.current && (y = " It was passed a child from " + z(e._owner.type) + "."), _e(e), j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', d, y), _e(null);
518
- }
519
- }
520
- function gt(e, c) {
521
- {
522
- if (typeof e != "object")
523
- return;
524
- if (oe(e))
525
- for (var d = 0; d < e.length; d++) {
526
- var y = e[d];
527
- ze(y) && mt(y, c);
528
- }
529
- else if (ze(e))
530
- e._store && (e._store.validated = !0);
531
- else if (e) {
532
- var R = B(e);
533
- if (typeof R == "function" && R !== e.entries)
534
- for (var L = R.call(e), w; !(w = L.next()).done; )
535
- ze(w.value) && mt(w.value, c);
536
- }
537
- }
538
- }
539
- function rn(e) {
540
- {
541
- var c = e.type;
542
- if (c == null || typeof c == "string")
543
- return;
544
- var d;
545
- if (typeof c == "function")
546
- d = c.propTypes;
547
- else if (typeof c == "object" && (c.$$typeof === f || // Note: Memo only checks outer props here.
548
- // Inner props are checked in the reconciler.
549
- c.$$typeof === g))
550
- d = c.propTypes;
551
- else
552
- return;
553
- if (d) {
554
- var y = z(c);
555
- ye(d, e.props, "prop", y, e);
556
- } else if (c.PropTypes !== void 0 && !qe) {
557
- qe = !0;
558
- var R = z(c);
559
- j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", R || "Unknown");
560
- }
561
- typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
562
- }
563
- }
564
- function an(e) {
565
- {
566
- for (var c = Object.keys(e.props), d = 0; d < c.length; d++) {
567
- var y = c[d];
568
- if (y !== "children" && y !== "key") {
569
- _e(e), j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", y), _e(null);
570
- break;
571
- }
572
- }
573
- e.ref !== null && (_e(e), j("Invalid attribute `ref` supplied to `React.Fragment`."), _e(null));
574
- }
575
- }
576
- var yt = {};
577
- function Ct(e, c, d, y, R, L) {
578
- {
579
- var w = Z(e);
580
- if (!w) {
581
- var b = "";
582
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (b += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
583
- var N = tn();
584
- N ? b += N : b += pt();
585
- var I;
586
- e === null ? I = "null" : oe(e) ? I = "array" : e !== void 0 && e.$$typeof === t ? (I = "<" + (z(e.type) || "Unknown") + " />", b = " Did you accidentally export a JSX literal instead of a component?") : I = typeof e, j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", I, b);
587
- }
588
- var P = en(e, c, d, R, L);
589
- if (P == null)
590
- return P;
591
- if (w) {
592
- var G = c.children;
593
- if (G !== void 0)
594
- if (y)
595
- if (oe(G)) {
596
- for (var xe = 0; xe < G.length; xe++)
597
- gt(G[xe], e);
598
- Object.freeze && Object.freeze(G);
599
- } else
600
- j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
601
- else
602
- gt(G, e);
603
- }
604
- if (x.call(c, "key")) {
605
- var fe = z(e), Y = Object.keys(c).filter(function(fn) {
606
- return fn !== "key";
607
- }), Qe = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
608
- if (!yt[fe + Qe]) {
609
- var un = Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}";
610
- j(`A props object containing a "key" prop is being spread into JSX:
611
- let props = %s;
612
- <%s {...props} />
613
- React keys must be passed directly to JSX without using spread:
614
- let props = %s;
615
- <%s key={someKey} {...props} />`, Qe, fe, un, fe), yt[fe + Qe] = !0;
616
- }
617
- }
618
- return e === i ? an(P) : rn(P), P;
619
- }
620
- }
621
- function on(e, c, d) {
622
- return Ct(e, c, d, !0);
623
- }
624
- function sn(e, c, d) {
625
- return Ct(e, c, d, !1);
626
- }
627
- var ln = sn, cn = on;
628
- Le.Fragment = i, Le.jsx = ln, Le.jsxs = cn;
629
- }()), Le;
630
- }
631
- process.env.NODE_ENV === "production" ? rt.exports = _n() : rt.exports = xn();
632
- var o = rt.exports;
633
- function se(...n) {
634
- return n.flat().filter(Boolean).map((t) => typeof t == "string" ? t : typeof t == "object" && !Array.isArray(t) && t !== null ? Object.entries(t).filter(([r, i]) => i).map(([r]) => r).join(" ") : "").join(" ").trim();
635
- }
636
- function bn(n) {
637
- const t = n || "collapsed", [r, i] = Ee(t);
638
- J(() => {
639
- n !== void 0 && i(n);
640
- }, [n]);
641
- const a = r !== "collapsed" && r !== "compact", s = V(() => {
11
+ function oe(e) {
12
+ const t = e || "collapsed", [a, i] = W(t);
13
+ E(() => {
14
+ e !== void 0 && i(e);
15
+ }, [e]);
16
+ const s = a !== "collapsed" && a !== "compact", o = p(() => {
642
17
  i("expanded");
643
- }, []), u = V(() => {
18
+ }, []), r = p(() => {
644
19
  i(t);
645
- }, [t]), h = V(() => {
20
+ }, [t]), g = p(() => {
646
21
  i(
647
- (f) => f === "collapsed" ? "compact" : "collapsed"
22
+ (u) => u === "collapsed" ? "compact" : "collapsed"
648
23
  );
649
24
  }, []);
650
25
  return {
651
- state: r,
26
+ state: a,
652
27
  initialState: t,
653
28
  setState: i,
654
- isOpen: a,
655
- open: s,
656
- close: u,
657
- toggle: h
29
+ isOpen: s,
30
+ open: o,
31
+ close: r,
32
+ toggle: g
658
33
  };
659
34
  }
660
- function wn({
661
- value: n,
35
+ function ae({
36
+ value: e,
662
37
  setValue: t,
663
- onSubmit: r,
38
+ onSubmit: a,
664
39
  isProcessing: i
665
40
  }) {
666
- const a = mn(null), s = et(() => {
667
- t(""), a.current && (a.current.style.height = "auto", setTimeout(() => {
668
- var f;
669
- (f = a.current) == null || f.focus();
41
+ const s = I(null), o = p(() => {
42
+ t(""), s.current && (s.current.style.height = "auto", setTimeout(() => {
43
+ var u;
44
+ (u = s.current) == null || u.focus();
670
45
  }, 100));
671
- }, [t]), u = et(() => {
672
- const f = a.current;
673
- if (!f)
46
+ }, [t]), r = p(() => {
47
+ const u = s.current;
48
+ if (!u)
674
49
  return;
675
- f.style.height = "auto";
676
- const p = f.scrollHeight, m = 40, g = 200;
677
- f.style.height = `${Math.min(
678
- Math.max(p, m),
679
- g
50
+ u.style.height = "auto";
51
+ const m = u.scrollHeight, f = 40, v = 200;
52
+ u.style.height = `${Math.min(
53
+ Math.max(m, f),
54
+ v
680
55
  )}px`;
681
- }, []), h = et(
682
- (f) => {
683
- f.key === "Enter" && !f.shiftKey && !i && n.trim() && (f.preventDefault(), r(n.trim()), s());
56
+ }, []), g = p(
57
+ (u) => {
58
+ u.key === "Enter" && !u.shiftKey && !i && e.trim() && (u.preventDefault(), a(e.trim()), o());
684
59
  },
685
- [n, i, r, s]
60
+ [e, i, a, o]
686
61
  );
687
- return gn(() => {
688
- u();
689
- }, [n, u]), {
690
- value: n,
62
+ return E(() => {
63
+ r();
64
+ }, [e, r]), {
65
+ value: e,
691
66
  setValue: t,
692
- clear: s,
693
- textareaRef: a,
694
- handleKeyDown: h,
695
- adjustHeight: u
696
- };
697
- }
698
- var it, kt, Ie, $t;
699
- it = {
700
- "(": 9,
701
- "!": 8,
702
- "*": 7,
703
- "/": 7,
704
- "%": 7,
705
- "+": 6,
706
- "-": 6,
707
- "<": 5,
708
- "<=": 5,
709
- ">": 5,
710
- ">=": 5,
711
- "==": 4,
712
- "!=": 4,
713
- "&&": 3,
714
- "||": 2,
715
- "?": 1,
716
- "?:": 1
717
- };
718
- kt = ["(", "?"];
719
- Ie = {
720
- ")": ["("],
721
- ":": ["?", "?:"]
722
- };
723
- $t = /<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;
724
- function En(n) {
725
- for (var t = [], r = [], i, a, s, u; i = n.match($t); ) {
726
- for (a = i[0], s = n.substr(0, i.index).trim(), s && t.push(s); u = r.pop(); ) {
727
- if (Ie[a]) {
728
- if (Ie[a][0] === u) {
729
- a = Ie[a][1] || a;
730
- break;
731
- }
732
- } else if (kt.indexOf(u) >= 0 || it[u] < it[a]) {
733
- r.push(u);
734
- break;
735
- }
736
- t.push(u);
737
- }
738
- Ie[a] || r.push(a), n = n.substr(i.index + a.length);
739
- }
740
- return n = n.trim(), n && t.push(n), t.concat(r.reverse());
741
- }
742
- var Rn = {
743
- "!": function(n) {
744
- return !n;
745
- },
746
- "*": function(n, t) {
747
- return n * t;
748
- },
749
- "/": function(n, t) {
750
- return n / t;
751
- },
752
- "%": function(n, t) {
753
- return n % t;
754
- },
755
- "+": function(n, t) {
756
- return n + t;
757
- },
758
- "-": function(n, t) {
759
- return n - t;
760
- },
761
- "<": function(n, t) {
762
- return n < t;
763
- },
764
- "<=": function(n, t) {
765
- return n <= t;
766
- },
767
- ">": function(n, t) {
768
- return n > t;
769
- },
770
- ">=": function(n, t) {
771
- return n >= t;
772
- },
773
- "==": function(n, t) {
774
- return n === t;
775
- },
776
- "!=": function(n, t) {
777
- return n !== t;
778
- },
779
- "&&": function(n, t) {
780
- return n && t;
781
- },
782
- "||": function(n, t) {
783
- return n || t;
784
- },
785
- "?:": function(n, t, r) {
786
- if (n)
787
- throw t;
788
- return r;
789
- }
790
- };
791
- function Tn(n, t) {
792
- var r = [], i, a, s, u, h, f;
793
- for (i = 0; i < n.length; i++) {
794
- if (h = n[i], u = Rn[h], u) {
795
- for (a = u.length, s = Array(a); a--; )
796
- s[a] = r.pop();
797
- try {
798
- f = u.apply(null, s);
799
- } catch (p) {
800
- return p;
801
- }
802
- } else t.hasOwnProperty(h) ? f = t[h] : f = +h;
803
- r.push(f);
804
- }
805
- return r[0];
806
- }
807
- function jn(n) {
808
- var t = En(n);
809
- return function(r) {
810
- return Tn(t, r);
811
- };
812
- }
813
- function Ln(n) {
814
- var t = jn(n);
815
- return function(r) {
816
- return +t({ n: r });
817
- };
818
- }
819
- var Et = {
820
- contextDelimiter: "",
821
- onMissingKey: null
822
- };
823
- function An(n) {
824
- var t, r, i;
825
- for (t = n.split(";"), r = 0; r < t.length; r++)
826
- if (i = t[r].trim(), i.indexOf("plural=") === 0)
827
- return i.substr(7);
828
- }
829
- function ot(n, t) {
830
- var r;
831
- this.data = n, this.pluralForms = {}, this.options = {};
832
- for (r in Et)
833
- this.options[r] = t !== void 0 && r in t ? t[r] : Et[r];
834
- }
835
- ot.prototype.getPluralForm = function(n, t) {
836
- var r = this.pluralForms[n], i, a, s;
837
- return r || (i = this.data[n][""], s = i["Plural-Forms"] || i["plural-forms"] || // Ignore reason: As known, there's no way to document the empty
838
- // string property on a key to guarantee this as metadata.
839
- // @ts-ignore
840
- i.plural_forms, typeof s != "function" && (a = An(
841
- i["Plural-Forms"] || i["plural-forms"] || // Ignore reason: As known, there's no way to document the empty
842
- // string property on a key to guarantee this as metadata.
843
- // @ts-ignore
844
- i.plural_forms
845
- ), s = Ln(a)), r = this.pluralForms[n] = s), r(t);
846
- };
847
- ot.prototype.dcnpgettext = function(n, t, r, i, a) {
848
- var s, u, h;
849
- return a === void 0 ? s = 0 : s = this.getPluralForm(n, a), u = r, t && (u = t + this.options.contextDelimiter + r), h = this.data[n][u], h && h[s] ? h[s] : (this.options.onMissingKey && this.options.onMissingKey(r, n), s === 0 ? r : i);
850
- };
851
- const Rt = {
852
- "": {
853
- plural_forms(n) {
854
- return n === 1 ? 0 : 1;
855
- }
856
- }
857
- }, Sn = /^i18n\.(n?gettext|has_translation)(_|$)/, On = (n, t, r) => {
858
- const i = new ot({}), a = /* @__PURE__ */ new Set(), s = () => {
859
- a.forEach((l) => l());
860
- }, u = (l) => (a.add(l), () => a.delete(l)), h = (l = "default") => i.data[l], f = (l, v = "default") => {
861
- var _;
862
- i.data[v] = {
863
- ...i.data[v],
864
- ...l
865
- }, i.data[v][""] = {
866
- ...Rt[""],
867
- ...(_ = i.data[v]) == null ? void 0 : _[""]
868
- }, delete i.pluralForms[v];
869
- }, p = (l, v) => {
870
- f(l, v), s();
871
- }, m = (l, v = "default") => {
872
- var _;
873
- i.data[v] = {
874
- ...i.data[v],
875
- ...l,
876
- // Populate default domain configuration (supported locale date which omits
877
- // a plural forms expression).
878
- "": {
879
- ...Rt[""],
880
- ...(_ = i.data[v]) == null ? void 0 : _[""],
881
- ...l == null ? void 0 : l[""]
882
- }
883
- }, delete i.pluralForms[v], s();
884
- }, g = (l, v) => {
885
- i.data = {}, i.pluralForms = {}, p(l, v);
886
- }, C = (l = "default", v, _, A, O) => (i.data[l] || f(void 0, l), i.dcnpgettext(l, v, _, A, O)), E = (l) => l || "default", D = (l, v) => {
887
- let _ = C(v, void 0, l);
888
- return r ? (_ = r.applyFilters("i18n.gettext", _, l, v), r.applyFilters("i18n.gettext_" + E(v), _, l, v)) : _;
889
- }, H = (l, v, _) => {
890
- let A = C(_, v, l);
891
- return r ? (A = r.applyFilters("i18n.gettext_with_context", A, l, v, _), r.applyFilters("i18n.gettext_with_context_" + E(_), A, l, v, _)) : A;
892
- }, B = (l, v, _, A) => {
893
- let O = C(A, void 0, l, v, _);
894
- return r ? (O = r.applyFilters("i18n.ngettext", O, l, v, _, A), r.applyFilters("i18n.ngettext_" + E(A), O, l, v, _, A)) : O;
895
- }, M = (l, v, _, A, O) => {
896
- let T = C(O, A, l, v, _);
897
- return r ? (T = r.applyFilters("i18n.ngettext_with_context", T, l, v, _, A, O), r.applyFilters("i18n.ngettext_with_context_" + E(O), T, l, v, _, A, O)) : T;
898
- }, j = () => H("ltr", "text direction") === "rtl", K = (l, v, _) => {
899
- var T, Z;
900
- const A = v ? v + "" + l : l;
901
- let O = !!((Z = (T = i.data) == null ? void 0 : T[_ ?? "default"]) != null && Z[A]);
902
- return r && (O = r.applyFilters("i18n.has_translation", O, l, v, _), O = r.applyFilters("i18n.has_translation_" + E(_), O, l, v, _)), O;
903
- };
904
- if (r) {
905
- const l = (v) => {
906
- Sn.test(v) && s();
907
- };
908
- r.addAction("hookAdded", "core/i18n", l), r.addAction("hookRemoved", "core/i18n", l);
909
- }
910
- return {
911
- getLocaleData: h,
912
- setLocaleData: p,
913
- addLocaleData: m,
914
- resetLocaleData: g,
915
- subscribe: u,
916
- __: D,
917
- _x: H,
918
- _n: B,
919
- _nx: M,
920
- isRTL: j,
921
- hasTranslation: K
922
- };
923
- };
924
- function Ht(n) {
925
- return typeof n != "string" || n === "" ? (console.error("The namespace must be a non-empty string."), !1) : /^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(n) ? !0 : (console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."), !1);
926
- }
927
- function st(n) {
928
- return typeof n != "string" || n === "" ? (console.error("The hook name must be a non-empty string."), !1) : /^__/.test(n) ? (console.error("The hook name cannot begin with `__`."), !1) : /^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(n) ? !0 : (console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."), !1);
929
- }
930
- function Tt(n, t) {
931
- return function(i, a, s, u = 10) {
932
- const h = n[t];
933
- if (!st(i) || !Ht(a))
934
- return;
935
- if (typeof s != "function") {
936
- console.error("The hook callback must be a function.");
937
- return;
938
- }
939
- if (typeof u != "number") {
940
- console.error("If specified, the hook priority must be a number.");
941
- return;
942
- }
943
- const f = {
944
- callback: s,
945
- priority: u,
946
- namespace: a
947
- };
948
- if (h[i]) {
949
- const p = h[i].handlers;
950
- let m;
951
- for (m = p.length; m > 0 && !(u >= p[m - 1].priority); m--)
952
- ;
953
- m === p.length ? p[m] = f : p.splice(m, 0, f), h.__current.forEach((g) => {
954
- g.name === i && g.currentIndex >= m && g.currentIndex++;
955
- });
956
- } else
957
- h[i] = {
958
- handlers: [f],
959
- runs: 0
960
- };
961
- i !== "hookAdded" && n.doAction("hookAdded", i, a, s, u);
962
- };
963
- }
964
- function Ve(n, t, r = !1) {
965
- return function(a, s) {
966
- const u = n[t];
967
- if (!st(a) || !r && !Ht(s))
968
- return;
969
- if (!u[a])
970
- return 0;
971
- let h = 0;
972
- if (r)
973
- h = u[a].handlers.length, u[a] = {
974
- runs: u[a].runs,
975
- handlers: []
976
- };
977
- else {
978
- const f = u[a].handlers;
979
- for (let p = f.length - 1; p >= 0; p--)
980
- f[p].namespace === s && (f.splice(p, 1), h++, u.__current.forEach((m) => {
981
- m.name === a && m.currentIndex >= p && m.currentIndex--;
982
- }));
983
- }
984
- return a !== "hookRemoved" && n.doAction("hookRemoved", a, s), h;
985
- };
986
- }
987
- function jt(n, t) {
988
- return function(i, a) {
989
- const s = n[t];
990
- return typeof a < "u" ? i in s && s[i].handlers.some((u) => u.namespace === a) : i in s;
991
- };
992
- }
993
- function We(n, t, r, i) {
994
- return function(s, ...u) {
995
- const h = n[t];
996
- h[s] || (h[s] = {
997
- handlers: [],
998
- runs: 0
999
- }), h[s].runs++;
1000
- const f = h[s].handlers;
1001
- if (process.env.NODE_ENV !== "production" && s !== "hookAdded" && h.all && f.push(...h.all.handlers), !f || !f.length)
1002
- return r ? u[0] : void 0;
1003
- const p = {
1004
- name: s,
1005
- currentIndex: 0
1006
- };
1007
- async function m() {
1008
- try {
1009
- h.__current.add(p);
1010
- let C = r ? u[0] : void 0;
1011
- for (; p.currentIndex < f.length; )
1012
- C = await f[p.currentIndex].callback.apply(null, u), r && (u[0] = C), p.currentIndex++;
1013
- return r ? C : void 0;
1014
- } finally {
1015
- h.__current.delete(p);
1016
- }
1017
- }
1018
- function g() {
1019
- try {
1020
- h.__current.add(p);
1021
- let C = r ? u[0] : void 0;
1022
- for (; p.currentIndex < f.length; )
1023
- C = f[p.currentIndex].callback.apply(null, u), r && (u[0] = C), p.currentIndex++;
1024
- return r ? C : void 0;
1025
- } finally {
1026
- h.__current.delete(p);
1027
- }
1028
- }
1029
- return (i ? m : g)();
1030
- };
1031
- }
1032
- function Lt(n, t) {
1033
- return function() {
1034
- var u;
1035
- var i;
1036
- const a = n[t];
1037
- return (i = (u = Array.from(a.__current).at(-1)) == null ? void 0 : u.name) !== null && i !== void 0 ? i : null;
67
+ clear: o,
68
+ textareaRef: s,
69
+ handleKeyDown: g,
70
+ adjustHeight: r
1038
71
  };
1039
72
  }
1040
- function At(n, t) {
1041
- return function(i) {
1042
- const a = n[t];
1043
- return typeof i > "u" ? a.__current.size > 0 : Array.from(a.__current).some((s) => s.name === i);
1044
- };
1045
- }
1046
- function St(n, t) {
1047
- return function(i) {
1048
- const a = n[t];
1049
- if (st(i))
1050
- return a[i] && a[i].runs ? a[i].runs : 0;
1051
- };
1052
- }
1053
- class In {
1054
- constructor() {
1055
- this.actions = /* @__PURE__ */ Object.create(null), this.actions.__current = /* @__PURE__ */ new Set(), this.filters = /* @__PURE__ */ Object.create(null), this.filters.__current = /* @__PURE__ */ new Set(), this.addAction = Tt(this, "actions"), this.addFilter = Tt(this, "filters"), this.removeAction = Ve(this, "actions"), this.removeFilter = Ve(this, "filters"), this.hasAction = jt(this, "actions"), this.hasFilter = jt(this, "filters"), this.removeAllActions = Ve(this, "actions", !0), this.removeAllFilters = Ve(this, "filters", !0), this.doAction = We(this, "actions", !1, !1), this.doActionAsync = We(this, "actions", !1, !0), this.applyFilters = We(this, "filters", !0, !1), this.applyFiltersAsync = We(this, "filters", !0, !0), this.currentAction = Lt(this, "actions"), this.currentFilter = Lt(this, "filters"), this.doingAction = At(this, "actions"), this.doingFilter = At(this, "filters"), this.didAction = St(this, "actions"), this.didFilter = St(this, "filters");
1056
- }
1057
- }
1058
- function Dn() {
1059
- return new In();
1060
- }
1061
- const Nt = Dn(), {
1062
- addAction: Kr,
1063
- addFilter: Xr,
1064
- removeAction: Jr,
1065
- removeFilter: qr,
1066
- hasAction: zr,
1067
- hasFilter: Qr,
1068
- removeAllActions: ei,
1069
- removeAllFilters: ti,
1070
- doAction: ni,
1071
- doActionAsync: ri,
1072
- applyFilters: ii,
1073
- applyFiltersAsync: ai,
1074
- currentAction: oi,
1075
- currentFilter: si,
1076
- doingAction: li,
1077
- doingFilter: ci,
1078
- didAction: ui,
1079
- didFilter: fi,
1080
- actions: di,
1081
- filters: hi
1082
- } = Nt, F = On(void 0, void 0, Nt);
1083
- F.getLocaleData.bind(F);
1084
- F.setLocaleData.bind(F);
1085
- F.resetLocaleData.bind(F);
1086
- F.subscribe.bind(F);
1087
- const Re = F.__.bind(F);
1088
- F._x.bind(F);
1089
- F._n.bind(F);
1090
- F._nx.bind(F);
1091
- F.isRTL.bind(F);
1092
- F.hasTranslation.bind(F);
1093
- const Vt = Re("Ask anything", "a8c-agenttic"), at = {
73
+ const ie = Ct("Ask anything", "a8c-agenttic"), Zt = {
1094
74
  type: "spring",
1095
75
  stiffness: 300,
1096
76
  damping: 30
1097
- }, De = {
77
+ }, lt = {
1098
78
  type: "spring",
1099
79
  damping: 40,
1100
80
  stiffness: 500,
1101
81
  mass: 0.8
1102
- }, Ye = {
1103
- ...De,
82
+ }, Vt = {
83
+ ...lt,
1104
84
  stiffness: 1e3,
1105
85
  damping: 90
1106
- }, lt = {
86
+ }, $t = {
1107
87
  type: "spring",
1108
88
  damping: 40,
1109
89
  stiffness: 500,
1110
90
  mass: 0.8
1111
- }, Wt = {
91
+ }, re = {
1112
92
  hidden: {
1113
93
  opacity: 0
1114
94
  },
1115
95
  visible: {
1116
96
  opacity: 1,
1117
- transition: at
97
+ transition: Zt
1118
98
  },
1119
99
  exit: {
1120
100
  opacity: 0,
1121
- transition: { ...at, duration: 0.1 }
101
+ transition: { ...Zt, duration: 0.1 }
1122
102
  }
1123
- }, Pn = () => {
103
+ }, De = () => {
1124
104
  if (typeof window > "u")
1125
105
  return { left: 0, right: 0, top: 0, bottom: 0 };
1126
- const n = 20;
106
+ const e = 20;
1127
107
  return {
1128
- left: n,
1129
- right: window.innerWidth - 400 - n,
108
+ left: e,
109
+ right: window.innerWidth - 400 - e,
1130
110
  // Assuming max width of 400px
1131
- top: n,
1132
- bottom: window.innerHeight - 60 - n
111
+ top: e,
112
+ bottom: window.innerHeight - 60 - e
1133
113
  // Assuming collapsed height of 60px
1134
114
  };
1135
- }, Fn = {
115
+ }, Me = {
1136
116
  "0%": { backgroundPosition: "-200% 0" },
1137
117
  "100%": { backgroundPosition: "200% 0" }
1138
- }, pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
118
+ }, Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1139
119
  __proto__: null,
1140
- fadeVariants: Wt,
1141
- fastSpring: De,
1142
- fastSpringWithDelay: Ye,
1143
- getDragConstraints: Pn,
1144
- morphSpring: lt,
1145
- springConfig: at,
1146
- thinkingGradientKeyframes: Fn
1147
- }, Symbol.toStringTag, { value: "Module" })), Mn = "button-module_button", kn = "button-module_pressed", $n = "button-module_primary", Hn = "button-module_ghost", Nn = "button-module_outline", Vn = "button-module_link", Wn = "button-module_icon", Bn = "button-module_sm", Yn = "button-module_withTextAndIcon", Ae = {
1148
- button: Mn,
1149
- pressed: kn,
1150
- primary: $n,
1151
- ghost: Hn,
1152
- outline: Nn,
1153
- link: Vn,
1154
- icon: Wn,
1155
- sm: Bn,
1156
- withTextAndIcon: Yn
1157
- }, ee = Mt.forwardRef(
120
+ fadeVariants: re,
121
+ fastSpring: lt,
122
+ fastSpringWithDelay: Vt,
123
+ getDragConstraints: De,
124
+ morphSpring: $t,
125
+ springConfig: Zt,
126
+ thinkingGradientKeyframes: Me
127
+ }, Symbol.toStringTag, { value: "Module" })), Pe = "button-module_button", Ve = "button-module_pressed", He = "button-module_primary", $e = "button-module_ghost", Fe = "button-module_outline", ke = "button-module_transparent", Ue = "button-module_link", Ge = "button-module_icon", We = "button-module_sm", Be = "button-module_lg", Ze = "button-module_withTextAndIcon", Lt = {
128
+ button: Pe,
129
+ pressed: Ve,
130
+ primary: He,
131
+ ghost: $e,
132
+ outline: Fe,
133
+ transparent: ke,
134
+ link: Ue,
135
+ icon: Ge,
136
+ sm: We,
137
+ lg: Be,
138
+ withTextAndIcon: Ze
139
+ }, Y = te.forwardRef(
1158
140
  function({
1159
141
  className: t,
1160
- variant: r = "primary",
142
+ variant: a = "primary",
1161
143
  size: i,
1162
- icon: a,
1163
- children: s,
1164
- asChild: u = !1,
1165
- pressed: h = !1,
1166
- ...f
1167
- }, p) {
1168
- const m = u ? yn : "button", g = !!a, C = i || (g && !s ? "icon" : void 0);
1169
- return /* @__PURE__ */ o.jsxs(
1170
- m,
144
+ icon: s,
145
+ children: o,
146
+ asChild: r = !1,
147
+ pressed: g = !1,
148
+ ...u
149
+ }, m) {
150
+ const f = r ? Ne : "button", v = !!s, y = i || (v && !o ? "icon" : void 0);
151
+ return /* @__PURE__ */ _(
152
+ f,
1171
153
  {
1172
- ref: p,
154
+ ref: m,
1173
155
  "data-slot": "button",
1174
- className: se(
1175
- Ae.button,
1176
- Ae[r],
1177
- C && Ae[C],
1178
- g && s ? Ae.withTextAndIcon : void 0,
1179
- h ? Ae.pressed : void 0,
156
+ className: V(
157
+ Lt.button,
158
+ Lt[a],
159
+ y && Lt[y],
160
+ v && o ? Lt.withTextAndIcon : void 0,
161
+ g ? Lt.pressed : void 0,
1180
162
  t
1181
163
  ),
1182
- "aria-pressed": h,
1183
- ...f,
164
+ "aria-pressed": g,
165
+ ...u,
1184
166
  children: [
1185
- a,
1186
- s
167
+ s,
168
+ o
1187
169
  ]
1188
170
  }
1189
171
  );
1190
172
  }
1191
173
  );
1192
- ee.displayName = "Button";
1193
- function Bt({ className: n, size: t = 24 }) {
1194
- return /* @__PURE__ */ o.jsx(
174
+ Y.displayName = "Button";
175
+ function se({ className: e, size: t = 24 }) {
176
+ return /* @__PURE__ */ n(
1195
177
  "svg",
1196
178
  {
1197
- className: n,
179
+ className: e,
1198
180
  width: t,
1199
181
  height: t,
1200
182
  viewBox: "0 0 24 24",
1201
183
  fill: "none",
1202
184
  xmlns: "http://www.w3.org/2000/svg",
1203
- children: /* @__PURE__ */ o.jsx(
185
+ children: /* @__PURE__ */ n(
1204
186
  "path",
1205
187
  {
1206
188
  d: "M19.6611 11.5224L16.3782 10.39C15.0799 9.94387 14.0561 8.92011 13.61 7.62181L12.4775 4.33887C12.3231 3.88704 11.6769 3.88704 11.5225 4.33887L10.39 7.62181C9.94388 8.92011 8.9201 9.94387 7.6218 10.39L4.33887 11.5224C3.88704 11.6768 3.88704 12.3231 4.33887 12.4776L7.6218 13.61C8.9201 14.0561 9.94388 15.0799 10.39 16.3782L11.5225 19.6611C11.6769 20.113 12.3231 20.113 12.4775 19.6611L13.61 16.3782C14.0561 15.0799 15.0799 14.0561 16.3782 13.61L19.6611 12.4776C20.113 12.3231 20.113 11.6768 19.6611 11.5224ZM15.8291 12.2431L14.1876 12.8093C13.5356 13.0323 13.0266 13.5471 12.8036 14.1934L12.2374 15.8348C12.1572 16.0636 11.837 16.0636 11.7569 15.8348L11.1907 14.1934C10.9677 13.5414 10.4529 13.0323 9.80662 12.8093L8.16515 12.2431C7.93637 12.163 7.93637 11.8427 8.16515 11.7626L9.80662 11.1964C10.4586 10.9734 10.9677 10.4586 11.1907 9.81233L11.7569 8.17087C11.837 7.94209 12.1572 7.94209 12.2374 8.17087L12.8036 9.81233C13.0266 10.4643 13.5414 10.9734 14.1876 11.1964L15.8291 11.7626C16.0579 11.8427 16.0579 12.163 15.8291 12.2431Z",
@@ -1210,20 +192,20 @@ function Bt({ className: n, size: t = 24 }) {
1210
192
  }
1211
193
  );
1212
194
  }
1213
- const Zn = "CollapsedView-module_button", Un = {
1214
- button: Zn
195
+ const Ye = "CollapsedView-module_button", Ke = {
196
+ button: Ye
1215
197
  };
1216
- function Gn({
1217
- icon: n = /* @__PURE__ */ o.jsx(Bt, { size: 36 }),
198
+ function ce({
199
+ icon: e = /* @__PURE__ */ n(se, { size: 36 }),
1218
200
  onClick: t,
1219
- onHover: r,
201
+ onHover: a,
1220
202
  focusOnMount: i = !1
1221
203
  }) {
1222
- const a = W(null), s = W(i);
1223
- return J(() => {
1224
- s.current && a.current && a.current.focus(), s.current = !1;
1225
- }, [s, a]), /* @__PURE__ */ o.jsx(
1226
- q.div,
204
+ const s = I(null), o = I(i);
205
+ return E(() => {
206
+ o.current && s.current && s.current.focus(), o.current = !1;
207
+ }, [o, s]), /* @__PURE__ */ n(
208
+ M.div,
1227
209
  {
1228
210
  "data-slot": "collapsed-view",
1229
211
  layout: "preserve-aspect",
@@ -1236,7 +218,7 @@ function Gn({
1236
218
  opacity: 1,
1237
219
  scale: 1,
1238
220
  transition: {
1239
- ...lt,
221
+ ...$t,
1240
222
  delay: 0.2
1241
223
  }
1242
224
  },
@@ -1247,37 +229,37 @@ function Gn({
1247
229
  duration: 0.15
1248
230
  }
1249
231
  },
1250
- children: /* @__PURE__ */ o.jsx(
1251
- ee,
232
+ children: /* @__PURE__ */ n(
233
+ Y,
1252
234
  {
1253
- ref: a,
235
+ ref: s,
1254
236
  onClick: t,
1255
- onMouseEnter: r,
237
+ onMouseEnter: a,
1256
238
  variant: "link",
1257
- className: Un.button,
1258
- icon: n,
1259
- "aria-label": Re("Open chat", "a8c-agenttic")
239
+ className: Ke.button,
240
+ icon: e,
241
+ "aria-label": Ct("Open chat", "a8c-agenttic")
1260
242
  }
1261
243
  )
1262
244
  }
1263
245
  );
1264
246
  }
1265
- const Kn = "Textarea-module_textarea", Xn = {
1266
- textarea: Kn
1267
- }, Yt = Mt.forwardRef(
1268
- ({ className: n, ...t }, r) => /* @__PURE__ */ o.jsx(
247
+ const Xe = "Textarea-module_textarea", je = {
248
+ textarea: Xe
249
+ }, le = te.forwardRef(
250
+ ({ className: e, ...t }, a) => /* @__PURE__ */ n(
1269
251
  "textarea",
1270
252
  {
1271
253
  "data-slot": "textarea",
1272
- className: Xn.textarea,
1273
- ref: r,
254
+ className: je.textarea,
255
+ ref: a,
1274
256
  ...t
1275
257
  }
1276
258
  )
1277
259
  );
1278
- Yt.displayName = "Textarea";
1279
- function Jn({ className: n, size: t = 24 }) {
1280
- return /* @__PURE__ */ o.jsx(
260
+ le.displayName = "Textarea";
261
+ function ze({ className: e, size: t = 24 }) {
262
+ return /* @__PURE__ */ n(
1281
263
  "svg",
1282
264
  {
1283
265
  width: t,
@@ -1285,8 +267,8 @@ function Jn({ className: n, size: t = 24 }) {
1285
267
  viewBox: "0 0 24 24",
1286
268
  fill: "none",
1287
269
  xmlns: "http://www.w3.org/2000/svg",
1288
- className: n,
1289
- children: /* @__PURE__ */ o.jsx(
270
+ className: e,
271
+ children: /* @__PURE__ */ n(
1290
272
  "path",
1291
273
  {
1292
274
  d: "M12.2197 5C12.4186 5 12.6094 5.07902 12.75 5.21967L17 9.46967C17.2929 9.76256 17.2929 10.2374 17 10.5303C16.7071 10.8232 16.2322 10.8232 15.9393 10.5303L12.9697 7.56067V18.25C12.9697 18.6642 12.6339 19 12.2197 19C11.8055 19 11.4697 18.6642 11.4697 18.25V7.56065L8.5 10.5303C8.2071 10.8232 7.73223 10.8232 7.43934 10.5303C7.14644 10.2374 7.14645 9.76256 7.43934 9.46967L11.6894 5.21967C11.83 5.07902 12.0208 5 12.2197 5Z",
@@ -1296,8 +278,8 @@ function Jn({ className: n, size: t = 24 }) {
1296
278
  }
1297
279
  );
1298
280
  }
1299
- function qn({ className: n, size: t = 24 }) {
1300
- return /* @__PURE__ */ o.jsx(
281
+ function qe({ className: e, size: t = 24 }) {
282
+ return /* @__PURE__ */ n(
1301
283
  "svg",
1302
284
  {
1303
285
  width: t,
@@ -1305,8 +287,8 @@ function qn({ className: n, size: t = 24 }) {
1305
287
  viewBox: "0 0 24 24",
1306
288
  fill: "none",
1307
289
  xmlns: "http://www.w3.org/2000/svg",
1308
- className: n,
1309
- children: /* @__PURE__ */ o.jsx(
290
+ className: e,
291
+ children: /* @__PURE__ */ n(
1310
292
  "rect",
1311
293
  {
1312
294
  x: "7",
@@ -1320,23 +302,23 @@ function qn({ className: n, size: t = 24 }) {
1320
302
  }
1321
303
  );
1322
304
  }
1323
- const zn = "ChatInput-module_container", Qn = "ChatInput-module_textareaContainer", er = "ChatInput-module_actions", tr = "ChatInput-module_button", be = {
1324
- container: zn,
1325
- textareaContainer: Qn,
1326
- actions: er,
1327
- button: tr
305
+ const Je = "ChatInput-module_container", Qe = "ChatInput-module_textareaContainer", tn = "ChatInput-module_actions", en = "ChatInput-module_button", pt = {
306
+ container: Je,
307
+ textareaContainer: Qe,
308
+ actions: tn,
309
+ button: en
1328
310
  };
1329
- function nr({ className: n, size: t = 24 }) {
1330
- return /* @__PURE__ */ o.jsx(
311
+ function nn({ className: e, size: t = 24 }) {
312
+ return /* @__PURE__ */ n(
1331
313
  "svg",
1332
314
  {
1333
- className: n,
315
+ className: e,
1334
316
  width: t,
1335
317
  height: t,
1336
318
  viewBox: "0 0 24 24",
1337
319
  fill: "none",
1338
320
  xmlns: "http://www.w3.org/2000/svg",
1339
- children: /* @__PURE__ */ o.jsx(
321
+ children: /* @__PURE__ */ n(
1340
322
  "path",
1341
323
  {
1342
324
  fillRule: "evenodd",
@@ -1348,27 +330,27 @@ function nr({ className: n, size: t = 24 }) {
1348
330
  }
1349
331
  );
1350
332
  }
1351
- const rr = "AnimatedPlaceholder-module_container", ir = {
1352
- container: rr
333
+ const on = "AnimatedPlaceholder-module_container", an = {
334
+ container: on
1353
335
  };
1354
- function ar({
1355
- texts: n,
336
+ function rn({
337
+ texts: e,
1356
338
  interval: t = 3e3,
1357
- className: r = ""
339
+ className: a = ""
1358
340
  }) {
1359
- const [i, a] = Ee(0);
1360
- return J(() => {
1361
- const s = setInterval(() => {
1362
- a(
1363
- (u) => (u + 1) % n.length
341
+ const [i, s] = W(0);
342
+ return E(() => {
343
+ const o = setInterval(() => {
344
+ s(
345
+ (r) => (r + 1) % e.length
1364
346
  );
1365
347
  }, t);
1366
- return () => clearInterval(s);
1367
- }, [n.length, t]), /* @__PURE__ */ o.jsx(Ue, { mode: "wait", children: /* @__PURE__ */ o.jsx(
1368
- q.span,
348
+ return () => clearInterval(o);
349
+ }, [e.length, t]), /* @__PURE__ */ n(_t, { mode: "wait", children: /* @__PURE__ */ n(
350
+ M.span,
1369
351
  {
1370
352
  "data-slot": "animated-placeholder",
1371
- className: se(ir.container, r),
353
+ className: V(an.container, a),
1372
354
  initial: { opacity: 0, y: 8 },
1373
355
  animate: { opacity: 1, y: 0 },
1374
356
  exit: { opacity: 0, y: -8 },
@@ -1377,178 +359,315 @@ function ar({
1377
359
  ease: [0.4, 0, 0.2, 1]
1378
360
  // Matches --transition-colors cubic-bezier
1379
361
  },
1380
- children: n[i]
362
+ children: e[i]
1381
363
  },
1382
364
  i
1383
365
  ) });
1384
366
  }
1385
- function Zt({
1386
- value: n,
367
+ const ue = Ee(null);
368
+ function ut() {
369
+ const e = Ae(ue);
370
+ if (!e)
371
+ throw new Error(
372
+ "useAgentUIContext must be used within an AgentUIContainer"
373
+ );
374
+ return e;
375
+ }
376
+ function zt({ children: e, value: t }) {
377
+ return /* @__PURE__ */ n(ue.Provider, { value: t, children: e });
378
+ }
379
+ function Kt({
380
+ value: e,
1387
381
  onChange: t,
1388
- onSubmit: r,
382
+ onSubmit: a,
1389
383
  onKeyDown: i,
1390
- textareaRef: a,
1391
- placeholder: s = Vt,
1392
- isProcessing: u,
1393
- onBlur: h,
1394
- fromCompact: f = !1,
1395
- onExpand: p,
1396
- showExpandButton: m = !0,
1397
- focusOnMount: g = !1,
1398
- customActions: C = [],
1399
- actionOrder: E = "before-submit",
1400
- onStop: D,
1401
- disabled: H = !1
384
+ textareaRef: s,
385
+ placeholder: o = ie,
386
+ isProcessing: r,
387
+ onBlur: g,
388
+ fromCompact: u = !1,
389
+ onExpand: m,
390
+ showExpandButton: f = !0,
391
+ focusOnMount: v = !1,
392
+ customActions: y = [],
393
+ actionOrder: b = "before-submit",
394
+ onStop: T,
395
+ disabled: L = !1,
396
+ className: O
1402
397
  }) {
1403
- const B = dn(), M = (n.trim() || u) && !H, j = (T) => T.endsWith("…") ? T : `${T}…`, K = Array.isArray(s);
1404
- let l;
1405
- K ? l = s.map(j) : s ? l = j(s) : l = "";
1406
- const v = W(g);
1407
- J(() => {
1408
- v.current && a.current && a.current.focus(), v.current = !1;
1409
- }, [v, a]);
1410
- const _ = () => C.map((T) => /* @__PURE__ */ o.jsx(
1411
- ee,
398
+ const D = Se(), N = (e.trim() || r) && !L, { variant: H, floatingChatState: c } = ut(), $ = (d) => d.endsWith("…") ? d : `${d}…`, B = Array.isArray(o);
399
+ let P;
400
+ B ? P = o.map($) : o ? P = $(o) : P = "";
401
+ const tt = I(v);
402
+ E(() => {
403
+ tt.current && s.current && s.current.focus(), tt.current = !1;
404
+ }, [tt, s]);
405
+ const K = () => y.map((d) => /* @__PURE__ */ n(
406
+ Y,
1412
407
  {
1413
- className: T.className || be.button,
1414
- onClick: T.onClick,
1415
- disabled: T.disabled,
1416
- variant: T.variant || "ghost",
1417
- icon: T.icon,
1418
- "aria-label": T["aria-label"]
408
+ className: d.className || pt.button,
409
+ onClick: d.onClick,
410
+ disabled: d.disabled,
411
+ variant: d.variant || "ghost",
412
+ icon: d.icon,
413
+ "aria-label": d["aria-label"]
1419
414
  },
1420
- T.id
1421
- )), A = () => m && p ? /* @__PURE__ */ o.jsx(
1422
- ee,
415
+ d.id
416
+ )), F = () => H === "embedded" || c === "expanded" ? null : f && m ? /* @__PURE__ */ n(
417
+ Y,
1423
418
  {
1424
- className: be.button,
1425
- onClick: p,
419
+ className: pt.button,
420
+ onClick: m,
1426
421
  variant: "ghost",
1427
- icon: /* @__PURE__ */ o.jsx(nr, {}),
1428
- "aria-label": Re("Expand conversation", "a8c-agenttic")
422
+ icon: /* @__PURE__ */ n(nn, {}),
423
+ "aria-label": Ct("Expand conversation", "a8c-agenttic")
1429
424
  }
1430
- ) : null, O = () => {
1431
- const T = () => {
1432
- u && D ? D() : r();
425
+ ) : null, l = () => {
426
+ const d = () => {
427
+ r && T ? T() : a();
1433
428
  };
1434
- return /* @__PURE__ */ o.jsx(
1435
- ee,
429
+ return /* @__PURE__ */ n(
430
+ Y,
1436
431
  {
1437
- className: be.button,
1438
- onClick: T,
1439
- disabled: !M,
432
+ className: pt.button,
433
+ onClick: d,
434
+ disabled: !N,
1440
435
  variant: "primary",
1441
- icon: u ? /* @__PURE__ */ o.jsx(qn, {}) : /* @__PURE__ */ o.jsx(Jn, {}),
1442
- "aria-label": Re(u ? "Stop processing" : "Send message", "a8c-agenttic")
436
+ icon: r ? /* @__PURE__ */ n(qe, {}) : /* @__PURE__ */ n(ze, {}),
437
+ "aria-label": r ? Ct("Stop processing", "a8c-agenttic") : Ct("Send message", "a8c-agenttic")
1443
438
  }
1444
439
  );
1445
440
  };
1446
- return /* @__PURE__ */ o.jsxs("div", { "data-slot": "chat-input", className: be.container, children: [
1447
- /* @__PURE__ */ o.jsxs(
1448
- q.div,
441
+ return /* @__PURE__ */ _("div", { "data-slot": "chat-input", className: pt.container, children: [
442
+ /* @__PURE__ */ _(
443
+ M.div,
1449
444
  {
1450
- className: be.textareaContainer,
445
+ className: pt.textareaContainer,
1451
446
  initial: {
1452
447
  opacity: 0
1453
448
  },
1454
449
  animate: {
1455
450
  opacity: 1,
1456
451
  scale: 1,
1457
- transition: n.trim() ? { duration: 0 } : Ye
452
+ transition: e.trim() ? { duration: 0 } : Vt
1458
453
  },
1459
454
  children: [
1460
- !n && K && /* @__PURE__ */ o.jsx(
1461
- ar,
455
+ !e && B && /* @__PURE__ */ n(
456
+ rn,
1462
457
  {
1463
- texts: l
458
+ texts: P
1464
459
  }
1465
460
  ),
1466
- /* @__PURE__ */ o.jsx(
1467
- Yt,
461
+ /* @__PURE__ */ n(
462
+ le,
1468
463
  {
1469
- id: B,
1470
- ref: a,
1471
- value: n,
1472
- onChange: (T) => t(T.target.value),
464
+ id: D,
465
+ ref: s,
466
+ value: e,
467
+ onChange: (d) => t(d.target.value),
1473
468
  onKeyDown: i,
1474
- onBlur: h,
1475
- placeholder: K ? "" : l,
469
+ onBlur: g,
470
+ placeholder: B ? "" : P,
1476
471
  rows: 1
1477
472
  }
1478
473
  )
1479
474
  ]
1480
475
  }
1481
476
  ),
1482
- /* @__PURE__ */ o.jsxs(
1483
- q.div,
477
+ /* @__PURE__ */ _(
478
+ M.div,
1484
479
  {
1485
- className: be.actions,
480
+ className: pt.actions,
1486
481
  initial: {
1487
- opacity: f ? 1 : 0,
1488
- scale: f ? 1 : 0.5
482
+ opacity: u ? 1 : 0,
483
+ scale: u ? 1 : 0.5
1489
484
  },
1490
485
  animate: {
1491
486
  opacity: 1,
1492
487
  scale: 1,
1493
- transition: n.trim() ? { duration: 0 } : De
488
+ transition: e.trim() ? { duration: 0 } : lt
1494
489
  },
1495
490
  children: [
1496
- A(),
1497
- E === "before-submit" && _(),
1498
- O(),
1499
- E === "after-submit" && _()
491
+ F(),
492
+ b === "before-submit" && K(),
493
+ l(),
494
+ b === "after-submit" && K()
1500
495
  ]
1501
496
  }
1502
497
  )
1503
498
  ] });
1504
499
  }
1505
- function or({
1506
- value: n,
500
+ const sn = "Suggestions-module_container", cn = "Suggestions-module_vertical", Gt = {
501
+ container: sn,
502
+ vertical: cn
503
+ }, Xt = ({
504
+ className: e,
505
+ suggestions: t,
506
+ onSubmit: a,
507
+ layout: i = "horizontal",
508
+ visible: s = !0
509
+ }) => {
510
+ const o = (r) => {
511
+ a && a(r.prompt);
512
+ };
513
+ return !t || t.length === 0 ? null : /* @__PURE__ */ n(_t, { children: t && t.length > 0 && s && /* @__PURE__ */ n(
514
+ M.div,
515
+ {
516
+ className: V(
517
+ Gt.container,
518
+ i === "vertical" ? Gt.vertical : "",
519
+ e
520
+ ),
521
+ initial: { opacity: 0, y: "-80%" },
522
+ animate: { opacity: 1, y: "-100%" },
523
+ exit: { opacity: 0, y: "-80%" },
524
+ transition: Vt,
525
+ children: t.map(
526
+ (r, g) => /* @__PURE__ */ n(
527
+ M.div,
528
+ {
529
+ initial: { opacity: 0, y: 10 },
530
+ animate: { opacity: 1, y: 0 },
531
+ exit: { opacity: 0, y: 10 },
532
+ transition: {
533
+ ...Vt,
534
+ delay: g * 0.05
535
+ },
536
+ children: /* @__PURE__ */ n(
537
+ Y,
538
+ {
539
+ onClick: () => o(r),
540
+ variant: i === "vertical" ? "transparent" : "outline",
541
+ size: i === "vertical" ? "lg" : void 0,
542
+ className: Gt.button,
543
+ children: r.label
544
+ }
545
+ )
546
+ },
547
+ r.id
548
+ )
549
+ )
550
+ }
551
+ ) });
552
+ };
553
+ function ln() {
554
+ const e = I(/* @__PURE__ */ new Map()), t = p((o) => {
555
+ const r = e.current.get(o);
556
+ r && (clearTimeout(r), e.current.delete(o));
557
+ }, []), a = p(
558
+ (o, r, g) => {
559
+ t(o);
560
+ const u = setTimeout(r, g);
561
+ return e.current.set(o, u), u;
562
+ },
563
+ [t]
564
+ ), i = p(() => {
565
+ e.current.forEach((o) => {
566
+ clearTimeout(o);
567
+ }), e.current.clear();
568
+ }, []), s = p((o) => e.current.has(o), []);
569
+ return E(() => i, [i]), {
570
+ setNamedTimeout: a,
571
+ clearNamedTimeout: t,
572
+ clearAllTimeouts: i,
573
+ hasTimeout: s
574
+ };
575
+ }
576
+ const un = 4e3, dn = 400;
577
+ function de({
578
+ value: e,
1507
579
  onChange: t,
1508
- onSubmit: r,
580
+ onSubmit: a,
1509
581
  onKeyDown: i,
1510
- textareaRef: a,
1511
- placeholder: s,
1512
- isProcessing: u,
1513
- onBlur: h,
1514
- onExpand: f,
1515
- showExpandButton: p = !0,
1516
- focusOnMount: m = !1,
1517
- customActions: g,
1518
- actionOrder: C,
1519
- onStop: E
582
+ textareaRef: s,
583
+ placeholder: o,
584
+ isProcessing: r,
585
+ onBlur: g,
586
+ onExpand: u,
587
+ showExpandButton: m = !0,
588
+ focusOnMount: f = !1,
589
+ customActions: v,
590
+ actionOrder: y,
591
+ onStop: b,
592
+ suggestions: T,
593
+ clearSuggestions: L
1520
594
  }) {
1521
- return /* @__PURE__ */ o.jsx(
1522
- Zt,
1523
- {
1524
- value: n,
1525
- onChange: t,
1526
- onSubmit: r,
1527
- onKeyDown: i,
1528
- textareaRef: a,
1529
- placeholder: s,
1530
- isProcessing: u,
1531
- onBlur: h,
1532
- onExpand: f,
1533
- showExpandButton: p,
1534
- focusOnMount: m,
1535
- customActions: g,
1536
- actionOrder: C,
1537
- onStop: E
1538
- }
595
+ const [O, D] = W(!1), { setNamedTimeout: N, clearAllTimeouts: H } = ln(), c = p(
596
+ ($) => {
597
+ t($), L == null || L();
598
+ },
599
+ [t, L]
1539
600
  );
601
+ return E(() => {
602
+ if (H(), e) {
603
+ D(!1);
604
+ return;
605
+ }
606
+ if (!T || T.length === 0) {
607
+ D(!1);
608
+ return;
609
+ }
610
+ D(!0), N(
611
+ "hide-suggestions",
612
+ () => {
613
+ D(!1), N(
614
+ "clear-suggestions",
615
+ () => {
616
+ L == null || L();
617
+ },
618
+ dn
619
+ );
620
+ },
621
+ un
622
+ );
623
+ }, [
624
+ e,
625
+ T,
626
+ H,
627
+ N,
628
+ L
629
+ ]), /* @__PURE__ */ _(Ht, { children: [
630
+ /* @__PURE__ */ n(
631
+ Kt,
632
+ {
633
+ value: e,
634
+ onChange: t,
635
+ onSubmit: a,
636
+ onKeyDown: i,
637
+ textareaRef: s,
638
+ placeholder: o,
639
+ isProcessing: r,
640
+ onBlur: g,
641
+ onExpand: u,
642
+ showExpandButton: m,
643
+ focusOnMount: f,
644
+ customActions: v,
645
+ actionOrder: y,
646
+ onStop: b
647
+ }
648
+ ),
649
+ !e && /* @__PURE__ */ n(
650
+ Xt,
651
+ {
652
+ suggestions: T,
653
+ onSubmit: c,
654
+ layout: "vertical",
655
+ visible: O
656
+ }
657
+ )
658
+ ] });
1540
659
  }
1541
- function Ut({ className: n, size: t = 24 }) {
1542
- return /* @__PURE__ */ o.jsx(
660
+ function me({ className: e, size: t = 24 }) {
661
+ return /* @__PURE__ */ n(
1543
662
  "svg",
1544
663
  {
1545
- className: n,
664
+ className: e,
1546
665
  width: t,
1547
666
  height: t,
1548
667
  viewBox: "0 0 24 24",
1549
668
  fill: "none",
1550
669
  xmlns: "http://www.w3.org/2000/svg",
1551
- children: /* @__PURE__ */ o.jsx(
670
+ children: /* @__PURE__ */ n(
1552
671
  "path",
1553
672
  {
1554
673
  d: "M12.0001 13.0607L16.4697 17.5304L17.5304 16.4697L13.0607 12.0001L17.5304 7.53039L16.4697 6.46973L12.0001 10.9394L7.5304 6.46973L6.46973 7.53039L10.9394 12.0001L6.46974 16.4697L7.5304 17.5304L12.0001 13.0607Z",
@@ -1558,68 +677,77 @@ function Ut({ className: n, size: t = 24 }) {
1558
677
  }
1559
678
  );
1560
679
  }
1561
- const sr = "ChatHeader-module_container", lr = {
1562
- container: sr
680
+ const mn = "ChatHeader-module_container", fn = {
681
+ container: mn
1563
682
  };
1564
- function cr({ onClose: n }) {
1565
- return /* @__PURE__ */ o.jsx(
1566
- q.div,
683
+ function fe({ onClose: e, className: t }) {
684
+ return /* @__PURE__ */ n(
685
+ M.div,
1567
686
  {
1568
687
  "data-slot": "chat-header",
1569
688
  "data-draggable": "true",
1570
- className: lr.container,
689
+ className: fn.container,
1571
690
  initial: { opacity: 0 },
1572
691
  animate: { opacity: 1 },
1573
- transition: { ...De, delay: 0.1 },
1574
- children: n && /* @__PURE__ */ o.jsx(
1575
- ee,
692
+ transition: { ...lt, delay: 0.1 },
693
+ children: e && /* @__PURE__ */ n(
694
+ Y,
1576
695
  {
1577
696
  variant: "ghost",
1578
- icon: /* @__PURE__ */ o.jsx(Ut, {}),
1579
- onClick: n,
1580
- "aria-label": Re("Close conversation", "a8c-agenttic")
697
+ icon: /* @__PURE__ */ n(me, {}),
698
+ onClick: e,
699
+ "aria-label": Ct("Close conversation", "a8c-agenttic")
1581
700
  }
1582
701
  )
1583
702
  }
1584
703
  );
1585
704
  }
1586
- const ur = "Notice-module_container", fr = "Notice-module_containerWithIcon", dr = "Notice-module_content", hr = "Notice-module_actions", pr = "Notice-module_icon", vr = "Notice-module_dismissible", we = {
1587
- container: ur,
1588
- containerWithIcon: fr,
1589
- content: dr,
1590
- actions: hr,
1591
- icon: pr,
1592
- dismissible: vr
705
+ const hn = "Notice-module_container", pn = "Notice-module_containerWithIcon", Cn = "Notice-module_content", gn = "Notice-module_actions", vn = "Notice-module_icon", wn = "Notice-module_dismissible", J = {
706
+ container: hn,
707
+ containerWithIcon: pn,
708
+ content: Cn,
709
+ actions: gn,
710
+ icon: vn,
711
+ dismissible: wn
1593
712
  };
1594
- function mr({
1595
- icon: n,
713
+ function he({
714
+ icon: e,
1596
715
  message: t,
1597
- action: r,
716
+ action: a,
1598
717
  dismissible: i = !0,
1599
- onDismiss: a
718
+ onDismiss: s,
719
+ className: o,
720
+ status: r
1600
721
  }) {
1601
- return /* @__PURE__ */ o.jsxs(
722
+ return /* @__PURE__ */ _(
1602
723
  "div",
1603
724
  {
1604
725
  "data-slot": "notice",
1605
- className: se(we.container, {
1606
- [we.containerWithIcon]: !!n
1607
- }),
726
+ className: V(
727
+ J.container,
728
+ {
729
+ [J.containerWithIcon]: !!e,
730
+ [J.isSuccess]: r === "success",
731
+ [J.isWarning]: r === "warning",
732
+ [J.isError]: r === "error"
733
+ },
734
+ o
735
+ ),
1608
736
  children: [
1609
- /* @__PURE__ */ o.jsxs("div", { className: we.content, children: [
1610
- n && /* @__PURE__ */ o.jsx("div", { className: we.icon, children: n }),
1611
- /* @__PURE__ */ o.jsx("span", { children: t })
737
+ /* @__PURE__ */ _("div", { className: J.content, children: [
738
+ e && /* @__PURE__ */ n("div", { className: J.icon, children: e }),
739
+ /* @__PURE__ */ n("span", { children: t })
1612
740
  ] }),
1613
- /* @__PURE__ */ o.jsxs("div", { className: we.actions, children: [
1614
- r && /* @__PURE__ */ o.jsx(ee, { onClick: r.onClick, variant: "link", children: r.label }),
1615
- i && a && /* @__PURE__ */ o.jsx(
1616
- ee,
741
+ /* @__PURE__ */ _("div", { className: J.actions, children: [
742
+ a && /* @__PURE__ */ n(Y, { onClick: a.onClick, variant: "link", children: a.label }),
743
+ i && s && /* @__PURE__ */ n(
744
+ Y,
1617
745
  {
1618
- className: we.dismissible,
1619
- onClick: a,
746
+ className: J.dismissible,
747
+ onClick: s,
1620
748
  variant: "ghost",
1621
749
  size: "sm",
1622
- icon: /* @__PURE__ */ o.jsx(Ut, {})
750
+ icon: /* @__PURE__ */ n(me, {})
1623
751
  }
1624
752
  )
1625
753
  ] })
@@ -1627,144 +755,101 @@ function mr({
1627
755
  }
1628
756
  );
1629
757
  }
1630
- const gr = "Suggestions-module_container", Ot = {
1631
- container: gr
1632
- }, yr = ({
1633
- className: n,
1634
- suggestions: t,
1635
- onSubmit: r
1636
- }) => {
1637
- const i = (a) => {
1638
- r && r(a.prompt);
1639
- };
1640
- return !t || t.length === 0 ? null : /* @__PURE__ */ o.jsx(Ue, { children: t && t.length > 0 && /* @__PURE__ */ o.jsx(
1641
- q.div,
1642
- {
1643
- className: se(Ot.container, n),
1644
- initial: { opacity: 0, y: "-80%" },
1645
- animate: { opacity: 1, y: "-100%" },
1646
- exit: { opacity: 0, y: "-80%" },
1647
- transition: Ye,
1648
- children: t.map(
1649
- (a, s) => /* @__PURE__ */ o.jsx(
1650
- q.div,
1651
- {
1652
- initial: { opacity: 0, y: 10 },
1653
- animate: { opacity: 1, y: 0 },
1654
- transition: {
1655
- ...Ye,
1656
- delay: s * 0.05
1657
- },
1658
- children: /* @__PURE__ */ o.jsx(
1659
- ee,
1660
- {
1661
- onClick: () => i(a),
1662
- variant: "outline",
1663
- className: Ot.button,
1664
- children: a.label
1665
- }
1666
- )
1667
- },
1668
- a.id
1669
- )
1670
- )
1671
- }
1672
- ) });
1673
- }, Cr = "ChatFooter-module_container", _r = {
1674
- container: Cr
758
+ const Ln = "ChatFooter-module_container", Yt = {
759
+ container: Ln
1675
760
  };
1676
- function xr({
1677
- inputValue: n,
761
+ function yn({
762
+ inputValue: e,
1678
763
  onInputChange: t,
1679
- onSubmit: r,
764
+ onSubmit: a,
1680
765
  onKeyDown: i,
1681
- textareaRef: a,
1682
- placeholder: s,
1683
- isProcessing: u,
1684
- onStop: h,
1685
- fromCompact: f = !1,
1686
- onExpand: p,
1687
- disabled: m,
1688
- notice: g,
1689
- suggestions: C,
1690
- clearSuggestions: E,
1691
- focusOnMount: D,
1692
- customActions: H,
1693
- actionOrder: B
766
+ textareaRef: s,
767
+ placeholder: o,
768
+ isProcessing: r,
769
+ onStop: g,
770
+ fromCompact: u = !1,
771
+ onExpand: m,
772
+ disabled: f,
773
+ notice: v,
774
+ suggestions: y,
775
+ clearSuggestions: b,
776
+ focusOnMount: T,
777
+ customActions: L,
778
+ actionOrder: O
1694
779
  }) {
1695
- const M = V(
1696
- (j) => {
1697
- t(j), E == null || E();
780
+ const D = p(
781
+ (N) => {
782
+ t(N), b == null || b();
1698
783
  },
1699
- [t, E]
784
+ [t, b]
1700
785
  );
1701
- return /* @__PURE__ */ o.jsxs(
1702
- q.div,
786
+ return /* @__PURE__ */ _(
787
+ M.div,
1703
788
  {
1704
789
  "data-slot": "chat-footer",
1705
- className: _r.container,
790
+ className: Yt.container,
1706
791
  initial: { opacity: 0, scale: 1 },
1707
792
  animate: { opacity: 1, scale: 1 },
1708
- transition: { ...De },
793
+ transition: { ...lt },
1709
794
  children: [
1710
- !n && /* @__PURE__ */ o.jsx(
1711
- yr,
795
+ !e && /* @__PURE__ */ n(
796
+ Xt,
1712
797
  {
1713
- suggestions: C,
1714
- onSubmit: M
798
+ suggestions: y,
799
+ onSubmit: D
1715
800
  }
1716
801
  ),
1717
- g && /* @__PURE__ */ o.jsx(
1718
- mr,
802
+ v && /* @__PURE__ */ n(
803
+ he,
1719
804
  {
1720
- icon: g.icon,
1721
- message: g.message,
1722
- action: g.action,
1723
- dismissible: g.dismissible,
1724
- onDismiss: g.onDismiss
805
+ icon: v.icon,
806
+ message: v.message,
807
+ action: v.action,
808
+ dismissible: v.dismissible,
809
+ onDismiss: v.onDismiss
1725
810
  }
1726
811
  ),
1727
- /* @__PURE__ */ o.jsx(
1728
- Zt,
812
+ /* @__PURE__ */ n(
813
+ Kt,
1729
814
  {
1730
- value: n,
815
+ value: e,
1731
816
  onChange: t,
1732
- onSubmit: r,
817
+ onSubmit: a,
1733
818
  onKeyDown: i,
1734
- textareaRef: a,
1735
- placeholder: s,
1736
- isProcessing: u,
1737
- onStop: h,
1738
- fromCompact: f,
1739
- onExpand: p,
819
+ textareaRef: s,
820
+ placeholder: o,
821
+ isProcessing: r,
822
+ onStop: g,
823
+ fromCompact: u,
824
+ onExpand: m,
1740
825
  showExpandButton: !1,
1741
- focusOnMount: D,
1742
- customActions: H,
1743
- actionOrder: B,
1744
- disabled: m
826
+ focusOnMount: T,
827
+ customActions: L,
828
+ actionOrder: O,
829
+ disabled: f
1745
830
  }
1746
831
  )
1747
832
  ]
1748
833
  }
1749
834
  );
1750
835
  }
1751
- const br = "MessageActions-module_container", It = {
1752
- container: br
836
+ const In = "MessageActions-module_container", qt = {
837
+ container: In
1753
838
  };
1754
- function Dt({ message: n }) {
1755
- return !n.actions || n.actions.length === 0 ? null : /* @__PURE__ */ o.jsx(
839
+ function Jt({ message: e }) {
840
+ return !e.actions || e.actions.length === 0 ? null : /* @__PURE__ */ n(
1756
841
  "div",
1757
842
  {
1758
- className: It.container,
843
+ className: qt.container,
1759
844
  "data-visible": "true",
1760
845
  role: "toolbar",
1761
846
  "aria-label": "Message actions",
1762
- children: n.actions.map((t) => /* @__PURE__ */ o.jsx(
1763
- ee,
847
+ children: e.actions.map((t) => /* @__PURE__ */ n(
848
+ Y,
1764
849
  {
1765
- className: It.button,
850
+ className: qt.button,
1766
851
  icon: t.icon,
1767
- onClick: () => t.onClick(n),
852
+ onClick: () => t.onClick(e),
1768
853
  variant: "ghost",
1769
854
  size: "sm",
1770
855
  type: "button",
@@ -1780,113 +865,114 @@ function Dt({ message: n }) {
1780
865
  }
1781
866
  );
1782
867
  }
1783
- const wr = "Message-module_message", Er = "Message-module_user", Rr = "Message-module_bubble", Tr = "Message-module_error", jr = "Message-module_content", Be = {
1784
- message: wr,
1785
- user: Er,
1786
- bubble: Rr,
1787
- error: Tr,
1788
- content: jr
1789
- }, Lr = Ze.forwardRef(
1790
- function({ message: t, messageRenderer: r = Cn }, i) {
1791
- const a = () => /* @__PURE__ */ o.jsx(o.Fragment, { children: t.content.map((s, u) => {
1792
- if (s.type === "text" && s.text)
1793
- return /* @__PURE__ */ o.jsx(r, { children: s.text }, u);
1794
- if (s.type === "component" && s.component) {
1795
- const h = s.component;
1796
- return /* @__PURE__ */ o.jsx(
1797
- h,
868
+ const Tn = "Message-module_message", _n = "Message-module_user", bn = "Message-module_bubble", En = "Message-module_error", An = "Message-module_content", Dt = {
869
+ message: Tn,
870
+ user: _n,
871
+ bubble: bn,
872
+ error: En,
873
+ content: An
874
+ }, Sn = ee.forwardRef(
875
+ function({ message: t, messageRenderer: a = Re }, i) {
876
+ const s = () => /* @__PURE__ */ n(Ht, { children: t.content.map((o, r) => {
877
+ if (o.type === "text" && o.text)
878
+ return /* @__PURE__ */ n(a, { children: o.text }, r);
879
+ if (o.type === "component" && o.component) {
880
+ const g = o.component;
881
+ return /* @__PURE__ */ n(
882
+ g,
1798
883
  {
1799
- ...s.componentProps || {}
884
+ ...o.componentProps || {}
1800
885
  },
1801
- u
886
+ r
1802
887
  );
1803
888
  }
1804
889
  return null;
1805
890
  }) });
1806
- return /* @__PURE__ */ o.jsxs(
1807
- q.div,
891
+ return /* @__PURE__ */ _(
892
+ M.div,
1808
893
  {
1809
894
  ref: i,
1810
- variants: Wt,
895
+ variants: re,
1811
896
  initial: "hidden",
1812
897
  animate: "visible",
1813
898
  "data-slot": "message",
1814
899
  "data-role": t.role,
1815
- className: se(Be.message, Be[t.role]),
900
+ className: V(Dt.message, Dt[t.role]),
1816
901
  children: [
1817
- /* @__PURE__ */ o.jsxs("div", { className: Be.content, children: [
1818
- /* @__PURE__ */ o.jsx("div", { className: Be.bubble, children: a() }),
1819
- t.role !== "user" && /* @__PURE__ */ o.jsx(Dt, { message: t })
902
+ /* @__PURE__ */ _("div", { className: Dt.content, children: [
903
+ /* @__PURE__ */ n("div", { className: Dt.bubble, children: s() }),
904
+ t.role !== "user" && /* @__PURE__ */ n(Jt, { message: t })
1820
905
  ] }),
1821
- t.role === "user" && /* @__PURE__ */ o.jsx(Dt, { message: t })
906
+ t.role === "user" && /* @__PURE__ */ n(Jt, { message: t })
1822
907
  ]
1823
908
  }
1824
909
  );
1825
910
  }
1826
- ), Ar = "Messages-module_container", Sr = "Messages-module_emptyState", tt = {
1827
- container: Ar,
1828
- emptyState: Sr
1829
- }, Or = "Thinking-module_container", Ir = "Thinking-module_icon", Dr = "Thinking-module_content", nt = {
1830
- container: Or,
1831
- icon: Ir,
1832
- content: Dr
1833
- }, Pr = hn(
1834
- Ze.forwardRef(
1835
- function({ content: t = "Thinking…" }, r) {
1836
- const i = pn(() => /* @__PURE__ */ o.jsx(Bt, {}), []);
1837
- return /* @__PURE__ */ o.jsxs(
911
+ ), xn = "Messages-module_container", On = "Messages-module_emptyState", Wt = {
912
+ container: xn,
913
+ emptyState: On
914
+ }, Nn = "Thinking-module_container", Rn = "Thinking-module_icon", Dn = "Thinking-module_content", Bt = {
915
+ container: Nn,
916
+ icon: Rn,
917
+ content: Dn
918
+ }, Mn = xe(
919
+ ee.forwardRef(
920
+ function({ content: t = "Thinking…" }, a) {
921
+ const i = Oe(() => /* @__PURE__ */ n(se, {}), []);
922
+ return /* @__PURE__ */ _(
1838
923
  "div",
1839
924
  {
1840
- ref: r,
925
+ ref: a,
1841
926
  "data-slot": "thinking",
1842
- className: nt.container,
927
+ className: Bt.container,
1843
928
  children: [
1844
- /* @__PURE__ */ o.jsx("div", { className: nt.icon, children: i }),
1845
- /* @__PURE__ */ o.jsx("span", { className: nt.content, children: t })
929
+ /* @__PURE__ */ n("div", { className: Bt.icon, children: i }),
930
+ /* @__PURE__ */ n("span", { className: Bt.content, children: t })
1846
931
  ]
1847
932
  }
1848
933
  );
1849
934
  }
1850
935
  )
1851
936
  );
1852
- function Fr({
1853
- messages: n,
937
+ function pe({
938
+ messages: e,
1854
939
  isProcessing: t,
1855
- error: r,
940
+ error: a,
1856
941
  emptyView: i,
1857
- messageRenderer: a
942
+ messageRenderer: s,
943
+ className: o
1858
944
  }) {
1859
- const s = W(null), u = W([]), h = W(!0), f = W(null);
1860
- return J(() => {
1861
- const p = n.length > u.current.length;
1862
- if (h.current && n.length > 0 && s.current ? s.current.scrollTop = s.current.scrollHeight : p && !h.current && s.current && s.current.scrollTo({
1863
- top: s.current.scrollHeight,
945
+ const r = I(null), g = I([]), u = I(!0), m = I(null);
946
+ return E(() => {
947
+ const f = e.length > g.current.length;
948
+ if (u.current && e.length > 0 && r.current ? r.current.scrollTop = r.current.scrollHeight : f && !u.current && r.current && r.current.scrollTo({
949
+ top: r.current.scrollHeight,
1864
950
  behavior: "smooth"
1865
- }), p && f.current) {
1866
- const g = n.slice(
1867
- u.current.length
951
+ }), f && m.current) {
952
+ const y = e.slice(
953
+ g.current.length
1868
954
  ).filter(
1869
- (C) => C.role === "agent"
955
+ (b) => b.role === "agent"
1870
956
  );
1871
- if (g.length > 0) {
1872
- const E = g[g.length - 1].content.filter((D) => D.type === "text").map((D) => D.text).join(" ");
1873
- E && (f.current.textContent = E);
957
+ if (y.length > 0) {
958
+ const T = y[y.length - 1].content.filter((L) => L.type === "text").map((L) => L.text).join(" ");
959
+ T && (m.current.textContent = T);
1874
960
  }
1875
961
  }
1876
- h.current && (h.current = !1), u.current = n;
1877
- }, [n]), n.length === 0 ? i ? /* @__PURE__ */ o.jsx(
962
+ u.current && (u.current = !1), g.current = e;
963
+ }, [e]), e.length === 0 ? i ? /* @__PURE__ */ n(
1878
964
  "div",
1879
965
  {
1880
966
  "data-slot": "messages",
1881
- className: `${tt.container} ${tt.emptyState}`,
1882
- ref: s,
967
+ className: `${Wt.container} ${Wt.emptyState}`,
968
+ ref: r,
1883
969
  children: i
1884
970
  }
1885
- ) : null : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
1886
- /* @__PURE__ */ o.jsx(
971
+ ) : null : /* @__PURE__ */ _(Ht, { children: [
972
+ /* @__PURE__ */ n(
1887
973
  "div",
1888
974
  {
1889
- ref: f,
975
+ ref: m,
1890
976
  "aria-live": "polite",
1891
977
  "aria-atomic": "true",
1892
978
  style: {
@@ -1898,23 +984,23 @@ function Fr({
1898
984
  }
1899
985
  }
1900
986
  ),
1901
- /* @__PURE__ */ o.jsx(
987
+ /* @__PURE__ */ n(
1902
988
  "div",
1903
989
  {
1904
990
  "data-slot": "messages",
1905
- className: tt.container,
1906
- ref: s,
1907
- children: /* @__PURE__ */ o.jsxs(Ue, { mode: "popLayout", children: [
1908
- n.map((p) => /* @__PURE__ */ o.jsx(
1909
- Lr,
991
+ className: Wt.container,
992
+ ref: r,
993
+ children: /* @__PURE__ */ _(_t, { mode: "popLayout", children: [
994
+ e.map((f) => /* @__PURE__ */ n(
995
+ Sn,
1910
996
  {
1911
- message: p,
1912
- messageRenderer: a
997
+ message: f,
998
+ messageRenderer: s
1913
999
  },
1914
- p.id
1000
+ f.id
1915
1001
  )),
1916
- t && /* @__PURE__ */ o.jsx(Pr, {}),
1917
- r && /* @__PURE__ */ o.jsx(
1002
+ t && /* @__PURE__ */ n(Mn, {}),
1003
+ a && /* @__PURE__ */ n(
1918
1004
  "div",
1919
1005
  {
1920
1006
  className: "error-message",
@@ -1923,7 +1009,7 @@ function Fr({
1923
1009
  padding: "1rem",
1924
1010
  textAlign: "center"
1925
1011
  },
1926
- children: r
1012
+ children: a
1927
1013
  }
1928
1014
  )
1929
1015
  ] })
@@ -1931,83 +1017,83 @@ function Fr({
1931
1017
  )
1932
1018
  ] });
1933
1019
  }
1934
- const Mr = "ConversationView-module_container", kr = "ConversationView-module_withHeader", Pt = {
1935
- container: Mr,
1936
- withHeader: kr
1020
+ const Pn = "ConversationView-module_container", Vn = "ConversationView-module_withHeader", Tt = {
1021
+ container: Pn,
1022
+ withHeader: Vn
1937
1023
  };
1938
- function Ft({
1939
- messages: n,
1024
+ function Qt({
1025
+ messages: e,
1940
1026
  error: t,
1941
- inputValue: r,
1027
+ inputValue: a,
1942
1028
  onInputChange: i,
1943
- onSubmit: a,
1944
- onKeyDown: s,
1945
- textareaRef: u,
1946
- placeholder: h,
1947
- isProcessing: f,
1948
- onStop: p,
1949
- fromCompact: m = !1,
1950
- showHeader: g = !1,
1951
- onClose: C,
1952
- onExpand: E,
1953
- notice: D,
1954
- emptyView: H,
1955
- suggestions: B,
1956
- clearSuggestions: M,
1957
- messageRenderer: j,
1958
- focusOnMount: K = !1
1029
+ onSubmit: s,
1030
+ onKeyDown: o,
1031
+ textareaRef: r,
1032
+ placeholder: g,
1033
+ isProcessing: u,
1034
+ onStop: m,
1035
+ fromCompact: f = !1,
1036
+ showHeader: v = !1,
1037
+ onClose: y,
1038
+ onExpand: b,
1039
+ notice: T,
1040
+ emptyView: L,
1041
+ suggestions: O,
1042
+ clearSuggestions: D,
1043
+ messageRenderer: N,
1044
+ focusOnMount: H = !1
1959
1045
  }) {
1960
- return J(() => {
1961
- const l = (v) => {
1962
- v.key === "Escape" && C && C();
1046
+ return E(() => {
1047
+ const c = ($) => {
1048
+ $.key === "Escape" && y && y();
1963
1049
  };
1964
- return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
1965
- }, [C]), /* @__PURE__ */ o.jsxs(
1050
+ return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
1051
+ }, [y]), /* @__PURE__ */ _(
1966
1052
  "div",
1967
1053
  {
1968
1054
  "data-slot": "conversation-view",
1969
- className: `${Pt.container}${g ? ` ${Pt.withHeader}` : ""}`,
1055
+ className: `${Tt.container}${v ? ` ${Tt.withHeader}` : ""}`,
1970
1056
  children: [
1971
- g && /* @__PURE__ */ o.jsx(cr, { onClose: C }),
1972
- /* @__PURE__ */ o.jsx(
1973
- Fr,
1057
+ v && /* @__PURE__ */ n(fe, { onClose: y }),
1058
+ /* @__PURE__ */ n(
1059
+ pe,
1974
1060
  {
1975
- messages: n,
1976
- isProcessing: f,
1061
+ messages: e,
1062
+ isProcessing: u,
1977
1063
  error: t,
1978
- emptyView: H,
1979
- messageRenderer: j
1064
+ emptyView: L,
1065
+ messageRenderer: N
1980
1066
  }
1981
1067
  ),
1982
- /* @__PURE__ */ o.jsx(
1983
- xr,
1068
+ /* @__PURE__ */ n(
1069
+ yn,
1984
1070
  {
1985
- inputValue: r,
1071
+ inputValue: a,
1986
1072
  onInputChange: i,
1987
- onSubmit: a,
1988
- onKeyDown: s,
1989
- textareaRef: u,
1990
- placeholder: h,
1991
- isProcessing: f,
1992
- onStop: p,
1993
- fromCompact: m,
1994
- onExpand: E,
1995
- notice: D,
1996
- suggestions: B,
1997
- clearSuggestions: M,
1998
- focusOnMount: K
1073
+ onSubmit: s,
1074
+ onKeyDown: o,
1075
+ textareaRef: r,
1076
+ placeholder: g,
1077
+ isProcessing: u,
1078
+ onStop: m,
1079
+ fromCompact: f,
1080
+ onExpand: b,
1081
+ notice: T,
1082
+ suggestions: O,
1083
+ clearSuggestions: D,
1084
+ focusOnMount: H
1999
1085
  }
2000
1086
  )
2001
1087
  ]
2002
1088
  }
2003
1089
  );
2004
1090
  }
2005
- const $r = "Chat-module_container", Hr = "Chat-module_embedded", Nr = "Chat-module_floating", Vr = "Chat-module_content", Se = {
2006
- container: $r,
2007
- embedded: Hr,
2008
- floating: Nr,
2009
- content: Vr
2010
- }, $ = {
1091
+ const Hn = "Chat-module_container", $n = "Chat-module_embedded", Fn = "Chat-module_floating", kn = "Chat-module_content", Z = {
1092
+ container: Hn,
1093
+ embedded: $n,
1094
+ floating: Fn,
1095
+ content: kn
1096
+ }, S = {
2011
1097
  COLLAPSED_SIZE: 56,
2012
1098
  COMPACT_WIDTH: 372,
2013
1099
  EXPANDED_HEIGHT: 520,
@@ -2015,7 +1101,7 @@ const $r = "Chat-module_container", Hr = "Chat-module_embedded", Nr = "Chat-modu
2015
1101
  BORDER_RADIUS: 24,
2016
1102
  PADDING: 16,
2017
1103
  VIEWPORT_OFFSET: 16
2018
- }, Oe = {
1104
+ }, yt = {
2019
1105
  SPRING_CONFIG: {
2020
1106
  type: "spring",
2021
1107
  damping: 25,
@@ -2028,264 +1114,266 @@ const $r = "Chat-module_container", Hr = "Chat-module_embedded", Nr = "Chat-modu
2028
1114
  '[data-slot="chat-footer"]'
2029
1115
  ].join(", ")
2030
1116
  };
2031
- function Wr({
2032
- messages: n,
1117
+ function jn({
1118
+ messages: e,
2033
1119
  isProcessing: t,
2034
- error: r,
1120
+ error: a,
2035
1121
  onSubmit: i,
2036
- variant: a = "floating",
2037
- triggerIcon: s,
2038
- placeholder: u = Vt,
2039
- notice: h,
2040
- onOpen: f,
2041
- onExpand: p,
2042
- onClose: m,
2043
- onStop: g,
2044
- emptyView: C,
2045
- floatingChatState: E,
2046
- suggestions: D,
2047
- clearSuggestions: H,
2048
- messageRenderer: B,
2049
- className: M
1122
+ variant: s = "floating",
1123
+ triggerIcon: o,
1124
+ placeholder: r = ie,
1125
+ notice: g,
1126
+ onOpen: u,
1127
+ onExpand: m,
1128
+ onClose: f,
1129
+ onStop: v,
1130
+ emptyView: y,
1131
+ floatingChatState: b,
1132
+ suggestions: T,
1133
+ clearSuggestions: L,
1134
+ messageRenderer: O,
1135
+ className: D
2050
1136
  }) {
2051
- const [j, K] = Ee(""), l = bn(E), v = W(!1), _ = W(!1), A = W(!1), [O, T] = Ee(!1);
2052
- J(() => {
2053
- v.current = !1, _.current = !1, A.current = !1;
2054
- }, [l.state]);
2055
- const Z = W(/* @__PURE__ */ new Set()), Pe = V(() => {
2056
- Z.current.forEach((x) => {
2057
- clearTimeout(x);
2058
- }), Z.current.clear();
2059
- }, []), S = wn({
2060
- value: j,
2061
- setValue: K,
2062
- onSubmit: async (x) => {
2063
- l.state !== "expanded" && (p == null || p()), l.setState("expanded"), await i(x);
1137
+ const [N, H] = W(""), c = oe(b), $ = I(!1), B = I(!1), P = I(!1), [tt, K] = W(!1);
1138
+ E(() => {
1139
+ $.current = !1, B.current = !1, P.current = !1;
1140
+ }, [c.state]);
1141
+ const F = I(/* @__PURE__ */ new Set()), l = p(() => {
1142
+ F.current.forEach((C) => {
1143
+ clearTimeout(C);
1144
+ }), F.current.clear();
1145
+ }, []), d = ae({
1146
+ value: N,
1147
+ setValue: H,
1148
+ onSubmit: async (C) => {
1149
+ c.state !== "expanded" && (m == null || m()), c.setState("expanded"), await i(C);
2064
1150
  },
2065
1151
  isProcessing: t
2066
- }), [z, te] = Ee(56), [ne, Fe] = Ee(
1152
+ }), [gt, vt] = W(56), [wt, bt] = W(
2067
1153
  "left"
2068
- ), de = W(null), le = W(null), Q = W(null), re = _t(0), ie = _t(0), he = vn(), Me = V(() => {
2069
- v.current = !0, l.open(), f == null || f();
2070
- }, [l, f]), ce = V(() => {
2071
- var k, U, X;
2072
- const x = (U = (k = Q.current) == null ? void 0 : k.ownerDocument) == null ? void 0 : U.activeElement;
2073
- return !(x && ((X = Q.current) != null && X.contains(x)) || j.trim());
2074
- }, [j, Q]), Ge = (x) => x === "collapsed" ? $.COLLAPSED_SIZE : x === "compact" ? z : $.EXPANDED_HEIGHT, Te = V(() => {
2075
- if (l.state === "collapsed" && (l.setState("compact"), l.initialState === "collapsed")) {
2076
- const x = setTimeout(() => {
2077
- l.state === "compact" && ce() && l.setState("collapsed"), Z.current.delete(x);
2078
- }, $.AUTO_COLLAPSE_DELAY);
2079
- Z.current.add(x);
2080
- }
2081
- }, [l, ce]), pe = V(() => {
2082
- if (l.initialState === "collapsed" && l.state === "compact" && ce()) {
2083
- const x = setTimeout(() => {
2084
- l.state === "compact" && ce() && l.setState("collapsed"), Z.current.delete(x);
2085
- }, $.AUTO_COLLAPSE_DELAY);
2086
- Z.current.add(x);
2087
- }
2088
- }, [l, ce]), ae = V(async () => {
2089
- if (S.value.trim()) {
2090
- const x = S.value.trim();
2091
- S.clear(), l.state !== "expanded" && (p == null || p()), l.setState("expanded"), await i(x);
2092
- }
2093
- }, [S, i, l, p]), ue = V(() => {
2094
- A.current = !0, p == null || p(), l.setState("expanded");
2095
- }, [p, l]), ve = V(() => {
2096
- _.current = !0, S.clear(), l.close(), m && m();
2097
- }, [S, l, m]), me = V(
2098
- (x) => {
2099
- if (!Q.current || !le.current)
1154
+ ), k = I(null), et = I(null), w = I(null), nt = Mt(0), ot = Mt(0), at = ne(), Ft = p(() => {
1155
+ $.current = !0, c.open(), u == null || u();
1156
+ }, [c, u]), X = p(() => {
1157
+ var A, U, G;
1158
+ const C = (U = (A = w.current) == null ? void 0 : A.ownerDocument) == null ? void 0 : U.activeElement;
1159
+ return !(C && ((G = w.current) != null && G.contains(C)) || N.trim());
1160
+ }, [N, w]), dt = (C) => C === "collapsed" ? S.COLLAPSED_SIZE : C === "compact" ? gt : S.EXPANDED_HEIGHT, j = p(() => {
1161
+ if (c.state === "collapsed" && (c.setState("compact"), c.initialState === "collapsed")) {
1162
+ const C = setTimeout(() => {
1163
+ c.state === "compact" && X() && c.setState("collapsed"), F.current.delete(C);
1164
+ }, S.AUTO_COLLAPSE_DELAY);
1165
+ F.current.add(C);
1166
+ }
1167
+ }, [c, X]), Q = p(() => {
1168
+ if (c.initialState === "collapsed" && c.state === "compact" && X()) {
1169
+ const C = setTimeout(() => {
1170
+ c.state === "compact" && X() && c.setState("collapsed"), F.current.delete(C);
1171
+ }, S.AUTO_COLLAPSE_DELAY);
1172
+ F.current.add(C);
1173
+ }
1174
+ }, [c, X]), z = p(async () => {
1175
+ if (d.value.trim()) {
1176
+ const C = d.value.trim();
1177
+ d.clear(), c.state !== "expanded" && (m == null || m()), c.setState("expanded"), await i(C);
1178
+ }
1179
+ }, [d, i, c, m]), it = p(() => {
1180
+ P.current = !0, m == null || m(), c.setState("expanded");
1181
+ }, [m, c]), kt = p(() => {
1182
+ B.current = !0, d.clear(), c.close(), f && f();
1183
+ }, [d, c, f]), rt = p(
1184
+ (C) => {
1185
+ if (!w.current || !et.current)
2100
1186
  return null;
2101
- const k = Q.current.getBoundingClientRect(), U = le.current.getBoundingClientRect(), X = window.getComputedStyle(Q.current), ye = new DOMMatrixReadOnly(X.transform), He = k.x - ye.e, oe = k.y - ye.f, Xe = (x ?? ne) === "left" ? U.left : U.right - $.COMPACT_WIDTH, Ne = U.bottom - $.EXPANDED_HEIGHT;
1187
+ const A = w.current.getBoundingClientRect(), U = et.current.getBoundingClientRect(), G = window.getComputedStyle(w.current), mt = new DOMMatrixReadOnly(G.transform), St = A.x - mt.e, ct = A.y - mt.f, xt = (C ?? wt) === "left" ? U.left : U.right - S.COMPACT_WIDTH, h = U.bottom - S.EXPANDED_HEIGHT;
2102
1188
  return {
2103
- x: Xe - He,
2104
- y: Ne - oe
1189
+ x: xt - St,
1190
+ y: h - ct
2105
1191
  };
2106
1192
  },
2107
- [ne]
2108
- ), ke = V(
2109
- (x) => {
2110
- x.target.closest(
2111
- Oe.NON_DRAGGABLE_SELECTORS
2112
- ) || he.start(x.nativeEvent);
1193
+ [wt]
1194
+ ), st = p(
1195
+ (C) => {
1196
+ C.target.closest(
1197
+ yt.NON_DRAGGABLE_SELECTORS
1198
+ ) || at.start(C.nativeEvent);
2113
1199
  },
2114
- [he]
2115
- ), Ke = V(
2116
- (x, k) => {
2117
- const U = k.point.x, X = $.COMPACT_WIDTH, ye = (window.innerWidth - X) / 2, oe = U < ye ? "left" : "right";
2118
- Fe(oe);
2119
- const Ce = me(oe);
2120
- Ce && (xt(re, Ce.x, {
2121
- ...Oe.SPRING_CONFIG,
2122
- velocity: k.velocity.x * Oe.VELOCITY_MULTIPLIER
2123
- }), xt(ie, Ce.y, {
2124
- ...Oe.SPRING_CONFIG,
2125
- velocity: k.velocity.y * Oe.VELOCITY_MULTIPLIER
1200
+ [at]
1201
+ ), Ut = p(
1202
+ (C, A) => {
1203
+ const U = A.point.x, G = S.COMPACT_WIDTH, mt = (window.innerWidth - G) / 2, ct = U < mt ? "left" : "right";
1204
+ bt(ct);
1205
+ const ft = rt(ct);
1206
+ ft && (Pt(nt, ft.x, {
1207
+ ...yt.SPRING_CONFIG,
1208
+ velocity: A.velocity.x * yt.VELOCITY_MULTIPLIER
1209
+ }), Pt(ot, ft.y, {
1210
+ ...yt.SPRING_CONFIG,
1211
+ velocity: A.velocity.y * yt.VELOCITY_MULTIPLIER
2126
1212
  }));
2127
1213
  },
2128
- [re, ie, me]
2129
- ), $e = W(l.state), ge = $e.current === "compact" && l.state === "expanded";
2130
- return J(() => {
2131
- Pe(), $e.current = l.state;
2132
- }, [l.state, Pe]), J(() => {
2133
- if (l.state !== "expanded")
1214
+ [nt, ot, rt]
1215
+ ), Et = I(c.state), At = Et.current === "compact" && c.state === "expanded";
1216
+ return E(() => {
1217
+ l(), Et.current = c.state;
1218
+ }, [c.state, l]), E(() => {
1219
+ if (c.state !== "expanded")
2134
1220
  return;
2135
- const x = () => {
2136
- const k = me();
2137
- k && (re.set(k.x), ie.set(k.y));
1221
+ const C = () => {
1222
+ const A = rt();
1223
+ A && (nt.set(A.x), ot.set(A.y));
2138
1224
  };
2139
- return window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
2140
- }, [l.state, re, ie, me]), J(() => {
2141
- const x = Z.current;
1225
+ return window.addEventListener("resize", C), () => window.removeEventListener("resize", C);
1226
+ }, [c.state, nt, ot, rt]), E(() => {
1227
+ const C = F.current;
2142
1228
  return () => {
2143
- x.forEach((k) => {
2144
- clearTimeout(k);
2145
- }), x.clear();
1229
+ C.forEach((A) => {
1230
+ clearTimeout(A);
1231
+ }), C.clear();
2146
1232
  };
2147
- }, []), J(() => {
2148
- if (l.state === "compact" && de.current) {
2149
- const x = de.current.scrollHeight + $.PADDING;
2150
- te(x);
1233
+ }, []), E(() => {
1234
+ if (c.state === "compact" && k.current) {
1235
+ const C = k.current.scrollHeight + S.PADDING;
1236
+ vt(C);
2151
1237
  }
2152
- }, [l.state, S.value]), a === "embedded" ? /* @__PURE__ */ o.jsx(
1238
+ }, [c.state, d.value]), s === "embedded" ? /* @__PURE__ */ n(
2153
1239
  "div",
2154
1240
  {
2155
1241
  "data-slot": "chat-embedded",
2156
- className: se(M, Se.container, Se.embedded),
2157
- children: /* @__PURE__ */ o.jsx(
2158
- Ft,
1242
+ className: V(D, Z.container, Z.embedded),
1243
+ children: /* @__PURE__ */ n(
1244
+ Qt,
2159
1245
  {
2160
- messages: n,
2161
- inputValue: S.value,
2162
- onInputChange: S.setValue,
2163
- onSubmit: ae,
2164
- onKeyDown: S.handleKeyDown,
2165
- textareaRef: S.textareaRef,
2166
- placeholder: u,
1246
+ messages: e,
1247
+ inputValue: d.value,
1248
+ onInputChange: d.setValue,
1249
+ onSubmit: z,
1250
+ onKeyDown: d.handleKeyDown,
1251
+ textareaRef: d.textareaRef,
1252
+ placeholder: r,
2167
1253
  isProcessing: t,
2168
- onStop: g,
1254
+ onStop: v,
2169
1255
  showHeader: !1,
2170
- notice: h,
2171
- suggestions: D,
2172
- clearSuggestions: H,
2173
- error: r,
2174
- emptyView: C,
2175
- messageRenderer: B,
2176
- onExpand: ue,
2177
- focusOnMount: A.current
1256
+ notice: g,
1257
+ suggestions: T,
1258
+ clearSuggestions: L,
1259
+ error: a,
1260
+ emptyView: y,
1261
+ messageRenderer: O,
1262
+ onExpand: it,
1263
+ focusOnMount: P.current
2178
1264
  }
2179
1265
  )
2180
1266
  }
2181
- ) : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
2182
- /* @__PURE__ */ o.jsx(
1267
+ ) : /* @__PURE__ */ _(Ht, { children: [
1268
+ /* @__PURE__ */ n(
2183
1269
  "div",
2184
1270
  {
2185
- ref: le,
1271
+ ref: et,
2186
1272
  style: {
2187
1273
  position: "fixed",
2188
- top: $.VIEWPORT_OFFSET,
2189
- left: $.VIEWPORT_OFFSET,
2190
- right: $.VIEWPORT_OFFSET,
2191
- bottom: $.VIEWPORT_OFFSET,
1274
+ top: S.VIEWPORT_OFFSET,
1275
+ left: S.VIEWPORT_OFFSET,
1276
+ right: S.VIEWPORT_OFFSET,
1277
+ bottom: S.VIEWPORT_OFFSET,
2192
1278
  pointerEvents: "none"
2193
1279
  }
2194
1280
  }
2195
1281
  ),
2196
- /* @__PURE__ */ o.jsx(
2197
- q.div,
1282
+ /* @__PURE__ */ n(
1283
+ M.div,
2198
1284
  {
2199
- ref: Q,
1285
+ ref: w,
2200
1286
  "data-slot": "chat-floating",
2201
- className: se(M, Se.container, Se.floating, {
2202
- animating: O
1287
+ className: V(D, Z.container, Z.floating, {
1288
+ animating: tt
2203
1289
  }),
2204
- onMouseLeave: l.state === "compact" ? pe : void 0,
2205
- drag: l.state === "expanded",
2206
- dragControls: he,
1290
+ onMouseLeave: c.state === "compact" ? Q : void 0,
1291
+ drag: c.state === "expanded",
1292
+ dragControls: at,
2207
1293
  dragListener: !1,
2208
- dragConstraints: le,
1294
+ dragConstraints: et,
2209
1295
  dragMomentum: !1,
2210
1296
  dragElastic: 0.1,
2211
1297
  dragTransition: { power: 0.1, timeConstant: 100 },
2212
- onDragEnd: Ke,
2213
- onPointerDown: ke,
1298
+ onDragEnd: Ut,
1299
+ onPointerDown: st,
2214
1300
  style: {
2215
- x: re,
2216
- y: ie,
2217
- bottom: $.VIEWPORT_OFFSET,
2218
- left: $.VIEWPORT_OFFSET
1301
+ x: nt,
1302
+ y: ot,
1303
+ bottom: S.VIEWPORT_OFFSET,
1304
+ left: S.VIEWPORT_OFFSET
2219
1305
  },
2220
- children: /* @__PURE__ */ o.jsx(
2221
- q.div,
1306
+ children: /* @__PURE__ */ n(
1307
+ M.div,
2222
1308
  {
2223
1309
  layout: !0,
2224
- className: Se.content,
1310
+ className: Z.content,
2225
1311
  initial: !1,
2226
1312
  animate: {
2227
- width: l.state === "collapsed" ? $.COLLAPSED_SIZE : $.COMPACT_WIDTH,
2228
- height: Ge(l.state),
2229
- x: l.state === "collapsed" && ne === "right" ? $.COMPACT_WIDTH - $.COLLAPSED_SIZE : 0,
2230
- transition: S.value.trim() ? { duration: 0 } : lt
1313
+ width: c.state === "collapsed" ? S.COLLAPSED_SIZE : S.COMPACT_WIDTH,
1314
+ height: dt(c.state),
1315
+ x: c.state === "collapsed" && wt === "right" ? S.COMPACT_WIDTH - S.COLLAPSED_SIZE : 0,
1316
+ transition: d.value.trim() ? { duration: 0 } : $t
2231
1317
  },
2232
- onAnimationStart: () => T(!0),
2233
- onAnimationComplete: () => T(!1),
1318
+ onAnimationStart: () => K(!0),
1319
+ onAnimationComplete: () => K(!1),
2234
1320
  style: {
2235
- borderRadius: $.BORDER_RADIUS
1321
+ borderRadius: S.BORDER_RADIUS
2236
1322
  },
2237
- children: /* @__PURE__ */ o.jsxs(Ue, { mode: "wait", children: [
2238
- l.state === "collapsed" && /* @__PURE__ */ o.jsx(
2239
- Gn,
1323
+ children: /* @__PURE__ */ _(_t, { mode: "wait", children: [
1324
+ c.state === "collapsed" && /* @__PURE__ */ n(
1325
+ ce,
2240
1326
  {
2241
- icon: s,
2242
- onClick: Me,
2243
- onHover: Te,
2244
- focusOnMount: _.current
1327
+ icon: o,
1328
+ onClick: Ft,
1329
+ onHover: j,
1330
+ focusOnMount: B.current
2245
1331
  },
2246
1332
  "collapsed"
2247
1333
  ),
2248
- l.state === "compact" && /* @__PURE__ */ o.jsx("div", { ref: de, children: /* @__PURE__ */ o.jsx(
2249
- or,
1334
+ c.state === "compact" && /* @__PURE__ */ n("div", { ref: k, children: /* @__PURE__ */ n(
1335
+ de,
2250
1336
  {
2251
- value: S.value,
2252
- onChange: S.setValue,
2253
- onSubmit: ae,
2254
- onKeyDown: S.handleKeyDown,
2255
- textareaRef: S.textareaRef,
2256
- placeholder: u,
1337
+ value: d.value,
1338
+ onChange: d.setValue,
1339
+ onSubmit: z,
1340
+ onKeyDown: d.handleKeyDown,
1341
+ textareaRef: d.textareaRef,
1342
+ placeholder: r,
2257
1343
  isProcessing: t,
2258
- onBlur: pe,
2259
- onExpand: ue,
2260
- showExpandButton: !S.value.trim(),
2261
- focusOnMount: v.current,
2262
- onStop: g
1344
+ onBlur: Q,
1345
+ onExpand: it,
1346
+ showExpandButton: !d.value.trim(),
1347
+ focusOnMount: $.current,
1348
+ onStop: v,
1349
+ suggestions: T,
1350
+ clearSuggestions: L
2263
1351
  },
2264
1352
  "compact"
2265
1353
  ) }),
2266
- l.state === "expanded" && /* @__PURE__ */ o.jsx(
2267
- Ft,
1354
+ c.state === "expanded" && /* @__PURE__ */ n(
1355
+ Qt,
2268
1356
  {
2269
- messages: n,
2270
- inputValue: S.value,
2271
- onInputChange: S.setValue,
2272
- onSubmit: ae,
2273
- onKeyDown: S.handleKeyDown,
2274
- textareaRef: S.textareaRef,
2275
- placeholder: u,
1357
+ messages: e,
1358
+ inputValue: d.value,
1359
+ onInputChange: d.setValue,
1360
+ onSubmit: z,
1361
+ onKeyDown: d.handleKeyDown,
1362
+ textareaRef: d.textareaRef,
1363
+ placeholder: r,
2276
1364
  isProcessing: t,
2277
- onStop: g,
1365
+ onStop: v,
2278
1366
  showHeader: !0,
2279
- onClose: ve,
2280
- fromCompact: ge,
2281
- notice: h,
2282
- suggestions: D,
2283
- clearSuggestions: H,
2284
- error: r,
2285
- emptyView: C,
2286
- messageRenderer: B,
2287
- onExpand: ue,
2288
- focusOnMount: A.current
1367
+ onClose: kt,
1368
+ fromCompact: At,
1369
+ notice: g,
1370
+ suggestions: T,
1371
+ clearSuggestions: L,
1372
+ error: a,
1373
+ emptyView: y,
1374
+ messageRenderer: O,
1375
+ onExpand: it,
1376
+ focusOnMount: P.current
2289
1377
  },
2290
1378
  "expanded"
2291
1379
  )
@@ -2296,50 +1384,480 @@ function Wr({
2296
1384
  )
2297
1385
  ] });
2298
1386
  }
2299
- const vi = ({
2300
- messages: n,
2301
- isProcessing: t,
2302
- error: r,
2303
- onSubmit: i,
2304
- variant: a = "floating",
2305
- triggerIcon: s,
2306
- placeholder: u,
2307
- notice: h,
2308
- emptyView: f,
2309
- onOpen: p,
2310
- onExpand: m,
2311
- onClose: g,
2312
- onStop: C,
2313
- floatingChatState: E,
2314
- suggestions: D,
2315
- clearSuggestions: H,
2316
- messageRenderer: B,
2317
- className: M
2318
- }) => /* @__PURE__ */ o.jsx(
2319
- Wr,
2320
- {
2321
- messages: n,
2322
- isProcessing: t,
2323
- error: r,
2324
- onSubmit: i,
2325
- variant: a,
2326
- triggerIcon: s,
2327
- placeholder: u,
2328
- notice: h,
2329
- emptyView: f,
2330
- onOpen: p,
2331
- onExpand: m,
2332
- onClose: g,
2333
- onStop: C,
2334
- floatingChatState: E,
2335
- suggestions: D,
2336
- clearSuggestions: H,
2337
- messageRenderer: B,
2338
- className: se("agenttic", M)
2339
- }
1387
+ const x = {
1388
+ COLLAPSED_SIZE: 56,
1389
+ COMPACT_WIDTH: 372,
1390
+ EXPANDED_HEIGHT: 520,
1391
+ AUTO_COLLAPSE_DELAY: 1500,
1392
+ BORDER_RADIUS: 24,
1393
+ PADDING: 16,
1394
+ VIEWPORT_OFFSET: 16
1395
+ }, It = {
1396
+ SPRING_CONFIG: {
1397
+ type: "spring",
1398
+ damping: 25,
1399
+ stiffness: 300
1400
+ },
1401
+ VELOCITY_MULTIPLIER: 0.1,
1402
+ NON_DRAGGABLE_SELECTORS: [
1403
+ '[data-slot="message"]',
1404
+ '[data-slot="chat-input"]',
1405
+ '[data-slot="chat-footer"]'
1406
+ ].join(", ")
1407
+ };
1408
+ function Ce({
1409
+ children: e,
1410
+ messages: t,
1411
+ isProcessing: a,
1412
+ error: i,
1413
+ onSubmit: s,
1414
+ variant: o = "floating",
1415
+ triggerIcon: r,
1416
+ placeholder: g,
1417
+ notice: u,
1418
+ onOpen: m,
1419
+ onExpand: f,
1420
+ onClose: v,
1421
+ onStop: y,
1422
+ emptyView: b,
1423
+ floatingChatState: T,
1424
+ suggestions: L,
1425
+ clearSuggestions: O,
1426
+ messageRenderer: D,
1427
+ className: N,
1428
+ inputValue: H,
1429
+ onInputChange: c,
1430
+ ...$
1431
+ }) {
1432
+ const B = H !== void 0, [P, tt] = W(""), K = B ? H : P, F = B ? c : tt, l = oe(T), d = I(!1), gt = I(!1), vt = I(!1), [wt, bt] = W(!1);
1433
+ E(() => {
1434
+ d.current = !1, gt.current = !1, vt.current = !1;
1435
+ }, [l.state]);
1436
+ const k = I(/* @__PURE__ */ new Set()), et = p(() => {
1437
+ k.current.forEach((h) => {
1438
+ clearTimeout(h);
1439
+ }), k.current.clear();
1440
+ }, []), w = ae({
1441
+ value: K,
1442
+ setValue: F,
1443
+ onSubmit: async (h) => {
1444
+ l.state !== "expanded" && (f == null || f()), l.setState("expanded"), await s(h);
1445
+ },
1446
+ isProcessing: a
1447
+ }), [nt, ot] = W(56), [at, Ft] = W(
1448
+ "left"
1449
+ ), X = I(null), dt = I(null), j = I(null), Q = Mt(0), z = Mt(0), it = ne(), kt = p(
1450
+ (h) => {
1451
+ w.setValue(h), O == null || O();
1452
+ },
1453
+ [w.setValue, O]
1454
+ ), rt = p(() => {
1455
+ d.current = !0, l.open(), m == null || m();
1456
+ }, [l, m]), st = p(() => {
1457
+ var R, q, ht;
1458
+ const h = (q = (R = j.current) == null ? void 0 : R.ownerDocument) == null ? void 0 : q.activeElement;
1459
+ return !(h && ((ht = j.current) != null && ht.contains(h)) || K.trim());
1460
+ }, [K, j]), Ut = (h) => h === "collapsed" ? x.COLLAPSED_SIZE : h === "compact" ? nt : x.EXPANDED_HEIGHT, Et = p(() => {
1461
+ if (l.state === "collapsed" && (l.setState("compact"), l.initialState === "collapsed")) {
1462
+ const h = setTimeout(() => {
1463
+ l.state === "compact" && st() && l.setState("collapsed"), k.current.delete(h);
1464
+ }, x.AUTO_COLLAPSE_DELAY);
1465
+ k.current.add(h);
1466
+ }
1467
+ }, [l, st]), At = p(() => {
1468
+ if (l.initialState === "collapsed" && l.state === "compact" && st()) {
1469
+ const h = setTimeout(() => {
1470
+ l.state === "compact" && st() && l.setState("collapsed"), k.current.delete(h);
1471
+ }, x.AUTO_COLLAPSE_DELAY);
1472
+ k.current.add(h);
1473
+ }
1474
+ }, [l, st]), C = p(async () => {
1475
+ if (w.value.trim()) {
1476
+ const h = w.value.trim();
1477
+ w.clear(), l.state !== "expanded" && (f == null || f()), l.setState("expanded"), await s(h);
1478
+ }
1479
+ }, [w, s, l, f]), A = p(() => {
1480
+ vt.current = !0, f == null || f(), l.setState("expanded");
1481
+ }, [f, l]), U = p(() => {
1482
+ gt.current = !0, w.clear(), l.close(), v && v();
1483
+ }, [w, l, v]), G = p(
1484
+ (h) => {
1485
+ if (!j.current || !dt.current)
1486
+ return null;
1487
+ const R = j.current.getBoundingClientRect(), q = dt.current.getBoundingClientRect(), ht = window.getComputedStyle(j.current), Ot = new DOMMatrixReadOnly(ht.transform), jt = R.x - Ot.e, Nt = R.y - Ot.f, _e = (h ?? at) === "left" ? q.left : q.right - x.COMPACT_WIDTH, be = q.bottom - x.EXPANDED_HEIGHT;
1488
+ return {
1489
+ x: _e - jt,
1490
+ y: be - Nt
1491
+ };
1492
+ },
1493
+ [at]
1494
+ ), mt = p(
1495
+ (h) => {
1496
+ h.target.closest(
1497
+ It.NON_DRAGGABLE_SELECTORS
1498
+ ) || it.start(h.nativeEvent);
1499
+ },
1500
+ [it]
1501
+ ), St = p(
1502
+ (h, R) => {
1503
+ const q = R.point.x, ht = x.COMPACT_WIDTH, Ot = (window.innerWidth - ht) / 2, Nt = q < Ot ? "left" : "right";
1504
+ Ft(Nt);
1505
+ const Rt = G(Nt);
1506
+ Rt && (Pt(Q, Rt.x, {
1507
+ ...It.SPRING_CONFIG,
1508
+ velocity: R.velocity.x * It.VELOCITY_MULTIPLIER
1509
+ }), Pt(z, Rt.y, {
1510
+ ...It.SPRING_CONFIG,
1511
+ velocity: R.velocity.y * It.VELOCITY_MULTIPLIER
1512
+ }));
1513
+ },
1514
+ [Q, z, G]
1515
+ ), ct = I(l.state), ft = ct.current === "compact" && l.state === "expanded";
1516
+ E(() => {
1517
+ et(), ct.current = l.state;
1518
+ }, [l.state, et]), E(() => {
1519
+ if (l.state !== "expanded")
1520
+ return;
1521
+ const h = () => {
1522
+ const R = G();
1523
+ R && (Q.set(R.x), z.set(R.y));
1524
+ };
1525
+ return window.addEventListener("resize", h), () => window.removeEventListener("resize", h);
1526
+ }, [l.state, Q, z, G]), E(() => {
1527
+ const h = k.current;
1528
+ return () => {
1529
+ h.forEach((R) => {
1530
+ clearTimeout(R);
1531
+ }), h.clear();
1532
+ };
1533
+ }, []), E(() => {
1534
+ if (l.state === "compact" && X.current) {
1535
+ const h = X.current.scrollHeight + x.PADDING;
1536
+ ot(h);
1537
+ }
1538
+ }, [l.state, w.value]);
1539
+ const xt = {
1540
+ // Core data
1541
+ messages: t,
1542
+ isProcessing: a,
1543
+ error: i,
1544
+ // Input state
1545
+ inputValue: w.value,
1546
+ setInputValue: w.setValue,
1547
+ clearInput: w.clear,
1548
+ textareaRef: w.textareaRef,
1549
+ handleKeyDown: w.handleKeyDown,
1550
+ // Actions
1551
+ onSubmit: s,
1552
+ handleSubmit: C,
1553
+ onStop: y,
1554
+ // UI state
1555
+ variant: o,
1556
+ placeholder: g,
1557
+ emptyView: b,
1558
+ messageRenderer: D,
1559
+ // Floating chat specific
1560
+ floatingChatState: l.state,
1561
+ triggerIcon: r,
1562
+ onOpen: rt,
1563
+ onExpand: A,
1564
+ onClose: U,
1565
+ // Suggestions
1566
+ suggestions: L,
1567
+ clearSuggestions: O,
1568
+ handleSuggestionSubmit: kt,
1569
+ // Notice
1570
+ notice: u,
1571
+ // Internal state for components
1572
+ focusOnMount: vt.current,
1573
+ fromCompact: ft,
1574
+ showExpandButton: !w.value.trim()
1575
+ };
1576
+ return o === "embedded" ? /* @__PURE__ */ n(zt, { value: xt, children: /* @__PURE__ */ n(
1577
+ "div",
1578
+ {
1579
+ "data-slot": "chat-embedded",
1580
+ className: V(
1581
+ N,
1582
+ Z.container,
1583
+ Z.embedded
1584
+ ),
1585
+ children: e
1586
+ }
1587
+ ) }) : /* @__PURE__ */ _(zt, { value: xt, children: [
1588
+ /* @__PURE__ */ n(
1589
+ "div",
1590
+ {
1591
+ ref: dt,
1592
+ style: {
1593
+ position: "fixed",
1594
+ top: x.VIEWPORT_OFFSET,
1595
+ left: x.VIEWPORT_OFFSET,
1596
+ right: x.VIEWPORT_OFFSET,
1597
+ bottom: x.VIEWPORT_OFFSET,
1598
+ pointerEvents: "none"
1599
+ }
1600
+ }
1601
+ ),
1602
+ /* @__PURE__ */ n(
1603
+ M.div,
1604
+ {
1605
+ ref: j,
1606
+ "data-slot": "chat-floating",
1607
+ className: V(N, Z.container, Z.floating, {
1608
+ animating: wt
1609
+ }),
1610
+ onMouseLeave: l.state === "compact" ? At : void 0,
1611
+ drag: l.state === "expanded",
1612
+ dragControls: it,
1613
+ dragListener: !1,
1614
+ dragConstraints: dt,
1615
+ dragMomentum: !1,
1616
+ dragElastic: 0.1,
1617
+ dragTransition: { power: 0.1, timeConstant: 100 },
1618
+ onDragEnd: St,
1619
+ onPointerDown: mt,
1620
+ style: {
1621
+ x: Q,
1622
+ y: z,
1623
+ bottom: x.VIEWPORT_OFFSET,
1624
+ left: x.VIEWPORT_OFFSET
1625
+ },
1626
+ children: /* @__PURE__ */ n(
1627
+ M.div,
1628
+ {
1629
+ layout: !0,
1630
+ className: Z.content,
1631
+ initial: !1,
1632
+ animate: {
1633
+ width: l.state === "collapsed" ? x.COLLAPSED_SIZE : x.COMPACT_WIDTH,
1634
+ height: Ut(l.state),
1635
+ x: l.state === "collapsed" && at === "right" ? x.COMPACT_WIDTH - x.COLLAPSED_SIZE : 0,
1636
+ transition: w.value.trim() ? { duration: 0 } : $t
1637
+ },
1638
+ onAnimationStart: () => bt(!0),
1639
+ onAnimationComplete: () => bt(!1),
1640
+ style: {
1641
+ borderRadius: x.BORDER_RADIUS
1642
+ },
1643
+ children: /* @__PURE__ */ _(_t, { mode: "wait", children: [
1644
+ l.state === "collapsed" && /* @__PURE__ */ n(
1645
+ ce,
1646
+ {
1647
+ icon: r,
1648
+ onClick: rt,
1649
+ onHover: Et,
1650
+ focusOnMount: gt.current
1651
+ },
1652
+ "collapsed"
1653
+ ),
1654
+ l.state === "compact" && /* @__PURE__ */ n("div", { ref: X, children: /* @__PURE__ */ n(
1655
+ de,
1656
+ {
1657
+ value: w.value,
1658
+ onChange: w.setValue,
1659
+ onSubmit: C,
1660
+ onKeyDown: w.handleKeyDown,
1661
+ textareaRef: w.textareaRef,
1662
+ placeholder: g,
1663
+ isProcessing: a,
1664
+ onBlur: At,
1665
+ onExpand: A,
1666
+ showExpandButton: !w.value.trim(),
1667
+ focusOnMount: d.current,
1668
+ onStop: y,
1669
+ suggestions: L,
1670
+ clearSuggestions: O
1671
+ },
1672
+ "compact"
1673
+ ) }),
1674
+ l.state === "expanded" && e
1675
+ ] })
1676
+ }
1677
+ )
1678
+ }
1679
+ )
1680
+ ] });
1681
+ }
1682
+ function ge({ className: e } = {}) {
1683
+ const { onClose: t } = ut();
1684
+ return /* @__PURE__ */ n(fe, { onClose: t, className: e });
1685
+ }
1686
+ function ve({ className: e } = {}) {
1687
+ const { messages: t, isProcessing: a, error: i, emptyView: s, messageRenderer: o } = ut();
1688
+ return /* @__PURE__ */ n(
1689
+ pe,
1690
+ {
1691
+ messages: t,
1692
+ isProcessing: a,
1693
+ error: i,
1694
+ emptyView: s,
1695
+ messageRenderer: o,
1696
+ className: e
1697
+ }
1698
+ );
1699
+ }
1700
+ function we({
1701
+ className: e,
1702
+ disabled: t,
1703
+ customActions: a,
1704
+ actionOrder: i
1705
+ } = {}) {
1706
+ const {
1707
+ inputValue: s,
1708
+ setInputValue: o,
1709
+ handleSubmit: r,
1710
+ handleKeyDown: g,
1711
+ textareaRef: u,
1712
+ placeholder: m,
1713
+ isProcessing: f,
1714
+ onStop: v,
1715
+ fromCompact: y,
1716
+ onExpand: b,
1717
+ showExpandButton: T,
1718
+ focusOnMount: L
1719
+ } = ut();
1720
+ return /* @__PURE__ */ n(
1721
+ Kt,
1722
+ {
1723
+ value: s,
1724
+ onChange: o,
1725
+ onSubmit: r,
1726
+ onKeyDown: g,
1727
+ textareaRef: u,
1728
+ placeholder: m,
1729
+ isProcessing: f,
1730
+ onStop: v,
1731
+ fromCompact: y,
1732
+ onExpand: b,
1733
+ showExpandButton: T,
1734
+ focusOnMount: L,
1735
+ disabled: t,
1736
+ customActions: a,
1737
+ actionOrder: i,
1738
+ className: e
1739
+ }
1740
+ );
1741
+ }
1742
+ function Le({
1743
+ className: e,
1744
+ showSuggestions: t
1745
+ } = {}) {
1746
+ const { suggestions: a, handleSuggestionSubmit: i, inputValue: s } = ut();
1747
+ return s && !t ? null : /* @__PURE__ */ n(
1748
+ Xt,
1749
+ {
1750
+ suggestions: a,
1751
+ onSubmit: i,
1752
+ className: e
1753
+ }
1754
+ );
1755
+ }
1756
+ function ye({ className: e } = {}) {
1757
+ const { notice: t } = ut();
1758
+ return t ? /* @__PURE__ */ n(
1759
+ he,
1760
+ {
1761
+ icon: t.icon,
1762
+ message: t.message,
1763
+ action: t.action,
1764
+ dismissible: t.dismissible,
1765
+ onDismiss: t.onDismiss,
1766
+ className: e
1767
+ }
1768
+ ) : null;
1769
+ }
1770
+ function Ie({
1771
+ children: e,
1772
+ className: t
1773
+ } = {}) {
1774
+ return e ? /* @__PURE__ */ n(
1775
+ M.div,
1776
+ {
1777
+ "data-slot": "chat-footer",
1778
+ className: V(Yt.container, t),
1779
+ initial: { opacity: 0, scale: 1 },
1780
+ animate: { opacity: 1, scale: 1 },
1781
+ transition: { ...lt },
1782
+ children: e
1783
+ }
1784
+ ) : /* @__PURE__ */ _(
1785
+ M.div,
1786
+ {
1787
+ "data-slot": "chat-footer",
1788
+ className: V(Yt.container, t),
1789
+ initial: { opacity: 0, scale: 1 },
1790
+ animate: { opacity: 1, scale: 1 },
1791
+ transition: { ...lt },
1792
+ children: [
1793
+ /* @__PURE__ */ n(Le, {}),
1794
+ /* @__PURE__ */ n(ye, {}),
1795
+ /* @__PURE__ */ n(we, {})
1796
+ ]
1797
+ }
1798
+ );
1799
+ }
1800
+ function Te({
1801
+ showHeader: e = !0,
1802
+ children: t,
1803
+ className: a
1804
+ } = {}) {
1805
+ const { onClose: i } = ut();
1806
+ return E(() => {
1807
+ const s = (o) => {
1808
+ o.key === "Escape" && i && i();
1809
+ };
1810
+ return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
1811
+ }, [i]), t ? /* @__PURE__ */ n(
1812
+ "div",
1813
+ {
1814
+ "data-slot": "conversation-view",
1815
+ className: `${Tt.container}${a ? ` ${a}` : ""}`,
1816
+ children: t
1817
+ }
1818
+ ) : /* @__PURE__ */ _(
1819
+ "div",
1820
+ {
1821
+ "data-slot": "conversation-view",
1822
+ className: `${Tt.container}${e ? ` ${Tt.withHeader}` : ""}${a ? ` ${a}` : ""}`,
1823
+ children: [
1824
+ e && /* @__PURE__ */ n(ge, {}),
1825
+ /* @__PURE__ */ n(ve, {}),
1826
+ /* @__PURE__ */ n(Ie, {})
1827
+ ]
1828
+ }
1829
+ );
1830
+ }
1831
+ const Un = {
1832
+ // Core container with state management
1833
+ Container: Ce,
1834
+ // Individual composable components
1835
+ Header: ge,
1836
+ Messages: ve,
1837
+ Input: we,
1838
+ Suggestions: Le,
1839
+ Notice: ye,
1840
+ // Convenience wrappers
1841
+ Footer: Ie,
1842
+ ConversationView: Te
1843
+ }, zn = Object.assign(
1844
+ (e) => /* @__PURE__ */ n(
1845
+ Ce,
1846
+ {
1847
+ ...e,
1848
+ className: V("agenttic", e.className),
1849
+ children: /* @__PURE__ */ n(
1850
+ Te,
1851
+ {
1852
+ showHeader: e.variant === "floating"
1853
+ }
1854
+ )
1855
+ }
1856
+ ),
1857
+ Un
2340
1858
  );
2341
- function mi({ className: n, size: t = 24 }) {
2342
- return /* @__PURE__ */ o.jsx(
1859
+ function qn({ className: e, size: t = 24 }) {
1860
+ return /* @__PURE__ */ n(
2343
1861
  "svg",
2344
1862
  {
2345
1863
  width: t,
@@ -2347,8 +1865,8 @@ function mi({ className: n, size: t = 24 }) {
2347
1865
  viewBox: "0 0 24 24",
2348
1866
  fill: "none",
2349
1867
  xmlns: "http://www.w3.org/2000/svg",
2350
- className: n,
2351
- children: /* @__PURE__ */ o.jsx(
1868
+ className: e,
1869
+ children: /* @__PURE__ */ n(
2352
1870
  "path",
2353
1871
  {
2354
1872
  d: "M6.97288 17.25C6.97288 17.3881 7.08481 17.5 7.22288 17.5L8.5 17.5L8.5 12.875L7.22288 12.875C7.08481 12.875 6.97288 12.9869 6.97288 13.125L6.97288 17.25ZM16.3725 17.5C17.1129 17.5 17.7434 16.9587 17.8549 16.2256L18.4819 13.1006C18.6199 12.1924 17.9175 11.3752 17.0004 11.375L14.0698 11.375C13.8509 11.3749 13.6429 11.2794 13.5004 11.1133C13.358 10.9469 13.2949 10.7261 13.3286 10.5098L13.7602 7.74023C13.8309 7.28511 13.4792 6.875 13.02 6.875L13.0141 6.87891L10 12.5L10 17.5L16.3725 17.5ZM5.47288 13.125C5.47288 12.1585 6.25638 11.375 7.22288 11.375L9.01216 11.375L11.6811 6.19238C11.9394 5.69079 12.4558 5.3751 13.02 5.375C14.4008 5.375 15.4552 6.6078 15.2426 7.97168L14.9458 9.875L17.0004 9.875C18.8366 9.87517 20.2413 11.511 19.9653 13.3262L19.3374 16.4512C19.1145 17.9166 17.8548 19 16.3725 19L7.22288 19C6.25638 19 5.47288 18.2165 5.47288 17.25L5.47288 13.125Z",
@@ -2358,8 +1876,8 @@ function mi({ className: n, size: t = 24 }) {
2358
1876
  }
2359
1877
  );
2360
1878
  }
2361
- function gi({ className: n, size: t = 24 }) {
2362
- return /* @__PURE__ */ o.jsx(
1879
+ function Jn({ className: e, size: t = 24 }) {
1880
+ return /* @__PURE__ */ n(
2363
1881
  "svg",
2364
1882
  {
2365
1883
  width: t,
@@ -2367,9 +1885,9 @@ function gi({ className: n, size: t = 24 }) {
2367
1885
  viewBox: "0 0 24 24",
2368
1886
  fill: "none",
2369
1887
  xmlns: "http://www.w3.org/2000/svg",
2370
- className: n,
1888
+ className: e,
2371
1889
  "aria-hidden": "true",
2372
- children: /* @__PURE__ */ o.jsx(
1890
+ children: /* @__PURE__ */ n(
2373
1891
  "path",
2374
1892
  {
2375
1893
  d: "M6.97288 6.75C6.97288 6.61194 7.08481 6.5 7.22288 6.5L8.5 6.5L8.5 11.125L7.22288 11.125C7.08481 11.125 6.97288 11.0131 6.97288 10.875L6.97288 6.75ZM16.3725 6.5C17.1129 6.5 17.7434 7.0413 17.8549 7.77438L18.4819 10.8994C18.6199 11.8076 17.9175 12.6248 17.0004 12.625L14.0698 12.625C13.8509 12.6251 13.6429 12.7206 13.5004 12.8867C13.358 13.0531 13.2949 13.2739 13.3286 13.4902L13.7602 16.2598C13.8309 16.7149 13.4792 17.125 13.02 17.125L13.0141 17.1211L10 11.5L10 6.5L16.3725 6.5ZM5.47288 10.875C5.47288 11.8415 6.25638 12.625 7.22288 12.625L9.01216 12.625L11.6811 17.8076C11.9394 18.3092 12.4558 18.6249 13.02 18.625C14.4008 18.625 15.4552 17.3922 15.2426 16.0283L14.9458 14.125L17.0004 14.125C18.8366 14.1248 20.2413 12.489 19.9653 10.6738L19.3374 7.54883C19.1145 6.08344 17.8548 5 16.3725 5L7.22288 5C6.25638 5 5.47288 5.78348 5.47288 6.75L5.47288 10.875Z",
@@ -2379,8 +1897,8 @@ function gi({ className: n, size: t = 24 }) {
2379
1897
  }
2380
1898
  );
2381
1899
  }
2382
- function yi({ className: n, size: t = 24 }) {
2383
- return /* @__PURE__ */ o.jsx(
1900
+ function Qn({ className: e, size: t = 24 }) {
1901
+ return /* @__PURE__ */ n(
2384
1902
  "svg",
2385
1903
  {
2386
1904
  width: t,
@@ -2388,9 +1906,9 @@ function yi({ className: n, size: t = 24 }) {
2388
1906
  viewBox: "0 0 24 24",
2389
1907
  fill: "none",
2390
1908
  xmlns: "http://www.w3.org/2000/svg",
2391
- className: n,
1909
+ className: e,
2392
1910
  "aria-hidden": "true",
2393
- children: /* @__PURE__ */ o.jsx(
1911
+ children: /* @__PURE__ */ n(
2394
1912
  "path",
2395
1913
  {
2396
1914
  d: "M14.5 12C14.5 11.1716 13.8284 10.5 13 10.5H8C7.17157 10.5 6.5 11.1716 6.5 12V17C6.5 17.8284 7.17157 18.5 8 18.5H13C13.8284 18.5 14.5 17.8284 14.5 17V12ZM16 14.5H16.5C17.3284 14.5 18 13.8284 18 13V8C18 7.17157 17.3284 6.5 16.5 6.5H11C10.1716 6.5 9.5 7.17157 9.5 8V9H13C14.6569 9 16 10.3431 16 12V14.5ZM19.5 13C19.5 14.6569 18.1569 16 16.5 16H16V17C16 18.6569 14.6569 20 13 20H8C6.34315 20 5 18.6569 5 17V12C5 10.3431 6.34315 9 8 9V8C8 6.34315 9.34315 5 11 5H16.5C18.1569 5 19.5 6.34315 19.5 8V13Z",
@@ -2400,8 +1918,8 @@ function yi({ className: n, size: t = 24 }) {
2400
1918
  }
2401
1919
  );
2402
1920
  }
2403
- function Ci({ className: n, size: t = 24 }) {
2404
- return /* @__PURE__ */ o.jsx(
1921
+ function to({ className: e, size: t = 24 }) {
1922
+ return /* @__PURE__ */ n(
2405
1923
  "svg",
2406
1924
  {
2407
1925
  width: t,
@@ -2409,9 +1927,9 @@ function Ci({ className: n, size: t = 24 }) {
2409
1927
  viewBox: "0 0 24 24",
2410
1928
  fill: "none",
2411
1929
  xmlns: "http://www.w3.org/2000/svg",
2412
- className: n,
1930
+ className: e,
2413
1931
  "aria-hidden": "true",
2414
- children: /* @__PURE__ */ o.jsx(
1932
+ children: /* @__PURE__ */ n(
2415
1933
  "path",
2416
1934
  {
2417
1935
  fillRule: "evenodd",
@@ -2423,8 +1941,8 @@ function Ci({ className: n, size: t = 24 }) {
2423
1941
  }
2424
1942
  );
2425
1943
  }
2426
- function _i({ className: n, size: t = 24 }) {
2427
- return /* @__PURE__ */ o.jsx(
1944
+ function eo({ className: e, size: t = 24 }) {
1945
+ return /* @__PURE__ */ n(
2428
1946
  "svg",
2429
1947
  {
2430
1948
  width: t,
@@ -2432,8 +1950,8 @@ function _i({ className: n, size: t = 24 }) {
2432
1950
  viewBox: "0 0 24 24",
2433
1951
  fill: "none",
2434
1952
  xmlns: "http://www.w3.org/2000/svg",
2435
- className: n,
2436
- children: /* @__PURE__ */ o.jsx(
1953
+ className: e,
1954
+ children: /* @__PURE__ */ n(
2437
1955
  "path",
2438
1956
  {
2439
1957
  fillRule: "evenodd",
@@ -2445,8 +1963,8 @@ function _i({ className: n, size: t = 24 }) {
2445
1963
  }
2446
1964
  );
2447
1965
  }
2448
- function xi({ className: n, size: t = 24 }) {
2449
- return /* @__PURE__ */ o.jsxs(
1966
+ function no({ className: e, size: t = 24 }) {
1967
+ return /* @__PURE__ */ _(
2450
1968
  "svg",
2451
1969
  {
2452
1970
  width: t,
@@ -2454,16 +1972,16 @@ function xi({ className: n, size: t = 24 }) {
2454
1972
  viewBox: "0 0 24 24",
2455
1973
  fill: "none",
2456
1974
  xmlns: "http://www.w3.org/2000/svg",
2457
- className: n,
1975
+ className: e,
2458
1976
  children: [
2459
- /* @__PURE__ */ o.jsx(
1977
+ /* @__PURE__ */ n(
2460
1978
  "path",
2461
1979
  {
2462
1980
  d: "M11.2222 14.3333C12.9404 14.3333 14.3333 12.9404 14.3333 11.2222C14.3333 9.50401 12.9404 8.11111 11.2222 8.11111C9.50401 8.11111 8.11111 9.50401 8.11111 11.2222C8.11111 12.9404 9.50401 14.3333 11.2222 14.3333Z",
2463
1981
  fill: "currentColor"
2464
1982
  }
2465
1983
  ),
2466
- /* @__PURE__ */ o.jsx(
1984
+ /* @__PURE__ */ n(
2467
1985
  "path",
2468
1986
  {
2469
1987
  fillRule: "evenodd",
@@ -2477,27 +1995,45 @@ function xi({ className: n, size: t = 24 }) {
2477
1995
  );
2478
1996
  }
2479
1997
  export {
2480
- vi as AgentUI,
2481
- ar as AnimatedPlaceholder,
2482
- Jn as ArrowUpIcon,
2483
- Bt as BigSkyIcon,
2484
- Wr as Chat,
2485
- xr as ChatFooter,
2486
- Zt as ChatInput,
2487
- nr as ChevronUpIcon,
2488
- yi as CopyIcon,
2489
- Lr as Message,
2490
- Dt as MessageActions,
2491
- Fr as Messages,
2492
- mr as Notice,
2493
- qn as StopIcon,
2494
- Ci as StylesIcon,
2495
- yr as Suggestions,
2496
- Pr as ThinkingMessage,
2497
- gi as ThumbsDownIcon,
2498
- mi as ThumbsUpIcon,
2499
- Ut as XIcon,
2500
- _i as ZoomIcon,
2501
- xi as ZoomIconFilled,
2502
- pi as animations
1998
+ zn as AgentUI,
1999
+ Ce as AgentUIContainer,
2000
+ Te as AgentUIConversationView,
2001
+ Ie as AgentUIFooter,
2002
+ ge as AgentUIHeader,
2003
+ we as AgentUIInput,
2004
+ ve as AgentUIMessages,
2005
+ ye as AgentUINotice,
2006
+ zt as AgentUIProvider,
2007
+ Le as AgentUISuggestions,
2008
+ rn as AnimatedPlaceholder,
2009
+ ze as ArrowUpIcon,
2010
+ se as BigSkyIcon,
2011
+ jn as Chat,
2012
+ yn as ChatFooter,
2013
+ fe as ChatHeader,
2014
+ Kt as ChatInput,
2015
+ nn as ChevronUpIcon,
2016
+ ce as CollapsedView,
2017
+ de as CompactView,
2018
+ Qt as ConversationView,
2019
+ Qn as CopyIcon,
2020
+ Sn as Message,
2021
+ Jt as MessageActions,
2022
+ pe as Messages,
2023
+ he as Notice,
2024
+ qe as StopIcon,
2025
+ to as StylesIcon,
2026
+ Xt as Suggestions,
2027
+ Mn as ThinkingMessage,
2028
+ Jn as ThumbsDownIcon,
2029
+ qn as ThumbsUpIcon,
2030
+ me as XIcon,
2031
+ eo as ZoomIcon,
2032
+ no as ZoomIconFilled,
2033
+ Xn as animations,
2034
+ V as cn,
2035
+ zn as default,
2036
+ ut as useAgentUIContext,
2037
+ oe as useChat,
2038
+ ae as useInput
2503
2039
  };