analytica-frontend-lib 1.0.82 → 1.0.83

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