@hydralms/components 0.1.3 → 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 (344) hide show
  1. package/dist/StudentProfile-BVfZMbnV.cjs +1 -0
  2. package/dist/StudentProfile-DeMxdrL3.js +3275 -0
  3. package/dist/assessment-toolbar/assessment-toolbar.d.ts +1 -1
  4. package/dist/assessment-toolbar/index.d.ts +5 -1
  5. package/dist/assessment-toolbar/question-header-bar.d.ts +2 -0
  6. package/dist/assessment-toolbar/question-materials-drawer.d.ts +2 -0
  7. package/dist/assessment-toolbar/question-navigator.d.ts +1 -1
  8. package/dist/assessment-toolbar/timer-display.d.ts +1 -1
  9. package/dist/assessment-toolbar/types.d.ts +52 -4
  10. package/dist/assessment-toolbar/use-countdown.d.ts +43 -0
  11. package/dist/common/index.d.ts +3 -1
  12. package/dist/common/pagination.d.ts +26 -0
  13. package/dist/common/stepper.d.ts +6 -0
  14. package/dist/common/types.d.ts +38 -0
  15. package/dist/components.css +1 -1
  16. package/dist/content/attachment-list.d.ts +6 -0
  17. package/dist/content/audio-player.d.ts +22 -0
  18. package/dist/content/code-block.d.ts +30 -0
  19. package/dist/content/content-block.d.ts +1 -1
  20. package/dist/content/embed-block.d.ts +28 -0
  21. package/dist/content/index.d.ts +8 -1
  22. package/dist/content/types.d.ts +63 -0
  23. package/dist/curriculum/course-card.d.ts +51 -0
  24. package/dist/curriculum/curriculum-item.d.ts +1 -1
  25. package/dist/curriculum/index.d.ts +2 -0
  26. package/dist/curriculum/types.d.ts +2 -2
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +597 -308
  30. package/dist/license/HydraContext.d.ts +16 -0
  31. package/dist/license/ProBadge.d.ts +6 -0
  32. package/dist/license/index.d.ts +7 -0
  33. package/dist/license/tiers.d.ts +3 -0
  34. package/dist/license/useHydraLicense.d.ts +6 -0
  35. package/dist/license/validate.d.ts +13 -0
  36. package/dist/license/withProGate.d.ts +6 -0
  37. package/dist/modules/AssignmentModule/AssignmentModule.d.ts +5 -0
  38. package/dist/modules/AssignmentModule/types.d.ts +69 -0
  39. package/dist/modules/CertificateModule/CertificateModule.d.ts +5 -0
  40. package/dist/modules/CertificateModule/types.d.ts +51 -0
  41. package/dist/modules/CourseCatalogModule/CourseCatalogModule.d.ts +5 -0
  42. package/dist/modules/CourseCatalogModule/types.d.ts +43 -0
  43. package/dist/modules/CoursePlayer/CoursePlayer.d.ts +4 -1
  44. package/dist/modules/DiscussionModule/DiscussionModule.d.ts +5 -0
  45. package/dist/modules/DiscussionModule/types.d.ts +47 -0
  46. package/dist/modules/ExamModule/ExamModule.d.ts +5 -0
  47. package/dist/modules/ExamModule/types.d.ts +55 -0
  48. package/dist/modules/FlashcardLab/FlashcardLab.d.ts +4 -1
  49. package/dist/modules/FlashcardLab/types.d.ts +2 -0
  50. package/dist/modules/GradeCenterModule/GradeCenterModule.d.ts +5 -0
  51. package/dist/modules/GradeCenterModule/types.d.ts +56 -0
  52. package/dist/modules/QuizModule/QuizModule.d.ts +4 -1
  53. package/dist/modules/QuizModule/types.d.ts +10 -14
  54. package/dist/modules/StudentDashboardModule/StudentDashboardModule.d.ts +5 -0
  55. package/dist/modules/StudentDashboardModule/types.d.ts +54 -0
  56. package/dist/modules/StudentProfileModule/StudentProfileModule.d.ts +5 -0
  57. package/dist/modules/StudentProfileModule/types.d.ts +43 -0
  58. package/dist/modules/SurveyModule/SurveyModule.d.ts +5 -0
  59. package/dist/modules/SurveyModule/types.d.ts +51 -0
  60. package/dist/modules/_shared/assessment-intro.d.ts +16 -0
  61. package/dist/modules/_shared/assessment-results.d.ts +23 -0
  62. package/dist/modules/_shared/types.d.ts +10 -0
  63. package/dist/modules/_shared/use-timer.d.ts +9 -0
  64. package/dist/modules/index.d.ts +18 -0
  65. package/dist/modules.cjs +1 -0
  66. package/dist/modules.js +1834 -0
  67. package/dist/progress/achievement-badge.d.ts +6 -0
  68. package/dist/progress/activity-timeline.d.ts +6 -0
  69. package/dist/progress/index.d.ts +4 -1
  70. package/dist/progress/stat-card.d.ts +1 -1
  71. package/dist/progress/streak-badge.d.ts +6 -0
  72. package/dist/progress/types.d.ts +99 -0
  73. package/dist/provider/HydraProvider.d.ts +5 -1
  74. package/dist/questions/choice.d.ts +1 -1
  75. package/dist/questions/confidence-indicator.d.ts +37 -0
  76. package/dist/questions/essay.d.ts +2 -2
  77. package/dist/questions/fill-in-the-blank.d.ts +1 -1
  78. package/dist/questions/hotspot.d.ts +21 -0
  79. package/dist/questions/index.d.ts +11 -1
  80. package/dist/questions/inline-choice.d.ts +21 -0
  81. package/dist/questions/matching.d.ts +22 -0
  82. package/dist/questions/multiple-choice.d.ts +1 -1
  83. package/dist/questions/numeric.d.ts +11 -0
  84. package/dist/questions/ordering.d.ts +12 -0
  85. package/dist/questions/question-renderer.d.ts +1 -1
  86. package/dist/questions/scenario.d.ts +23 -0
  87. package/dist/questions/scoring.d.ts +22 -0
  88. package/dist/questions/spreadsheet.d.ts +29 -0
  89. package/dist/questions/true-false.d.ts +1 -1
  90. package/dist/questions/types.d.ts +106 -1
  91. package/dist/questions/use-drag-reorder.d.ts +17 -0
  92. package/dist/sections/AnnouncementFeed/AnnouncementFeed.d.ts +1 -1
  93. package/dist/sections/AnnouncementFeed/types.d.ts +15 -1
  94. package/dist/sections/AssessmentReview/AssessmentReview.d.ts +1 -1
  95. package/dist/sections/AssessmentReview/types.d.ts +6 -0
  96. package/dist/sections/AssignmentSubmission/AssignmentSubmission.d.ts +1 -1
  97. package/dist/sections/AssignmentSubmission/types.d.ts +6 -0
  98. package/dist/sections/CertificateViewer/CertificateViewer.d.ts +1 -1
  99. package/dist/sections/CertificateViewer/certificate-variants.d.ts +42 -0
  100. package/dist/sections/CertificateViewer/types.d.ts +13 -5
  101. package/dist/sections/CourseCatalog/CourseCatalog.d.ts +2 -0
  102. package/dist/sections/CourseCatalog/types.d.ts +80 -0
  103. package/dist/sections/CourseOutline/CourseOutline.d.ts +1 -1
  104. package/dist/sections/CourseOutline/types.d.ts +6 -0
  105. package/dist/sections/DiscussionThread/DiscussionThread.d.ts +1 -1
  106. package/dist/sections/DiscussionThread/types.d.ts +6 -0
  107. package/dist/sections/EnrollmentWizard/EnrollmentWizard.d.ts +2 -0
  108. package/dist/sections/EnrollmentWizard/types.d.ts +66 -0
  109. package/dist/sections/ExamSession/ExamSession.d.ts +1 -1
  110. package/dist/sections/ExamSession/types.d.ts +12 -1
  111. package/dist/sections/FlashcardStudySession/FlashcardStudySession.d.ts +1 -1
  112. package/dist/sections/FlashcardStudySession/types.d.ts +6 -0
  113. package/dist/sections/ForumBoard/ForumBoard.d.ts +8 -0
  114. package/dist/sections/ForumBoard/types.d.ts +78 -0
  115. package/dist/sections/GradebookTable/GradebookTable.d.ts +1 -1
  116. package/dist/sections/GradebookTable/types.d.ts +14 -0
  117. package/dist/sections/LecturePlayer/LecturePlayer.d.ts +1 -1
  118. package/dist/sections/LecturePlayer/types.d.ts +8 -0
  119. package/dist/sections/LessonPage/LessonPage.d.ts +1 -1
  120. package/dist/sections/LessonPage/types.d.ts +6 -0
  121. package/dist/sections/PracticeQuiz/PracticeQuiz.d.ts +1 -1
  122. package/dist/sections/PracticeQuiz/types.d.ts +6 -0
  123. package/dist/sections/ProgressDashboard/ProgressDashboard.d.ts +1 -1
  124. package/dist/sections/ProgressDashboard/types.d.ts +6 -0
  125. package/dist/sections/QuizSession/QuizSession.d.ts +1 -1
  126. package/dist/sections/QuizSession/types.d.ts +12 -1
  127. package/dist/sections/RequirementsChecklist/RequirementsChecklist.d.ts +8 -0
  128. package/dist/sections/RequirementsChecklist/types.d.ts +43 -0
  129. package/dist/sections/ResourceLibrary/ResourceLibrary.d.ts +1 -1
  130. package/dist/sections/ResourceLibrary/types.d.ts +15 -1
  131. package/dist/sections/RubricView/RubricView.d.ts +9 -0
  132. package/dist/sections/RubricView/types.d.ts +56 -0
  133. package/dist/sections/ScrollableQuiz/ScrollableQuiz.d.ts +1 -1
  134. package/dist/sections/ScrollableQuiz/types.d.ts +6 -0
  135. package/dist/sections/StudentProfile/StudentProfile.d.ts +2 -0
  136. package/dist/sections/StudentProfile/types.d.ts +98 -0
  137. package/dist/sections/SurveyForm/SurveyForm.d.ts +1 -1
  138. package/dist/sections/SurveyForm/types.d.ts +6 -0
  139. package/dist/sections/_shared/merge-answers.d.ts +9 -0
  140. package/dist/sections/_shared/section-shell.d.ts +20 -0
  141. package/dist/sections/_shared/use-assessment-session.d.ts +30 -0
  142. package/dist/sections/index.d.ts +13 -1
  143. package/dist/sections.cjs +1 -1
  144. package/dist/sections.js +282 -1786
  145. package/dist/social/post-card.d.ts +1 -1
  146. package/dist/tabs-BsfVo2Bl.cjs +173 -0
  147. package/dist/tabs-BuY1iNJE.js +22305 -0
  148. package/dist/ui/alert.d.ts +1 -1
  149. package/dist/ui/badge.d.ts +1 -1
  150. package/dist/ui/button.d.ts +1 -1
  151. package/dist/ui/drawer.d.ts +84 -0
  152. package/dist/ui/index.d.ts +5 -0
  153. package/dist/ui/progress.d.ts +1 -1
  154. package/dist/ui/rich-text-editor.d.ts +32 -0
  155. package/dist/ui/rich-text-toolbar.d.ts +8 -0
  156. package/dist/ui/toast.d.ts +43 -0
  157. package/dist/utils/array-utils.d.ts +4 -0
  158. package/dist/utils/debounce.d.ts +5 -1
  159. package/dist/utils/flatten-leaves.d.ts +6 -0
  160. package/dist/utils/format-file-size.d.ts +1 -0
  161. package/dist/utils/format-timestamp.d.ts +1 -0
  162. package/dist/utils/is-empty-html.d.ts +5 -0
  163. package/dist/utils/pick-palette-color.d.ts +19 -0
  164. package/dist/utils/shuffle.d.ts +1 -0
  165. package/dist/utils/string-utils.d.ts +12 -0
  166. package/dist/video/types.d.ts +15 -0
  167. package/dist/video/video-bookmark.d.ts +1 -1
  168. package/dist/video/video-player.d.ts +1 -1
  169. package/dist/video/video-playlist-item.d.ts +1 -1
  170. package/dist/withProGate-BWqcKdPM.js +137 -0
  171. package/dist/withProGate-DX6XqKLp.cjs +1 -0
  172. package/package.json +40 -137
  173. package/src/assessment-toolbar/assessment-toolbar.tsx +54 -49
  174. package/src/assessment-toolbar/index.ts +6 -0
  175. package/src/assessment-toolbar/question-header-bar.tsx +61 -0
  176. package/src/assessment-toolbar/question-materials-drawer.tsx +55 -0
  177. package/src/assessment-toolbar/question-navigator.tsx +13 -36
  178. package/src/assessment-toolbar/timer-display.tsx +6 -5
  179. package/src/assessment-toolbar/types.ts +54 -4
  180. package/src/assessment-toolbar/use-countdown.ts +153 -0
  181. package/src/common/empty-state.tsx +1 -0
  182. package/src/common/index.ts +5 -0
  183. package/src/common/pagination.tsx +135 -0
  184. package/src/common/search-input.tsx +8 -6
  185. package/src/common/stepper.tsx +100 -0
  186. package/src/common/types.ts +41 -0
  187. package/src/content/attachment-list.tsx +92 -0
  188. package/src/content/audio-player.tsx +196 -0
  189. package/src/content/code-block.tsx +113 -0
  190. package/src/content/content-block.tsx +68 -2
  191. package/src/content/embed-block.tsx +78 -0
  192. package/src/content/file-upload-zone.tsx +11 -6
  193. package/src/content/index.ts +9 -0
  194. package/src/content/types.ts +46 -0
  195. package/src/curriculum/course-card.tsx +199 -0
  196. package/src/curriculum/curriculum-item.tsx +9 -5
  197. package/src/curriculum/curriculum-tree.tsx +20 -13
  198. package/src/curriculum/index.ts +2 -0
  199. package/src/curriculum/types.ts +2 -2
  200. package/src/feedback/feedback-banner.tsx +12 -14
  201. package/src/flashcards/flashcard-deck.tsx +1 -9
  202. package/src/flashcards/flashcard.tsx +29 -9
  203. package/src/index.ts +3 -0
  204. package/src/license/HydraContext.tsx +62 -0
  205. package/src/license/ProBadge.tsx +43 -0
  206. package/src/license/index.ts +7 -0
  207. package/src/license/tiers.ts +24 -0
  208. package/src/license/useHydraLicense.ts +10 -0
  209. package/src/license/validate.ts +90 -0
  210. package/src/license/withProGate.tsx +21 -0
  211. package/src/modules/AssignmentModule/AssignmentModule.tsx +314 -0
  212. package/src/modules/AssignmentModule/types.ts +77 -0
  213. package/src/modules/CertificateModule/CertificateModule.tsx +173 -0
  214. package/src/modules/CertificateModule/types.ts +49 -0
  215. package/src/modules/CourseCatalogModule/CourseCatalogModule.tsx +126 -0
  216. package/src/modules/CourseCatalogModule/types.ts +47 -0
  217. package/src/modules/CoursePlayer/CoursePlayer.tsx +80 -69
  218. package/src/modules/DiscussionModule/DiscussionModule.tsx +145 -0
  219. package/src/modules/DiscussionModule/types.ts +54 -0
  220. package/src/modules/ExamModule/ExamModule.tsx +151 -0
  221. package/src/modules/ExamModule/types.ts +57 -0
  222. package/src/modules/FlashcardLab/FlashcardLab.tsx +39 -21
  223. package/src/modules/FlashcardLab/types.ts +2 -0
  224. package/src/modules/GradeCenterModule/GradeCenterModule.tsx +174 -0
  225. package/src/modules/GradeCenterModule/types.ts +65 -0
  226. package/src/modules/QuizModule/QuizModule.tsx +58 -178
  227. package/src/modules/QuizModule/types.ts +10 -15
  228. package/src/modules/StudentDashboardModule/StudentDashboardModule.tsx +117 -0
  229. package/src/modules/StudentDashboardModule/types.ts +56 -0
  230. package/src/modules/StudentProfileModule/StudentProfileModule.tsx +289 -0
  231. package/src/modules/StudentProfileModule/types.ts +45 -0
  232. package/src/modules/SurveyModule/SurveyModule.tsx +185 -0
  233. package/src/modules/SurveyModule/types.ts +53 -0
  234. package/src/modules/_shared/assessment-intro.tsx +75 -0
  235. package/src/modules/_shared/assessment-results.tsx +133 -0
  236. package/src/modules/_shared/types.ts +11 -0
  237. package/src/modules/_shared/use-timer.ts +49 -0
  238. package/src/modules/index.ts +33 -0
  239. package/src/progress/achievement-badge.tsx +52 -0
  240. package/src/progress/activity-timeline.tsx +84 -0
  241. package/src/progress/grade-indicator.tsx +9 -1
  242. package/src/progress/index.ts +7 -0
  243. package/src/progress/progress-ring.tsx +2 -1
  244. package/src/progress/stat-card.tsx +37 -18
  245. package/src/progress/streak-badge.tsx +35 -0
  246. package/src/progress/types.ts +103 -0
  247. package/src/provider/HydraProvider.tsx +15 -6
  248. package/src/questions/choice.tsx +19 -14
  249. package/src/questions/confidence-indicator.tsx +107 -0
  250. package/src/questions/essay.tsx +28 -28
  251. package/src/questions/fill-in-the-blank.tsx +20 -19
  252. package/src/questions/hotspot.tsx +154 -0
  253. package/src/questions/index.ts +18 -0
  254. package/src/questions/inline-choice.tsx +152 -0
  255. package/src/questions/matching.tsx +229 -0
  256. package/src/questions/multiple-choice.tsx +19 -14
  257. package/src/questions/numeric.tsx +106 -0
  258. package/src/questions/ordering.tsx +167 -0
  259. package/src/questions/question-renderer.tsx +24 -2
  260. package/src/questions/scenario.tsx +140 -0
  261. package/src/questions/scoring.ts +201 -0
  262. package/src/questions/spreadsheet.tsx +260 -0
  263. package/src/questions/true-false.tsx +19 -14
  264. package/src/questions/types.ts +123 -1
  265. package/src/questions/use-drag-reorder.ts +80 -0
  266. package/src/sections/AnnouncementFeed/AnnouncementFeed.tsx +66 -23
  267. package/src/sections/AnnouncementFeed/types.ts +15 -1
  268. package/src/sections/AssessmentReview/AssessmentReview.tsx +50 -2
  269. package/src/sections/AssessmentReview/types.ts +6 -0
  270. package/src/sections/AssignmentSubmission/AssignmentSubmission.tsx +44 -6
  271. package/src/sections/AssignmentSubmission/types.ts +6 -0
  272. package/src/sections/CertificateViewer/CertificateViewer.tsx +215 -60
  273. package/src/sections/CertificateViewer/certificate-variants.tsx +170 -0
  274. package/src/sections/CertificateViewer/types.ts +19 -5
  275. package/src/sections/CourseCatalog/CourseCatalog.tsx +220 -0
  276. package/src/sections/CourseCatalog/types.ts +76 -0
  277. package/src/sections/CourseOutline/CourseOutline.tsx +45 -14
  278. package/src/sections/CourseOutline/types.ts +6 -0
  279. package/src/sections/DiscussionThread/DiscussionThread.tsx +55 -11
  280. package/src/sections/DiscussionThread/types.ts +6 -0
  281. package/src/sections/EnrollmentWizard/EnrollmentWizard.tsx +343 -0
  282. package/src/sections/EnrollmentWizard/types.ts +65 -0
  283. package/src/sections/ExamSession/ExamSession.tsx +125 -82
  284. package/src/sections/ExamSession/types.ts +12 -1
  285. package/src/sections/FlashcardStudySession/FlashcardStudySession.tsx +53 -36
  286. package/src/sections/FlashcardStudySession/types.ts +6 -0
  287. package/src/sections/ForumBoard/ForumBoard.tsx +342 -0
  288. package/src/sections/ForumBoard/types.ts +81 -0
  289. package/src/sections/GradebookTable/GradebookTable.tsx +55 -2
  290. package/src/sections/GradebookTable/types.ts +14 -0
  291. package/src/sections/LecturePlayer/LecturePlayer.tsx +63 -37
  292. package/src/sections/LecturePlayer/types.ts +8 -0
  293. package/src/sections/LessonPage/LessonPage.tsx +40 -13
  294. package/src/sections/LessonPage/types.ts +6 -0
  295. package/src/sections/PracticeQuiz/PracticeQuiz.tsx +119 -98
  296. package/src/sections/PracticeQuiz/types.ts +6 -0
  297. package/src/sections/ProgressDashboard/ProgressDashboard.tsx +121 -67
  298. package/src/sections/ProgressDashboard/types.ts +6 -0
  299. package/src/sections/QuizSession/QuizSession.tsx +115 -67
  300. package/src/sections/QuizSession/types.ts +12 -1
  301. package/src/sections/RequirementsChecklist/RequirementsChecklist.tsx +147 -0
  302. package/src/sections/RequirementsChecklist/types.ts +44 -0
  303. package/src/sections/ResourceLibrary/ResourceLibrary.tsx +68 -17
  304. package/src/sections/ResourceLibrary/types.ts +15 -1
  305. package/src/sections/RubricView/RubricView.tsx +174 -0
  306. package/src/sections/RubricView/types.ts +58 -0
  307. package/src/sections/ScrollableQuiz/ScrollableQuiz.tsx +58 -23
  308. package/src/sections/ScrollableQuiz/types.ts +6 -0
  309. package/src/sections/StudentProfile/StudentProfile.tsx +279 -0
  310. package/src/sections/StudentProfile/types.ts +99 -0
  311. package/src/sections/SurveyForm/SurveyForm.tsx +40 -10
  312. package/src/sections/SurveyForm/types.ts +6 -0
  313. package/src/sections/_shared/merge-answers.ts +22 -0
  314. package/src/sections/_shared/section-shell.tsx +64 -0
  315. package/src/sections/_shared/use-assessment-session.ts +125 -0
  316. package/src/sections/index.ts +42 -1
  317. package/src/social/post-card.tsx +8 -19
  318. package/src/social/user-avatar.tsx +10 -5
  319. package/src/styles/globals.css +52 -41
  320. package/src/ui/badge.tsx +8 -0
  321. package/src/ui/drawer.tsx +600 -0
  322. package/src/ui/index.ts +21 -0
  323. package/src/ui/progress.tsx +4 -0
  324. package/src/ui/rich-text-editor.tsx +119 -0
  325. package/src/ui/rich-text-toolbar.tsx +157 -0
  326. package/src/ui/toast.tsx +170 -0
  327. package/src/utils/array-utils.ts +17 -0
  328. package/src/utils/debounce.ts +8 -2
  329. package/src/utils/flatten-leaves.ts +17 -0
  330. package/src/utils/format-file-size.ts +5 -0
  331. package/src/utils/format-timestamp.ts +13 -0
  332. package/src/utils/is-empty-html.ts +7 -0
  333. package/src/utils/pick-palette-color.ts +33 -0
  334. package/src/utils/shuffle.ts +8 -0
  335. package/src/utils/string-utils.ts +30 -0
  336. package/src/video/types.ts +16 -0
  337. package/src/video/video-bookmark.tsx +4 -3
  338. package/src/video/video-chapter-list.tsx +9 -4
  339. package/src/video/video-player.tsx +24 -5
  340. package/src/video/video-playlist-item.tsx +8 -3
  341. package/src/video/video-thumbnail-card.tsx +4 -0
  342. package/src/video/video-transcript.tsx +8 -5
  343. package/dist/table-BrS5cDQu.js +0 -2510
  344. package/dist/table-D6AkBBEo.cjs +0 -1
package/dist/sections.js CHANGED
@@ -1,944 +1,162 @@
1
- import { jsxs as t, jsx as e, Fragment as ee } from "react/jsx-runtime";
2
- import { useState as I, useMemo as j, useRef as ge, useEffect as ie, useCallback as Qe, Fragment as Be } from "react";
3
- import { q as be, C as L, t as Q, X, c as F, ak as oe, w as je, x as $e, r as R, N as _e, B as Ne, Z as V, P as ne, F as Ee, J as He, A as ve, b as we, z as Ve, S as Ye, _ as Je, ad as te, a as ye, D as Ke, Y as Ze, af as J, ah as K, ag as Z, a9 as Se, ab as ke, ac as G, H as ze, R as ue, aj as Ge, U as Xe, a0 as Ce, G as Ue, aa as se, K as me, Q as he, O as We, a1 as Oe, a7 as qe, a8 as le, a6 as Ae, a2 as et, a4 as Y, V as tt, $ as ae } from "./table-BrS5cDQu.js";
4
- import { CheckCircle as W, Clock as De, Check as fe, ChevronRight as nt, List as rt, Grid as st, Download as Te, Pin as lt, MessageSquare as at, Heart as it, Reply as ct, Save as dt, Send as Ie, ArrowUp as ot, ArrowDown as ut, Flame as mt, BookOpen as Fe, Award as Le, Trophy as ht, Printer as ft } from "lucide-react";
5
- function Ct({
6
- questions: r,
7
- initialAnswers: s = [],
8
- onSubmit: a,
9
- onAnswerChange: d,
10
- timeElapsedSeconds: p,
11
- timeLimitSeconds: l,
12
- isSubmitting: h = !1,
13
- readOnly: i = !1,
14
- className: w,
15
- style: y
16
- }) {
17
- const [c, b] = I(0), [T, u] = I(s), [U, N] = I(/* @__PURE__ */ new Set()), z = r[c], x = j(
18
- () => r.map((S, f) => ({
19
- uid: S.uid,
20
- sequence: f + 1,
21
- isFlagged: U.has(S.uid),
22
- isAnswered: T.some((m) => m.uid === S.uid),
23
- isSkipped: !1
24
- })),
25
- [r, T, U]
26
- );
27
- function C(S) {
28
- if (!z) return;
29
- const f = z.uid, m = S.map((v) => ({
30
- uid: f,
31
- answerUid: v.uid,
32
- content: v.content
33
- }));
34
- u((v) => {
35
- const k = [...v.filter((D) => D.uid !== f), ...m];
36
- return d == null || d(k), k;
37
- });
38
- }
39
- function n(S) {
40
- const f = r.findIndex((m) => m.uid === S);
41
- f !== -1 && b(f);
42
- }
43
- function o(S) {
44
- N((f) => {
45
- const m = new Set(f);
46
- return m.has(S) ? m.delete(S) : m.add(S), m;
47
- });
48
- }
49
- function g() {
50
- a(T);
51
- }
52
- return /* @__PURE__ */ t("div", { className: F(w), style: y, children: [
53
- /* @__PURE__ */ e(
54
- be,
55
- {
56
- currentQuestionIndex: c,
57
- totalQuestions: r.length,
58
- hasNext: c < r.length - 1,
59
- hasPrevious: c > 0,
60
- onNext: () => b((S) => Math.min(S + 1, r.length - 1)),
61
- onPrevious: () => b((S) => Math.max(S - 1, 0)),
62
- onSubmit: g,
63
- timeElapsedSeconds: p,
64
- timeLimitSeconds: l,
65
- questions: x,
66
- onNavigateToQuestion: n,
67
- onToggleFlag: o,
68
- currentQuestionUid: z == null ? void 0 : z.uid,
69
- isSubmitting: h,
70
- readOnly: i
71
- }
72
- ),
73
- z && /* @__PURE__ */ e(L, { className: "mt-3", children: /* @__PURE__ */ e(Q, { className: "pt-6", children: /* @__PURE__ */ e(
74
- X,
75
- {
76
- question: z,
77
- sessionAnswers: T.filter(
78
- (S) => S.uid === z.uid
79
- ),
80
- onAnswer: C,
81
- readOnly: i
82
- }
83
- ) }) })
84
- ] });
85
- }
86
- function Ut({
87
- video: r,
88
- notes: s,
89
- layout: a = "horizontal",
90
- notesPanelWidth: d = "340px",
91
- notesPanelHeight: p = "240px",
92
- className: l,
93
- style: h
94
- }) {
95
- const i = a === "horizontal";
96
- return s ? /* @__PURE__ */ t(
97
- "div",
98
- {
99
- className: F(
100
- "flex overflow-hidden",
101
- i ? "flex-row" : "flex-col",
102
- l
103
- ),
104
- style: h,
105
- children: [
106
- /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 min-h-0", children: /* @__PURE__ */ e(oe, { ...r }) }),
107
- /* @__PURE__ */ t(
108
- L,
109
- {
110
- className: F(
111
- "overflow-auto shrink-0 rounded-none border-0",
112
- i ? "border-l border-border" : "border-t border-border w-full"
113
- ),
114
- style: {
115
- width: i ? d : void 0,
116
- height: i ? void 0 : p
117
- },
118
- children: [
119
- /* @__PURE__ */ e(je, { children: /* @__PURE__ */ e($e, { children: "Notes" }) }),
120
- /* @__PURE__ */ e(Q, { children: typeof s == "string" ? /* @__PURE__ */ e("span", { className: "text-sm text-foreground", children: s }) : s })
121
- ]
122
- }
123
- )
124
- ]
125
- }
126
- ) : /* @__PURE__ */ e("div", { className: l, style: h, children: /* @__PURE__ */ e(oe, { ...r }) });
127
- }
128
- function At({
129
- cards: r,
130
- title: s,
131
- description: a,
132
- shuffled: d = !1,
133
- onComplete: p,
134
- readOnly: l = !1,
135
- className: h,
136
- style: i
1
+ import { m as q, S as ee } from "./StudentProfile-DeMxdrL3.js";
2
+ import { A as Se, a as Ae, b as Te, C as Ce, c as ze, d as Le, D as Qe, E as Me, e as ke, F as Ee, f as Ie, G as je, L as Ue, g as Fe, P as Be, h as De, Q as Pe, R as Ve, i as _e, j as Ge, k as We } from "./StudentProfile-DeMxdrL3.js";
3
+ import { jsx as e, jsxs as a, Fragment as te } from "react/jsx-runtime";
4
+ import { useState as L, useRef as K, useMemo as j, useEffect as se, useCallback as O } from "react";
5
+ import { c as f, C as U, x as Y, ao as ie, as as ae, v as z, at as Q, a1 as $, ar as ne, aN as _, aP as G, aO as W, aI as le, aK as re, aL as H, ac as J, a_ as R, ai as de } from "./tabs-BuY1iNJE.js";
6
+ import { AlertCircle as oe, List as ce, Grid as me, Download as ue } from "lucide-react";
7
+ const he = [];
8
+ function ve({
9
+ questions: l,
10
+ initialAnswers: N = [],
11
+ onSubmit: r,
12
+ onAnswerChange: y,
13
+ showNavigator: F = !0,
14
+ showQuestionNumbers: B = !0,
15
+ questionGroups: b,
16
+ isSubmitting: M = !1,
17
+ readOnly: h = !1,
18
+ isLoading: D,
19
+ error: k,
20
+ onRetry: E,
21
+ className: o,
22
+ style: p
137
23
  }) {
138
- const [w, y] = I(!1), c = {
139
- totalCards: r.length,
140
- wasShuffled: d
141
- };
142
- function b() {
143
- y(!0), p == null || p(c);
144
- }
145
- function T() {
146
- y(!1);
147
- }
148
- return w ? /* @__PURE__ */ e("div", { className: F("flex flex-col items-center", h), style: i, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ t(Q, { className: "pt-6 text-center flex flex-col items-center gap-2", children: [
149
- /* @__PURE__ */ e(W, { size: 48, className: "text-success" }),
150
- /* @__PURE__ */ e("span", { className: "text-xl font-bold text-foreground", children: "Deck complete!" }),
151
- s && /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: [
152
- "You finished ",
153
- /* @__PURE__ */ e("strong", { children: s })
154
- ] }),
155
- /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
156
- c.totalCards,
157
- " card",
158
- c.totalCards !== 1 ? "s" : "",
159
- " studied",
160
- c.wasShuffled ? " (shuffled)" : ""
161
- ] }),
162
- /* @__PURE__ */ e(R, { className: "mt-2", onClick: T, children: "Study Again" })
163
- ] }) }) }) : /* @__PURE__ */ e("div", { className: F("flex flex-col items-center", h), style: i, children: /* @__PURE__ */ e(
164
- _e,
165
- {
166
- cards: r,
167
- deckName: s,
168
- deckDescription: a,
169
- shuffled: d,
170
- showProgress: !0,
171
- onComplete: b,
172
- readOnly: l
24
+ var d;
25
+ const [S, x] = L(N), [A, T] = L(((d = l[0]) == null ? void 0 : d.uid) ?? null), m = K(/* @__PURE__ */ new Map()), g = j(() => {
26
+ const s = /* @__PURE__ */ new Map();
27
+ for (const i of S) {
28
+ const n = s.get(i.uid);
29
+ n ? n.push(i) : s.set(i.uid, [i]);
173
30
  }
174
- ) });
175
- }
176
- function pt({
177
- score: r
178
- }) {
179
- const s = r.percentage !== void 0 ? r.percentage : r.total > 0 ? Math.round(r.correct / r.total * 100) : 0;
180
- return /* @__PURE__ */ e(L, { className: "mb-3", children: /* @__PURE__ */ e(Q, { className: "pt-6", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
181
- /* @__PURE__ */ t("div", { children: [
182
- /* @__PURE__ */ t("span", { className: "text-2xl font-bold leading-none text-foreground", children: [
183
- s,
184
- "%"
185
- ] }),
186
- /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
187
- r.correct,
188
- " of ",
189
- r.total,
190
- " correct"
191
- ] })
192
- ] }),
193
- r.passed !== void 0 && /* @__PURE__ */ e(Ne, { variant: r.passed ? "success" : "destructive", children: r.passed ? "Passed" : "Failed" }),
194
- r.passingScore !== void 0 && /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
195
- "Passing score: ",
196
- r.passingScore,
197
- "%"
198
- ] })
199
- ] }) }) });
200
- }
201
- function ce({
202
- questions: r,
203
- sessionAnswers: s,
204
- showCorrectAnswers: a
205
- }) {
206
- return /* @__PURE__ */ e("div", { className: "flex flex-col gap-3", children: r.map((d, p) => /* @__PURE__ */ t(L, { className: "overflow-hidden", children: [
207
- /* @__PURE__ */ e("div", { className: "px-2 py-1 bg-muted", children: /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground font-semibold", children: [
208
- "Question ",
209
- p + 1
210
- ] }) }),
211
- /* @__PURE__ */ e(V, {}),
212
- /* @__PURE__ */ e(Q, { className: "pt-4 pb-4", children: /* @__PURE__ */ e(
213
- X,
214
- {
215
- question: d,
216
- sessionAnswers: s.filter((l) => l.uid === d.uid),
217
- readOnly: !0,
218
- showCorrectAnswers: a
219
- }
220
- ) })
221
- ] }, d.uid)) });
222
- }
223
- function xt(r, s, a, d) {
224
- const p = new Map(r.map((i) => [i.uid, i])), l = new Set(a.flatMap((i) => i.questionUids)), h = r.filter((i) => !l.has(i.uid));
225
- return /* @__PURE__ */ t("div", { className: "flex flex-col gap-4", children: [
226
- a.map((i) => {
227
- const w = i.questionUids.map((y) => p.get(y)).filter(Boolean);
228
- return /* @__PURE__ */ t("div", { children: [
229
- /* @__PURE__ */ e("span", { className: "uppercase text-xs tracking-wide text-muted-foreground font-semibold", children: i.label }),
230
- /* @__PURE__ */ e(V, { className: "mb-2" }),
231
- /* @__PURE__ */ e(
232
- ce,
233
- {
234
- questions: w,
235
- sessionAnswers: s,
236
- showCorrectAnswers: d
237
- }
238
- )
239
- ] }, i.label);
240
- }),
241
- h.length > 0 && /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
242
- ce,
243
- {
244
- questions: h,
245
- sessionAnswers: s,
246
- showCorrectAnswers: d
247
- }
248
- ) })
249
- ] });
250
- }
251
- function Dt({
252
- questions: r,
253
- sessionAnswers: s,
254
- score: a,
255
- questionGroups: d,
256
- showCorrectAnswers: p = !0,
257
- className: l,
258
- style: h
259
- }) {
260
- return /* @__PURE__ */ t("div", { className: F(l), style: h, children: [
261
- a && /* @__PURE__ */ e(pt, { score: a }),
262
- d && d.length > 0 ? xt(r, s, d, p) : /* @__PURE__ */ e(
263
- ce,
264
- {
265
- questions: r,
266
- sessionAnswers: s,
267
- showCorrectAnswers: p
268
- }
269
- )
270
- ] });
271
- }
272
- function Me(r) {
273
- const s = [];
274
- for (const a of r)
275
- !a.children || a.children.length === 0 ? s.push(a.uid) : s.push(...Me(a.children));
276
- return s;
277
- }
278
- function Tt({
279
- items: r,
280
- progress: s,
281
- courseTitle: a,
282
- activeItemUid: d,
283
- onItemClick: p,
284
- showOverallProgress: l = !0,
285
- showDuration: h = !0,
286
- showIcons: i = !0,
287
- readOnly: w = !1,
288
- className: y,
289
- style: c
290
- }) {
291
- const { completedCount: b, totalCount: T, percentage: u } = j(() => {
292
- const U = Me(r), N = U.length, z = s ? U.filter(
293
- (x) => s.some((C) => C.resourceUid === x && C.isCompleted)
294
- ).length : 0;
295
- return {
296
- completedCount: z,
297
- totalCount: N,
298
- percentage: N > 0 ? Math.round(z / N * 100) : 0
299
- };
300
- }, [r, s]);
301
- return /* @__PURE__ */ t("div", { className: F(y), style: c, children: [
302
- (a || l) && /* @__PURE__ */ t("div", { className: "px-2 pt-2 pb-1", children: [
303
- a && /* @__PURE__ */ e("p", { className: F("font-semibold text-sm text-foreground", l && "mb-1"), children: a }),
304
- l && /* @__PURE__ */ t("div", { children: [
305
- /* @__PURE__ */ e(ne, { value: u, size: "sm" }),
306
- /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground mt-0.5 block", children: [
307
- b,
308
- " of ",
309
- T,
310
- " completed"
311
- ] })
312
- ] })
313
- ] }),
314
- /* @__PURE__ */ e(
315
- Ee,
316
- {
317
- items: r,
318
- progress: s,
319
- activeItemUid: d,
320
- onItemClick: p,
321
- readOnly: w,
322
- showDuration: h,
323
- showIcons: i,
324
- showProgress: !0
325
- }
326
- )
327
- ] });
328
- }
329
- function It({
330
- questions: r,
331
- initialAnswers: s = [],
332
- onSubmit: a,
333
- onAnswerChange: d,
334
- showNavigator: p = !0,
335
- showQuestionNumbers: l = !0,
336
- questionGroups: h,
337
- isSubmitting: i = !1,
338
- readOnly: w = !1,
339
- className: y,
340
- style: c
341
- }) {
342
- var S;
343
- const [b, T] = I(s), [u, U] = I(((S = r[0]) == null ? void 0 : S.uid) ?? null), N = ge(/* @__PURE__ */ new Map()), z = j(() => {
344
- const f = new Set(b.map((m) => m.uid));
345
- return r.filter((m) => f.has(m.uid)).length;
346
- }, [r, b]);
347
- ie(() => {
348
- const f = new IntersectionObserver(
349
- (m) => {
350
- for (const v of m)
351
- v.isIntersecting && U(v.target.getAttribute("data-question-uid"));
31
+ return s;
32
+ }, [S]), v = j(
33
+ () => l.filter((s) => g.has(s.uid)).length,
34
+ [l, g]
35
+ );
36
+ se(() => {
37
+ const s = new IntersectionObserver(
38
+ (i) => {
39
+ for (const n of i)
40
+ n.isIntersecting && T(n.target.getAttribute("data-question-uid"));
352
41
  },
353
42
  { rootMargin: "-20% 0px -60% 0px" }
354
43
  );
355
- return N.current.forEach((m) => f.observe(m)), () => f.disconnect();
356
- }, [r]);
357
- const x = Qe((f, m) => {
358
- m ? N.current.set(f, m) : N.current.delete(f);
359
- }, []);
360
- function C(f, m) {
361
- const v = m.map((A) => ({
362
- uid: f,
363
- answerUid: A.uid,
364
- content: A.content
365
- }));
366
- T((A) => {
367
- const D = [...A.filter((P) => P.uid !== f), ...v];
368
- return d == null || d(D), D;
369
- });
370
- }
371
- function n(f) {
372
- var m;
373
- (m = N.current.get(f)) == null || m.scrollIntoView({ behavior: "smooth", block: "center" });
44
+ return m.current.forEach((i) => s.observe(i)), () => s.disconnect();
45
+ }, [l]);
46
+ const P = O((s, i) => {
47
+ i ? m.current.set(s, i) : m.current.delete(s);
48
+ }, []), w = K(y);
49
+ w.current = y;
50
+ const I = O(
51
+ (s, i) => {
52
+ x(
53
+ (n) => q(n, s, i, w.current)
54
+ );
55
+ },
56
+ []
57
+ );
58
+ function u(s) {
59
+ var i;
60
+ (i = m.current.get(s)) == null || i.scrollIntoView({ behavior: "smooth", block: "center" });
374
61
  }
375
- const o = j(() => {
376
- if (!h) return [{ label: null, questions: r }];
377
- const f = h.map(
378
- (A) => ({
379
- label: A.label,
380
- questions: A.questionUids.map((k) => r.find((D) => D.uid === k)).filter(Boolean)
62
+ const V = j(() => {
63
+ if (!b) return [{ label: null, questions: l }];
64
+ const s = b.map(
65
+ (c) => ({
66
+ label: c.label,
67
+ questions: c.questionUids.map((C) => l.find((Z) => Z.uid === C)).filter(Boolean)
381
68
  })
382
- ), m = new Set(h.flatMap((A) => A.questionUids)), v = r.filter((A) => !m.has(A.uid));
383
- return v.length > 0 && f.push({ label: null, questions: v }), f;
384
- }, [r, h]);
385
- let g = 0;
386
- return /* @__PURE__ */ t("div", { className: F("flex gap-3", y), style: c, children: [
387
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
388
- o.map((f, m) => /* @__PURE__ */ t("div", { children: [
389
- f.label && /* @__PURE__ */ e("p", { className: F("text-lg font-semibold mb-2 text-foreground", m > 0 && "mt-4"), children: f.label }),
390
- f.questions.map((v) => {
391
- const A = g++;
392
- return /* @__PURE__ */ e(
393
- L,
394
- {
395
- ref: (k) => x(v.uid, k),
396
- "data-question-uid": v.uid,
397
- className: "mb-2",
398
- children: /* @__PURE__ */ t(Q, { className: "pt-6", children: [
399
- l && /* @__PURE__ */ t("p", { className: "font-semibold text-sm text-muted-foreground mb-1", children: [
400
- "Question ",
401
- A + 1
402
- ] }),
403
- /* @__PURE__ */ e(
404
- X,
405
- {
406
- question: v,
407
- sessionAnswers: b.filter((k) => k.uid === v.uid),
408
- onAnswer: (k) => C(v.uid, k),
409
- readOnly: w
410
- }
411
- )
412
- ] })
413
- },
414
- v.uid
415
- );
416
- })
417
- ] }, m)),
418
- /* @__PURE__ */ t("div", { className: "mt-3 flex justify-between items-center", children: [
419
- /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
420
- z,
421
- " of ",
422
- r.length,
423
- " answered"
424
- ] }),
425
- /* @__PURE__ */ e(
426
- R,
427
- {
428
- onClick: () => a(b),
429
- disabled: i || w,
430
- children: i ? "Submitting..." : "Submit"
431
- }
432
- )
433
- ] })
434
- ] }),
435
- p && /* @__PURE__ */ t(L, { className: "hidden md:block w-50 shrink-0 sticky top-4 self-start p-3", children: [
436
- /* @__PURE__ */ e("p", { className: "font-semibold text-sm mb-1 text-foreground", children: "Questions" }),
437
- /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: r.map((f, m) => {
438
- const v = b.some((k) => k.uid === f.uid), A = u === f.uid;
439
- return /* @__PURE__ */ e(
440
- "button",
441
- {
442
- type: "button",
443
- className: F(
444
- "inline-flex items-center justify-center text-xs font-medium min-w-9 px-1 py-0.5 rounded-full cursor-pointer border transition-colors",
445
- A ? "bg-primary border-primary text-primary-foreground" : v ? "border-success text-success bg-transparent" : "border-border text-foreground bg-transparent hover:bg-muted"
446
- ),
447
- onClick: () => n(f.uid),
448
- children: m + 1
449
- },
450
- f.uid
451
- );
452
- }) })
453
- ] })
454
- ] });
455
- }
456
- function gt(r) {
457
- const s = [...r];
458
- for (let a = s.length - 1; a > 0; a--) {
459
- const d = Math.floor(Math.random() * (a + 1));
460
- [s[a], s[d]] = [s[d], s[a]];
461
- }
462
- return s;
463
- }
464
- function Ft({
465
- questions: r,
466
- instantFeedback: s = !0,
467
- allowRetry: a = !0,
468
- onComplete: d,
469
- shuffled: p = !1,
470
- readOnly: l = !1,
471
- className: h,
472
- style: i
473
- }) {
474
- const w = j(
475
- () => p ? gt(r) : r,
476
- // eslint-disable-next-line react-hooks/exhaustive-deps
477
- [r, p]
478
- ), [y, c] = I(0), [b, T] = I(/* @__PURE__ */ new Set()), [u, U] = I(/* @__PURE__ */ new Map()), [N, z] = I(/* @__PURE__ */ new Set()), [x, C] = I(null), [n, o] = I(!1), g = w[y], S = g ? b.has(g.uid) : !1;
479
- function f() {
480
- var O;
481
- if (!g || !x) return;
482
- const k = (u.get(g.uid) ?? 0) + 1;
483
- U((B) => new Map(B).set(g.uid, k)), T((B) => new Set(B).add(g.uid));
484
- const D = new Set(
485
- ((O = g.answers) == null ? void 0 : O.filter((B) => B.isCorrect).map((B) => B.uid)) ?? []
486
- ), P = new Set(x.map((B) => B.uid));
487
- D.size === P.size && [...D].every((B) => P.has(B)) && k === 1 && z((B) => new Set(B).add(g.uid));
488
- }
489
- function m() {
490
- g && (T((k) => {
491
- const D = new Set(k);
492
- return D.delete(g.uid), D;
493
- }), C(null));
494
- }
495
- function v() {
496
- if (y < w.length - 1)
497
- c((k) => k + 1), C(null);
498
- else {
499
- const k = {
500
- totalQuestions: w.length,
501
- correctOnFirstAttempt: N.size,
502
- totalAttempts: Array.from(u.values()).reduce((D, P) => D + P, 0)
503
- };
504
- o(!0), d == null || d(k);
505
- }
506
- }
507
- const A = j(() => {
508
- var P;
509
- if (!g || !x) return !1;
510
- const k = new Set(
511
- ((P = g.answers) == null ? void 0 : P.filter(($) => $.isCorrect).map(($) => $.uid)) ?? []
512
- ), D = new Set(x.map(($) => $.uid));
513
- return k.size === D.size && [...k].every(($) => D.has($));
514
- }, [g, x]);
515
- if (n) {
516
- const k = w.length > 0 ? Math.round(N.size / w.length * 100) : 0;
517
- return /* @__PURE__ */ e(L, { className: h, style: i, children: /* @__PURE__ */ t(Q, { className: "pt-6 text-center", children: [
518
- /* @__PURE__ */ e(W, { size: 48, className: "text-success mx-auto mb-4" }),
519
- /* @__PURE__ */ e("p", { className: "text-xl font-bold mb-1 text-foreground", children: "Practice Complete!" }),
520
- /* @__PURE__ */ t("p", { className: "text-muted-foreground mb-2", children: [
521
- N.size,
522
- " of ",
523
- w.length,
524
- " correct on first attempt (",
525
- k,
526
- "%)"
527
- ] }),
528
- /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
529
- R,
530
- {
531
- variant: "outline",
532
- onClick: () => {
533
- c(0), T(/* @__PURE__ */ new Set()), U(/* @__PURE__ */ new Map()), z(/* @__PURE__ */ new Set()), C(null), o(!1);
534
- },
535
- children: "Practice Again"
536
- }
537
- ) })
538
- ] }) });
539
- }
540
- return /* @__PURE__ */ t("div", { className: h, style: i, children: [
541
- /* @__PURE__ */ t("div", { className: "flex justify-between items-center mb-2", children: [
542
- /* @__PURE__ */ t("span", { className: "font-semibold text-sm text-foreground", children: [
543
- "Question ",
544
- y + 1,
545
- " of ",
546
- w.length
69
+ ), i = new Set(b.flatMap((c) => c.questionUids)), n = l.filter((c) => !i.has(c.uid));
70
+ return n.length > 0 && s.push({ label: null, questions: n }), s;
71
+ }, [l, b]);
72
+ let t = 0;
73
+ return /* @__PURE__ */ e(
74
+ ee,
75
+ {
76
+ isLoading: D,
77
+ error: k,
78
+ onRetry: E,
79
+ className: o,
80
+ style: p,
81
+ skeleton: /* @__PURE__ */ a(te, { children: [
82
+ /* @__PURE__ */ e(Q, { className: "h-32 w-full" }),
83
+ /* @__PURE__ */ e(Q, { className: "h-32 w-full" }),
84
+ /* @__PURE__ */ e(Q, { className: "h-32 w-full" })
547
85
  ] }),
548
- /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: [
549
- N.size,
550
- " correct on first try"
551
- ] })
552
- ] }),
553
- /* @__PURE__ */ e(
554
- ne,
555
- {
556
- value: y + (S ? 1 : 0),
557
- max: w.length,
558
- size: "sm",
559
- className: "mb-3"
560
- }
561
- ),
562
- g && /* @__PURE__ */ e(L, { children: /* @__PURE__ */ t(Q, { className: "pt-6", children: [
563
- /* @__PURE__ */ e(
564
- X,
565
- {
566
- question: g,
567
- sessionAnswers: (x == null ? void 0 : x.map((k) => ({
568
- uid: g.uid,
569
- answerUid: k.uid,
570
- content: k.content
571
- }))) ?? [],
572
- onAnswer: (k) => C(k),
573
- readOnly: l || S,
574
- showCorrectAnswers: S
575
- }
576
- ),
577
- s && S && /* @__PURE__ */ e(
578
- He,
579
- {
580
- isCorrect: A,
581
- explanation: g.explanation,
582
- onRetry: a && !A ? m : void 0
583
- }
584
- ),
585
- /* @__PURE__ */ t("div", { className: "flex justify-end gap-2 mt-2", children: [
586
- !S && s && /* @__PURE__ */ e(
587
- R,
588
- {
589
- onClick: f,
590
- disabled: !x || x.length === 0 || l,
591
- children: "Check Answer"
592
- }
593
- ),
594
- (!s || S) && /* @__PURE__ */ e(
595
- R,
596
- {
597
- onClick: v,
598
- disabled: l,
599
- children: y < w.length - 1 ? "Next Question" : "Finish"
600
- }
601
- )
602
- ] })
603
- ] }) })
604
- ] });
605
- }
606
- function Lt({
607
- questions: r,
608
- initialAnswers: s = [],
609
- onSubmit: a,
610
- onAnswerChange: d,
611
- timeLimitSeconds: p,
612
- timeElapsedSeconds: l,
613
- autoSubmitOnTimeout: h = !0,
614
- timeWarningThreshold: i = 300,
615
- allowBackNavigation: w = !0,
616
- confirmBeforeSubmit: y = !0,
617
- examTitle: c,
618
- instructions: b,
619
- isSubmitting: T = !1,
620
- readOnly: u = !1,
621
- className: U,
622
- style: N
623
- }) {
624
- const [z, x] = I(0), [C, n] = I(s), [o, g] = I(/* @__PURE__ */ new Set()), [S, f] = I(!1), [m, v] = I(!1), A = ge(!1), k = r[z], D = p - l;
625
- ie(() => {
626
- D <= i && D > 0 && v(!0);
627
- }, [D, i]), ie(() => {
628
- h && D <= 0 && !A.current && (A.current = !0, re(!0));
629
- }, [D, h]);
630
- const P = j(
631
- () => r.map((M, E) => ({
632
- uid: M.uid,
633
- sequence: E + 1,
634
- isFlagged: o.has(M.uid),
635
- isAnswered: C.some((_) => _.uid === M.uid),
636
- isSkipped: !1
637
- })),
638
- [r, C, o]
639
- );
640
- function $(M) {
641
- if (!k) return;
642
- const E = k.uid, _ = M.map((H) => ({
643
- uid: E,
644
- answerUid: H.uid,
645
- content: H.content
646
- }));
647
- n((H) => {
648
- const de = [...H.filter((Pe) => Pe.uid !== E), ..._];
649
- return d == null || d(de), de;
650
- });
651
- }
652
- function O(M) {
653
- const E = r.findIndex((_) => _.uid === M);
654
- E !== -1 && x(E);
655
- }
656
- function B(M) {
657
- g((E) => {
658
- const _ = new Set(E);
659
- return _.has(M) ? _.delete(M) : _.add(M), _;
660
- });
661
- }
662
- function Re() {
663
- y ? f(!0) : re(!1);
664
- }
665
- function re(M) {
666
- const E = new Set(C.map((H) => H.uid)), _ = {
667
- timeElapsedSeconds: l,
668
- wasAutoSubmitted: M,
669
- answeredCount: r.filter((H) => E.has(H.uid)).length,
670
- totalQuestions: r.length
671
- };
672
- a(C, _);
673
- }
674
- return /* @__PURE__ */ t("div", { className: F(U), style: N, children: [
675
- c && /* @__PURE__ */ e("p", { className: "text-xl font-bold mb-2 text-foreground", children: c }),
676
- m && D > 0 && D <= i && /* @__PURE__ */ e(ve, { variant: "warning", className: "mb-2", children: /* @__PURE__ */ t(we, { children: [
677
- Math.ceil(D / 60),
678
- " minute",
679
- Math.ceil(D / 60) !== 1 ? "s" : "",
680
- " remaining"
681
- ] }) }),
682
- /* @__PURE__ */ e(
683
- be,
684
- {
685
- currentQuestionIndex: z,
686
- totalQuestions: r.length,
687
- hasNext: z < r.length - 1,
688
- hasPrevious: w && z > 0,
689
- onNext: () => x((M) => Math.min(M + 1, r.length - 1)),
690
- onPrevious: () => w && x((M) => Math.max(M - 1, 0)),
691
- onSubmit: Re,
692
- timeElapsedSeconds: l,
693
- timeLimitSeconds: p,
694
- questions: P,
695
- onNavigateToQuestion: O,
696
- onToggleFlag: B,
697
- currentQuestionUid: k == null ? void 0 : k.uid,
698
- isSubmitting: T,
699
- readOnly: u
700
- }
701
- ),
702
- b && z === 0 && /* @__PURE__ */ e(L, { className: "mt-3", children: /* @__PURE__ */ e(Q, { className: "pt-6", children: b }) }),
703
- k && /* @__PURE__ */ e(L, { className: "mt-3", children: /* @__PURE__ */ e(Q, { className: "pt-6", children: /* @__PURE__ */ e(
704
- X,
705
- {
706
- question: k,
707
- sessionAnswers: C.filter((M) => M.uid === k.uid),
708
- onAnswer: $,
709
- readOnly: u
710
- }
711
- ) }) }),
712
- /* @__PURE__ */ e(
713
- Ve,
714
- {
715
- open: S,
716
- title: "Submit Exam?",
717
- message: `You have answered ${P.filter((M) => M.isAnswered).length} of ${r.length} questions. Once submitted, you cannot change your answers.`,
718
- confirmLabel: "Submit Exam",
719
- cancelLabel: "Continue Exam",
720
- confirmColor: "primary",
721
- onConfirm: () => {
722
- f(!1), re(!1);
723
- },
724
- onCancel: () => f(!1),
725
- isLoading: T
726
- }
727
- )
728
- ] });
729
- }
730
- function Mt({
731
- title: r,
732
- description: s,
733
- questions: a,
734
- initialAnswers: d = [],
735
- onSubmit: p,
736
- onAnswerChange: l,
737
- showProgress: h = !0,
738
- requireAll: i = !1,
739
- submitLabel: w = "Submit Survey",
740
- isSubmitting: y = !1,
741
- readOnly: c = !1,
742
- className: b,
743
- style: T
744
- }) {
745
- const [u, U] = I(d), N = j(() => {
746
- const n = new Set(u.map((o) => o.questionUid));
747
- return a.filter((o) => n.has(o.uid)).length;
748
- }, [a, u]), z = !i || N === a.length;
749
- function x(n, o) {
750
- U((g) => {
751
- const f = [...g.filter((m) => m.questionUid !== n), { questionUid: n, value: o }];
752
- return l == null || l(f), f;
753
- });
754
- }
755
- function C(n) {
756
- return u.find((o) => o.questionUid === n);
757
- }
758
- return /* @__PURE__ */ t("div", { className: b, style: T, children: [
759
- /* @__PURE__ */ e("p", { className: "text-xl font-bold text-foreground mb-2", children: r }),
760
- s && /* @__PURE__ */ e("div", { className: "mb-2 text-muted-foreground text-sm", children: typeof s == "string" ? /* @__PURE__ */ e("span", { children: s }) : s }),
761
- h && /* @__PURE__ */ t("div", { className: "mb-3", children: [
762
- /* @__PURE__ */ e(ne, { value: N / a.length * 100 }),
763
- /* @__PURE__ */ t("span", { className: "block text-xs text-muted-foreground mt-0.5", children: [
764
- N,
765
- " of ",
766
- a.length,
767
- " answered"
768
- ] })
769
- ] }),
770
- a.map((n, o) => {
771
- var S, f;
772
- const g = C(n.uid);
773
- return /* @__PURE__ */ e(L, { className: "mb-2", children: /* @__PURE__ */ t(Q, { className: "pt-6", children: [
774
- /* @__PURE__ */ t("p", { className: "font-medium text-foreground mb-2", children: [
775
- o + 1,
776
- ". ",
777
- n.content,
778
- n.required && /* @__PURE__ */ e("span", { className: "text-destructive ml-0.5", children: "*" })
779
- ] }),
780
- n.type === "likert" && /* @__PURE__ */ e(
781
- Ye,
782
- {
783
- value: g ? Number(g.value) : null,
784
- onChange: (m) => x(n.uid, m),
785
- points: n.scalePoints,
786
- lowLabel: (S = n.scaleLabels) == null ? void 0 : S.low,
787
- highLabel: (f = n.scaleLabels) == null ? void 0 : f.high,
788
- readOnly: c
789
- }
790
- ),
791
- n.type === "rating" && /* @__PURE__ */ e(
792
- Je,
793
- {
794
- value: g ? Number(g.value) : 0,
795
- onChange: (m) => x(n.uid, m),
796
- readOnly: c
797
- }
798
- ),
799
- n.type === "open_text" && /* @__PURE__ */ e(
800
- te,
801
- {
802
- placeholder: "Type your response...",
803
- value: (g == null ? void 0 : g.value) ?? "",
804
- onChange: (m) => x(n.uid, m.target.value),
805
- disabled: c,
806
- className: "min-h-24"
807
- }
808
- ),
809
- n.type === "choice" && n.answers && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: n.answers.map((m) => /* @__PURE__ */ t("label", { className: "flex items-center gap-2 cursor-pointer py-1 text-sm text-foreground has-[input:disabled]:cursor-default has-[input:disabled]:opacity-60", children: [
810
- /* @__PURE__ */ e(
811
- "input",
812
- {
813
- type: "radio",
814
- className: "accent-primary m-0 shrink-0",
815
- name: `survey-q-${n.uid}`,
816
- value: m.uid,
817
- checked: (g == null ? void 0 : g.value) === m.uid,
818
- onChange: () => x(n.uid, m.uid),
819
- disabled: c
820
- }
821
- ),
822
- /* @__PURE__ */ e("span", { children: m.content })
823
- ] }, m.uid)) }),
824
- n.type === "multiple_choice" && n.answers && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: n.answers.map((m) => {
825
- const v = u.filter((A) => A.questionUid === n.uid).map((A) => String(A.value));
826
- return /* @__PURE__ */ t("label", { className: "flex items-center gap-2 cursor-pointer py-1 text-sm text-foreground has-[input:disabled]:cursor-default has-[input:disabled]:opacity-60", children: [
86
+ children: /* @__PURE__ */ a("div", { className: "flex gap-3", children: [
87
+ /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
88
+ V.map((s, i) => /* @__PURE__ */ a("div", { children: [
89
+ s.label && /* @__PURE__ */ e("p", { className: f("text-lg font-semibold mb-2 text-foreground", i > 0 && "mt-4"), children: s.label }),
90
+ s.questions.map((n) => {
91
+ const c = t++;
92
+ return /* @__PURE__ */ e(
93
+ U,
94
+ {
95
+ ref: (C) => P(n.uid, C),
96
+ "data-question-uid": n.uid,
97
+ className: "mb-2",
98
+ children: /* @__PURE__ */ a(Y, { className: "pt-6", children: [
99
+ B && /* @__PURE__ */ a("p", { className: "font-semibold text-sm text-muted-foreground mb-1", children: [
100
+ "Question ",
101
+ c + 1
102
+ ] }),
103
+ /* @__PURE__ */ e(
104
+ ie,
105
+ {
106
+ question: n,
107
+ sessionAnswers: g.get(n.uid) ?? he,
108
+ onAnswer: (C) => I(n.uid, C),
109
+ readOnly: h
110
+ }
111
+ )
112
+ ] })
113
+ },
114
+ n.uid
115
+ );
116
+ })
117
+ ] }, s.label ?? `ungrouped-${i}`)),
118
+ /* @__PURE__ */ e(ae, { className: "my-3" }),
119
+ /* @__PURE__ */ a("div", { className: "flex justify-between items-center", children: [
120
+ /* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
121
+ v,
122
+ " of ",
123
+ l.length,
124
+ " answered"
125
+ ] }),
827
126
  /* @__PURE__ */ e(
828
- "input",
127
+ z,
829
128
  {
830
- type: "checkbox",
831
- className: "accent-primary m-0 shrink-0",
832
- checked: v.includes(m.uid),
833
- disabled: c,
834
- onChange: (A) => {
835
- const k = u.filter((P) => P.questionUid === n.uid);
836
- let D;
837
- A.target.checked ? D = [...k, { questionUid: n.uid, value: m.uid }] : D = k.filter((P) => String(P.value) !== m.uid), U((P) => [
838
- ...P.filter(($) => $.questionUid !== n.uid),
839
- ...D
840
- ]), l == null || l([
841
- ...u.filter((P) => P.questionUid !== n.uid),
842
- ...D
843
- ]);
844
- }
129
+ onClick: () => r(S),
130
+ disabled: M || h,
131
+ children: M ? "Submitting..." : "Submit"
845
132
  }
846
- ),
847
- /* @__PURE__ */ e("span", { children: m.content })
848
- ] }, m.uid);
849
- }) })
850
- ] }) }, n.uid);
851
- }),
852
- /* @__PURE__ */ t("div", { className: "flex justify-between items-center mt-3", children: [
853
- /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
854
- N,
855
- " of ",
856
- a.length,
857
- " answered"
858
- ] }),
859
- /* @__PURE__ */ e(
860
- R,
861
- {
862
- onClick: () => p(u),
863
- disabled: !z || y || c,
864
- children: y ? "Submitting..." : w
865
- }
866
- )
867
- ] })
868
- ] });
869
- }
870
- function Rt({
871
- title: r,
872
- blocks: s,
873
- isCompleted: a = !1,
874
- onMarkComplete: d,
875
- onNextLesson: p,
876
- nextLessonTitle: l,
877
- estimatedDuration: h,
878
- showDuration: i = !0,
879
- readOnly: w = !1,
880
- className: y,
881
- style: c
882
- }) {
883
- const [b, T] = I(a), [, u] = I(/* @__PURE__ */ new Map());
884
- function U(z, x) {
885
- u((C) => new Map(C).set(z, x));
886
- }
887
- function N() {
888
- T(!0), d == null || d();
889
- }
890
- return /* @__PURE__ */ t("div", { className: F(y), style: c, children: [
891
- /* @__PURE__ */ t("div", { className: "mb-3", children: [
892
- /* @__PURE__ */ e("p", { className: "text-2xl font-bold mb-0.5 text-foreground", children: r }),
893
- i && h != null && /* @__PURE__ */ t("div", { className: "flex items-center gap-0.5 text-muted-foreground", children: [
894
- /* @__PURE__ */ e(De, { size: 16 }),
895
- /* @__PURE__ */ e("span", { className: "text-sm", children: ye(h) })
133
+ )
134
+ ] })
135
+ ] }),
136
+ F && /* @__PURE__ */ e(U, { className: "hidden md:block w-50 shrink-0 sticky top-4 self-start", children: /* @__PURE__ */ a(Y, { className: "p-3", children: [
137
+ /* @__PURE__ */ e("p", { className: "font-semibold text-sm mb-1 text-foreground", children: "Questions" }),
138
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: l.map((s, i) => {
139
+ const n = g.has(s.uid), c = A === s.uid;
140
+ return /* @__PURE__ */ e(
141
+ "button",
142
+ {
143
+ type: "button",
144
+ className: f(
145
+ "inline-flex items-center justify-center text-xs font-medium min-w-9 px-1 py-0.5 rounded-full cursor-pointer border transition-colors",
146
+ c ? "bg-primary border-primary text-primary-foreground" : n ? "border-success text-success bg-transparent" : "border-border text-foreground bg-transparent hover:bg-muted"
147
+ ),
148
+ onClick: () => u(s.uid),
149
+ children: i + 1
150
+ },
151
+ s.uid
152
+ );
153
+ }) })
154
+ ] }) })
896
155
  ] })
897
- ] }),
898
- /* @__PURE__ */ e(V, { className: "mb-3" }),
899
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-3", children: s.map((z, x) => /* @__PURE__ */ e(
900
- Ke,
901
- {
902
- block: z,
903
- onQuestionAnswer: U,
904
- readOnly: w
905
- },
906
- x
907
- )) }),
908
- /* @__PURE__ */ e("div", { className: "border border-border rounded-md px-4 py-3 mt-4 sticky bottom-0 bg-background z-10", children: /* @__PURE__ */ t("div", { className: "flex justify-between items-center", children: [
909
- b ? /* @__PURE__ */ t("div", { className: "flex items-center gap-1 text-success", children: [
910
- /* @__PURE__ */ e(fe, { size: 20 }),
911
- /* @__PURE__ */ e("span", { className: "text-sm font-semibold", children: "Lesson Complete" })
912
- ] }) : /* @__PURE__ */ t(
913
- R,
914
- {
915
- onClick: N,
916
- disabled: w,
917
- children: [
918
- /* @__PURE__ */ e(fe, { size: 18 }),
919
- " Mark Complete"
920
- ]
921
- }
922
- ),
923
- p && /* @__PURE__ */ t(
924
- R,
925
- {
926
- variant: b ? "default" : "outline",
927
- onClick: p,
928
- children: [
929
- l ? `Next: ${l}` : "Next Lesson",
930
- " ",
931
- /* @__PURE__ */ e(nt, { size: 18 })
932
- ]
933
- }
934
- )
935
- ] }) })
936
- ] });
937
- }
938
- function pe(r) {
939
- return r < 1024 ? `${r} B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(1)} KB` : `${(r / (1024 * 1024)).toFixed(1)} MB`;
156
+ }
157
+ );
940
158
  }
941
- const xe = {
159
+ const X = {
942
160
  pdf: "document",
943
161
  document: "document",
944
162
  video: "video",
@@ -947,922 +165,200 @@ const xe = {
947
165
  archive: "document",
948
166
  other: "document"
949
167
  };
950
- function Pt({
951
- resources: r,
952
- categories: s,
953
- onResourceClick: a,
954
- onDownload: d,
955
- viewMode: p = "list",
956
- allowViewToggle: l = !0,
957
- showSearch: h = !0,
958
- emptyMessage: i = "No resources found",
959
- readOnly: w = !1,
960
- className: y,
961
- style: c
168
+ function we({
169
+ resources: l,
170
+ categories: N,
171
+ onResourceClick: r,
172
+ onDownload: y,
173
+ viewMode: F = "list",
174
+ allowViewToggle: B = !0,
175
+ showSearch: b = !0,
176
+ emptyMessage: M = "No resources found",
177
+ readOnly: h = !1,
178
+ isLoading: D,
179
+ error: k,
180
+ onRetry: E,
181
+ pageSize: o,
182
+ currentPage: p = 1,
183
+ totalItems: S,
184
+ onPageChange: x,
185
+ className: A,
186
+ style: T
962
187
  }) {
963
- const [b, T] = I(""), [u, U] = I(null), [N, z] = I(p), x = j(() => {
964
- let n = r;
965
- if (u && (n = n.filter((o) => o.categoryUid === u)), b.trim()) {
966
- const o = b.toLowerCase();
967
- n = n.filter(
968
- (g) => {
969
- var S;
970
- return g.name.toLowerCase().includes(o) || ((S = g.description) == null ? void 0 : S.toLowerCase().includes(o));
188
+ const [m, g] = L(""), [v, P] = L(null), [w, I] = L(F), u = j(() => {
189
+ let t = l;
190
+ if (v && (t = t.filter((d) => d.categoryUid === v)), m.trim()) {
191
+ const d = m.toLowerCase();
192
+ t = t.filter(
193
+ (s) => {
194
+ var i;
195
+ return s.name.toLowerCase().includes(d) || ((i = s.description) == null ? void 0 : i.toLowerCase().includes(d));
971
196
  }
972
197
  );
973
198
  }
974
- return n;
975
- }, [r, u, b]);
976
- function C(n) {
977
- const o = xe[n.type] ?? "document";
978
- return /* @__PURE__ */ t(
199
+ return t;
200
+ }, [l, v, m]);
201
+ if (D)
202
+ return /* @__PURE__ */ a("div", { className: f("space-y-4", A), style: T, children: [
203
+ /* @__PURE__ */ e(Q, { className: "h-9 w-full" }),
204
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-4", children: Array.from({ length: 6 }).map((t, d) => /* @__PURE__ */ e(Q, { className: "h-32 w-full rounded-lg" }, d)) })
205
+ ] });
206
+ if (k)
207
+ return /* @__PURE__ */ e("div", { className: f("py-12", A), style: T, children: /* @__PURE__ */ e(
208
+ $,
209
+ {
210
+ icon: /* @__PURE__ */ e(oe, { className: "size-10 text-destructive" }),
211
+ title: "Something went wrong",
212
+ description: k,
213
+ action: E ? /* @__PURE__ */ e(z, { variant: "outline", onClick: E, children: "Retry" }) : void 0
214
+ }
215
+ ) });
216
+ function V(t) {
217
+ const d = X[t.type] ?? "document";
218
+ return /* @__PURE__ */ a(
979
219
  "div",
980
220
  {
981
- className: F(
221
+ className: f(
982
222
  "flex items-center gap-3 px-3 py-2",
983
- !w && "cursor-pointer hover:bg-muted",
984
- w && "opacity-70"
223
+ !h && r && "cursor-pointer hover:bg-muted",
224
+ (h || !r) && "opacity-70"
985
225
  ),
986
- onClick: () => !w && a(n),
226
+ onClick: () => !h && (r == null ? void 0 : r(t)),
987
227
  children: [
988
- /* @__PURE__ */ e("div", { className: "min-w-10", children: /* @__PURE__ */ e(ue, { type: o, size: 20 }) }),
989
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
990
- /* @__PURE__ */ e("span", { className: "text-sm text-foreground", children: n.name }),
991
- (n.description || n.fileSize != null) && /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: [
992
- n.description,
993
- n.fileSize != null && pe(n.fileSize)
228
+ /* @__PURE__ */ e("div", { className: "min-w-10", children: /* @__PURE__ */ e(J, { type: d, size: 20 }) }),
229
+ /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
230
+ /* @__PURE__ */ e("span", { className: "text-sm text-foreground", children: t.name }),
231
+ (t.description || t.fileSize != null) && /* @__PURE__ */ e("span", { className: "block text-xs text-muted-foreground", children: [
232
+ t.description,
233
+ t.fileSize != null && R(t.fileSize)
994
234
  ].filter(Boolean).join(" · ") })
995
235
  ] }),
996
- d && /* @__PURE__ */ t(J, { children: [
997
- /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(
998
- R,
236
+ y && /* @__PURE__ */ a(_, { children: [
237
+ /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
238
+ z,
999
239
  {
1000
240
  variant: "ghost",
1001
241
  size: "icon-xs",
1002
242
  "aria-label": "Download",
1003
- onClick: (g) => {
1004
- g.stopPropagation(), d(n);
243
+ onClick: (s) => {
244
+ s.stopPropagation(), y(t);
1005
245
  },
1006
- children: /* @__PURE__ */ e(Te, { size: 16 })
246
+ children: /* @__PURE__ */ e(ue, { size: 16 })
1007
247
  }
1008
248
  ) }),
1009
- /* @__PURE__ */ e(Z, { children: "Download" })
249
+ /* @__PURE__ */ e(W, { children: "Download" })
1010
250
  ] })
1011
251
  ]
1012
252
  },
1013
- n.uid
253
+ t.uid
1014
254
  );
1015
255
  }
1016
- return /* @__PURE__ */ t("div", { className: y, style: c, children: [
1017
- /* @__PURE__ */ t("div", { className: "flex gap-2 items-center mb-2", children: [
1018
- h && /* @__PURE__ */ e("div", { className: "flex-1 max-w-80", children: /* @__PURE__ */ e(
1019
- Ze,
256
+ return /* @__PURE__ */ a("div", { className: A, style: T, children: [
257
+ /* @__PURE__ */ a("div", { className: "flex gap-2 items-center mb-2", children: [
258
+ b && /* @__PURE__ */ e("div", { className: "flex-1 max-w-80", children: /* @__PURE__ */ e(
259
+ ne,
1020
260
  {
1021
- value: b,
1022
- onChange: T,
261
+ value: m,
262
+ onChange: g,
1023
263
  placeholder: "Search resources...",
1024
264
  size: "small"
1025
265
  }
1026
266
  ) }),
1027
- l && /* @__PURE__ */ t("div", { className: "flex gap-0.5", children: [
1028
- /* @__PURE__ */ t(J, { children: [
1029
- /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(
1030
- R,
267
+ B && /* @__PURE__ */ a("div", { className: "flex gap-0.5", children: [
268
+ /* @__PURE__ */ a(_, { children: [
269
+ /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
270
+ z,
1031
271
  {
1032
272
  variant: "ghost",
1033
273
  size: "icon-xs",
1034
274
  "aria-label": "List view",
1035
- className: F(N === "list" && "text-primary"),
1036
- onClick: () => z("list"),
1037
- children: /* @__PURE__ */ e(rt, { size: 18 })
275
+ className: f(w === "list" && "text-primary"),
276
+ onClick: () => I("list"),
277
+ children: /* @__PURE__ */ e(ce, { size: 18 })
1038
278
  }
1039
279
  ) }),
1040
- /* @__PURE__ */ e(Z, { children: "List view" })
280
+ /* @__PURE__ */ e(W, { children: "List view" })
1041
281
  ] }),
1042
- /* @__PURE__ */ t(J, { children: [
1043
- /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(
1044
- R,
282
+ /* @__PURE__ */ a(_, { children: [
283
+ /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
284
+ z,
1045
285
  {
1046
286
  variant: "ghost",
1047
287
  size: "icon-xs",
1048
288
  "aria-label": "Grid view",
1049
- className: F(N === "grid" && "text-primary"),
1050
- onClick: () => z("grid"),
1051
- children: /* @__PURE__ */ e(st, { size: 18 })
289
+ className: f(w === "grid" && "text-primary"),
290
+ onClick: () => I("grid"),
291
+ children: /* @__PURE__ */ e(me, { size: 18 })
1052
292
  }
1053
293
  ) }),
1054
- /* @__PURE__ */ e(Z, { children: "Grid view" })
294
+ /* @__PURE__ */ e(W, { children: "Grid view" })
1055
295
  ] })
1056
296
  ] })
1057
297
  ] }),
1058
- s && s.length > 0 && /* @__PURE__ */ e(
1059
- Se,
298
+ N && N.length > 0 && /* @__PURE__ */ e(
299
+ le,
1060
300
  {
1061
- value: u ?? "all",
1062
- onValueChange: (n) => U(n === "all" ? null : n),
301
+ value: v ?? "all",
302
+ onValueChange: (t) => P(t === "all" ? null : t),
1063
303
  className: "mb-2",
1064
- children: /* @__PURE__ */ t(ke, { children: [
1065
- /* @__PURE__ */ e(G, { value: "all", children: "All" }),
1066
- s.map((n) => /* @__PURE__ */ e(G, { value: n.uid, children: n.label }, n.uid))
304
+ children: /* @__PURE__ */ a(re, { children: [
305
+ /* @__PURE__ */ e(H, { value: "all", children: "All" }),
306
+ N.map((t) => /* @__PURE__ */ e(H, { value: t.uid, children: t.label }, t.uid))
1067
307
  ] })
1068
308
  }
1069
309
  ),
1070
- x.length === 0 ? /* @__PURE__ */ e(ze, { title: i, description: "Try adjusting your search or filter." }) : N === "list" ? /* @__PURE__ */ e(L, { children: x.map(C) }) : /* @__PURE__ */ e("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2", children: x.map((n) => /* @__PURE__ */ e(
1071
- L,
310
+ u.length === 0 ? /* @__PURE__ */ e($, { title: M, description: "Try adjusting your search or filter." }) : w === "list" ? /* @__PURE__ */ e(U, { children: (x && o ? u.slice((p - 1) * o, p * o) : u).map(V) }) : /* @__PURE__ */ e("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2", children: (x && o ? u.slice((p - 1) * o, p * o) : u).map((t) => /* @__PURE__ */ e(
311
+ U,
1072
312
  {
1073
- className: F(
313
+ className: f(
1074
314
  "transition-colors",
1075
- !w && "cursor-pointer hover:border-primary"
315
+ !h && r && "cursor-pointer hover:border-primary"
1076
316
  ),
1077
- onClick: () => !w && a(n),
1078
- children: /* @__PURE__ */ t(Q, { className: "pt-4 pb-4", children: [
1079
- /* @__PURE__ */ t("div", { className: "flex gap-1 items-center mb-1", children: [
1080
- /* @__PURE__ */ e(ue, { type: xe[n.type] ?? "document", size: 20 }),
1081
- /* @__PURE__ */ e("span", { className: "font-semibold text-sm text-foreground truncate", children: n.name })
317
+ onClick: () => !h && (r == null ? void 0 : r(t)),
318
+ children: /* @__PURE__ */ a(Y, { className: "pt-4 pb-4", children: [
319
+ /* @__PURE__ */ a("div", { className: "flex gap-1 items-center mb-1", children: [
320
+ /* @__PURE__ */ e(J, { type: X[t.type] ?? "document", size: 20 }),
321
+ /* @__PURE__ */ e("span", { className: "font-semibold text-sm text-foreground truncate", children: t.name })
1082
322
  ] }),
1083
- n.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-1 truncate", children: n.description }),
1084
- n.fileSize != null && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: pe(n.fileSize) })
323
+ t.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-1 truncate", children: t.description }),
324
+ t.fileSize != null && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: R(t.fileSize) })
1085
325
  ] })
1086
326
  },
1087
- n.uid
1088
- )) })
1089
- ] });
1090
- }
1091
- function bt(r) {
1092
- const s = new Date(r), d = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), p = Math.floor(d / 6e4);
1093
- if (p < 1) return "Just now";
1094
- if (p < 60) return `${p}m ago`;
1095
- const l = Math.floor(p / 60);
1096
- if (l < 24) return `${l}h ago`;
1097
- const h = Math.floor(l / 24);
1098
- return h < 7 ? `${h}d ago` : s.toLocaleDateString();
1099
- }
1100
- function Qt({
1101
- announcements: r,
1102
- onMarkRead: s,
1103
- onSelect: a,
1104
- showAvatars: d = !0,
1105
- previewLines: p = 3,
1106
- emptyMessage: l = "No announcements yet",
1107
- readOnly: h = !1,
1108
- className: i,
1109
- style: w
1110
- }) {
1111
- const [y, c] = I(/* @__PURE__ */ new Set()), b = j(() => {
1112
- const u = r.filter((N) => N.isPinned), U = r.filter((N) => !N.isPinned);
1113
- return [...u, ...U];
1114
- }, [r]);
1115
- function T(u) {
1116
- c((N) => {
1117
- const z = new Set(N);
1118
- return z.has(u) ? z.delete(u) : z.add(u), z;
1119
- });
1120
- const U = r.find((N) => N.uid === u);
1121
- U && !U.isRead && (s == null || s(u));
1122
- }
1123
- return b.length === 0 ? /* @__PURE__ */ e("div", { className: i, style: w, children: /* @__PURE__ */ e(ze, { title: l }) }) : /* @__PURE__ */ e("div", { className: F("flex flex-col gap-2", i), style: w, children: b.map((u) => {
1124
- const U = y.has(u.uid);
1125
- return /* @__PURE__ */ e(
1126
- L,
1127
- {
1128
- className: F(
1129
- u.isRead && "opacity-85",
1130
- a && "cursor-pointer",
1131
- u.isPinned && "border-l-4 border-l-warning"
1132
- ),
1133
- onClick: () => a && !h ? a(u) : T(u.uid),
1134
- children: /* @__PURE__ */ e(Q, { className: "pt-4 pb-4", children: /* @__PURE__ */ t("div", { className: "flex gap-1.5 items-start", children: [
1135
- d && /* @__PURE__ */ e(
1136
- Ge,
1137
- {
1138
- displayName: u.author.displayName,
1139
- avatarUrl: u.author.avatarUrl,
1140
- role: u.author.role,
1141
- size: "medium"
1142
- }
1143
- ),
1144
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
1145
- /* @__PURE__ */ t("div", { className: "flex items-center gap-1 mb-0.5", children: [
1146
- u.isPinned && /* @__PURE__ */ e(lt, { size: 14 }),
1147
- /* @__PURE__ */ e(
1148
- "span",
1149
- {
1150
- className: F("text-foreground", u.isRead ? "font-normal" : "font-semibold"),
1151
- children: u.title
1152
- }
1153
- ),
1154
- !u.isRead && /* @__PURE__ */ e(Ne, { variant: "destructive", className: "text-[10px] px-1.5 py-0", children: "New" })
1155
- ] }),
1156
- /* @__PURE__ */ t("span", { className: "block text-xs text-muted-foreground mb-1", children: [
1157
- u.author.displayName,
1158
- " · ",
1159
- bt(u.createdAt)
1160
- ] }),
1161
- /* @__PURE__ */ e(
1162
- "span",
1163
- {
1164
- className: F(
1165
- "text-sm text-foreground",
1166
- !U && "line-clamp-(--preview-lines) overflow-hidden"
1167
- ),
1168
- style: U ? void 0 : { "--preview-lines": p },
1169
- children: u.content
1170
- }
1171
- ),
1172
- !U && u.content.length > 200 && /* @__PURE__ */ e(
1173
- R,
1174
- {
1175
- variant: "link",
1176
- size: "xs",
1177
- className: "px-0 mt-0.5 h-auto",
1178
- onClick: (N) => {
1179
- N.stopPropagation(), T(u.uid);
1180
- },
1181
- children: "Read more"
1182
- }
1183
- )
1184
- ] })
1185
- ] }) })
1186
- },
1187
- u.uid
1188
- );
1189
- }) });
1190
- }
1191
- function Bt({
1192
- title: r,
1193
- rootPost: s,
1194
- replies: a,
1195
- currentUser: d,
1196
- onReply: p,
1197
- onToggleLike: l,
1198
- onMarkAnswer: h,
1199
- maxDepth: i = 3,
1200
- allowReplies: w = !0,
1201
- sortOrder: y = "oldest",
1202
- readOnly: c = !1,
1203
- className: b,
1204
- style: T
1205
- }) {
1206
- const [u, U] = I(null), [N, z] = I(""), x = j(() => {
1207
- const o = /* @__PURE__ */ new Map();
1208
- for (const g of a) {
1209
- const S = g.parentUid ?? s.uid, f = o.get(S) ?? [];
1210
- f.push(g), o.set(S, f);
1211
- }
1212
- for (const [, g] of o)
1213
- g.sort((S, f) => y === "newest" ? new Date(f.createdAt).getTime() - new Date(S.createdAt).getTime() : y === "most_liked" ? f.likeCount - S.likeCount : new Date(S.createdAt).getTime() - new Date(f.createdAt).getTime());
1214
- return o;
1215
- }, [a, s.uid, y]);
1216
- function C(o) {
1217
- N.trim() && (p(o, N.trim()), z(""), U(null));
1218
- }
1219
- function n(o, g) {
1220
- const S = x.get(o.uid) ?? [], f = Math.min(g, i), m = /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
1221
- l && !c && /* @__PURE__ */ t(J, { children: [
1222
- /* @__PURE__ */ e(K, { children: /* @__PURE__ */ t(
1223
- R,
1224
- {
1225
- variant: "ghost",
1226
- size: "sm",
1227
- "aria-label": o.isLikedByCurrentUser ? "Unlike" : "Like",
1228
- className: F(o.isLikedByCurrentUser && "text-destructive"),
1229
- onClick: () => l(o.uid),
1230
- children: [
1231
- /* @__PURE__ */ e(it, { size: 14, fill: o.isLikedByCurrentUser ? "currentColor" : "none" }),
1232
- o.likeCount > 0 ? o.likeCount : "Like"
1233
- ]
1234
- }
1235
- ) }),
1236
- /* @__PURE__ */ e(Z, { children: o.isLikedByCurrentUser ? "Unlike" : "Like" })
1237
- ] }),
1238
- w && !c && /* @__PURE__ */ t(J, { children: [
1239
- /* @__PURE__ */ e(K, { children: /* @__PURE__ */ t(
1240
- R,
1241
- {
1242
- variant: "ghost",
1243
- size: "sm",
1244
- "aria-label": "Reply",
1245
- onClick: () => U(o.uid),
1246
- children: [
1247
- /* @__PURE__ */ e(ct, { size: 14 }),
1248
- "Reply"
1249
- ]
1250
- }
1251
- ) }),
1252
- /* @__PURE__ */ e(Z, { children: "Reply" })
1253
- ] }),
1254
- h && !c && d.role !== "student" && !o.isAnswer && /* @__PURE__ */ t(J, { children: [
1255
- /* @__PURE__ */ e(K, { children: /* @__PURE__ */ t(
1256
- R,
1257
- {
1258
- variant: "ghost",
1259
- size: "sm",
1260
- "aria-label": "Mark as answer",
1261
- className: "text-success",
1262
- onClick: () => h(o.uid),
1263
- children: [
1264
- /* @__PURE__ */ e(W, { size: 14 }),
1265
- "Mark Answer"
1266
- ]
1267
- }
1268
- ) }),
1269
- /* @__PURE__ */ e(Z, { children: "Mark as answer" })
1270
- ] })
1271
- ] });
1272
- return /* @__PURE__ */ t("div", { children: [
1273
- /* @__PURE__ */ e(
1274
- Xe,
1275
- {
1276
- author: o.author,
1277
- content: o.content,
1278
- createdAt: o.createdAt,
1279
- updatedAt: o.updatedAt,
1280
- actions: m,
1281
- highlight: o.isAnswer ? "answer" : "none",
1282
- indentLevel: f,
1283
- className: "mb-2"
1284
- }
1285
- ),
1286
- u === o.uid && /* @__PURE__ */ e(
1287
- L,
1288
- {
1289
- className: "mb-2",
1290
- style: { marginLeft: `${(f + 1) * 16}px` },
1291
- children: /* @__PURE__ */ t(Q, { className: "pt-4 pb-4", children: [
1292
- /* @__PURE__ */ e(
1293
- te,
1294
- {
1295
- className: "min-h-15 mb-2",
1296
- placeholder: "Write a reply...",
1297
- value: N,
1298
- onChange: (v) => z(v.target.value)
1299
- }
1300
- ),
1301
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
1302
- /* @__PURE__ */ e(
1303
- R,
1304
- {
1305
- size: "sm",
1306
- onClick: () => C(o.uid),
1307
- disabled: !N.trim(),
1308
- children: "Post Reply"
1309
- }
1310
- ),
1311
- /* @__PURE__ */ e(
1312
- R,
1313
- {
1314
- variant: "ghost",
1315
- size: "sm",
1316
- onClick: () => {
1317
- U(null), z("");
1318
- },
1319
- children: "Cancel"
1320
- }
1321
- )
1322
- ] })
1323
- ] })
1324
- }
1325
- ),
1326
- S.map((v) => n(v, g + 1))
1327
- ] }, o.uid);
1328
- }
1329
- return /* @__PURE__ */ t("div", { className: b, style: T, children: [
1330
- /* @__PURE__ */ t("div", { className: "flex items-center gap-1 mb-2", children: [
1331
- /* @__PURE__ */ e(at, { size: 20, className: "text-foreground shrink-0" }),
1332
- /* @__PURE__ */ e("span", { className: "text-lg font-semibold text-foreground", children: r }),
1333
- /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
1334
- a.length,
1335
- " ",
1336
- a.length === 1 ? "reply" : "replies"
1337
- ] })
1338
- ] }),
1339
- /* @__PURE__ */ e(V, { className: "mb-2" }),
1340
- n(s, 0)
1341
- ] });
1342
- }
1343
- function jt({
1344
- title: r,
1345
- instructions: s,
1346
- dueDate: a,
1347
- maxScore: d,
1348
- status: p,
1349
- submissionTypes: l,
1350
- existingSubmission: h,
1351
- fileConstraints: i,
1352
- onSubmit: w,
1353
- onSaveDraft: y,
1354
- grade: c,
1355
- isSubmitting: b = !1,
1356
- readOnly: T = !1,
1357
- className: u,
1358
- style: U
1359
- }) {
1360
- const [N, z] = I((h == null ? void 0 : h.textContent) ?? ""), [x, C] = I((h == null ? void 0 : h.files) ?? []), [n, o] = I((h == null ? void 0 : h.url) ?? ""), [g, S] = I(l[0]), f = !T && !["submitted", "graded"].includes(p);
1361
- function m() {
1362
- return {
1363
- textContent: l.includes("text") ? N : void 0,
1364
- files: l.includes("file") ? x : void 0,
1365
- url: l.includes("url") ? n : void 0
1366
- };
1367
- }
1368
- return /* @__PURE__ */ t("div", { className: u, style: U, children: [
1369
- /* @__PURE__ */ e("div", { className: "flex justify-between items-start mb-2", children: /* @__PURE__ */ t("div", { children: [
1370
- /* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground mb-0.5", children: r }),
1371
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
1372
- /* @__PURE__ */ e(Ce, { status: p }),
1373
- a && /* @__PURE__ */ e(Ue, { dueDate: a, size: "small" }),
1374
- d != null && /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
1375
- d,
1376
- " points"
1377
- ] })
1378
- ] })
1379
- ] }) }),
1380
- /* @__PURE__ */ e(L, { className: "mb-3", children: /* @__PURE__ */ t(Q, { className: "pt-6", children: [
1381
- /* @__PURE__ */ e("div", { className: "font-semibold text-sm text-foreground mb-1", children: "Instructions" }),
1382
- /* @__PURE__ */ e("div", { className: "text-muted-foreground text-sm", children: typeof s == "string" ? /* @__PURE__ */ e("span", { children: s }) : s })
1383
- ] }) }),
1384
- c && /* @__PURE__ */ e(ve, { variant: "success", className: "mb-3", children: /* @__PURE__ */ t(we, { children: [
1385
- /* @__PURE__ */ t("div", { className: "font-semibold text-sm mb-1", children: [
1386
- "Grade: ",
1387
- c.score,
1388
- d != null ? ` / ${d}` : ""
1389
- ] }),
1390
- c.feedback && /* @__PURE__ */ e("div", { children: c.feedback })
1391
- ] }) }),
1392
- f && /* @__PURE__ */ t(ee, { children: [
1393
- l.length > 1 ? /* @__PURE__ */ t(Se, { value: g, onValueChange: (v) => S(v), children: [
1394
- /* @__PURE__ */ t(ke, { children: [
1395
- l.includes("text") && /* @__PURE__ */ e(G, { value: "text", children: "Text" }),
1396
- l.includes("file") && /* @__PURE__ */ e(G, { value: "file", children: "File Upload" }),
1397
- l.includes("url") && /* @__PURE__ */ e(G, { value: "url", children: "URL" })
1398
- ] }),
1399
- l.includes("text") && /* @__PURE__ */ e(se, { value: "text", children: /* @__PURE__ */ e(
1400
- te,
1401
- {
1402
- className: "min-h-45",
1403
- placeholder: "Type your submission...",
1404
- value: N,
1405
- onChange: (v) => z(v.target.value)
1406
- }
1407
- ) }),
1408
- l.includes("file") && /* @__PURE__ */ e(se, { value: "file", children: /* @__PURE__ */ e(
1409
- me,
1410
- {
1411
- files: x,
1412
- onFilesAdded: (v) => C((A) => [...A, ...v]),
1413
- onFileRemove: (v) => C((A) => A.filter((k, D) => D !== v)),
1414
- accept: i == null ? void 0 : i.acceptedTypes,
1415
- maxFiles: i == null ? void 0 : i.maxFiles,
1416
- maxSizeMB: i == null ? void 0 : i.maxSizeMB
1417
- }
1418
- ) }),
1419
- l.includes("url") && /* @__PURE__ */ e(se, { value: "url", children: /* @__PURE__ */ e(
1420
- he,
1421
- {
1422
- placeholder: "https://...",
1423
- value: n,
1424
- onChange: (v) => o(v.target.value)
1425
- }
1426
- ) })
1427
- ] }) : /* @__PURE__ */ t(ee, { children: [
1428
- l.includes("text") && /* @__PURE__ */ e(
1429
- te,
1430
- {
1431
- className: "min-h-45 mb-2",
1432
- placeholder: "Type your submission...",
1433
- value: N,
1434
- onChange: (v) => z(v.target.value)
1435
- }
1436
- ),
1437
- l.includes("file") && /* @__PURE__ */ e("div", { className: "mb-2", children: /* @__PURE__ */ e(
1438
- me,
1439
- {
1440
- files: x,
1441
- onFilesAdded: (v) => C((A) => [...A, ...v]),
1442
- onFileRemove: (v) => C((A) => A.filter((k, D) => D !== v)),
1443
- accept: i == null ? void 0 : i.acceptedTypes,
1444
- maxFiles: i == null ? void 0 : i.maxFiles,
1445
- maxSizeMB: i == null ? void 0 : i.maxSizeMB
1446
- }
1447
- ) }),
1448
- l.includes("url") && /* @__PURE__ */ e(
1449
- he,
1450
- {
1451
- className: "mb-2",
1452
- placeholder: "https://...",
1453
- value: n,
1454
- onChange: (v) => o(v.target.value)
1455
- }
1456
- )
1457
- ] }),
1458
- /* @__PURE__ */ e(V, { className: "my-2" }),
1459
- /* @__PURE__ */ t("div", { className: "flex gap-2 justify-end", children: [
1460
- y && /* @__PURE__ */ t(
1461
- R,
1462
- {
1463
- variant: "outline",
1464
- onClick: () => y(m()),
1465
- disabled: b,
1466
- children: [
1467
- /* @__PURE__ */ e(dt, { size: 16 }),
1468
- "Save Draft"
1469
- ]
1470
- }
1471
- ),
1472
- /* @__PURE__ */ t(
1473
- R,
1474
- {
1475
- onClick: () => w(m()),
1476
- disabled: b,
1477
- children: [
1478
- /* @__PURE__ */ e(Ie, { size: 16 }),
1479
- b ? "Submitting..." : "Submit"
1480
- ]
1481
- }
1482
- )
1483
- ] })
1484
- ] })
1485
- ] });
1486
- }
1487
- function q({
1488
- label: r,
1489
- field: s,
1490
- sortField: a,
1491
- sortDir: d,
1492
- onSort: p,
1493
- textAlign: l
1494
- }) {
1495
- const h = a === s;
1496
- return /* @__PURE__ */ e(
1497
- Ae,
1498
- {
1499
- className: F(
1500
- "cursor-pointer select-none hover:bg-muted",
1501
- l === "right" && "text-right"
1502
- ),
1503
- onClick: () => p(s),
1504
- children: /* @__PURE__ */ t("div", { className: F("flex items-center gap-1", l === "right" && "justify-end"), children: [
1505
- /* @__PURE__ */ e("span", { className: F(h ? "text-foreground" : "text-muted-foreground"), children: r }),
1506
- h && (d === "asc" ? /* @__PURE__ */ e(ot, { size: 14 }) : /* @__PURE__ */ e(ut, { size: 14 }))
1507
- ] })
1508
- }
1509
- );
1510
- }
1511
- function $t({
1512
- items: r,
1513
- categories: s,
1514
- overallGrade: a,
1515
- showWeights: d = !0,
1516
- showCategoryTotals: p = !0,
1517
- onItemClick: l,
1518
- readOnly: h = !1,
1519
- className: i,
1520
- style: w
1521
- }) {
1522
- const [y, c] = I("dueDate"), [b, T] = I("asc");
1523
- function u(x) {
1524
- y === x ? T((C) => C === "asc" ? "desc" : "asc") : (c(x), T("asc"));
1525
- }
1526
- const U = j(() => {
1527
- const x = [...r];
1528
- return x.sort((C, n) => {
1529
- let o = 0;
1530
- switch (y) {
1531
- case "name":
1532
- o = C.name.localeCompare(n.name);
1533
- break;
1534
- case "score":
1535
- o = (C.score ?? -1) - (n.score ?? -1);
1536
- break;
1537
- case "dueDate":
1538
- o = (C.dueDate ?? "").localeCompare(n.dueDate ?? "");
1539
- break;
1540
- case "status":
1541
- o = C.status.localeCompare(n.status);
1542
- break;
1543
- }
1544
- return b === "asc" ? o : -o;
1545
- }), x;
1546
- }, [r, y, b]), N = j(() => {
1547
- if (!s || s.length === 0) return [{ category: null, items: U }];
1548
- const x = s.map((n) => ({
1549
- category: n,
1550
- items: U.filter((o) => o.categoryUid === n.uid)
1551
- })), C = U.filter((n) => !n.categoryUid);
1552
- return C.length > 0 && x.push({ category: null, items: C }), x;
1553
- }, [U, s]), z = d ? 5 : 4;
1554
- return /* @__PURE__ */ t("div", { className: i, style: w, children: [
1555
- a && /* @__PURE__ */ e(L, { className: "mb-3", children: /* @__PURE__ */ e(Q, { className: "pt-6", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
1556
- /* @__PURE__ */ e(
1557
- We,
1558
- {
1559
- percentage: a.percentage,
1560
- letterGrade: a.letterGrade,
1561
- size: "large",
1562
- passingThreshold: 60
1563
- }
1564
- ),
1565
- /* @__PURE__ */ t("div", { children: [
1566
- /* @__PURE__ */ e("div", { className: "text-lg font-semibold text-foreground", children: "Overall Grade" }),
1567
- /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
1568
- a.pointsEarned,
1569
- " / ",
1570
- a.pointsPossible,
1571
- " points"
1572
- ] })
1573
- ] })
1574
- ] }) }) }),
1575
- /* @__PURE__ */ e(L, { children: /* @__PURE__ */ t(Oe, { children: [
1576
- /* @__PURE__ */ e(qe, { children: /* @__PURE__ */ t(le, { children: [
1577
- /* @__PURE__ */ e(
1578
- q,
1579
- {
1580
- label: "Assignment",
1581
- field: "name",
1582
- sortField: y,
1583
- sortDir: b,
1584
- onSort: u
1585
- }
1586
- ),
1587
- /* @__PURE__ */ e(
1588
- q,
1589
- {
1590
- label: "Status",
1591
- field: "status",
1592
- sortField: y,
1593
- sortDir: b,
1594
- onSort: u
1595
- }
1596
- ),
1597
- /* @__PURE__ */ e(
1598
- q,
1599
- {
1600
- label: "Due Date",
1601
- field: "dueDate",
1602
- sortField: y,
1603
- sortDir: b,
1604
- onSort: u
1605
- }
1606
- ),
1607
- /* @__PURE__ */ e(
1608
- q,
1609
- {
1610
- label: "Score",
1611
- field: "score",
1612
- sortField: y,
1613
- sortDir: b,
1614
- onSort: u,
1615
- textAlign: "right"
1616
- }
1617
- ),
1618
- d && /* @__PURE__ */ e(Ae, { className: "text-right text-muted-foreground", children: "Weight" })
1619
- ] }) }),
1620
- /* @__PURE__ */ e(et, { children: N.map((x, C) => /* @__PURE__ */ t(Be, { children: [
1621
- x.category && p && /* @__PURE__ */ e(le, { className: "bg-muted hover:bg-muted", children: /* @__PURE__ */ e(Y, { colSpan: z, children: /* @__PURE__ */ t("span", { className: "font-semibold text-sm text-foreground", children: [
1622
- x.category.name,
1623
- x.category.weight != null && ` (${x.category.weight}%)`
1624
- ] }) }) }),
1625
- x.items.map((n) => /* @__PURE__ */ t(
1626
- le,
1627
- {
1628
- className: F(l && !h && "cursor-pointer"),
1629
- onClick: () => l && !h ? l(n) : void 0,
1630
- children: [
1631
- /* @__PURE__ */ e(Y, { children: n.name }),
1632
- /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(Ce, { status: n.status, size: "small" }) }),
1633
- /* @__PURE__ */ e(Y, { children: n.dueDate ? /* @__PURE__ */ e(
1634
- Ue,
1635
- {
1636
- dueDate: n.dueDate,
1637
- submittedDate: n.submittedDate,
1638
- size: "small"
1639
- }
1640
- ) : "—" }),
1641
- /* @__PURE__ */ e(Y, { className: "text-right", children: n.score != null ? /* @__PURE__ */ t("span", { className: "text-sm font-semibold text-foreground", children: [
1642
- n.score,
1643
- " / ",
1644
- n.maxScore
1645
- ] }) : n.status === "excused" ? /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Excused" }) : /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "—" }) }),
1646
- d && /* @__PURE__ */ e(Y, { className: "text-right", children: n.weight != null ? `${n.weight}%` : "—" })
1647
- ]
1648
- },
1649
- n.uid
1650
- ))
1651
- ] }, C)) })
1652
- ] }) })
1653
- ] });
1654
- }
1655
- const Nt = {
1656
- lesson_completed: Fe,
1657
- quiz_passed: W,
1658
- assignment_submitted: Ie,
1659
- badge_earned: Le
1660
- };
1661
- function _t({
1662
- overallProgress: r,
1663
- totalTimeSpent: s,
1664
- modules: a,
1665
- recentActivity: d,
1666
- streak: p,
1667
- achievements: l,
1668
- recentActivityLimit: h = 5,
1669
- onModuleClick: i,
1670
- className: w,
1671
- style: y
1672
- }) {
1673
- return /* @__PURE__ */ t("div", { className: w, style: y, children: [
1674
- /* @__PURE__ */ t("div", { className: "grid grid-cols-[repeat(auto-fit,minmax(160px,1fr))] gap-2 mb-3", children: [
1675
- /* @__PURE__ */ e(L, { className: "p-2 flex justify-center", children: /* @__PURE__ */ e(tt, { value: r, size: 100 }) }),
1676
- /* @__PURE__ */ e(
1677
- ae,
1678
- {
1679
- icon: /* @__PURE__ */ e(De, { size: 24 }),
1680
- label: "Time Spent",
1681
- value: ye(s)
1682
- }
1683
- ),
1684
- p && /* @__PURE__ */ e(
1685
- ae,
1686
- {
1687
- icon: /* @__PURE__ */ e(mt, { size: 24 }),
1688
- label: "Current Streak",
1689
- value: `${p.currentDays} days`,
1690
- subtitle: `Longest: ${p.longestDays} days`
1691
- }
1692
- ),
1693
- /* @__PURE__ */ e(
1694
- ae,
1695
- {
1696
- icon: /* @__PURE__ */ e(Fe, { size: 24 }),
1697
- label: "Modules",
1698
- value: `${a.filter((c) => c.completedItems === c.totalItems).length} / ${a.length}`,
1699
- subtitle: "completed"
1700
- }
1701
- )
1702
- ] }),
1703
- /* @__PURE__ */ e("p", { className: "text-lg font-semibold mb-2 text-foreground", children: "Module Progress" }),
1704
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mb-3", children: a.map((c) => {
1705
- const b = c.totalItems > 0 ? c.completedItems / c.totalItems * 100 : 0;
1706
- return /* @__PURE__ */ t(
1707
- L,
1708
- {
1709
- className: F(
1710
- "p-2 transition-colors",
1711
- i && "cursor-pointer hover:border-primary"
1712
- ),
1713
- onClick: () => i == null ? void 0 : i(c.uid),
1714
- children: [
1715
- /* @__PURE__ */ t("div", { className: "flex justify-between items-center mb-0.5", children: [
1716
- /* @__PURE__ */ e("span", { className: "font-semibold text-sm text-foreground", children: c.name }),
1717
- /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: [
1718
- c.completedItems,
1719
- " / ",
1720
- c.totalItems
1721
- ] })
1722
- ] }),
1723
- /* @__PURE__ */ e(ne, { value: b, size: "sm" })
1724
- ]
1725
- },
1726
- c.uid
1727
- );
1728
- }) }),
1729
- d && d.length > 0 && /* @__PURE__ */ t(ee, { children: [
1730
- /* @__PURE__ */ e("p", { className: "text-lg font-semibold mb-2 text-foreground", children: "Recent Activity" }),
1731
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-1.5 mb-3", children: d.slice(0, h).map((c) => {
1732
- const b = Nt[c.type] ?? W;
1733
- return /* @__PURE__ */ t("div", { className: "flex gap-1.5 items-center", children: [
1734
- /* @__PURE__ */ e(b, { size: 16 }),
1735
- /* @__PURE__ */ e("span", { className: "flex-1 text-sm text-foreground", children: c.description }),
1736
- /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: new Date(c.timestamp).toLocaleDateString() })
1737
- ] }, c.uid);
1738
- }) })
1739
- ] }),
1740
- l && l.length > 0 && /* @__PURE__ */ t(ee, { children: [
1741
- /* @__PURE__ */ e("p", { className: "text-lg font-semibold mb-2 text-foreground", children: "Achievements" }),
1742
- /* @__PURE__ */ e("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(140px,1fr))] gap-2", children: l.map((c) => /* @__PURE__ */ t(L, { className: "p-2 text-center", children: [
1743
- c.iconUrl ? /* @__PURE__ */ e(
1744
- "img",
1745
- {
1746
- src: c.iconUrl,
1747
- alt: c.name,
1748
- className: "w-12 h-12 mb-1 mx-auto"
1749
- }
1750
- ) : /* @__PURE__ */ e(ht, { size: 32, className: "mx-auto mb-2 text-warning" }),
1751
- /* @__PURE__ */ e("p", { className: "font-semibold text-sm text-foreground", children: c.name }),
1752
- /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: c.description })
1753
- ] }, c.uid)) })
1754
- ] })
1755
- ] });
1756
- }
1757
- const vt = {
1758
- classic: "border-[3px] border-double border-warning bg-linear-to-br from-[#fffbe6] to-[#fff8e1]",
1759
- modern: "border border-primary bg-linear-to-br from-[#fff5f5] to-[#fee2e2]",
1760
- minimal: "border border-border"
1761
- };
1762
- function Et({
1763
- recipientName: r,
1764
- courseTitle: s,
1765
- completionDate: a,
1766
- organizationName: d,
1767
- organizationLogo: p,
1768
- signatory: l,
1769
- certificateId: h,
1770
- variant: i = "classic",
1771
- showActions: w = !0,
1772
- onPrint: y,
1773
- onDownload: c,
1774
- className: b,
1775
- style: T
1776
- }) {
1777
- const u = (() => {
1778
- try {
1779
- return new Date(a).toLocaleDateString("en-US", {
1780
- year: "numeric",
1781
- month: "long",
1782
- day: "numeric"
1783
- });
1784
- } catch {
1785
- return a;
1786
- }
1787
- })();
1788
- function U() {
1789
- y ? y() : window.print();
1790
- }
1791
- return /* @__PURE__ */ t("div", { className: b, style: T, children: [
1792
- /* @__PURE__ */ t(
1793
- "div",
327
+ t.uid
328
+ )) }),
329
+ x && o && u.length > 0 && /* @__PURE__ */ e(
330
+ de,
1794
331
  {
1795
- className: F(
1796
- "p-3 sm:p-5 md:p-6 text-center max-w-200 mx-auto rounded-md",
1797
- vt[i]
1798
- ),
1799
- children: [
1800
- p ? /* @__PURE__ */ e(
1801
- "img",
1802
- {
1803
- src: p,
1804
- alt: d,
1805
- className: "h-15 mb-2 mx-auto block"
1806
- }
1807
- ) : /* @__PURE__ */ e(
1808
- Le,
1809
- {
1810
- size: 48,
1811
- className: F("mx-auto mb-4", i === "classic" && "text-warning")
1812
- }
1813
- ),
1814
- /* @__PURE__ */ e("p", { className: "uppercase tracking-[3px] text-sm text-foreground/70", children: "Certificate of Completion" }),
1815
- /* @__PURE__ */ e(V, { className: "my-2 mx-auto max-w-50" }),
1816
- /* @__PURE__ */ e("p", { className: "text-sm text-foreground mb-1", children: "This is to certify that" }),
1817
- /* @__PURE__ */ e("p", { className: F("text-2xl font-bold mb-2 text-foreground", i === "classic" && "font-serif"), children: r }),
1818
- /* @__PURE__ */ e("p", { className: "text-sm text-foreground mb-1", children: "has successfully completed" }),
1819
- /* @__PURE__ */ e("p", { className: "text-xl font-bold mb-2 text-primary", children: s }),
1820
- /* @__PURE__ */ t("p", { className: "text-sm text-foreground mb-3", children: [
1821
- "Issued by ",
1822
- d,
1823
- " on ",
1824
- u
1825
- ] }),
1826
- l && /* @__PURE__ */ t("div", { className: "mt-4 mb-2", children: [
1827
- /* @__PURE__ */ e(V, { className: "my-2 mx-auto max-w-50" }),
1828
- /* @__PURE__ */ e("p", { className: "font-semibold text-sm text-foreground", children: l.name }),
1829
- /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: l.title })
1830
- ] }),
1831
- h && /* @__PURE__ */ t("span", { className: "block text-xs text-muted-foreground mt-2", children: [
1832
- "Certificate ID: ",
1833
- h
1834
- ] })
1835
- ]
332
+ currentPage: p,
333
+ totalPages: Math.ceil((S ?? u.length) / o),
334
+ onPageChange: x,
335
+ className: "mt-4"
1836
336
  }
1837
- ),
1838
- w && /* @__PURE__ */ t("div", { className: "flex justify-center gap-2 mt-3", children: [
1839
- /* @__PURE__ */ t(R, { variant: "outline", onClick: U, children: [
1840
- /* @__PURE__ */ e(ft, { size: 16 }),
1841
- " Print"
1842
- ] }),
1843
- c && /* @__PURE__ */ t(R, { variant: "outline", onClick: c, children: [
1844
- /* @__PURE__ */ e(Te, { size: 16 }),
1845
- " Download"
1846
- ] })
1847
- ] })
337
+ )
1848
338
  ] });
1849
339
  }
1850
340
  export {
1851
- Qt as AnnouncementFeed,
1852
- Dt as AssessmentReview,
1853
- jt as AssignmentSubmission,
1854
- Et as CertificateViewer,
1855
- Tt as CourseOutline,
1856
- Bt as DiscussionThread,
1857
- Lt as ExamSession,
1858
- At as FlashcardStudySession,
1859
- $t as GradebookTable,
1860
- Ut as LecturePlayer,
1861
- Rt as LessonPage,
1862
- Ft as PracticeQuiz,
1863
- _t as ProgressDashboard,
1864
- Ct as QuizSession,
1865
- Pt as ResourceLibrary,
1866
- It as ScrollableQuiz,
1867
- Mt as SurveyForm
341
+ Se as AnnouncementFeed,
342
+ Ae as AssessmentReview,
343
+ Te as AssignmentSubmission,
344
+ Ce as CertificateViewer,
345
+ ze as CourseCatalog,
346
+ Le as CourseOutline,
347
+ Qe as DiscussionThread,
348
+ Me as EnrollmentWizard,
349
+ ke as ExamSession,
350
+ Ee as FlashcardStudySession,
351
+ Ie as ForumBoard,
352
+ je as GradebookTable,
353
+ Ue as LecturePlayer,
354
+ Fe as LessonPage,
355
+ Be as PracticeQuiz,
356
+ De as ProgressDashboard,
357
+ Pe as QuizSession,
358
+ Ve as RequirementsChecklist,
359
+ we as ResourceLibrary,
360
+ _e as RubricView,
361
+ ve as ScrollableQuiz,
362
+ Ge as StudentProfile,
363
+ We as SurveyForm
1868
364
  };