@discuss-ds/ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,3497 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ AIMiniAvatar: () => AIMiniAvatar,
34
+ AIResponseContainer: () => AIResponseContainer,
35
+ ActivityStructure: () => ActivityStructure,
36
+ AskAiInput: () => AskAiInput,
37
+ AskAiToggle: () => AskAiToggle,
38
+ Button: () => Button,
39
+ Calendar: () => Calendar,
40
+ ChatChoices: () => ChatChoices,
41
+ ChatInput: () => ChatInput,
42
+ ChatOption: () => ChatOption,
43
+ Checkbox: () => Checkbox,
44
+ CheckboxField: () => CheckboxField,
45
+ DatePicker: () => DatePicker,
46
+ DateTimePicker: () => DateTimePicker,
47
+ Dialog: () => Dialog,
48
+ DialogBody: () => DialogBody,
49
+ DialogClose: () => DialogClose,
50
+ DialogContent: () => DialogContent,
51
+ DialogDescription: () => DialogDescription,
52
+ DialogFooter: () => DialogFooter,
53
+ DialogHeader: () => DialogHeader,
54
+ DialogTitle: () => DialogTitle,
55
+ DialogTrigger: () => DialogTrigger,
56
+ DropdownMenu: () => DropdownMenu,
57
+ DropdownMenuCheckboxItem: () => DropdownMenuCheckboxItem,
58
+ DropdownMenuContent: () => DropdownMenuContent,
59
+ DropdownMenuGroup: () => DropdownMenuGroup,
60
+ DropdownMenuItem: () => DropdownMenuItem,
61
+ DropdownMenuLabel: () => DropdownMenuLabel,
62
+ DropdownMenuRadioGroup: () => DropdownMenuRadioGroup,
63
+ DropdownMenuRadioItem: () => DropdownMenuRadioItem,
64
+ DropdownMenuSeparator: () => DropdownMenuSeparator,
65
+ DropdownMenuSub: () => DropdownMenuSub,
66
+ DropdownMenuSubContent: () => DropdownMenuSubContent,
67
+ DropdownMenuSubTrigger: () => DropdownMenuSubTrigger,
68
+ DropdownMenuTrigger: () => DropdownMenuTrigger,
69
+ EditableTag: () => EditableTag,
70
+ Field: () => Field,
71
+ FileAttachment: () => FileAttachment,
72
+ FileUploadItem: () => FileUploadItem,
73
+ FileUploadZone: () => FileUploadZone,
74
+ Form: () => Form,
75
+ FormControl: () => FormControl,
76
+ FormDescription: () => FormDescription,
77
+ FormField: () => FormField,
78
+ FormItem: () => FormItem,
79
+ FormLabel: () => FormLabel,
80
+ FormMessage: () => FormMessage,
81
+ ImagePreview: () => ImagePreview,
82
+ ImageThumbnails: () => ImageThumbnails,
83
+ Input: () => Input,
84
+ InputWithAction: () => InputWithAction,
85
+ Label: () => Label,
86
+ MediaInfo: () => MediaInfo,
87
+ NumberInput: () => NumberInput,
88
+ OpenEndAnswer: () => OpenEndAnswer,
89
+ Pagination: () => Pagination,
90
+ Progress: () => Progress,
91
+ ProjectSelector: () => ProjectSelector,
92
+ QuestionCard: () => QuestionCard,
93
+ QuestionEditorCard: () => QuestionEditorCard,
94
+ QuestionHeader: () => QuestionHeader,
95
+ QuestionNavItem: () => QuestionNavItem,
96
+ QuestionOption: () => QuestionOption,
97
+ QuestionOptionEditor: () => QuestionOptionEditor,
98
+ QuestionOtherOption: () => QuestionOtherOption,
99
+ QuestionTypeIcon: () => QuestionTypeIcon,
100
+ RadioGroup: () => RadioGroup,
101
+ RadioGroupFieldItem: () => RadioGroupFieldItem,
102
+ RadioGroupItem: () => RadioGroupItem,
103
+ RankList: () => RankList,
104
+ RatingScale: () => RatingScale,
105
+ RoleTag: () => RoleTag,
106
+ SearchBar: () => SearchBar,
107
+ Select: () => Select,
108
+ SelectContent: () => SelectContent,
109
+ SelectGroup: () => SelectGroup,
110
+ SelectItem: () => SelectItem,
111
+ SelectTrigger: () => SelectTrigger,
112
+ SelectValue: () => SelectValue,
113
+ Slider: () => Slider,
114
+ StatCard: () => StatCard,
115
+ StatusTag: () => StatusTag,
116
+ Switch: () => Switch,
117
+ TabItem: () => TabItem,
118
+ TabNavigation: () => TabNavigation,
119
+ TabNavigationContext: () => TabNavigationContext,
120
+ Table: () => Table,
121
+ TableBody: () => TableBody,
122
+ TableCell: () => TableCell,
123
+ TableCellTwoLines: () => TableCellTwoLines,
124
+ TableHead: () => TableHead,
125
+ TableHeader: () => TableHeader,
126
+ TableRow: () => TableRow,
127
+ Tabs: () => Tabs,
128
+ TabsContent: () => TabsContent,
129
+ Tag: () => Tag,
130
+ Textarea: () => Textarea,
131
+ TimeItem: () => TimeItem,
132
+ TimePicker: () => TimePicker,
133
+ Timestamp: () => Timestamp,
134
+ Toast: () => Toast,
135
+ ToastAction: () => ToastAction,
136
+ ToastInline: () => ToastInline,
137
+ ToastProvider: () => ToastProvider,
138
+ ToastViewport: () => ToastViewport,
139
+ Toggle: () => Toggle,
140
+ Tooltip: () => Tooltip,
141
+ TooltipContent: () => TooltipContent,
142
+ TooltipProvider: () => TooltipProvider,
143
+ TooltipTrigger: () => TooltipTrigger,
144
+ TopicActivityRow: () => TopicActivityRow,
145
+ TopicCard: () => TopicCard,
146
+ TopicCardMetaItem: () => TopicCardMetaItem,
147
+ TopicCardTag: () => TopicCardTag,
148
+ UserMessageBubble: () => UserMessageBubble,
149
+ VideoPlayer: () => VideoPlayer,
150
+ VolumeControl: () => VolumeControl,
151
+ fieldSurfaceClasses: () => fieldSurfaceClasses,
152
+ formatDateTime: () => formatDateTime,
153
+ getPaginationItems: () => getPaginationItems,
154
+ useFormField: () => useFormField
155
+ });
156
+ module.exports = __toCommonJS(index_exports);
157
+
158
+ // src/components/Buttons & Actions/Button.tsx
159
+ var React = __toESM(require("react"), 1);
160
+ var import_radix_ui = require("radix-ui");
161
+ var import_class_variance_authority = require("class-variance-authority");
162
+
163
+ // src/lib/utils.ts
164
+ var import_clsx = require("clsx");
165
+ var import_tailwind_merge = require("tailwind-merge");
166
+ var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
167
+ extend: {
168
+ classGroups: {
169
+ "font-size": [
170
+ {
171
+ text: [
172
+ "heading-h1",
173
+ "heading-h2",
174
+ "heading-h3",
175
+ "heading-h4",
176
+ "body-section",
177
+ "body-base",
178
+ "body-small",
179
+ "body-xs",
180
+ "body-xxs",
181
+ "ui-label",
182
+ "ui-label-large",
183
+ "ui-badge",
184
+ "ui-caption",
185
+ "ui-overline",
186
+ "ui-code",
187
+ "ui-placeholder",
188
+ "ui-input-value"
189
+ ]
190
+ }
191
+ ],
192
+ "bg-image": [{ "bg-linear": ["to-t", "to-tr", "to-r", "to-br", "to-b", "to-bl", "to-l", "to-tl"] }]
193
+ }
194
+ }
195
+ });
196
+ function cn(...inputs) {
197
+ return twMerge((0, import_clsx.clsx)(inputs));
198
+ }
199
+
200
+ // src/components/Buttons & Actions/Button.tsx
201
+ var import_jsx_runtime = require("react/jsx-runtime");
202
+ var subtle = "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground hover:bg-accent-soft hover:bg-none hover:text-accent-soft-foreground disabled:bg-muted disabled:bg-none disabled:text-muted-foreground";
203
+ var buttonVariants = (0, import_class_variance_authority.cva)(
204
+ "inline-flex shrink-0 items-center justify-center whitespace-nowrap text-ui-label transition-colors disabled:pointer-events-none disabled:opacity-50",
205
+ {
206
+ variants: {
207
+ variant: {
208
+ default: "bg-primary text-label hover:bg-primary-hover",
209
+ subtle,
210
+ // Alias of `subtle`, kept so existing consumers don't break.
211
+ secondary: subtle,
212
+ destructive: "bg-destructive text-label hover:bg-destructive-hover",
213
+ outline: "border border-border bg-surface text-surface-foreground hover:border-input hover:bg-accent-soft hover:text-accent-soft-foreground disabled:bg-transparent disabled:border-input disabled:text-muted-foreground",
214
+ ghost: "text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground disabled:text-muted-foreground",
215
+ link: "text-surface-foreground underline hover:text-accent-foreground"
216
+ },
217
+ size: {
218
+ md: "h-10 min-w-10 gap-2.5 rounded-md px-4 py-2",
219
+ sm: "h-8 min-w-8 gap-1 rounded-sm px-2.5 py-1.5",
220
+ lg: "h-12 gap-2.5 rounded-md px-6 py-3 text-ui-label-large",
221
+ icon: "size-10 rounded-md p-0",
222
+ "icon-sm": "size-8 rounded-sm p-0"
223
+ }
224
+ },
225
+ compoundVariants: [
226
+ // Primary icon-only is a circle at 40px (and a rounded square at 32px).
227
+ { variant: "default", size: "icon", className: "rounded-full" },
228
+ {
229
+ variant: "default",
230
+ size: ["icon", "icon-sm"],
231
+ className: "disabled:border disabled:border-border disabled:bg-transparent disabled:text-muted-foreground disabled:opacity-100"
232
+ },
233
+ // Destructive icon-only drops the fill and tints the glyph instead.
234
+ {
235
+ variant: "destructive",
236
+ size: ["icon", "icon-sm"],
237
+ className: "bg-transparent text-destructive hover:bg-destructive-soft-hover"
238
+ },
239
+ { variant: "outline", size: ["icon", "icon-sm"], className: "disabled:border-border" },
240
+ // Links have no box of their own.
241
+ { variant: "link", className: "rounded-md bg-transparent px-4" }
242
+ ],
243
+ defaultVariants: {
244
+ variant: "default",
245
+ size: "md"
246
+ }
247
+ }
248
+ );
249
+ var Button = React.forwardRef(
250
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
251
+ const Comp = asChild ? import_radix_ui.Slot.Root : "button";
252
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { ref, className: cn(buttonVariants({ variant, size }), className), ...props });
253
+ }
254
+ );
255
+ Button.displayName = "Button";
256
+
257
+ // src/components/Buttons & Actions/Switch.tsx
258
+ var React2 = __toESM(require("react"), 1);
259
+ var import_radix_ui2 = require("radix-ui");
260
+ var import_jsx_runtime2 = require("react/jsx-runtime");
261
+ var Switch = React2.forwardRef(
262
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
263
+ import_radix_ui2.Switch.Root,
264
+ {
265
+ ref,
266
+ className: cn(
267
+ "inline-flex h-6 w-11 shrink-0 items-center rounded-full p-0.5 transition-colors",
268
+ "disabled:cursor-not-allowed disabled:opacity-50",
269
+ // Brand override: selected controls use `ring`, not `primary`/`accent`.
270
+ "data-[state=checked]:bg-ring data-[state=unchecked]:bg-muted",
271
+ className
272
+ ),
273
+ ...props,
274
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
275
+ import_radix_ui2.Switch.Thumb,
276
+ {
277
+ className: cn(
278
+ "block size-5 rounded-full bg-surface shadow-sm transition-transform",
279
+ "data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
280
+ )
281
+ }
282
+ )
283
+ }
284
+ )
285
+ );
286
+ Switch.displayName = "Switch";
287
+
288
+ // src/components/Buttons & Actions/Toggle.tsx
289
+ var React3 = __toESM(require("react"), 1);
290
+ var import_radix_ui3 = require("radix-ui");
291
+ var import_jsx_runtime3 = require("react/jsx-runtime");
292
+ var Toggle = React3.forwardRef(
293
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
294
+ import_radix_ui3.Toggle.Root,
295
+ {
296
+ ref,
297
+ className: cn(
298
+ "inline-flex size-10 shrink-0 items-center justify-center rounded-md text-surface-foreground transition-colors",
299
+ "hover:bg-accent-soft hover:text-accent-soft-foreground",
300
+ "data-[state=on]:bg-secondary data-[state=on]:hover:bg-accent-soft",
301
+ "disabled:pointer-events-none disabled:opacity-50",
302
+ className
303
+ ),
304
+ ...props
305
+ }
306
+ )
307
+ );
308
+ Toggle.displayName = "Toggle";
309
+
310
+ // src/components/Conversation & AI Chat/AIMiniAvatar.tsx
311
+ var React4 = __toESM(require("react"), 1);
312
+
313
+ // src/components/Conversation & AI Chat/aiGlyphPaths.ts
314
+ var AI_GLYPH_THINKING = {
315
+ viewBox: "0 0 23.5102 10.31",
316
+ d: "M20.7764 6.13895C20.8091 6.08935 20.9139 6.07477 20.9653 6.02535C21.1265 5.87047 21.227 5.79769 21.3523 5.6889L21.3349 5.70985C21.3757 5.67187 21.4194 5.629 21.4687 5.57648C21.7621 5.26894 22.4786 4.16096 22.8403 4.43013C22.8403 4.43014 22.8403 4.43014 22.8403 4.43015C22.8438 4.43279 22.8474 4.43556 22.8508 4.43847C22.9168 4.49352 22.9251 4.63928 22.993 4.71056C23.061 4.78185 23.5711 5.14655 23.5041 5.29532C23.4036 5.50831 22.9412 5.85678 22.8715 5.95956C22.8242 6.02999 22.8059 6.14803 22.7475 6.24057C22.6464 6.40032 22.5565 6.50906 22.4809 6.62923C22.4785 6.632 22.4718 6.64062 22.4693 6.64331C22.3989 6.74734 22.341 6.85851 22.2892 7.02244C22.1391 7.06575 21.9883 7.10631 21.8375 7.14262C21.7434 7.29292 21.476 7.39415 21.4003 7.4664C21.3382 7.52673 21.3404 7.6092 21.2705 7.66966C21.2189 7.71436 21.1282 7.74838 21.0302 7.79812C21.0228 7.80313 21.0008 7.8182 20.9928 7.8224C20.9494 7.83706 20.9028 7.85865 20.856 7.89199C20.6266 8.05556 20.6529 8.23489 20.4981 8.34362C20.4171 8.3997 20.2989 8.44071 20.1779 8.48367C20.0629 8.52373 19.9434 8.57023 19.8501 8.64564C19.8314 8.67452 19.8127 8.70339 19.7937 8.73228C19.83 8.76183 19.8664 8.79129 19.9028 8.82072C19.8037 8.88716 19.7221 8.82963 19.622 8.8719C19.5039 8.92146 19.4745 9.02208 19.3928 9.05557C19.3259 9.0829 19.2105 9.05922 19.1237 9.09701C18.9965 9.1516 19.0573 9.22895 18.9919 9.2717C18.9722 9.29205 18.4308 9.51795 18.3887 9.52197C18.1304 9.58812 18.0801 9.46546 17.8631 9.48595C17.8361 9.48814 17.8091 9.4903 17.782 9.49237C17.3207 9.52161 16.8743 9.67817 16.3789 9.7352C16.285 9.7455 16.1851 9.74966 16.0822 9.74684C15.9622 9.74345 15.8411 9.73294 15.7225 9.71759C16.0452 9.39607 15.3567 9.12062 15.6025 9.64387C15.3808 9.56394 15.2157 9.69807 14.9941 9.66267C14.8498 9.63874 14.7566 9.5627 14.5364 9.54137C14.3208 9.51495 14.0878 9.5587 13.7616 9.41848C13.6405 9.36165 13.5631 9.27393 13.5919 9.09969C13.4354 9.05602 13.2983 8.98697 13.1658 8.92556C13.0992 8.89457 13.0342 8.86595 12.9619 8.83793C12.8815 8.79834 12.8349 8.81997 12.6347 8.66553C12.5818 8.65788 12.5185 8.66138 12.4458 8.68578C12.3597 8.6238 12.3017 8.26898 12.2414 8.14791C12.1605 8.05685 11.7146 7.13701 11.7091 6.94414C11.7083 6.94093 11.7074 6.93768 11.7065 6.93438C11.6552 6.75979 11.6158 6.47257 11.5821 6.33303C11.5388 6.16728 11.1933 5.9876 11.6352 5.69928C11.6536 5.50058 11.6924 5.35814 11.7614 5.21539C11.7996 5.14267 11.8487 5.06108 11.9231 4.94138C11.9508 4.89665 12.0069 4.91427 12.0188 4.88607C12.0432 4.82851 12.0458 4.71199 12.0891 4.60378C12.1604 4.42562 12.3223 4.38132 12.1443 4.31661C12.1745 4.18591 12.2099 4.05361 12.2533 3.91918C12.3093 3.89617 12.3653 3.87434 12.4217 3.85356C12.4277 3.77084 12.4368 3.68676 12.4498 3.60124C12.6122 3.82914 12.8149 3.31965 12.5882 3.35167C12.6971 3.26408 12.8129 3.18134 12.936 3.10694C13.0432 3.05147 13.1502 2.9942 13.2575 2.93523C13.445 3.18433 13.6433 2.62036 13.4965 2.52782C13.5159 2.50978 13.5359 2.49118 13.5559 2.47273C13.6468 2.43151 13.7186 2.3762 13.8101 2.30215C13.9339 2.20399 14.0605 2.08848 14.2572 2.00205C14.5866 1.86654 14.5863 1.91818 14.7383 2.00328C14.8117 1.96386 14.8906 1.92778 14.9768 1.89808C15.2046 1.61986 15.3871 1.74917 15.5554 1.87821C15.6574 1.92057 15.8644 2.08723 15.9086 2.24717C15.9561 2.38086 15.9647 2.4401 16.0174 2.50589C16.0362 2.5325 16.059 2.56113 16.0862 2.59267C15.9089 2.83438 16.1252 3.33908 16.1251 3.71466C16.1272 3.75694 16.1742 3.7651 16.1787 3.82326C16.1923 3.96864 16.0396 4.27583 16.1879 4.30844C16.1104 4.40775 16.0302 4.50104 15.9487 4.58956C15.9485 4.59211 15.9483 4.59466 15.9481 4.59722C15.9434 4.68512 15.9381 4.77303 15.9326 4.86089C15.9773 4.87807 16.0219 4.89524 16.0666 4.91242C15.8514 5.01394 15.8076 5.2888 15.7201 5.39794C15.7026 5.41968 15.6395 5.39969 15.591 5.46924C15.5342 5.55031 15.482 5.72425 15.4171 5.82229C15.4664 5.89261 15.5154 5.96317 15.5642 6.03418C15.516 6.24242 15.3088 6.23112 15.2434 6.33666C15.2371 6.34685 15.1897 6.45661 15.1414 6.56252C15.1003 6.65319 15.0605 6.74017 15.0575 6.75026C14.9983 6.92736 15.1953 6.94548 14.8653 7.42471C14.8017 7.51174 14.7031 7.55363 14.6374 7.63359C14.5939 7.68676 14.5258 7.79471 14.4522 7.90588C14.359 8.0661 14.2337 8.27035 14.258 8.34435C13.9929 8.37671 13.5599 8.69876 13.4026 8.72273C13.3557 8.73114 13.3039 8.65181 13.1715 8.69189C13.1196 8.70739 13.0387 8.75964 12.9539 8.81245C12.8709 8.86549 12.783 8.9216 12.7186 8.94208C12.5852 8.98412 12.5082 8.92996 12.4483 8.94919C12.3923 8.9672 12.3668 9.04791 12.2925 9.07862C12.0591 9.1738 11.8082 9.16385 11.6213 9.23522C11.3502 9.33814 11.1776 9.60661 10.949 9.76888C10.9348 9.77067 10.9203 9.77115 10.9058 9.77095C10.8529 9.76975 10.7975 9.7598 10.7466 9.77439C9.99772 10.0005 9.00243 10.0857 8.1768 9.85282C8.13481 9.84174 8.09342 9.83033 8.0522 9.8185C7.65595 9.74342 6.84265 9.06031 6.88897 9.55865C6.80575 9.55556 6.53393 9.38444 6.29758 9.12608C6.231 9.02829 5.91504 8.73378 5.8576 8.6732C5.70806 8.5387 5.53716 8.47446 5.42743 8.35204C5.23871 8.13938 5.11803 7.9385 4.98784 7.72031C4.93094 7.62219 4.78289 7.41761 4.64906 7.18544C4.56629 7.04595 4.42492 6.92507 4.39704 6.84099C4.36359 6.73961 4.41467 6.60764 4.3839 6.48312C4.3266 6.25751 4.2228 5.90491 4.15903 5.6261C4.13709 5.5314 4.11932 5.43956 4.10919 5.36422C4.10191 5.30774 4.17499 5.27443 4.18647 5.19139C4.22915 4.86817 4.21424 4.52439 3.96715 4.59214C4.0923 4.18224 4.00781 3.80768 4.06914 3.4305C4.07049 3.42228 4.07191 3.41407 4.0734 3.40587C4.17848 2.77229 4.60265 1.62744 5.42728 1.02539C5.5388 0.936113 5.63885 0.851595 5.72033 0.774897C6.02466 0.499997 5.92843 0.404094 6.57046 0.168732C6.72019 0.118531 6.87745 0.0750992 7.10515 0.029663C7.44001 -0.0409616 8.00784 0.000885725 8.42487 0.305113C8.52342 0.370349 8.66824 0.438081 8.84918 0.507494C9.00601 0.701494 9.15341 0.965493 9.19962 1.24429C9.25461 1.59798 9.20706 1.9295 9.02072 2.15487C9.06272 2.2086 9.10331 2.26358 9.14209 2.32146C9.12853 2.38467 9.11273 2.44783 9.09564 2.50868C9.04342 2.51339 8.99124 2.51735 8.93911 2.52058C8.80099 2.92074 8.72119 3.45798 8.53257 3.73379C8.51917 3.75362 8.50452 3.77482 8.48864 3.79731C8.18299 4.22988 7.45145 5.14772 7.14208 5.47284C6.97081 5.65357 7.04778 5.72472 6.79141 5.71506C6.77155 5.76833 6.75129 5.82205 6.73113 5.87552C6.74881 5.93119 6.76688 5.98626 6.78446 6.04197C6.67655 6.19317 6.53517 6.34587 6.39918 6.49486C6.30179 6.60171 6.20676 6.7071 6.12771 6.80983C5.86753 7.16626 5.41116 7.79089 4.96904 8.10513C4.87549 8.1762 4.78037 8.24183 4.68809 8.2947C4.56491 8.36535 4.36563 8.39839 4.25536 8.48329C4.09377 8.60676 4.15002 8.76609 3.93397 8.92203C3.68203 9.10323 3.21465 9.30524 2.7946 9.44827C2.61334 9.50835 2.4488 9.5679 2.33086 9.62822C2.22328 9.68313 2.19724 9.76099 2.12265 9.80252C1.81329 9.9754 1.54922 10.089 1.27057 10.31C0.871376 10.3138 0.823743 10.1166 0.644008 9.97432C0.509878 9.86688 0.126525 9.63933 0.0856048 9.51058C0.0484623 9.42509 0.051783 9.29751 0 9.20711C0.311082 9.00323 0.527575 9.0048 0.893831 9.00304C1.355 8.7957 1.81246 8.57815 2.27037 8.35384C2.37271 8.30354 2.47492 8.24832 2.57658 8.1893C2.6503 8.2117 2.72528 8.23255 2.80124 8.252C2.8013 8.25211 2.80136 8.25221 2.80143 8.25232C3.03486 8.18581 3.03979 8.00743 3.12463 7.91046C3.36205 7.63959 3.68578 7.33424 4.07988 6.99574C4.53563 6.62516 4.89846 6.21727 5.32159 5.69439C5.74872 5.17021 6.15919 4.65793 6.46139 4.25093C6.64154 4.00919 7.13955 3.16034 7.33028 3.04133C7.34208 3.03408 7.35548 3.03074 7.36955 3.02924C7.41387 3.02544 7.46598 3.03904 7.49046 3.00739C7.70834 2.58993 7.86103 2.13779 7.83041 1.79989C7.8547 1.70941 7.86312 1.62307 7.85378 1.53151C7.87209 1.5287 7.84915 1.45435 7.69179 1.34775C7.77026 1.34362 7.49926 1.35778 7.23888 1.52474C6.97348 1.67631 6.69939 1.87603 6.42229 2.07271C6.36356 2.11454 6.30432 2.15719 6.24453 2.20056C5.85524 2.48354 5.60232 3.08823 5.49387 3.71498C5.39928 4.24892 5.42498 4.76811 5.56179 5.30683C5.73246 5.96207 5.84566 6.51339 6.19333 6.98921C6.31865 7.19227 6.46019 7.37337 6.62146 7.53296C6.79615 7.70852 6.92033 7.78019 7.25856 8.05634C7.33453 8.12545 7.42269 8.18946 7.52192 8.24799C7.75285 8.38685 8.10613 8.47857 8.4572 8.54593C8.61666 8.57713 8.77013 8.59963 8.91167 8.62268C9.08941 8.64956 9.17441 8.79085 9.4164 8.66989C9.42212 8.70681 9.42791 8.74373 9.43379 8.78063C9.65293 8.71479 9.77712 8.60908 10.021 8.54539C10.1203 8.51928 10.2997 8.46967 10.4831 8.41151C10.6699 8.35263 10.8737 8.27862 10.9746 8.24849C11.0761 8.21757 11.0641 8.29673 11.157 8.26042C11.3161 8.19806 11.6214 7.97025 11.8416 7.87728C12.0071 7.80802 12.2892 7.74718 12.4664 7.68389C12.5014 7.67152 12.5303 7.65958 12.5544 7.6466C12.9362 7.44059 13.2264 7.19551 13.4781 6.90736C13.5439 6.83289 13.5972 6.76236 13.6731 6.65907C13.7546 6.55024 13.9356 6.40299 13.9581 6.35458C14.0011 6.26124 13.9376 6.19233 13.9591 6.12514C13.9721 6.08459 13.9882 6.04256 14.0073 5.9983C14.1356 5.69579 14.4023 5.27933 14.5269 4.98849C14.6407 4.72311 14.7511 4.44958 14.8552 4.17601C14.9522 3.92097 15.0207 3.66979 15.0372 3.45937C15.0531 3.24138 15.027 3.11048 14.9379 2.78902C14.9187 2.70766 14.878 2.57482 14.9201 2.69356C14.9293 2.78057 15.2047 3.01121 15.3025 3.00426C15.3103 3.005 15.2823 2.99694 15.209 3.02009C15.1006 3.05115 14.8991 3.17087 14.6896 3.3475C14.4622 3.54526 14.1241 3.87681 13.8343 4.11513C13.7102 4.21459 13.5954 4.34064 13.4984 4.45314C13.4195 4.54661 13.3558 4.46837 13.2997 4.56139C13.2381 4.66643 13.2646 4.75718 13.2429 4.81048C13.1582 5.0115 13.0582 5.33059 12.8983 5.73083C12.8528 5.84656 12.829 6.11681 12.8105 6.25296C12.8013 6.311 12.7318 6.36264 12.7373 6.39885C12.74 6.41716 12.7967 6.44932 12.8133 6.49994C12.8239 6.53247 12.835 6.56327 12.8464 6.59222C13.0113 6.99361 13.2145 7.29577 13.6284 7.75962C13.6287 7.75995 13.629 7.76028 13.6292 7.7606C13.5327 7.66867 13.5735 7.71591 13.5864 7.71996C13.6067 7.73297 13.6364 7.74994 13.6682 7.76708C13.7325 7.8017 13.8061 7.838 13.8819 7.87409C14.0342 7.94645 14.1967 8.01873 14.3624 8.09149C14.4295 8.12341 14.8213 8.16242 15.1241 8.16799C15.4466 8.17777 15.7837 8.17904 16.12 8.1862C16.4042 8.19173 16.7364 8.16186 17.0675 8.14113C17.3555 8.12227 17.5732 8.24796 17.6136 8.24221C17.625 8.2406 17.6357 8.23751 17.6461 8.23323C17.7042 8.20464 17.7441 8.12089 17.8688 8.07355C18.3421 7.89885 19.1022 7.67963 19.5971 7.39003C19.6136 7.38042 19.6303 7.37015 19.6473 7.35931C19.8747 7.2155 20.0413 6.98443 20.2828 6.80153C20.3065 6.7842 20.3357 6.76481 20.3699 6.74391L20.298 6.79064C20.4619 6.66741 20.7621 6.44192 20.7839 6.34931C20.7993 6.28776 20.7412 6.19318 20.7764 6.13895ZM14.3029 9.42491C14.3405 9.34309 14.2314 9.3194 14.1139 9.3164C13.9993 9.31488 13.861 9.3268 13.9789 9.41542C14.0391 9.45982 14.2868 9.46988 14.3029 9.42491ZM9.59175 9.70184C9.60097 9.75063 9.61033 9.7994 9.61981 9.84815C9.67917 9.8212 9.73753 9.79318 9.79481 9.76425C9.75681 9.73961 9.71928 9.71456 9.68227 9.6891C9.65216 9.69362 9.62202 9.69787 9.59175 9.70184Z"
317
+ };
318
+ var AI_GLYPH_WORKING = {
319
+ viewBox: "0 0 21.6653 7.31887",
320
+ d: "M21.5195 2.20094C21.5632 2.27281 21.5435 2.40302 21.5694 2.49163C21.6275 2.6923 21.6417 2.82523 21.6527 2.95596C21.6564 2.97027 21.6628 3.01397 21.6653 3.02853C21.6641 3.13693 21.6598 3.24436 21.6586 3.38773C21.6816 3.85362 21.6618 5.13496 21.204 5.07451C21.204 5.0745 21.204 5.0745 21.204 5.0745C21.1996 5.074 21.1952 5.07338 21.1907 5.07263C21.1061 5.05815 21.0241 4.94601 20.929 4.92104C20.8337 4.89639 20.2098 4.84129 20.1872 4.70468C20.162 4.5075 20.3424 4.05165 20.3322 3.94693C20.3275 3.87626 20.2696 3.79112 20.2564 3.70362C20.2253 3.50095 20.228 3.36832 20.1618 3.22753L20.1705 3.27725C20.1408 3.22743 20.1002 3.17862 20.0419 3.13125C20.0967 3.02469 20.1456 2.91373 20.1862 2.79711C20.1085 2.70121 20.1178 2.49436 20.0701 2.43438C20.0329 2.38632 19.9603 2.39539 19.9218 2.35006C19.8787 2.3002 19.8633 2.1732 19.7612 2.09203C19.7034 2.0461 19.6466 2.03107 19.595 2.02843L19.7627 2.11426C19.6671 2.14605 19.6042 2.2088 19.5173 2.20366C19.3811 2.19547 19.1788 2.06914 18.9898 2.10943C18.9652 2.12544 18.9407 2.1416 18.9163 2.1579C18.9287 2.20111 18.9406 2.24436 18.9521 2.28762C18.8618 2.29819 18.8311 2.20964 18.7478 2.20237C18.6497 2.19419 18.5963 2.27357 18.5308 2.27097C18.4776 2.26885 18.4048 2.20215 18.3342 2.20612C18.2309 2.21188 18.2544 2.30623 18.2002 2.32458C18.1776 2.32896 17.7784 2.40078 17.7565 2.40615C17.5856 2.42463 17.557 2.29863 17.4163 2.30438C17.0252 2.32264 16.6544 2.50901 16.341 2.64771C16.2001 2.7096 16.0505 2.75491 15.9061 2.79231C16.0092 2.39243 15.4001 2.37041 15.7957 2.76269C15.7449 2.76246 15.7042 2.7768 15.67 2.79808C15.5564 2.86487 15.4802 2.97434 15.3466 3.01614C15.2272 3.05323 15.1197 3.02273 14.9627 3.09457C14.6814 3.2228 14.4809 3.53873 14.2487 3.24296C13.9703 3.44596 13.6586 3.47244 13.7401 3.80561C13.6873 3.86035 13.4234 3.80763 13.3424 3.84086C13.2469 3.85834 12.8209 4.21338 12.8015 4.30503C12.7577 4.37886 12.704 4.52293 12.7165 4.60386C12.7165 4.60456 12.7165 4.60525 12.7166 4.60594C12.7245 4.73675 13.038 4.86932 12.6198 5.00545C12.6218 5.24087 12.6062 5.31289 12.5709 5.505C12.5653 5.5391 12.5078 5.54892 12.51 5.56912C12.5148 5.61101 12.5679 5.67144 12.5899 5.73138C12.625 5.82708 12.5422 5.92847 12.7068 5.83917C12.7265 5.85366 12.7463 5.86629 12.7663 5.87733C12.8032 5.90096 12.8414 5.92124 12.8766 5.93338C12.8592 5.96968 12.8434 6.00666 12.8291 6.04399C12.8751 6.0348 12.9151 6.01504 12.9349 5.9805C12.8531 6.08998 12.8602 6.12516 12.8542 6.09438C12.8536 6.06287 12.7741 5.97616 12.8523 5.90639C12.814 5.91011 12.7686 5.91968 12.7291 5.93658C12.8704 5.95935 13.0187 5.97102 13.1668 5.97103C13.2458 6.27758 13.5375 5.8631 13.4165 5.7269C13.4322 5.71942 13.4481 5.7116 13.4633 5.70383C13.6382 5.70301 13.7156 5.57219 13.8729 5.49571C14.0312 5.4108 14.0391 5.43683 14.1889 5.47644C14.2098 5.43405 14.2279 5.39151 14.2438 5.3483C14.0282 5.01309 14.4813 5.23839 14.467 4.9003C14.4628 4.86036 14.4497 4.81226 14.424 4.75824C14.6924 4.64645 14.5813 4.22813 14.4827 3.98518C14.4718 3.95634 14.4244 3.95942 14.4063 3.92204C14.3646 3.8314 14.3895 3.57996 14.2385 3.6136C14.269 3.52481 14.297 3.43419 14.3224 3.34163C14.2805 3.27925 14.2374 3.21883 14.1932 3.15937C14.147 3.17171 14.1008 3.18404 14.0545 3.19636C14.1795 3.02404 14.0534 2.83228 14.0536 2.72057C14.0538 2.69796 14.1146 2.67123 14.1077 2.60167C14.1053 2.5772 14.097 2.54816 14.0858 2.51695C14.0606 2.4458 14.0206 2.3664 14.0068 2.30319C13.9256 2.30215 13.845 2.30379 13.7653 2.30835C13.664 2.19886 13.8037 2.06102 13.7674 1.97878C13.7632 1.95836 13.5836 1.76062 13.569 1.76088C13.4625 1.71319 13.3938 1.83751 13.1876 1.69055C13.1768 1.68378 13.1679 1.67414 13.1594 1.66314C13.1251 1.62875 13.0976 1.58516 13.0563 1.56847C12.9543 1.52205 12.6158 1.57037 12.5754 1.68805C12.488 1.51352 12.1471 1.54577 12.0499 1.50822C12.0197 1.49536 12.0125 1.39933 11.915 1.38294C11.8348 1.36858 11.641 1.46343 11.5414 1.4673C11.4886 1.46852 11.4499 1.45238 11.417 1.43601C11.379 1.41974 11.3502 1.40253 11.3222 1.40479C11.2702 1.40908 11.2364 1.48093 11.1663 1.49376C10.9506 1.53213 10.7369 1.4686 10.5668 1.5019C10.3215 1.54967 10.1495 1.7839 9.97459 1.91406C9.92313 1.91395 9.86479 1.88637 9.81474 1.89889C9.18393 2.05373 8.52084 2.24974 8.06049 2.55947C7.97673 2.61393 7.82886 2.68357 7.70707 2.77585C7.47457 2.96164 7.29957 3.141 7.58115 3.23461C7.55145 3.37335 6.85892 3.81217 6.75779 3.91528C6.65223 4.01974 6.62886 4.1568 6.55292 4.24037C6.3287 4.49052 6.12192 4.63806 5.97447 4.97688C5.93734 5.06497 5.97217 5.18888 5.95013 5.22858C5.92305 5.27641 5.81725 5.29086 5.78729 5.35168C5.72348 5.47691 5.72292 5.63535 5.74247 5.70235C5.7392 5.69015 5.73474 5.68324 5.73057 5.6806C5.7259 5.67767 5.6564 5.71443 5.64159 5.73607C5.59977 5.79621 5.66356 5.86599 5.71545 5.8044C5.74124 5.7781 5.76378 5.72791 5.79373 5.65487C5.7797 5.76571 5.84646 5.7256 5.86464 5.68044C5.89311 5.65904 5.9217 5.63652 5.95175 5.6189C6.02236 5.57879 6.10324 5.51868 6.14438 5.46754C6.52517 4.99861 6.93077 4.48918 7.03916 4.16128C7.131 3.87843 7.03817 3.83671 7.2777 3.53191C7.3285 3.46368 7.38339 3.39761 7.43515 3.31198C7.55556 3.123 7.78512 2.91105 7.53243 2.74719C7.53788 2.72612 7.54202 2.70518 7.54516 2.6844C7.57114 2.34511 7.5461 2.13531 7.71559 1.91428C7.66205 1.8939 7.6084 1.87498 7.55468 1.85784C7.54899 1.82465 7.54284 1.79249 7.53625 1.76174C7.58249 1.7438 7.62858 1.72536 7.6745 1.70638C7.66025 1.58943 7.57775 1.48171 7.50533 1.44831C7.42954 1.40963 7.39741 1.46692 7.42084 1.47901C7.42785 1.48323 7.43783 1.48634 7.4422 1.48541C7.17989 1.34605 6.43947 1.33364 6.13402 1.38718C5.94822 1.40777 5.97834 1.51041 5.80067 1.34866C5.76607 1.37821 5.73267 1.40807 5.6993 1.43868C5.69344 1.49226 5.68877 1.54561 5.68469 1.59899C5.60346 1.6368 5.51247 1.67081 5.41947 1.70715C5.25719 1.77218 5.08842 1.83937 4.95565 1.92193C4.5607 2.16343 4.07316 2.6724 3.66471 2.90149C3.56135 2.95829 3.38743 2.97861 3.30147 3.05515C3.17694 3.16659 3.25374 3.3124 3.10481 3.45557C2.97543 3.58045 2.7598 3.72772 2.55869 3.88391C2.36237 4.0352 2.17431 4.20354 2.0791 4.34155C2.02181 4.42439 2.04245 4.49771 2.00764 4.55703C1.86276 4.80728 1.7279 5.00722 1.67572 5.28395C1.40472 5.45513 1.24398 5.34517 1.02204 5.34271C0.85587 5.34339 0.443166 5.39397 0.298309 5.53289C0.195382 5.59242 0.114988 5.33164 0 5.398C0.0672404 4.97998 0.13697 4.91763 0.231708 4.78102C0.32599 4.66409 0.441105 4.57777 0.588846 4.47063C0.890159 3.96002 1.2295 3.4868 1.62503 3.03919C1.6425 3.01952 1.66013 2.99985 1.67793 2.98018C1.75746 2.97633 1.83576 2.97461 1.91436 2.97328C1.91444 2.97336 1.91453 2.97345 1.91462 2.97353C2.12092 2.85218 2.0899 2.68327 2.15819 2.5722C2.597 1.85461 3.67978 1.04205 4.76963 0.519159C5.32989 0.243909 5.91307 0.0975681 6.38788 0.0444249C6.6555 -0.0118234 7.54053 -0.0488161 7.88667 0.153048C7.94618 0.17965 7.98958 0.207339 8.01918 0.232423C8.08533 0.290805 8.06243 0.37677 8.1281 0.424204C8.788 0.858895 8.84837 1.50779 8.95406 1.97915C8.94198 2.20167 8.92957 2.41449 8.93075 2.60529C8.95493 3.51671 8.63286 4.38247 8.20801 5.05868C7.91193 5.53227 7.58085 5.95424 7.27747 6.35851C7.01913 6.69107 6.69575 6.90231 6.33432 7.03688C5.96029 7.1761 5.5056 7.15874 5.13666 6.97761C4.77988 6.8026 4.46111 6.49764 4.34143 6.02344C4.13016 4.94119 4.72195 4.23827 5.12818 3.69949C5.57383 3.15323 6.05227 2.7034 6.49909 2.26167C6.60356 2.1588 6.70991 2.04377 6.81333 1.92552C7.11534 1.5805 7.51671 1.27415 7.87436 1.12238C8.09128 1.03067 8.22986 1.1177 8.46139 0.914443C8.47778 0.948059 8.49413 0.981695 8.51042 1.01535C8.72666 0.884509 8.85128 0.753639 9.11283 0.667108C9.33416 0.590984 9.91261 0.445577 10.1078 0.420265C10.2081 0.405908 10.1856 0.481938 10.2787 0.461915C10.4358 0.427279 10.7555 0.265817 10.9724 0.225515C11.0344 0.213886 11.1095 0.207961 11.1911 0.203672C11.3902 0.189668 11.6101 0.200757 11.7294 0.184671C12.3244 0.0941229 13.0686 0.0795288 13.6887 0.360932C13.7173 0.373361 13.7452 0.386407 13.7732 0.400348C13.9935 0.504733 14.1863 0.761282 14.2374 0.804733C14.3459 0.889986 14.4353 0.85695 14.5099 0.917486C14.8544 1.19506 15.0555 1.7393 15.1651 2.08618C15.1811 2.13408 15.1962 2.17883 15.2114 2.2209C15.5209 3.10883 15.7231 4.06037 15.5398 5.11604C15.4759 5.44103 15.3468 5.76469 15.156 6.04424C14.7344 6.73319 13.702 7.23955 12.966 7.30853C12.4728 7.37179 12.1947 7.12924 12.0524 6.99922C11.8908 6.83031 12.009 6.80775 11.9034 6.68162C11.8329 6.59062 11.7694 6.53954 11.7184 6.49409C11.6899 6.46762 11.6662 6.44349 11.6504 6.41689C11.2557 5.85657 11.3479 4.693 11.5144 4.34149C11.5151 4.33971 11.5158 4.33796 11.5166 4.33623C11.5524 4.24664 11.6398 4.2033 11.6561 4.14998C11.6648 4.12266 11.6353 4.04477 11.6651 3.9555C11.9475 3.16456 12.4817 2.80074 13.0494 2.47332C13.7152 2.10344 14.4121 1.81425 15.0508 1.49401C15.5692 1.23861 16.1097 1.07617 16.6335 0.991567C16.9162 0.946369 17.1285 1.06931 17.1663 1.06219C17.2508 1.04785 17.2925 0.940458 17.4657 0.897656C18.0451 0.752637 18.8417 0.865944 19.4146 0.908582C19.6055 0.920524 19.8557 0.905474 20.0965 0.923509C20.1598 0.938582 20.3128 1.02252 20.3653 1.06104C20.4783 1.12075 20.5849 1.18937 20.6707 1.26172C20.897 1.42686 21.21 2.00184 21.2965 2.08728C21.3583 2.13718 21.4717 2.12365 21.5195 2.20094ZM14.7616 3.09249C14.7223 2.91995 14.4452 3.20284 14.6094 3.23071C14.6457 3.23713 14.7714 3.13732 14.7616 3.09249ZM8.90352 1.8629C8.92394 1.90808 8.94428 1.9533 8.96454 1.99855C8.99986 1.96338 9.03568 1.92859 9.07244 1.894C9.0381 1.87445 9.00388 1.85503 8.96929 1.83592C8.94712 1.84485 8.92519 1.85385 8.90352 1.8629Z"
321
+ };
322
+
323
+ // src/components/Conversation & AI Chat/AIMiniAvatar.tsx
324
+ var import_jsx_runtime4 = require("react/jsx-runtime");
325
+ var defaultLabel = {
326
+ thinking: "Thinking...",
327
+ executing: "Executing...",
328
+ working: "Working on it..."
329
+ };
330
+ var AIMiniAvatar = React4.forwardRef(
331
+ ({ className, status = "idle", label, elapsed, ...props }, ref) => {
332
+ const glyph = status === "working" ? AI_GLYPH_WORKING : AI_GLYPH_THINKING;
333
+ const busy = status !== "idle";
334
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
335
+ "div",
336
+ {
337
+ ref,
338
+ role: "status",
339
+ "aria-live": "polite",
340
+ className: cn("flex items-center gap-2.5", className),
341
+ ...props,
342
+ children: [
343
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
344
+ "svg",
345
+ {
346
+ "aria-hidden": "true",
347
+ viewBox: glyph.viewBox,
348
+ fill: "none",
349
+ className: cn(
350
+ "h-5.75 shrink-0 fill-accent",
351
+ status === "working" ? "w-5" : "w-5.25",
352
+ busy && "motion-safe:animate-pulse"
353
+ ),
354
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: glyph.d })
355
+ }
356
+ ),
357
+ busy && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
358
+ "span",
359
+ {
360
+ className: cn(
361
+ "text-ui-caption whitespace-nowrap",
362
+ status === "executing" ? "bg-linear-to-r from-secondary-muted-foreground to-secondary-muted-foreground/40 bg-clip-text text-transparent" : "text-secondary-muted-foreground"
363
+ ),
364
+ children: label ?? defaultLabel[status]
365
+ }
366
+ ),
367
+ status === "working" && elapsed != null && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
368
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
369
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-ui-caption whitespace-nowrap text-secondary-muted-foreground", children: elapsed })
370
+ ] })
371
+ ]
372
+ }
373
+ );
374
+ }
375
+ );
376
+ AIMiniAvatar.displayName = "AIMiniAvatar";
377
+
378
+ // src/components/Conversation & AI Chat/AIResponseContainer.tsx
379
+ var React5 = __toESM(require("react"), 1);
380
+ var import_jsx_runtime5 = require("react/jsx-runtime");
381
+ var AIResponseContainer = React5.forwardRef(
382
+ ({ className, title, children, actions, feedback, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref, className: cn("flex w-full max-w-188 flex-col items-start gap-4", className), ...props, children: [
383
+ title && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { className: "text-heading-h4 text-surface-foreground", children: title }),
384
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex w-full flex-col gap-4 text-body-base text-surface-foreground [&>p]:opacity-90", children }),
385
+ actions,
386
+ feedback
387
+ ] })
388
+ );
389
+ AIResponseContainer.displayName = "AIResponseContainer";
390
+
391
+ // src/components/Conversation & AI Chat/AskAiToggle.tsx
392
+ var React6 = __toESM(require("react"), 1);
393
+ var import_react = require("@phosphor-icons/react");
394
+ var import_class_variance_authority2 = require("class-variance-authority");
395
+ var import_radix_ui4 = require("radix-ui");
396
+ var import_jsx_runtime6 = require("react/jsx-runtime");
397
+ var askAiToggleVariants = (0, import_class_variance_authority2.cva)(
398
+ "inline-flex shrink-0 items-center justify-center text-surface-foreground transition-colors disabled:pointer-events-none disabled:opacity-50",
399
+ {
400
+ variants: {
401
+ type: {
402
+ // 40px, filled with the subtle fill until pressed.
403
+ menu: "size-10 rounded-md bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-soft-foreground",
404
+ // 32px, bare until pressed.
405
+ action: "size-8 rounded-sm hover:bg-accent-soft data-[state=on]:bg-accent-soft data-[state=on]:text-accent-soft-foreground"
406
+ }
407
+ },
408
+ defaultVariants: { type: "menu" }
409
+ }
410
+ );
411
+ var AskAiToggle = React6.forwardRef(
412
+ ({ className, type, "aria-label": ariaLabel = "Ask AI", pressed, defaultPressed, ...props }, ref) => {
413
+ const [internal, setInternal] = React6.useState(defaultPressed ?? false);
414
+ const on = pressed ?? internal;
415
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
416
+ import_radix_ui4.Toggle.Root,
417
+ {
418
+ ref,
419
+ "aria-label": ariaLabel,
420
+ pressed,
421
+ defaultPressed,
422
+ onPressedChange: (next) => {
423
+ setInternal(next);
424
+ props.onPressedChange?.(next);
425
+ },
426
+ className: cn(askAiToggleVariants({ type }), className),
427
+ ...props,
428
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react.Sparkle, { size: 16, weight: on ? "fill" : "regular", "aria-hidden": true })
429
+ }
430
+ );
431
+ }
432
+ );
433
+ AskAiToggle.displayName = "AskAiToggle";
434
+
435
+ // src/components/Conversation & AI Chat/ChatChoices.tsx
436
+ var React10 = __toESM(require("react"), 1);
437
+
438
+ // src/components/Forms & Data Entry/Checkbox.tsx
439
+ var React8 = __toESM(require("react"), 1);
440
+ var import_react2 = require("@phosphor-icons/react");
441
+ var import_radix_ui6 = require("radix-ui");
442
+
443
+ // src/components/Forms & Data Entry/Label.tsx
444
+ var React7 = __toESM(require("react"), 1);
445
+ var import_radix_ui5 = require("radix-ui");
446
+ var import_jsx_runtime7 = require("react/jsx-runtime");
447
+ var Label = React7.forwardRef(
448
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
449
+ import_radix_ui5.Label.Root,
450
+ {
451
+ ref,
452
+ className: cn(
453
+ "text-ui-label text-surface-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
454
+ className
455
+ ),
456
+ ...props
457
+ }
458
+ )
459
+ );
460
+ Label.displayName = "Label";
461
+
462
+ // src/components/Forms & Data Entry/Checkbox.tsx
463
+ var import_jsx_runtime8 = require("react/jsx-runtime");
464
+ var Checkbox = React8.forwardRef(
465
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
466
+ import_radix_ui6.Checkbox.Root,
467
+ {
468
+ ref,
469
+ className: cn(
470
+ "peer inline-flex size-4 shrink-0 items-center justify-center rounded-xxs border-2 border-input bg-surface transition-colors",
471
+ "disabled:cursor-not-allowed disabled:opacity-50",
472
+ // Brand override: selected controls use `ring`, not `primary`/`accent`.
473
+ "data-[state=checked]:border-ring data-[state=checked]:bg-ring data-[state=checked]:text-label",
474
+ "data-[state=indeterminate]:border-ring data-[state=indeterminate]:bg-ring data-[state=indeterminate]:text-label",
475
+ className
476
+ ),
477
+ ...props,
478
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_radix_ui6.Checkbox.Indicator, { className: "flex items-center justify-center text-current", children: props.checked === "indeterminate" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react2.Minus, { size: 12, weight: "bold", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react2.Check, { size: 12, weight: "bold", "aria-hidden": true }) })
479
+ }
480
+ )
481
+ );
482
+ Checkbox.displayName = "Checkbox";
483
+ var CheckboxField = React8.forwardRef(
484
+ ({ label, description, id, className, disabled, ...props }, ref) => {
485
+ const generatedId = React8.useId();
486
+ const controlId = id ?? generatedId;
487
+ const descriptionId = `${controlId}-description`;
488
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
489
+ "div",
490
+ {
491
+ className: cn("flex gap-2", description ? "items-start pt-0.5" : "items-center", disabled && "opacity-50", className),
492
+ children: [
493
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
494
+ Checkbox,
495
+ {
496
+ ref,
497
+ id: controlId,
498
+ disabled,
499
+ "aria-describedby": description ? descriptionId : void 0,
500
+ className: description ? "mt-0.5" : void 0,
501
+ ...props
502
+ }
503
+ ),
504
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
505
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Label, { htmlFor: controlId, className: cn(!description && "font-normal leading-5"), children: label }),
506
+ description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { id: descriptionId, className: "text-xs text-secondary-muted-foreground", children: description })
507
+ ] })
508
+ ]
509
+ }
510
+ );
511
+ }
512
+ );
513
+ CheckboxField.displayName = "CheckboxField";
514
+
515
+ // src/components/Forms & Data Entry/RadioGroup.tsx
516
+ var React9 = __toESM(require("react"), 1);
517
+ var import_radix_ui7 = require("radix-ui");
518
+ var import_jsx_runtime9 = require("react/jsx-runtime");
519
+ var RadioGroup = React9.forwardRef(
520
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_radix_ui7.RadioGroup.Root, { ref, className: cn("flex flex-col gap-2", className), ...props })
521
+ );
522
+ RadioGroup.displayName = "RadioGroup";
523
+ var RadioGroupItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
524
+ import_radix_ui7.RadioGroup.Item,
525
+ {
526
+ ref,
527
+ className: cn(
528
+ "peer inline-flex size-5 shrink-0 items-center justify-center rounded-full border-2 border-input bg-surface transition-colors",
529
+ "disabled:cursor-not-allowed disabled:opacity-50",
530
+ // Brand override: selected controls use `ring`, not `primary`/`accent`.
531
+ "data-[state=checked]:border-ring",
532
+ className
533
+ ),
534
+ ...props,
535
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_radix_ui7.RadioGroup.Indicator, { className: "size-2.5 rounded-full bg-ring" })
536
+ }
537
+ ));
538
+ RadioGroupItem.displayName = "RadioGroupItem";
539
+ var RadioGroupFieldItem = React9.forwardRef(({ label, description, id, className, disabled, ...props }, ref) => {
540
+ const generatedId = React9.useId();
541
+ const controlId = id ?? generatedId;
542
+ const descriptionId = `${controlId}-description`;
543
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
544
+ "div",
545
+ {
546
+ className: cn("flex gap-2", description ? "items-start pt-0.5" : "items-center", disabled && "opacity-50", className),
547
+ children: [
548
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
549
+ RadioGroupItem,
550
+ {
551
+ ref,
552
+ id: controlId,
553
+ disabled,
554
+ "aria-describedby": description ? descriptionId : void 0,
555
+ ...props
556
+ }
557
+ ),
558
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
559
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Label, { htmlFor: controlId, className: cn(!description && "font-normal leading-5"), children: label }),
560
+ description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { id: descriptionId, className: "text-xs text-secondary-muted-foreground", children: description })
561
+ ] })
562
+ ]
563
+ }
564
+ );
565
+ });
566
+ RadioGroupFieldItem.displayName = "RadioGroupFieldItem";
567
+
568
+ // src/components/Conversation & AI Chat/ChatChoices.tsx
569
+ var import_jsx_runtime10 = require("react/jsx-runtime");
570
+ var ChatChoices = React10.forwardRef(
571
+ ({ className, title, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { ref, className: cn("flex flex-col", className), ...props, children: [
572
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "border-b border-border px-6 pt-5 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-body-section text-surface-foreground", children: title }) }),
573
+ children
574
+ ] })
575
+ );
576
+ ChatChoices.displayName = "ChatChoices";
577
+ var rowClasses = "flex w-full flex-col gap-1 border-b border-border px-6 py-4 text-left text-body-small";
578
+ function ChatOption(props) {
579
+ const id = React10.useId();
580
+ const descriptionId = `${id}-description`;
581
+ if (props.kind === "radio" || props.kind === "checkbox") {
582
+ const { title: title2, description: description2, className: className2 } = props;
583
+ const control = props.kind === "radio" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadioGroupItem, { id, value: props.value, disabled: props.disabled, "aria-describedby": description2 ? descriptionId : void 0 }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
584
+ Checkbox,
585
+ {
586
+ id,
587
+ checked: props.checked,
588
+ defaultChecked: props.defaultChecked,
589
+ onCheckedChange: (next) => props.onCheckedChange?.(next === true),
590
+ disabled: props.disabled,
591
+ "aria-describedby": description2 ? descriptionId : void 0
592
+ }
593
+ );
594
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn(rowClasses, "cursor-default", className2), children: [
595
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2.5 py-1", children: [
596
+ control,
597
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: id, className: "text-ui-label text-surface-foreground", children: title2 })
598
+ ] }),
599
+ description2 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { id: descriptionId, className: "pl-7.75 text-sm leading-[1.4] text-secondary-muted-foreground", children: description2 })
600
+ ] });
601
+ }
602
+ const { title, description, className, kind: _kind, ...buttonProps } = props;
603
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
604
+ "button",
605
+ {
606
+ type: "button",
607
+ className: cn(rowClasses, "transition-colors hover:bg-accent-soft", className),
608
+ ...buttonProps,
609
+ children: [
610
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-ui-label text-surface-foreground", children: title }),
611
+ description && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-body-small text-secondary-muted-foreground", children: description })
612
+ ]
613
+ }
614
+ );
615
+ }
616
+
617
+ // src/components/Conversation & AI Chat/ChatInput.tsx
618
+ var React11 = __toESM(require("react"), 1);
619
+ var import_react3 = require("@phosphor-icons/react");
620
+ var import_jsx_runtime11 = require("react/jsx-runtime");
621
+ var ChatInput = React11.forwardRef(
622
+ ({
623
+ className,
624
+ value,
625
+ defaultValue = "",
626
+ onValueChange,
627
+ onSubmit,
628
+ placeholder = "Add context or ask for changes...",
629
+ "aria-label": ariaLabel = "Message",
630
+ attachments,
631
+ choices,
632
+ trailing,
633
+ onAdd,
634
+ addLabel = "Add",
635
+ sendLabel = "Send",
636
+ disabled,
637
+ ...props
638
+ }, ref) => {
639
+ const [internal, setInternal] = React11.useState(defaultValue);
640
+ const text = value ?? internal;
641
+ const filled = text.trim() !== "" || attachments != null;
642
+ const submit = () => {
643
+ if (!text.trim() && attachments == null) return;
644
+ onSubmit?.(text);
645
+ };
646
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
647
+ "div",
648
+ {
649
+ ref,
650
+ className: cn(
651
+ "flex w-full flex-col overflow-hidden rounded-2xl border border-border bg-surface shadow-xs",
652
+ "focus-within:border-input-accent",
653
+ className
654
+ ),
655
+ ...props,
656
+ children: [
657
+ choices,
658
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-4 p-4", children: [
659
+ attachments && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex flex-wrap gap-4", children: attachments }),
660
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
661
+ "textarea",
662
+ {
663
+ rows: 1,
664
+ "aria-label": ariaLabel,
665
+ value: text,
666
+ disabled,
667
+ placeholder,
668
+ onChange: (event) => {
669
+ setInternal(event.target.value);
670
+ onValueChange?.(event.target.value);
671
+ },
672
+ onKeyDown: (event) => {
673
+ if (event.key === "Enter" && !event.shiftKey) {
674
+ event.preventDefault();
675
+ submit();
676
+ }
677
+ },
678
+ className: "field-sizing-content max-h-60 min-h-7 w-full resize-none bg-transparent text-body-base text-surface-foreground outline-none placeholder:text-muted-foreground"
679
+ }
680
+ )
681
+ ] }),
682
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-1.5 px-2.5 pt-2 pb-2.5", children: [
683
+ onAdd && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": addLabel, disabled, onClick: onAdd, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react3.Plus, { size: 16, "aria-hidden": true }) }),
684
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-1 items-center justify-end gap-1.5", children: [
685
+ trailing,
686
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
687
+ Button,
688
+ {
689
+ type: "button",
690
+ variant: filled ? "default" : "outline",
691
+ size: "icon",
692
+ "aria-label": sendLabel,
693
+ disabled: disabled || !filled,
694
+ onClick: submit,
695
+ className: cn(!filled && "disabled:opacity-100 disabled:border-border disabled:text-muted-foreground"),
696
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react3.ArrowUp, { size: 16, "aria-hidden": true })
697
+ }
698
+ )
699
+ ] })
700
+ ] })
701
+ ]
702
+ }
703
+ );
704
+ }
705
+ );
706
+ ChatInput.displayName = "ChatInput";
707
+ var AskAiInput = React11.forwardRef(
708
+ ({ className, value, defaultValue = "", onValueChange, onSubmit, sendLabel = "Send", placeholder = "Ask for changes", disabled, ...props }, ref) => {
709
+ const [internal, setInternal] = React11.useState(defaultValue);
710
+ const text = value ?? internal;
711
+ const filled = text.trim() !== "";
712
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
713
+ "form",
714
+ {
715
+ className: cn(
716
+ "flex min-h-10 w-full items-center gap-2 rounded-full border border-border bg-surface py-1.5 pr-1.5 pl-2 shadow-sm",
717
+ "focus-within:border-input-accent",
718
+ className
719
+ ),
720
+ onSubmit: (event) => {
721
+ event.preventDefault();
722
+ if (filled) onSubmit?.(text);
723
+ },
724
+ children: [
725
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
726
+ "input",
727
+ {
728
+ ref,
729
+ value: text,
730
+ disabled,
731
+ placeholder,
732
+ onChange: (event) => {
733
+ setInternal(event.target.value);
734
+ onValueChange?.(event.target.value);
735
+ },
736
+ className: "min-w-0 flex-1 bg-transparent text-body-small text-surface-foreground outline-none placeholder:text-muted-foreground",
737
+ ...props
738
+ }
739
+ ),
740
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
741
+ Button,
742
+ {
743
+ type: "submit",
744
+ variant: filled ? "default" : "outline",
745
+ size: "icon",
746
+ "aria-label": sendLabel,
747
+ disabled: disabled || !filled,
748
+ className: cn(!filled && "disabled:opacity-100 disabled:border-border disabled:text-muted-foreground"),
749
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react3.ArrowUp, { size: 16, "aria-hidden": true })
750
+ }
751
+ )
752
+ ]
753
+ }
754
+ );
755
+ }
756
+ );
757
+ AskAiInput.displayName = "AskAiInput";
758
+
759
+ // src/components/Conversation & AI Chat/FileAttachment.tsx
760
+ var React12 = __toESM(require("react"), 1);
761
+ var import_react4 = require("@phosphor-icons/react");
762
+ var import_jsx_runtime12 = require("react/jsx-runtime");
763
+ var FileAttachment = React12.forwardRef(
764
+ ({ className, name, type, onRemove, removeLabel, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { ref, className: cn("group/file relative w-32 shrink-0", className), ...props, children: [
765
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
766
+ "div",
767
+ {
768
+ className: cn(
769
+ "flex flex-col gap-1.5 border border-border bg-surface px-2.5 pt-2.5 pb-3",
770
+ onRemove ? "rounded-xl" : "rounded-lg"
771
+ ),
772
+ children: [
773
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "line-clamp-2 min-h-8 break-all text-ui-caption text-surface-foreground", title: name, children: name }),
774
+ type && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "w-fit rounded-xs bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-1.5 py-px text-body-xxs font-semibold tracking-wider text-secondary-muted-foreground uppercase", children: type })
775
+ ]
776
+ }
777
+ ),
778
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
779
+ Button,
780
+ {
781
+ type: "button",
782
+ variant: "outline",
783
+ size: "icon-sm",
784
+ "aria-label": removeLabel ?? `Remove ${name}`,
785
+ onClick: onRemove,
786
+ className: "absolute right-0 bottom-0 rounded-full opacity-0 transition-opacity group-hover/file:opacity-100 group-focus-within/file:opacity-100",
787
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react4.X, { size: 16, "aria-hidden": true })
788
+ }
789
+ )
790
+ ] })
791
+ );
792
+ FileAttachment.displayName = "FileAttachment";
793
+
794
+ // src/components/Conversation & AI Chat/ProjectSelector.tsx
795
+ var React14 = __toESM(require("react"), 1);
796
+ var import_react6 = require("@phosphor-icons/react");
797
+
798
+ // src/components/Overlays & Feedback/DropdownMenu.tsx
799
+ var React13 = __toESM(require("react"), 1);
800
+ var import_react5 = require("@phosphor-icons/react");
801
+ var import_radix_ui8 = require("radix-ui");
802
+ var import_jsx_runtime13 = require("react/jsx-runtime");
803
+ var DropdownMenu = import_radix_ui8.DropdownMenu.Root;
804
+ var DropdownMenuTrigger = import_radix_ui8.DropdownMenu.Trigger;
805
+ var DropdownMenuGroup = import_radix_ui8.DropdownMenu.Group;
806
+ var DropdownMenuRadioGroup = import_radix_ui8.DropdownMenu.RadioGroup;
807
+ var DropdownMenuSub = import_radix_ui8.DropdownMenu.Sub;
808
+ var contentClasses = "min-w-80 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md";
809
+ function useKeyboardModality(onKeyDown, onPointerMove) {
810
+ const [keyboard, setKeyboard] = React13.useState(false);
811
+ return {
812
+ "data-keyboard": keyboard ? "" : void 0,
813
+ onKeyDown: (event) => {
814
+ setKeyboard(true);
815
+ onKeyDown?.(event);
816
+ },
817
+ onPointerMove: (event) => {
818
+ setKeyboard(false);
819
+ onPointerMove?.(event);
820
+ }
821
+ };
822
+ }
823
+ var DropdownMenuContent = React13.forwardRef(({ className, sideOffset = 4, onKeyDown, onPointerMove, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_radix_ui8.DropdownMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
824
+ import_radix_ui8.DropdownMenu.Content,
825
+ {
826
+ ref,
827
+ sideOffset,
828
+ style: { zIndex: "var(--sys-z-30)" },
829
+ className: cn(contentClasses, "group/menu flex flex-col gap-0.5", className),
830
+ ...useKeyboardModality(onKeyDown, onPointerMove),
831
+ ...props
832
+ }
833
+ ) }));
834
+ DropdownMenuContent.displayName = "DropdownMenuContent";
835
+ var itemBase = "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-body-base text-surface-foreground outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
836
+ var itemHover = "data-[highlighted]:bg-accent-soft group-data-[keyboard]/menu:data-[highlighted]:outline-solid group-data-[keyboard]/menu:data-[highlighted]:outline-2 group-data-[keyboard]/menu:data-[highlighted]:-outline-offset-2 group-data-[keyboard]/menu:data-[highlighted]:outline-ring";
837
+ var selectedItem = "data-[state=checked]:text-ui-label-large data-[state=checked]:text-accent-foreground";
838
+ function ItemBody({ children, description }) {
839
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
840
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children }),
841
+ description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-xs leading-normal text-secondary-muted-foreground", children: description })
842
+ ] });
843
+ }
844
+ var DropdownMenuItem = React13.forwardRef(({ className, children, description, variant = "default", icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
845
+ import_radix_ui8.DropdownMenu.Item,
846
+ {
847
+ ref,
848
+ className: cn(
849
+ itemBase,
850
+ variant === "destructive" ? "text-ui-label-large text-destructive data-[highlighted]:bg-destructive-soft-hover group-data-[keyboard]/menu:data-[highlighted]:outline-solid group-data-[keyboard]/menu:data-[highlighted]:outline-2 group-data-[keyboard]/menu:data-[highlighted]:-outline-offset-2 group-data-[keyboard]/menu:data-[highlighted]:outline-ring" : itemHover,
851
+ className
852
+ ),
853
+ ...props,
854
+ children: [
855
+ variant === "destructive" && !icon ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react5.Trash, { size: 16, "aria-hidden": true, className: "shrink-0" }) : icon,
856
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ItemBody, { description, children })
857
+ ]
858
+ }
859
+ ));
860
+ DropdownMenuItem.displayName = "DropdownMenuItem";
861
+ var DropdownMenuCheckboxItem = React13.forwardRef(({ className, children, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_radix_ui8.DropdownMenu.CheckboxItem, { ref, className: cn(itemBase, itemHover, selectedItem, className), ...props, children: [
862
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ItemBody, { description, children }),
863
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_radix_ui8.DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react5.Check, { size: 16, "aria-hidden": true }) })
864
+ ] }));
865
+ DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
866
+ var DropdownMenuRadioItem = React13.forwardRef(({ className, children, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_radix_ui8.DropdownMenu.RadioItem, { ref, className: cn(itemBase, itemHover, selectedItem, className), ...props, children: [
867
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ItemBody, { description, children }),
868
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_radix_ui8.DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react5.Check, { size: 16, "aria-hidden": true }) })
869
+ ] }));
870
+ DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
871
+ var DropdownMenuSubTrigger = React13.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
872
+ import_radix_ui8.DropdownMenu.SubTrigger,
873
+ {
874
+ ref,
875
+ className: cn(itemBase, itemHover, "data-[state=open]:bg-accent-soft", className),
876
+ ...props,
877
+ children: [
878
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "flex-1", children }),
879
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react5.CaretRight, { size: 16, "aria-hidden": true })
880
+ ]
881
+ }
882
+ ));
883
+ DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
884
+ var DropdownMenuSubContent = React13.forwardRef(({ className, onKeyDown, onPointerMove, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_radix_ui8.DropdownMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
885
+ import_radix_ui8.DropdownMenu.SubContent,
886
+ {
887
+ ref,
888
+ style: { zIndex: "var(--sys-z-30)" },
889
+ className: cn(contentClasses, "group/menu flex flex-col gap-0.5", className),
890
+ ...useKeyboardModality(onKeyDown, onPointerMove),
891
+ ...props
892
+ }
893
+ ) }));
894
+ DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
895
+ var DropdownMenuLabel = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
896
+ import_radix_ui8.DropdownMenu.Label,
897
+ {
898
+ ref,
899
+ className: cn("px-2 py-1.5 text-ui-caption text-secondary-muted-foreground", className),
900
+ ...props
901
+ }
902
+ ));
903
+ DropdownMenuLabel.displayName = "DropdownMenuLabel";
904
+ var DropdownMenuSeparator = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_radix_ui8.DropdownMenu.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
905
+ DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
906
+
907
+ // src/components/Conversation & AI Chat/ProjectSelector.tsx
908
+ var import_jsx_runtime14 = require("react/jsx-runtime");
909
+ var NEW_PROJECT = "__new__";
910
+ var ProjectSelector = React14.forwardRef(
911
+ ({ className, project, projects, onProjectChange, newProjectLabel = "New Project", selected = false, children, ...props }, ref) => {
912
+ const label = children ?? project ?? newProjectLabel;
913
+ const classes = cn(
914
+ "inline-flex h-10 items-center gap-2 rounded-full border bg-surface px-3 py-2 text-ui-label whitespace-nowrap text-surface-foreground transition-colors",
915
+ selected ? "border-border" : "border-input hover:border-input hover:bg-accent-soft hover:text-accent-soft-foreground data-[state=open]:bg-accent-soft data-[state=open]:text-accent-soft-foreground",
916
+ className
917
+ );
918
+ const content = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
919
+ project ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react6.FolderOpen, { size: 16, weight: "fill", "aria-hidden": true, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react6.FolderSimple, { size: 16, "aria-hidden": true, className: "shrink-0" }),
920
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: label }),
921
+ !selected && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react6.CaretDown, { size: 16, "aria-hidden": true, className: "shrink-0" })
922
+ ] });
923
+ if (selected) {
924
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: classes, title: typeof label === "string" ? label : void 0, children: content });
925
+ }
926
+ const trigger = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { ref, type: "button", "aria-haspopup": "menu", className: classes, ...props, children: content });
927
+ if (!projects) return trigger;
928
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(DropdownMenu, { children: [
929
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
930
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuContent, { side: "top", align: "end", className: "min-w-60", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
931
+ DropdownMenuRadioGroup,
932
+ {
933
+ value: project ?? NEW_PROJECT,
934
+ onValueChange: (next) => onProjectChange?.(next === NEW_PROJECT ? void 0 : next),
935
+ children: [
936
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuRadioItem, { value: NEW_PROJECT, children: newProjectLabel }),
937
+ projects.map((name) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuRadioItem, { value: name, children: name }, name))
938
+ ]
939
+ }
940
+ ) })
941
+ ] });
942
+ }
943
+ );
944
+ ProjectSelector.displayName = "ProjectSelector";
945
+
946
+ // src/components/Conversation & AI Chat/Timestamp.tsx
947
+ var React15 = __toESM(require("react"), 1);
948
+ var import_jsx_runtime15 = require("react/jsx-runtime");
949
+ var Timestamp = React15.forwardRef(
950
+ ({ className, time, children, timePosition = "before", ...props }, ref) => {
951
+ const timeNode = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("time", { className: "text-ui-caption whitespace-nowrap text-secondary-muted-foreground", children: time });
952
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
953
+ "div",
954
+ {
955
+ ref,
956
+ className: cn("flex items-center gap-2", timePosition === "before" && "justify-end", className),
957
+ ...props,
958
+ children: [
959
+ timePosition === "before" && timeNode,
960
+ children && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { role: "toolbar", "aria-label": "Message actions", className: "flex items-center", children }),
961
+ timePosition === "after" && timeNode
962
+ ]
963
+ }
964
+ );
965
+ }
966
+ );
967
+ Timestamp.displayName = "Timestamp";
968
+
969
+ // src/components/Conversation & AI Chat/TopicCard.tsx
970
+ var React16 = __toESM(require("react"), 1);
971
+ var import_react7 = require("@phosphor-icons/react");
972
+ var import_jsx_runtime16 = require("react/jsx-runtime");
973
+ var TopicCard = React16.forwardRef(
974
+ ({ className, icon, title, badge, description, tags, meta, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
975
+ "div",
976
+ {
977
+ ref,
978
+ className: cn("flex w-full flex-col gap-4 overflow-hidden rounded-xl border border-border bg-surface p-4", className),
979
+ ...props,
980
+ children: [
981
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-4", children: [
982
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-4 text-primary", children: [
983
+ icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "flex size-6 shrink-0 items-center justify-center [&>svg]:size-6", children: icon }),
984
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { className: "text-heading-h3 whitespace-nowrap", children: title })
985
+ ] }),
986
+ badge
987
+ ] }),
988
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-body-base text-surface-foreground", children: description }),
989
+ tags && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-wrap items-center gap-2", children: tags }),
990
+ meta && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex items-center gap-2 text-ui-caption text-secondary-muted-foreground", children: meta })
991
+ ]
992
+ }
993
+ )
994
+ );
995
+ TopicCard.displayName = "TopicCard";
996
+ function TopicCardMetaItem({ icon, children, className, ...props }) {
997
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: cn("flex items-center gap-1", className), ...props, children: [
998
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", className: "flex size-4 items-center justify-center [&>svg]:size-4", children: icon }),
999
+ children
1000
+ ] });
1001
+ }
1002
+ function TopicCardTag({ className, ...props }) {
1003
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1004
+ "span",
1005
+ {
1006
+ className: cn(
1007
+ "rounded-sm bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2 py-1 text-ui-caption text-surface-foreground",
1008
+ className
1009
+ ),
1010
+ ...props
1011
+ }
1012
+ );
1013
+ }
1014
+ var TopicActivityRow = React16.forwardRef(
1015
+ ({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1016
+ "button",
1017
+ {
1018
+ ref,
1019
+ type: "button",
1020
+ className: cn(
1021
+ "flex w-full items-center gap-4 border-b border-border bg-surface p-4 text-left text-body-small text-surface-foreground",
1022
+ className
1023
+ ),
1024
+ ...props,
1025
+ children: [
1026
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "flex items-center gap-2 whitespace-nowrap", children: [
1027
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react7.Check, { size: 16, "aria-hidden": true, className: "text-accent" }),
1028
+ status
1029
+ ] }),
1030
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
1031
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react7.CaretRight, { size: 16, "aria-hidden": true })
1032
+ ]
1033
+ }
1034
+ )
1035
+ );
1036
+ TopicActivityRow.displayName = "TopicActivityRow";
1037
+
1038
+ // src/components/Conversation & AI Chat/UserMessageBubble.tsx
1039
+ var React17 = __toESM(require("react"), 1);
1040
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1041
+ var UserMessageBubble = React17.forwardRef(
1042
+ ({ className, children, attachments, footer, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref, className: cn("flex w-full max-w-125 flex-col items-end gap-2.5", className), ...props, children: [
1043
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex w-full flex-col gap-4 rounded-tl-xl rounded-tr-xl rounded-br-xs rounded-bl-xl bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 p-4 text-body-base text-surface-foreground", children: [
1044
+ attachments && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-wrap gap-4", children: attachments }),
1045
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "break-words", children })
1046
+ ] }),
1047
+ footer && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w-full", children: footer })
1048
+ ] })
1049
+ );
1050
+ UserMessageBubble.displayName = "UserMessageBubble";
1051
+
1052
+ // src/components/Forms & Data Entry/Calendar.tsx
1053
+ var import_react8 = require("@phosphor-icons/react");
1054
+ var import_react_day_picker = require("react-day-picker");
1055
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1056
+ var subtleFill = "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5";
1057
+ function Calendar({
1058
+ className,
1059
+ classNames,
1060
+ showOutsideDays = true,
1061
+ captionLayout = "dropdown",
1062
+ recommendedDates,
1063
+ modifiers,
1064
+ modifiersClassNames,
1065
+ startMonth,
1066
+ endMonth,
1067
+ ...props
1068
+ }) {
1069
+ const year = (/* @__PURE__ */ new Date()).getFullYear();
1070
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1071
+ import_react_day_picker.DayPicker,
1072
+ {
1073
+ showOutsideDays,
1074
+ captionLayout,
1075
+ startMonth: startMonth ?? new Date(year - 10, 0),
1076
+ endMonth: endMonth ?? new Date(year + 10, 11),
1077
+ className: cn("w-71 text-surface-foreground", className),
1078
+ modifiers: { ...recommendedDates ? { recommended: recommendedDates } : {}, ...modifiers },
1079
+ modifiersClassNames: {
1080
+ recommended: "border border-dashed border-border *:text-surface-foreground",
1081
+ ...modifiersClassNames
1082
+ },
1083
+ classNames: {
1084
+ root: "relative",
1085
+ months: "flex flex-col",
1086
+ month: "flex flex-col items-center gap-4",
1087
+ nav: "absolute inset-x-0 top-0 flex h-8 items-center justify-between",
1088
+ button_previous: "inline-flex size-8 items-center justify-center rounded-sm text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground disabled:opacity-50",
1089
+ button_next: "inline-flex size-8 items-center justify-center rounded-sm text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground disabled:opacity-50",
1090
+ month_caption: "flex h-8 items-center justify-center",
1091
+ dropdowns: "flex items-center gap-1",
1092
+ dropdown_root: "relative inline-flex items-center rounded-md border border-input bg-surface px-3 py-1.5 text-body-small shadow-xs hover:border-input-accent",
1093
+ dropdown: "absolute inset-0 cursor-pointer opacity-0",
1094
+ caption_label: "flex items-center gap-2 text-body-small text-surface-foreground",
1095
+ month_grid: "w-full border-collapse",
1096
+ weekdays: "flex gap-1",
1097
+ weekday: "flex h-8 w-9 items-center justify-center text-ui-caption text-muted-foreground",
1098
+ weeks: "flex flex-col gap-1",
1099
+ week: "flex gap-1",
1100
+ day: "size-9 rounded-full p-0 text-center",
1101
+ day_button: "flex size-full items-center justify-center rounded-full text-ui-caption text-secondary-muted-foreground transition-colors hover:bg-accent-soft hover:text-accent-soft-foreground",
1102
+ selected: cn(subtleFill, "*:text-surface-foreground"),
1103
+ today: "font-semibold",
1104
+ outside: "opacity-60 *:text-muted-foreground",
1105
+ disabled: "opacity-60 *:pointer-events-none *:text-muted-foreground",
1106
+ hidden: "invisible",
1107
+ ...classNames
1108
+ },
1109
+ components: {
1110
+ Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react8.CaretLeft, { size: 16, "aria-hidden": true }) : orientation === "right" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react8.CaretRight, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react8.CaretDown, { size: 16, "aria-hidden": true })
1111
+ },
1112
+ ...props
1113
+ }
1114
+ );
1115
+ }
1116
+ Calendar.displayName = "Calendar";
1117
+
1118
+ // src/components/Forms & Data Entry/DateTimePicker.tsx
1119
+ var React22 = __toESM(require("react"), 1);
1120
+ var import_react10 = require("@phosphor-icons/react");
1121
+ var import_radix_ui12 = require("radix-ui");
1122
+
1123
+ // src/components/Forms & Data Entry/Field.tsx
1124
+ var React18 = __toESM(require("react"), 1);
1125
+ var import_react9 = require("@phosphor-icons/react");
1126
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1127
+ function fieldSurfaceClasses(status = "default") {
1128
+ return cn(
1129
+ "border bg-surface text-surface-foreground transition-colors",
1130
+ status === "success" && "border-success-foreground",
1131
+ status === "error" && "border-destructive",
1132
+ status === "default" && "border-input hover:border-input-accent"
1133
+ );
1134
+ }
1135
+ function Field({ label, description, message, status = "default", id, className, children }) {
1136
+ const generatedId = React18.useId();
1137
+ const controlId = id ?? generatedId;
1138
+ const messageId = `${controlId}-message`;
1139
+ const showStatus = status !== "default" && message != null;
1140
+ const text = showStatus ? message : description;
1141
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cn("flex w-full flex-col gap-1.5", className), children: [
1142
+ label != null && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Label, { htmlFor: controlId, children: label }),
1143
+ children({
1144
+ id: controlId,
1145
+ "aria-describedby": text != null ? messageId : void 0,
1146
+ "aria-invalid": status === "error" ? true : void 0
1147
+ }),
1148
+ text != null && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1149
+ "p",
1150
+ {
1151
+ id: messageId,
1152
+ className: cn(
1153
+ "flex gap-2 text-ui-caption",
1154
+ status === "default" && "text-secondary-muted-foreground",
1155
+ status === "success" && "items-center text-success-foreground",
1156
+ status === "error" && "items-start text-destructive"
1157
+ ),
1158
+ children: [
1159
+ showStatus && (status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react9.WarningCircle, { size: 16, "aria-hidden": true, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react9.CheckCircle, { size: 16, "aria-hidden": true, className: "shrink-0" })),
1160
+ text
1161
+ ]
1162
+ }
1163
+ )
1164
+ ] });
1165
+ }
1166
+
1167
+ // src/components/Forms & Data Entry/formatDateTime.ts
1168
+ function formatDateTime(date, showTime = true) {
1169
+ const day = date.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" });
1170
+ if (!showTime) return day;
1171
+ return `${day} - ${date.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" })}`;
1172
+ }
1173
+
1174
+ // src/components/Forms & Data Entry/TimePicker.tsx
1175
+ var React21 = __toESM(require("react"), 1);
1176
+ var import_radix_ui11 = require("radix-ui");
1177
+
1178
+ // src/components/Navigation/TabItem.tsx
1179
+ var React20 = __toESM(require("react"), 1);
1180
+ var import_radix_ui10 = require("radix-ui");
1181
+
1182
+ // src/components/Navigation/TabNavigation.tsx
1183
+ var React19 = __toESM(require("react"), 1);
1184
+ var import_radix_ui9 = require("radix-ui");
1185
+ var import_class_variance_authority3 = require("class-variance-authority");
1186
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1187
+ var TabNavigationContext = React19.createContext("filter");
1188
+ var tabNavigationVariants = (0, import_class_variance_authority3.cva)("inline-flex items-start gap-1 p-0.5", {
1189
+ variants: {
1190
+ variant: {
1191
+ filter: "rounded-full border border-border bg-surface",
1192
+ toggle: "rounded-md bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5"
1193
+ }
1194
+ },
1195
+ defaultVariants: { variant: "filter" }
1196
+ });
1197
+ var Tabs = import_radix_ui9.Tabs.Root;
1198
+ var TabsContent = import_radix_ui9.Tabs.Content;
1199
+ var TabNavigation = React19.forwardRef(
1200
+ ({ className, variant = "filter", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabNavigationContext.Provider, { value: variant ?? "filter", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui9.Tabs.List, { ref, className: cn(tabNavigationVariants({ variant }), className), ...props }) })
1201
+ );
1202
+ TabNavigation.displayName = "TabNavigation";
1203
+
1204
+ // src/components/Navigation/TabItem.tsx
1205
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1206
+ var base = "inline-flex h-7 items-center justify-center gap-1 whitespace-nowrap px-2.5 py-1 text-ui-label transition-colors disabled:pointer-events-none disabled:opacity-50";
1207
+ var filter = "rounded-full text-surface-foreground hover:text-accent data-[state=active]:bg-secondary data-[state=active]:bg-linear-to-r data-[state=active]:from-overlay-dark-5 data-[state=active]:to-overlay-dark-5 data-[state=active]:hover:bg-accent-soft data-[state=active]:hover:bg-none data-[state=active]:hover:text-accent-soft-foreground disabled:text-muted-foreground";
1208
+ var toggle = "rounded-sm text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:bg-surface data-[state=active]:text-surface-foreground";
1209
+ var TabItem = React20.forwardRef(
1210
+ ({ className, ...props }, ref) => {
1211
+ const variant = React20.useContext(TabNavigationContext);
1212
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1213
+ import_radix_ui10.Tabs.Trigger,
1214
+ {
1215
+ ref,
1216
+ className: cn(base, variant === "toggle" ? toggle : filter, className),
1217
+ ...props
1218
+ }
1219
+ );
1220
+ }
1221
+ );
1222
+ TabItem.displayName = "TabItem";
1223
+
1224
+ // src/components/Forms & Data Entry/TimePicker.tsx
1225
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1226
+ var TimeItem = React21.forwardRef(
1227
+ ({ className, recommended, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1228
+ import_radix_ui11.ToggleGroup.Item,
1229
+ {
1230
+ ref,
1231
+ className: cn(
1232
+ "flex w-full justify-center rounded-sm px-2.5 py-1.5 text-ui-caption text-secondary-muted-foreground transition-colors",
1233
+ "hover:bg-accent-soft hover:text-accent-soft-foreground",
1234
+ "data-[state=on]:bg-secondary data-[state=on]:bg-linear-to-r data-[state=on]:from-overlay-dark-5 data-[state=on]:to-overlay-dark-5 data-[state=on]:text-surface-foreground",
1235
+ "data-[state=on]:hover:bg-accent-soft data-[state=on]:hover:bg-none data-[state=on]:hover:text-accent-soft-foreground",
1236
+ "disabled:pointer-events-none disabled:opacity-60 disabled:text-muted-foreground",
1237
+ recommended && "border border-dashed border-border text-surface-foreground",
1238
+ className
1239
+ ),
1240
+ ...props
1241
+ }
1242
+ )
1243
+ );
1244
+ TimeItem.displayName = "TimeItem";
1245
+ var pad = (n) => String(n).padStart(2, "0");
1246
+ function TimePicker({
1247
+ value,
1248
+ onValueChange,
1249
+ minuteStep = 5,
1250
+ isHourDisabled,
1251
+ isMinuteDisabled,
1252
+ isHourRecommended,
1253
+ isMinuteRecommended,
1254
+ className
1255
+ }) {
1256
+ const current = value ?? { hour: 12, minute: 0, period: "AM" };
1257
+ const root = React21.useRef(null);
1258
+ React21.useEffect(() => {
1259
+ root.current?.querySelectorAll('[data-state="on"]').forEach((item) => {
1260
+ const column = item.parentElement;
1261
+ if (column) column.scrollTop = Math.max(0, item.offsetTop - column.offsetTop - column.clientHeight / 2 + item.clientHeight / 2);
1262
+ });
1263
+ }, []);
1264
+ const hours = Array.from({ length: 12 }, (_, i) => i + 1);
1265
+ const minutes = Array.from({ length: Math.ceil(60 / minuteStep) }, (_, i) => i * minuteStep);
1266
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { ref: root, className: cn("flex w-45 flex-col gap-4 pt-2", className), children: [
1267
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-ui-label text-surface-foreground", children: "Select Time" }),
1268
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1269
+ Tabs,
1270
+ {
1271
+ value: current.period,
1272
+ onValueChange: (period) => onValueChange?.({ ...current, period }),
1273
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabNavigation, { variant: "toggle", "aria-label": "AM or PM", className: "self-start", children: ["AM", "PM"].map((period) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabItem, { value: period, children: period }, period)) })
1274
+ }
1275
+ ),
1276
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex h-47.5 w-full items-start gap-3", children: [
1277
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1278
+ import_radix_ui11.ToggleGroup.Root,
1279
+ {
1280
+ type: "single",
1281
+ "aria-label": "Hour",
1282
+ value: String(current.hour),
1283
+ onValueChange: (next) => next && onValueChange?.({ ...current, hour: Number(next) }),
1284
+ className: "flex h-full min-w-0 flex-1 flex-col gap-1 overflow-y-auto",
1285
+ children: hours.map((hour) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1286
+ TimeItem,
1287
+ {
1288
+ value: String(hour),
1289
+ disabled: isHourDisabled?.(hour, current.period),
1290
+ recommended: isHourRecommended?.(hour, current.period),
1291
+ children: pad(hour)
1292
+ },
1293
+ hour
1294
+ ))
1295
+ }
1296
+ ),
1297
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex h-full items-center text-ui-label-large text-surface-foreground", "aria-hidden": "true", children: ":" }),
1298
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1299
+ import_radix_ui11.ToggleGroup.Root,
1300
+ {
1301
+ type: "single",
1302
+ "aria-label": "Minute",
1303
+ value: String(current.minute),
1304
+ onValueChange: (next) => next && onValueChange?.({ ...current, minute: Number(next) }),
1305
+ className: "flex h-full min-w-0 flex-1 flex-col gap-1 overflow-y-auto",
1306
+ children: minutes.map((minute) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1307
+ TimeItem,
1308
+ {
1309
+ value: String(minute),
1310
+ disabled: isMinuteDisabled?.(minute, current.hour, current.period),
1311
+ recommended: isMinuteRecommended?.(minute, current.hour, current.period),
1312
+ children: pad(minute)
1313
+ },
1314
+ minute
1315
+ ))
1316
+ }
1317
+ )
1318
+ ] })
1319
+ ] });
1320
+ }
1321
+
1322
+ // src/components/Forms & Data Entry/DateTimePicker.tsx
1323
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1324
+ function toTimeValue(date) {
1325
+ if (!date) return void 0;
1326
+ const hours = date.getHours();
1327
+ return { hour: hours % 12 === 0 ? 12 : hours % 12, minute: date.getMinutes(), period: hours >= 12 ? "PM" : "AM" };
1328
+ }
1329
+ function combine(date, time) {
1330
+ const next = new Date(date);
1331
+ next.setHours(time.hour % 12 + (time.period === "PM" ? 12 : 0), time.minute, 0, 0);
1332
+ return next;
1333
+ }
1334
+ function DateTimePicker({
1335
+ value,
1336
+ defaultValue,
1337
+ onApply,
1338
+ onReset,
1339
+ showTime = true,
1340
+ calendarProps,
1341
+ timePickerProps,
1342
+ className
1343
+ }) {
1344
+ const [date, setDate] = React22.useState(value ?? defaultValue);
1345
+ const [time, setTime] = React22.useState(toTimeValue(value ?? defaultValue));
1346
+ const apply = () => {
1347
+ if (!date) return onApply?.(void 0);
1348
+ onApply?.(showTime ? combine(date, time ?? { hour: 12, minute: 0, period: "AM" }) : date);
1349
+ };
1350
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1351
+ "div",
1352
+ {
1353
+ className: cn(
1354
+ "inline-flex flex-col gap-4 rounded-lg border border-border bg-surface p-4 shadow-md",
1355
+ className
1356
+ ),
1357
+ children: [
1358
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-6", children: [
1359
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Calendar, { mode: "single", selected: date, onSelect: setDate, defaultMonth: date, ...calendarProps }),
1360
+ showTime && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
1361
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "h-70 w-px self-center bg-border", "aria-hidden": "true" }),
1362
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TimePicker, { value: time, onValueChange: setTime, ...timePickerProps })
1363
+ ] })
1364
+ ] }),
1365
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [
1366
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1367
+ Button,
1368
+ {
1369
+ type: "button",
1370
+ variant: "ghost",
1371
+ size: "sm",
1372
+ onClick: () => {
1373
+ setDate(void 0);
1374
+ setTime(void 0);
1375
+ onReset?.();
1376
+ },
1377
+ children: "Reset"
1378
+ }
1379
+ ),
1380
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { type: "button", variant: "outline", size: "sm", onClick: apply, children: "Apply" })
1381
+ ] })
1382
+ ]
1383
+ }
1384
+ );
1385
+ }
1386
+ var DatePicker = React22.forwardRef(
1387
+ ({ label, placeholder = "Select date and time", value, defaultValue, onValueChange, showTime = true, className, ...pickerProps }, ref) => {
1388
+ const [open, setOpen] = React22.useState(false);
1389
+ const [internal, setInternal] = React22.useState(defaultValue);
1390
+ const current = value ?? internal;
1391
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Field, { label, className: cn("w-75", className), children: (control) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_radix_ui12.Popover.Root, { open, onOpenChange: setOpen, children: [
1392
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_radix_ui12.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1393
+ "button",
1394
+ {
1395
+ ref,
1396
+ type: "button",
1397
+ ...control,
1398
+ className: "flex h-10 w-full items-center gap-3 rounded-md border border-input bg-surface px-3 py-2.5 text-left shadow-xs transition-colors hover:border-input-accent data-[state=open]:border-input-accent",
1399
+ children: [
1400
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react10.CalendarBlank, { size: 24, "aria-hidden": true, className: "shrink-0 text-surface-foreground" }),
1401
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: cn("truncate", current ? "text-ui-label-large text-surface-foreground" : "text-body-base text-muted-foreground"), children: current ? formatDateTime(current, showTime) : placeholder })
1402
+ ]
1403
+ }
1404
+ ) }),
1405
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_radix_ui12.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_radix_ui12.Popover.Content, { align: "start", sideOffset: 8, style: { zIndex: "var(--sys-z-20)" }, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1406
+ DateTimePicker,
1407
+ {
1408
+ ...pickerProps,
1409
+ showTime,
1410
+ value: current,
1411
+ onApply: (next) => {
1412
+ setInternal(next);
1413
+ onValueChange?.(next);
1414
+ setOpen(false);
1415
+ }
1416
+ }
1417
+ ) }) })
1418
+ ] }) });
1419
+ }
1420
+ );
1421
+ DatePicker.displayName = "DatePicker";
1422
+
1423
+ // src/components/Forms & Data Entry/Form.tsx
1424
+ var React23 = __toESM(require("react"), 1);
1425
+ var import_radix_ui13 = require("radix-ui");
1426
+ var import_react_hook_form = require("react-hook-form");
1427
+ var import_jsx_runtime24 = require("react/jsx-runtime");
1428
+ var Form = import_react_hook_form.FormProvider;
1429
+ var FormFieldContext = React23.createContext(null);
1430
+ function FormField(props) {
1431
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_hook_form.Controller, { ...props }) });
1432
+ }
1433
+ var FormItemContext = React23.createContext(null);
1434
+ function useFormField() {
1435
+ const fieldContext = React23.useContext(FormFieldContext);
1436
+ const itemContext = React23.useContext(FormItemContext);
1437
+ const { getFieldState } = (0, import_react_hook_form.useFormContext)();
1438
+ const formState = (0, import_react_hook_form.useFormState)({ name: fieldContext?.name });
1439
+ if (!fieldContext) {
1440
+ throw new Error("useFormField must be used within <FormField>");
1441
+ }
1442
+ if (!itemContext) {
1443
+ throw new Error("useFormField must be used within <FormItem>");
1444
+ }
1445
+ const fieldState = getFieldState(fieldContext.name, formState);
1446
+ const { id } = itemContext;
1447
+ return {
1448
+ id,
1449
+ name: fieldContext.name,
1450
+ formItemId: `${id}-form-item`,
1451
+ formDescriptionId: `${id}-form-item-description`,
1452
+ formMessageId: `${id}-form-item-message`,
1453
+ ...fieldState
1454
+ };
1455
+ }
1456
+ var FormItem = React23.forwardRef(({ className, ...props }, ref) => {
1457
+ const id = React23.useId();
1458
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref, className: cn("flex flex-col gap-2", className), ...props }) });
1459
+ });
1460
+ FormItem.displayName = "FormItem";
1461
+ var FormLabel = React23.forwardRef(
1462
+ ({ className, ...props }, ref) => {
1463
+ const { error, formItemId } = useFormField();
1464
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1465
+ Label,
1466
+ {
1467
+ ref,
1468
+ htmlFor: formItemId,
1469
+ className: cn(error && "text-destructive-foreground", className),
1470
+ ...props
1471
+ }
1472
+ );
1473
+ }
1474
+ );
1475
+ FormLabel.displayName = "FormLabel";
1476
+ var FormControl = React23.forwardRef((props, ref) => {
1477
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
1478
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1479
+ import_radix_ui13.Slot.Root,
1480
+ {
1481
+ ref,
1482
+ id: formItemId,
1483
+ "aria-describedby": error ? `${formDescriptionId} ${formMessageId}` : formDescriptionId,
1484
+ "aria-invalid": !!error,
1485
+ ...props
1486
+ }
1487
+ );
1488
+ });
1489
+ FormControl.displayName = "FormControl";
1490
+ var FormDescription = React23.forwardRef(
1491
+ ({ className, ...props }, ref) => {
1492
+ const { formDescriptionId } = useFormField();
1493
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1494
+ "p",
1495
+ {
1496
+ ref,
1497
+ id: formDescriptionId,
1498
+ className: cn("text-sm text-secondary-muted-foreground", className),
1499
+ ...props
1500
+ }
1501
+ );
1502
+ }
1503
+ );
1504
+ FormDescription.displayName = "FormDescription";
1505
+ var FormMessage = React23.forwardRef(
1506
+ ({ className, children, ...props }, ref) => {
1507
+ const { error, formMessageId } = useFormField();
1508
+ const body = error ? String(error?.message ?? "") : children;
1509
+ if (!body) {
1510
+ return null;
1511
+ }
1512
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { ref, id: formMessageId, className: cn("text-sm text-destructive-foreground", className), ...props, children: body });
1513
+ }
1514
+ );
1515
+ FormMessage.displayName = "FormMessage";
1516
+
1517
+ // src/components/Forms & Data Entry/Input.tsx
1518
+ var React24 = __toESM(require("react"), 1);
1519
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1520
+ var inputClasses = (status, className) => cn(
1521
+ "flex h-10 w-full rounded-md px-3 py-2 text-ui-input-value placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
1522
+ fieldSurfaceClasses(status),
1523
+ className
1524
+ );
1525
+ var Input = React24.forwardRef(
1526
+ ({ className, status = "default", label, description, message, id, ...props }, ref) => {
1527
+ if (label == null && description == null && message == null) {
1528
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1529
+ "input",
1530
+ {
1531
+ ref,
1532
+ id,
1533
+ "aria-invalid": status === "error" ? true : void 0,
1534
+ className: inputClasses(status, className),
1535
+ ...props
1536
+ }
1537
+ );
1538
+ }
1539
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("input", { ref, className: inputClasses(status, className), ...control, ...props }) });
1540
+ }
1541
+ );
1542
+ Input.displayName = "Input";
1543
+
1544
+ // src/components/Forms & Data Entry/InputWithAction.tsx
1545
+ var React25 = __toESM(require("react"), 1);
1546
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1547
+ var InputWithAction = React25.forwardRef(
1548
+ ({ className, actionLabel, onAction, tags, status = "default", label, description, message, id, disabled, placeholder, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
1549
+ "div",
1550
+ {
1551
+ className: cn(
1552
+ "flex min-h-10 w-full items-center gap-2 rounded-md border bg-surface py-2 pr-1 pl-3 transition-colors",
1553
+ "focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-ring",
1554
+ status === "error" ? "border-destructive" : "border-input hover:border-input-accent focus-within:border-input",
1555
+ tags ? "pl-1" : null,
1556
+ disabled && "opacity-50",
1557
+ className
1558
+ ),
1559
+ children: [
1560
+ tags && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex shrink-0 items-center gap-1", children: tags }),
1561
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1562
+ "input",
1563
+ {
1564
+ ref,
1565
+ disabled,
1566
+ placeholder: tags ? void 0 : placeholder,
1567
+ className: "min-w-0 flex-1 truncate bg-transparent text-body-small text-surface-foreground outline-none placeholder:text-muted-foreground",
1568
+ ...control,
1569
+ ...props
1570
+ }
1571
+ ),
1572
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { type: "button", variant: "subtle", size: "sm", disabled, onClick: onAction, children: actionLabel })
1573
+ ]
1574
+ }
1575
+ ) })
1576
+ );
1577
+ InputWithAction.displayName = "InputWithAction";
1578
+
1579
+ // src/components/Forms & Data Entry/NumberInput.tsx
1580
+ var React26 = __toESM(require("react"), 1);
1581
+ var import_react11 = require("@phosphor-icons/react");
1582
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1583
+ var NumberInput = React26.forwardRef(
1584
+ ({
1585
+ className,
1586
+ value,
1587
+ defaultValue = 0,
1588
+ onValueChange,
1589
+ min = Number.NEGATIVE_INFINITY,
1590
+ max = Number.POSITIVE_INFINITY,
1591
+ step = 1,
1592
+ unit,
1593
+ status = "default",
1594
+ label,
1595
+ description,
1596
+ message,
1597
+ id,
1598
+ disabled,
1599
+ ...props
1600
+ }, ref) => {
1601
+ const [internal, setInternal] = React26.useState(defaultValue);
1602
+ const current = value ?? internal;
1603
+ const clamp = (next) => Math.min(max, Math.max(min, next));
1604
+ const commit = (next) => {
1605
+ const clamped = clamp(next);
1606
+ setInternal(clamped);
1607
+ onValueChange?.(clamped);
1608
+ };
1609
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Field, { label, description, message, status, id, className: "w-50", children: (control) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
1610
+ "div",
1611
+ {
1612
+ className: cn(
1613
+ "flex h-10 w-full items-center justify-between rounded-md border bg-surface p-1 transition-colors",
1614
+ "has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-ring",
1615
+ status === "error" ? "border-destructive" : status === "success" ? "border-success-foreground" : "border-border",
1616
+ disabled && "opacity-50",
1617
+ className
1618
+ ),
1619
+ children: [
1620
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1621
+ Button,
1622
+ {
1623
+ type: "button",
1624
+ variant: "subtle",
1625
+ size: "icon-sm",
1626
+ "aria-label": "Decrease",
1627
+ disabled: disabled || current <= min,
1628
+ onClick: () => commit(current - step),
1629
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react11.Minus, { size: 16, "aria-hidden": true })
1630
+ }
1631
+ ),
1632
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center justify-center gap-1 text-center", children: [
1633
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1634
+ "input",
1635
+ {
1636
+ ref,
1637
+ role: "spinbutton",
1638
+ inputMode: "numeric",
1639
+ "aria-valuenow": current,
1640
+ "aria-valuemin": Number.isFinite(min) ? min : void 0,
1641
+ "aria-valuemax": Number.isFinite(max) ? max : void 0,
1642
+ disabled,
1643
+ value: String(current),
1644
+ size: Math.max(1, String(current).length),
1645
+ onChange: (event) => {
1646
+ const parsed = Number(event.target.value.replace(/[^\d.-]/g, ""));
1647
+ if (!Number.isNaN(parsed)) commit(parsed);
1648
+ },
1649
+ onKeyDown: (event) => {
1650
+ if (event.key === "ArrowUp") {
1651
+ event.preventDefault();
1652
+ commit(current + step);
1653
+ } else if (event.key === "ArrowDown") {
1654
+ event.preventDefault();
1655
+ commit(current - step);
1656
+ }
1657
+ },
1658
+ className: "min-w-0 bg-transparent text-center text-ui-label text-surface-foreground outline-none",
1659
+ ...control,
1660
+ ...props
1661
+ }
1662
+ ),
1663
+ unit && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-body-small text-secondary-muted-foreground", children: unit })
1664
+ ] }),
1665
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1666
+ Button,
1667
+ {
1668
+ type: "button",
1669
+ variant: "subtle",
1670
+ size: "icon-sm",
1671
+ "aria-label": "Increase",
1672
+ disabled: disabled || current >= max,
1673
+ onClick: () => commit(current + step),
1674
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react11.Plus, { size: 16, "aria-hidden": true })
1675
+ }
1676
+ )
1677
+ ]
1678
+ }
1679
+ ) });
1680
+ }
1681
+ );
1682
+ NumberInput.displayName = "NumberInput";
1683
+
1684
+ // src/components/Forms & Data Entry/SearchBar.tsx
1685
+ var React27 = __toESM(require("react"), 1);
1686
+ var import_react12 = require("@phosphor-icons/react");
1687
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1688
+ var SearchBar = React27.forwardRef(
1689
+ ({ className, value, defaultValue, onChange, onClear, clearLabel = "Clear search", disabled, ...props }, ref) => {
1690
+ const innerRef = React27.useRef(null);
1691
+ React27.useImperativeHandle(ref, () => innerRef.current);
1692
+ const [uncontrolled, setUncontrolled] = React27.useState(String(defaultValue ?? ""));
1693
+ const current = value !== void 0 ? String(value) : uncontrolled;
1694
+ const clear = () => {
1695
+ const input = innerRef.current;
1696
+ if (input) {
1697
+ const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
1698
+ setter?.call(input, "");
1699
+ input.dispatchEvent(new Event("input", { bubbles: true }));
1700
+ input.focus();
1701
+ }
1702
+ onClear?.();
1703
+ };
1704
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
1705
+ "div",
1706
+ {
1707
+ className: cn(
1708
+ "flex h-10 w-full items-center gap-2 rounded-md border bg-surface px-3 py-2 transition-colors",
1709
+ "border-input focus-within:border-input-accent focus-within:ring-1 focus-within:ring-input-accent",
1710
+ current !== "" && "border-input-accent ring-1 ring-input-accent",
1711
+ disabled && "opacity-50",
1712
+ className
1713
+ ),
1714
+ children: [
1715
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react12.MagnifyingGlass, { size: 16, "aria-hidden": true, className: "shrink-0 text-surface-foreground" }),
1716
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1717
+ "input",
1718
+ {
1719
+ ref: innerRef,
1720
+ type: "text",
1721
+ role: "searchbox",
1722
+ value,
1723
+ defaultValue,
1724
+ disabled,
1725
+ onChange: (event) => {
1726
+ setUncontrolled(event.target.value);
1727
+ onChange?.(event);
1728
+ },
1729
+ className: "min-w-0 flex-1 bg-transparent text-ui-input-value text-surface-foreground outline-none placeholder:text-muted-foreground",
1730
+ ...props
1731
+ }
1732
+ ),
1733
+ current !== "" && !disabled && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1734
+ "button",
1735
+ {
1736
+ type: "button",
1737
+ "aria-label": clearLabel,
1738
+ onClick: clear,
1739
+ className: "inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground",
1740
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react12.X, { size: 16, "aria-hidden": true })
1741
+ }
1742
+ )
1743
+ ]
1744
+ }
1745
+ );
1746
+ }
1747
+ );
1748
+ SearchBar.displayName = "SearchBar";
1749
+
1750
+ // src/components/Forms & Data Entry/Select.tsx
1751
+ var React28 = __toESM(require("react"), 1);
1752
+ var import_react13 = require("@phosphor-icons/react");
1753
+ var import_radix_ui14 = require("radix-ui");
1754
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1755
+ var Select = import_radix_ui14.Select.Root;
1756
+ var SelectValue = import_radix_ui14.Select.Value;
1757
+ var SelectGroup = import_radix_ui14.Select.Group;
1758
+ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M1 4L3.5 6.5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
1759
+ var SelectTrigger = React28.forwardRef(
1760
+ ({ className, children, icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
1761
+ import_radix_ui14.Select.Trigger,
1762
+ {
1763
+ ref,
1764
+ className: cn(
1765
+ "flex h-10 w-full items-center gap-2 rounded-md border border-input bg-surface px-3 py-2 text-left text-ui-input-value text-surface-foreground transition-colors",
1766
+ "hover:border-input-accent data-[state=open]:border-input-accent",
1767
+ "disabled:cursor-not-allowed disabled:opacity-50",
1768
+ "data-[placeholder]:text-muted-foreground",
1769
+ className
1770
+ ),
1771
+ ...props,
1772
+ children: [
1773
+ icon && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "flex shrink-0 text-surface-foreground", children: icon }),
1774
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
1775
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_radix_ui14.Select.Icon, { className: "shrink-0 text-surface-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react13.CaretDown, { size: 16, "aria-hidden": true }) })
1776
+ ]
1777
+ }
1778
+ )
1779
+ );
1780
+ SelectTrigger.displayName = "SelectTrigger";
1781
+ var SelectContent = React28.forwardRef(
1782
+ ({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_radix_ui14.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1783
+ import_radix_ui14.Select.Content,
1784
+ {
1785
+ ref,
1786
+ position,
1787
+ style: {
1788
+ zIndex: "var(--sys-z-20)",
1789
+ width: position === "popper" ? "var(--radix-select-trigger-width)" : void 0
1790
+ },
1791
+ className: cn(
1792
+ "overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md",
1793
+ className
1794
+ ),
1795
+ ...props,
1796
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_radix_ui14.Select.Viewport, { className: "p-1", children })
1797
+ }
1798
+ ) })
1799
+ );
1800
+ SelectContent.displayName = "SelectContent";
1801
+ var SelectItem = React28.forwardRef(
1802
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
1803
+ import_radix_ui14.Select.Item,
1804
+ {
1805
+ ref,
1806
+ className: cn(
1807
+ "relative flex cursor-default items-center gap-2 rounded-sm py-2 pr-4 pl-8 text-sm text-popover-foreground select-none",
1808
+ "outline-none data-[highlighted]:bg-accent-soft data-[highlighted]:text-accent-soft-foreground",
1809
+ className
1810
+ ),
1811
+ ...props,
1812
+ children: [
1813
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "absolute left-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_radix_ui14.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CheckIcon, {}) }) }),
1814
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_radix_ui14.Select.ItemText, { children })
1815
+ ]
1816
+ }
1817
+ )
1818
+ );
1819
+ SelectItem.displayName = "SelectItem";
1820
+
1821
+ // src/components/Forms & Data Entry/Slider.tsx
1822
+ var React29 = __toESM(require("react"), 1);
1823
+ var import_radix_ui15 = require("radix-ui");
1824
+ var import_jsx_runtime30 = require("react/jsx-runtime");
1825
+ var Slider = React29.forwardRef(
1826
+ ({
1827
+ className,
1828
+ value,
1829
+ defaultValue,
1830
+ onValueChange,
1831
+ min = 0,
1832
+ max = 100,
1833
+ label,
1834
+ showRange,
1835
+ showValue,
1836
+ "aria-label": ariaLabel,
1837
+ "aria-labelledby": ariaLabelledBy,
1838
+ ...props
1839
+ }, ref) => {
1840
+ const [internal, setInternal] = React29.useState(defaultValue ?? [min]);
1841
+ const thumbValues = value ?? internal;
1842
+ const hasHeader = label != null || showRange;
1843
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
1844
+ hasHeader && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center justify-between text-secondary-muted-foreground", children: [
1845
+ label != null ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-ui-label text-surface-foreground", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-ui-caption", children: min }),
1846
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-body-small", children: max })
1847
+ ] }),
1848
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
1849
+ import_radix_ui15.Slider.Root,
1850
+ {
1851
+ ref,
1852
+ value,
1853
+ defaultValue,
1854
+ min,
1855
+ max,
1856
+ onValueChange: (next) => {
1857
+ setInternal(next);
1858
+ onValueChange?.(next);
1859
+ },
1860
+ className: "relative flex h-4 w-full touch-none items-center select-none",
1861
+ ...props,
1862
+ children: [
1863
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui15.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_radix_ui15.Slider.Range, { className: "absolute h-full bg-input-accent" }) }),
1864
+ thumbValues.map((thumbValue, index) => (
1865
+ // The accessible name belongs on each individual thumb (the actual
1866
+ // role="slider" element) — Root is just a group container. With
1867
+ // more than one thumb this applies the same label to each; give a
1868
+ // range slider distinct per-thumb labels via aria-labelledby instead.
1869
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1870
+ import_radix_ui15.Slider.Thumb,
1871
+ {
1872
+ "aria-label": ariaLabel,
1873
+ "aria-labelledby": ariaLabelledBy,
1874
+ className: "group relative block size-4 rounded-full border-2 border-surface bg-input-accent shadow-sm transition-colors disabled:pointer-events-none disabled:opacity-50",
1875
+ children: showValue && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1876
+ "span",
1877
+ {
1878
+ "aria-hidden": "true",
1879
+ className: cn(
1880
+ "pointer-events-none absolute bottom-full left-1/2 mb-2 flex min-w-4 -translate-x-1/2 items-center justify-center rounded-xs bg-primary p-0.5 text-ui-caption text-label",
1881
+ showValue !== "always" && "invisible group-hover:visible group-focus-visible:visible group-active:visible"
1882
+ ),
1883
+ children: thumbValue
1884
+ }
1885
+ )
1886
+ },
1887
+ index
1888
+ )
1889
+ ))
1890
+ ]
1891
+ }
1892
+ )
1893
+ ] });
1894
+ }
1895
+ );
1896
+ Slider.displayName = "Slider";
1897
+
1898
+ // src/components/Forms & Data Entry/Textarea.tsx
1899
+ var React30 = __toESM(require("react"), 1);
1900
+ var import_jsx_runtime31 = require("react/jsx-runtime");
1901
+ var textareaClasses = (status, className) => cn(
1902
+ "flex field-sizing-content min-h-25 w-full rounded-md px-3 py-2.5 text-body-base placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
1903
+ fieldSurfaceClasses(status),
1904
+ className
1905
+ );
1906
+ var Textarea = React30.forwardRef(
1907
+ ({ className, status = "default", label, description, message, id, ...props }, ref) => {
1908
+ if (label == null && description == null && message == null) {
1909
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
1910
+ "textarea",
1911
+ {
1912
+ ref,
1913
+ id,
1914
+ "aria-invalid": status === "error" ? true : void 0,
1915
+ className: textareaClasses(status, className),
1916
+ ...props
1917
+ }
1918
+ );
1919
+ }
1920
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Field, { label, description, message, status, id, children: (control) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("textarea", { ref, className: textareaClasses(status, className), ...control, ...props }) });
1921
+ }
1922
+ );
1923
+ Textarea.displayName = "Textarea";
1924
+
1925
+ // src/components/Overlays & Feedback/Dialog.tsx
1926
+ var React31 = __toESM(require("react"), 1);
1927
+ var import_react14 = require("@phosphor-icons/react");
1928
+ var import_radix_ui16 = require("radix-ui");
1929
+ var import_jsx_runtime32 = require("react/jsx-runtime");
1930
+ var Dialog = import_radix_ui16.Dialog.Root;
1931
+ var DialogTrigger = import_radix_ui16.Dialog.Trigger;
1932
+ var DialogClose = import_radix_ui16.Dialog.Close;
1933
+ var DialogContent = React31.forwardRef(
1934
+ ({ className, children, closeLabel = "Close", hideClose, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_radix_ui16.Dialog.Portal, { children: [
1935
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1936
+ import_radix_ui16.Dialog.Overlay,
1937
+ {
1938
+ style: { zIndex: "var(--sys-z-30)" },
1939
+ className: "fixed inset-0 bg-primary/30"
1940
+ }
1941
+ ),
1942
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
1943
+ import_radix_ui16.Dialog.Content,
1944
+ {
1945
+ ref,
1946
+ style: { zIndex: "var(--sys-z-30)" },
1947
+ className: cn(
1948
+ "fixed top-1/2 left-1/2 flex w-150 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-lg border border-border bg-surface shadow-lg",
1949
+ className
1950
+ ),
1951
+ ...props,
1952
+ children: [
1953
+ children,
1954
+ !hideClose && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_radix_ui16.Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { variant: "ghost", size: "icon-sm", "aria-label": closeLabel, className: "absolute top-4 right-6", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react14.X, { size: 16, "aria-hidden": true }) }) })
1955
+ ]
1956
+ }
1957
+ )
1958
+ ] })
1959
+ );
1960
+ DialogContent.displayName = "DialogContent";
1961
+ var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("flex flex-col gap-1.5 border-b border-border px-6 py-4 pr-16", className), ...props });
1962
+ var DialogTitle = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1963
+ import_radix_ui16.Dialog.Title,
1964
+ {
1965
+ ref,
1966
+ className: cn("text-lg leading-6 font-semibold text-surface-foreground", className),
1967
+ ...props
1968
+ }
1969
+ ));
1970
+ DialogTitle.displayName = "DialogTitle";
1971
+ var DialogDescription = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1972
+ import_radix_ui16.Dialog.Description,
1973
+ {
1974
+ ref,
1975
+ className: cn("text-body-small text-secondary-muted-foreground", className),
1976
+ ...props
1977
+ }
1978
+ ));
1979
+ DialogDescription.displayName = "DialogDescription";
1980
+ var DialogBody = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("flex flex-col gap-4 p-6", className), ...props });
1981
+ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("flex items-center justify-end gap-3 border-t border-border px-6 py-4", className), ...props });
1982
+
1983
+ // src/components/Overlays & Feedback/Toast.tsx
1984
+ var React32 = __toESM(require("react"), 1);
1985
+ var import_react15 = require("@phosphor-icons/react");
1986
+ var import_class_variance_authority4 = require("class-variance-authority");
1987
+ var import_radix_ui17 = require("radix-ui");
1988
+ var import_jsx_runtime33 = require("react/jsx-runtime");
1989
+ var toastVariants = (0, import_class_variance_authority4.cva)("border", {
1990
+ variants: {
1991
+ variant: {
1992
+ info: "border-info-border bg-surface",
1993
+ success: "border-success-soft-border bg-success-soft",
1994
+ warning: "border-warning-soft-border bg-warning-soft",
1995
+ destructive: "border-destructive-soft-border bg-destructive-soft"
1996
+ }
1997
+ },
1998
+ defaultVariants: { variant: "info" }
1999
+ });
2000
+ var iconColour = {
2001
+ info: "text-surface-foreground",
2002
+ success: "text-success-soft-foreground",
2003
+ warning: "text-warning-soft-foreground",
2004
+ destructive: "text-destructive-soft-foreground"
2005
+ };
2006
+ var titleColour = {
2007
+ info: "text-surface-foreground",
2008
+ success: "text-success-soft-foreground",
2009
+ warning: "text-warning-soft-foreground",
2010
+ destructive: "text-destructive-soft-foreground"
2011
+ };
2012
+ function VariantIcon({ variant, size }) {
2013
+ const props = { size, "aria-hidden": true, className: cn("shrink-0", iconColour[variant]) };
2014
+ if (variant === "success") return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react15.CheckCircle, { ...props });
2015
+ if (variant === "warning") return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react15.Warning, { ...props });
2016
+ if (variant === "destructive") return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react15.WarningCircle, { ...props });
2017
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react15.Info, { ...props });
2018
+ }
2019
+ var ToastProvider = import_radix_ui17.Toast.Provider;
2020
+ var ToastViewport = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2021
+ import_radix_ui17.Toast.Viewport,
2022
+ {
2023
+ ref,
2024
+ style: { zIndex: "var(--sys-z-50)" },
2025
+ className: cn("fixed right-4 bottom-4 flex w-89 max-w-full flex-col gap-3 outline-none", className),
2026
+ ...props
2027
+ }
2028
+ ));
2029
+ ToastViewport.displayName = "ToastViewport";
2030
+ var Toast = React32.forwardRef(
2031
+ ({ className, variant = "info", title, description, action, closeLabel = "Close", children, ...props }, ref) => {
2032
+ const v = variant ?? "info";
2033
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
2034
+ import_radix_ui17.Toast.Root,
2035
+ {
2036
+ ref,
2037
+ type: v === "destructive" ? "foreground" : "background",
2038
+ className: cn("flex items-start gap-3 rounded-lg p-4 shadow-lg", toastVariants({ variant: v }), className),
2039
+ ...props,
2040
+ children: [
2041
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(VariantIcon, { variant: v, size: 20 }),
2042
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1 text-body-small", children: [
2043
+ title != null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_radix_ui17.Toast.Title, { className: cn("font-semibold", titleColour[v]), children: title }),
2044
+ description != null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_radix_ui17.Toast.Description, { className: "text-secondary-muted-foreground", children: description }),
2045
+ children,
2046
+ action
2047
+ ] }),
2048
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2049
+ import_radix_ui17.Toast.Close,
2050
+ {
2051
+ "aria-label": closeLabel,
2052
+ className: "inline-flex size-4 shrink-0 items-center justify-center rounded-xs text-surface-foreground",
2053
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react15.X, { size: 16, "aria-hidden": true })
2054
+ }
2055
+ )
2056
+ ]
2057
+ }
2058
+ );
2059
+ }
2060
+ );
2061
+ Toast.displayName = "Toast";
2062
+ var ToastAction = import_radix_ui17.Toast.Action;
2063
+ var ToastInline = React32.forwardRef(
2064
+ ({ className, variant = "info", onClose, closeLabel = "Close", children, ...props }, ref) => {
2065
+ const v = variant ?? "info";
2066
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
2067
+ "div",
2068
+ {
2069
+ ref,
2070
+ role: v === "destructive" ? "alert" : "status",
2071
+ className: cn("flex items-center gap-2 rounded-sm px-2 py-1.5", toastVariants({ variant: v }), className),
2072
+ ...props,
2073
+ children: [
2074
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(VariantIcon, { variant: v, size: 16 }),
2075
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
2076
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react15.X, { size: 16, "aria-hidden": true }) })
2077
+ ]
2078
+ }
2079
+ );
2080
+ }
2081
+ );
2082
+ ToastInline.displayName = "ToastInline";
2083
+
2084
+ // src/components/Overlays & Feedback/Tooltip.tsx
2085
+ var React33 = __toESM(require("react"), 1);
2086
+ var import_radix_ui18 = require("radix-ui");
2087
+ var import_jsx_runtime34 = require("react/jsx-runtime");
2088
+ var TooltipProvider = import_radix_ui18.Tooltip.Provider;
2089
+ var Tooltip = import_radix_ui18.Tooltip.Root;
2090
+ var TooltipTrigger = import_radix_ui18.Tooltip.Trigger;
2091
+ var TooltipContent = React33.forwardRef(
2092
+ ({ className, sideOffset = 4, title, description, action, arrow = true, children, ...props }, ref) => {
2093
+ const detailed = title != null || description != null;
2094
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_radix_ui18.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2095
+ import_radix_ui18.Tooltip.Content,
2096
+ {
2097
+ ref,
2098
+ sideOffset,
2099
+ style: { zIndex: "var(--sys-z-40)" },
2100
+ className: cn(
2101
+ "rounded-sm bg-primary-soft-foreground text-label shadow-md",
2102
+ detailed ? "flex max-w-60 min-w-50 flex-col gap-1 px-3 py-2.5" : "px-2.5 py-1.5 text-ui-caption",
2103
+ action != null && "max-w-65 min-w-55",
2104
+ className
2105
+ ),
2106
+ ...props,
2107
+ children: [
2108
+ detailed ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
2109
+ title != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-xs leading-4 font-semibold text-label", children: title }),
2110
+ description != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-xs leading-4.5 text-plum-200", children: description }),
2111
+ action != null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mt-1 text-ui-caption text-plum-300 underline *:underline", children: action })
2112
+ ] }) : children,
2113
+ arrow && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_radix_ui18.Tooltip.Arrow, { width: 12, height: 8, className: "fill-primary-soft-foreground" })
2114
+ ]
2115
+ }
2116
+ ) });
2117
+ }
2118
+ );
2119
+ TooltipContent.displayName = "TooltipContent";
2120
+
2121
+ // src/components/Question Types/FileUpload.tsx
2122
+ var React35 = __toESM(require("react"), 1);
2123
+ var import_react16 = require("@phosphor-icons/react");
2124
+ var import_radix_ui19 = require("radix-ui");
2125
+
2126
+ // src/components/Tags & Badges/Tag.tsx
2127
+ var React34 = __toESM(require("react"), 1);
2128
+ var import_class_variance_authority5 = require("class-variance-authority");
2129
+ var import_jsx_runtime35 = require("react/jsx-runtime");
2130
+ var tagVariants = (0, import_class_variance_authority5.cva)(
2131
+ "inline-flex items-center gap-1.5 whitespace-nowrap rounded-sm border px-2.5 py-1 text-ui-caption",
2132
+ {
2133
+ variants: {
2134
+ variant: {
2135
+ neutral: "border-accent-soft-border bg-accent-soft text-accent-soft-foreground",
2136
+ default: "border-border bg-surface text-surface-foreground",
2137
+ success: "border-success-soft-border bg-success-soft text-success-soft-foreground",
2138
+ warning: "border-warning-soft-border bg-warning-soft text-warning-soft-foreground",
2139
+ destructive: "border-destructive-soft-border bg-destructive-soft text-destructive-soft-foreground"
2140
+ }
2141
+ },
2142
+ defaultVariants: { variant: "neutral" }
2143
+ }
2144
+ );
2145
+ var Tag = React34.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { ref, className: cn(tagVariants({ variant }), className), ...props }));
2146
+ Tag.displayName = "Tag";
2147
+ var statusDotVariants = (0, import_class_variance_authority5.cva)("size-1.5 shrink-0 rounded-full", {
2148
+ variants: {
2149
+ status: {
2150
+ active: "bg-success-800",
2151
+ inactive: "bg-accent",
2152
+ pending: "bg-warning",
2153
+ error: "bg-destructive"
2154
+ }
2155
+ },
2156
+ defaultVariants: { status: "active" }
2157
+ });
2158
+ var StatusTag = React34.forwardRef(
2159
+ ({ className, status, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { ref, className: cn(tagVariants({ variant: "default" }), className), ...props, children: [
2160
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: statusDotVariants({ status }), "aria-hidden": "true" }),
2161
+ children
2162
+ ] })
2163
+ );
2164
+ StatusTag.displayName = "StatusTag";
2165
+
2166
+ // src/components/Question Types/FileUpload.tsx
2167
+ var import_jsx_runtime36 = require("react/jsx-runtime");
2168
+ var FileUploadZone = React35.forwardRef(
2169
+ ({ className, title = "Upload document", hint, icon, onFiles, ...props }, ref) => {
2170
+ const [over, setOver] = React35.useState(false);
2171
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
2172
+ "label",
2173
+ {
2174
+ className: cn(
2175
+ "flex min-h-35.75 w-full cursor-pointer flex-col items-center justify-center gap-2 rounded-md border-2 border-dashed border-border px-4 text-center transition-colors",
2176
+ "hover:bg-background has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-ring",
2177
+ over && "border-input-accent bg-accent-soft",
2178
+ className
2179
+ ),
2180
+ onDragOver: (event) => {
2181
+ event.preventDefault();
2182
+ setOver(true);
2183
+ },
2184
+ onDragLeave: () => setOver(false),
2185
+ onDrop: (event) => {
2186
+ event.preventDefault();
2187
+ setOver(false);
2188
+ onFiles?.(Array.from(event.dataTransfer.files));
2189
+ },
2190
+ children: [
2191
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "flex size-10 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react16.FileText, { size: 24, "aria-hidden": true }) }),
2192
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "flex flex-col gap-1", children: [
2193
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-body-small text-surface-foreground", children: title }),
2194
+ hint && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: hint })
2195
+ ] }),
2196
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
2197
+ "input",
2198
+ {
2199
+ ref,
2200
+ type: "file",
2201
+ className: "sr-only",
2202
+ onChange: (event) => onFiles?.(Array.from(event.target.files ?? [])),
2203
+ ...props
2204
+ }
2205
+ )
2206
+ ]
2207
+ }
2208
+ );
2209
+ }
2210
+ );
2211
+ FileUploadZone.displayName = "FileUploadZone";
2212
+ var FileUploadItem = React35.forwardRef(
2213
+ ({ className, name, size, status = "uploading", progress = 0, timeLeft, icon, onRemove, removeLabel, ...props }, ref) => {
2214
+ const uploading = status === "uploading";
2215
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
2216
+ "div",
2217
+ {
2218
+ ref,
2219
+ className: cn("flex w-full flex-col justify-center gap-2 overflow-hidden rounded-sm border border-border p-2", className),
2220
+ ...props,
2221
+ children: [
2222
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-2", children: [
2223
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react16.FileText, { size: 24, "aria-hidden": true }) }),
2224
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
2225
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
2226
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
2227
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "truncate text-ui-label text-surface-foreground", children: name }),
2228
+ status === "complete" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Tag, { variant: "success", children: "Complete" }),
2229
+ status === "error" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Tag, { variant: "destructive", children: "Error" })
2230
+ ] }),
2231
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react16.X, { size: 16, "aria-hidden": true }) })
2232
+ ] }),
2233
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between text-ui-caption text-secondary-muted-foreground", children: [
2234
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "flex items-center gap-2", children: [
2235
+ size,
2236
+ uploading && timeLeft && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
2237
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
2238
+ timeLeft
2239
+ ] })
2240
+ ] }),
2241
+ uploading && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-body-xxs font-normal", children: [
2242
+ Math.round(progress),
2243
+ "%"
2244
+ ] })
2245
+ ] })
2246
+ ] })
2247
+ ] }),
2248
+ uploading && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
2249
+ import_radix_ui19.Progress.Root,
2250
+ {
2251
+ value: progress,
2252
+ "aria-label": `Uploading ${name}`,
2253
+ className: "h-0.75 w-full overflow-hidden rounded-sm bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5",
2254
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_radix_ui19.Progress.Indicator, { className: "h-full bg-accent transition-[width]", style: { width: `${progress}%` } })
2255
+ }
2256
+ )
2257
+ ]
2258
+ }
2259
+ );
2260
+ }
2261
+ );
2262
+ FileUploadItem.displayName = "FileUploadItem";
2263
+
2264
+ // src/components/Question Types/Media.tsx
2265
+ var React36 = __toESM(require("react"), 1);
2266
+ var import_react17 = require("@phosphor-icons/react");
2267
+ var import_radix_ui20 = require("radix-ui");
2268
+ var import_jsx_runtime37 = require("react/jsx-runtime");
2269
+ function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...props }) {
2270
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("flex items-center justify-between border-t border-border bg-surface px-6 py-4", className), ...props, children: [
2271
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
2272
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: cn("truncate text-surface-foreground", large ? "text-body-section" : "text-ui-label"), children: name }),
2273
+ details && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: cn("flex items-center gap-2 text-secondary-muted-foreground", large ? "text-body-small" : "text-ui-caption"), children: details.map((part, index) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(React36.Fragment, { children: [
2274
+ index > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { "aria-hidden": "true", className: "size-0.5 rounded-full bg-secondary-muted-foreground" }),
2275
+ part
2276
+ ] }, part)) })
2277
+ ] }),
2278
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { type: "button", variant: "destructive", size: "icon", "aria-label": removeLabel ?? `Remove ${name}`, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.Trash, { size: 16, "aria-hidden": true }) })
2279
+ ] });
2280
+ }
2281
+ var ImagePreview = React36.forwardRef(
2282
+ ({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border", className), ...props, children: [
2283
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex h-84 w-full items-center justify-center bg-accent-soft [&>img]:size-full [&>img]:object-contain", children }),
2284
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MediaInfo, { name, details, onRemove, large: true })
2285
+ ] })
2286
+ );
2287
+ ImagePreview.displayName = "ImagePreview";
2288
+ var ImageThumbnails = React36.forwardRef(
2289
+ ({ className, max, images, value, onValueChange, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2290
+ import_radix_ui20.ToggleGroup.Root,
2291
+ {
2292
+ ref,
2293
+ type: "single",
2294
+ value: value ?? "",
2295
+ onValueChange: (next) => next && onValueChange?.(next),
2296
+ className: cn("flex w-full gap-2", className),
2297
+ ...props,
2298
+ children: Array.from({ length: max }, (_, index) => {
2299
+ const image = images[index];
2300
+ if (!image) {
2301
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2302
+ "span",
2303
+ {
2304
+ "aria-hidden": "true",
2305
+ className: "flex h-20 min-w-0 flex-1 items-center justify-center rounded-sm border border-dashed border-border text-accent-foreground",
2306
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.Image, { size: 24 })
2307
+ },
2308
+ `empty-${index}`
2309
+ );
2310
+ }
2311
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2312
+ import_radix_ui20.ToggleGroup.Item,
2313
+ {
2314
+ value: image.id,
2315
+ "aria-label": image.alt,
2316
+ className: cn(
2317
+ "flex h-20 min-w-0 flex-1 items-center justify-center overflow-hidden rounded-sm border border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 p-2 text-surface-foreground transition-colors",
2318
+ "hover:bg-accent-soft hover:bg-none",
2319
+ "data-[state=on]:border-accent-foreground data-[state=on]:bg-accent-soft data-[state=on]:bg-none data-[state=on]:text-accent-foreground"
2320
+ ),
2321
+ children: image.src ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("img", { src: image.src, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.Image, { size: 24, "aria-hidden": true })
2322
+ },
2323
+ image.id
2324
+ );
2325
+ })
2326
+ }
2327
+ )
2328
+ );
2329
+ ImageThumbnails.displayName = "ImageThumbnails";
2330
+ var formatTime = (seconds) => {
2331
+ const total = Math.max(0, Math.floor(Number.isFinite(seconds) ? seconds : 0));
2332
+ return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
2333
+ };
2334
+ var VideoPlayer = React36.forwardRef(
2335
+ ({ className, src, name, details, onRemove, onMore, initialTime = 0, initialDuration = 0, ...props }, ref) => {
2336
+ const video = React36.useRef(null);
2337
+ const [playing, setPlaying] = React36.useState(false);
2338
+ const [time, setTime] = React36.useState(initialTime);
2339
+ const [duration, setDuration] = React36.useState(initialDuration);
2340
+ const [volume, setVolume] = React36.useState(1);
2341
+ const muted = volume === 0;
2342
+ const toggle2 = () => {
2343
+ const el = video.current;
2344
+ if (!el) return setPlaying((p) => !p);
2345
+ if (el.paused) void el.play();
2346
+ else el.pause();
2347
+ };
2348
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface", className), ...props, children: [
2349
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative flex h-60.5 w-full items-end bg-accent-soft", children: [
2350
+ src && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2351
+ "video",
2352
+ {
2353
+ ref: video,
2354
+ src,
2355
+ className: "absolute inset-0 size-full object-contain",
2356
+ onPlay: () => setPlaying(true),
2357
+ onPause: () => setPlaying(false),
2358
+ onTimeUpdate: (event) => setTime(event.currentTarget.currentTime),
2359
+ onLoadedMetadata: (event) => setDuration(event.currentTarget.duration),
2360
+ onVolumeChange: (event) => setVolume(event.currentTarget.muted ? 0 : event.currentTarget.volume)
2361
+ }
2362
+ ),
2363
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative flex w-full flex-col gap-2 bg-surface-foreground bg-linear-to-r from-primary/30 to-primary/30 px-4 pt-3 pb-4 text-surface", children: [
2364
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
2365
+ import_radix_ui20.Slider.Root,
2366
+ {
2367
+ min: 0,
2368
+ max: duration || 1,
2369
+ step: 0.1,
2370
+ value: [Math.min(time, duration || 1)],
2371
+ onValueChange: ([next]) => {
2372
+ if (next === void 0) return;
2373
+ setTime(next);
2374
+ if (video.current) video.current.currentTime = next;
2375
+ },
2376
+ className: "relative flex h-4 w-full touch-none items-center select-none",
2377
+ children: [
2378
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_radix_ui20.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_radix_ui20.Slider.Range, { className: "absolute h-full bg-accent-foreground" }) }),
2379
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_radix_ui20.Slider.Thumb, { "aria-label": "Seek", className: "block size-3 rounded-full border-2 border-surface bg-surface shadow-sm" })
2380
+ ]
2381
+ }
2382
+ ),
2383
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center justify-between", children: [
2384
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-4", children: [
2385
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2386
+ "button",
2387
+ {
2388
+ type: "button",
2389
+ "aria-label": playing ? "Pause" : "Play",
2390
+ onClick: toggle2,
2391
+ className: "inline-flex size-10 items-center justify-center rounded-full bg-surface/12 text-surface transition-colors hover:bg-surface/20",
2392
+ children: playing ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.Pause, { size: 16, weight: "fill", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.Play, { size: 16, weight: "fill", "aria-hidden": true })
2393
+ }
2394
+ ),
2395
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "text-ui-label whitespace-nowrap text-surface/80", children: [
2396
+ formatTime(time),
2397
+ " / ",
2398
+ formatTime(duration)
2399
+ ] })
2400
+ ] }),
2401
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-2", children: [
2402
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2403
+ VolumeControl,
2404
+ {
2405
+ volume,
2406
+ onVolumeChange: (next) => {
2407
+ setVolume(next);
2408
+ if (video.current) {
2409
+ video.current.volume = next;
2410
+ video.current.muted = next === 0;
2411
+ }
2412
+ }
2413
+ }
2414
+ ),
2415
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2416
+ "button",
2417
+ {
2418
+ type: "button",
2419
+ "aria-label": "Full screen",
2420
+ onClick: () => void video.current?.requestFullscreen?.(),
2421
+ className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
2422
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.CornersOut, { size: 16, "aria-hidden": true })
2423
+ }
2424
+ ),
2425
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2426
+ "button",
2427
+ {
2428
+ type: "button",
2429
+ "aria-label": "More",
2430
+ onClick: onMore,
2431
+ className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
2432
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.DotsThree, { size: 16, "aria-hidden": true })
2433
+ }
2434
+ )
2435
+ ] })
2436
+ ] })
2437
+ ] })
2438
+ ] }),
2439
+ name && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MediaInfo, { name, details, onRemove }),
2440
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "sr-only", "aria-live": "polite", children: muted ? "Muted" : "" })
2441
+ ] });
2442
+ }
2443
+ );
2444
+ VideoPlayer.displayName = "VideoPlayer";
2445
+ function VolumeControl({ volume, onVolumeChange, className }) {
2446
+ const last = React36.useRef(volume || 1);
2447
+ if (volume > 0) last.current = volume;
2448
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("group/volume flex items-center", className), children: [
2449
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "w-0 overflow-hidden opacity-0 transition-all group-focus-within/volume:w-16 group-focus-within/volume:opacity-100 group-hover/volume:w-16 group-hover/volume:opacity-100", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
2450
+ import_radix_ui20.Slider.Root,
2451
+ {
2452
+ min: 0,
2453
+ max: 1,
2454
+ step: 0.05,
2455
+ value: [volume],
2456
+ onValueChange: ([next]) => next !== void 0 && onVolumeChange(next),
2457
+ className: "relative flex h-4 w-14 touch-none items-center select-none",
2458
+ children: [
2459
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_radix_ui20.Slider.Track, { className: "relative h-1 w-full grow overflow-hidden rounded-xxs bg-surface/20", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_radix_ui20.Slider.Range, { className: "absolute h-full bg-surface" }) }),
2460
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_radix_ui20.Slider.Thumb, { "aria-label": "Volume", className: "block size-3 rounded-full bg-surface shadow-sm" })
2461
+ ]
2462
+ }
2463
+ ) }),
2464
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2465
+ "button",
2466
+ {
2467
+ type: "button",
2468
+ "aria-label": volume === 0 ? "Unmute" : "Mute",
2469
+ onClick: () => onVolumeChange(volume === 0 ? last.current : 0),
2470
+ className: "inline-flex size-10 items-center justify-center rounded-md text-surface transition-colors hover:bg-surface/12",
2471
+ children: volume === 0 ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.SpeakerSimpleX, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react17.SpeakerSimpleHigh, { size: 16, "aria-hidden": true })
2472
+ }
2473
+ )
2474
+ ] });
2475
+ }
2476
+
2477
+ // src/components/Question Types/OpenEndAnswer.tsx
2478
+ var React37 = __toESM(require("react"), 1);
2479
+ var import_jsx_runtime38 = require("react/jsx-runtime");
2480
+ var OpenEndAnswer = React37.forwardRef(
2481
+ ({ value, defaultValue, onChange, maxLength = 1e3, placeholder = "Write your answer", ...props }, ref) => {
2482
+ const [internal, setInternal] = React37.useState(String(defaultValue ?? ""));
2483
+ const text = value !== void 0 ? String(value) : internal;
2484
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2485
+ Textarea,
2486
+ {
2487
+ ref,
2488
+ value: text,
2489
+ maxLength,
2490
+ placeholder,
2491
+ description: `${text.length}/${maxLength} characters`,
2492
+ onChange: (event) => {
2493
+ setInternal(event.target.value);
2494
+ onChange?.(event);
2495
+ },
2496
+ ...props
2497
+ }
2498
+ );
2499
+ }
2500
+ );
2501
+ OpenEndAnswer.displayName = "OpenEndAnswer";
2502
+
2503
+ // src/components/Question Types/QuestionCard.tsx
2504
+ var React38 = __toESM(require("react"), 1);
2505
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2506
+ var QuestionCard = React38.forwardRef(
2507
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2508
+ "div",
2509
+ {
2510
+ ref,
2511
+ className: cn("flex w-120 max-w-200 flex-col gap-4 rounded-lg bg-surface p-6", className),
2512
+ ...props
2513
+ }
2514
+ )
2515
+ );
2516
+ QuestionCard.displayName = "QuestionCard";
2517
+
2518
+ // src/components/Question Types/QuestionEditorCard.tsx
2519
+ var React40 = __toESM(require("react"), 1);
2520
+ var import_react19 = require("@phosphor-icons/react");
2521
+
2522
+ // src/components/Question Types/QuestionHeader.tsx
2523
+ var React39 = __toESM(require("react"), 1);
2524
+ var import_react18 = require("@phosphor-icons/react");
2525
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2526
+ var eyebrow = "text-ui-caption uppercase text-secondary-muted-foreground";
2527
+ var QuestionHeader = React39.forwardRef(
2528
+ ({ className, number, title, required, error, onDismissError, editor, onTitleChange, actions, maxLength = 2e3, active, showCounter = true, ...props }, ref) => {
2529
+ const label = String(number).padStart(2, "0");
2530
+ const showError = error !== void 0 && error !== false;
2531
+ if (editor) {
2532
+ const text = typeof title === "string" ? title : "";
2533
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
2534
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center justify-between", children: [
2535
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
2536
+ "span",
2537
+ {
2538
+ className: cn(
2539
+ "group/handle inline-flex h-6 items-center gap-1 rounded-sm px-2.5 text-ui-caption hover:pl-1",
2540
+ active ? "bg-accent-soft text-accent-soft-foreground" : "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground"
2541
+ ),
2542
+ children: [
2543
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react18.DotsSixVertical, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover/handle:block" }),
2544
+ "Question ",
2545
+ number
2546
+ ]
2547
+ }
2548
+ ),
2549
+ actions && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100", children: actions })
2550
+ ] }),
2551
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2552
+ "textarea",
2553
+ {
2554
+ rows: 1,
2555
+ "aria-label": "Question title",
2556
+ value: text,
2557
+ maxLength,
2558
+ onChange: (event) => onTitleChange?.(event.target.value),
2559
+ className: "field-sizing-content w-full resize-none bg-transparent text-heading-h4 text-surface-foreground outline-none"
2560
+ }
2561
+ ),
2562
+ showCounter && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
2563
+ text.length,
2564
+ "/",
2565
+ maxLength,
2566
+ " characters"
2567
+ ] })
2568
+ ] });
2569
+ }
2570
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
2571
+ showError && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ToastInline, { variant: "destructive", onClose: onDismissError, className: "min-h-10", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-ui-label text-destructive", children: error === true ? "This question is mandatory." : error }) }),
2572
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: eyebrow, children: [
2573
+ "Question ",
2574
+ label
2575
+ ] }),
2576
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("h3", { className: "text-heading-h4 text-surface-foreground", children: [
2577
+ title,
2578
+ required && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { "aria-hidden": "true", className: "text-destructive", children: "*" }),
2579
+ required && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "sr-only", children: " (required)" })
2580
+ ] })
2581
+ ] });
2582
+ }
2583
+ );
2584
+ QuestionHeader.displayName = "QuestionHeader";
2585
+
2586
+ // src/components/Question Types/QuestionEditorCard.tsx
2587
+ var import_jsx_runtime41 = require("react/jsx-runtime");
2588
+ var QuestionEditorCard = React40.forwardRef(
2589
+ ({
2590
+ className,
2591
+ number,
2592
+ title,
2593
+ onTitleChange,
2594
+ active,
2595
+ maxLength,
2596
+ countLabel,
2597
+ actions,
2598
+ onDuplicate,
2599
+ onDelete,
2600
+ onPreview,
2601
+ onAskAi,
2602
+ onAdd,
2603
+ onPaste,
2604
+ note,
2605
+ children,
2606
+ ...props
2607
+ }, ref) => {
2608
+ const footer = active && (countLabel != null || onAdd || onPaste);
2609
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
2610
+ "div",
2611
+ {
2612
+ ref,
2613
+ className: cn("group/editor flex w-full items-start gap-2", className),
2614
+ ...props,
2615
+ children: [
2616
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
2617
+ "div",
2618
+ {
2619
+ className: cn(
2620
+ "flex w-full max-w-200 flex-col overflow-hidden rounded-xl border bg-surface transition-shadow group-hover/editor:shadow-lg group-focus-within/editor:shadow-lg",
2621
+ active ? "border-accent" : "border-border"
2622
+ ),
2623
+ children: [
2624
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: cn("flex flex-col p-6", footer ? "gap-5" : "gap-4"), children: [
2625
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-4", children: [
2626
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2627
+ QuestionHeader,
2628
+ {
2629
+ editor: true,
2630
+ number,
2631
+ title,
2632
+ onTitleChange,
2633
+ active,
2634
+ showCounter: !!active,
2635
+ maxLength,
2636
+ actions: actions ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
2637
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2638
+ Button,
2639
+ {
2640
+ type: "button",
2641
+ variant: "ghost",
2642
+ size: "icon-sm",
2643
+ "aria-label": "Duplicate question",
2644
+ onClick: onDuplicate,
2645
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react19.Copy, { size: 16, "aria-hidden": true })
2646
+ }
2647
+ ),
2648
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2649
+ Button,
2650
+ {
2651
+ type: "button",
2652
+ variant: "destructive",
2653
+ size: "icon-sm",
2654
+ "aria-label": "Delete question",
2655
+ onClick: onDelete,
2656
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react19.Trash, { size: 16, "aria-hidden": true })
2657
+ }
2658
+ ),
2659
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2660
+ Button,
2661
+ {
2662
+ type: "button",
2663
+ variant: "ghost",
2664
+ size: "icon-sm",
2665
+ "aria-label": "Preview question",
2666
+ onClick: onPreview,
2667
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react19.Eye, { size: 16, "aria-hidden": true })
2668
+ }
2669
+ )
2670
+ ] })
2671
+ }
2672
+ ),
2673
+ children
2674
+ ] }),
2675
+ footer && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center justify-between", children: [
2676
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: countLabel }),
2677
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
2678
+ onAdd && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2679
+ Button,
2680
+ {
2681
+ type: "button",
2682
+ variant: "ghost",
2683
+ size: "icon",
2684
+ "aria-label": "Add choice",
2685
+ onClick: onAdd,
2686
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react19.Plus, { size: 16, "aria-hidden": true })
2687
+ }
2688
+ ),
2689
+ onPaste && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2690
+ Button,
2691
+ {
2692
+ type: "button",
2693
+ variant: "ghost",
2694
+ size: "icon",
2695
+ "aria-label": "Paste choices",
2696
+ onClick: onPaste,
2697
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react19.Clipboard, { size: 16, "aria-hidden": true })
2698
+ }
2699
+ )
2700
+ ] })
2701
+ ] })
2702
+ ] }),
2703
+ note && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "border-t border-border px-2 py-2 text-body-small text-surface-foreground", children: note })
2704
+ ]
2705
+ }
2706
+ ),
2707
+ onAskAi && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2708
+ Button,
2709
+ {
2710
+ type: "button",
2711
+ variant: "ghost",
2712
+ size: "icon-sm",
2713
+ "aria-label": "Ask AI",
2714
+ onClick: onAskAi,
2715
+ className: "shrink-0 opacity-0 transition-opacity group-hover/editor:opacity-100 group-focus-within/editor:opacity-100 focus-visible:opacity-100",
2716
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react19.Sparkle, { size: 16, "aria-hidden": true })
2717
+ }
2718
+ )
2719
+ ]
2720
+ }
2721
+ );
2722
+ }
2723
+ );
2724
+ QuestionEditorCard.displayName = "QuestionEditorCard";
2725
+
2726
+ // src/components/Question Types/QuestionNavItem.tsx
2727
+ var React42 = __toESM(require("react"), 1);
2728
+ var import_react21 = require("@phosphor-icons/react");
2729
+ var import_radix_ui21 = require("radix-ui");
2730
+
2731
+ // src/components/Question Types/QuestionTypeIcon.tsx
2732
+ var React41 = require("react");
2733
+ var import_react20 = require("@phosphor-icons/react");
2734
+ var import_jsx_runtime42 = require("react/jsx-runtime");
2735
+ var icons = {
2736
+ "select-one": import_react20.RadioButton,
2737
+ "select-multiple": import_react20.CheckSquare,
2738
+ ranking: import_react20.ListNumbers,
2739
+ upload: import_react20.FileArrowUp,
2740
+ rating: import_react20.StarHalf,
2741
+ "open-end": import_react20.ChatsCircle
2742
+ };
2743
+ function QuestionTypeIcon({ type, size = 22.5, className, ...props }) {
2744
+ const Icon = icons[type];
2745
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { size, weight: "duotone", "aria-hidden": true, className: className ?? "text-accent-foreground", ...props });
2746
+ }
2747
+
2748
+ // src/components/Question Types/QuestionNavItem.tsx
2749
+ var import_jsx_runtime43 = require("react/jsx-runtime");
2750
+ var QuestionNavItem = React42.forwardRef(
2751
+ ({ className, questionType = "select-one", selected, error, asChild, children, ...props }, ref) => {
2752
+ const Comp = asChild ? import_radix_ui21.Slot.Root : "button";
2753
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
2754
+ Comp,
2755
+ {
2756
+ ref,
2757
+ type: asChild ? void 0 : "button",
2758
+ "aria-current": selected ? "true" : void 0,
2759
+ className: cn(
2760
+ "group/nav flex h-9.5 w-full max-w-106.5 items-center gap-2 rounded-sm border bg-surface p-2 text-left text-body-small text-surface-foreground transition-colors focus-visible:outline-none",
2761
+ error ? ["hover:bg-destructive-soft focus-visible:border-destructive", selected ? "border-destructive" : "border-border"] : [
2762
+ "hover:border-input-accent hover:bg-accent-soft focus-visible:border-input-accent",
2763
+ selected ? "border-input-accent" : "border-border"
2764
+ ],
2765
+ className
2766
+ ),
2767
+ ...props,
2768
+ children: [
2769
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
2770
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react21.DotsSixVertical, { size: 16, className: "hidden group-hover/nav:block" }),
2771
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "group-hover/nav:hidden", children: error ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react21.Warning, { size: 16, className: "text-destructive" }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(QuestionTypeIcon, { type: questionType, size: 16 }) })
2772
+ ] }),
2773
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
2774
+ error && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "sr-only", children: ", has errors" })
2775
+ ]
2776
+ }
2777
+ );
2778
+ }
2779
+ );
2780
+ QuestionNavItem.displayName = "QuestionNavItem";
2781
+
2782
+ // src/components/Question Types/QuestionOption.tsx
2783
+ var React43 = __toESM(require("react"), 1);
2784
+ var import_react22 = require("@phosphor-icons/react");
2785
+ var import_jsx_runtime44 = require("react/jsx-runtime");
2786
+ var optionClasses = "flex w-full max-w-150 cursor-pointer items-center gap-2 rounded-md border border-border bg-surface px-4 py-2 text-body-base text-surface-foreground transition-colors hover:border-input hover:bg-accent-soft hover:shadow-md has-[[data-state=checked]]:border-accent-foreground has-[[data-state=checked]]:hover:border-accent-foreground has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50";
2787
+ function QuestionOption(props) {
2788
+ const id = React43.useId();
2789
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { htmlFor: id, className: cn(optionClasses, props.className), children: [
2790
+ props.kind === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2791
+ Checkbox,
2792
+ {
2793
+ id,
2794
+ checked: props.checked,
2795
+ defaultChecked: props.defaultChecked,
2796
+ onCheckedChange: (next) => props.onCheckedChange?.(next === true),
2797
+ disabled: props.disabled
2798
+ }
2799
+ ) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadioGroupItem, { id, value: props.value, disabled: props.disabled }),
2800
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "min-w-0 flex-1", children: props.label })
2801
+ ] });
2802
+ }
2803
+ var QuestionOtherOption = React43.forwardRef(
2804
+ ({ className, onSubmit, confirmLabel = "Confirm answer", placeholder = "Type your answer", ...props }, ref) => {
2805
+ const inner = React43.useRef(null);
2806
+ React43.useImperativeHandle(ref, () => inner.current);
2807
+ const submit = () => onSubmit?.(inner.current?.value ?? "");
2808
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
2809
+ "div",
2810
+ {
2811
+ className: cn(
2812
+ "inline-flex items-center gap-2 rounded-md border border-border bg-surface py-2 pr-2 pl-4 focus-within:border-input-accent",
2813
+ className
2814
+ ),
2815
+ children: [
2816
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2817
+ "input",
2818
+ {
2819
+ ref: inner,
2820
+ type: "text",
2821
+ placeholder,
2822
+ onKeyDown: (event) => {
2823
+ if (event.key === "Enter") {
2824
+ event.preventDefault();
2825
+ submit();
2826
+ }
2827
+ },
2828
+ className: "min-w-0 bg-transparent text-body-base text-surface-foreground outline-none placeholder:text-muted-foreground",
2829
+ ...props
2830
+ }
2831
+ ),
2832
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Button, { type: "button", variant: "subtle", size: "icon-sm", "aria-label": confirmLabel, onClick: submit, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Check, { size: 16, "aria-hidden": true }) })
2833
+ ]
2834
+ }
2835
+ );
2836
+ }
2837
+ );
2838
+ QuestionOtherOption.displayName = "QuestionOtherOption";
2839
+ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className }) {
2840
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("flex w-full items-center gap-2", className), children: [
2841
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex h-11.5 min-w-0 flex-1 items-center gap-2 rounded-md border border-border bg-surface px-4 py-2 focus-within:border-input-accent hover:border-input hover:shadow-md", children: [
2842
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.DotsSixVertical, { size: 20, "aria-hidden": true, className: "shrink-0 text-surface-foreground" }),
2843
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2844
+ "input",
2845
+ {
2846
+ "aria-label": "Option label",
2847
+ value: label,
2848
+ onChange: (event) => onLabelChange?.(event.target.value),
2849
+ className: "min-w-0 flex-1 bg-transparent text-body-base text-surface-foreground outline-none"
2850
+ }
2851
+ )
2852
+ ] }),
2853
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": "Remove option", onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Trash, { size: 16, "aria-hidden": true }) }),
2854
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "Add option", onClick: onAdd, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Plus, { size: 16, "aria-hidden": true }) })
2855
+ ] });
2856
+ }
2857
+
2858
+ // src/components/Question Types/RankList.tsx
2859
+ var React44 = __toESM(require("react"), 1);
2860
+ var import_react23 = require("@phosphor-icons/react");
2861
+ var import_jsx_runtime45 = require("react/jsx-runtime");
2862
+ function move(list, from, to) {
2863
+ if (from === to || to < 0 || to >= list.length) return list;
2864
+ const next = list.slice();
2865
+ const [item] = next.splice(from, 1);
2866
+ next.splice(to, 0, item);
2867
+ return next;
2868
+ }
2869
+ var RankList = React44.forwardRef(
2870
+ ({ className, items, onItemsChange, ...props }, ref) => {
2871
+ const [dragIndex, setDragIndex] = React44.useState(null);
2872
+ const [announcement, setAnnouncement] = React44.useState("");
2873
+ const handles = React44.useRef(/* @__PURE__ */ new Map());
2874
+ const refocus = React44.useRef(null);
2875
+ React44.useEffect(() => {
2876
+ if (refocus.current) {
2877
+ handles.current.get(refocus.current)?.focus();
2878
+ refocus.current = null;
2879
+ }
2880
+ });
2881
+ const reorder = (from, to, id) => {
2882
+ const next = move(items, from, to);
2883
+ if (next === items) return;
2884
+ refocus.current = id;
2885
+ setAnnouncement(`Moved to position ${to + 1} of ${items.length}`);
2886
+ onItemsChange(next);
2887
+ };
2888
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
2889
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("ol", { ref, className: cn("flex w-full max-w-150 flex-col gap-4", className), ...props, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
2890
+ "li",
2891
+ {
2892
+ draggable: true,
2893
+ onDragStart: () => setDragIndex(index),
2894
+ onDragOver: (event) => event.preventDefault(),
2895
+ onDrop: () => {
2896
+ if (dragIndex !== null) reorder(dragIndex, index, item.id);
2897
+ setDragIndex(null);
2898
+ },
2899
+ onDragEnd: () => setDragIndex(null),
2900
+ className: cn(
2901
+ "group/rank flex items-center gap-3 overflow-hidden rounded-sm border border-border bg-surface px-4 py-2.5 text-body-base text-surface-foreground transition-colors",
2902
+ "hover:border-accent-foreground hover:shadow-md",
2903
+ dragIndex === index && "opacity-50"
2904
+ ),
2905
+ children: [
2906
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2907
+ "button",
2908
+ {
2909
+ type: "button",
2910
+ ref: (el) => {
2911
+ if (el) handles.current.set(item.id, el);
2912
+ else handles.current.delete(item.id);
2913
+ },
2914
+ "aria-label": `Reorder, position ${index + 1} of ${items.length}. Use the up and down arrow keys to move.`,
2915
+ onKeyDown: (event) => {
2916
+ if (event.key === "ArrowUp") {
2917
+ event.preventDefault();
2918
+ reorder(index, index - 1, item.id);
2919
+ } else if (event.key === "ArrowDown") {
2920
+ event.preventDefault();
2921
+ reorder(index, index + 1, item.id);
2922
+ }
2923
+ },
2924
+ className: "inline-flex shrink-0 cursor-grab rounded-xs text-surface-foreground",
2925
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsSixVertical, { size: 16, "aria-hidden": true })
2926
+ }
2927
+ ),
2928
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2929
+ "span",
2930
+ {
2931
+ "aria-hidden": "true",
2932
+ className: "flex size-6 shrink-0 items-center justify-center rounded-full border border-border bg-background bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-ui-caption text-surface-foreground group-hover/rank:border-accent-foreground group-hover/rank:bg-accent-soft group-hover/rank:bg-none group-hover/rank:text-accent-soft-foreground",
2933
+ children: index + 1
2934
+ }
2935
+ ),
2936
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "min-w-0 flex-1", children: item.label })
2937
+ ]
2938
+ },
2939
+ item.id
2940
+ )) }),
2941
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { role: "status", "aria-live": "polite", className: "sr-only", children: announcement })
2942
+ ] });
2943
+ }
2944
+ );
2945
+ RankList.displayName = "RankList";
2946
+
2947
+ // src/components/Question Types/RatingScale.tsx
2948
+ var React45 = __toESM(require("react"), 1);
2949
+ var import_radix_ui22 = require("radix-ui");
2950
+ var import_jsx_runtime46 = require("react/jsx-runtime");
2951
+ var RatingScale = React45.forwardRef(
2952
+ ({ className, max = 5, value, defaultValue, onValueChange, lowLabel, highLabel, ...props }, ref) => {
2953
+ const [internal, setInternal] = React45.useState(defaultValue);
2954
+ const current = value !== void 0 ? value : internal;
2955
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: cn("flex w-full max-w-150 flex-col gap-2", className), children: [
2956
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2957
+ import_radix_ui22.ToggleGroup.Root,
2958
+ {
2959
+ ref,
2960
+ type: "single",
2961
+ value: current ? String(current) : "",
2962
+ onValueChange: (next) => {
2963
+ const parsed = next ? Number(next) : void 0;
2964
+ setInternal(parsed);
2965
+ onValueChange?.(parsed);
2966
+ },
2967
+ className: "flex gap-2",
2968
+ ...props,
2969
+ children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2970
+ import_radix_ui22.ToggleGroup.Item,
2971
+ {
2972
+ value: String(n),
2973
+ "aria-label": `${n}`,
2974
+ className: cn(
2975
+ "flex h-12 min-w-0 flex-1 items-center justify-center rounded-sm border-2 border-border bg-surface text-ui-label-large text-surface-foreground transition-colors",
2976
+ "hover:bg-accent-soft",
2977
+ "data-[state=on]:border-accent-foreground data-[state=on]:text-accent-foreground"
2978
+ ),
2979
+ children: n
2980
+ },
2981
+ n
2982
+ ))
2983
+ }
2984
+ ),
2985
+ (lowLabel != null || highLabel != null) && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex justify-between text-ui-caption text-secondary-muted-foreground", "aria-hidden": "true", children: [
2986
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: lowLabel }),
2987
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: highLabel })
2988
+ ] })
2989
+ ] });
2990
+ }
2991
+ );
2992
+ RatingScale.displayName = "RatingScale";
2993
+
2994
+ // src/components/Data Display/Progress.tsx
2995
+ var React46 = __toESM(require("react"), 1);
2996
+ var import_radix_ui23 = require("radix-ui");
2997
+ var import_jsx_runtime47 = require("react/jsx-runtime");
2998
+ var Progress = React46.forwardRef(
2999
+ ({ className, value = 0, label, valueLabel, detailsStart, detailsEnd, ...props }, ref) => {
3000
+ const hasHeader = label != null || valueLabel != null;
3001
+ const hasDetails = detailsStart != null || detailsEnd != null;
3002
+ const clamped = Math.min(100, Math.max(0, value ?? 0));
3003
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
3004
+ hasHeader && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-between text-ui-label text-surface-foreground", children: [
3005
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: label }),
3006
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: valueLabel === true ? `${Math.round(clamped)}%` : valueLabel })
3007
+ ] }),
3008
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3009
+ import_radix_ui23.Progress.Root,
3010
+ {
3011
+ ref,
3012
+ value: clamped,
3013
+ className: "relative h-2 w-full overflow-hidden rounded-full bg-secondary",
3014
+ ...props,
3015
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3016
+ import_radix_ui23.Progress.Indicator,
3017
+ {
3018
+ className: "h-full rounded-full bg-accent transition-[width]",
3019
+ style: { width: `${clamped}%` }
3020
+ }
3021
+ )
3022
+ }
3023
+ ),
3024
+ hasDetails && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-start justify-between text-ui-label leading-5 text-secondary-muted-foreground", children: [
3025
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: detailsStart }),
3026
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: detailsEnd })
3027
+ ] })
3028
+ ] });
3029
+ }
3030
+ );
3031
+ Progress.displayName = "Progress";
3032
+
3033
+ // src/components/Data Display/Table.tsx
3034
+ var React47 = __toESM(require("react"), 1);
3035
+ var import_react24 = require("@phosphor-icons/react");
3036
+ var import_jsx_runtime48 = require("react/jsx-runtime");
3037
+ var Table = React47.forwardRef(
3038
+ ({ className, containerClassName, striped, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: cn("relative w-full overflow-auto rounded-lg border border-border bg-surface", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3039
+ "table",
3040
+ {
3041
+ ref,
3042
+ "data-striped": striped ? "" : void 0,
3043
+ className: cn("group/table w-full border-collapse text-body-small text-surface-foreground", className),
3044
+ ...props
3045
+ }
3046
+ ) })
3047
+ );
3048
+ Table.displayName = "Table";
3049
+ var TableHeader = React47.forwardRef(
3050
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("thead", { ref, className, ...props })
3051
+ );
3052
+ TableHeader.displayName = "TableHeader";
3053
+ var TableBody = React47.forwardRef(
3054
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tbody", { ref, className, ...props })
3055
+ );
3056
+ TableBody.displayName = "TableBody";
3057
+ var TableRow = React47.forwardRef(
3058
+ ({ className, selected, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3059
+ "tr",
3060
+ {
3061
+ ref,
3062
+ "data-state": selected ? "selected" : void 0,
3063
+ "aria-selected": selected || void 0,
3064
+ className: cn(
3065
+ "group/row border-b border-border transition-colors last:border-b-0",
3066
+ "group-data-[striped]/table:even:bg-background hover:bg-accent-soft group-data-[striped]/table:even:hover:bg-accent-soft",
3067
+ className
3068
+ ),
3069
+ ...props
3070
+ }
3071
+ )
3072
+ );
3073
+ TableRow.displayName = "TableRow";
3074
+ var ariaSort = { none: "none", asc: "ascending", desc: "descending" };
3075
+ var TableHead = React47.forwardRef(
3076
+ ({ className, align = "left", sortable, sort = "none", onSort, checkbox, children, ...props }, ref) => {
3077
+ const caret = sort === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react24.CaretUp, { size: 16, "aria-hidden": true, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react24.CaretDown, { size: 16, "aria-hidden": true, className: "shrink-0" });
3078
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3079
+ "th",
3080
+ {
3081
+ ref,
3082
+ scope: "col",
3083
+ "aria-sort": sortable ? ariaSort[sort] : void 0,
3084
+ className: cn(
3085
+ "h-10 border-b border-border text-ui-label whitespace-nowrap",
3086
+ checkbox ? "w-13 px-0 text-center" : "px-4 py-3",
3087
+ align === "right" ? "text-right" : "text-left",
3088
+ className
3089
+ ),
3090
+ ...props,
3091
+ children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
3092
+ "button",
3093
+ {
3094
+ type: "button",
3095
+ onClick: onSort,
3096
+ className: cn("inline-flex items-center gap-1 rounded-xs", align === "right" && "flex-row-reverse"),
3097
+ children: [
3098
+ children,
3099
+ caret
3100
+ ]
3101
+ }
3102
+ ) : checkbox ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex items-center justify-center", children }) : children
3103
+ }
3104
+ );
3105
+ }
3106
+ );
3107
+ TableHead.displayName = "TableHead";
3108
+ var TableCell = React47.forwardRef(
3109
+ ({ className, align = "left", muted, checkbox, actions, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3110
+ "td",
3111
+ {
3112
+ ref,
3113
+ className: cn(
3114
+ "h-10 text-body-small",
3115
+ "group-data-[state=selected]/row:first:border-l-2 group-data-[state=selected]/row:first:border-l-input-accent",
3116
+ checkbox ? "w-13 px-0 text-center" : actions ? "px-4 py-1.5 text-right" : "px-4 py-3",
3117
+ align === "right" && "text-right",
3118
+ muted ? "text-secondary-muted-foreground" : "text-surface-foreground",
3119
+ className
3120
+ ),
3121
+ ...props,
3122
+ children: checkbox ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex items-center justify-center", children }) : actions ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex items-start justify-end gap-1", children }) : children
3123
+ }
3124
+ )
3125
+ );
3126
+ TableCell.displayName = "TableCell";
3127
+ function TableCellTwoLines({ primary, secondary, avatar, className, ...props }) {
3128
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("flex items-center gap-2", className), ...props, children: [
3129
+ avatar,
3130
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col gap-0.5 whitespace-nowrap", children: [
3131
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-ui-label text-surface-foreground", children: primary }),
3132
+ secondary && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-ui-caption text-secondary-muted-foreground", children: secondary })
3133
+ ] })
3134
+ ] });
3135
+ }
3136
+
3137
+ // src/components/Data Display/StatCard.tsx
3138
+ var React48 = __toESM(require("react"), 1);
3139
+ var import_class_variance_authority6 = require("class-variance-authority");
3140
+ var import_jsx_runtime49 = require("react/jsx-runtime");
3141
+ var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 flex-col gap-2 rounded-md border p-3", {
3142
+ variants: {
3143
+ variant: {
3144
+ default: "border-border bg-transparent",
3145
+ warning: "border-warning-soft-border bg-warning-soft"
3146
+ }
3147
+ },
3148
+ defaultVariants: { variant: "default" }
3149
+ });
3150
+ var StatCard = React48.forwardRef(
3151
+ ({ className, variant, label, value, icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
3152
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "truncate text-ui-caption text-secondary-muted-foreground", children: label }),
3153
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: "flex items-center gap-2 text-body-base text-surface-foreground", children: [
3154
+ icon && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { "aria-hidden": "true", className: "inline-flex size-6 shrink-0 items-center justify-center", children: icon }),
3155
+ value
3156
+ ] })
3157
+ ] })
3158
+ );
3159
+ StatCard.displayName = "StatCard";
3160
+
3161
+ // src/components/Research-Specific/ActivityStructure.tsx
3162
+ var React50 = __toESM(require("react"), 1);
3163
+
3164
+ // src/components/Tags & Badges/EditableTag.tsx
3165
+ var React49 = __toESM(require("react"), 1);
3166
+ var import_react25 = require("@phosphor-icons/react");
3167
+ var import_class_variance_authority7 = require("class-variance-authority");
3168
+ var import_jsx_runtime50 = require("react/jsx-runtime");
3169
+ var editableTagVariants = (0, import_class_variance_authority7.cva)(
3170
+ "inline-flex h-6.5 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
3171
+ {
3172
+ variants: {
3173
+ type: {
3174
+ default: "gap-1 bg-accent-muted pl-2.5 pr-1.5 text-primary",
3175
+ editable: "gap-1 bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 pl-2.5 pr-1.5 text-surface-foreground hover:bg-accent-soft hover:bg-none hover:text-accent-soft-foreground",
3176
+ add: "gap-1 border border-dashed border-border pl-2.5 pr-1.5 text-surface-foreground hover:bg-accent-soft hover:text-accent-soft-foreground",
3177
+ multiple: "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2.5 text-surface-foreground hover:bg-accent-soft hover:bg-none hover:text-accent-soft-foreground"
3178
+ }
3179
+ },
3180
+ defaultVariants: { type: "default" }
3181
+ }
3182
+ );
3183
+ var EditableTag = React49.forwardRef(
3184
+ ({ className, type = "default", icon, onRemove, onClick, children, ...props }, ref) => {
3185
+ const classes = cn(editableTagVariants({ type }), className);
3186
+ const leading = type === "add" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react25.Plus, { size: 12, "aria-hidden": true }) : icon !== void 0 ? icon : type === "default" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react25.Crown, { size: 12, weight: "fill", "aria-hidden": true }) : null;
3187
+ if (type === "add" || type === "multiple" && onClick) {
3188
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("button", { ref, type: "button", className: classes, onClick, ...props, children: [
3189
+ leading,
3190
+ children
3191
+ ] });
3192
+ }
3193
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { ref, className: classes, ...props, children: [
3194
+ leading,
3195
+ children,
3196
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3197
+ "button",
3198
+ {
3199
+ type: "button",
3200
+ "aria-label": typeof children === "string" ? `Remove ${children}` : "Remove",
3201
+ onClick: onRemove,
3202
+ className: "inline-flex size-3 items-center justify-center rounded-xs",
3203
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react25.X, { size: 12, "aria-hidden": true })
3204
+ }
3205
+ )
3206
+ ] });
3207
+ }
3208
+ );
3209
+ EditableTag.displayName = "EditableTag";
3210
+
3211
+ // src/components/Research-Specific/ActivityStructure.tsx
3212
+ var import_jsx_runtime51 = require("react/jsx-runtime");
3213
+ var ActivityStructure = React50.forwardRef(
3214
+ ({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
3215
+ "section",
3216
+ {
3217
+ ref,
3218
+ className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-2xl border border-border bg-surface p-4", className),
3219
+ ...props,
3220
+ children: [
3221
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h3", { className: "text-heading-h3 text-surface-foreground", children: title }),
3222
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "grid grid-cols-2 gap-3", children: stats.map(({ id, ...stat }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(StatCard, { ...stat }, id)) }),
3223
+ sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col gap-2", children: [
3224
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),
3225
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-body-base text-surface-foreground", children: body }),
3226
+ (tags?.length || onAddTag) && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
3227
+ tags?.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(EditableTag, { type: "editable", onRemove: onRemoveTag && (() => onRemoveTag(id, tag)), children: tag }, tag)),
3228
+ onAddTag && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(EditableTag, { type: "add", onClick: () => onAddTag(id), children: addTagLabel })
3229
+ ] })
3230
+ ] }, id))
3231
+ ]
3232
+ }
3233
+ )
3234
+ );
3235
+ ActivityStructure.displayName = "ActivityStructure";
3236
+
3237
+ // src/components/Tags & Badges/RoleTag.tsx
3238
+ var React51 = __toESM(require("react"), 1);
3239
+ var import_react26 = require("@phosphor-icons/react");
3240
+ var import_class_variance_authority8 = require("class-variance-authority");
3241
+ var import_jsx_runtime52 = require("react/jsx-runtime");
3242
+ var roleTagVariants = (0, import_class_variance_authority8.cva)(
3243
+ "group inline-flex h-6 items-center whitespace-nowrap rounded-sm py-1 text-ui-caption transition-colors",
3244
+ {
3245
+ variants: {
3246
+ type: {
3247
+ primary: "bg-primary-soft px-2.5 text-primary-soft-foreground",
3248
+ secondary: "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 px-2.5 text-secondary-muted-foreground",
3249
+ question: "gap-1 bg-primary-soft pl-1 pr-2.5 text-plum-500",
3250
+ interactable: "gap-1 pl-2.5 pr-2.5 hover:pl-1"
3251
+ },
3252
+ selected: { true: "", false: "" }
3253
+ },
3254
+ compoundVariants: [
3255
+ {
3256
+ type: "interactable",
3257
+ selected: false,
3258
+ className: "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground"
3259
+ },
3260
+ { type: "interactable", selected: true, className: "bg-accent-soft text-accent-foreground" }
3261
+ ],
3262
+ defaultVariants: { type: "primary", selected: false }
3263
+ }
3264
+ );
3265
+ var RoleTag = React51.forwardRef(
3266
+ ({ className, type = "primary", selected = false, onClick, children, ...props }, ref) => {
3267
+ const classes = cn(roleTagVariants({ type, selected: type === "interactable" ? selected : false }), className);
3268
+ if (type === "interactable") {
3269
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
3270
+ "button",
3271
+ {
3272
+ ref,
3273
+ type: "button",
3274
+ "aria-pressed": selected,
3275
+ className: classes,
3276
+ onClick,
3277
+ ...props,
3278
+ children: [
3279
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react26.DotsSixVertical, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover:block" }),
3280
+ children
3281
+ ]
3282
+ }
3283
+ );
3284
+ }
3285
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { ref, className: classes, ...props, children: [
3286
+ type === "question" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react26.RadioButton, { size: 16, weight: "fill", "aria-hidden": true }),
3287
+ children
3288
+ ] });
3289
+ }
3290
+ );
3291
+ RoleTag.displayName = "RoleTag";
3292
+
3293
+ // src/components/Utility/Pagination.tsx
3294
+ var React52 = __toESM(require("react"), 1);
3295
+ var import_react27 = require("@phosphor-icons/react");
3296
+ var import_jsx_runtime53 = require("react/jsx-runtime");
3297
+ function getPaginationItems(page, pageCount, siblings = 1) {
3298
+ const keep = /* @__PURE__ */ new Set([1, pageCount]);
3299
+ for (let p = page - siblings; p <= page + siblings; p++) if (p >= 1 && p <= pageCount) keep.add(p);
3300
+ const sorted = [...keep].sort((a, b) => a - b);
3301
+ const items = [];
3302
+ sorted.forEach((p, index) => {
3303
+ const previous = sorted[index - 1];
3304
+ if (previous !== void 0 && p - previous === 2) items.push(previous + 1);
3305
+ else if (previous !== void 0 && p - previous > 2) items.push("ellipsis");
3306
+ items.push(p);
3307
+ });
3308
+ return items;
3309
+ }
3310
+ var Pagination = React52.forwardRef(
3311
+ ({ className, page, pageCount, onPageChange, variant = "full", siblings = 1, ...props }, ref) => {
3312
+ const go = (next2) => onPageChange(Math.min(pageCount, Math.max(1, next2)));
3313
+ const previous = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
3314
+ Button,
3315
+ {
3316
+ type: "button",
3317
+ variant: "outline",
3318
+ size: "icon-sm",
3319
+ "aria-label": "Previous page",
3320
+ disabled: page <= 1,
3321
+ onClick: () => go(page - 1),
3322
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react27.ArrowLeft, { size: 16, "aria-hidden": true })
3323
+ }
3324
+ );
3325
+ const next = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
3326
+ Button,
3327
+ {
3328
+ type: "button",
3329
+ variant: "outline",
3330
+ size: "icon-sm",
3331
+ "aria-label": "Next page",
3332
+ disabled: page >= pageCount,
3333
+ onClick: () => go(page + 1),
3334
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react27.ArrowRight, { size: 16, "aria-hidden": true })
3335
+ }
3336
+ );
3337
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
3338
+ "nav",
3339
+ {
3340
+ ref,
3341
+ "aria-label": "Pagination",
3342
+ className: cn("flex items-center", variant === "compact" ? "w-35 justify-between" : "gap-2", className),
3343
+ ...props,
3344
+ children: [
3345
+ previous,
3346
+ variant === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "text-body-small text-surface-foreground", "aria-live": "polite", children: [
3347
+ page,
3348
+ "/",
3349
+ pageCount
3350
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("ul", { className: "flex items-center gap-2", children: getPaginationItems(page, pageCount, siblings).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { children: item === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "inline-flex size-8 items-center justify-center rounded-sm border border-border bg-surface text-surface-foreground", children: [
3351
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react27.DotsThree, { size: 16, "aria-hidden": true }),
3352
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "sr-only", children: "More pages" })
3353
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
3354
+ Button,
3355
+ {
3356
+ type: "button",
3357
+ variant: item === page ? "subtle" : "outline",
3358
+ size: "sm",
3359
+ "aria-label": `Page ${item}`,
3360
+ "aria-current": item === page ? "page" : void 0,
3361
+ onClick: () => go(item),
3362
+ children: item
3363
+ }
3364
+ ) }, item === "ellipsis" ? `ellipsis-${index}` : item)) }),
3365
+ next
3366
+ ]
3367
+ }
3368
+ );
3369
+ }
3370
+ );
3371
+ Pagination.displayName = "Pagination";
3372
+ // Annotate the CommonJS export names for ESM import in node:
3373
+ 0 && (module.exports = {
3374
+ AIMiniAvatar,
3375
+ AIResponseContainer,
3376
+ ActivityStructure,
3377
+ AskAiInput,
3378
+ AskAiToggle,
3379
+ Button,
3380
+ Calendar,
3381
+ ChatChoices,
3382
+ ChatInput,
3383
+ ChatOption,
3384
+ Checkbox,
3385
+ CheckboxField,
3386
+ DatePicker,
3387
+ DateTimePicker,
3388
+ Dialog,
3389
+ DialogBody,
3390
+ DialogClose,
3391
+ DialogContent,
3392
+ DialogDescription,
3393
+ DialogFooter,
3394
+ DialogHeader,
3395
+ DialogTitle,
3396
+ DialogTrigger,
3397
+ DropdownMenu,
3398
+ DropdownMenuCheckboxItem,
3399
+ DropdownMenuContent,
3400
+ DropdownMenuGroup,
3401
+ DropdownMenuItem,
3402
+ DropdownMenuLabel,
3403
+ DropdownMenuRadioGroup,
3404
+ DropdownMenuRadioItem,
3405
+ DropdownMenuSeparator,
3406
+ DropdownMenuSub,
3407
+ DropdownMenuSubContent,
3408
+ DropdownMenuSubTrigger,
3409
+ DropdownMenuTrigger,
3410
+ EditableTag,
3411
+ Field,
3412
+ FileAttachment,
3413
+ FileUploadItem,
3414
+ FileUploadZone,
3415
+ Form,
3416
+ FormControl,
3417
+ FormDescription,
3418
+ FormField,
3419
+ FormItem,
3420
+ FormLabel,
3421
+ FormMessage,
3422
+ ImagePreview,
3423
+ ImageThumbnails,
3424
+ Input,
3425
+ InputWithAction,
3426
+ Label,
3427
+ MediaInfo,
3428
+ NumberInput,
3429
+ OpenEndAnswer,
3430
+ Pagination,
3431
+ Progress,
3432
+ ProjectSelector,
3433
+ QuestionCard,
3434
+ QuestionEditorCard,
3435
+ QuestionHeader,
3436
+ QuestionNavItem,
3437
+ QuestionOption,
3438
+ QuestionOptionEditor,
3439
+ QuestionOtherOption,
3440
+ QuestionTypeIcon,
3441
+ RadioGroup,
3442
+ RadioGroupFieldItem,
3443
+ RadioGroupItem,
3444
+ RankList,
3445
+ RatingScale,
3446
+ RoleTag,
3447
+ SearchBar,
3448
+ Select,
3449
+ SelectContent,
3450
+ SelectGroup,
3451
+ SelectItem,
3452
+ SelectTrigger,
3453
+ SelectValue,
3454
+ Slider,
3455
+ StatCard,
3456
+ StatusTag,
3457
+ Switch,
3458
+ TabItem,
3459
+ TabNavigation,
3460
+ TabNavigationContext,
3461
+ Table,
3462
+ TableBody,
3463
+ TableCell,
3464
+ TableCellTwoLines,
3465
+ TableHead,
3466
+ TableHeader,
3467
+ TableRow,
3468
+ Tabs,
3469
+ TabsContent,
3470
+ Tag,
3471
+ Textarea,
3472
+ TimeItem,
3473
+ TimePicker,
3474
+ Timestamp,
3475
+ Toast,
3476
+ ToastAction,
3477
+ ToastInline,
3478
+ ToastProvider,
3479
+ ToastViewport,
3480
+ Toggle,
3481
+ Tooltip,
3482
+ TooltipContent,
3483
+ TooltipProvider,
3484
+ TooltipTrigger,
3485
+ TopicActivityRow,
3486
+ TopicCard,
3487
+ TopicCardMetaItem,
3488
+ TopicCardTag,
3489
+ UserMessageBubble,
3490
+ VideoPlayer,
3491
+ VolumeControl,
3492
+ fieldSurfaceClasses,
3493
+ formatDateTime,
3494
+ getPaginationItems,
3495
+ useFormField
3496
+ });
3497
+ //# sourceMappingURL=index.cjs.map