@hydralms/components 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/dist/StudentProfile-BVfZMbnV.cjs +1 -0
  2. package/dist/StudentProfile-DeMxdrL3.js +3275 -0
  3. package/dist/assessment-toolbar/question-navigator.d.ts +1 -1
  4. package/dist/assessment-toolbar/timer-display.d.ts +1 -1
  5. package/dist/common/index.d.ts +2 -1
  6. package/dist/common/pagination.d.ts +26 -0
  7. package/dist/common/types.d.ts +1 -0
  8. package/dist/components.css +1 -1
  9. package/dist/content/audio-player.d.ts +22 -0
  10. package/dist/content/code-block.d.ts +30 -0
  11. package/dist/content/embed-block.d.ts +28 -0
  12. package/dist/content/index.d.ts +6 -0
  13. package/dist/content/types.d.ts +24 -0
  14. package/dist/curriculum/course-card.d.ts +51 -0
  15. package/dist/curriculum/index.d.ts +2 -0
  16. package/dist/curriculum/types.d.ts +2 -2
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.js +494 -444
  20. package/dist/license/HydraContext.d.ts +16 -0
  21. package/dist/license/ProBadge.d.ts +6 -0
  22. package/dist/license/index.d.ts +7 -0
  23. package/dist/license/tiers.d.ts +3 -0
  24. package/dist/license/useHydraLicense.d.ts +6 -0
  25. package/dist/license/validate.d.ts +13 -0
  26. package/dist/license/withProGate.d.ts +6 -0
  27. package/dist/modules/AssignmentModule/AssignmentModule.d.ts +4 -7
  28. package/dist/modules/AssignmentModule/types.d.ts +5 -1
  29. package/dist/modules/CertificateModule/CertificateModule.d.ts +4 -8
  30. package/dist/modules/CertificateModule/types.d.ts +6 -4
  31. package/dist/modules/CourseCatalogModule/CourseCatalogModule.d.ts +5 -0
  32. package/dist/modules/CourseCatalogModule/types.d.ts +43 -0
  33. package/dist/modules/CoursePlayer/CoursePlayer.d.ts +4 -1
  34. package/dist/modules/DiscussionModule/DiscussionModule.d.ts +4 -7
  35. package/dist/modules/ExamModule/ExamModule.d.ts +4 -7
  36. package/dist/modules/ExamModule/types.d.ts +5 -14
  37. package/dist/modules/FlashcardLab/FlashcardLab.d.ts +4 -1
  38. package/dist/modules/FlashcardLab/types.d.ts +2 -0
  39. package/dist/modules/GradeCenterModule/GradeCenterModule.d.ts +4 -8
  40. package/dist/modules/GradeCenterModule/types.d.ts +2 -0
  41. package/dist/modules/QuizModule/QuizModule.d.ts +4 -1
  42. package/dist/modules/QuizModule/types.d.ts +5 -14
  43. package/dist/modules/StudentDashboardModule/StudentDashboardModule.d.ts +5 -0
  44. package/dist/modules/StudentDashboardModule/types.d.ts +54 -0
  45. package/dist/modules/StudentProfileModule/StudentProfileModule.d.ts +5 -0
  46. package/dist/modules/StudentProfileModule/types.d.ts +43 -0
  47. package/dist/modules/SurveyModule/SurveyModule.d.ts +4 -6
  48. package/dist/modules/SurveyModule/types.d.ts +2 -0
  49. package/dist/modules/_shared/assessment-intro.d.ts +16 -0
  50. package/dist/modules/_shared/assessment-results.d.ts +23 -0
  51. package/dist/modules/_shared/types.d.ts +10 -0
  52. package/dist/modules/_shared/use-timer.d.ts +9 -0
  53. package/dist/modules/index.d.ts +6 -0
  54. package/dist/modules.cjs +1 -1
  55. package/dist/modules.js +1266 -854
  56. package/dist/progress/types.d.ts +2 -0
  57. package/dist/provider/HydraProvider.d.ts +5 -1
  58. package/dist/questions/choice.d.ts +1 -1
  59. package/dist/questions/confidence-indicator.d.ts +37 -0
  60. package/dist/questions/essay.d.ts +1 -1
  61. package/dist/questions/fill-in-the-blank.d.ts +1 -1
  62. package/dist/questions/hotspot.d.ts +1 -1
  63. package/dist/questions/index.d.ts +2 -0
  64. package/dist/questions/inline-choice.d.ts +1 -1
  65. package/dist/questions/matching.d.ts +1 -1
  66. package/dist/questions/multiple-choice.d.ts +1 -1
  67. package/dist/questions/numeric.d.ts +1 -1
  68. package/dist/questions/ordering.d.ts +1 -1
  69. package/dist/questions/question-renderer.d.ts +1 -1
  70. package/dist/questions/scenario.d.ts +1 -1
  71. package/dist/questions/spreadsheet.d.ts +1 -1
  72. package/dist/questions/true-false.d.ts +1 -1
  73. package/dist/sections/AnnouncementFeed/AnnouncementFeed.d.ts +1 -1
  74. package/dist/sections/AnnouncementFeed/types.d.ts +15 -1
  75. package/dist/sections/AssessmentReview/AssessmentReview.d.ts +1 -1
  76. package/dist/sections/AssessmentReview/types.d.ts +6 -0
  77. package/dist/sections/AssignmentSubmission/AssignmentSubmission.d.ts +1 -1
  78. package/dist/sections/AssignmentSubmission/types.d.ts +6 -0
  79. package/dist/sections/CertificateViewer/CertificateViewer.d.ts +1 -1
  80. package/dist/sections/CertificateViewer/certificate-variants.d.ts +42 -0
  81. package/dist/sections/CertificateViewer/types.d.ts +6 -0
  82. package/dist/sections/CourseCatalog/CourseCatalog.d.ts +2 -0
  83. package/dist/sections/CourseCatalog/types.d.ts +80 -0
  84. package/dist/sections/CourseOutline/CourseOutline.d.ts +1 -1
  85. package/dist/sections/CourseOutline/types.d.ts +6 -0
  86. package/dist/sections/DiscussionThread/DiscussionThread.d.ts +1 -1
  87. package/dist/sections/DiscussionThread/types.d.ts +6 -0
  88. package/dist/sections/EnrollmentWizard/EnrollmentWizard.d.ts +2 -0
  89. package/dist/sections/EnrollmentWizard/types.d.ts +66 -0
  90. package/dist/sections/ExamSession/ExamSession.d.ts +1 -1
  91. package/dist/sections/ExamSession/types.d.ts +6 -0
  92. package/dist/sections/FlashcardStudySession/FlashcardStudySession.d.ts +1 -1
  93. package/dist/sections/FlashcardStudySession/types.d.ts +6 -0
  94. package/dist/sections/ForumBoard/ForumBoard.d.ts +1 -1
  95. package/dist/sections/ForumBoard/types.d.ts +14 -0
  96. package/dist/sections/GradebookTable/GradebookTable.d.ts +1 -1
  97. package/dist/sections/GradebookTable/types.d.ts +14 -0
  98. package/dist/sections/LecturePlayer/LecturePlayer.d.ts +1 -1
  99. package/dist/sections/LecturePlayer/types.d.ts +8 -0
  100. package/dist/sections/LessonPage/LessonPage.d.ts +1 -1
  101. package/dist/sections/LessonPage/types.d.ts +6 -0
  102. package/dist/sections/PracticeQuiz/PracticeQuiz.d.ts +1 -1
  103. package/dist/sections/PracticeQuiz/types.d.ts +6 -0
  104. package/dist/sections/ProgressDashboard/ProgressDashboard.d.ts +1 -1
  105. package/dist/sections/ProgressDashboard/types.d.ts +6 -0
  106. package/dist/sections/QuizSession/QuizSession.d.ts +1 -1
  107. package/dist/sections/QuizSession/types.d.ts +6 -0
  108. package/dist/sections/RequirementsChecklist/RequirementsChecklist.d.ts +1 -1
  109. package/dist/sections/RequirementsChecklist/types.d.ts +6 -0
  110. package/dist/sections/ResourceLibrary/ResourceLibrary.d.ts +1 -1
  111. package/dist/sections/ResourceLibrary/types.d.ts +15 -1
  112. package/dist/sections/RubricView/RubricView.d.ts +1 -1
  113. package/dist/sections/RubricView/types.d.ts +6 -0
  114. package/dist/sections/ScrollableQuiz/ScrollableQuiz.d.ts +1 -1
  115. package/dist/sections/ScrollableQuiz/types.d.ts +6 -0
  116. package/dist/sections/StudentProfile/StudentProfile.d.ts +2 -0
  117. package/dist/sections/StudentProfile/types.d.ts +98 -0
  118. package/dist/sections/SurveyForm/SurveyForm.d.ts +1 -1
  119. package/dist/sections/SurveyForm/types.d.ts +6 -0
  120. package/dist/sections/_shared/merge-answers.d.ts +9 -0
  121. package/dist/sections/_shared/section-shell.d.ts +20 -0
  122. package/dist/sections/_shared/use-assessment-session.d.ts +30 -0
  123. package/dist/sections/index.d.ts +6 -0
  124. package/dist/sections.cjs +1 -1
  125. package/dist/sections.js +268 -307
  126. package/dist/tabs-BsfVo2Bl.cjs +173 -0
  127. package/dist/{tabs-Wf3h_Cx3.js → tabs-BuY1iNJE.js} +7532 -6807
  128. package/dist/ui/badge.d.ts +1 -1
  129. package/dist/ui/index.d.ts +2 -0
  130. package/dist/ui/progress.d.ts +1 -1
  131. package/dist/ui/rich-text-editor.d.ts +3 -1
  132. package/dist/ui/toast.d.ts +43 -0
  133. package/dist/utils/debounce.d.ts +5 -1
  134. package/dist/utils/pick-palette-color.d.ts +19 -0
  135. package/dist/video/types.d.ts +15 -0
  136. package/dist/video/video-player.d.ts +1 -1
  137. package/dist/withProGate-BWqcKdPM.js +137 -0
  138. package/dist/withProGate-DX6XqKLp.cjs +1 -0
  139. package/package.json +34 -220
  140. package/src/assessment-toolbar/question-navigator.tsx +10 -5
  141. package/src/assessment-toolbar/timer-display.tsx +4 -3
  142. package/src/assessment-toolbar/use-countdown.ts +1 -1
  143. package/src/common/empty-state.tsx +1 -0
  144. package/src/common/index.ts +2 -0
  145. package/src/common/pagination.tsx +135 -0
  146. package/src/common/search-input.tsx +2 -1
  147. package/src/common/types.ts +2 -0
  148. package/src/content/attachment-list.tsx +2 -0
  149. package/src/content/audio-player.tsx +196 -0
  150. package/src/content/code-block.tsx +113 -0
  151. package/src/content/content-block.tsx +64 -0
  152. package/src/content/embed-block.tsx +78 -0
  153. package/src/content/file-upload-zone.tsx +10 -0
  154. package/src/content/index.ts +6 -0
  155. package/src/content/types.ts +5 -0
  156. package/src/curriculum/course-card.tsx +199 -0
  157. package/src/curriculum/curriculum-item.tsx +3 -3
  158. package/src/curriculum/curriculum-tree.tsx +20 -13
  159. package/src/curriculum/index.ts +2 -0
  160. package/src/curriculum/types.ts +2 -2
  161. package/src/flashcards/flashcard.tsx +28 -8
  162. package/src/index.ts +3 -0
  163. package/src/license/HydraContext.tsx +62 -0
  164. package/src/license/ProBadge.tsx +43 -0
  165. package/src/license/index.ts +7 -0
  166. package/src/license/tiers.ts +24 -0
  167. package/src/license/useHydraLicense.ts +10 -0
  168. package/src/license/validate.ts +90 -0
  169. package/src/license/withProGate.tsx +21 -0
  170. package/src/modules/AssignmentModule/AssignmentModule.tsx +17 -8
  171. package/src/modules/AssignmentModule/types.ts +5 -1
  172. package/src/modules/CertificateModule/CertificateModule.tsx +21 -9
  173. package/src/modules/CertificateModule/types.ts +6 -4
  174. package/src/modules/CourseCatalogModule/CourseCatalogModule.tsx +126 -0
  175. package/src/modules/CourseCatalogModule/types.ts +47 -0
  176. package/src/modules/CoursePlayer/CoursePlayer.tsx +37 -22
  177. package/src/modules/DiscussionModule/DiscussionModule.tsx +57 -22
  178. package/src/modules/ExamModule/ExamModule.tsx +64 -198
  179. package/src/modules/ExamModule/types.ts +5 -14
  180. package/src/modules/FlashcardLab/FlashcardLab.tsx +10 -5
  181. package/src/modules/FlashcardLab/types.ts +2 -0
  182. package/src/modules/GradeCenterModule/GradeCenterModule.tsx +7 -2
  183. package/src/modules/GradeCenterModule/types.ts +2 -0
  184. package/src/modules/QuizModule/QuizModule.tsx +49 -169
  185. package/src/modules/QuizModule/types.ts +5 -15
  186. package/src/modules/StudentDashboardModule/StudentDashboardModule.tsx +117 -0
  187. package/src/modules/StudentDashboardModule/types.ts +56 -0
  188. package/src/modules/StudentProfileModule/StudentProfileModule.tsx +289 -0
  189. package/src/modules/StudentProfileModule/types.ts +45 -0
  190. package/src/modules/SurveyModule/SurveyModule.tsx +9 -4
  191. package/src/modules/SurveyModule/types.ts +2 -0
  192. package/src/modules/_shared/assessment-intro.tsx +75 -0
  193. package/src/modules/_shared/assessment-results.tsx +133 -0
  194. package/src/modules/_shared/types.ts +11 -0
  195. package/src/modules/_shared/use-timer.ts +49 -0
  196. package/src/modules/index.ts +9 -0
  197. package/src/progress/achievement-badge.tsx +3 -3
  198. package/src/progress/grade-indicator.tsx +9 -1
  199. package/src/progress/progress-ring.tsx +2 -1
  200. package/src/progress/stat-card.tsx +8 -1
  201. package/src/progress/types.ts +2 -0
  202. package/src/provider/HydraProvider.tsx +15 -6
  203. package/src/questions/choice.tsx +13 -6
  204. package/src/questions/confidence-indicator.tsx +107 -0
  205. package/src/questions/essay.tsx +6 -4
  206. package/src/questions/fill-in-the-blank.tsx +8 -4
  207. package/src/questions/hotspot.tsx +4 -4
  208. package/src/questions/index.ts +2 -0
  209. package/src/questions/inline-choice.tsx +5 -4
  210. package/src/questions/matching.tsx +5 -4
  211. package/src/questions/multiple-choice.tsx +13 -6
  212. package/src/questions/numeric.tsx +8 -4
  213. package/src/questions/ordering.tsx +12 -4
  214. package/src/questions/question-renderer.tsx +3 -2
  215. package/src/questions/scenario.tsx +4 -4
  216. package/src/questions/spreadsheet.tsx +5 -4
  217. package/src/questions/true-false.tsx +13 -6
  218. package/src/sections/AnnouncementFeed/AnnouncementFeed.tsx +64 -8
  219. package/src/sections/AnnouncementFeed/types.ts +15 -1
  220. package/src/sections/AssessmentReview/AssessmentReview.tsx +37 -0
  221. package/src/sections/AssessmentReview/types.ts +6 -0
  222. package/src/sections/AssignmentSubmission/AssignmentSubmission.tsx +37 -1
  223. package/src/sections/AssignmentSubmission/types.ts +6 -0
  224. package/src/sections/CertificateViewer/CertificateViewer.tsx +29 -227
  225. package/src/sections/CertificateViewer/certificate-variants.tsx +170 -0
  226. package/src/sections/CertificateViewer/types.ts +6 -0
  227. package/src/sections/CourseCatalog/CourseCatalog.tsx +220 -0
  228. package/src/sections/CourseCatalog/types.ts +76 -0
  229. package/src/sections/CourseOutline/CourseOutline.tsx +41 -0
  230. package/src/sections/CourseOutline/types.ts +6 -0
  231. package/src/sections/DiscussionThread/DiscussionThread.tsx +42 -1
  232. package/src/sections/DiscussionThread/types.ts +6 -0
  233. package/src/sections/EnrollmentWizard/EnrollmentWizard.tsx +343 -0
  234. package/src/sections/EnrollmentWizard/types.ts +65 -0
  235. package/src/sections/ExamSession/ExamSession.tsx +100 -94
  236. package/src/sections/ExamSession/types.ts +6 -0
  237. package/src/sections/FlashcardStudySession/FlashcardStudySession.tsx +53 -36
  238. package/src/sections/FlashcardStudySession/types.ts +6 -0
  239. package/src/sections/ForumBoard/ForumBoard.tsx +59 -1
  240. package/src/sections/ForumBoard/types.ts +14 -0
  241. package/src/sections/GradebookTable/GradebookTable.tsx +54 -1
  242. package/src/sections/GradebookTable/types.ts +14 -0
  243. package/src/sections/LecturePlayer/LecturePlayer.tsx +63 -37
  244. package/src/sections/LecturePlayer/types.ts +8 -0
  245. package/src/sections/LessonPage/LessonPage.tsx +36 -5
  246. package/src/sections/LessonPage/types.ts +6 -0
  247. package/src/sections/PracticeQuiz/PracticeQuiz.tsx +106 -74
  248. package/src/sections/PracticeQuiz/types.ts +6 -0
  249. package/src/sections/ProgressDashboard/ProgressDashboard.tsx +64 -10
  250. package/src/sections/ProgressDashboard/types.ts +6 -0
  251. package/src/sections/QuizSession/QuizSession.tsx +71 -82
  252. package/src/sections/QuizSession/types.ts +6 -0
  253. package/src/sections/RequirementsChecklist/RequirementsChecklist.tsx +41 -1
  254. package/src/sections/RequirementsChecklist/types.ts +6 -0
  255. package/src/sections/ResourceLibrary/ResourceLibrary.tsx +64 -8
  256. package/src/sections/ResourceLibrary/types.ts +15 -1
  257. package/src/sections/RubricView/RubricView.tsx +37 -1
  258. package/src/sections/RubricView/types.ts +6 -0
  259. package/src/sections/ScrollableQuiz/ScrollableQuiz.tsx +36 -15
  260. package/src/sections/ScrollableQuiz/types.ts +6 -0
  261. package/src/sections/StudentProfile/StudentProfile.tsx +279 -0
  262. package/src/sections/StudentProfile/types.ts +99 -0
  263. package/src/sections/SurveyForm/SurveyForm.tsx +32 -5
  264. package/src/sections/SurveyForm/types.ts +6 -0
  265. package/src/sections/_shared/merge-answers.ts +22 -0
  266. package/src/sections/_shared/section-shell.tsx +64 -0
  267. package/src/sections/_shared/use-assessment-session.ts +125 -0
  268. package/src/sections/index.ts +22 -0
  269. package/src/social/user-avatar.tsx +9 -5
  270. package/src/styles/globals.css +39 -41
  271. package/src/ui/badge.tsx +8 -0
  272. package/src/ui/index.ts +2 -0
  273. package/src/ui/progress.tsx +4 -0
  274. package/src/ui/rich-text-editor.tsx +10 -0
  275. package/src/ui/rich-text-toolbar.tsx +2 -1
  276. package/src/ui/toast.tsx +170 -0
  277. package/src/utils/debounce.ts +8 -2
  278. package/src/utils/pick-palette-color.ts +33 -0
  279. package/src/video/types.ts +16 -0
  280. package/src/video/video-player.tsx +13 -1
  281. package/dist/ForumBoard-CHXU3mjC.js +0 -2207
  282. package/dist/ForumBoard-d1w5-r6n.cjs +0 -1
  283. package/dist/tabs-DRM2Iq_J.cjs +0 -172
package/dist/modules.js CHANGED
@@ -1,300 +1,381 @@
1
- import { jsx as e, jsxs as t, Fragment as J } from "react/jsx-runtime";
2
- import { useState as P, useRef as E, useEffect as D, useMemo as W } from "react";
3
- import { Trophy as te, HelpCircle as X, Clock as G, CheckCircle2 as F, Play as Z, XCircle as me, RotateCcw as K, BookOpen as se, Shuffle as ne, Layers as ve, ArrowLeft as H, PanelLeft as we, Check as ke, ChevronLeft as Se, ChevronRight as ze, ShieldCheck as ye, ClipboardList as Ce, BarChart3 as Ae, FileEdit as ae, Paperclip as le, FileText as Re, Link as Te, Award as Pe, PartyPopper as Ee } from "lucide-react";
4
- import { Q as Ie, A as re, F as Me, g as Ue, b as je, P as Be, L as Le, d as De, E as Qe, S as $e, G as Fe, e as Ye, f as ie, a as qe, R as Ge, C as Ve, D as We, c as He } from "./ForumBoard-CHXU3mjC.js";
5
- import { C as B, w as L, u as j, a as V, B as R, c as T, af as ee, aq as U, an as q, aU as he, J as Oe, N as _e, R as Je, V as Xe, M as Ze, L as Ke, Z as fe, P as et, e as xe, g as pe, a4 as ge, aB as tt, aD as st, aE as ce, aC as oe, Y as de, ar as ue } from "./tabs-Wf3h_Cx3.js";
6
- function dt({
7
- title: u,
8
- description: b,
9
- questions: h,
10
- timeLimitSeconds: o,
11
- passingScore: k,
12
- allowRetake: m = !0,
13
- onComplete: l,
14
- showReview: i = !0,
15
- questionMaterials: f,
16
- className: d,
17
- style: v
1
+ import { jsx as e, jsxs as t, Fragment as te } from "react/jsx-runtime";
2
+ import { useState as R, useRef as U, useEffect as L, useCallback as T, useMemo as K } from "react";
3
+ import { HelpCircle as le, Clock as re, CheckCircle2 as X, Play as ae, XCircle as Te, Trophy as se, RotateCcw as ie, BookOpen as Z, Shuffle as he, Layers as Ie, ArrowLeft as J, PanelLeft as je, Check as Le, ChevronLeft as Fe, ChevronRight as Qe, ShieldCheck as $e, ClipboardList as Ye, BarChart3 as ve, FileEdit as fe, Paperclip as xe, FileText as qe, Link as Ge, Award as ee, PartyPopper as We, Bell as Ve, User as He } from "lucide-react";
4
+ import { a as be, Q as _e, F as Je, l as Ke, d as Xe, P as Ze, L as De, g as Oe, e as et, k as tt, G as st, h as we, i as pe, b as rt, R as nt, C as Se, D as lt, f as at, c as ke, A as it, E as ct, j as dt } from "./StudentProfile-DeMxdrL3.js";
5
+ import { C as I, x as j, B as q, a as ne, v as P, ak as D, aw as G, as as _, a$ as ze, c as A, M as ot, R as ut, U as mt, Y as ht, Q as ft, O as xt, a1 as ce, P as pt, d as Ce, e as ye, a8 as Ae, aI as de, aK as oe, aL as V, aJ as H, $ as ge, ax as Ne, aR as gt, b0 as Nt, A as vt } from "./tabs-BuY1iNJE.js";
6
+ import { w as Y } from "./withProGate-BWqcKdPM.js";
7
+ function Me(c) {
8
+ const [N, o] = R(0), l = U(null), f = U(null), i = U(0);
9
+ L(() => (c ? (l.current = Date.now(), f.current = setInterval(() => {
10
+ if (l.current) {
11
+ const a = Math.floor((Date.now() - l.current) / 1e3);
12
+ a !== i.current && (i.current = a, o(a));
13
+ }
14
+ }, 1e3)) : f.current && (clearInterval(f.current), f.current = null), () => {
15
+ f.current && clearInterval(f.current);
16
+ }), [c]);
17
+ const n = T(() => l.current ? Math.floor((Date.now() - l.current) / 1e3) : i.current, []), h = T(() => {
18
+ i.current = 0, o(0), l.current = null;
19
+ }, []);
20
+ return { timeElapsed: N, getFinalElapsed: n, reset: h };
21
+ }
22
+ function Ee({
23
+ icon: c,
24
+ title: N,
25
+ description: o,
26
+ questionCount: l,
27
+ timeLimitSeconds: f,
28
+ passingScore: i,
29
+ startLabel: n,
30
+ onStart: h,
31
+ children: a,
32
+ readOnly: u = !1
18
33
  }) {
19
- const [x, n] = P({ tag: "intro" }), [g, a] = P(0), p = E(null), N = E(null), C = E(null);
20
- D(() => {
21
- var r;
22
- (r = C.current) == null || r.focus({ preventScroll: !0 });
23
- }, [x.tag]), D(() => (x.tag === "quiz" ? (p.current = Date.now(), N.current = setInterval(() => {
24
- p.current && a(Math.floor((Date.now() - p.current) / 1e3));
25
- }, 1e3)) : N.current && (clearInterval(N.current), N.current = null), () => {
26
- N.current && clearInterval(N.current);
27
- }), [x.tag]);
28
- function S(r) {
29
- const { correct: A, total: I, percentage: M } = he(h, r), Q = p.current ? Math.floor((Date.now() - p.current) / 1e3) : g;
30
- return {
31
- answers: r,
32
- correct: A,
33
- total: I,
34
- percentage: M,
35
- passed: k !== void 0 ? M >= k : !0,
36
- timeElapsedSeconds: Q
37
- };
38
- }
39
- function w(r) {
40
- const A = S(r);
41
- n({ tag: "results", result: A }), l == null || l(A);
42
- }
43
- function z() {
44
- a(0), p.current = null, n({ tag: "intro" });
45
- }
46
- if (x.tag === "intro")
47
- return /* @__PURE__ */ e("div", { ref: C, tabIndex: -1, className: T("max-w-2xl mx-auto outline-none", d), style: v, children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8 text-center", children: [
48
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ e(te, { className: "size-7 text-primary" }) }),
49
- /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: u }),
50
- b && /* @__PURE__ */ e("p", { className: "text-muted-foreground mb-6 max-w-md mx-auto", children: b }),
51
- /* @__PURE__ */ t("div", { className: "flex flex-wrap justify-center gap-2 mb-8", children: [
52
- /* @__PURE__ */ t(j, { variant: "outline", className: "gap-1.5", children: [
53
- /* @__PURE__ */ e(X, { className: "size-3.5" }),
54
- h.length,
55
- " questions"
56
- ] }),
57
- o && /* @__PURE__ */ t(j, { variant: "outline", className: "gap-1.5", children: [
58
- /* @__PURE__ */ e(G, { className: "size-3.5" }),
59
- V(o),
60
- " time limit"
61
- ] }),
62
- k !== void 0 && /* @__PURE__ */ t(j, { variant: "outline", className: "gap-1.5", children: [
63
- /* @__PURE__ */ e(F, { className: "size-3.5" }),
64
- k,
65
- "% to pass"
66
- ] })
34
+ return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ t(j, { className: "pt-8 pb-8 text-center", children: [
35
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center", children: c }),
36
+ /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: N }),
37
+ o && /* @__PURE__ */ e("p", { className: "text-muted-foreground mb-6 max-w-md mx-auto", children: o }),
38
+ a,
39
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap justify-center gap-2 mb-8", children: [
40
+ /* @__PURE__ */ t(q, { variant: "outline", className: "gap-1.5", children: [
41
+ /* @__PURE__ */ e(le, { className: "size-3.5" }),
42
+ l,
43
+ " questions"
67
44
  ] }),
68
- /* @__PURE__ */ t(R, { size: "lg", onClick: () => n({ tag: "quiz" }), children: [
69
- /* @__PURE__ */ e(Z, { className: "size-4 mr-2" }),
70
- "Start Quiz"
45
+ f != null && /* @__PURE__ */ t(q, { variant: "outline", className: "gap-1.5", children: [
46
+ /* @__PURE__ */ e(re, { className: "size-3.5" }),
47
+ ne(f),
48
+ " time limit"
49
+ ] }),
50
+ i !== void 0 && /* @__PURE__ */ t(q, { variant: "outline", className: "gap-1.5", children: [
51
+ /* @__PURE__ */ e(X, { className: "size-3.5" }),
52
+ i,
53
+ "% to pass"
71
54
  ] })
72
- ] }) }) });
73
- if (x.tag === "quiz")
74
- return /* @__PURE__ */ e("div", { ref: C, tabIndex: -1, className: T("outline-none", d), style: v, children: /* @__PURE__ */ e(
75
- Ie,
76
- {
77
- questions: h,
78
- onSubmit: w,
79
- timeElapsedSeconds: g,
80
- timeLimitSeconds: o,
81
- questionMaterials: f
82
- }
83
- ) });
84
- const { result: s } = x, c = s.passed;
85
- return /* @__PURE__ */ t("div", { ref: C, tabIndex: -1, className: T("max-w-2xl mx-auto outline-none", d), style: v, children: [
86
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8", children: [
55
+ ] }),
56
+ /* @__PURE__ */ t(P, { size: "lg", onClick: h, disabled: u, children: [
57
+ /* @__PURE__ */ e(ae, { className: "size-4 mr-2" }),
58
+ n
59
+ ] })
60
+ ] }) });
61
+ }
62
+ function Be({
63
+ title: c,
64
+ percentage: N,
65
+ passed: o,
66
+ correct: l,
67
+ total: f,
68
+ timeElapsedSeconds: i,
69
+ answers: n,
70
+ questions: h,
71
+ allowRetake: a,
72
+ onRetake: u,
73
+ retakeLabel: x = "Retake",
74
+ showReview: b = !0,
75
+ extraBadges: s,
76
+ readOnly: S = !1
77
+ }) {
78
+ return /* @__PURE__ */ t(te, { children: [
79
+ /* @__PURE__ */ e(I, { children: /* @__PURE__ */ t(j, { className: "pt-8 pb-8", children: [
87
80
  /* @__PURE__ */ t("div", { className: "text-center mb-8", children: [
88
81
  /* @__PURE__ */ e(
89
- ee,
82
+ D,
90
83
  {
91
- value: s.percentage,
84
+ value: N,
92
85
  size: 140,
93
86
  strokeWidth: 10,
94
- color: c ? "var(--success)" : "var(--destructive)",
87
+ color: o ? "var(--success)" : "var(--destructive)",
95
88
  className: "mx-auto mb-4 text-foreground"
96
89
  }
97
90
  ),
98
91
  /* @__PURE__ */ e(
99
- j,
92
+ q,
100
93
  {
101
- variant: c ? "success" : "destructive",
94
+ variant: o ? "success" : "destructive",
102
95
  className: "text-sm px-3 py-1 mb-2",
103
- children: c ? "Passed" : "Failed"
96
+ children: o ? "Passed" : "Failed"
104
97
  }
105
98
  ),
106
- /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground", children: u })
99
+ s,
100
+ /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground", children: c })
107
101
  ] }),
108
102
  /* @__PURE__ */ t("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8", children: [
109
103
  /* @__PURE__ */ e(
110
- U,
104
+ G,
111
105
  {
112
- icon: /* @__PURE__ */ e(F, {}),
106
+ icon: /* @__PURE__ */ e(X, {}),
113
107
  label: "Correct",
114
108
  description: "Questions answered right",
115
- value: `${s.correct}/${s.total}`
109
+ value: `${l}/${f}`,
110
+ accent: "var(--success)"
116
111
  }
117
112
  ),
118
113
  /* @__PURE__ */ e(
119
- U,
114
+ G,
120
115
  {
121
- icon: /* @__PURE__ */ e(me, {}),
116
+ icon: /* @__PURE__ */ e(Te, {}),
122
117
  label: "Incorrect",
123
118
  description: "Questions to review",
124
- value: `${s.total - s.correct}/${s.total}`
119
+ value: `${f - l}/${f}`,
120
+ accent: "var(--destructive)"
125
121
  }
126
122
  ),
127
123
  /* @__PURE__ */ e(
128
- U,
124
+ G,
129
125
  {
130
- icon: /* @__PURE__ */ e(te, {}),
126
+ icon: /* @__PURE__ */ e(se, {}),
131
127
  label: "Score",
132
128
  description: "Overall percentage",
133
- value: `${s.percentage}%`
129
+ value: `${N}%`,
130
+ accent: "var(--palette-3)"
134
131
  }
135
132
  ),
136
133
  /* @__PURE__ */ e(
137
- U,
134
+ G,
138
135
  {
139
- icon: /* @__PURE__ */ e(G, {}),
136
+ icon: /* @__PURE__ */ e(re, {}),
140
137
  label: "Time",
141
138
  description: "Total elapsed",
142
- value: V(s.timeElapsedSeconds)
139
+ value: ne(i),
140
+ accent: "var(--palette-1)"
143
141
  }
144
142
  )
145
143
  ] }),
146
- m && /* @__PURE__ */ e("div", { className: "flex justify-center mb-8", children: /* @__PURE__ */ t(R, { variant: "outline", onClick: z, children: [
147
- /* @__PURE__ */ e(K, { className: "size-4 mr-2" }),
148
- "Retake Quiz"
144
+ a && u && !S && /* @__PURE__ */ e("div", { className: "flex justify-center mb-8", children: /* @__PURE__ */ t(P, { variant: "outline", onClick: u, children: [
145
+ /* @__PURE__ */ e(ie, { className: "size-4 mr-2" }),
146
+ x
149
147
  ] }) })
150
148
  ] }) }),
151
- i && /* @__PURE__ */ t(J, { children: [
152
- /* @__PURE__ */ e(q, { className: "my-6" }),
149
+ b && /* @__PURE__ */ t(te, { children: [
150
+ /* @__PURE__ */ e(_, { className: "my-6" }),
153
151
  /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-foreground mb-4", children: "Question Review" }),
154
152
  /* @__PURE__ */ e(
155
- re,
153
+ be,
156
154
  {
157
155
  questions: h,
158
- sessionAnswers: s.answers,
156
+ sessionAnswers: n,
159
157
  showCorrectAnswers: !0
160
158
  }
161
159
  )
162
160
  ] })
163
161
  ] });
164
162
  }
165
- function ut({
166
- decks: u,
167
- showShuffleToggle: b = !0,
168
- defaultShuffled: h = !1,
169
- allowMultiSelect: o = !0,
170
- onComplete: k,
171
- className: m,
172
- style: l
163
+ function bt({
164
+ title: c,
165
+ description: N,
166
+ questions: o,
167
+ timeLimitSeconds: l,
168
+ passingScore: f,
169
+ allowRetake: i = !0,
170
+ onComplete: n,
171
+ showReview: h = !0,
172
+ questionMaterials: a,
173
+ readOnly: u = !1,
174
+ className: x,
175
+ style: b
176
+ }) {
177
+ const [s, S] = R({ tag: "intro" }), m = U(null), { timeElapsed: g, getFinalElapsed: v, reset: r } = Me(s.tag === "quiz"), C = U(n);
178
+ C.current = n, L(() => {
179
+ var d;
180
+ (d = m.current) == null || d.focus({ preventScroll: !0 });
181
+ }, [s.tag]);
182
+ const M = T((d) => {
183
+ var B;
184
+ const { correct: p, total: w, percentage: k } = ze(o, d), Q = {
185
+ answers: d,
186
+ correct: p,
187
+ total: w,
188
+ percentage: k,
189
+ passed: f !== void 0 ? k >= f : !0,
190
+ timeElapsedSeconds: v()
191
+ };
192
+ S({ tag: "results", result: Q }), (B = C.current) == null || B.call(C, Q);
193
+ }, [o, f, v]), y = T(() => {
194
+ r(), S({ tag: "intro" });
195
+ }, [r]);
196
+ if (s.tag === "intro")
197
+ return /* @__PURE__ */ e("div", { ref: m, tabIndex: -1, className: A("max-w-2xl mx-auto outline-none", x), style: b, children: /* @__PURE__ */ e(
198
+ Ee,
199
+ {
200
+ icon: /* @__PURE__ */ e(se, { className: "size-7 text-primary" }),
201
+ title: c,
202
+ description: N,
203
+ questionCount: o.length,
204
+ timeLimitSeconds: l,
205
+ passingScore: f,
206
+ startLabel: "Start Quiz",
207
+ onStart: () => S({ tag: "quiz" }),
208
+ readOnly: u
209
+ }
210
+ ) });
211
+ if (s.tag === "quiz")
212
+ return /* @__PURE__ */ e("div", { ref: m, tabIndex: -1, className: A("outline-none", x), style: b, children: /* @__PURE__ */ e(
213
+ _e,
214
+ {
215
+ questions: o,
216
+ onSubmit: M,
217
+ timeElapsedSeconds: g,
218
+ timeLimitSeconds: l,
219
+ questionMaterials: a,
220
+ readOnly: u
221
+ }
222
+ ) });
223
+ const { result: E } = s;
224
+ return /* @__PURE__ */ e("div", { ref: m, tabIndex: -1, className: A("max-w-2xl mx-auto outline-none", x), style: b, children: /* @__PURE__ */ e(
225
+ Be,
226
+ {
227
+ title: c,
228
+ percentage: E.percentage,
229
+ passed: E.passed,
230
+ correct: E.correct,
231
+ total: E.total,
232
+ timeElapsedSeconds: E.timeElapsedSeconds,
233
+ answers: E.answers,
234
+ questions: o,
235
+ allowRetake: i,
236
+ onRetake: y,
237
+ retakeLabel: "Retake Quiz",
238
+ showReview: h,
239
+ readOnly: u
240
+ }
241
+ ) });
242
+ }
243
+ const $t = Y(bt, "QuizModule");
244
+ function wt({
245
+ decks: c = [],
246
+ showShuffleToggle: N = !0,
247
+ defaultShuffled: o = !1,
248
+ allowMultiSelect: l = !0,
249
+ onComplete: f,
250
+ readOnly: i = !1,
251
+ className: n,
252
+ style: h
173
253
  }) {
174
- const [i, f] = P({ tag: "setup" }), [d, v] = P(/* @__PURE__ */ new Set()), [x, n] = P(h), g = E(null), a = E(null);
175
- D(() => {
176
- var s;
177
- (s = a.current) == null || s.focus({ preventScroll: !0 });
178
- }, [i.tag]);
179
- function p(s) {
180
- v((c) => {
181
- const r = new Set(c);
182
- return r.has(s) ? r.delete(s) : (o || r.clear(), r.add(s)), r;
254
+ const [a, u] = R({ tag: "setup" }), [x, b] = R(/* @__PURE__ */ new Set()), [s, S] = R(o), m = U(null), g = U(null);
255
+ L(() => {
256
+ var d;
257
+ (d = g.current) == null || d.focus({ preventScroll: !0 });
258
+ }, [a.tag]);
259
+ function v(d) {
260
+ b((p) => {
261
+ const w = new Set(p);
262
+ return w.has(d) ? w.delete(d) : (l || w.clear(), w.add(d)), w;
183
263
  });
184
264
  }
185
- function N() {
186
- const s = u.filter((r) => d.has(r.uid)), c = s.flatMap((r) => r.cards);
187
- g.current = Date.now(), f({
265
+ function r() {
266
+ const d = c.filter((w) => x.has(w.uid)), p = d.flatMap((w) => w.cards);
267
+ m.current = Date.now(), u({
188
268
  tag: "study",
189
- cards: c,
190
- deckUids: s.map((r) => r.uid),
191
- shuffled: x
269
+ cards: p,
270
+ deckUids: d.map((w) => w.uid),
271
+ shuffled: s
192
272
  });
193
273
  }
194
274
  function C() {
195
- if (i.tag !== "study") return;
196
- const s = g.current ? Math.floor((Date.now() - g.current) / 1e3) : 0, c = {
197
- totalCards: i.cards.length,
198
- decksStudied: i.deckUids.length,
199
- deckUids: i.deckUids,
200
- wasShuffled: i.shuffled,
201
- timeElapsedSeconds: s
275
+ if (a.tag !== "study") return;
276
+ const d = m.current ? Math.floor((Date.now() - m.current) / 1e3) : 0, p = {
277
+ totalCards: a.cards.length,
278
+ decksStudied: a.deckUids.length,
279
+ deckUids: a.deckUids,
280
+ wasShuffled: a.shuffled,
281
+ timeElapsedSeconds: d
202
282
  };
203
- f({ tag: "completion", result: c }), k == null || k(c);
283
+ u({ tag: "completion", result: p }), f == null || f(p);
204
284
  }
205
- function S() {
206
- if (i.tag !== "completion") return;
207
- const c = u.filter((r) => i.result.deckUids.includes(r.uid)).flatMap((r) => r.cards);
208
- g.current = Date.now(), f({
285
+ function M() {
286
+ if (a.tag !== "completion") return;
287
+ const p = c.filter((w) => a.result.deckUids.includes(w.uid)).flatMap((w) => w.cards);
288
+ m.current = Date.now(), u({
209
289
  tag: "study",
210
- cards: c,
211
- deckUids: i.result.deckUids,
212
- shuffled: i.result.wasShuffled
290
+ cards: p,
291
+ deckUids: a.result.deckUids,
292
+ shuffled: a.result.wasShuffled
213
293
  });
214
294
  }
215
- function w() {
216
- v(/* @__PURE__ */ new Set()), n(h), f({ tag: "setup" });
295
+ function y() {
296
+ b(/* @__PURE__ */ new Set()), S(o), u({ tag: "setup" });
217
297
  }
218
- if (i.tag === "setup")
219
- return /* @__PURE__ */ e("div", { ref: a, tabIndex: -1, className: T("max-w-2xl mx-auto outline-none", m), style: l, children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8", children: [
298
+ if (a.tag === "setup")
299
+ return /* @__PURE__ */ e("div", { ref: g, tabIndex: -1, className: A("max-w-2xl mx-auto outline-none", n), style: h, children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ t(j, { className: "pt-8 pb-8", children: [
220
300
  /* @__PURE__ */ t("div", { className: "text-center mb-6", children: [
221
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ e(se, { className: "size-7 text-primary" }) }),
301
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ e(Z, { className: "size-7 text-primary" }) }),
222
302
  /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: "Choose Your Decks" }),
223
- /* @__PURE__ */ e("p", { className: "text-muted-foreground text-sm", children: o ? "Select one or more decks to study" : "Select a deck to study" })
303
+ /* @__PURE__ */ e("p", { className: "text-muted-foreground text-sm", children: l ? "Select one or more decks to study" : "Select a deck to study" })
224
304
  ] }),
225
- /* @__PURE__ */ e("div", { className: "grid sm:grid-cols-2 lg:grid-cols-3 gap-3 mb-6", children: u.map((s) => {
226
- const c = d.has(s.uid);
305
+ /* @__PURE__ */ e("div", { className: "grid sm:grid-cols-2 lg:grid-cols-3 gap-3 mb-6", children: c.map((d) => {
306
+ const p = x.has(d.uid);
227
307
  return /* @__PURE__ */ e(
228
- B,
308
+ I,
229
309
  {
230
- className: T(
310
+ className: A(
231
311
  "cursor-pointer transition-all py-0",
232
- c ? "border-primary ring-1 ring-primary" : "hover:border-muted-foreground/30"
312
+ p ? "border-primary ring-1 ring-primary" : "hover:border-muted-foreground/30"
233
313
  ),
234
- onClick: () => p(s.uid),
235
- children: /* @__PURE__ */ t(L, { className: "py-4", children: [
314
+ onClick: () => v(d.uid),
315
+ children: /* @__PURE__ */ t(j, { className: "py-4", children: [
236
316
  /* @__PURE__ */ t("div", { className: "flex items-start justify-between mb-2", children: [
237
- /* @__PURE__ */ e("h3", { className: "font-semibold text-foreground text-sm", children: s.title }),
238
- /* @__PURE__ */ t(j, { variant: "secondary", className: "text-xs shrink-0", children: [
239
- s.cards.length,
317
+ /* @__PURE__ */ e("h3", { className: "font-semibold text-foreground text-sm", children: d.title }),
318
+ /* @__PURE__ */ t(q, { variant: "secondary", className: "text-xs shrink-0", children: [
319
+ d.cards.length,
240
320
  " cards"
241
321
  ] })
242
322
  ] }),
243
- s.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-2", children: s.description })
323
+ d.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-2", children: d.description })
244
324
  ] })
245
325
  },
246
- s.uid
326
+ d.uid
247
327
  );
248
328
  }) }),
249
329
  /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
250
330
  /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
251
- b && /* @__PURE__ */ t(
252
- R,
331
+ N && /* @__PURE__ */ t(
332
+ P,
253
333
  {
254
- variant: x ? "secondary" : "outline",
334
+ variant: s ? "secondary" : "outline",
255
335
  size: "sm",
256
336
  className: "gap-1.5",
257
- onClick: () => n((s) => !s),
337
+ onClick: () => S((d) => !d),
258
338
  children: [
259
- /* @__PURE__ */ e(ne, { className: "size-3.5" }),
339
+ /* @__PURE__ */ e(he, { className: "size-3.5" }),
260
340
  "Shuffle"
261
341
  ]
262
342
  }
263
343
  ),
264
- d.size > 0 && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: [
265
- u.filter((s) => d.has(s.uid)).reduce((s, c) => s + c.cards.length, 0),
344
+ x.size > 0 && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: [
345
+ c.filter((d) => x.has(d.uid)).reduce((d, p) => d + p.cards.length, 0),
266
346
  " ",
267
347
  "cards selected"
268
348
  ] })
269
349
  ] }),
270
350
  /* @__PURE__ */ e(
271
- R,
351
+ P,
272
352
  {
273
- onClick: N,
274
- disabled: d.size === 0,
353
+ onClick: r,
354
+ disabled: x.size === 0 || i,
275
355
  children: "Start Studying"
276
356
  }
277
357
  )
278
358
  ] })
279
359
  ] }) }) });
280
- if (i.tag === "study") {
281
- const s = u.filter((c) => i.deckUids.includes(c.uid)).map((c) => c.title).join(", ");
282
- return /* @__PURE__ */ e("div", { ref: a, tabIndex: -1, className: T("outline-none", m), style: l, children: /* @__PURE__ */ e(
283
- Me,
360
+ if (a.tag === "study") {
361
+ const d = c.filter((p) => a.deckUids.includes(p.uid)).map((p) => p.title).join(", ");
362
+ return /* @__PURE__ */ e("div", { ref: g, tabIndex: -1, className: A("outline-none", n), style: h, children: /* @__PURE__ */ e(
363
+ Je,
284
364
  {
285
- cards: i.cards,
286
- title: s,
287
- shuffled: i.shuffled,
288
- onComplete: C
365
+ cards: a.cards,
366
+ title: d,
367
+ shuffled: a.shuffled,
368
+ onComplete: C,
369
+ readOnly: i
289
370
  }
290
371
  ) });
291
372
  }
292
- const { result: z } = i;
293
- return /* @__PURE__ */ e("div", { ref: a, tabIndex: -1, className: T("max-w-2xl mx-auto outline-none", m), style: l, children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8", children: [
373
+ const { result: E } = a;
374
+ return /* @__PURE__ */ e("div", { ref: g, tabIndex: -1, className: A("max-w-2xl mx-auto outline-none", n), style: h, children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ t(j, { className: "pt-8 pb-8", children: [
294
375
  /* @__PURE__ */ t("div", { className: "text-center mb-8", children: [
295
376
  /* @__PURE__ */ t("div", { className: "relative mx-auto mb-4", children: [
296
377
  /* @__PURE__ */ e(
297
- ee,
378
+ D,
298
379
  {
299
380
  value: 100,
300
381
  size: 120,
@@ -304,155 +385,162 @@ function ut({
304
385
  label: ""
305
386
  }
306
387
  ),
307
- /* @__PURE__ */ e(F, { className: "size-8 text-success absolute inset-0 m-auto" })
388
+ /* @__PURE__ */ e(X, { className: "size-8 text-success absolute inset-0 m-auto" })
308
389
  ] }),
309
390
  /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground mb-2", children: "Study Session Complete" }),
310
391
  /* @__PURE__ */ e("p", { className: "text-muted-foreground text-sm", children: "Great work! Here's your session summary." })
311
392
  ] }),
312
393
  /* @__PURE__ */ t("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8", children: [
313
394
  /* @__PURE__ */ e(
314
- U,
395
+ G,
315
396
  {
316
- icon: /* @__PURE__ */ e(ve, {}),
397
+ icon: /* @__PURE__ */ e(Ie, {}),
317
398
  label: "Cards Studied",
318
399
  description: "Total cards reviewed",
319
- value: String(z.totalCards)
400
+ value: String(E.totalCards)
320
401
  }
321
402
  ),
322
403
  /* @__PURE__ */ e(
323
- U,
404
+ G,
324
405
  {
325
- icon: /* @__PURE__ */ e(se, {}),
406
+ icon: /* @__PURE__ */ e(Z, {}),
326
407
  label: "Decks",
327
408
  description: "Decks completed",
328
- value: String(z.decksStudied)
409
+ value: String(E.decksStudied)
329
410
  }
330
411
  ),
331
412
  /* @__PURE__ */ e(
332
- U,
413
+ G,
333
414
  {
334
- icon: /* @__PURE__ */ e(G, {}),
415
+ icon: /* @__PURE__ */ e(re, {}),
335
416
  label: "Time Spent",
336
417
  description: "Session duration",
337
- value: V(z.timeElapsedSeconds)
418
+ value: ne(E.timeElapsedSeconds)
338
419
  }
339
420
  ),
340
421
  /* @__PURE__ */ e(
341
- U,
422
+ G,
342
423
  {
343
- icon: /* @__PURE__ */ e(ne, {}),
424
+ icon: /* @__PURE__ */ e(he, {}),
344
425
  label: "Shuffled",
345
426
  description: "Card order randomized",
346
- value: z.wasShuffled ? "Yes" : "No"
427
+ value: E.wasShuffled ? "Yes" : "No"
347
428
  }
348
429
  )
349
430
  ] }),
350
431
  /* @__PURE__ */ t("div", { className: "flex justify-center gap-3", children: [
351
- /* @__PURE__ */ t(R, { variant: "outline", onClick: w, children: [
352
- /* @__PURE__ */ e(H, { className: "size-4 mr-2" }),
432
+ /* @__PURE__ */ t(P, { variant: "outline", onClick: y, disabled: i, children: [
433
+ /* @__PURE__ */ e(J, { className: "size-4 mr-2" }),
353
434
  "Pick New Deck"
354
435
  ] }),
355
- /* @__PURE__ */ t(R, { onClick: S, children: [
356
- /* @__PURE__ */ e(K, { className: "size-4 mr-2" }),
436
+ /* @__PURE__ */ t(P, { onClick: M, disabled: i, children: [
437
+ /* @__PURE__ */ e(ie, { className: "size-4 mr-2" }),
357
438
  "Study Again"
358
439
  ] })
359
440
  ] })
360
441
  ] }) }) });
361
442
  }
362
- function mt({
363
- courseTitle: u,
364
- curriculum: b,
365
- progress: h,
366
- items: o,
367
- initialItemUid: k,
368
- onItemComplete: m,
369
- onItemChange: l,
370
- sidebarCollapsed: i = !1,
371
- readOnly: f = !1,
372
- className: d,
373
- style: v
443
+ const Yt = Y(wt, "FlashcardLab");
444
+ function St({
445
+ courseTitle: c,
446
+ curriculum: N,
447
+ progress: o,
448
+ items: l,
449
+ initialItemUid: f,
450
+ onItemComplete: i,
451
+ onItemChange: n,
452
+ sidebarCollapsed: h = !1,
453
+ readOnly: a = !1,
454
+ className: u,
455
+ style: x
374
456
  }) {
375
- const x = E(null), n = W(() => Ue(b), [b]), g = W(
376
- () => new Map(o.map((y) => [y.uid, y])),
377
- [o]
378
- ), [a, p] = P(
379
- k ?? n[0] ?? ""
380
- ), [N, C] = P(!i), [S, w] = P(() => h ? new Set(
381
- h.filter((y) => y.isCompleted).map((y) => y.resourceUid)
382
- ) : /* @__PURE__ */ new Set()), z = n.indexOf(a), s = z > 0, c = z < n.length - 1, r = S.has(a), A = n.length > 0 ? Math.round(
383
- n.filter((y) => S.has(y)).length / n.length * 100
384
- ) : 0, I = g.get(a);
385
- D(() => {
386
- var y;
387
- (y = x.current) == null || y.focus({ preventScroll: !0 });
388
- }, [a]);
389
- function M(y) {
390
- p(y), l == null || l(y);
391
- }
392
- function Q(y) {
393
- (!y.children || y.children.length === 0) && M(y.uid);
394
- }
395
- function Y() {
396
- w((y) => new Set(y).add(a)), m == null || m(a);
397
- }
398
- function O() {
399
- c && M(n[z + 1]);
400
- }
401
- function _() {
402
- s && M(n[z - 1]);
403
- }
404
- const Ne = W(() => {
405
- const y = new Map(
406
- (h ?? []).map(($) => [$.resourceUid, $])
457
+ const b = U(null), s = K(() => Ke(N), [N]), S = K(
458
+ () => new Map(l.map((z) => [z.uid, z])),
459
+ [l]
460
+ ), [m, g] = R(
461
+ f ?? s[0] ?? ""
462
+ ), [v, r] = R(!h), [C, M] = R(() => o ? new Set(
463
+ o.filter((z) => z.isCompleted).map((z) => z.resourceUid)
464
+ ) : /* @__PURE__ */ new Set()), y = s.indexOf(m), E = y > 0, d = y < s.length - 1, p = C.has(m), w = s.length > 0 ? Math.round(
465
+ s.filter((z) => C.has(z)).length / s.length * 100
466
+ ) : 0, k = S.get(m), Q = K(
467
+ () => (k == null ? void 0 : k.type) === "video" ? { src: k.src, poster: k.poster, title: k.title } : null,
468
+ [k]
469
+ );
470
+ L(() => {
471
+ var z;
472
+ (z = b.current) == null || z.focus({ preventScroll: !0 });
473
+ }, [m]);
474
+ const B = U(n);
475
+ B.current = n;
476
+ const $ = U(i);
477
+ $.current = i;
478
+ const W = T((z) => {
479
+ var F;
480
+ g(z), (F = B.current) == null || F.call(B, z);
481
+ }, []), O = T((z) => {
482
+ (!z.children || z.children.length === 0) && W(z.uid);
483
+ }, [W]), ue = T(() => {
484
+ var z;
485
+ M((F) => new Set(F).add(m)), (z = $.current) == null || z.call($, m);
486
+ }, [m]), me = T(() => {
487
+ const z = s.indexOf(m);
488
+ z < s.length - 1 && W(s[z + 1]);
489
+ }, [s, m, W]), Pe = T(() => {
490
+ const z = s.indexOf(m);
491
+ z > 0 && W(s[z - 1]);
492
+ }, [s, m, W]), Ue = K(() => {
493
+ const z = new Map(
494
+ (o ?? []).map((F) => [F.resourceUid, F])
407
495
  );
408
- for (const $ of S)
409
- y.has($) ? y.set($, { ...y.get($), isCompleted: !0 }) : y.set($, { resourceUid: $, isCompleted: !0 });
410
- return Array.from(y.values());
411
- }, [h, S]), be = c ? g.get(n[z + 1]) : null;
496
+ for (const F of C)
497
+ z.has(F) ? z.set(F, { ...z.get(F), isCompleted: !0 }) : z.set(F, { resourceUid: F, isCompleted: !0 });
498
+ return Array.from(z.values());
499
+ }, [o, C]), Re = d ? S.get(s[y + 1]) : null;
412
500
  return /* @__PURE__ */ t(
413
501
  "div",
414
502
  {
415
- className: T("flex h-full overflow-hidden", d),
416
- style: v,
503
+ className: A("flex h-full overflow-hidden", u),
504
+ style: x,
417
505
  children: [
418
- /* @__PURE__ */ e(Oe, { open: N, onOpenChange: C, side: "left", children: /* @__PURE__ */ t(_e, { size: "sm", scrollLock: !1, children: [
419
- /* @__PURE__ */ t(Je, { className: "flex-row items-center justify-between", children: [
420
- /* @__PURE__ */ e(Xe, { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide", children: "Course" }),
421
- /* @__PURE__ */ e(Ze, {})
506
+ /* @__PURE__ */ e(ot, { open: v, onOpenChange: r, side: "left", children: /* @__PURE__ */ t(ut, { size: "sm", scrollLock: !1, children: [
507
+ /* @__PURE__ */ t(mt, { className: "flex-row items-center justify-between", children: [
508
+ /* @__PURE__ */ e(ht, { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide", children: "Course" }),
509
+ /* @__PURE__ */ e(ft, {})
422
510
  ] }),
423
- /* @__PURE__ */ e(Ke, { className: "px-2 pb-2", children: /* @__PURE__ */ e(
424
- je,
511
+ /* @__PURE__ */ e(xt, { className: "px-2 pb-2", children: /* @__PURE__ */ e(
512
+ Xe,
425
513
  {
426
- items: b,
427
- progress: Ne,
428
- courseTitle: u,
429
- activeItemUid: a,
430
- onItemClick: Q,
431
- readOnly: f
514
+ items: N,
515
+ progress: Ue,
516
+ courseTitle: c,
517
+ activeItemUid: m,
518
+ onItemClick: O,
519
+ readOnly: a
432
520
  }
433
521
  ) })
434
522
  ] }) }),
435
523
  /* @__PURE__ */ t("div", { className: "flex-1 flex flex-col min-w-0 overflow-hidden", children: [
436
524
  /* @__PURE__ */ t("div", { className: "flex items-center gap-2 px-4 py-2 border-b border-border bg-background shrink-0", children: [
437
525
  /* @__PURE__ */ e(
438
- R,
526
+ P,
439
527
  {
440
528
  variant: "ghost",
441
529
  size: "sm",
442
530
  className: "size-7 p-0 mr-1",
443
- onClick: () => C(!0),
444
- children: /* @__PURE__ */ e(we, { className: "size-4" })
531
+ onClick: () => r(!0),
532
+ children: /* @__PURE__ */ e(je, { className: "size-4" })
445
533
  }
446
534
  ),
447
- /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ e("span", { className: "text-sm font-semibold text-foreground truncate block", children: (I == null ? void 0 : I.title) ?? "Select an item" }) }),
535
+ /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ e("span", { className: "text-sm font-semibold text-foreground truncate block", children: (k == null ? void 0 : k.title) ?? "Select an item" }) }),
448
536
  /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground shrink-0", children: [
449
- z + 1,
537
+ y + 1,
450
538
  " / ",
451
- n.length
539
+ s.length
452
540
  ] })
453
541
  ] }),
454
- /* @__PURE__ */ e("div", { ref: x, tabIndex: -1, className: "flex-1 overflow-y-auto p-6 outline-none", children: I ? rt(I, f, Y, r, O, c, be) : /* @__PURE__ */ e(
455
- fe,
542
+ /* @__PURE__ */ e("div", { ref: b, tabIndex: -1, className: "flex-1 overflow-y-auto p-6 outline-none", children: k ? kt(k, a, ue, p, me, d, Re, Q) : /* @__PURE__ */ e(
543
+ ce,
456
544
  {
457
545
  title: "No content selected",
458
546
  description: "Select an item from the course outline to get started."
@@ -461,43 +549,43 @@ function mt({
461
549
  /* @__PURE__ */ e("div", { className: "shrink-0 border-t border-border bg-background px-4 py-3", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-4", children: [
462
550
  /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
463
551
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mb-1", children: /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: [
464
- A,
552
+ w,
465
553
  "% complete"
466
554
  ] }) }),
467
- /* @__PURE__ */ e(et, { value: A, size: "sm" })
555
+ /* @__PURE__ */ e(pt, { value: w, size: "sm" })
468
556
  ] }),
469
557
  /* @__PURE__ */ t("div", { className: "flex items-center gap-2 shrink-0", children: [
470
- !r && I && /* @__PURE__ */ t(
471
- R,
558
+ !p && k && /* @__PURE__ */ t(
559
+ P,
472
560
  {
473
561
  size: "sm",
474
562
  variant: "outline",
475
- onClick: Y,
476
- disabled: f,
563
+ onClick: ue,
564
+ disabled: a,
477
565
  children: [
478
- /* @__PURE__ */ e(ke, { className: "size-3.5 mr-1" }),
566
+ /* @__PURE__ */ e(Le, { className: "size-3.5 mr-1" }),
479
567
  "Complete"
480
568
  ]
481
569
  }
482
570
  ),
483
571
  /* @__PURE__ */ e(
484
- R,
572
+ P,
485
573
  {
486
574
  size: "sm",
487
575
  variant: "ghost",
488
- onClick: _,
489
- disabled: !s,
490
- children: /* @__PURE__ */ e(Se, { className: "size-4" })
576
+ onClick: Pe,
577
+ disabled: !E,
578
+ children: /* @__PURE__ */ e(Fe, { className: "size-4" })
491
579
  }
492
580
  ),
493
581
  /* @__PURE__ */ e(
494
- R,
582
+ P,
495
583
  {
496
584
  size: "sm",
497
585
  variant: "ghost",
498
- onClick: O,
499
- disabled: !c,
500
- children: /* @__PURE__ */ e(ze, { className: "size-4" })
586
+ onClick: me,
587
+ disabled: !d,
588
+ children: /* @__PURE__ */ e(Qe, { className: "size-4" })
501
589
  }
502
590
  )
503
591
  ] })
@@ -507,45 +595,42 @@ function mt({
507
595
  }
508
596
  );
509
597
  }
510
- function rt(u, b, h, o, k, m, l) {
511
- switch (u.type) {
598
+ function kt(c, N, o, l, f, i, n, h) {
599
+ switch (c.type) {
512
600
  case "lesson":
513
601
  return /* @__PURE__ */ e(
514
- De,
602
+ Oe,
515
603
  {
516
- title: u.title,
517
- blocks: u.blocks,
518
- isCompleted: o,
519
- onMarkComplete: h,
520
- onNextLesson: m ? k : void 0,
521
- nextLessonTitle: l == null ? void 0 : l.title,
522
- readOnly: b
604
+ title: c.title,
605
+ blocks: c.blocks,
606
+ isCompleted: l,
607
+ onMarkComplete: o,
608
+ onNextLesson: i ? f : void 0,
609
+ nextLessonTitle: n == null ? void 0 : n.title,
610
+ readOnly: N
523
611
  }
524
612
  );
525
613
  case "video":
526
614
  return /* @__PURE__ */ e(
527
- Le,
615
+ De,
528
616
  {
529
- video: {
530
- src: u.src,
531
- poster: u.poster,
532
- title: u.title
533
- }
617
+ video: h ?? { src: "", title: c.title },
618
+ onComplete: l ? void 0 : o
534
619
  }
535
620
  );
536
621
  case "quiz":
537
622
  return /* @__PURE__ */ e(
538
- Be,
623
+ Ze,
539
624
  {
540
- questions: u.questions,
625
+ questions: c.questions,
541
626
  instantFeedback: !0,
542
627
  allowRetry: !0,
543
- readOnly: b
628
+ readOnly: N
544
629
  }
545
630
  );
546
631
  default:
547
632
  return /* @__PURE__ */ e(
548
- fe,
633
+ ce,
549
634
  {
550
635
  title: "Unknown content type",
551
636
  description: "This content type is not supported."
@@ -553,443 +638,344 @@ function rt(u, b, h, o, k, m, l) {
553
638
  );
554
639
  }
555
640
  }
556
- function ht({
557
- title: u,
558
- description: b,
559
- instructions: h,
560
- questions: o,
561
- timeLimitSeconds: k,
562
- passingScore: m,
563
- allowBackNavigation: l = !0,
564
- autoSubmitOnTimeout: i = !0,
565
- timeWarningThreshold: f,
566
- allowRetake: d = !1,
567
- showReview: v = !0,
568
- onComplete: x,
569
- className: n,
570
- style: g
641
+ const qt = Y(St, "CoursePlayer");
642
+ function zt({
643
+ title: c,
644
+ description: N,
645
+ instructions: o,
646
+ questions: l = [],
647
+ timeLimitSeconds: f,
648
+ passingScore: i,
649
+ allowBackNavigation: n = !0,
650
+ autoSubmitOnTimeout: h = !0,
651
+ timeWarningThreshold: a,
652
+ allowRetake: u = !1,
653
+ showReview: x = !0,
654
+ onComplete: b,
655
+ readOnly: s = !1,
656
+ className: S,
657
+ style: m
571
658
  }) {
572
- const [a, p] = P({ tag: "intro" }), [N, C] = P(0), S = E(null), w = E(null), z = E(null);
573
- D(() => {
574
- var M;
575
- (M = z.current) == null || M.focus({ preventScroll: !0 });
576
- }, [a.tag]), D(() => (a.tag === "exam" ? (S.current = Date.now(), w.current = setInterval(() => {
577
- S.current && C(Math.floor((Date.now() - S.current) / 1e3));
578
- }, 1e3)) : w.current && (clearInterval(w.current), w.current = null), () => {
579
- w.current && clearInterval(w.current);
580
- }), [a.tag]);
581
- function s(M, Q) {
582
- const { correct: Y, total: O, percentage: _ } = he(o, M);
583
- return {
584
- answers: M,
585
- correct: Y,
586
- total: O,
587
- percentage: _,
588
- passed: m !== void 0 ? _ >= m : !0,
589
- timeElapsedSeconds: Q.timeElapsedSeconds,
590
- wasAutoSubmitted: Q.wasAutoSubmitted
659
+ const [g, v] = R({ tag: "intro" }), r = U(null), { timeElapsed: C, reset: M } = Me(g.tag === "exam"), y = U(b);
660
+ y.current = b, L(() => {
661
+ var w;
662
+ (w = r.current) == null || w.focus({ preventScroll: !0 });
663
+ }, [g.tag]);
664
+ const E = T((w, k) => {
665
+ var O;
666
+ const { correct: Q, total: B, percentage: $ } = ze(l, w), W = {
667
+ answers: w,
668
+ correct: Q,
669
+ total: B,
670
+ percentage: $,
671
+ passed: i !== void 0 ? $ >= i : !0,
672
+ timeElapsedSeconds: k.timeElapsedSeconds,
673
+ wasAutoSubmitted: k.wasAutoSubmitted
591
674
  };
592
- }
593
- function c(M, Q) {
594
- const Y = s(M, Q);
595
- p({ tag: "results", result: Y }), x == null || x(Y);
596
- }
597
- function r() {
598
- C(0), S.current = null, p({ tag: "intro" });
599
- }
600
- if (a.tag === "intro")
601
- return /* @__PURE__ */ e(
602
- "div",
675
+ v({ tag: "results", result: W }), (O = y.current) == null || O.call(y, W);
676
+ }, [l, i]), d = T(() => {
677
+ M(), v({ tag: "intro" });
678
+ }, [M]);
679
+ if (g.tag === "intro")
680
+ return /* @__PURE__ */ e("div", { ref: r, tabIndex: -1, className: A("max-w-2xl mx-auto outline-none", S), style: m, children: /* @__PURE__ */ e(
681
+ Ee,
603
682
  {
604
- ref: z,
605
- tabIndex: -1,
606
- className: T("max-w-2xl mx-auto outline-none", n),
607
- style: g,
608
- children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8 text-center", children: [
609
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ e(ye, { className: "size-7 text-primary" }) }),
610
- /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: u }),
611
- b && /* @__PURE__ */ e("p", { className: "text-muted-foreground mb-6 max-w-md mx-auto", children: b }),
612
- h && /* @__PURE__ */ e(xe, { className: "text-left mb-6", children: /* @__PURE__ */ e(pe, { children: h }) }),
613
- /* @__PURE__ */ t("div", { className: "flex flex-wrap justify-center gap-2 mb-8", children: [
614
- /* @__PURE__ */ t(j, { variant: "outline", className: "gap-1.5", children: [
615
- /* @__PURE__ */ e(X, { className: "size-3.5" }),
616
- o.length,
617
- " questions"
618
- ] }),
619
- /* @__PURE__ */ t(j, { variant: "outline", className: "gap-1.5", children: [
620
- /* @__PURE__ */ e(G, { className: "size-3.5" }),
621
- V(k),
622
- " time limit"
623
- ] }),
624
- m !== void 0 && /* @__PURE__ */ t(j, { variant: "outline", className: "gap-1.5", children: [
625
- /* @__PURE__ */ e(F, { className: "size-3.5" }),
626
- m,
627
- "% to pass"
628
- ] })
629
- ] }),
630
- /* @__PURE__ */ t(R, { size: "lg", onClick: () => p({ tag: "exam" }), children: [
631
- /* @__PURE__ */ e(Z, { className: "size-4 mr-2" }),
632
- "Begin Exam"
633
- ] })
634
- ] }) })
683
+ icon: /* @__PURE__ */ e($e, { className: "size-7 text-primary" }),
684
+ title: c,
685
+ description: N,
686
+ questionCount: l.length,
687
+ timeLimitSeconds: f,
688
+ passingScore: i,
689
+ startLabel: "Begin Exam",
690
+ onStart: () => v({ tag: "exam" }),
691
+ readOnly: s,
692
+ children: o && /* @__PURE__ */ e(Ce, { className: "text-left mb-6", children: /* @__PURE__ */ e(ye, { children: o }) })
635
693
  }
636
- );
637
- if (a.tag === "exam")
638
- return /* @__PURE__ */ e(
639
- "div",
694
+ ) });
695
+ if (g.tag === "exam")
696
+ return /* @__PURE__ */ e("div", { ref: r, tabIndex: -1, className: A("outline-none", S), style: m, children: /* @__PURE__ */ e(
697
+ et,
640
698
  {
641
- ref: z,
642
- tabIndex: -1,
643
- className: T("outline-none", n),
644
- style: g,
645
- children: /* @__PURE__ */ e(
646
- Qe,
647
- {
648
- questions: o,
649
- timeLimitSeconds: k,
650
- timeElapsedSeconds: N,
651
- autoSubmitOnTimeout: i,
652
- timeWarningThreshold: f,
653
- allowBackNavigation: l,
654
- confirmBeforeSubmit: !0,
655
- examTitle: u,
656
- onSubmit: c
657
- }
658
- )
699
+ questions: l,
700
+ timeLimitSeconds: f,
701
+ timeElapsedSeconds: C,
702
+ autoSubmitOnTimeout: h,
703
+ timeWarningThreshold: a,
704
+ allowBackNavigation: n,
705
+ confirmBeforeSubmit: !0,
706
+ examTitle: c,
707
+ onSubmit: E,
708
+ readOnly: s
659
709
  }
660
- );
661
- const { result: A } = a, I = A.passed;
662
- return /* @__PURE__ */ t(
663
- "div",
710
+ ) });
711
+ const { result: p } = g;
712
+ return /* @__PURE__ */ e("div", { ref: r, tabIndex: -1, className: A("max-w-2xl mx-auto outline-none", S), style: m, children: /* @__PURE__ */ e(
713
+ Be,
664
714
  {
665
- ref: z,
666
- tabIndex: -1,
667
- className: T("max-w-2xl mx-auto outline-none", n),
668
- style: g,
669
- children: [
670
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8", children: [
671
- /* @__PURE__ */ t("div", { className: "text-center mb-8", children: [
672
- /* @__PURE__ */ e(
673
- ee,
674
- {
675
- value: A.percentage,
676
- size: 140,
677
- strokeWidth: 10,
678
- color: I ? "var(--success)" : "var(--destructive)",
679
- className: "mx-auto mb-4 text-foreground"
680
- }
681
- ),
682
- /* @__PURE__ */ e(
683
- j,
684
- {
685
- variant: I ? "success" : "destructive",
686
- className: "text-sm px-3 py-1 mb-2",
687
- children: I ? "Passed" : "Failed"
688
- }
689
- ),
690
- A.wasAutoSubmitted && /* @__PURE__ */ e(j, { variant: "outline", className: "text-sm px-3 py-1 mb-2 ml-2", children: "Auto-submitted" }),
691
- /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground", children: u })
692
- ] }),
693
- /* @__PURE__ */ t("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8", children: [
694
- /* @__PURE__ */ e(
695
- U,
696
- {
697
- icon: /* @__PURE__ */ e(F, {}),
698
- label: "Correct",
699
- description: "Questions answered right",
700
- value: `${A.correct}/${A.total}`
701
- }
702
- ),
703
- /* @__PURE__ */ e(
704
- U,
705
- {
706
- icon: /* @__PURE__ */ e(me, {}),
707
- label: "Incorrect",
708
- description: "Questions to review",
709
- value: `${A.total - A.correct}/${A.total}`
710
- }
711
- ),
712
- /* @__PURE__ */ e(
713
- U,
714
- {
715
- icon: /* @__PURE__ */ e(te, {}),
716
- label: "Score",
717
- description: "Overall percentage",
718
- value: `${A.percentage}%`
719
- }
720
- ),
721
- /* @__PURE__ */ e(
722
- U,
723
- {
724
- icon: /* @__PURE__ */ e(G, {}),
725
- label: "Time",
726
- description: "Total elapsed",
727
- value: V(A.timeElapsedSeconds)
728
- }
729
- )
730
- ] }),
731
- d && /* @__PURE__ */ e("div", { className: "flex justify-center mb-8", children: /* @__PURE__ */ t(R, { variant: "outline", onClick: r, children: [
732
- /* @__PURE__ */ e(K, { className: "size-4 mr-2" }),
733
- "Retake Exam"
734
- ] }) })
735
- ] }) }),
736
- v && /* @__PURE__ */ t(J, { children: [
737
- /* @__PURE__ */ e(q, { className: "my-6" }),
738
- /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-foreground mb-4", children: "Question Review" }),
739
- /* @__PURE__ */ e(
740
- re,
741
- {
742
- questions: o,
743
- sessionAnswers: A.answers,
744
- showCorrectAnswers: !0
745
- }
746
- )
747
- ] })
748
- ]
715
+ title: c,
716
+ percentage: p.percentage,
717
+ passed: p.passed,
718
+ correct: p.correct,
719
+ total: p.total,
720
+ timeElapsedSeconds: p.timeElapsedSeconds,
721
+ answers: p.answers,
722
+ questions: l,
723
+ allowRetake: u,
724
+ onRetake: d,
725
+ retakeLabel: "Retake Exam",
726
+ showReview: x,
727
+ readOnly: s,
728
+ extraBadges: p.wasAutoSubmitted ? /* @__PURE__ */ e(q, { variant: "outline", className: "text-sm px-3 py-1 mb-2 ml-2", children: "Auto-submitted" }) : null
749
729
  }
750
- );
730
+ ) });
751
731
  }
752
- function ft({
753
- title: u,
754
- description: b,
755
- questions: h,
756
- requireAll: o = !1,
757
- showProgress: k = !0,
758
- thankYouTitle: m = "Thank You!",
759
- thankYouMessage: l,
760
- onComplete: i,
761
- allowRestart: f = !1,
762
- className: d,
763
- style: v
732
+ const Gt = Y(zt, "ExamModule");
733
+ function Ct({
734
+ title: c,
735
+ description: N,
736
+ questions: o = [],
737
+ requireAll: l = !1,
738
+ showProgress: f = !0,
739
+ thankYouTitle: i = "Thank You!",
740
+ thankYouMessage: n,
741
+ onComplete: h,
742
+ allowRestart: a = !1,
743
+ readOnly: u = !1,
744
+ className: x,
745
+ style: b
764
746
  }) {
765
- const [x, n] = P({ tag: "intro" }), g = E(null), a = E(null);
766
- D(() => {
767
- var w;
768
- (w = a.current) == null || w.focus({ preventScroll: !0 });
769
- }, [x.tag]);
770
- function p(w) {
771
- const z = g.current ? Math.floor((Date.now() - g.current) / 1e3) : 0, s = {
772
- answers: w,
773
- totalQuestions: h.length,
774
- answeredCount: w.length,
775
- timeElapsedSeconds: z
747
+ const [s, S] = R({ tag: "intro" }), m = U(null), g = U(null);
748
+ L(() => {
749
+ var y;
750
+ (y = g.current) == null || y.focus({ preventScroll: !0 });
751
+ }, [s.tag]);
752
+ function v(y) {
753
+ const E = m.current ? Math.floor((Date.now() - m.current) / 1e3) : 0, d = {
754
+ answers: y,
755
+ totalQuestions: o.length,
756
+ answeredCount: y.length,
757
+ timeElapsedSeconds: E
776
758
  };
777
- n({ tag: "thankYou", result: s }), i == null || i(s);
759
+ S({ tag: "thankYou", result: d }), h == null || h(d);
778
760
  }
779
- function N() {
780
- g.current = null, n({ tag: "intro" });
761
+ function r() {
762
+ m.current = null, S({ tag: "intro" });
781
763
  }
782
764
  function C() {
783
- g.current = Date.now(), n({ tag: "survey" });
765
+ m.current = Date.now(), S({ tag: "survey" });
784
766
  }
785
- if (x.tag === "intro")
767
+ if (s.tag === "intro")
786
768
  return /* @__PURE__ */ e(
787
769
  "div",
788
770
  {
789
- ref: a,
771
+ ref: g,
790
772
  tabIndex: -1,
791
- className: T("max-w-2xl mx-auto outline-none", d),
792
- style: v,
793
- children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8 text-center", children: [
794
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ e(Ce, { className: "size-7 text-primary" }) }),
795
- /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: u }),
796
- b && /* @__PURE__ */ e("p", { className: "text-muted-foreground mb-6 max-w-md mx-auto", children: b }),
797
- /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-center gap-2 mb-8", children: /* @__PURE__ */ t(j, { variant: "outline", className: "gap-1.5", children: [
798
- /* @__PURE__ */ e(X, { className: "size-3.5" }),
799
- h.length,
773
+ className: A("max-w-2xl mx-auto outline-none", x),
774
+ style: b,
775
+ children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ t(j, { className: "pt-8 pb-8 text-center", children: [
776
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ e(Ye, { className: "size-7 text-primary" }) }),
777
+ /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: c }),
778
+ N && /* @__PURE__ */ e("p", { className: "text-muted-foreground mb-6 max-w-md mx-auto", children: N }),
779
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-center gap-2 mb-8", children: /* @__PURE__ */ t(q, { variant: "outline", className: "gap-1.5", children: [
780
+ /* @__PURE__ */ e(le, { className: "size-3.5" }),
781
+ o.length,
800
782
  " questions"
801
783
  ] }) }),
802
- /* @__PURE__ */ t(R, { size: "lg", onClick: C, children: [
803
- /* @__PURE__ */ e(Z, { className: "size-4 mr-2" }),
784
+ /* @__PURE__ */ t(P, { size: "lg", onClick: C, disabled: u, children: [
785
+ /* @__PURE__ */ e(ae, { className: "size-4 mr-2" }),
804
786
  "Begin Survey"
805
787
  ] })
806
788
  ] }) })
807
789
  }
808
790
  );
809
- if (x.tag === "survey")
791
+ if (s.tag === "survey")
810
792
  return /* @__PURE__ */ e(
811
793
  "div",
812
794
  {
813
- ref: a,
795
+ ref: g,
814
796
  tabIndex: -1,
815
- className: T("outline-none", d),
816
- style: v,
797
+ className: A("outline-none", x),
798
+ style: b,
817
799
  children: /* @__PURE__ */ e(
818
- $e,
800
+ tt,
819
801
  {
820
- title: u,
821
- questions: h,
822
- requireAll: o,
823
- showProgress: k,
824
- onSubmit: p
802
+ title: c,
803
+ questions: o,
804
+ requireAll: l,
805
+ showProgress: f,
806
+ onSubmit: v,
807
+ readOnly: u
825
808
  }
826
809
  )
827
810
  }
828
811
  );
829
- const { result: S } = x;
812
+ const { result: M } = s;
830
813
  return /* @__PURE__ */ e(
831
814
  "div",
832
815
  {
833
- ref: a,
816
+ ref: g,
834
817
  tabIndex: -1,
835
- className: T("max-w-2xl mx-auto outline-none", d),
836
- style: v,
837
- children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8 text-center", children: [
838
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-success/10 flex items-center justify-center", children: /* @__PURE__ */ e(F, { className: "size-7 text-success" }) }),
839
- /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: m }),
840
- /* @__PURE__ */ e("p", { className: "text-muted-foreground mb-6 max-w-md mx-auto", children: l ?? "Your responses have been recorded. Thank you for your feedback!" }),
818
+ className: A("max-w-2xl mx-auto outline-none", x),
819
+ style: b,
820
+ children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ t(j, { className: "pt-8 pb-8 text-center", children: [
821
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-success/10 flex items-center justify-center", children: /* @__PURE__ */ e(X, { className: "size-7 text-success" }) }),
822
+ /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: i }),
823
+ /* @__PURE__ */ e("p", { className: "text-muted-foreground mb-6 max-w-md mx-auto", children: n ?? "Your responses have been recorded. Thank you for your feedback!" }),
841
824
  /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-3 max-w-sm mx-auto mb-6", children: [
842
825
  /* @__PURE__ */ e(
843
- U,
826
+ G,
844
827
  {
845
- icon: /* @__PURE__ */ e(X, {}),
828
+ icon: /* @__PURE__ */ e(le, {}),
846
829
  label: "Answered",
847
830
  description: "Questions completed",
848
- value: `${S.answeredCount}/${S.totalQuestions}`
831
+ value: `${M.answeredCount}/${M.totalQuestions}`
849
832
  }
850
833
  ),
851
834
  /* @__PURE__ */ e(
852
- U,
835
+ G,
853
836
  {
854
- icon: /* @__PURE__ */ e(G, {}),
837
+ icon: /* @__PURE__ */ e(re, {}),
855
838
  label: "Time",
856
839
  description: "Total elapsed",
857
- value: V(S.timeElapsedSeconds)
840
+ value: ne(M.timeElapsedSeconds)
858
841
  }
859
842
  )
860
843
  ] }),
861
- f && /* @__PURE__ */ t(R, { variant: "outline", onClick: N, children: [
862
- /* @__PURE__ */ e(K, { className: "size-4 mr-2" }),
844
+ a && /* @__PURE__ */ t(P, { variant: "outline", onClick: r, disabled: u, children: [
845
+ /* @__PURE__ */ e(ie, { className: "size-4 mr-2" }),
863
846
  "Take Again"
864
847
  ] })
865
848
  ] }) })
866
849
  }
867
850
  );
868
851
  }
869
- function xt({
870
- courseTitle: u,
871
- gradeItems: b,
872
- categories: h,
873
- overallGrade: o,
874
- showWeights: k,
875
- progressData: m,
876
- reviewData: l,
877
- className: i,
878
- style: f
852
+ const Wt = Y(Ct, "SurveyModule");
853
+ function yt({
854
+ courseTitle: c,
855
+ gradeItems: N = [],
856
+ categories: o,
857
+ overallGrade: l,
858
+ showWeights: f,
859
+ progressData: i,
860
+ reviewData: n,
861
+ readOnly: h = !1,
862
+ className: a,
863
+ style: u
879
864
  }) {
880
- const [d, v] = P(null), x = E(null);
881
- D(() => {
882
- var N;
883
- (N = x.current) == null || N.focus({ preventScroll: !0 });
884
- }, [d]);
885
- function n(N) {
886
- l != null && l[N.uid] && v(N.uid);
865
+ const [x, b] = R(null), s = U(null);
866
+ L(() => {
867
+ var r;
868
+ (r = s.current) == null || r.focus({ preventScroll: !0 });
869
+ }, [x]);
870
+ function S(r) {
871
+ n != null && n[r.uid] && b(r.uid);
887
872
  }
888
- function g() {
889
- v(null);
873
+ function m() {
874
+ b(null);
890
875
  }
891
- const a = d ? b.find((N) => N.uid === d) : null, p = d ? l == null ? void 0 : l[d] : null;
876
+ const g = x ? N.find((r) => r.uid === x) : null, v = x ? n == null ? void 0 : n[x] : null;
892
877
  return /* @__PURE__ */ t(
893
878
  "div",
894
879
  {
895
- ref: x,
880
+ ref: s,
896
881
  tabIndex: -1,
897
- className: T("outline-none", i),
898
- style: f,
882
+ className: A("outline-none", a),
883
+ style: u,
899
884
  children: [
900
885
  /* @__PURE__ */ t("div", { className: "flex items-center justify-between mb-6", children: [
901
886
  /* @__PURE__ */ t("div", { children: [
902
- u && /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground", children: u }),
887
+ c && /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground", children: c }),
903
888
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Grade Center" })
904
889
  ] }),
905
- o && /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
890
+ l && /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
906
891
  /* @__PURE__ */ e(
907
- ge,
892
+ Ae,
908
893
  {
909
- percentage: o.percentage,
910
- letterGrade: o.letterGrade,
894
+ percentage: l.percentage,
895
+ letterGrade: l.letterGrade,
911
896
  size: "medium"
912
897
  }
913
898
  ),
914
899
  /* @__PURE__ */ t("div", { className: "text-right", children: [
915
900
  /* @__PURE__ */ t("div", { className: "text-sm font-medium text-foreground", children: [
916
- o.pointsEarned,
901
+ l.pointsEarned,
917
902
  "/",
918
- o.pointsPossible,
903
+ l.pointsPossible,
919
904
  " pts"
920
905
  ] }),
921
- o.letterGrade && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: o.letterGrade })
906
+ l.letterGrade && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: l.letterGrade })
922
907
  ] })
923
908
  ] })
924
909
  ] }),
925
- /* @__PURE__ */ e(q, { className: "mb-6" }),
926
- a && p ? /* @__PURE__ */ t("div", { children: [
910
+ /* @__PURE__ */ e(_, { className: "mb-6" }),
911
+ g && v ? /* @__PURE__ */ t("div", { children: [
927
912
  /* @__PURE__ */ t(
928
- R,
913
+ P,
929
914
  {
930
915
  variant: "ghost",
931
916
  size: "sm",
932
- onClick: g,
917
+ onClick: m,
933
918
  className: "mb-4",
934
919
  children: [
935
- /* @__PURE__ */ e(H, { className: "size-4 mr-1.5" }),
920
+ /* @__PURE__ */ e(J, { className: "size-4 mr-1.5" }),
936
921
  "Back to Grades"
937
922
  ]
938
923
  }
939
924
  ),
940
- /* @__PURE__ */ e(B, { className: "mb-4", children: /* @__PURE__ */ t(L, { className: "py-3 px-4", children: [
941
- /* @__PURE__ */ e("h3", { className: "font-semibold text-foreground", children: a.name }),
942
- a.score !== null && /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: [
925
+ /* @__PURE__ */ e(I, { className: "mb-4", children: /* @__PURE__ */ t(j, { className: "py-3 px-4", children: [
926
+ /* @__PURE__ */ e("h3", { className: "font-semibold text-foreground", children: g.name }),
927
+ g.score !== null && /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: [
943
928
  "Score: ",
944
- a.score,
929
+ g.score,
945
930
  "/",
946
- a.maxScore,
931
+ g.maxScore,
947
932
  " (",
948
933
  Math.round(
949
- a.score / a.maxScore * 100
934
+ g.score / g.maxScore * 100
950
935
  ),
951
936
  "%)"
952
937
  ] })
953
938
  ] }) }),
954
939
  /* @__PURE__ */ e(
955
- re,
940
+ be,
956
941
  {
957
- questions: p.questions,
958
- sessionAnswers: p.sessionAnswers,
959
- score: p.score,
942
+ questions: v.questions,
943
+ sessionAnswers: v.sessionAnswers,
944
+ score: v.score,
960
945
  showCorrectAnswers: !0
961
946
  }
962
947
  )
963
- ] }) : /* @__PURE__ */ t(tt, { defaultValue: "grades", children: [
964
- m && /* @__PURE__ */ t(st, { className: "mb-6", children: [
965
- /* @__PURE__ */ t(ce, { value: "grades", children: [
966
- /* @__PURE__ */ e(se, { className: "size-4 mr-1.5" }),
948
+ ] }) : /* @__PURE__ */ t(de, { defaultValue: "grades", children: [
949
+ i && /* @__PURE__ */ t(oe, { className: "mb-6", children: [
950
+ /* @__PURE__ */ t(V, { value: "grades", children: [
951
+ /* @__PURE__ */ e(Z, { className: "size-4 mr-1.5" }),
967
952
  "Grades"
968
953
  ] }),
969
- /* @__PURE__ */ t(ce, { value: "progress", children: [
970
- /* @__PURE__ */ e(Ae, { className: "size-4 mr-1.5" }),
954
+ /* @__PURE__ */ t(V, { value: "progress", children: [
955
+ /* @__PURE__ */ e(ve, { className: "size-4 mr-1.5" }),
971
956
  "Progress"
972
957
  ] })
973
958
  ] }),
974
- /* @__PURE__ */ e(oe, { value: "grades", children: /* @__PURE__ */ e(
975
- Fe,
959
+ /* @__PURE__ */ e(H, { value: "grades", children: /* @__PURE__ */ e(
960
+ st,
976
961
  {
977
- items: b,
978
- categories: h,
979
- overallGrade: o,
980
- showWeights: k,
981
- onItemClick: n
962
+ items: N,
963
+ categories: o,
964
+ overallGrade: l,
965
+ showWeights: f,
966
+ onItemClick: S,
967
+ readOnly: h
982
968
  }
983
969
  ) }),
984
- m && /* @__PURE__ */ e(oe, { value: "progress", children: /* @__PURE__ */ e(
985
- Ye,
970
+ i && /* @__PURE__ */ e(H, { value: "progress", children: /* @__PURE__ */ e(
971
+ we,
986
972
  {
987
- overallProgress: m.overallProgress,
988
- totalTimeSpent: m.totalTimeSpent,
989
- modules: m.modules,
990
- recentActivity: m.recentActivity,
991
- streak: m.streak,
992
- achievements: m.achievements
973
+ overallProgress: i.overallProgress,
974
+ totalTimeSpent: i.totalTimeSpent,
975
+ modules: i.modules,
976
+ recentActivity: i.recentActivity,
977
+ streak: i.streak,
978
+ achievements: i.achievements
993
979
  }
994
980
  ) })
995
981
  ] })
@@ -997,91 +983,94 @@ function xt({
997
983
  }
998
984
  );
999
985
  }
1000
- const nt = {
986
+ const Vt = Y(yt, "GradeCenterModule"), At = {
1001
987
  text: "Text Entry",
1002
988
  file: "File Upload",
1003
989
  url: "URL Submission"
1004
990
  };
1005
- function pt({
1006
- title: u,
1007
- instructions: b,
1008
- dueDate: h,
1009
- maxScore: o,
1010
- submissionTypes: k,
1011
- fileConstraints: m,
1012
- rubric: l,
1013
- existingSubmission: i,
1014
- status: f = "not_started",
1015
- grade: d,
1016
- onSubmit: v,
1017
- onSaveDraft: x,
1018
- className: n,
991
+ function Mt({
992
+ title: c,
993
+ instructions: N,
994
+ dueDate: o,
995
+ maxScore: l,
996
+ submissionTypes: f = ["text", "file"],
997
+ fileConstraints: i,
998
+ rubric: n,
999
+ existingSubmission: h,
1000
+ status: a = "not_started",
1001
+ grade: u,
1002
+ onSubmit: x,
1003
+ onComplete: b,
1004
+ onSaveDraft: s,
1005
+ readOnly: S = !1,
1006
+ className: m,
1019
1007
  style: g
1020
1008
  }) {
1021
- const a = f === "submitted" || f === "graded" ? {
1009
+ const v = a === "submitted" || a === "graded" ? {
1022
1010
  tag: "confirmation",
1023
- submission: i ?? {}
1024
- } : { tag: "instructions" }, [p, N] = P(a), C = E(null);
1025
- D(() => {
1026
- var r;
1027
- (r = C.current) == null || r.focus({ preventScroll: !0 });
1028
- }, [p.tag]);
1029
- const S = W(() => l ? l.reduce(
1030
- (r, A) => r + Math.max(...A.levels.map((I) => I.points)),
1011
+ submission: h ?? {}
1012
+ } : { tag: "instructions" }, [r, C] = R(v), M = U(null);
1013
+ L(() => {
1014
+ var k;
1015
+ (k = M.current) == null || k.focus({ preventScroll: !0 });
1016
+ }, [r.tag]);
1017
+ const y = K(() => Array.isArray(n) ? n.reduce(
1018
+ (k, Q) => k + Math.max(...Q.levels.map((B) => B.points)),
1031
1019
  0
1032
- ) : 0, [l]);
1033
- function w(r) {
1034
- v == null || v(r), N({ tag: "confirmation", submission: r });
1020
+ ) : 0, [n]);
1021
+ function E(k) {
1022
+ x == null || x(k), b == null || b({ submission: k, status: "submitted" }), C({ tag: "confirmation", submission: k });
1035
1023
  }
1036
- function z(r) {
1037
- x == null || x(r);
1024
+ function d(k) {
1025
+ s == null || s(k), b == null || b({ submission: k, status: "draft" });
1038
1026
  }
1039
- const s = f === "not_started" || f === "draft" || f === "resubmit";
1040
- if (p.tag === "instructions")
1027
+ const p = a === "not_started" || a === "draft" || a === "resubmit";
1028
+ if (r.tag === "instructions")
1041
1029
  return /* @__PURE__ */ e(
1042
1030
  "div",
1043
1031
  {
1044
- ref: C,
1032
+ ref: M,
1045
1033
  tabIndex: -1,
1046
- className: T("max-w-2xl mx-auto outline-none", n),
1034
+ className: A("max-w-2xl mx-auto outline-none", m),
1047
1035
  style: g,
1048
- children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8", children: [
1036
+ children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ t(j, { className: "pt-8 pb-8", children: [
1049
1037
  /* @__PURE__ */ t("div", { className: "text-center mb-6", children: [
1050
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ e(ae, { className: "size-7 text-primary" }) }),
1051
- /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: u })
1038
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ e(fe, { className: "size-7 text-primary" }) }),
1039
+ /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: c })
1052
1040
  ] }),
1053
1041
  /* @__PURE__ */ t("div", { className: "flex flex-wrap justify-center gap-2 mb-6", children: [
1054
- h && /* @__PURE__ */ e(de, { dueDate: h, size: "small" }),
1055
- o !== void 0 && /* @__PURE__ */ t(j, { variant: "outline", className: "gap-1.5", children: [
1056
- /* @__PURE__ */ e(F, { className: "size-3.5" }),
1057
- o,
1042
+ o && /* @__PURE__ */ e(ge, { dueDate: o, size: "small" }),
1043
+ l !== void 0 && /* @__PURE__ */ t(q, { variant: "outline", className: "gap-1.5", children: [
1044
+ /* @__PURE__ */ e(X, { className: "size-3.5" }),
1045
+ l,
1058
1046
  " points"
1059
1047
  ] }),
1060
- /* @__PURE__ */ t(j, { variant: "outline", className: "gap-1.5", children: [
1061
- /* @__PURE__ */ e(le, { className: "size-3.5" }),
1062
- k.map((r) => nt[r]).join(", ")
1048
+ /* @__PURE__ */ t(q, { variant: "outline", className: "gap-1.5", children: [
1049
+ /* @__PURE__ */ e(xe, { className: "size-3.5" }),
1050
+ f.map((k) => At[k]).join(", ")
1063
1051
  ] }),
1064
- /* @__PURE__ */ e(ue, { status: f })
1052
+ /* @__PURE__ */ e(Ne, { status: a })
1065
1053
  ] }),
1066
- /* @__PURE__ */ e(q, { className: "my-6" }),
1067
- /* @__PURE__ */ e("div", { className: "prose prose-sm text-foreground mb-6", children: b }),
1068
- l && l.length > 0 && /* @__PURE__ */ t(J, { children: [
1069
- /* @__PURE__ */ e(q, { className: "my-6" }),
1054
+ /* @__PURE__ */ e(_, { className: "my-6" }),
1055
+ /* @__PURE__ */ e("div", { className: "prose prose-sm text-foreground mb-6", children: N }),
1056
+ Array.isArray(n) && n.length > 0 && /* @__PURE__ */ t(te, { children: [
1057
+ /* @__PURE__ */ e(_, { className: "my-6" }),
1070
1058
  /* @__PURE__ */ e(
1071
- ie,
1059
+ pe,
1072
1060
  {
1073
- criteria: l,
1074
- maxScore: S
1061
+ criteria: n,
1062
+ maxScore: y
1075
1063
  }
1076
1064
  )
1077
1065
  ] }),
1078
- s && /* @__PURE__ */ e("div", { className: "text-center mt-8", children: /* @__PURE__ */ t(
1079
- R,
1066
+ p && !S && /* @__PURE__ */ e("div", { className: "text-center mt-8", children: /* @__PURE__ */ t(
1067
+ P,
1080
1068
  {
1081
1069
  size: "lg",
1082
- onClick: () => N({ tag: "work" }),
1070
+ onClick: () => C({ tag: "work" }),
1071
+ disabled: S,
1083
1072
  children: [
1084
- /* @__PURE__ */ e(Z, { className: "size-4 mr-2" }),
1073
+ /* @__PURE__ */ e(ae, { className: "size-4 mr-2" }),
1085
1074
  "Start Assignment"
1086
1075
  ]
1087
1076
  }
@@ -1089,120 +1078,121 @@ function pt({
1089
1078
  ] }) })
1090
1079
  }
1091
1080
  );
1092
- if (p.tag === "work")
1081
+ if (r.tag === "work")
1093
1082
  return /* @__PURE__ */ t(
1094
1083
  "div",
1095
1084
  {
1096
- ref: C,
1085
+ ref: M,
1097
1086
  tabIndex: -1,
1098
- className: T("outline-none", n),
1087
+ className: A("outline-none", m),
1099
1088
  style: g,
1100
1089
  children: [
1101
1090
  /* @__PURE__ */ t(
1102
- R,
1091
+ P,
1103
1092
  {
1104
1093
  variant: "ghost",
1105
1094
  size: "sm",
1106
- onClick: () => N({ tag: "instructions" }),
1095
+ onClick: () => C({ tag: "instructions" }),
1107
1096
  className: "mb-4",
1108
1097
  children: [
1109
- /* @__PURE__ */ e(H, { className: "size-4 mr-1.5" }),
1098
+ /* @__PURE__ */ e(J, { className: "size-4 mr-1.5" }),
1110
1099
  "Back to Instructions"
1111
1100
  ]
1112
1101
  }
1113
1102
  ),
1114
1103
  /* @__PURE__ */ e(
1115
- qe,
1104
+ rt,
1116
1105
  {
1117
- title: u,
1118
- instructions: b,
1119
- dueDate: h,
1120
- maxScore: o,
1121
- status: f,
1122
- submissionTypes: k,
1123
- existingSubmission: i,
1124
- fileConstraints: m,
1125
- grade: d,
1126
- onSubmit: w,
1127
- onSaveDraft: z
1106
+ title: c,
1107
+ instructions: N,
1108
+ dueDate: o,
1109
+ maxScore: l,
1110
+ status: a,
1111
+ submissionTypes: f,
1112
+ existingSubmission: h,
1113
+ fileConstraints: i,
1114
+ grade: u,
1115
+ onSubmit: E,
1116
+ onSaveDraft: d,
1117
+ readOnly: S
1128
1118
  }
1129
1119
  )
1130
1120
  ]
1131
1121
  }
1132
1122
  );
1133
- const { submission: c } = p;
1123
+ const { submission: w } = r;
1134
1124
  return /* @__PURE__ */ e(
1135
1125
  "div",
1136
1126
  {
1137
- ref: C,
1127
+ ref: M,
1138
1128
  tabIndex: -1,
1139
- className: T("max-w-2xl mx-auto outline-none", n),
1129
+ className: A("max-w-2xl mx-auto outline-none", m),
1140
1130
  style: g,
1141
- children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8", children: [
1131
+ children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ t(j, { className: "pt-8 pb-8", children: [
1142
1132
  /* @__PURE__ */ t("div", { className: "text-center mb-6", children: [
1143
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-success/10 flex items-center justify-center", children: /* @__PURE__ */ e(F, { className: "size-7 text-success" }) }),
1144
- /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground mb-2", children: f === "graded" ? "Assignment Graded" : "Submission Received" }),
1133
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-success/10 flex items-center justify-center", children: /* @__PURE__ */ e(X, { className: "size-7 text-success" }) }),
1134
+ /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground mb-2", children: a === "graded" ? "Assignment Graded" : "Submission Received" }),
1145
1135
  /* @__PURE__ */ t("div", { className: "flex justify-center gap-2 mb-4", children: [
1146
- /* @__PURE__ */ e(ue, { status: f }),
1147
- h && /* @__PURE__ */ e(de, { dueDate: h, size: "small" })
1136
+ /* @__PURE__ */ e(Ne, { status: a }),
1137
+ o && /* @__PURE__ */ e(ge, { dueDate: o, size: "small" })
1148
1138
  ] })
1149
1139
  ] }),
1150
- f === "graded" && d && /* @__PURE__ */ t("div", { className: "text-center mb-6", children: [
1140
+ a === "graded" && u && /* @__PURE__ */ t("div", { className: "text-center mb-6", children: [
1151
1141
  /* @__PURE__ */ e(
1152
- ge,
1142
+ Ae,
1153
1143
  {
1154
- percentage: o ? Math.round(d.score / o * 100) : 0,
1144
+ percentage: l ? Math.round(u.score / l * 100) : 0,
1155
1145
  size: "large"
1156
1146
  }
1157
1147
  ),
1158
1148
  /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground mt-2", children: [
1159
- d.score,
1149
+ u.score,
1160
1150
  "/",
1161
- o,
1151
+ l,
1162
1152
  " points"
1163
1153
  ] }),
1164
- d.feedback && /* @__PURE__ */ e(xe, { className: "text-left mt-4", children: /* @__PURE__ */ e(pe, { children: d.feedback }) }),
1165
- l && d.rubricLevels && /* @__PURE__ */ t(J, { children: [
1166
- /* @__PURE__ */ e(q, { className: "my-6" }),
1154
+ u.feedback && /* @__PURE__ */ e(Ce, { className: "text-left mt-4", children: /* @__PURE__ */ e(ye, { children: u.feedback }) }),
1155
+ Array.isArray(n) && u.rubricLevels && /* @__PURE__ */ t(te, { children: [
1156
+ /* @__PURE__ */ e(_, { className: "my-6" }),
1167
1157
  /* @__PURE__ */ e(
1168
- ie,
1158
+ pe,
1169
1159
  {
1170
- criteria: l,
1171
- selectedLevels: d.rubricLevels,
1172
- totalScore: d.score,
1173
- maxScore: S
1160
+ criteria: n,
1161
+ selectedLevels: u.rubricLevels,
1162
+ totalScore: u.score,
1163
+ maxScore: y
1174
1164
  }
1175
1165
  )
1176
1166
  ] })
1177
1167
  ] }),
1178
- /* @__PURE__ */ e(q, { className: "my-6" }),
1168
+ /* @__PURE__ */ e(_, { className: "my-6" }),
1179
1169
  /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-foreground mb-3", children: "What You Submitted" }),
1180
1170
  /* @__PURE__ */ t("div", { className: "space-y-2 text-sm text-muted-foreground", children: [
1181
- c.textContent && /* @__PURE__ */ t("div", { className: "flex items-start gap-2", children: [
1182
- /* @__PURE__ */ e(Re, { className: "size-4 mt-0.5 shrink-0" }),
1183
- /* @__PURE__ */ e("span", { className: "line-clamp-2", children: c.textContent })
1171
+ w.textContent && /* @__PURE__ */ t("div", { className: "flex items-start gap-2", children: [
1172
+ /* @__PURE__ */ e(qe, { className: "size-4 mt-0.5 shrink-0" }),
1173
+ /* @__PURE__ */ e("span", { className: "line-clamp-2", children: w.textContent.replace(/<[^>]*>/g, "") })
1184
1174
  ] }),
1185
- c.files && c.files.length > 0 && /* @__PURE__ */ t("div", { className: "flex items-start gap-2", children: [
1186
- /* @__PURE__ */ e(le, { className: "size-4 mt-0.5 shrink-0" }),
1175
+ w.files && w.files.length > 0 && /* @__PURE__ */ t("div", { className: "flex items-start gap-2", children: [
1176
+ /* @__PURE__ */ e(xe, { className: "size-4 mt-0.5 shrink-0" }),
1187
1177
  /* @__PURE__ */ t("span", { children: [
1188
- c.files.length,
1178
+ w.files.length,
1189
1179
  " file",
1190
- c.files.length !== 1 ? "s" : "",
1180
+ w.files.length !== 1 ? "s" : "",
1191
1181
  " uploaded"
1192
1182
  ] })
1193
1183
  ] }),
1194
- c.url && /* @__PURE__ */ t("div", { className: "flex items-start gap-2", children: [
1195
- /* @__PURE__ */ e(Te, { className: "size-4 mt-0.5 shrink-0" }),
1196
- /* @__PURE__ */ e("span", { className: "truncate", children: c.url })
1184
+ w.url && /* @__PURE__ */ t("div", { className: "flex items-start gap-2", children: [
1185
+ /* @__PURE__ */ e(Ge, { className: "size-4 mt-0.5 shrink-0" }),
1186
+ /* @__PURE__ */ e("span", { className: "truncate", children: w.url })
1197
1187
  ] })
1198
1188
  ] }),
1199
- s && /* @__PURE__ */ e("div", { className: "text-center mt-8", children: /* @__PURE__ */ t(
1200
- R,
1189
+ p && !S && /* @__PURE__ */ e("div", { className: "text-center mt-8", children: /* @__PURE__ */ t(
1190
+ P,
1201
1191
  {
1202
1192
  variant: "outline",
1203
- onClick: () => N({ tag: "work" }),
1193
+ onClick: () => C({ tag: "work" }),
1204
1194
  children: [
1205
- /* @__PURE__ */ e(ae, { className: "size-4 mr-2" }),
1195
+ /* @__PURE__ */ e(fe, { className: "size-4 mr-2" }),
1206
1196
  "Edit Submission"
1207
1197
  ]
1208
1198
  }
@@ -1211,67 +1201,73 @@ function pt({
1211
1201
  }
1212
1202
  );
1213
1203
  }
1214
- function gt({
1215
- courseTitle: u,
1216
- recipientName: b,
1217
- organizationName: h,
1218
- organizationLogo: o,
1219
- signatory: k,
1220
- completionDate: m,
1221
- certificateVariant: l = "modern",
1222
- requirements: i,
1223
- overallProgress: f,
1224
- onRequirementClick: d,
1225
- onCertificateEarned: v,
1226
- className: x,
1227
- style: n
1204
+ const Ht = Y(Mt, "AssignmentModule");
1205
+ function Et({
1206
+ courseTitle: c,
1207
+ recipientName: N,
1208
+ organizationName: o,
1209
+ organizationLogo: l,
1210
+ signatory: f,
1211
+ completionDate: i,
1212
+ certificateVariant: n = "modern",
1213
+ requirements: h,
1214
+ overallProgress: a,
1215
+ onRequirementClick: u,
1216
+ onComplete: x,
1217
+ readOnly: b = !1,
1218
+ className: s,
1219
+ style: S
1228
1220
  }) {
1229
- const { allComplete: g, completedCount: a } = W(() => {
1230
- const w = i.filter((z) => z.completed).length;
1231
- return { allComplete: w === i.length, completedCount: w };
1232
- }, [i]), [p, N] = P({ tag: "requirements" }), C = E(null), S = E(!1);
1233
- return D(() => {
1234
- var w;
1235
- (w = C.current) == null || w.focus({ preventScroll: !0 });
1236
- }, [p.tag]), D(() => {
1237
- p.tag === "certificate" && !S.current && (S.current = !0, v == null || v());
1238
- }, [p.tag, v]), p.tag === "requirements" ? /* @__PURE__ */ e(
1221
+ const { allComplete: m, completedCount: g, derivedProgress: v } = K(() => {
1222
+ const p = h.filter((Q) => Q.completed).length, w = h.length, k = w > 0 ? Math.round(p / w * 100) : 0;
1223
+ return { allComplete: p === w, completedCount: p, derivedProgress: k };
1224
+ }, [h]), r = a ?? v, [C, M] = R({ tag: "requirements" }), y = U(null), E = U(!1);
1225
+ L(() => {
1226
+ var p;
1227
+ (p = y.current) == null || p.focus({ preventScroll: !0 });
1228
+ }, [C.tag]);
1229
+ const d = U(x);
1230
+ return d.current = x, L(() => {
1231
+ var p;
1232
+ C.tag === "certificate" && !E.current && (E.current = !0, (p = d.current) == null || p.call(d));
1233
+ }, [C.tag]), C.tag === "requirements" ? /* @__PURE__ */ e(
1239
1234
  "div",
1240
1235
  {
1241
- ref: C,
1236
+ ref: y,
1242
1237
  tabIndex: -1,
1243
- className: T("max-w-2xl mx-auto outline-none", x),
1244
- style: n,
1245
- children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ t(L, { className: "pt-8 pb-8", children: [
1238
+ className: A("max-w-2xl mx-auto outline-none", s),
1239
+ style: S,
1240
+ children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ t(j, { className: "pt-8 pb-8", children: [
1246
1241
  /* @__PURE__ */ t("div", { className: "text-center mb-6", children: [
1247
1242
  /* @__PURE__ */ e(
1248
- ee,
1243
+ D,
1249
1244
  {
1250
- value: f,
1245
+ value: r,
1251
1246
  size: 100,
1252
1247
  strokeWidth: 8,
1253
- color: g ? "var(--success)" : "var(--primary)",
1248
+ color: m ? "var(--success)" : "var(--primary)",
1254
1249
  className: "mx-auto mb-4 text-foreground"
1255
1250
  }
1256
1251
  ),
1257
- /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground mb-2", children: u }),
1258
- /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: g ? "All requirements met — your certificate is ready!" : `${a} of ${i.length} requirements complete` })
1252
+ /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground mb-2", children: c }),
1253
+ /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: m ? "All requirements met — your certificate is ready!" : `${g} of ${h.length} requirements complete` })
1259
1254
  ] }),
1260
1255
  /* @__PURE__ */ e(
1261
- Ge,
1256
+ nt,
1262
1257
  {
1263
- requirements: i,
1264
- onRequirementClick: d,
1258
+ requirements: h,
1259
+ onRequirementClick: b ? void 0 : u,
1265
1260
  className: "mb-6"
1266
1261
  }
1267
1262
  ),
1268
- g && /* @__PURE__ */ e("div", { className: "text-center mt-6", children: /* @__PURE__ */ t(
1269
- R,
1263
+ m && /* @__PURE__ */ e("div", { className: "text-center mt-6", children: /* @__PURE__ */ t(
1264
+ P,
1270
1265
  {
1271
1266
  size: "lg",
1272
- onClick: () => N({ tag: "certificate" }),
1267
+ onClick: () => M({ tag: "certificate" }),
1268
+ disabled: b,
1273
1269
  children: [
1274
- /* @__PURE__ */ e(Pe, { className: "size-4 mr-2" }),
1270
+ /* @__PURE__ */ e(ee, { className: "size-4 mr-2" }),
1275
1271
  "View Certificate"
1276
1272
  ]
1277
1273
  }
@@ -1281,43 +1277,43 @@ function gt({
1281
1277
  ) : /* @__PURE__ */ t(
1282
1278
  "div",
1283
1279
  {
1284
- ref: C,
1280
+ ref: y,
1285
1281
  tabIndex: -1,
1286
- className: T("outline-none", x),
1287
- style: n,
1282
+ className: A("outline-none", s),
1283
+ style: S,
1288
1284
  children: [
1289
1285
  /* @__PURE__ */ t(
1290
- R,
1286
+ P,
1291
1287
  {
1292
1288
  variant: "ghost",
1293
1289
  size: "sm",
1294
- onClick: () => N({ tag: "requirements" }),
1290
+ onClick: () => M({ tag: "requirements" }),
1295
1291
  className: "mb-4",
1296
1292
  children: [
1297
- /* @__PURE__ */ e(H, { className: "size-4 mr-1.5" }),
1293
+ /* @__PURE__ */ e(J, { className: "size-4 mr-1.5" }),
1298
1294
  "Back to Requirements"
1299
1295
  ]
1300
1296
  }
1301
1297
  ),
1302
1298
  /* @__PURE__ */ t("div", { className: "text-center mb-8", children: [
1303
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-success/10 flex items-center justify-center", children: /* @__PURE__ */ e(Ee, { className: "size-7 text-success" }) }),
1299
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-14 h-14 rounded-full bg-success/10 flex items-center justify-center", children: /* @__PURE__ */ e(We, { className: "size-7 text-success" }) }),
1304
1300
  /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-foreground mb-2", children: "Congratulations!" }),
1305
1301
  /* @__PURE__ */ t("p", { className: "text-muted-foreground", children: [
1306
1302
  "You've completed all requirements for",
1307
1303
  " ",
1308
- /* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: u })
1304
+ /* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: c })
1309
1305
  ] })
1310
1306
  ] }),
1311
1307
  /* @__PURE__ */ e(
1312
- Ve,
1308
+ Se,
1313
1309
  {
1314
- recipientName: b,
1315
- courseTitle: u,
1316
- completionDate: m ?? (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
1317
- organizationName: h,
1318
- organizationLogo: o,
1319
- signatory: k,
1320
- variant: l,
1310
+ recipientName: N,
1311
+ courseTitle: c,
1312
+ completionDate: i ?? (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
1313
+ organizationName: o,
1314
+ organizationLogo: l,
1315
+ signatory: f,
1316
+ variant: n,
1321
1317
  showActions: !0
1322
1318
  }
1323
1319
  )
@@ -1325,98 +1321,514 @@ function gt({
1325
1321
  }
1326
1322
  );
1327
1323
  }
1328
- function Nt({
1329
- forumTitle: u,
1330
- topics: b,
1331
- currentUser: h,
1332
- threads: o,
1333
- onCreateTopic: k,
1334
- onReply: m,
1335
- onToggleLike: l,
1336
- onMarkAnswer: i,
1337
- onTopicOpen: f,
1338
- readOnly: d,
1339
- className: v,
1340
- style: x
1324
+ const _t = Y(Et, "CertificateModule");
1325
+ function Bt({
1326
+ forumTitle: c,
1327
+ topics: N = [],
1328
+ currentUser: o,
1329
+ threads: l = {},
1330
+ onCreateTopic: f,
1331
+ onReply: i,
1332
+ onToggleLike: n,
1333
+ onMarkAnswer: h,
1334
+ onTopicOpen: a,
1335
+ readOnly: u,
1336
+ className: x,
1337
+ style: b
1341
1338
  }) {
1342
- const [n, g] = P(null), [a, p] = P(""), [N, C] = P("newest"), S = E(null);
1343
- D(() => {
1344
- var r;
1345
- (r = S.current) == null || r.focus({ preventScroll: !0 });
1346
- }, [n]);
1347
- function w(r) {
1348
- g(r), f == null || f(r);
1349
- }
1350
- function z() {
1351
- g(null);
1352
- }
1353
- const s = n ? o[n] : null, c = n ? b.find((r) => r.uid === n) : null;
1339
+ const [s, S] = R(null), [m, g] = R(""), [v, r] = R("newest"), C = U(null);
1340
+ L(() => {
1341
+ var B;
1342
+ (B = C.current) == null || B.focus({ preventScroll: !0 });
1343
+ }, [s]);
1344
+ const M = U(a);
1345
+ M.current = a;
1346
+ const y = T((B) => {
1347
+ var $;
1348
+ S(B), ($ = M.current) == null || $.call(M, B);
1349
+ }, []), E = T(() => {
1350
+ S(null);
1351
+ }, []), d = s ? l[s] : null, p = s ? N.find((B) => B.uid === s) : null, w = T(
1352
+ (B, $) => {
1353
+ s && (i == null || i(s, B, $));
1354
+ },
1355
+ [s, i]
1356
+ ), k = T(
1357
+ (B) => {
1358
+ s && (n == null || n(s, B));
1359
+ },
1360
+ [s, n]
1361
+ ), Q = T(
1362
+ (B) => {
1363
+ s && (h == null || h(s, B));
1364
+ },
1365
+ [s, h]
1366
+ );
1354
1367
  return /* @__PURE__ */ e(
1355
1368
  "div",
1356
1369
  {
1357
- ref: S,
1370
+ ref: C,
1358
1371
  tabIndex: -1,
1359
- className: T("outline-none", v),
1360
- style: x,
1361
- children: n && s ? (
1372
+ className: A("outline-none", x),
1373
+ style: b,
1374
+ children: s && d ? (
1362
1375
  /* ─── Thread View ─── */
1363
1376
  /* @__PURE__ */ t("div", { children: [
1364
1377
  /* @__PURE__ */ t(
1365
- R,
1378
+ P,
1379
+ {
1380
+ variant: "ghost",
1381
+ size: "sm",
1382
+ onClick: E,
1383
+ className: "mb-4",
1384
+ children: [
1385
+ /* @__PURE__ */ e(J, { className: "size-4 mr-1.5" }),
1386
+ "Back to Topics"
1387
+ ]
1388
+ }
1389
+ ),
1390
+ /* @__PURE__ */ e(
1391
+ lt,
1392
+ {
1393
+ title: (p == null ? void 0 : p.title) ?? "",
1394
+ rootPost: d.rootPost,
1395
+ replies: d.replies,
1396
+ currentUser: o,
1397
+ onReply: w,
1398
+ onToggleLike: n ? k : void 0,
1399
+ onMarkAnswer: h ? Q : void 0,
1400
+ readOnly: u
1401
+ }
1402
+ )
1403
+ ] })
1404
+ ) : s && !d ? (
1405
+ /* ─── Empty Thread State ─── */
1406
+ /* @__PURE__ */ t("div", { children: [
1407
+ /* @__PURE__ */ t(
1408
+ P,
1366
1409
  {
1367
1410
  variant: "ghost",
1368
1411
  size: "sm",
1369
- onClick: z,
1412
+ onClick: E,
1370
1413
  className: "mb-4",
1371
1414
  children: [
1372
- /* @__PURE__ */ e(H, { className: "size-4 mr-1.5" }),
1415
+ /* @__PURE__ */ e(J, { className: "size-4 mr-1.5" }),
1373
1416
  "Back to Topics"
1374
1417
  ]
1375
1418
  }
1376
1419
  ),
1377
1420
  /* @__PURE__ */ e(
1378
- We,
1421
+ ce,
1379
1422
  {
1380
- title: (c == null ? void 0 : c.title) ?? "",
1381
- rootPost: s.rootPost,
1382
- replies: s.replies,
1383
- currentUser: h,
1384
- onReply: (r, A) => m == null ? void 0 : m(n, r, A),
1385
- onToggleLike: l ? (r) => l(n, r) : void 0,
1386
- onMarkAnswer: i ? (r) => i(n, r) : void 0,
1387
- readOnly: d
1423
+ title: "No discussion yet",
1424
+ description: "Be the first to start this conversation."
1388
1425
  }
1389
1426
  )
1390
1427
  ] })
1391
1428
  ) : (
1392
1429
  /* ─── Forum Board View ─── */
1393
1430
  /* @__PURE__ */ e(
1394
- He,
1431
+ at,
1395
1432
  {
1396
- title: u,
1397
- topics: b,
1398
- currentUser: h,
1399
- onTopicClick: w,
1400
- onCreateTopic: k,
1401
- sortOrder: N,
1402
- onSortChange: C,
1403
- searchQuery: a,
1404
- onSearchChange: p,
1405
- readOnly: d
1433
+ title: c,
1434
+ topics: N,
1435
+ currentUser: o,
1436
+ onTopicClick: y,
1437
+ onCreateTopic: f,
1438
+ sortOrder: v,
1439
+ onSortChange: r,
1440
+ searchQuery: m,
1441
+ onSearchChange: g,
1442
+ readOnly: u
1406
1443
  }
1407
1444
  )
1408
1445
  )
1409
1446
  }
1410
1447
  );
1411
1448
  }
1449
+ const Jt = Y(Bt, "DiscussionModule");
1450
+ function Pt({
1451
+ studentName: c,
1452
+ overallProgress: N,
1453
+ totalTimeSpent: o,
1454
+ modules: l,
1455
+ recentActivity: f,
1456
+ streak: i,
1457
+ achievements: n,
1458
+ enrolledCourses: h,
1459
+ onCourseClick: a,
1460
+ announcements: u = [],
1461
+ onAnnouncementSelect: x,
1462
+ onMarkRead: b,
1463
+ readOnly: s = !1,
1464
+ className: S,
1465
+ style: m
1466
+ }) {
1467
+ const g = U(null);
1468
+ L(() => {
1469
+ var r;
1470
+ (r = g.current) == null || r.focus({ preventScroll: !0 });
1471
+ }, []);
1472
+ const v = u.filter((r) => !r.isRead).length;
1473
+ return /* @__PURE__ */ t(
1474
+ "div",
1475
+ {
1476
+ ref: g,
1477
+ tabIndex: -1,
1478
+ className: A("outline-none", S),
1479
+ style: m,
1480
+ children: [
1481
+ /* @__PURE__ */ t("div", { className: "flex items-center justify-between mb-6", children: [
1482
+ /* @__PURE__ */ t("h2", { className: "text-xl font-bold text-foreground", children: [
1483
+ "Welcome back, ",
1484
+ c
1485
+ ] }),
1486
+ /* @__PURE__ */ e(D, { value: N, size: 48, strokeWidth: 4 })
1487
+ ] }),
1488
+ /* @__PURE__ */ e(_, { className: "mb-6" }),
1489
+ /* @__PURE__ */ t(de, { defaultValue: "overview", children: [
1490
+ /* @__PURE__ */ t(oe, { className: "mb-6", children: [
1491
+ /* @__PURE__ */ t(V, { value: "overview", children: [
1492
+ /* @__PURE__ */ e(ve, { className: "size-4 mr-1.5" }),
1493
+ "Overview"
1494
+ ] }),
1495
+ /* @__PURE__ */ t(V, { value: "courses", children: [
1496
+ /* @__PURE__ */ e(Z, { className: "size-4 mr-1.5" }),
1497
+ "My Courses"
1498
+ ] }),
1499
+ /* @__PURE__ */ t(V, { value: "announcements", children: [
1500
+ /* @__PURE__ */ e(Ve, { className: "size-4 mr-1.5" }),
1501
+ "Announcements",
1502
+ v > 0 && /* @__PURE__ */ e("span", { className: "ml-1.5 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium min-w-5 h-5 px-1.5", children: v })
1503
+ ] })
1504
+ ] }),
1505
+ /* @__PURE__ */ e(H, { value: "overview", children: /* @__PURE__ */ e(
1506
+ we,
1507
+ {
1508
+ overallProgress: N,
1509
+ totalTimeSpent: o,
1510
+ modules: l,
1511
+ recentActivity: f,
1512
+ streak: i,
1513
+ achievements: n
1514
+ }
1515
+ ) }),
1516
+ /* @__PURE__ */ e(H, { value: "courses", children: /* @__PURE__ */ e(
1517
+ ke,
1518
+ {
1519
+ courses: h,
1520
+ onCourseClick: (r) => !s && a(r.uid),
1521
+ showSearch: !0,
1522
+ viewMode: "grid",
1523
+ readOnly: s
1524
+ }
1525
+ ) }),
1526
+ /* @__PURE__ */ e(H, { value: "announcements", children: /* @__PURE__ */ e(
1527
+ it,
1528
+ {
1529
+ announcements: u,
1530
+ onSelect: x,
1531
+ onMarkRead: b,
1532
+ readOnly: s
1533
+ }
1534
+ ) })
1535
+ ] })
1536
+ ]
1537
+ }
1538
+ );
1539
+ }
1540
+ const Kt = Y(Pt, "StudentDashboardModule");
1541
+ function Ut({
1542
+ title: c,
1543
+ courses: N = [],
1544
+ categories: o = [],
1545
+ enrollmentData: l,
1546
+ onEnroll: f,
1547
+ onCourseOpen: i,
1548
+ readOnly: n = !1,
1549
+ className: h,
1550
+ style: a
1551
+ }) {
1552
+ var g;
1553
+ const [u, x] = R({ tag: "browse" }), b = U(null);
1554
+ L(() => {
1555
+ var v;
1556
+ (v = b.current) == null || v.focus({ preventScroll: !0 });
1557
+ }, [u.tag]);
1558
+ function s(v) {
1559
+ l != null && l[v] ? x({ tag: "enroll", courseUid: v }) : i == null || i(v);
1560
+ }
1561
+ function S() {
1562
+ x({ tag: "browse" });
1563
+ }
1564
+ function m(v) {
1565
+ f(v), x({ tag: "browse" });
1566
+ }
1567
+ return /* @__PURE__ */ t(
1568
+ "div",
1569
+ {
1570
+ ref: b,
1571
+ tabIndex: -1,
1572
+ className: A("outline-none", h),
1573
+ style: a,
1574
+ children: [
1575
+ c && u.tag === "browse" && /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground mb-4", children: c }),
1576
+ u.tag === "enroll" ? (
1577
+ /* --- Enrollment View --- */
1578
+ /* @__PURE__ */ t("div", { children: [
1579
+ /* @__PURE__ */ t(
1580
+ P,
1581
+ {
1582
+ variant: "ghost",
1583
+ size: "sm",
1584
+ onClick: S,
1585
+ className: "mb-4",
1586
+ children: [
1587
+ /* @__PURE__ */ e(J, { className: "size-4 mr-1.5" }),
1588
+ "Back to Catalog"
1589
+ ]
1590
+ }
1591
+ ),
1592
+ l != null && l[u.courseUid] ? /* @__PURE__ */ e(
1593
+ ct,
1594
+ {
1595
+ course: l[u.courseUid].course,
1596
+ prerequisites: l[u.courseUid].prerequisites,
1597
+ onEnroll: m,
1598
+ onCancel: S
1599
+ }
1600
+ ) : (
1601
+ /* Fallback when enrollment data is not yet available */
1602
+ /* @__PURE__ */ e(I, { children: /* @__PURE__ */ t(j, { className: "pt-6", children: [
1603
+ /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-foreground mb-2", children: ((g = N.find((v) => v.uid === u.courseUid)) == null ? void 0 : g.title) ?? "Course" }),
1604
+ /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-4", children: "Enrollment details are loading. You can enroll directly below." }),
1605
+ /* @__PURE__ */ t("div", { className: "flex gap-2", children: [
1606
+ /* @__PURE__ */ e(P, { variant: "outline", onClick: S, children: "Cancel" }),
1607
+ /* @__PURE__ */ e(
1608
+ P,
1609
+ {
1610
+ onClick: () => m(u.courseUid),
1611
+ disabled: n,
1612
+ children: "Enroll Now"
1613
+ }
1614
+ )
1615
+ ] })
1616
+ ] }) })
1617
+ )
1618
+ ] })
1619
+ ) : (
1620
+ /* --- Browse View --- */
1621
+ /* @__PURE__ */ e(
1622
+ ke,
1623
+ {
1624
+ courses: N,
1625
+ categories: o,
1626
+ onCourseClick: (v) => s(v.uid),
1627
+ onEnroll: (v) => s(v.uid),
1628
+ readOnly: n
1629
+ }
1630
+ )
1631
+ )
1632
+ ]
1633
+ }
1634
+ );
1635
+ }
1636
+ const Xt = Y(Ut, "CourseCatalogModule");
1637
+ function Rt({
1638
+ student: c,
1639
+ enrolledCourses: N = [],
1640
+ achievements: o = [],
1641
+ certificates: l = [],
1642
+ stats: f,
1643
+ onCourseClick: i,
1644
+ certificateData: n,
1645
+ readOnly: h = !1,
1646
+ className: a,
1647
+ style: u
1648
+ }) {
1649
+ const [x, b] = R(null), s = U(null);
1650
+ L(() => {
1651
+ var r;
1652
+ (r = s.current) == null || r.focus({ preventScroll: !0 });
1653
+ }, [x]);
1654
+ function S(r) {
1655
+ h || n != null && n[r] && b(r);
1656
+ }
1657
+ function m() {
1658
+ b(null);
1659
+ }
1660
+ const g = x ? n == null ? void 0 : n[x] : null, v = x ? l.find((r) => r.uid === x) : null;
1661
+ return /* @__PURE__ */ t(
1662
+ "div",
1663
+ {
1664
+ ref: s,
1665
+ tabIndex: -1,
1666
+ className: A("outline-none", a),
1667
+ style: u,
1668
+ children: [
1669
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-4 mb-6", children: [
1670
+ /* @__PURE__ */ e(
1671
+ gt,
1672
+ {
1673
+ displayName: c.displayName,
1674
+ avatarUrl: c.avatarUrl,
1675
+ size: "medium"
1676
+ }
1677
+ ),
1678
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
1679
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2 flex-wrap", children: [
1680
+ /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-foreground", children: c.displayName }),
1681
+ c.role && /* @__PURE__ */ e(q, { variant: "secondary", children: c.role })
1682
+ ] }),
1683
+ c.email && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: c.email })
1684
+ ] })
1685
+ ] }),
1686
+ /* @__PURE__ */ e(_, { className: "mb-6" }),
1687
+ v && g ? /* @__PURE__ */ t("div", { children: [
1688
+ /* @__PURE__ */ t(
1689
+ P,
1690
+ {
1691
+ variant: "ghost",
1692
+ size: "sm",
1693
+ onClick: m,
1694
+ className: "mb-4",
1695
+ children: [
1696
+ /* @__PURE__ */ e(J, { className: "size-4 mr-1.5" }),
1697
+ "Back to Profile"
1698
+ ]
1699
+ }
1700
+ ),
1701
+ /* @__PURE__ */ e(Se, { ...g, showActions: !0 })
1702
+ ] }) : /* @__PURE__ */ t(de, { defaultValue: "profile", children: [
1703
+ /* @__PURE__ */ t(oe, { className: "mb-6", children: [
1704
+ /* @__PURE__ */ t(V, { value: "profile", children: [
1705
+ /* @__PURE__ */ e(He, { className: "size-4 mr-1.5" }),
1706
+ "Profile"
1707
+ ] }),
1708
+ /* @__PURE__ */ t(V, { value: "courses", children: [
1709
+ /* @__PURE__ */ e(Z, { className: "size-4 mr-1.5" }),
1710
+ "Courses"
1711
+ ] }),
1712
+ /* @__PURE__ */ t(V, { value: "achievements", children: [
1713
+ /* @__PURE__ */ e(se, { className: "size-4 mr-1.5" }),
1714
+ "Achievements"
1715
+ ] }),
1716
+ /* @__PURE__ */ t(V, { value: "certificates", children: [
1717
+ /* @__PURE__ */ e(ee, { className: "size-4 mr-1.5" }),
1718
+ "Certificates"
1719
+ ] })
1720
+ ] }),
1721
+ /* @__PURE__ */ e(H, { value: "profile", children: /* @__PURE__ */ e(
1722
+ dt,
1723
+ {
1724
+ student: c,
1725
+ enrolledCourses: N,
1726
+ achievements: o,
1727
+ stats: f,
1728
+ onCourseClick: i,
1729
+ showCourses: !1,
1730
+ showAchievements: !1,
1731
+ readOnly: !0
1732
+ }
1733
+ ) }),
1734
+ /* @__PURE__ */ e(H, { value: "courses", children: N.length > 0 ? /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(j, { className: "p-0 divide-y divide-border", children: N.map((r) => /* @__PURE__ */ t(
1735
+ "div",
1736
+ {
1737
+ className: A(
1738
+ "flex items-center gap-3 px-4 py-3 transition-colors",
1739
+ i && !h && "cursor-pointer hover:bg-muted/50"
1740
+ ),
1741
+ onClick: i && !h ? () => i(r.uid) : void 0,
1742
+ children: [
1743
+ /* @__PURE__ */ e(
1744
+ D,
1745
+ {
1746
+ value: r.progress,
1747
+ size: 32,
1748
+ strokeWidth: 3
1749
+ }
1750
+ ),
1751
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
1752
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground truncate", children: r.title }),
1753
+ r.lastAccessedAt && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: Nt(r.lastAccessedAt) })
1754
+ ] }),
1755
+ /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: [
1756
+ Math.round(r.progress),
1757
+ "%"
1758
+ ] })
1759
+ ]
1760
+ },
1761
+ r.uid
1762
+ )) }) }) : /* @__PURE__ */ t("div", { className: "py-12 text-center", children: [
1763
+ /* @__PURE__ */ e(Z, { className: "size-10 text-muted-foreground mx-auto mb-3" }),
1764
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: "No courses yet" }),
1765
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-1", children: "Enrolled courses will appear here." })
1766
+ ] }) }),
1767
+ /* @__PURE__ */ e(H, { value: "achievements", children: o.length > 0 ? /* @__PURE__ */ e("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-2", children: o.map((r) => /* @__PURE__ */ e(
1768
+ vt,
1769
+ {
1770
+ title: r.name,
1771
+ description: r.description,
1772
+ icon: r.iconUrl ? /* @__PURE__ */ e(
1773
+ "img",
1774
+ {
1775
+ src: r.iconUrl,
1776
+ alt: r.name,
1777
+ className: "w-12 h-12"
1778
+ }
1779
+ ) : void 0,
1780
+ earnedDate: r.earnedAt
1781
+ },
1782
+ r.uid
1783
+ )) }) : /* @__PURE__ */ t("div", { className: "py-12 text-center", children: [
1784
+ /* @__PURE__ */ e(se, { className: "size-10 text-muted-foreground mx-auto mb-3" }),
1785
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: "No achievements yet" }),
1786
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-1", children: "Achievements will appear here as they are earned." })
1787
+ ] }) }),
1788
+ /* @__PURE__ */ e(H, { value: "certificates", children: l.length > 0 ? /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(j, { className: "p-0 divide-y divide-border", children: l.map((r) => /* @__PURE__ */ t(
1789
+ "div",
1790
+ {
1791
+ className: A(
1792
+ "flex items-center gap-3 px-4 py-3 transition-colors",
1793
+ (n == null ? void 0 : n[r.uid]) && !h && "cursor-pointer hover:bg-muted/50"
1794
+ ),
1795
+ onClick: n != null && n[r.uid] && !h ? () => S(r.uid) : void 0,
1796
+ children: [
1797
+ /* @__PURE__ */ e("div", { className: "w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center text-primary", children: /* @__PURE__ */ e(ee, { size: 20 }) }),
1798
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
1799
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground truncate", children: r.courseName }),
1800
+ /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: [
1801
+ "Issued",
1802
+ " ",
1803
+ new Date(r.issuedAt).toLocaleDateString()
1804
+ ] })
1805
+ ] }),
1806
+ (n == null ? void 0 : n[r.uid]) && /* @__PURE__ */ e(q, { variant: "secondary", className: "text-xs", children: "View" })
1807
+ ]
1808
+ },
1809
+ r.uid
1810
+ )) }) }) : /* @__PURE__ */ t("div", { className: "py-12 text-center", children: [
1811
+ /* @__PURE__ */ e(ee, { className: "size-10 text-muted-foreground mx-auto mb-3" }),
1812
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: "No certificates yet" }),
1813
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-1", children: "Certificates will appear here once courses are completed." })
1814
+ ] }) })
1815
+ ] })
1816
+ ]
1817
+ }
1818
+ );
1819
+ }
1820
+ const Zt = Y(Rt, "StudentProfileModule");
1412
1821
  export {
1413
- pt as AssignmentModule,
1414
- gt as CertificateModule,
1415
- mt as CoursePlayer,
1416
- Nt as DiscussionModule,
1417
- ht as ExamModule,
1418
- ut as FlashcardLab,
1419
- xt as GradeCenterModule,
1420
- dt as QuizModule,
1421
- ft as SurveyModule
1822
+ Ht as AssignmentModule,
1823
+ _t as CertificateModule,
1824
+ Xt as CourseCatalogModule,
1825
+ qt as CoursePlayer,
1826
+ Jt as DiscussionModule,
1827
+ Gt as ExamModule,
1828
+ Yt as FlashcardLab,
1829
+ Vt as GradeCenterModule,
1830
+ $t as QuizModule,
1831
+ Kt as StudentDashboardModule,
1832
+ Zt as StudentProfileModule,
1833
+ Wt as SurveyModule
1422
1834
  };