@actioneer/ads 0.1.0

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 (231) hide show
  1. package/LICENSE +21 -0
  2. package/bin/ads-init.mjs +314 -0
  3. package/components/accordion.d.ts +13 -0
  4. package/components/accordion.js +91 -0
  5. package/components/agents-ui/agent-audio-visualizer-aura.d.ts +11 -0
  6. package/components/agents-ui/agent-audio-visualizer-aura.js +277 -0
  7. package/components/agents-ui/agent-audio-visualizer-wave.d.ts +12 -0
  8. package/components/agents-ui/agent-audio-visualizer-wave.js +203 -0
  9. package/components/agents-ui/react-shader-toy.d.ts +87 -0
  10. package/components/agents-ui/react-shader-toy.js +531 -0
  11. package/components/ai-elements/chain-of-thought.d.ts +30 -0
  12. package/components/ai-elements/chain-of-thought.js +182 -0
  13. package/components/ai-elements/index.d.ts +11 -0
  14. package/components/ai-elements/inline-citation.d.ts +44 -0
  15. package/components/ai-elements/inline-citation.js +314 -0
  16. package/components/ai-elements/message.d.ts +96 -0
  17. package/components/ai-elements/message.js +308 -0
  18. package/components/ai-elements/queue.d.ts +60 -0
  19. package/components/ai-elements/queue.js +193 -0
  20. package/components/ai-elements/reasoning.d.ts +26 -0
  21. package/components/ai-elements/reasoning.js +131 -0
  22. package/components/ai-elements/shimmer.d.ts +25 -0
  23. package/components/ai-elements/shimmer.js +44 -0
  24. package/components/ai-elements/speech-input.d.ts +16 -0
  25. package/components/ai-elements/speech-input.js +151 -0
  26. package/components/ai-elements/task-progress.d.ts +41 -0
  27. package/components/ai-elements/task-progress.js +211 -0
  28. package/components/ai-elements/task.d.ts +35 -0
  29. package/components/ai-elements/task.js +73 -0
  30. package/components/ai-elements/tool.d.ts +53 -0
  31. package/components/ai-elements/tool.js +116 -0
  32. package/components/ai-elements/voice.d.ts +74 -0
  33. package/components/ai-elements/voice.js +875 -0
  34. package/components/alert.d.ts +21 -0
  35. package/components/alert.js +76 -0
  36. package/components/answer.d.ts +984 -0
  37. package/components/answer.js +543 -0
  38. package/components/assistant-ui/action-bar.d.ts +3 -0
  39. package/components/assistant-ui/action-bar.js +57 -0
  40. package/components/assistant-ui/answer-tool-ui.d.ts +5 -0
  41. package/components/assistant-ui/answer-tool-ui.js +42 -0
  42. package/components/assistant-ui/attachment.d.ts +50 -0
  43. package/components/assistant-ui/attachment.js +353 -0
  44. package/components/assistant-ui/badge.d.ts +11 -0
  45. package/components/assistant-ui/badge.js +54 -0
  46. package/components/assistant-ui/branch-picker.d.ts +3 -0
  47. package/components/assistant-ui/branch-picker.js +36 -0
  48. package/components/assistant-ui/chain-of-thought.d.ts +46 -0
  49. package/components/assistant-ui/composer-add-context.d.ts +50 -0
  50. package/components/assistant-ui/composer-add-context.js +209 -0
  51. package/components/assistant-ui/composer-deep-research.d.ts +16 -0
  52. package/components/assistant-ui/composer-deep-research.js +38 -0
  53. package/components/assistant-ui/composer-harness.d.ts +18 -0
  54. package/components/assistant-ui/composer-harness.js +186 -0
  55. package/components/assistant-ui/composer-trigger-popover.d.ts +47 -0
  56. package/components/assistant-ui/composer-trigger-popover.js +147 -0
  57. package/components/assistant-ui/composer.d.ts +8 -0
  58. package/components/assistant-ui/composer.js +276 -0
  59. package/components/assistant-ui/directive-text.d.ts +16 -0
  60. package/components/assistant-ui/directive-text.js +40 -0
  61. package/components/assistant-ui/error.d.ts +6 -0
  62. package/components/assistant-ui/error.js +39 -0
  63. package/components/assistant-ui/file.d.ts +37 -0
  64. package/components/assistant-ui/file.js +159 -0
  65. package/components/assistant-ui/follow-up-suggestions.d.ts +7 -0
  66. package/components/assistant-ui/follow-up-suggestions.js +44 -0
  67. package/components/assistant-ui/image.d.ts +46 -0
  68. package/components/assistant-ui/image.js +351 -0
  69. package/components/assistant-ui/index.d.ts +28 -0
  70. package/components/assistant-ui/markdown-text.d.ts +1 -0
  71. package/components/assistant-ui/markdown-text.js +242 -0
  72. package/components/assistant-ui/message-timing.d.ts +25 -0
  73. package/components/assistant-ui/message-timing.js +56 -0
  74. package/components/assistant-ui/message.d.ts +4 -0
  75. package/components/assistant-ui/message.js +159 -0
  76. package/components/assistant-ui/primitives.d.ts +2 -0
  77. package/components/assistant-ui/quote.d.ts +37 -0
  78. package/components/assistant-ui/quote.js +150 -0
  79. package/components/assistant-ui/reasoning.d.ts +44 -0
  80. package/components/assistant-ui/reasoning.js +261 -0
  81. package/components/assistant-ui/selection-toolbar.d.ts +29 -0
  82. package/components/assistant-ui/selection-toolbar.js +91 -0
  83. package/components/assistant-ui/smart-message-text.d.ts +15 -0
  84. package/components/assistant-ui/smart-message-text.js +29 -0
  85. package/components/assistant-ui/sources.d.ts +17 -0
  86. package/components/assistant-ui/sources.js +121 -0
  87. package/components/assistant-ui/suggestions.d.ts +7 -0
  88. package/components/assistant-ui/suggestions.js +19 -0
  89. package/components/assistant-ui/thread-context.d.ts +37 -0
  90. package/components/assistant-ui/thread-context.js +8 -0
  91. package/components/assistant-ui/thread.d.ts +5 -0
  92. package/components/assistant-ui/thread.js +77 -0
  93. package/components/assistant-ui/tool-fallback.d.ts +36 -0
  94. package/components/assistant-ui/tool-fallback.js +428 -0
  95. package/components/assistant-ui/tool-group.d.ts +33 -0
  96. package/components/assistant-ui/tool-group.js +173 -0
  97. package/components/assistant-ui/tooltip-icon-button.d.ts +7 -0
  98. package/components/assistant-ui/tooltip-icon-button.js +31 -0
  99. package/components/assistant-ui/voice.d.ts +18 -0
  100. package/components/autocomplete.d.ts +18 -0
  101. package/components/autocomplete.js +162 -0
  102. package/components/avatar.d.ts +26 -0
  103. package/components/avatar.js +92 -0
  104. package/components/badge.d.ts +10 -0
  105. package/components/badge.js +83 -0
  106. package/components/brand-loader.d.ts +16 -0
  107. package/components/brand-loader.js +64 -0
  108. package/components/breadcrumbs.d.ts +8 -0
  109. package/components/breadcrumbs.js +58 -0
  110. package/components/button.d.ts +13 -0
  111. package/components/button.js +100 -0
  112. package/components/card.d.ts +19 -0
  113. package/components/card.js +82 -0
  114. package/components/carousel.d.ts +31 -0
  115. package/components/carousel.js +351 -0
  116. package/components/chart.d.ts +165 -0
  117. package/components/chart.js +841 -0
  118. package/components/checkbox.d.ts +13 -0
  119. package/components/checkbox.js +84 -0
  120. package/components/chip.d.ts +13 -0
  121. package/components/chip.js +112 -0
  122. package/components/collapsible.d.ts +5 -0
  123. package/components/collapsible.js +31 -0
  124. package/components/connector-card.d.ts +62 -0
  125. package/components/connector-card.js +154 -0
  126. package/components/divider.d.ts +23 -0
  127. package/components/divider.js +69 -0
  128. package/components/drawer.d.ts +45 -0
  129. package/components/drawer.js +234 -0
  130. package/components/dropdown.d.ts +33 -0
  131. package/components/dropdown.js +198 -0
  132. package/components/empty-state.d.ts +8 -0
  133. package/components/empty-state.js +30 -0
  134. package/components/field.d.ts +20 -0
  135. package/components/field.js +74 -0
  136. package/components/index.d.ts +56 -0
  137. package/components/index.js +444 -0
  138. package/components/input-field.d.ts +22 -0
  139. package/components/input-field.js +91 -0
  140. package/components/input.d.ts +8 -0
  141. package/components/input.js +61 -0
  142. package/components/kbd.d.ts +6 -0
  143. package/components/kbd.js +26 -0
  144. package/components/link.d.ts +14 -0
  145. package/components/link.js +72 -0
  146. package/components/modal.d.ts +18 -0
  147. package/components/modal.js +156 -0
  148. package/components/navbar.d.ts +15 -0
  149. package/components/navbar.js +68 -0
  150. package/components/number-field.d.ts +11 -0
  151. package/components/number-field.js +89 -0
  152. package/components/pagination.d.ts +28 -0
  153. package/components/pagination.js +179 -0
  154. package/components/panel.d.ts +14 -0
  155. package/components/panel.js +71 -0
  156. package/components/pixel-blast-svg.d.ts +22 -0
  157. package/components/pixel-blast-svg.js +154 -0
  158. package/components/popover.d.ts +20 -0
  159. package/components/popover.js +101 -0
  160. package/components/progress-circle.d.ts +11 -0
  161. package/components/progress-circle.js +75 -0
  162. package/components/progress.d.ts +22 -0
  163. package/components/progress.js +66 -0
  164. package/components/radio.d.ts +16 -0
  165. package/components/radio.js +101 -0
  166. package/components/segmented.d.ts +16 -0
  167. package/components/segmented.js +103 -0
  168. package/components/select.d.ts +28 -0
  169. package/components/select.js +180 -0
  170. package/components/selection-action-bar.d.ts +11 -0
  171. package/components/selection-action-bar.js +59 -0
  172. package/components/sidebar.d.ts +118 -0
  173. package/components/sidebar.js +375 -0
  174. package/components/skeleton.d.ts +6 -0
  175. package/components/skeleton.js +26 -0
  176. package/components/slider.d.ts +11 -0
  177. package/components/slider.js +62 -0
  178. package/components/spinner.d.ts +11 -0
  179. package/components/spinner.js +62 -0
  180. package/components/switch.d.ts +7 -0
  181. package/components/switch.js +61 -0
  182. package/components/table.d.ts +59 -0
  183. package/components/table.js +254 -0
  184. package/components/tabs.d.ts +29 -0
  185. package/components/tabs.js +371 -0
  186. package/components/textarea.d.ts +5 -0
  187. package/components/textarea.js +24 -0
  188. package/components/timeline.d.ts +7 -0
  189. package/components/timeline.js +47 -0
  190. package/components/toast.d.ts +74 -0
  191. package/components/toast.js +211 -0
  192. package/components/tooltip.d.ts +11 -0
  193. package/components/tooltip.js +143 -0
  194. package/components/tree.d.ts +42 -0
  195. package/components/tree.js +86 -0
  196. package/components/typography.d.ts +33 -0
  197. package/components/typography.js +65 -0
  198. package/components/ui/avatar.d.ts +11 -0
  199. package/components/ui/avatar.js +56 -0
  200. package/components/ui/button.d.ts +10 -0
  201. package/components/ui/button.js +57 -0
  202. package/components/ui/collapsible.d.ts +5 -0
  203. package/components/ui/collapsible.js +35 -0
  204. package/components/ui/dialog.d.ts +17 -0
  205. package/components/ui/dialog.js +93 -0
  206. package/components/ui/tabs.d.ts +22 -0
  207. package/components/ui/tooltip.d.ts +7 -0
  208. package/components/ui/tooltip.js +56 -0
  209. package/fonts/aribau-grotesk-400.otf +0 -0
  210. package/fonts/aribau-grotesk-700.otf +0 -0
  211. package/fonts.css +21 -0
  212. package/hooks/agents-ui/use-agent-audio-visualizer-aura.d.ts +8 -0
  213. package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +62 -0
  214. package/hooks/agents-ui/use-agent-audio-visualizer-wave.d.ts +7 -0
  215. package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +60 -0
  216. package/hooks/agents-ui/voice-visualizer-types.d.ts +9 -0
  217. package/lib/cn.d.ts +3 -0
  218. package/lib/cn.js +9 -0
  219. package/lib/icons.d.ts +378 -0
  220. package/lib/icons.js +119 -0
  221. package/lib/interactive.d.ts +24 -0
  222. package/lib/interactive.js +36 -0
  223. package/lib/motion.d.ts +58 -0
  224. package/lib/motion.js +70 -0
  225. package/lib/router.d.ts +3 -0
  226. package/lib/utils.d.ts +6 -0
  227. package/llms.txt +537 -0
  228. package/manifest.json +5085 -0
  229. package/package.json +60 -0
  230. package/styles.css +653 -0
  231. package/theme.css +273 -0
@@ -0,0 +1,875 @@
1
+ "use client";
2
+ import { jsx as e, jsxs as c, Fragment as y } from "react/jsx-runtime";
3
+ import * as s from "react";
4
+ import { MotionConfig as Z, motion as B, useReducedMotion as K } from "motion/react";
5
+ import { cn as T } from "../../lib/cn.js";
6
+ import { EASE_OUT as F, EASE_IN_OUT as X } from "../../lib/motion.js";
7
+ import { Button as G } from "../button.js";
8
+ import { Tooltip as j } from "../tooltip.js";
9
+ import { AgentAudioVisualizerAura as J } from "../agents-ui/agent-audio-visualizer-aura.js";
10
+ import { AgentAudioVisualizerWave as Q } from "../agents-ui/agent-audio-visualizer-wave.js";
11
+ import { Call as ee, PhoneOff as oe, MicOff as te, Mic as ie } from "../../lib/icons.js";
12
+ const Te = [
13
+ "default",
14
+ "blue",
15
+ "violet",
16
+ "emerald",
17
+ "sunset"
18
+ ], re = ["orb", "aura", "wave"], $e = [
19
+ "idle",
20
+ "connecting",
21
+ "listening",
22
+ "thinking",
23
+ "speaking",
24
+ "muted",
25
+ "asleep"
26
+ ], C = {
27
+ // Near-white slash with a silver sheen; quiet, silver-on-light.
28
+ command: {
29
+ sheen: "#ffffff",
30
+ silver: "#c7ccd6",
31
+ silverDeep: "#a6adbc",
32
+ shadow: "rgba(58,64,82,0.22)",
33
+ accent: "#c7ccd6"
34
+ },
35
+ // Two flat electric-violet 4-point sparkles.
36
+ glint: {
37
+ spark: "#8030e0",
38
+ sparkLite: "#9a4cf0",
39
+ accent: "#8030e0"
40
+ },
41
+ // Thin silver-white ring with a soft warm-white glow.
42
+ halo: {
43
+ ring: "#cfd4de",
44
+ ringLite: "#ffffff",
45
+ glow: "#fff2dd",
46
+ accent: "#e9d9b8"
47
+ },
48
+ // Glossy deep-blue sphere: navy shadow → cobalt body → ice-blue highlights.
49
+ mana: {
50
+ lit: "#5b7ce0",
51
+ body: "#4060b0",
52
+ mid: "#203060",
53
+ shadow: "#001020",
54
+ cloud: "#3a5aa8",
55
+ cloudLite: "#6f8fe4",
56
+ ice: "#90d0ff",
57
+ spec: "#ffffff",
58
+ accent: "#90d0ff"
59
+ },
60
+ // Polished chrome ball: silver body, gray crescent core, white gloss.
61
+ obsidian: {
62
+ hi: "#f6f6f8",
63
+ body: "#d0d2d8",
64
+ horizon: "#8a8a92",
65
+ low: "#e4e5ea",
66
+ coreLite: "#dcdde2",
67
+ coreDark: "#6f6f76",
68
+ rim: "#101010",
69
+ gloss: "#ffffff",
70
+ accent: "#c8ccd6"
71
+ },
72
+ // Iridescent orb: crimson top, magenta left, amber right, cyan bottom, melting.
73
+ opal: {
74
+ crimson: "#e03020",
75
+ rust: "#802010",
76
+ pink: "#f080d0",
77
+ magenta: "#f080e0",
78
+ amber: "#f0b024",
79
+ yellow: "#ffd45a",
80
+ cyan: "#30d0d0",
81
+ sheen: "#ffffff",
82
+ accent: "#f080d0"
83
+ }
84
+ }, ne = {
85
+ idle: { scale: [1, 1.04, 1], opacity: 1, duration: 4 },
86
+ connecting: { scale: [1, 1.06, 1], opacity: 1, duration: 1.3 },
87
+ listening: { scale: [1, 1.09, 1], opacity: 1, duration: 1.7 },
88
+ thinking: { scale: [1, 1.03, 1], opacity: 1, duration: 2.4 },
89
+ speaking: { scale: [1, 1.12, 0.99, 1.07, 1], opacity: 1, duration: 0.95 },
90
+ muted: { scale: [1, 1.02, 1], opacity: 0.7, duration: 5 },
91
+ asleep: { scale: [1, 1.015, 1], opacity: 0.45, duration: 6 }
92
+ }, ce = {
93
+ command: { idle: 0, think: 42 },
94
+ glint: { idle: 5, think: 65 },
95
+ halo: { idle: 20, think: 80 },
96
+ mana: { idle: 0, think: 28 },
97
+ obsidian: { idle: 4, think: 48 },
98
+ opal: { idle: 9, think: 40 }
99
+ }, le = {
100
+ idle: "idle",
101
+ connecting: "think",
102
+ listening: "idle",
103
+ thinking: "think",
104
+ speaking: "idle",
105
+ muted: "slow",
106
+ asleep: "stop"
107
+ }, se = {
108
+ listening: { count: 2, duration: 1.7, maxScale: 1.7, peak: 0.4 },
109
+ connecting: { count: 1, duration: 1.9, maxScale: 1.55, peak: 0.32 }
110
+ };
111
+ function ae(r, o) {
112
+ switch (r) {
113
+ case "command": {
114
+ const t = C.command, i = `${o}-cmd`;
115
+ return {
116
+ defs: /* @__PURE__ */ c(y, { children: [
117
+ /* @__PURE__ */ c("linearGradient", { id: i, x1: "0", y1: "1", x2: "1", y2: "0", children: [
118
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: t.silverDeep }),
119
+ /* @__PURE__ */ e("stop", { offset: "45%", stopColor: t.silver }),
120
+ /* @__PURE__ */ e("stop", { offset: "70%", stopColor: t.sheen }),
121
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: t.silver })
122
+ ] }),
123
+ /* @__PURE__ */ e("filter", { id: `${i}-s`, x: "-40%", y: "-40%", width: "180%", height: "180%", children: /* @__PURE__ */ e("feDropShadow", { dx: "0", dy: "2.5", stdDeviation: "3", floodColor: t.shadow }) })
124
+ ] }),
125
+ body: /* @__PURE__ */ e("g", { filter: `url(#${i}-s)`, children: /* @__PURE__ */ e(
126
+ "line",
127
+ {
128
+ x1: 37,
129
+ y1: 72,
130
+ x2: 63,
131
+ y2: 28,
132
+ stroke: `url(#${i})`,
133
+ strokeWidth: 13,
134
+ strokeLinecap: "round"
135
+ }
136
+ ) })
137
+ };
138
+ }
139
+ case "glint": {
140
+ const t = C.glint;
141
+ return {
142
+ defs: null,
143
+ body: /* @__PURE__ */ c(y, { children: [
144
+ /* @__PURE__ */ e(
145
+ "path",
146
+ {
147
+ d: "M50 16 C53.5 43 56.5 46.5 84 50 C56.5 53.5 53.5 57 50 84 C46.5 57 43.5 53.5 16 50 C43.5 46.5 46.5 43 50 16 Z",
148
+ fill: t.spark
149
+ }
150
+ ),
151
+ /* @__PURE__ */ e(
152
+ "path",
153
+ {
154
+ d: "M27 60 C28.6 68 29.4 68.8 37 70.5 C29.4 72.2 28.6 73 27 81 C25.4 73 24.6 72.2 17 70.5 C24.6 68.8 25.4 68 27 60 Z",
155
+ fill: t.sparkLite
156
+ }
157
+ )
158
+ ] })
159
+ };
160
+ }
161
+ case "halo": {
162
+ const t = C.halo, i = `${o}-halo`;
163
+ return {
164
+ defs: /* @__PURE__ */ c(y, { children: [
165
+ /* @__PURE__ */ c("linearGradient", { id: i, x1: "0", y1: "0", x2: "1", y2: "1", children: [
166
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: t.ringLite }),
167
+ /* @__PURE__ */ e("stop", { offset: "50%", stopColor: t.ring }),
168
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: t.ringLite })
169
+ ] }),
170
+ /* @__PURE__ */ e("filter", { id: `${i}-glow`, x: "-60%", y: "-60%", width: "220%", height: "220%", children: /* @__PURE__ */ e("feGaussianBlur", { stdDeviation: "4" }) })
171
+ ] }),
172
+ // Warm-white glow + the crisp silver ring stay fixed …
173
+ under: /* @__PURE__ */ c(y, { children: [
174
+ /* @__PURE__ */ e(
175
+ "circle",
176
+ {
177
+ cx: 50,
178
+ cy: 50,
179
+ r: 30,
180
+ fill: "none",
181
+ stroke: t.glow,
182
+ strokeWidth: 9,
183
+ opacity: 0.55,
184
+ filter: `url(#${i}-glow)`
185
+ }
186
+ ),
187
+ /* @__PURE__ */ e("circle", { cx: 50, cy: 50, r: 30, fill: "none", stroke: `url(#${i})`, strokeWidth: 4 })
188
+ ] }),
189
+ // … while a bright sheen arc travels around it.
190
+ body: /* @__PURE__ */ e(
191
+ "path",
192
+ {
193
+ d: "M50 20 A30 30 0 0 1 78 44",
194
+ fill: "none",
195
+ stroke: t.ringLite,
196
+ strokeWidth: 4.5,
197
+ strokeLinecap: "round"
198
+ }
199
+ )
200
+ };
201
+ }
202
+ case "mana": {
203
+ const t = C.mana, i = `${o}-mana`;
204
+ return {
205
+ defs: /* @__PURE__ */ c(y, { children: [
206
+ /* @__PURE__ */ c("radialGradient", { id: i, cx: "0.4", cy: "0.34", r: "0.75", children: [
207
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: t.lit }),
208
+ /* @__PURE__ */ e("stop", { offset: "45%", stopColor: t.body }),
209
+ /* @__PURE__ */ e("stop", { offset: "78%", stopColor: t.mid }),
210
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: t.shadow })
211
+ ] }),
212
+ /* @__PURE__ */ e("filter", { id: `${i}-b`, x: "-30%", y: "-30%", width: "160%", height: "160%", children: /* @__PURE__ */ e("feGaussianBlur", { stdDeviation: "2.4" }) }),
213
+ /* @__PURE__ */ e("clipPath", { id: `${i}-c`, children: /* @__PURE__ */ e("circle", { cx: 50, cy: 50, r: 32 }) })
214
+ ] }),
215
+ // Sphere + cloudy internal texture rotate inside the clipped circle …
216
+ body: /* @__PURE__ */ c("g", { clipPath: `url(#${i}-c)`, children: [
217
+ /* @__PURE__ */ e("circle", { cx: 50, cy: 50, r: 32, fill: `url(#${i})` }),
218
+ /* @__PURE__ */ c("g", { filter: `url(#${i}-b)`, children: [
219
+ /* @__PURE__ */ e(
220
+ "ellipse",
221
+ {
222
+ cx: 44,
223
+ cy: 60,
224
+ rx: 14,
225
+ ry: 9,
226
+ fill: t.cloud,
227
+ opacity: 0.55,
228
+ transform: "rotate(-20 44 60)"
229
+ }
230
+ ),
231
+ /* @__PURE__ */ e(
232
+ "ellipse",
233
+ {
234
+ cx: 60,
235
+ cy: 44,
236
+ rx: 10,
237
+ ry: 7,
238
+ fill: t.cloudLite,
239
+ opacity: 0.45,
240
+ transform: "rotate(25 60 44)"
241
+ }
242
+ ),
243
+ /* @__PURE__ */ e("ellipse", { cx: 38, cy: 40, rx: 7, ry: 5, fill: t.cloudLite, opacity: 0.35 })
244
+ ] })
245
+ ] }),
246
+ // … while the ice-blue + white speculars stay put (fixed light source).
247
+ over: /* @__PURE__ */ c("g", { children: [
248
+ /* @__PURE__ */ e(
249
+ "ellipse",
250
+ {
251
+ cx: 62,
252
+ cy: 38,
253
+ rx: 9,
254
+ ry: 6,
255
+ fill: t.ice,
256
+ opacity: 0.5,
257
+ transform: "rotate(-30 62 38)",
258
+ filter: `url(#${i}-b)`
259
+ }
260
+ ),
261
+ /* @__PURE__ */ e(
262
+ "ellipse",
263
+ {
264
+ cx: 59,
265
+ cy: 35,
266
+ rx: 5.5,
267
+ ry: 3.8,
268
+ fill: t.spec,
269
+ opacity: 0.9,
270
+ transform: "rotate(-30 59 35)"
271
+ }
272
+ ),
273
+ /* @__PURE__ */ e("ellipse", { cx: 66, cy: 43, rx: 2.6, ry: 1.9, fill: t.spec, opacity: 0.7 })
274
+ ] })
275
+ };
276
+ }
277
+ case "opal": {
278
+ const t = C.opal, i = `${o}-opal`;
279
+ return {
280
+ defs: /* @__PURE__ */ c(y, { children: [
281
+ /* @__PURE__ */ e("filter", { id: `${i}-b`, x: "-30%", y: "-30%", width: "160%", height: "160%", children: /* @__PURE__ */ e("feGaussianBlur", { stdDeviation: "7" }) }),
282
+ /* @__PURE__ */ e("clipPath", { id: `${i}-c`, children: /* @__PURE__ */ e("circle", { cx: 50, cy: 50, r: 33 }) }),
283
+ /* @__PURE__ */ c("radialGradient", { id: `${i}-sheen`, cx: "0.4", cy: "0.32", r: "0.5", children: [
284
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: t.sheen, stopOpacity: 0.55 }),
285
+ /* @__PURE__ */ e("stop", { offset: "60%", stopColor: t.sheen, stopOpacity: 0 })
286
+ ] })
287
+ ] }),
288
+ // The multi-hue field drifts (rotates slowly) so the colors melt.
289
+ body: /* @__PURE__ */ c("g", { clipPath: `url(#${i}-c)`, children: [
290
+ /* @__PURE__ */ e("circle", { cx: 50, cy: 50, r: 33, fill: t.pink }),
291
+ /* @__PURE__ */ c("g", { filter: `url(#${i}-b)`, children: [
292
+ /* @__PURE__ */ e("ellipse", { cx: 50, cy: 24, rx: 27, ry: 23, fill: t.crimson }),
293
+ /* @__PURE__ */ e("ellipse", { cx: 40, cy: 20, rx: 14, ry: 12, fill: t.rust }),
294
+ /* @__PURE__ */ e("ellipse", { cx: 26, cy: 52, rx: 22, ry: 26, fill: t.magenta }),
295
+ /* @__PURE__ */ e("ellipse", { cx: 74, cy: 50, rx: 23, ry: 25, fill: t.amber }),
296
+ /* @__PURE__ */ e("ellipse", { cx: 80, cy: 60, rx: 12, ry: 12, fill: t.yellow }),
297
+ /* @__PURE__ */ e("ellipse", { cx: 50, cy: 78, rx: 27, ry: 22, fill: t.cyan }),
298
+ /* @__PURE__ */ e("ellipse", { cx: 62, cy: 70, rx: 14, ry: 12, fill: t.pink })
299
+ ] })
300
+ ] }),
301
+ over: /* @__PURE__ */ e("circle", { cx: 50, cy: 50, r: 33, fill: `url(#${i}-sheen)` })
302
+ };
303
+ }
304
+ case "obsidian":
305
+ default: {
306
+ const t = C.obsidian, i = `${o}-obs`;
307
+ return {
308
+ defs: /* @__PURE__ */ c(y, { children: [
309
+ /* @__PURE__ */ c("linearGradient", { id: `${i}-b`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
310
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: t.hi }),
311
+ /* @__PURE__ */ e("stop", { offset: "34%", stopColor: t.body }),
312
+ /* @__PURE__ */ e("stop", { offset: "54%", stopColor: t.horizon }),
313
+ /* @__PURE__ */ e("stop", { offset: "72%", stopColor: t.body }),
314
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: t.low })
315
+ ] }),
316
+ /* @__PURE__ */ c("radialGradient", { id: `${i}-core`, cx: "0.42", cy: "0.4", r: "0.65", children: [
317
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: t.coreLite }),
318
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: t.coreDark })
319
+ ] }),
320
+ /* @__PURE__ */ e("filter", { id: `${i}-gl`, x: "-40%", y: "-40%", width: "180%", height: "180%", children: /* @__PURE__ */ e("feGaussianBlur", { stdDeviation: "2" }) }),
321
+ /* @__PURE__ */ e("clipPath", { id: `${i}-c`, children: /* @__PURE__ */ e("circle", { cx: 50, cy: 50, r: 32 }) })
322
+ ] }),
323
+ // Chrome body + gray crescent core + rim accents rotate …
324
+ body: /* @__PURE__ */ c("g", { clipPath: `url(#${i}-c)`, children: [
325
+ /* @__PURE__ */ e("circle", { cx: 50, cy: 50, r: 32, fill: `url(#${i}-b)` }),
326
+ /* @__PURE__ */ e(
327
+ "circle",
328
+ {
329
+ cx: 50,
330
+ cy: 51,
331
+ r: 20,
332
+ fill: "none",
333
+ stroke: t.coreLite,
334
+ strokeWidth: 2.5,
335
+ opacity: 0.8
336
+ }
337
+ ),
338
+ /* @__PURE__ */ e("circle", { cx: 51, cy: 53, r: 16, fill: `url(#${i}-core)` }),
339
+ /* @__PURE__ */ e("circle", { cx: 47, cy: 49, r: 14, fill: `url(#${i}-b)` }),
340
+ /* @__PURE__ */ e("circle", { cx: 73, cy: 58, r: 1.6, fill: t.rim, opacity: 0.5 }),
341
+ /* @__PURE__ */ e("circle", { cx: 30, cy: 64, r: 1.3, fill: t.rim, opacity: 0.4 })
342
+ ] }),
343
+ // … while the white gloss stays fixed (polished-chrome highlight).
344
+ over: /* @__PURE__ */ e(
345
+ "ellipse",
346
+ {
347
+ cx: 41,
348
+ cy: 37,
349
+ rx: 8,
350
+ ry: 5.5,
351
+ fill: t.gloss,
352
+ opacity: 0.85,
353
+ transform: "rotate(-25 41 37)",
354
+ filter: `url(#${i}-gl)`
355
+ }
356
+ )
357
+ };
358
+ }
359
+ }
360
+ }
361
+ const q = s.forwardRef(({ state: r, variant: o, className: t, ariaLabel: i }, n) => {
362
+ const p = s.useId().replace(/[:]/g, ""), d = ae(o, p), m = ne[r], g = C[o].accent, a = se[r], h = le[r], v = ce[o], k = h === "think" ? v.think : h === "idle" ? v.idle : h === "slow" ? v.idle * 0.4 : 0, x = k > 0, _ = x ? { duration: 360 / k, ease: "linear", repeat: 1 / 0 } : { duration: 0.2, ease: F };
363
+ return /* @__PURE__ */ e(Z, { reducedMotion: "user", children: /* @__PURE__ */ e(
364
+ B.div,
365
+ {
366
+ ref: n,
367
+ role: "img",
368
+ "aria-label": i ?? `AI voice, ${r}`,
369
+ "data-state": r,
370
+ "data-variant": o,
371
+ className: T(
372
+ "relative inline-flex size-16 shrink-0 items-center justify-center",
373
+ t
374
+ ),
375
+ animate: { scale: m.scale, opacity: m.opacity },
376
+ transition: {
377
+ scale: {
378
+ duration: m.duration,
379
+ ease: X,
380
+ repeat: 1 / 0,
381
+ repeatType: "loop"
382
+ },
383
+ opacity: { duration: 0.2, ease: F }
384
+ },
385
+ children: /* @__PURE__ */ c("svg", { viewBox: "0 0 100 100", className: "size-full", fill: "none", "aria-hidden": !0, children: [
386
+ d.defs && /* @__PURE__ */ e("defs", { children: d.defs }),
387
+ d.under,
388
+ a && Array.from({ length: a.count }).map((L, P) => /* @__PURE__ */ e(
389
+ B.rect,
390
+ {
391
+ x: 20,
392
+ y: 20,
393
+ width: 60,
394
+ height: 60,
395
+ rx: o === "command" ? 18 : 30,
396
+ fill: "none",
397
+ stroke: g,
398
+ strokeWidth: 2.5,
399
+ style: { transformBox: "fill-box", transformOrigin: "center" },
400
+ initial: { scale: 0.95, opacity: 0 },
401
+ animate: { scale: a.maxScale, opacity: [0, a.peak, 0] },
402
+ transition: {
403
+ duration: a.duration,
404
+ ease: F,
405
+ repeat: 1 / 0,
406
+ delay: P * (a.duration / 2)
407
+ }
408
+ },
409
+ P
410
+ )),
411
+ /* @__PURE__ */ e(
412
+ B.g,
413
+ {
414
+ style: { transformBox: "fill-box", transformOrigin: "center" },
415
+ animate: { rotate: x ? 360 : 0 },
416
+ transition: _,
417
+ children: d.body
418
+ }
419
+ ),
420
+ d.over
421
+ ] })
422
+ }
423
+ ) });
424
+ });
425
+ q.displayName = "PersonaVisual";
426
+ const H = {
427
+ default: [
428
+ [0.08, 0.78, 1],
429
+ [0.58, 0.24, 1],
430
+ [1, 0.16, 0.58]
431
+ ],
432
+ blue: [
433
+ [0.05, 0.82, 1],
434
+ [0.1, 0.38, 1],
435
+ [0.2, 0.08, 0.78]
436
+ ],
437
+ violet: [
438
+ [0.52, 0.18, 1],
439
+ [1, 0.22, 0.78],
440
+ [0.15, 0.75, 1]
441
+ ],
442
+ emerald: [
443
+ [0.08, 0.9, 0.55],
444
+ [0.05, 0.72, 1],
445
+ [0.68, 1, 0.15]
446
+ ],
447
+ sunset: [
448
+ [1, 0.42, 0.06],
449
+ [1, 0.12, 0.46],
450
+ [0.58, 0.18, 1]
451
+ ]
452
+ }, ue = {
453
+ default: 0.65,
454
+ blue: 0.3,
455
+ violet: 0.5,
456
+ emerald: 0.4,
457
+ sunset: 0.55
458
+ }, w = {
459
+ idle: { speed: 0.15, amplitude: 0.04, glow: 0.15, brightness: 0.55, pulse: 0, saturation: 0.7 },
460
+ connecting: { speed: 0.5, amplitude: 0.1, glow: 0.45, brightness: 0.75, pulse: 1, saturation: 0.9 },
461
+ listening: { speed: 0.4, amplitude: 0.14, glow: 0.5, brightness: 0.85, pulse: 0, saturation: 1 },
462
+ speaking: { speed: 1.4, amplitude: 0.35, glow: 0.9, brightness: 1, pulse: 0, saturation: 1 },
463
+ muted: { speed: 0.06, amplitude: 0.015, glow: 0.08, brightness: 0.35, pulse: 0, saturation: 0.2 }
464
+ }, U = {
465
+ idle: w.idle,
466
+ connecting: w.connecting,
467
+ listening: w.listening,
468
+ thinking: w.connecting,
469
+ speaking: w.speaking,
470
+ muted: w.muted,
471
+ asleep: { ...w.idle, brightness: 0.35, speed: 0.08 }
472
+ }, de = `#version 300 es
473
+ in vec2 a_position;
474
+ out vec2 v_uv;
475
+ void main() {
476
+ v_uv = a_position * 0.5 + 0.5;
477
+ gl_Position = vec4(a_position, 0.0, 1.0);
478
+ }`, fe = `#version 300 es
479
+ precision highp float;
480
+
481
+ in vec2 v_uv;
482
+ out vec4 fragColor;
483
+
484
+ uniform float u_time;
485
+ uniform float u_speed;
486
+ uniform float u_amplitude;
487
+ uniform float u_glow;
488
+ uniform float u_brightness;
489
+ uniform float u_pulse;
490
+ uniform float u_saturation;
491
+ uniform vec3 u_color0;
492
+ uniform vec3 u_color1;
493
+ uniform vec3 u_color2;
494
+ uniform float u_dpr;
495
+
496
+ // Simplex-like noise (3D)
497
+ vec3 mod289(vec3 x) { return x - floor(x / 289.0) * 289.0; }
498
+ vec4 mod289(vec4 x) { return x - floor(x / 289.0) * 289.0; }
499
+ vec4 permute(vec4 x) { return mod289((x * 34.0 + 1.0) * x); }
500
+ vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }
501
+
502
+ float snoise(vec3 v) {
503
+ const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);
504
+ vec3 i = floor(v + dot(v, vec3(C.y)));
505
+ vec3 x0 = v - i + dot(i, vec3(C.x));
506
+ vec3 g = step(x0.yzx, x0.xyz);
507
+ vec3 l = 1.0 - g;
508
+ vec3 i1 = min(g, l.zxy);
509
+ vec3 i2 = max(g, l.zxy);
510
+ vec3 x1 = x0 - i1 + C.x;
511
+ vec3 x2 = x0 - i2 + C.y;
512
+ vec3 x3 = x0 - 0.5;
513
+ i = mod289(i);
514
+ vec4 p = permute(permute(permute(
515
+ i.z + vec4(0.0, i1.z, i2.z, 1.0))
516
+ + i.y + vec4(0.0, i1.y, i2.y, 1.0))
517
+ + i.x + vec4(0.0, i1.x, i2.x, 1.0));
518
+ vec4 j = p - 49.0 * floor(p / 49.0);
519
+ vec4 x_ = floor(j / 7.0);
520
+ vec4 y_ = floor(j - 7.0 * x_);
521
+ vec4 x = (x_ * 2.0 + 0.5) / 7.0 - 1.0;
522
+ vec4 y = (y_ * 2.0 + 0.5) / 7.0 - 1.0;
523
+ vec4 h = 1.0 - abs(x) - abs(y);
524
+ vec4 b0 = vec4(x.xy, y.xy);
525
+ vec4 b1 = vec4(x.zw, y.zw);
526
+ vec4 s0 = floor(b0) * 2.0 + 1.0;
527
+ vec4 s1 = floor(b1) * 2.0 + 1.0;
528
+ vec4 sh = -step(h, vec4(0.0));
529
+ vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
530
+ vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
531
+ vec3 g0 = vec3(a0.xy, h.x);
532
+ vec3 g1 = vec3(a0.zw, h.y);
533
+ vec3 g2 = vec3(a1.xy, h.z);
534
+ vec3 g3 = vec3(a1.zw, h.w);
535
+ vec4 norm = taylorInvSqrt(vec4(dot(g0,g0), dot(g1,g1), dot(g2,g2), dot(g3,g3)));
536
+ g0 *= norm.x; g1 *= norm.y; g2 *= norm.z; g3 *= norm.w;
537
+ vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);
538
+ m = m * m;
539
+ return 42.0 * dot(m * m, vec4(dot(g0,x0), dot(g1,x1), dot(g2,x2), dot(g3,x3)));
540
+ }
541
+
542
+ void main() {
543
+ vec2 uv = v_uv * 2.0 - 1.0;
544
+ float dist = length(uv);
545
+ float t = u_time * u_speed;
546
+
547
+ // Perfect circle — hard boundary, soft anti-aliased edge
548
+ float radius = 0.44;
549
+ float circle = 1.0 - smoothstep(radius - 0.008, radius + 0.008, dist);
550
+
551
+ if (circle < 0.001) {
552
+ // Outer glow only
553
+ float glowDist = dist - radius;
554
+ float glow = exp(-glowDist * 12.0) * u_glow * 0.4;
555
+ vec3 glowColor = mix(u_color0, u_color1, 0.5);
556
+ fragColor = vec4(glowColor * glow, glow);
557
+ return;
558
+ }
559
+
560
+ float n1 = snoise(vec3(uv * 2.0, t * 0.6)) * 0.5 + 0.5;
561
+ float n2 = snoise(vec3(uv * 3.5 + 7.0, t * 0.9)) * 0.5 + 0.5;
562
+ float n3 = snoise(vec3(uv * 1.5 - 3.0, t * 0.4 + 10.0)) * 0.5 + 0.5;
563
+
564
+ vec2 distort = vec2(
565
+ snoise(vec3(uv * 2.0 + 5.0, t * 0.7)),
566
+ snoise(vec3(uv * 2.0 + 15.0, t * 0.7))
567
+ ) * u_amplitude * 2.0;
568
+ float n4 = snoise(vec3((uv + distort) * 3.0, t * 0.5)) * 0.5 + 0.5;
569
+
570
+ vec3 col = mix(u_color0, u_color1, n1);
571
+ col = mix(col, u_color2, n2 * 0.5);
572
+ col = mix(col, u_color1 * 1.3, n4 * 0.4);
573
+
574
+ float vein = pow(n3, 3.0) * u_amplitude * 6.0;
575
+ col += vein * mix(u_color1, vec3(1.0), 0.3);
576
+
577
+ float centerDist = dist / radius;
578
+ float depthShade = 1.0 - centerDist * centerDist * 0.4;
579
+ col *= depthShade;
580
+
581
+ float rim = pow(centerDist, 4.0) * 0.6;
582
+ col += rim * mix(u_color0, vec3(1.0), 0.5);
583
+
584
+ vec2 lightPos = vec2(-0.15, -0.18);
585
+ float specDist = length(uv - lightPos);
586
+ float spec = exp(-specDist * specDist * 30.0) * 0.7;
587
+ col += spec * vec3(1.0);
588
+
589
+ vec2 lightPos2 = vec2(0.2, 0.25);
590
+ float spec2 = exp(-length(uv - lightPos2) * 8.0) * 0.15;
591
+ col += spec2 * u_color1;
592
+
593
+ float pulseFactor = 1.0 + u_pulse * sin(u_time * 3.5) * 0.35;
594
+
595
+ float lum = dot(col, vec3(0.299, 0.587, 0.114));
596
+ col = mix(vec3(lum), col, u_saturation);
597
+
598
+ col *= u_brightness * pulseFactor;
599
+
600
+ fragColor = vec4(col, circle);
601
+ }`;
602
+ function W(r, o, t) {
603
+ const i = r.createShader(o);
604
+ return i ? (r.shaderSource(i, t), r.compileShader(i), r.getShaderParameter(i, r.COMPILE_STATUS) ? i : (r.deleteShader(i), null)) : null;
605
+ }
606
+ function pe(r) {
607
+ const o = r.getContext("webgl2", {
608
+ alpha: !0,
609
+ premultipliedAlpha: !1,
610
+ antialias: !0
611
+ });
612
+ if (!o) return null;
613
+ const t = W(o, o.VERTEX_SHADER, de), i = W(o, o.FRAGMENT_SHADER, fe);
614
+ if (!t || !i) return null;
615
+ const n = o.createProgram();
616
+ if (o.attachShader(n, t), o.attachShader(n, i), o.linkProgram(n), !o.getProgramParameter(n, o.LINK_STATUS)) return null;
617
+ o.useProgram(n);
618
+ const p = o.createBuffer();
619
+ o.bindBuffer(o.ARRAY_BUFFER, p), o.bufferData(
620
+ o.ARRAY_BUFFER,
621
+ new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]),
622
+ o.STATIC_DRAW
623
+ );
624
+ const d = o.getAttribLocation(n, "a_position");
625
+ o.enableVertexAttribArray(d), o.vertexAttribPointer(d, 2, o.FLOAT, !1, 0, 0), o.enable(o.BLEND), o.blendFunc(o.SRC_ALPHA, o.ONE_MINUS_SRC_ALPHA);
626
+ const m = {
627
+ u_time: o.getUniformLocation(n, "u_time"),
628
+ u_speed: o.getUniformLocation(n, "u_speed"),
629
+ u_amplitude: o.getUniformLocation(n, "u_amplitude"),
630
+ u_glow: o.getUniformLocation(n, "u_glow"),
631
+ u_brightness: o.getUniformLocation(n, "u_brightness"),
632
+ u_pulse: o.getUniformLocation(n, "u_pulse"),
633
+ u_saturation: o.getUniformLocation(n, "u_saturation"),
634
+ u_color0: o.getUniformLocation(n, "u_color0"),
635
+ u_color1: o.getUniformLocation(n, "u_color1"),
636
+ u_color2: o.getUniformLocation(n, "u_color2"),
637
+ u_dpr: o.getUniformLocation(n, "u_dpr")
638
+ };
639
+ return { gl: o, uniforms: m };
640
+ }
641
+ function E(r, o, t) {
642
+ return r + (o - r) * t;
643
+ }
644
+ const me = s.memo(function({
645
+ state: o,
646
+ palette: t,
647
+ volume: i,
648
+ reduced: n
649
+ }) {
650
+ const p = s.useRef(0);
651
+ p.current = i;
652
+ const d = s.useRef(n);
653
+ d.current = n;
654
+ const m = s.useRef(null), g = s.useRef(null), a = s.useRef(0), h = s.useRef(performance.now()), v = s.useRef({ ...U.idle }), k = s.useRef({ ...U.idle });
655
+ s.useEffect(() => {
656
+ k.current = { ...U[o] };
657
+ }, [o]);
658
+ const x = H[t], _ = s.useRef(x);
659
+ _.current = x;
660
+ const [L, P] = s.useState(!1);
661
+ s.useEffect(() => {
662
+ const b = requestAnimationFrame(() => P(!0));
663
+ return () => {
664
+ cancelAnimationFrame(b), P(!1);
665
+ };
666
+ }, []);
667
+ const D = s.useCallback(() => {
668
+ const b = g.current;
669
+ if (!b) return;
670
+ const { gl: l, uniforms: f } = b, A = m.current;
671
+ if (!A) return;
672
+ const u = v.current, S = k.current, R = 0.045;
673
+ u.speed = E(u.speed, S.speed, R), u.amplitude = E(u.amplitude, S.amplitude, R), u.glow = E(u.glow, S.glow, R), u.brightness = E(u.brightness, S.brightness, R), u.pulse = E(u.pulse, S.pulse, R), u.saturation = E(u.saturation, S.saturation, R);
674
+ const Y = (performance.now() - h.current) / 1e3, z = window.devicePixelRatio || 1, M = A.getBoundingClientRect(), O = Math.round(M.width * z), I = Math.round(M.height * z);
675
+ (A.width !== O || A.height !== I) && (A.width = O, A.height = I), l.viewport(0, 0, O, I), l.clearColor(0, 0, 0, 0), l.clear(l.COLOR_BUFFER_BIT);
676
+ const $ = d.current ? 0 : 1, N = p.current * $, V = _.current;
677
+ l.uniform1f(f.u_time, Y), l.uniform1f(f.u_speed, (u.speed + N * 0.4) * $), l.uniform1f(f.u_amplitude, (u.amplitude + N * 0.12) * $), l.uniform1f(f.u_glow, u.glow + N * 0.2), l.uniform1f(f.u_brightness, u.brightness), l.uniform1f(f.u_pulse, u.pulse * $), l.uniform1f(f.u_saturation, u.saturation), l.uniform3fv(f.u_color0, V[0]), l.uniform3fv(f.u_color1, V[1]), l.uniform3fv(f.u_color2, V[2]), l.uniform1f(f.u_dpr, z), l.drawArrays(l.TRIANGLE_STRIP, 0, 4), a.current = requestAnimationFrame(D);
678
+ }, []);
679
+ return s.useEffect(() => {
680
+ if (!L) return;
681
+ const b = m.current;
682
+ if (b && (g.current = pe(b), !!g.current))
683
+ return a.current = requestAnimationFrame(D), () => {
684
+ cancelAnimationFrame(a.current);
685
+ const l = g.current;
686
+ if (l) {
687
+ const f = l.gl.getExtension("WEBGL_lose_context");
688
+ f == null || f.loseContext();
689
+ }
690
+ g.current = null;
691
+ };
692
+ }, [L, D]), /* @__PURE__ */ e("canvas", { ref: m, className: "size-full", "data-state": o });
693
+ }), ge = s.forwardRef(
694
+ ({
695
+ state: r = "idle",
696
+ variant: o = "orb",
697
+ className: t,
698
+ volume: i = 0,
699
+ palette: n = "default",
700
+ onReady: p,
701
+ "aria-label": d,
702
+ ...m
703
+ }, g) => {
704
+ const a = re.includes(o) ? o : "orb", h = K() ?? !1, v = Math.min(1, Math.max(0, i));
705
+ if (s.useEffect(() => {
706
+ p == null || p();
707
+ }, []), a === "orb" || a === "aura" || a === "wave") {
708
+ const x = H[n][0], _ = ue[n], L = a === "orb" ? /* @__PURE__ */ e(
709
+ me,
710
+ {
711
+ state: r,
712
+ palette: n,
713
+ volume: v,
714
+ reduced: h
715
+ }
716
+ ) : a === "aura" ? /* @__PURE__ */ e(
717
+ J,
718
+ {
719
+ state: r,
720
+ volume: v,
721
+ reduced: h,
722
+ color: x,
723
+ colorShift: _
724
+ }
725
+ ) : /* @__PURE__ */ e(
726
+ Q,
727
+ {
728
+ state: r,
729
+ volume: v,
730
+ reduced: h,
731
+ color: x,
732
+ colorShift: _
733
+ }
734
+ );
735
+ return /* @__PURE__ */ e(
736
+ "div",
737
+ {
738
+ ...m,
739
+ ref: g,
740
+ role: "img",
741
+ "aria-label": d ?? `AI voice, ${r}`,
742
+ "data-state": r,
743
+ "data-variant": a,
744
+ className: T(
745
+ "relative inline-flex size-16 shrink-0 items-center justify-center",
746
+ t
747
+ ),
748
+ children: L
749
+ }
750
+ );
751
+ }
752
+ return /* @__PURE__ */ e(
753
+ q,
754
+ {
755
+ ref: g,
756
+ state: r,
757
+ variant: a,
758
+ className: t,
759
+ ariaLabel: d
760
+ }
761
+ );
762
+ }
763
+ );
764
+ ge.displayName = "Voice";
765
+ const he = {
766
+ idle: "bg-muted-foreground",
767
+ connecting: "bg-warning motion-safe:animate-pulse",
768
+ listening: "bg-success",
769
+ thinking: "bg-warning motion-safe:animate-pulse",
770
+ speaking: "bg-success",
771
+ muted: "bg-danger",
772
+ asleep: "bg-muted-foreground opacity-50"
773
+ };
774
+ function ve({ state: r = "idle", className: o }) {
775
+ return /* @__PURE__ */ e(
776
+ "span",
777
+ {
778
+ "aria-hidden": !0,
779
+ className: T(
780
+ "inline-block size-2.5 shrink-0 rounded-dot transition-[background-color,opacity] duration-(--duration-normal) ease-out motion-reduce:transition-none",
781
+ he[r],
782
+ o
783
+ )
784
+ }
785
+ );
786
+ }
787
+ function xe({
788
+ onConnect: r,
789
+ disabled: o,
790
+ className: t
791
+ }) {
792
+ return /* @__PURE__ */ e(
793
+ G,
794
+ {
795
+ variant: "solid",
796
+ size: "sm",
797
+ disabled: o,
798
+ onClick: r,
799
+ startContent: /* @__PURE__ */ e(ee, {}),
800
+ className: t,
801
+ children: "Connect"
802
+ }
803
+ );
804
+ }
805
+ function ye({
806
+ isMuted: r = !1,
807
+ onMute: o,
808
+ onUnmute: t,
809
+ disabled: i,
810
+ className: n
811
+ }) {
812
+ return /* @__PURE__ */ e(j, { content: r ? "Unmute" : "Mute", children: /* @__PURE__ */ e(
813
+ G,
814
+ {
815
+ variant: "ghost",
816
+ size: "icon-sm",
817
+ disabled: i,
818
+ "aria-label": r ? "Unmute" : "Mute",
819
+ onClick: () => r ? t == null ? void 0 : t() : o == null ? void 0 : o(),
820
+ className: n,
821
+ children: r ? /* @__PURE__ */ e(te, {}) : /* @__PURE__ */ e(ie, {})
822
+ }
823
+ ) });
824
+ }
825
+ function _e({
826
+ onDisconnect: r,
827
+ disabled: o,
828
+ className: t
829
+ }) {
830
+ return /* @__PURE__ */ e(j, { content: "Disconnect", children: /* @__PURE__ */ e(
831
+ G,
832
+ {
833
+ variant: "ghost",
834
+ size: "icon-sm",
835
+ disabled: o,
836
+ "aria-label": "Disconnect",
837
+ onClick: r,
838
+ className: T("text-danger hover:text-danger", t),
839
+ children: /* @__PURE__ */ e(oe, {})
840
+ }
841
+ ) });
842
+ }
843
+ function be(r, o) {
844
+ return r === "ended" ? "idle" : r === "starting" ? "connecting" : o ? "muted" : "listening";
845
+ }
846
+ function De({
847
+ status: r,
848
+ isMuted: o = !1,
849
+ onConnect: t,
850
+ onMute: i,
851
+ onUnmute: n,
852
+ onDisconnect: p,
853
+ className: d
854
+ }) {
855
+ return /* @__PURE__ */ c("div", { className: T("flex items-center gap-2", d), children: [
856
+ /* @__PURE__ */ e(ve, { state: be(r, o) }),
857
+ r === "ended" && /* @__PURE__ */ e(xe, { onConnect: t }),
858
+ r === "starting" && /* @__PURE__ */ e("span", { className: "text-base text-secondary", children: "Connecting…" }),
859
+ r === "running" && /* @__PURE__ */ c(y, { children: [
860
+ /* @__PURE__ */ e(ye, { isMuted: o, onMute: i, onUnmute: n }),
861
+ /* @__PURE__ */ e(_e, { onDisconnect: p })
862
+ ] })
863
+ ] });
864
+ }
865
+ export {
866
+ Te as VOICE_PALETTES,
867
+ $e as VOICE_STATES,
868
+ re as VOICE_VARIANTS,
869
+ ge as Voice,
870
+ xe as VoiceConnectButton,
871
+ De as VoiceControl,
872
+ _e as VoiceDisconnectButton,
873
+ ye as VoiceMuteButton,
874
+ ve as VoiceStatusDot
875
+ };