@arbidocs/react 0.3.184 → 0.4.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 (41) hide show
  1. package/dist/chunk-3CLGHHME.js +3882 -0
  2. package/dist/chunk-3CLGHHME.js.map +1 -0
  3. package/dist/chunk-6ALMBER7.js +176 -0
  4. package/dist/chunk-6ALMBER7.js.map +1 -0
  5. package/dist/chunk-BXP6S34V.cjs +284 -0
  6. package/dist/chunk-BXP6S34V.cjs.map +1 -0
  7. package/dist/chunk-EJ2BMHYK.js +272 -0
  8. package/dist/chunk-EJ2BMHYK.js.map +1 -0
  9. package/dist/chunk-OU2QLIKS.cjs +4060 -0
  10. package/dist/chunk-OU2QLIKS.cjs.map +1 -0
  11. package/dist/chunk-RZQACYNQ.cjs +218 -0
  12. package/dist/chunk-RZQACYNQ.cjs.map +1 -0
  13. package/dist/index-CcbVSNSP.d.cts +116 -0
  14. package/dist/index-CcbVSNSP.d.ts +116 -0
  15. package/dist/index.cjs +955 -2796
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +13 -901
  18. package/dist/index.d.ts +13 -901
  19. package/dist/index.js +312 -2303
  20. package/dist/index.js.map +1 -1
  21. package/dist/shell/index.cjs +29 -0
  22. package/dist/shell/index.cjs.map +1 -0
  23. package/dist/shell/index.d.cts +4 -0
  24. package/dist/shell/index.d.ts +4 -0
  25. package/dist/shell/index.js +4 -0
  26. package/dist/shell/index.js.map +1 -0
  27. package/dist/ui/index.cjs +288 -147
  28. package/dist/ui/index.d.cts +878 -3
  29. package/dist/ui/index.d.ts +878 -3
  30. package/dist/ui/index.js +2 -1
  31. package/dist/viewers/index.cjs +327 -76
  32. package/dist/viewers/index.cjs.map +1 -1
  33. package/dist/viewers/index.d.cts +90 -4
  34. package/dist/viewers/index.d.ts +90 -4
  35. package/dist/viewers/index.js +316 -78
  36. package/dist/viewers/index.js.map +1 -1
  37. package/package.json +12 -3
  38. package/dist/chunk-FIPS3VPH.cjs +0 -1975
  39. package/dist/chunk-FIPS3VPH.cjs.map +0 -1
  40. package/dist/chunk-I256BUCX.js +0 -1819
  41. package/dist/chunk-I256BUCX.js.map +0 -1
@@ -1,1975 +0,0 @@
1
- 'use strict';
2
-
3
- var clsx = require('clsx');
4
- var tailwindMerge = require('tailwind-merge');
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var React2 = require('react');
7
- var Markdown = require('react-markdown');
8
- var remarkGfm = require('remark-gfm');
9
- var rehypeRaw = require('rehype-raw');
10
- var lucideReact = require('lucide-react');
11
- var reactDom = require('react-dom');
12
- var AvatarPrimitive = require('@radix-ui/react-avatar');
13
- var classVarianceAuthority = require('class-variance-authority');
14
- var reactSlot = require('@radix-ui/react-slot');
15
- var HoverCardPrimitive = require('@radix-ui/react-hover-card');
16
- var SeparatorPrimitive = require('@radix-ui/react-separator');
17
- var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
18
- var ProgressPrimitive = require('@radix-ui/react-progress');
19
- var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
20
- var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
21
- var CheckboxPrimitive = require('@radix-ui/react-checkbox');
22
- var SwitchPrimitives = require('@radix-ui/react-switch');
23
- var TabsPrimitive = require('@radix-ui/react-tabs');
24
- var SliderPrimitive = require('@radix-ui/react-slider');
25
- var TogglePrimitive = require('@radix-ui/react-toggle');
26
- var ToggleGroupPrimitive = require('@radix-ui/react-toggle-group');
27
- var DialogPrimitive = require('@radix-ui/react-dialog');
28
- var PopoverPrimitive = require('@radix-ui/react-popover');
29
- var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
30
- var SelectPrimitive = require('@radix-ui/react-select');
31
- var cmdk = require('cmdk');
32
-
33
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
34
-
35
- function _interopNamespace(e) {
36
- if (e && e.__esModule) return e;
37
- var n = Object.create(null);
38
- if (e) {
39
- Object.keys(e).forEach(function (k) {
40
- if (k !== 'default') {
41
- var d = Object.getOwnPropertyDescriptor(e, k);
42
- Object.defineProperty(n, k, d.get ? d : {
43
- enumerable: true,
44
- get: function () { return e[k]; }
45
- });
46
- }
47
- });
48
- }
49
- n.default = e;
50
- return Object.freeze(n);
51
- }
52
-
53
- var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
54
- var Markdown__default = /*#__PURE__*/_interopDefault(Markdown);
55
- var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
56
- var rehypeRaw__default = /*#__PURE__*/_interopDefault(rehypeRaw);
57
- var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
58
- var HoverCardPrimitive__namespace = /*#__PURE__*/_interopNamespace(HoverCardPrimitive);
59
- var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
60
- var CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespace(CollapsiblePrimitive);
61
- var ProgressPrimitive__namespace = /*#__PURE__*/_interopNamespace(ProgressPrimitive);
62
- var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
63
- var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
64
- var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
65
- var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
66
- var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
67
- var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
68
- var TogglePrimitive__namespace = /*#__PURE__*/_interopNamespace(TogglePrimitive);
69
- var ToggleGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(ToggleGroupPrimitive);
70
- var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
71
- var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
72
- var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
73
- var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
74
-
75
- // src/lib/utils.ts
76
- function cn(...inputs) {
77
- return tailwindMerge.twMerge(clsx.clsx(inputs));
78
- }
79
- var markdownBaseComponents = {
80
- h1: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-lg font-semibold", "data-testid": "markdown-heading-1", ...props, children }),
81
- h2: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-semibold text-base", "data-testid": "markdown-heading-2", ...props, children }),
82
- h3: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-base", "data-testid": "markdown-heading-3", ...props, children }),
83
- h4: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-base", ...props, children }),
84
- h5: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("h5", { className: "font-medium", ...props, children }),
85
- strong: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "font-semibold", ...props, children }),
86
- blockquote: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("blockquote", { className: "border-l-2 border-primary pl-4", ...props, children }),
87
- ol: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "list-decimal space-y-2 pl-6", "data-testid": "markdown-ordered-list", ...props, children }),
88
- ul: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "list-none space-y-2 pl-6", "data-testid": "markdown-unordered-list", ...props, children }),
89
- li: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "my-1.5", ...props, children }),
90
- table: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("table", { "data-testid": "markdown-table", ...props, children }),
91
- th: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("th", { ...props, children }),
92
- td: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("td", { ...props, children }),
93
- tr: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("tr", { ...props, children }),
94
- p: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-wrap", ...props, children }),
95
- hr: (props) => /* @__PURE__ */ jsxRuntime.jsx("hr", { className: "border-foreground/20", ...props }),
96
- sup: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("sup", { className: "text-xs", ...props, children }),
97
- sub: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("sub", { className: "text-xs", ...props, children }),
98
- div: ({ children, className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className, ...props, children }),
99
- br: (props) => /* @__PURE__ */ jsxRuntime.jsx("br", { ...props }),
100
- kbd: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
101
- "kbd",
102
- {
103
- className: "px-1.5 py-0.5 text-xs font-mono bg-muted border border-border rounded",
104
- ...props,
105
- children
106
- }
107
- ),
108
- abbr: ({ children, title, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("abbr", { title, className: "underline decoration-dotted cursor-help", ...props, children }),
109
- cite: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("cite", { className: "italic", ...props, children })
110
- };
111
- var MarkdownStreamingContext = React2.createContext(false);
112
-
113
- // src/ai/split-markdown-blocks.ts
114
- var LIST_ITEM_RE = /^\s*([-*+]|\d+[.)])\s/;
115
- var BLOCKQUOTE_RE = /^\s*>/;
116
- function splitMarkdownBlocks(content) {
117
- if (!content) return [];
118
- const blocks = [];
119
- let start = 0;
120
- let inFence = false;
121
- let i = 0;
122
- while (i < content.length) {
123
- if (content.startsWith("```", i)) {
124
- inFence = !inFence;
125
- i += 3;
126
- continue;
127
- }
128
- if (!inFence && content[i] === "\n" && content[i + 1] === "\n") {
129
- const before = content.slice(start, i);
130
- const lastLine = before.slice(before.lastIndexOf("\n") + 1);
131
- const afterStart = i + 2;
132
- const nextNewline = content.indexOf("\n", afterStart);
133
- const nextLine = content.slice(afterStart, nextNewline === -1 ? void 0 : nextNewline);
134
- const bothListItems = LIST_ITEM_RE.test(lastLine) && LIST_ITEM_RE.test(nextLine);
135
- const bothBlockquotes = BLOCKQUOTE_RE.test(lastLine) && BLOCKQUOTE_RE.test(nextLine);
136
- if (bothListItems || bothBlockquotes) {
137
- i += 2;
138
- continue;
139
- }
140
- blocks.push(content.slice(start, afterStart));
141
- start = afterStart;
142
- i = afterStart;
143
- continue;
144
- }
145
- i++;
146
- }
147
- if (start < content.length) blocks.push(content.slice(start));
148
- return blocks;
149
- }
150
- function CodeBlock({ language, code }) {
151
- const [copied, setCopied] = React2.useState(false);
152
- const handleCopy = async () => {
153
- try {
154
- await navigator.clipboard.writeText(code);
155
- setCopied(true);
156
- setTimeout(() => setCopied(false), 2e3);
157
- } catch {
158
- }
159
- };
160
- return /* @__PURE__ */ jsxRuntime.jsxs(
161
- "div",
162
- {
163
- className: "code-block relative my-3 overflow-hidden rounded-md border border-border bg-muted",
164
- "data-testid": "markdown-code-block",
165
- children: [
166
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border-b border-border px-3 py-1.5", children: [
167
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-xs text-muted-foreground", children: language || "code" }),
168
- /* @__PURE__ */ jsxRuntime.jsxs(
169
- "button",
170
- {
171
- type: "button",
172
- onClick: handleCopy,
173
- className: "flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",
174
- title: copied ? "Copied!" : "Copy code",
175
- children: [
176
- copied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: 12 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { size: 12 }),
177
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: copied ? "Copied" : "Copy" })
178
- ]
179
- }
180
- )
181
- ] }),
182
- /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "overflow-x-auto p-3 text-sm leading-relaxed", children: /* @__PURE__ */ jsxRuntime.jsx("code", { className: cn("font-mono text-foreground", language && `language-${language}`), children: code }) })
183
- ]
184
- }
185
- );
186
- }
187
- var defaultComponents = {
188
- ...markdownBaseComponents,
189
- a: ({ href, children, ...props }) => {
190
- const isInternal = !href || href.startsWith("#") || href.startsWith("cite:");
191
- return /* @__PURE__ */ jsxRuntime.jsx(
192
- "a",
193
- {
194
- className: "text-primary underline underline-offset-2",
195
- href,
196
- ...isInternal ? {} : { target: "_blank", rel: "noopener noreferrer" },
197
- ...props,
198
- children
199
- }
200
- );
201
- },
202
- em: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("em", { className: "italic", ...props, children }),
203
- code: function MarkdownCode({
204
- className,
205
- children,
206
- ...props
207
- }) {
208
- const match = /language-(\w+)/.exec(className || "");
209
- if (!match) {
210
- return /* @__PURE__ */ jsxRuntime.jsx(
211
- "code",
212
- {
213
- className: "rounded bg-muted px-1 py-0.5 font-mono text-[0.9em]",
214
- "data-testid": "markdown-inline-code",
215
- ...props,
216
- children
217
- }
218
- );
219
- }
220
- return /* @__PURE__ */ jsxRuntime.jsx(CodeBlock, { language: match[1], code: String(children).replace(/\n$/, "") });
221
- },
222
- // The CodeBlock renders its own <pre>; unwrap react-markdown's wrapper so we
223
- // don't nest <pre><pre>.
224
- pre: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children }),
225
- blockquote: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("blockquote", { className: "border-l-2 border-border pl-4 italic text-muted-foreground", ...props, children }),
226
- table: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-3 overflow-x-auto rounded-lg border border-border", children: /* @__PURE__ */ jsxRuntime.jsx("table", { "data-testid": "markdown-table", className: "w-full border-collapse text-sm", ...props, children }) }),
227
- thead: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-muted", ...props, children }),
228
- th: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
229
- "th",
230
- {
231
- className: "border-b border-border px-3 py-2 text-left font-semibold text-foreground",
232
- ...props,
233
- children
234
- }
235
- ),
236
- td: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: "border-b border-border px-3 py-2 align-top", ...props, children }),
237
- // General emphasis marks (GFM `~~strikethrough~~` → <del>, raw <ins>/<mark>).
238
- del: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("del", { className: "text-muted-foreground line-through", ...props, children }),
239
- ins: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("ins", { className: "underline decoration-primary/60", ...props, children }),
240
- mark: ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("mark", { className: "rounded bg-primary/15 px-0.5 text-foreground", ...props, children })
241
- };
242
- var remarkPlugins = [remarkGfm__default.default];
243
- var rehypePlugins = [rehypeRaw__default.default];
244
- var MemoizedBlock = React2__namespace.default.memo(function MarkdownBlock({
245
- content,
246
- components
247
- }) {
248
- return /* @__PURE__ */ jsxRuntime.jsx(Markdown__default.default, { remarkPlugins, rehypePlugins, components, children: content });
249
- });
250
- var MarkdownErrorBoundary = class extends React2__namespace.default.Component {
251
- state = { hasError: false };
252
- static getDerivedStateFromError() {
253
- return { hasError: true };
254
- }
255
- render() {
256
- return this.state.hasError ? this.props.fallback : this.props.children;
257
- }
258
- };
259
- function MarkdownRendererComponent({
260
- children,
261
- components: customComponents,
262
- isStreaming = false,
263
- className,
264
- testId = "markdown-renderer"
265
- }) {
266
- const components = React2.useMemo(
267
- () => customComponents ? { ...defaultComponents, ...customComponents } : defaultComponents,
268
- [customComponents]
269
- );
270
- const blocks = React2.useMemo(() => splitMarkdownBlocks(children), [children]);
271
- return /* @__PURE__ */ jsxRuntime.jsx(
272
- MarkdownErrorBoundary,
273
- {
274
- fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("whitespace-pre-wrap break-words text-foreground", className), children }),
275
- children: /* @__PURE__ */ jsxRuntime.jsx(MarkdownStreamingContext.Provider, { value: isStreaming, children: /* @__PURE__ */ jsxRuntime.jsx(
276
- "div",
277
- {
278
- className: cn(
279
- "markdown-content space-y-3 break-words leading-relaxed text-foreground",
280
- className
281
- ),
282
- "data-testid": testId,
283
- children: blocks.map((block, index) => /* @__PURE__ */ jsxRuntime.jsx(MemoizedBlock, { content: block, components }, index))
284
- }
285
- ) })
286
- }
287
- );
288
- }
289
- var MarkdownRenderer = React2__namespace.default.memo(MarkdownRendererComponent);
290
- var TooltipContext = React2__namespace.createContext(null);
291
- var DEFAULT_DELAY = 300;
292
- var TooltipConfigContext = React2__namespace.createContext({
293
- delayDuration: DEFAULT_DELAY
294
- });
295
- var TooltipProvider = ({ children, delayDuration = DEFAULT_DELAY }) => {
296
- const value = React2__namespace.useMemo(() => ({ delayDuration }), [delayDuration]);
297
- return /* @__PURE__ */ jsxRuntime.jsx(TooltipConfigContext.Provider, { value, children });
298
- };
299
- function Tooltip({ children, delayDuration }) {
300
- const config = React2__namespace.useContext(TooltipConfigContext);
301
- const delay = delayDuration ?? config.delayDuration;
302
- const [open, setOpen] = React2__namespace.useState(false);
303
- const triggerRef = React2__namespace.useRef(null);
304
- const timer = React2__namespace.useRef(null);
305
- const contentId = React2__namespace.useId();
306
- const clearTimer = () => {
307
- if (timer.current) {
308
- clearTimeout(timer.current);
309
- timer.current = null;
310
- }
311
- };
312
- const show = React2__namespace.useCallback(() => {
313
- clearTimer();
314
- timer.current = setTimeout(() => setOpen(true), delay);
315
- }, [delay]);
316
- const hide = React2__namespace.useCallback(() => {
317
- clearTimer();
318
- setOpen(false);
319
- }, []);
320
- const setTrigger = React2__namespace.useCallback((el) => {
321
- triggerRef.current = el;
322
- }, []);
323
- React2__namespace.useEffect(() => () => clearTimer(), []);
324
- const value = React2__namespace.useMemo(
325
- () => ({ open, show, hide, setTrigger, triggerRef, contentId }),
326
- [open, show, hide, setTrigger, contentId]
327
- );
328
- return /* @__PURE__ */ jsxRuntime.jsx(TooltipContext.Provider, { value, children });
329
- }
330
- function TooltipTrigger({ asChild, children, ...props }) {
331
- const ctx = React2__namespace.useContext(TooltipContext);
332
- if (!ctx) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
333
- const triggerHandlers = {
334
- onPointerEnter: (e) => {
335
- props.onPointerEnter?.(e);
336
- ctx.show();
337
- },
338
- onPointerLeave: (e) => {
339
- props.onPointerLeave?.(e);
340
- ctx.hide();
341
- },
342
- onFocus: (e) => {
343
- props.onFocus?.(e);
344
- ctx.show();
345
- },
346
- onBlur: (e) => {
347
- props.onBlur?.(e);
348
- ctx.hide();
349
- },
350
- "aria-describedby": ctx.open ? ctx.contentId : void 0,
351
- "data-state": ctx.open ? "open" : "closed"
352
- };
353
- if (asChild && React2__namespace.isValidElement(children)) {
354
- const child = children;
355
- return React2__namespace.cloneElement(child, {
356
- ...props,
357
- ...triggerHandlers,
358
- ref: ctx.setTrigger
359
- });
360
- }
361
- return /* @__PURE__ */ jsxRuntime.jsx(
362
- "button",
363
- {
364
- type: "button",
365
- ...props,
366
- ...triggerHandlers,
367
- ref: ctx.setTrigger,
368
- children
369
- }
370
- );
371
- }
372
- var TRANSFORM_BY_SIDE = {
373
- top: "translate(-50%, -100%)",
374
- bottom: "translate(-50%, 0)",
375
- left: "translate(-100%, -50%)",
376
- right: "translate(0, -50%)"
377
- };
378
- var TooltipContent = React2__namespace.forwardRef(
379
- ({ className, side = "top", sideOffset = 4, style, ...props }, ref) => {
380
- const ctx = React2__namespace.useContext(TooltipContext);
381
- const innerRef = React2__namespace.useRef(null);
382
- const [coords, setCoords] = React2__namespace.useState(null);
383
- React2__namespace.useLayoutEffect(() => {
384
- if (!ctx?.open || !ctx.triggerRef.current) {
385
- setCoords(null);
386
- return;
387
- }
388
- const r = ctx.triggerRef.current.getBoundingClientRect();
389
- const c = innerRef.current?.getBoundingClientRect();
390
- const ch = c?.height ?? 0;
391
- const cw = c?.width ?? 0;
392
- const vh = window.innerHeight;
393
- const vw = window.innerWidth;
394
- let s = side;
395
- if (s === "top" && r.top - sideOffset - ch < 0) s = "bottom";
396
- else if (s === "bottom" && r.bottom + sideOffset + ch > vh) s = "top";
397
- else if (s === "left" && r.left - sideOffset - cw < 0) s = "right";
398
- else if (s === "right" && r.right + sideOffset + cw > vw) s = "left";
399
- setCoords({
400
- top: s === "top" ? r.top - sideOffset : s === "bottom" ? r.bottom + sideOffset : r.top + r.height / 2,
401
- left: s === "left" ? r.left - sideOffset : s === "right" ? r.right + sideOffset : r.left + r.width / 2,
402
- transform: TRANSFORM_BY_SIDE[s]
403
- });
404
- }, [ctx?.open, side, sideOffset, ctx?.triggerRef]);
405
- if (!ctx?.open) return null;
406
- const setRefs = (node) => {
407
- innerRef.current = node;
408
- if (typeof ref === "function") ref(node);
409
- else if (ref) ref.current = node;
410
- };
411
- return reactDom.createPortal(
412
- /* @__PURE__ */ jsxRuntime.jsx(
413
- "div",
414
- {
415
- ref: setRefs,
416
- id: ctx.contentId,
417
- role: "tooltip",
418
- className: cn(
419
- // The kit owns the tooltip's look: semantic tokens only, so it is
420
- // legible in every app without one of them defining a global class.
421
- // The `tooltip-content` hook is kept last-but-one so a host stylesheet
422
- // can still restyle every tooltip in one place (the ARBI app does, with
423
- // `!important` rules that win over these defaults).
424
- "pointer-events-none max-w-[300px] break-words rounded-md border border-border bg-popover px-3 py-2 text-sm font-normal text-popover-foreground shadow-lg",
425
- "tooltip-content",
426
- className
427
- ),
428
- style: {
429
- position: "fixed",
430
- top: coords?.top ?? -9999,
431
- left: coords?.left ?? -9999,
432
- transform: coords?.transform ?? TRANSFORM_BY_SIDE[side],
433
- opacity: coords ? void 0 : 0,
434
- zIndex: 9999,
435
- ...style
436
- },
437
- ...props
438
- }
439
- ),
440
- document.body
441
- );
442
- }
443
- );
444
- TooltipContent.displayName = "TooltipContent";
445
- function IconToggle({
446
- icon: Icon2,
447
- isActive,
448
- onToggle,
449
- colors,
450
- fillWhenActive = false,
451
- disabled = false,
452
- disabledTooltip,
453
- showLabel = false,
454
- label,
455
- tooltipActive,
456
- tooltipInactive,
457
- tooltipMixed,
458
- isMixed = false,
459
- showTooltip = true,
460
- "data-testid": dataTestId
461
- }) {
462
- const handleClick = (e) => {
463
- e.stopPropagation();
464
- onToggle(!isActive);
465
- };
466
- const { bg: bgColorClass } = colors;
467
- const tooltipText = disabled ? disabledTooltip : isMixed ? tooltipMixed : isActive ? tooltipActive : tooltipInactive;
468
- const { text: textColorClass } = colors;
469
- const button = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
470
- "button",
471
- {
472
- type: "button",
473
- onClick: handleClick,
474
- disabled,
475
- "data-testid": dataTestId,
476
- "aria-pressed": isMixed ? "mixed" : isActive,
477
- className: `
478
- group/toggle relative inline-flex items-center h-4 w-8 rounded-full
479
- transition-colors cursor-pointer
480
- disabled:opacity-50 disabled:cursor-not-allowed
481
- ${isActive ? bgColorClass : isMixed ? "bg-gray-400" : "bg-muted"}
482
- `,
483
- children: [
484
- isActive && !disabled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-0 w-4 h-4 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: "w-2.5 h-2.5 text-white/70 hidden group-hover/toggle:block" }) }),
485
- !isActive && !disabled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-0 w-4 h-4 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "w-2.5 h-2.5 text-muted-foreground hidden group-hover/toggle:block" }) }),
486
- /* @__PURE__ */ jsxRuntime.jsx(
487
- "div",
488
- {
489
- className: `
490
- absolute h-4 w-4 rounded-full bg-white shadow-sm
491
- flex items-center justify-center
492
- transition-transform duration-200
493
- ${isActive ? "translate-x-4" : "translate-x-0"}
494
- `,
495
- children: /* @__PURE__ */ jsxRuntime.jsx(
496
- Icon2,
497
- {
498
- className: `w-2.5 h-2.5 ${isActive ? textColorClass : "text-muted-foreground"} ${isActive && fillWhenActive ? "fill-current" : ""}`
499
- }
500
- )
501
- }
502
- )
503
- ]
504
- }
505
- ) });
506
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex items-center gap-2", children: [
507
- showLabel && label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-sm text-primary", children: label }),
508
- tooltipText && showTooltip ? /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
509
- /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, onFocusCapture: (e) => e.stopPropagation(), children: button }),
510
- /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: tooltipText }) })
511
- ] }) : button
512
- ] });
513
- }
514
- var DictateContext = React2.createContext(null);
515
- function DictateProvider({
516
- transcribe,
517
- onError,
518
- children
519
- }) {
520
- return /* @__PURE__ */ jsxRuntime.jsx(DictateContext.Provider, { value: { transcribe, onError }, children });
521
- }
522
- function useDictateContext() {
523
- return React2.useContext(DictateContext);
524
- }
525
- var Avatar = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
526
- AvatarPrimitive__namespace.Root,
527
- {
528
- ref,
529
- className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
530
- ...props
531
- }
532
- ));
533
- Avatar.displayName = AvatarPrimitive__namespace.Root.displayName;
534
- var AvatarImage = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
535
- AvatarPrimitive__namespace.Image,
536
- {
537
- ref,
538
- className: cn("aspect-square h-full w-full object-cover", className),
539
- ...props
540
- }
541
- ));
542
- AvatarImage.displayName = AvatarPrimitive__namespace.Image.displayName;
543
- var AvatarFallback = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
544
- AvatarPrimitive__namespace.Fallback,
545
- {
546
- ref,
547
- className: cn(
548
- "flex h-full w-full items-center justify-center rounded-full bg-muted",
549
- className
550
- ),
551
- ...props
552
- }
553
- ));
554
- AvatarFallback.displayName = AvatarPrimitive__namespace.Fallback.displayName;
555
- var badgeVariants = classVarianceAuthority.cva(
556
- "inline-flex items-center rounded-md border px-2.5 py-0.5 text-sm font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
557
- {
558
- variants: {
559
- variant: {
560
- default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
561
- accent: "border-transparent bg-ai-accent-soft text-ai-accent",
562
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
563
- destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
564
- outline: "text-foreground"
565
- }
566
- },
567
- defaultVariants: {
568
- variant: "default"
569
- }
570
- }
571
- );
572
- function Badge({ className, variant, ...props }) {
573
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
574
- }
575
- var buttonVariants = classVarianceAuthority.cva(
576
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-base font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
577
- {
578
- variants: {
579
- variant: {
580
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
581
- accent: "bg-ai-accent text-ai-accent-foreground shadow hover:bg-ai-accent/90",
582
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
583
- outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
584
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
585
- ghost: "hover:bg-accent hover:text-accent-foreground",
586
- link: "text-primary underline-offset-4 hover:underline"
587
- },
588
- size: {
589
- default: "h-9 px-4 py-2",
590
- sm: "h-8 rounded-md px-3",
591
- lg: "h-10 rounded-md px-8",
592
- icon: "h-9 w-9"
593
- }
594
- },
595
- defaultVariants: {
596
- variant: "default",
597
- size: "default"
598
- }
599
- }
600
- );
601
- var Button = React2__namespace.forwardRef(
602
- ({ className, variant, size, asChild = false, ...props }, ref) => {
603
- const Comp = asChild ? reactSlot.Slot : "button";
604
- return /* @__PURE__ */ jsxRuntime.jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props });
605
- }
606
- );
607
- Button.displayName = "Button";
608
- var HoverCard = HoverCardPrimitive__namespace.Root;
609
- var HoverCardTrigger = HoverCardPrimitive__namespace.Trigger;
610
- var HoverCardContent = React2__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(HoverCardPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
611
- HoverCardPrimitive__namespace.Content,
612
- {
613
- ref,
614
- align,
615
- sideOffset,
616
- className: cn(
617
- "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]",
618
- className
619
- ),
620
- ...props
621
- }
622
- ) }));
623
- HoverCardContent.displayName = HoverCardPrimitive__namespace.Content.displayName;
624
- var cardVariants = classVarianceAuthority.cva("rounded-lg bg-card text-card-foreground", {
625
- variants: {
626
- variant: {
627
- flat: "",
628
- outline: "border",
629
- elevated: "border shadow-sm"
630
- }
631
- },
632
- defaultVariants: {
633
- variant: "flat"
634
- }
635
- });
636
- var Card = React2__namespace.forwardRef(
637
- ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
638
- "div",
639
- {
640
- ref,
641
- "data-slot": "card",
642
- className: cn(cardVariants({ variant }), className),
643
- ...props
644
- }
645
- )
646
- );
647
- Card.displayName = "Card";
648
- var CardHeader = React2__namespace.forwardRef(
649
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
650
- "div",
651
- {
652
- ref,
653
- "data-slot": "card-header",
654
- className: cn("flex flex-col space-y-1.5 p-6", className),
655
- ...props
656
- }
657
- )
658
- );
659
- CardHeader.displayName = "CardHeader";
660
- var CardTitle = React2__namespace.forwardRef(
661
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
662
- "div",
663
- {
664
- ref,
665
- "data-slot": "card-title",
666
- className: cn("font-semibold leading-none tracking-tight", className),
667
- ...props
668
- }
669
- )
670
- );
671
- CardTitle.displayName = "CardTitle";
672
- var CardDescription = React2__namespace.forwardRef(
673
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
674
- "div",
675
- {
676
- ref,
677
- "data-slot": "card-description",
678
- className: cn("text-sm text-muted-foreground", className),
679
- ...props
680
- }
681
- )
682
- );
683
- CardDescription.displayName = "CardDescription";
684
- var CardContent = React2__namespace.forwardRef(
685
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-slot": "card-content", className: cn("p-6 pt-0", className), ...props })
686
- );
687
- CardContent.displayName = "CardContent";
688
- var CardFooter = React2__namespace.forwardRef(
689
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
690
- "div",
691
- {
692
- ref,
693
- "data-slot": "card-footer",
694
- className: cn("flex items-center p-6 pt-0", className),
695
- ...props
696
- }
697
- )
698
- );
699
- CardFooter.displayName = "CardFooter";
700
-
701
- // src/documents/media-error.ts
702
- function classifyMediaError(err, kind) {
703
- const label = kind === "camera" ? "Camera" : "Microphone";
704
- const name = err instanceof DOMException ? err.name : void 0;
705
- if (name === "NotAllowedError" || name === "SecurityError") {
706
- return `${label} access is blocked. Allow ${kind} permission in your browser settings to use this feature.`;
707
- }
708
- if (name === "NotFoundError" || name === "DevicesNotFoundError") {
709
- return `No ${kind} found on this device.`;
710
- }
711
- if (!navigator.mediaDevices?.getUserMedia) {
712
- return `${kind === "camera" ? "Camera" : "Voice"} input is not supported in this browser.`;
713
- }
714
- return `Could not access the ${kind}. Please try again.`;
715
- }
716
-
717
- // src/documents/useAudioRecorder.ts
718
- var LEVEL_UPDATE_INTERVAL_MS = 50;
719
- function useAudioRecorder() {
720
- const [state, setState] = React2.useState("idle");
721
- const [level, setLevel] = React2.useState(0);
722
- const [elapsedMs, setElapsedMs] = React2.useState(0);
723
- const [blob, setBlob] = React2.useState(null);
724
- const [mimeType, setMimeType] = React2.useState(null);
725
- const [error, setError] = React2.useState(null);
726
- const mediaRecorderRef = React2.useRef(null);
727
- const chunksRef = React2.useRef([]);
728
- const streamRef = React2.useRef(null);
729
- const stateRef = React2.useRef("idle");
730
- stateRef.current = state;
731
- const segmentStartRef = React2.useRef(0);
732
- const accumulatedMsRef = React2.useRef(0);
733
- const audioContextRef = React2.useRef(null);
734
- const analyserRef = React2.useRef(null);
735
- const levelRafRef = React2.useRef(null);
736
- const stopMeter = React2.useCallback(() => {
737
- if (levelRafRef.current !== null) cancelAnimationFrame(levelRafRef.current);
738
- levelRafRef.current = null;
739
- analyserRef.current = null;
740
- void audioContextRef.current?.close().catch(() => {
741
- });
742
- audioContextRef.current = null;
743
- }, []);
744
- const startMeter = React2.useCallback((stream) => {
745
- const audioContext = new AudioContext();
746
- const source = audioContext.createMediaStreamSource(stream);
747
- const analyser = audioContext.createAnalyser();
748
- analyser.fftSize = 256;
749
- source.connect(analyser);
750
- audioContextRef.current = audioContext;
751
- analyserRef.current = analyser;
752
- const data = new Uint8Array(analyser.frequencyBinCount);
753
- let lastUpdate = 0;
754
- const tick = (t) => {
755
- const active = analyserRef.current;
756
- if (!active) return;
757
- if (t - lastUpdate >= LEVEL_UPDATE_INTERVAL_MS) {
758
- lastUpdate = t;
759
- active.getByteTimeDomainData(data);
760
- let sumSquares = 0;
761
- for (let i = 0; i < data.length; i++) {
762
- const centered = (data[i] - 128) / 128;
763
- sumSquares += centered * centered;
764
- }
765
- const rms = Math.sqrt(sumSquares / data.length);
766
- setLevel(Math.sqrt(Math.min(1, rms * 8)));
767
- setElapsedMs(accumulatedMsRef.current + (t - segmentStartRef.current));
768
- }
769
- levelRafRef.current = requestAnimationFrame(tick);
770
- };
771
- levelRafRef.current = requestAnimationFrame(tick);
772
- }, []);
773
- const stopTracks = React2.useCallback(() => {
774
- streamRef.current?.getTracks().forEach((t) => t.stop());
775
- streamRef.current = null;
776
- }, []);
777
- React2.useEffect(
778
- () => () => {
779
- stopTracks();
780
- stopMeter();
781
- },
782
- [stopTracks, stopMeter]
783
- );
784
- const start = React2.useCallback(async () => {
785
- if (stateRef.current === "recording" || stateRef.current === "paused") return;
786
- setError(null);
787
- try {
788
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
789
- streamRef.current = stream;
790
- const mt = MediaRecorder.isTypeSupported("audio/webm") ? "audio/webm" : "audio/mp4";
791
- const recorder = new MediaRecorder(stream, { mimeType: mt });
792
- chunksRef.current = [];
793
- recorder.ondataavailable = (e) => {
794
- if (e.data.size > 0) chunksRef.current.push(e.data);
795
- };
796
- mediaRecorderRef.current = recorder;
797
- setMimeType(mt);
798
- setBlob(null);
799
- accumulatedMsRef.current = 0;
800
- segmentStartRef.current = performance.now();
801
- recorder.start();
802
- setState("recording");
803
- startMeter(stream);
804
- } catch (err) {
805
- stopTracks();
806
- setError(classifyMediaError(err, "microphone"));
807
- }
808
- }, [startMeter, stopTracks]);
809
- const pause = React2.useCallback(() => {
810
- const recorder = mediaRecorderRef.current;
811
- if (!recorder || recorder.state !== "recording") return;
812
- recorder.pause();
813
- accumulatedMsRef.current += performance.now() - segmentStartRef.current;
814
- stopMeter();
815
- setLevel(0);
816
- setState("paused");
817
- }, [stopMeter]);
818
- const resume = React2.useCallback(() => {
819
- const recorder = mediaRecorderRef.current;
820
- if (!recorder || recorder.state !== "paused") return;
821
- recorder.resume();
822
- segmentStartRef.current = performance.now();
823
- setState("recording");
824
- if (streamRef.current) startMeter(streamRef.current);
825
- }, [startMeter]);
826
- const stop = React2.useCallback(() => {
827
- const recorder = mediaRecorderRef.current;
828
- if (!recorder || recorder.state === "inactive") return;
829
- const finalElapsed = recorder.state === "paused" ? accumulatedMsRef.current : accumulatedMsRef.current + (performance.now() - segmentStartRef.current);
830
- stopMeter();
831
- recorder.onstop = () => {
832
- stopTracks();
833
- const finalBlob = chunksRef.current.length ? new Blob(chunksRef.current, { type: recorder.mimeType }) : null;
834
- setBlob(finalBlob);
835
- setElapsedMs(finalElapsed);
836
- setLevel(0);
837
- setState("stopped");
838
- };
839
- recorder.stop();
840
- }, [stopMeter, stopTracks]);
841
- const reset = React2.useCallback(() => {
842
- setState("idle");
843
- setBlob(null);
844
- setElapsedMs(0);
845
- setLevel(0);
846
- setMimeType(null);
847
- setError(null);
848
- }, []);
849
- return { state, level, elapsedMs, blob, mimeType, error, start, pause, resume, stop, reset };
850
- }
851
-
852
- // src/documents/format-elapsed.ts
853
- function formatElapsed(ms) {
854
- const totalSeconds = Math.max(0, Math.floor(ms / 1e3));
855
- const minutes = Math.floor(totalSeconds / 60);
856
- const seconds = totalSeconds % 60;
857
- return `${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
858
- }
859
- var BAR_WEIGHTS = [
860
- 0.25,
861
- 0.32,
862
- 0.48,
863
- 0.62,
864
- 0.82,
865
- 0.56,
866
- 0.92,
867
- 0.72,
868
- 1,
869
- 0.86,
870
- 0.62,
871
- 0.96,
872
- 0.76,
873
- 0.5,
874
- 0.84,
875
- 0.66,
876
- 0.42,
877
- 0.56,
878
- 0.36,
879
- 0.28,
880
- 0.22
881
- ];
882
- var MIN_BAR_PX = 3;
883
- var MAX_BAR_PX = 40;
884
- function MicWaveformIndicator({
885
- level,
886
- elapsedMs,
887
- paused = false
888
- }) {
889
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3", "data-testid": "mic-waveform-indicator", children: [
890
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
891
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative flex h-2 w-2", children: [
892
- !paused && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-red-500 opacity-75" }),
893
- /* @__PURE__ */ jsxRuntime.jsx(
894
- "span",
895
- {
896
- className: `relative inline-flex h-2 w-2 rounded-full ${paused ? "bg-muted-foreground" : "bg-red-500"}`
897
- }
898
- )
899
- ] }),
900
- /* @__PURE__ */ jsxRuntime.jsx(
901
- "span",
902
- {
903
- className: `text-xs font-semibold uppercase tracking-wide ${paused ? "text-muted-foreground" : "text-red-500"}`,
904
- children: paused ? "Paused" : "Rec"
905
- }
906
- ),
907
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-xs tabular-nums text-muted-foreground", children: formatElapsed(elapsedMs) })
908
- ] }),
909
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 items-end gap-[3px]", "data-testid": "mic-waveform-indicator-bars", children: BAR_WEIGHTS.map((weight, i) => /* @__PURE__ */ jsxRuntime.jsx(
910
- "span",
911
- {
912
- className: "w-1 rounded-full bg-secondary transition-[height] duration-75 ease-out",
913
- style: {
914
- height: Math.min(MAX_BAR_PX, Math.max(MIN_BAR_PX, level * weight * MAX_BAR_PX))
915
- }
916
- },
917
- i
918
- )) })
919
- ] });
920
- }
921
- function MicRecordingOverlay({
922
- level,
923
- elapsedMs,
924
- paused,
925
- caption = "Keep button pressed while speaking"
926
- }) {
927
- if (typeof document === "undefined") return null;
928
- return reactDom.createPortal(
929
- /* @__PURE__ */ jsxRuntime.jsx(
930
- "div",
931
- {
932
- "aria-hidden": true,
933
- className: "pointer-events-none fixed inset-0 z-[2147483647] flex items-center justify-center",
934
- "data-testid": "mic-recording-overlay",
935
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-72 flex-col items-center gap-3 rounded-2xl bg-background/95 px-6 py-5 shadow-2xl ring-1 ring-border backdrop-blur-sm", children: [
936
- /* @__PURE__ */ jsxRuntime.jsx(MicWaveformIndicator, { level, elapsedMs, paused }),
937
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-center text-sm font-medium text-muted-foreground", children: caption })
938
- ] })
939
- }
940
- ),
941
- document.body
942
- );
943
- }
944
- var HOLD_THRESHOLD_MS = 350;
945
- function InlineMicButton({
946
- focused,
947
- onTranscript,
948
- onError,
949
- transcribe,
950
- className
951
- }) {
952
- const recorder = useAudioRecorder();
953
- const [isTranscribing, setIsTranscribing] = React2.useState(false);
954
- const [latched, setLatched] = React2.useState(false);
955
- const pressedAtRef = React2.useRef(0);
956
- React2.useEffect(() => {
957
- if (recorder.error) onError?.(recorder.error);
958
- }, [recorder.error]);
959
- React2.useEffect(() => {
960
- if (recorder.state !== "stopped" || !recorder.blob) return;
961
- const blob = recorder.blob;
962
- setIsTranscribing(true);
963
- transcribe(blob).then((text) => {
964
- if (text.trim()) onTranscript(text.trim());
965
- }).catch((err) => {
966
- onError?.(err instanceof Error ? err.message : "Could not transcribe audio.");
967
- }).finally(() => {
968
- setIsTranscribing(false);
969
- setLatched(false);
970
- recorder.reset();
971
- });
972
- }, [recorder.state, recorder.blob]);
973
- const isRecording = recorder.state === "recording";
974
- const isBusy = isTranscribing;
975
- if (!focused && !isRecording && !isBusy) return null;
976
- const handlePointerDown = (e) => {
977
- e.preventDefault();
978
- if (isRecording) return;
979
- pressedAtRef.current = Date.now();
980
- void recorder.start();
981
- };
982
- const handlePointerUp = () => {
983
- if (!isRecording) return;
984
- if (latched) {
985
- recorder.stop();
986
- setLatched(false);
987
- return;
988
- }
989
- const held = Date.now() - pressedAtRef.current;
990
- if (held >= HOLD_THRESHOLD_MS) {
991
- recorder.stop();
992
- } else {
993
- setLatched(true);
994
- }
995
- };
996
- const handlePointerLeave = () => {
997
- if (isRecording && !latched) recorder.stop();
998
- };
999
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1000
- /* @__PURE__ */ jsxRuntime.jsx(
1001
- "button",
1002
- {
1003
- type: "button",
1004
- onPointerDown: handlePointerDown,
1005
- onPointerUp: handlePointerUp,
1006
- onPointerLeave: handlePointerLeave,
1007
- onPointerCancel: handlePointerLeave,
1008
- disabled: isBusy,
1009
- title: isRecording ? "Release to stop, or tap again if hands-free" : "Hold, or tap to dictate",
1010
- "data-testid": "inline-mic-button",
1011
- className: `inline-flex items-center justify-center rounded-full transition-colors disabled:pointer-events-none ${isRecording ? "h-7 w-7 bg-red-500 text-white shadow-sm hover:bg-red-600" : isBusy ? "h-6 w-6 text-muted-foreground" : "h-6 w-6 text-muted-foreground/50 hover:bg-muted hover:text-muted-foreground"} ${className ?? ""}`,
1012
- children: isBusy ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : isRecording ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Square, { className: "h-3 w-3 fill-current" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mic, { className: "h-3.5 w-3.5" })
1013
- }
1014
- ),
1015
- isRecording && /* @__PURE__ */ jsxRuntime.jsx(
1016
- MicRecordingOverlay,
1017
- {
1018
- level: recorder.level,
1019
- elapsedMs: recorder.elapsedMs,
1020
- caption: latched ? "Tap the mic again to stop" : "Release to stop, or keep holding"
1021
- }
1022
- )
1023
- ] });
1024
- }
1025
- var Input = React2__namespace.forwardRef(
1026
- ({ className, type, dictate, onFocus, onBlur, ...props }, forwardedRef) => {
1027
- const dictateCtx = useDictateContext();
1028
- const [focused, setFocused] = React2__namespace.useState(false);
1029
- const innerRef = React2__namespace.useRef(null);
1030
- React2__namespace.useImperativeHandle(forwardedRef, () => innerRef.current);
1031
- const showDictate = dictate && !!dictateCtx && !props.disabled && !props.readOnly;
1032
- const input = /* @__PURE__ */ jsxRuntime.jsx(
1033
- "input",
1034
- {
1035
- type,
1036
- "data-slot": "input",
1037
- className: cn(
1038
- "flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:border-ring/50 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1039
- showDictate && "pr-9",
1040
- className
1041
- ),
1042
- ref: innerRef,
1043
- onFocus: (e) => {
1044
- setFocused(true);
1045
- onFocus?.(e);
1046
- },
1047
- onBlur: (e) => {
1048
- setFocused(false);
1049
- onBlur?.(e);
1050
- },
1051
- ...props
1052
- }
1053
- );
1054
- if (!showDictate) return input;
1055
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
1056
- input,
1057
- /* @__PURE__ */ jsxRuntime.jsx(
1058
- InlineMicButton,
1059
- {
1060
- focused,
1061
- transcribe: dictateCtx.transcribe,
1062
- onError: dictateCtx.onError,
1063
- className: "absolute right-1.5 top-1/2 -translate-y-1/2",
1064
- onTranscript: (text) => {
1065
- const el = innerRef.current;
1066
- if (!el) return;
1067
- const next = el.value ? `${el.value} ${text}` : text;
1068
- const setter = Object.getOwnPropertyDescriptor(
1069
- window.HTMLInputElement.prototype,
1070
- "value"
1071
- )?.set;
1072
- setter?.call(el, next);
1073
- el.dispatchEvent(new Event("input", { bubbles: true }));
1074
- }
1075
- }
1076
- )
1077
- ] });
1078
- }
1079
- );
1080
- Input.displayName = "Input";
1081
- var Label = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1082
- "label",
1083
- {
1084
- ref,
1085
- className: `text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 ${className || ""}`,
1086
- ...props
1087
- }
1088
- ));
1089
- Label.displayName = "Label";
1090
- var Separator = React2__namespace.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1091
- SeparatorPrimitive__namespace.Root,
1092
- {
1093
- ref,
1094
- decorative,
1095
- orientation,
1096
- className: cn(
1097
- "shrink-0 bg-border",
1098
- orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
1099
- className
1100
- ),
1101
- ...props
1102
- }
1103
- ));
1104
- Separator.displayName = SeparatorPrimitive__namespace.Root.displayName;
1105
- var Textarea = React2__namespace.forwardRef(
1106
- ({ className, dictate, onFocus, onBlur, ...props }, forwardedRef) => {
1107
- const dictateCtx = useDictateContext();
1108
- const [focused, setFocused] = React2__namespace.useState(false);
1109
- const innerRef = React2__namespace.useRef(null);
1110
- React2__namespace.useImperativeHandle(forwardedRef, () => innerRef.current);
1111
- const showDictate = dictate && !!dictateCtx && !props.disabled && !props.readOnly;
1112
- const textarea = /* @__PURE__ */ jsxRuntime.jsx(
1113
- "textarea",
1114
- {
1115
- className: cn(
1116
- "flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:border-ring/50 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1117
- showDictate && "pr-9",
1118
- className
1119
- ),
1120
- ref: innerRef,
1121
- onFocus: (e) => {
1122
- setFocused(true);
1123
- onFocus?.(e);
1124
- },
1125
- onBlur: (e) => {
1126
- setFocused(false);
1127
- onBlur?.(e);
1128
- },
1129
- ...props
1130
- }
1131
- );
1132
- if (!showDictate) return textarea;
1133
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
1134
- textarea,
1135
- /* @__PURE__ */ jsxRuntime.jsx(
1136
- InlineMicButton,
1137
- {
1138
- focused,
1139
- transcribe: dictateCtx.transcribe,
1140
- onError: dictateCtx.onError,
1141
- className: "absolute right-1.5 top-1.5",
1142
- onTranscript: (text) => {
1143
- const el = innerRef.current;
1144
- if (!el) return;
1145
- const next = el.value ? `${el.value} ${text}` : text;
1146
- const setter = Object.getOwnPropertyDescriptor(
1147
- window.HTMLTextAreaElement.prototype,
1148
- "value"
1149
- )?.set;
1150
- setter?.call(el, next);
1151
- el.dispatchEvent(new Event("input", { bubbles: true }));
1152
- }
1153
- }
1154
- )
1155
- ] });
1156
- }
1157
- );
1158
- Textarea.displayName = "Textarea";
1159
- var Collapsible = CollapsiblePrimitive__namespace.Root;
1160
- var CollapsibleTrigger2 = CollapsiblePrimitive__namespace.CollapsibleTrigger;
1161
- var CollapsibleContent2 = CollapsiblePrimitive__namespace.CollapsibleContent;
1162
- var Progress = React2__namespace.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1163
- ProgressPrimitive__namespace.Root,
1164
- {
1165
- ref,
1166
- className: cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className),
1167
- ...props,
1168
- children: /* @__PURE__ */ jsxRuntime.jsx(
1169
- ProgressPrimitive__namespace.Indicator,
1170
- {
1171
- className: "h-full w-full flex-1 bg-primary transition-all",
1172
- style: { transform: `translateX(-${100 - (value || 0)}%)` }
1173
- }
1174
- )
1175
- }
1176
- ));
1177
- Progress.displayName = ProgressPrimitive__namespace.Root.displayName;
1178
- var ScrollArea = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1179
- ScrollAreaPrimitive__namespace.Root,
1180
- {
1181
- ref,
1182
- className: cn("relative overflow-hidden", className),
1183
- ...props,
1184
- children: [
1185
- /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
1186
- /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, {}),
1187
- /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
1188
- ]
1189
- }
1190
- ));
1191
- ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
1192
- var ScrollBar = React2__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1193
- ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
1194
- {
1195
- ref,
1196
- orientation,
1197
- className: cn(
1198
- "flex touch-none select-none transition-colors",
1199
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
1200
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
1201
- className
1202
- ),
1203
- ...props,
1204
- children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
1205
- }
1206
- ));
1207
- ScrollBar.displayName = ScrollAreaPrimitive__namespace.ScrollAreaScrollbar.displayName;
1208
- var RadioGroup = React2__namespace.forwardRef(({ className, ...props }, ref) => {
1209
- return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Root, { className: cn("grid gap-2", className), ...props, ref });
1210
- });
1211
- RadioGroup.displayName = RadioGroupPrimitive__namespace.Root.displayName;
1212
- var RadioGroupItem = React2__namespace.forwardRef(({ className, ...props }, ref) => {
1213
- return /* @__PURE__ */ jsxRuntime.jsx(
1214
- RadioGroupPrimitive__namespace.Item,
1215
- {
1216
- ref,
1217
- className: cn(
1218
- "aspect-square h-4 w-4 rounded-full border border-primary text-primary focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1219
- className
1220
- ),
1221
- ...props,
1222
- children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
1223
- }
1224
- );
1225
- });
1226
- RadioGroupItem.displayName = RadioGroupPrimitive__namespace.Item.displayName;
1227
- var Checkbox = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1228
- CheckboxPrimitive__namespace.Root,
1229
- {
1230
- ref,
1231
- className: cn(
1232
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
1233
- className
1234
- ),
1235
- ...props,
1236
- children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxPrimitive__namespace.Indicator, { className: cn("flex items-center justify-center text-current"), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) })
1237
- }
1238
- ));
1239
- Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
1240
- var Switch = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1241
- SwitchPrimitives__namespace.Root,
1242
- {
1243
- className: cn(
1244
- "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
1245
- className
1246
- ),
1247
- ...props,
1248
- ref,
1249
- children: /* @__PURE__ */ jsxRuntime.jsx(
1250
- SwitchPrimitives__namespace.Thumb,
1251
- {
1252
- className: cn(
1253
- "pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
1254
- )
1255
- }
1256
- )
1257
- }
1258
- ));
1259
- Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
1260
- var Tabs = TabsPrimitive__namespace.Root;
1261
- var TabsList = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1262
- TabsPrimitive__namespace.List,
1263
- {
1264
- ref,
1265
- className: cn(
1266
- "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
1267
- className
1268
- ),
1269
- ...props
1270
- }
1271
- ));
1272
- TabsList.displayName = TabsPrimitive__namespace.List.displayName;
1273
- var TabsTrigger = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1274
- TabsPrimitive__namespace.Trigger,
1275
- {
1276
- ref,
1277
- className: cn(
1278
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
1279
- className
1280
- ),
1281
- ...props
1282
- }
1283
- ));
1284
- TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
1285
- var TabsContent = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1286
- TabsPrimitive__namespace.Content,
1287
- {
1288
- ref,
1289
- className: cn(
1290
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1291
- className
1292
- ),
1293
- ...props
1294
- }
1295
- ));
1296
- TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
1297
- var Table = React2__namespace.forwardRef(
1298
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props }) })
1299
- );
1300
- Table.displayName = "Table";
1301
- var TableHeader = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
1302
- TableHeader.displayName = "TableHeader";
1303
- var TableBody = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
1304
- TableBody.displayName = "TableBody";
1305
- var TableFooter = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1306
- "tfoot",
1307
- {
1308
- ref,
1309
- className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className),
1310
- ...props
1311
- }
1312
- ));
1313
- TableFooter.displayName = "TableFooter";
1314
- var TableRow = React2__namespace.forwardRef(
1315
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1316
- "tr",
1317
- {
1318
- ref,
1319
- className: cn(
1320
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
1321
- className
1322
- ),
1323
- ...props
1324
- }
1325
- )
1326
- );
1327
- TableRow.displayName = "TableRow";
1328
- var TableHead = React2__namespace.forwardRef(
1329
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1330
- "th",
1331
- {
1332
- ref,
1333
- className: cn(
1334
- "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
1335
- className
1336
- ),
1337
- ...props
1338
- }
1339
- )
1340
- );
1341
- TableHead.displayName = "TableHead";
1342
- var TableCell = React2__namespace.forwardRef(
1343
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1344
- "td",
1345
- {
1346
- ref,
1347
- className: cn(
1348
- "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
1349
- className
1350
- ),
1351
- ...props
1352
- }
1353
- )
1354
- );
1355
- TableCell.displayName = "TableCell";
1356
- var TableCaption = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
1357
- TableCaption.displayName = "TableCaption";
1358
- var Slider = React2__namespace.forwardRef(
1359
- ({ className, rangeClassName, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1360
- SliderPrimitive__namespace.Root,
1361
- {
1362
- ref,
1363
- className: cn("relative flex w-full touch-none select-none items-center", className),
1364
- ...props,
1365
- children: [
1366
- /* @__PURE__ */ jsxRuntime.jsx(SliderPrimitive__namespace.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20", children: /* @__PURE__ */ jsxRuntime.jsx(SliderPrimitive__namespace.Range, { className: cn("absolute h-full bg-primary", rangeClassName) }) }),
1367
- /* @__PURE__ */ jsxRuntime.jsx(SliderPrimitive__namespace.Thumb, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" })
1368
- ]
1369
- }
1370
- )
1371
- );
1372
- Slider.displayName = SliderPrimitive__namespace.Root.displayName;
1373
- var toggleVariants = classVarianceAuthority.cva(
1374
- "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
1375
- {
1376
- variants: {
1377
- variant: {
1378
- default: "bg-transparent",
1379
- outline: "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"
1380
- },
1381
- size: {
1382
- default: "h-9 px-2 min-w-9",
1383
- sm: "h-8 px-1.5 min-w-8",
1384
- lg: "h-10 px-2.5 min-w-10"
1385
- }
1386
- },
1387
- defaultVariants: {
1388
- variant: "default",
1389
- size: "default"
1390
- }
1391
- }
1392
- );
1393
- var Toggle = React2__namespace.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1394
- TogglePrimitive__namespace.Root,
1395
- {
1396
- ref,
1397
- className: cn(toggleVariants({ variant, size, className })),
1398
- ...props
1399
- }
1400
- ));
1401
- Toggle.displayName = TogglePrimitive__namespace.Root.displayName;
1402
- var ToggleGroupContext = React2__namespace.createContext({
1403
- size: "default",
1404
- variant: "default"
1405
- });
1406
- var ToggleGroup = React2__namespace.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1407
- ToggleGroupPrimitive__namespace.Root,
1408
- {
1409
- ref,
1410
- className: cn("flex items-center justify-center gap-1", className),
1411
- ...props,
1412
- children: /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
1413
- }
1414
- ));
1415
- ToggleGroup.displayName = ToggleGroupPrimitive__namespace.Root.displayName;
1416
- var ToggleGroupItem = React2__namespace.forwardRef(({ className, children, variant, size, ...props }, ref) => {
1417
- const context = React2__namespace.useContext(ToggleGroupContext);
1418
- return /* @__PURE__ */ jsxRuntime.jsx(
1419
- ToggleGroupPrimitive__namespace.Item,
1420
- {
1421
- ref,
1422
- className: cn(
1423
- toggleVariants({
1424
- variant: context.variant || variant,
1425
- size: context.size || size
1426
- }),
1427
- className
1428
- ),
1429
- ...props,
1430
- children
1431
- }
1432
- );
1433
- });
1434
- ToggleGroupItem.displayName = ToggleGroupPrimitive__namespace.Item.displayName;
1435
- var Dialog = DialogPrimitive__namespace.Root;
1436
- var DialogTrigger = DialogPrimitive__namespace.Trigger;
1437
- var DialogPortal = DialogPrimitive__namespace.Portal;
1438
- var DialogClose = DialogPrimitive__namespace.Close;
1439
- var DialogOverlay = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1440
- DialogPrimitive__namespace.Overlay,
1441
- {
1442
- ref,
1443
- className: cn(
1444
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1445
- className
1446
- ),
1447
- ...props
1448
- }
1449
- ));
1450
- DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
1451
- var DialogContent = React2__namespace.forwardRef(({ className, children, hideCloseButton, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
1452
- /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
1453
- /* @__PURE__ */ jsxRuntime.jsxs(
1454
- DialogPrimitive__namespace.Content,
1455
- {
1456
- ref,
1457
- className: cn(
1458
- "fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg max-h-[90vh] translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-md",
1459
- className
1460
- ),
1461
- ...props,
1462
- children: [
1463
- children,
1464
- !hideCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
1465
- DialogPrimitive__namespace.Close,
1466
- {
1467
- className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
1468
- "data-testid": "dialog-close-button",
1469
- children: [
1470
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
1471
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close dialog" })
1472
- ]
1473
- }
1474
- )
1475
- ]
1476
- }
1477
- )
1478
- ] }));
1479
- DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
1480
- var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
1481
- DialogHeader.displayName = "DialogHeader";
1482
- var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
1483
- "div",
1484
- {
1485
- className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
1486
- ...props
1487
- }
1488
- );
1489
- DialogFooter.displayName = "DialogFooter";
1490
- var DialogTitle = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1491
- DialogPrimitive__namespace.Title,
1492
- {
1493
- ref,
1494
- className: cn("text-lg font-semibold leading-none tracking-tight", className),
1495
- ...props
1496
- }
1497
- ));
1498
- DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
1499
- var DialogDescription = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1500
- DialogPrimitive__namespace.Description,
1501
- {
1502
- ref,
1503
- className: cn("text-sm text-muted-foreground", className),
1504
- ...props
1505
- }
1506
- ));
1507
- DialogDescription.displayName = DialogPrimitive__namespace.Description.displayName;
1508
- var Popover = PopoverPrimitive__namespace.Root;
1509
- var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
1510
- var PopoverAnchor = PopoverPrimitive__namespace.Anchor;
1511
- var PopoverContent = React2__namespace.forwardRef(({ className, align = "center", sideOffset = 4, container, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { container: container ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
1512
- PopoverPrimitive__namespace.Content,
1513
- {
1514
- ref,
1515
- align,
1516
- sideOffset,
1517
- className: cn(
1518
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
1519
- className
1520
- ),
1521
- ...props
1522
- }
1523
- ) }));
1524
- PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
1525
- var DropdownMenu = DropdownMenuPrimitive__namespace.Root;
1526
- var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
1527
- var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
1528
- var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
1529
- var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
1530
- var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
1531
- var DropdownMenuSubTrigger = React2__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1532
- DropdownMenuPrimitive__namespace.SubTrigger,
1533
- {
1534
- ref,
1535
- className: cn(
1536
- "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
1537
- inset && "pl-8",
1538
- className
1539
- ),
1540
- ...props,
1541
- children: [
1542
- children,
1543
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "ml-auto" })
1544
- ]
1545
- }
1546
- ));
1547
- DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
1548
- var DropdownMenuSubContent = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1549
- DropdownMenuPrimitive__namespace.SubContent,
1550
- {
1551
- ref,
1552
- className: cn(
1553
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
1554
- className
1555
- ),
1556
- ...props
1557
- }
1558
- ));
1559
- DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
1560
- var DropdownMenuContent = React2__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
1561
- DropdownMenuPrimitive__namespace.Content,
1562
- {
1563
- ref,
1564
- sideOffset,
1565
- className: cn(
1566
- "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
1567
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
1568
- className
1569
- ),
1570
- ...props
1571
- }
1572
- ) }));
1573
- DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
1574
- var DropdownMenuItem = React2__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1575
- DropdownMenuPrimitive__namespace.Item,
1576
- {
1577
- ref,
1578
- className: cn(
1579
- "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
1580
- inset && "pl-8",
1581
- className
1582
- ),
1583
- ...props
1584
- }
1585
- ));
1586
- DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
1587
- var DropdownMenuCheckboxItem = React2__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1588
- DropdownMenuPrimitive__namespace.CheckboxItem,
1589
- {
1590
- ref,
1591
- className: cn(
1592
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1593
- className
1594
- ),
1595
- checked,
1596
- ...props,
1597
- children: [
1598
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-4 w-4 items-center justify-center rounded border border-border bg-popover", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-3.5 w-3.5 text-primary" }) }) }),
1599
- children
1600
- ]
1601
- }
1602
- ));
1603
- DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
1604
- var DropdownMenuRadioItem = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1605
- DropdownMenuPrimitive__namespace.RadioItem,
1606
- {
1607
- ref,
1608
- className: cn(
1609
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1610
- className
1611
- ),
1612
- ...props,
1613
- children: [
1614
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-2 w-2 fill-current" }) }) }),
1615
- children
1616
- ]
1617
- }
1618
- ));
1619
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
1620
- var DropdownMenuLabel = React2__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1621
- DropdownMenuPrimitive__namespace.Label,
1622
- {
1623
- ref,
1624
- className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
1625
- ...props
1626
- }
1627
- ));
1628
- DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
1629
- var DropdownMenuSeparator = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1630
- DropdownMenuPrimitive__namespace.Separator,
1631
- {
1632
- ref,
1633
- className: cn("-mx-1 my-1 h-px bg-muted", className),
1634
- ...props
1635
- }
1636
- ));
1637
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive__namespace.Separator.displayName;
1638
- var DropdownMenuShortcut = ({ className, ...props }) => {
1639
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("ml-auto text-sm tracking-widest opacity-60", className), ...props });
1640
- };
1641
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
1642
- var Select = SelectPrimitive__namespace.Root;
1643
- var SelectGroup = SelectPrimitive__namespace.Group;
1644
- var SelectValue = SelectPrimitive__namespace.Value;
1645
- var SelectTrigger = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1646
- SelectPrimitive__namespace.Trigger,
1647
- {
1648
- ref,
1649
- className: cn(
1650
- "flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground/60 focus:outline-none focus-visible:border-ring/50 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
1651
- className
1652
- ),
1653
- ...props,
1654
- children: [
1655
- children,
1656
- /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-50" }) })
1657
- ]
1658
- }
1659
- ));
1660
- SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
1661
- var SelectScrollUpButton = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1662
- SelectPrimitive__namespace.ScrollUpButton,
1663
- {
1664
- ref,
1665
- className: cn("flex cursor-default items-center justify-center py-1", className),
1666
- ...props,
1667
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-4 w-4" })
1668
- }
1669
- ));
1670
- SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
1671
- var SelectScrollDownButton = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1672
- SelectPrimitive__namespace.ScrollDownButton,
1673
- {
1674
- ref,
1675
- className: cn("flex cursor-default items-center justify-center py-1", className),
1676
- ...props,
1677
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" })
1678
- }
1679
- ));
1680
- SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
1681
- var SelectContent = React2__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
1682
- SelectPrimitive__namespace.Content,
1683
- {
1684
- ref,
1685
- className: cn(
1686
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1687
- position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1688
- className
1689
- ),
1690
- position,
1691
- ...props,
1692
- children: [
1693
- /* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
1694
- /* @__PURE__ */ jsxRuntime.jsx(
1695
- SelectPrimitive__namespace.Viewport,
1696
- {
1697
- className: cn(
1698
- "p-1",
1699
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
1700
- ),
1701
- children
1702
- }
1703
- ),
1704
- /* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
1705
- ]
1706
- }
1707
- ) }));
1708
- SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
1709
- var SelectLabel = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1710
- SelectPrimitive__namespace.Label,
1711
- {
1712
- ref,
1713
- className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
1714
- ...props
1715
- }
1716
- ));
1717
- SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
1718
- var SelectItem = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1719
- SelectPrimitive__namespace.Item,
1720
- {
1721
- ref,
1722
- className: cn(
1723
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1724
- className
1725
- ),
1726
- ...props,
1727
- children: [
1728
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
1729
- /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
1730
- ]
1731
- }
1732
- ));
1733
- SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
1734
- var SelectSeparator = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1735
- SelectPrimitive__namespace.Separator,
1736
- {
1737
- ref,
1738
- className: cn("-mx-1 my-1 h-px bg-muted", className),
1739
- ...props
1740
- }
1741
- ));
1742
- SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
1743
- var Command = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1744
- cmdk.Command,
1745
- {
1746
- ref,
1747
- className: cn(
1748
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
1749
- className
1750
- ),
1751
- ...props
1752
- }
1753
- ));
1754
- Command.displayName = cmdk.Command.displayName;
1755
- var CommandDialog = ({ children, ...props }) => {
1756
- return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) }) });
1757
- };
1758
- var CommandInput = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center border-b px-3", "data-cmdk-input-wrapper": "", children: [
1759
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
1760
- /* @__PURE__ */ jsxRuntime.jsx(
1761
- cmdk.Command.Input,
1762
- {
1763
- ref,
1764
- className: cn(
1765
- "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
1766
- className
1767
- ),
1768
- ...props
1769
- }
1770
- )
1771
- ] }));
1772
- CommandInput.displayName = cmdk.Command.Input.displayName;
1773
- var CommandList = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1774
- cmdk.Command.List,
1775
- {
1776
- ref,
1777
- className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
1778
- ...props
1779
- }
1780
- ));
1781
- CommandList.displayName = cmdk.Command.List.displayName;
1782
- var CommandEmpty = React2__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(cmdk.Command.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
1783
- CommandEmpty.displayName = cmdk.Command.Empty.displayName;
1784
- var CommandGroup = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1785
- cmdk.Command.Group,
1786
- {
1787
- ref,
1788
- className: cn(
1789
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-sm [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
1790
- className
1791
- ),
1792
- ...props
1793
- }
1794
- ));
1795
- CommandGroup.displayName = cmdk.Command.Group.displayName;
1796
- var CommandSeparator = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1797
- cmdk.Command.Separator,
1798
- {
1799
- ref,
1800
- className: cn("-mx-1 h-px bg-border", className),
1801
- ...props
1802
- }
1803
- ));
1804
- CommandSeparator.displayName = cmdk.Command.Separator.displayName;
1805
- var CommandItem = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1806
- cmdk.Command.Item,
1807
- {
1808
- ref,
1809
- className: cn(
1810
- "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
1811
- className
1812
- ),
1813
- ...props
1814
- }
1815
- ));
1816
- CommandItem.displayName = cmdk.Command.Item.displayName;
1817
- var CommandShortcut = ({ className, ...props }) => {
1818
- return /* @__PURE__ */ jsxRuntime.jsx(
1819
- "span",
1820
- {
1821
- className: cn("ml-auto text-sm tracking-widest text-muted-foreground", className),
1822
- ...props
1823
- }
1824
- );
1825
- };
1826
- CommandShortcut.displayName = "CommandShortcut";
1827
- var AI_COMPONENTS = {
1828
- a: (p) => /* @__PURE__ */ jsxRuntime.jsx(
1829
- "a",
1830
- {
1831
- className: "text-ai-accent underline underline-offset-2",
1832
- target: "_blank",
1833
- rel: "noopener noreferrer",
1834
- ...p
1835
- }
1836
- ),
1837
- // Redline marks: deletions in red strike, <ins>/<mark> additions accented.
1838
- del: (p) => /* @__PURE__ */ jsxRuntime.jsx("del", { className: "rounded bg-destructive/10 text-destructive decoration-destructive/60", ...p }),
1839
- ins: (p) => /* @__PURE__ */ jsxRuntime.jsx("ins", { className: "rounded bg-ai-accent-soft px-0.5 text-ai-accent no-underline", ...p }),
1840
- mark: (p) => /* @__PURE__ */ jsxRuntime.jsx("mark", { className: "rounded bg-ai-accent-soft px-0.5 text-ai-accent", ...p }),
1841
- thead: (p) => /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-secondary/60", ...p })
1842
- };
1843
- function AiMarkdown({
1844
- children,
1845
- className,
1846
- isStreaming
1847
- }) {
1848
- return /* @__PURE__ */ jsxRuntime.jsx(
1849
- MarkdownRenderer,
1850
- {
1851
- className: className ?? "text-sm text-foreground",
1852
- components: AI_COMPONENTS,
1853
- isStreaming,
1854
- testId: "ai-markdown",
1855
- children
1856
- }
1857
- );
1858
- }
1859
-
1860
- exports.AiMarkdown = AiMarkdown;
1861
- exports.Avatar = Avatar;
1862
- exports.AvatarFallback = AvatarFallback;
1863
- exports.AvatarImage = AvatarImage;
1864
- exports.Badge = Badge;
1865
- exports.Button = Button;
1866
- exports.Card = Card;
1867
- exports.CardContent = CardContent;
1868
- exports.CardDescription = CardDescription;
1869
- exports.CardFooter = CardFooter;
1870
- exports.CardHeader = CardHeader;
1871
- exports.CardTitle = CardTitle;
1872
- exports.Checkbox = Checkbox;
1873
- exports.Collapsible = Collapsible;
1874
- exports.CollapsibleContent = CollapsibleContent2;
1875
- exports.CollapsibleTrigger = CollapsibleTrigger2;
1876
- exports.Command = Command;
1877
- exports.CommandDialog = CommandDialog;
1878
- exports.CommandEmpty = CommandEmpty;
1879
- exports.CommandGroup = CommandGroup;
1880
- exports.CommandInput = CommandInput;
1881
- exports.CommandItem = CommandItem;
1882
- exports.CommandList = CommandList;
1883
- exports.CommandSeparator = CommandSeparator;
1884
- exports.CommandShortcut = CommandShortcut;
1885
- exports.Dialog = Dialog;
1886
- exports.DialogClose = DialogClose;
1887
- exports.DialogContent = DialogContent;
1888
- exports.DialogDescription = DialogDescription;
1889
- exports.DialogFooter = DialogFooter;
1890
- exports.DialogHeader = DialogHeader;
1891
- exports.DialogOverlay = DialogOverlay;
1892
- exports.DialogPortal = DialogPortal;
1893
- exports.DialogTitle = DialogTitle;
1894
- exports.DialogTrigger = DialogTrigger;
1895
- exports.DictateProvider = DictateProvider;
1896
- exports.DropdownMenu = DropdownMenu;
1897
- exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
1898
- exports.DropdownMenuContent = DropdownMenuContent;
1899
- exports.DropdownMenuGroup = DropdownMenuGroup;
1900
- exports.DropdownMenuItem = DropdownMenuItem;
1901
- exports.DropdownMenuLabel = DropdownMenuLabel;
1902
- exports.DropdownMenuPortal = DropdownMenuPortal;
1903
- exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
1904
- exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
1905
- exports.DropdownMenuSeparator = DropdownMenuSeparator;
1906
- exports.DropdownMenuShortcut = DropdownMenuShortcut;
1907
- exports.DropdownMenuSub = DropdownMenuSub;
1908
- exports.DropdownMenuSubContent = DropdownMenuSubContent;
1909
- exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
1910
- exports.DropdownMenuTrigger = DropdownMenuTrigger;
1911
- exports.HoverCard = HoverCard;
1912
- exports.HoverCardContent = HoverCardContent;
1913
- exports.HoverCardTrigger = HoverCardTrigger;
1914
- exports.IconToggle = IconToggle;
1915
- exports.InlineMicButton = InlineMicButton;
1916
- exports.Input = Input;
1917
- exports.Label = Label;
1918
- exports.MarkdownRenderer = MarkdownRenderer;
1919
- exports.MarkdownStreamingContext = MarkdownStreamingContext;
1920
- exports.MicRecordingOverlay = MicRecordingOverlay;
1921
- exports.MicWaveformIndicator = MicWaveformIndicator;
1922
- exports.Popover = Popover;
1923
- exports.PopoverAnchor = PopoverAnchor;
1924
- exports.PopoverContent = PopoverContent;
1925
- exports.PopoverTrigger = PopoverTrigger;
1926
- exports.Progress = Progress;
1927
- exports.RadioGroup = RadioGroup;
1928
- exports.RadioGroupItem = RadioGroupItem;
1929
- exports.ScrollArea = ScrollArea;
1930
- exports.ScrollBar = ScrollBar;
1931
- exports.Select = Select;
1932
- exports.SelectContent = SelectContent;
1933
- exports.SelectGroup = SelectGroup;
1934
- exports.SelectItem = SelectItem;
1935
- exports.SelectLabel = SelectLabel;
1936
- exports.SelectScrollDownButton = SelectScrollDownButton;
1937
- exports.SelectScrollUpButton = SelectScrollUpButton;
1938
- exports.SelectSeparator = SelectSeparator;
1939
- exports.SelectTrigger = SelectTrigger;
1940
- exports.SelectValue = SelectValue;
1941
- exports.Separator = Separator;
1942
- exports.Slider = Slider;
1943
- exports.Switch = Switch;
1944
- exports.Table = Table;
1945
- exports.TableBody = TableBody;
1946
- exports.TableCaption = TableCaption;
1947
- exports.TableCell = TableCell;
1948
- exports.TableFooter = TableFooter;
1949
- exports.TableHead = TableHead;
1950
- exports.TableHeader = TableHeader;
1951
- exports.TableRow = TableRow;
1952
- exports.Tabs = Tabs;
1953
- exports.TabsContent = TabsContent;
1954
- exports.TabsList = TabsList;
1955
- exports.TabsTrigger = TabsTrigger;
1956
- exports.Textarea = Textarea;
1957
- exports.Toggle = Toggle;
1958
- exports.ToggleGroup = ToggleGroup;
1959
- exports.ToggleGroupItem = ToggleGroupItem;
1960
- exports.Tooltip = Tooltip;
1961
- exports.TooltipContent = TooltipContent;
1962
- exports.TooltipProvider = TooltipProvider;
1963
- exports.TooltipTrigger = TooltipTrigger;
1964
- exports.badgeVariants = badgeVariants;
1965
- exports.buttonVariants = buttonVariants;
1966
- exports.cardVariants = cardVariants;
1967
- exports.classifyMediaError = classifyMediaError;
1968
- exports.cn = cn;
1969
- exports.formatElapsed = formatElapsed;
1970
- exports.markdownBaseComponents = markdownBaseComponents;
1971
- exports.splitMarkdownBlocks = splitMarkdownBlocks;
1972
- exports.toggleVariants = toggleVariants;
1973
- exports.useAudioRecorder = useAudioRecorder;
1974
- //# sourceMappingURL=chunk-FIPS3VPH.cjs.map
1975
- //# sourceMappingURL=chunk-FIPS3VPH.cjs.map