analytica-frontend-lib 1.2.37 → 1.2.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/Accordation/index.d.ts +4 -0
  2. package/dist/Accordation/index.d.ts.map +1 -1
  3. package/dist/Accordation/index.js +5 -2
  4. package/dist/Accordation/index.js.map +1 -1
  5. package/dist/Accordation/index.mjs +5 -2
  6. package/dist/Accordation/index.mjs.map +1 -1
  7. package/dist/ActivityCardQuestionBanks/index.css +24 -10
  8. package/dist/ActivityCardQuestionBanks/index.css.map +1 -1
  9. package/dist/ActivityCardQuestionBanks/index.d.ts.map +1 -1
  10. package/dist/ActivityCardQuestionBanks/index.js +8 -6
  11. package/dist/ActivityCardQuestionBanks/index.js.map +1 -1
  12. package/dist/ActivityCardQuestionBanks/index.mjs +8 -6
  13. package/dist/ActivityCardQuestionBanks/index.mjs.map +1 -1
  14. package/dist/ActivityCardQuestionPreview/index.css +19307 -0
  15. package/dist/ActivityCardQuestionPreview/index.css.map +1 -0
  16. package/dist/ActivityCardQuestionPreview/index.d.ts +29 -0
  17. package/dist/ActivityCardQuestionPreview/index.d.ts.map +1 -0
  18. package/dist/ActivityCardQuestionPreview/index.js +3684 -0
  19. package/dist/ActivityCardQuestionPreview/index.js.map +1 -0
  20. package/dist/ActivityCardQuestionPreview/index.mjs +3692 -0
  21. package/dist/ActivityCardQuestionPreview/index.mjs.map +1 -0
  22. package/dist/ActivityDetails/index.css +24 -10
  23. package/dist/ActivityDetails/index.css.map +1 -1
  24. package/dist/ActivityDetails/index.js +83 -31
  25. package/dist/ActivityDetails/index.js.map +1 -1
  26. package/dist/ActivityDetails/index.mjs +84 -31
  27. package/dist/ActivityDetails/index.mjs.map +1 -1
  28. package/dist/ActivityFilters/index.css +24 -10
  29. package/dist/ActivityFilters/index.css.map +1 -1
  30. package/dist/ActivityFilters/index.js +83 -31
  31. package/dist/ActivityFilters/index.js.map +1 -1
  32. package/dist/ActivityFilters/index.mjs +84 -31
  33. package/dist/ActivityFilters/index.mjs.map +1 -1
  34. package/dist/ActivityPreview/index.css +19307 -0
  35. package/dist/ActivityPreview/index.css.map +1 -0
  36. package/dist/ActivityPreview/index.d.ts +34 -0
  37. package/dist/ActivityPreview/index.d.ts.map +1 -0
  38. package/dist/ActivityPreview/index.js +4458 -0
  39. package/dist/ActivityPreview/index.js.map +1 -0
  40. package/dist/ActivityPreview/index.mjs +4468 -0
  41. package/dist/ActivityPreview/index.mjs.map +1 -0
  42. package/dist/AlertManager/index.css +24 -10
  43. package/dist/AlertManager/index.css.map +1 -1
  44. package/dist/AlertManager/index.js +500 -389
  45. package/dist/AlertManager/index.js.map +1 -1
  46. package/dist/AlertManager/index.mjs +466 -354
  47. package/dist/AlertManager/index.mjs.map +1 -1
  48. package/dist/CorrectActivityModal/index.js +5 -2
  49. package/dist/CorrectActivityModal/index.js.map +1 -1
  50. package/dist/CorrectActivityModal/index.mjs +5 -2
  51. package/dist/CorrectActivityModal/index.mjs.map +1 -1
  52. package/dist/DropdownMenu/index.d.ts +7 -8
  53. package/dist/DropdownMenu/index.d.ts.map +1 -1
  54. package/dist/DropdownMenu/index.js +78 -29
  55. package/dist/DropdownMenu/index.js.map +1 -1
  56. package/dist/DropdownMenu/index.mjs +79 -29
  57. package/dist/DropdownMenu/index.mjs.map +1 -1
  58. package/dist/NotificationCard/index.js +78 -29
  59. package/dist/NotificationCard/index.js.map +1 -1
  60. package/dist/NotificationCard/index.mjs +79 -29
  61. package/dist/NotificationCard/index.mjs.map +1 -1
  62. package/dist/Search/index.js +78 -29
  63. package/dist/Search/index.js.map +1 -1
  64. package/dist/Search/index.mjs +79 -29
  65. package/dist/Search/index.mjs.map +1 -1
  66. package/dist/SendActivityModal/index.css +19307 -0
  67. package/dist/SendActivityModal/index.css.map +1 -0
  68. package/dist/SendActivityModal/index.d.ts +5 -0
  69. package/dist/SendActivityModal/index.d.ts.map +1 -0
  70. package/dist/SendActivityModal/index.js +6471 -0
  71. package/dist/SendActivityModal/index.js.map +1 -0
  72. package/dist/SendActivityModal/index.mjs +6493 -0
  73. package/dist/SendActivityModal/index.mjs.map +1 -0
  74. package/dist/TableProvider/index.css +24 -10
  75. package/dist/TableProvider/index.css.map +1 -1
  76. package/dist/TableProvider/index.js +83 -31
  77. package/dist/TableProvider/index.js.map +1 -1
  78. package/dist/TableProvider/index.mjs +84 -31
  79. package/dist/TableProvider/index.mjs.map +1 -1
  80. package/dist/index.css +24 -10
  81. package/dist/index.css.map +1 -1
  82. package/dist/index.d.ts +16 -3
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +3183 -1502
  85. package/dist/index.js.map +1 -1
  86. package/dist/index.mjs +2963 -1294
  87. package/dist/index.mjs.map +1 -1
  88. package/dist/styles.css +24 -10
  89. package/dist/styles.css.map +1 -1
  90. package/dist/types/activityDetails.d.ts +10 -0
  91. package/dist/types/activityDetails.d.ts.map +1 -1
  92. package/dist/types/questions.d.ts +100 -1
  93. package/dist/types/questions.d.ts.map +1 -1
  94. package/dist/utils/questionRenderer.d.ts +5 -0
  95. package/dist/utils/questionRenderer.d.ts.map +1 -0
  96. package/package.json +10 -3
@@ -0,0 +1,3692 @@
1
+ // src/components/ActivityCardQuestionPreview/ActivityCardQuestionPreview.tsx
2
+ import { useMemo, useState as useState7 } from "react";
3
+
4
+ // src/components/Accordation/Accordation.tsx
5
+ import {
6
+ forwardRef as forwardRef2,
7
+ useId,
8
+ useState as useState2,
9
+ useEffect as useEffect2
10
+ } from "react";
11
+
12
+ // src/components/Card/Card.tsx
13
+ import {
14
+ forwardRef,
15
+ Fragment as Fragment2,
16
+ useState,
17
+ useRef,
18
+ useEffect
19
+ } from "react";
20
+
21
+ // src/utils/utils.ts
22
+ import { clsx } from "clsx";
23
+ import { twMerge } from "tailwind-merge";
24
+ function cn(...inputs) {
25
+ return twMerge(clsx(inputs));
26
+ }
27
+ function getSubjectColorWithOpacity(hexColor, isDark) {
28
+ if (!hexColor) return void 0;
29
+ let color = hexColor.replace(/^#/, "").toLowerCase();
30
+ if (isDark) {
31
+ if (color.length === 8) {
32
+ color = color.slice(0, 6);
33
+ }
34
+ return `#${color}`;
35
+ } else {
36
+ let resultColor;
37
+ if (color.length === 6) {
38
+ resultColor = `#${color}4d`;
39
+ } else if (color.length === 8) {
40
+ resultColor = `#${color}`;
41
+ } else {
42
+ resultColor = `#${color}`;
43
+ }
44
+ return resultColor;
45
+ }
46
+ }
47
+
48
+ // src/components/Button/Button.tsx
49
+ import { jsx, jsxs } from "react/jsx-runtime";
50
+ var VARIANT_ACTION_CLASSES = {
51
+ solid: {
52
+ primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
53
+ positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
54
+ negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
55
+ },
56
+ outline: {
57
+ primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
58
+ positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
59
+ negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
60
+ },
61
+ link: {
62
+ primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
63
+ positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
64
+ negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
65
+ }
66
+ };
67
+ var SIZE_CLASSES = {
68
+ "extra-small": "text-xs px-3.5 py-2",
69
+ small: "text-sm px-4 py-2.5",
70
+ medium: "text-md px-5 py-2.5",
71
+ large: "text-lg px-6 py-3",
72
+ "extra-large": "text-lg px-7 py-3.5"
73
+ };
74
+ var Button = ({
75
+ children,
76
+ iconLeft,
77
+ iconRight,
78
+ size = "medium",
79
+ variant = "solid",
80
+ action = "primary",
81
+ className = "",
82
+ disabled,
83
+ type = "button",
84
+ ...props
85
+ }) => {
86
+ const sizeClasses = SIZE_CLASSES[size];
87
+ const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
88
+ const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
89
+ return /* @__PURE__ */ jsxs(
90
+ "button",
91
+ {
92
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
93
+ disabled,
94
+ type,
95
+ ...props,
96
+ children: [
97
+ iconLeft && /* @__PURE__ */ jsx("span", { className: "mr-2 flex items-center", children: iconLeft }),
98
+ children,
99
+ iconRight && /* @__PURE__ */ jsx("span", { className: "ml-2 flex items-center", children: iconRight })
100
+ ]
101
+ }
102
+ );
103
+ };
104
+ var Button_default = Button;
105
+
106
+ // src/components/Badge/Badge.tsx
107
+ import { Bell } from "phosphor-react";
108
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
109
+ var VARIANT_ACTION_CLASSES2 = {
110
+ solid: {
111
+ error: "bg-error-background text-error-700 focus-visible:outline-none",
112
+ warning: "bg-warning text-warning-800 focus-visible:outline-none",
113
+ success: "bg-success text-success-800 focus-visible:outline-none",
114
+ info: "bg-info text-info-800 focus-visible:outline-none",
115
+ muted: "bg-background-muted text-background-800 focus-visible:outline-none"
116
+ },
117
+ outlined: {
118
+ error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
119
+ warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
120
+ success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
121
+ info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
122
+ muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
123
+ },
124
+ exams: {
125
+ exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
126
+ exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
127
+ exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
128
+ exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
129
+ },
130
+ examsOutlined: {
131
+ exam1: "bg-exam-1 text-info-700 border border-info-700 focus-visible:outline-none",
132
+ exam2: "bg-exam-2 text-typography-1 border border-typography-1 focus-visible:outline-none",
133
+ exam3: "bg-exam-3 text-typography-2 border border-typography-2 focus-visible:outline-none",
134
+ exam4: "bg-exam-4 text-success-700 border border-success-700 focus-visible:outline-none"
135
+ },
136
+ resultStatus: {
137
+ negative: "bg-error text-error-800 focus-visible:outline-none",
138
+ positive: "bg-success text-success-800 focus-visible:outline-none"
139
+ },
140
+ notification: "text-primary"
141
+ };
142
+ var SIZE_CLASSES2 = {
143
+ small: "text-2xs px-2 py-1",
144
+ medium: "text-xs px-2 py-1",
145
+ large: "text-sm px-2 py-1"
146
+ };
147
+ var SIZE_CLASSES_ICON = {
148
+ small: "size-3",
149
+ medium: "size-3.5",
150
+ large: "size-4"
151
+ };
152
+ var Badge = ({
153
+ children,
154
+ iconLeft,
155
+ iconRight,
156
+ size = "medium",
157
+ variant = "solid",
158
+ action = "error",
159
+ className = "",
160
+ notificationActive = false,
161
+ ...props
162
+ }) => {
163
+ const sizeClasses = SIZE_CLASSES2[size];
164
+ const sizeClassesIcon = SIZE_CLASSES_ICON[size];
165
+ const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
166
+ const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
167
+ const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
168
+ const baseClassesIcon = "flex items-center";
169
+ if (variant === "notification") {
170
+ return /* @__PURE__ */ jsxs2(
171
+ "div",
172
+ {
173
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
174
+ ...props,
175
+ children: [
176
+ /* @__PURE__ */ jsx2(Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
177
+ notificationActive && /* @__PURE__ */ jsx2(
178
+ "span",
179
+ {
180
+ "data-testid": "notification-dot",
181
+ className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
182
+ }
183
+ )
184
+ ]
185
+ }
186
+ );
187
+ }
188
+ return /* @__PURE__ */ jsxs2(
189
+ "div",
190
+ {
191
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
192
+ ...props,
193
+ children: [
194
+ iconLeft && /* @__PURE__ */ jsx2("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
195
+ children,
196
+ iconRight && /* @__PURE__ */ jsx2("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
197
+ ]
198
+ }
199
+ );
200
+ };
201
+ var Badge_default = Badge;
202
+
203
+ // src/components/Text/Text.tsx
204
+ import { jsx as jsx3 } from "react/jsx-runtime";
205
+ var Text = ({
206
+ children,
207
+ size = "md",
208
+ weight = "normal",
209
+ color = "text-text-950",
210
+ as,
211
+ className = "",
212
+ ...props
213
+ }) => {
214
+ let sizeClasses = "";
215
+ let weightClasses = "";
216
+ const sizeClassMap = {
217
+ "2xs": "text-2xs",
218
+ xs: "text-xs",
219
+ sm: "text-sm",
220
+ md: "text-md",
221
+ lg: "text-lg",
222
+ xl: "text-xl",
223
+ "2xl": "text-2xl",
224
+ "3xl": "text-3xl",
225
+ "4xl": "text-4xl",
226
+ "5xl": "text-5xl",
227
+ "6xl": "text-6xl"
228
+ };
229
+ sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
230
+ const weightClassMap = {
231
+ hairline: "font-hairline",
232
+ light: "font-light",
233
+ normal: "font-normal",
234
+ medium: "font-medium",
235
+ semibold: "font-semibold",
236
+ bold: "font-bold",
237
+ extrabold: "font-extrabold",
238
+ black: "font-black"
239
+ };
240
+ weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
241
+ const baseClasses = "font-primary";
242
+ const Component = as ?? "p";
243
+ return /* @__PURE__ */ jsx3(
244
+ Component,
245
+ {
246
+ className: cn(baseClasses, sizeClasses, weightClasses, color, className),
247
+ ...props,
248
+ children
249
+ }
250
+ );
251
+ };
252
+ var Text_default = Text;
253
+
254
+ // src/components/ProgressBar/ProgressBar.tsx
255
+ import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
256
+ var SIZE_CLASSES3 = {
257
+ small: {
258
+ container: "h-1",
259
+ // 4px height (h-1 = 4px in Tailwind)
260
+ bar: "h-1",
261
+ // 4px height for the fill bar
262
+ spacing: "gap-2",
263
+ // 8px gap between label and progress bar
264
+ layout: "flex-col",
265
+ // vertical layout for small
266
+ borderRadius: "rounded-full"
267
+ // 9999px border radius
268
+ },
269
+ medium: {
270
+ container: "h-2",
271
+ // 8px height (h-2 = 8px in Tailwind)
272
+ bar: "h-2",
273
+ // 8px height for the fill bar
274
+ spacing: "gap-2",
275
+ // 8px gap between progress bar and label
276
+ layout: "flex-row items-center",
277
+ // horizontal layout for medium
278
+ borderRadius: "rounded-lg"
279
+ // 8px border radius
280
+ }
281
+ };
282
+ var VARIANT_CLASSES = {
283
+ blue: {
284
+ background: "bg-background-300",
285
+ // Background track color (#D5D4D4)
286
+ fill: "bg-primary-700"
287
+ // Blue for activity progress (#2271C4)
288
+ },
289
+ green: {
290
+ background: "bg-background-300",
291
+ // Background track color (#D5D4D4)
292
+ fill: "bg-success-200"
293
+ // Green for performance (#84D3A2)
294
+ }
295
+ };
296
+ var calculateProgressValues = (value, max) => {
297
+ const safeValue = isNaN(value) ? 0 : value;
298
+ const clampedValue = Math.max(0, Math.min(safeValue, max));
299
+ const percentage = max === 0 ? 0 : clampedValue / max * 100;
300
+ return { clampedValue, percentage };
301
+ };
302
+ var shouldShowHeader = (label, showPercentage, showHitCount) => {
303
+ return !!(label || showPercentage || showHitCount);
304
+ };
305
+ var getDisplayPriority = (showHitCount, showPercentage, label, clampedValue, max, percentage) => {
306
+ if (showHitCount) {
307
+ return {
308
+ type: "hitCount",
309
+ content: `${Math.round(clampedValue)} de ${max}`,
310
+ hasMetrics: true
311
+ };
312
+ }
313
+ if (showPercentage) {
314
+ return {
315
+ type: "percentage",
316
+ content: `${Math.round(percentage)}%`,
317
+ hasMetrics: true
318
+ };
319
+ }
320
+ return {
321
+ type: "label",
322
+ content: label,
323
+ hasMetrics: false
324
+ };
325
+ };
326
+ var getCompactLayoutConfig = ({
327
+ showPercentage,
328
+ showHitCount,
329
+ percentage,
330
+ clampedValue,
331
+ max,
332
+ label,
333
+ percentageClassName,
334
+ labelClassName
335
+ }) => {
336
+ const displayPriority = getDisplayPriority(
337
+ showHitCount,
338
+ showPercentage,
339
+ label,
340
+ clampedValue,
341
+ max,
342
+ percentage
343
+ );
344
+ return {
345
+ color: displayPriority.hasMetrics ? "text-primary-600" : "text-primary-700",
346
+ className: displayPriority.hasMetrics ? percentageClassName : labelClassName,
347
+ content: displayPriority.content
348
+ };
349
+ };
350
+ var getDefaultLayoutDisplayConfig = (size, label, showPercentage) => ({
351
+ showHeader: size === "small" && !!(label || showPercentage),
352
+ showPercentage: size === "medium" && showPercentage,
353
+ showLabel: size === "medium" && !!label && !showPercentage
354
+ // Only show label when percentage is not shown
355
+ });
356
+ var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue, max, percentage, percentageClassName) => {
357
+ if (!showHitCount && !showPercentage) return null;
358
+ const displayPriority = getDisplayPriority(
359
+ showHitCount,
360
+ showPercentage,
361
+ null,
362
+ // label is not relevant for stacked layout metrics display
363
+ clampedValue,
364
+ max,
365
+ percentage
366
+ );
367
+ return /* @__PURE__ */ jsx4(
368
+ "div",
369
+ {
370
+ className: cn(
371
+ "text-xs font-medium leading-[14px] text-right",
372
+ percentageClassName
373
+ ),
374
+ children: displayPriority.type === "hitCount" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
375
+ /* @__PURE__ */ jsx4("span", { className: "text-success-200", children: Math.round(clampedValue) }),
376
+ /* @__PURE__ */ jsxs3("span", { className: "text-text-600", children: [
377
+ " de ",
378
+ max
379
+ ] })
380
+ ] }) : /* @__PURE__ */ jsxs3(Text_default, { size: "xs", weight: "medium", className: "text-success-200", children: [
381
+ Math.round(percentage),
382
+ "%"
383
+ ] })
384
+ }
385
+ );
386
+ };
387
+ var ProgressBarBase = ({
388
+ clampedValue,
389
+ max,
390
+ percentage,
391
+ label,
392
+ variantClasses,
393
+ containerClassName,
394
+ fillClassName
395
+ }) => /* @__PURE__ */ jsxs3(
396
+ "div",
397
+ {
398
+ className: cn(
399
+ containerClassName,
400
+ variantClasses.background,
401
+ "overflow-hidden relative"
402
+ ),
403
+ children: [
404
+ /* @__PURE__ */ jsx4(
405
+ "progress",
406
+ {
407
+ value: clampedValue,
408
+ max,
409
+ "aria-label": typeof label === "string" ? `${label}: ${Math.round(percentage)}% complete` : `Progress: ${Math.round(percentage)}% of ${max}`,
410
+ className: "absolute inset-0 w-full h-full opacity-0"
411
+ }
412
+ ),
413
+ /* @__PURE__ */ jsx4(
414
+ "div",
415
+ {
416
+ className: cn(
417
+ fillClassName,
418
+ variantClasses.fill,
419
+ "transition-all duration-300 ease-out"
420
+ ),
421
+ style: { width: `${percentage}%` }
422
+ }
423
+ )
424
+ ]
425
+ }
426
+ );
427
+ var StackedLayout = ({
428
+ className,
429
+ label,
430
+ showPercentage,
431
+ showHitCount,
432
+ labelClassName,
433
+ percentageClassName,
434
+ clampedValue,
435
+ max,
436
+ percentage,
437
+ variantClasses,
438
+ dimensions
439
+ }) => /* @__PURE__ */ jsxs3(
440
+ "div",
441
+ {
442
+ className: cn(
443
+ "flex flex-col items-start gap-2",
444
+ dimensions.width,
445
+ dimensions.height,
446
+ className
447
+ ),
448
+ children: [
449
+ shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ jsxs3("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
450
+ label && /* @__PURE__ */ jsx4(
451
+ Text_default,
452
+ {
453
+ as: "div",
454
+ size: "md",
455
+ weight: "medium",
456
+ className: cn("text-text-600 leading-[19px]", labelClassName),
457
+ children: label
458
+ }
459
+ ),
460
+ renderStackedHitCountDisplay(
461
+ showHitCount,
462
+ showPercentage,
463
+ clampedValue,
464
+ max,
465
+ percentage,
466
+ percentageClassName
467
+ )
468
+ ] }),
469
+ /* @__PURE__ */ jsx4(
470
+ ProgressBarBase,
471
+ {
472
+ clampedValue,
473
+ max,
474
+ percentage,
475
+ label,
476
+ variantClasses,
477
+ containerClassName: "w-full h-2 rounded-lg",
478
+ fillClassName: "h-2 rounded-lg shadow-hard-shadow-3"
479
+ }
480
+ )
481
+ ]
482
+ }
483
+ );
484
+ var CompactLayout = ({
485
+ className,
486
+ label,
487
+ showPercentage,
488
+ showHitCount,
489
+ labelClassName,
490
+ percentageClassName,
491
+ clampedValue,
492
+ max,
493
+ percentage,
494
+ variantClasses,
495
+ dimensions
496
+ }) => {
497
+ const {
498
+ color,
499
+ className: compactClassName,
500
+ content
501
+ } = getCompactLayoutConfig({
502
+ showPercentage,
503
+ showHitCount,
504
+ percentage,
505
+ clampedValue,
506
+ max,
507
+ label,
508
+ percentageClassName,
509
+ labelClassName
510
+ });
511
+ return /* @__PURE__ */ jsxs3(
512
+ "div",
513
+ {
514
+ className: cn(
515
+ "flex flex-col items-start gap-1",
516
+ dimensions.width,
517
+ dimensions.height,
518
+ className
519
+ ),
520
+ children: [
521
+ shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ jsx4(
522
+ Text_default,
523
+ {
524
+ as: "div",
525
+ size: "sm",
526
+ weight: "medium",
527
+ color,
528
+ className: cn("leading-4 w-full", compactClassName),
529
+ children: content
530
+ }
531
+ ),
532
+ /* @__PURE__ */ jsx4(
533
+ ProgressBarBase,
534
+ {
535
+ clampedValue,
536
+ max,
537
+ percentage,
538
+ label,
539
+ variantClasses,
540
+ containerClassName: "w-full h-1 rounded-full",
541
+ fillClassName: "h-1 rounded-full"
542
+ }
543
+ )
544
+ ]
545
+ }
546
+ );
547
+ };
548
+ var DefaultLayout = ({
549
+ className,
550
+ size,
551
+ sizeClasses,
552
+ variantClasses,
553
+ label,
554
+ showPercentage,
555
+ labelClassName,
556
+ percentageClassName,
557
+ clampedValue,
558
+ max,
559
+ percentage
560
+ }) => {
561
+ const gapClass = size === "medium" ? "gap-2" : sizeClasses.spacing;
562
+ const progressBarClass = size === "medium" ? "flex-grow" : "w-full";
563
+ const displayConfig = getDefaultLayoutDisplayConfig(
564
+ size,
565
+ label,
566
+ showPercentage
567
+ );
568
+ return /* @__PURE__ */ jsxs3("div", { className: cn("flex", sizeClasses.layout, gapClass, className), children: [
569
+ displayConfig.showHeader && /* @__PURE__ */ jsxs3("div", { className: "flex flex-row items-center justify-between w-full", children: [
570
+ label && /* @__PURE__ */ jsx4(
571
+ Text_default,
572
+ {
573
+ as: "div",
574
+ size: "xs",
575
+ weight: "medium",
576
+ className: cn(
577
+ "text-text-950 leading-none tracking-normal text-center",
578
+ labelClassName
579
+ ),
580
+ children: label
581
+ }
582
+ ),
583
+ showPercentage && /* @__PURE__ */ jsxs3(
584
+ Text_default,
585
+ {
586
+ size: "xs",
587
+ weight: "medium",
588
+ className: cn(
589
+ "text-text-950 leading-none tracking-normal text-center",
590
+ percentageClassName
591
+ ),
592
+ children: [
593
+ Math.round(percentage),
594
+ "%"
595
+ ]
596
+ }
597
+ )
598
+ ] }),
599
+ /* @__PURE__ */ jsx4(
600
+ ProgressBarBase,
601
+ {
602
+ clampedValue,
603
+ max,
604
+ percentage,
605
+ label,
606
+ variantClasses,
607
+ containerClassName: cn(
608
+ progressBarClass,
609
+ sizeClasses.container,
610
+ sizeClasses.borderRadius
611
+ ),
612
+ fillClassName: cn(
613
+ sizeClasses.bar,
614
+ sizeClasses.borderRadius,
615
+ "shadow-hard-shadow-3"
616
+ )
617
+ }
618
+ ),
619
+ displayConfig.showPercentage && /* @__PURE__ */ jsxs3(
620
+ Text_default,
621
+ {
622
+ size: "xs",
623
+ weight: "medium",
624
+ className: cn(
625
+ "text-text-950 leading-none tracking-normal text-center flex-none",
626
+ percentageClassName
627
+ ),
628
+ children: [
629
+ Math.round(percentage),
630
+ "%"
631
+ ]
632
+ }
633
+ ),
634
+ displayConfig.showLabel && /* @__PURE__ */ jsx4(
635
+ Text_default,
636
+ {
637
+ as: "div",
638
+ size: "xs",
639
+ weight: "medium",
640
+ className: cn(
641
+ "text-text-950 leading-none tracking-normal text-center flex-none",
642
+ labelClassName
643
+ ),
644
+ children: label
645
+ }
646
+ )
647
+ ] });
648
+ };
649
+ var ProgressBar = ({
650
+ value,
651
+ max = 100,
652
+ size = "medium",
653
+ variant = "blue",
654
+ layout = "default",
655
+ label,
656
+ showPercentage = false,
657
+ showHitCount = false,
658
+ className = "",
659
+ labelClassName = "",
660
+ percentageClassName = "",
661
+ stackedWidth,
662
+ stackedHeight,
663
+ compactWidth,
664
+ compactHeight
665
+ }) => {
666
+ const { clampedValue, percentage } = calculateProgressValues(value, max);
667
+ const sizeClasses = SIZE_CLASSES3[size];
668
+ const variantClasses = VARIANT_CLASSES[variant];
669
+ if (layout === "stacked") {
670
+ return /* @__PURE__ */ jsx4(
671
+ StackedLayout,
672
+ {
673
+ className,
674
+ label,
675
+ showPercentage,
676
+ showHitCount,
677
+ labelClassName,
678
+ percentageClassName,
679
+ clampedValue,
680
+ max,
681
+ percentage,
682
+ variantClasses,
683
+ dimensions: {
684
+ width: stackedWidth ?? "w-[380px]",
685
+ height: stackedHeight ?? "h-[35px]"
686
+ }
687
+ }
688
+ );
689
+ }
690
+ if (layout === "compact") {
691
+ return /* @__PURE__ */ jsx4(
692
+ CompactLayout,
693
+ {
694
+ className,
695
+ label,
696
+ showPercentage,
697
+ showHitCount,
698
+ labelClassName,
699
+ percentageClassName,
700
+ clampedValue,
701
+ max,
702
+ percentage,
703
+ variantClasses,
704
+ dimensions: {
705
+ width: compactWidth ?? "w-[131px]",
706
+ height: compactHeight ?? "h-[24px]"
707
+ }
708
+ }
709
+ );
710
+ }
711
+ return /* @__PURE__ */ jsx4(
712
+ DefaultLayout,
713
+ {
714
+ className,
715
+ size,
716
+ sizeClasses,
717
+ variantClasses,
718
+ label,
719
+ showPercentage,
720
+ labelClassName,
721
+ percentageClassName,
722
+ clampedValue,
723
+ max,
724
+ percentage
725
+ }
726
+ );
727
+ };
728
+ var ProgressBar_default = ProgressBar;
729
+
730
+ // src/components/Card/Card.tsx
731
+ import {
732
+ CaretRight,
733
+ ChatCircleText,
734
+ CheckCircle,
735
+ Clock,
736
+ DotsThreeVertical,
737
+ Play,
738
+ SpeakerHigh,
739
+ SpeakerLow,
740
+ SpeakerSimpleX,
741
+ XCircle
742
+ } from "phosphor-react";
743
+
744
+ // src/components/IconRender/IconRender.tsx
745
+ import { cloneElement } from "react";
746
+ import * as PhosphorIcons from "phosphor-react";
747
+
748
+ // src/assets/icons/subjects/ChatPT.tsx
749
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
750
+ var ChatPT = ({ size, color }) => /* @__PURE__ */ jsxs4(
751
+ "svg",
752
+ {
753
+ width: size,
754
+ height: size,
755
+ viewBox: "0 0 32 32",
756
+ fill: "none",
757
+ xmlns: "http://www.w3.org/2000/svg",
758
+ children: [
759
+ /* @__PURE__ */ jsx5(
760
+ "path",
761
+ {
762
+ d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
763
+ fill: color
764
+ }
765
+ ),
766
+ /* @__PURE__ */ jsx5(
767
+ "path",
768
+ {
769
+ d: "M21.1758 12V20.5312H19.7168V12H21.1758ZM23.8535 12V13.1719H17.0625V12H23.8535Z",
770
+ fill: color
771
+ }
772
+ ),
773
+ /* @__PURE__ */ jsx5(
774
+ "path",
775
+ {
776
+ d: "M13.2402 17.3496H11.0195V16.1836H13.2402C13.627 16.1836 13.9395 16.1211 14.1777 15.9961C14.416 15.8711 14.5898 15.6992 14.6992 15.4805C14.8125 15.2578 14.8691 15.0039 14.8691 14.7188C14.8691 14.4492 14.8125 14.1973 14.6992 13.9629C14.5898 13.7246 14.416 13.5332 14.1777 13.3887C13.9395 13.2441 13.627 13.1719 13.2402 13.1719H11.4707V20.5312H10V12H13.2402C13.9004 12 14.4609 12.1172 14.9219 12.3516C15.3867 12.582 15.7402 12.9023 15.9824 13.3125C16.2246 13.7188 16.3457 14.1836 16.3457 14.707C16.3457 15.2578 16.2246 15.7305 15.9824 16.125C15.7402 16.5195 15.3867 16.8223 14.9219 17.0332C14.4609 17.2441 13.9004 17.3496 13.2402 17.3496Z",
777
+ fill: color
778
+ }
779
+ )
780
+ ]
781
+ }
782
+ );
783
+
784
+ // src/assets/icons/subjects/ChatEN.tsx
785
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
786
+ var ChatEN = ({ size, color }) => /* @__PURE__ */ jsxs5(
787
+ "svg",
788
+ {
789
+ width: size,
790
+ height: size,
791
+ viewBox: "0 0 32 32",
792
+ fill: "none",
793
+ xmlns: "http://www.w3.org/2000/svg",
794
+ children: [
795
+ /* @__PURE__ */ jsx6(
796
+ "path",
797
+ {
798
+ d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
799
+ fill: color
800
+ }
801
+ ),
802
+ /* @__PURE__ */ jsx6(
803
+ "path",
804
+ {
805
+ d: "M22.5488 12V20.5312H21.0781L17.252 14.4199V20.5312H15.7812V12H17.252L21.0898 18.123V12H22.5488Z",
806
+ fill: color
807
+ }
808
+ ),
809
+ /* @__PURE__ */ jsx6(
810
+ "path",
811
+ {
812
+ d: "M14.584 19.3652V20.5312H10.0547V19.3652H14.584ZM10.4707 12V20.5312H9V12H10.4707ZM13.9922 15.5625V16.7109H10.0547V15.5625H13.9922ZM14.5547 12V13.1719H10.0547V12H14.5547Z",
813
+ fill: color
814
+ }
815
+ )
816
+ ]
817
+ }
818
+ );
819
+
820
+ // src/assets/icons/subjects/ChatES.tsx
821
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
822
+ var ChatES = ({ size, color }) => /* @__PURE__ */ jsxs6(
823
+ "svg",
824
+ {
825
+ width: size,
826
+ height: size,
827
+ viewBox: "0 0 32 32",
828
+ fill: "none",
829
+ xmlns: "http://www.w3.org/2000/svg",
830
+ children: [
831
+ /* @__PURE__ */ jsx7(
832
+ "path",
833
+ {
834
+ d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
835
+ fill: color
836
+ }
837
+ ),
838
+ /* @__PURE__ */ jsx7(
839
+ "path",
840
+ {
841
+ d: "M21.1426 17.8027C21.1426 17.627 21.1152 17.4707 21.0605 17.334C21.0098 17.1973 20.918 17.0723 20.7852 16.959C20.6523 16.8457 20.4648 16.7363 20.2227 16.6309C19.9844 16.5215 19.6797 16.4102 19.3086 16.2969C18.9023 16.1719 18.5273 16.0332 18.1836 15.8809C17.8438 15.7246 17.5469 15.5449 17.293 15.3418C17.0391 15.1348 16.8418 14.8984 16.7012 14.6328C16.5605 14.3633 16.4902 14.0527 16.4902 13.7012C16.4902 13.3535 16.5625 13.0371 16.707 12.752C16.8555 12.4668 17.0645 12.2207 17.334 12.0137C17.6074 11.8027 17.9297 11.6406 18.3008 11.5273C18.6719 11.4102 19.082 11.3516 19.5312 11.3516C20.1641 11.3516 20.709 11.4688 21.166 11.7031C21.627 11.9375 21.9805 12.252 22.2266 12.6465C22.4766 13.041 22.6016 13.4766 22.6016 13.9531H21.1426C21.1426 13.6719 21.082 13.4238 20.9609 13.209C20.8438 12.9902 20.6641 12.8184 20.4219 12.6934C20.1836 12.5684 19.8809 12.5059 19.5137 12.5059C19.166 12.5059 18.877 12.5586 18.6465 12.6641C18.416 12.7695 18.2441 12.9121 18.1309 13.0918C18.0176 13.2715 17.9609 13.4746 17.9609 13.7012C17.9609 13.8613 17.998 14.0078 18.0723 14.1406C18.1465 14.2695 18.2598 14.3906 18.4121 14.5039C18.5645 14.6133 18.7559 14.7168 18.9863 14.8145C19.2168 14.9121 19.4883 15.0059 19.8008 15.0957C20.2734 15.2363 20.6855 15.3926 21.0371 15.5645C21.3887 15.7324 21.6816 15.9238 21.916 16.1387C22.1504 16.3535 22.3262 16.5977 22.4434 16.8711C22.5605 17.1406 22.6191 17.4473 22.6191 17.791C22.6191 18.1504 22.5469 18.4746 22.4023 18.7637C22.2578 19.0488 22.0508 19.293 21.7812 19.4961C21.5156 19.6953 21.1953 19.8496 20.8203 19.959C20.4492 20.0645 20.0352 20.1172 19.5781 20.1172C19.168 20.1172 18.7637 20.0625 18.3652 19.9531C17.9707 19.8438 17.6113 19.6777 17.2871 19.4551C16.9629 19.2285 16.7051 18.9473 16.5137 18.6113C16.3223 18.2715 16.2266 17.875 16.2266 17.4219H17.6973C17.6973 17.6992 17.7441 17.9355 17.8379 18.1309C17.9355 18.3262 18.0703 18.4863 18.2422 18.6113C18.4141 18.7324 18.6133 18.8223 18.8398 18.8809C19.0703 18.9395 19.3164 18.9688 19.5781 18.9688C19.9219 18.9688 20.209 18.9199 20.4395 18.8223C20.6738 18.7246 20.8496 18.5879 20.9668 18.4121C21.084 18.2363 21.1426 18.0332 21.1426 17.8027Z",
842
+ fill: color
843
+ }
844
+ ),
845
+ /* @__PURE__ */ jsx7(
846
+ "path",
847
+ {
848
+ d: "M15.4512 18.834V20H10.9219V18.834H15.4512ZM11.3379 11.4688V20H9.86719V11.4688H11.3379ZM14.8594 15.0312V16.1797H10.9219V15.0312H14.8594ZM15.4219 11.4688V12.6406H10.9219V11.4688H15.4219Z",
849
+ fill: color
850
+ }
851
+ )
852
+ ]
853
+ }
854
+ );
855
+
856
+ // src/components/IconRender/IconRender.tsx
857
+ import { jsx as jsx8 } from "react/jsx-runtime";
858
+ var IconRender = ({
859
+ iconName,
860
+ color = "#000000",
861
+ size = 24,
862
+ weight = "regular"
863
+ }) => {
864
+ if (typeof iconName === "string") {
865
+ switch (iconName) {
866
+ case "Chat_PT":
867
+ return /* @__PURE__ */ jsx8(ChatPT, { size, color });
868
+ case "Chat_EN":
869
+ return /* @__PURE__ */ jsx8(ChatEN, { size, color });
870
+ case "Chat_ES":
871
+ return /* @__PURE__ */ jsx8(ChatES, { size, color });
872
+ default: {
873
+ const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
874
+ return /* @__PURE__ */ jsx8(IconComponent, { size, color, weight });
875
+ }
876
+ }
877
+ } else {
878
+ return cloneElement(iconName, {
879
+ size,
880
+ color: "currentColor"
881
+ });
882
+ }
883
+ };
884
+ var IconRender_default = IconRender;
885
+
886
+ // src/components/Card/Card.tsx
887
+ import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
888
+ var CARD_BASE_CLASSES = {
889
+ default: "w-full bg-background border border-border-50 rounded-xl",
890
+ compact: "w-full bg-background border border-border-50 rounded-lg",
891
+ minimal: "w-full bg-background border border-border-100 rounded-md"
892
+ };
893
+ var CARD_PADDING_CLASSES = {
894
+ none: "",
895
+ small: "p-2",
896
+ medium: "p-4",
897
+ large: "p-6"
898
+ };
899
+ var CARD_MIN_HEIGHT_CLASSES = {
900
+ none: "",
901
+ small: "min-h-16",
902
+ medium: "min-h-20",
903
+ large: "min-h-24"
904
+ };
905
+ var CARD_LAYOUT_CLASSES = {
906
+ horizontal: "flex flex-row",
907
+ vertical: "flex flex-col"
908
+ };
909
+ var CARD_CURSOR_CLASSES = {
910
+ default: "",
911
+ pointer: "cursor-pointer"
912
+ };
913
+ var CardBase = forwardRef(
914
+ ({
915
+ children,
916
+ variant = "default",
917
+ layout = "horizontal",
918
+ padding = "medium",
919
+ minHeight = "medium",
920
+ cursor = "default",
921
+ className = "",
922
+ ...props
923
+ }, ref) => {
924
+ const baseClasses = CARD_BASE_CLASSES[variant];
925
+ const paddingClasses = CARD_PADDING_CLASSES[padding];
926
+ const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
927
+ const layoutClasses = CARD_LAYOUT_CLASSES[layout];
928
+ const cursorClasses = CARD_CURSOR_CLASSES[cursor];
929
+ return /* @__PURE__ */ jsx9(
930
+ "div",
931
+ {
932
+ ref,
933
+ className: cn(
934
+ baseClasses,
935
+ paddingClasses,
936
+ minHeightClasses,
937
+ layoutClasses,
938
+ cursorClasses,
939
+ className
940
+ ),
941
+ ...props,
942
+ children
943
+ }
944
+ );
945
+ }
946
+ );
947
+ var ACTION_CARD_CLASSES = {
948
+ warning: "bg-warning-background",
949
+ success: "bg-success-200",
950
+ error: "bg-error-100",
951
+ info: "bg-info-background"
952
+ };
953
+ var ACTION_ICON_CLASSES = {
954
+ warning: "bg-warning-300 text-text",
955
+ success: "bg-indicator-positive text-text-950",
956
+ error: "bg-indicator-negative text-text",
957
+ info: "bg-info-500 text-text"
958
+ };
959
+ var ACTION_SUBTITLE_CLASSES = {
960
+ warning: "text-warning-600",
961
+ success: "text-success-700",
962
+ error: "text-error-700",
963
+ info: "text-info-700"
964
+ };
965
+ var ACTION_HEADER_CLASSES = {
966
+ warning: "text-warning-300",
967
+ success: "text-success-300",
968
+ error: "text-error-300",
969
+ info: "text-info-300"
970
+ };
971
+ var CardActivitiesResults = forwardRef(
972
+ ({
973
+ icon,
974
+ title,
975
+ subTitle,
976
+ header,
977
+ extended = false,
978
+ action = "success",
979
+ description,
980
+ className,
981
+ ...props
982
+ }, ref) => {
983
+ const actionCardClasses = ACTION_CARD_CLASSES[action];
984
+ const actionIconClasses = ACTION_ICON_CLASSES[action];
985
+ const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
986
+ const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
987
+ return /* @__PURE__ */ jsxs7(
988
+ "div",
989
+ {
990
+ ref,
991
+ className: cn(
992
+ "w-full flex flex-col border border-border-50 bg-background rounded-xl",
993
+ className
994
+ ),
995
+ ...props,
996
+ children: [
997
+ /* @__PURE__ */ jsxs7(
998
+ "div",
999
+ {
1000
+ className: cn(
1001
+ "flex flex-col gap-1 items-center justify-center p-4",
1002
+ actionCardClasses,
1003
+ extended ? "rounded-t-xl" : "rounded-xl"
1004
+ ),
1005
+ children: [
1006
+ /* @__PURE__ */ jsx9(
1007
+ "span",
1008
+ {
1009
+ className: cn(
1010
+ "size-7.5 rounded-full flex items-center justify-center",
1011
+ actionIconClasses
1012
+ ),
1013
+ children: icon
1014
+ }
1015
+ ),
1016
+ /* @__PURE__ */ jsx9(
1017
+ Text_default,
1018
+ {
1019
+ size: "2xs",
1020
+ weight: "medium",
1021
+ className: "text-text-800 uppercase truncate",
1022
+ children: title
1023
+ }
1024
+ ),
1025
+ /* @__PURE__ */ jsx9(
1026
+ "p",
1027
+ {
1028
+ className: cn("text-lg font-bold truncate", actionSubTitleClasses),
1029
+ children: subTitle
1030
+ }
1031
+ )
1032
+ ]
1033
+ }
1034
+ ),
1035
+ extended && /* @__PURE__ */ jsxs7("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
1036
+ /* @__PURE__ */ jsx9(
1037
+ "p",
1038
+ {
1039
+ className: cn(
1040
+ "text-2xs font-medium uppercase truncate",
1041
+ actionHeaderClasses
1042
+ ),
1043
+ children: header
1044
+ }
1045
+ ),
1046
+ /* @__PURE__ */ jsx9(Badge_default, { size: "large", action: "info", children: description })
1047
+ ] })
1048
+ ]
1049
+ }
1050
+ );
1051
+ }
1052
+ );
1053
+ var CardQuestions = forwardRef(
1054
+ ({
1055
+ header,
1056
+ state = "undone",
1057
+ className,
1058
+ onClickButton,
1059
+ valueButton,
1060
+ ...props
1061
+ }, ref) => {
1062
+ const isDone = state === "done";
1063
+ const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
1064
+ const buttonLabel = isDone ? "Ver Resultado" : "Responder";
1065
+ return /* @__PURE__ */ jsxs7(
1066
+ CardBase,
1067
+ {
1068
+ ref,
1069
+ layout: "horizontal",
1070
+ padding: "medium",
1071
+ minHeight: "medium",
1072
+ className: cn("justify-between gap-4", className),
1073
+ ...props,
1074
+ children: [
1075
+ /* @__PURE__ */ jsxs7("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
1076
+ /* @__PURE__ */ jsx9("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
1077
+ /* @__PURE__ */ jsx9("div", { className: "flex flex-row gap-6 items-center", children: /* @__PURE__ */ jsx9(
1078
+ Badge_default,
1079
+ {
1080
+ size: "medium",
1081
+ variant: "solid",
1082
+ action: isDone ? "success" : "error",
1083
+ children: stateLabel
1084
+ }
1085
+ ) })
1086
+ ] }),
1087
+ /* @__PURE__ */ jsx9("span", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx9(
1088
+ Button_default,
1089
+ {
1090
+ size: "extra-small",
1091
+ onClick: () => onClickButton?.(valueButton),
1092
+ className: "min-w-fit",
1093
+ children: buttonLabel
1094
+ }
1095
+ ) })
1096
+ ]
1097
+ }
1098
+ );
1099
+ }
1100
+ );
1101
+ var CardProgress = forwardRef(
1102
+ ({
1103
+ header,
1104
+ subhead,
1105
+ initialDate,
1106
+ endDate,
1107
+ progress = 0,
1108
+ direction = "horizontal",
1109
+ icon,
1110
+ color = "#B7DFFF",
1111
+ progressVariant = "blue",
1112
+ showDates = true,
1113
+ className,
1114
+ ...props
1115
+ }, ref) => {
1116
+ const isHorizontal = direction === "horizontal";
1117
+ const contentComponent = {
1118
+ horizontal: /* @__PURE__ */ jsxs7(Fragment3, { children: [
1119
+ showDates && /* @__PURE__ */ jsxs7("div", { className: "flex flex-row gap-6 items-center", children: [
1120
+ initialDate && /* @__PURE__ */ jsxs7("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
1121
+ /* @__PURE__ */ jsx9("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
1122
+ /* @__PURE__ */ jsx9("p", { className: "text-text-600", children: initialDate })
1123
+ ] }),
1124
+ endDate && /* @__PURE__ */ jsxs7("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
1125
+ /* @__PURE__ */ jsx9("p", { className: "text-text-800 font-semibold", children: "Fim" }),
1126
+ /* @__PURE__ */ jsx9("p", { className: "text-text-600", children: endDate })
1127
+ ] })
1128
+ ] }),
1129
+ /* @__PURE__ */ jsxs7("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
1130
+ /* @__PURE__ */ jsx9(
1131
+ ProgressBar_default,
1132
+ {
1133
+ size: "small",
1134
+ value: progress,
1135
+ variant: progressVariant,
1136
+ "data-testid": "progress-bar"
1137
+ }
1138
+ ),
1139
+ /* @__PURE__ */ jsxs7(
1140
+ Text_default,
1141
+ {
1142
+ size: "xs",
1143
+ weight: "medium",
1144
+ className: cn(
1145
+ "text-text-950 leading-none tracking-normal text-center flex-none"
1146
+ ),
1147
+ children: [
1148
+ Math.round(progress),
1149
+ "%"
1150
+ ]
1151
+ }
1152
+ )
1153
+ ] })
1154
+ ] }),
1155
+ vertical: /* @__PURE__ */ jsx9("p", { className: "text-sm text-text-800", children: subhead })
1156
+ };
1157
+ return /* @__PURE__ */ jsxs7(
1158
+ CardBase,
1159
+ {
1160
+ ref,
1161
+ layout: isHorizontal ? "horizontal" : "vertical",
1162
+ padding: "none",
1163
+ minHeight: "medium",
1164
+ cursor: "pointer",
1165
+ className: cn(isHorizontal ? "h-20" : "", className),
1166
+ ...props,
1167
+ children: [
1168
+ /* @__PURE__ */ jsx9(
1169
+ "div",
1170
+ {
1171
+ className: cn(
1172
+ "flex justify-center items-center [&>svg]:size-6 text-text-950",
1173
+ isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl",
1174
+ !color.startsWith("#") ? `${color}` : ""
1175
+ ),
1176
+ style: color.startsWith("#") ? { backgroundColor: color } : void 0,
1177
+ "data-testid": "icon-container",
1178
+ children: icon
1179
+ }
1180
+ ),
1181
+ /* @__PURE__ */ jsxs7(
1182
+ "div",
1183
+ {
1184
+ className: cn(
1185
+ "p-4 flex flex-col justify-between w-full h-full",
1186
+ !isHorizontal && "gap-4"
1187
+ ),
1188
+ children: [
1189
+ /* @__PURE__ */ jsx9(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
1190
+ contentComponent[direction]
1191
+ ]
1192
+ }
1193
+ )
1194
+ ]
1195
+ }
1196
+ );
1197
+ }
1198
+ );
1199
+ var CardTopic = forwardRef(
1200
+ ({
1201
+ header,
1202
+ subHead,
1203
+ progress,
1204
+ showPercentage = false,
1205
+ progressVariant = "blue",
1206
+ className = "",
1207
+ ...props
1208
+ }, ref) => {
1209
+ return /* @__PURE__ */ jsxs7(
1210
+ CardBase,
1211
+ {
1212
+ ref,
1213
+ layout: "vertical",
1214
+ padding: "small",
1215
+ minHeight: "medium",
1216
+ cursor: "pointer",
1217
+ className: cn("justify-center gap-2 py-2 px-4", className),
1218
+ ...props,
1219
+ children: [
1220
+ subHead && /* @__PURE__ */ jsx9("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ jsxs7(Fragment2, { children: [
1221
+ /* @__PURE__ */ jsx9("p", { children: text }),
1222
+ index < subHead.length - 1 && /* @__PURE__ */ jsx9("p", { children: "\u2022" })
1223
+ ] }, `${text} - ${index}`)) }),
1224
+ /* @__PURE__ */ jsx9("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
1225
+ /* @__PURE__ */ jsxs7("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
1226
+ /* @__PURE__ */ jsx9(
1227
+ ProgressBar_default,
1228
+ {
1229
+ size: "small",
1230
+ value: progress,
1231
+ variant: progressVariant,
1232
+ "data-testid": "progress-bar"
1233
+ }
1234
+ ),
1235
+ showPercentage && /* @__PURE__ */ jsxs7(
1236
+ Text_default,
1237
+ {
1238
+ size: "xs",
1239
+ weight: "medium",
1240
+ className: cn(
1241
+ "text-text-950 leading-none tracking-normal text-center flex-none"
1242
+ ),
1243
+ children: [
1244
+ Math.round(progress),
1245
+ "%"
1246
+ ]
1247
+ }
1248
+ )
1249
+ ] })
1250
+ ]
1251
+ }
1252
+ );
1253
+ }
1254
+ );
1255
+ var CardPerformance = forwardRef(
1256
+ ({
1257
+ header,
1258
+ progress,
1259
+ description = "Sem dados ainda! Voc\xEA ainda n\xE3o fez um question\xE1rio neste assunto.",
1260
+ actionVariant = "button",
1261
+ progressVariant = "blue",
1262
+ labelProgress = "",
1263
+ className = "",
1264
+ onClickButton,
1265
+ valueButton,
1266
+ ...props
1267
+ }, ref) => {
1268
+ const hasProgress = progress !== void 0;
1269
+ return /* @__PURE__ */ jsxs7(
1270
+ CardBase,
1271
+ {
1272
+ ref,
1273
+ layout: "horizontal",
1274
+ padding: "medium",
1275
+ minHeight: "none",
1276
+ className: cn(
1277
+ actionVariant == "caret" ? "cursor-pointer" : "",
1278
+ className
1279
+ ),
1280
+ onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
1281
+ ...props,
1282
+ children: [
1283
+ /* @__PURE__ */ jsxs7("div", { className: "w-full flex flex-col justify-between gap-2", children: [
1284
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-row justify-between items-center gap-2", children: [
1285
+ /* @__PURE__ */ jsx9("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
1286
+ actionVariant === "button" && /* @__PURE__ */ jsx9(
1287
+ Button_default,
1288
+ {
1289
+ variant: "outline",
1290
+ size: "extra-small",
1291
+ onClick: () => onClickButton?.(valueButton),
1292
+ className: "min-w-fit flex-shrink-0",
1293
+ children: "Ver Aula"
1294
+ }
1295
+ )
1296
+ ] }),
1297
+ /* @__PURE__ */ jsx9("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ jsx9(
1298
+ ProgressBar_default,
1299
+ {
1300
+ value: progress,
1301
+ label: `${progress}% ${labelProgress}`,
1302
+ variant: progressVariant
1303
+ }
1304
+ ) : /* @__PURE__ */ jsx9("p", { className: "text-xs text-text-600 truncate", children: description }) })
1305
+ ] }),
1306
+ actionVariant == "caret" && /* @__PURE__ */ jsx9(
1307
+ CaretRight,
1308
+ {
1309
+ className: "size-4.5 text-text-800 cursor-pointer",
1310
+ "data-testid": "caret-icon"
1311
+ }
1312
+ )
1313
+ ]
1314
+ }
1315
+ );
1316
+ }
1317
+ );
1318
+ var CardResults = forwardRef(
1319
+ ({
1320
+ header,
1321
+ correct_answers,
1322
+ incorrect_answers,
1323
+ icon,
1324
+ direction = "col",
1325
+ color = "#B7DFFF",
1326
+ className,
1327
+ ...props
1328
+ }, ref) => {
1329
+ const isRow = direction == "row";
1330
+ return /* @__PURE__ */ jsxs7(
1331
+ CardBase,
1332
+ {
1333
+ ref,
1334
+ layout: "horizontal",
1335
+ padding: "none",
1336
+ minHeight: "medium",
1337
+ className: cn("items-stretch cursor-pointer pr-4", className),
1338
+ ...props,
1339
+ children: [
1340
+ /* @__PURE__ */ jsx9(
1341
+ "div",
1342
+ {
1343
+ className: cn(
1344
+ "flex justify-center items-center [&>svg]:size-8 text-text-950 min-w-20 max-w-20 min-h-full rounded-l-xl"
1345
+ ),
1346
+ style: {
1347
+ backgroundColor: color
1348
+ },
1349
+ children: /* @__PURE__ */ jsx9(IconRender_default, { iconName: icon, color: "currentColor", size: 20 })
1350
+ }
1351
+ ),
1352
+ /* @__PURE__ */ jsxs7("div", { className: "w-full flex flex-row justify-between items-center", children: [
1353
+ /* @__PURE__ */ jsxs7(
1354
+ "div",
1355
+ {
1356
+ className: cn(
1357
+ "p-4 flex flex-wrap justify-between w-full h-full",
1358
+ isRow ? "flex-row items-center gap-2" : "flex-col"
1359
+ ),
1360
+ children: [
1361
+ /* @__PURE__ */ jsx9("p", { className: "text-sm font-bold text-text-950 flex-1", children: header }),
1362
+ /* @__PURE__ */ jsxs7("span", { className: "flex flex-wrap flex-row gap-1 items-center", children: [
1363
+ /* @__PURE__ */ jsxs7(
1364
+ Badge_default,
1365
+ {
1366
+ action: "success",
1367
+ variant: "solid",
1368
+ size: "large",
1369
+ iconLeft: /* @__PURE__ */ jsx9(CheckCircle, {}),
1370
+ children: [
1371
+ correct_answers,
1372
+ " Corretas"
1373
+ ]
1374
+ }
1375
+ ),
1376
+ /* @__PURE__ */ jsxs7(
1377
+ Badge_default,
1378
+ {
1379
+ action: "error",
1380
+ variant: "solid",
1381
+ size: "large",
1382
+ iconLeft: /* @__PURE__ */ jsx9(XCircle, {}),
1383
+ children: [
1384
+ incorrect_answers,
1385
+ " Incorretas"
1386
+ ]
1387
+ }
1388
+ )
1389
+ ] })
1390
+ ]
1391
+ }
1392
+ ),
1393
+ /* @__PURE__ */ jsx9(CaretRight, { className: "min-w-6 min-h-6 text-text-800" })
1394
+ ] })
1395
+ ]
1396
+ }
1397
+ );
1398
+ }
1399
+ );
1400
+ var CardStatus = forwardRef(
1401
+ ({ header, className, status, label, ...props }, ref) => {
1402
+ const getLabelBadge = (status2) => {
1403
+ switch (status2) {
1404
+ case "correct":
1405
+ return "Correta";
1406
+ case "incorrect":
1407
+ return "Incorreta";
1408
+ case "unanswered":
1409
+ return "Em branco";
1410
+ case "pending":
1411
+ return "Avalia\xE7\xE3o pendente";
1412
+ default:
1413
+ return "Em branco";
1414
+ }
1415
+ };
1416
+ const getIconBadge = (status2) => {
1417
+ switch (status2) {
1418
+ case "correct":
1419
+ return /* @__PURE__ */ jsx9(CheckCircle, {});
1420
+ case "incorrect":
1421
+ return /* @__PURE__ */ jsx9(XCircle, {});
1422
+ case "pending":
1423
+ return /* @__PURE__ */ jsx9(Clock, {});
1424
+ default:
1425
+ return /* @__PURE__ */ jsx9(XCircle, {});
1426
+ }
1427
+ };
1428
+ const getActionBadge = (status2) => {
1429
+ switch (status2) {
1430
+ case "correct":
1431
+ return "success";
1432
+ case "incorrect":
1433
+ return "error";
1434
+ case "pending":
1435
+ return "info";
1436
+ default:
1437
+ return "info";
1438
+ }
1439
+ };
1440
+ return /* @__PURE__ */ jsx9(
1441
+ CardBase,
1442
+ {
1443
+ ref,
1444
+ layout: "horizontal",
1445
+ padding: "medium",
1446
+ minHeight: "medium",
1447
+ className: cn("items-center cursor-pointer", className),
1448
+ ...props,
1449
+ children: /* @__PURE__ */ jsxs7("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
1450
+ /* @__PURE__ */ jsx9("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
1451
+ /* @__PURE__ */ jsxs7("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
1452
+ status && /* @__PURE__ */ jsx9(
1453
+ Badge_default,
1454
+ {
1455
+ action: getActionBadge(status),
1456
+ variant: "solid",
1457
+ size: "medium",
1458
+ iconLeft: getIconBadge(status),
1459
+ children: getLabelBadge(status)
1460
+ }
1461
+ ),
1462
+ label && /* @__PURE__ */ jsx9("p", { className: "text-sm text-text-800", children: label })
1463
+ ] }),
1464
+ /* @__PURE__ */ jsx9(CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
1465
+ ] })
1466
+ }
1467
+ );
1468
+ }
1469
+ );
1470
+ var CardSettings = forwardRef(
1471
+ ({ header, className, icon, ...props }, ref) => {
1472
+ return /* @__PURE__ */ jsxs7(
1473
+ CardBase,
1474
+ {
1475
+ ref,
1476
+ layout: "horizontal",
1477
+ padding: "small",
1478
+ minHeight: "none",
1479
+ className: cn(
1480
+ "border-none items-center gap-2 text-text-700",
1481
+ className
1482
+ ),
1483
+ ...props,
1484
+ children: [
1485
+ /* @__PURE__ */ jsx9("span", { className: "[&>svg]:size-6", children: icon }),
1486
+ /* @__PURE__ */ jsx9("p", { className: "w-full text-sm truncate", children: header }),
1487
+ /* @__PURE__ */ jsx9(CaretRight, { size: 24, className: "cursor-pointer" })
1488
+ ]
1489
+ }
1490
+ );
1491
+ }
1492
+ );
1493
+ var CardSupport = forwardRef(
1494
+ ({ header, className, direction = "col", children, ...props }, ref) => {
1495
+ return /* @__PURE__ */ jsxs7(
1496
+ CardBase,
1497
+ {
1498
+ ref,
1499
+ layout: "horizontal",
1500
+ padding: "medium",
1501
+ minHeight: "none",
1502
+ className: cn(
1503
+ "border-none items-center gap-2 text-text-700",
1504
+ className
1505
+ ),
1506
+ ...props,
1507
+ children: [
1508
+ /* @__PURE__ */ jsxs7(
1509
+ "div",
1510
+ {
1511
+ className: cn(
1512
+ "w-full flex",
1513
+ direction == "col" ? "flex-col" : "flex-row items-center"
1514
+ ),
1515
+ children: [
1516
+ /* @__PURE__ */ jsx9("span", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx9("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
1517
+ /* @__PURE__ */ jsx9("span", { className: "flex flex-row gap-1", children })
1518
+ ]
1519
+ }
1520
+ ),
1521
+ /* @__PURE__ */ jsx9(CaretRight, { className: "text-text-800 cursor-pointer", size: 24 })
1522
+ ]
1523
+ }
1524
+ );
1525
+ }
1526
+ );
1527
+ var CardForum = forwardRef(
1528
+ ({
1529
+ title,
1530
+ content,
1531
+ comments,
1532
+ onClickComments,
1533
+ valueComments,
1534
+ onClickProfile,
1535
+ valueProfile,
1536
+ className = "",
1537
+ date,
1538
+ hour,
1539
+ ...props
1540
+ }, ref) => {
1541
+ return /* @__PURE__ */ jsxs7(
1542
+ CardBase,
1543
+ {
1544
+ ref,
1545
+ layout: "horizontal",
1546
+ padding: "medium",
1547
+ minHeight: "none",
1548
+ variant: "minimal",
1549
+ className: cn("w-auto h-auto gap-3", className),
1550
+ ...props,
1551
+ children: [
1552
+ /* @__PURE__ */ jsx9(
1553
+ "button",
1554
+ {
1555
+ type: "button",
1556
+ "aria-label": "Ver perfil",
1557
+ onClick: () => onClickProfile?.(valueProfile),
1558
+ className: "min-w-8 h-8 rounded-full bg-background-950"
1559
+ }
1560
+ ),
1561
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
1562
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
1563
+ /* @__PURE__ */ jsx9("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
1564
+ /* @__PURE__ */ jsxs7("p", { className: "text-xs text-text-600", children: [
1565
+ "\u2022 ",
1566
+ date,
1567
+ " \u2022 ",
1568
+ hour
1569
+ ] })
1570
+ ] }),
1571
+ /* @__PURE__ */ jsx9("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
1572
+ /* @__PURE__ */ jsxs7(
1573
+ "button",
1574
+ {
1575
+ type: "button",
1576
+ "aria-label": "Ver coment\xE1rios",
1577
+ onClick: () => onClickComments?.(valueComments),
1578
+ className: "text-text-600 flex flex-row gap-2 items-center",
1579
+ children: [
1580
+ /* @__PURE__ */ jsx9(ChatCircleText, { "aria-hidden": "true", size: 16 }),
1581
+ /* @__PURE__ */ jsxs7("p", { className: "text-xs", children: [
1582
+ comments,
1583
+ " respostas"
1584
+ ] })
1585
+ ]
1586
+ }
1587
+ )
1588
+ ] })
1589
+ ]
1590
+ }
1591
+ );
1592
+ }
1593
+ );
1594
+ var CardAudio = forwardRef(
1595
+ ({
1596
+ src,
1597
+ title,
1598
+ onPlay,
1599
+ onPause,
1600
+ onEnded,
1601
+ onAudioTimeUpdate,
1602
+ loop = false,
1603
+ preload = "metadata",
1604
+ tracks,
1605
+ className,
1606
+ ...props
1607
+ }, ref) => {
1608
+ const [isPlaying, setIsPlaying] = useState(false);
1609
+ const [currentTime, setCurrentTime] = useState(0);
1610
+ const [duration, setDuration] = useState(0);
1611
+ const [volume, setVolume] = useState(1);
1612
+ const [showVolumeControl, setShowVolumeControl] = useState(false);
1613
+ const [showSpeedMenu, setShowSpeedMenu] = useState(false);
1614
+ const [playbackRate, setPlaybackRate] = useState(1);
1615
+ const audioRef = useRef(null);
1616
+ const volumeControlRef = useRef(null);
1617
+ const speedMenuRef = useRef(null);
1618
+ const formatTime = (time) => {
1619
+ const minutes = Math.floor(time / 60);
1620
+ const seconds = Math.floor(time % 60);
1621
+ return `${minutes}:${seconds.toString().padStart(2, "0")}`;
1622
+ };
1623
+ const handlePlayPause = () => {
1624
+ if (isPlaying) {
1625
+ audioRef.current?.pause();
1626
+ setIsPlaying(false);
1627
+ onPause?.();
1628
+ } else {
1629
+ audioRef.current?.play();
1630
+ setIsPlaying(true);
1631
+ onPlay?.();
1632
+ }
1633
+ };
1634
+ const handleTimeUpdate = () => {
1635
+ const current = audioRef.current?.currentTime ?? 0;
1636
+ const total = audioRef.current?.duration ?? 0;
1637
+ setCurrentTime(current);
1638
+ setDuration(total);
1639
+ onAudioTimeUpdate?.(current, total);
1640
+ };
1641
+ const handleLoadedMetadata = () => {
1642
+ setDuration(audioRef.current?.duration ?? 0);
1643
+ };
1644
+ const handleEnded = () => {
1645
+ setIsPlaying(false);
1646
+ setCurrentTime(0);
1647
+ onEnded?.();
1648
+ };
1649
+ const handleProgressClick = (e) => {
1650
+ const rect = e.currentTarget.getBoundingClientRect();
1651
+ const clickX = e.clientX - rect.left;
1652
+ const width = rect.width;
1653
+ const percentage = clickX / width;
1654
+ const newTime = percentage * duration;
1655
+ if (audioRef.current) {
1656
+ audioRef.current.currentTime = newTime;
1657
+ }
1658
+ setCurrentTime(newTime);
1659
+ };
1660
+ const handleVolumeChange = (e) => {
1661
+ const newVolume = parseFloat(e.target.value);
1662
+ setVolume(newVolume);
1663
+ if (audioRef.current) {
1664
+ audioRef.current.volume = newVolume;
1665
+ }
1666
+ };
1667
+ const toggleVolumeControl = () => {
1668
+ setShowVolumeControl(!showVolumeControl);
1669
+ setShowSpeedMenu(false);
1670
+ };
1671
+ const toggleSpeedMenu = () => {
1672
+ setShowSpeedMenu(!showSpeedMenu);
1673
+ setShowVolumeControl(false);
1674
+ };
1675
+ const handleSpeedChange = (speed) => {
1676
+ setPlaybackRate(speed);
1677
+ if (audioRef.current) {
1678
+ audioRef.current.playbackRate = speed;
1679
+ }
1680
+ setShowSpeedMenu(false);
1681
+ };
1682
+ const getVolumeIcon = () => {
1683
+ if (volume === 0) {
1684
+ return /* @__PURE__ */ jsx9(SpeakerSimpleX, { size: 24 });
1685
+ }
1686
+ if (volume < 0.5) {
1687
+ return /* @__PURE__ */ jsx9(SpeakerLow, { size: 24 });
1688
+ }
1689
+ return /* @__PURE__ */ jsx9(SpeakerHigh, { size: 24 });
1690
+ };
1691
+ useEffect(() => {
1692
+ const handleClickOutside = (event) => {
1693
+ if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
1694
+ setShowVolumeControl(false);
1695
+ }
1696
+ if (speedMenuRef.current && !speedMenuRef.current.contains(event.target)) {
1697
+ setShowSpeedMenu(false);
1698
+ }
1699
+ };
1700
+ document.addEventListener("mousedown", handleClickOutside);
1701
+ return () => {
1702
+ document.removeEventListener("mousedown", handleClickOutside);
1703
+ };
1704
+ }, []);
1705
+ return /* @__PURE__ */ jsxs7(
1706
+ CardBase,
1707
+ {
1708
+ ref,
1709
+ layout: "horizontal",
1710
+ padding: "medium",
1711
+ minHeight: "none",
1712
+ className: cn(
1713
+ "flex flex-row w-auto h-14 items-center gap-2",
1714
+ className
1715
+ ),
1716
+ ...props,
1717
+ children: [
1718
+ /* @__PURE__ */ jsx9(
1719
+ "audio",
1720
+ {
1721
+ ref: audioRef,
1722
+ src,
1723
+ loop,
1724
+ preload,
1725
+ onTimeUpdate: handleTimeUpdate,
1726
+ onLoadedMetadata: handleLoadedMetadata,
1727
+ onEnded: handleEnded,
1728
+ "data-testid": "audio-element",
1729
+ "aria-label": title,
1730
+ children: tracks ? tracks.map((track) => /* @__PURE__ */ jsx9(
1731
+ "track",
1732
+ {
1733
+ kind: track.kind,
1734
+ src: track.src,
1735
+ srcLang: track.srcLang,
1736
+ label: track.label,
1737
+ default: track.default
1738
+ },
1739
+ track.src
1740
+ )) : /* @__PURE__ */ jsx9(
1741
+ "track",
1742
+ {
1743
+ kind: "captions",
1744
+ src: "data:text/vtt;base64,",
1745
+ srcLang: "pt",
1746
+ label: "Sem legendas dispon\xEDveis"
1747
+ }
1748
+ )
1749
+ }
1750
+ ),
1751
+ /* @__PURE__ */ jsx9(
1752
+ "button",
1753
+ {
1754
+ type: "button",
1755
+ onClick: handlePlayPause,
1756
+ disabled: !src,
1757
+ className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
1758
+ "aria-label": isPlaying ? "Pausar" : "Reproduzir",
1759
+ children: isPlaying ? /* @__PURE__ */ jsx9("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ jsxs7("div", { className: "flex gap-0.5", children: [
1760
+ /* @__PURE__ */ jsx9("div", { className: "w-1 h-4 bg-current rounded-sm" }),
1761
+ /* @__PURE__ */ jsx9("div", { className: "w-1 h-4 bg-current rounded-sm" })
1762
+ ] }) }) : /* @__PURE__ */ jsx9(Play, { size: 24 })
1763
+ }
1764
+ ),
1765
+ /* @__PURE__ */ jsx9("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(currentTime) }),
1766
+ /* @__PURE__ */ jsx9("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ jsx9(
1767
+ "button",
1768
+ {
1769
+ type: "button",
1770
+ className: "w-full h-2 bg-border-100 rounded-full cursor-pointer",
1771
+ onClick: handleProgressClick,
1772
+ onKeyDown: (e) => {
1773
+ if (e.key === "Enter" || e.key === " ") {
1774
+ e.preventDefault();
1775
+ handleProgressClick(
1776
+ e
1777
+ );
1778
+ }
1779
+ },
1780
+ "aria-label": "Barra de progresso do \xE1udio",
1781
+ children: /* @__PURE__ */ jsx9(
1782
+ "div",
1783
+ {
1784
+ className: "h-full bg-primary-600 rounded-full transition-all duration-100",
1785
+ style: {
1786
+ width: duration > 0 ? `${currentTime / duration * 100}%` : "0%"
1787
+ }
1788
+ }
1789
+ )
1790
+ }
1791
+ ) }),
1792
+ /* @__PURE__ */ jsx9("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(duration) }),
1793
+ /* @__PURE__ */ jsxs7("div", { className: "relative h-6", ref: volumeControlRef, children: [
1794
+ /* @__PURE__ */ jsx9(
1795
+ "button",
1796
+ {
1797
+ type: "button",
1798
+ onClick: toggleVolumeControl,
1799
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
1800
+ "aria-label": "Controle de volume",
1801
+ children: /* @__PURE__ */ jsx9("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
1802
+ }
1803
+ ),
1804
+ showVolumeControl && /* @__PURE__ */ jsx9(
1805
+ "button",
1806
+ {
1807
+ type: "button",
1808
+ className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
1809
+ onKeyDown: (e) => {
1810
+ if (e.key === "Escape") {
1811
+ setShowVolumeControl(false);
1812
+ }
1813
+ },
1814
+ children: /* @__PURE__ */ jsx9(
1815
+ "input",
1816
+ {
1817
+ type: "range",
1818
+ min: "0",
1819
+ max: "1",
1820
+ step: "0.1",
1821
+ value: volume,
1822
+ onChange: handleVolumeChange,
1823
+ onKeyDown: (e) => {
1824
+ if (e.key === "ArrowUp" || e.key === "ArrowRight") {
1825
+ e.preventDefault();
1826
+ const newVolume = Math.min(
1827
+ 1,
1828
+ Math.round((volume + 0.1) * 10) / 10
1829
+ );
1830
+ setVolume(newVolume);
1831
+ if (audioRef.current) audioRef.current.volume = newVolume;
1832
+ } else if (e.key === "ArrowDown" || e.key === "ArrowLeft") {
1833
+ e.preventDefault();
1834
+ const newVolume = Math.max(
1835
+ 0,
1836
+ Math.round((volume - 0.1) * 10) / 10
1837
+ );
1838
+ setVolume(newVolume);
1839
+ if (audioRef.current) audioRef.current.volume = newVolume;
1840
+ }
1841
+ },
1842
+ className: "w-20 h-2 bg-border-100 rounded-lg appearance-none cursor-pointer",
1843
+ style: {
1844
+ background: `linear-gradient(to right, #3b82f6 0%, #3b82f6 ${volume * 100}%, #e5e7eb ${volume * 100}%, #e5e7eb 100%)`
1845
+ },
1846
+ "aria-label": "Volume",
1847
+ "aria-valuenow": Math.round(volume * 100),
1848
+ "aria-valuemin": 0,
1849
+ "aria-valuemax": 100
1850
+ }
1851
+ )
1852
+ }
1853
+ )
1854
+ ] }),
1855
+ /* @__PURE__ */ jsxs7("div", { className: "relative h-6", ref: speedMenuRef, children: [
1856
+ /* @__PURE__ */ jsx9(
1857
+ "button",
1858
+ {
1859
+ type: "button",
1860
+ onClick: toggleSpeedMenu,
1861
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
1862
+ "aria-label": "Op\xE7\xF5es de velocidade",
1863
+ children: /* @__PURE__ */ jsx9(DotsThreeVertical, { size: 24 })
1864
+ }
1865
+ ),
1866
+ showSpeedMenu && /* @__PURE__ */ jsx9("div", { className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg min-w-24 z-10", children: /* @__PURE__ */ jsx9("div", { className: "flex flex-col gap-1", children: [
1867
+ { speed: 1, label: "1x" },
1868
+ { speed: 1.5, label: "1.5x" },
1869
+ { speed: 2, label: "2x" }
1870
+ ].map(({ speed, label }) => /* @__PURE__ */ jsx9(
1871
+ "button",
1872
+ {
1873
+ type: "button",
1874
+ onClick: () => handleSpeedChange(speed),
1875
+ className: cn(
1876
+ "px-3 py-1 text-sm text-left rounded hover:bg-border-50 transition-colors",
1877
+ playbackRate === speed ? "bg-primary-950 text-secondary-100 font-medium" : "text-text-950"
1878
+ ),
1879
+ children: label
1880
+ },
1881
+ speed
1882
+ )) }) })
1883
+ ] })
1884
+ ]
1885
+ }
1886
+ );
1887
+ }
1888
+ );
1889
+ var SIMULADO_BACKGROUND_CLASSES = {
1890
+ enem: "bg-exam-1",
1891
+ prova: "bg-exam-2",
1892
+ simuladao: "bg-exam-3",
1893
+ vestibular: "bg-exam-4"
1894
+ };
1895
+ var CardSimulado = forwardRef(
1896
+ ({ title, duration, info, backgroundColor, className, ...props }, ref) => {
1897
+ const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
1898
+ return /* @__PURE__ */ jsx9(
1899
+ CardBase,
1900
+ {
1901
+ ref,
1902
+ layout: "horizontal",
1903
+ padding: "medium",
1904
+ minHeight: "none",
1905
+ cursor: "pointer",
1906
+ className: cn(
1907
+ `${backgroundClass} hover:shadow-soft-shadow-2 transition-shadow duration-200`,
1908
+ className
1909
+ ),
1910
+ ...props,
1911
+ children: /* @__PURE__ */ jsxs7("div", { className: "flex justify-between items-center w-full gap-4", children: [
1912
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
1913
+ /* @__PURE__ */ jsx9(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
1914
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-4 text-text-700", children: [
1915
+ duration && /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-1", children: [
1916
+ /* @__PURE__ */ jsx9(Clock, { size: 16, className: "flex-shrink-0" }),
1917
+ /* @__PURE__ */ jsx9(Text_default, { size: "sm", children: duration })
1918
+ ] }),
1919
+ /* @__PURE__ */ jsx9(Text_default, { size: "sm", className: "truncate", children: info })
1920
+ ] })
1921
+ ] }),
1922
+ /* @__PURE__ */ jsx9(
1923
+ CaretRight,
1924
+ {
1925
+ size: 24,
1926
+ className: "text-text-800 flex-shrink-0",
1927
+ "data-testid": "caret-icon"
1928
+ }
1929
+ )
1930
+ ] })
1931
+ }
1932
+ );
1933
+ }
1934
+ );
1935
+ var CardTest = forwardRef(
1936
+ ({
1937
+ title,
1938
+ duration,
1939
+ questionsCount,
1940
+ additionalInfo,
1941
+ selected = false,
1942
+ onSelect,
1943
+ className = "",
1944
+ ...props
1945
+ }, ref) => {
1946
+ const handleClick = () => {
1947
+ if (onSelect) {
1948
+ onSelect(!selected);
1949
+ }
1950
+ };
1951
+ const handleKeyDown = (event) => {
1952
+ if ((event.key === "Enter" || event.key === " ") && onSelect) {
1953
+ event.preventDefault();
1954
+ onSelect(!selected);
1955
+ }
1956
+ };
1957
+ const isSelectable = !!onSelect;
1958
+ const getQuestionsText = (count) => {
1959
+ const singular = count === 1 ? "quest\xE3o" : "quest\xF5es";
1960
+ return `${count} ${singular}`;
1961
+ };
1962
+ const displayInfo = questionsCount ? getQuestionsText(questionsCount) : additionalInfo || "";
1963
+ const baseClasses = "flex flex-row items-center p-4 gap-2 w-full max-w-full bg-background shadow-soft-shadow-1 rounded-xl isolate border-0 text-left";
1964
+ const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
1965
+ const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
1966
+ if (isSelectable) {
1967
+ return /* @__PURE__ */ jsx9(
1968
+ "button",
1969
+ {
1970
+ ref,
1971
+ type: "button",
1972
+ className: cn(
1973
+ `${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim()
1974
+ ),
1975
+ onClick: handleClick,
1976
+ onKeyDown: handleKeyDown,
1977
+ "aria-pressed": selected,
1978
+ ...props,
1979
+ children: /* @__PURE__ */ jsxs7("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
1980
+ /* @__PURE__ */ jsx9(
1981
+ Text_default,
1982
+ {
1983
+ size: "md",
1984
+ weight: "bold",
1985
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
1986
+ children: title
1987
+ }
1988
+ ),
1989
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
1990
+ duration && /* @__PURE__ */ jsxs7("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
1991
+ /* @__PURE__ */ jsx9(Clock, { size: 16, className: "text-text-700" }),
1992
+ /* @__PURE__ */ jsx9(
1993
+ Text_default,
1994
+ {
1995
+ size: "sm",
1996
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
1997
+ children: duration
1998
+ }
1999
+ )
2000
+ ] }),
2001
+ /* @__PURE__ */ jsx9(
2002
+ Text_default,
2003
+ {
2004
+ size: "sm",
2005
+ className: "text-text-700 leading-[21px] flex-grow truncate",
2006
+ children: displayInfo
2007
+ }
2008
+ )
2009
+ ] })
2010
+ ] })
2011
+ }
2012
+ );
2013
+ }
2014
+ return /* @__PURE__ */ jsx9(
2015
+ "div",
2016
+ {
2017
+ ref,
2018
+ className: cn(`${baseClasses} ${className}`.trim()),
2019
+ ...props,
2020
+ children: /* @__PURE__ */ jsxs7("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
2021
+ /* @__PURE__ */ jsx9(
2022
+ Text_default,
2023
+ {
2024
+ size: "md",
2025
+ weight: "bold",
2026
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
2027
+ children: title
2028
+ }
2029
+ ),
2030
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
2031
+ duration && /* @__PURE__ */ jsxs7("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
2032
+ /* @__PURE__ */ jsx9(Clock, { size: 16, className: "text-text-700" }),
2033
+ /* @__PURE__ */ jsx9(
2034
+ Text_default,
2035
+ {
2036
+ size: "sm",
2037
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
2038
+ children: duration
2039
+ }
2040
+ )
2041
+ ] }),
2042
+ /* @__PURE__ */ jsx9(
2043
+ Text_default,
2044
+ {
2045
+ size: "sm",
2046
+ className: "text-text-700 leading-[21px] flex-grow truncate min-w-0",
2047
+ children: displayInfo
2048
+ }
2049
+ )
2050
+ ] })
2051
+ ] })
2052
+ }
2053
+ );
2054
+ }
2055
+ );
2056
+ var SIMULATION_TYPE_STYLES = {
2057
+ enem: {
2058
+ background: "bg-exam-1",
2059
+ badge: "exam1",
2060
+ text: "Enem"
2061
+ },
2062
+ prova: {
2063
+ background: "bg-exam-2",
2064
+ badge: "exam2",
2065
+ text: "Prova"
2066
+ },
2067
+ simulado: {
2068
+ background: "bg-exam-3",
2069
+ badge: "exam3",
2070
+ text: "Simulad\xE3o"
2071
+ },
2072
+ vestibular: {
2073
+ background: "bg-exam-4",
2074
+ badge: "exam4",
2075
+ text: "Vestibular"
2076
+ }
2077
+ };
2078
+ var CardSimulationHistory = forwardRef(({ data, onSimulationClick, className, ...props }, ref) => {
2079
+ return /* @__PURE__ */ jsx9(
2080
+ "div",
2081
+ {
2082
+ ref,
2083
+ className: cn("w-full max-w-[992px] h-auto", className),
2084
+ ...props,
2085
+ children: /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-0", children: [
2086
+ data.map((section, sectionIndex) => /* @__PURE__ */ jsx9("div", { className: "flex flex-col", children: /* @__PURE__ */ jsxs7(
2087
+ "div",
2088
+ {
2089
+ className: cn(
2090
+ "flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-background",
2091
+ sectionIndex === 0 ? "rounded-t-3xl" : ""
2092
+ ),
2093
+ children: [
2094
+ /* @__PURE__ */ jsx9(
2095
+ Text_default,
2096
+ {
2097
+ size: "xs",
2098
+ weight: "bold",
2099
+ className: "text-text-800 w-11 flex-shrink-0",
2100
+ children: section.date
2101
+ }
2102
+ ),
2103
+ /* @__PURE__ */ jsx9("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
2104
+ const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
2105
+ return /* @__PURE__ */ jsx9(
2106
+ CardBase,
2107
+ {
2108
+ layout: "horizontal",
2109
+ padding: "medium",
2110
+ minHeight: "none",
2111
+ cursor: "pointer",
2112
+ className: cn(
2113
+ `${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
2114
+ transition-shadow duration-200 h-auto min-h-[61px]`
2115
+ ),
2116
+ onClick: () => onSimulationClick?.(simulation),
2117
+ children: /* @__PURE__ */ jsxs7("div", { className: "flex justify-between items-center w-full gap-2", children: [
2118
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap flex-col justify-between sm:flex-row gap-2 flex-1 min-w-0", children: [
2119
+ /* @__PURE__ */ jsx9(
2120
+ Text_default,
2121
+ {
2122
+ size: "lg",
2123
+ weight: "bold",
2124
+ className: "text-text-950 truncate",
2125
+ children: simulation.title
2126
+ }
2127
+ ),
2128
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
2129
+ /* @__PURE__ */ jsx9(
2130
+ Badge_default,
2131
+ {
2132
+ variant: "examsOutlined",
2133
+ action: typeStyles.badge,
2134
+ size: "medium",
2135
+ children: typeStyles.text
2136
+ }
2137
+ ),
2138
+ /* @__PURE__ */ jsx9(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
2139
+ ] })
2140
+ ] }),
2141
+ /* @__PURE__ */ jsx9(
2142
+ CaretRight,
2143
+ {
2144
+ size: 24,
2145
+ className: "text-text-800 flex-shrink-0",
2146
+ "data-testid": "caret-icon"
2147
+ }
2148
+ )
2149
+ ] })
2150
+ },
2151
+ simulation.id
2152
+ );
2153
+ }) })
2154
+ ]
2155
+ }
2156
+ ) }, section.date)),
2157
+ data.length > 0 && /* @__PURE__ */ jsx9("div", { className: "w-full h-6 bg-background rounded-b-3xl" })
2158
+ ] })
2159
+ }
2160
+ );
2161
+ });
2162
+
2163
+ // src/components/Accordation/Accordation.tsx
2164
+ import { CaretRight as CaretRight2 } from "phosphor-react";
2165
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
2166
+ var CardAccordation = forwardRef2(
2167
+ ({
2168
+ trigger,
2169
+ children,
2170
+ className,
2171
+ defaultExpanded = false,
2172
+ expanded: controlledExpanded,
2173
+ onToggleExpanded,
2174
+ value,
2175
+ disabled = false,
2176
+ triggerClassName,
2177
+ contentClassName,
2178
+ ...props
2179
+ }, ref) => {
2180
+ const [internalExpanded, setInternalExpanded] = useState2(defaultExpanded);
2181
+ const generatedId = useId();
2182
+ const contentId = value ? `accordion-content-${value}` : generatedId;
2183
+ const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
2184
+ const isControlled = controlledExpanded !== void 0;
2185
+ const isExpanded = isControlled ? controlledExpanded : internalExpanded;
2186
+ useEffect2(() => {
2187
+ if (isControlled) {
2188
+ setInternalExpanded(controlledExpanded);
2189
+ }
2190
+ }, [isControlled, controlledExpanded]);
2191
+ const handleToggle = () => {
2192
+ if (disabled) return;
2193
+ const newExpanded = !isExpanded;
2194
+ if (!isControlled) {
2195
+ setInternalExpanded(newExpanded);
2196
+ }
2197
+ onToggleExpanded?.(newExpanded);
2198
+ };
2199
+ const handleKeyDown = (event) => {
2200
+ if (disabled) return;
2201
+ if (event.key === "Enter" || event.key === " ") {
2202
+ event.preventDefault();
2203
+ handleToggle();
2204
+ }
2205
+ };
2206
+ return /* @__PURE__ */ jsxs8(
2207
+ CardBase,
2208
+ {
2209
+ ref,
2210
+ layout: "vertical",
2211
+ padding: "none",
2212
+ minHeight: "none",
2213
+ className: cn("overflow-hidden", className),
2214
+ ...props,
2215
+ children: [
2216
+ /* @__PURE__ */ jsxs8(
2217
+ "button",
2218
+ {
2219
+ id: headerId,
2220
+ type: "button",
2221
+ onClick: handleToggle,
2222
+ onKeyDown: handleKeyDown,
2223
+ disabled,
2224
+ className: cn(
2225
+ "w-full cursor-pointer not-aria-expanded:rounded-xl aria-expanded:rounded-t-xl flex items-center justify-between gap-3 text-left transition-colors duration-200 focus:outline-none focus:border-2 focus:border-primary-950 focus:ring-inset px-2",
2226
+ disabled && "cursor-not-allowed text-text-400",
2227
+ triggerClassName
2228
+ ),
2229
+ "aria-expanded": isExpanded,
2230
+ "aria-controls": contentId,
2231
+ "aria-disabled": disabled,
2232
+ "data-value": value,
2233
+ children: [
2234
+ trigger,
2235
+ /* @__PURE__ */ jsx10(
2236
+ CaretRight2,
2237
+ {
2238
+ size: 20,
2239
+ className: cn(
2240
+ "transition-transform duration-200 flex-shrink-0",
2241
+ disabled ? "text-gray-400" : "text-text-700",
2242
+ isExpanded ? "rotate-90" : "rotate-0"
2243
+ ),
2244
+ "data-testid": "accordion-caret"
2245
+ }
2246
+ )
2247
+ ]
2248
+ }
2249
+ ),
2250
+ /* @__PURE__ */ jsx10(
2251
+ "section",
2252
+ {
2253
+ id: contentId,
2254
+ "aria-labelledby": headerId,
2255
+ "aria-hidden": !isExpanded,
2256
+ className: cn(
2257
+ "transition-all duration-300 ease-in-out overflow-hidden",
2258
+ isExpanded ? "max-h-screen opacity-100" : "max-h-0 opacity-0"
2259
+ ),
2260
+ "data-testid": "accordion-content",
2261
+ "data-value": value,
2262
+ children: /* @__PURE__ */ jsx10("div", { className: cn("p-4 pt-0", contentClassName), children })
2263
+ }
2264
+ )
2265
+ ]
2266
+ }
2267
+ );
2268
+ }
2269
+ );
2270
+ CardAccordation.displayName = "CardAccordation";
2271
+
2272
+ // src/components/CheckBox/CheckBox.tsx
2273
+ import {
2274
+ forwardRef as forwardRef3,
2275
+ useState as useState3,
2276
+ useId as useId2
2277
+ } from "react";
2278
+ import { Check, Minus } from "phosphor-react";
2279
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
2280
+ var SIZE_CLASSES4 = {
2281
+ small: {
2282
+ checkbox: "w-4 h-4",
2283
+ // 16px x 16px
2284
+ textSize: "sm",
2285
+ spacing: "gap-1.5",
2286
+ // 6px
2287
+ borderWidth: "border-2",
2288
+ iconSize: 14,
2289
+ // pixels for Phosphor icons
2290
+ labelHeight: "h-[21px]"
2291
+ },
2292
+ medium: {
2293
+ checkbox: "w-5 h-5",
2294
+ // 20px x 20px
2295
+ textSize: "md",
2296
+ spacing: "gap-2",
2297
+ // 8px
2298
+ borderWidth: "border-2",
2299
+ iconSize: 16,
2300
+ // pixels for Phosphor icons
2301
+ labelHeight: "h-6"
2302
+ },
2303
+ large: {
2304
+ checkbox: "w-6 h-6",
2305
+ // 24px x 24px
2306
+ textSize: "lg",
2307
+ spacing: "gap-2",
2308
+ // 8px
2309
+ borderWidth: "border-[3px]",
2310
+ // 3px border
2311
+ iconSize: 20,
2312
+ // pixels for Phosphor icons
2313
+ labelHeight: "h-[27px]"
2314
+ }
2315
+ };
2316
+ var BASE_CHECKBOX_CLASSES = "rounded border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
2317
+ var STATE_CLASSES = {
2318
+ default: {
2319
+ unchecked: "border-border-400 bg-background hover:border-border-500",
2320
+ checked: "border-primary-950 bg-primary-950 text-text hover:border-primary-800 hover:bg-primary-800"
2321
+ },
2322
+ hovered: {
2323
+ unchecked: "border-border-500 bg-background",
2324
+ checked: "border-primary-800 bg-primary-800 text-text"
2325
+ },
2326
+ focused: {
2327
+ unchecked: "border-indicator-info bg-background ring-2 ring-indicator-info/20",
2328
+ checked: "border-indicator-info bg-primary-950 text-text ring-2 ring-indicator-info/20"
2329
+ },
2330
+ invalid: {
2331
+ unchecked: "border-error-700 bg-background hover:border-error-600",
2332
+ checked: "border-error-700 bg-primary-950 text-text"
2333
+ },
2334
+ disabled: {
2335
+ unchecked: "border-border-400 bg-background cursor-not-allowed opacity-40",
2336
+ checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
2337
+ }
2338
+ };
2339
+ var CheckBox = forwardRef3(
2340
+ ({
2341
+ label,
2342
+ size = "medium",
2343
+ state = "default",
2344
+ indeterminate = false,
2345
+ errorMessage,
2346
+ helperText,
2347
+ className = "",
2348
+ labelClassName = "",
2349
+ checked: checkedProp,
2350
+ disabled,
2351
+ id,
2352
+ onChange,
2353
+ ...props
2354
+ }, ref) => {
2355
+ const generatedId = useId2();
2356
+ const inputId = id ?? `checkbox-${generatedId}`;
2357
+ const [internalChecked, setInternalChecked] = useState3(false);
2358
+ const isControlled = checkedProp !== void 0;
2359
+ const checked = isControlled ? checkedProp : internalChecked;
2360
+ const handleChange = (event) => {
2361
+ if (!isControlled) {
2362
+ setInternalChecked(event.target.checked);
2363
+ }
2364
+ onChange?.(event);
2365
+ };
2366
+ const currentState = disabled ? "disabled" : state;
2367
+ const sizeClasses = SIZE_CLASSES4[size];
2368
+ const checkVariant = checked || indeterminate ? "checked" : "unchecked";
2369
+ const stylingClasses = STATE_CLASSES[currentState][checkVariant];
2370
+ const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
2371
+ const checkboxClasses = cn(
2372
+ BASE_CHECKBOX_CLASSES,
2373
+ sizeClasses.checkbox,
2374
+ borderWidthClass,
2375
+ stylingClasses,
2376
+ className
2377
+ );
2378
+ const renderIcon = () => {
2379
+ if (indeterminate) {
2380
+ return /* @__PURE__ */ jsx11(
2381
+ Minus,
2382
+ {
2383
+ size: sizeClasses.iconSize,
2384
+ weight: "bold",
2385
+ color: "currentColor"
2386
+ }
2387
+ );
2388
+ }
2389
+ if (checked) {
2390
+ return /* @__PURE__ */ jsx11(
2391
+ Check,
2392
+ {
2393
+ size: sizeClasses.iconSize,
2394
+ weight: "bold",
2395
+ color: "currentColor"
2396
+ }
2397
+ );
2398
+ }
2399
+ return null;
2400
+ };
2401
+ return /* @__PURE__ */ jsxs9("div", { className: "flex flex-col", children: [
2402
+ /* @__PURE__ */ jsxs9(
2403
+ "div",
2404
+ {
2405
+ className: cn(
2406
+ "flex flex-row items-center",
2407
+ sizeClasses.spacing,
2408
+ disabled ? "opacity-40" : ""
2409
+ ),
2410
+ children: [
2411
+ /* @__PURE__ */ jsx11(
2412
+ "input",
2413
+ {
2414
+ ref,
2415
+ type: "checkbox",
2416
+ id: inputId,
2417
+ checked,
2418
+ disabled,
2419
+ onChange: handleChange,
2420
+ className: "sr-only",
2421
+ ...props
2422
+ }
2423
+ ),
2424
+ /* @__PURE__ */ jsx11("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
2425
+ label && /* @__PURE__ */ jsx11(
2426
+ "div",
2427
+ {
2428
+ className: cn(
2429
+ "flex flex-row items-center",
2430
+ sizeClasses.labelHeight
2431
+ ),
2432
+ children: /* @__PURE__ */ jsx11(
2433
+ Text_default,
2434
+ {
2435
+ as: "label",
2436
+ htmlFor: inputId,
2437
+ size: sizeClasses.textSize,
2438
+ weight: "normal",
2439
+ className: cn(
2440
+ "cursor-pointer select-none leading-[150%] flex items-center font-roboto",
2441
+ labelClassName
2442
+ ),
2443
+ children: label
2444
+ }
2445
+ )
2446
+ }
2447
+ )
2448
+ ]
2449
+ }
2450
+ ),
2451
+ errorMessage && /* @__PURE__ */ jsx11(
2452
+ Text_default,
2453
+ {
2454
+ size: "sm",
2455
+ weight: "normal",
2456
+ className: "mt-1.5",
2457
+ color: "text-error-600",
2458
+ children: errorMessage
2459
+ }
2460
+ ),
2461
+ helperText && !errorMessage && /* @__PURE__ */ jsx11(
2462
+ Text_default,
2463
+ {
2464
+ size: "sm",
2465
+ weight: "normal",
2466
+ className: "mt-1.5",
2467
+ color: "text-text-500",
2468
+ children: helperText
2469
+ }
2470
+ )
2471
+ ] });
2472
+ }
2473
+ );
2474
+ CheckBox.displayName = "CheckBox";
2475
+ var CheckBox_default = CheckBox;
2476
+
2477
+ // src/components/CheckBox/CheckboxList.tsx
2478
+ import {
2479
+ forwardRef as forwardRef4,
2480
+ useId as useId3,
2481
+ useEffect as useEffect3,
2482
+ useRef as useRef2,
2483
+ Children,
2484
+ cloneElement as cloneElement2,
2485
+ isValidElement
2486
+ } from "react";
2487
+ import { create, useStore } from "zustand";
2488
+ import { jsx as jsx12 } from "react/jsx-runtime";
2489
+ var createCheckboxListStore = (name, defaultValues, disabled, onValuesChange) => create((set, get) => ({
2490
+ values: defaultValues,
2491
+ setValues: (values) => {
2492
+ if (!get().disabled) {
2493
+ set({ values });
2494
+ get().onValuesChange?.(values);
2495
+ }
2496
+ },
2497
+ toggleValue: (value) => {
2498
+ if (!get().disabled) {
2499
+ const currentValues = get().values;
2500
+ const newValues = currentValues.includes(value) ? currentValues.filter((v) => v !== value) : [...currentValues, value];
2501
+ set({ values: newValues });
2502
+ get().onValuesChange?.(newValues);
2503
+ }
2504
+ },
2505
+ onValuesChange,
2506
+ disabled,
2507
+ name
2508
+ }));
2509
+ var useCheckboxListStore = (externalStore) => {
2510
+ if (!externalStore) {
2511
+ throw new Error("CheckboxListItem must be used within a CheckboxList");
2512
+ }
2513
+ return externalStore;
2514
+ };
2515
+ var injectStore = (children, store) => Children.map(children, (child) => {
2516
+ if (!isValidElement(child)) return child;
2517
+ const typedChild = child;
2518
+ const shouldInject = typedChild.type === CheckboxListItem;
2519
+ return cloneElement2(typedChild, {
2520
+ ...shouldInject ? { store } : {},
2521
+ ...typedChild.props.children ? { children: injectStore(typedChild.props.children, store) } : {}
2522
+ });
2523
+ });
2524
+ var CheckboxList = forwardRef4(
2525
+ ({
2526
+ values: propValues,
2527
+ defaultValues = [],
2528
+ onValuesChange,
2529
+ name: propName,
2530
+ disabled = false,
2531
+ className = "",
2532
+ children,
2533
+ ...props
2534
+ }, ref) => {
2535
+ const generatedId = useId3();
2536
+ const name = propName || `checkbox-list-${generatedId}`;
2537
+ const storeRef = useRef2(null);
2538
+ storeRef.current ??= createCheckboxListStore(
2539
+ name,
2540
+ defaultValues,
2541
+ disabled,
2542
+ onValuesChange
2543
+ );
2544
+ const store = storeRef.current;
2545
+ const { setValues } = useStore(store, (s) => s);
2546
+ useEffect3(() => {
2547
+ const currentValues = store.getState().values;
2548
+ if (currentValues.length > 0 && onValuesChange) {
2549
+ onValuesChange(currentValues);
2550
+ }
2551
+ }, []);
2552
+ useEffect3(() => {
2553
+ if (propValues !== void 0) {
2554
+ setValues(propValues);
2555
+ }
2556
+ }, [propValues, setValues]);
2557
+ useEffect3(() => {
2558
+ store.setState({ disabled });
2559
+ }, [disabled, store]);
2560
+ return /* @__PURE__ */ jsx12(
2561
+ "div",
2562
+ {
2563
+ ref,
2564
+ className: cn("flex flex-col gap-2 w-full", className),
2565
+ "aria-label": name,
2566
+ ...props,
2567
+ children: injectStore(children, store)
2568
+ }
2569
+ );
2570
+ }
2571
+ );
2572
+ CheckboxList.displayName = "CheckboxList";
2573
+ var CheckboxListItem = forwardRef4(
2574
+ ({
2575
+ value,
2576
+ store: externalStore,
2577
+ disabled: itemDisabled,
2578
+ size = "medium",
2579
+ state = "default",
2580
+ className = "",
2581
+ id,
2582
+ ...props
2583
+ }, ref) => {
2584
+ const store = useCheckboxListStore(externalStore);
2585
+ const {
2586
+ values: groupValues,
2587
+ toggleValue,
2588
+ disabled: groupDisabled,
2589
+ name
2590
+ } = useStore(store);
2591
+ const generatedId = useId3();
2592
+ const inputId = id ?? `checkbox-item-${generatedId}`;
2593
+ const isChecked = groupValues.includes(value);
2594
+ const isDisabled = groupDisabled || itemDisabled;
2595
+ const currentState = isDisabled ? "disabled" : state;
2596
+ return /* @__PURE__ */ jsx12(
2597
+ CheckBox_default,
2598
+ {
2599
+ ref,
2600
+ id: inputId,
2601
+ name,
2602
+ value,
2603
+ checked: isChecked,
2604
+ disabled: isDisabled,
2605
+ size,
2606
+ state: currentState,
2607
+ className,
2608
+ onChange: () => {
2609
+ if (!isDisabled) {
2610
+ toggleValue(value);
2611
+ }
2612
+ },
2613
+ ...props
2614
+ }
2615
+ );
2616
+ }
2617
+ );
2618
+ CheckboxListItem.displayName = "CheckboxListItem";
2619
+ var CheckboxList_default = CheckboxList;
2620
+
2621
+ // src/components/Radio/Radio.tsx
2622
+ import {
2623
+ forwardRef as forwardRef5,
2624
+ useState as useState4,
2625
+ useId as useId4,
2626
+ useEffect as useEffect4,
2627
+ useRef as useRef3,
2628
+ Children as Children2,
2629
+ cloneElement as cloneElement3,
2630
+ isValidElement as isValidElement2
2631
+ } from "react";
2632
+ import { create as create2, useStore as useStore2 } from "zustand";
2633
+ import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
2634
+ var SIZE_CLASSES5 = {
2635
+ small: {
2636
+ radio: "w-5 h-5",
2637
+ textSize: "sm",
2638
+ spacing: "gap-1.5",
2639
+ borderWidth: "border-2",
2640
+ dotSize: "w-2.5 h-2.5",
2641
+ labelHeight: "h-5"
2642
+ },
2643
+ medium: {
2644
+ radio: "w-6 h-6",
2645
+ textSize: "md",
2646
+ spacing: "gap-2",
2647
+ borderWidth: "border-2",
2648
+ dotSize: "w-3 h-3",
2649
+ labelHeight: "h-6"
2650
+ },
2651
+ large: {
2652
+ radio: "w-7 h-7",
2653
+ textSize: "lg",
2654
+ spacing: "gap-2",
2655
+ borderWidth: "border-2",
2656
+ dotSize: "w-3.5 h-3.5",
2657
+ labelHeight: "h-7"
2658
+ },
2659
+ extraLarge: {
2660
+ radio: "w-8 h-8",
2661
+ textSize: "xl",
2662
+ spacing: "gap-3",
2663
+ borderWidth: "border-2",
2664
+ dotSize: "w-4 h-4",
2665
+ labelHeight: "h-8"
2666
+ }
2667
+ };
2668
+ var BASE_RADIO_CLASSES = "rounded-full border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
2669
+ var STATE_CLASSES2 = {
2670
+ default: {
2671
+ unchecked: "border-border-400 bg-background hover:border-border-500",
2672
+ checked: "border-primary-950 bg-background hover:border-primary-800"
2673
+ },
2674
+ hovered: {
2675
+ unchecked: "border-border-500 bg-background",
2676
+ checked: "border-info-700 bg-background"
2677
+ },
2678
+ focused: {
2679
+ unchecked: "border-border-400 bg-background",
2680
+ checked: "border-primary-950 bg-background"
2681
+ },
2682
+ invalid: {
2683
+ unchecked: "border-border-400 bg-background",
2684
+ checked: "border-primary-950 bg-background"
2685
+ },
2686
+ disabled: {
2687
+ unchecked: "border-border-400 bg-background cursor-not-allowed",
2688
+ checked: "border-primary-950 bg-background cursor-not-allowed"
2689
+ }
2690
+ };
2691
+ var DOT_CLASSES = {
2692
+ default: "bg-primary-950",
2693
+ hovered: "bg-info-700",
2694
+ focused: "bg-primary-950",
2695
+ invalid: "bg-primary-950",
2696
+ disabled: "bg-primary-950"
2697
+ };
2698
+ var Radio = forwardRef5(
2699
+ ({
2700
+ label,
2701
+ size = "medium",
2702
+ state = "default",
2703
+ errorMessage,
2704
+ helperText,
2705
+ className = "",
2706
+ labelClassName = "",
2707
+ checked: checkedProp,
2708
+ defaultChecked = false,
2709
+ disabled,
2710
+ id,
2711
+ name,
2712
+ value,
2713
+ onChange,
2714
+ ...props
2715
+ }, ref) => {
2716
+ const generatedId = useId4();
2717
+ const inputId = id ?? `radio-${generatedId}`;
2718
+ const inputRef = useRef3(null);
2719
+ const [internalChecked, setInternalChecked] = useState4(defaultChecked);
2720
+ const isControlled = checkedProp !== void 0;
2721
+ const checked = isControlled ? checkedProp : internalChecked;
2722
+ const handleChange = (event) => {
2723
+ const newChecked = event.target.checked;
2724
+ if (!isControlled) {
2725
+ setInternalChecked(newChecked);
2726
+ }
2727
+ if (event.target) {
2728
+ event.target.blur();
2729
+ }
2730
+ onChange?.(event);
2731
+ };
2732
+ const currentState = disabled ? "disabled" : state;
2733
+ const sizeClasses = SIZE_CLASSES5[size];
2734
+ const actualRadioSize = sizeClasses.radio;
2735
+ const actualDotSize = sizeClasses.dotSize;
2736
+ const radioVariant = checked ? "checked" : "unchecked";
2737
+ const stylingClasses = STATE_CLASSES2[currentState][radioVariant];
2738
+ const getBorderWidth = () => {
2739
+ if (currentState === "focused") {
2740
+ return "border-2";
2741
+ }
2742
+ return sizeClasses.borderWidth;
2743
+ };
2744
+ const borderWidthClass = getBorderWidth();
2745
+ const radioClasses = cn(
2746
+ BASE_RADIO_CLASSES,
2747
+ actualRadioSize,
2748
+ borderWidthClass,
2749
+ stylingClasses,
2750
+ className
2751
+ );
2752
+ const dotClasses = cn(
2753
+ actualDotSize,
2754
+ "rounded-full",
2755
+ DOT_CLASSES[currentState],
2756
+ "transition-all duration-200"
2757
+ );
2758
+ const isWrapperNeeded = currentState === "focused" || currentState === "invalid";
2759
+ const wrapperBorderColor = currentState === "focused" ? "border-indicator-info" : "border-indicator-error";
2760
+ const getTextColor = () => {
2761
+ if (currentState === "disabled") {
2762
+ return checked ? "text-text-900" : "text-text-600";
2763
+ }
2764
+ if (currentState === "focused") {
2765
+ return "text-text-900";
2766
+ }
2767
+ return checked ? "text-text-900" : "text-text-600";
2768
+ };
2769
+ const getCursorClass = () => {
2770
+ return currentState === "disabled" ? "cursor-not-allowed" : "cursor-pointer";
2771
+ };
2772
+ return /* @__PURE__ */ jsxs10("div", { className: "flex flex-col", children: [
2773
+ /* @__PURE__ */ jsxs10(
2774
+ "div",
2775
+ {
2776
+ className: cn(
2777
+ "flex flex-row items-center",
2778
+ isWrapperNeeded ? cn("p-1 border-2", wrapperBorderColor, "rounded-lg gap-1.5") : sizeClasses.spacing,
2779
+ disabled ? "opacity-40" : ""
2780
+ ),
2781
+ children: [
2782
+ /* @__PURE__ */ jsx13(
2783
+ "input",
2784
+ {
2785
+ ref: (node) => {
2786
+ inputRef.current = node;
2787
+ if (typeof ref === "function") ref(node);
2788
+ else if (ref) ref.current = node;
2789
+ },
2790
+ type: "radio",
2791
+ id: inputId,
2792
+ checked,
2793
+ disabled,
2794
+ name,
2795
+ value,
2796
+ onChange: handleChange,
2797
+ className: "sr-only",
2798
+ style: {
2799
+ position: "absolute",
2800
+ left: "-9999px",
2801
+ visibility: "hidden"
2802
+ },
2803
+ ...props
2804
+ }
2805
+ ),
2806
+ /* @__PURE__ */ jsx13(
2807
+ "button",
2808
+ {
2809
+ type: "button",
2810
+ className: radioClasses,
2811
+ disabled,
2812
+ "aria-pressed": checked,
2813
+ onClick: (e) => {
2814
+ e.preventDefault();
2815
+ if (!disabled) {
2816
+ if (inputRef.current) {
2817
+ inputRef.current.click();
2818
+ inputRef.current.blur();
2819
+ }
2820
+ }
2821
+ },
2822
+ onKeyDown: (e) => {
2823
+ if ((e.key === "Enter" || e.key === " ") && !disabled) {
2824
+ e.preventDefault();
2825
+ if (inputRef.current) {
2826
+ inputRef.current.click();
2827
+ inputRef.current.blur();
2828
+ }
2829
+ }
2830
+ },
2831
+ children: checked && /* @__PURE__ */ jsx13("div", { className: dotClasses })
2832
+ }
2833
+ ),
2834
+ label && /* @__PURE__ */ jsx13(
2835
+ "div",
2836
+ {
2837
+ className: cn(
2838
+ "flex flex-row items-center",
2839
+ sizeClasses.labelHeight,
2840
+ "flex-1 min-w-0"
2841
+ ),
2842
+ children: /* @__PURE__ */ jsx13(
2843
+ Text_default,
2844
+ {
2845
+ as: "label",
2846
+ htmlFor: inputId,
2847
+ size: sizeClasses.textSize,
2848
+ weight: "normal",
2849
+ className: cn(
2850
+ getCursorClass(),
2851
+ "select-none leading-normal flex items-center font-roboto truncate",
2852
+ labelClassName
2853
+ ),
2854
+ color: getTextColor(),
2855
+ children: label
2856
+ }
2857
+ )
2858
+ }
2859
+ )
2860
+ ]
2861
+ }
2862
+ ),
2863
+ errorMessage && /* @__PURE__ */ jsx13(
2864
+ Text_default,
2865
+ {
2866
+ size: "sm",
2867
+ weight: "normal",
2868
+ className: "mt-1.5 truncate",
2869
+ color: "text-error-600",
2870
+ children: errorMessage
2871
+ }
2872
+ ),
2873
+ helperText && !errorMessage && /* @__PURE__ */ jsx13(
2874
+ Text_default,
2875
+ {
2876
+ size: "sm",
2877
+ weight: "normal",
2878
+ className: "mt-1.5 truncate",
2879
+ color: "text-text-500",
2880
+ children: helperText
2881
+ }
2882
+ )
2883
+ ] });
2884
+ }
2885
+ );
2886
+ Radio.displayName = "Radio";
2887
+ var createRadioGroupStore = (name, defaultValue, disabled, onValueChange) => create2((set, get) => ({
2888
+ value: defaultValue,
2889
+ setValue: (value) => {
2890
+ if (!get().disabled) {
2891
+ set({ value });
2892
+ get().onValueChange?.(value);
2893
+ }
2894
+ },
2895
+ onValueChange,
2896
+ disabled,
2897
+ name
2898
+ }));
2899
+ var useRadioGroupStore = (externalStore) => {
2900
+ if (!externalStore) {
2901
+ throw new Error("RadioGroupItem must be used within a RadioGroup");
2902
+ }
2903
+ return externalStore;
2904
+ };
2905
+ var injectStore2 = (children, store) => Children2.map(children, (child) => {
2906
+ if (!isValidElement2(child)) return child;
2907
+ const typedChild = child;
2908
+ const shouldInject = typedChild.type === RadioGroupItem;
2909
+ return cloneElement3(typedChild, {
2910
+ ...shouldInject ? { store } : {},
2911
+ ...typedChild.props.children ? { children: injectStore2(typedChild.props.children, store) } : {}
2912
+ });
2913
+ });
2914
+ var RadioGroup = forwardRef5(
2915
+ ({
2916
+ value: propValue,
2917
+ defaultValue = "",
2918
+ onValueChange,
2919
+ name: propName,
2920
+ disabled = false,
2921
+ className = "",
2922
+ children,
2923
+ ...props
2924
+ }, ref) => {
2925
+ const generatedId = useId4();
2926
+ const name = propName || `radio-group-${generatedId}`;
2927
+ const storeRef = useRef3(null);
2928
+ storeRef.current ??= createRadioGroupStore(
2929
+ name,
2930
+ defaultValue,
2931
+ disabled,
2932
+ onValueChange
2933
+ );
2934
+ const store = storeRef.current;
2935
+ const { setValue } = useStore2(store, (s) => s);
2936
+ useEffect4(() => {
2937
+ const currentValue = store.getState().value;
2938
+ if (currentValue && onValueChange) {
2939
+ onValueChange(currentValue);
2940
+ }
2941
+ }, []);
2942
+ useEffect4(() => {
2943
+ if (propValue !== void 0) {
2944
+ setValue(propValue);
2945
+ }
2946
+ }, [propValue, setValue]);
2947
+ useEffect4(() => {
2948
+ store.setState({ disabled });
2949
+ }, [disabled, store]);
2950
+ return /* @__PURE__ */ jsx13(
2951
+ "div",
2952
+ {
2953
+ ref,
2954
+ className,
2955
+ role: "radiogroup",
2956
+ "aria-label": name,
2957
+ ...props,
2958
+ children: injectStore2(children, store)
2959
+ }
2960
+ );
2961
+ }
2962
+ );
2963
+ RadioGroup.displayName = "RadioGroup";
2964
+ var RadioGroupItem = forwardRef5(
2965
+ ({
2966
+ value,
2967
+ store: externalStore,
2968
+ disabled: itemDisabled,
2969
+ size = "medium",
2970
+ state = "default",
2971
+ className = "",
2972
+ id,
2973
+ ...props
2974
+ }, ref) => {
2975
+ const store = useRadioGroupStore(externalStore);
2976
+ const {
2977
+ value: groupValue,
2978
+ setValue,
2979
+ disabled: groupDisabled,
2980
+ name
2981
+ } = useStore2(store);
2982
+ const generatedId = useId4();
2983
+ const inputId = id ?? `radio-item-${generatedId}`;
2984
+ const isChecked = groupValue === value;
2985
+ const isDisabled = groupDisabled || itemDisabled;
2986
+ const currentState = isDisabled ? "disabled" : state;
2987
+ return /* @__PURE__ */ jsx13(
2988
+ Radio,
2989
+ {
2990
+ ref,
2991
+ id: inputId,
2992
+ name,
2993
+ value,
2994
+ checked: isChecked,
2995
+ disabled: isDisabled,
2996
+ size,
2997
+ state: currentState,
2998
+ className,
2999
+ onChange: (e) => {
3000
+ if (e.target.checked && !isDisabled) {
3001
+ setValue(value);
3002
+ }
3003
+ },
3004
+ ...props
3005
+ }
3006
+ );
3007
+ }
3008
+ );
3009
+ RadioGroupItem.displayName = "RadioGroupItem";
3010
+
3011
+ // src/components/Alternative/Alternative.tsx
3012
+ import { CheckCircle as CheckCircle2, XCircle as XCircle2 } from "phosphor-react";
3013
+ import { forwardRef as forwardRef6, useId as useId5, useState as useState5 } from "react";
3014
+ import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
3015
+ var AlternativesList = ({
3016
+ alternatives,
3017
+ name,
3018
+ defaultValue,
3019
+ value,
3020
+ onValueChange,
3021
+ disabled = false,
3022
+ layout = "default",
3023
+ className = "",
3024
+ mode = "interactive",
3025
+ selectedValue
3026
+ }) => {
3027
+ const uniqueId = useId5();
3028
+ const groupName = name || `alternatives-${uniqueId}`;
3029
+ const [actualValue, setActualValue] = useState5(value);
3030
+ const isReadonly = mode === "readonly";
3031
+ const getStatusStyles = (status, isReadonly2) => {
3032
+ const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
3033
+ switch (status) {
3034
+ case "correct":
3035
+ return "bg-success-background border-success-300";
3036
+ case "incorrect":
3037
+ return "bg-error-background border-error-300";
3038
+ default:
3039
+ return `bg-background border-border-100 ${hoverClass}`;
3040
+ }
3041
+ };
3042
+ const getStatusBadge = (status) => {
3043
+ switch (status) {
3044
+ case "correct":
3045
+ return /* @__PURE__ */ jsx14(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx14(CheckCircle2, {}), children: "Resposta correta" });
3046
+ case "incorrect":
3047
+ return /* @__PURE__ */ jsx14(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx14(XCircle2, {}), children: "Resposta incorreta" });
3048
+ default:
3049
+ return null;
3050
+ }
3051
+ };
3052
+ const getLayoutClasses = () => {
3053
+ switch (layout) {
3054
+ case "compact":
3055
+ return "gap-2";
3056
+ case "detailed":
3057
+ return "gap-4";
3058
+ default:
3059
+ return "gap-3.5";
3060
+ }
3061
+ };
3062
+ const renderReadonlyAlternative = (alternative) => {
3063
+ const alternativeId = alternative.value;
3064
+ const isUserSelected = selectedValue === alternative.value;
3065
+ const isCorrectAnswer = alternative.status === "correct";
3066
+ let displayStatus = void 0;
3067
+ if (isUserSelected && !isCorrectAnswer) {
3068
+ displayStatus = "incorrect";
3069
+ } else if (isCorrectAnswer) {
3070
+ displayStatus = "correct";
3071
+ }
3072
+ const statusStyles = getStatusStyles(displayStatus, true);
3073
+ const statusBadge = getStatusBadge(displayStatus);
3074
+ const renderRadio = () => {
3075
+ const radioClasses = `w-6 h-6 rounded-full border-2 cursor-default transition-all duration-200 flex items-center justify-center ${isUserSelected ? "border-primary-950 bg-background" : "border-border-400 bg-background"}`;
3076
+ const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
3077
+ return /* @__PURE__ */ jsx14("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ jsx14("div", { className: dotClasses }) });
3078
+ };
3079
+ if (layout === "detailed") {
3080
+ return /* @__PURE__ */ jsx14(
3081
+ "div",
3082
+ {
3083
+ className: cn(
3084
+ "border-2 rounded-lg p-4 w-full",
3085
+ statusStyles,
3086
+ alternative.disabled ? "opacity-50" : ""
3087
+ ),
3088
+ children: /* @__PURE__ */ jsxs11("div", { className: "flex items-start justify-between gap-3", children: [
3089
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-start gap-3 flex-1", children: [
3090
+ /* @__PURE__ */ jsx14("div", { className: "mt-1", children: renderRadio() }),
3091
+ /* @__PURE__ */ jsxs11("div", { className: "flex-1", children: [
3092
+ /* @__PURE__ */ jsx14(
3093
+ "p",
3094
+ {
3095
+ className: cn(
3096
+ "block font-medium",
3097
+ selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
3098
+ ),
3099
+ children: alternative.label
3100
+ }
3101
+ ),
3102
+ alternative.description && /* @__PURE__ */ jsx14("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
3103
+ ] })
3104
+ ] }),
3105
+ statusBadge && /* @__PURE__ */ jsx14("div", { className: "flex-shrink-0", children: statusBadge })
3106
+ ] })
3107
+ },
3108
+ alternativeId
3109
+ );
3110
+ }
3111
+ return /* @__PURE__ */ jsxs11(
3112
+ "div",
3113
+ {
3114
+ className: cn(
3115
+ "flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full",
3116
+ statusStyles,
3117
+ alternative.disabled ? "opacity-50" : ""
3118
+ ),
3119
+ children: [
3120
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 flex-1", children: [
3121
+ renderRadio(),
3122
+ /* @__PURE__ */ jsx14(
3123
+ "span",
3124
+ {
3125
+ className: cn(
3126
+ "flex-1",
3127
+ selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
3128
+ ),
3129
+ children: alternative.label
3130
+ }
3131
+ )
3132
+ ] }),
3133
+ statusBadge && /* @__PURE__ */ jsx14("div", { className: "flex-shrink-0", children: statusBadge })
3134
+ ]
3135
+ },
3136
+ alternativeId
3137
+ );
3138
+ };
3139
+ if (isReadonly) {
3140
+ return /* @__PURE__ */ jsx14(
3141
+ "div",
3142
+ {
3143
+ className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
3144
+ children: alternatives.map(
3145
+ (alternative) => renderReadonlyAlternative(alternative)
3146
+ )
3147
+ }
3148
+ );
3149
+ }
3150
+ return /* @__PURE__ */ jsx14(
3151
+ RadioGroup,
3152
+ {
3153
+ name: groupName,
3154
+ defaultValue,
3155
+ value,
3156
+ onValueChange: (value2) => {
3157
+ setActualValue(value2);
3158
+ onValueChange?.(value2);
3159
+ },
3160
+ disabled,
3161
+ className: cn("flex flex-col", getLayoutClasses(), className),
3162
+ children: alternatives.map((alternative, index) => {
3163
+ const alternativeId = alternative.value || `alt-${index}`;
3164
+ const statusStyles = getStatusStyles(alternative.status, false);
3165
+ const statusBadge = getStatusBadge(alternative.status);
3166
+ if (layout === "detailed") {
3167
+ return /* @__PURE__ */ jsx14(
3168
+ "div",
3169
+ {
3170
+ className: cn(
3171
+ "border-2 rounded-lg p-4 transition-all",
3172
+ statusStyles,
3173
+ alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
3174
+ ),
3175
+ children: /* @__PURE__ */ jsxs11("div", { className: "flex items-start justify-between gap-3", children: [
3176
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-start gap-3 flex-1", children: [
3177
+ /* @__PURE__ */ jsx14(
3178
+ RadioGroupItem,
3179
+ {
3180
+ value: alternative.value,
3181
+ id: alternativeId,
3182
+ disabled: alternative.disabled,
3183
+ className: "mt-1"
3184
+ }
3185
+ ),
3186
+ /* @__PURE__ */ jsxs11("div", { className: "flex-1", children: [
3187
+ /* @__PURE__ */ jsx14(
3188
+ "label",
3189
+ {
3190
+ htmlFor: alternativeId,
3191
+ className: cn(
3192
+ "block font-medium",
3193
+ actualValue === alternative.value ? "text-text-950" : "text-text-600",
3194
+ alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
3195
+ ),
3196
+ children: alternative.label
3197
+ }
3198
+ ),
3199
+ alternative.description && /* @__PURE__ */ jsx14("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
3200
+ ] })
3201
+ ] }),
3202
+ statusBadge && /* @__PURE__ */ jsx14("div", { className: "flex-shrink-0", children: statusBadge })
3203
+ ] })
3204
+ },
3205
+ alternativeId
3206
+ );
3207
+ }
3208
+ return /* @__PURE__ */ jsxs11(
3209
+ "div",
3210
+ {
3211
+ className: cn(
3212
+ "flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
3213
+ statusStyles,
3214
+ alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
3215
+ ),
3216
+ children: [
3217
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 flex-1", children: [
3218
+ /* @__PURE__ */ jsx14(
3219
+ RadioGroupItem,
3220
+ {
3221
+ value: alternative.value,
3222
+ id: alternativeId,
3223
+ disabled: alternative.disabled
3224
+ }
3225
+ ),
3226
+ /* @__PURE__ */ jsx14(
3227
+ "label",
3228
+ {
3229
+ htmlFor: alternativeId,
3230
+ className: cn(
3231
+ "flex-1",
3232
+ actualValue === alternative.value ? "text-text-950" : "text-text-600",
3233
+ alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
3234
+ ),
3235
+ children: alternative.label
3236
+ }
3237
+ )
3238
+ ] }),
3239
+ statusBadge && /* @__PURE__ */ jsx14("div", { className: "flex-shrink-0", children: statusBadge })
3240
+ ]
3241
+ },
3242
+ alternativeId
3243
+ );
3244
+ })
3245
+ }
3246
+ );
3247
+ };
3248
+ var HeaderAlternative = forwardRef6(
3249
+ ({ className, title, subTitle, content, ...props }, ref) => {
3250
+ return /* @__PURE__ */ jsxs11(
3251
+ "div",
3252
+ {
3253
+ ref,
3254
+ className: cn(
3255
+ "bg-background p-4 flex flex-col gap-4 rounded-xl",
3256
+ className
3257
+ ),
3258
+ ...props,
3259
+ children: [
3260
+ /* @__PURE__ */ jsxs11("span", { className: "flex flex-col", children: [
3261
+ /* @__PURE__ */ jsx14("p", { className: "text-text-950 font-bold text-lg", children: title }),
3262
+ /* @__PURE__ */ jsx14("p", { className: "text-text-700 text-sm ", children: subTitle })
3263
+ ] }),
3264
+ /* @__PURE__ */ jsx14("p", { className: "text-text-950 text-md", children: content })
3265
+ ]
3266
+ }
3267
+ );
3268
+ }
3269
+ );
3270
+
3271
+ // src/types/questionTypes.ts
3272
+ var questionTypeLabels = {
3273
+ ["ALTERNATIVA" /* ALTERNATIVA */]: "Alternativa",
3274
+ ["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: "Verdadeiro ou Falso",
3275
+ ["DISSERTATIVA" /* DISSERTATIVA */]: "Discursiva",
3276
+ ["IMAGEM" /* IMAGEM */]: "Imagem",
3277
+ ["MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */]: "M\xFAltipla Escolha",
3278
+ ["LIGAR_PONTOS" /* LIGAR_PONTOS */]: "Ligar Pontos",
3279
+ ["PREENCHER" /* PREENCHER */]: "Preencher Lacunas"
3280
+ };
3281
+
3282
+ // src/components/MultipleChoice/MultipleChoice.tsx
3283
+ import { useEffect as useEffect5, useState as useState6 } from "react";
3284
+ import { CheckCircle as CheckCircle3, XCircle as XCircle3, Check as Check2 } from "phosphor-react";
3285
+ import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
3286
+ var MultipleChoiceList = ({
3287
+ disabled = false,
3288
+ className = "",
3289
+ choices,
3290
+ name,
3291
+ selectedValues,
3292
+ onHandleSelectedValues,
3293
+ mode = "interactive"
3294
+ }) => {
3295
+ const [actualValue, setActualValue] = useState6(selectedValues);
3296
+ useEffect5(() => {
3297
+ setActualValue(selectedValues);
3298
+ }, [selectedValues]);
3299
+ const getStatusBadge = (status) => {
3300
+ switch (status) {
3301
+ case "correct":
3302
+ return /* @__PURE__ */ jsx15(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx15(CheckCircle3, {}), children: "Resposta correta" });
3303
+ case "incorrect":
3304
+ return /* @__PURE__ */ jsx15(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx15(XCircle3, {}), children: "Resposta incorreta" });
3305
+ default:
3306
+ return null;
3307
+ }
3308
+ };
3309
+ const getStatusStyles = (status) => {
3310
+ switch (status) {
3311
+ case "correct":
3312
+ return "bg-success-background border-success-300";
3313
+ case "incorrect":
3314
+ return "bg-error-background border-error-300";
3315
+ default:
3316
+ return `bg-background border-border-100`;
3317
+ }
3318
+ };
3319
+ const renderVisualCheckbox = (isSelected, isDisabled) => {
3320
+ const checkboxClasses = cn(
3321
+ "w-5 h-5 rounded border-2 cursor-default transition-all duration-200 flex items-center justify-center",
3322
+ isSelected ? "border-primary-950 bg-primary-950 text-text" : "border-border-400 bg-background",
3323
+ isDisabled && "opacity-40 cursor-not-allowed"
3324
+ );
3325
+ return /* @__PURE__ */ jsx15("div", { className: checkboxClasses, children: isSelected && /* @__PURE__ */ jsx15(Check2, { size: 16, weight: "bold" }) });
3326
+ };
3327
+ if (mode === "readonly") {
3328
+ return /* @__PURE__ */ jsx15("div", { className: cn("flex flex-col gap-2", className), children: choices.map((choice, i) => {
3329
+ const isSelected = actualValue?.includes(choice.value) || false;
3330
+ const statusStyles = getStatusStyles(choice.status);
3331
+ const statusBadge = getStatusBadge(choice.status);
3332
+ return /* @__PURE__ */ jsxs12(
3333
+ "div",
3334
+ {
3335
+ className: cn(
3336
+ "flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
3337
+ statusStyles,
3338
+ choice.disabled ? "opacity-50 cursor-not-allowed" : ""
3339
+ ),
3340
+ children: [
3341
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2 flex-1", children: [
3342
+ renderVisualCheckbox(isSelected, choice.disabled || disabled),
3343
+ /* @__PURE__ */ jsx15(
3344
+ "span",
3345
+ {
3346
+ className: cn(
3347
+ "flex-1",
3348
+ isSelected || choice.status && choice.status != "neutral" ? "text-text-950" : "text-text-600",
3349
+ choice.disabled || disabled ? "cursor-not-allowed" : "cursor-default"
3350
+ ),
3351
+ children: choice.label
3352
+ }
3353
+ )
3354
+ ] }),
3355
+ statusBadge && /* @__PURE__ */ jsx15("div", { className: "flex-shrink-0", children: statusBadge })
3356
+ ]
3357
+ },
3358
+ `readonly-${choice.value}-${i}`
3359
+ );
3360
+ }) });
3361
+ }
3362
+ return /* @__PURE__ */ jsx15(
3363
+ "div",
3364
+ {
3365
+ className: cn(
3366
+ "flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
3367
+ disabled ? "opacity-50 cursor-not-allowed" : "",
3368
+ className
3369
+ ),
3370
+ children: /* @__PURE__ */ jsx15(
3371
+ CheckboxList_default,
3372
+ {
3373
+ name,
3374
+ values: actualValue,
3375
+ onValuesChange: (v) => {
3376
+ setActualValue(v);
3377
+ onHandleSelectedValues?.(v);
3378
+ },
3379
+ disabled,
3380
+ children: choices.map((choice, i) => /* @__PURE__ */ jsxs12(
3381
+ "div",
3382
+ {
3383
+ className: "flex flex-row gap-2 items-center",
3384
+ children: [
3385
+ /* @__PURE__ */ jsx15(
3386
+ CheckboxListItem,
3387
+ {
3388
+ value: choice.value,
3389
+ id: `interactive-${choice.value}-${i}`,
3390
+ disabled: choice.disabled || disabled
3391
+ }
3392
+ ),
3393
+ /* @__PURE__ */ jsx15(
3394
+ "label",
3395
+ {
3396
+ htmlFor: `interactive-${choice.value}-${i}`,
3397
+ className: cn(
3398
+ "flex-1",
3399
+ actualValue?.includes(choice.value) ? "text-text-950" : "text-text-600",
3400
+ choice.disabled || disabled ? "cursor-not-allowed" : "cursor-pointer"
3401
+ ),
3402
+ children: choice.label
3403
+ }
3404
+ )
3405
+ ]
3406
+ },
3407
+ `interactive-${choice.value}-${i}`
3408
+ ))
3409
+ }
3410
+ )
3411
+ }
3412
+ );
3413
+ };
3414
+
3415
+ // src/utils/questionRenderer.ts
3416
+ var renderFromMap = (renderers, questionType) => {
3417
+ if (!questionType) return null;
3418
+ const renderer = renderers[questionType];
3419
+ return renderer ? renderer() : null;
3420
+ };
3421
+
3422
+ // src/components/ActivityCardQuestionPreview/ActivityCardQuestionPreview.tsx
3423
+ import { CheckCircle as CheckCircle4, XCircle as XCircle4 } from "phosphor-react";
3424
+ import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
3425
+ var QuestionHeader = ({
3426
+ badgeColor,
3427
+ iconName,
3428
+ subjectName,
3429
+ resolvedQuestionTypeLabel,
3430
+ position
3431
+ }) => /* @__PURE__ */ jsxs13("div", { className: "flex flex-row gap-2 text-text-650", children: [
3432
+ /* @__PURE__ */ jsxs13("div", { className: "py-1 px-2 flex flex-row items-center gap-1", children: [
3433
+ /* @__PURE__ */ jsx16(
3434
+ "span",
3435
+ {
3436
+ className: "size-4 rounded-sm flex items-center justify-center shrink-0 text-text-950",
3437
+ style: {
3438
+ backgroundColor: badgeColor
3439
+ },
3440
+ children: /* @__PURE__ */ jsx16(
3441
+ IconRender_default,
3442
+ {
3443
+ iconName: iconName ?? "Book",
3444
+ size: 14,
3445
+ color: "currentColor"
3446
+ }
3447
+ )
3448
+ }
3449
+ ),
3450
+ /* @__PURE__ */ jsx16(Text_default, { size: "sm", children: subjectName ?? "Assunto n\xE3o informado" })
3451
+ ] }),
3452
+ typeof position === "number" && /* @__PURE__ */ jsx16("div", { className: "py-1 px-2 flex flex-row items-center gap-1", children: /* @__PURE__ */ jsxs13(Text_default, { size: "sm", className: "text-text-700", children: [
3453
+ "#",
3454
+ position
3455
+ ] }) }),
3456
+ /* @__PURE__ */ jsx16("div", { className: "py-1 px-2 flex flex-row items-center gap-1", children: /* @__PURE__ */ jsx16(Text_default, { size: "sm", className: "", children: resolvedQuestionTypeLabel ?? "Tipo de quest\xE3o" }) })
3457
+ ] });
3458
+ var ActivityCardQuestionPreview = ({
3459
+ subjectName = "Assunto n\xE3o informado",
3460
+ subjectColor = "#000000",
3461
+ iconName = "Book",
3462
+ isDark = false,
3463
+ questionType,
3464
+ questionTypeLabel,
3465
+ enunciado = "Enunciado n\xE3o informado",
3466
+ question,
3467
+ defaultExpanded = false,
3468
+ value,
3469
+ className,
3470
+ children,
3471
+ position
3472
+ }) => {
3473
+ const badgeColor = getSubjectColorWithOpacity(subjectColor, isDark) ?? subjectColor;
3474
+ const [isExpanded, setIsExpanded] = useState7(defaultExpanded);
3475
+ const correctOptionIds = question?.correctOptionIds || [];
3476
+ const resolvedQuestionTypeLabel = questionType && questionTypeLabels[questionType] ? questionTypeLabels[questionType] : questionTypeLabel || "Tipo de quest\xE3o";
3477
+ const safeSubjectName = subjectName ?? "Assunto n\xE3o informado";
3478
+ const safeIconName = iconName ?? "Book";
3479
+ const safeResolvedLabel = resolvedQuestionTypeLabel ?? "Tipo de quest\xE3o";
3480
+ const alternatives = useMemo(() => {
3481
+ if (!question?.options || questionType !== "ALTERNATIVA" /* ALTERNATIVA */)
3482
+ return [];
3483
+ return question.options.map((option) => {
3484
+ const isCorrect = correctOptionIds.includes(option.id);
3485
+ return {
3486
+ value: option.id,
3487
+ label: option.option,
3488
+ status: isCorrect ? "correct" : void 0,
3489
+ disabled: !isCorrect
3490
+ };
3491
+ });
3492
+ }, [question, questionType, correctOptionIds]);
3493
+ const multipleChoices = useMemo(() => {
3494
+ if (!question?.options || questionType !== "MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */)
3495
+ return [];
3496
+ return question.options.map((option) => {
3497
+ const isCorrect = correctOptionIds.includes(option.id);
3498
+ return {
3499
+ value: option.id,
3500
+ label: option.option,
3501
+ status: isCorrect ? "correct" : void 0,
3502
+ disabled: !isCorrect
3503
+ };
3504
+ });
3505
+ }, [question, questionType, correctOptionIds]);
3506
+ const renderAlternative = () => {
3507
+ if (alternatives.length === 0) return null;
3508
+ return /* @__PURE__ */ jsx16("div", { className: "mt-4", children: /* @__PURE__ */ jsx16(
3509
+ AlternativesList,
3510
+ {
3511
+ alternatives,
3512
+ mode: "readonly",
3513
+ layout: "compact",
3514
+ selectedValue: correctOptionIds[0],
3515
+ name: `preview-alternatives-${value ?? subjectName}`
3516
+ }
3517
+ ) });
3518
+ };
3519
+ const renderMultipleChoice = () => {
3520
+ if (multipleChoices.length === 0) return null;
3521
+ return /* @__PURE__ */ jsx16("div", { className: "mt-4", children: /* @__PURE__ */ jsx16(
3522
+ MultipleChoiceList,
3523
+ {
3524
+ choices: multipleChoices,
3525
+ mode: "readonly",
3526
+ selectedValues: correctOptionIds,
3527
+ name: `preview-multiple-${value ?? subjectName}`
3528
+ }
3529
+ ) });
3530
+ };
3531
+ const renderTrueOrFalse = () => {
3532
+ if (!question?.options || question.options.length === 0) return null;
3533
+ return /* @__PURE__ */ jsx16("div", { className: "mt-4", children: /* @__PURE__ */ jsx16("div", { className: "flex flex-col gap-3.5", children: question.options.map((option, index) => {
3534
+ const isCorrect = correctOptionIds.includes(option.id);
3535
+ const correctAnswer = isCorrect ? "Verdadeiro" : "Falso";
3536
+ return /* @__PURE__ */ jsx16("section", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsxs13(
3537
+ "div",
3538
+ {
3539
+ className: cn(
3540
+ "flex flex-row justify-between items-center gap-2 p-2 rounded-md border",
3541
+ isCorrect ? "bg-success-background border-success-300" : "bg-error-background border-error-300"
3542
+ ),
3543
+ children: [
3544
+ /* @__PURE__ */ jsx16(Text_default, { size: "sm", className: "text-text-900", children: String.fromCodePoint(97 + index).concat(") ").concat(option.option) }),
3545
+ /* @__PURE__ */ jsxs13("div", { className: "flex flex-row items-center gap-2 flex-shrink-0", children: [
3546
+ /* @__PURE__ */ jsxs13(Text_default, { size: "sm", className: "text-text-700", children: [
3547
+ "Resposta correta: ",
3548
+ correctAnswer
3549
+ ] }),
3550
+ /* @__PURE__ */ jsx16(
3551
+ Badge_default,
3552
+ {
3553
+ variant: "solid",
3554
+ action: isCorrect ? "success" : "error",
3555
+ iconLeft: isCorrect ? /* @__PURE__ */ jsx16(CheckCircle4, {}) : /* @__PURE__ */ jsx16(XCircle4, {}),
3556
+ children: isCorrect ? "Resposta correta" : "Resposta incorreta"
3557
+ }
3558
+ )
3559
+ ] })
3560
+ ]
3561
+ }
3562
+ ) }, option.id);
3563
+ }) }) });
3564
+ };
3565
+ const renderDissertative = () => {
3566
+ return /* @__PURE__ */ jsx16("div", { className: "mt-4 px-2 py-4", children: /* @__PURE__ */ jsx16(Text_default, { size: "sm", className: "text-text-600 italic", children: "Resposta do aluno" }) });
3567
+ };
3568
+ const renderConnectDots = () => null;
3569
+ const renderFill = () => null;
3570
+ const renderImage = () => null;
3571
+ const questionRenderers = {
3572
+ ["ALTERNATIVA" /* ALTERNATIVA */]: renderAlternative,
3573
+ ["MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */]: renderMultipleChoice,
3574
+ ["DISSERTATIVA" /* DISSERTATIVA */]: renderDissertative,
3575
+ ["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: renderTrueOrFalse,
3576
+ ["LIGAR_PONTOS" /* LIGAR_PONTOS */]: renderConnectDots,
3577
+ ["PREENCHER" /* PREENCHER */]: renderFill,
3578
+ ["IMAGEM" /* IMAGEM */]: renderImage
3579
+ };
3580
+ return /* @__PURE__ */ jsxs13(
3581
+ "div",
3582
+ {
3583
+ className: "w-full",
3584
+ "data-position": position,
3585
+ role: "button",
3586
+ tabIndex: 0,
3587
+ "aria-expanded": isExpanded,
3588
+ onClick: () => {
3589
+ if (isExpanded) {
3590
+ setIsExpanded(false);
3591
+ }
3592
+ },
3593
+ onMouseDown: (event) => {
3594
+ const draggableAncestor = event.target.closest(
3595
+ '[data-draggable="true"]'
3596
+ );
3597
+ if (!draggableAncestor) {
3598
+ event.preventDefault();
3599
+ }
3600
+ },
3601
+ onKeyDown: (event) => {
3602
+ if (event.key === "Enter" || event.key === " ") {
3603
+ event.preventDefault();
3604
+ if (isExpanded) {
3605
+ setIsExpanded(false);
3606
+ }
3607
+ }
3608
+ },
3609
+ children: [
3610
+ /* @__PURE__ */ jsx16(
3611
+ "div",
3612
+ {
3613
+ "data-drag-preview": "true",
3614
+ className: "fixed -left-[9999px] -top-[9999px] pointer-events-none z-[9999] w-[440px]",
3615
+ children: /* @__PURE__ */ jsx16("div", { className: "w-full rounded-lg border border-border-200 bg-background", children: /* @__PURE__ */ jsxs13("div", { className: "w-full min-w-0 flex flex-col gap-2 py-2", children: [
3616
+ /* @__PURE__ */ jsx16(
3617
+ QuestionHeader,
3618
+ {
3619
+ badgeColor,
3620
+ iconName: safeIconName,
3621
+ subjectName: safeSubjectName,
3622
+ resolvedQuestionTypeLabel: safeResolvedLabel,
3623
+ position
3624
+ }
3625
+ ),
3626
+ /* @__PURE__ */ jsx16(
3627
+ Text_default,
3628
+ {
3629
+ size: "md",
3630
+ weight: "medium",
3631
+ className: "text-text-950 truncate px-3",
3632
+ children: enunciado
3633
+ }
3634
+ )
3635
+ ] }) })
3636
+ }
3637
+ ),
3638
+ /* @__PURE__ */ jsxs13(
3639
+ CardAccordation,
3640
+ {
3641
+ className: cn(
3642
+ "w-full rounded-lg border border-border-200 bg-background",
3643
+ className
3644
+ ),
3645
+ expanded: isExpanded,
3646
+ onToggleExpanded: setIsExpanded,
3647
+ defaultExpanded,
3648
+ value,
3649
+ trigger: /* @__PURE__ */ jsxs13("div", { className: "w-full min-w-0 flex flex-col gap-2 py-2", children: [
3650
+ /* @__PURE__ */ jsx16(
3651
+ QuestionHeader,
3652
+ {
3653
+ badgeColor,
3654
+ iconName: safeIconName,
3655
+ subjectName: safeSubjectName,
3656
+ resolvedQuestionTypeLabel: safeResolvedLabel,
3657
+ position
3658
+ }
3659
+ ),
3660
+ !isExpanded && /* @__PURE__ */ jsx16(
3661
+ Text_default,
3662
+ {
3663
+ size: "md",
3664
+ weight: "medium",
3665
+ className: "text-text-950 truncate px-3",
3666
+ children: enunciado
3667
+ }
3668
+ )
3669
+ ] }),
3670
+ children: [
3671
+ /* @__PURE__ */ jsx16(
3672
+ Text_default,
3673
+ {
3674
+ size: "md",
3675
+ weight: "medium",
3676
+ className: "text-text-950 break-words whitespace-pre-wrap",
3677
+ children: enunciado
3678
+ }
3679
+ ),
3680
+ renderFromMap(questionRenderers, questionType),
3681
+ children
3682
+ ]
3683
+ }
3684
+ )
3685
+ ]
3686
+ }
3687
+ );
3688
+ };
3689
+ export {
3690
+ ActivityCardQuestionPreview
3691
+ };
3692
+ //# sourceMappingURL=index.mjs.map