@nevuto/novi 0.0.0-stage → 0.3.49

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 (92) hide show
  1. package/COMPONENTS.md +579 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +32 -0
  4. package/README.md +35 -2
  5. package/dist/AiAssistant/AiAssistantActionCard.d.ts +39 -0
  6. package/dist/AiAssistant/AiAssistantActionCard.d.ts.map +1 -0
  7. package/dist/AiAssistant/AiAssistantAnswer.d.ts +54 -0
  8. package/dist/AiAssistant/AiAssistantAnswer.d.ts.map +1 -0
  9. package/dist/AiAssistant/AiAssistantBottom.d.ts +22 -0
  10. package/dist/AiAssistant/AiAssistantBottom.d.ts.map +1 -0
  11. package/dist/AiAssistant/AiAssistantHeader.d.ts +34 -0
  12. package/dist/AiAssistant/AiAssistantHeader.d.ts.map +1 -0
  13. package/dist/AiAssistant/AiAssistantImageGroup.d.ts +21 -0
  14. package/dist/AiAssistant/AiAssistantImageGroup.d.ts.map +1 -0
  15. package/dist/AiAssistant/AiAssistantInput.d.ts +70 -0
  16. package/dist/AiAssistant/AiAssistantInput.d.ts.map +1 -0
  17. package/dist/AiAssistant/AiAssistantLauncher.d.ts +41 -0
  18. package/dist/AiAssistant/AiAssistantLauncher.d.ts.map +1 -0
  19. package/dist/AiAssistant/AiAssistantLink.d.ts +27 -0
  20. package/dist/AiAssistant/AiAssistantLink.d.ts.map +1 -0
  21. package/dist/AiAssistant/AiAssistantMenu.d.ts +13 -0
  22. package/dist/AiAssistant/AiAssistantMenu.d.ts.map +1 -0
  23. package/dist/AiAssistant/AiAssistantModal.d.ts +39 -0
  24. package/dist/AiAssistant/AiAssistantModal.d.ts.map +1 -0
  25. package/dist/AiAssistant/AiAssistantQuestion.d.ts +34 -0
  26. package/dist/AiAssistant/AiAssistantQuestion.d.ts.map +1 -0
  27. package/dist/AiAssistant/AiAssistantQuestionCard.d.ts +46 -0
  28. package/dist/AiAssistant/AiAssistantQuestionCard.d.ts.map +1 -0
  29. package/dist/AiAssistant/AiAssistantReasoning.d.ts +34 -0
  30. package/dist/AiAssistant/AiAssistantReasoning.d.ts.map +1 -0
  31. package/dist/AiAssistant/AiAssistantRecommendation.d.ts +26 -0
  32. package/dist/AiAssistant/AiAssistantRecommendation.d.ts.map +1 -0
  33. package/dist/AiAssistant/AiAssistantReference.d.ts +42 -0
  34. package/dist/AiAssistant/AiAssistantReference.d.ts.map +1 -0
  35. package/dist/AiAssistant/AiAssistantReferencePanel.d.ts +28 -0
  36. package/dist/AiAssistant/AiAssistantReferencePanel.d.ts.map +1 -0
  37. package/dist/AiAssistant/AiAssistantSecretField.d.ts +21 -0
  38. package/dist/AiAssistant/AiAssistantSecretField.d.ts.map +1 -0
  39. package/dist/AiAssistant/AiAssistantSuggestions.d.ts +21 -0
  40. package/dist/AiAssistant/AiAssistantSuggestions.d.ts.map +1 -0
  41. package/dist/AiAssistant/AiAssistantTask.d.ts +21 -0
  42. package/dist/AiAssistant/AiAssistantTask.d.ts.map +1 -0
  43. package/dist/AiAssistant/AiAssistantThinking.d.ts +22 -0
  44. package/dist/AiAssistant/AiAssistantThinking.d.ts.map +1 -0
  45. package/dist/AiAssistant/AiAssistantTitle.d.ts +13 -0
  46. package/dist/AiAssistant/AiAssistantTitle.d.ts.map +1 -0
  47. package/dist/AiAssistant/AiAssistantToolCall.d.ts +30 -0
  48. package/dist/AiAssistant/AiAssistantToolCall.d.ts.map +1 -0
  49. package/dist/AiAssistant/AiAssistantToolCallGroup.d.ts +22 -0
  50. package/dist/AiAssistant/AiAssistantToolCallGroup.d.ts.map +1 -0
  51. package/dist/AiAssistant/index.d.ts +46 -0
  52. package/dist/AiAssistant/index.d.ts.map +1 -0
  53. package/dist/AiAssistant/useControlled.d.ts +14 -0
  54. package/dist/AiAssistant/useControlled.d.ts.map +1 -0
  55. package/dist/AiAssistant/usePaper.d.ts +9 -0
  56. package/dist/AiAssistant/usePaper.d.ts.map +1 -0
  57. package/dist/Novi/Novi.d.ts +55 -0
  58. package/dist/Novi/Novi.d.ts.map +1 -0
  59. package/dist/Novi/useResolvedColor.d.ts +3 -0
  60. package/dist/Novi/useResolvedColor.d.ts.map +1 -0
  61. package/dist/NoviTile/NoviTile.d.ts +22 -0
  62. package/dist/NoviTile/NoviTile.d.ts.map +1 -0
  63. package/dist/engine/decor.d.ts +115 -0
  64. package/dist/engine/decor.d.ts.map +1 -0
  65. package/dist/engine/engine.d.ts +210 -0
  66. package/dist/engine/engine.d.ts.map +1 -0
  67. package/dist/engine/expressions.d.ts +26 -0
  68. package/dist/engine/expressions.d.ts.map +1 -0
  69. package/dist/engine/eyefit.d.ts +35 -0
  70. package/dist/engine/eyefit.d.ts.map +1 -0
  71. package/dist/engine/face.d.ts +63 -0
  72. package/dist/engine/face.d.ts.map +1 -0
  73. package/dist/engine/frame.d.ts +26 -0
  74. package/dist/engine/frame.d.ts.map +1 -0
  75. package/dist/engine/gaze.d.ts +108 -0
  76. package/dist/engine/gaze.d.ts.map +1 -0
  77. package/dist/engine/math.d.ts +21 -0
  78. package/dist/engine/math.d.ts.map +1 -0
  79. package/dist/engine/profiles.d.ts +8 -0
  80. package/dist/engine/profiles.d.ts.map +1 -0
  81. package/dist/engine/shape.d.ts +79 -0
  82. package/dist/engine/shape.d.ts.map +1 -0
  83. package/dist/engine/skins.d.ts +44 -0
  84. package/dist/engine/skins.d.ts.map +1 -0
  85. package/dist/engine/states.d.ts +85 -0
  86. package/dist/engine/states.d.ts.map +1 -0
  87. package/dist/index.css +1 -0
  88. package/dist/index.d.ts +17 -0
  89. package/dist/index.d.ts.map +1 -0
  90. package/dist/index.js +1 -0
  91. package/dist/index.mjs +2940 -0
  92. package/package.json +48 -3
package/dist/index.mjs ADDED
@@ -0,0 +1,2940 @@
1
+ "use client";
2
+ import { jsx as a, jsxs as g, Fragment as Mt } from "react/jsx-runtime";
3
+ import { useState as st, useEffect as K, useRef as H, useId as qt, useMemo as ln, forwardRef as he, useLayoutEffect as Le, useCallback as dn } from "react";
4
+ import { IconButton as ot, Scrollable as Xt, Kbd as un, Button as At, Spinner as hn } from "@nevuto/components";
5
+ import { Minimize2Icon as pn, Maximize2Icon as fn, XIcon as Fe, ArrowDownIcon as mn, ArrowBigUpIcon as _n, CornerDownLeftIcon as yn, ChevronDownIcon as gn, PlusIcon as He, SquareIcon as xn, ArrowUpIcon as bn, AudioWaveformIcon as vn, PanelRightIcon as kn, MinusIcon as Nn, ZapIcon as $n, MessagesSquareIcon as An, CircleAlertIcon as pe, CheckIcon as De, CopyIcon as Mn, ThumbsUpIcon as wn, ThumbsDownIcon as In, ChevronRightIcon as zn, SparklesIcon as Rn, CaretDownIcon as Ye, CaretRightIcon as Ue, CircleDashedIcon as Tn } from "@nevuto/icons";
6
+ const U = Math.PI * 2, w = (t, n = 0, e = 1) => t < n ? n : t > e ? e : t, I = (t, n, e) => t + (n - t) * e, G = {
7
+ easeOutCubic: (t) => 1 - (1 - t) ** 3,
8
+ easeInOutCubic: (t) => t < 0.5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2,
9
+ easeOutQuint: (t) => 1 - (1 - t) ** 5
10
+ };
11
+ function bt(t, n, e = 0) {
12
+ const s = t / n * U;
13
+ return 0.55 * Math.sin(s + e) + 0.3 * Math.sin(2 * s + e * 1.7 + 1.1) + 0.15 * Math.sin(3 * s + e * 2.3 + 2.4);
14
+ }
15
+ function Gt(t) {
16
+ let n = t >>> 0;
17
+ return () => {
18
+ n = n + 1831565813 >>> 0;
19
+ let e = Math.imul(n ^ n >>> 15, 1 | n);
20
+ return e = e + Math.imul(e ^ e >>> 7, 61 | e) ^ e, ((e ^ e >>> 14) >>> 0) / 4294967296;
21
+ };
22
+ }
23
+ const N = (t) => Math.round(t * 100) / 100;
24
+ function Zt(t, n = 0.55, e = 0.62) {
25
+ const s = (t % 360 + 360) % 360, o = (1 - Math.abs(2 * e - 1)) * n, i = o * (1 - Math.abs(s / 60 % 2 - 1)), r = e - o / 2, [c, l, d] = s < 60 ? [o, i, 0] : s < 120 ? [i, o, 0] : s < 180 ? [0, o, i] : s < 240 ? [0, i, o] : s < 300 ? [i, 0, o] : [o, 0, i], u = (h) => Math.round((h + r) * 255).toString(16).padStart(2, "0");
26
+ return `#${u(c)}${u(l)}${u(d)}`;
27
+ }
28
+ function Bn(t, n, e, s, o = 1) {
29
+ const i = t.phase + n * t.speed * U, r = Math.cos(t.tilt), c = Math.sin(t.tilt), l = Math.sqrt(Math.max(0, 1 - t.k * t.k)), d = 64, u = t.sweep * U;
30
+ let h = "", f = "", p = null;
31
+ for (let $ = 0; $ <= d; $++) {
32
+ const m = i + $ / d * u, A = Math.cos(m), v = Math.sin(m), y = t.a * (A * r + v * -c * t.k) + t.cx, b = t.a * (A * c + v * r * t.k) + t.cy, M = t.a * v * l < 0, E = N(y * e), j = N(b * e), q = M !== p ? "M" : "L";
33
+ M ? f += `${q}${E} ${j}` : h += `${q}${E} ${j}`, p = M;
34
+ }
35
+ const _ = Math.cos(t.tilt) * t.a * e, x = Math.sin(t.tilt) * t.a * e;
36
+ return {
37
+ id: s,
38
+ front: h,
39
+ back: f,
40
+ width: t.width * e,
41
+ opacity: o,
42
+ grad: {
43
+ x1: N(t.cx * e - _),
44
+ y1: N(t.cy * e - x),
45
+ x2: N(t.cx * e + _),
46
+ y2: N(t.cy * e + x),
47
+ stops: [
48
+ Zt(t.hue),
49
+ Zt(t.hue + t.hueSpan * 0.5),
50
+ Zt(t.hue + t.hueSpan)
51
+ ]
52
+ }
53
+ };
54
+ }
55
+ const mt = Gt(659918), _e = Array.from({ length: 6 }, (t, n) => ({
56
+ a: 1.3 + mt() * 0.1,
57
+ k: 0.05 + mt() * 0.4,
58
+ tilt: n / 6 * Math.PI + mt() * 0.5,
59
+ speed: 3 + mt() * 0.7,
60
+ phase: mt() * U,
61
+ sweep: 0.6 + mt() * 0.25,
62
+ hue: n * 360 / 6 + mt() * 30,
63
+ hueSpan: 60 + mt() * 60,
64
+ width: 0.05 + mt() * 0.012,
65
+ cx: 0,
66
+ cy: 0.1
67
+ })), En = Array.from({ length: 4 }, (t, n) => ({
68
+ a: 0.78 + n * 0.2,
69
+ k: 0.05 + n * 0.02,
70
+ tilt: -0.62 + n * 0.05,
71
+ speed: 0.3,
72
+ phase: 0.06 * n,
73
+ sweep: 0.4,
74
+ hue: 95 + n * 62,
75
+ hueSpan: 100,
76
+ width: 0.05,
77
+ cx: 0,
78
+ cy: -0.12
79
+ })), ye = [-0.557, -0.013, 0.532], ge = 0.165, xe = 1.25, be = Gt(48879), Pn = Array.from({ length: 5 }, (t, n) => ({
80
+ birth: n * 0.2,
81
+ angle: be() * U,
82
+ rho: 0.58 + be() * 0.18
83
+ }));
84
+ function On(t, n) {
85
+ const e = [];
86
+ for (const s of Pn) {
87
+ const o = t - s.birth;
88
+ if (o < 0 || o > 0.62) continue;
89
+ const i = s.rho * Math.pow(0.75, o * 10), r = s.angle + o * 100 * Math.PI / 180;
90
+ e.push({
91
+ x: Math.cos(r) * i * n,
92
+ y: Math.sin(r) * i * n,
93
+ r: (0.04 + 0.028 * w(o / 0.55)) * n,
94
+ depth: w(1 - i / 0.8),
95
+ opacity: w(o / 0.06) * w((0.62 - o) / 0.08)
96
+ });
97
+ }
98
+ return e;
99
+ }
100
+ const ve = Gt(49383), Cn = Array.from({ length: 4 }, (t, n) => {
101
+ const e = n - 1.5;
102
+ return {
103
+ a: 0.85 * (1 + e * 0.03),
104
+ // same flattening to within +-5%: the ribbons form a tight bundle
105
+ k: 0.15 / 0.85 * (1 + e * 0.16),
106
+ tilt: 34 * Math.PI / 180 + e * 0.035,
107
+ speed: 210 / 360,
108
+ // measured phase shift: 10 to 20 degrees between ribbons, no more
109
+ phase: -n * 0.045 + ve() * 0.012,
110
+ sweep: 0.34,
111
+ hue: n * 85 + ve() * 20,
112
+ hueSpan: 80,
113
+ width: 0.095,
114
+ cx: 0,
115
+ cy: 0
116
+ };
117
+ }), Sn = 0.129, jn = "var(--backgrounds-bg-interactive)", qn = -42, ke = 1.003, Ln = 0.15, Fn = 1.14, Hn = 0.054, fe = 15.46, ie = 0.186, ae = 0.412, Xe = { yaw: 28.49, pitch: 28.62, roll: -13 }, Dt = (t) => t * Math.PI / 180;
118
+ function Yt(t, n, e) {
119
+ const s = Math.cos(e), o = Math.sin(e);
120
+ return [
121
+ [t[0] * s + n[0] * o, t[1] * s + n[1] * o, t[2] * s + n[2] * o],
122
+ [n[0] * s - t[0] * o, n[1] * s - t[1] * o, n[2] * s - t[2] * o]
123
+ ];
124
+ }
125
+ function Ge(t, n, e = fe) {
126
+ let s = [0, 0, 1], o = [1, 0, 0], i = [0, 1, 0];
127
+ [s, o] = Yt(s, o, Dt(t.yaw)), [i, s] = Yt(i, s, Dt(t.pitch)), [o, i] = Yt(o, i, Dt(t.roll));
128
+ const r = (c) => {
129
+ const [l, d] = Yt(s, o, Dt(e * c));
130
+ return {
131
+ x: l[0] * n,
132
+ y: l[1] * n,
133
+ a: d[0],
134
+ b: d[1],
135
+ c: i[0],
136
+ d: i[1],
137
+ depth: l[2]
138
+ };
139
+ };
140
+ return [r(-1), r(1)];
141
+ }
142
+ const Ne = Gt(24301), $e = (() => {
143
+ const t = [];
144
+ let n = 1.4;
145
+ for (; n < 900; )
146
+ t.push(n), n += 1.9 + Ne() * 2.7, Ne() < 0.18 && (t.push(n), n += 0.24);
147
+ return t;
148
+ })(), Dn = 0.18;
149
+ function Yn(t) {
150
+ for (let n = 0; n < $e.length; n++) {
151
+ const e = $e[n];
152
+ if (t < e) break;
153
+ const s = (t - e) / Dn;
154
+ if (s >= 0 && s <= 1)
155
+ return s < 0.45 ? 1 - s / 0.45 : (s - 0.45) / 0.55;
156
+ }
157
+ return 1;
158
+ }
159
+ function Un(t, n = {}) {
160
+ const { wander: e = 1, blink: s = !0, float: o = !0 } = n;
161
+ return {
162
+ dYaw: (bt(t, 11.3, 0.4) * 5.5 + bt(t, 3.7, 2.1) * 1.6) * e,
163
+ dPitch: (bt(t, 9.1, 1.3) * 4.2 + bt(t, 4.3, 0.7) * 1.3) * e,
164
+ dRoll: bt(t, 13.7, 3.2) * 2.2 * e,
165
+ lid: s ? Yn(t) : 1,
166
+ // At rest the reference is almost still (centre stable to +-0.003, constant
167
+ // radius): all the life goes through the gaze and the blinks. Just enough is
168
+ // kept here not to freeze the image completely.
169
+ driftX: o ? bt(t, 7.9, 1.9) * 6e-3 : 0,
170
+ driftY: o ? bt(t, 5.3, 0.3) * 7e-3 : 0,
171
+ // Width is constant, only the height breathes very slightly.
172
+ breath: o ? 1 + Math.sin(t / 3.4 * Math.PI * 2) * 5e-3 : 1
173
+ };
174
+ }
175
+ function Xn(t) {
176
+ return 0.06 + 0.94 * w(t);
177
+ }
178
+ const ft = (t, n, e = 0, s = 1) => ({ w: t, h: n, tilt: e, open: s }), it = (t, n, e = 0, s = 1) => [
179
+ ft(t, n, e, s),
180
+ ft(t, n, -e, s)
181
+ ], X = { yaw: 0, pitch: 0, roll: 0 }, We = [
182
+ {
183
+ id: "neutral",
184
+ gaze: { ...X },
185
+ split: fe,
186
+ eyes: [ft(ie, ae), ft(ie, ae)]
187
+ },
188
+ {
189
+ id: "attentive",
190
+ gaze: { ...X },
191
+ split: 16,
192
+ eyes: it(0.21, 0.44)
193
+ },
194
+ {
195
+ id: "surprised",
196
+ gaze: { ...X },
197
+ split: 19,
198
+ eyes: it(0.45, 0.47)
199
+ },
200
+ {
201
+ id: "excited",
202
+ gaze: { ...X },
203
+ split: 19.5,
204
+ eyes: it(0.4, 0.56, -10)
205
+ },
206
+ {
207
+ // eyes narrowed into arcs: the tops converge slightly
208
+ id: "happy",
209
+ gaze: { ...X },
210
+ split: 17,
211
+ eyes: it(0.27, 0.17, 14)
212
+ },
213
+ {
214
+ id: "laughing",
215
+ gaze: { ...X },
216
+ split: 18,
217
+ eyes: it(0.34, 0.13, 20)
218
+ },
219
+ {
220
+ // eye tops converging hard towards the centre + narrowed eyes
221
+ id: "angry",
222
+ gaze: { ...X },
223
+ split: 17,
224
+ eyes: it(0.34, 0.15, 30)
225
+ },
226
+ {
227
+ // the reverse: the eye tops diverge
228
+ id: "sad",
229
+ gaze: { ...X },
230
+ split: 16,
231
+ eyes: it(0.22, 0.4, -28)
232
+ },
233
+ {
234
+ id: "scared",
235
+ gaze: { ...X },
236
+ split: 20.5,
237
+ eyes: it(0.4, 0.6)
238
+ },
239
+ {
240
+ // one eye distinctly more closed than the other
241
+ id: "suspicious",
242
+ gaze: { ...X },
243
+ split: 16,
244
+ eyes: [ft(0.21, 0.4), ft(0.22, 0.15)]
245
+ },
246
+ {
247
+ // asymmetric on both axes: mismatched sizes AND tilts.
248
+ // The narrowed eye is deliberately flat (ratio 1.6): at a ratio near 1 it
249
+ // would read as round and its tilt would not show.
250
+ id: "confused",
251
+ gaze: { ...X },
252
+ split: 16.5,
253
+ eyes: [ft(0.2, 0.44, -18), ft(0.28, 0.17, 14)]
254
+ },
255
+ {
256
+ id: "curious",
257
+ gaze: { ...X },
258
+ split: 16.5,
259
+ eyes: [ft(0.24, 0.46, -8), ft(0.2, 0.38, -8)]
260
+ },
261
+ {
262
+ id: "proud",
263
+ gaze: { ...X },
264
+ split: 17,
265
+ eyes: it(0.3, 0.15, 18)
266
+ },
267
+ {
268
+ id: "shy",
269
+ gaze: { ...X },
270
+ split: 14,
271
+ eyes: it(0.17, 0.3)
272
+ },
273
+ {
274
+ // horizontal slits
275
+ id: "unimpressed",
276
+ gaze: { ...X },
277
+ split: 16,
278
+ eyes: it(0.3, 0.12)
279
+ },
280
+ {
281
+ // half-dropped lids: goes through `open`, i.e. the vertical squash on screen,
282
+ // the same mechanism as a blink
283
+ id: "sleepy",
284
+ gaze: { ...X },
285
+ split: 16,
286
+ eyes: it(0.2, 0.42, 0, 0.42)
287
+ }
288
+ ], Gn = new Map(We.map((t) => [t.id, t])), Wn = "neutral", Ae = (t, n, e) => ({
289
+ w: I(t.w, n.w, e),
290
+ h: I(t.h, n.h, e),
291
+ tilt: I(t.tilt ?? 0, n.tilt ?? 0, e),
292
+ open: I(t.open, n.open, e)
293
+ });
294
+ function Qn(t, n, e) {
295
+ return {
296
+ id: n.id,
297
+ gaze: {
298
+ yaw: I(t.gaze.yaw, n.gaze.yaw, e),
299
+ pitch: I(t.gaze.pitch, n.gaze.pitch, e),
300
+ roll: I(t.gaze.roll, n.gaze.roll, e)
301
+ },
302
+ split: I(t.split, n.split, e),
303
+ eyes: [Ae(t.eyes[0], n.eyes[0], e), Ae(t.eyes[1], n.eyes[1], e)]
304
+ };
305
+ }
306
+ const tt = 64, Vn = {
307
+ // egg: same height as the ball, narrowed
308
+ // frame 164, measured footprint 1.647 x 2.000
309
+ egg: [0.8369, 0.8424, 0.8497, 0.8585, 0.8674, 0.8775, 0.8878, 0.8983, 0.9089, 0.9185, 0.9288, 0.9374, 0.9445, 0.9504, 0.9543, 0.9559, 0.9555, 0.9519, 0.9466, 0.9389, 0.9302, 0.9193, 0.9085, 0.8969, 0.8852, 0.8734, 0.8625, 0.8513, 0.8411, 0.8325, 0.8243, 0.8179, 0.8137, 0.8112, 0.8102, 0.8128, 0.8178, 0.8262, 0.8374, 0.8518, 0.8702, 0.8922, 0.9169, 0.9446, 0.9741, 1.0023, 1.0267, 1.0433, 1.0481, 1.0393, 1.0216, 0.997, 0.9697, 0.9418, 0.9169, 0.8949, 0.876, 0.8604, 0.849, 0.8394, 0.8337, 0.8314, 0.8305, 0.8326],
310
+ // hexagon, point up, very rounded corners
311
+ // frame 174, measured footprint 1.826 x 2.011
312
+ hexagon: [0.921, 0.9282, 0.9441, 0.9706, 0.9984, 1.0059, 0.9896, 0.9562, 0.929, 0.9124, 0.9047, 0.9058, 0.9157, 0.9349, 0.9642, 0.9873, 0.9882, 0.9665, 0.9336, 0.9105, 0.8968, 0.8918, 0.8955, 0.908, 0.9293, 0.9611, 0.982, 0.9812, 0.959, 0.9282, 0.9089, 0.8978, 0.8964, 0.9026, 0.9189, 0.9439, 0.9778, 0.999, 0.9964, 0.9713, 0.9439, 0.9274, 0.9196, 0.9206, 0.9308, 0.9502, 0.9799, 1.0121, 1.0226, 1.0071, 0.9752, 0.951, 0.9366, 0.9316, 0.9351, 0.9485, 0.9711, 1.0026, 1.0213, 1.0155, 0.9863, 0.9547, 0.9347, 0.9232],
313
+ // triangle, point up, very rounded corners
314
+ // frame 190, measured footprint 1.995 x 1.884
315
+ triangle: [0.7819, 0.8211, 0.8747, 0.944, 1.0223, 1.096, 1.1401, 1.134, 1.0808, 1.0047, 0.9265, 0.8603, 0.8104, 0.773, 0.745, 0.7273, 0.7151, 0.7118, 0.7148, 0.7245, 0.7427, 0.768, 0.8037, 0.8518, 0.9148, 0.9876, 1.0583, 1.1073, 1.1109, 1.0667, 0.994, 0.9164, 0.8482, 0.7948, 0.7555, 0.7261, 0.7056, 0.6925, 0.6859, 0.6869, 0.6938, 0.7084, 0.7305, 0.7615, 0.804, 0.8595, 0.9311, 1.0092, 1.0791, 1.1171, 1.1054, 1.0501, 0.9779, 0.905, 0.845, 0.799, 0.7656, 0.7413, 0.7258, 0.716, 0.7146, 0.7204, 0.733, 0.7528]
316
+ }, me = Array.from({ length: tt }, (t, n) => n / tt * U), Wt = me.map(Math.cos), Qt = me.map(Math.sin);
317
+ function ce(t, n = {}) {
318
+ return {
319
+ radii: [...Vn[t]],
320
+ rot: 0,
321
+ cx: 0,
322
+ cy: 0,
323
+ sx: 1,
324
+ sy: 1,
325
+ ...n
326
+ };
327
+ }
328
+ function It(t, n = {}) {
329
+ return {
330
+ radii: new Array(tt).fill(t),
331
+ rot: 0,
332
+ cx: 0,
333
+ cy: 0,
334
+ sx: 1,
335
+ sy: 1,
336
+ ...n
337
+ };
338
+ }
339
+ function Kn(t, n, e, s) {
340
+ const o = s ?? {
341
+ radii: new Array(tt),
342
+ rot: 0,
343
+ cx: 0,
344
+ cy: 0,
345
+ sx: 1,
346
+ sy: 1
347
+ };
348
+ for (let r = 0; r < tt; r++)
349
+ o.radii[r] = I(t.radii[r] ?? 1, n.radii[r] ?? 1, e);
350
+ let i = n.rot - t.rot;
351
+ for (; i > Math.PI; ) i -= U;
352
+ for (; i < -Math.PI; ) i += U;
353
+ return o.rot = t.rot + i * e, o.cx = I(t.cx, n.cx, e), o.cy = I(t.cy, n.cy, e), o.sx = I(t.sx, n.sx, e), o.sy = I(t.sy, n.sy, e), o;
354
+ }
355
+ function le(t, n, e = []) {
356
+ const s = Math.cos(t.rot), o = Math.sin(t.rot);
357
+ for (let i = 0; i < tt; i++) {
358
+ const r = t.radii[i] ?? 1, c = r * (Wt[i] ?? 0), l = r * (Qt[i] ?? 0), d = c * s - l * o, u = c * o + l * s, h = e[i] ?? { x: 0, y: 0 };
359
+ h.x = (d * t.sx + t.cx) * n, h.y = (u * t.sy + t.cy) * n, e[i] = h;
360
+ }
361
+ return e.length = tt, e;
362
+ }
363
+ function Zn(t, n = 1 / 6) {
364
+ const e = t.length;
365
+ if (e < 3) return "";
366
+ const s = t[0];
367
+ let o = `M${N(s.x)} ${N(s.y)}`;
368
+ for (let i = 0; i < e; i++) {
369
+ const r = t[(i - 1 + e) % e], c = t[i], l = t[(i + 1) % e], d = t[(i + 2) % e], u = c.x + (l.x - r.x) * n, h = c.y + (l.y - r.y) * n, f = l.x - (d.x - c.x) * n, p = l.y - (d.y - c.y) * n;
370
+ o += `C${N(u)} ${N(h)} ${N(f)} ${N(p)} ${N(l.x)} ${N(l.y)}`;
371
+ }
372
+ return `${o}Z`;
373
+ }
374
+ function Lt(t, n, e) {
375
+ const s = new Array(tt).fill(0), o = t.length;
376
+ for (let i = 0; i < tt; i++) {
377
+ const r = Wt[i] ?? 0, c = Qt[i] ?? 0;
378
+ let l = 0;
379
+ for (let d = 0; d < o; d++) {
380
+ const u = t[d], h = t[(d + 1) % o], f = h.x - u.x, p = h.y - u.y, _ = r * p - c * f;
381
+ if (Math.abs(_) < 1e-9) continue;
382
+ const x = u.x - n, $ = u.y - e, m = (x * p - $ * f) / _, A = (x * c - $ * r) / _;
383
+ m > l && A >= 0 && A <= 1 && (l = m);
384
+ }
385
+ s[i] = l;
386
+ }
387
+ return s;
388
+ }
389
+ function Ft(t, n, e, s, o, i, r = 96) {
390
+ const c = s - t, l = o - n, d = Math.hypot(c, l) || 1e-6, u = Math.atan2(l, c), h = Math.acos(Math.max(-1, Math.min(1, (e - i) / d))), f = [];
391
+ for (let p = 0; p <= r / 2; p++) {
392
+ const _ = u + h + (U - 2 * h) * p / (r / 2);
393
+ f.push({ x: t + Math.cos(_) * e, y: n + Math.sin(_) * e });
394
+ }
395
+ for (let p = 0; p <= r / 2; p++) {
396
+ const _ = u - h + 2 * h * p / (r / 2);
397
+ f.push({ x: s + Math.cos(_) * i, y: o + Math.sin(_) * i });
398
+ }
399
+ return f;
400
+ }
401
+ function Qe(t, n) {
402
+ const e = t.length, s = (n / U % 1 + 1) % 1 * e, o = Math.floor(s);
403
+ return I(t[o % e] ?? 1, t[(o + 1) % e] ?? 1, s - o);
404
+ }
405
+ function Jn(t, n = 1, e = 1) {
406
+ return me.map((s, o) => {
407
+ const i = Math.abs((Wt[o] ?? 0) / n) ** t, r = Math.abs((Qt[o] ?? 0) / e) ** t;
408
+ return (i + r) ** (-1 / t);
409
+ });
410
+ }
411
+ function ts(t) {
412
+ const n = new Array(tt).fill(0);
413
+ for (let e = 0; e < tt; e++) {
414
+ const s = Wt[e] ?? 0, o = Qt[e] ?? 0;
415
+ let i = 0;
416
+ for (const r of t) {
417
+ const c = s * r.x + o * r.y, l = c * c - (r.x * r.x + r.y * r.y - r.r * r.r);
418
+ if (l < 0) continue;
419
+ const d = c + Math.sqrt(l);
420
+ d > i && (i = d);
421
+ }
422
+ n[e] = i;
423
+ }
424
+ return n;
425
+ }
426
+ function es(t, n, e = 10) {
427
+ const s = t.length, o = [], i = (r, c) => {
428
+ const l = c.x - r.x, d = c.y - r.y, u = Math.hypot(l, d) || 1;
429
+ return Math.atan2(-l / u, d / u);
430
+ };
431
+ for (let r = 0; r < s; r++) {
432
+ const c = t[(r - 1 + s) % s], l = t[r], d = t[(r + 1) % s], u = i(c, l);
433
+ let f = i(l, d) - u;
434
+ for (; f > Math.PI; ) f -= U;
435
+ for (; f < -Math.PI; ) f += U;
436
+ for (let p = 0; p <= e; p++) {
437
+ const _ = u + f * p / e;
438
+ o.push({ x: l.x + Math.cos(_) * n, y: l.y + Math.sin(_) * n });
439
+ }
440
+ }
441
+ return o;
442
+ }
443
+ function Me(t, n, e, s = 0) {
444
+ const o = s * Math.PI / 180, i = Array.from({ length: t }, (r, c) => {
445
+ const l = o + c / t * U;
446
+ return { x: Math.cos(l) * (n - e), y: Math.sin(l) * (n - e) };
447
+ });
448
+ return Lt(es(i, e), 0, 0);
449
+ }
450
+ function ns(t, n = 1) {
451
+ if (t.length < 3) return "";
452
+ let e = "";
453
+ for (let s = 0; s < t.length; s++) {
454
+ const o = t[s];
455
+ e += `${s === 0 ? "M" : "L"}${N(o.x * n)} ${N(o.y * n)}`;
456
+ }
457
+ return `${e}Z`;
458
+ }
459
+ function ss(t, n) {
460
+ const e = Math.max(t, 0.01) / 2, s = Math.max(n, 0.01) / 2, o = Math.min(e, s);
461
+ return `M${N(-e)} ${N(-s + o)}A${N(o)} ${N(o)} 0 0 1 ${N(-e + o)} ${N(-s)}L${N(e - o)} ${N(-s)}A${N(o)} ${N(o)} 0 0 1 ${N(e)} ${N(-s + o)}L${N(e)} ${N(s - o)}A${N(o)} ${N(o)} 0 0 1 ${N(e - o)} ${N(s)}L${N(-e + o)} ${N(s)}A${N(o)} ${N(o)} 0 0 1 ${N(-e)} ${N(s - o)}Z`;
462
+ }
463
+ function Vt(t, n = 1) {
464
+ const e = Math.max(...t);
465
+ if (e <= 0) return t;
466
+ const s = n / e;
467
+ return t.map((o) => o * s);
468
+ }
469
+ const os = Array.from(
470
+ { length: tt },
471
+ (t, n) => n / tt * Math.PI * 2
472
+ ), rs = Vt(
473
+ os.map((t) => 1 + 0.075 * Math.cos(2 * t + 0.5) + 0.035 * Math.cos(3 * t + 2.1)),
474
+ 1.02
475
+ ), is = Vt(
476
+ ts([
477
+ { x: -0.44, y: 0.2, r: 0.54 },
478
+ { x: 0.46, y: 0.2, r: 0.5 },
479
+ { x: 0.02, y: 0.3, r: 0.6 },
480
+ { x: -0.24, y: -0.3, r: 0.48 },
481
+ { x: 0.3, y: -0.24, r: 0.44 }
482
+ ]),
483
+ 1.02
484
+ ), as = Vt(
485
+ Lt(Ft(0, 0.28, 0.66, 0, -0.96, 0.05), 0, 0),
486
+ 1.04
487
+ ), cs = Lt(Ft(-0.42, 0, 0.62, 0.42, 0, 0.62), 0, 0), Ve = [
488
+ { id: "circle", radii: new Array(tt).fill(1) },
489
+ { id: "pebble", radii: rs },
490
+ // 1.15 and not 1.02: on a superellipse the peak radius is the diagonal, so
491
+ // normalising on it yields a shape that looks smaller than the circle.
492
+ { id: "squircle", radii: Vt(Jn(4.2), 1.15) },
493
+ { id: "capsule", radii: cs },
494
+ // -90deg: one vertex towards the top of the screen (y points down)
495
+ { id: "triangle", radii: Me(3, 1.12, 0.34, -90) },
496
+ // 0deg: vertices left and right, so the top and bottom edges come out flat
497
+ { id: "hexagon", radii: Me(6, 1.04, 0.26, 0) },
498
+ { id: "cloud", radii: is },
499
+ { id: "droplet", radii: as }
500
+ ], ls = new Map(Ve.map((t) => [t.id, t])), ds = "circle", us = [
501
+ { id: "ink", hex: "var(--novi-color-ink)" },
502
+ { id: "brown", hex: "var(--novi-color-brown)" },
503
+ { id: "red", hex: "var(--novi-color-red)" },
504
+ { id: "orange", hex: "var(--novi-color-orange)" },
505
+ { id: "amber", hex: "var(--novi-color-amber)" },
506
+ { id: "green", hex: "var(--novi-color-green)" },
507
+ { id: "teal", hex: "var(--novi-color-teal)" },
508
+ { id: "blue", hex: "var(--novi-color-blue)" },
509
+ { id: "violet", hex: "var(--novi-color-violet)" },
510
+ { id: "pink", hex: "var(--novi-color-pink)" },
511
+ { id: "gray", hex: "var(--novi-color-gray)" },
512
+ { id: "cream", hex: "var(--novi-color-cream)" }
513
+ ], hs = new Map(us.map((t) => [t.id, t])), ps = "ink";
514
+ function fs(t, n, e) {
515
+ const s = (c) => {
516
+ const l = parseInt(c.slice(1), 16);
517
+ return [l >> 16 & 255, l >> 8 & 255, l & 255];
518
+ }, o = s(t), i = s(n);
519
+ return `#${o.map((c, l) => Math.round(c + (i[l] - c) * e)).map((c) => c.toString(16).padStart(2, "0")).join("")}`;
520
+ }
521
+ const $t = (t, n) => [
522
+ { w: t, h: n, open: 1 },
523
+ { w: t, h: n, open: 1 }
524
+ ];
525
+ function W(t = {}) {
526
+ return {
527
+ sil: It(1),
528
+ offX: 0,
529
+ offY: 0,
530
+ gaze: { ...Xe },
531
+ split: fe,
532
+ eyes: $t(ie, ae),
533
+ eyeAlpha: 1,
534
+ bodyAlpha: 1,
535
+ dots: [],
536
+ arcs: [],
537
+ notif: null,
538
+ dotsBehind: !1,
539
+ ...t
540
+ };
541
+ }
542
+ const Ke = -0.1875, ms = Lt(
543
+ Ft(0, -0.505, 0.132, 0, 0.13, 0.075),
544
+ 0,
545
+ Ke
546
+ ), _s = Lt(Ft(0, -0.2535, 0.1345, 0, 0.2535, 0.1345), 0, 0), ys = (t = {}) => ({
547
+ radii: [...ms],
548
+ rot: 0,
549
+ cx: 0,
550
+ cy: Ke,
551
+ sx: 1,
552
+ sy: 1,
553
+ ...t
554
+ }), gs = (t = {}) => ({
555
+ radii: [..._s],
556
+ rot: 0,
557
+ cx: 0,
558
+ cy: 0,
559
+ sx: 1,
560
+ sy: 1,
561
+ ...t
562
+ }), xs = ns(Ft(0, 0, 0.118, 0, 0.172, 0.012)), we = 0.213;
563
+ function Ie(t) {
564
+ return ce("triangle", {
565
+ rot: t,
566
+ cx: -we * Math.sin(t),
567
+ cy: we * Math.cos(t)
568
+ });
569
+ }
570
+ function ze(t, n) {
571
+ const e = ((t - n * 0.5) / 1.5 % 1 + 1) % 1, s = e < 0.5 ? 0.5 - 0.5 * Math.cos(e * U) : 0;
572
+ return w(s * 2);
573
+ }
574
+ const Ze = [
575
+ {
576
+ id: "idle",
577
+ duration: 2.4,
578
+ morph: 0.45,
579
+ blinkIn: !1,
580
+ baseFace: !0,
581
+ baseBody: !0,
582
+ pose: () => W()
583
+ },
584
+ {
585
+ id: "thinking",
586
+ duration: 2.6,
587
+ morph: 0.4,
588
+ baseFace: !1,
589
+ baseBody: !1,
590
+ blinkIn: !0,
591
+ pose: (t) => {
592
+ const n = ze(t, 1), e = 0.3 + 0.7 * G.easeOutCubic(w(t / 0.3));
593
+ return W({
594
+ // the ball BECOMES the middle dot: the morph stays continuous
595
+ sil: It(ge * (1 + (xe - 1) * n), { cx: ye[1] }),
596
+ eyeAlpha: 0,
597
+ dots: [0, 2].map((s) => {
598
+ const o = ze(t, s);
599
+ return {
600
+ x: ye[s] * e,
601
+ y: 0,
602
+ r: ge * (1 + (xe - 1) * o),
603
+ opacity: 0.55 + 0.45 * o
604
+ };
605
+ })
606
+ });
607
+ }
608
+ },
609
+ {
610
+ id: "wink",
611
+ duration: 1.6,
612
+ morph: 0.3,
613
+ blinkIn: !0,
614
+ baseFace: !1,
615
+ baseBody: !0,
616
+ pose: () => W({
617
+ gaze: { yaw: -5.37, pitch: 4.55, roll: 6.7 },
618
+ split: 16.25,
619
+ // The closed eye is not the open eye squashed: it is a horizontal dash
620
+ // WIDER than the open eye (0.447 against 0.236).
621
+ eyes: [
622
+ { w: 0.236, h: 0.464, open: 1 },
623
+ { w: 0.447, h: 0.089, open: 1 }
624
+ ]
625
+ })
626
+ },
627
+ {
628
+ id: "wide",
629
+ duration: 1.8,
630
+ morph: 0.55,
631
+ blinkIn: !0,
632
+ baseFace: !1,
633
+ baseBody: !0,
634
+ pose: () => W({
635
+ gaze: { yaw: 6.92, pitch: -21.96, roll: 11.6 },
636
+ split: 18.43,
637
+ eyes: $t(0.356, 0.875)
638
+ })
639
+ },
640
+ {
641
+ id: "alert",
642
+ duration: 2.4,
643
+ // the "!" settles back at 1.6 + 0.4
644
+ minDuration: 2,
645
+ morph: 0.45,
646
+ baseFace: !1,
647
+ baseBody: !1,
648
+ blinkIn: !1,
649
+ pose: (t) => {
650
+ const n = w(t / 1.5), e = G.easeInOutCubic(n) * 0.82 - 0.087, s = t > 1.6 ? w((t - 1.6) / 0.4) : 0, o = e * (1 - s) + 0.1 * s, i = Math.sin(t * 2.5 * U) * 5e-3, r = 17.7 * Math.PI / 180;
651
+ return W({
652
+ sil: gs({ rot: r, cx: o, cy: -0.325 - i }),
653
+ eyeAlpha: 0,
654
+ dots: [
655
+ {
656
+ // the dot follows the glyph's axis, 0.580 from the bar's centre
657
+ x: o - Math.sin(r) * 0.58,
658
+ y: -0.325 + Math.cos(r) * 0.58 + i * 2.8,
659
+ r: 0.118,
660
+ d: xs,
661
+ rot: r * 180 / Math.PI,
662
+ opacity: 1
663
+ }
664
+ ]
665
+ });
666
+ }
667
+ },
668
+ {
669
+ id: "notify",
670
+ duration: 2.2,
671
+ morph: 0.5,
672
+ blinkIn: !0,
673
+ baseFace: !1,
674
+ baseBody: !0,
675
+ pose: (t) => {
676
+ const n = w(t / 0.45), e = 1 + (Fn - 1) * Math.sin(n * Math.PI) * (1 - n * 0.35), s = Ln * (n < 1 ? e : 1), o = qn * Math.PI / 180;
677
+ return W({
678
+ // the gaze goes to the opposite side from the pip
679
+ gaze: { yaw: -21.94, pitch: -5.82, roll: -12.2 },
680
+ split: 18.89,
681
+ eyes: $t(0.505, 0.498),
682
+ notif: {
683
+ x: Math.cos(o) * ke,
684
+ y: Math.sin(o) * ke,
685
+ r: s,
686
+ notch: s + Hn
687
+ }
688
+ });
689
+ }
690
+ },
691
+ {
692
+ id: "exclaim",
693
+ duration: 2,
694
+ morph: 0.45,
695
+ baseFace: !1,
696
+ baseBody: !1,
697
+ blinkIn: !1,
698
+ pose: () => W({
699
+ sil: ys(),
700
+ eyeAlpha: 0,
701
+ dots: [{ x: -0.012, y: 0.526, r: 0.113, opacity: 1 }]
702
+ })
703
+ },
704
+ {
705
+ id: "sleep",
706
+ duration: 2.4,
707
+ morph: 0.5,
708
+ baseFace: !1,
709
+ baseBody: !1,
710
+ blinkIn: !1,
711
+ pose: (t) => W({
712
+ // Measured vertical bounce: +-0.19 about +0.11, period 0.6 s.
713
+ sil: It(0.1585, { cy: 0.11 + Math.sin(t * (U / 0.6)) * 0.19 }),
714
+ eyeAlpha: 0
715
+ })
716
+ },
717
+ {
718
+ id: "egg",
719
+ duration: 1.8,
720
+ morph: 0.4,
721
+ baseFace: !1,
722
+ baseBody: !1,
723
+ blinkIn: !0,
724
+ pose: () => W({
725
+ sil: ce("egg"),
726
+ gaze: { yaw: 19.97, pitch: 26.01, roll: -17.1 },
727
+ // the eyes narrow along with the body
728
+ split: 11.07,
729
+ eyes: $t(0.164, 0.385)
730
+ })
731
+ },
732
+ {
733
+ id: "hexagon",
734
+ duration: 1.6,
735
+ morph: 0.4,
736
+ baseFace: !1,
737
+ baseBody: !1,
738
+ blinkIn: !0,
739
+ pose: () => W({
740
+ sil: ce("hexagon"),
741
+ gaze: { yaw: 23.11, pitch: 24.42, roll: -13.3 },
742
+ split: 13.37,
743
+ eyes: $t(0.177, 0.411)
744
+ })
745
+ },
746
+ {
747
+ id: "play",
748
+ duration: 2,
749
+ morph: 0.5,
750
+ baseFace: !1,
751
+ baseBody: !1,
752
+ blinkIn: !0,
753
+ pose: (t) => {
754
+ const n = w(t / 0.35) * w((2.2 - t) / 0.5);
755
+ return W({
756
+ sil: Ie(0),
757
+ gaze: { yaw: 12, pitch: -8, roll: -6 },
758
+ split: 15,
759
+ eyes: $t(0.18, 0.34),
760
+ // the bundle sweeps right to left over the triangle
761
+ arcs: En.map((e, s) => ({
762
+ id: `sw${s}`,
763
+ seed: { ...e, cx: 0.45 - t * 0.42 },
764
+ t,
765
+ opacity: n
766
+ }))
767
+ });
768
+ }
769
+ },
770
+ {
771
+ id: "orbit",
772
+ duration: 3.4,
773
+ // the body has finished relaxing from triangle to ball at 1.6 + 0.9
774
+ minDuration: 2.5,
775
+ morph: 0.6,
776
+ baseFace: !1,
777
+ baseBody: !1,
778
+ blinkIn: !1,
779
+ pose: (t) => {
780
+ const n = G.easeInOutCubic(w(t / 0.35)), e = -U * 1.25 * t * n, s = G.easeInOutCubic(w((t - 1.6) / 0.9)), o = Ie(e), i = It(1, { rot: e }), r = {
781
+ radii: o.radii.map((l, d) => l + (i.radii[d] - l) * s),
782
+ rot: e,
783
+ cx: o.cx * (1 - s),
784
+ cy: o.cy * (1 - s),
785
+ sx: 1,
786
+ sy: 1
787
+ }, c = w(t / 0.8) * w((3.6 - t) / 0.9);
788
+ return W({
789
+ sil: r,
790
+ // the eyes race around the sphere ~3x faster than the silhouette
791
+ gaze: {
792
+ yaw: Xe.yaw + Math.sin(t * 6.5) * 65 * (1 - s),
793
+ pitch: -4 + s * 32,
794
+ roll: -13
795
+ },
796
+ eyes: $t(0.18, 0.34 + s * 0.07),
797
+ // the rings come in one by one over 0.8 s
798
+ arcs: _e.map((l, d) => ({
799
+ id: `rg${d}`,
800
+ seed: l,
801
+ t,
802
+ opacity: c * w((t - d * 0.13) / 0.3)
803
+ }))
804
+ });
805
+ }
806
+ },
807
+ {
808
+ /**
809
+ * The entry transition into a settings-like view.
810
+ *
811
+ * The ONE state that is not measured: it is CHOSEN. It borrows `orbit`'s
812
+ * vocabulary — the same rings, with their measured parameters — but cuts short:
813
+ * 1 s instead of 3.4, half the rings, and no triangle.
814
+ *
815
+ * The two `true` flags are the whole point of this state:
816
+ *
817
+ * - `baseBody` lets the chosen shape replace the body, so a view can impose the
818
+ * circle and the pebble or the droplet MORPH into it instead of jumping;
819
+ * - `baseFace` makes it carry the resting face, so pointer following applies
820
+ * from this entry on. A state with its own gaze pose (like `orbit`) would hand
821
+ * over to the next state mid-course, and the eyes would jump on resume.
822
+ *
823
+ * It is deliberately NOT in `SEQUENCE`: it is an interface transition, not a
824
+ * catalogue animation.
825
+ */
826
+ id: "swirl",
827
+ // a little more than the gaze's turn (`TURN_TIME`, 1.1 s): the eyes must be
828
+ // settled before the rings fade out
829
+ duration: 1.3,
830
+ minDuration: 1.3,
831
+ morph: 0.3,
832
+ baseFace: !0,
833
+ baseBody: !0,
834
+ // the shape morph is hidden behind a blink, as everywhere else
835
+ blinkIn: !0,
836
+ pose: (t) => W({
837
+ // three of `orbit`'s six rings: half the bundle is enough to recognise it,
838
+ // and that is as many arcs fewer to rasterise per frame
839
+ arcs: _e.slice(0, 3).map((n, e) => ({
840
+ id: `sw${e}`,
841
+ seed: n,
842
+ t,
843
+ // they come in one after another then fade before the block ends, so the
844
+ // return to rest happens on an already clean frame
845
+ opacity: w((t - e * 0.06) / 0.14) * w((1.22 - t) / 0.34)
846
+ }))
847
+ })
848
+ },
849
+ {
850
+ id: "burst",
851
+ duration: 2.6,
852
+ // the body is recomposed at 1.7 + 0.7
853
+ minDuration: 2.4,
854
+ morph: 0.4,
855
+ baseFace: !1,
856
+ baseBody: !1,
857
+ blinkIn: !1,
858
+ pose: (t) => {
859
+ const n = 1 - 0.834 * G.easeOutQuint(w(t / 0.7)), e = G.easeOutQuint(w((t - 1.7) / 0.7));
860
+ return W({
861
+ sil: It(n + (1 - n) * e),
862
+ eyeAlpha: w((t - 1.85) / 0.4),
863
+ dots: On(t, 1),
864
+ dotsBehind: !0
865
+ });
866
+ }
867
+ },
868
+ {
869
+ id: "comet",
870
+ duration: 2.4,
871
+ // the dot recomposes at 1.85 + 0.6 = 2.45, i.e. 0.05 s past the reference's
872
+ // cut: that remainder finishes during the next fade, as in the reference. So we
873
+ // do not go below the measured duration.
874
+ minDuration: 2.4,
875
+ morph: 0.45,
876
+ baseFace: !1,
877
+ baseBody: !1,
878
+ blinkIn: !1,
879
+ pose: (t) => {
880
+ const n = 1 - (1 - Sn) * G.easeOutQuint(w(t / 0.55)), e = G.easeOutQuint(w((t - 1.85) / 0.6)), s = w((t - 0.15) / 0.25) * w((1.95 - t) / 0.3);
881
+ return W({
882
+ // The dot drifts 0.035 downwards then comes back (measured wobble).
883
+ sil: It(n + (1 - n) * e, {
884
+ cy: Math.sin(w(t / 1.7) * Math.PI) * 0.035
885
+ }),
886
+ eyeAlpha: w((t - 2) / 0.35),
887
+ arcs: Cn.map((o, i) => ({ id: `cm${i}`, seed: o, t, opacity: s }))
888
+ });
889
+ }
890
+ }
891
+ ], zt = new Map(Ze.map((t) => [t.id, t])), bs = {
892
+ idle: 1,
893
+ thinking: 1.1,
894
+ wink: 0.8,
895
+ wide: 0.8,
896
+ alert: 0.75,
897
+ notify: 0.9,
898
+ exclaim: 0.8,
899
+ sleep: 0.45,
900
+ egg: 0.8,
901
+ hexagon: 0.8,
902
+ play: 0.9,
903
+ orbit: 1.2,
904
+ swirl: 0.5,
905
+ burst: 0.45,
906
+ comet: 1.15
907
+ }, Xi = [
908
+ "idle",
909
+ "thinking",
910
+ "wink",
911
+ "wide",
912
+ "alert",
913
+ "notify",
914
+ "exclaim",
915
+ "sleep",
916
+ "egg",
917
+ "hexagon",
918
+ "play",
919
+ "orbit",
920
+ "burst",
921
+ "comet"
922
+ ], yt = 100, Re = 5.5 + 1.6, Te = 4.2 + 1.3, vs = 6e-3, ks = 7e-3;
923
+ function Be(t, n, e) {
924
+ const s = [], o = Ge(t.gaze, yt, t.split);
925
+ for (let i = 0; i < 2; i++) {
926
+ const r = o[i];
927
+ if (r.depth <= 0.02) continue;
928
+ const c = t.eyes[i], l = (c.tilt ?? 0) * Math.PI / 180, d = Math.cos(l), u = Math.sin(l), h = r.a * d + r.c * u, f = r.b * d + r.d * u, p = -r.a * u + r.c * d, _ = -r.b * u + r.d * d, x = Math.max(c.w * yt, 0.01) / 2, $ = Math.max(c.h * yt, 0.01) / 2, m = Math.min(x, $), A = $ > x, v = A ? $ - m : x - m, y = Qe(e, Math.atan2(r.y, r.x) - n.rot);
929
+ s.push({
930
+ x: r.x * y,
931
+ y: r.y * y,
932
+ ax: (A ? p : h) * v,
933
+ ay: (A ? _ : f) * v,
934
+ r: m,
935
+ m: [h, f, p, _]
936
+ });
937
+ }
938
+ return s;
939
+ }
940
+ function Ns(t, n, e, s, o) {
941
+ const i = s - n, r = o - e, c = i * i + r * r;
942
+ let l = 1 / 0, d = 0, u = 0;
943
+ for (let f = 0; f < t.length; f++) {
944
+ const p = t[f];
945
+ let _ = c > 0 ? ((p.x - n) * i + (p.y - e) * r) / c : 0;
946
+ _ = _ < 0 ? 0 : _ > 1 ? 1 : _;
947
+ const x = n + _ * i - p.x, $ = e + _ * r - p.y, m = x * x + $ * $;
948
+ m < l && (l = m, d = x, u = $);
949
+ }
950
+ const h = Math.sqrt(l);
951
+ return { d: h, ux: h > 1e-9 ? d / h : 0, uy: h > 1e-9 ? u / h : 0 };
952
+ }
953
+ const $s = Math.hypot(vs, ks) * yt;
954
+ function Ee(t, n, e, s) {
955
+ let o = 1 / 0, i = 0, r = 0;
956
+ for (const c of n) {
957
+ const l = c.x + e, d = c.y + s, u = Ns(t, l - c.ax, d - c.ay, l + c.ax, d + c.ay), [h, f, p, _] = c.m, x = c.r * Math.hypot(h * u.ux + f * u.uy, p * u.ux + _ * u.uy) + $s;
958
+ u.d - x < o && (o = u.d - x, i = u.ux, r = u.uy);
959
+ }
960
+ return { margin: o, ux: i, uy: r };
961
+ }
962
+ const Pe = 12, As = 8;
963
+ function Ms(t) {
964
+ if (!t.length) return { x: 0, y: 0 };
965
+ const n = (m, A) => {
966
+ let v = 1 / 0;
967
+ for (const y of t) v = Math.min(v, Ee(y.outline, y.footprints, m, A).margin);
968
+ return v;
969
+ };
970
+ let e = 1 / 0;
971
+ for (const m of t)
972
+ e = Math.min(e, Ee(m.refOutline, m.reference, 0, 0).margin);
973
+ let s = 0, o = 0;
974
+ const i = t[0].footprints;
975
+ for (const m of i)
976
+ s -= m.x / i.length, o -= m.y / i.length;
977
+ const r = Math.max(0.35 * yt, Math.hypot(s, o) * 1.25);
978
+ e = Math.min(e, n(s, o));
979
+ const c = n(0, 0);
980
+ if (c >= e && c >= 0) return { x: 0, y: 0 };
981
+ const l = Math.max(e, 0);
982
+ let d = 0, u = 0, h = 1 / 0, f = 0, p = 0, _ = c;
983
+ for (let m = 0; m < Pe; m++) {
984
+ const A = m / Pe * Math.PI * 2, v = Math.cos(A), y = Math.sin(A);
985
+ if (n(v * r, y * r) < l) {
986
+ for (const M of [0.3, 0.6, 1]) {
987
+ const E = n(v * r * M, y * r * M);
988
+ E > _ && (_ = E, f = v * r * M, p = y * r * M);
989
+ }
990
+ continue;
991
+ }
992
+ let b = 0, P = r;
993
+ for (let M = 0; M < As; M++) {
994
+ const E = (b + P) / 2;
995
+ n(v * E, y * E) >= l ? P = E : b = E;
996
+ }
997
+ P < h && (h = P, d = v * P, u = y * P);
998
+ }
999
+ const x = h === 1 / 0 ? f : d, $ = h === 1 / 0 ? p : u;
1000
+ return { x: +(x / yt).toFixed(6), y: +($ / yt).toFixed(6) };
1001
+ }
1002
+ function ws(t, n, e) {
1003
+ return t.baseFace && e ? { gaze: e.gaze, split: e.split, eyes: e.eyes } : { gaze: n.gaze, split: n.split, eyes: n.eyes };
1004
+ }
1005
+ function Is(t) {
1006
+ const n = (s) => JSON.stringify([s.gaze, s.split, s.eyes, s.sil.rot, s.sil.cx, s.sil.cy, s.sil.sx, s.sil.sy]);
1007
+ if (n(t.pose(0)) === n(t.pose(t.duration))) return [0];
1008
+ const e = 3;
1009
+ return Array.from({ length: e }, (s, o) => o / (e - 1) * t.duration);
1010
+ }
1011
+ function zs(t, n, e) {
1012
+ const s = [];
1013
+ for (const o of Is(t)) {
1014
+ const i = t.pose(o), r = le({ ...i.sil, radii: n }, yt), c = le(i.sil, yt), l = ws(t, i, e), d = [];
1015
+ for (const u of [-Re, Re])
1016
+ for (const h of [-Te, Te])
1017
+ d.push({
1018
+ ...l,
1019
+ gaze: { yaw: l.gaze.yaw + u, pitch: l.gaze.pitch + h, roll: l.gaze.roll }
1020
+ });
1021
+ for (const u of d)
1022
+ s.push({
1023
+ footprints: Be(u, i.sil, n),
1024
+ reference: Be(u, i.sil, i.sil.radii),
1025
+ outline: r,
1026
+ refOutline: c
1027
+ });
1028
+ }
1029
+ return Ms(s);
1030
+ }
1031
+ const Jt = { x: 0, y: 0 }, de = (t, n) => `${t}|${n ?? ""}`;
1032
+ function Rs() {
1033
+ return new Map(
1034
+ Ve.map((t) => {
1035
+ const n = /* @__PURE__ */ new Map();
1036
+ for (const e of Ze) {
1037
+ if (!e.baseBody) continue;
1038
+ const s = e.baseFace ? [null, ...We] : [null];
1039
+ for (const o of s)
1040
+ n.set(de(e.id, (o == null ? void 0 : o.id) ?? null), zs(e, t.radii, o));
1041
+ }
1042
+ return [t.radii, n];
1043
+ })
1044
+ );
1045
+ }
1046
+ const Ts = Rs();
1047
+ function Oe(t, n, e) {
1048
+ if (!t) return Jt;
1049
+ const s = Ts.get(t);
1050
+ return s ? s.get(de(n, e)) ?? s.get(de(n, null)) ?? Jt : Jt;
1051
+ }
1052
+ const te = { yaw: 0, pitch: 0, mix: 0, spin: 0, wander: 1 }, Bs = (t, n, e) => ({
1053
+ yaw: I(t.yaw, n.yaw, e),
1054
+ pitch: I(t.pitch, n.pitch, e),
1055
+ mix: I(t.mix, n.mix, e),
1056
+ spin: I(t.spin, n.spin, e),
1057
+ wander: I(t.wander, n.wander, e)
1058
+ }), Ce = (t, n, e) => ({
1059
+ w: I(t.w, n.w, e),
1060
+ h: I(t.h, n.h, e),
1061
+ open: I(t.open, n.open, e),
1062
+ tilt: I(t.tilt ?? 0, n.tilt ?? 0, e)
1063
+ });
1064
+ function Se(t, n, e) {
1065
+ const s = 1 - e;
1066
+ return {
1067
+ sil: Kn(t.sil, n.sil, e),
1068
+ offX: I(t.offX, n.offX, e),
1069
+ offY: I(t.offY, n.offY, e),
1070
+ gaze: {
1071
+ yaw: I(t.gaze.yaw, n.gaze.yaw, e),
1072
+ pitch: I(t.gaze.pitch, n.gaze.pitch, e),
1073
+ roll: I(t.gaze.roll, n.gaze.roll, e)
1074
+ },
1075
+ split: I(t.split, n.split, e),
1076
+ eyes: [Ce(t.eyes[0], n.eyes[0], e), Ce(t.eyes[1], n.eyes[1], e)],
1077
+ eyeAlpha: I(t.eyeAlpha, n.eyeAlpha, e),
1078
+ bodyAlpha: I(t.bodyAlpha, n.bodyAlpha, e),
1079
+ dots: [
1080
+ ...t.dots.map((o) => ({ ...o, opacity: o.opacity * s })),
1081
+ ...n.dots.map((o) => ({ ...o, opacity: o.opacity * e }))
1082
+ ],
1083
+ arcs: [
1084
+ ...t.arcs.map((o) => ({ ...o, id: `a${o.id}`, opacity: o.opacity * s })),
1085
+ ...n.arcs.map((o) => ({ ...o, id: `b${o.id}`, opacity: o.opacity * e }))
1086
+ ],
1087
+ // the pip belongs to one of the two states only, it does not blend
1088
+ notif: e < 0.5 ? t.notif : n.notif,
1089
+ dotsBehind: e < 0.5 ? t.dotsBehind : n.dotsBehind
1090
+ };
1091
+ }
1092
+ const _t = class _t {
1093
+ constructor(n = 100, e = "idle", s = null, o = null) {
1094
+ this.prev = null, this.frozenStart = null, this.tCur = 0, this.tPrev = 0, this.blinkAt = -10, this.pts = [], this.shape = null, this.shapePrev = null, this.shapeAt = -10, this.expr = null, this.exprPrev = null, this.exprAt = -10, this.look = te, this.lookPrev = te, this.lookAt = -10, this.lookMorph = 0.24, this.scale = n, this.cur = e, this.shape = s, this.expr = o;
1095
+ }
1096
+ /**
1097
+ * The resting expression chosen in the customiser. Like the shape, it glides
1098
+ * towards the new value instead of jumping.
1099
+ */
1100
+ setExpression(n, e = 0) {
1101
+ n !== this.expr && (this.exprPrev = this.expr, this.expr = n, this.exprAt = e);
1102
+ }
1103
+ /** The effective expression at `now`, morph in progress included. */
1104
+ exprAtTime(n) {
1105
+ const e = this.expr, s = this.exprPrev;
1106
+ if (!e || !s) return e;
1107
+ const o = (n - this.exprAt) / _t.SHAPE_MORPH;
1108
+ return o >= 1 ? e : Qn(s, e, G.easeOutQuint(w(o)));
1109
+ }
1110
+ /**
1111
+ * The shape chosen in the customiser. It only replaces the body on the resting
1112
+ * states (`baseBody`): on the others the silhouette IS the animation and must not
1113
+ * be overwritten.
1114
+ *
1115
+ * The change is a morph, not a jump: since every shape is sampled at the same
1116
+ * angles, interpolating the radii is enough.
1117
+ */
1118
+ setShape(n, e = 0) {
1119
+ n !== this.shape && (this.shapePrev = this.shape, this.shape = n, this.shapeAt = e);
1120
+ }
1121
+ /**
1122
+ * The effective shape at `now`, morph in progress included.
1123
+ *
1124
+ * Does NOT reset `shapePrev` to null when the morph ends: `sample` must stay a pure
1125
+ * function of time, so re-reading a past date has to give back the intermediate
1126
+ * image. We simply keep one more reference.
1127
+ */
1128
+ shapeAtTime(n) {
1129
+ const e = this.shape, s = this.shapePrev;
1130
+ if (!e || !s) return e;
1131
+ const o = (n - this.shapeAt) / _t.SHAPE_MORPH;
1132
+ if (o >= 1) return e;
1133
+ const i = G.easeOutQuint(w(o));
1134
+ return e.map((r, c) => I(s[c] ?? r, r, i));
1135
+ }
1136
+ /**
1137
+ * A new gaze target, `null` to fall back to the state's own.
1138
+ *
1139
+ * It restarts from the CURRENT value, and not from the previous target the way
1140
+ * `setShape` does: this method is called on every pointer move, and restarting from
1141
+ * the old target would step the gaze backwards before every catch-up — the follow
1142
+ * would tremble instead of gliding.
1143
+ *
1144
+ * Same contract as `setShape` otherwise: external state comes in through a dated
1145
+ * setter, never through a variable read during `sample`, or the engine stops being
1146
+ * a pure function of time.
1147
+ */
1148
+ setLook(n, e, s = _t.LOOK_MORPH) {
1149
+ n && !Number.isFinite(n.yaw + n.pitch + n.mix + n.spin + n.wander) || (this.lookPrev = this.lookAtTime(e), this.look = n ?? te, this.lookAt = e, this.lookMorph = s);
1150
+ }
1151
+ /** The effective gaze at `now`, catch-up in progress included. */
1152
+ lookAtTime(n) {
1153
+ const e = (n - this.lookAt) / this.lookMorph;
1154
+ return e >= 1 ? this.look : Bs(this.lookPrev, this.look, G.easeOutQuint(w(e)));
1155
+ }
1156
+ posed(n, e, s, o) {
1157
+ let i = n.pose(e);
1158
+ return n.baseBody && s && (i = { ...i, sil: { ...i.sil, radii: s } }), n.baseFace && o && (i = { ...i, gaze: o.gaze, split: o.split, eyes: o.eyes }), i;
1159
+ }
1160
+ /**
1161
+ * The eye offset at `now` for a given state, in ball-radius units.
1162
+ *
1163
+ * It is READ from a table and interpolated, never recomputed: `eyefit.ts` explains
1164
+ * why that distinction is the whole fix. All that is left here is interpolating it
1165
+ * along the shape's axis, with exactly the silhouette morph's curve and duration —
1166
+ * it is the same cause, so it must be the same movement.
1167
+ *
1168
+ * The table is queried on the morph's BOUNDARIES (`shapePrev` and `shape`) and not
1169
+ * on the profile `shapeAtTime` returns: that one is a fresh array allocated every
1170
+ * frame, so it has no identity and exists in no table.
1171
+ */
1172
+ eyeOffsetAtTime(n, e) {
1173
+ const s = (i, r, c, l) => {
1174
+ if (c === l) return l;
1175
+ const d = (n - i) / r;
1176
+ if (d >= 1) return l;
1177
+ const u = G.easeOutQuint(w(d));
1178
+ return { x: I(c.x, l.x, u), y: I(c.y, l.y, u) };
1179
+ }, o = (i) => {
1180
+ var r, c;
1181
+ return s(
1182
+ this.exprAt,
1183
+ _t.SHAPE_MORPH,
1184
+ Oe(i, e, ((r = this.exprPrev) == null ? void 0 : r.id) ?? null),
1185
+ Oe(i, e, ((c = this.expr) == null ? void 0 : c.id) ?? null)
1186
+ );
1187
+ };
1188
+ return s(
1189
+ this.shapeAt,
1190
+ _t.SHAPE_MORPH,
1191
+ o(this.shapePrev),
1192
+ o(this.shape)
1193
+ );
1194
+ }
1195
+ get state() {
1196
+ return this.cur;
1197
+ }
1198
+ /**
1199
+ * Restarts on `id` WITH NO previous state, like a fresh engine placed on it.
1200
+ *
1201
+ * This is what "rewind" means for this engine. `setState` alone cannot do it: it
1202
+ * keeps the state being left in order to fade from it, which is exactly its job
1203
+ * during playback and exactly what must not happen when returning to the start of a
1204
+ * sequence. Replaying frame 0 after a full pass blended the first state with the
1205
+ * LAST one, and the export opened on an eyeless ball — the comet has a zero
1206
+ * `eyeAlpha`.
1207
+ *
1208
+ * `sample` stays a pure function of time: like `setState`, this is a DATED setter,
1209
+ * called by whatever drives the sequence, never during a sampling.
1210
+ */
1211
+ reset(n, e) {
1212
+ this.cur = n, this.prev = null, this.frozenStart = null, this.tCur = e, this.tPrev = e, this.blinkAt = -10;
1213
+ }
1214
+ /**
1215
+ * The origin of the running fade: the frozen pose if there is one, otherwise the
1216
+ * state being left evaluated at its own elapsed time — so still animating, which is
1217
+ * what we want.
1218
+ */
1219
+ fadeOrigin(n, e, s) {
1220
+ if (this.frozenStart) return this.frozenStart;
1221
+ if (!this.prev) return null;
1222
+ const o = zt.get(this.prev);
1223
+ return this.posed(o, Math.max(0, n - this.tPrev), e, s);
1224
+ }
1225
+ /**
1226
+ * The composite pose at `now`, running fade included: exactly what `sample` blends,
1227
+ * before the layer of life-at-rest and gaze. Extracted so that `setState` can
1228
+ * freeze it.
1229
+ */
1230
+ composedPose(n) {
1231
+ const e = zt.get(this.cur), s = this.shapeAtTime(n), o = this.exprAtTime(n), i = this.posed(e, Math.max(0, n - this.tCur), s, o), r = n - this.tCur;
1232
+ if (r >= e.morph) return i;
1233
+ const c = this.fadeOrigin(n, s, o);
1234
+ return c ? Se(c, i, G.easeOutQuint(w(r / e.morph))) : i;
1235
+ }
1236
+ /**
1237
+ * A dated state change.
1238
+ *
1239
+ * The engine keeps only ONE slot of history, so a change arriving during a fade
1240
+ * replaced the blend's origin with the FULL pose of the state being left, instead
1241
+ * of the partially blended image that was on screen. Measured on
1242
+ * `idle -> wide -> idle` at 100 ms: 35.9 px of jump against 8.0 px of normal
1243
+ * movement.
1244
+ *
1245
+ * So we freeze the current composite pose and blend from it. Continuous by
1246
+ * construction, however many changes are chained.
1247
+ *
1248
+ * And ONLY in that case. Freezing on every change would halt the outgoing state's
1249
+ * animation for the whole fade — `alert`'s "!" would freeze mid-flight — while
1250
+ * there is nothing to correct outside a morph: there the state being left already
1251
+ * IS exactly the displayed image. Spaced playback therefore freezes nothing and
1252
+ * renders byte for byte what it used to.
1253
+ */
1254
+ setState(n, e) {
1255
+ var i;
1256
+ if (n === this.cur) return;
1257
+ const s = zt.get(this.cur).morph, o = this.prev !== null && e - this.tCur < s;
1258
+ this.frozenStart = o ? this.composedPose(e) : null, this.prev = this.cur, this.tPrev = this.tCur, this.cur = n, this.tCur = e, (i = zt.get(n)) != null && i.blinkIn && (this.blinkAt = e);
1259
+ }
1260
+ sample(n) {
1261
+ const e = this.scale, s = zt.get(this.cur), o = this.shapeAtTime(n), i = this.exprAtTime(n);
1262
+ let r = this.posed(s, Math.max(0, n - this.tCur), o, i), c = this.eyeOffsetAtTime(n, this.cur);
1263
+ const l = n - this.tCur, d = l < s.morph ? this.fadeOrigin(n, o, i) : null;
1264
+ if (d) {
1265
+ const T = G.easeOutQuint(w(l / s.morph));
1266
+ r = Se(d, r, T);
1267
+ const L = this.prev;
1268
+ if (L) {
1269
+ const B = this.eyeOffsetAtTime(n, L);
1270
+ c = {
1271
+ x: I(B.x, c.x, T),
1272
+ y: I(B.y, c.y, T)
1273
+ };
1274
+ }
1275
+ }
1276
+ const u = r.eyeAlpha > 0.01, h = this.lookAtTime(n), f = Un(n, { wander: u ? h.wander : 0, blink: u }), p = {
1277
+ // Both aims REPLACE the pose's instead of adding to them (see `Look`), and the
1278
+ // turn is subtracted on the way. The drift is added AFTER the mix, otherwise
1279
+ // the target would cancel it along with the pose — and it has to survive a
1280
+ // turned head with no pointer.
1281
+ yaw: I(r.gaze.yaw, h.yaw, h.mix) + f.dYaw - h.spin,
1282
+ pitch: I(r.gaze.pitch, h.pitch, h.mix) + f.dPitch,
1283
+ // the roll follows nothing: Novi's head is tilted -13deg in the reference, and
1284
+ // rolling it with the cursor breaks that signature
1285
+ roll: r.gaze.roll + f.dRoll
1286
+ }, _ = w((n - this.blinkAt) / 0.2), x = _ < 1 ? Math.abs(_ * 2 - 1) : 1, $ = Math.min(f.lid, x), m = r.offX + f.driftX, A = r.offY + f.driftY, v = {
1287
+ ...r.sil,
1288
+ cx: r.sil.cx + m,
1289
+ cy: r.sil.cy + A,
1290
+ sy: r.sil.sy * f.breath
1291
+ }, y = Zn(le(v, e, this.pts)), b = (T, L) => Qe(r.sil.radii, Math.atan2(L, T) - r.sil.rot), P = [];
1292
+ if (r.eyeAlpha > 0.01) {
1293
+ const T = Ge(p, e, r.split);
1294
+ for (let L = 0; L < 2; L++) {
1295
+ const B = T[L];
1296
+ if (B.depth <= 0.02) continue;
1297
+ const et = r.eyes[L], F = b(B.x, B.y), ut = (et.tilt ?? 0) * Math.PI / 180, Z = Math.cos(ut), J = Math.sin(ut), at = B.a * Z + B.c * J, k = B.b * Z + B.d * J, C = -B.a * J + B.c * Z, S = -B.b * J + B.d * Z, D = Xn(Math.min($, et.open));
1298
+ P.push({
1299
+ d: ss(et.w * e, et.h * e),
1300
+ matrix: `matrix(${N(at)},${N(k * D)},${N(C)},${N(S * D)},${N(B.x * F + (m + c.x) * e)},${N(B.y * F + (A + c.y) * e)})`,
1301
+ alpha: r.eyeAlpha * w(B.depth / 0.12)
1302
+ });
1303
+ }
1304
+ }
1305
+ const M = r.dots.filter((T) => T.opacity > 0.01 && T.r > 5e-4).map((T) => ({ ...T, x: (T.x + m) * e, y: (T.y + A) * e, r: T.r * e })), E = r.notif ? b(r.notif.x, r.notif.y) : 1, j = r.notif ? (r.notif.x * E + m) * e : 0, q = r.notif ? (r.notif.y * E + A) * e : 0, O = r.notif ? { x: j, y: q, r: r.notif.r * e } : null, rt = r.notif ? { x: j, y: q, r: r.notif.notch * e } : null;
1306
+ return {
1307
+ bodyPath: y,
1308
+ bodyAlpha: r.bodyAlpha,
1309
+ eyes: P,
1310
+ dots: M,
1311
+ dotsBehind: r.dotsBehind,
1312
+ // States declare arcs in ball-radius units; the engine alone knows the viewBox
1313
+ // scale, so the engine is what rasterises them.
1314
+ arcs: r.arcs.filter((T) => T.opacity > 0.01).map((T) => Bn(T.seed, T.t, e, T.id, T.opacity)),
1315
+ notif: O,
1316
+ notch: rt
1317
+ };
1318
+ }
1319
+ };
1320
+ _t.SHAPE_MORPH = 0.45, _t.LOOK_MORPH = 0.24;
1321
+ let ue = _t;
1322
+ const Je = 100, Es = 158, Ps = 16, Os = 13, Cs = 10, tn = 360, ee = 1.1, Ss = 1.5, Gi = (t) => ({
1323
+ yaw: 0,
1324
+ pitch: 0,
1325
+ mix: 0,
1326
+ spin: tn * (1 - G.easeInOutCubic(w(t / Ss))),
1327
+ wander: 1
1328
+ });
1329
+ function js({ nx: t, ny: n, progress: e, pointer: s, turn: o = 0 }) {
1330
+ return {
1331
+ yaw: o + t * Ps,
1332
+ // positive pitch = looking up, whereas the screen's y goes down
1333
+ pitch: Cs - n * Os,
1334
+ mix: e,
1335
+ spin: tn * (1 - e),
1336
+ // With no pointer the head stays turned, but its drift is given back: otherwise
1337
+ // Novi stares at a dead point, and arriving by keyboard or touch gave a
1338
+ // completely motionless avatar.
1339
+ wander: s ? 0 : 1
1340
+ };
1341
+ }
1342
+ function qs(t, n) {
1343
+ if (/^#[0-9a-f]{6}$/i.test(t)) return t;
1344
+ const e = t.match(/-?\d*\.?\d+/g);
1345
+ return !e || e.length < 3 ? n : `#${e.slice(0, 3).map(
1346
+ (s) => Math.max(0, Math.min(255, Math.round(Number(s)))).toString(16).padStart(2, "0")
1347
+ ).join("")}`;
1348
+ }
1349
+ function je(t, n) {
1350
+ if (typeof document > "u") return n;
1351
+ const e = document.createElement("span");
1352
+ e.style.color = t, e.style.position = "absolute", e.style.visibility = "hidden", e.style.pointerEvents = "none", document.documentElement.appendChild(e);
1353
+ const s = getComputedStyle(e).color;
1354
+ return e.remove(), qs(s, n);
1355
+ }
1356
+ function ne(t, n) {
1357
+ const [e, s] = st(() => je(t, n));
1358
+ return K(() => {
1359
+ const o = () => s(je(t, n));
1360
+ o();
1361
+ const i = new MutationObserver(o);
1362
+ return i.observe(document.documentElement, {
1363
+ attributes: !0,
1364
+ attributeFilter: ["data-theme", "class", "style"]
1365
+ }), () => i.disconnect();
1366
+ }, [n, t]), e;
1367
+ }
1368
+ const se = 1 / 60;
1369
+ function Ls(t, n, e) {
1370
+ const o = { fill: t.color ?? (t.depth === void 0 ? n : fs(e, n, t.depth)), opacity: t.opacity };
1371
+ return t.d ? {
1372
+ ...o,
1373
+ d: t.d,
1374
+ transform: `translate(${t.x} ${t.y}) rotate(${t.rot ?? 0}) scale(${Je})`
1375
+ } : { ...o, cx: t.x, cy: t.y, r: t.r };
1376
+ }
1377
+ function Kt({
1378
+ size: t = 320,
1379
+ shape: n = ds,
1380
+ color: e = ps,
1381
+ expression: s = Wn,
1382
+ paper: o = "var(--backgrounds-bg-base)",
1383
+ state: i = "idle",
1384
+ frozenAt: r,
1385
+ follow: c = !1,
1386
+ turn: l = 0,
1387
+ gaze: d = null,
1388
+ label: u,
1389
+ className: h
1390
+ }) {
1391
+ var J, at;
1392
+ const f = ((J = ls.get(n)) == null ? void 0 : J.radii) ?? null, p = ((at = hs.get(e)) == null ? void 0 : at.hex) ?? "var(--novi-color-ink)", _ = ne(p, "#18181b"), x = ne(o, "#ffffff"), $ = ne(jn, "#3b82f6"), m = Gn.get(s) ?? null, A = H(null), v = H();
1393
+ v.current || (v.current = new ue(Je, i, f, m));
1394
+ const y = v.current, [b, P] = st(() => y.sample(r ?? 0)), M = qt().replace(/[^a-zA-Z0-9_-]/g, ""), E = `novi-mask-${M}`, j = H(0), q = H(null), O = H(!1), rt = H(0), T = H(0), L = H({ follow: c, turn: l, gaze: d, state: i });
1395
+ L.current = { follow: c, turn: l, gaze: d, state: i };
1396
+ const B = r !== void 0;
1397
+ function et() {
1398
+ var gt, lt;
1399
+ const k = v.current, C = j.current;
1400
+ if (!((gt = zt.get(L.current.state)) != null && gt.baseFace)) {
1401
+ O.current && (k.setLook(null, C, ee), O.current = !1);
1402
+ return;
1403
+ }
1404
+ const S = (lt = A.current) == null ? void 0 : lt.getBoundingClientRect();
1405
+ if (!S || S.width === 0 || S.height === 0) return;
1406
+ O.current || (rt.current = C);
1407
+ const D = q.current, R = Math.max(1, window.innerWidth / 2), ct = Math.max(1, window.innerHeight / 2);
1408
+ k.setLook(
1409
+ js({
1410
+ nx: D ? w((D.x - (S.left + S.width / 2)) / R, -1, 1) : 0,
1411
+ ny: D ? w((D.y - (S.top + S.height / 2)) / ct, -1, 1) : 0,
1412
+ progress: G.easeOutQuint(w((C - rt.current) / ee)),
1413
+ pointer: D !== null,
1414
+ turn: L.current.turn
1415
+ }),
1416
+ C
1417
+ ), O.current = !0;
1418
+ }
1419
+ K(() => {
1420
+ if (B) return;
1421
+ const k = v.current;
1422
+ let C = 0, S = 0;
1423
+ const D = (R) => {
1424
+ C = requestAnimationFrame(D);
1425
+ const ct = S ? Math.min((R - S) / 1e3, 0.064) : 0;
1426
+ S = R, j.current += ct, L.current.follow ? et() : L.current.gaze && k.setLook(
1427
+ L.current.gaze(j.current - T.current),
1428
+ j.current,
1429
+ se
1430
+ ), P(k.sample(j.current));
1431
+ };
1432
+ return C = requestAnimationFrame(D), () => cancelAnimationFrame(C);
1433
+ }, [B]), K(() => {
1434
+ if (!c || B) return;
1435
+ const k = (S) => {
1436
+ S.pointerType !== "touch" && (q.current = { x: S.clientX, y: S.clientY });
1437
+ }, C = () => {
1438
+ q.current = null;
1439
+ };
1440
+ return window.addEventListener("pointermove", k), document.addEventListener("pointerleave", C), () => {
1441
+ window.removeEventListener("pointermove", k), document.removeEventListener("pointerleave", C), q.current = null, O.current && (v.current.setLook(null, j.current, ee), O.current = !1);
1442
+ };
1443
+ }, [c, B]), K(() => {
1444
+ const k = v.current;
1445
+ if (d)
1446
+ return T.current = j.current, k.setLook(d(0), j.current - se, se), () => {
1447
+ k.setLook(null, j.current);
1448
+ };
1449
+ }, [d]), K(() => {
1450
+ v.current.setState(i, j.current);
1451
+ }, [i]), K(() => {
1452
+ v.current.setShape(f, j.current);
1453
+ }, [f]), K(() => {
1454
+ v.current.setExpression(m, j.current);
1455
+ }, [m]), K(() => {
1456
+ B && P(v.current.sample(r));
1457
+ }, [B, r, f, m, i]);
1458
+ const F = Es, ut = ln(
1459
+ () => b.arcs.map((k) => /* @__PURE__ */ a(
1460
+ "linearGradient",
1461
+ {
1462
+ id: `${M}-${k.id}`,
1463
+ gradientUnits: "userSpaceOnUse",
1464
+ x1: k.grad.x1,
1465
+ y1: k.grad.y1,
1466
+ x2: k.grad.x2,
1467
+ y2: k.grad.y2,
1468
+ children: k.grad.stops.map((C, S) => /* @__PURE__ */ a("stop", { offset: S / (k.grad.stops.length - 1), stopColor: C }, S))
1469
+ },
1470
+ k.id
1471
+ )),
1472
+ [b.arcs, M]
1473
+ ), Z = b.dots.map((k, C) => {
1474
+ const S = Ls(k, _, x);
1475
+ return k.d ? /* @__PURE__ */ a("path", { ...S }, C) : /* @__PURE__ */ a("circle", { ...S }, C);
1476
+ });
1477
+ return /* @__PURE__ */ g(
1478
+ "svg",
1479
+ {
1480
+ ref: A,
1481
+ className: h,
1482
+ width: t,
1483
+ height: t,
1484
+ viewBox: `${-F} ${-F} ${F * 2} ${F * 2}`,
1485
+ role: u ? "img" : void 0,
1486
+ "aria-label": u,
1487
+ "aria-hidden": u ? void 0 : !0,
1488
+ children: [
1489
+ /* @__PURE__ */ g("defs", { children: [
1490
+ /* @__PURE__ */ g("mask", { id: E, maskUnits: "userSpaceOnUse", x: -F, y: -F, width: F * 2, height: F * 2, children: [
1491
+ /* @__PURE__ */ a("path", { d: b.bodyPath, fill: "#fff" }),
1492
+ b.eyes.map((k, C) => /* @__PURE__ */ a("path", { d: k.d, transform: k.matrix, opacity: k.alpha, fill: "#000" }, C)),
1493
+ b.notch && /* @__PURE__ */ a("circle", { cx: b.notch.x, cy: b.notch.y, r: b.notch.r, fill: "#000" })
1494
+ ] }),
1495
+ ut
1496
+ ] }),
1497
+ /* @__PURE__ */ a("g", { fill: "none", strokeLinecap: "round", children: b.arcs.map((k) => /* @__PURE__ */ a(
1498
+ "path",
1499
+ {
1500
+ d: k.back,
1501
+ stroke: `url(#${M}-${k.id})`,
1502
+ strokeWidth: k.width,
1503
+ opacity: k.opacity
1504
+ },
1505
+ `b${k.id}`
1506
+ )) }),
1507
+ b.dotsBehind && /* @__PURE__ */ a("g", { children: Z }),
1508
+ /* @__PURE__ */ g("g", { opacity: b.bodyAlpha, children: [
1509
+ /* @__PURE__ */ a("path", { d: b.bodyPath, fill: x }),
1510
+ /* @__PURE__ */ a("g", { mask: `url(#${E})`, children: /* @__PURE__ */ a("rect", { x: -F, y: -F, width: F * 2, height: F * 2, fill: _ }) })
1511
+ ] }),
1512
+ !b.dotsBehind && /* @__PURE__ */ a("g", { children: Z }),
1513
+ b.notif && /* @__PURE__ */ a("circle", { cx: b.notif.x, cy: b.notif.y, r: b.notif.r, fill: $ }),
1514
+ /* @__PURE__ */ a("g", { fill: "none", strokeLinecap: "round", children: b.arcs.map((k) => /* @__PURE__ */ a(
1515
+ "path",
1516
+ {
1517
+ d: k.front,
1518
+ stroke: `url(#${M}-${k.id})`,
1519
+ strokeWidth: k.width,
1520
+ opacity: k.opacity
1521
+ },
1522
+ `f${k.id}`
1523
+ )) })
1524
+ ]
1525
+ }
1526
+ );
1527
+ }
1528
+ function Wi({ size: t = 60, state: n = "idle", frozenAt: e, ...s }) {
1529
+ return /* @__PURE__ */ a(Kt, { ...s, state: n, size: t, frozenAt: e ?? bs[n] ?? 1 });
1530
+ }
1531
+ const Fs = "_root_1ynah_1", Hs = "_title_1ynah_10", Ds = "_titleText_1ynah_24", Ys = "_avatar_1ynah_31", Us = "_actions_1ynah_37", Et = {
1532
+ root: Fs,
1533
+ title: Hs,
1534
+ titleText: Ds,
1535
+ avatar: Ys,
1536
+ actions: Us
1537
+ };
1538
+ function Xs({
1539
+ title: t,
1540
+ titleAs: n = "h2",
1541
+ avatar: e,
1542
+ onExpandToggle: s,
1543
+ expanded: o = !1,
1544
+ onClose: i,
1545
+ actions: r,
1546
+ expandLabel: c = "Expand",
1547
+ collapseLabel: l = "Collapse",
1548
+ closeLabel: d = "Close",
1549
+ className: u,
1550
+ ...h
1551
+ }) {
1552
+ return /* @__PURE__ */ g("header", { className: [Et.root, u].filter(Boolean).join(" "), ...h, children: [
1553
+ /* @__PURE__ */ g(n, { className: Et.title, children: [
1554
+ e && /* @__PURE__ */ a("span", { className: Et.avatar, children: e }),
1555
+ /* @__PURE__ */ a("span", { className: Et.titleText, children: t })
1556
+ ] }),
1557
+ /* @__PURE__ */ g("div", { className: Et.actions, children: [
1558
+ r,
1559
+ s && /* @__PURE__ */ a(
1560
+ ot,
1561
+ {
1562
+ variant: "transparent",
1563
+ size: "xsmall",
1564
+ icon: o ? /* @__PURE__ */ a(pn, { size: 15 }) : /* @__PURE__ */ a(fn, { size: 15 }),
1565
+ "aria-label": o ? l : c,
1566
+ "aria-expanded": o,
1567
+ onClick: s
1568
+ }
1569
+ ),
1570
+ i && /* @__PURE__ */ a(
1571
+ ot,
1572
+ {
1573
+ variant: "transparent",
1574
+ size: "xsmall",
1575
+ icon: /* @__PURE__ */ a(Fe, { size: 15 }),
1576
+ "aria-label": d,
1577
+ onClick: i
1578
+ }
1579
+ )
1580
+ ] })
1581
+ ] });
1582
+ }
1583
+ const Gs = "_root_1wg4e_1", Ws = "_threadWrap_1wg4e_13", Qs = "_thread_1wg4e_13", Vs = "_jump_1wg4e_32", Ks = "_threadInner_1wg4e_59", Pt = {
1584
+ root: Gs,
1585
+ threadWrap: Ws,
1586
+ thread: Qs,
1587
+ jump: Vs,
1588
+ threadInner: Ks
1589
+ }, Zs = 64;
1590
+ function Qi({
1591
+ children: t,
1592
+ title: n = "Ask anything",
1593
+ titleAs: e,
1594
+ header: s,
1595
+ avatar: o,
1596
+ expanded: i = !1,
1597
+ onExpandToggle: r,
1598
+ onClose: c,
1599
+ headerActions: l,
1600
+ input: d,
1601
+ bottom: u,
1602
+ height: h = "480px",
1603
+ autoScroll: f = !0,
1604
+ scrollToBottomLabel: p = "Jump to the newest message",
1605
+ className: _,
1606
+ style: x,
1607
+ ...$
1608
+ }) {
1609
+ const m = H(null), A = H(!0), [v, y] = st(!0);
1610
+ K(() => {
1611
+ const M = m.current;
1612
+ !M || !f || !A.current || (M.scrollTop = M.scrollHeight);
1613
+ }, [t, f]);
1614
+ function b() {
1615
+ const M = m.current;
1616
+ if (!M) return;
1617
+ const E = M.scrollHeight - M.scrollTop - M.clientHeight;
1618
+ A.current = E <= Zs, y(A.current);
1619
+ }
1620
+ function P() {
1621
+ const M = m.current;
1622
+ M && (M.scrollTo({ top: M.scrollHeight, behavior: "smooth" }), A.current = !0, y(!0));
1623
+ }
1624
+ return /* @__PURE__ */ g(
1625
+ "div",
1626
+ {
1627
+ className: [Pt.root, _].filter(Boolean).join(" "),
1628
+ style: { height: h, ...x },
1629
+ ...$,
1630
+ children: [
1631
+ s ?? /* @__PURE__ */ a(
1632
+ Xs,
1633
+ {
1634
+ title: n,
1635
+ titleAs: e,
1636
+ avatar: o,
1637
+ expanded: i,
1638
+ onExpandToggle: r,
1639
+ onClose: c,
1640
+ actions: l
1641
+ }
1642
+ ),
1643
+ /* @__PURE__ */ g("div", { className: Pt.threadWrap, children: [
1644
+ /* @__PURE__ */ a(
1645
+ Xt,
1646
+ {
1647
+ ref: m,
1648
+ direction: "y",
1649
+ size: "thin",
1650
+ className: Pt.thread,
1651
+ onScroll: b,
1652
+ children: /* @__PURE__ */ a("div", { className: Pt.threadInner, children: t })
1653
+ }
1654
+ ),
1655
+ !v && /* @__PURE__ */ a("div", { className: Pt.jump, children: /* @__PURE__ */ a(
1656
+ ot,
1657
+ {
1658
+ variant: "neutral",
1659
+ radius: "full",
1660
+ size: "sm",
1661
+ icon: /* @__PURE__ */ a(mn, { size: 15 }),
1662
+ "aria-label": p,
1663
+ onClick: P
1664
+ }
1665
+ ) })
1666
+ ] }),
1667
+ d,
1668
+ u
1669
+ ]
1670
+ }
1671
+ );
1672
+ }
1673
+ const Js = "_root_15sqm_1", to = "_label_15sqm_9", eo = "_action_15sqm_20", oe = {
1674
+ root: Js,
1675
+ label: to,
1676
+ action: eo
1677
+ };
1678
+ function Vi({ children: t, action: n, className: e, ...s }) {
1679
+ return /* @__PURE__ */ g("div", { className: [oe.root, e].filter(Boolean).join(" "), ...s, children: [
1680
+ /* @__PURE__ */ a("span", { className: oe.label, children: t }),
1681
+ n && /* @__PURE__ */ a("span", { className: oe.action, children: n })
1682
+ ] });
1683
+ }
1684
+ const no = "_root_s1zb4_1", so = "_leading_s1zb4_11", oo = "_meta_s1zb4_18", ro = "_hint_s1zb4_28", io = "_divider_s1zb4_32", ao = "_shortcut_s1zb4_39", co = "_keys_s1zb4_46", xt = {
1685
+ root: no,
1686
+ leading: so,
1687
+ meta: oo,
1688
+ hint: ro,
1689
+ divider: io,
1690
+ shortcut: ao,
1691
+ keys: co
1692
+ }, lo = [
1693
+ /* @__PURE__ */ a(_n, { size: 12 }, "shift"),
1694
+ /* @__PURE__ */ a(yn, { size: 12 }, "enter")
1695
+ ];
1696
+ function Ki({
1697
+ hint: t,
1698
+ shortcutLabel: n,
1699
+ shortcutKeys: e = lo,
1700
+ leading: s,
1701
+ className: o,
1702
+ ...i
1703
+ }) {
1704
+ const r = !!n || e.length > 0;
1705
+ return /* @__PURE__ */ g("div", { className: [xt.root, o].filter(Boolean).join(" "), ...i, children: [
1706
+ s && /* @__PURE__ */ a("div", { className: xt.leading, children: s }),
1707
+ /* @__PURE__ */ g("div", { className: xt.meta, children: [
1708
+ t && /* @__PURE__ */ a("span", { className: xt.hint, children: t }),
1709
+ t && r && /* @__PURE__ */ a("span", { className: xt.divider, "aria-hidden": "true" }),
1710
+ r && /* @__PURE__ */ g("span", { className: xt.shortcut, children: [
1711
+ n && /* @__PURE__ */ a("span", { className: xt.shortcutLabel, children: n }),
1712
+ /* @__PURE__ */ a("span", { className: xt.keys, children: e.map((c, l) => /* @__PURE__ */ a(un, { bg: "bg-field-component", children: c }, l)) })
1713
+ ] })
1714
+ ] })
1715
+ ] });
1716
+ }
1717
+ const uo = "_root_19z6n_1", ho = "_selected_19z6n_38", po = "_label_19z6n_48", fo = "_icon_19z6n_56", Ot = {
1718
+ root: uo,
1719
+ selected: ho,
1720
+ label: po,
1721
+ icon: fo
1722
+ };
1723
+ function Zi({
1724
+ children: t,
1725
+ leftIcon: n,
1726
+ rightIcon: e,
1727
+ selected: s = !1,
1728
+ className: o,
1729
+ ...i
1730
+ }) {
1731
+ const r = [Ot.root, s && Ot.selected, o].filter(Boolean).join(" "), c = /* @__PURE__ */ g(Mt, { children: [
1732
+ n && /* @__PURE__ */ a("span", { className: Ot.icon, children: n }),
1733
+ /* @__PURE__ */ a("span", { className: Ot.label, children: t }),
1734
+ e && /* @__PURE__ */ a("span", { className: Ot.icon, children: e })
1735
+ ] });
1736
+ if (i.href !== void 0) {
1737
+ const { href: u, ...h } = i;
1738
+ return /* @__PURE__ */ a("a", { className: r, href: u, "aria-current": s ? "true" : void 0, ...h, children: c });
1739
+ }
1740
+ const { type: l = "button", ...d } = i;
1741
+ return /* @__PURE__ */ a("button", { className: r, type: l, "aria-current": s ? "true" : void 0, ...d, children: c });
1742
+ }
1743
+ const mo = "_menu_dpnsn_2", _o = "_menuVisible_dpnsn_21", yo = "_menuClip_dpnsn_29", go = "_menuSize_dpnsn_35", xo = "_menuContent_dpnsn_42", bo = "_menuFade_dpnsn_69", vo = "_scrollHint_dpnsn_74", vt = {
1744
+ menu: mo,
1745
+ menuVisible: _o,
1746
+ menuClip: yo,
1747
+ menuSize: go,
1748
+ menuContent: xo,
1749
+ menuFade: bo,
1750
+ scrollHint: vo
1751
+ }, en = he(
1752
+ function({ menu: n, id: e, label: s = "Add to prompt", maxHeight: o = 240, disabled: i = !1, restoreFocusRef: r }, c) {
1753
+ const l = H(null), d = H(null), u = H(null), [h, f] = st(!1), [p, _] = st(), [x, $] = st(n), m = n != null && n !== !1;
1754
+ K(() => {
1755
+ var y;
1756
+ m && $(n), l.current && (!m && l.current.contains(document.activeElement) && ((y = r.current) == null || y.focus()), l.current.inert = !m || i);
1757
+ }, [n, m, i, r]), Le(() => {
1758
+ const y = d.current;
1759
+ if (!y) return;
1760
+ function b() {
1761
+ y && (_(y.getBoundingClientRect().height), A(y));
1762
+ }
1763
+ b();
1764
+ const P = new ResizeObserver(b);
1765
+ return P.observe(y), u.current && P.observe(u.current), () => P.disconnect();
1766
+ }, [x, o]);
1767
+ function A(y) {
1768
+ f(y.scrollHeight - y.clientHeight - y.scrollTop > 1);
1769
+ }
1770
+ function v(y) {
1771
+ l.current = y, typeof c == "function" ? c(y) : c && (c.current = y);
1772
+ }
1773
+ return /* @__PURE__ */ a(
1774
+ "div",
1775
+ {
1776
+ ref: v,
1777
+ id: e,
1778
+ role: "region",
1779
+ "aria-label": s,
1780
+ "aria-hidden": !m,
1781
+ className: [vt.menu, m && vt.menuVisible].filter(Boolean).join(" "),
1782
+ onTransitionEnd: (y) => {
1783
+ y.target === y.currentTarget && y.propertyName === "grid-template-rows" && !m && $(null);
1784
+ },
1785
+ children: /* @__PURE__ */ a("div", { className: vt.menuClip, children: /* @__PURE__ */ g("div", { className: vt.menuSize, style: { height: p }, children: [
1786
+ /* @__PURE__ */ a(
1787
+ Xt,
1788
+ {
1789
+ ref: d,
1790
+ direction: "y",
1791
+ size: "thin",
1792
+ className: [vt.menuContent, h && vt.menuFade].filter(Boolean).join(" "),
1793
+ onScroll: (y) => A(y.currentTarget),
1794
+ style: {
1795
+ maxHeight: `min(${typeof o == "number" ? `${o}px` : o}, 50dvh)`
1796
+ },
1797
+ children: /* @__PURE__ */ a("div", { ref: u, children: x })
1798
+ }
1799
+ ),
1800
+ m && h && /* @__PURE__ */ a("span", { className: vt.scrollHint, "aria-hidden": !0, children: /* @__PURE__ */ a(gn, { size: 14 }) })
1801
+ ] }) })
1802
+ }
1803
+ );
1804
+ }
1805
+ );
1806
+ function Tt(t, n, e) {
1807
+ const s = H(t !== void 0).current, [o, i] = st(n), r = s ? t : o, c = dn(
1808
+ (l) => {
1809
+ s || i(l), e == null || e(l);
1810
+ },
1811
+ [s, e]
1812
+ );
1813
+ return [r, c];
1814
+ }
1815
+ const ko = "_root_193n0_1", No = "_dragging_193n0_21", $o = "_srOnly_193n0_26", Ao = "_references_193n0_37", Mo = "_field_193n0_44", wo = "_textarea_193n0_49", Io = "_stop_193n0_77", zo = "_footer_193n0_81", Ro = "_actions_193n0_88", To = "_disabled_193n0_95", dt = {
1816
+ root: ko,
1817
+ dragging: No,
1818
+ srOnly: $o,
1819
+ references: Ao,
1820
+ field: Mo,
1821
+ textarea: wo,
1822
+ stop: Io,
1823
+ footer: zo,
1824
+ actions: Ro,
1825
+ disabled: To
1826
+ }, Ji = he(
1827
+ function({
1828
+ value: n,
1829
+ defaultValue: e = "",
1830
+ onValueChange: s,
1831
+ onSubmit: o,
1832
+ placeholder: i = "Ask anything…",
1833
+ references: r,
1834
+ leading: c,
1835
+ menu: l,
1836
+ menuLabel: d = "Add to prompt",
1837
+ menuMaxHeight: u = 240,
1838
+ onMenuClose: h,
1839
+ onAdd: f,
1840
+ addLabel: p = "Add",
1841
+ trailing: _,
1842
+ submit: x,
1843
+ submitIcon: $,
1844
+ submitLabel: m = "Send",
1845
+ onStop: A,
1846
+ stopIcon: v,
1847
+ stopLabel: y = "Stop",
1848
+ loading: b = !1,
1849
+ submitOnEnter: P = !0,
1850
+ maxHeight: M = "160px",
1851
+ onFilesDrop: E,
1852
+ dropLabel: j = "Drop files to attach them",
1853
+ disabled: q = !1,
1854
+ className: O,
1855
+ onKeyDown: rt,
1856
+ onPaste: T,
1857
+ ...L
1858
+ }, B) {
1859
+ const [et, F] = Tt(n, e, s), ut = qt(), Z = l != null && l !== !1, [J, at] = st(!1), k = H(null), C = H(0), S = et.trim().length > 0 && !q && !b, D = b && !!A;
1860
+ Le(() => {
1861
+ const z = k.current;
1862
+ z && (z.style.height = "auto", z.style.height = `${z.scrollHeight}px`);
1863
+ }, [et]);
1864
+ function R(z) {
1865
+ k.current = z, typeof B == "function" ? B(z) : B && (B.current = z);
1866
+ }
1867
+ function ct(z) {
1868
+ F(z.target.value);
1869
+ }
1870
+ function gt() {
1871
+ S && (o == null || o(et.trim()), F(""));
1872
+ }
1873
+ const lt = !!E && !q;
1874
+ function Ht(z) {
1875
+ lt && (z.preventDefault(), C.current += 1, at(!0));
1876
+ }
1877
+ function sn(z) {
1878
+ lt && (z.preventDefault(), z.dataTransfer.dropEffect = "copy");
1879
+ }
1880
+ function on(z) {
1881
+ lt && (z.preventDefault(), C.current = Math.max(0, C.current - 1), C.current === 0 && at(!1));
1882
+ }
1883
+ function rn(z) {
1884
+ if (!lt) return;
1885
+ z.preventDefault(), C.current = 0, at(!1);
1886
+ const Bt = Array.from(z.dataTransfer.files);
1887
+ Bt.length > 0 && (E == null || E(Bt));
1888
+ }
1889
+ function an(z) {
1890
+ if (T == null || T(z), !lt || z.defaultPrevented) return;
1891
+ const Bt = Array.from(z.clipboardData.files);
1892
+ Bt.length > 0 && (z.preventDefault(), E == null || E(Bt));
1893
+ }
1894
+ function cn(z) {
1895
+ rt == null || rt(z), !z.defaultPrevented && P && z.key === "Enter" && !z.shiftKey && (z.preventDefault(), gt());
1896
+ }
1897
+ return /* @__PURE__ */ g(
1898
+ "div",
1899
+ {
1900
+ className: [
1901
+ dt.root,
1902
+ J && dt.dragging,
1903
+ q && dt.disabled,
1904
+ O
1905
+ ].filter(Boolean).join(" "),
1906
+ onKeyDown: (z) => {
1907
+ z.key === "Escape" && !z.defaultPrevented && Z && h && (z.preventDefault(), h());
1908
+ },
1909
+ onDragEnter: Ht,
1910
+ onDragOver: sn,
1911
+ onDragLeave: on,
1912
+ onDrop: rn,
1913
+ children: [
1914
+ /* @__PURE__ */ a("span", { className: dt.srOnly, "aria-live": "polite", children: J ? j : "" }),
1915
+ /* @__PURE__ */ a(
1916
+ en,
1917
+ {
1918
+ id: ut,
1919
+ menu: l,
1920
+ label: d,
1921
+ maxHeight: u,
1922
+ disabled: q,
1923
+ restoreFocusRef: k
1924
+ }
1925
+ ),
1926
+ r && /* @__PURE__ */ a("div", { className: dt.references, children: r }),
1927
+ /* @__PURE__ */ a(Xt, { direction: "y", size: "thin", maxHeight: M, className: dt.field, children: /* @__PURE__ */ a(
1928
+ "textarea",
1929
+ {
1930
+ ref: R,
1931
+ className: dt.textarea,
1932
+ rows: 1,
1933
+ value: et,
1934
+ placeholder: i,
1935
+ disabled: q,
1936
+ onChange: ct,
1937
+ onKeyDown: cn,
1938
+ onPaste: an,
1939
+ ...L
1940
+ }
1941
+ ) }),
1942
+ /* @__PURE__ */ g("div", { className: dt.footer, children: [
1943
+ /* @__PURE__ */ a("div", { className: dt.actions, children: c }),
1944
+ /* @__PURE__ */ g("div", { className: dt.actions, children: [
1945
+ _,
1946
+ f && /* @__PURE__ */ a(
1947
+ ot,
1948
+ {
1949
+ variant: "transparent",
1950
+ radius: "full",
1951
+ size: "sm",
1952
+ icon: /* @__PURE__ */ a(He, { size: 18 }),
1953
+ "aria-label": p,
1954
+ "aria-expanded": Z,
1955
+ "aria-controls": ut,
1956
+ disabled: q,
1957
+ onClick: f
1958
+ }
1959
+ ),
1960
+ x ?? (D ? /* @__PURE__ */ a(
1961
+ ot,
1962
+ {
1963
+ variant: "neutral",
1964
+ radius: "full",
1965
+ size: "sm",
1966
+ className: dt.stop,
1967
+ icon: v ?? /* @__PURE__ */ a(xn, { size: 12, fill: "currentColor" }),
1968
+ "aria-label": y,
1969
+ onClick: A
1970
+ }
1971
+ ) : /* @__PURE__ */ a(
1972
+ ot,
1973
+ {
1974
+ variant: "inverted",
1975
+ radius: "full",
1976
+ size: "sm",
1977
+ icon: $ ?? /* @__PURE__ */ a(bn, { size: 15 }),
1978
+ "aria-label": m,
1979
+ disabled: !S,
1980
+ loading: b,
1981
+ onClick: gt
1982
+ }
1983
+ ))
1984
+ ] })
1985
+ ] })
1986
+ ]
1987
+ }
1988
+ );
1989
+ }
1990
+ ), Bo = "_root_6xqta_30", Eo = "_expanded_6xqta_50", Po = "_promptRow_6xqta_54", Oo = "_references_6xqta_62", Co = "_referencesVisible_6xqta_73", So = "_referencesClip_6xqta_79", jo = "_referencesRow_6xqta_84", qo = "_closing_6xqta_90", Lo = "_disabled_6xqta_124", Fo = "_avatar_6xqta_129", Ho = "_input_6xqta_136", Do = "_actions_6xqta_154", Yo = "_divider_6xqta_161", nt = {
1991
+ root: Bo,
1992
+ expanded: Eo,
1993
+ promptRow: Po,
1994
+ references: Oo,
1995
+ referencesVisible: Co,
1996
+ referencesClip: So,
1997
+ referencesRow: jo,
1998
+ closing: qo,
1999
+ disabled: Lo,
2000
+ avatar: Fo,
2001
+ input: Ho,
2002
+ actions: Do,
2003
+ divider: Yo
2004
+ }, ta = he(
2005
+ function({
2006
+ value: n,
2007
+ open: e = !0,
2008
+ defaultValue: s = "",
2009
+ onValueChange: o,
2010
+ onSubmit: i,
2011
+ placeholder: r = "Work with Novi",
2012
+ avatar: c,
2013
+ noviProps: l,
2014
+ references: d,
2015
+ actions: u,
2016
+ menu: h,
2017
+ menuLabel: f = "Add to prompt",
2018
+ menuMaxHeight: p = 240,
2019
+ onMenuClose: _,
2020
+ onAdd: x,
2021
+ onVoice: $,
2022
+ onOpen: m,
2023
+ addLabel: A = "Add",
2024
+ voiceLabel: v = "Use voice",
2025
+ openLabel: y = "Open assistant",
2026
+ disabled: b = !1,
2027
+ className: P,
2028
+ onKeyDown: M,
2029
+ ...E
2030
+ }, j) {
2031
+ const [q, O] = Tt(n, s, o), [rt, T] = st(e), [L, B] = st(!1), [et, F] = st(d), ut = qt(), Z = H(null), J = h != null && h !== !1, at = H(null);
2032
+ K(() => {
2033
+ e ? (T(!0), B(!1)) : rt && B(!0);
2034
+ }, [e, rt]), K(() => {
2035
+ d != null && d !== !1 && F(d);
2036
+ }, [d]);
2037
+ function k(R) {
2038
+ at.current = R, typeof j == "function" ? j(R) : j && (j.current = R);
2039
+ }
2040
+ function C(R) {
2041
+ O(R.target.value);
2042
+ }
2043
+ const S = !!(u || x || $ || m), D = d != null && d !== !1;
2044
+ return rt ? /* @__PURE__ */ g(
2045
+ "form",
2046
+ {
2047
+ className: [
2048
+ nt.root,
2049
+ (D || J) && nt.expanded,
2050
+ L && nt.closing,
2051
+ b && nt.disabled,
2052
+ P
2053
+ ].filter(Boolean).join(" "),
2054
+ onKeyDown: (R) => {
2055
+ R.key === "Escape" && !R.defaultPrevented && J && _ && (R.preventDefault(), _());
2056
+ },
2057
+ onAnimationEnd: (R) => {
2058
+ R.target === R.currentTarget && L && T(!1);
2059
+ },
2060
+ onSubmit: (R) => {
2061
+ var lt, Ht;
2062
+ R.preventDefault();
2063
+ const ct = q.trim();
2064
+ if (R.target !== R.currentTarget || !ct || b) return;
2065
+ const gt = R.nativeEvent.submitter;
2066
+ (lt = Z.current) != null && lt.contains(document.activeElement) || gt && ((Ht = Z.current) != null && Ht.contains(gt)) || (i == null || i(ct), O(""));
2067
+ },
2068
+ children: [
2069
+ /* @__PURE__ */ a(
2070
+ en,
2071
+ {
2072
+ ref: Z,
2073
+ id: ut,
2074
+ menu: h,
2075
+ label: f,
2076
+ maxHeight: p,
2077
+ disabled: b,
2078
+ restoreFocusRef: at
2079
+ }
2080
+ ),
2081
+ /* @__PURE__ */ a(
2082
+ "div",
2083
+ {
2084
+ className: [nt.references, D && nt.referencesVisible].filter(Boolean).join(" "),
2085
+ "aria-hidden": !D,
2086
+ onTransitionEnd: (R) => {
2087
+ R.propertyName === "grid-template-rows" && !D && F(null);
2088
+ },
2089
+ children: /* @__PURE__ */ a("div", { className: nt.referencesClip, children: /* @__PURE__ */ a("div", { className: nt.referencesRow, children: et }) })
2090
+ }
2091
+ ),
2092
+ /* @__PURE__ */ g("div", { className: nt.promptRow, children: [
2093
+ /* @__PURE__ */ a("span", { className: nt.avatar, "aria-hidden": !0, children: c ?? /* @__PURE__ */ a(
2094
+ Kt,
2095
+ {
2096
+ size: 28,
2097
+ expression: "happy",
2098
+ frozenAt: 1,
2099
+ paper: "var(--backgrounds-bg-base)",
2100
+ ...l
2101
+ }
2102
+ ) }),
2103
+ /* @__PURE__ */ a(
2104
+ "input",
2105
+ {
2106
+ ...E,
2107
+ ref: k,
2108
+ type: "text",
2109
+ className: nt.input,
2110
+ value: q,
2111
+ placeholder: r,
2112
+ disabled: b,
2113
+ onChange: C,
2114
+ onKeyDown: (R) => {
2115
+ var ct;
2116
+ M == null || M(R), !R.defaultPrevented && R.key === "Enter" && !R.nativeEvent.isComposing && (R.preventDefault(), (ct = R.currentTarget.form) == null || ct.requestSubmit());
2117
+ }
2118
+ }
2119
+ ),
2120
+ S && /* @__PURE__ */ g("div", { className: nt.actions, children: [
2121
+ u,
2122
+ x && /* @__PURE__ */ a(
2123
+ ot,
2124
+ {
2125
+ variant: "transparent",
2126
+ radius: "full",
2127
+ size: "sm",
2128
+ "aria-expanded": J,
2129
+ "aria-controls": ut,
2130
+ icon: /* @__PURE__ */ a(He, { size: 18 }),
2131
+ "aria-label": A,
2132
+ disabled: b,
2133
+ onClick: x
2134
+ }
2135
+ ),
2136
+ $ && /* @__PURE__ */ a(
2137
+ ot,
2138
+ {
2139
+ variant: "transparent",
2140
+ radius: "full",
2141
+ size: "sm",
2142
+ icon: /* @__PURE__ */ a(vn, { size: 18 }),
2143
+ "aria-label": v,
2144
+ disabled: b,
2145
+ onClick: $
2146
+ }
2147
+ ),
2148
+ m && /* @__PURE__ */ g(Mt, { children: [
2149
+ /* @__PURE__ */ a("span", { className: nt.divider, "aria-hidden": !0 }),
2150
+ /* @__PURE__ */ a(
2151
+ ot,
2152
+ {
2153
+ variant: "transparent",
2154
+ radius: "full",
2155
+ size: "sm",
2156
+ icon: /* @__PURE__ */ a(kn, { size: 18 }),
2157
+ "aria-label": y,
2158
+ disabled: b,
2159
+ onClick: m
2160
+ }
2161
+ )
2162
+ ] })
2163
+ ] })
2164
+ ] })
2165
+ ]
2166
+ }
2167
+ ) : null;
2168
+ }
2169
+ ), Uo = "_root_1deeq_1", Xo = "_image_1deeq_11", Go = "_base_1deeq_18", Wo = "_small_1deeq_23", Qo = "_button_1deeq_29", Ct = {
2170
+ root: Uo,
2171
+ image: Xo,
2172
+ base: Go,
2173
+ small: Wo,
2174
+ button: Qo
2175
+ };
2176
+ function Vo({
2177
+ images: t,
2178
+ onImageClick: n,
2179
+ size: e = "base",
2180
+ className: s,
2181
+ ...o
2182
+ }) {
2183
+ return t.length === 0 ? null : /* @__PURE__ */ a("div", { className: [Ct.root, Ct[e], s].filter(Boolean).join(" "), ...o, children: t.map(
2184
+ (i, r) => n ? /* @__PURE__ */ a(
2185
+ "button",
2186
+ {
2187
+ type: "button",
2188
+ className: Ct.button,
2189
+ "aria-label": i.alt || `Open image ${r + 1} of ${t.length}`,
2190
+ onClick: () => n(r),
2191
+ children: /* @__PURE__ */ a("img", { className: Ct.image, src: i.src, alt: i.alt ?? "" })
2192
+ },
2193
+ `${i.src}-${r}`
2194
+ ) : /* @__PURE__ */ a(
2195
+ "img",
2196
+ {
2197
+ className: Ct.image,
2198
+ src: i.src,
2199
+ alt: i.alt ?? ""
2200
+ },
2201
+ `${i.src}-${r}`
2202
+ )
2203
+ ) });
2204
+ }
2205
+ const Ko = "_pill_1o1q3_2", Zo = "_root_1o1q3_29", Jo = "_header_1o1q3_39", tr = "_title_1o1q3_50", er = "_prefix_1o1q3_54", nr = "_mark_1o1q3_60", sr = "_error_1o1q3_67", or = "_body_1o1q3_78", ht = {
2206
+ pill: Ko,
2207
+ root: Zo,
2208
+ header: Jo,
2209
+ title: tr,
2210
+ prefix: er,
2211
+ mark: nr,
2212
+ error: sr,
2213
+ body: or
2214
+ };
2215
+ function ea({
2216
+ title: t,
2217
+ children: n,
2218
+ icon: e,
2219
+ prefix: s,
2220
+ tone: o = "default",
2221
+ open: i,
2222
+ defaultOpen: r = !1,
2223
+ onOpenChange: c,
2224
+ maxBodyHeight: l,
2225
+ expandLabel: d = "Open",
2226
+ collapseLabel: u = "Collapse",
2227
+ className: h,
2228
+ ...f
2229
+ }) {
2230
+ const [p, _] = Tt(i, r, c), x = e && /* @__PURE__ */ a("span", { className: [ht.mark, o === "error" && ht.error].filter(Boolean).join(" "), children: e });
2231
+ return p ? /* @__PURE__ */ g("div", { className: [ht.root, h].filter(Boolean).join(" "), ...f, children: [
2232
+ /* @__PURE__ */ g("div", { className: ht.header, children: [
2233
+ x,
2234
+ /* @__PURE__ */ a("span", { className: ht.title, children: t }),
2235
+ /* @__PURE__ */ a(
2236
+ ot,
2237
+ {
2238
+ variant: "transparent",
2239
+ size: "2xsmall",
2240
+ icon: /* @__PURE__ */ a(Nn, { size: 15 }),
2241
+ "aria-label": u,
2242
+ "aria-expanded": !0,
2243
+ onClick: () => _(!p)
2244
+ }
2245
+ )
2246
+ ] }),
2247
+ l ? /* @__PURE__ */ a(Xt, { direction: "y", size: "thin", maxHeight: l, className: ht.body, children: n }) : /* @__PURE__ */ a("div", { className: ht.body, children: n })
2248
+ ] }) : /* @__PURE__ */ g(
2249
+ "button",
2250
+ {
2251
+ type: "button",
2252
+ className: [ht.pill, h].filter(Boolean).join(" "),
2253
+ "aria-expanded": !1,
2254
+ "aria-label": typeof t == "string" ? `${d}: ${t}` : d,
2255
+ onClick: () => _(!p),
2256
+ children: [
2257
+ s && /* @__PURE__ */ a("span", { className: ht.prefix, children: s }),
2258
+ x,
2259
+ /* @__PURE__ */ a("span", { className: ht.title, children: t })
2260
+ ]
2261
+ }
2262
+ );
2263
+ }
2264
+ const rr = "_root_exebp_6", ir = "_header_exebp_18", ar = "_mark_exebp_30", cr = "_title_exebp_37", lr = "_meta_exebp_42", dr = "_body_exebp_50", ur = "_description_exebp_60", hr = "_footer_exebp_67", pr = "_footerStart_exebp_77", fr = "_footerEnd_exebp_84", Y = {
2265
+ root: rr,
2266
+ header: ir,
2267
+ mark: ar,
2268
+ title: cr,
2269
+ meta: lr,
2270
+ body: dr,
2271
+ description: ur,
2272
+ footer: hr,
2273
+ footerStart: pr,
2274
+ footerEnd: fr
2275
+ };
2276
+ function na({
2277
+ title: t,
2278
+ description: n,
2279
+ children: e,
2280
+ icon: s,
2281
+ status: o,
2282
+ onConfirm: i,
2283
+ onCancel: r,
2284
+ footer: c,
2285
+ confirmLabel: l = "Run",
2286
+ cancelLabel: d = "Cancel",
2287
+ disabled: u = !1,
2288
+ running: h = !1,
2289
+ className: f,
2290
+ ...p
2291
+ }) {
2292
+ const _ = s === null ? null : s ?? /* @__PURE__ */ a($n, { size: 16 }), x = c ?? /* @__PURE__ */ g(Mt, { children: [
2293
+ r && /* @__PURE__ */ a(At, { variant: "neutral", size: "sm", onClick: r, children: d }),
2294
+ i && /* @__PURE__ */ a(
2295
+ At,
2296
+ {
2297
+ variant: "inverted",
2298
+ size: "sm",
2299
+ disabled: u,
2300
+ loading: h,
2301
+ onClick: i,
2302
+ children: l
2303
+ }
2304
+ )
2305
+ ] }), $ = !!n || !!e, m = !!c || !!i || !!r;
2306
+ return /* @__PURE__ */ g("div", { className: [Y.root, f].filter(Boolean).join(" "), ...p, children: [
2307
+ /* @__PURE__ */ g("div", { className: Y.header, children: [
2308
+ _ && /* @__PURE__ */ a("span", { className: Y.mark, children: _ }),
2309
+ /* @__PURE__ */ a("span", { className: Y.title, children: t }),
2310
+ o && /* @__PURE__ */ a("span", { className: Y.meta, children: o })
2311
+ ] }),
2312
+ $ && /* @__PURE__ */ g("div", { className: Y.body, children: [
2313
+ n && /* @__PURE__ */ a("p", { className: Y.description, children: n }),
2314
+ e
2315
+ ] }),
2316
+ m && /* @__PURE__ */ a("div", { className: Y.footer, children: /* @__PURE__ */ a("span", { className: Y.footerEnd, children: x }) })
2317
+ ] });
2318
+ }
2319
+ function sa({
2320
+ title: t,
2321
+ children: n,
2322
+ icon: e,
2323
+ progress: s,
2324
+ onPrevious: o,
2325
+ onNext: i,
2326
+ onSubmit: r,
2327
+ onSkip: c,
2328
+ footer: l,
2329
+ skipLabel: d = "Skip for now",
2330
+ previousLabel: u = "Previous",
2331
+ nextLabel: h = "Next",
2332
+ submitLabel: f = "Submit",
2333
+ disabled: p = !1,
2334
+ submitting: _ = !1,
2335
+ className: x,
2336
+ ...$
2337
+ }) {
2338
+ const m = e === null ? null : e ?? /* @__PURE__ */ a(An, { size: 16 }), A = !!o || !!i, v = c && /* @__PURE__ */ a(At, { variant: "neutral", size: "sm", onClick: c, children: d }), y = l ?? /* @__PURE__ */ g(Mt, { children: [
2339
+ !A && v,
2340
+ o && /* @__PURE__ */ a(At, { variant: "neutral", size: "sm", onClick: o, children: u }),
2341
+ i && /* @__PURE__ */ a(At, { variant: "neutral", size: "sm", disabled: p, onClick: i, children: h }),
2342
+ r && /* @__PURE__ */ a(
2343
+ At,
2344
+ {
2345
+ variant: "neutral",
2346
+ size: "sm",
2347
+ disabled: p,
2348
+ loading: _,
2349
+ onClick: r,
2350
+ children: f
2351
+ }
2352
+ )
2353
+ ] }), b = !!l || !!o || !!i || !!r || !!c;
2354
+ return /* @__PURE__ */ g("div", { className: [Y.root, x].filter(Boolean).join(" "), ...$, children: [
2355
+ /* @__PURE__ */ g("div", { className: Y.header, children: [
2356
+ m && /* @__PURE__ */ a("span", { className: Y.mark, children: m }),
2357
+ /* @__PURE__ */ a("span", { className: Y.title, children: t }),
2358
+ s && /* @__PURE__ */ a("span", { className: Y.meta, children: s })
2359
+ ] }),
2360
+ /* @__PURE__ */ a("div", { className: Y.body, children: n }),
2361
+ b && /* @__PURE__ */ g("div", { className: Y.footer, children: [
2362
+ A && !l && /* @__PURE__ */ a("span", { className: Y.footerStart, children: v }),
2363
+ /* @__PURE__ */ a("span", { className: Y.footerEnd, children: y })
2364
+ ] })
2365
+ ] });
2366
+ }
2367
+ const mr = "_root_1tlwe_1", _r = "_label_1tlwe_8", yr = "_name_1tlwe_17", gr = "_key_1tlwe_22", xr = "_description_1tlwe_28", br = "_control_1tlwe_34", wt = {
2368
+ root: mr,
2369
+ label: _r,
2370
+ name: yr,
2371
+ key: gr,
2372
+ description: xr,
2373
+ control: br
2374
+ };
2375
+ function oa({
2376
+ label: t,
2377
+ name: n,
2378
+ children: e,
2379
+ description: s,
2380
+ className: o,
2381
+ ...i
2382
+ }) {
2383
+ return /* @__PURE__ */ g("label", { className: [wt.root, o].filter(Boolean).join(" "), ...i, children: [
2384
+ /* @__PURE__ */ g("span", { className: wt.label, children: [
2385
+ /* @__PURE__ */ a("span", { className: wt.name, children: t }),
2386
+ n && /* @__PURE__ */ g("code", { className: wt.key, children: [
2387
+ "(",
2388
+ n,
2389
+ ")"
2390
+ ] })
2391
+ ] }),
2392
+ s && /* @__PURE__ */ a("span", { className: wt.description, children: s }),
2393
+ /* @__PURE__ */ a("span", { className: wt.control, children: e })
2394
+ ] });
2395
+ }
2396
+ const vr = "_root_8yfcy_1", kr = "_chip_8yfcy_20", Nr = "_plain_8yfcy_28", $r = "_interactive_8yfcy_37", Ar = "_prefix_8yfcy_62", Mr = "_marks_8yfcy_72", wr = "_marksThumb_8yfcy_82", Ir = "_thumbnail_8yfcy_89", zr = "_icon_8yfcy_102", Rr = "_remove_8yfcy_103", Tr = "_toneError_8yfcy_114", Br = "_removable_8yfcy_124", Er = "_label_8yfcy_139", Pr = "_mono_8yfcy_146", Q = {
2397
+ root: vr,
2398
+ chip: kr,
2399
+ plain: Nr,
2400
+ static: "_static_8yfcy_33",
2401
+ interactive: $r,
2402
+ prefix: Ar,
2403
+ marks: Mr,
2404
+ marksThumb: wr,
2405
+ thumbnail: Ir,
2406
+ icon: zr,
2407
+ remove: Rr,
2408
+ toneError: Tr,
2409
+ removable: Br,
2410
+ label: Er,
2411
+ mono: Pr
2412
+ };
2413
+ function ra({
2414
+ children: t,
2415
+ icon: n,
2416
+ thumbnail: e,
2417
+ thumbnailAlt: s = "",
2418
+ onRemove: o,
2419
+ removeLabel: i = "Remove",
2420
+ variant: r = "chip",
2421
+ prefix: c,
2422
+ tone: l = "default",
2423
+ mono: d = !1,
2424
+ className: u,
2425
+ onClick: h,
2426
+ ...f
2427
+ }) {
2428
+ const p = r === "chip" ? o : void 0, _ = !!p || !!h, x = /* @__PURE__ */ g(
2429
+ "span",
2430
+ {
2431
+ className: [
2432
+ Q.marks,
2433
+ e && Q.marksThumb,
2434
+ l === "error" && Q.toneError
2435
+ ].filter(Boolean).join(" "),
2436
+ "aria-hidden": "true",
2437
+ children: [
2438
+ e ? /* @__PURE__ */ a(
2439
+ "img",
2440
+ {
2441
+ className: Q.thumbnail,
2442
+ src: e,
2443
+ alt: s,
2444
+ width: 14,
2445
+ height: 14
2446
+ }
2447
+ ) : n && /* @__PURE__ */ a("span", { className: Q.icon, children: n }),
2448
+ p && /* @__PURE__ */ a("span", { className: Q.remove, children: /* @__PURE__ */ a(Fe, { size: 14 }) })
2449
+ ]
2450
+ }
2451
+ ), $ = /* @__PURE__ */ g(Mt, { children: [
2452
+ c && /* @__PURE__ */ a("span", { className: Q.prefix, children: c }),
2453
+ (n || e || p) && x,
2454
+ /* @__PURE__ */ a("span", { className: [Q.label, d && Q.mono].filter(Boolean).join(" "), children: t })
2455
+ ] }), m = [
2456
+ Q.root,
2457
+ r === "plain" ? Q.plain : Q.chip,
2458
+ _ ? Q.interactive : Q.static,
2459
+ p && Q.removable,
2460
+ u
2461
+ ].filter(Boolean).join(" ");
2462
+ return _ ? /* @__PURE__ */ a(
2463
+ "button",
2464
+ {
2465
+ type: "button",
2466
+ className: m,
2467
+ "aria-label": p ? i : void 0,
2468
+ onClick: p ? () => p() : h,
2469
+ ...f,
2470
+ children: $
2471
+ }
2472
+ ) : /* @__PURE__ */ a("span", { className: m, children: $ });
2473
+ }
2474
+ const Or = "_root_7cjvl_1", Cr = "_bubble_7cjvl_9", Sr = "_references_7cjvl_21", jr = "_animated_7cjvl_29", Ut = {
2475
+ root: Or,
2476
+ bubble: Cr,
2477
+ references: Sr,
2478
+ animated: jr
2479
+ };
2480
+ function ia({
2481
+ children: t,
2482
+ images: n = [],
2483
+ onImageClick: e,
2484
+ references: s,
2485
+ animate: o = !0,
2486
+ className: i,
2487
+ ...r
2488
+ }) {
2489
+ return /* @__PURE__ */ g(
2490
+ "div",
2491
+ {
2492
+ className: [Ut.root, o && Ut.animated, i].filter(Boolean).join(" "),
2493
+ ...r,
2494
+ children: [
2495
+ s && /* @__PURE__ */ a("div", { className: Ut.references, children: s }),
2496
+ n.length > 0 && /* @__PURE__ */ a(Vo, { images: n, onImageClick: e }),
2497
+ t && /* @__PURE__ */ a("div", { className: Ut.bubble, children: t })
2498
+ ]
2499
+ }
2500
+ );
2501
+ }
2502
+ const qr = "_root_1axqb_1", Lr = "_body_1axqb_8", Fr = "_error_1axqb_26", Hr = "_errorMark_1axqb_35", Dr = "_errorText_1axqb_41", Yr = "_footer_1axqb_46", Ur = "_sources_1axqb_53", Xr = "_sourceItem_1axqb_64", Gr = "_source_1axqb_53", Wr = "_actions_1axqb_108", Qr = "_actionsVisible_1axqb_120", Vr = "_voted_1axqb_126", V = {
2503
+ root: qr,
2504
+ body: Lr,
2505
+ error: Fr,
2506
+ errorMark: Hr,
2507
+ errorText: Dr,
2508
+ footer: Yr,
2509
+ sources: Ur,
2510
+ sourceItem: Xr,
2511
+ source: Gr,
2512
+ actions: Wr,
2513
+ actionsVisible: Qr,
2514
+ voted: Vr
2515
+ }, Kr = 1600;
2516
+ function aa({
2517
+ children: t,
2518
+ textValue: n,
2519
+ sources: e = [],
2520
+ error: s,
2521
+ onRetry: o,
2522
+ retryLabel: i = "Try again",
2523
+ onCopy: r,
2524
+ onFeedbackChange: c,
2525
+ feedback: l,
2526
+ defaultFeedback: d = null,
2527
+ actions: u,
2528
+ actionsVisible: h = !1,
2529
+ copyLabel: f = "Copy",
2530
+ copiedLabel: p = "Copied",
2531
+ likeLabel: _ = "Good answer",
2532
+ dislikeLabel: x = "Bad answer",
2533
+ className: $,
2534
+ ...m
2535
+ }) {
2536
+ const [A, v] = st(!1), [y, b] = Tt(l, d, c), P = H(null), M = n ?? (typeof t == "string" ? t : ""), E = !!r || !!c || !!u;
2537
+ K(
2538
+ () => () => {
2539
+ P.current && clearTimeout(P.current);
2540
+ },
2541
+ []
2542
+ );
2543
+ async function j() {
2544
+ var O;
2545
+ try {
2546
+ await ((O = navigator.clipboard) == null ? void 0 : O.writeText(M)), v(!0), P.current && clearTimeout(P.current), P.current = setTimeout(() => v(!1), Kr);
2547
+ } finally {
2548
+ r == null || r(M);
2549
+ }
2550
+ }
2551
+ function q(O) {
2552
+ b(y === O ? null : O);
2553
+ }
2554
+ return /* @__PURE__ */ g(
2555
+ "div",
2556
+ {
2557
+ className: [V.root, h && V.actionsVisible, $].filter(Boolean).join(" "),
2558
+ ...m,
2559
+ children: [
2560
+ t && /* @__PURE__ */ a("div", { className: V.body, children: t }),
2561
+ s && /* @__PURE__ */ g("div", { className: V.error, role: "alert", children: [
2562
+ /* @__PURE__ */ a("span", { className: V.errorMark, children: /* @__PURE__ */ a(pe, { size: 15 }) }),
2563
+ /* @__PURE__ */ a("span", { className: V.errorText, children: s }),
2564
+ o && /* @__PURE__ */ a(At, { variant: "neutral", size: "sm", onClick: o, children: i })
2565
+ ] }),
2566
+ (e.length > 0 || E) && /* @__PURE__ */ g("div", { className: V.footer, children: [
2567
+ e.length > 0 && /* @__PURE__ */ a("ul", { className: V.sources, children: e.map((O) => /* @__PURE__ */ a("li", { className: V.sourceItem, children: O.href ? /* @__PURE__ */ a("a", { className: V.source, href: O.href, onClick: O.onClick, children: O.label }) : O.onClick ? /* @__PURE__ */ a("button", { type: "button", className: V.source, onClick: O.onClick, children: O.label }) : /* @__PURE__ */ a("span", { className: V.source, children: O.label }) }, O.id)) }),
2568
+ E && /* @__PURE__ */ g("div", { className: V.actions, children: [
2569
+ u,
2570
+ r && /* @__PURE__ */ a(
2571
+ ot,
2572
+ {
2573
+ variant: "transparent",
2574
+ size: "xsmall",
2575
+ icon: A ? /* @__PURE__ */ a(De, { size: 15 }) : /* @__PURE__ */ a(Mn, { size: 15 }),
2576
+ "aria-label": A ? p : f,
2577
+ onClick: j
2578
+ }
2579
+ ),
2580
+ c && /* @__PURE__ */ g(Mt, { children: [
2581
+ /* @__PURE__ */ a(
2582
+ ot,
2583
+ {
2584
+ variant: "transparent",
2585
+ size: "xsmall",
2586
+ className: y === "like" ? V.voted : void 0,
2587
+ icon: /* @__PURE__ */ a(wn, { size: 15 }),
2588
+ "aria-label": _,
2589
+ "aria-pressed": y === "like",
2590
+ onClick: () => q("like")
2591
+ }
2592
+ ),
2593
+ /* @__PURE__ */ a(
2594
+ ot,
2595
+ {
2596
+ variant: "transparent",
2597
+ size: "xsmall",
2598
+ className: y === "dislike" ? V.voted : void 0,
2599
+ icon: /* @__PURE__ */ a(In, { size: 15 }),
2600
+ "aria-label": x,
2601
+ "aria-pressed": y === "dislike",
2602
+ onClick: () => q("dislike")
2603
+ }
2604
+ )
2605
+ ] })
2606
+ ] })
2607
+ ] })
2608
+ ]
2609
+ }
2610
+ );
2611
+ }
2612
+ const Zr = "_root_15ubm_1", Jr = "_label_15ubm_8", ti = "_row_15ubm_14", ei = "_pill_15ubm_20", ni = "_icon_15ubm_55", si = "_text_15ubm_62", Rt = {
2613
+ root: Zr,
2614
+ label: Jr,
2615
+ row: ti,
2616
+ pill: ei,
2617
+ icon: ni,
2618
+ text: si
2619
+ };
2620
+ function ca({
2621
+ children: t,
2622
+ label: n,
2623
+ className: e,
2624
+ ...s
2625
+ }) {
2626
+ return /* @__PURE__ */ g("div", { className: [Rt.root, e].filter(Boolean).join(" "), ...s, children: [
2627
+ n && /* @__PURE__ */ a("span", { className: Rt.label, children: n }),
2628
+ /* @__PURE__ */ a("div", { className: Rt.row, children: t })
2629
+ ] });
2630
+ }
2631
+ function la({
2632
+ children: t,
2633
+ icon: n,
2634
+ className: e,
2635
+ type: s = "button",
2636
+ ...o
2637
+ }) {
2638
+ return /* @__PURE__ */ g("button", { type: s, className: [Rt.pill, e].filter(Boolean).join(" "), ...o, children: [
2639
+ n && /* @__PURE__ */ a("span", { className: Rt.icon, children: n }),
2640
+ /* @__PURE__ */ a("span", { className: Rt.text, children: t })
2641
+ ] });
2642
+ }
2643
+ const oi = "_root_1ojxj_1", ri = "_content_1ojxj_38", ii = "_titleRow_1ojxj_46", ai = "_icon_1ojxj_52", ci = "_title_1ojxj_46", li = "_description_1ojxj_61", di = "_trailing_1ojxj_95", kt = {
2644
+ root: oi,
2645
+ content: ri,
2646
+ titleRow: ii,
2647
+ icon: ai,
2648
+ title: ci,
2649
+ description: li,
2650
+ trailing: di
2651
+ };
2652
+ function da({
2653
+ title: t,
2654
+ description: n,
2655
+ icon: e,
2656
+ trailing: s,
2657
+ className: o,
2658
+ ...i
2659
+ }) {
2660
+ const r = [kt.root, o].filter(Boolean).join(" "), c = e === null ? null : e ?? /* @__PURE__ */ a(Rn, { size: 16 }), l = s === null ? null : s ?? /* @__PURE__ */ a(zn, { size: 16 }), d = /* @__PURE__ */ g(Mt, { children: [
2661
+ /* @__PURE__ */ g("span", { className: kt.content, children: [
2662
+ /* @__PURE__ */ g("span", { className: kt.titleRow, children: [
2663
+ c && /* @__PURE__ */ a("span", { className: kt.icon, children: c }),
2664
+ /* @__PURE__ */ a("span", { className: kt.title, children: t })
2665
+ ] }),
2666
+ n && /* @__PURE__ */ a("span", { className: kt.description, children: n })
2667
+ ] }),
2668
+ l && /* @__PURE__ */ a("span", { className: kt.trailing, children: l })
2669
+ ] });
2670
+ if (i.href !== void 0) {
2671
+ const { href: f, ...p } = i;
2672
+ return /* @__PURE__ */ a("a", { className: r, href: f, ...p, children: d });
2673
+ }
2674
+ const { type: u = "button", ...h } = i;
2675
+ return /* @__PURE__ */ a("button", { className: r, type: u, ...h, children: d });
2676
+ }
2677
+ const ui = "_root_15073_1", hi = "_row_15073_8", pi = "_error_15073_19", fi = "_mark_15073_23", mi = "_label_15073_30", _i = "_code_15073_41 _code_1hqe1_6", yi = "_details_15073_46", Nt = {
2678
+ root: ui,
2679
+ row: hi,
2680
+ error: pi,
2681
+ mark: fi,
2682
+ label: mi,
2683
+ code: _i,
2684
+ details: yi
2685
+ };
2686
+ function ua({
2687
+ children: t,
2688
+ icon: n,
2689
+ code: e,
2690
+ state: s = "done",
2691
+ details: o,
2692
+ errorIcon: i,
2693
+ className: r,
2694
+ ...c
2695
+ }) {
2696
+ const l = s === "error", d = l ? i ?? /* @__PURE__ */ a(pe, { size: 16 }) : n;
2697
+ return /* @__PURE__ */ g("div", { className: [Nt.root, r].filter(Boolean).join(" "), ...c, children: [
2698
+ /* @__PURE__ */ g("div", { className: [Nt.row, l && Nt.error].filter(Boolean).join(" "), children: [
2699
+ d && /* @__PURE__ */ a("span", { className: Nt.mark, children: d }),
2700
+ /* @__PURE__ */ a("span", { className: Nt.label, children: t }),
2701
+ e != null && /* @__PURE__ */ a("code", { className: Nt.code, children: e })
2702
+ ] }),
2703
+ o && /* @__PURE__ */ a("div", { className: Nt.details, children: o })
2704
+ ] });
2705
+ }
2706
+ const gi = "_root_1sq2g_1", xi = "_trigger_1sq2g_8", bi = "_caret_1sq2g_31", vi = "_title_1sq2g_39", ki = "_items_1sq2g_47", St = {
2707
+ root: gi,
2708
+ trigger: xi,
2709
+ caret: bi,
2710
+ title: vi,
2711
+ items: ki
2712
+ };
2713
+ function ha({
2714
+ title: t,
2715
+ children: n,
2716
+ open: e,
2717
+ defaultOpen: s = !1,
2718
+ onOpenChange: o,
2719
+ className: i,
2720
+ ...r
2721
+ }) {
2722
+ const [c, l] = Tt(e, s, o), d = qt();
2723
+ return /* @__PURE__ */ g("div", { className: [St.root, i].filter(Boolean).join(" "), ...r, children: [
2724
+ /* @__PURE__ */ g(
2725
+ "button",
2726
+ {
2727
+ type: "button",
2728
+ className: St.trigger,
2729
+ "aria-expanded": c,
2730
+ "aria-controls": d,
2731
+ onClick: () => l(!c),
2732
+ children: [
2733
+ /* @__PURE__ */ a("span", { className: St.caret, children: c ? /* @__PURE__ */ a(Ye, { size: 14 }) : /* @__PURE__ */ a(Ue, { size: 14 }) }),
2734
+ /* @__PURE__ */ a("span", { className: St.title, children: t })
2735
+ ]
2736
+ }
2737
+ ),
2738
+ c && /* @__PURE__ */ a("div", { id: d, className: St.items, children: n })
2739
+ ] });
2740
+ }
2741
+ const Ni = "_root_1dvwc_1", $i = "_pending_1dvwc_11", Ai = "_error_1dvwc_15", Mi = "_mark_1dvwc_19", wi = "_label_1dvwc_29", Ii = "_done_1dvwc_37", zi = "_code_1dvwc_41 _code_1hqe1_6", jt = {
2742
+ root: Ni,
2743
+ pending: $i,
2744
+ error: Ai,
2745
+ mark: Mi,
2746
+ label: wi,
2747
+ done: Ii,
2748
+ code: zi
2749
+ };
2750
+ function pa({
2751
+ children: t,
2752
+ code: n,
2753
+ state: e = "pending",
2754
+ marker: s,
2755
+ runningLabel: o = "In progress",
2756
+ className: i,
2757
+ ...r
2758
+ }) {
2759
+ const c = s ?? (e === "done" ? /* @__PURE__ */ a(De, { size: 14 }) : e === "error" ? /* @__PURE__ */ a(pe, { size: 14 }) : e === "running" ? /* @__PURE__ */ a(hn, { size: "xs", label: o }) : /* @__PURE__ */ a(Tn, { size: 14 }));
2760
+ return /* @__PURE__ */ g("div", { className: [jt.root, jt[e], i].filter(Boolean).join(" "), ...r, children: [
2761
+ /* @__PURE__ */ a("span", { className: jt.mark, children: c }),
2762
+ /* @__PURE__ */ a("span", { className: jt.label, children: t }),
2763
+ n != null && /* @__PURE__ */ a("code", { className: jt.code, children: n })
2764
+ ] });
2765
+ }
2766
+ const Ri = "--backgrounds-bg-base";
2767
+ function Ti(t, n) {
2768
+ const e = t.trim();
2769
+ if (/^#[0-9a-f]{6}$/i.test(e)) return e;
2770
+ if (/^#[0-9a-f]{3}$/i.test(e))
2771
+ return `#${e.slice(1).split("").map((o) => o + o).join("")}`;
2772
+ const s = e.match(/-?\d*\.?\d+/g);
2773
+ return !s || s.length < 3 ? n : `#${s.slice(0, 3).map(
2774
+ (o) => Math.max(0, Math.min(255, Math.round(Number(o)))).toString(16).padStart(2, "0")
2775
+ ).join("")}`;
2776
+ }
2777
+ function qe(t) {
2778
+ if (typeof window > "u") return t;
2779
+ const n = getComputedStyle(document.documentElement).getPropertyValue(Ri);
2780
+ return n ? Ti(n, t) : t;
2781
+ }
2782
+ function nn(t, n = "rgb(255 255 255)") {
2783
+ const [e, s] = st(() => t ?? qe(n));
2784
+ return K(() => {
2785
+ if (t) {
2786
+ s(t);
2787
+ return;
2788
+ }
2789
+ const o = () => s(qe(n));
2790
+ o();
2791
+ const i = new MutationObserver(o);
2792
+ return i.observe(document.documentElement, {
2793
+ attributes: !0,
2794
+ attributeFilter: ["data-theme", "class", "style"]
2795
+ }), () => i.disconnect();
2796
+ }, [t, n]), e;
2797
+ }
2798
+ const Bi = "_root_1gc8h_1", Ei = "_header_1gc8h_8", Pi = "_trigger_1gc8h_23", Oi = "_mark_1gc8h_34", Ci = "_caret_1gc8h_35", Si = "_body_1gc8h_50", ji = "_peek_1gc8h_65", pt = {
2799
+ root: Bi,
2800
+ header: Ei,
2801
+ trigger: Pi,
2802
+ mark: Oi,
2803
+ caret: Ci,
2804
+ body: Si,
2805
+ peek: ji
2806
+ };
2807
+ function fa({
2808
+ children: t,
2809
+ label: n = "Reasoning",
2810
+ workingLabel: e = "Reasoning…",
2811
+ working: s = !1,
2812
+ open: o,
2813
+ defaultOpen: i = !1,
2814
+ onOpenChange: r,
2815
+ peekHeight: c = "96px",
2816
+ avatar: l,
2817
+ paper: d,
2818
+ avatarSize: u = 20,
2819
+ className: h,
2820
+ ...f
2821
+ }) {
2822
+ const [p, _] = Tt(o, i, r), x = H(null), $ = qt(), m = nn(d), A = s || p;
2823
+ K(() => {
2824
+ if (!s) return;
2825
+ const y = x.current;
2826
+ y && (y.scrollTop = y.scrollHeight);
2827
+ }, [t, s]);
2828
+ const v = l === null ? null : l ?? /* @__PURE__ */ a(Kt, { size: u, state: "thinking", paper: m });
2829
+ return /* @__PURE__ */ g("div", { className: [pt.root, h].filter(Boolean).join(" "), ...f, children: [
2830
+ s ? /* @__PURE__ */ g("div", { className: pt.header, role: "status", "aria-live": "polite", children: [
2831
+ v && /* @__PURE__ */ a("span", { className: pt.mark, children: v }),
2832
+ /* @__PURE__ */ a("span", { className: pt.label, children: e })
2833
+ ] }) : /* @__PURE__ */ g(
2834
+ "button",
2835
+ {
2836
+ type: "button",
2837
+ className: [pt.header, pt.trigger].join(" "),
2838
+ "aria-expanded": p,
2839
+ "aria-controls": $,
2840
+ onClick: () => _(!p),
2841
+ children: [
2842
+ /* @__PURE__ */ a("span", { className: pt.caret, children: p ? /* @__PURE__ */ a(Ye, { size: 14 }) : /* @__PURE__ */ a(Ue, { size: 14 }) }),
2843
+ /* @__PURE__ */ a("span", { className: pt.label, children: n })
2844
+ ]
2845
+ }
2846
+ ),
2847
+ A && /* @__PURE__ */ a(
2848
+ "div",
2849
+ {
2850
+ id: $,
2851
+ ref: x,
2852
+ className: [pt.body, s && pt.peek].filter(Boolean).join(" "),
2853
+ style: s ? { maxHeight: c } : void 0,
2854
+ children: t
2855
+ }
2856
+ )
2857
+ ] });
2858
+ }
2859
+ const qi = "_root_1d7vi_1", Li = "_avatar_1d7vi_8", Fi = "_label_1d7vi_14", re = {
2860
+ root: qi,
2861
+ avatar: Li,
2862
+ label: Fi
2863
+ };
2864
+ function ma({
2865
+ label: t = "Thinking…",
2866
+ size: n = 24,
2867
+ shape: e,
2868
+ color: s,
2869
+ paper: o,
2870
+ className: i,
2871
+ ...r
2872
+ }) {
2873
+ const c = nn(o);
2874
+ return /* @__PURE__ */ g(
2875
+ "div",
2876
+ {
2877
+ className: [re.root, i].filter(Boolean).join(" "),
2878
+ role: "status",
2879
+ "aria-live": "polite",
2880
+ ...r,
2881
+ children: [
2882
+ /* @__PURE__ */ a("span", { className: re.avatar, children: /* @__PURE__ */ a(Kt, { size: n, state: "thinking", shape: e, color: s, paper: c }) }),
2883
+ /* @__PURE__ */ a("span", { className: re.label, children: t })
2884
+ ]
2885
+ }
2886
+ );
2887
+ }
2888
+ export {
2889
+ na as AiAssistantActionCard,
2890
+ aa as AiAssistantAnswer,
2891
+ Ki as AiAssistantBottom,
2892
+ Xs as AiAssistantHeader,
2893
+ Vo as AiAssistantImageGroup,
2894
+ Ji as AiAssistantInput,
2895
+ ta as AiAssistantLauncher,
2896
+ Zi as AiAssistantLink,
2897
+ Qi as AiAssistantModal,
2898
+ ia as AiAssistantQuestion,
2899
+ sa as AiAssistantQuestionCard,
2900
+ fa as AiAssistantReasoning,
2901
+ da as AiAssistantRecommendation,
2902
+ ra as AiAssistantReference,
2903
+ ea as AiAssistantReferencePanel,
2904
+ oa as AiAssistantSecretField,
2905
+ la as AiAssistantSuggestion,
2906
+ ca as AiAssistantSuggestions,
2907
+ pa as AiAssistantTask,
2908
+ ma as AiAssistantThinking,
2909
+ Vi as AiAssistantTitle,
2910
+ ua as AiAssistantToolCall,
2911
+ ha as AiAssistantToolCallGroup,
2912
+ us as COLORS,
2913
+ hs as COLOR_BY_ID,
2914
+ ps as DEFAULT_COLOR,
2915
+ Wn as DEFAULT_EXPRESSION,
2916
+ ds as DEFAULT_SHAPE,
2917
+ We as EXPRESSIONS,
2918
+ Gn as EXPRESSION_BY_ID,
2919
+ Es as HALF_VIEWBOX,
2920
+ Kt as Novi,
2921
+ ue as NoviEngine,
2922
+ Wi as NoviTile,
2923
+ Cs as PITCH,
2924
+ Os as PITCH_MAX,
2925
+ bs as POSES,
2926
+ Je as RADIUS,
2927
+ Xi as SEQUENCE,
2928
+ Ve as SHAPES,
2929
+ ls as SHAPE_BY_ID,
2930
+ tn as SPIN,
2931
+ Ss as SPIN_TIME,
2932
+ Ze as STATES,
2933
+ zt as STATE_BY_ID,
2934
+ ee as TURN_TIME,
2935
+ Ps as YAW_MAX,
2936
+ js as lookTarget,
2937
+ fs as mixHex,
2938
+ Gi as spinLook,
2939
+ nn as usePaper
2940
+ };