analytica-frontend-lib 1.2.51 → 1.2.52

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 (91) hide show
  1. package/dist/ActivitiesHistory/index.css +19387 -0
  2. package/dist/ActivitiesHistory/index.css.map +1 -0
  3. package/dist/ActivitiesHistory/index.d.ts +2 -0
  4. package/dist/ActivitiesHistory/index.d.ts.map +1 -0
  5. package/dist/ActivitiesHistory/index.js +7381 -0
  6. package/dist/ActivitiesHistory/index.js.map +1 -0
  7. package/dist/ActivitiesHistory/index.mjs +7424 -0
  8. package/dist/ActivitiesHistory/index.mjs.map +1 -0
  9. package/dist/ActivityCardQuestionBanks/index.css +13 -0
  10. package/dist/ActivityCardQuestionBanks/index.css.map +1 -1
  11. package/dist/ActivityCardQuestionPreview/index.css +13 -0
  12. package/dist/ActivityCardQuestionPreview/index.css.map +1 -1
  13. package/dist/ActivityDetails/index.css +13 -0
  14. package/dist/ActivityDetails/index.css.map +1 -1
  15. package/dist/ActivityFilters/index.css +13 -0
  16. package/dist/ActivityFilters/index.css.map +1 -1
  17. package/dist/ActivityPreview/index.css +13 -0
  18. package/dist/ActivityPreview/index.css.map +1 -1
  19. package/dist/AlertManager/index.css +13 -0
  20. package/dist/AlertManager/index.css.map +1 -1
  21. package/dist/RecommendedLessonsHistory/index.css +13 -0
  22. package/dist/RecommendedLessonsHistory/index.css.map +1 -1
  23. package/dist/RecommendedLessonsHistory/index.js +10 -2
  24. package/dist/RecommendedLessonsHistory/index.js.map +1 -1
  25. package/dist/RecommendedLessonsHistory/index.mjs +10 -2
  26. package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
  27. package/dist/SendActivityModal/SendActivityModal.css +13 -0
  28. package/dist/SendActivityModal/SendActivityModal.css.map +1 -1
  29. package/dist/SendActivityModal/index.css +13 -0
  30. package/dist/SendActivityModal/index.css.map +1 -1
  31. package/dist/TableProvider/index.css +13 -0
  32. package/dist/TableProvider/index.css.map +1 -1
  33. package/dist/hooks/useActivitiesHistory/index.d.ts +210 -0
  34. package/dist/hooks/useActivitiesHistory/index.d.ts.map +1 -0
  35. package/dist/hooks/useActivitiesHistory/index.js +181 -0
  36. package/dist/hooks/useActivitiesHistory/index.js.map +1 -0
  37. package/dist/hooks/useActivitiesHistory/index.mjs +141 -0
  38. package/dist/hooks/useActivitiesHistory/index.mjs.map +1 -0
  39. package/dist/hooks/useActivitiesHistory.d.ts +210 -0
  40. package/dist/hooks/useActivitiesHistory.d.ts.map +1 -0
  41. package/dist/hooks/useActivityModels/index.d.ts +220 -0
  42. package/dist/hooks/useActivityModels/index.d.ts.map +1 -0
  43. package/dist/hooks/useActivityModels/index.js +186 -0
  44. package/dist/hooks/useActivityModels/index.js.map +1 -0
  45. package/dist/hooks/useActivityModels/index.mjs +146 -0
  46. package/dist/hooks/useActivityModels/index.mjs.map +1 -0
  47. package/dist/hooks/useActivityModels.d.ts +220 -0
  48. package/dist/hooks/useActivityModels.d.ts.map +1 -0
  49. package/dist/index.css +13 -0
  50. package/dist/index.css.map +1 -1
  51. package/dist/index.d.ts +8 -0
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +1069 -23
  54. package/dist/index.js.map +1 -1
  55. package/dist/index.mjs +1049 -23
  56. package/dist/index.mjs.map +1 -1
  57. package/dist/styles.css +13 -0
  58. package/dist/styles.css.map +1 -1
  59. package/dist/types/activitiesHistory/index.d.ts +196 -0
  60. package/dist/types/activitiesHistory/index.d.ts.map +1 -0
  61. package/dist/types/activitiesHistory/index.js +92 -0
  62. package/dist/types/activitiesHistory/index.js.map +1 -0
  63. package/dist/types/activitiesHistory/index.mjs +59 -0
  64. package/dist/types/activitiesHistory/index.mjs.map +1 -0
  65. package/dist/types/activitiesHistory.d.ts +196 -0
  66. package/dist/types/activitiesHistory.d.ts.map +1 -0
  67. package/dist/types/common.d.ts +44 -0
  68. package/dist/types/common.d.ts.map +1 -0
  69. package/dist/types/recommendedLessons/index.d.ts +10 -18
  70. package/dist/types/recommendedLessons/index.d.ts.map +1 -1
  71. package/dist/types/recommendedLessons/index.js +27 -22
  72. package/dist/types/recommendedLessons/index.js.map +1 -1
  73. package/dist/types/recommendedLessons/index.mjs +26 -23
  74. package/dist/types/recommendedLessons/index.mjs.map +1 -1
  75. package/dist/types/recommendedLessons.d.ts +10 -18
  76. package/dist/types/recommendedLessons.d.ts.map +1 -1
  77. package/dist/utils/hookErrorHandler.d.ts +24 -0
  78. package/dist/utils/hookErrorHandler.d.ts.map +1 -0
  79. package/package.json +7 -1
  80. package/dist/RecommendedLessonDetails/index.d.ts +0 -5
  81. package/dist/RecommendedLessonDetails/index.d.ts.map +0 -1
  82. package/dist/RecommendedLessonDetails/index.js +0 -4854
  83. package/dist/RecommendedLessonDetails/index.js.map +0 -1
  84. package/dist/RecommendedLessonDetails/index.mjs +0 -4872
  85. package/dist/RecommendedLessonDetails/index.mjs.map +0 -1
  86. package/dist/hooks/useRecommendedLessonDetails/index.d.ts +0 -780
  87. package/dist/hooks/useRecommendedLessonDetails/index.d.ts.map +0 -1
  88. package/dist/hooks/useRecommendedLessonDetails/index.js +0 -204
  89. package/dist/hooks/useRecommendedLessonDetails/index.js.map +0 -1
  90. package/dist/hooks/useRecommendedLessonDetails/index.mjs +0 -174
  91. package/dist/hooks/useRecommendedLessonDetails/index.mjs.map +0 -1
@@ -1,4854 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/components/RecommendedLessonDetails/index.ts
31
- var RecommendedLessonDetails_exports = {};
32
- __export(RecommendedLessonDetails_exports, {
33
- RecommendedLessonDetails: () => RecommendedLessonDetails_default,
34
- StudentPerformanceModal: () => StudentPerformanceModal
35
- });
36
- module.exports = __toCommonJS(RecommendedLessonDetails_exports);
37
-
38
- // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
39
- var import_react16 = require("react");
40
-
41
- // src/utils/utils.ts
42
- var import_clsx = require("clsx");
43
- var import_tailwind_merge = require("tailwind-merge");
44
- function cn(...inputs) {
45
- return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
46
- }
47
-
48
- // src/components/Text/Text.tsx
49
- var import_jsx_runtime = require("react/jsx-runtime");
50
- var Text = ({
51
- children,
52
- size = "md",
53
- weight = "normal",
54
- color = "text-text-950",
55
- as,
56
- className = "",
57
- ...props
58
- }) => {
59
- let sizeClasses = "";
60
- let weightClasses = "";
61
- const sizeClassMap = {
62
- "2xs": "text-2xs",
63
- xs: "text-xs",
64
- sm: "text-sm",
65
- md: "text-md",
66
- lg: "text-lg",
67
- xl: "text-xl",
68
- "2xl": "text-2xl",
69
- "3xl": "text-3xl",
70
- "4xl": "text-4xl",
71
- "5xl": "text-5xl",
72
- "6xl": "text-6xl"
73
- };
74
- sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
75
- const weightClassMap = {
76
- hairline: "font-hairline",
77
- light: "font-light",
78
- normal: "font-normal",
79
- medium: "font-medium",
80
- semibold: "font-semibold",
81
- bold: "font-bold",
82
- extrabold: "font-extrabold",
83
- black: "font-black"
84
- };
85
- weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
86
- const baseClasses = "font-primary";
87
- const Component = as ?? "p";
88
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
- Component,
90
- {
91
- className: cn(baseClasses, sizeClasses, weightClasses, color, className),
92
- ...props,
93
- children
94
- }
95
- );
96
- };
97
- var Text_default = Text;
98
-
99
- // src/components/RecommendedLessonDetails/components/Breadcrumb.tsx
100
- var import_react = require("@phosphor-icons/react");
101
- var import_jsx_runtime2 = require("react/jsx-runtime");
102
- var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("nav", { className: "flex items-center gap-2 text-sm", "aria-label": "Breadcrumb", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
103
- Text_default,
104
- {
105
- as: "span",
106
- className: "flex items-center gap-2",
107
- children: [
108
- index > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react.CaretRightIcon, { size: 14, className: "text-text-500" }),
109
- item.path ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
110
- "button",
111
- {
112
- type: "button",
113
- onClick: () => onItemClick?.(item.path),
114
- className: "text-text-600 hover:text-primary-700 transition-colors",
115
- children: item.label
116
- }
117
- ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text_default, { as: "span", className: "text-text-950 font-medium", children: item.label })
118
- ]
119
- },
120
- item.path ?? item.label
121
- )) });
122
-
123
- // src/components/RecommendedLessonDetails/components/LessonHeader.tsx
124
- var import_react2 = require("@phosphor-icons/react");
125
-
126
- // src/components/Button/Button.tsx
127
- var import_jsx_runtime3 = require("react/jsx-runtime");
128
- var VARIANT_ACTION_CLASSES = {
129
- solid: {
130
- 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",
131
- 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",
132
- 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"
133
- },
134
- outline: {
135
- 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",
136
- 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",
137
- 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"
138
- },
139
- link: {
140
- 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",
141
- 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",
142
- 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"
143
- }
144
- };
145
- var SIZE_CLASSES = {
146
- "extra-small": "text-xs px-3.5 py-2",
147
- small: "text-sm px-4 py-2.5",
148
- medium: "text-md px-5 py-2.5",
149
- large: "text-lg px-6 py-3",
150
- "extra-large": "text-lg px-7 py-3.5"
151
- };
152
- var Button = ({
153
- children,
154
- iconLeft,
155
- iconRight,
156
- size = "medium",
157
- variant = "solid",
158
- action = "primary",
159
- className = "",
160
- disabled,
161
- type = "button",
162
- ...props
163
- }) => {
164
- const sizeClasses = SIZE_CLASSES[size];
165
- const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
166
- const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
167
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
168
- "button",
169
- {
170
- className: cn(baseClasses, variantClasses, sizeClasses, className),
171
- disabled,
172
- type,
173
- ...props,
174
- children: [
175
- iconLeft && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
176
- children,
177
- iconRight && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
178
- ]
179
- }
180
- );
181
- };
182
- var Button_default = Button;
183
-
184
- // src/assets/icons/subjects/BookOpenText.tsx
185
- var import_jsx_runtime4 = require("react/jsx-runtime");
186
- var BookOpenText = ({
187
- size,
188
- color
189
- }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
190
- "svg",
191
- {
192
- width: size,
193
- height: size,
194
- viewBox: "0 0 32 32",
195
- fill: "none",
196
- xmlns: "http://www.w3.org/2000/svg",
197
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
198
- "path",
199
- {
200
- d: "M29 6H20C19.2238 6 18.4582 6.18073 17.7639 6.52786C17.0697 6.875 16.4657 7.37902 16 8C15.5343 7.37902 14.9303 6.875 14.2361 6.52786C13.5418 6.18073 12.7762 6 12 6H3C2.73478 6 2.48043 6.10536 2.29289 6.29289C2.10536 6.48043 2 6.73478 2 7V25C2 25.2652 2.10536 25.5196 2.29289 25.7071C2.48043 25.8946 2.73478 26 3 26H12C12.7956 26 13.5587 26.3161 14.1213 26.8787C14.6839 27.4413 15 28.2044 15 29C15 29.2652 15.1054 29.5196 15.2929 29.7071C15.4804 29.8946 15.7348 30 16 30C16.2652 30 16.5196 29.8946 16.7071 29.7071C16.8946 29.5196 17 29.2652 17 29C17 28.2044 17.3161 27.4413 17.8787 26.8787C18.4413 26.3161 19.2044 26 20 26H29C29.2652 26 29.5196 25.8946 29.7071 25.7071C29.8946 25.5196 30 25.2652 30 25V7C30 6.73478 29.8946 6.48043 29.7071 6.29289C29.5196 6.10536 29.2652 6 29 6ZM12 24H4V8H12C12.7956 8 13.5587 8.31607 14.1213 8.87868C14.6839 9.44129 15 10.2044 15 11V25C14.1353 24.3493 13.0821 23.9983 12 24ZM28 24H20C18.9179 23.9983 17.8647 24.3493 17 25V11C17 10.2044 17.3161 9.44129 17.8787 8.87868C18.4413 8.31607 19.2044 8 20 8H28V24ZM20 11H25C25.2652 11 25.5196 11.1054 25.7071 11.2929C25.8946 11.4804 26 11.7348 26 12C26 12.2652 25.8946 12.5196 25.7071 12.7071C25.5196 12.8946 25.2652 13 25 13H20C19.7348 13 19.4804 12.8946 19.2929 12.7071C19.1054 12.5196 19 12.2652 19 12C19 11.7348 19.1054 11.4804 19.2929 11.2929C19.4804 11.1054 19.7348 11 20 11ZM26 16C26 16.2652 25.8946 16.5196 25.7071 16.7071C25.5196 16.8946 25.2652 17 25 17H20C19.7348 17 19.4804 16.8946 19.2929 16.7071C19.1054 16.5196 19 16.2652 19 16C19 15.7348 19.1054 15.4804 19.2929 15.2929C19.4804 15.1054 19.7348 15 20 15H25C25.2652 15 25.5196 15.1054 25.7071 15.2929C25.8946 15.4804 26 15.7348 26 16ZM26 20C26 20.2652 25.8946 20.5196 25.7071 20.7071C25.5196 20.8946 25.2652 21 25 21H20C19.7348 21 19.4804 20.8946 19.2929 20.7071C19.1054 20.5196 19 20.2652 19 20C19 19.7348 19.1054 19.4804 19.2929 19.2929C19.4804 19.1054 19.7348 19 20 19H25C25.2652 19 25.5196 19.1054 25.7071 19.2929C25.8946 19.4804 26 19.7348 26 20Z",
201
- fill: color
202
- }
203
- )
204
- }
205
- );
206
-
207
- // src/assets/icons/subjects/ChatEN.tsx
208
- var import_jsx_runtime5 = require("react/jsx-runtime");
209
- var ChatEN = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
210
- "svg",
211
- {
212
- width: size,
213
- height: size,
214
- viewBox: "0 0 32 32",
215
- fill: "none",
216
- xmlns: "http://www.w3.org/2000/svg",
217
- children: [
218
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
219
- "path",
220
- {
221
- d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
222
- fill: color
223
- }
224
- ),
225
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
226
- "path",
227
- {
228
- d: "M22.5488 12V20.5312H21.0781L17.252 14.4199V20.5312H15.7812V12H17.252L21.0898 18.123V12H22.5488Z",
229
- fill: color
230
- }
231
- ),
232
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
233
- "path",
234
- {
235
- d: "M14.584 19.3652V20.5312H10.0547V19.3652H14.584ZM10.4707 12V20.5312H9V12H10.4707ZM13.9922 15.5625V16.7109H10.0547V15.5625H13.9922ZM14.5547 12V13.1719H10.0547V12H14.5547Z",
236
- fill: color
237
- }
238
- )
239
- ]
240
- }
241
- );
242
-
243
- // src/assets/icons/subjects/ChatES.tsx
244
- var import_jsx_runtime6 = require("react/jsx-runtime");
245
- var ChatES = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
246
- "svg",
247
- {
248
- width: size,
249
- height: size,
250
- viewBox: "0 0 32 32",
251
- fill: "none",
252
- xmlns: "http://www.w3.org/2000/svg",
253
- children: [
254
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
255
- "path",
256
- {
257
- d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
258
- fill: color
259
- }
260
- ),
261
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
262
- "path",
263
- {
264
- d: "M21.1426 17.8027C21.1426 17.627 21.1152 17.4707 21.0605 17.334C21.0098 17.1973 20.918 17.0723 20.7852 16.959C20.6523 16.8457 20.4648 16.7363 20.2227 16.6309C19.9844 16.5215 19.6797 16.4102 19.3086 16.2969C18.9023 16.1719 18.5273 16.0332 18.1836 15.8809C17.8438 15.7246 17.5469 15.5449 17.293 15.3418C17.0391 15.1348 16.8418 14.8984 16.7012 14.6328C16.5605 14.3633 16.4902 14.0527 16.4902 13.7012C16.4902 13.3535 16.5625 13.0371 16.707 12.752C16.8555 12.4668 17.0645 12.2207 17.334 12.0137C17.6074 11.8027 17.9297 11.6406 18.3008 11.5273C18.6719 11.4102 19.082 11.3516 19.5312 11.3516C20.1641 11.3516 20.709 11.4688 21.166 11.7031C21.627 11.9375 21.9805 12.252 22.2266 12.6465C22.4766 13.041 22.6016 13.4766 22.6016 13.9531H21.1426C21.1426 13.6719 21.082 13.4238 20.9609 13.209C20.8438 12.9902 20.6641 12.8184 20.4219 12.6934C20.1836 12.5684 19.8809 12.5059 19.5137 12.5059C19.166 12.5059 18.877 12.5586 18.6465 12.6641C18.416 12.7695 18.2441 12.9121 18.1309 13.0918C18.0176 13.2715 17.9609 13.4746 17.9609 13.7012C17.9609 13.8613 17.998 14.0078 18.0723 14.1406C18.1465 14.2695 18.2598 14.3906 18.4121 14.5039C18.5645 14.6133 18.7559 14.7168 18.9863 14.8145C19.2168 14.9121 19.4883 15.0059 19.8008 15.0957C20.2734 15.2363 20.6855 15.3926 21.0371 15.5645C21.3887 15.7324 21.6816 15.9238 21.916 16.1387C22.1504 16.3535 22.3262 16.5977 22.4434 16.8711C22.5605 17.1406 22.6191 17.4473 22.6191 17.791C22.6191 18.1504 22.5469 18.4746 22.4023 18.7637C22.2578 19.0488 22.0508 19.293 21.7812 19.4961C21.5156 19.6953 21.1953 19.8496 20.8203 19.959C20.4492 20.0645 20.0352 20.1172 19.5781 20.1172C19.168 20.1172 18.7637 20.0625 18.3652 19.9531C17.9707 19.8438 17.6113 19.6777 17.2871 19.4551C16.9629 19.2285 16.7051 18.9473 16.5137 18.6113C16.3223 18.2715 16.2266 17.875 16.2266 17.4219H17.6973C17.6973 17.6992 17.7441 17.9355 17.8379 18.1309C17.9355 18.3262 18.0703 18.4863 18.2422 18.6113C18.4141 18.7324 18.6133 18.8223 18.8398 18.8809C19.0703 18.9395 19.3164 18.9688 19.5781 18.9688C19.9219 18.9688 20.209 18.9199 20.4395 18.8223C20.6738 18.7246 20.8496 18.5879 20.9668 18.4121C21.084 18.2363 21.1426 18.0332 21.1426 17.8027Z",
265
- fill: color
266
- }
267
- ),
268
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
269
- "path",
270
- {
271
- d: "M15.4512 18.834V20H10.9219V18.834H15.4512ZM11.3379 11.4688V20H9.86719V11.4688H11.3379ZM14.8594 15.0312V16.1797H10.9219V15.0312H14.8594ZM15.4219 11.4688V12.6406H10.9219V11.4688H15.4219Z",
272
- fill: color
273
- }
274
- )
275
- ]
276
- }
277
- );
278
-
279
- // src/assets/icons/subjects/ChatPT.tsx
280
- var import_jsx_runtime7 = require("react/jsx-runtime");
281
- var ChatPT = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
282
- "svg",
283
- {
284
- width: size,
285
- height: size,
286
- viewBox: "0 0 32 32",
287
- fill: "none",
288
- xmlns: "http://www.w3.org/2000/svg",
289
- children: [
290
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
291
- "path",
292
- {
293
- d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
294
- fill: color
295
- }
296
- ),
297
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
298
- "path",
299
- {
300
- d: "M21.1758 12V20.5312H19.7168V12H21.1758ZM23.8535 12V13.1719H17.0625V12H23.8535Z",
301
- fill: color
302
- }
303
- ),
304
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
305
- "path",
306
- {
307
- d: "M13.2402 17.3496H11.0195V16.1836H13.2402C13.627 16.1836 13.9395 16.1211 14.1777 15.9961C14.416 15.8711 14.5898 15.6992 14.6992 15.4805C14.8125 15.2578 14.8691 15.0039 14.8691 14.7188C14.8691 14.4492 14.8125 14.1973 14.6992 13.9629C14.5898 13.7246 14.416 13.5332 14.1777 13.3887C13.9395 13.2441 13.627 13.1719 13.2402 13.1719H11.4707V20.5312H10V12H13.2402C13.9004 12 14.4609 12.1172 14.9219 12.3516C15.3867 12.582 15.7402 12.9023 15.9824 13.3125C16.2246 13.7188 16.3457 14.1836 16.3457 14.707C16.3457 15.2578 16.2246 15.7305 15.9824 16.125C15.7402 16.5195 15.3867 16.8223 14.9219 17.0332C14.4609 17.2441 13.9004 17.3496 13.2402 17.3496Z",
308
- fill: color
309
- }
310
- )
311
- ]
312
- }
313
- );
314
-
315
- // src/assets/icons/subjects/HeadCircuit.tsx
316
- var import_jsx_runtime8 = require("react/jsx-runtime");
317
- var HeadCircuit = ({
318
- size,
319
- color
320
- }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
321
- "svg",
322
- {
323
- width: size,
324
- height: size,
325
- viewBox: "0 0 32 32",
326
- fill: "none",
327
- xmlns: "http://www.w3.org/2000/svg",
328
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
329
- "path",
330
- {
331
- d: "M24.0625 21.4338C25.327 20.3715 26.3372 19.0392 27.0187 17.5348C27.7001 16.0304 28.0354 14.3924 28 12.7413C27.875 7.02751 23.2987 2.31626 17.595 2.01626C16.1233 1.93616 14.6506 2.15261 13.2642 2.65277C11.8778 3.15293 10.6061 3.92659 9.52453 4.92781C8.44297 5.92903 7.57365 7.13739 6.96819 8.48112C6.36272 9.82485 6.03347 11.2766 5.99997 12.75L3.19372 18.1475C3.18247 18.17 3.17122 18.1925 3.16122 18.215C2.96003 18.6839 2.94569 19.212 3.12114 19.6912C3.29659 20.1704 3.64855 20.5644 4.10497 20.7925L4.13622 20.8063L6.99997 22.1175V26C6.99997 26.5304 7.21068 27.0392 7.58576 27.4142C7.96083 27.7893 8.46954 28 8.99997 28H15C15.2652 28 15.5195 27.8947 15.7071 27.7071C15.8946 27.5196 16 27.2652 16 27C16 26.7348 15.8946 26.4804 15.7071 26.2929C15.5195 26.1054 15.2652 26 15 26H8.99997V21.4763C9.00011 21.2846 8.94517 21.0969 8.84168 20.9356C8.73818 20.7742 8.5905 20.646 8.41622 20.5663L4.99997 19L7.88372 13.4575C7.95889 13.3166 7.99878 13.1597 7.99997 13C7.99968 10.9604 8.69216 8.98124 9.96395 7.38674C11.2357 5.79224 13.0114 4.677 15 4.22376V6.17251C14.3328 6.4084 13.7704 6.87258 13.4123 7.48299C13.0543 8.0934 12.9235 8.81075 13.0432 9.50824C13.1628 10.2057 13.5252 10.8385 14.0663 11.2946C14.6074 11.7508 15.2923 12.0009 16 12.0009C16.7077 12.0009 17.3926 11.7508 17.9336 11.2946C18.4747 10.8385 18.8371 10.2057 18.9568 9.50824C19.0764 8.81075 18.9457 8.0934 18.5876 7.48299C18.2295 6.87258 17.6672 6.4084 17 6.17251V4.00001C17.1625 4.00001 17.325 4.00001 17.4875 4.01251C19.2608 4.11409 20.9649 4.73627 22.3864 5.80124C23.808 6.86621 24.8841 8.32669 25.48 10H23C22.8533 9.99995 22.7084 10.0322 22.5755 10.0944C22.4426 10.1566 22.3251 10.2473 22.2312 10.36L19.0425 14.1875C18.3774 13.9397 17.6462 13.9351 16.9781 14.1744C16.3099 14.4138 15.748 14.8817 15.3916 15.4954C15.0352 16.1092 14.9073 16.8292 15.0306 17.5281C15.1538 18.227 15.5203 18.8598 16.0652 19.3146C16.61 19.7694 17.2981 20.0168 18.0078 20.0132C18.7175 20.0095 19.4031 19.755 19.9432 19.2947C20.4834 18.8343 20.8433 18.1977 20.9594 17.4976C21.0754 16.7974 20.9402 16.0788 20.5775 15.4688L23.4687 12H25.9425C25.9725 12.26 25.9908 12.5225 25.9975 12.7875C26.0286 14.2198 25.7187 15.639 25.0931 16.9278C24.4676 18.2167 23.5445 19.3383 22.4 20.2C22.2589 20.3057 22.1484 20.4469 22.0794 20.6091C22.0105 20.7713 21.9857 20.9489 22.0075 21.1238L23.0075 29.1238C23.0379 29.3653 23.1554 29.5874 23.3379 29.7485C23.5203 29.9095 23.7553 29.9985 23.9987 29.9988C24.0405 29.9988 24.0822 29.9962 24.1237 29.9913C24.2541 29.975 24.3799 29.9333 24.4942 29.8684C24.6084 29.8035 24.7087 29.7168 24.7893 29.6131C24.87 29.5094 24.9295 29.3909 24.9643 29.2643C24.9992 29.1376 25.0087 29.0054 24.9925 28.875L24.0625 21.4338ZM16 10C15.8022 10 15.6088 9.94136 15.4444 9.83148C15.28 9.7216 15.1518 9.56542 15.0761 9.38269C15.0004 9.19997 14.9806 8.9989 15.0192 8.80492C15.0578 8.61094 15.153 8.43275 15.2929 8.2929C15.4327 8.15305 15.6109 8.05781 15.8049 8.01922C15.9989 7.98064 16.1999 8.00044 16.3827 8.07613C16.5654 8.15182 16.7216 8.27999 16.8314 8.44444C16.9413 8.60889 17 8.80223 17 9.00001C17 9.26523 16.8946 9.51958 16.7071 9.70712C16.5195 9.89465 16.2652 10 16 10ZM18 18C17.8022 18 17.6088 17.9414 17.4444 17.8315C17.28 17.7216 17.1518 17.5654 17.0761 17.3827C17.0004 17.2 16.9806 16.9989 17.0192 16.8049C17.0578 16.6109 17.153 16.4328 17.2929 16.2929C17.4327 16.153 17.6109 16.0578 17.8049 16.0192C17.9989 15.9806 18.1999 16.0004 18.3827 16.0761C18.5654 16.1518 18.7216 16.28 18.8314 16.4444C18.9413 16.6089 19 16.8022 19 17C19 17.2652 18.8946 17.5196 18.7071 17.7071C18.5195 17.8947 18.2652 18 18 18Z",
332
- fill: color
333
- }
334
- )
335
- }
336
- );
337
-
338
- // src/assets/icons/subjects/Microscope.tsx
339
- var import_jsx_runtime9 = require("react/jsx-runtime");
340
- var Microscope = ({
341
- size,
342
- color
343
- }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
344
- "svg",
345
- {
346
- width: size,
347
- height: size,
348
- viewBox: "0 0 32 32",
349
- fill: "none",
350
- xmlns: "http://www.w3.org/2000/svg",
351
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
352
- "path",
353
- {
354
- d: "M28 26H25.4925C26.7637 24.4552 27.5898 22.5932 27.882 20.6142C28.1743 18.6351 27.9216 16.6138 27.1511 14.7676C26.3806 12.9213 25.1215 11.32 23.5092 10.1358C21.8968 8.95153 19.9922 8.22913 18 8.04625V4C18 3.46957 17.7893 2.96086 17.4142 2.58579C17.0391 2.21071 16.5304 2 16 2H10C9.46957 2 8.96086 2.21071 8.58579 2.58579C8.21071 2.96086 8 3.46957 8 4V17C8 17.5304 8.21071 18.0391 8.58579 18.4142C8.96086 18.7893 9.46957 19 10 19H16C16.5304 19 17.0391 18.7893 17.4142 18.4142C17.7893 18.0391 18 17.5304 18 17V10.0575C19.7643 10.2552 21.4306 10.9703 22.7895 12.1128C24.1483 13.2553 25.1389 14.7742 25.6366 16.4783C26.1343 18.1824 26.1169 19.9957 25.5866 21.69C25.0563 23.3842 24.0368 24.8838 22.6562 26H4C3.73478 26 3.48043 26.1054 3.29289 26.2929C3.10536 26.4804 3 26.7348 3 27C3 27.2652 3.10536 27.5196 3.29289 27.7071C3.48043 27.8946 3.73478 28 4 28H28C28.2652 28 28.5196 27.8946 28.7071 27.7071C28.8946 27.5196 29 27.2652 29 27C29 26.7348 28.8946 26.4804 28.7071 26.2929C28.5196 26.1054 28.2652 26 28 26ZM16 17H10V4H16V17ZM9 23C8.73478 23 8.48043 22.8946 8.29289 22.7071C8.10536 22.5196 8 22.2652 8 22C8 21.7348 8.10536 21.4804 8.29289 21.2929C8.48043 21.1054 8.73478 21 9 21H17C17.2652 21 17.5196 21.1054 17.7071 21.2929C17.8946 21.4804 18 21.7348 18 22C18 22.2652 17.8946 22.5196 17.7071 22.7071C17.5196 22.8946 17.2652 23 17 23H9Z",
355
- fill: color
356
- }
357
- )
358
- }
359
- );
360
-
361
- // src/components/SubjectInfo/SubjectInfo.tsx
362
- var import_phosphor_react = require("phosphor-react");
363
- var import_jsx_runtime10 = require("react/jsx-runtime");
364
- var SubjectInfo = {
365
- ["F\xEDsica" /* FISICA */]: {
366
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.Atom, { size: 17, color: "currentColor" }),
367
- colorClass: "bg-subject-1",
368
- name: "F\xEDsica" /* FISICA */
369
- },
370
- ["Hist\xF3ria" /* HISTORIA */]: {
371
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.Scroll, { size: 17, color: "currentColor" }),
372
- colorClass: "bg-subject-2",
373
- name: "Hist\xF3ria" /* HISTORIA */
374
- },
375
- ["Literatura" /* LITERATURA */]: {
376
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(BookOpenText, { size: 17, color: "currentColor" }),
377
- colorClass: "bg-subject-3",
378
- name: "Literatura" /* LITERATURA */
379
- },
380
- ["Geografia" /* GEOGRAFIA */]: {
381
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.GlobeHemisphereWest, { size: 17, color: "currentColor" }),
382
- colorClass: "bg-subject-4",
383
- name: "Geografia" /* GEOGRAFIA */
384
- },
385
- ["Biologia" /* BIOLOGIA */]: {
386
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Microscope, { size: 17, color: "currentColor" }),
387
- colorClass: "bg-subject-5",
388
- name: "Biologia" /* BIOLOGIA */
389
- },
390
- ["Portugu\xEAs" /* PORTUGUES */]: {
391
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChatPT, { size: 17, color: "currentColor" }),
392
- colorClass: "bg-subject-6",
393
- name: "Portugu\xEAs" /* PORTUGUES */
394
- },
395
- ["Qu\xEDmica" /* QUIMICA */]: {
396
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.Flask, { size: 17, color: "currentColor" }),
397
- colorClass: "bg-subject-7",
398
- name: "Qu\xEDmica" /* QUIMICA */
399
- },
400
- ["Artes" /* ARTES */]: {
401
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.Palette, { size: 17, color: "currentColor" }),
402
- colorClass: "bg-subject-8",
403
- name: "Artes" /* ARTES */
404
- },
405
- ["Matem\xE1tica" /* MATEMATICA */]: {
406
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.MathOperations, { size: 17, color: "currentColor" }),
407
- colorClass: "bg-subject-9",
408
- name: "Matem\xE1tica" /* MATEMATICA */
409
- },
410
- ["Filosofia" /* FILOSOFIA */]: {
411
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HeadCircuit, { size: 17, color: "currentColor" }),
412
- colorClass: "bg-subject-10",
413
- name: "Filosofia" /* FILOSOFIA */
414
- },
415
- ["Espanhol" /* ESPANHOL */]: {
416
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChatES, { size: 17, color: "currentColor" }),
417
- colorClass: "bg-subject-11",
418
- name: "Espanhol" /* ESPANHOL */
419
- },
420
- ["Reda\xE7\xE3o" /* REDACAO */]: {
421
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.ArticleNyTimes, { size: 17, color: "currentColor" }),
422
- colorClass: "bg-subject-12",
423
- name: "Reda\xE7\xE3o" /* REDACAO */
424
- },
425
- ["Sociologia" /* SOCIOLOGIA */]: {
426
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.Person, { size: 17, color: "currentColor" }),
427
- colorClass: "bg-subject-13",
428
- name: "Sociologia" /* SOCIOLOGIA */
429
- },
430
- ["Ingl\xEAs" /* INGLES */]: {
431
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChatEN, { size: 17, color: "currentColor" }),
432
- colorClass: "bg-subject-14",
433
- name: "Ingl\xEAs" /* INGLES */
434
- },
435
- ["Ed. F\xEDsica" /* EDUCACAO_FISICA */]: {
436
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.DribbbleLogo, { size: 17, color: "currentColor" }),
437
- colorClass: "bg-subject-15",
438
- name: "Ed. F\xEDsica" /* EDUCACAO_FISICA */
439
- },
440
- ["Trilhas" /* TRILHAS */]: {
441
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.BookBookmark, { size: 17, color: "currentColor" }),
442
- colorClass: "bg-subject-16",
443
- name: "Trilhas" /* TRILHAS */
444
- }
445
- };
446
- var getSubjectInfo = (subject) => {
447
- return SubjectInfo[subject] || {
448
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react.Book, { size: 17, color: "currentColor" }),
449
- colorClass: "bg-subject-16",
450
- name: subject
451
- };
452
- };
453
-
454
- // src/types/recommendedLessons.ts
455
- var getStudentStatusBadgeAction = (status) => {
456
- const actionMap = {
457
- ["CONCLU\xCDDO" /* CONCLUIDO */]: "success",
458
- ["EM ANDAMENTO" /* EM_ANDAMENTO */]: "info",
459
- ["A INICIAR" /* A_INICIAR */]: "warning",
460
- ["N\xC3O FINALIZADO" /* NAO_FINALIZADO */]: "error"
461
- };
462
- return actionMap[status] ?? "warning";
463
- };
464
- var isDeadlinePassed = (deadline) => {
465
- if (!deadline) return false;
466
- return new Date(deadline) < /* @__PURE__ */ new Date();
467
- };
468
- var deriveStudentStatus = (progress, completedAt, deadline) => {
469
- if (completedAt) return "CONCLU\xCDDO" /* CONCLUIDO */;
470
- if (progress === 100) return "CONCLU\xCDDO" /* CONCLUIDO */;
471
- if (isDeadlinePassed(deadline ?? null) && progress < 100) {
472
- return "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
473
- }
474
- if (progress === 0) return "A INICIAR" /* A_INICIAR */;
475
- if (progress > 0) return "EM ANDAMENTO" /* EM_ANDAMENTO */;
476
- return "A INICIAR" /* A_INICIAR */;
477
- };
478
- var formatDaysToComplete = (daysToComplete) => {
479
- if (daysToComplete === null) return null;
480
- if (daysToComplete === 1) return "1 dia";
481
- return `${daysToComplete} dias`;
482
- };
483
-
484
- // src/components/RecommendedLessonDetails/utils/lessonDetailsUtils.ts
485
- var formatDate = (dateString) => {
486
- if (!dateString) return "-";
487
- const date = new Date(dateString);
488
- if (Number.isNaN(date.getTime())) return "-";
489
- return date.toLocaleDateString("pt-BR", {
490
- day: "2-digit",
491
- month: "2-digit",
492
- year: "numeric"
493
- });
494
- };
495
- var transformStudentForDisplay = (student, deadline) => ({
496
- id: student.userInstitutionId,
497
- name: student.name,
498
- status: deriveStudentStatus(student.progress, student.completedAt, deadline),
499
- completionPercentage: student.progress,
500
- duration: formatDaysToComplete(student.daysToComplete)
501
- });
502
-
503
- // src/components/RecommendedLessonDetails/components/LessonHeader.tsx
504
- var import_jsx_runtime11 = require("react/jsx-runtime");
505
- var LessonHeader = ({
506
- data,
507
- onViewLesson,
508
- mapSubjectNameToEnum,
509
- viewLessonLabel
510
- }) => {
511
- const { goal, breakdown } = data;
512
- const subjectName = goal.lessonsGoals[0]?.supLessonsProgress?.lesson?.subject?.name || "";
513
- const subjectEnum = mapSubjectNameToEnum?.(subjectName);
514
- const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
515
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4", children: [
516
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2", children: [
517
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
518
- Text_default,
519
- {
520
- as: "h1",
521
- size: "xl",
522
- weight: "bold",
523
- className: "text-text-950 lg:text-2xl",
524
- children: goal.title
525
- }
526
- ),
527
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-wrap items-center gap-2 text-sm text-text-600", children: [
528
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
529
- "In\xEDcio em ",
530
- formatDate(goal.startDate)
531
- ] }),
532
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
533
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
534
- "Prazo final ",
535
- formatDate(goal.finalDate)
536
- ] }),
537
- breakdown?.schoolName && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
538
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
539
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.schoolName })
540
- ] }),
541
- subjectName && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
542
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
543
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text_default, { as: "span", size: "sm", className: "flex items-center gap-1", children: [
544
- subjectInfo && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
545
- Text_default,
546
- {
547
- as: "span",
548
- className: cn(
549
- "size-5 rounded flex items-center justify-center text-white",
550
- subjectInfo.colorClass
551
- ),
552
- children: subjectInfo.icon
553
- }
554
- ),
555
- subjectName
556
- ] })
557
- ] }),
558
- breakdown?.className && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
559
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
560
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.className })
561
- ] })
562
- ] })
563
- ] }),
564
- onViewLesson && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
565
- Button_default,
566
- {
567
- variant: "solid",
568
- action: "primary",
569
- size: "small",
570
- iconLeft: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react2.BookBookmarkIcon, { size: 16 }),
571
- onClick: onViewLesson,
572
- children: viewLessonLabel
573
- }
574
- )
575
- ] }) });
576
- };
577
-
578
- // src/components/Skeleton/Skeleton.tsx
579
- var import_react3 = require("react");
580
- var import_jsx_runtime12 = require("react/jsx-runtime");
581
- var SKELETON_ANIMATION_CLASSES = {
582
- pulse: "animate-pulse",
583
- none: ""
584
- };
585
- var SKELETON_VARIANT_CLASSES = {
586
- text: "h-4 bg-background-200 rounded",
587
- circular: "bg-background-200 rounded-full",
588
- rectangular: "bg-background-200",
589
- rounded: "bg-background-200 rounded-lg"
590
- };
591
- var SPACING_CLASSES = {
592
- none: "",
593
- small: "space-y-1",
594
- medium: "space-y-2",
595
- large: "space-y-3"
596
- };
597
- var Skeleton = (0, import_react3.forwardRef)(
598
- ({
599
- variant = "text",
600
- width,
601
- height,
602
- animation = "pulse",
603
- lines = 1,
604
- spacing = "none",
605
- className = "",
606
- children,
607
- ...props
608
- }, ref) => {
609
- const animationClass = SKELETON_ANIMATION_CLASSES[animation];
610
- const variantClass = SKELETON_VARIANT_CLASSES[variant];
611
- const spacingClass = SPACING_CLASSES[spacing];
612
- const style = {
613
- width: typeof width === "number" ? `${width}px` : width,
614
- height: typeof height === "number" ? `${height}px` : height
615
- };
616
- if (variant === "text" && lines > 1) {
617
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
618
- "div",
619
- {
620
- ref,
621
- className: cn("flex flex-col", spacingClass, className),
622
- ...props,
623
- children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
624
- "div",
625
- {
626
- className: cn(variantClass, animationClass),
627
- style: index === lines - 1 ? { width: "60%" } : void 0
628
- },
629
- index
630
- ))
631
- }
632
- );
633
- }
634
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
635
- "div",
636
- {
637
- ref,
638
- className: cn(variantClass, animationClass, className),
639
- style,
640
- ...props,
641
- children
642
- }
643
- );
644
- }
645
- );
646
- var SkeletonText = (0, import_react3.forwardRef)(
647
- (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Skeleton, { ref, variant: "text", ...props })
648
- );
649
- var SkeletonCircle = (0, import_react3.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Skeleton, { ref, variant: "circular", ...props }));
650
- var SkeletonRectangle = (0, import_react3.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Skeleton, { ref, variant: "rectangular", ...props }));
651
- var SkeletonRounded = (0, import_react3.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Skeleton, { ref, variant: "rounded", ...props }));
652
- var SkeletonCard = (0, import_react3.forwardRef)(
653
- ({
654
- showAvatar = true,
655
- showTitle = true,
656
- showDescription = true,
657
- showActions = true,
658
- lines = 2,
659
- className = "",
660
- ...props
661
- }, ref) => {
662
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
663
- "div",
664
- {
665
- ref,
666
- className: cn(
667
- "w-full p-4 bg-background border border-border-200 rounded-lg",
668
- className
669
- ),
670
- ...props,
671
- children: [
672
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-start space-x-3", children: [
673
- showAvatar && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonCircle, { width: 40, height: 40 }),
674
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-1 space-y-2", children: [
675
- showTitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonText, { width: "60%", height: 20 }),
676
- showDescription && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonText, { lines, spacing: "small" })
677
- ] })
678
- ] }),
679
- showActions && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-end space-x-2 mt-4", children: [
680
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonRectangle, { width: 80, height: 32 }),
681
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonRectangle, { width: 80, height: 32 })
682
- ] })
683
- ]
684
- }
685
- );
686
- }
687
- );
688
- var SkeletonList = (0, import_react3.forwardRef)(
689
- ({
690
- items = 3,
691
- showAvatar = true,
692
- showTitle = true,
693
- showDescription = true,
694
- lines = 1,
695
- className = "",
696
- ...props
697
- }, ref) => {
698
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref, className: cn("space-y-3", className), ...props, children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-start space-x-3 p-3", children: [
699
- showAvatar && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonCircle, { width: 32, height: 32 }),
700
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-1 space-y-2", children: [
701
- showTitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonText, { width: "40%", height: 16 }),
702
- showDescription && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonText, { lines, spacing: "small" })
703
- ] })
704
- ] }, index)) });
705
- }
706
- );
707
- var SkeletonTable = (0, import_react3.forwardRef)(
708
- ({ rows = 5, columns = 4, showHeader = true, className = "", ...props }, ref) => {
709
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { ref, className: cn("w-full", className), ...props, children: [
710
- showHeader && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex space-x-2 mb-3", children: Array.from({ length: columns }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
711
- SkeletonText,
712
- {
713
- width: `${100 / columns}%`,
714
- height: 20
715
- },
716
- index
717
- )) }),
718
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-2", children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex space-x-2", children: Array.from({ length: columns }, (_2, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
719
- SkeletonText,
720
- {
721
- width: `${100 / columns}%`,
722
- height: 16
723
- },
724
- colIndex
725
- )) }, rowIndex)) })
726
- ] });
727
- }
728
- );
729
-
730
- // src/components/RecommendedLessonDetails/components/LoadingSkeleton.tsx
731
- var import_jsx_runtime13 = require("react/jsx-runtime");
732
- var LoadingSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-6", children: [
733
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonText, { width: 256 }),
734
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-3", children: [
735
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonText, { width: "75%", height: 28 }),
736
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonText, { width: "50%" })
737
- ] }) }),
738
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-4", children: [
739
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonText, { width: 192, height: 20 }),
740
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
741
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonRounded, { height: 140 }),
742
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonRounded, { height: 140 }),
743
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonRounded, { height: 140 })
744
- ] })
745
- ] }),
746
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SkeletonTable, { rows: 4, columns: 5 }) })
747
- ] });
748
-
749
- // src/components/RecommendedLessonDetails/components/ResultsSection.tsx
750
- var import_react4 = require("@phosphor-icons/react");
751
-
752
- // src/components/ProgressCircle/ProgressCircle.tsx
753
- var import_jsx_runtime14 = require("react/jsx-runtime");
754
- var SIZE_CLASSES2 = {
755
- small: {
756
- container: "w-[107px] h-[107px]",
757
- // 107px circle to fit labels like "CONCLUÍDO"
758
- strokeWidth: 4,
759
- // 4px stroke width - matches ProgressBar small (h-1)
760
- textSize: "2xl",
761
- // 24px for percentage (font-size: 24px)
762
- textWeight: "medium",
763
- // font-weight: 500
764
- labelSize: "2xs",
765
- // 10px for status label
766
- labelWeight: "bold",
767
- // font-weight: 700
768
- spacing: "gap-0",
769
- // Reduced gap between percentage and label for better spacing
770
- contentWidth: "max-w-[85px]"
771
- // Width to fit labels like "CONCLUÍDO" inside circle
772
- },
773
- medium: {
774
- container: "w-[152px] h-[152px]",
775
- // 151.67px ≈ 152px circle from design specs
776
- strokeWidth: 8,
777
- // 8px stroke width - matches ProgressBar medium (h-2)
778
- textSize: "2xl",
779
- // 24px for percentage (font-size: 24px)
780
- textWeight: "medium",
781
- // font-weight: 500
782
- labelSize: "xs",
783
- // 12px for status label (font-size: 12px)
784
- labelWeight: "medium",
785
- // font-weight: 500 (changed from bold)
786
- spacing: "gap-1",
787
- // 4px gap between percentage and label
788
- contentWidth: "max-w-[90px]"
789
- // Reduced width to fit text inside circle
790
- }
791
- };
792
- var VARIANT_CLASSES = {
793
- blue: {
794
- background: "stroke-primary-100",
795
- // Light blue background (#BBDCF7)
796
- fill: "stroke-primary-700",
797
- // Blue for activity progress (#2271C4)
798
- textColor: "text-primary-700",
799
- // Blue text color (#2271C4)
800
- labelColor: "text-text-700"
801
- // Gray text for label (#525252)
802
- },
803
- green: {
804
- background: "stroke-background-300",
805
- // Gray background (#D5D4D4 - matches design)
806
- fill: "stroke-success-200",
807
- // Green for performance (#84D3A2 - matches design)
808
- textColor: "text-text-800",
809
- // Dark gray text (#404040 - matches design)
810
- labelColor: "text-text-600"
811
- // Medium gray text for label (#737373 - matches design)
812
- }
813
- };
814
- var ProgressCircle = ({
815
- value,
816
- max = 100,
817
- size = "small",
818
- variant = "blue",
819
- label,
820
- showPercentage = true,
821
- className = "",
822
- labelClassName = "",
823
- percentageClassName = ""
824
- }) => {
825
- const safeValue = isNaN(value) ? 0 : value;
826
- const clampedValue = Math.max(0, Math.min(safeValue, max));
827
- const percentage = max === 0 ? 0 : clampedValue / max * 100;
828
- const sizeClasses = SIZE_CLASSES2[size];
829
- const variantClasses = VARIANT_CLASSES[variant];
830
- const radius = size === "small" ? 49 : 64;
831
- const circumference = 2 * Math.PI * radius;
832
- const strokeDashoffset = circumference - percentage / 100 * circumference;
833
- const center = size === "small" ? 53.5 : 76;
834
- const svgSize = size === "small" ? 107 : 152;
835
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
836
- "div",
837
- {
838
- className: cn(
839
- "relative flex flex-col items-center justify-center",
840
- sizeClasses.container,
841
- "rounded-lg",
842
- className
843
- ),
844
- children: [
845
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
846
- "svg",
847
- {
848
- className: "absolute inset-0 transform -rotate-90",
849
- width: svgSize,
850
- height: svgSize,
851
- viewBox: `0 0 ${svgSize} ${svgSize}`,
852
- "aria-hidden": "true",
853
- children: [
854
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
855
- "circle",
856
- {
857
- cx: center,
858
- cy: center,
859
- r: radius,
860
- fill: "none",
861
- strokeWidth: sizeClasses.strokeWidth,
862
- className: cn(variantClasses.background, "rounded-lg")
863
- }
864
- ),
865
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
866
- "circle",
867
- {
868
- cx: center,
869
- cy: center,
870
- r: radius,
871
- fill: "none",
872
- strokeWidth: sizeClasses.strokeWidth,
873
- strokeLinecap: "round",
874
- strokeDasharray: circumference,
875
- strokeDashoffset,
876
- className: cn(
877
- variantClasses.fill,
878
- "transition-all duration-500 ease-out shadow-soft-shadow-3 rounded-lg"
879
- )
880
- }
881
- )
882
- ]
883
- }
884
- ),
885
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
886
- "progress",
887
- {
888
- value: clampedValue,
889
- max,
890
- "aria-label": typeof label === "string" ? label : "Progress",
891
- className: "absolute opacity-0 w-0 h-0"
892
- }
893
- ),
894
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
895
- "div",
896
- {
897
- className: cn(
898
- "relative z-10 flex flex-col items-center justify-center",
899
- sizeClasses.spacing,
900
- sizeClasses.contentWidth
901
- ),
902
- children: [
903
- showPercentage && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
904
- Text_default,
905
- {
906
- size: sizeClasses.textSize,
907
- weight: sizeClasses.textWeight,
908
- className: cn(
909
- "text-center w-full",
910
- variantClasses.textColor,
911
- percentageClassName
912
- ),
913
- children: [
914
- Math.round(percentage),
915
- "%"
916
- ]
917
- }
918
- ),
919
- label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
920
- Text_default,
921
- {
922
- as: "span",
923
- size: sizeClasses.labelSize,
924
- weight: sizeClasses.labelWeight,
925
- className: cn(
926
- variantClasses.labelColor,
927
- "text-center uppercase tracking-wide truncate w-full",
928
- labelClassName
929
- ),
930
- children: label
931
- }
932
- )
933
- ]
934
- }
935
- )
936
- ]
937
- }
938
- );
939
- };
940
- var ProgressCircle_default = ProgressCircle;
941
-
942
- // src/components/RecommendedLessonDetails/components/ResultsSection.tsx
943
- var import_jsx_runtime15 = require("react/jsx-runtime");
944
- var ResultsSection = ({ data, labels }) => {
945
- const { details } = data;
946
- const { aggregated, contentPerformance } = details;
947
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col gap-4", children: [
948
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text_default, { as: "h2", size: "md", weight: "semibold", className: "text-text-950", children: labels.resultsTitle }),
949
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
950
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-primary-50", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
951
- ProgressCircle_default,
952
- {
953
- value: aggregated.completionPercentage,
954
- size: "small",
955
- variant: "blue",
956
- label: labels.completedLabel,
957
- showPercentage: true
958
- }
959
- ) }),
960
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-success-200", children: [
961
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
962
- Text_default,
963
- {
964
- as: "span",
965
- className: "size-8 rounded-full flex items-center justify-center bg-warning-300 mb-2",
966
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react4.TrophyIcon, { size: 18, weight: "fill", className: "text-white" })
967
- }
968
- ),
969
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
970
- Text_default,
971
- {
972
- size: "2xs",
973
- weight: "bold",
974
- className: "text-text-700 uppercase text-center leading-none mb-1",
975
- children: labels.bestResultLabel
976
- }
977
- ),
978
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
979
- Text_default,
980
- {
981
- size: "xl",
982
- weight: "bold",
983
- className: "text-success-700 text-center leading-none tracking-wide",
984
- children: contentPerformance.best?.contentName || "-"
985
- }
986
- )
987
- ] }),
988
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-error-100", children: [
989
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
990
- Text_default,
991
- {
992
- as: "span",
993
- className: "size-8 rounded-full flex items-center justify-center bg-error-300 mb-2",
994
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react4.WarningIcon, { size: 18, weight: "fill", className: "text-error-700" })
995
- }
996
- ),
997
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
998
- Text_default,
999
- {
1000
- size: "2xs",
1001
- weight: "bold",
1002
- className: "text-text-700 uppercase text-center leading-none mb-1",
1003
- children: labels.hardestTopicLabel
1004
- }
1005
- ),
1006
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1007
- Text_default,
1008
- {
1009
- size: "xl",
1010
- weight: "bold",
1011
- className: "text-error-700 text-center leading-none tracking-wide",
1012
- children: contentPerformance.worst?.contentName || "-"
1013
- }
1014
- )
1015
- ] })
1016
- ] }) })
1017
- ] });
1018
- };
1019
-
1020
- // src/components/RecommendedLessonDetails/components/StudentsTable.tsx
1021
- var import_react6 = require("react");
1022
- var import_react7 = require("@phosphor-icons/react");
1023
-
1024
- // src/components/Badge/Badge.tsx
1025
- var import_phosphor_react2 = require("phosphor-react");
1026
- var import_jsx_runtime16 = require("react/jsx-runtime");
1027
- var VARIANT_ACTION_CLASSES2 = {
1028
- solid: {
1029
- error: "bg-error-background text-error-700 focus-visible:outline-none",
1030
- warning: "bg-warning text-warning-800 focus-visible:outline-none",
1031
- success: "bg-success text-success-800 focus-visible:outline-none",
1032
- info: "bg-info text-info-800 focus-visible:outline-none",
1033
- muted: "bg-background-muted text-background-800 focus-visible:outline-none"
1034
- },
1035
- outlined: {
1036
- error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
1037
- warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
1038
- success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
1039
- info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
1040
- muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
1041
- },
1042
- exams: {
1043
- exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
1044
- exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
1045
- exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
1046
- exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
1047
- },
1048
- examsOutlined: {
1049
- exam1: "bg-exam-1 text-info-700 border border-info-700 focus-visible:outline-none",
1050
- exam2: "bg-exam-2 text-typography-1 border border-typography-1 focus-visible:outline-none",
1051
- exam3: "bg-exam-3 text-typography-2 border border-typography-2 focus-visible:outline-none",
1052
- exam4: "bg-exam-4 text-success-700 border border-success-700 focus-visible:outline-none"
1053
- },
1054
- resultStatus: {
1055
- negative: "bg-error text-error-800 focus-visible:outline-none",
1056
- positive: "bg-success text-success-800 focus-visible:outline-none"
1057
- },
1058
- notification: "text-primary"
1059
- };
1060
- var SIZE_CLASSES3 = {
1061
- small: "text-2xs px-2 py-1",
1062
- medium: "text-xs px-2 py-1",
1063
- large: "text-sm px-2 py-1"
1064
- };
1065
- var SIZE_CLASSES_ICON = {
1066
- small: "size-3",
1067
- medium: "size-3.5",
1068
- large: "size-4"
1069
- };
1070
- var Badge = ({
1071
- children,
1072
- iconLeft,
1073
- iconRight,
1074
- size = "medium",
1075
- variant = "solid",
1076
- action = "error",
1077
- className = "",
1078
- notificationActive = false,
1079
- ...props
1080
- }) => {
1081
- const sizeClasses = SIZE_CLASSES3[size];
1082
- const sizeClassesIcon = SIZE_CLASSES_ICON[size];
1083
- const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
1084
- const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
1085
- const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
1086
- const baseClassesIcon = "flex items-center";
1087
- if (variant === "notification") {
1088
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1089
- "div",
1090
- {
1091
- className: cn(baseClasses, variantClasses, sizeClasses, className),
1092
- ...props,
1093
- children: [
1094
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_phosphor_react2.Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
1095
- notificationActive && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1096
- "span",
1097
- {
1098
- "data-testid": "notification-dot",
1099
- className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
1100
- }
1101
- )
1102
- ]
1103
- }
1104
- );
1105
- }
1106
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1107
- "div",
1108
- {
1109
- className: cn(baseClasses, variantClasses, sizeClasses, className),
1110
- ...props,
1111
- children: [
1112
- iconLeft && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
1113
- children,
1114
- iconRight && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
1115
- ]
1116
- }
1117
- );
1118
- };
1119
- var Badge_default = Badge;
1120
-
1121
- // src/components/ProgressBar/ProgressBar.tsx
1122
- var import_jsx_runtime17 = require("react/jsx-runtime");
1123
- var SIZE_CLASSES4 = {
1124
- small: {
1125
- container: "h-1",
1126
- // 4px height (h-1 = 4px in Tailwind)
1127
- bar: "h-1",
1128
- // 4px height for the fill bar
1129
- spacing: "gap-2",
1130
- // 8px gap between label and progress bar
1131
- layout: "flex-col",
1132
- // vertical layout for small
1133
- borderRadius: "rounded-full"
1134
- // 9999px border radius
1135
- },
1136
- medium: {
1137
- container: "h-2",
1138
- // 8px height (h-2 = 8px in Tailwind)
1139
- bar: "h-2",
1140
- // 8px height for the fill bar
1141
- spacing: "gap-2",
1142
- // 8px gap between progress bar and label
1143
- layout: "flex-row items-center",
1144
- // horizontal layout for medium
1145
- borderRadius: "rounded-lg"
1146
- // 8px border radius
1147
- }
1148
- };
1149
- var VARIANT_CLASSES2 = {
1150
- blue: {
1151
- background: "bg-background-300",
1152
- // Background track color (#D5D4D4)
1153
- fill: "bg-primary-700"
1154
- // Blue for activity progress (#2271C4)
1155
- },
1156
- green: {
1157
- background: "bg-background-300",
1158
- // Background track color (#D5D4D4)
1159
- fill: "bg-success-200"
1160
- // Green for performance (#84D3A2)
1161
- }
1162
- };
1163
- var calculateProgressValues = (value, max) => {
1164
- const safeValue = isNaN(value) ? 0 : value;
1165
- const clampedValue = Math.max(0, Math.min(safeValue, max));
1166
- const percentage = max === 0 ? 0 : clampedValue / max * 100;
1167
- return { clampedValue, percentage };
1168
- };
1169
- var shouldShowHeader = (label, showPercentage, showHitCount) => {
1170
- return !!(label || showPercentage || showHitCount);
1171
- };
1172
- var getDisplayPriority = (showHitCount, showPercentage, label, clampedValue, max, percentage) => {
1173
- if (showHitCount) {
1174
- return {
1175
- type: "hitCount",
1176
- content: `${Math.round(clampedValue)} de ${max}`,
1177
- hasMetrics: true
1178
- };
1179
- }
1180
- if (showPercentage) {
1181
- return {
1182
- type: "percentage",
1183
- content: `${Math.round(percentage)}%`,
1184
- hasMetrics: true
1185
- };
1186
- }
1187
- return {
1188
- type: "label",
1189
- content: label,
1190
- hasMetrics: false
1191
- };
1192
- };
1193
- var getCompactLayoutConfig = ({
1194
- showPercentage,
1195
- showHitCount,
1196
- percentage,
1197
- clampedValue,
1198
- max,
1199
- label,
1200
- percentageClassName,
1201
- labelClassName
1202
- }) => {
1203
- const displayPriority = getDisplayPriority(
1204
- showHitCount,
1205
- showPercentage,
1206
- label,
1207
- clampedValue,
1208
- max,
1209
- percentage
1210
- );
1211
- return {
1212
- color: displayPriority.hasMetrics ? "text-primary-600" : "text-primary-700",
1213
- className: displayPriority.hasMetrics ? percentageClassName : labelClassName,
1214
- content: displayPriority.content
1215
- };
1216
- };
1217
- var getDefaultLayoutDisplayConfig = (size, label, showPercentage) => ({
1218
- showHeader: size === "small" && !!(label || showPercentage),
1219
- showPercentage: size === "medium" && showPercentage,
1220
- showLabel: size === "medium" && !!label && !showPercentage
1221
- // Only show label when percentage is not shown
1222
- });
1223
- var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue, max, percentage, percentageClassName) => {
1224
- if (!showHitCount && !showPercentage) return null;
1225
- const displayPriority = getDisplayPriority(
1226
- showHitCount,
1227
- showPercentage,
1228
- null,
1229
- // label is not relevant for stacked layout metrics display
1230
- clampedValue,
1231
- max,
1232
- percentage
1233
- );
1234
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1235
- "div",
1236
- {
1237
- className: cn(
1238
- "text-xs font-medium leading-[14px] text-right",
1239
- percentageClassName
1240
- ),
1241
- children: displayPriority.type === "hitCount" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
1242
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-success-200", children: Math.round(clampedValue) }),
1243
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "text-text-600", children: [
1244
- " de ",
1245
- max
1246
- ] })
1247
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text_default, { size: "xs", weight: "medium", className: "text-success-200", children: [
1248
- Math.round(percentage),
1249
- "%"
1250
- ] })
1251
- }
1252
- );
1253
- };
1254
- var ProgressBarBase = ({
1255
- clampedValue,
1256
- max,
1257
- percentage,
1258
- label,
1259
- variantClasses,
1260
- containerClassName,
1261
- fillClassName
1262
- }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1263
- "div",
1264
- {
1265
- className: cn(
1266
- containerClassName,
1267
- variantClasses.background,
1268
- "overflow-hidden relative"
1269
- ),
1270
- children: [
1271
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1272
- "progress",
1273
- {
1274
- value: clampedValue,
1275
- max,
1276
- "aria-label": typeof label === "string" ? `${label}: ${Math.round(percentage)}% complete` : `Progress: ${Math.round(percentage)}% of ${max}`,
1277
- className: "absolute inset-0 w-full h-full opacity-0"
1278
- }
1279
- ),
1280
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1281
- "div",
1282
- {
1283
- className: cn(
1284
- fillClassName,
1285
- variantClasses.fill,
1286
- "transition-all duration-300 ease-out"
1287
- ),
1288
- style: { width: `${percentage}%` }
1289
- }
1290
- )
1291
- ]
1292
- }
1293
- );
1294
- var StackedLayout = ({
1295
- className,
1296
- label,
1297
- showPercentage,
1298
- showHitCount,
1299
- labelClassName,
1300
- percentageClassName,
1301
- clampedValue,
1302
- max,
1303
- percentage,
1304
- variantClasses,
1305
- dimensions
1306
- }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1307
- "div",
1308
- {
1309
- className: cn(
1310
- "flex flex-col items-start gap-2",
1311
- dimensions.width,
1312
- dimensions.height,
1313
- className
1314
- ),
1315
- children: [
1316
- shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
1317
- label && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1318
- Text_default,
1319
- {
1320
- as: "div",
1321
- size: "md",
1322
- weight: "medium",
1323
- className: cn("text-text-600 leading-[19px]", labelClassName),
1324
- children: label
1325
- }
1326
- ),
1327
- renderStackedHitCountDisplay(
1328
- showHitCount,
1329
- showPercentage,
1330
- clampedValue,
1331
- max,
1332
- percentage,
1333
- percentageClassName
1334
- )
1335
- ] }),
1336
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1337
- ProgressBarBase,
1338
- {
1339
- clampedValue,
1340
- max,
1341
- percentage,
1342
- label,
1343
- variantClasses,
1344
- containerClassName: "w-full h-2 rounded-lg",
1345
- fillClassName: "h-2 rounded-lg shadow-hard-shadow-3"
1346
- }
1347
- )
1348
- ]
1349
- }
1350
- );
1351
- var CompactLayout = ({
1352
- className,
1353
- label,
1354
- showPercentage,
1355
- showHitCount,
1356
- labelClassName,
1357
- percentageClassName,
1358
- clampedValue,
1359
- max,
1360
- percentage,
1361
- variantClasses,
1362
- dimensions
1363
- }) => {
1364
- const {
1365
- color,
1366
- className: compactClassName,
1367
- content
1368
- } = getCompactLayoutConfig({
1369
- showPercentage,
1370
- showHitCount,
1371
- percentage,
1372
- clampedValue,
1373
- max,
1374
- label,
1375
- percentageClassName,
1376
- labelClassName
1377
- });
1378
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1379
- "div",
1380
- {
1381
- className: cn(
1382
- "flex flex-col items-start gap-1",
1383
- dimensions.width,
1384
- dimensions.height,
1385
- className
1386
- ),
1387
- children: [
1388
- shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1389
- Text_default,
1390
- {
1391
- as: "div",
1392
- size: "sm",
1393
- weight: "medium",
1394
- color,
1395
- className: cn("leading-4 w-full", compactClassName),
1396
- children: content
1397
- }
1398
- ),
1399
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1400
- ProgressBarBase,
1401
- {
1402
- clampedValue,
1403
- max,
1404
- percentage,
1405
- label,
1406
- variantClasses,
1407
- containerClassName: "w-full h-1 rounded-full",
1408
- fillClassName: "h-1 rounded-full"
1409
- }
1410
- )
1411
- ]
1412
- }
1413
- );
1414
- };
1415
- var DefaultLayout = ({
1416
- className,
1417
- size,
1418
- sizeClasses,
1419
- variantClasses,
1420
- label,
1421
- showPercentage,
1422
- labelClassName,
1423
- percentageClassName,
1424
- clampedValue,
1425
- max,
1426
- percentage
1427
- }) => {
1428
- const gapClass = size === "medium" ? "gap-2" : sizeClasses.spacing;
1429
- const progressBarClass = size === "medium" ? "flex-grow" : "w-full";
1430
- const displayConfig = getDefaultLayoutDisplayConfig(
1431
- size,
1432
- label,
1433
- showPercentage
1434
- );
1435
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("flex", sizeClasses.layout, gapClass, className), children: [
1436
- displayConfig.showHeader && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-row items-center justify-between w-full", children: [
1437
- label && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1438
- Text_default,
1439
- {
1440
- as: "div",
1441
- size: "xs",
1442
- weight: "medium",
1443
- className: cn(
1444
- "text-text-950 leading-none tracking-normal text-center",
1445
- labelClassName
1446
- ),
1447
- children: label
1448
- }
1449
- ),
1450
- showPercentage && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1451
- Text_default,
1452
- {
1453
- size: "xs",
1454
- weight: "medium",
1455
- className: cn(
1456
- "text-text-950 leading-none tracking-normal text-center",
1457
- percentageClassName
1458
- ),
1459
- children: [
1460
- Math.round(percentage),
1461
- "%"
1462
- ]
1463
- }
1464
- )
1465
- ] }),
1466
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1467
- ProgressBarBase,
1468
- {
1469
- clampedValue,
1470
- max,
1471
- percentage,
1472
- label,
1473
- variantClasses,
1474
- containerClassName: cn(
1475
- progressBarClass,
1476
- sizeClasses.container,
1477
- sizeClasses.borderRadius
1478
- ),
1479
- fillClassName: cn(
1480
- sizeClasses.bar,
1481
- sizeClasses.borderRadius,
1482
- "shadow-hard-shadow-3"
1483
- )
1484
- }
1485
- ),
1486
- displayConfig.showPercentage && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1487
- Text_default,
1488
- {
1489
- size: "xs",
1490
- weight: "medium",
1491
- className: cn(
1492
- "text-text-950 leading-none tracking-normal text-center flex-none",
1493
- percentageClassName
1494
- ),
1495
- children: [
1496
- Math.round(percentage),
1497
- "%"
1498
- ]
1499
- }
1500
- ),
1501
- displayConfig.showLabel && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1502
- Text_default,
1503
- {
1504
- as: "div",
1505
- size: "xs",
1506
- weight: "medium",
1507
- className: cn(
1508
- "text-text-950 leading-none tracking-normal text-center flex-none",
1509
- labelClassName
1510
- ),
1511
- children: label
1512
- }
1513
- )
1514
- ] });
1515
- };
1516
- var ProgressBar = ({
1517
- value,
1518
- max = 100,
1519
- size = "medium",
1520
- variant = "blue",
1521
- layout = "default",
1522
- label,
1523
- showPercentage = false,
1524
- showHitCount = false,
1525
- className = "",
1526
- labelClassName = "",
1527
- percentageClassName = "",
1528
- stackedWidth,
1529
- stackedHeight,
1530
- compactWidth,
1531
- compactHeight
1532
- }) => {
1533
- const { clampedValue, percentage } = calculateProgressValues(value, max);
1534
- const sizeClasses = SIZE_CLASSES4[size];
1535
- const variantClasses = VARIANT_CLASSES2[variant];
1536
- if (layout === "stacked") {
1537
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1538
- StackedLayout,
1539
- {
1540
- className,
1541
- label,
1542
- showPercentage,
1543
- showHitCount,
1544
- labelClassName,
1545
- percentageClassName,
1546
- clampedValue,
1547
- max,
1548
- percentage,
1549
- variantClasses,
1550
- dimensions: {
1551
- width: stackedWidth ?? "w-[380px]",
1552
- height: stackedHeight ?? "h-[35px]"
1553
- }
1554
- }
1555
- );
1556
- }
1557
- if (layout === "compact") {
1558
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1559
- CompactLayout,
1560
- {
1561
- className,
1562
- label,
1563
- showPercentage,
1564
- showHitCount,
1565
- labelClassName,
1566
- percentageClassName,
1567
- clampedValue,
1568
- max,
1569
- percentage,
1570
- variantClasses,
1571
- dimensions: {
1572
- width: compactWidth ?? "w-[131px]",
1573
- height: compactHeight ?? "h-[24px]"
1574
- }
1575
- }
1576
- );
1577
- }
1578
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1579
- DefaultLayout,
1580
- {
1581
- className,
1582
- size,
1583
- sizeClasses,
1584
- variantClasses,
1585
- label,
1586
- showPercentage,
1587
- labelClassName,
1588
- percentageClassName,
1589
- clampedValue,
1590
- max,
1591
- percentage
1592
- }
1593
- );
1594
- };
1595
- var ProgressBar_default = ProgressBar;
1596
-
1597
- // src/components/Table/Table.tsx
1598
- var import_react5 = require("react");
1599
- var import_phosphor_react3 = require("phosphor-react");
1600
-
1601
- // src/components/NoSearchResult/NoSearchResult.tsx
1602
- var import_jsx_runtime18 = require("react/jsx-runtime");
1603
- var NoSearchResult = ({ image, title, description }) => {
1604
- const displayTitle = title || "Nenhum resultado encontrado";
1605
- const displayDescription = description || "N\xE3o encontramos nenhum resultado com esse nome. Tente revisar a busca ou usar outra palavra-chave.";
1606
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-row justify-center items-center gap-8 w-full max-w-4xl min-h-96", children: [
1607
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w-72 h-72 flex-shrink-0 relative", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1608
- "img",
1609
- {
1610
- src: image,
1611
- alt: "No search results",
1612
- className: "w-full h-full object-contain"
1613
- }
1614
- ) }),
1615
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col items-start w-full max-w-md", children: [
1616
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-row justify-between items-end px-6 pt-6 pb-4 w-full rounded-t-xl", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1617
- Text_default,
1618
- {
1619
- as: "h2",
1620
- className: "text-text-950 font-semibold text-3xl leading-tight w-full flex items-center",
1621
- children: displayTitle
1622
- }
1623
- ) }),
1624
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-row justify-center items-center px-6 gap-2 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text_default, { className: "text-text-600 font-normal text-lg leading-relaxed w-full text-justify", children: displayDescription }) })
1625
- ] })
1626
- ] });
1627
- };
1628
- var NoSearchResult_default = NoSearchResult;
1629
-
1630
- // src/components/EmptyState/EmptyState.tsx
1631
- var import_jsx_runtime19 = require("react/jsx-runtime");
1632
- var EmptyState = ({
1633
- image,
1634
- title,
1635
- description,
1636
- buttonText,
1637
- buttonIcon,
1638
- onButtonClick,
1639
- buttonVariant = "solid",
1640
- buttonAction = "primary"
1641
- }) => {
1642
- const displayTitle = title || "Nenhum dado dispon\xEDvel";
1643
- const displayDescription = description || "N\xE3o h\xE1 dados para exibir no momento.";
1644
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col justify-center items-center gap-6 w-full min-h-[705px] bg-background rounded-xl p-6", children: [
1645
- image && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("img", { src: image, alt: displayTitle, className: "w-[170px] h-[150px]" }),
1646
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col items-center gap-4 w-full max-w-[600px] px-6", children: [
1647
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1648
- Text_default,
1649
- {
1650
- as: "h2",
1651
- className: "text-text-950 font-semibold text-3xl leading-[35px] text-center",
1652
- children: displayTitle
1653
- }
1654
- ),
1655
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text_default, { className: "text-text-600 font-normal text-[18px] leading-[27px] text-center", children: displayDescription })
1656
- ] }),
1657
- buttonText && onButtonClick && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1658
- Button_default,
1659
- {
1660
- variant: buttonVariant,
1661
- action: buttonAction,
1662
- size: "large",
1663
- onClick: onButtonClick,
1664
- iconLeft: buttonIcon,
1665
- className: "rounded-full px-5 py-2.5",
1666
- children: buttonText
1667
- }
1668
- )
1669
- ] });
1670
- };
1671
- var EmptyState_default = EmptyState;
1672
-
1673
- // src/components/Table/Table.tsx
1674
- var import_jsx_runtime20 = require("react/jsx-runtime");
1675
- function useTableSort(data, options = {}) {
1676
- const { syncWithUrl = false } = options;
1677
- const getInitialState = () => {
1678
- if (!syncWithUrl || globalThis.window === void 0) {
1679
- return { column: null, direction: null };
1680
- }
1681
- const params = new URLSearchParams(globalThis.location.search);
1682
- const sortBy = params.get("sortBy");
1683
- const sort = params.get("sort");
1684
- if (sortBy && sort && (sort === "ASC" || sort === "DESC")) {
1685
- return {
1686
- column: sortBy,
1687
- direction: sort.toLowerCase()
1688
- };
1689
- }
1690
- return { column: null, direction: null };
1691
- };
1692
- const initialState = getInitialState();
1693
- const [sortColumn, setSortColumn] = (0, import_react5.useState)(
1694
- initialState.column
1695
- );
1696
- const [sortDirection, setSortDirection] = (0, import_react5.useState)(
1697
- initialState.direction
1698
- );
1699
- (0, import_react5.useEffect)(() => {
1700
- if (!syncWithUrl || globalThis.window === void 0) return;
1701
- const url = new URL(globalThis.location.href);
1702
- const params = url.searchParams;
1703
- if (sortColumn && sortDirection) {
1704
- params.set("sortBy", sortColumn);
1705
- params.set("sort", sortDirection.toUpperCase());
1706
- } else {
1707
- params.delete("sortBy");
1708
- params.delete("sort");
1709
- }
1710
- globalThis.history.replaceState({}, "", url.toString());
1711
- }, [sortColumn, sortDirection, syncWithUrl]);
1712
- const handleSort = (column) => {
1713
- if (sortColumn === column) {
1714
- if (sortDirection === "asc") {
1715
- setSortDirection("desc");
1716
- } else if (sortDirection === "desc") {
1717
- setSortColumn(null);
1718
- setSortDirection(null);
1719
- }
1720
- } else {
1721
- setSortColumn(column);
1722
- setSortDirection("asc");
1723
- }
1724
- };
1725
- const sortedData = (0, import_react5.useMemo)(() => {
1726
- if (!sortColumn || !sortDirection) {
1727
- return data;
1728
- }
1729
- return [...data].sort((a, b) => {
1730
- const aValue = a[sortColumn];
1731
- const bValue = b[sortColumn];
1732
- if (typeof aValue === "string" && typeof bValue === "string") {
1733
- const comparison = aValue.localeCompare(bValue);
1734
- return sortDirection === "asc" ? comparison : -comparison;
1735
- }
1736
- if (typeof aValue === "number" && typeof bValue === "number") {
1737
- return sortDirection === "asc" ? aValue - bValue : bValue - aValue;
1738
- }
1739
- return 0;
1740
- });
1741
- }, [data, sortColumn, sortDirection]);
1742
- return { sortedData, sortColumn, sortDirection, handleSort };
1743
- }
1744
- var renderHeaderElements = (children) => {
1745
- return import_react5.Children.map(children, (child) => {
1746
- if ((0, import_react5.isValidElement)(child) && (child.type === TableCaption || child.type === TableHeader)) {
1747
- return child;
1748
- }
1749
- return null;
1750
- });
1751
- };
1752
- var getNoSearchResultContent = (config, defaultTitle, defaultDescription) => {
1753
- if (config.component) {
1754
- return config.component;
1755
- }
1756
- if (config.image) {
1757
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1758
- NoSearchResult_default,
1759
- {
1760
- image: config.image,
1761
- title: config.title || defaultTitle,
1762
- description: config.description || defaultDescription
1763
- }
1764
- );
1765
- }
1766
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "text-center", children: [
1767
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-600 text-lg font-semibold mb-2", children: config.title || defaultTitle }),
1768
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-500 text-sm", children: config.description || defaultDescription })
1769
- ] });
1770
- };
1771
- var getEmptyStateContent = (config, defaultTitle, defaultDescription) => {
1772
- if (config?.component) {
1773
- return config.component;
1774
- }
1775
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1776
- EmptyState_default,
1777
- {
1778
- image: config?.image,
1779
- title: config?.title || defaultTitle,
1780
- description: config?.description || defaultDescription,
1781
- buttonText: config?.buttonText,
1782
- buttonIcon: config?.buttonIcon,
1783
- onButtonClick: config?.onButtonClick,
1784
- buttonVariant: config?.buttonVariant,
1785
- buttonAction: config?.buttonAction
1786
- }
1787
- );
1788
- };
1789
- var renderTableWrapper = (variant, tableRef, className, children, stateContent, tableProps) => {
1790
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1791
- "div",
1792
- {
1793
- className: cn(
1794
- "relative w-full overflow-x-auto",
1795
- variant === "default" && "border border-border-200 rounded-xl"
1796
- ),
1797
- children: [
1798
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1799
- "table",
1800
- {
1801
- ref: tableRef,
1802
- className: cn(
1803
- "analytica-table w-full caption-bottom text-sm border-separate border-spacing-0",
1804
- className
1805
- ),
1806
- ...tableProps,
1807
- children: renderHeaderElements(children)
1808
- }
1809
- ),
1810
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "py-8 flex justify-center", children: stateContent })
1811
- ]
1812
- }
1813
- );
1814
- };
1815
- var Table = (0, import_react5.forwardRef)(
1816
- ({
1817
- variant = "default",
1818
- className,
1819
- children,
1820
- showLoading = false,
1821
- loadingState,
1822
- showNoSearchResult = false,
1823
- noSearchResultState,
1824
- showEmpty = false,
1825
- emptyState,
1826
- ...props
1827
- }, ref) => {
1828
- const defaultNoSearchResultState = {
1829
- title: "Nenhum resultado encontrado",
1830
- description: "N\xE3o encontramos nenhum resultado com esse nome. Tente revisar a busca ou usar outra palavra-chave."
1831
- };
1832
- const defaultEmptyState = {
1833
- title: "Nenhum dado dispon\xEDvel",
1834
- description: "N\xE3o h\xE1 dados para exibir no momento."
1835
- };
1836
- const finalNoSearchResultState = noSearchResultState || defaultNoSearchResultState;
1837
- const finalEmptyState = emptyState || defaultEmptyState;
1838
- if (showLoading) {
1839
- const loadingContent = loadingState?.component || /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkeletonTable, { rows: 5, columns: 4, showHeader: false });
1840
- return renderTableWrapper(
1841
- variant,
1842
- ref,
1843
- className,
1844
- children,
1845
- loadingContent,
1846
- props
1847
- );
1848
- }
1849
- if (showNoSearchResult) {
1850
- const noSearchContent = getNoSearchResultContent(
1851
- finalNoSearchResultState,
1852
- defaultNoSearchResultState.title || "",
1853
- defaultNoSearchResultState.description || ""
1854
- );
1855
- return renderTableWrapper(
1856
- variant,
1857
- ref,
1858
- className,
1859
- children,
1860
- noSearchContent,
1861
- props
1862
- );
1863
- }
1864
- if (showEmpty) {
1865
- const emptyContent = getEmptyStateContent(
1866
- finalEmptyState,
1867
- defaultEmptyState.title || "Nenhum dado dispon\xEDvel",
1868
- defaultEmptyState.description || "N\xE3o h\xE1 dados para exibir no momento."
1869
- );
1870
- return renderTableWrapper(
1871
- variant,
1872
- ref,
1873
- className,
1874
- children,
1875
- emptyContent,
1876
- props
1877
- );
1878
- }
1879
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1880
- "div",
1881
- {
1882
- className: cn(
1883
- "relative w-full overflow-x-auto",
1884
- variant === "default" && "border border-border-200 rounded-xl"
1885
- ),
1886
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1887
- "table",
1888
- {
1889
- ref,
1890
- className: cn(
1891
- variant === "default" && "analytica-table",
1892
- variant === "default" && "border-separate border-spacing-0",
1893
- "w-full caption-bottom text-sm",
1894
- className
1895
- ),
1896
- ...props,
1897
- children: [
1898
- !import_react5.Children.toArray(children).some(
1899
- (child) => (0, import_react5.isValidElement)(child) && child.type === TableCaption
1900
- ) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("caption", { className: "sr-only", children: "My Table" }),
1901
- children
1902
- ]
1903
- }
1904
- )
1905
- }
1906
- );
1907
- }
1908
- );
1909
- Table.displayName = "Table";
1910
- var TableHeader = (0, import_react5.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1911
- "thead",
1912
- {
1913
- ref,
1914
- className: cn("[&_tr:first-child]:border-0", className),
1915
- ...props
1916
- }
1917
- ));
1918
- TableHeader.displayName = "TableHeader";
1919
- var TableBody = (0, import_react5.forwardRef)(
1920
- ({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1921
- "tbody",
1922
- {
1923
- ref,
1924
- className: cn(
1925
- "[&_tr:last-child]:border-border-200",
1926
- variant === "default" && "border-t border-border-200",
1927
- className
1928
- ),
1929
- ...props
1930
- }
1931
- )
1932
- );
1933
- TableBody.displayName = "TableBody";
1934
- var TableFooter = (0, import_react5.forwardRef)(
1935
- ({ variant = "default", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1936
- "tfoot",
1937
- {
1938
- ref,
1939
- className: cn(
1940
- "bg-background-50 font-medium [&>tr]:last:border-b-0 px-6 py-3.5",
1941
- variant === "default" && "border-t border-border-200",
1942
- className
1943
- ),
1944
- ...props
1945
- }
1946
- )
1947
- );
1948
- TableFooter.displayName = "TableFooter";
1949
- var VARIANT_STATES_ROW = {
1950
- default: {
1951
- default: "border border-border-200",
1952
- defaultBorderless: "border-b border-border-200",
1953
- borderless: ""
1954
- },
1955
- selected: {
1956
- default: "border-b-2 border-indicator-primary",
1957
- defaultBorderless: "border-b border-indicator-primary",
1958
- borderless: "bg-indicator-primary/10"
1959
- },
1960
- invalid: {
1961
- default: "border-b-2 border-indicator-error",
1962
- defaultBorderless: "border-b border-indicator-error",
1963
- borderless: "bg-indicator-error/10"
1964
- },
1965
- disabled: {
1966
- default: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed",
1967
- defaultBorderless: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed",
1968
- borderless: "bg-background-50 opacity-50 cursor-not-allowed"
1969
- }
1970
- };
1971
- var TableRow = (0, import_react5.forwardRef)(
1972
- ({
1973
- variant = "default",
1974
- state = "default",
1975
- clickable = false,
1976
- className,
1977
- ...props
1978
- }, ref) => {
1979
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1980
- "tr",
1981
- {
1982
- ref,
1983
- className: cn(
1984
- "transition-colors",
1985
- state === "disabled" ? "" : "hover:bg-muted/50",
1986
- state === "disabled" || !clickable ? "" : "cursor-pointer",
1987
- VARIANT_STATES_ROW[state][variant],
1988
- className
1989
- ),
1990
- "aria-disabled": state === "disabled",
1991
- ...props
1992
- }
1993
- );
1994
- }
1995
- );
1996
- TableRow.displayName = "TableRow";
1997
- var TableHead = (0, import_react5.forwardRef)(
1998
- ({
1999
- className,
2000
- sortable = true,
2001
- sortDirection = null,
2002
- onSort,
2003
- children,
2004
- ...props
2005
- }, ref) => {
2006
- const handleClick = () => {
2007
- if (sortable && onSort) {
2008
- onSort();
2009
- }
2010
- };
2011
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2012
- "th",
2013
- {
2014
- ref,
2015
- className: cn(
2016
- "h-10 px-6 py-3.5 text-left align-middle font-bold text-base text-text-800 tracking-[0.2px] leading-none [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] whitespace-nowrap",
2017
- sortable && "cursor-pointer select-none hover:bg-muted/30",
2018
- className
2019
- ),
2020
- onClick: handleClick,
2021
- ...props,
2022
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
2023
- children,
2024
- sortable && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col", children: [
2025
- sortDirection === "asc" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react3.CaretUp, { size: 16, weight: "fill", className: "text-text-800" }),
2026
- sortDirection === "desc" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react3.CaretDown, { size: 16, weight: "fill", className: "text-text-800" })
2027
- ] })
2028
- ] })
2029
- }
2030
- );
2031
- }
2032
- );
2033
- TableHead.displayName = "TableHead";
2034
- var TableCell = (0, import_react5.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2035
- "td",
2036
- {
2037
- ref,
2038
- className: cn(
2039
- "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-base font-normal text-text-800 leading-[150%] tracking-normal px-6 py-3.5 whitespace-nowrap",
2040
- className
2041
- ),
2042
- ...props
2043
- }
2044
- ));
2045
- TableCell.displayName = "TableCell";
2046
- var TableCaption = (0, import_react5.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2047
- "caption",
2048
- {
2049
- ref,
2050
- className: cn(
2051
- "border-t border-border-200 text-sm text-text-800 px-6 py-3.5",
2052
- className
2053
- ),
2054
- ...props
2055
- }
2056
- ));
2057
- TableCaption.displayName = "TableCaption";
2058
- var Table_default = Table;
2059
-
2060
- // src/components/RecommendedLessonDetails/components/StudentsTable.tsx
2061
- var import_jsx_runtime21 = require("react/jsx-runtime");
2062
- var StudentsTable = ({
2063
- students,
2064
- onViewPerformance,
2065
- labels,
2066
- emptyMessage = "Nenhum aluno encontrado"
2067
- }) => {
2068
- const { sortedData, sortColumn, sortDirection, handleSort } = useTableSort(students);
2069
- const canViewPerformance = (0, import_react6.useCallback)((student) => {
2070
- return student.status === "CONCLU\xCDDO" /* CONCLUIDO */ || student.status === "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
2071
- }, []);
2072
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "bg-background rounded-xl border border-border-50 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Table_default, { children: [
2073
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(TableRow, { children: [
2074
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2075
- TableHead,
2076
- {
2077
- sortable: true,
2078
- sortDirection: sortColumn === "name" ? sortDirection : void 0,
2079
- onSort: () => handleSort("name"),
2080
- children: labels.studentColumn
2081
- }
2082
- ),
2083
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2084
- TableHead,
2085
- {
2086
- sortable: true,
2087
- sortDirection: sortColumn === "status" ? sortDirection : void 0,
2088
- onSort: () => handleSort("status"),
2089
- children: labels.statusColumn
2090
- }
2091
- ),
2092
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2093
- TableHead,
2094
- {
2095
- sortable: true,
2096
- sortDirection: sortColumn === "completionPercentage" ? sortDirection : void 0,
2097
- onSort: () => handleSort("completionPercentage"),
2098
- children: labels.completionColumn
2099
- }
2100
- ),
2101
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableHead, { children: labels.durationColumn }),
2102
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableHead, { className: "w-[140px]" })
2103
- ] }) }),
2104
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableBody, { children: sortedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableCell, { colSpan: 5, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { size: "sm", className: "text-text-500", children: emptyMessage }) }) }) : sortedData.map((student) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(TableRow, { children: [
2105
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
2106
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2107
- Text_default,
2108
- {
2109
- as: "span",
2110
- className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
2111
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react7.UserIcon, { size: 16, className: "text-text-500" })
2112
- }
2113
- ),
2114
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { size: "sm", className: "text-text-950", children: student.name })
2115
- ] }) }),
2116
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2117
- Badge_default,
2118
- {
2119
- variant: "solid",
2120
- action: getStudentStatusBadgeAction(student.status),
2121
- size: "small",
2122
- children: student.status
2123
- }
2124
- ) }),
2125
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex flex-col gap-1 min-w-[120px]", children: [
2126
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text_default, { size: "sm", className: "text-primary-700 font-medium", children: [
2127
- student.completionPercentage,
2128
- "%"
2129
- ] }),
2130
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2131
- ProgressBar_default,
2132
- {
2133
- value: student.completionPercentage,
2134
- size: "small",
2135
- variant: "blue",
2136
- className: "w-full max-w-[100px]"
2137
- }
2138
- )
2139
- ] }) }),
2140
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { size: "sm", className: "text-text-700", children: student.duration ?? "-" }) }),
2141
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableCell, { children: canViewPerformance(student) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2142
- Button_default,
2143
- {
2144
- variant: "outline",
2145
- size: "extra-small",
2146
- onClick: () => onViewPerformance?.(student.id),
2147
- children: labels.viewPerformance
2148
- }
2149
- ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button_default, { variant: "outline", size: "extra-small", disabled: true, children: labels.viewPerformance }) })
2150
- ] }, student.id)) })
2151
- ] }) });
2152
- };
2153
-
2154
- // src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
2155
- var import_react14 = require("react");
2156
- var import_react15 = require("@phosphor-icons/react");
2157
-
2158
- // src/components/Modal/Modal.tsx
2159
- var import_react8 = require("react");
2160
- var import_phosphor_react4 = require("phosphor-react");
2161
-
2162
- // src/components/Modal/utils/videoUtils.ts
2163
- var isYouTubeUrl = (url) => {
2164
- const youtubeRegex = /^(https?:\/\/)?((www|m|music)\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/.+/i;
2165
- return youtubeRegex.test(url);
2166
- };
2167
- var isValidYouTubeHost = (host) => {
2168
- if (host === "youtu.be") return "youtu.be";
2169
- const isValidYouTubeCom = host === "youtube.com" || host.endsWith(".youtube.com") && /^(www|m|music)\.youtube\.com$/.test(host);
2170
- if (isValidYouTubeCom) return "youtube";
2171
- const isValidNoCookie = host === "youtube-nocookie.com" || host.endsWith(".youtube-nocookie.com") && /^(www|m|music)\.youtube-nocookie\.com$/.test(host);
2172
- if (isValidNoCookie) return "nocookie";
2173
- return null;
2174
- };
2175
- var extractYoutuBeId = (pathname) => {
2176
- const firstSeg = pathname.split("/").filter(Boolean)[0];
2177
- return firstSeg || null;
2178
- };
2179
- var extractYouTubeId = (pathname, searchParams) => {
2180
- const parts = pathname.split("/").filter(Boolean);
2181
- const [first, second] = parts;
2182
- if (first === "embed" && second) return second;
2183
- if (first === "shorts" && second) return second;
2184
- if (first === "live" && second) return second;
2185
- const v = searchParams.get("v");
2186
- if (v) return v;
2187
- return null;
2188
- };
2189
- var getYouTubeVideoId = (url) => {
2190
- try {
2191
- const u = new URL(url);
2192
- const hostType = isValidYouTubeHost(u.hostname.toLowerCase());
2193
- if (!hostType) return null;
2194
- if (hostType === "youtu.be") {
2195
- return extractYoutuBeId(u.pathname);
2196
- }
2197
- return extractYouTubeId(u.pathname, u.searchParams);
2198
- } catch {
2199
- return null;
2200
- }
2201
- };
2202
- var getYouTubeEmbedUrl = (videoId) => {
2203
- return `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=0&rel=0&modestbranding=1`;
2204
- };
2205
-
2206
- // src/components/Modal/Modal.tsx
2207
- var import_jsx_runtime22 = require("react/jsx-runtime");
2208
- var SIZE_CLASSES5 = {
2209
- xs: "max-w-[360px]",
2210
- sm: "max-w-[420px]",
2211
- md: "max-w-[510px]",
2212
- lg: "max-w-[640px]",
2213
- xl: "max-w-[970px]"
2214
- };
2215
- var Modal = ({
2216
- isOpen,
2217
- onClose,
2218
- title,
2219
- children,
2220
- size = "md",
2221
- className = "",
2222
- closeOnEscape = true,
2223
- footer,
2224
- hideCloseButton = false,
2225
- variant = "default",
2226
- description,
2227
- image,
2228
- imageAlt,
2229
- actionLink,
2230
- actionLabel,
2231
- contentClassName = ""
2232
- }) => {
2233
- const titleId = (0, import_react8.useId)();
2234
- (0, import_react8.useEffect)(() => {
2235
- if (!isOpen || !closeOnEscape) return;
2236
- const handleEscape = (event) => {
2237
- if (event.key === "Escape") {
2238
- onClose();
2239
- }
2240
- };
2241
- document.addEventListener("keydown", handleEscape);
2242
- return () => document.removeEventListener("keydown", handleEscape);
2243
- }, [isOpen, closeOnEscape, onClose]);
2244
- (0, import_react8.useEffect)(() => {
2245
- if (!isOpen) return;
2246
- const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
2247
- const originalOverflow = document.body.style.overflow;
2248
- const originalPaddingRight = document.body.style.paddingRight;
2249
- document.body.style.overflow = "hidden";
2250
- if (scrollbarWidth > 0) {
2251
- document.body.style.paddingRight = `${scrollbarWidth}px`;
2252
- const overlay = document.createElement("div");
2253
- overlay.id = "modal-scrollbar-overlay";
2254
- overlay.style.cssText = `
2255
- position: fixed;
2256
- top: 0;
2257
- right: 0;
2258
- width: ${scrollbarWidth}px;
2259
- height: 100vh;
2260
- background-color: rgb(0 0 0 / 0.6);
2261
- z-index: 40;
2262
- pointer-events: none;
2263
- `;
2264
- document.body.appendChild(overlay);
2265
- }
2266
- return () => {
2267
- document.body.style.overflow = originalOverflow;
2268
- document.body.style.paddingRight = originalPaddingRight;
2269
- const overlay = document.getElementById("modal-scrollbar-overlay");
2270
- if (overlay) {
2271
- overlay.remove();
2272
- }
2273
- };
2274
- }, [isOpen]);
2275
- if (!isOpen) return null;
2276
- const sizeClasses = SIZE_CLASSES5[size];
2277
- const baseClasses = "bg-secondary-50 rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
2278
- const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
2279
- const modalClasses = cn(
2280
- baseClasses,
2281
- sizeClasses,
2282
- dialogResetClasses,
2283
- className
2284
- );
2285
- const normalizeUrl = (href) => /^https?:\/\//i.test(href) ? href : `https://${href}`;
2286
- const handleActionClick = () => {
2287
- if (actionLink) {
2288
- window.open(normalizeUrl(actionLink), "_blank", "noopener,noreferrer");
2289
- }
2290
- };
2291
- if (variant === "activity") {
2292
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2293
- "dialog",
2294
- {
2295
- className: modalClasses,
2296
- "aria-labelledby": titleId,
2297
- "aria-modal": "true",
2298
- open: true,
2299
- children: [
2300
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex justify-end p-6 pb-0", children: !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2301
- "button",
2302
- {
2303
- onClick: onClose,
2304
- 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",
2305
- "aria-label": "Fechar modal",
2306
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react4.X, { size: 18 })
2307
- }
2308
- ) }),
2309
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col items-center px-6 pb-6 gap-5", children: [
2310
- image && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2311
- "img",
2312
- {
2313
- src: image,
2314
- alt: imageAlt ?? "",
2315
- className: "w-[122px] h-[122px] object-contain"
2316
- }
2317
- ) }),
2318
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2319
- "h2",
2320
- {
2321
- id: titleId,
2322
- className: "text-lg font-semibold text-text-950 text-center",
2323
- children: title
2324
- }
2325
- ),
2326
- description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm font-normal text-text-400 text-center max-w-md leading-[21px]", children: description }),
2327
- actionLink && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "w-full", children: [
2328
- (() => {
2329
- const normalized = normalizeUrl(actionLink);
2330
- const isYT = isYouTubeUrl(normalized);
2331
- if (!isYT) return null;
2332
- const id = getYouTubeVideoId(normalized);
2333
- if (!id) {
2334
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2335
- Button_default,
2336
- {
2337
- variant: "solid",
2338
- action: "primary",
2339
- size: "large",
2340
- className: "w-full",
2341
- onClick: handleActionClick,
2342
- children: actionLabel || "Iniciar Atividade"
2343
- }
2344
- );
2345
- }
2346
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2347
- "iframe",
2348
- {
2349
- src: getYouTubeEmbedUrl(id),
2350
- className: "w-full aspect-video rounded-lg",
2351
- allowFullScreen: true,
2352
- allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
2353
- title: "V\xEDdeo YouTube"
2354
- }
2355
- );
2356
- })(),
2357
- !isYouTubeUrl(normalizeUrl(actionLink)) && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2358
- Button_default,
2359
- {
2360
- variant: "solid",
2361
- action: "primary",
2362
- size: "large",
2363
- className: "w-full",
2364
- onClick: handleActionClick,
2365
- children: actionLabel || "Iniciar Atividade"
2366
- }
2367
- )
2368
- ] })
2369
- ] })
2370
- ]
2371
- }
2372
- ) });
2373
- }
2374
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2375
- "dialog",
2376
- {
2377
- className: modalClasses,
2378
- "aria-labelledby": titleId,
2379
- "aria-modal": "true",
2380
- open: true,
2381
- children: [
2382
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center justify-between px-6 py-6", children: [
2383
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { id: titleId, className: "text-lg font-semibold text-text-950", children: title }),
2384
- !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2385
- "button",
2386
- {
2387
- onClick: onClose,
2388
- 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",
2389
- "aria-label": "Fechar modal",
2390
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react4.X, { size: 18 })
2391
- }
2392
- )
2393
- ] }),
2394
- children && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cn("px-6 pb-6", contentClassName), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
2395
- footer && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
2396
- ]
2397
- }
2398
- ) });
2399
- };
2400
- var Modal_default = Modal;
2401
-
2402
- // src/components/Accordation/Accordation.tsx
2403
- var import_react11 = require("react");
2404
-
2405
- // src/components/Card/Card.tsx
2406
- var import_react10 = require("react");
2407
- var import_phosphor_react5 = require("phosphor-react");
2408
-
2409
- // src/components/IconRender/IconRender.tsx
2410
- var import_react9 = require("react");
2411
- var PhosphorIcons = __toESM(require("phosphor-react"));
2412
- var import_jsx_runtime23 = require("react/jsx-runtime");
2413
- var IconRender = ({
2414
- iconName,
2415
- color = "#000000",
2416
- size = 24,
2417
- weight = "regular"
2418
- }) => {
2419
- if (typeof iconName === "string") {
2420
- switch (iconName) {
2421
- case "Chat_PT":
2422
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatPT, { size, color });
2423
- case "Chat_EN":
2424
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatEN, { size, color });
2425
- case "Chat_ES":
2426
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatES, { size, color });
2427
- default: {
2428
- const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
2429
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IconComponent, { size, color, weight });
2430
- }
2431
- }
2432
- } else {
2433
- return (0, import_react9.cloneElement)(iconName, {
2434
- size,
2435
- color: "currentColor"
2436
- });
2437
- }
2438
- };
2439
- var IconRender_default = IconRender;
2440
-
2441
- // src/components/Card/Card.tsx
2442
- var import_jsx_runtime24 = require("react/jsx-runtime");
2443
- var CARD_BASE_CLASSES = {
2444
- default: "w-full bg-background border border-border-50 rounded-xl",
2445
- compact: "w-full bg-background border border-border-50 rounded-lg",
2446
- minimal: "w-full bg-background border border-border-100 rounded-md"
2447
- };
2448
- var CARD_PADDING_CLASSES = {
2449
- none: "",
2450
- small: "p-2",
2451
- medium: "p-4",
2452
- large: "p-6"
2453
- };
2454
- var CARD_MIN_HEIGHT_CLASSES = {
2455
- none: "",
2456
- small: "min-h-16",
2457
- medium: "min-h-20",
2458
- large: "min-h-24"
2459
- };
2460
- var CARD_LAYOUT_CLASSES = {
2461
- horizontal: "flex flex-row",
2462
- vertical: "flex flex-col"
2463
- };
2464
- var CARD_CURSOR_CLASSES = {
2465
- default: "",
2466
- pointer: "cursor-pointer"
2467
- };
2468
- var CardBase = (0, import_react10.forwardRef)(
2469
- ({
2470
- children,
2471
- variant = "default",
2472
- layout = "horizontal",
2473
- padding = "medium",
2474
- minHeight = "medium",
2475
- cursor = "default",
2476
- className = "",
2477
- ...props
2478
- }, ref) => {
2479
- const baseClasses = CARD_BASE_CLASSES[variant];
2480
- const paddingClasses = CARD_PADDING_CLASSES[padding];
2481
- const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
2482
- const layoutClasses = CARD_LAYOUT_CLASSES[layout];
2483
- const cursorClasses = CARD_CURSOR_CLASSES[cursor];
2484
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2485
- "div",
2486
- {
2487
- ref,
2488
- className: cn(
2489
- baseClasses,
2490
- paddingClasses,
2491
- minHeightClasses,
2492
- layoutClasses,
2493
- cursorClasses,
2494
- className
2495
- ),
2496
- ...props,
2497
- children
2498
- }
2499
- );
2500
- }
2501
- );
2502
- var ACTION_CARD_CLASSES = {
2503
- warning: "bg-warning-background",
2504
- success: "bg-success-200",
2505
- error: "bg-error-100",
2506
- info: "bg-info-background"
2507
- };
2508
- var ACTION_ICON_CLASSES = {
2509
- warning: "bg-warning-300 text-text",
2510
- success: "bg-indicator-positive text-text-950",
2511
- error: "bg-indicator-negative text-text",
2512
- info: "bg-info-500 text-text"
2513
- };
2514
- var ACTION_SUBTITLE_CLASSES = {
2515
- warning: "text-warning-600",
2516
- success: "text-success-700",
2517
- error: "text-error-700",
2518
- info: "text-info-700"
2519
- };
2520
- var ACTION_HEADER_CLASSES = {
2521
- warning: "text-warning-300",
2522
- success: "text-success-300",
2523
- error: "text-error-300",
2524
- info: "text-info-300"
2525
- };
2526
- var CardActivitiesResults = (0, import_react10.forwardRef)(
2527
- ({
2528
- icon,
2529
- title,
2530
- subTitle,
2531
- header,
2532
- extended = false,
2533
- action = "success",
2534
- description,
2535
- className,
2536
- ...props
2537
- }, ref) => {
2538
- const actionCardClasses = ACTION_CARD_CLASSES[action];
2539
- const actionIconClasses = ACTION_ICON_CLASSES[action];
2540
- const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
2541
- const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
2542
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2543
- "div",
2544
- {
2545
- ref,
2546
- className: cn(
2547
- "w-full flex flex-col border border-border-50 bg-background rounded-xl",
2548
- className
2549
- ),
2550
- ...props,
2551
- children: [
2552
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2553
- "div",
2554
- {
2555
- className: cn(
2556
- "flex flex-col gap-1 items-center justify-center p-4",
2557
- actionCardClasses,
2558
- extended ? "rounded-t-xl" : "rounded-xl"
2559
- ),
2560
- children: [
2561
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2562
- "span",
2563
- {
2564
- className: cn(
2565
- "size-7.5 rounded-full flex items-center justify-center",
2566
- actionIconClasses
2567
- ),
2568
- children: icon
2569
- }
2570
- ),
2571
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2572
- Text_default,
2573
- {
2574
- size: "2xs",
2575
- weight: "medium",
2576
- className: "text-text-800 uppercase truncate",
2577
- children: title
2578
- }
2579
- ),
2580
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2581
- "p",
2582
- {
2583
- className: cn("text-lg font-bold truncate", actionSubTitleClasses),
2584
- children: subTitle
2585
- }
2586
- )
2587
- ]
2588
- }
2589
- ),
2590
- extended && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
2591
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2592
- "p",
2593
- {
2594
- className: cn(
2595
- "text-2xs font-medium uppercase truncate",
2596
- actionHeaderClasses
2597
- ),
2598
- children: header
2599
- }
2600
- ),
2601
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Badge_default, { size: "large", action: "info", children: description })
2602
- ] })
2603
- ]
2604
- }
2605
- );
2606
- }
2607
- );
2608
- var CardQuestions = (0, import_react10.forwardRef)(
2609
- ({
2610
- header,
2611
- state = "undone",
2612
- className,
2613
- onClickButton,
2614
- valueButton,
2615
- ...props
2616
- }, ref) => {
2617
- const isDone = state === "done";
2618
- const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
2619
- const buttonLabel = isDone ? "Ver Resultado" : "Responder";
2620
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2621
- CardBase,
2622
- {
2623
- ref,
2624
- layout: "horizontal",
2625
- padding: "medium",
2626
- minHeight: "medium",
2627
- className: cn("justify-between gap-4", className),
2628
- ...props,
2629
- children: [
2630
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
2631
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
2632
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-row gap-6 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2633
- Badge_default,
2634
- {
2635
- size: "medium",
2636
- variant: "solid",
2637
- action: isDone ? "success" : "error",
2638
- children: stateLabel
2639
- }
2640
- ) })
2641
- ] }),
2642
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2643
- Button_default,
2644
- {
2645
- size: "extra-small",
2646
- onClick: () => onClickButton?.(valueButton),
2647
- className: "min-w-fit",
2648
- children: buttonLabel
2649
- }
2650
- ) })
2651
- ]
2652
- }
2653
- );
2654
- }
2655
- );
2656
- var CardProgress = (0, import_react10.forwardRef)(
2657
- ({
2658
- header,
2659
- subhead,
2660
- initialDate,
2661
- endDate,
2662
- progress = 0,
2663
- direction = "horizontal",
2664
- icon,
2665
- color = "#B7DFFF",
2666
- progressVariant = "blue",
2667
- showDates = true,
2668
- className,
2669
- ...props
2670
- }, ref) => {
2671
- const isHorizontal = direction === "horizontal";
2672
- const contentComponent = {
2673
- horizontal: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
2674
- showDates && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
2675
- initialDate && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
2676
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
2677
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-600", children: initialDate })
2678
- ] }),
2679
- endDate && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
2680
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-800 font-semibold", children: "Fim" }),
2681
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-600", children: endDate })
2682
- ] })
2683
- ] }),
2684
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
2685
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2686
- ProgressBar_default,
2687
- {
2688
- size: "small",
2689
- value: progress,
2690
- variant: progressVariant,
2691
- "data-testid": "progress-bar"
2692
- }
2693
- ),
2694
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2695
- Text_default,
2696
- {
2697
- size: "xs",
2698
- weight: "medium",
2699
- className: cn(
2700
- "text-text-950 leading-none tracking-normal text-center flex-none"
2701
- ),
2702
- children: [
2703
- Math.round(progress),
2704
- "%"
2705
- ]
2706
- }
2707
- )
2708
- ] })
2709
- ] }),
2710
- vertical: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-text-800", children: subhead })
2711
- };
2712
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2713
- CardBase,
2714
- {
2715
- ref,
2716
- layout: isHorizontal ? "horizontal" : "vertical",
2717
- padding: "none",
2718
- minHeight: "medium",
2719
- cursor: "pointer",
2720
- className: cn(isHorizontal ? "h-20" : "", className),
2721
- ...props,
2722
- children: [
2723
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2724
- "div",
2725
- {
2726
- className: cn(
2727
- "flex justify-center items-center [&>svg]:size-6 text-text-950",
2728
- isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl",
2729
- !color.startsWith("#") ? `${color}` : ""
2730
- ),
2731
- style: color.startsWith("#") ? { backgroundColor: color } : void 0,
2732
- "data-testid": "icon-container",
2733
- children: icon
2734
- }
2735
- ),
2736
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2737
- "div",
2738
- {
2739
- className: cn(
2740
- "p-4 flex flex-col justify-between w-full h-full",
2741
- !isHorizontal && "gap-4"
2742
- ),
2743
- children: [
2744
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
2745
- contentComponent[direction]
2746
- ]
2747
- }
2748
- )
2749
- ]
2750
- }
2751
- );
2752
- }
2753
- );
2754
- var CardTopic = (0, import_react10.forwardRef)(
2755
- ({
2756
- header,
2757
- subHead,
2758
- progress,
2759
- showPercentage = false,
2760
- progressVariant = "blue",
2761
- className = "",
2762
- ...props
2763
- }, ref) => {
2764
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2765
- CardBase,
2766
- {
2767
- ref,
2768
- layout: "vertical",
2769
- padding: "small",
2770
- minHeight: "medium",
2771
- cursor: "pointer",
2772
- className: cn("justify-center gap-2 py-2 px-4", className),
2773
- ...props,
2774
- children: [
2775
- subHead && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react10.Fragment, { children: [
2776
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: text }),
2777
- index < subHead.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: "\u2022" })
2778
- ] }, `${text} - ${index}`)) }),
2779
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
2780
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
2781
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2782
- ProgressBar_default,
2783
- {
2784
- size: "small",
2785
- value: progress,
2786
- variant: progressVariant,
2787
- "data-testid": "progress-bar"
2788
- }
2789
- ),
2790
- showPercentage && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2791
- Text_default,
2792
- {
2793
- size: "xs",
2794
- weight: "medium",
2795
- className: cn(
2796
- "text-text-950 leading-none tracking-normal text-center flex-none"
2797
- ),
2798
- children: [
2799
- Math.round(progress),
2800
- "%"
2801
- ]
2802
- }
2803
- )
2804
- ] })
2805
- ]
2806
- }
2807
- );
2808
- }
2809
- );
2810
- var CardPerformance = (0, import_react10.forwardRef)(
2811
- ({
2812
- header,
2813
- progress,
2814
- description = "Sem dados ainda! Voc\xEA ainda n\xE3o fez um question\xE1rio neste assunto.",
2815
- actionVariant = "button",
2816
- progressVariant = "blue",
2817
- labelProgress = "",
2818
- className = "",
2819
- onClickButton,
2820
- valueButton,
2821
- ...props
2822
- }, ref) => {
2823
- const hasProgress = progress !== void 0;
2824
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2825
- CardBase,
2826
- {
2827
- ref,
2828
- layout: "horizontal",
2829
- padding: "medium",
2830
- minHeight: "none",
2831
- className: cn(
2832
- actionVariant == "caret" ? "cursor-pointer" : "",
2833
- className
2834
- ),
2835
- onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
2836
- ...props,
2837
- children: [
2838
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "w-full flex flex-col justify-between gap-2", children: [
2839
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row justify-between items-center gap-2", children: [
2840
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
2841
- actionVariant === "button" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2842
- Button_default,
2843
- {
2844
- variant: "outline",
2845
- size: "extra-small",
2846
- onClick: () => onClickButton?.(valueButton),
2847
- className: "min-w-fit flex-shrink-0",
2848
- children: "Ver Aula"
2849
- }
2850
- )
2851
- ] }),
2852
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2853
- ProgressBar_default,
2854
- {
2855
- value: progress,
2856
- label: `${progress}% ${labelProgress}`,
2857
- variant: progressVariant
2858
- }
2859
- ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-xs text-text-600 truncate", children: description }) })
2860
- ] }),
2861
- actionVariant == "caret" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2862
- import_phosphor_react5.CaretRight,
2863
- {
2864
- className: "size-4.5 text-text-800 cursor-pointer",
2865
- "data-testid": "caret-icon"
2866
- }
2867
- )
2868
- ]
2869
- }
2870
- );
2871
- }
2872
- );
2873
- var CardResults = (0, import_react10.forwardRef)(
2874
- ({
2875
- header,
2876
- correct_answers,
2877
- incorrect_answers,
2878
- icon,
2879
- direction = "col",
2880
- color = "#B7DFFF",
2881
- className,
2882
- ...props
2883
- }, ref) => {
2884
- const isRow = direction == "row";
2885
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2886
- CardBase,
2887
- {
2888
- ref,
2889
- layout: "horizontal",
2890
- padding: "none",
2891
- minHeight: "medium",
2892
- className: cn("items-stretch cursor-pointer pr-4", className),
2893
- ...props,
2894
- children: [
2895
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2896
- "div",
2897
- {
2898
- className: cn(
2899
- "flex justify-center items-center [&>svg]:size-8 text-text-950 min-w-20 max-w-20 min-h-full rounded-l-xl"
2900
- ),
2901
- style: {
2902
- backgroundColor: color
2903
- },
2904
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconRender_default, { iconName: icon, color: "currentColor", size: 20 })
2905
- }
2906
- ),
2907
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "w-full flex flex-row justify-between items-center", children: [
2908
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2909
- "div",
2910
- {
2911
- className: cn(
2912
- "p-4 flex flex-wrap justify-between w-full h-full",
2913
- isRow ? "flex-row items-center gap-2" : "flex-col"
2914
- ),
2915
- children: [
2916
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm font-bold text-text-950 flex-1", children: header }),
2917
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex flex-wrap flex-row gap-1 items-center", children: [
2918
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2919
- Badge_default,
2920
- {
2921
- action: "success",
2922
- variant: "solid",
2923
- size: "large",
2924
- iconLeft: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CheckCircle, {}),
2925
- children: [
2926
- correct_answers,
2927
- " Corretas"
2928
- ]
2929
- }
2930
- ),
2931
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2932
- Badge_default,
2933
- {
2934
- action: "error",
2935
- variant: "solid",
2936
- size: "large",
2937
- iconLeft: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.XCircle, {}),
2938
- children: [
2939
- incorrect_answers,
2940
- " Incorretas"
2941
- ]
2942
- }
2943
- )
2944
- ] })
2945
- ]
2946
- }
2947
- ),
2948
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CaretRight, { className: "min-w-6 min-h-6 text-text-800" })
2949
- ] })
2950
- ]
2951
- }
2952
- );
2953
- }
2954
- );
2955
- var CardStatus = (0, import_react10.forwardRef)(
2956
- ({ header, className, status, label, ...props }, ref) => {
2957
- const getLabelBadge = (status2) => {
2958
- switch (status2) {
2959
- case "correct":
2960
- return "Correta";
2961
- case "incorrect":
2962
- return "Incorreta";
2963
- case "unanswered":
2964
- return "Em branco";
2965
- case "pending":
2966
- return "Avalia\xE7\xE3o pendente";
2967
- default:
2968
- return "Em branco";
2969
- }
2970
- };
2971
- const getIconBadge = (status2) => {
2972
- switch (status2) {
2973
- case "correct":
2974
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CheckCircle, {});
2975
- case "incorrect":
2976
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.XCircle, {});
2977
- case "pending":
2978
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.Clock, {});
2979
- default:
2980
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.XCircle, {});
2981
- }
2982
- };
2983
- const getActionBadge = (status2) => {
2984
- switch (status2) {
2985
- case "correct":
2986
- return "success";
2987
- case "incorrect":
2988
- return "error";
2989
- case "pending":
2990
- return "info";
2991
- default:
2992
- return "info";
2993
- }
2994
- };
2995
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2996
- CardBase,
2997
- {
2998
- ref,
2999
- layout: "horizontal",
3000
- padding: "medium",
3001
- minHeight: "medium",
3002
- className: cn("items-center cursor-pointer", className),
3003
- ...props,
3004
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
3005
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
3006
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
3007
- status && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3008
- Badge_default,
3009
- {
3010
- action: getActionBadge(status),
3011
- variant: "solid",
3012
- size: "medium",
3013
- iconLeft: getIconBadge(status),
3014
- children: getLabelBadge(status)
3015
- }
3016
- ),
3017
- label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-text-800", children: label })
3018
- ] }),
3019
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
3020
- ] })
3021
- }
3022
- );
3023
- }
3024
- );
3025
- var CardSettings = (0, import_react10.forwardRef)(
3026
- ({ header, className, icon, ...props }, ref) => {
3027
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3028
- CardBase,
3029
- {
3030
- ref,
3031
- layout: "horizontal",
3032
- padding: "small",
3033
- minHeight: "none",
3034
- className: cn(
3035
- "border-none items-center gap-2 text-text-700",
3036
- className
3037
- ),
3038
- ...props,
3039
- children: [
3040
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "[&>svg]:size-6", children: icon }),
3041
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "w-full text-sm truncate", children: header }),
3042
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CaretRight, { size: 24, className: "cursor-pointer" })
3043
- ]
3044
- }
3045
- );
3046
- }
3047
- );
3048
- var CardSupport = (0, import_react10.forwardRef)(
3049
- ({ header, className, direction = "col", children, ...props }, ref) => {
3050
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3051
- CardBase,
3052
- {
3053
- ref,
3054
- layout: "horizontal",
3055
- padding: "medium",
3056
- minHeight: "none",
3057
- className: cn(
3058
- "border-none items-center gap-2 text-text-700",
3059
- className
3060
- ),
3061
- ...props,
3062
- children: [
3063
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3064
- "div",
3065
- {
3066
- className: cn(
3067
- "w-full flex",
3068
- direction == "col" ? "flex-col" : "flex-row items-center"
3069
- ),
3070
- children: [
3071
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
3072
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "flex flex-row gap-1", children })
3073
- ]
3074
- }
3075
- ),
3076
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CaretRight, { className: "text-text-800 cursor-pointer", size: 24 })
3077
- ]
3078
- }
3079
- );
3080
- }
3081
- );
3082
- var CardForum = (0, import_react10.forwardRef)(
3083
- ({
3084
- title,
3085
- content,
3086
- comments,
3087
- onClickComments,
3088
- valueComments,
3089
- onClickProfile,
3090
- valueProfile,
3091
- className = "",
3092
- date,
3093
- hour,
3094
- ...props
3095
- }, ref) => {
3096
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3097
- CardBase,
3098
- {
3099
- ref,
3100
- layout: "horizontal",
3101
- padding: "medium",
3102
- minHeight: "none",
3103
- variant: "minimal",
3104
- className: cn("w-auto h-auto gap-3", className),
3105
- ...props,
3106
- children: [
3107
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3108
- "button",
3109
- {
3110
- type: "button",
3111
- "aria-label": "Ver perfil",
3112
- onClick: () => onClickProfile?.(valueProfile),
3113
- className: "min-w-8 h-8 rounded-full bg-background-950"
3114
- }
3115
- ),
3116
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
3117
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
3118
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
3119
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("p", { className: "text-xs text-text-600", children: [
3120
- "\u2022 ",
3121
- date,
3122
- " \u2022 ",
3123
- hour
3124
- ] })
3125
- ] }),
3126
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
3127
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3128
- "button",
3129
- {
3130
- type: "button",
3131
- "aria-label": "Ver coment\xE1rios",
3132
- onClick: () => onClickComments?.(valueComments),
3133
- className: "text-text-600 flex flex-row gap-2 items-center",
3134
- children: [
3135
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.ChatCircleText, { "aria-hidden": "true", size: 16 }),
3136
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("p", { className: "text-xs", children: [
3137
- comments,
3138
- " respostas"
3139
- ] })
3140
- ]
3141
- }
3142
- )
3143
- ] })
3144
- ]
3145
- }
3146
- );
3147
- }
3148
- );
3149
- var CardAudio = (0, import_react10.forwardRef)(
3150
- ({
3151
- src,
3152
- title,
3153
- onPlay,
3154
- onPause,
3155
- onEnded,
3156
- onAudioTimeUpdate,
3157
- loop = false,
3158
- preload = "metadata",
3159
- tracks,
3160
- className,
3161
- ...props
3162
- }, ref) => {
3163
- const [isPlaying, setIsPlaying] = (0, import_react10.useState)(false);
3164
- const [currentTime, setCurrentTime] = (0, import_react10.useState)(0);
3165
- const [duration, setDuration] = (0, import_react10.useState)(0);
3166
- const [volume, setVolume] = (0, import_react10.useState)(1);
3167
- const [showVolumeControl, setShowVolumeControl] = (0, import_react10.useState)(false);
3168
- const [showSpeedMenu, setShowSpeedMenu] = (0, import_react10.useState)(false);
3169
- const [playbackRate, setPlaybackRate] = (0, import_react10.useState)(1);
3170
- const audioRef = (0, import_react10.useRef)(null);
3171
- const volumeControlRef = (0, import_react10.useRef)(null);
3172
- const speedMenuRef = (0, import_react10.useRef)(null);
3173
- const formatTime = (time) => {
3174
- const minutes = Math.floor(time / 60);
3175
- const seconds = Math.floor(time % 60);
3176
- return `${minutes}:${seconds.toString().padStart(2, "0")}`;
3177
- };
3178
- const handlePlayPause = () => {
3179
- if (isPlaying) {
3180
- audioRef.current?.pause();
3181
- setIsPlaying(false);
3182
- onPause?.();
3183
- } else {
3184
- audioRef.current?.play();
3185
- setIsPlaying(true);
3186
- onPlay?.();
3187
- }
3188
- };
3189
- const handleTimeUpdate = () => {
3190
- const current = audioRef.current?.currentTime ?? 0;
3191
- const total = audioRef.current?.duration ?? 0;
3192
- setCurrentTime(current);
3193
- setDuration(total);
3194
- onAudioTimeUpdate?.(current, total);
3195
- };
3196
- const handleLoadedMetadata = () => {
3197
- setDuration(audioRef.current?.duration ?? 0);
3198
- };
3199
- const handleEnded = () => {
3200
- setIsPlaying(false);
3201
- setCurrentTime(0);
3202
- onEnded?.();
3203
- };
3204
- const handleProgressClick = (e) => {
3205
- const rect = e.currentTarget.getBoundingClientRect();
3206
- const clickX = e.clientX - rect.left;
3207
- const width = rect.width;
3208
- const percentage = clickX / width;
3209
- const newTime = percentage * duration;
3210
- if (audioRef.current) {
3211
- audioRef.current.currentTime = newTime;
3212
- }
3213
- setCurrentTime(newTime);
3214
- };
3215
- const handleVolumeChange = (e) => {
3216
- const newVolume = parseFloat(e.target.value);
3217
- setVolume(newVolume);
3218
- if (audioRef.current) {
3219
- audioRef.current.volume = newVolume;
3220
- }
3221
- };
3222
- const toggleVolumeControl = () => {
3223
- setShowVolumeControl(!showVolumeControl);
3224
- setShowSpeedMenu(false);
3225
- };
3226
- const toggleSpeedMenu = () => {
3227
- setShowSpeedMenu(!showSpeedMenu);
3228
- setShowVolumeControl(false);
3229
- };
3230
- const handleSpeedChange = (speed) => {
3231
- setPlaybackRate(speed);
3232
- if (audioRef.current) {
3233
- audioRef.current.playbackRate = speed;
3234
- }
3235
- setShowSpeedMenu(false);
3236
- };
3237
- const getVolumeIcon = () => {
3238
- if (volume === 0) {
3239
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.SpeakerSimpleX, { size: 24 });
3240
- }
3241
- if (volume < 0.5) {
3242
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.SpeakerLow, { size: 24 });
3243
- }
3244
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.SpeakerHigh, { size: 24 });
3245
- };
3246
- (0, import_react10.useEffect)(() => {
3247
- const handleClickOutside = (event) => {
3248
- if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
3249
- setShowVolumeControl(false);
3250
- }
3251
- if (speedMenuRef.current && !speedMenuRef.current.contains(event.target)) {
3252
- setShowSpeedMenu(false);
3253
- }
3254
- };
3255
- document.addEventListener("mousedown", handleClickOutside);
3256
- return () => {
3257
- document.removeEventListener("mousedown", handleClickOutside);
3258
- };
3259
- }, []);
3260
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3261
- CardBase,
3262
- {
3263
- ref,
3264
- layout: "horizontal",
3265
- padding: "medium",
3266
- minHeight: "none",
3267
- className: cn(
3268
- "flex flex-row w-auto h-14 items-center gap-2",
3269
- className
3270
- ),
3271
- ...props,
3272
- children: [
3273
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3274
- "audio",
3275
- {
3276
- ref: audioRef,
3277
- src,
3278
- loop,
3279
- preload,
3280
- onTimeUpdate: handleTimeUpdate,
3281
- onLoadedMetadata: handleLoadedMetadata,
3282
- onEnded: handleEnded,
3283
- "data-testid": "audio-element",
3284
- "aria-label": title,
3285
- children: tracks ? tracks.map((track) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3286
- "track",
3287
- {
3288
- kind: track.kind,
3289
- src: track.src,
3290
- srcLang: track.srcLang,
3291
- label: track.label,
3292
- default: track.default
3293
- },
3294
- track.src
3295
- )) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3296
- "track",
3297
- {
3298
- kind: "captions",
3299
- src: "data:text/vtt;base64,",
3300
- srcLang: "pt",
3301
- label: "Sem legendas dispon\xEDveis"
3302
- }
3303
- )
3304
- }
3305
- ),
3306
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3307
- "button",
3308
- {
3309
- type: "button",
3310
- onClick: handlePlayPause,
3311
- disabled: !src,
3312
- className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
3313
- "aria-label": isPlaying ? "Pausar" : "Reproduzir",
3314
- children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex gap-0.5", children: [
3315
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" }),
3316
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" })
3317
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.Play, { size: 24 })
3318
- }
3319
- ),
3320
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(currentTime) }),
3321
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3322
- "button",
3323
- {
3324
- type: "button",
3325
- className: "w-full h-2 bg-border-100 rounded-full cursor-pointer",
3326
- onClick: handleProgressClick,
3327
- onKeyDown: (e) => {
3328
- if (e.key === "Enter" || e.key === " ") {
3329
- e.preventDefault();
3330
- handleProgressClick(
3331
- e
3332
- );
3333
- }
3334
- },
3335
- "aria-label": "Barra de progresso do \xE1udio",
3336
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3337
- "div",
3338
- {
3339
- className: "h-full bg-primary-600 rounded-full transition-all duration-100",
3340
- style: {
3341
- width: duration > 0 ? `${currentTime / duration * 100}%` : "0%"
3342
- }
3343
- }
3344
- )
3345
- }
3346
- ) }),
3347
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(duration) }),
3348
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative h-6", ref: volumeControlRef, children: [
3349
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3350
- "button",
3351
- {
3352
- type: "button",
3353
- onClick: toggleVolumeControl,
3354
- className: "cursor-pointer text-text-950 hover:text-primary-600",
3355
- "aria-label": "Controle de volume",
3356
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
3357
- }
3358
- ),
3359
- showVolumeControl && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3360
- "button",
3361
- {
3362
- type: "button",
3363
- 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",
3364
- onKeyDown: (e) => {
3365
- if (e.key === "Escape") {
3366
- setShowVolumeControl(false);
3367
- }
3368
- },
3369
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3370
- "input",
3371
- {
3372
- type: "range",
3373
- min: "0",
3374
- max: "1",
3375
- step: "0.1",
3376
- value: volume,
3377
- onChange: handleVolumeChange,
3378
- onKeyDown: (e) => {
3379
- if (e.key === "ArrowUp" || e.key === "ArrowRight") {
3380
- e.preventDefault();
3381
- const newVolume = Math.min(
3382
- 1,
3383
- Math.round((volume + 0.1) * 10) / 10
3384
- );
3385
- setVolume(newVolume);
3386
- if (audioRef.current) audioRef.current.volume = newVolume;
3387
- } else if (e.key === "ArrowDown" || e.key === "ArrowLeft") {
3388
- e.preventDefault();
3389
- const newVolume = Math.max(
3390
- 0,
3391
- Math.round((volume - 0.1) * 10) / 10
3392
- );
3393
- setVolume(newVolume);
3394
- if (audioRef.current) audioRef.current.volume = newVolume;
3395
- }
3396
- },
3397
- className: "w-20 h-2 bg-border-100 rounded-lg appearance-none cursor-pointer",
3398
- style: {
3399
- background: `linear-gradient(to right, #3b82f6 0%, #3b82f6 ${volume * 100}%, #e5e7eb ${volume * 100}%, #e5e7eb 100%)`
3400
- },
3401
- "aria-label": "Volume",
3402
- "aria-valuenow": Math.round(volume * 100),
3403
- "aria-valuemin": 0,
3404
- "aria-valuemax": 100
3405
- }
3406
- )
3407
- }
3408
- )
3409
- ] }),
3410
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative h-6", ref: speedMenuRef, children: [
3411
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3412
- "button",
3413
- {
3414
- type: "button",
3415
- onClick: toggleSpeedMenu,
3416
- className: "cursor-pointer text-text-950 hover:text-primary-600",
3417
- "aria-label": "Op\xE7\xF5es de velocidade",
3418
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.DotsThreeVertical, { size: 24 })
3419
- }
3420
- ),
3421
- showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg min-w-24 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col gap-1", children: [
3422
- { speed: 1, label: "1x" },
3423
- { speed: 1.5, label: "1.5x" },
3424
- { speed: 2, label: "2x" }
3425
- ].map(({ speed, label }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3426
- "button",
3427
- {
3428
- type: "button",
3429
- onClick: () => handleSpeedChange(speed),
3430
- className: cn(
3431
- "px-3 py-1 text-sm text-left rounded hover:bg-border-50 transition-colors",
3432
- playbackRate === speed ? "bg-primary-950 text-secondary-100 font-medium" : "text-text-950"
3433
- ),
3434
- children: label
3435
- },
3436
- speed
3437
- )) }) })
3438
- ] })
3439
- ]
3440
- }
3441
- );
3442
- }
3443
- );
3444
- var SIMULADO_BACKGROUND_CLASSES = {
3445
- enem: "bg-exam-1",
3446
- prova: "bg-exam-2",
3447
- simuladao: "bg-exam-3",
3448
- vestibular: "bg-exam-4"
3449
- };
3450
- var CardSimulado = (0, import_react10.forwardRef)(
3451
- ({ title, duration, info, backgroundColor, className, ...props }, ref) => {
3452
- const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
3453
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3454
- CardBase,
3455
- {
3456
- ref,
3457
- layout: "horizontal",
3458
- padding: "medium",
3459
- minHeight: "none",
3460
- cursor: "pointer",
3461
- className: cn(
3462
- `${backgroundClass} hover:shadow-soft-shadow-2 transition-shadow duration-200`,
3463
- className
3464
- ),
3465
- ...props,
3466
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between items-center w-full gap-4", children: [
3467
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
3468
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
3469
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-4 text-text-700", children: [
3470
- duration && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-1", children: [
3471
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.Clock, { size: 16, className: "flex-shrink-0" }),
3472
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "sm", children: duration })
3473
- ] }),
3474
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "sm", className: "truncate", children: info })
3475
- ] })
3476
- ] }),
3477
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3478
- import_phosphor_react5.CaretRight,
3479
- {
3480
- size: 24,
3481
- className: "text-text-800 flex-shrink-0",
3482
- "data-testid": "caret-icon"
3483
- }
3484
- )
3485
- ] })
3486
- }
3487
- );
3488
- }
3489
- );
3490
- var CardTest = (0, import_react10.forwardRef)(
3491
- ({
3492
- title,
3493
- duration,
3494
- questionsCount,
3495
- additionalInfo,
3496
- selected = false,
3497
- onSelect,
3498
- className = "",
3499
- ...props
3500
- }, ref) => {
3501
- const handleClick = () => {
3502
- if (onSelect) {
3503
- onSelect(!selected);
3504
- }
3505
- };
3506
- const handleKeyDown = (event) => {
3507
- if ((event.key === "Enter" || event.key === " ") && onSelect) {
3508
- event.preventDefault();
3509
- onSelect(!selected);
3510
- }
3511
- };
3512
- const isSelectable = !!onSelect;
3513
- const getQuestionsText = (count) => {
3514
- const singular = count === 1 ? "quest\xE3o" : "quest\xF5es";
3515
- return `${count} ${singular}`;
3516
- };
3517
- const displayInfo = questionsCount ? getQuestionsText(questionsCount) : additionalInfo || "";
3518
- 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";
3519
- const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
3520
- const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
3521
- if (isSelectable) {
3522
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3523
- "button",
3524
- {
3525
- ref,
3526
- type: "button",
3527
- className: cn(
3528
- `${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim()
3529
- ),
3530
- onClick: handleClick,
3531
- onKeyDown: handleKeyDown,
3532
- "aria-pressed": selected,
3533
- ...props,
3534
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
3535
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3536
- Text_default,
3537
- {
3538
- size: "md",
3539
- weight: "bold",
3540
- className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
3541
- children: title
3542
- }
3543
- ),
3544
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
3545
- duration && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
3546
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.Clock, { size: 16, className: "text-text-700" }),
3547
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3548
- Text_default,
3549
- {
3550
- size: "sm",
3551
- className: "text-text-700 leading-[21px] whitespace-nowrap",
3552
- children: duration
3553
- }
3554
- )
3555
- ] }),
3556
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3557
- Text_default,
3558
- {
3559
- size: "sm",
3560
- className: "text-text-700 leading-[21px] flex-grow truncate",
3561
- children: displayInfo
3562
- }
3563
- )
3564
- ] })
3565
- ] })
3566
- }
3567
- );
3568
- }
3569
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3570
- "div",
3571
- {
3572
- ref,
3573
- className: cn(`${baseClasses} ${className}`.trim()),
3574
- ...props,
3575
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
3576
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3577
- Text_default,
3578
- {
3579
- size: "md",
3580
- weight: "bold",
3581
- className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
3582
- children: title
3583
- }
3584
- ),
3585
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
3586
- duration && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
3587
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.Clock, { size: 16, className: "text-text-700" }),
3588
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3589
- Text_default,
3590
- {
3591
- size: "sm",
3592
- className: "text-text-700 leading-[21px] whitespace-nowrap",
3593
- children: duration
3594
- }
3595
- )
3596
- ] }),
3597
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3598
- Text_default,
3599
- {
3600
- size: "sm",
3601
- className: "text-text-700 leading-[21px] flex-grow truncate min-w-0",
3602
- children: displayInfo
3603
- }
3604
- )
3605
- ] })
3606
- ] })
3607
- }
3608
- );
3609
- }
3610
- );
3611
- var SIMULATION_TYPE_STYLES = {
3612
- enem: {
3613
- background: "bg-exam-1",
3614
- badge: "exam1",
3615
- text: "Enem"
3616
- },
3617
- prova: {
3618
- background: "bg-exam-2",
3619
- badge: "exam2",
3620
- text: "Prova"
3621
- },
3622
- simulado: {
3623
- background: "bg-exam-3",
3624
- badge: "exam3",
3625
- text: "Simulad\xE3o"
3626
- },
3627
- vestibular: {
3628
- background: "bg-exam-4",
3629
- badge: "exam4",
3630
- text: "Vestibular"
3631
- }
3632
- };
3633
- var CardSimulationHistory = (0, import_react10.forwardRef)(({ data, onSimulationClick, className, ...props }, ref) => {
3634
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3635
- "div",
3636
- {
3637
- ref,
3638
- className: cn("w-full max-w-[992px] h-auto", className),
3639
- ...props,
3640
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-0", children: [
3641
- data.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3642
- "div",
3643
- {
3644
- className: cn(
3645
- "flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-background",
3646
- sectionIndex === 0 ? "rounded-t-3xl" : ""
3647
- ),
3648
- children: [
3649
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3650
- Text_default,
3651
- {
3652
- size: "xs",
3653
- weight: "bold",
3654
- className: "text-text-800 w-11 flex-shrink-0",
3655
- children: section.date
3656
- }
3657
- ),
3658
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
3659
- const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
3660
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3661
- CardBase,
3662
- {
3663
- layout: "horizontal",
3664
- padding: "medium",
3665
- minHeight: "none",
3666
- cursor: "pointer",
3667
- className: cn(
3668
- `${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
3669
- transition-shadow duration-200 h-auto min-h-[61px]`
3670
- ),
3671
- onClick: () => onSimulationClick?.(simulation),
3672
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between items-center w-full gap-2", children: [
3673
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-wrap flex-col justify-between sm:flex-row gap-2 flex-1 min-w-0", children: [
3674
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3675
- Text_default,
3676
- {
3677
- size: "lg",
3678
- weight: "bold",
3679
- className: "text-text-950 truncate",
3680
- children: simulation.title
3681
- }
3682
- ),
3683
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
3684
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3685
- Badge_default,
3686
- {
3687
- variant: "examsOutlined",
3688
- action: typeStyles.badge,
3689
- size: "medium",
3690
- children: typeStyles.text
3691
- }
3692
- ),
3693
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
3694
- ] })
3695
- ] }),
3696
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3697
- import_phosphor_react5.CaretRight,
3698
- {
3699
- size: 24,
3700
- className: "text-text-800 flex-shrink-0",
3701
- "data-testid": "caret-icon"
3702
- }
3703
- )
3704
- ] })
3705
- },
3706
- simulation.id
3707
- );
3708
- }) })
3709
- ]
3710
- }
3711
- ) }, section.date)),
3712
- data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-full h-6 bg-background rounded-b-3xl" })
3713
- ] })
3714
- }
3715
- );
3716
- });
3717
-
3718
- // src/components/Accordation/Accordation.tsx
3719
- var import_phosphor_react6 = require("phosphor-react");
3720
- var import_jsx_runtime25 = require("react/jsx-runtime");
3721
- var CardAccordation = (0, import_react11.forwardRef)(
3722
- ({
3723
- trigger,
3724
- children,
3725
- className,
3726
- defaultExpanded = false,
3727
- expanded: controlledExpanded,
3728
- onToggleExpanded,
3729
- value,
3730
- disabled = false,
3731
- triggerClassName,
3732
- contentClassName,
3733
- ...props
3734
- }, ref) => {
3735
- const [internalExpanded, setInternalExpanded] = (0, import_react11.useState)(defaultExpanded);
3736
- const generatedId = (0, import_react11.useId)();
3737
- const contentId = value ? `accordion-content-${value}` : generatedId;
3738
- const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
3739
- const isControlled = controlledExpanded !== void 0;
3740
- const isExpanded = isControlled ? controlledExpanded : internalExpanded;
3741
- (0, import_react11.useEffect)(() => {
3742
- if (isControlled) {
3743
- setInternalExpanded(controlledExpanded);
3744
- }
3745
- }, [isControlled, controlledExpanded]);
3746
- const handleToggle = () => {
3747
- if (disabled) return;
3748
- const newExpanded = !isExpanded;
3749
- if (!isControlled) {
3750
- setInternalExpanded(newExpanded);
3751
- }
3752
- onToggleExpanded?.(newExpanded);
3753
- };
3754
- const handleKeyDown = (event) => {
3755
- if (disabled) return;
3756
- if (event.key === "Enter" || event.key === " ") {
3757
- event.preventDefault();
3758
- handleToggle();
3759
- }
3760
- };
3761
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3762
- CardBase,
3763
- {
3764
- ref,
3765
- layout: "vertical",
3766
- padding: "none",
3767
- minHeight: "none",
3768
- className: cn("overflow-hidden", className),
3769
- ...props,
3770
- children: [
3771
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3772
- "button",
3773
- {
3774
- id: headerId,
3775
- type: "button",
3776
- onClick: handleToggle,
3777
- onKeyDown: handleKeyDown,
3778
- disabled,
3779
- className: cn(
3780
- "w-full cursor-pointer not-aria-expanded:rounded-xl aria-expanded:rounded-t-xl flex items-center justify-between gap-3 text-left transition-colors duration-200 focus:outline-none focus:border-2 focus:border-primary-950 focus:ring-inset px-2",
3781
- disabled && "cursor-not-allowed text-text-400",
3782
- triggerClassName
3783
- ),
3784
- "aria-expanded": isExpanded,
3785
- "aria-controls": contentId,
3786
- "aria-disabled": disabled,
3787
- "data-value": value,
3788
- children: [
3789
- trigger,
3790
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3791
- import_phosphor_react6.CaretRight,
3792
- {
3793
- size: 20,
3794
- className: cn(
3795
- "transition-transform duration-200 flex-shrink-0",
3796
- disabled ? "text-gray-400" : "text-text-700",
3797
- isExpanded ? "rotate-90" : "rotate-0"
3798
- ),
3799
- "data-testid": "accordion-caret"
3800
- }
3801
- )
3802
- ]
3803
- }
3804
- ),
3805
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3806
- "section",
3807
- {
3808
- id: contentId,
3809
- "aria-labelledby": headerId,
3810
- "aria-hidden": !isExpanded,
3811
- className: cn(
3812
- "transition-all duration-300 ease-in-out overflow-hidden",
3813
- isExpanded ? "max-h-screen opacity-100" : "max-h-0 opacity-0"
3814
- ),
3815
- "data-testid": "accordion-content",
3816
- "data-value": value,
3817
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: cn("p-4 pt-0", contentClassName), children })
3818
- }
3819
- )
3820
- ]
3821
- }
3822
- );
3823
- }
3824
- );
3825
- CardAccordation.displayName = "CardAccordation";
3826
-
3827
- // src/components/Alternative/Alternative.tsx
3828
- var import_phosphor_react7 = require("phosphor-react");
3829
-
3830
- // src/components/Radio/Radio.tsx
3831
- var import_react12 = require("react");
3832
- var import_zustand = require("zustand");
3833
- var import_jsx_runtime26 = require("react/jsx-runtime");
3834
- var SIZE_CLASSES6 = {
3835
- small: {
3836
- radio: "w-5 h-5",
3837
- textSize: "sm",
3838
- spacing: "gap-1.5",
3839
- borderWidth: "border-2",
3840
- dotSize: "w-2.5 h-2.5",
3841
- labelHeight: "h-5"
3842
- },
3843
- medium: {
3844
- radio: "w-6 h-6",
3845
- textSize: "md",
3846
- spacing: "gap-2",
3847
- borderWidth: "border-2",
3848
- dotSize: "w-3 h-3",
3849
- labelHeight: "h-6"
3850
- },
3851
- large: {
3852
- radio: "w-7 h-7",
3853
- textSize: "lg",
3854
- spacing: "gap-2",
3855
- borderWidth: "border-2",
3856
- dotSize: "w-3.5 h-3.5",
3857
- labelHeight: "h-7"
3858
- },
3859
- extraLarge: {
3860
- radio: "w-8 h-8",
3861
- textSize: "xl",
3862
- spacing: "gap-3",
3863
- borderWidth: "border-2",
3864
- dotSize: "w-4 h-4",
3865
- labelHeight: "h-8"
3866
- }
3867
- };
3868
- var BASE_RADIO_CLASSES = "rounded-full border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
3869
- var STATE_CLASSES = {
3870
- default: {
3871
- unchecked: "border-border-400 bg-background hover:border-border-500",
3872
- checked: "border-primary-950 bg-background hover:border-primary-800"
3873
- },
3874
- hovered: {
3875
- unchecked: "border-border-500 bg-background",
3876
- checked: "border-info-700 bg-background"
3877
- },
3878
- focused: {
3879
- unchecked: "border-border-400 bg-background",
3880
- checked: "border-primary-950 bg-background"
3881
- },
3882
- invalid: {
3883
- unchecked: "border-border-400 bg-background",
3884
- checked: "border-primary-950 bg-background"
3885
- },
3886
- disabled: {
3887
- unchecked: "border-border-400 bg-background cursor-not-allowed",
3888
- checked: "border-primary-950 bg-background cursor-not-allowed"
3889
- }
3890
- };
3891
- var DOT_CLASSES = {
3892
- default: "bg-primary-950",
3893
- hovered: "bg-info-700",
3894
- focused: "bg-primary-950",
3895
- invalid: "bg-primary-950",
3896
- disabled: "bg-primary-950"
3897
- };
3898
- var Radio = (0, import_react12.forwardRef)(
3899
- ({
3900
- label,
3901
- size = "medium",
3902
- state = "default",
3903
- errorMessage,
3904
- helperText,
3905
- className = "",
3906
- labelClassName = "",
3907
- checked: checkedProp,
3908
- defaultChecked = false,
3909
- disabled,
3910
- id,
3911
- name,
3912
- value,
3913
- onChange,
3914
- ...props
3915
- }, ref) => {
3916
- const generatedId = (0, import_react12.useId)();
3917
- const inputId = id ?? `radio-${generatedId}`;
3918
- const inputRef = (0, import_react12.useRef)(null);
3919
- const [internalChecked, setInternalChecked] = (0, import_react12.useState)(defaultChecked);
3920
- const isControlled = checkedProp !== void 0;
3921
- const checked = isControlled ? checkedProp : internalChecked;
3922
- const handleChange = (event) => {
3923
- const newChecked = event.target.checked;
3924
- if (!isControlled) {
3925
- setInternalChecked(newChecked);
3926
- }
3927
- if (event.target) {
3928
- event.target.blur();
3929
- }
3930
- onChange?.(event);
3931
- };
3932
- const currentState = disabled ? "disabled" : state;
3933
- const sizeClasses = SIZE_CLASSES6[size];
3934
- const actualRadioSize = sizeClasses.radio;
3935
- const actualDotSize = sizeClasses.dotSize;
3936
- const radioVariant = checked ? "checked" : "unchecked";
3937
- const stylingClasses = STATE_CLASSES[currentState][radioVariant];
3938
- const getBorderWidth = () => {
3939
- if (currentState === "focused") {
3940
- return "border-2";
3941
- }
3942
- return sizeClasses.borderWidth;
3943
- };
3944
- const borderWidthClass = getBorderWidth();
3945
- const radioClasses = cn(
3946
- BASE_RADIO_CLASSES,
3947
- actualRadioSize,
3948
- borderWidthClass,
3949
- stylingClasses,
3950
- className
3951
- );
3952
- const dotClasses = cn(
3953
- actualDotSize,
3954
- "rounded-full",
3955
- DOT_CLASSES[currentState],
3956
- "transition-all duration-200"
3957
- );
3958
- const isWrapperNeeded = currentState === "focused" || currentState === "invalid";
3959
- const wrapperBorderColor = currentState === "focused" ? "border-indicator-info" : "border-indicator-error";
3960
- const getTextColor = () => {
3961
- if (currentState === "disabled") {
3962
- return checked ? "text-text-900" : "text-text-600";
3963
- }
3964
- if (currentState === "focused") {
3965
- return "text-text-900";
3966
- }
3967
- return checked ? "text-text-900" : "text-text-600";
3968
- };
3969
- const getCursorClass = () => {
3970
- return currentState === "disabled" ? "cursor-not-allowed" : "cursor-pointer";
3971
- };
3972
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col", children: [
3973
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3974
- "div",
3975
- {
3976
- className: cn(
3977
- "flex flex-row items-center",
3978
- isWrapperNeeded ? cn("p-1 border-2", wrapperBorderColor, "rounded-lg gap-1.5") : sizeClasses.spacing,
3979
- disabled ? "opacity-40" : ""
3980
- ),
3981
- children: [
3982
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3983
- "input",
3984
- {
3985
- ref: (node) => {
3986
- inputRef.current = node;
3987
- if (typeof ref === "function") ref(node);
3988
- else if (ref) ref.current = node;
3989
- },
3990
- type: "radio",
3991
- id: inputId,
3992
- checked,
3993
- disabled,
3994
- name,
3995
- value,
3996
- onChange: handleChange,
3997
- className: "sr-only",
3998
- style: {
3999
- position: "absolute",
4000
- left: "-9999px",
4001
- visibility: "hidden"
4002
- },
4003
- ...props
4004
- }
4005
- ),
4006
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4007
- "button",
4008
- {
4009
- type: "button",
4010
- className: radioClasses,
4011
- disabled,
4012
- "aria-pressed": checked,
4013
- onClick: (e) => {
4014
- e.preventDefault();
4015
- if (!disabled) {
4016
- if (inputRef.current) {
4017
- inputRef.current.click();
4018
- inputRef.current.blur();
4019
- }
4020
- }
4021
- },
4022
- onKeyDown: (e) => {
4023
- if ((e.key === "Enter" || e.key === " ") && !disabled) {
4024
- e.preventDefault();
4025
- if (inputRef.current) {
4026
- inputRef.current.click();
4027
- inputRef.current.blur();
4028
- }
4029
- }
4030
- },
4031
- children: checked && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: dotClasses })
4032
- }
4033
- ),
4034
- label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4035
- "div",
4036
- {
4037
- className: cn(
4038
- "flex flex-row items-center",
4039
- sizeClasses.labelHeight,
4040
- "flex-1 min-w-0"
4041
- ),
4042
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4043
- Text_default,
4044
- {
4045
- as: "label",
4046
- htmlFor: inputId,
4047
- size: sizeClasses.textSize,
4048
- weight: "normal",
4049
- className: cn(
4050
- getCursorClass(),
4051
- "select-none leading-normal flex items-center font-roboto truncate",
4052
- labelClassName
4053
- ),
4054
- color: getTextColor(),
4055
- children: label
4056
- }
4057
- )
4058
- }
4059
- )
4060
- ]
4061
- }
4062
- ),
4063
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4064
- Text_default,
4065
- {
4066
- size: "sm",
4067
- weight: "normal",
4068
- className: "mt-1.5 truncate",
4069
- color: "text-error-600",
4070
- children: errorMessage
4071
- }
4072
- ),
4073
- helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4074
- Text_default,
4075
- {
4076
- size: "sm",
4077
- weight: "normal",
4078
- className: "mt-1.5 truncate",
4079
- color: "text-text-500",
4080
- children: helperText
4081
- }
4082
- )
4083
- ] });
4084
- }
4085
- );
4086
- Radio.displayName = "Radio";
4087
- var createRadioGroupStore = (name, defaultValue, disabled, onValueChange) => (0, import_zustand.create)((set, get) => ({
4088
- value: defaultValue,
4089
- setValue: (value) => {
4090
- if (!get().disabled) {
4091
- set({ value });
4092
- get().onValueChange?.(value);
4093
- }
4094
- },
4095
- onValueChange,
4096
- disabled,
4097
- name
4098
- }));
4099
- var useRadioGroupStore = (externalStore) => {
4100
- if (!externalStore) {
4101
- throw new Error("RadioGroupItem must be used within a RadioGroup");
4102
- }
4103
- return externalStore;
4104
- };
4105
- var injectStore = (children, store) => import_react12.Children.map(children, (child) => {
4106
- if (!(0, import_react12.isValidElement)(child)) return child;
4107
- const typedChild = child;
4108
- const shouldInject = typedChild.type === RadioGroupItem;
4109
- return (0, import_react12.cloneElement)(typedChild, {
4110
- ...shouldInject ? { store } : {},
4111
- ...typedChild.props.children ? { children: injectStore(typedChild.props.children, store) } : {}
4112
- });
4113
- });
4114
- var RadioGroup = (0, import_react12.forwardRef)(
4115
- ({
4116
- value: propValue,
4117
- defaultValue = "",
4118
- onValueChange,
4119
- name: propName,
4120
- disabled = false,
4121
- className = "",
4122
- children,
4123
- ...props
4124
- }, ref) => {
4125
- const generatedId = (0, import_react12.useId)();
4126
- const name = propName || `radio-group-${generatedId}`;
4127
- const storeRef = (0, import_react12.useRef)(null);
4128
- storeRef.current ??= createRadioGroupStore(
4129
- name,
4130
- defaultValue,
4131
- disabled,
4132
- onValueChange
4133
- );
4134
- const store = storeRef.current;
4135
- const { setValue } = (0, import_zustand.useStore)(store, (s) => s);
4136
- (0, import_react12.useEffect)(() => {
4137
- const currentValue = store.getState().value;
4138
- if (currentValue && onValueChange) {
4139
- onValueChange(currentValue);
4140
- }
4141
- }, []);
4142
- (0, import_react12.useEffect)(() => {
4143
- if (propValue !== void 0) {
4144
- setValue(propValue);
4145
- }
4146
- }, [propValue, setValue]);
4147
- (0, import_react12.useEffect)(() => {
4148
- store.setState({ disabled });
4149
- }, [disabled, store]);
4150
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4151
- "div",
4152
- {
4153
- ref,
4154
- className,
4155
- role: "radiogroup",
4156
- "aria-label": name,
4157
- ...props,
4158
- children: injectStore(children, store)
4159
- }
4160
- );
4161
- }
4162
- );
4163
- RadioGroup.displayName = "RadioGroup";
4164
- var RadioGroupItem = (0, import_react12.forwardRef)(
4165
- ({
4166
- value,
4167
- store: externalStore,
4168
- disabled: itemDisabled,
4169
- size = "medium",
4170
- state = "default",
4171
- className = "",
4172
- id,
4173
- ...props
4174
- }, ref) => {
4175
- const store = useRadioGroupStore(externalStore);
4176
- const {
4177
- value: groupValue,
4178
- setValue,
4179
- disabled: groupDisabled,
4180
- name
4181
- } = (0, import_zustand.useStore)(store);
4182
- const generatedId = (0, import_react12.useId)();
4183
- const inputId = id ?? `radio-item-${generatedId}`;
4184
- const isChecked = groupValue === value;
4185
- const isDisabled = groupDisabled || itemDisabled;
4186
- const currentState = isDisabled ? "disabled" : state;
4187
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4188
- Radio,
4189
- {
4190
- ref,
4191
- id: inputId,
4192
- name,
4193
- value,
4194
- checked: isChecked,
4195
- disabled: isDisabled,
4196
- size,
4197
- state: currentState,
4198
- className,
4199
- onChange: (e) => {
4200
- if (e.target.checked && !isDisabled) {
4201
- setValue(value);
4202
- }
4203
- },
4204
- ...props
4205
- }
4206
- );
4207
- }
4208
- );
4209
- RadioGroupItem.displayName = "RadioGroupItem";
4210
-
4211
- // src/components/Alternative/Alternative.tsx
4212
- var import_react13 = require("react");
4213
- var import_jsx_runtime27 = require("react/jsx-runtime");
4214
- var AlternativesList = ({
4215
- alternatives,
4216
- name,
4217
- defaultValue,
4218
- value,
4219
- onValueChange,
4220
- disabled = false,
4221
- layout = "default",
4222
- className = "",
4223
- mode = "interactive",
4224
- selectedValue
4225
- }) => {
4226
- const uniqueId = (0, import_react13.useId)();
4227
- const groupName = name || `alternatives-${uniqueId}`;
4228
- const [actualValue, setActualValue] = (0, import_react13.useState)(value);
4229
- const isReadonly = mode === "readonly";
4230
- const getStatusStyles = (status, isReadonly2) => {
4231
- const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
4232
- switch (status) {
4233
- case "correct":
4234
- return "bg-success-background border-success-300";
4235
- case "incorrect":
4236
- return "bg-error-background border-error-300";
4237
- default:
4238
- return `bg-background border-border-100 ${hoverClass}`;
4239
- }
4240
- };
4241
- const getStatusBadge = (status) => {
4242
- switch (status) {
4243
- case "correct":
4244
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_phosphor_react7.CheckCircle, {}), children: "Resposta correta" });
4245
- case "incorrect":
4246
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_phosphor_react7.XCircle, {}), children: "Resposta incorreta" });
4247
- default:
4248
- return null;
4249
- }
4250
- };
4251
- const getLayoutClasses = () => {
4252
- switch (layout) {
4253
- case "compact":
4254
- return "gap-2";
4255
- case "detailed":
4256
- return "gap-4";
4257
- default:
4258
- return "gap-3.5";
4259
- }
4260
- };
4261
- const renderReadonlyAlternative = (alternative) => {
4262
- const alternativeId = alternative.value;
4263
- const isUserSelected = selectedValue === alternative.value;
4264
- const isCorrectAnswer = alternative.status === "correct";
4265
- let displayStatus = void 0;
4266
- if (isUserSelected && !isCorrectAnswer) {
4267
- displayStatus = "incorrect";
4268
- } else if (isCorrectAnswer) {
4269
- displayStatus = "correct";
4270
- }
4271
- const statusStyles = getStatusStyles(displayStatus, true);
4272
- const statusBadge = getStatusBadge(displayStatus);
4273
- const renderRadio = () => {
4274
- 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"}`;
4275
- const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
4276
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: dotClasses }) });
4277
- };
4278
- if (layout === "detailed") {
4279
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4280
- "div",
4281
- {
4282
- className: cn(
4283
- "border-2 rounded-lg p-4 w-full",
4284
- statusStyles,
4285
- alternative.disabled ? "opacity-50" : ""
4286
- ),
4287
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
4288
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
4289
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mt-1", children: renderRadio() }),
4290
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1", children: [
4291
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4292
- "p",
4293
- {
4294
- className: cn(
4295
- "block font-medium",
4296
- selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
4297
- ),
4298
- children: alternative.label
4299
- }
4300
- ),
4301
- alternative.description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
4302
- ] })
4303
- ] }),
4304
- statusBadge && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
4305
- ] })
4306
- },
4307
- alternativeId
4308
- );
4309
- }
4310
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4311
- "div",
4312
- {
4313
- className: cn(
4314
- "flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full",
4315
- statusStyles,
4316
- alternative.disabled ? "opacity-50" : ""
4317
- ),
4318
- children: [
4319
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
4320
- renderRadio(),
4321
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4322
- "span",
4323
- {
4324
- className: cn(
4325
- "flex-1",
4326
- selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
4327
- ),
4328
- children: alternative.label
4329
- }
4330
- )
4331
- ] }),
4332
- statusBadge && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
4333
- ]
4334
- },
4335
- alternativeId
4336
- );
4337
- };
4338
- if (isReadonly) {
4339
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4340
- "div",
4341
- {
4342
- className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
4343
- children: alternatives.map(
4344
- (alternative) => renderReadonlyAlternative(alternative)
4345
- )
4346
- }
4347
- );
4348
- }
4349
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4350
- RadioGroup,
4351
- {
4352
- name: groupName,
4353
- defaultValue,
4354
- value,
4355
- onValueChange: (value2) => {
4356
- setActualValue(value2);
4357
- onValueChange?.(value2);
4358
- },
4359
- disabled,
4360
- className: cn("flex flex-col", getLayoutClasses(), className),
4361
- children: alternatives.map((alternative, index) => {
4362
- const alternativeId = alternative.value || `alt-${index}`;
4363
- const statusStyles = getStatusStyles(alternative.status, false);
4364
- const statusBadge = getStatusBadge(alternative.status);
4365
- if (layout === "detailed") {
4366
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4367
- "div",
4368
- {
4369
- className: cn(
4370
- "border-2 rounded-lg p-4 transition-all",
4371
- statusStyles,
4372
- alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
4373
- ),
4374
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
4375
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
4376
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4377
- RadioGroupItem,
4378
- {
4379
- value: alternative.value,
4380
- id: alternativeId,
4381
- disabled: alternative.disabled,
4382
- className: "mt-1"
4383
- }
4384
- ),
4385
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1", children: [
4386
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4387
- "label",
4388
- {
4389
- htmlFor: alternativeId,
4390
- className: cn(
4391
- "block font-medium",
4392
- actualValue === alternative.value ? "text-text-950" : "text-text-600",
4393
- alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
4394
- ),
4395
- children: alternative.label
4396
- }
4397
- ),
4398
- alternative.description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
4399
- ] })
4400
- ] }),
4401
- statusBadge && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
4402
- ] })
4403
- },
4404
- alternativeId
4405
- );
4406
- }
4407
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4408
- "div",
4409
- {
4410
- className: cn(
4411
- "flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
4412
- statusStyles,
4413
- alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
4414
- ),
4415
- children: [
4416
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
4417
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4418
- RadioGroupItem,
4419
- {
4420
- value: alternative.value,
4421
- id: alternativeId,
4422
- disabled: alternative.disabled
4423
- }
4424
- ),
4425
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4426
- "label",
4427
- {
4428
- htmlFor: alternativeId,
4429
- className: cn(
4430
- "flex-1",
4431
- actualValue === alternative.value ? "text-text-950" : "text-text-600",
4432
- alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
4433
- ),
4434
- children: alternative.label
4435
- }
4436
- )
4437
- ] }),
4438
- statusBadge && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
4439
- ]
4440
- },
4441
- alternativeId
4442
- );
4443
- })
4444
- }
4445
- );
4446
- };
4447
- var HeaderAlternative = (0, import_react13.forwardRef)(
4448
- ({ className, title, subTitle, content, ...props }, ref) => {
4449
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4450
- "div",
4451
- {
4452
- ref,
4453
- className: cn(
4454
- "bg-background p-4 flex flex-col gap-4 rounded-xl",
4455
- className
4456
- ),
4457
- ...props,
4458
- children: [
4459
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "flex flex-col", children: [
4460
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-text-950 font-bold text-lg", children: title }),
4461
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-text-700 text-sm ", children: subTitle })
4462
- ] }),
4463
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-text-950 text-md", children: content })
4464
- ]
4465
- }
4466
- );
4467
- }
4468
- );
4469
-
4470
- // src/components/RecommendedLessonDetails/types.ts
4471
- var DEFAULT_LABELS = {
4472
- viewLesson: "Ver aula",
4473
- viewPerformance: "Ver desempenho",
4474
- resultsTitle: "Resultados da aula recomendada",
4475
- completedLabel: "CONCLU\xCDDO",
4476
- bestResultLabel: "MELHOR RESULTADO",
4477
- hardestTopicLabel: "MAIOR DIFICULDADE",
4478
- studentColumn: "Aluno",
4479
- statusColumn: "Status",
4480
- completionColumn: "Conclus\xE3o",
4481
- durationColumn: "Dura\xE7\xE3o"
4482
- };
4483
- var DEFAULT_PERFORMANCE_LABELS = {
4484
- title: "Desempenho",
4485
- correctAnswersLabel: "N\xB0 DE QUEST\xD5ES CORRETAS",
4486
- incorrectAnswersLabel: "N\xB0 DE QUEST\xD5ES INCORRETAS",
4487
- bestResultLabel: "MELHOR RESULTADO",
4488
- hardestTopicLabel: "MAIOR DIFICULDADE",
4489
- lessonsTitle: "Aulas"
4490
- };
4491
-
4492
- // src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
4493
- var import_jsx_runtime28 = require("react/jsx-runtime");
4494
- var PerformanceCard = ({
4495
- icon,
4496
- label,
4497
- value,
4498
- secondaryLabel,
4499
- secondaryValue,
4500
- variant
4501
- }) => {
4502
- const headerBgColor = {
4503
- success: "bg-success-200",
4504
- error: "bg-error-100"
4505
- }[variant];
4506
- const valueColor = {
4507
- success: "text-success-700",
4508
- error: "text-error-700"
4509
- }[variant];
4510
- const iconBgColor = {
4511
- success: "bg-warning-300",
4512
- error: "bg-error-300"
4513
- }[variant];
4514
- const secondaryLabelColor = {
4515
- success: "text-success-600",
4516
- error: "text-error-600"
4517
- }[variant];
4518
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col rounded-xl border border-border-50 bg-background overflow-hidden", children: [
4519
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4520
- "div",
4521
- {
4522
- className: `flex flex-col items-center justify-center p-4 gap-1 ${headerBgColor}`,
4523
- children: [
4524
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4525
- Text_default,
4526
- {
4527
- as: "span",
4528
- className: `size-8 rounded-full flex items-center justify-center ${iconBgColor}`,
4529
- children: icon
4530
- }
4531
- ),
4532
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4533
- Text_default,
4534
- {
4535
- size: "2xs",
4536
- weight: "medium",
4537
- className: "text-text-800 uppercase text-center leading-none",
4538
- children: label
4539
- }
4540
- ),
4541
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "xl", weight: "bold", className: `${valueColor} text-center`, children: value })
4542
- ]
4543
- }
4544
- ),
4545
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col items-center gap-2 px-4 py-3", children: [
4546
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4547
- Text_default,
4548
- {
4549
- size: "2xs",
4550
- weight: "medium",
4551
- className: `${secondaryLabelColor} uppercase text-center`,
4552
- children: secondaryLabel
4553
- }
4554
- ),
4555
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Badge_default, { size: "large", action: "info", children: secondaryValue || "-" })
4556
- ] })
4557
- ] });
4558
- };
4559
- var getAlternativeStatus = (isCorrect, isSelected) => {
4560
- if (isCorrect) {
4561
- return "correct";
4562
- }
4563
- if (isSelected) {
4564
- return "incorrect";
4565
- }
4566
- return void 0;
4567
- };
4568
- var mapAlternatives = (question) => {
4569
- return question.alternatives.map((alt) => ({
4570
- value: alt.id,
4571
- label: alt.text,
4572
- status: getAlternativeStatus(alt.isCorrect, alt.isSelected)
4573
- }));
4574
- };
4575
- var getSelectedValue = (question) => {
4576
- const selected = question.alternatives.find((alt) => alt.isSelected);
4577
- return selected?.id;
4578
- };
4579
- var QuestionAccordionItem = ({
4580
- question,
4581
- index
4582
- }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4583
- CardAccordation,
4584
- {
4585
- value: question.id,
4586
- className: "bg-background rounded-xl border border-border-50",
4587
- triggerClassName: "py-5 px-5",
4588
- contentClassName: "px-5 pb-5",
4589
- trigger: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between flex-1", children: [
4590
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: [
4591
- "Quest\xE3o ",
4592
- index + 1
4593
- ] }),
4594
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4595
- Badge_default,
4596
- {
4597
- size: "small",
4598
- action: question.isCorrect ? "success" : "error",
4599
- variant: "solid",
4600
- iconLeft: question.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react15.CheckCircleIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react15.XCircleIcon, {}),
4601
- children: question.isCorrect ? "Correta" : "Incorreta"
4602
- }
4603
- )
4604
- ] }),
4605
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-3", children: [
4606
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "sm", className: "text-text-700", children: question.statement }),
4607
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4608
- CardAccordation,
4609
- {
4610
- value: `${question.id}-alternatives`,
4611
- className: "bg-background rounded-lg border border-border-50",
4612
- triggerClassName: "py-5 px-5",
4613
- contentClassName: "px-5 py-5",
4614
- trigger: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "sm", weight: "medium", className: "text-text-800", children: "Alternativas" }),
4615
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4616
- AlternativesList,
4617
- {
4618
- mode: "readonly",
4619
- alternatives: mapAlternatives(question),
4620
- selectedValue: getSelectedValue(question),
4621
- layout: "default"
4622
- }
4623
- )
4624
- }
4625
- )
4626
- ] })
4627
- }
4628
- );
4629
- var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4630
- CardAccordation,
4631
- {
4632
- value: lesson.id,
4633
- className: "bg-background rounded-xl border border-border-50",
4634
- triggerClassName: "py-5 px-5",
4635
- contentClassName: "px-5 pb-5",
4636
- trigger: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-1 flex-1", children: [
4637
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: lesson.title }),
4638
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4639
- ProgressBar_default,
4640
- {
4641
- value: lesson.progress,
4642
- variant: "blue",
4643
- size: "medium",
4644
- showPercentage: true,
4645
- layout: "default"
4646
- }
4647
- )
4648
- ] }),
4649
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-col gap-2", children: lesson.questions.map((question, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4650
- QuestionAccordionItem,
4651
- {
4652
- question,
4653
- index
4654
- },
4655
- question.id
4656
- )) })
4657
- }
4658
- );
4659
- var LoadingSkeleton2 = () => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-4 animate-pulse", children: [
4660
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-6 bg-background-200 rounded w-48" }),
4661
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
4662
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-44 bg-background-200 rounded-xl" }),
4663
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-44 bg-background-200 rounded-xl" })
4664
- ] })
4665
- ] });
4666
- var PerformanceContent = ({
4667
- data,
4668
- labels
4669
- }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-5", children: [
4670
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2", children: [
4671
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4672
- Text_default,
4673
- {
4674
- as: "span",
4675
- className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
4676
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react15.UserIcon, { size: 16, className: "text-text-500" })
4677
- }
4678
- ),
4679
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "md", weight: "medium", className: "text-text-950", children: data.studentName })
4680
- ] }),
4681
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
4682
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4683
- PerformanceCard,
4684
- {
4685
- icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4686
- import_react15.LightbulbFilamentIcon,
4687
- {
4688
- size: 18,
4689
- weight: "fill",
4690
- className: "text-white"
4691
- }
4692
- ),
4693
- label: labels.correctAnswersLabel,
4694
- value: data.correctAnswers,
4695
- secondaryLabel: labels.bestResultLabel,
4696
- secondaryValue: data.bestResult,
4697
- variant: "success"
4698
- }
4699
- ),
4700
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4701
- PerformanceCard,
4702
- {
4703
- icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4704
- import_react15.WarningCircleIcon,
4705
- {
4706
- size: 18,
4707
- weight: "fill",
4708
- className: "text-error-700"
4709
- }
4710
- ),
4711
- label: labels.incorrectAnswersLabel,
4712
- value: data.incorrectAnswers,
4713
- secondaryLabel: labels.hardestTopicLabel,
4714
- secondaryValue: data.hardestTopic,
4715
- variant: "error"
4716
- }
4717
- )
4718
- ] }),
4719
- data.lessons.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-3", children: [
4720
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "md", weight: "semibold", className: "text-text-950", children: labels.lessonsTitle }),
4721
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-col gap-2", children: data.lessons.map((lesson) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LessonAccordionItem, { lesson }, lesson.id)) })
4722
- ] })
4723
- ] });
4724
- var renderModalContent = (loading, data, labels) => {
4725
- if (loading) {
4726
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LoadingSkeleton2, {});
4727
- }
4728
- if (data) {
4729
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PerformanceContent, { data, labels });
4730
- }
4731
- return null;
4732
- };
4733
- var StudentPerformanceModal = ({
4734
- isOpen,
4735
- onClose,
4736
- data,
4737
- loading = false,
4738
- labels: customLabels
4739
- }) => {
4740
- const labels = (0, import_react14.useMemo)(
4741
- () => ({ ...DEFAULT_PERFORMANCE_LABELS, ...customLabels }),
4742
- [customLabels]
4743
- );
4744
- if (!data && !loading) {
4745
- return null;
4746
- }
4747
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4748
- Modal_default,
4749
- {
4750
- isOpen,
4751
- onClose,
4752
- title: labels.title,
4753
- size: "lg",
4754
- contentClassName: "max-h-[70vh] overflow-y-auto",
4755
- children: renderModalContent(loading, data, labels)
4756
- }
4757
- );
4758
- };
4759
-
4760
- // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
4761
- var import_jsx_runtime29 = require("react/jsx-runtime");
4762
- var RecommendedLessonDetails = ({
4763
- data,
4764
- loading = false,
4765
- error = null,
4766
- onViewLesson,
4767
- onViewStudentPerformance,
4768
- onBreadcrumbClick,
4769
- mapSubjectNameToEnum,
4770
- breadcrumbs,
4771
- labels: customLabels,
4772
- className
4773
- }) => {
4774
- const labels = (0, import_react16.useMemo)(
4775
- () => ({ ...DEFAULT_LABELS, ...customLabels }),
4776
- [customLabels]
4777
- );
4778
- const defaultBreadcrumbs = (0, import_react16.useMemo)(
4779
- () => [
4780
- { label: "Aulas recomendadas", path: "/aulas-recomendadas" },
4781
- { label: data?.goal.title || "Detalhes" }
4782
- ],
4783
- [data?.goal.title]
4784
- );
4785
- const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
4786
- const displayStudents = (0, import_react16.useMemo)(() => {
4787
- if (!data?.details.students) return [];
4788
- const deadline = data?.goal.finalDate;
4789
- return data.details.students.map(
4790
- (student) => transformStudentForDisplay(student, deadline)
4791
- );
4792
- }, [data?.details.students, data?.goal.finalDate]);
4793
- if (loading) {
4794
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4795
- "div",
4796
- {
4797
- className: cn("flex flex-col gap-6", className),
4798
- "data-testid": "lesson-details-loading",
4799
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LoadingSkeleton, {})
4800
- }
4801
- );
4802
- }
4803
- if (error) {
4804
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4805
- "div",
4806
- {
4807
- className: cn(
4808
- "flex flex-col items-center justify-center py-12",
4809
- className
4810
- ),
4811
- "data-testid": "lesson-details-error",
4812
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { size: "md", className: "text-error-700", children: error })
4813
- }
4814
- );
4815
- }
4816
- if (!data) {
4817
- return null;
4818
- }
4819
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4820
- "div",
4821
- {
4822
- className: cn("flex flex-col gap-6", className),
4823
- "data-testid": "recommended-lesson-details",
4824
- children: [
4825
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
4826
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4827
- LessonHeader,
4828
- {
4829
- data,
4830
- onViewLesson,
4831
- mapSubjectNameToEnum,
4832
- viewLessonLabel: labels.viewLesson
4833
- }
4834
- ),
4835
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ResultsSection, { data, labels }),
4836
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4837
- StudentsTable,
4838
- {
4839
- students: displayStudents,
4840
- onViewPerformance: onViewStudentPerformance,
4841
- labels
4842
- }
4843
- )
4844
- ]
4845
- }
4846
- );
4847
- };
4848
- var RecommendedLessonDetails_default = RecommendedLessonDetails;
4849
- // Annotate the CommonJS export names for ESM import in node:
4850
- 0 && (module.exports = {
4851
- RecommendedLessonDetails,
4852
- StudentPerformanceModal
4853
- });
4854
- //# sourceMappingURL=index.js.map