@ganeshdole/brainbox-widget 0.0.0-stage → 0.2.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.
package/dist/index.js ADDED
@@ -0,0 +1,1357 @@
1
+ import { memo as e, useCallback as t, useEffect as n, useMemo as r, useRef as i, useState as a, useSyncExternalStore as o } from "react";
2
+ import { createPortal as s } from "react-dom";
3
+ import { BrainboxProvider as c, useBrainbox as l, useDraft as u } from "@ganeshdole/brainbox-react";
4
+ import { DEFAULT_COLOR as d, FONT_STACK as f, MARK_COLORS as p, STROKE_WIDTH as m, TEXT_HALO as h, TEXT_HALO_WIDTH as g, TEXT_SIZE as _, arrowHead as v, boundsOf as y, canSessionRecord as b, createBrainbox as x, hitTest as S, isDegenerate as C, nextColor as w, normalizeBox as T, penPath as E, preloadCapture as D, shouldKeepPoint as O, startAudioRecording as k } from "@ganeshdole/brainbox-core";
5
+ import { ArrowUpRight as A, Camera as j, Check as M, ImageOff as N, Loader2 as P, MessageSquarePlus as ee, Mic as F, MicOff as te, MousePointer2 as I, Pause as L, Pencil as R, Play as ne, Send as re, Square as z, Trash2 as B, Type as V, Undo2 as ie, Video as ae, X as H } from "lucide-react";
6
+ import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
7
+ import { createRoot as oe } from "react-dom/client";
8
+ //#region src/lib/widget-store.ts
9
+ function se() {
10
+ let e = !1, t = null, n = /* @__PURE__ */ new Set(), r = () => {
11
+ for (let e of n) e();
12
+ }, i = (t) => {
13
+ t !== e && (e = t, r());
14
+ };
15
+ return {
16
+ isOpen: () => e,
17
+ subscribe(e) {
18
+ return n.add(e), () => n.delete(e);
19
+ },
20
+ open: () => i(!0),
21
+ start(n) {
22
+ t = n, e ? r() : i(!0);
23
+ },
24
+ takeStart() {
25
+ let e = t;
26
+ return t = null, e;
27
+ },
28
+ close: () => {
29
+ t = null, i(!1);
30
+ }
31
+ };
32
+ }
33
+ var ce = /* @__PURE__ */ new WeakMap();
34
+ function K(e) {
35
+ let t = ce.get(e);
36
+ return t || (t = se(), ce.set(e, t)), t;
37
+ }
38
+ var le = {
39
+ isOpen: () => !1,
40
+ subscribe: () => () => {},
41
+ open: () => {},
42
+ start: () => {},
43
+ takeStart: () => null,
44
+ close: () => {}
45
+ };
46
+ //#endregion
47
+ //#region src/lib/position.ts
48
+ function q(e) {
49
+ switch (e) {
50
+ case "bottom-left": return "bottom-5 left-5";
51
+ case "top-right": return "top-5 right-5";
52
+ case "top-left": return "top-5 left-5";
53
+ default: return "bottom-5 right-5";
54
+ }
55
+ }
56
+ //#endregion
57
+ //#region src/components/Launcher.tsx
58
+ function ue({ position: e, onClick: t }) {
59
+ return /* @__PURE__ */ W("button", {
60
+ onClick: t,
61
+ "aria-label": "Send feedback",
62
+ className: `fixed ${q(e)} z-[2147483647] flex h-12 w-12 items-center justify-center rounded-full bg-brand text-on-brand shadow-button transition hover:bg-brand-hover`,
63
+ children: /* @__PURE__ */ W(ee, { className: "h-5 w-5" })
64
+ });
65
+ }
66
+ //#endregion
67
+ //#region src/components/Chooser.tsx
68
+ function de({ position: e, canRecord: t, onScreenshot: n, onRecord: r, onCancel: i }) {
69
+ return /* @__PURE__ */ G("div", {
70
+ className: `fixed ${q(e)} z-[2147483647] w-72 rounded-2xl border border-default bg-elevated p-4 shadow-3xl`,
71
+ children: [
72
+ /* @__PURE__ */ G("div", {
73
+ className: "mb-3 flex items-center justify-between",
74
+ children: [/* @__PURE__ */ W("span", {
75
+ className: "text-sm font-medium text-emphasis",
76
+ children: "Send feedback"
77
+ }), /* @__PURE__ */ W("button", {
78
+ onClick: i,
79
+ "aria-label": "Close",
80
+ className: "text-muted hover:text-emphasis",
81
+ children: /* @__PURE__ */ W(H, { className: "h-4 w-4" })
82
+ })]
83
+ }),
84
+ /* @__PURE__ */ G("button", {
85
+ onClick: n,
86
+ className: "mb-2 flex w-full items-center gap-3 rounded-xl border border-default bg-interactive p-3 text-left hover:bg-interactive-hover",
87
+ children: [/* @__PURE__ */ W(j, { className: "h-5 w-5 shrink-0 text-emphasis" }), /* @__PURE__ */ G("span", { children: [/* @__PURE__ */ W("span", {
88
+ className: "block text-sm font-medium text-emphasis",
89
+ children: "Screenshot"
90
+ }), /* @__PURE__ */ W("span", {
91
+ className: "block text-xs text-muted",
92
+ children: "Mark up the page, then talk it through"
93
+ })] })]
94
+ }),
95
+ t && /* @__PURE__ */ G("button", {
96
+ onClick: r,
97
+ className: "flex w-full items-center gap-3 rounded-xl border border-default bg-interactive p-3 text-left hover:bg-interactive-hover",
98
+ children: [/* @__PURE__ */ W(ae, { className: "h-5 w-5 shrink-0 text-emphasis" }), /* @__PURE__ */ G("span", { children: [/* @__PURE__ */ W("span", {
99
+ className: "block text-sm font-medium text-emphasis",
100
+ children: "Record"
101
+ }), /* @__PURE__ */ W("span", {
102
+ className: "block text-xs text-muted",
103
+ children: "Capture your actions · voice optional"
104
+ })] })]
105
+ }),
106
+ /* @__PURE__ */ G("a", {
107
+ href: "https://www.brainbox.sh?ref=widget",
108
+ target: "_blank",
109
+ rel: "noopener noreferrer",
110
+ className: "mt-3 block text-center text-xs text-muted hover:text-emphasis",
111
+ children: ["Powered by ", /* @__PURE__ */ W("span", {
112
+ className: "font-medium",
113
+ children: "Brainbox"
114
+ })]
115
+ })
116
+ ]
117
+ });
118
+ }
119
+ //#endregion
120
+ //#region src/lib/scroll-lock.ts
121
+ var fe = /* @__PURE__ */ new Set([
122
+ " ",
123
+ "PageUp",
124
+ "PageDown",
125
+ "Home",
126
+ "End",
127
+ "ArrowUp",
128
+ "ArrowDown",
129
+ "ArrowLeft",
130
+ "ArrowRight"
131
+ ]);
132
+ function pe(e, t) {
133
+ return fe.has(e) ? t instanceof HTMLElement ? e === " " && (t instanceof HTMLButtonElement || t.getAttribute("role") === "button") ? !1 : !(t.isContentEditable || t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement) : !0 : !1;
134
+ }
135
+ function me(e = window) {
136
+ let t = e.scrollX, n = e.scrollY, r = (e) => {
137
+ e.cancelable && e.preventDefault();
138
+ }, i = (e) => {
139
+ pe(e.key, e.composedPath()[0] ?? null) && e.preventDefault();
140
+ }, a = () => {
141
+ (e.scrollX !== t || e.scrollY !== n) && e.scrollTo(t, n);
142
+ }, o = {
143
+ capture: !0,
144
+ passive: !1
145
+ };
146
+ return e.addEventListener("wheel", r, o), e.addEventListener("touchmove", r, o), e.addEventListener("keydown", i, !0), e.addEventListener("scroll", a), () => {
147
+ e.removeEventListener("wheel", r, o), e.removeEventListener("touchmove", r, o), e.removeEventListener("keydown", i, !0), e.removeEventListener("scroll", a);
148
+ };
149
+ }
150
+ //#endregion
151
+ //#region src/lib/use-drawing.ts
152
+ function he(e) {
153
+ return e === "box" || e === "arrow" || e === "pen";
154
+ }
155
+ var ge = 0, J = () => `m${++ge}`;
156
+ function _e({ color: e, onCommit: r }) {
157
+ let [o, s] = a(null), c = i(null), l = i(null), u = i(0), d = t(() => {
158
+ u.current ||= requestAnimationFrame(() => {
159
+ u.current = 0, s(c.current ? { ...c.current } : null);
160
+ });
161
+ }, []);
162
+ return n(() => () => cancelAnimationFrame(u.current), []), {
163
+ draft: o,
164
+ begin: t((t, n) => {
165
+ let r = {
166
+ x: n.clientX,
167
+ y: n.clientY
168
+ };
169
+ try {
170
+ n.currentTarget.setPointerCapture(n.pointerId);
171
+ } catch {}
172
+ l.current = r, c.current = t === "box" ? {
173
+ kind: "box",
174
+ id: J(),
175
+ color: e,
176
+ ...T(r, r)
177
+ } : t === "arrow" ? {
178
+ kind: "arrow",
179
+ id: J(),
180
+ color: e,
181
+ x1: r.x,
182
+ y1: r.y,
183
+ x2: r.x,
184
+ y2: r.y
185
+ } : {
186
+ kind: "pen",
187
+ id: J(),
188
+ color: e,
189
+ points: [r]
190
+ }, d();
191
+ }, [e, d]),
192
+ extend: t((e) => {
193
+ let t = l.current, n = c.current;
194
+ if (!(!t || !n)) {
195
+ if (n.kind === "pen") {
196
+ let t = e.nativeEvent.getCoalescedEvents?.() ?? [e.nativeEvent];
197
+ for (let e of t) {
198
+ let t = {
199
+ x: e.clientX,
200
+ y: e.clientY
201
+ };
202
+ O(n.points[n.points.length - 1], t) && n.points.push(t);
203
+ }
204
+ } else {
205
+ let r = {
206
+ x: e.clientX,
207
+ y: e.clientY
208
+ };
209
+ n.kind === "box" ? Object.assign(n, T(t, r)) : n.kind === "arrow" && Object.assign(n, {
210
+ x2: r.x,
211
+ y2: r.y
212
+ });
213
+ }
214
+ d();
215
+ }
216
+ }, [d]),
217
+ finish: t(() => {
218
+ l.current = null, cancelAnimationFrame(u.current), u.current = 0;
219
+ let e = c.current;
220
+ c.current = null, s(null), e && !C(e) && r(e);
221
+ }, [r])
222
+ };
223
+ }
224
+ //#endregion
225
+ //#region src/components/MarkShape.tsx
226
+ var Y = e(function({ mark: e }) {
227
+ switch (e.kind) {
228
+ case "box": return /* @__PURE__ */ W("rect", {
229
+ x: e.x,
230
+ y: e.y,
231
+ width: e.width,
232
+ height: e.height,
233
+ fill: "none",
234
+ stroke: e.color,
235
+ strokeWidth: m
236
+ });
237
+ case "arrow": {
238
+ let [t, n, r] = v(e);
239
+ return /* @__PURE__ */ G("g", { children: [/* @__PURE__ */ W("line", {
240
+ x1: e.x1,
241
+ y1: e.y1,
242
+ x2: e.x2,
243
+ y2: e.y2,
244
+ stroke: e.color,
245
+ strokeWidth: m,
246
+ strokeLinecap: "round"
247
+ }), /* @__PURE__ */ W("polygon", {
248
+ points: `${t.x},${t.y} ${n.x},${n.y} ${r.x},${r.y}`,
249
+ fill: e.color
250
+ })] });
251
+ }
252
+ case "pen": return /* @__PURE__ */ W("path", {
253
+ d: E(e),
254
+ fill: "none",
255
+ stroke: e.color,
256
+ strokeWidth: m,
257
+ strokeLinecap: "round",
258
+ strokeLinejoin: "round"
259
+ });
260
+ case "text": return /* @__PURE__ */ W("text", {
261
+ x: e.x,
262
+ y: e.y,
263
+ fill: e.color,
264
+ stroke: h,
265
+ strokeWidth: g,
266
+ paintOrder: "stroke",
267
+ fontFamily: f,
268
+ fontSize: _,
269
+ fontWeight: 700,
270
+ children: e.text
271
+ });
272
+ }
273
+ });
274
+ function ve({ at: e, color: t, onChange: r, onCommit: a, onCancel: o }) {
275
+ let s = i(null);
276
+ return n(() => {
277
+ let e = requestAnimationFrame(() => s.current?.focus());
278
+ return () => cancelAnimationFrame(e);
279
+ }, []), /* @__PURE__ */ W("input", {
280
+ ref: s,
281
+ autoFocus: !0,
282
+ value: e.value,
283
+ onChange: (e) => r(e.target.value),
284
+ onPointerDown: (e) => e.stopPropagation(),
285
+ onKeyDown: (e) => {
286
+ e.key === "Enter" && (e.preventDefault(), a()), e.key === "Escape" && (e.preventDefault(), o());
287
+ },
288
+ placeholder: "Type a note",
289
+ className: "absolute bg-transparent font-bold outline-none placeholder:font-normal placeholder:opacity-60",
290
+ style: {
291
+ left: e.x,
292
+ top: e.y - _,
293
+ color: t,
294
+ fontFamily: f,
295
+ fontSize: _,
296
+ textShadow: `0 0 3px ${h}, 0 0 3px ${h}`,
297
+ minWidth: 160
298
+ }
299
+ });
300
+ }
301
+ //#endregion
302
+ //#region src/components/MarkupToolbar.tsx
303
+ var ye = [
304
+ {
305
+ tool: "select",
306
+ label: "Select",
307
+ key: "v",
308
+ Icon: I
309
+ },
310
+ {
311
+ tool: "box",
312
+ label: "Box",
313
+ key: "r",
314
+ Icon: z
315
+ },
316
+ {
317
+ tool: "arrow",
318
+ label: "Arrow",
319
+ key: "a",
320
+ Icon: A
321
+ },
322
+ {
323
+ tool: "pen",
324
+ label: "Draw",
325
+ key: "p",
326
+ Icon: R
327
+ },
328
+ {
329
+ tool: "text",
330
+ label: "Text",
331
+ key: "t",
332
+ Icon: V
333
+ }
334
+ ];
335
+ function be({ tool: e, color: t, canUndo: r, canDelete: o, onTool: s, onColor: c, onUndo: l, onDelete: u, onCancel: d, onDone: f }) {
336
+ let [m, h] = a(!1), g = i(null);
337
+ return n(() => {
338
+ if (!m) return;
339
+ let e = (e) => {
340
+ g.current?.contains(e.target) || h(!1);
341
+ };
342
+ return window.addEventListener("pointerdown", e, !0), () => window.removeEventListener("pointerdown", e, !0);
343
+ }, [m]), /* @__PURE__ */ W("div", {
344
+ className: "pointer-events-none absolute inset-x-0 bottom-6 flex justify-center",
345
+ children: /* @__PURE__ */ G("div", {
346
+ onPointerDown: (e) => e.stopPropagation(),
347
+ className: "pointer-events-auto flex items-center gap-1 rounded-2xl border border-default bg-elevated p-1.5 shadow-3xl",
348
+ children: [
349
+ /* @__PURE__ */ W(Z, {
350
+ label: "Cancel (Esc)",
351
+ onClick: d,
352
+ children: /* @__PURE__ */ W(H, { className: "h-4 w-4" })
353
+ }),
354
+ /* @__PURE__ */ W(X, {}),
355
+ ye.map(({ tool: t, label: n, key: r, Icon: i }) => /* @__PURE__ */ W("button", {
356
+ type: "button",
357
+ title: `${n} (${r})`,
358
+ "aria-label": n,
359
+ "aria-pressed": t === e,
360
+ onClick: () => s(t),
361
+ className: `flex h-9 w-9 items-center justify-center rounded-xl transition-colors ${t === e ? "bg-brand text-on-brand" : "text-default hover:bg-interactive-hover hover:text-emphasis"}`,
362
+ children: /* @__PURE__ */ W(i, { className: "h-4 w-4" })
363
+ }, t)),
364
+ /* @__PURE__ */ W(X, {}),
365
+ /* @__PURE__ */ G("div", {
366
+ ref: g,
367
+ className: "relative",
368
+ children: [/* @__PURE__ */ W("button", {
369
+ type: "button",
370
+ title: "Colour (c)",
371
+ "aria-label": "Colour",
372
+ "aria-expanded": m,
373
+ onClick: () => h((e) => !e),
374
+ className: "flex h-9 w-9 items-center justify-center rounded-xl hover:bg-interactive-hover",
375
+ children: /* @__PURE__ */ W("span", {
376
+ className: "h-5 w-5 rounded-full border border-default",
377
+ style: { background: t }
378
+ })
379
+ }), m && /* @__PURE__ */ W("div", {
380
+ className: "absolute bottom-11 right-0 flex items-center gap-1 rounded-xl border border-default bg-elevated p-1.5 shadow-3xl",
381
+ children: p.map((e) => /* @__PURE__ */ W("button", {
382
+ type: "button",
383
+ title: e,
384
+ "aria-label": `Colour ${e}`,
385
+ "aria-pressed": e === t,
386
+ onClick: () => {
387
+ c(e), h(!1);
388
+ },
389
+ className: `flex h-7 w-7 items-center justify-center rounded-lg hover:bg-interactive-hover ${e === t ? "bg-interactive" : ""}`,
390
+ children: /* @__PURE__ */ W("span", {
391
+ className: "h-5 w-5 rounded-full border border-default",
392
+ style: { background: e }
393
+ })
394
+ }, e))
395
+ })]
396
+ }),
397
+ /* @__PURE__ */ W(Z, {
398
+ label: "Undo (⌘Z)",
399
+ disabled: !r,
400
+ onClick: l,
401
+ children: /* @__PURE__ */ W(ie, { className: "h-4 w-4" })
402
+ }),
403
+ /* @__PURE__ */ W(Z, {
404
+ label: "Delete (⌫)",
405
+ disabled: !o,
406
+ onClick: u,
407
+ children: /* @__PURE__ */ W(B, { className: "h-4 w-4" })
408
+ }),
409
+ /* @__PURE__ */ W(X, {}),
410
+ /* @__PURE__ */ W("button", {
411
+ type: "button",
412
+ onClick: f,
413
+ className: "flex h-9 items-center gap-1.5 rounded-xl bg-brand px-4 text-sm font-medium text-on-brand shadow-button hover:bg-brand-hover",
414
+ children: "Next"
415
+ })
416
+ ]
417
+ })
418
+ });
419
+ }
420
+ var X = () => /* @__PURE__ */ W("span", { className: "mx-1 h-6 w-px shrink-0 bg-subtle" });
421
+ function Z({ label: e, disabled: t, onClick: n, children: r }) {
422
+ return /* @__PURE__ */ W("button", {
423
+ type: "button",
424
+ title: e,
425
+ "aria-label": e,
426
+ disabled: t,
427
+ onClick: n,
428
+ className: "flex h-9 w-9 items-center justify-center rounded-xl text-default hover:bg-interactive-hover hover:text-emphasis disabled:opacity-30 disabled:hover:bg-transparent",
429
+ children: r
430
+ });
431
+ }
432
+ //#endregion
433
+ //#region src/components/MarkupOverlay.tsx
434
+ var xe = {
435
+ v: "select",
436
+ r: "box",
437
+ a: "arrow",
438
+ p: "pen",
439
+ t: "text"
440
+ };
441
+ function Se({ frozenUrl: e, pending: i, failed: o, onDone: s, onCancel: c }) {
442
+ let [l, u] = a("box"), [f, p] = a(d), [m, h] = a([]), [g, _] = a([]), [v, b] = a(null), [x, T] = a(null), E = t((e) => {
443
+ _((e) => [...e, m]), h(e);
444
+ }, [m]), D = t(() => {
445
+ let e = g[g.length - 1];
446
+ e && (_(g.slice(0, -1)), h(e), b(null));
447
+ }, [g]), O = t(() => {
448
+ v && (E(m.filter((e) => e.id !== v)), b(null));
449
+ }, [
450
+ E,
451
+ m,
452
+ v
453
+ ]), k = t(() => {
454
+ if (!x) return null;
455
+ let e = {
456
+ kind: "text",
457
+ id: J(),
458
+ color: f,
459
+ x: x.x,
460
+ y: x.y,
461
+ text: x.value
462
+ };
463
+ return C(e) ? null : e;
464
+ }, [f, x]), A = t(() => {
465
+ let e = k();
466
+ T(null), e && E([...m, e]);
467
+ }, [
468
+ E,
469
+ m,
470
+ k
471
+ ]);
472
+ n(() => me(), []), n(() => {
473
+ let e = (e) => {
474
+ if (x) {
475
+ e.key === "Escape" && (e.preventDefault(), T(null));
476
+ return;
477
+ }
478
+ if (e.key === "Escape") {
479
+ e.preventDefault(), c();
480
+ return;
481
+ }
482
+ if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "z") {
483
+ e.preventDefault(), D();
484
+ return;
485
+ }
486
+ if (e.key === "Backspace" || e.key === "Delete") {
487
+ e.preventDefault(), O();
488
+ return;
489
+ }
490
+ if (e.metaKey || e.ctrlKey || e.altKey) return;
491
+ if (e.key.toLowerCase() === "c") {
492
+ e.preventDefault(), p(w);
493
+ return;
494
+ }
495
+ let t = xe[e.key.toLowerCase()];
496
+ t && (e.preventDefault(), u(t));
497
+ };
498
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
499
+ }, [
500
+ c,
501
+ O,
502
+ x,
503
+ D
504
+ ]);
505
+ let { draft: j, begin: M, extend: ee, finish: F } = _e({
506
+ color: f,
507
+ onCommit: t((e) => E([...m, e]), [E, m])
508
+ }), te = (e) => {
509
+ if (x) {
510
+ A();
511
+ return;
512
+ }
513
+ if (l === "select") {
514
+ b(S(m, {
515
+ x: e.clientX,
516
+ y: e.clientY
517
+ }));
518
+ return;
519
+ }
520
+ if (l === "text") {
521
+ T({
522
+ x: e.clientX,
523
+ y: e.clientY,
524
+ value: ""
525
+ });
526
+ return;
527
+ }
528
+ he(l) && (b(null), M(l, e));
529
+ }, I = r(() => m.map((e) => /* @__PURE__ */ W(Y, { mark: e }, e.id)), [m]), L = r(() => {
530
+ let e = m.find((e) => e.id === v);
531
+ return e ? y(e) : null;
532
+ }, [m, v]);
533
+ return /* @__PURE__ */ G("div", {
534
+ className: `fixed inset-0 z-[2147483647] touch-none select-none overflow-hidden ${l === "select" ? "cursor-default" : l === "text" ? "cursor-text" : "cursor-crosshair"}`,
535
+ onPointerDown: te,
536
+ onPointerMove: ee,
537
+ onPointerUp: F,
538
+ onPointerCancel: F,
539
+ children: [
540
+ e ? /* @__PURE__ */ W("img", {
541
+ src: e,
542
+ alt: "",
543
+ "aria-hidden": "true",
544
+ draggable: !1,
545
+ className: "absolute inset-0 h-full w-full"
546
+ }) : /* @__PURE__ */ W("div", { className: "absolute inset-0 bg-black/30" }),
547
+ /* @__PURE__ */ G("svg", {
548
+ className: "pointer-events-none absolute inset-0 h-full w-full",
549
+ "aria-hidden": "true",
550
+ children: [
551
+ I,
552
+ j && /* @__PURE__ */ W(Y, { mark: j }),
553
+ L && /* @__PURE__ */ W("rect", {
554
+ x: L.x - 4,
555
+ y: L.y - 4,
556
+ width: L.width + 8,
557
+ height: L.height + 8,
558
+ fill: "none",
559
+ stroke: "#ffffff",
560
+ strokeWidth: 1,
561
+ strokeDasharray: "4 3"
562
+ })
563
+ ]
564
+ }),
565
+ x && /* @__PURE__ */ W(ve, {
566
+ at: x,
567
+ color: f,
568
+ onChange: (e) => T({
569
+ ...x,
570
+ value: e
571
+ }),
572
+ onCommit: A,
573
+ onCancel: () => T(null)
574
+ }),
575
+ /* @__PURE__ */ W("div", {
576
+ className: "pointer-events-none absolute inset-x-0 bottom-24 flex justify-center",
577
+ children: i ? /* @__PURE__ */ G("span", {
578
+ className: "flex items-center gap-2 rounded-full bg-elevated px-3 py-1 text-xs text-default",
579
+ children: [/* @__PURE__ */ W(P, { className: "h-3.5 w-3.5 animate-spin" }), " Freezing the page"]
580
+ }) : o ? /* @__PURE__ */ G("span", {
581
+ className: "flex items-center gap-2 rounded-full bg-warning px-3 py-1 text-xs text-warning",
582
+ children: [/* @__PURE__ */ W(N, { className: "h-3.5 w-3.5" }), " Couldn't grab the screenshot - your note still sends"]
583
+ }) : /* @__PURE__ */ W("span", {
584
+ className: "rounded-full bg-elevated px-3 py-1 text-xs text-muted",
585
+ children: "This is a snapshot of the page. Mark what's wrong, or hit Next"
586
+ })
587
+ }),
588
+ /* @__PURE__ */ W(be, {
589
+ tool: l,
590
+ color: f,
591
+ canUndo: g.length > 0,
592
+ canDelete: !!v,
593
+ onTool: (e) => {
594
+ A(), u(e), b(null);
595
+ },
596
+ onColor: p,
597
+ onUndo: D,
598
+ onDelete: O,
599
+ onCancel: c,
600
+ onDone: () => {
601
+ let e = k();
602
+ T(null), s(e ? [...m, e] : m);
603
+ }
604
+ })
605
+ ]
606
+ });
607
+ }
608
+ //#endregion
609
+ //#region src/lib/time.ts
610
+ function Ce(e) {
611
+ let t = Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 0;
612
+ return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
613
+ }
614
+ //#endregion
615
+ //#region src/components/RecordOverlay.tsx
616
+ var we = [
617
+ {
618
+ tool: "box",
619
+ label: "Box",
620
+ Icon: z
621
+ },
622
+ {
623
+ tool: "arrow",
624
+ label: "Arrow",
625
+ Icon: A
626
+ },
627
+ {
628
+ tool: "pen",
629
+ label: "Draw",
630
+ Icon: R
631
+ },
632
+ {
633
+ tool: "text",
634
+ label: "Text",
635
+ Icon: V
636
+ }
637
+ ];
638
+ function Te({ annotations: e, onStop: r, micActive: o, onMuteChange: s }) {
639
+ let [c, l] = a(0), [u, f] = a(null), [p, m] = a(d), [h, g] = a(null), [_, v] = a(!1), [y, b] = a(!1), [x, S] = a(0), C = i(o);
640
+ n(() => {
641
+ C.current = o;
642
+ }, [o]);
643
+ let T = i(s);
644
+ n(() => {
645
+ T.current = s;
646
+ }, [s]), n(() => {
647
+ v(C.current());
648
+ let e = setInterval(() => {
649
+ l((e) => e + 1), v(C.current());
650
+ }, 1e3);
651
+ return () => clearInterval(e);
652
+ }, []), n(() => {
653
+ T.current(y);
654
+ }, [y]);
655
+ let E = t((t) => {
656
+ e.show(t), S(e.count());
657
+ }, [e]), D = t(() => {
658
+ e.undo(), S(e.count());
659
+ }, [e]), O = t(() => {
660
+ e.clear(), S(e.count());
661
+ }, [e]), { draft: k, begin: A, extend: j, finish: M } = _e({
662
+ color: p,
663
+ onCommit: E
664
+ }), N = t(() => {
665
+ if (!h) return;
666
+ let t = h.value.trim();
667
+ g(null), t && (e.show({
668
+ kind: "text",
669
+ id: J(),
670
+ color: p,
671
+ x: h.x,
672
+ y: h.y,
673
+ text: t
674
+ }), S(e.count()));
675
+ }, [
676
+ e,
677
+ p,
678
+ h
679
+ ]);
680
+ return n(() => {
681
+ if (!u) return;
682
+ let e = (e) => {
683
+ e.key === "Escape" && (e.preventDefault(), h ? g(null) : f(null));
684
+ };
685
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
686
+ }, [u, h]), /* @__PURE__ */ G(U, { children: [u && /* @__PURE__ */ G("div", {
687
+ className: `fixed inset-0 z-[2147483646] touch-none select-none ${u === "text" ? "cursor-text" : "cursor-crosshair"}`,
688
+ onPointerDown: (e) => {
689
+ if (h) {
690
+ N();
691
+ return;
692
+ }
693
+ if (u === "text") {
694
+ g({
695
+ x: e.clientX,
696
+ y: e.clientY,
697
+ value: ""
698
+ });
699
+ return;
700
+ }
701
+ he(u) && A(u, e);
702
+ },
703
+ onPointerMove: j,
704
+ onPointerUp: M,
705
+ onPointerCancel: M,
706
+ children: [/* @__PURE__ */ W("svg", {
707
+ className: "pointer-events-none absolute inset-0 h-full w-full",
708
+ "aria-hidden": "true",
709
+ children: k && /* @__PURE__ */ W(Y, { mark: k })
710
+ }), h && /* @__PURE__ */ W(ve, {
711
+ at: h,
712
+ color: p,
713
+ onChange: (e) => g({
714
+ ...h,
715
+ value: e
716
+ }),
717
+ onCommit: N,
718
+ onCancel: () => g(null)
719
+ })]
720
+ }), /* @__PURE__ */ W("div", {
721
+ className: "pointer-events-none fixed inset-x-0 bottom-6 z-[2147483647] flex justify-center",
722
+ children: /* @__PURE__ */ G("div", {
723
+ className: "pointer-events-auto flex items-center gap-1 rounded-full border border-default bg-elevated px-3 py-2 shadow-3xl",
724
+ children: [
725
+ /* @__PURE__ */ G("span", {
726
+ className: "ml-1 flex items-center gap-2 text-sm text-emphasis",
727
+ children: [/* @__PURE__ */ W("span", {
728
+ className: "h-2.5 w-2.5 animate-pulse rounded-full",
729
+ style: { background: "#ef4444" }
730
+ }), /* @__PURE__ */ W("span", {
731
+ className: "font-mono",
732
+ children: Ce(c)
733
+ })]
734
+ }),
735
+ /* @__PURE__ */ G("button", {
736
+ type: "button",
737
+ onClick: () => b((e) => !e),
738
+ disabled: !_,
739
+ title: _ ? y ? "Voice off - click to record narration again" : "Voice on - click to mute" : "No mic - the recording has no voice",
740
+ "aria-pressed": !y && _,
741
+ className: `flex h-8 items-center gap-1.5 rounded-full px-2.5 text-xs transition-colors disabled:opacity-40 ${_ && !y ? "bg-interactive text-emphasis" : "text-muted hover:bg-interactive-hover hover:text-emphasis"}`,
742
+ children: [W(_ && !y ? F : te, { className: "h-3.5 w-3.5" }), _ && !y ? "Voice on" : "Voice off"]
743
+ }),
744
+ /* @__PURE__ */ W("span", { className: "mx-1 h-5 w-px bg-subtle" }),
745
+ /* @__PURE__ */ W(Ee, {
746
+ label: "Use the page",
747
+ active: u === null,
748
+ onClick: () => {
749
+ N(), f(null);
750
+ },
751
+ children: /* @__PURE__ */ W(I, { className: "h-4 w-4" })
752
+ }),
753
+ we.map(({ tool: e, label: t, Icon: n }) => /* @__PURE__ */ W(Ee, {
754
+ label: t,
755
+ active: u === e,
756
+ onClick: () => {
757
+ N(), f(e);
758
+ },
759
+ children: /* @__PURE__ */ W(n, { className: "h-4 w-4" })
760
+ }, e)),
761
+ /* @__PURE__ */ W("button", {
762
+ type: "button",
763
+ title: "Colour",
764
+ "aria-label": "Colour",
765
+ onClick: () => m(w),
766
+ className: "flex h-8 w-8 items-center justify-center rounded-full hover:bg-interactive-hover",
767
+ children: /* @__PURE__ */ W("span", {
768
+ className: "h-4 w-4 rounded-full border border-default",
769
+ style: { background: p }
770
+ })
771
+ }),
772
+ /* @__PURE__ */ W(De, {
773
+ label: "Undo last mark",
774
+ disabled: x === 0,
775
+ onClick: D,
776
+ children: /* @__PURE__ */ W(ie, { className: "h-4 w-4" })
777
+ }),
778
+ /* @__PURE__ */ W(De, {
779
+ label: "Clear all marks",
780
+ disabled: x === 0,
781
+ onClick: O,
782
+ children: /* @__PURE__ */ W(B, { className: "h-4 w-4" })
783
+ }),
784
+ /* @__PURE__ */ W("span", { className: "mx-1 h-5 w-px bg-subtle" }),
785
+ /* @__PURE__ */ G("button", {
786
+ onClick: r,
787
+ className: "ml-1 flex items-center gap-1.5 rounded-full bg-brand px-3 py-1 text-xs font-medium text-on-brand hover:bg-brand-hover",
788
+ children: [/* @__PURE__ */ W(z, { className: "h-3 w-3" }), " Stop"]
789
+ })
790
+ ]
791
+ })
792
+ })] });
793
+ }
794
+ function Ee({ label: e, active: t, onClick: n, children: r }) {
795
+ return /* @__PURE__ */ W("button", {
796
+ type: "button",
797
+ title: e,
798
+ "aria-label": e,
799
+ "aria-pressed": t,
800
+ onClick: n,
801
+ className: `flex h-8 w-8 items-center justify-center rounded-full transition-colors ${t ? "bg-brand text-on-brand" : "text-default hover:bg-interactive-hover hover:text-emphasis"}`,
802
+ children: r
803
+ });
804
+ }
805
+ function De({ label: e, disabled: t, onClick: n, children: r }) {
806
+ return /* @__PURE__ */ W("button", {
807
+ type: "button",
808
+ title: e,
809
+ "aria-label": e,
810
+ disabled: t,
811
+ onClick: n,
812
+ className: "flex h-8 w-8 items-center justify-center rounded-full text-default hover:bg-interactive-hover hover:text-emphasis disabled:opacity-30 disabled:hover:bg-transparent",
813
+ children: r
814
+ });
815
+ }
816
+ //#endregion
817
+ //#region src/lib/multiband.ts
818
+ var Oe = -100, ke = -10;
819
+ function Ae(e) {
820
+ return Number.isFinite(e) ? Math.sqrt(1 - Math.max(Oe, Math.min(ke, e)) * -1 / 100) : 0;
821
+ }
822
+ function je(e, t, n, r) {
823
+ if (t <= 0) return [];
824
+ let i = Math.max(0, Math.min(n, e.length)), a = Math.max(i, Math.min(r, e.length));
825
+ if (a === i) return Array.from({ length: t }, () => 0);
826
+ let o = Math.max(1, Math.ceil((a - i) / t));
827
+ return Array.from({ length: t }, (t, n) => {
828
+ let r = i + n * o, s = Math.min(r + o, a), c = 0, l = 0;
829
+ for (let t = r; t < s; t += 1) {
830
+ let n = e[t];
831
+ n !== void 0 && (c += Ae(n), l += 1);
832
+ }
833
+ return l === 0 ? 0 : c / l;
834
+ });
835
+ }
836
+ function Me(e, t, n = .01) {
837
+ return e.length === t.length ? e.some((e, r) => Math.abs(e - (t[r] ?? 0)) > n) : !0;
838
+ }
839
+ var Ne = 5;
840
+ function Pe(e) {
841
+ return Ne + Math.min(1, Math.max(0, e)) * (100 - Ne);
842
+ }
843
+ function Fe(e) {
844
+ let t = 0;
845
+ for (let n of e) n > t && (t = n);
846
+ return t;
847
+ }
848
+ function Ie(e, t) {
849
+ return t <= 0 ? [] : e.length === 0 ? Array.from({ length: t }, () => 0) : Array.from({ length: t }, (n, r) => {
850
+ let i = Math.floor(r * e.length / t), a = Math.max(i + 1, Math.floor((r + 1) * e.length / t)), o = 0, s = 0;
851
+ for (let t = i; t < a && t < e.length; t += 1) {
852
+ let n = e[t];
853
+ n !== void 0 && (o += n, s += 1);
854
+ }
855
+ return s === 0 ? 0 : o / s;
856
+ });
857
+ }
858
+ //#endregion
859
+ //#region src/lib/use-multiband.ts
860
+ var Le = {
861
+ bands: 24,
862
+ loPass: 2,
863
+ hiPass: 110,
864
+ updateInterval: 32,
865
+ fftSize: 2048
866
+ };
867
+ function Re(e, t = {}) {
868
+ let { bands: o, loPass: s, hiPass: c, updateInterval: l, fftSize: u } = {
869
+ ...Le,
870
+ ...t
871
+ }, d = r(() => Array.from({ length: o }, () => 0), [o]), [f, p] = a(d), m = i(d);
872
+ return n(() => {
873
+ if (m.current = d, !e || typeof AudioContext > "u") return;
874
+ let t, n;
875
+ try {
876
+ t = new AudioContext(), n = t.createAnalyser(), n.fftSize = u, t.createMediaStreamSource(e).connect(n);
877
+ } catch {
878
+ return;
879
+ }
880
+ let r = new Float32Array(n.frequencyBinCount), i = 0, a = 0, f = (e) => {
881
+ if (i = requestAnimationFrame(f), e - a < l) return;
882
+ a = e, n.getFloatFrequencyData(r);
883
+ let t = je(r, o, s, c);
884
+ Me(t, m.current) && (m.current = t, p(t));
885
+ };
886
+ return i = requestAnimationFrame(f), () => {
887
+ cancelAnimationFrame(i), n.disconnect(), t.close().catch(() => {});
888
+ };
889
+ }, [
890
+ e,
891
+ o,
892
+ s,
893
+ c,
894
+ l,
895
+ u,
896
+ d
897
+ ]), e ? f : d;
898
+ }
899
+ //#endregion
900
+ //#region src/components/BarVisualizer.tsx
901
+ var ze = e(function({ levels: e, dimFrom: t }) {
902
+ return /* @__PURE__ */ W("span", {
903
+ className: "flex h-8 flex-1 items-center justify-center gap-[2px] overflow-hidden",
904
+ "aria-hidden": "true",
905
+ children: e.map((e, n) => /* @__PURE__ */ W(Be, {
906
+ height: Pe(e),
907
+ dim: t !== void 0 && n >= t
908
+ }, n))
909
+ });
910
+ }), Be = e(function({ height: e, dim: t }) {
911
+ return /* @__PURE__ */ W("span", {
912
+ className: "w-[2px] shrink-0 rounded-[1px] transition-[height,opacity] duration-75",
913
+ style: {
914
+ height: `${e}%`,
915
+ background: "var(--text-emphasis)",
916
+ opacity: t ? .25 : 1
917
+ }
918
+ });
919
+ }), Q = 32, Ve = 120;
920
+ function He({ onChange: e }) {
921
+ let [r, o] = a("idle"), [s, c] = a(null), [l, u] = a([]), [d, f] = a(0), [p, m] = a(""), [h, g] = a(""), [_, v] = a(!1), [y, b] = a(0), x = i(null), S = i(null), C = i([]), w = Re(r === "recording" ? s : null, { bands: Q }), T = t(async () => {
922
+ let t = x.current;
923
+ if (t) {
924
+ x.current = null, c(null);
925
+ try {
926
+ let n = await t.stop();
927
+ u(C.current), g(URL.createObjectURL(n)), o("recorded"), e(n);
928
+ } catch {
929
+ m("Recording failed - try again"), o("idle");
930
+ }
931
+ }
932
+ }, [e]), E = async () => {
933
+ m("");
934
+ try {
935
+ let e = await k();
936
+ x.current = e, C.current = [], c(e.stream), u([]), f(0), b(0), o("recording");
937
+ } catch {
938
+ m("Mic blocked - allow microphone access, or type instead");
939
+ }
940
+ }, D = () => {
941
+ S.current?.pause(), v(!1), b(0), g(""), C.current = [], u([]), f(0), o("idle"), e(null);
942
+ }, O = () => {
943
+ let e = S.current;
944
+ e && (e.paused ? e.play().catch(() => m("Playback unavailable")) : e.pause());
945
+ };
946
+ n(() => {
947
+ r === "recording" && C.current.push(Fe(w));
948
+ }, [w, r]), n(() => {
949
+ if (r !== "recording") return;
950
+ let e = Date.now(), t = setInterval(() => {
951
+ let t = Math.floor((Date.now() - e) / 1e3);
952
+ f(t), t >= Ve && T();
953
+ }, 250);
954
+ return () => clearInterval(t);
955
+ }, [r, T]), n(() => {
956
+ if (h) return () => URL.revokeObjectURL(h);
957
+ }, [h]), n(() => () => {
958
+ let e = x.current;
959
+ x.current = null, e && e.stop().catch(() => {});
960
+ }, []);
961
+ let A = r === "recorded";
962
+ return /* @__PURE__ */ G("div", {
963
+ className: "flex items-center gap-3 px-3 py-2.5",
964
+ children: [
965
+ /* @__PURE__ */ W("button", {
966
+ onClick: r === "recording" ? () => void T() : A ? O : E,
967
+ "aria-label": r === "recording" ? "Stop recording" : A ? _ ? "Pause" : "Play voice note" : "Record a voice note",
968
+ className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-full transition-colors ${r === "recording" ? "bg-error text-error ring-2 ring-error" : "bg-brand text-on-brand shadow-button hover:bg-brand-hover"}`,
969
+ children: r === "recording" ? /* @__PURE__ */ W(z, { className: "h-3.5 w-3.5 fill-current" }) : A ? W(_ ? L : ne, { className: "h-3.5 w-3.5 fill-current" }) : /* @__PURE__ */ W(F, { className: "h-4 w-4" })
970
+ }),
971
+ r === "idle" ? /* @__PURE__ */ W("span", {
972
+ className: "min-w-0 flex-1 truncate text-left text-sm",
973
+ children: p ? /* @__PURE__ */ W("span", {
974
+ className: "text-error",
975
+ children: p
976
+ }) : /* @__PURE__ */ W("span", {
977
+ className: "text-emphasis",
978
+ children: "Say what went wrong"
979
+ })
980
+ }) : /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(ze, {
981
+ levels: A ? Ie(l, Q) : w,
982
+ dimFrom: A && _ ? Math.round(y * Q) : void 0
983
+ }), /* @__PURE__ */ W("span", {
984
+ className: "shrink-0 font-mono text-xs text-default",
985
+ children: Ce(d)
986
+ })] }),
987
+ A && /* @__PURE__ */ W("button", {
988
+ onClick: D,
989
+ "aria-label": "Delete voice note",
990
+ className: "shrink-0 text-muted hover:text-error",
991
+ children: /* @__PURE__ */ W(B, { className: "h-4 w-4" })
992
+ }),
993
+ r !== "idle" && p && /* @__PURE__ */ W("span", {
994
+ className: "shrink-0 text-xs text-error",
995
+ children: p
996
+ }),
997
+ h && /* @__PURE__ */ W("audio", {
998
+ ref: S,
999
+ src: h,
1000
+ className: "hidden",
1001
+ onPlay: () => v(!0),
1002
+ onPause: () => v(!1),
1003
+ onEnded: () => {
1004
+ v(!1), b(0);
1005
+ },
1006
+ onTimeUpdate: (e) => {
1007
+ let t = e.currentTarget;
1008
+ d > 0 && b(Math.min(1, t.currentTime / d));
1009
+ }
1010
+ })
1011
+ ]
1012
+ });
1013
+ }
1014
+ //#endregion
1015
+ //#region src/components/Composer.tsx
1016
+ function Ue({ screenshotUrl: e, videoUrl: t, sessionReady: n, voiceCaptured: r, capturePending: i, captureFailed: o, position: s, onCancel: c, onSubmit: l }) {
1017
+ let [u, d] = a(""), [f, p] = a(null), m = !!t || !!r, [h, g] = a(m), _ = !o || !!u.trim() || !!f || m || !!n;
1018
+ return /* @__PURE__ */ G("div", {
1019
+ className: `fixed ${q(s)} z-[2147483647] w-96 rounded-2xl border border-default bg-elevated p-4 shadow-3xl`,
1020
+ children: [
1021
+ /* @__PURE__ */ G("div", {
1022
+ className: "mb-3 flex items-center justify-between",
1023
+ children: [/* @__PURE__ */ W("span", {
1024
+ className: "text-sm font-medium text-emphasis",
1025
+ children: "Send feedback"
1026
+ }), /* @__PURE__ */ W("button", {
1027
+ onClick: c,
1028
+ "aria-label": "Close",
1029
+ className: "text-muted hover:text-emphasis",
1030
+ children: /* @__PURE__ */ W(H, { className: "h-4 w-4" })
1031
+ })]
1032
+ }),
1033
+ i ? /* @__PURE__ */ W("div", {
1034
+ className: "mb-3 flex h-40 items-center justify-center rounded-lg border border-default bg-interactive",
1035
+ children: /* @__PURE__ */ G("span", {
1036
+ className: "flex items-center gap-2 text-xs text-muted",
1037
+ children: [/* @__PURE__ */ W(P, { className: "h-3.5 w-3.5 animate-spin" }), " Grabbing the screenshot"]
1038
+ })
1039
+ }) : o ? /* @__PURE__ */ G("p", {
1040
+ className: "mb-3 flex items-center gap-2 rounded-lg border border-warning-subtle bg-warning p-3 text-xs text-warning",
1041
+ children: [/* @__PURE__ */ W(N, { className: "h-3.5 w-3.5 shrink-0" }), " Couldn't grab the screenshot - your note still gets through."]
1042
+ }) : t ? /* @__PURE__ */ W("video", {
1043
+ controls: !0,
1044
+ src: t,
1045
+ className: "mb-3 max-h-48 w-full rounded-lg border border-default"
1046
+ }) : n && e ? /* @__PURE__ */ G("div", {
1047
+ className: "relative mb-3 overflow-hidden rounded-lg border border-default",
1048
+ children: [
1049
+ /* @__PURE__ */ W("img", {
1050
+ src: e,
1051
+ alt: "Recording preview",
1052
+ className: "max-h-44 w-full bg-canvas object-contain"
1053
+ }),
1054
+ /* @__PURE__ */ W("span", {
1055
+ className: "absolute inset-0 flex items-center justify-center",
1056
+ children: /* @__PURE__ */ W("span", {
1057
+ className: "flex h-10 w-10 items-center justify-center rounded-full bg-black/60 backdrop-blur-sm",
1058
+ children: /* @__PURE__ */ W(ne, { className: "h-4 w-4 text-white" })
1059
+ })
1060
+ }),
1061
+ /* @__PURE__ */ G("span", {
1062
+ className: "absolute bottom-1.5 left-1.5 rounded-full bg-black/60 px-2 py-0.5 text-[10px] text-white backdrop-blur-sm",
1063
+ children: [
1064
+ "Recording",
1065
+ r ? " · voice" : "",
1066
+ " - replays in the dashboard"
1067
+ ]
1068
+ })
1069
+ ]
1070
+ }) : e ? /* @__PURE__ */ W("img", {
1071
+ src: e,
1072
+ alt: "Captured screenshot",
1073
+ className: "mb-3 max-h-44 w-full rounded-lg border border-default bg-canvas object-contain"
1074
+ }) : n ? /* @__PURE__ */ G("p", {
1075
+ className: "mb-3 rounded-lg border border-default bg-interactive p-3 text-xs text-default",
1076
+ children: [
1077
+ "✓ Session recorded",
1078
+ r ? " with voice" : "",
1079
+ " - it will replay in the dashboard."
1080
+ ]
1081
+ }) : null,
1082
+ /* @__PURE__ */ G("div", {
1083
+ className: "overflow-hidden rounded-xl border border-default bg-background focus-within:border-interactive",
1084
+ children: [!m && /* @__PURE__ */ W(He, { onChange: p }), h && /* @__PURE__ */ W("div", {
1085
+ className: m ? "" : "border-t border-subtle",
1086
+ children: /* @__PURE__ */ W("textarea", {
1087
+ value: u,
1088
+ maxLength: 1e4,
1089
+ autoFocus: !0,
1090
+ onChange: (e) => d(e.target.value),
1091
+ placeholder: m ? "Anything to add?" : "Describe what went wrong",
1092
+ className: "h-20 w-full resize-none bg-transparent p-3 text-sm text-default outline-none placeholder:text-placeholder"
1093
+ })
1094
+ })]
1095
+ }),
1096
+ !h && /* @__PURE__ */ G("button", {
1097
+ onClick: () => g(!0),
1098
+ className: "mt-2 flex items-center gap-1.5 text-xs text-default hover:text-emphasis",
1099
+ children: [/* @__PURE__ */ W(R, { className: "h-3 w-3" }), " Prefer to type?"]
1100
+ }),
1101
+ /* @__PURE__ */ G("button", {
1102
+ onClick: () => l(u, f),
1103
+ disabled: !_,
1104
+ className: "mt-3 flex w-full items-center justify-center gap-2 rounded-xl bg-brand py-2 text-sm font-medium text-on-brand shadow-button hover:bg-brand-hover disabled:opacity-40",
1105
+ children: [/* @__PURE__ */ W(re, { className: "h-4 w-4" }), " Send"]
1106
+ })
1107
+ ]
1108
+ });
1109
+ }
1110
+ //#endregion
1111
+ //#region src/components/Result.tsx
1112
+ var We = 3e3;
1113
+ function $({ kind: e, id: t, message: r, position: i, onClose: a }) {
1114
+ return n(() => {
1115
+ if (e !== "success" || !a) return;
1116
+ let t = setTimeout(a, We);
1117
+ return () => clearTimeout(t);
1118
+ }, [e, a]), /* @__PURE__ */ G("div", {
1119
+ className: `fixed ${q(i)} z-[2147483647] w-72 rounded-2xl border border-default bg-elevated p-4 shadow-3xl`,
1120
+ children: [
1121
+ e === "loading" && /* @__PURE__ */ G("p", {
1122
+ className: "flex items-center gap-2 text-sm text-default",
1123
+ children: [/* @__PURE__ */ W(P, { className: "h-4 w-4 animate-spin" }), " Sending…"]
1124
+ }),
1125
+ e === "success" && /* @__PURE__ */ G("div", { children: [
1126
+ /* @__PURE__ */ G("p", {
1127
+ className: "flex items-center gap-2 text-sm text-success",
1128
+ children: [/* @__PURE__ */ W(M, { className: "h-4 w-4" }), " Thanks! Feedback sent."]
1129
+ }),
1130
+ t && /* @__PURE__ */ G("p", {
1131
+ className: "mt-1 font-mono text-xs text-muted",
1132
+ children: ["#", t.slice(0, 8)]
1133
+ }),
1134
+ /* @__PURE__ */ W("button", {
1135
+ onClick: a,
1136
+ className: "mt-3 text-xs text-muted hover:text-emphasis",
1137
+ children: "Close"
1138
+ })
1139
+ ] }),
1140
+ e === "error" && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("p", {
1141
+ className: "flex items-center gap-2 text-sm text-error",
1142
+ children: [
1143
+ /* @__PURE__ */ W(H, { className: "h-4 w-4" }),
1144
+ " ",
1145
+ r ?? "Something went wrong"
1146
+ ]
1147
+ }), /* @__PURE__ */ W("button", {
1148
+ onClick: a,
1149
+ className: "mt-3 text-xs text-muted hover:text-emphasis",
1150
+ children: "Dismiss"
1151
+ })] })
1152
+ ]
1153
+ });
1154
+ }
1155
+ //#endregion
1156
+ //#region src/App.tsx
1157
+ function Ge({ brainbox: e, hostEl: o, trigger: s, position: c }) {
1158
+ let l = r(() => K(e), [e]), [d, f] = a(() => l.isOpen() ? "choosing" : "idle"), [p, m] = a(null), [h, g] = a(""), [_, v] = a(""), y = r(() => e.draft({ exclude: o }), [e, o]), x = u(y), S = t(() => {
1159
+ y.cancel(), m(null), f("idle"), g(""), v(""), l.close();
1160
+ }, [y, l]), C = d !== "idle";
1161
+ n(() => {
1162
+ C && D();
1163
+ }, [C]);
1164
+ let w = t(() => {
1165
+ y.captureScreenshot(), f("marking");
1166
+ }, [y]), T = t((e) => {
1167
+ y.markUp(e), f("composing");
1168
+ }, [y]), E = t(async (e) => {
1169
+ m(null);
1170
+ try {
1171
+ await e.stop(), f("composing");
1172
+ } catch (e) {
1173
+ g(e instanceof Error ? e.message : "Recording failed"), f("error");
1174
+ }
1175
+ }, []), O = t(() => {
1176
+ try {
1177
+ let e = y.startRecording({ onAutoStop: () => void E(e) });
1178
+ m(e), f("recording");
1179
+ } catch {
1180
+ f("choosing");
1181
+ }
1182
+ }, [y, E]), k = i(d);
1183
+ n(() => {
1184
+ k.current = d;
1185
+ }, [d]), n(() => {
1186
+ let e = () => {
1187
+ if (!l.isOpen()) return S();
1188
+ let e = l.takeStart();
1189
+ if (!e) return f((e) => e === "idle" ? "choosing" : e);
1190
+ k.current !== "idle" && k.current !== "choosing" || (e === "screenshot" ? w() : b() ? O() : f("choosing"));
1191
+ }, t = l.subscribe(e), n = !0;
1192
+ return queueMicrotask(() => {
1193
+ n && l.isOpen() && e();
1194
+ }), () => {
1195
+ n = !1, t();
1196
+ };
1197
+ }, [
1198
+ l,
1199
+ S,
1200
+ w,
1201
+ O
1202
+ ]);
1203
+ let A = t(async (e, t) => {
1204
+ f("submitting");
1205
+ try {
1206
+ let { id: n } = await y.submit({
1207
+ text: e,
1208
+ audio: t
1209
+ });
1210
+ v(n ?? ""), f("done");
1211
+ } catch (e) {
1212
+ g(e instanceof Error ? e.message : "Upload failed"), f("error");
1213
+ }
1214
+ }, [y]);
1215
+ return /* @__PURE__ */ G(U, { children: [
1216
+ s === "floating" && d === "idle" && /* @__PURE__ */ W(ue, {
1217
+ position: c,
1218
+ onClick: l.open
1219
+ }),
1220
+ d === "choosing" && /* @__PURE__ */ W(de, {
1221
+ position: c,
1222
+ canRecord: b(),
1223
+ onScreenshot: w,
1224
+ onRecord: O,
1225
+ onCancel: S
1226
+ }),
1227
+ d === "marking" && /* @__PURE__ */ W(Se, {
1228
+ frozenUrl: x.screenshotUrl ?? void 0,
1229
+ pending: x.screenshotPending,
1230
+ failed: x.screenshotFailed,
1231
+ onDone: T,
1232
+ onCancel: S
1233
+ }),
1234
+ d === "recording" && p && /* @__PURE__ */ W(Te, {
1235
+ annotations: p.annotations,
1236
+ onStop: () => void E(p),
1237
+ micActive: p.micActive,
1238
+ onMuteChange: p.setMicMuted
1239
+ }),
1240
+ d === "composing" && /* @__PURE__ */ W(Ue, {
1241
+ screenshotUrl: x.screenshotUrl ?? void 0,
1242
+ sessionReady: x.hasSession,
1243
+ voiceCaptured: x.hasVoice,
1244
+ capturePending: x.screenshotPending,
1245
+ captureFailed: x.screenshotFailed,
1246
+ position: c,
1247
+ onCancel: S,
1248
+ onSubmit: A
1249
+ }),
1250
+ d === "submitting" && /* @__PURE__ */ W($, {
1251
+ kind: "loading",
1252
+ position: c
1253
+ }),
1254
+ d === "done" && /* @__PURE__ */ W($, {
1255
+ kind: "success",
1256
+ id: _,
1257
+ position: c,
1258
+ onClose: S
1259
+ }),
1260
+ d === "error" && /* @__PURE__ */ W($, {
1261
+ kind: "error",
1262
+ message: h,
1263
+ position: c,
1264
+ onClose: S
1265
+ })
1266
+ ] });
1267
+ }
1268
+ //#endregion
1269
+ //#region src/lib/shadow-css.ts
1270
+ function Ke(e) {
1271
+ let t = [];
1272
+ for (let n of e.matchAll(/@property\s+(--[\w-]+)\s*\{([^}]*)\}/g)) {
1273
+ let e = n[1];
1274
+ if (!e) continue;
1275
+ let r = /initial-value:\s*([^;}]+)/.exec(n[2] ?? "");
1276
+ t.push(`${e}:${r?.[1]?.trim() ?? "initial"}`);
1277
+ }
1278
+ let n = e.replaceAll(":root", ":host");
1279
+ return t.length === 0 ? n : `${n}\n@layer properties{*,::before,::after,::backdrop{${t.join(";")}}}`;
1280
+ }
1281
+ //#endregion
1282
+ //#region src/lib/shadow-host.ts
1283
+ var qe = [
1284
+ "pointerdown",
1285
+ "pointerup",
1286
+ "mousedown",
1287
+ "mouseup",
1288
+ "click",
1289
+ "touchstart",
1290
+ "touchend"
1291
+ ];
1292
+ function Je(e) {
1293
+ e.stopPropagation();
1294
+ }
1295
+ function Ye(e) {
1296
+ let t = document.createElement("div");
1297
+ t.id = "brainbox-widget", t.classList.add("rr-block"), t.style.position = "relative", t.style.zIndex = "2147483647";
1298
+ for (let e of qe) t.addEventListener(e, Je);
1299
+ let n = t.attachShadow({ mode: "open" }), r = document.createElement("style");
1300
+ r.textContent = Ke(e), n.appendChild(r);
1301
+ let i = document.createElement("div");
1302
+ return i.className = "dark", n.appendChild(i), {
1303
+ element: t,
1304
+ container: i
1305
+ };
1306
+ }
1307
+ //#endregion
1308
+ //#region src/index.css?inline
1309
+ var Xe = "/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:\"Inter\", ui-sans-serif, system-ui, -apple-system, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-bold:700;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:\"Inter\", ui-sans-serif, system-ui, -apple-system, sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}.dark{color:var(--text-emphasis);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;letter-spacing:-.011em}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-x-0{inset-inline:0}.top-5{top:calc(var(--spacing) * 5)}.right-0{right:0}.right-5{right:calc(var(--spacing) * 5)}.bottom-1\\.5{bottom:calc(var(--spacing) * 1.5)}.bottom-5{bottom:calc(var(--spacing) * 5)}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-11{bottom:calc(var(--spacing) * 11)}.bottom-24{bottom:calc(var(--spacing) * 24)}.left-1\\.5{left:calc(var(--spacing) * 1.5)}.left-1\\/2{left:50%}.left-5{left:calc(var(--spacing) * 5)}.z-\\[2147483646\\]{z-index:2147483646}.z-\\[2147483647\\]{z-index:2147483647}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-1{margin-left:var(--spacing)}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.h-2\\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-20{height:calc(var(--spacing) * 20)}.h-40{height:calc(var(--spacing) * 40)}.h-full{height:100%}.max-h-44{max-height:calc(var(--spacing) * 44)}.max-h-48{max-height:calc(var(--spacing) * 48)}.w-2\\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-72{width:calc(var(--spacing) * 72)}.w-96{width:calc(var(--spacing) * 96)}.w-\\[2px\\]{width:2px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-crosshair{cursor:crosshair}.cursor-default{cursor:default}.cursor-text{cursor:text}.touch-none{touch-action:none}.resize-none{resize:none}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-\\[2px\\]{gap:2px}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[1px\\]{border-radius:1px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-default{border-color:var(--border-default)}.border-subtle{border-color:var(--border-subtle)}.border-warning-subtle{border-color:var(--border-warning-subtle)}.bg-background{background-color:var(--bg-background)}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab, red, red)){.bg-black\\/30{background-color:color-mix(in oklab, var(--color-black) 30%, transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-brand{background-color:var(--bg-brand)}.bg-canvas{background-color:var(--bg-canvas)}.bg-elevated{background-color:var(--bg-elevated)}.bg-error{background-color:var(--bg-error)}.bg-interactive{background-color:var(--bg-interactive)}.bg-subtle{background-color:var(--bg-subtle)}.bg-transparent{background-color:#0000}.bg-warning{background-color:var(--bg-warning)}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-default{color:var(--text-default)}.text-emphasis{color:var(--text-emphasis)}.text-error{color:var(--text-error)}.text-muted{color:var(--text-muted)}.text-on-brand{color:var(--text-on-brand)}.text-success{color:var(--text-success)}.text-warning{color:var(--text-warning)}.text-white{color:var(--color-white)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-3xl{--tw-shadow:0 16px 48px -12px var(--tw-shadow-color,#0009);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-button{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff1f), 0 1px 2px var(--tw-shadow-color,#0009);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-error{--tw-ring-color:var(--ring-error)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[height\\,opacity\\]{transition-property:height,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75{--tw-duration:75ms;transition-duration:75ms}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.placeholder\\:font-normal::placeholder{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.placeholder\\:text-placeholder::placeholder{color:var(--text-placeholder)}.placeholder\\:opacity-60::placeholder{opacity:.6}.focus-within\\:border-interactive:focus-within{border-color:var(--border-interactive)}@media (hover:hover){.hover\\:bg-brand-hover:hover{background-color:var(--bg-brand-hover)}.hover\\:bg-interactive-hover:hover{background-color:var(--bg-interactive-hover)}.hover\\:text-emphasis:hover{color:var(--text-emphasis)}.hover\\:text-error:hover{color:var(--text-error)}}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-40:disabled{opacity:.4}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}}:root,.light,.light-theme{--gray-1:#fcfcfc;--gray-2:#f9f9f9;--gray-3:#f0f0f0;--gray-4:#e8e8e8;--gray-5:#e0e0e0;--gray-6:#d9d9d9;--gray-7:#cecece;--gray-8:#bbb;--gray-9:#8d8d8d;--gray-10:#838383;--gray-11:#646464;--gray-12:#202020}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--gray-1:color(display-p3 .988 .988 .988);--gray-2:color(display-p3 .975 .975 .975);--gray-3:color(display-p3 .939 .939 .939);--gray-4:color(display-p3 .908 .908 .908);--gray-5:color(display-p3 .88 .88 .88);--gray-6:color(display-p3 .849 .849 .849);--gray-7:color(display-p3 .807 .807 .807);--gray-8:color(display-p3 .732 .732 .732);--gray-9:color(display-p3 .553 .553 .553);--gray-10:color(display-p3 .512 .512 .512);--gray-11:color(display-p3 .392 .392 .392);--gray-12:color(display-p3 .125 .125 .125)}}}.dark,.dark-theme{--gray-1:#111;--gray-2:#191919;--gray-3:#222;--gray-4:#2a2a2a;--gray-5:#313131;--gray-6:#3a3a3a;--gray-7:#484848;--gray-8:#606060;--gray-9:#6e6e6e;--gray-10:#7b7b7b;--gray-11:#b4b4b4;--gray-12:#eee}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--gray-1:color(display-p3 .067 .067 .067);--gray-2:color(display-p3 .098 .098 .098);--gray-3:color(display-p3 .135 .135 .135);--gray-4:color(display-p3 .163 .163 .163);--gray-5:color(display-p3 .192 .192 .192);--gray-6:color(display-p3 .228 .228 .228);--gray-7:color(display-p3 .283 .283 .283);--gray-8:color(display-p3 .375 .375 .375);--gray-9:color(display-p3 .431 .431 .431);--gray-10:color(display-p3 .484 .484 .484);--gray-11:color(display-p3 .706 .706 .706);--gray-12:color(display-p3 .933 .933 .933)}}}:root,.light,.light-theme{--gray-a1:#00000003;--gray-a2:#00000006;--gray-a3:#0000000f;--gray-a4:#00000017;--gray-a5:#0000001f;--gray-a6:#00000026;--gray-a7:#00000031;--gray-a8:#0004;--gray-a9:#00000072;--gray-a10:#0000007c;--gray-a11:#0000009b;--gray-a12:#000000df}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--gray-a1:color(display-p3 0 0 0/.012);--gray-a2:color(display-p3 0 0 0/.024);--gray-a3:color(display-p3 0 0 0/.063);--gray-a4:color(display-p3 0 0 0/.09);--gray-a5:color(display-p3 0 0 0/.122);--gray-a6:color(display-p3 0 0 0/.153);--gray-a7:color(display-p3 0 0 0/.192);--gray-a8:color(display-p3 0 0 0/.267);--gray-a9:color(display-p3 0 0 0/.447);--gray-a10:color(display-p3 0 0 0/.486);--gray-a11:color(display-p3 0 0 0/.608);--gray-a12:color(display-p3 0 0 0/.875)}}}.dark,.dark-theme{--gray-a1:#0000;--gray-a2:#ffffff09;--gray-a3:#ffffff12;--gray-a4:#ffffff1b;--gray-a5:#fff2;--gray-a6:#ffffff2c;--gray-a7:#ffffff3b;--gray-a8:#fff5;--gray-a9:#ffffff64;--gray-a10:#ffffff72;--gray-a11:#ffffffaf;--gray-a12:#ffffffed}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--gray-a1:color(display-p3 0 0 0/0);--gray-a2:color(display-p3 1 1 1/.034);--gray-a3:color(display-p3 1 1 1/.071);--gray-a4:color(display-p3 1 1 1/.105);--gray-a5:color(display-p3 1 1 1/.134);--gray-a6:color(display-p3 1 1 1/.172);--gray-a7:color(display-p3 1 1 1/.231);--gray-a8:color(display-p3 1 1 1/.332);--gray-a9:color(display-p3 1 1 1/.391);--gray-a10:color(display-p3 1 1 1/.445);--gray-a11:color(display-p3 1 1 1/.685);--gray-a12:color(display-p3 1 1 1/.929)}}}:root,.light,.light-theme{--red-1:#fffcfc;--red-2:#fff7f7;--red-3:#feebec;--red-4:#ffdbdc;--red-5:#ffcdce;--red-6:#fdbdbe;--red-7:#f4a9aa;--red-8:#eb8e90;--red-9:#e5484d;--red-10:#dc3e42;--red-11:#ce2c31;--red-12:#641723}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--red-1:color(display-p3 .998 .989 .988);--red-2:color(display-p3 .995 .971 .971);--red-3:color(display-p3 .985 .925 .925);--red-4:color(display-p3 .999 .866 .866);--red-5:color(display-p3 .984 .812 .811);--red-6:color(display-p3 .955 .751 .749);--red-7:color(display-p3 .915 .675 .672);--red-8:color(display-p3 .872 .575 .572);--red-9:color(display-p3 .83 .329 .324);--red-10:color(display-p3 .798 .294 .285);--red-11:color(display-p3 .744 .234 .222);--red-12:color(display-p3 .36 .115 .143)}}}.dark,.dark-theme{--red-1:#191111;--red-2:#201314;--red-3:#3b1219;--red-4:#500f1c;--red-5:#611623;--red-6:#72232d;--red-7:#8c333a;--red-8:#b54548;--red-9:#e5484d;--red-10:#ec5d5e;--red-11:#ff9592;--red-12:#ffd1d9}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--red-1:color(display-p3 .093 .068 .067);--red-2:color(display-p3 .118 .077 .079);--red-3:color(display-p3 .211 .081 .099);--red-4:color(display-p3 .287 .079 .113);--red-5:color(display-p3 .348 .11 .142);--red-6:color(display-p3 .414 .16 .183);--red-7:color(display-p3 .508 .224 .236);--red-8:color(display-p3 .659 .298 .297);--red-9:color(display-p3 .83 .329 .324);--red-10:color(display-p3 .861 .403 .387);--red-11:color(display-p3 1 .57 .55);--red-12:color(display-p3 .971 .826 .852)}}}:root,.light,.light-theme{--red-a1:#ff000003;--red-a2:#ff000008;--red-a3:#f3000d14;--red-a4:#ff000824;--red-a5:#ff000632;--red-a6:#f8000442;--red-a7:#df000356;--red-a8:#d2000571;--red-a9:#db0007b7;--red-a10:#d10005c1;--red-a11:#c40006d3;--red-a12:#55000de8}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--red-a1:color(display-p3 .675 .024 .024/.012);--red-a2:color(display-p3 .863 .024 .024/.028);--red-a3:color(display-p3 .792 .008 .008/.075);--red-a4:color(display-p3 1 .008 .008/.134);--red-a5:color(display-p3 .918 .008 .008/.189);--red-a6:color(display-p3 .831 .02 .004/.251);--red-a7:color(display-p3 .741 .016 .004/.33);--red-a8:color(display-p3 .698 .012 .004/.428);--red-a9:color(display-p3 .749 .008 0/.675);--red-a10:color(display-p3 .714 .012 0/.714);--red-a11:color(display-p3 .744 .234 .222);--red-a12:color(display-p3 .36 .115 .143)}}}.dark,.dark-theme{--red-a1:#f4121209;--red-a2:#f22f3e11;--red-a3:#ff173f2d;--red-a4:#fe0a3b44;--red-a5:#ff204756;--red-a6:#ff3e5668;--red-a7:#ff536184;--red-a8:#ff5d61b0;--red-a9:#fe4e54e4;--red-a10:#ff6465eb;--red-a11:#ff9592;--red-a12:#ffd1d9}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--red-a1:color(display-p3 .984 .071 .071/.03);--red-a2:color(display-p3 .996 .282 .282/.055);--red-a3:color(display-p3 1 .169 .271/.156);--red-a4:color(display-p3 1 .118 .267/.236);--red-a5:color(display-p3 1 .212 .314/.303);--red-a6:color(display-p3 1 .318 .38/.374);--red-a7:color(display-p3 1 .4 .424/.475);--red-a8:color(display-p3 1 .431 .431/.635);--red-a9:color(display-p3 1 .388 .384/.82);--red-a10:color(display-p3 1 .463 .447/.853);--red-a11:color(display-p3 1 .57 .55);--red-a12:color(display-p3 .971 .826 .852)}}}:root,.light,.light-theme{--green-1:#fbfefc;--green-2:#f4fbf6;--green-3:#e6f6eb;--green-4:#d6f1df;--green-5:#c4e8d1;--green-6:#adddc0;--green-7:#8eceaa;--green-8:#5bb98b;--green-9:#30a46c;--green-10:#2b9a66;--green-11:#218358;--green-12:#193b2d}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--green-1:color(display-p3 .986 .996 .989);--green-2:color(display-p3 .963 .983 .967);--green-3:color(display-p3 .913 .964 .925);--green-4:color(display-p3 .859 .94 .879);--green-5:color(display-p3 .796 .907 .826);--green-6:color(display-p3 .718 .863 .761);--green-7:color(display-p3 .61 .801 .675);--green-8:color(display-p3 .451 .715 .559);--green-9:color(display-p3 .332 .634 .442);--green-10:color(display-p3 .308 .595 .417);--green-11:color(display-p3 .19 .5 .32);--green-12:color(display-p3 .132 .228 .18)}}}.dark,.dark-theme{--green-1:#0e1512;--green-2:#121b17;--green-3:#132d21;--green-4:#113b29;--green-5:#174933;--green-6:#20573e;--green-7:#28684a;--green-8:#2f7c57;--green-9:#30a46c;--green-10:#33b074;--green-11:#3dd68c;--green-12:#b1f1cb}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--green-1:color(display-p3 .062 .083 .071);--green-2:color(display-p3 .079 .106 .09);--green-3:color(display-p3 .1 .173 .133);--green-4:color(display-p3 .115 .229 .166);--green-5:color(display-p3 .147 .282 .206);--green-6:color(display-p3 .185 .338 .25);--green-7:color(display-p3 .227 .403 .298);--green-8:color(display-p3 .27 .479 .351);--green-9:color(display-p3 .332 .634 .442);--green-10:color(display-p3 .357 .682 .474);--green-11:color(display-p3 .434 .828 .573);--green-12:color(display-p3 .747 .938 .807)}}}:root,.light,.light-theme{--green-a1:#00c04004;--green-a2:#00a32f0b;--green-a3:#00a43319;--green-a4:#00a83829;--green-a5:#019c393b;--green-a6:#00963c52;--green-a7:#00914071;--green-a8:#00924ba4;--green-a9:#008f4acf;--green-a10:#008647d4;--green-a11:#00713fde;--green-a12:#002616e6}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--green-a1:color(display-p3 .024 .757 .267/.016);--green-a2:color(display-p3 .024 .565 .129/.036);--green-a3:color(display-p3 .012 .596 .145/.087);--green-a4:color(display-p3 .008 .588 .145/.142);--green-a5:color(display-p3 .004 .541 .157/.204);--green-a6:color(display-p3 .004 .518 .157/.283);--green-a7:color(display-p3 .004 .486 .165/.389);--green-a8:color(display-p3 0 .478 .2/.55);--green-a9:color(display-p3 0 .455 .165/.667);--green-a10:color(display-p3 0 .416 .153/.691);--green-a11:color(display-p3 .19 .5 .32);--green-a12:color(display-p3 .132 .228 .18)}}}.dark,.dark-theme{--green-a1:#00de4505;--green-a2:#29f99d0b;--green-a3:#22ff991e;--green-a4:#11ff992d;--green-a5:#2bffa23c;--green-a6:#44ffaa4b;--green-a7:#50fdac5e;--green-a8:#54ffad73;--green-a9:#44ffa49e;--green-a10:#43fea4ab;--green-a11:#46fea5d4;--green-a12:#bbffd7f0}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--green-a1:color(display-p3 0 .992 .298/.017);--green-a2:color(display-p3 .341 .98 .616/.043);--green-a3:color(display-p3 .376 .996 .655/.114);--green-a4:color(display-p3 .341 .996 .635/.173);--green-a5:color(display-p3 .408 1 .678/.232);--green-a6:color(display-p3 .475 1 .706/.29);--green-a7:color(display-p3 .514 1 .706/.362);--green-a8:color(display-p3 .529 1 .718/.442);--green-a9:color(display-p3 .502 .996 .682/.61);--green-a10:color(display-p3 .506 1 .682/.66);--green-a11:color(display-p3 .434 .828 .573);--green-a12:color(display-p3 .747 .938 .807)}}}:root,.light,.light-theme{--blue-1:#fbfdff;--blue-2:#f4faff;--blue-3:#e6f4fe;--blue-4:#d5efff;--blue-5:#c2e5ff;--blue-6:#acd8fc;--blue-7:#8ec8f6;--blue-8:#5eb1ef;--blue-9:#0090ff;--blue-10:#0588f0;--blue-11:#0d74ce;--blue-12:#113264}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--blue-1:color(display-p3 .986 .992 .999);--blue-2:color(display-p3 .96 .979 .998);--blue-3:color(display-p3 .912 .956 .991);--blue-4:color(display-p3 .853 .932 1);--blue-5:color(display-p3 .788 .894 .998);--blue-6:color(display-p3 .709 .843 .976);--blue-7:color(display-p3 .606 .777 .947);--blue-8:color(display-p3 .451 .688 .917);--blue-9:color(display-p3 .247 .556 .969);--blue-10:color(display-p3 .234 .523 .912);--blue-11:color(display-p3 .15 .44 .84);--blue-12:color(display-p3 .102 .193 .379)}}}.dark,.dark-theme{--blue-1:#0d1520;--blue-2:#111927;--blue-3:#0d2847;--blue-4:#003362;--blue-5:#004074;--blue-6:#104d87;--blue-7:#205d9e;--blue-8:#2870bd;--blue-9:#0090ff;--blue-10:#3b9eff;--blue-11:#70b8ff;--blue-12:#c2e6ff}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--blue-1:color(display-p3 .057 .081 .122);--blue-2:color(display-p3 .072 .098 .147);--blue-3:color(display-p3 .078 .154 .27);--blue-4:color(display-p3 .033 .197 .37);--blue-5:color(display-p3 .08 .245 .441);--blue-6:color(display-p3 .14 .298 .511);--blue-7:color(display-p3 .195 .361 .6);--blue-8:color(display-p3 .239 .434 .72);--blue-9:color(display-p3 .247 .556 .969);--blue-10:color(display-p3 .344 .612 .973);--blue-11:color(display-p3 .49 .72 1);--blue-12:color(display-p3 .788 .898 .99)}}}:root,.light,.light-theme{--blue-a1:#0080ff04;--blue-a2:#008cff0b;--blue-a3:#008ff519;--blue-a4:#009eff2a;--blue-a5:#0093ff3d;--blue-a6:#0088f653;--blue-a7:#0083eb71;--blue-a8:#0084e6a1;--blue-a9:#0090ff;--blue-a10:#0086f0fa;--blue-a11:#006dcbf2;--blue-a12:#002359ee}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--blue-a1:color(display-p3 .024 .514 1/.016);--blue-a2:color(display-p3 .024 .514 .906/.04);--blue-a3:color(display-p3 .012 .506 .914/.087);--blue-a4:color(display-p3 .008 .545 1/.146);--blue-a5:color(display-p3 .004 .502 .984/.212);--blue-a6:color(display-p3 .004 .463 .922/.291);--blue-a7:color(display-p3 .004 .431 .863/.393);--blue-a8:color(display-p3 0 .427 .851/.55);--blue-a9:color(display-p3 0 .412 .961/.753);--blue-a10:color(display-p3 0 .376 .886/.765);--blue-a11:color(display-p3 .15 .44 .84);--blue-a12:color(display-p3 .102 .193 .379)}}}.dark,.dark-theme{--blue-a1:#004df211;--blue-a2:#1166fb18;--blue-a3:#0077ff3a;--blue-a4:#0075ff57;--blue-a5:#0081fd6b;--blue-a6:#0f89fd7f;--blue-a7:#2a91fe98;--blue-a8:#3094feb9;--blue-a9:#0090ff;--blue-a10:#3b9eff;--blue-a11:#70b8ff;--blue-a12:#c2e6ff}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--blue-a1:color(display-p3 0 .333 1/.059);--blue-a2:color(display-p3 .114 .435 .988/.085);--blue-a3:color(display-p3 .122 .463 1/.219);--blue-a4:color(display-p3 0 .467 1/.324);--blue-a5:color(display-p3 .098 .51 1/.4);--blue-a6:color(display-p3 .224 .557 1/.475);--blue-a7:color(display-p3 .294 .584 1/.572);--blue-a8:color(display-p3 .314 .592 1/.702);--blue-a9:color(display-p3 .251 .573 .996/.967);--blue-a10:color(display-p3 .357 .631 1/.971);--blue-a11:color(display-p3 .49 .72 1);--blue-a12:color(display-p3 .788 .898 .99)}}}:root,.light,.light-theme{--amber-1:#fefdfb;--amber-2:#fefbe9;--amber-3:#fff7c2;--amber-4:#ffee9c;--amber-5:#fbe577;--amber-6:#f3d673;--amber-7:#e9c162;--amber-8:#e2a336;--amber-9:#ffc53d;--amber-10:#ffba18;--amber-11:#ab6400;--amber-12:#4f3422}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--amber-1:color(display-p3 .995 .992 .985);--amber-2:color(display-p3 .994 .986 .921);--amber-3:color(display-p3 .994 .969 .782);--amber-4:color(display-p3 .989 .937 .65);--amber-5:color(display-p3 .97 .902 .527);--amber-6:color(display-p3 .936 .844 .506);--amber-7:color(display-p3 .89 .762 .443);--amber-8:color(display-p3 .85 .65 .3);--amber-9:color(display-p3 1 .77 .26);--amber-10:color(display-p3 .959 .741 .274);--amber-11:color(display-p3 .64 .4 0);--amber-12:color(display-p3 .294 .208 .145)}}}.dark,.dark-theme{--amber-1:#16120c;--amber-2:#1d180f;--amber-3:#302008;--amber-4:#3f2700;--amber-5:#4d3000;--amber-6:#5c3d05;--amber-7:#714f19;--amber-8:#8f6424;--amber-9:#ffc53d;--amber-10:#ffd60a;--amber-11:#ffca16;--amber-12:#ffe7b3}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--amber-1:color(display-p3 .082 .07 .05);--amber-2:color(display-p3 .111 .094 .064);--amber-3:color(display-p3 .178 .128 .049);--amber-4:color(display-p3 .239 .156 0);--amber-5:color(display-p3 .29 .193 0);--amber-6:color(display-p3 .344 .245 .076);--amber-7:color(display-p3 .422 .314 .141);--amber-8:color(display-p3 .535 .399 .189);--amber-9:color(display-p3 1 .77 .26);--amber-10:color(display-p3 1 .87 .15);--amber-11:color(display-p3 1 .8 .29);--amber-12:color(display-p3 .984 .909 .726)}}}:root,.light,.light-theme{--amber-a1:#c0800004;--amber-a2:#f4d10016;--amber-a3:#ffde003d;--amber-a4:#ffd40063;--amber-a5:#f8cf0088;--amber-a6:#eab5008c;--amber-a7:#dc9b009d;--amber-a8:#da8a00c9;--amber-a9:#ffb300c2;--amber-a10:#ffb300e7;--amber-a11:#ab6400;--amber-a12:#341500dd}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--amber-a1:color(display-p3 .757 .514 .024/.016);--amber-a2:color(display-p3 .902 .804 .008/.079);--amber-a3:color(display-p3 .965 .859 .004/.22);--amber-a4:color(display-p3 .969 .82 .004/.35);--amber-a5:color(display-p3 .933 .796 .004/.475);--amber-a6:color(display-p3 .875 .682 .004/.495);--amber-a7:color(display-p3 .804 .573 0/.557);--amber-a8:color(display-p3 .788 .502 0/.699);--amber-a9:color(display-p3 1 .686 0/.742);--amber-a10:color(display-p3 .945 .643 0/.726);--amber-a11:color(display-p3 .64 .4 0);--amber-a12:color(display-p3 .294 .208 .145)}}}.dark,.dark-theme{--amber-a1:#e63c0006;--amber-a2:#fd9b000d;--amber-a3:#fa820022;--amber-a4:#fc820032;--amber-a5:#fd8b0041;--amber-a6:#fd9b0051;--amber-a7:#ffab2567;--amber-a8:#ffae3587;--amber-a9:#ffc53d;--amber-a10:#ffd60a;--amber-a11:#ffca16;--amber-a12:#ffe7b3}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--amber-a1:color(display-p3 .992 .298 0/.017);--amber-a2:color(display-p3 .988 .651 0/.047);--amber-a3:color(display-p3 1 .6 0/.118);--amber-a4:color(display-p3 1 .557 0/.185);--amber-a5:color(display-p3 1 .592 0/.24);--amber-a6:color(display-p3 1 .659 .094/.299);--amber-a7:color(display-p3 1 .714 .263/.383);--amber-a8:color(display-p3 .996 .729 .306/.5);--amber-a9:color(display-p3 1 .769 .259);--amber-a10:color(display-p3 1 .871 .149);--amber-a11:color(display-p3 1 .8 .29);--amber-a12:color(display-p3 .984 .909 .726)}}}:root{--black-a1:#0000000d;--black-a2:#0000001a;--black-a3:#00000026;--black-a4:#0003;--black-a5:#0000004d;--black-a6:#0006;--black-a7:#00000080;--black-a8:#0009;--black-a9:#000000b3;--black-a10:#000c;--black-a11:#000000e6;--black-a12:#000000f2}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root{--black-a1:color(display-p3 0 0 0/.05);--black-a2:color(display-p3 0 0 0/.1);--black-a3:color(display-p3 0 0 0/.15);--black-a4:color(display-p3 0 0 0/.2);--black-a5:color(display-p3 0 0 0/.3);--black-a6:color(display-p3 0 0 0/.4);--black-a7:color(display-p3 0 0 0/.5);--black-a8:color(display-p3 0 0 0/.6);--black-a9:color(display-p3 0 0 0/.7);--black-a10:color(display-p3 0 0 0/.8);--black-a11:color(display-p3 0 0 0/.9);--black-a12:color(display-p3 0 0 0/.95)}}}:root,.dark{--bg-background:#fdfdfd;--bg-canvas:var(--gray-1);--bg-subtle:var(--gray-1);--bg-elevated:var(--gray-2);--text-emphasis:var(--gray-12);--text-default:var(--gray-11);--text-muted:var(--gray-8);--text-placeholder:var(--gray-5);--text-on-brand:#fff;--border-default:var(--gray-3);--border-subtle:var(--gray-2);--border-interactive:var(--gray-a3);--bg-interactive:var(--gray-a2);--bg-interactive-hover:var(--gray-a3);--ring-focus:var(--gray-a3);--bg-brand:#000;--bg-brand-hover:var(--black-a11);--ring-brand:var(--black-a4);--bg-error:var(--red-a3);--bg-error-hover:var(--red-a5);--border-error:var(--red-a6);--border-error-subtle:var(--red-a4);--text-error:var(--red-a11);--ring-error:var(--red-a7);--bg-warning:var(--amber-a3);--border-warning:var(--amber-a6);--border-warning-subtle:var(--amber-a4);--text-warning:var(--amber-a11);--bg-success:var(--green-a3);--border-success:var(--green-a6);--border-success-subtle:var(--green-a4);--text-success:var(--green-a11);--bg-info:var(--blue-a3);--border-info-subtle:var(--blue-a4);--text-info:var(--blue-a11);--text-link:var(--blue-a9);--border-link:var(--blue-a9);--ring-link:var(--blue-a7)}.dark{--bg-background:#000;--text-placeholder:var(--gray-8);--text-on-brand:#000;--bg-brand:#fff;--bg-brand-hover:var(--gray-12);--ring-brand:var(--gray-a4)}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:\"*\";inherits:false}@property --tw-rotate-y{syntax:\"*\";inherits:false}@property --tw-rotate-z{syntax:\"*\";inherits:false}@property --tw-skew-x{syntax:\"*\";inherits:false}@property --tw-skew-y{syntax:\"*\";inherits:false}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:\"*\";inherits:false}@property --tw-backdrop-brightness{syntax:\"*\";inherits:false}@property --tw-backdrop-contrast{syntax:\"*\";inherits:false}@property --tw-backdrop-grayscale{syntax:\"*\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\"*\";inherits:false}@property --tw-backdrop-invert{syntax:\"*\";inherits:false}@property --tw-backdrop-opacity{syntax:\"*\";inherits:false}@property --tw-backdrop-saturate{syntax:\"*\";inherits:false}@property --tw-backdrop-sepia{syntax:\"*\";inherits:false}@property --tw-duration{syntax:\"*\";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}";
1310
+ //#endregion
1311
+ //#region src/widget.tsx
1312
+ function Ze({ trigger: e = "floating", position: t = "bottom-right" }) {
1313
+ let r = l(), [i] = a(() => typeof document > "u" ? null : Ye(Xe));
1314
+ return n(() => {
1315
+ if (i) return document.body.appendChild(i.element), () => i.element.remove();
1316
+ }, [i]), !r || !i ? null : s(/* @__PURE__ */ W(Ge, {
1317
+ brainbox: r,
1318
+ hostEl: i.element,
1319
+ trigger: e,
1320
+ position: t
1321
+ }), i.container);
1322
+ }
1323
+ //#endregion
1324
+ //#region src/use-brainbox-widget.ts
1325
+ function Qe() {
1326
+ let e = l(), t = e ? K(e) : le;
1327
+ return {
1328
+ isOpen: o(t.subscribe, t.isOpen, t.isOpen),
1329
+ open: t.open,
1330
+ start: t.start,
1331
+ close: t.close
1332
+ };
1333
+ }
1334
+ //#endregion
1335
+ //#region src/mount.tsx
1336
+ function $e({ trigger: e, position: t, ...n }) {
1337
+ let r = x(n), i = K(r), a = document.createElement("div");
1338
+ a.setAttribute("data-brainbox-root", ""), document.body.appendChild(a);
1339
+ let o = oe(a);
1340
+ return o.render(/* @__PURE__ */ W(c, {
1341
+ brainbox: r,
1342
+ children: /* @__PURE__ */ W(Ze, {
1343
+ trigger: e,
1344
+ position: t
1345
+ })
1346
+ })), {
1347
+ open: i.open,
1348
+ start: i.start,
1349
+ close: i.close,
1350
+ identify: r.identify,
1351
+ destroy() {
1352
+ o.unmount(), a.remove(), r.destroy();
1353
+ }
1354
+ };
1355
+ }
1356
+ //#endregion
1357
+ export { Ze as BrainboxWidget, $e as mount, Qe as useBrainboxWidget };