wrong-notebook 2026.11.10 → 2026.11.11-2

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 (635) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +5 -0
  3. package/.next/build-manifest.json +14 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +35 -0
  6. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/server/app/_global-error.html +1 -1
  8. package/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/admin/page.js.nft.json +1 -1
  15. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
  17. package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/admin/cnm-tags/route.js +1 -1
  19. package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
  20. package/.next/server/app/api/admin/dashboard/route.js +3 -3
  21. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  22. package/.next/server/app/api/admin/debug-logs/export/route.js +1 -1
  23. package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
  24. package/.next/server/app/api/admin/debug-logs/route.js +1 -1
  25. package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
  26. package/.next/server/app/api/admin/eula/accept/route.js +1 -1
  27. package/.next/server/app/api/admin/eula/accept/route.js.nft.json +1 -1
  28. package/.next/server/app/api/admin/migrate-tags/route.js +1 -1
  29. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  30. package/.next/server/app/api/admin/system-reset/route.js +1 -1
  31. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  32. package/.next/server/app/api/admin/telemetry/route.js +1 -1
  33. package/.next/server/app/api/admin/telemetry/route.js.nft.json +1 -1
  34. package/.next/server/app/api/admin/users/[id]/detail/route.js +3 -3
  35. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  36. package/.next/server/app/api/admin/users/[id]/route.js +1 -1
  37. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  38. package/.next/server/app/api/admin/users/route.js +1 -1
  39. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  40. package/.next/server/app/api/ai/models/route.js +3 -3
  41. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  42. package/.next/server/app/api/ai/test/route.js +3 -3
  43. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  44. package/.next/server/app/api/analytics/route.js +3 -3
  45. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  46. package/.next/server/app/api/analyze/route.js +3 -3
  47. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  48. package/.next/server/app/api/auth/[...nextauth]/route.js +1 -1
  49. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  50. package/.next/server/app/api/error-items/[id]/delete/route.js +1 -1
  51. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  52. package/.next/server/app/api/error-items/[id]/figure/route.js +3 -3
  53. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  54. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +3 -3
  55. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  56. package/.next/server/app/api/error-items/[id]/geogebra/route.js +3 -3
  57. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  58. package/.next/server/app/api/error-items/[id]/image/route.js +1 -1
  59. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  60. package/.next/server/app/api/error-items/[id]/notes/route.js +1 -1
  61. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  62. package/.next/server/app/api/error-items/[id]/practice-records/route.js +1 -1
  63. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  64. package/.next/server/app/api/error-items/[id]/reanswer/route.js +3 -3
  65. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  66. package/.next/server/app/api/error-items/[id]/retag/route.js +3 -3
  67. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  68. package/.next/server/app/api/error-items/[id]/route.js +1 -1
  69. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  70. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +3 -3
  71. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
  72. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +3 -3
  73. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  74. package/.next/server/app/api/error-items/answer-space/route.js +1 -1
  75. package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -1
  76. package/.next/server/app/api/error-items/batch-delete/route.js +1 -1
  77. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  78. package/.next/server/app/api/error-items/batch-move/route.js +1 -1
  79. package/.next/server/app/api/error-items/batch-move/route.js.nft.json +1 -1
  80. package/.next/server/app/api/error-items/clear/route.js +1 -1
  81. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  82. package/.next/server/app/api/error-items/export-questions/route.js +1 -1
  83. package/.next/server/app/api/error-items/export-questions/route.js.nft.json +1 -1
  84. package/.next/server/app/api/error-items/list/route.js +8 -7
  85. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  86. package/.next/server/app/api/error-items/route.js +3 -3
  87. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  88. package/.next/server/app/api/error-items/short/[shortId]/route.js +1 -1
  89. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  90. package/.next/server/app/api/error-items/similarity/route.js +1 -1
  91. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  92. package/.next/server/app/api/eula/status/route.js +1 -1
  93. package/.next/server/app/api/eula/status/route.js.nft.json +1 -1
  94. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +3 -3
  95. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  96. package/.next/server/app/api/exams/[id]/results/route.js +3 -3
  97. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  98. package/.next/server/app/api/exams/[id]/retry/route.js +3 -3
  99. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  100. package/.next/server/app/api/exams/[id]/route.js +3 -3
  101. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  102. package/.next/server/app/api/exams/route.js +3 -3
  103. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  104. package/.next/server/app/api/export/route.js +7 -7
  105. package/.next/server/app/api/export/route.js.nft.json +1 -1
  106. package/.next/server/app/api/geogebra-analyze/route.js +3 -3
  107. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  108. package/.next/server/app/api/health/route.js.nft.json +1 -1
  109. package/.next/server/app/api/import/route.js +17 -17
  110. package/.next/server/app/api/import/route.js.nft.json +1 -1
  111. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +19 -19
  112. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
  113. package/.next/server/app/api/import-batches/[id]/fix-text/route.js +3 -3
  114. package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
  115. package/.next/server/app/api/import-batches/[id]/read/route.js +20 -20
  116. package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
  117. package/.next/server/app/api/import-batches/[id]/retry/route.js +19 -19
  118. package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
  119. package/.next/server/app/api/import-batches/[id]/route.js +20 -20
  120. package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
  121. package/.next/server/app/api/import-batches/[id]/start/route.js +20 -20
  122. package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
  123. package/.next/server/app/api/import-batches/route.js +20 -20
  124. package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
  125. package/.next/server/app/api/import-tasks/[id]/confirm/route.js +19 -19
  126. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
  127. package/.next/server/app/api/import-tasks/[id]/read/route.js +19 -19
  128. package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
  129. package/.next/server/app/api/import-tasks/[id]/retry/route.js +20 -20
  130. package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
  131. package/.next/server/app/api/import-tasks/[id]/route.js +19 -19
  132. package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
  133. package/.next/server/app/api/import-tasks/route.js +20 -20
  134. package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
  135. package/.next/server/app/api/initialize/route.js +2 -2
  136. package/.next/server/app/api/initialize/route.js.nft.json +1 -1
  137. package/.next/server/app/api/logs/frontend/route.js +1 -1
  138. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  139. package/.next/server/app/api/mcp/route/app-paths-manifest.json +3 -0
  140. package/.next/server/app/api/mcp/route/build-manifest.json +12 -0
  141. package/.next/server/app/api/mcp/route/server-reference-manifest.json +4 -0
  142. package/.next/server/app/api/mcp/route.js +33 -0
  143. package/.next/server/app/api/mcp/route.js.map +5 -0
  144. package/.next/server/app/api/mcp/route.js.nft.json +1 -0
  145. package/.next/server/app/api/mcp/route_client-reference-manifest.js +3 -0
  146. package/.next/server/app/api/minimax-code/checkin/route.js +1 -1
  147. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  148. package/.next/server/app/api/minimax-code/login/route.js +1 -1
  149. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  150. package/.next/server/app/api/minimax-code/route.js +1 -1
  151. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  152. package/.next/server/app/api/notebooks/[id]/retag/route.js +3 -3
  153. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  154. package/.next/server/app/api/notebooks/[id]/route.js +1 -1
  155. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  156. package/.next/server/app/api/notebooks/route.js +1 -1
  157. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  158. package/.next/server/app/api/openclaw/batch-upload/route.js +3 -3
  159. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  160. package/.next/server/app/api/paper-groups/[id]/route.js +1 -1
  161. package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
  162. package/.next/server/app/api/paper-groups/route.js +1 -1
  163. package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
  164. package/.next/server/app/api/practice/generate/route.js +23 -17
  165. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  166. package/.next/server/app/api/practice/grade/route.js +3 -3
  167. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  168. package/.next/server/app/api/practice/record/[id]/route.js +3 -3
  169. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  170. package/.next/server/app/api/practice/record/route.js +3 -3
  171. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  172. package/.next/server/app/api/question-banks/[id]/questions/[qid]/route/app-paths-manifest.json +3 -0
  173. package/.next/server/app/api/question-banks/[id]/questions/[qid]/route/build-manifest.json +12 -0
  174. package/.next/server/app/api/question-banks/[id]/questions/[qid]/route/server-reference-manifest.json +4 -0
  175. package/.next/server/app/api/question-banks/[id]/questions/[qid]/route.js +35 -0
  176. package/.next/server/app/api/question-banks/[id]/questions/[qid]/route.js.map +5 -0
  177. package/.next/server/app/api/question-banks/[id]/questions/[qid]/route.js.nft.json +1 -0
  178. package/.next/server/app/api/question-banks/[id]/questions/[qid]/route_client-reference-manifest.js +3 -0
  179. package/.next/server/app/api/question-banks/[id]/route/app-paths-manifest.json +3 -0
  180. package/.next/server/app/api/question-banks/[id]/route/build-manifest.json +12 -0
  181. package/.next/server/app/api/question-banks/[id]/route/server-reference-manifest.json +4 -0
  182. package/.next/server/app/api/question-banks/[id]/route.js +17 -0
  183. package/.next/server/app/api/question-banks/[id]/route.js.map +5 -0
  184. package/.next/server/app/api/question-banks/[id]/route.js.nft.json +1 -0
  185. package/.next/server/app/api/question-banks/[id]/route_client-reference-manifest.js +3 -0
  186. package/.next/server/app/api/question-banks/route/app-paths-manifest.json +3 -0
  187. package/.next/server/app/api/question-banks/route/build-manifest.json +12 -0
  188. package/.next/server/app/api/question-banks/route/server-reference-manifest.json +4 -0
  189. package/.next/server/app/api/question-banks/route.js +35 -0
  190. package/.next/server/app/api/question-banks/route.js.map +5 -0
  191. package/.next/server/app/api/question-banks/route.js.nft.json +1 -0
  192. package/.next/server/app/api/question-banks/route_client-reference-manifest.js +3 -0
  193. package/.next/server/app/api/reanswer/route.js +3 -3
  194. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  195. package/.next/server/app/api/register/route.js.nft.json +1 -1
  196. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  197. package/.next/server/app/api/requests/[id]/route.js +1 -1
  198. package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
  199. package/.next/server/app/api/review/due/route.js +13 -13
  200. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  201. package/.next/server/app/api/settings/route.js +1 -1
  202. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  203. package/.next/server/app/api/setup/route.js +1 -1
  204. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  205. package/.next/server/app/api/stats/activity/route.js +1 -1
  206. package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
  207. package/.next/server/app/api/stats/practice/clear/route.js +1 -1
  208. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  209. package/.next/server/app/api/stats/practice/route.js +1 -1
  210. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  211. package/.next/server/app/api/stats/repeated-mistakes/route.js +3 -3
  212. package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
  213. package/.next/server/app/api/stats/weak-tags/route.js +16 -15
  214. package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
  215. package/.next/server/app/api/tags/route.js +1 -1
  216. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  217. package/.next/server/app/api/tags/stats/route.js +1 -1
  218. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  219. package/.next/server/app/api/tags/suggestions/route.js +1 -1
  220. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  221. package/.next/server/app/api/tasks/route.js +1 -1
  222. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  223. package/.next/server/app/api/telemetry/route.js.nft.json +1 -1
  224. package/.next/server/app/api/tts/[id]/route.js +1 -1
  225. package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
  226. package/.next/server/app/api/tts/batch/route.js +1 -1
  227. package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
  228. package/.next/server/app/api/tts/route.js +1 -1
  229. package/.next/server/app/api/tts/route.js.nft.json +1 -1
  230. package/.next/server/app/api/tts/status/route.js +1 -1
  231. package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
  232. package/.next/server/app/api/user/ai-consent/route.js +1 -1
  233. package/.next/server/app/api/user/ai-consent/route.js.nft.json +1 -1
  234. package/.next/server/app/api/user/route.js +3 -3
  235. package/.next/server/app/api/user/route.js.nft.json +1 -1
  236. package/.next/server/app/api/version/route.js.nft.json +1 -1
  237. package/.next/server/app/banks/page/app-paths-manifest.json +3 -0
  238. package/.next/server/app/banks/page/build-manifest.json +22 -0
  239. package/.next/server/app/banks/page/next-font-manifest.json +11 -0
  240. package/.next/server/app/banks/page/react-loadable-manifest.json +1 -0
  241. package/.next/server/app/banks/page/server-reference-manifest.json +4 -0
  242. package/.next/server/app/banks/page.js +15 -0
  243. package/.next/server/app/banks/page.js.map +5 -0
  244. package/.next/server/app/banks/page.js.nft.json +1 -0
  245. package/.next/server/app/banks/page_client-reference-manifest.js +3 -0
  246. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  247. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  248. package/.next/server/app/eula/page.js.nft.json +1 -1
  249. package/.next/server/app/eula/page_client-reference-manifest.js +1 -1
  250. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  251. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  252. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  253. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  254. package/.next/server/app/exams/page.js.nft.json +1 -1
  255. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  256. package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
  257. package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
  258. package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
  259. package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
  260. package/.next/server/app/import-tasks/page.js.nft.json +1 -1
  261. package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
  262. package/.next/server/app/initialize/page.js.nft.json +1 -1
  263. package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
  264. package/.next/server/app/login/page.js.nft.json +1 -1
  265. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  266. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  267. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  268. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  269. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  270. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  271. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  272. package/.next/server/app/page.js.nft.json +1 -1
  273. package/.next/server/app/page_client-reference-manifest.js +1 -1
  274. package/.next/server/app/practice/page.js.nft.json +1 -1
  275. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  276. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  277. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  278. package/.next/server/app/register/page.js.nft.json +1 -1
  279. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  280. package/.next/server/app/review/page.js.nft.json +1 -1
  281. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  282. package/.next/server/app/setup/page.js.nft.json +1 -1
  283. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  284. package/.next/server/app/stats/page.js.nft.json +1 -1
  285. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  286. package/.next/server/app/tags/page.js.nft.json +1 -1
  287. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  288. package/.next/server/app-paths-manifest.json +5 -0
  289. package/.next/server/chunks/1oeh_server_app_api_question-banks_[id]_questions_[qid]_route_actions_0cut200tgdhrg.js +3 -0
  290. package/.next/server/chunks/{[root-of-the-server]__007euzraef-1_._.js → [root-of-the-server]__003zs5cdrhp0h._.js} +1 -1
  291. package/.next/server/chunks/{[root-of-the-server]__046l8-2oecq5e._.js → [root-of-the-server]__0095ttqaxkura._.js} +1 -1
  292. package/.next/server/chunks/{[root-of-the-server]__00d4vtmsmiyd_._.js → [root-of-the-server]__00gh00nfppv7c._.js} +1 -1
  293. package/.next/server/chunks/{[root-of-the-server]__1ld7m10shogtt._.js → [root-of-the-server]__02cwazw3laf8n._.js} +2 -2
  294. package/.next/server/chunks/[root-of-the-server]__02p_mpxidnu0x._.js +3 -0
  295. package/.next/server/chunks/{[root-of-the-server]__12u2irl6e293j._.js → [root-of-the-server]__03mzwpgmelgxq._.js} +2 -2
  296. package/.next/server/chunks/[root-of-the-server]__04g1e8vi5hfmd._.js +1 -1
  297. package/.next/server/chunks/{[root-of-the-server]__06t523lsa-xt5._.js → [root-of-the-server]__04k-j5q4c3fxh._.js} +1 -1
  298. package/.next/server/chunks/[root-of-the-server]__06g_4_o5xkej2._.js +3 -0
  299. package/.next/server/chunks/[root-of-the-server]__074shufbnm6ni._.js +3 -0
  300. package/.next/server/chunks/{[root-of-the-server]__02m42nibzxxmr._.js → [root-of-the-server]__07dbynh_bs54x._.js} +1 -1
  301. package/.next/server/chunks/{[root-of-the-server]__06g0t8zt3udt7._.js → [root-of-the-server]__0afxho639gukq._.js} +1 -1
  302. package/.next/server/chunks/{[root-of-the-server]__17tyjwy7wmx2z._.js → [root-of-the-server]__0as_tqxtximnv._.js} +2 -2
  303. package/.next/server/chunks/{[root-of-the-server]__13cki3v6cufcx._.js → [root-of-the-server]__0b110dxj2qk5d._.js} +2 -2
  304. package/.next/server/chunks/{[root-of-the-server]__0r3grb-nk-tkn._.js → [root-of-the-server]__0bey3smu2frko._.js} +2 -2
  305. package/.next/server/chunks/{[root-of-the-server]__00lpxd_gni_y7._.js → [root-of-the-server]__0clg30mkk8i71._.js} +1 -1
  306. package/.next/server/chunks/{[root-of-the-server]__0zj60abydj_ho._.js → [root-of-the-server]__0cyq3g7ztpx7w._.js} +2 -2
  307. package/.next/server/chunks/[root-of-the-server]__0dxid01zcz8sh._.js +3 -0
  308. package/.next/server/chunks/[root-of-the-server]__0evv12a34qcy6._.js +4 -4
  309. package/.next/server/chunks/{[root-of-the-server]__0d_63r679gzzq._.js → [root-of-the-server]__0gj0qch0bepug._.js} +1 -1
  310. package/.next/server/chunks/[root-of-the-server]__0gspnsyl2sr50._.js +3 -0
  311. package/.next/server/chunks/{[root-of-the-server]__1i70uvkdts-q1._.js → [root-of-the-server]__0h7v77lf4fj2l._.js} +2 -2
  312. package/.next/server/chunks/{[root-of-the-server]__0m1vmtwh8l5-k._.js → [root-of-the-server]__0hfzltniz674f._.js} +2 -2
  313. package/.next/server/chunks/[root-of-the-server]__0i0wx-z-qadeh._.js +3 -0
  314. package/.next/server/chunks/{[root-of-the-server]__1gkabltrjg-t4._.js → [root-of-the-server]__0iw2v5f6ccxl0._.js} +2 -2
  315. package/.next/server/chunks/{[root-of-the-server]__0o5b_c35hufmg._.js → [root-of-the-server]__0iz5qf7p--9io._.js} +2 -2
  316. package/.next/server/chunks/[root-of-the-server]__0llcnfms-yrs4._.js +1 -1
  317. package/.next/server/chunks/[root-of-the-server]__0lrgjyg38b9j1._.js +3 -0
  318. package/.next/server/chunks/[root-of-the-server]__0nmxuavodh1jp._.js +3 -0
  319. package/.next/server/chunks/[root-of-the-server]__0o64d13on6cmz._.js +3 -0
  320. package/.next/server/chunks/{[root-of-the-server]__1ln0042a-s6yz._.js → [root-of-the-server]__0oou2pf7_339_._.js} +2 -2
  321. package/.next/server/chunks/[root-of-the-server]__0pfjf0rwvysy7._.js +3 -0
  322. package/.next/server/chunks/[root-of-the-server]__0pzhwzricdm-8._.js +3 -0
  323. package/.next/server/chunks/[root-of-the-server]__0q7tfn1jdwvpx._.js +3 -0
  324. package/.next/server/chunks/[root-of-the-server]__0qcuz-9of1fv5._.js +3 -0
  325. package/.next/server/chunks/[root-of-the-server]__0r0zkh318us2a._.js +3 -0
  326. package/.next/server/chunks/[root-of-the-server]__0sr8vnpwvch60._.js +1 -1
  327. package/.next/server/chunks/{[root-of-the-server]__1ege7h8tb5rk0._.js → [root-of-the-server]__0sthzz27i2a2z._.js} +2 -2
  328. package/.next/server/chunks/{[root-of-the-server]__1jwj83lfyd4sd._.js → [root-of-the-server]__0svsyv06lv5b6._.js} +2 -2
  329. package/.next/server/chunks/{[root-of-the-server]__1w6vhjjteqg1c._.js → [root-of-the-server]__0u5ilae_0p228._.js} +2 -2
  330. package/.next/server/chunks/[root-of-the-server]__0ve9pg6dcdyog._.js +3 -0
  331. package/.next/server/chunks/[root-of-the-server]__0vf7un104o30d._.js +3 -0
  332. package/.next/server/chunks/{[root-of-the-server]__1ya8xaf2pmzqp._.js → [root-of-the-server]__0wb0hryzh-40d._.js} +2 -2
  333. package/.next/server/chunks/[root-of-the-server]__0xryaobvas7wn._.js +3 -0
  334. package/.next/server/chunks/[root-of-the-server]__0y88hdobvv_cu._.js +3 -0
  335. package/.next/server/chunks/{[root-of-the-server]__1pdsfjtgtncsg._.js → [root-of-the-server]__0ykbbyo6dhbr6._.js} +2 -2
  336. package/.next/server/chunks/{[root-of-the-server]__1v3kta6bd_kv9._.js → [root-of-the-server]__0yqilo886f-ap._.js} +2 -2
  337. package/.next/server/chunks/[root-of-the-server]__10gksjgitow13._.js +3 -0
  338. package/.next/server/chunks/{[root-of-the-server]__1i_tefn2lhztv._.js → [root-of-the-server]__11abvzxq0gnxd._.js} +2 -2
  339. package/.next/server/chunks/[root-of-the-server]__11k2f-h9fwj0r._.js +3 -0
  340. package/.next/server/chunks/[root-of-the-server]__132wdxrrngo1f._.js +3 -0
  341. package/.next/server/chunks/[root-of-the-server]__1338_d0rrpmqi._.js +3 -0
  342. package/.next/server/chunks/[root-of-the-server]__13k69ibnw4thj._.js +3 -0
  343. package/.next/server/chunks/[root-of-the-server]__14971xq-txgd-._.js +3 -0
  344. package/.next/server/chunks/[root-of-the-server]__159kla6_fcldu._.js +3 -0
  345. package/.next/server/chunks/[root-of-the-server]__167-list_13wk._.js +3 -0
  346. package/.next/server/chunks/{[root-of-the-server]__1m2fnptuk23jt._.js → [root-of-the-server]__16lnqkbxm2wvd._.js} +2 -2
  347. package/.next/server/chunks/[root-of-the-server]__190kzk1zqnnnh._.js +3 -0
  348. package/.next/server/chunks/{[root-of-the-server]__0fxflgag7lsn4._.js → [root-of-the-server]__1_n49ooywukvu._.js} +2 -2
  349. package/.next/server/chunks/[root-of-the-server]__1assq-8cgzn69._.js +1 -1
  350. package/.next/server/chunks/[root-of-the-server]__1bc2146vwwx0n._.js +3 -0
  351. package/.next/server/chunks/[root-of-the-server]__1chl_j6-66d0z._.js +3 -0
  352. package/.next/server/chunks/{[root-of-the-server]__14_mjy9lqgp99._.js → [root-of-the-server]__1d_eia02z8s27._.js} +2 -2
  353. package/.next/server/chunks/[root-of-the-server]__1dg09yxfyy2d-._.js +3 -0
  354. package/.next/server/chunks/[root-of-the-server]__1e8_j43j1t1m3._.js +4 -4
  355. package/.next/server/chunks/{[root-of-the-server]__0wpt1mx3kryp7._.js → [root-of-the-server]__1expjjxwlr3rv._.js} +1 -1
  356. package/.next/server/chunks/[root-of-the-server]__1fp_biblbk1dj._.js +3 -0
  357. package/.next/server/chunks/[root-of-the-server]__1goozrpjh5dhf._.js +1 -1
  358. package/.next/server/chunks/[root-of-the-server]__1h4469dzsx9y_._.js +3 -0
  359. package/.next/server/chunks/[root-of-the-server]__1hg-nksvhu11h._.js +3 -0
  360. package/.next/server/chunks/[root-of-the-server]__1hq4b2pmltb_l._.js +3 -0
  361. package/.next/server/chunks/[root-of-the-server]__1hr87f6mg8xi6._.js +3 -0
  362. package/.next/server/chunks/{[root-of-the-server]__1xpcaqsei77n2._.js → [root-of-the-server]__1i04dsau7foki._.js} +2 -2
  363. package/.next/server/chunks/{[root-of-the-server]__0obmdl7r6pt9d._.js → [root-of-the-server]__1i4c418rordji._.js} +1 -1
  364. package/.next/server/chunks/[root-of-the-server]__1i8ob9ye9_osl._.js +3 -0
  365. package/.next/server/chunks/[root-of-the-server]__1ii2yvizq9zx8._.js +1 -1
  366. package/.next/server/chunks/[root-of-the-server]__1jcv8k2sx2ptr._.js +3 -0
  367. package/.next/server/chunks/[root-of-the-server]__1juyqvp5sctaz._.js +3 -0
  368. package/.next/server/chunks/[root-of-the-server]__1k67g4w53li1h._.js +3 -0
  369. package/.next/server/chunks/[root-of-the-server]__1kqyyoqumu2k3._.js +3 -0
  370. package/.next/server/chunks/[root-of-the-server]__1ktelnqkakjyk._.js +3 -0
  371. package/.next/server/chunks/[root-of-the-server]__1kucx2jgzzdfv._.js +1 -1
  372. package/.next/server/chunks/[root-of-the-server]__1l63lc79i6lzk._.js +1 -1
  373. package/.next/server/chunks/[root-of-the-server]__1nmtvzuc1uv-5._.js +3 -0
  374. package/.next/server/chunks/[root-of-the-server]__1oaxm5scx4anf._.js +3 -0
  375. package/.next/server/chunks/[root-of-the-server]__1oc9d5av5hr08._.js +3 -0
  376. package/.next/server/chunks/[root-of-the-server]__1opijjenrark5._.js +3 -0
  377. package/.next/server/chunks/[root-of-the-server]__1otoj-v6_5y0o._.js +3 -0
  378. package/.next/server/chunks/[root-of-the-server]__1qbwy5a1mwohf._.js +3 -0
  379. package/.next/server/chunks/{[root-of-the-server]__0y82146_dftio._.js → [root-of-the-server]__1qch4uwoe4jbl._.js} +1 -1
  380. package/.next/server/chunks/[root-of-the-server]__1qh6ja_35h8e9._.js +3 -0
  381. package/.next/server/chunks/[root-of-the-server]__1qmbbudn1-e1n._.js +1 -1
  382. package/.next/server/chunks/[root-of-the-server]__1rfpsbaml9gvv._.js +3 -0
  383. package/.next/server/chunks/[root-of-the-server]__1rzzqjvucnhdy._.js +3 -0
  384. package/.next/server/chunks/[root-of-the-server]__1s9wsfyjfjfsw._.js +3 -0
  385. package/.next/server/chunks/[root-of-the-server]__1svy-pnpe1pwu._.js +3 -0
  386. package/.next/server/chunks/[root-of-the-server]__1t6v0c67wrtj7._.js +3 -0
  387. package/.next/server/chunks/{[root-of-the-server]__0ztucyaloy2ub._.js → [root-of-the-server]__1tcmfyputqswh._.js} +2 -2
  388. package/.next/server/chunks/[root-of-the-server]__1ttyfy9dd2omo._.js +3 -0
  389. package/.next/server/chunks/[root-of-the-server]__1uk_9g9b1wxp5._.js +3 -0
  390. package/.next/server/chunks/[root-of-the-server]__1v5j-xo97hloh._.js +3 -0
  391. package/.next/server/chunks/[root-of-the-server]__1wt1lpxbrwtyt._.js +3 -0
  392. package/.next/server/chunks/[root-of-the-server]__1y7j4fig86u8c._.js +3 -0
  393. package/.next/server/chunks/{[root-of-the-server]__0q520ovb9262s._.js → [root-of-the-server]__1z61l-vv1munx._.js} +2 -2
  394. package/.next/server/chunks/{_02qwqg9i39x4_._.js → _0-4_eys63g0m9._.js} +6 -6
  395. package/.next/server/chunks/_020v6nmfgswzk._.js +1 -1
  396. package/.next/server/chunks/_06iu5mmu8wlcc._.js +3 -0
  397. package/.next/server/chunks/{_0tz5wpjdgntj3._.js → _09trvgfs0zumw._.js} +2 -2
  398. package/.next/server/chunks/_0c25unp5_llaq._.js +3 -0
  399. package/.next/server/chunks/{_1csx8ckltgali._.js → _0fsupxpep5knb._.js} +6 -6
  400. package/.next/server/chunks/{_0oppr1mpoh25l._.js → _0j_08_iij6lec._.js} +1 -1
  401. package/.next/server/chunks/_0pivjcgtfkjfw._.js +3 -0
  402. package/.next/server/chunks/_0rse5-saodpeb._.js +30 -0
  403. package/.next/server/chunks/{_1gtuhmdu6udof._.js → _0sreqb-d5c0h6._.js} +6 -6
  404. package/.next/server/chunks/_0vidw039o5x0k._.js +3 -0
  405. package/.next/server/chunks/_10xn2rcd87yd5._.js +3 -0
  406. package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
  407. package/.next/server/chunks/{_1yvd01woddaxt._.js → _1c-nysoxl9gha._.js} +6 -6
  408. package/.next/server/chunks/_1eqnx6dcz6a03._.js +1 -1
  409. package/.next/server/chunks/_1ooq1_fguyb4w._.js +1 -1
  410. package/.next/server/chunks/_1re5pp9fn2sv7._.js +3 -0
  411. package/.next/server/chunks/_1v6bg00q81vb-._.js +3 -0
  412. package/.next/server/chunks/_1y2rcqvbb2_-4._.js +3 -0
  413. package/.next/server/chunks/_1yx16tn5391kx._.js +1 -1
  414. package/.next/server/chunks/_1z_ujac_e_65s._.js +1 -1
  415. package/.next/server/chunks/_next-internal_server_app_api_mcp_route_actions_1thtlukwlrce1.js +3 -0
  416. package/.next/server/chunks/_next-internal_server_app_api_question-banks_[id]_route_actions_06y5t4oimtusv.js +3 -0
  417. package/.next/server/chunks/_next-internal_server_app_api_question-banks_route_actions_0h4hz83b0yf8g.js +3 -0
  418. package/.next/server/chunks/node_modules_zod_v4_classic_external_0yua5dbpvcjkf.js +5 -5
  419. package/.next/server/chunks/src_lib_078zldkqc-a67._.js +1 -1
  420. package/.next/server/chunks/src_lib_09_k-7vv0sy-e._.js +3 -0
  421. package/.next/server/chunks/src_lib_0clsw_ng7x3ih._.js +1 -1
  422. package/.next/server/chunks/src_lib_0gonw_e9wzfyz._.js +1 -1
  423. package/.next/server/chunks/src_lib_0whd_w99i5vmm._.js +1 -1
  424. package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +28 -19
  425. package/.next/server/chunks/src_lib_1b_d9xsuzjp3e._.js +1 -1
  426. package/.next/server/chunks/src_lib_1hw1dokd0kaxo._.js +3 -0
  427. package/.next/server/chunks/src_lib_1o3tjd1o5cimp._.js +1 -1
  428. package/.next/server/chunks/src_lib_error-list_1o9rfcd_k01kv._.js +3 -0
  429. package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +1 -1
  430. package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +1 -1
  431. package/.next/server/chunks/src_lib_notebook-scope_ts_06eipvr6xztlf._.js +1 -1
  432. package/.next/server/chunks/src_lib_question-bank_import_ts_023xoc-kyom7m._.js +3 -0
  433. package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +1 -1
  434. package/.next/server/chunks/src_lib_tags_seed_1_ej3w-2450a0._.js +1 -1
  435. package/.next/server/chunks/ssr/[root-of-the-server]__032-uso7x2eqk._.js +1 -1
  436. package/.next/server/chunks/ssr/[root-of-the-server]__0ekyw4b9xrrfl._.js +3 -0
  437. package/.next/server/chunks/ssr/{[root-of-the-server]__04nhi0374i4dp._.js → [root-of-the-server]__0l72nsu73r1ie._.js} +1 -1
  438. package/.next/server/chunks/ssr/{[root-of-the-server]__0xjcdrflb40xr._.js → [root-of-the-server]__0q4fkp0gm5j49._.js} +1 -1
  439. package/.next/server/chunks/ssr/[root-of-the-server]__127jl-l56wp65._.js +3 -0
  440. package/.next/server/chunks/ssr/[root-of-the-server]__13a530hbs-5o-._.js +1 -1
  441. package/.next/server/chunks/ssr/[root-of-the-server]__1abszuh7g1t6l._.js +3 -0
  442. package/.next/server/chunks/ssr/[root-of-the-server]__1czdp-cv_3o0y._.js +3 -0
  443. package/.next/server/chunks/ssr/[root-of-the-server]__1u1nyl__o71y7._.js +3 -0
  444. package/.next/server/chunks/ssr/[root-of-the-server]__1w_b5karqfj4p._.js +3 -0
  445. package/.next/server/chunks/ssr/{[root-of-the-server]__01z2m5q6l60fn._.js → [root-of-the-server]__1z7574v_ikkfm._.js} +1 -1
  446. package/.next/server/chunks/ssr/_0-nyc5xhnkj97._.js +3 -0
  447. package/.next/server/chunks/ssr/_00bsw28n2tkm8._.js +3 -0
  448. package/.next/server/chunks/ssr/_017305t8j_d1y._.js +3 -0
  449. package/.next/server/chunks/ssr/_02_avk2sj3zf5._.js +1 -1
  450. package/.next/server/chunks/ssr/_081vr-pfkkxm1._.js +3 -0
  451. package/.next/server/chunks/ssr/{_1h4fhwg03wbzm._.js → _08d_9wlphi_z1._.js} +1 -1
  452. package/.next/server/chunks/ssr/_093l-s8jylydj._.js +3 -0
  453. package/.next/server/chunks/ssr/_09np4pgpwe7dt._.js +3 -0
  454. package/.next/server/chunks/ssr/_09o1qheyspd5d._.js +3 -0
  455. package/.next/server/chunks/ssr/{_0ajvgy4u-t-py._.js → _0_6a-7_isz4ox._.js} +1 -1
  456. package/.next/server/chunks/ssr/_0p3bqrojxwfs0._.js +1 -1
  457. package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
  458. package/.next/server/chunks/ssr/_13546ppmec5po._.js +4 -0
  459. package/.next/server/chunks/ssr/{_0is6rtsx_9ka7._.js → _1bpiiswbxudjs._.js} +1 -1
  460. package/.next/server/chunks/ssr/_1ctycpq4tb8xw._.js +1 -1
  461. package/.next/server/chunks/ssr/_1gdar99uip6w4._.js +3 -0
  462. package/.next/server/chunks/ssr/_1m-8w6s67a81a._.js +3 -0
  463. package/.next/server/chunks/ssr/_1s1ithxs1-28e._.js +3 -0
  464. package/.next/server/chunks/ssr/_1ywwrbmzxhzuj._.js +3 -0
  465. package/.next/server/chunks/ssr/_207sw-k8wjyua._.js +4 -0
  466. package/.next/server/chunks/ssr/_next-internal_server_app_banks_page_actions_02im6pq6s__f4.js +3 -0
  467. package/.next/server/chunks/ssr/node_modules_0_n_aglnnr_pe._.js +3 -0
  468. package/.next/server/chunks/ssr/{node_modules_1i644g-kqgnm_._.js → node_modules_0h9ta63mxl6gx._.js} +1 -1
  469. package/.next/server/chunks/ssr/node_modules_0howjysrkg79j._.js +3 -0
  470. package/.next/server/chunks/ssr/node_modules_1gehjcp51qewp._.js +3 -0
  471. package/.next/server/chunks/ssr/{node_modules_05hncuf8243qe._.js → node_modules_@radix-ui_1c09orgee1uhq._.js} +2 -2
  472. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_0sz_snu3yd_63.js → node_modules_heic-to_dist_csp_heic-to_0lnmp65mgz816.js} +1 -1
  473. package/.next/server/chunks/ssr/node_modules_next_dist_0rsvep-qefr2x._.js +1 -1
  474. package/.next/server/chunks/ssr/node_modules_next_dist_1khq67j4vo9y4._.js +1 -1
  475. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1v3-7fv6473ff.js +3 -0
  476. package/.next/server/chunks/ssr/src_0qrp0l9l_33ze._.js +3 -0
  477. package/.next/server/chunks/ssr/{src_0e73j7l6j__rh._.js → src_11my1u2jnbp_c._.js} +2 -2
  478. package/.next/server/chunks/ssr/src_18crt94jrdkoz._.js +3 -0
  479. package/.next/server/chunks/ssr/src_1m8frpkuirkx8._.js +1 -1
  480. package/.next/server/chunks/ssr/src_app_banks_page_tsx_0ln3jwg20xg0f._.js +3 -0
  481. package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
  482. package/.next/server/chunks/ssr/src_app_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
  483. package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +2 -2
  484. package/.next/server/chunks/ssr/src_app_practice_page_tsx_10gnx53v3kpzb._.js +1 -1
  485. package/.next/server/chunks/ssr/src_app_review_page_tsx_1rq4ygvo_szv0._.js +1 -1
  486. package/.next/server/chunks/ssr/src_components_error-list_error-item-card_tsx_1zsiqsrj-jjd7._.js +1 -1
  487. package/.next/server/chunks/ssr/src_components_mastery-panel_tsx_1--j5c7mhomdp._.js +1 -1
  488. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +20 -20
  489. package/.next/server/chunks/ssr/src_contexts_LanguageContext_tsx_0r6xucmeu1k5z._.js +1 -1
  490. package/.next/server/chunks/ssr/src_lib_0rd9w12yo--s3._.js +3 -0
  491. package/.next/server/chunks/ssr/src_lib_130aann40fb28._.js +3 -0
  492. package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
  493. package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +1 -1
  494. package/.next/server/functions-config-manifest.json +2 -1
  495. package/.next/server/middleware-build-manifest.js +14 -3
  496. package/.next/server/next-font-manifest.js +1 -1
  497. package/.next/server/next-font-manifest.json +4 -0
  498. package/.next/server/pages/500.html +1 -1
  499. package/.next/server/preview-props.json +3 -3
  500. package/.next/server/server-reference-manifest.js +1 -1
  501. package/.next/server/server-reference-manifest.json +1 -1
  502. package/.next/static/chunks/{3j92h-4k4_o_f.js → 01du700kl9vpy.js} +1 -1
  503. package/.next/static/chunks/0296boczx9jzp.js +1 -0
  504. package/.next/static/chunks/0ce17zvy849pt.js +1 -0
  505. package/.next/static/chunks/0jujm58tnoh6g.js +1 -0
  506. package/.next/static/chunks/{1rlw59dtd-wn9.js → 0l7p1okxbynzl.js} +2 -2
  507. package/.next/static/chunks/0q-ubzpc3zt00.js +264 -0
  508. package/.next/static/chunks/0q3d845nwr3t9.js +1 -0
  509. package/.next/static/chunks/{2s65brxj4r_r8.js → 0qp2dju3vke54.js} +1 -1
  510. package/.next/static/chunks/0wf-6-2_vym2v.js +1 -0
  511. package/.next/static/chunks/11-wz53_clo14.js +1 -0
  512. package/.next/static/chunks/{0_ysyni00uuve.js → 1inmkqwqys755.js} +1 -1
  513. package/.next/static/chunks/{2_0xdmmmic5_l.js → 1s6os79cobfn_.js} +1 -1
  514. package/.next/static/chunks/1vyad-frr447h.js +2 -0
  515. package/.next/static/chunks/1xe6wsozi5dph.js +9 -0
  516. package/.next/static/chunks/{1-p-0kczwnip9.js → 2-_veplkr98_e.js} +1 -1
  517. package/.next/static/chunks/{3f9t8cne6yfyl.js → 229eh2g7m2yeo.js} +1 -1
  518. package/.next/static/chunks/2bh5ydfa-1ijv.js +2 -0
  519. package/.next/static/chunks/{28qc_d51g0z--.js → 2g9sfd_hxpx8t.js} +1 -1
  520. package/.next/static/chunks/{13aykr4b9nzmt.js → 2pg8rnt3z7y03.js} +4 -4
  521. package/.next/static/chunks/2vka298e6x3mn.js +13 -0
  522. package/.next/static/chunks/2wwddiemqx680.js +1 -0
  523. package/.next/static/chunks/2xm7gxq5_ot8y.js +1 -0
  524. package/.next/static/chunks/{1joajsaunlqm-.js → 32feki_k6eulj.js} +1 -1
  525. package/.next/static/chunks/{3h3a7lg3-9cbn.js → 348vc_z8o0lz1.js} +1 -1
  526. package/.next/static/chunks/3_xu3ke2zp8fv.js +1 -0
  527. package/.next/static/chunks/3ghbptbmig2g6.js +1 -0
  528. package/.next/static/chunks/3pn9o00oxw1jh.js +1 -0
  529. package/.next/static/chunks/3pu4qklwvr6i6.js +1 -0
  530. package/.next/static/chunks/3t23a8b3wz2sp.css +3 -0
  531. package/.next/static/chunks/{3t9tbm4atwmw8.js → 3vdtiexr8nj05.js} +1 -1
  532. package/.next/static/chunks/3xonrwoptfy0c.js +1 -0
  533. package/dist-scripts/src/lib/tags/data/university.js +1 -1
  534. package/package.json +1 -1
  535. package/prisma/migrations/20261111000000_add_question_bank/migration.sql +54 -0
  536. package/prisma/schema.prisma +50 -0
  537. package/prisma/seed.db +0 -0
  538. package/.next/server/chunks/[root-of-the-server]__00ry5fb1607z0._.js +0 -3
  539. package/.next/server/chunks/[root-of-the-server]__0191d7zm1bh5y._.js +0 -3
  540. package/.next/server/chunks/[root-of-the-server]__0_3i3iyk5i5fu._.js +0 -3
  541. package/.next/server/chunks/[root-of-the-server]__0d3nasp559369._.js +0 -3
  542. package/.next/server/chunks/[root-of-the-server]__0ddx0pk-g57hh._.js +0 -3
  543. package/.next/server/chunks/[root-of-the-server]__0euaxkmzk9kv8._.js +0 -3
  544. package/.next/server/chunks/[root-of-the-server]__0evnxpsv44y-s._.js +0 -3
  545. package/.next/server/chunks/[root-of-the-server]__0g2y0mex0x8zf._.js +0 -3
  546. package/.next/server/chunks/[root-of-the-server]__0gjk0_s945vrt._.js +0 -3
  547. package/.next/server/chunks/[root-of-the-server]__0gkhutsleo1es._.js +0 -3
  548. package/.next/server/chunks/[root-of-the-server]__0gvfx4rsinijb._.js +0 -3
  549. package/.next/server/chunks/[root-of-the-server]__0jutgg41pd-47._.js +0 -3
  550. package/.next/server/chunks/[root-of-the-server]__0kc9gy1644-op._.js +0 -3
  551. package/.next/server/chunks/[root-of-the-server]__0medeb4h2gk5t._.js +0 -3
  552. package/.next/server/chunks/[root-of-the-server]__0prgnysrc2l5k._.js +0 -3
  553. package/.next/server/chunks/[root-of-the-server]__0qwtk85kstlpq._.js +0 -3
  554. package/.next/server/chunks/[root-of-the-server]__0rwbb97vk-mfk._.js +0 -3
  555. package/.next/server/chunks/[root-of-the-server]__0smp3m3n89xs_._.js +0 -3
  556. package/.next/server/chunks/[root-of-the-server]__0zsd45jad6b40._.js +0 -3
  557. package/.next/server/chunks/[root-of-the-server]__0zux7hsnes_j2._.js +0 -3
  558. package/.next/server/chunks/[root-of-the-server]__10--fi__uy8y7._.js +0 -3
  559. package/.next/server/chunks/[root-of-the-server]__14b8pj1sucy1-._.js +0 -3
  560. package/.next/server/chunks/[root-of-the-server]__16t85d4p3aldo._.js +0 -3
  561. package/.next/server/chunks/[root-of-the-server]__1_do4zybj0nvi._.js +0 -3
  562. package/.next/server/chunks/[root-of-the-server]__1bz0s-wy2cxhl._.js +0 -3
  563. package/.next/server/chunks/[root-of-the-server]__1d7_aw9ogigrd._.js +0 -3
  564. package/.next/server/chunks/[root-of-the-server]__1gb1x1ubkdwig._.js +0 -3
  565. package/.next/server/chunks/[root-of-the-server]__1gsm8s81ac08k._.js +0 -3
  566. package/.next/server/chunks/[root-of-the-server]__1hc1bcnovtwo2._.js +0 -3
  567. package/.next/server/chunks/[root-of-the-server]__1jwd70xukhvz4._.js +0 -3
  568. package/.next/server/chunks/[root-of-the-server]__1ms_0h40h2rbg._.js +0 -3
  569. package/.next/server/chunks/[root-of-the-server]__1nw9nkdb5uv4i._.js +0 -3
  570. package/.next/server/chunks/[root-of-the-server]__1ogeha9-ljbre._.js +0 -3
  571. package/.next/server/chunks/[root-of-the-server]__1p5s772lt24dg._.js +0 -3
  572. package/.next/server/chunks/[root-of-the-server]__1pxyy29_t_ru1._.js +0 -3
  573. package/.next/server/chunks/[root-of-the-server]__1s_ky5a7nhgas._.js +0 -3
  574. package/.next/server/chunks/[root-of-the-server]__1txu2n-l6c6yu._.js +0 -3
  575. package/.next/server/chunks/[root-of-the-server]__1ulrsdu0e8fjb._.js +0 -3
  576. package/.next/server/chunks/[root-of-the-server]__1vg4na3a-hvwi._.js +0 -3
  577. package/.next/server/chunks/[root-of-the-server]__1wi-k0dtwwxx3._.js +0 -3
  578. package/.next/server/chunks/[root-of-the-server]__1wvm4n7d69s3x._.js +0 -3
  579. package/.next/server/chunks/[root-of-the-server]__1x-u1u9mrt630._.js +0 -3
  580. package/.next/server/chunks/[root-of-the-server]__1xx_3auad-kml._.js +0 -3
  581. package/.next/server/chunks/[root-of-the-server]__1y0omyblg9j35._.js +0 -3
  582. package/.next/server/chunks/[root-of-the-server]__1z2d4j9-oei44._.js +0 -3
  583. package/.next/server/chunks/[root-of-the-server]__1znqtfuuspj0w._.js +0 -3
  584. package/.next/server/chunks/[root-of-the-server]__205o-7lep9jth._.js +0 -3
  585. package/.next/server/chunks/[root-of-the-server]__20c3hyqykubh2._.js +0 -3
  586. package/.next/server/chunks/[root-of-the-server]__20pn9h3od2anc._.js +0 -3
  587. package/.next/server/chunks/_0b9gke5b17vzh._.js +0 -3
  588. package/.next/server/chunks/_0ta62b-tktnk8._.js +0 -3
  589. package/.next/server/chunks/_12xi_xqvtrn3k._.js +0 -3
  590. package/.next/server/chunks/_14l8uqb__fhx_._.js +0 -3
  591. package/.next/server/chunks/_18hm5aaxkr500._.js +0 -3
  592. package/.next/server/chunks/_1b-7g4thtxfnp._.js +0 -3
  593. package/.next/server/chunks/ssr/[root-of-the-server]__0l0hz47yn1ku_._.js +0 -3
  594. package/.next/server/chunks/ssr/[root-of-the-server]__0w77craeuuak9._.js +0 -3
  595. package/.next/server/chunks/ssr/[root-of-the-server]__1rrcp_77jpv98._.js +0 -3
  596. package/.next/server/chunks/ssr/[root-of-the-server]__1xgyz8jfhhs4j._.js +0 -3
  597. package/.next/server/chunks/ssr/_07igsu8xjloky._.js +0 -3
  598. package/.next/server/chunks/ssr/_090e6vf_k0pe9._.js +0 -3
  599. package/.next/server/chunks/ssr/_09y2uhjubswp4._.js +0 -3
  600. package/.next/server/chunks/ssr/_0htmdb0udewwn._.js +0 -3
  601. package/.next/server/chunks/ssr/_0lzeodofsq9pe._.js +0 -3
  602. package/.next/server/chunks/ssr/_0mp06uu5odp8m._.js +0 -4
  603. package/.next/server/chunks/ssr/_0ozptnii2nxuw._.js +0 -3
  604. package/.next/server/chunks/ssr/_0r_8p9g00106y._.js +0 -3
  605. package/.next/server/chunks/ssr/_0znwyf0_b8ia6._.js +0 -3
  606. package/.next/server/chunks/ssr/_127aw5h992s9d._.js +0 -4
  607. package/.next/server/chunks/ssr/_1dx7u1_w4db4k._.js +0 -3
  608. package/.next/server/chunks/ssr/node_modules_0nslyotwav52f._.js +0 -3
  609. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0mg8mlclupjv-._.js +0 -3
  610. package/.next/server/chunks/ssr/src_0_qzoo_03n_v-._.js +0 -3
  611. package/.next/server/chunks/ssr/src_0atwwo6buvs3b._.js +0 -3
  612. package/.next/server/chunks/ssr/src_1o5f_wr8vv-x0._.js +0 -3
  613. package/.next/server/chunks/ssr/src_lib_short-id_short-id-client_ts_03nnd3s0tat3l._.js +0 -3
  614. package/.next/static/chunks/08pb1_yl7fhsw.js +0 -1
  615. package/.next/static/chunks/0alfkmfoq-e76.js +0 -1
  616. package/.next/static/chunks/0c3tf7izst9o8.js +0 -1
  617. package/.next/static/chunks/0gs3bacq7z36z.js +0 -1
  618. package/.next/static/chunks/13oi1micj1ewp.js +0 -1
  619. package/.next/static/chunks/14zevcjua-k8z.js +0 -1
  620. package/.next/static/chunks/1797q5c62e7um.js +0 -1
  621. package/.next/static/chunks/1_4nz7m2jathb.js +0 -1
  622. package/.next/static/chunks/1ey5h3_143nwz.js +0 -2
  623. package/.next/static/chunks/23h8i_poncr7i.js +0 -1
  624. package/.next/static/chunks/26is31yphg3a0.css +0 -3
  625. package/.next/static/chunks/2e4y6sq3k0g-g.js +0 -1
  626. package/.next/static/chunks/2hl9d1rdb9hkq.js +0 -1
  627. package/.next/static/chunks/315-5a18eawtj.js +0 -13
  628. package/.next/static/chunks/33vv8ujyvnonj.js +0 -1
  629. package/.next/static/chunks/3keaieh9lgnr3.js +0 -2
  630. package/.next/static/chunks/3ls9d-zeu8xdr.js +0 -264
  631. package/.next/static/chunks/3m_jfkz23whuc.js +0 -1
  632. package/.next/static/chunks/431ssxm5rrwz9.js +0 -1
  633. /package/.next/static/{HqqfOtkWGYtFERkBGxueA → S4q1xCvMlvuYeRE4fI2-s}/_buildManifest.js +0 -0
  634. /package/.next/static/{HqqfOtkWGYtFERkBGxueA → S4q1xCvMlvuYeRE4fI2-s}/_clientMiddlewareManifest.js +0 -0
  635. /package/.next/static/{HqqfOtkWGYtFERkBGxueA → S4q1xCvMlvuYeRE4fI2-s}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,314381,3198,e=>{var t=e.i(456420);let i={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],314381);var r=e.i(843476),a=e.i(271645),o=e.i(632781);let l={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};l.node;let s=(0,t.f)(l),c={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};c.node;let h=(0,t.f)(c);var d=e.i(395925),u=e.i(741120),m=e.i(759659),g=e.i(519455),p=e.i(111110),f=e.i(294114),w=e.i(201276),x=e.i(113381);let y=null;function b(e,t,i){let n=e?.firstElementChild;n&&(n.style.width="100%",n.style.height=`${i}px`,t?.setSize(e?.offsetWidth||n.offsetWidth||800,i))}function v(e,t){let i=(0,x.L)(e,t);for(let e of i)w.V.warn("[GGB]","命令执行失败",{...e});return i.map(e=>e.command+":"+e.message).join("\n")||void 0}e.s(["f",0,function({commands:e,height:t=700,showToolBar:i=!1,showAlgebraInput:n=!1,showMenuBar:l=!1,className:c="",onRegenerate:C,onDelete:k}){let{t:j}=(0,p.b)(),M=(0,a.useRef)(null),E=(0,a.useRef)(null),N=(0,a.useRef)(void 0),D=(0,a.useId)(),_=(0,a.useRef)(`ggb-${D.replace(/[^a-zA-Z0-9_-]/g,"")}`),[R,S]=(0,a.useState)(!0),[L,I]=(0,a.useState)(null),[P,H]=(0,a.useState)(!0),[z,$]=(0,a.useState)(!1),[A,B]=(0,a.useState)(!1),Y=(0,a.useMemo)(()=>(0,x.i)(e),[e]);(0,a.useEffect)(()=>{if(0===Y.length)return;let e=!1,r=_.current,a=M.current;return(y||(y=new Promise((e,t)=>{if(window.GGBApplet)return void e();let i=document.createElement("script");i.src="https://www.geogebra.org/apps/deployggb.js",i.async=!0,i.onload=()=>e(),i.onerror=()=>{y=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(i)}))).then(()=>{if(e)return;let o=window.GGBApplet;if(!o){I(j.geogebra.notLoaded),S(!1);return}if(a){a.innerHTML=`<div id="${r}" style="width:100%;height:${t}px"></div>`;try{new o({appName:"classic",width:"100%",height:t,showToolBar:i,showAlgebraInput:n,showMenuBar:l,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:i=>{e||(E.current=i,b(a,i,t),N.current=v(i,Y),S(!1))}},!0).inject(r)}catch(t){w.V.error("[GGB]","Init failed",{error:t}),e||(I(j.geogebra.initFailed),S(!1))}}}).catch(t=>{w.V.error("[GGB]","Script load failed",{error:t}),e||(I(j.geogebra.scriptFailed),S(!1))}),()=>{e=!0;try{let e=E.current;e?.remove&&e.remove()}catch(e){w.V.warn("[GGB]","Cleanup failed",{error:e})}E.current=null,a&&(a.innerHTML="")}},[Y,i,n,l]),(0,a.useEffect)(()=>{b(M.current,E.current,P?700:t)},[P,t]);let U=(0,a.useCallback)(()=>{let e=E.current;if(e)try{e.resetConstruction(),setTimeout(()=>{E.current&&(N.current=v(E.current,Y))},300)}catch(e){w.V.warn("[GGB]","Reset failed",{error:e})}},[Y]),O=(0,a.useCallback)(async()=>{if(C&&!z){$(!0);try{await C(N.current)}finally{$(!1)}}},[C,z]),X=(0,a.useCallback)(async()=>{if(k&&!A&&await (0,f.u)(j.geogebra.confirmDelete,{destructive:!0})){B(!0);try{await k()}catch{f.c.error(j.geogebra.deleteFailed)}finally{B(!1)}}},[k,A,j]);return 0===Y.length?null:(0,r.jsxs)("div",{className:`relative rounded-lg border bg-card ${c}`,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:j.geogebra.title}),R&&(0,r.jsx)(o.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[C&&(0,r.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:O,title:j.geogebra.regenerate,disabled:z||R,children:[z?(0,r.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(u.f,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:j.geogebra.regenerate})]}),k&&(0,r.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:X,title:j.geogebra.delete,disabled:A||z,children:[A?(0,r.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:j.geogebra.delete})]}),(0,r.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:U,title:j.geogebra.reset,disabled:R,children:(0,r.jsx)(d.f,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>H(e=>!e),title:P?j.geogebra.shrink:j.geogebra.enlarge,children:P?(0,r.jsx)(h,{className:"h-3.5 w-3.5"}):(0,r.jsx)(s,{className:"h-3.5 w-3.5"})})]})]}),(0,r.jsx)("div",{ref:M,style:{width:"100%"}}),R&&(0,r.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,r.jsx)(o.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:j.geogebra.loading})]})}),L&&(0,r.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:L})]})}],3198)},856522,e=>{var t=e.i(456420);let i={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],856522)},786563,e=>{var t=e.i(456420);let i={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],786563)},837817,232660,e=>{var t=e.i(456420);let i={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],837817);var r=e.i(271645),a={x:0,y:0,width:0,height:0,unit:"px"},o=(e,t,i)=>Math.min(Math.max(e,t),i),l=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function s(e,t,i){return"%"===e.unit?{...a,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/i*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/i*100:0}}function c(e,t,i){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*i/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*i/100:0}:{...a,...e,unit:"px"}}function h(e,t,i,n,r,a=0,o=0,l=n,s=r){let c={...e},d=Math.min(a,n),u=Math.min(o,r),m=Math.min(l,n),g=Math.min(s,r);t&&(t>1?(u=(d=o?o*t:d)/t,m=l*t):(d=(u=a?a/t:u)*t,g=s/t)),c.y<0&&(c.height=Math.max(c.height+c.y,u),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,d),c.x=0);let p=n-(c.x+c.width);p<0&&(c.x=Math.min(c.x,n-d),c.width+=p);let f=r-(c.y+c.height);if(f<0&&(c.y=Math.min(c.y,r-u),c.height+=f),c.width<d&&(("sw"===i||"nw"==i)&&(c.x-=d-c.width),c.width=d),c.height<u&&(("nw"===i||"ne"==i)&&(c.y-=u-c.height),c.height=u),c.width>m&&(("sw"===i||"nw"==i)&&(c.x-=m-c.width),c.width=m),c.height>g&&(("nw"===i||"ne"==i)&&(c.y-=g-c.height),c.height=g),t){let e=c.width/c.height;if(e<t){let e=Math.max(c.width/t,u);("nw"===i||"ne"==i)&&(c.y-=e-c.height),c.height=e}else if(e>t){let e=Math.max(c.height*t,d);("sw"===i||"nw"==i)&&(c.x-=e-c.width),c.width=e}}return c}var d={capture:!0,passive:!1},u=0,m=class e extends r.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,r.createRef)();mediaRef=(0,r.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${u++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:i,width:n,height:r}=e.getBoundingClientRect();return{x:t,y:i,width:n,height:r}}componentDidUpdate(e){let{crop:t,onComplete:i}=this.props;if(i&&!e.crop&&t){let{width:e,height:n}=this.getBox();e&&n&&i(c(t,e,n),s(t,e,n))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,d),this.document.addEventListener("pointerup",this.onDocPointerDone,d),this.document.addEventListener("pointercancel",this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,d),this.document.removeEventListener("pointerup",this.onDocPointerDone,d),this.document.removeEventListener("pointercancel",this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:i}=this.props,n=this.getBox();if(!t)return;let r=c(t,n.width,n.height);if(i)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=e.clientX,l=e.clientY,s=r.x,h=r.y;if(a){let t=e.clientX-n.x,i=e.clientY-n.y,c=0,d=0;"ne"===a||"e"==a?(c=t-(r.x+r.width),d=i-r.y,s=r.x,h=r.y+r.height):"se"===a||"s"===a?(c=t-(r.x+r.width),d=i-(r.y+r.height),s=r.x,h=r.y):"sw"===a||"w"==a?(c=t-r.x,d=i-(r.y+r.height),s=r.x+r.width,h=r.y):("nw"===a||"n"==a)&&(c=t-r.x,d=i-r.y,s=r.x+r.width,h=r.y+r.height),o=s+n.x+c,l=h+n.y+d}this.evData={startClientX:o,startClientY:l,startCropX:s,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:i,locked:n,keepSelection:r,onChange:a}=this.props,o=this.getBox();if(i||n||r&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-o.x,h=e.clientY-o.y,d={unit:"px",x:l,y:h,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(c(d,o.width,o.height),s(d,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:i,disabled:n,onChange:r,onDragStart:a}=this.props,o=this.getBox();if(n||!i||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));let{evData:h}=this;h.clientX=e.clientX,h.clientY=e.clientY,l(i,t=h.isResize?this.resizeCrop():this.dragCrop())||r(c(t,o.width,o.height),s(t,o.width,o.height))};onComponentKeyDown=t=>{let{crop:i,disabled:n,onChange:r,onComplete:a}=this.props;if(n)return;let l=t.key,h=!1;if(!i)return;let d=this.getBox(),u=this.makePixelCrop(d),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===l?(u.x-=m,h=!0):"ArrowRight"===l?(u.x+=m,h=!0):"ArrowUp"===l?(u.y-=m,h=!0):"ArrowDown"===l&&(u.y+=m,h=!0),h){t.cancelable&&t.preventDefault(),u.x=o(u.x,0,d.width-u.width),u.y=o(u.y,0,d.height-u.height);let e=c(u,d.width,d.height),i=s(u,d.width,d.height);r(e,i),a&&a(e,i)}};onHandlerKeyDown=(t,i)=>{var n,r;let a,{aspect:o=0,crop:d,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(u||!d||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=h((n=c(d,y.width,y.height),r=t.key,a={...n},"ArrowLeft"===r?"nw"===i?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"w"===i?(a.x-=b,a.width+=b):"sw"===i?(a.x-=b,a.width+=b,a.height+=b):"ne"===i?(a.y+=b,a.width-=b,a.height-=b):"e"===i?a.width-=b:"se"===i&&(a.width-=b,a.height-=b):"ArrowRight"===r&&("nw"===i?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"w"===i?(a.x+=b,a.width-=b):"sw"===i?(a.x+=b,a.width-=b,a.height-=b):"ne"===i?(a.y-=b,a.width+=b,a.height+=b):"e"===i?a.width+=b:"se"===i&&(a.width+=b,a.height+=b)),"ArrowUp"===r?"nw"===i?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"n"===i?(a.y-=b,a.height+=b):"ne"===i?(a.y-=b,a.width+=b,a.height+=b):"sw"===i?(a.x+=b,a.width-=b,a.height-=b):"s"===i?a.height-=b:"se"===i&&(a.width-=b,a.height-=b):"ArrowDown"===r&&("nw"===i?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"n"===i?(a.y+=b,a.height-=b):"ne"===i?(a.y+=b,a.width-=b,a.height-=b):"sw"===i?(a.x-=b,a.width+=b,a.height+=b):"s"===i?a.height+=b:"se"===i&&(a.width+=b,a.height+=b)),a),o,i,y.width,y.height,m,g,p,f);if(!l(d,v)){let e=s(v,y.width,y.height);w(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:i,onComplete:n,onDragEnd:r}=this.props,a=this.getBox();this.unbindDocMove(),!(i||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,r&&r(e),n&&n(c(t,a.width,a.height),s(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),i=this.makePixelCrop(t),n=e.clientX-e.startClientX,r=e.clientY-e.startClientY;return i.x=o(e.startCropX+n,0,t.width-i.width),i.y=o(e.startCropY+r,0,t.height-i.height),i}getPointRegion(e,t,i,n){let{evData:r}=this,a=r.clientX-e.x,o=r.clientY-e.y,l;return l=n&&t?"nw"===t||"n"===t||"ne"===t:o<r.startCropY,(i&&t?"nw"===t||"w"===t||"sw"===t:a<r.startCropX)?l?"nw":"sw":l?"ne":"se"}resolveMinDimensions(e,t,i=0,n=0){let r=Math.min(i,e.width),a=Math.min(n,e.height);return t&&(r||a)?t>1?r?[r,r/t]:[a*t,a]:a?[a*t,a]:[r,r/t]:[r,a]}resizeCrop(){let{evData:t}=this,{aspect:i=0,maxWidth:n,maxHeight:r}=this.props,a=this.getBox(),[l,s]=this.resolveMinDimensions(a,i,this.props.minWidth,this.props.minHeight),c=this.makePixelCrop(a),d=this.getPointRegion(a,t.ord,l,s),u=t.ord||d,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(l&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-l)),(s&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-s));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===d?(p.x=t.startCropX,p.width=m,i?p.height=p.width/i:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===d?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,i?p.height=p.width/i:p.height=g):"sw"===d?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),i?p.height=p.width/i:p.height=g):"nw"===d&&(p.x=t.startCropX+m,p.width=Math.abs(m),i?(p.height=p.width/i,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=h(p,i,d,a.width,a.height,l,s,n,r);return i||e.xyOrds.indexOf(u)>-1?c=f:e.xOrds.indexOf(u)>-1?(c.x=f.x,c.width=f.width):e.yOrds.indexOf(u)>-1&&(c.y=f.y,c.height=f.height),c.x=o(c.x,0,a.width-c.width),c.y=o(c.y,0,a.height-c.height),c}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:i,locked:n,renderSelectionAddon:a,ruleOfThirds:o,crop:l}=this.props,s=this.getCropStyle();if(l)return r.default.createElement("div",{style:s,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!i&&!n&&r.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},r.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&r.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),r.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return c({...a,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:i,className:n,crop:a,disabled:o,locked:l,style:s,ruleOfThirds:c}=this.props,{cropIsActive:h,newCropIsBeingDrawn:d}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",n,h&&"ReactCrop--active",o&&"ReactCrop--disabled",l&&"ReactCrop--locked",d&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&i&&"ReactCrop--circular-crop",a&&c&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",i&&"ReactCrop--no-animate");return r.default.createElement("div",{ref:this.componentRef,className:m,style:s},r.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?r.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},r.default.createElement("defs",null,r.default.createElement("mask",{id:`hole-${this.instanceId}`},r.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),i?r.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):r.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),r.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};e.s(["f",0,m],232660)},469937,e=>{var t=e.i(843476),i=e.i(786563),n=e.i(111110),r=e.i(975157);let a=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:o,disabled:l,size:s="sm",showUnrated:c=!0,className:h}){let{t:d}=(0,n.b)(),u=e??0,m="sm"===s?"h-3.5 w-3.5":"h-5 w-5",g=u?d.difficulty.starsLabel.replace("{n}",String(u)):d.difficulty.unrated;return o?(0,t.jsxs)("span",{className:(0,r.f)("inline-flex items-center gap-0.5",h),role:"group","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:d.difficulty.clearHint,children:[a.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>o(e===u?null:e),"aria-label":d.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(i.f,{className:(0,r.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&c&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:d.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,r.f)("inline-flex items-center",h),role:"img","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:g,children:a.map(e=>(0,t.jsx)(i.f,{className:(0,r.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):c?(0,t.jsx)("span",{className:(0,r.f)("text-xs text-muted-foreground",h),children:d.difficulty.unrated}):null}])},12130,271945,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(456420);let r={name:"eraser",size:24,node:[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]};r.node;let a=(0,n.f)(r);var o=e.i(395925);let l={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};l.node;let s=(0,n.f)(l);var c=e.i(759659),h=e.i(837817),d=e.i(232660),u=e.i(519455),m=e.i(776639),g=e.i(263676),p=e.i(111110),f=e.i(895133);let w={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},x=(0,i.forwardRef)(function({imageSrc:e,regions:n,onChange:r,imageStyle:a=w,onImageLoad:o},l){let{t:s}=(0,p.b)(),c=(0,i.useRef)(null),h=(0,i.useRef)(null),[d,u]=(0,i.useState)(null),m=e=>{let t=c.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},x=()=>{d&&d.width>=.02&&d.height>=.02&&r([...n,d]),h.current=null,u(null)},y=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:l,src:e,alt:"",draggable:!1,style:a,onLoad:o,className:"block"}),(0,t.jsxs)("div",{ref:c,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(c.current?.setPointerCapture(e.pointerId),h.current=m(e),u(null))},onPointerMove:e=>{if(!h.current)return;let t=m(e);u((0,f.w)(h.current.x,h.current.y,t.x,t.y))},onPointerUp:x,onPointerCancel:x,children:[n.map((e,i)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:y(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:i+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":s.batchImport.removeRegion.replace("{index}",String(i+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>r(n.filter((e,t)=>t!==i)),children:(0,t.jsx)(g.X,{className:"h-3 w-3"})})]},i)),d&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:y(d)})]})]})}),y={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};y.node;let b=(0,n.f)(y),v={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};v.node;let C=(0,n.f)(v);function k({zoom:e,onZoomIn:i,onZoomOut:n,onReset:r}){let{t:a}=(0,p.b)(),o="outline-none focus-visible:ring-2 focus-visible:ring-white/70",l=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${o}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:l,onClick:n,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(C,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${o}`,onClick:r,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:l,onClick:i,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(b,{className:"h-4 w-4"})})]})}var j=e.i(201276),M=e.i(804536);let E="image-cropper-mode",N=["single","auto","multi"];e.s(["U",0,N,"p",0,E,"S",0,["image","text","file","direct"],"c",0,"question-input-mode","k",0,["image","text"]],271945);let D={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}},_=[{key:"thin",pixels:3},{key:"medium",pixels:7},{key:"thick",pixels:14}];e.s(["f",0,function({imageSrc:e,open:n,onClose:r,onCropComplete:l,onMultiCropComplete:g,onRegionsSelected:w,allowMulti:y=!0,onAutoSplit:b,onAddPart:v,partCount:C=0,eraseEnabled:R=!0}){let{t:S}=(0,p.b)(),L=(0,f.f)(e),[I,P]=(0,i.useState)({src:e,rotation:0}),H=I.src===e?I.rotation:0,[z,$]=(0,i.useState)(null),A=0===H?L:z&&z.src===L&&z.rotation===H?z.url:L;(0,i.useEffect)(()=>{if(!L||0===H)return;let e=!1,t=null,i=new Image;return i.decoding="async",i.src=L,i.decode().then(()=>{if(e)return;let n=(0,f.h)(i.naturalWidth,i.naturalHeight,{x:0,y:0,width:1,height:1,rotation:H}),r=(0,f.s)(i.naturalWidth,i.naturalHeight,H),a=document.createElement("canvas");a.width=r.width,a.height=r.height;let o=a.getContext("2d");o&&((0,f.D)(o,i,n,r.width,r.height),a.toBlob(i=>{i&&!e&&$({src:L,rotation:H,url:t=URL.createObjectURL(i)})},"image/jpeg",.9))}).catch(e=>{j.V.warn("[ImageCropper]","Rotate preview failed",{error:e})}),()=>{e=!0,t&&URL.revokeObjectURL(t)}},[L,H]);let[B,Y]=(0,i.useState)(),U=(0,i.useRef)(null),[O,X]=(0,M.y)(E,N,"single"),W=["single",...b?["auto"]:[],...g||w&&y?["multi"]:[]],T=W.includes(O)?O:"single",[F,K]=(0,i.useState)(null),G=null===F?D[T]:{...D[T],maxHeight:`${Math.max(0,F-16)}px`},{containerRef:V,container:q,zoom:Z,imageStyle:Q,measureImage:J,zoomIn:ee,zoomOut:et,reset:ei}=function(e){let[t,n]=(0,i.useState)(null),r=(0,i.useRef)(null),a=(0,i.useCallback)(e=>{r.current=e,n(e)},[]),[o,l]=(0,i.useState)(1),s=(0,i.useRef)(1),[c,h]=(0,i.useState)(null),d=(0,i.useRef)(null),u=(0,i.useRef)(!1),m=(0,i.useCallback)((e,t,i)=>{let n=r.current,a=s.current,o=Math.min(5,Math.max(1,e));if(!n||o===a)return;if(1===a){let e=n.querySelector("img");e&&h(e.clientWidth)}let c=n.getBoundingClientRect(),u=(t??c.left+c.width/2)-c.left,m=(i??c.top+c.height/2)-c.top;d.current={viewX:u,viewY:m,contentX:n.scrollLeft+u,contentY:n.scrollTop+m,ratio:o/a},s.current=o,l(o)},[]);(0,i.useLayoutEffect)(()=>{let e=r.current,t=d.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,d.current=null)},[o]),(0,i.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(s.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},i=null,n=e=>{let[t,i]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-i.clientX,t.clientY-i.clientY),centerX:(t.clientX+i.clientX)/2,centerY:(t.clientY+i.clientY)/2}},r=e=>{2===e.touches.length&&(i={distance:n(e.touches).distance,zoom:s.current},u.current=!0)},a=e=>{if(!i||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:r,centerY:a}=n(e.touches);i.distance>0&&m(i.zoom*(t/i.distance),r,a)},o=e=>{e.touches.length<2&&(i=null,u.current=!1)},l=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",r,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",l,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",r),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",l,{capture:!0})}},[t,m]);let g=(0,i.useCallback)(e=>{e&&1===s.current&&h(e.clientWidth)},[]),p=(0,i.useCallback)(()=>m(1.25*s.current),[m]),f=(0,i.useCallback)(()=>m(s.current/1.25),[m]),w=(0,i.useCallback)(()=>{s.current=1,d.current=null,l(1)},[]),x=1!==o&&c?{...e,width:c*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,container:t,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:f,reset:w}}(G);(0,i.useEffect)(()=>{ei()},[e,ei]),(0,i.useEffect)(()=>{if(!q)return;let e=new ResizeObserver(([e])=>K(e.contentRect.height));return e.observe(q),()=>e.disconnect()},[q]),(0,i.useEffect)(()=>{let e=q?.querySelector("img");J(e instanceof HTMLImageElement?e:null)},[q,G.maxHeight,Z,J]);let[en,er]=(0,i.useState)({src:e,regions:[]}),ea=en.src===e?en.regions:[],eo=t=>er({src:e,regions:t}),el=(0,i.useRef)(null),[es,ec]=(0,i.useState)({src:e,strokes:[]}),eh=(0,i.useMemo)(()=>es.src===e?es.strokes:[],[es,e]),ed=t=>ec(i=>({src:e,strokes:"function"==typeof t?t(i.strokes):t})),eu=t=>{P({src:e,rotation:((H+t)%360+360)%360}),Y(void 0),eo([]),ed([]),ei()},[em,eg]=(0,i.useState)(!1),[ep,ef]=(0,i.useState)("medium"),[ew,ex]=(0,i.useState)(0),ey=(0,i.useRef)(null),eb=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!R||"multi"===T)return;let e=ey.current,t=U.current;if(!e||!t||0===t.clientWidth)return;e.width=t.clientWidth,e.height=t.clientHeight;let i=e.getContext("2d");i&&(i.clearRect(0,0,e.width,e.height),(0,f.c)(i,eh,{width:e.width,height:e.height},{sx:0,sy:0,sw:e.width,sh:e.height},{width:e.width,height:e.height}))},[R,T,eh,ew,Z,e,G.maxHeight]),(0,i.useEffect)(()=>{eg(!1),eb.current=null},[e]);let ev=_.find(e=>e.key===ep)?.pixels??7,eC=e=>{let t=ey.current.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}},ek=()=>{eb.current=null},ej={single:S.batchImport.singleMode,auto:S.batchImport.autoMode,multi:S.batchImport.multiMode},eM={thin:S.common.cropper.brushThin,medium:S.common.cropper.brushMedium,thick:S.common.cropper.brushThick},eE=async()=>{if(0!==ea.length){if(w){w(ea.map(e=>({...e,rotation:H})),!0),eo([]);return}if(el.current&&g)try{g(await (0,f.Y)(el.current,ea.map(e=>({...e,rotation:0})))),eo([])}catch(e){j.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},eN=()=>({...B&&B.width>0&&B.height>0?{x:B.x/100,y:B.y/100,width:B.width/100,height:B.height/100}:{x:0,y:0,width:1,height:1},rotation:H,...eh.length?{erase:eh}:{}}),eD=async()=>{let e=eN();if("auto"===T&&b)return void b(e);if(w)return void w([e],!1);if(U.current&&l)try{let[t]=await (0,f.Y)(U.current,[{...e,rotation:0}]);l(t)}catch(e){j.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(m.N,{open:n,onOpenChange:e=>!e&&r(),children:(0,t.jsxs)(m.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(m.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(m.F,{children:S.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:V,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===T?(0,t.jsx)(x,{ref:el,imageSrc:A,regions:ea,onChange:eo,imageStyle:Q,onImageLoad:e=>J(e.currentTarget)}):(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)(d.f,{crop:B,onChange:(e,t)=>Y(t),disabled:em,children:(0,t.jsx)("img",{ref:U,alt:"Crop me",src:A,onLoad:function(e){Y({unit:"%",x:0,y:0,width:100,height:100}),J(e.currentTarget),ex(e=>e+1)},style:Q,className:"block"})}),R&&(0,t.jsx)("canvas",{ref:ey,"aria-hidden":!0,className:`absolute inset-0 ${em?"cursor-crosshair":"pointer-events-none"}`,style:{touchAction:"none"},onPointerDown:e=>{if(!em||0!==e.button)return;e.preventDefault(),ey.current?.setPointerCapture(e.pointerId);let t=ey.current;eb.current=eh.length,ed([...eh,{points:[eC(e)],radius:t?ev/t.clientWidth:.006}])},onPointerMove:e=>{let t=eb.current;if(null===t)return;let i=eC(e);ed(e=>e.map((e,n)=>{if(n!==t)return e;let r=e.points[e.points.length-1];return r&&5e-4>Math.abs(r.x-i.x)&&5e-4>Math.abs(r.y-i.y)?e:{...e,points:[...e.points,i]}}))},onPointerUp:ek,onPointerCancel:ek})]})})}),(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex gap-1 rounded-md bg-background/90 p-1 shadow-sm",children:[(0,t.jsx)(u.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>eu(-90),"aria-label":S.common.cropper.rotateLeft,title:S.common.cropper.rotateLeft,children:(0,t.jsx)(o.f,{className:"h-4 w-4"})}),(0,t.jsx)(u.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>eu(90),"aria-label":S.common.cropper.rotateRight,title:S.common.cropper.rotateRight,children:(0,t.jsx)(s,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(k,{zoom:Z,onZoomIn:ee,onZoomOut:et,onReset:ei})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[W.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===W.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:W.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":T===e,onClick:()=>{ei(),X(e),"multi"===e&&(eg(!1),ed([]))},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${T===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:ej[e]},e))}),R&&"multi"!==T&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(u.f,{variant:em?"secondary":"outline",size:"sm",onClick:()=>{eg(e=>!e),eb.current=null},className:"flex items-center gap-2",children:[(0,t.jsx)(a,{className:"h-4 w-4"}),em?S.common.cropper.eraseDone:S.common.cropper.erase]}),em&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-md bg-muted p-1",children:_.map(({key:e})=>(0,t.jsx)("button",{type:"button","aria-pressed":ep===e,onClick:()=>ef(e),className:`rounded px-2 py-1 text-xs font-medium ${ep===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:eM[e]},e))}),eh.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:()=>ed(eh.slice(0,-1)),className:"flex items-center gap-1.5",children:[(0,t.jsx)(h.f,{className:"h-4 w-4"}),S.common.cropper.undoErase]}),(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:()=>ed([]),className:"flex items-center gap-1.5",children:[(0,t.jsx)(c.f,{className:"h-4 w-4"}),S.common.cropper.clearErase]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===T?`${S.batchImport.hint} ${S.batchImport.regionCount.replace("{count}",String(ea.length))}`:em?S.common.cropper.eraseHint:"auto"===T?S.batchImport.autoHint:C>0?S.upload.parts.cropHint.replace("{n}",String(C+1)):S.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end",children:["multi"===T&&ea.length>0&&(0,t.jsx)(u.f,{variant:"ghost",onClick:()=>eo([]),children:S.batchImport.clear}),(0,t.jsx)(u.f,{variant:"outline",onClick:r,children:S.common.cancel||"Cancel"}),"multi"===T?(0,t.jsx)(u.f,{onClick:eE,disabled:0===ea.length,children:S.batchImport.start.replace("{count}",String(ea.length))}):(0,t.jsxs)(t.Fragment,{children:["single"===T&&v&&(0,t.jsx)(u.f,{variant:"secondary",onClick:()=>v(eN()),"data-testid":"crop-add-part",children:S.upload.parts.addNext}),(0,t.jsx)(u.f,{onClick:eD,children:"auto"===T?S.batchImport.autoStart:C>0?S.upload.parts.confirm.replace("{count}",String(C+1)):S.common.confirm||"Confirm"})]})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(456420);let r={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};r.node;let a=(0,n.f)(r);var o=e.i(772382),l=e.i(511445),s=e.i(624687),c=e.i(111110),h=e.i(975157);e.s(["f",0,function({value:e,onChange:n,className:r,...d}){let{t:u}=(0,c.b)(),[m,g]=(0,i.useState)("source"),p=(0,i.useId)(),f=[{mode:"source",label:u.markdownEditor.source,icon:a},{mode:"preview",label:u.markdownEditor.preview,icon:o.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:f.map(({mode:e,label:i,icon:n})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,h.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(n,{className:"h-3.5 w-3.5"}),i]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(s.f,{value:e,onChange:e=>n(e.target.value),className:r,...d}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(967489),r=e.i(856423),a=e.i(41931),o=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:s,className:c}){let[h,d]=(0,i.useState)([]),{t:u}=(0,l.b)();return(0,i.useEffect)(()=>{(async()=>{try{let e=await a.k.get("/api/notebooks");d(e)}catch(e){o.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(n.d,{value:e,onValueChange:s,children:[(0,t.jsx)(n.P,{className:c,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(n.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(n.r,{children:0===h.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):h.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}])},674166,e=>{var t=e.i(843476),i=e.i(967489),n=e.i(470279);e.s(["f",0,function({value:e,onChange:r,disabled:a}){let{groups:o,loading:l}=(0,n.f)(),s=o.filter(e=>e.isActive);return(0,t.jsxs)(i.d,{value:e,onValueChange:r,disabled:a||l,children:[(0,t.jsx)(i.P,{children:(0,t.jsx)(i.U,{placeholder:"选择卷别"})}),(0,t.jsx)(i.r,{children:s.map(e=>(0,t.jsx)(i.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),i=e.i(111110),n=e.i(398019),r=e.i(184110),a=e.i(975157);let o={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:s,className:c}){let{t:h}=(0,i.b)();if(!e)return null;let d=(0,r.V)(l),u=(0,r.o)(s);return(0,t.jsx)("figure",{className:(0,a.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,n.d)(e),alt:h.figure.alt,className:(0,a.f)(o[u],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===u?{marginLeft:0,marginRight:"auto"}:"right"===u?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:d/100,maxWidth:`${Math.min(d,100)}%`}})})}])},574041,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(263676),r=e.i(487486),a=e.i(793479),o=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:s,placeholder:c="Enter tags...",className:h="",enterHint:d,subject:u,gradeStage:m}){let[g,p]=(0,i.useState)(""),[f,w]=(0,i.useState)([]),[x,y]=(0,i.useState)(!1),[b,v]=(0,i.useState)(0),C=(0,i.useRef)(null),k=(0,i.useRef)(null),j=(0,i.useCallback)(async t=>{try{let i=new URLSearchParams({q:t});u&&i.append("subject",u),m&&i.append("stage",m);let n=((await o.k.get(`/api/tags/suggestions?${i.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(n.slice(0,20)),y(n.length>0),v(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,i.useEffect)(()=>{g.trim()&&j(g)},[g,j]);let M=t=>{t.trim()&&!e.includes(t.trim())&&(s([...e,t.trim()]),p(""),w([]),y(!1),v(0))},E=t=>{s(e.filter(e=>e!==t))};return(0,i.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||C.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${h}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(r.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>E(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(n.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(a.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&f[b]?M(f[b]):g.trim()&&M(g)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),v(0)):"Backspace"===t.key&&!g&&e.length>0&&E(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?c:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,i)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${i===b?"bg-accent":""}`,onClick:()=>M(e),onMouseEnter:()=>v(i),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:d?`${d} "${g}"`:`Press Enter to create "${g}"`})]})}])},184110,e=>{let t=["left","center","right"],i="center";function n(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,i,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,n,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:i},"V",0,function(e){return n(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},804536,e=>{var t=e.i(271645);let i=new Map,n=new Set;function r(e){return n.add(e),window.addEventListener("storage",e),()=>{n.delete(e),window.removeEventListener("storage",e)}}function a(e,a,o){let l=(0,t.useSyncExternalStore)(r,()=>(function(e){if(i.has(e))return i.get(e)??null;try{return window.localStorage.getItem(e)}catch{return null}})(e),()=>null);return[(0,t.useMemo)(()=>a(l),[a,l]),(0,t.useCallback)(t=>(function(e,t){try{window.localStorage.setItem(e,t),i.delete(e)}catch{i.set(e,t)}n.forEach(e=>e())})(e,o(t)),[e,o])]}let o=e=>e;e.s(["y",0,function(e,i,n){return a(e,(0,t.useCallback)(e=>i.includes(e??"")?e:n,[i,n]),o)},"x",0,a])},213761,895133,e=>{let t=[0,90,180,270];function i(e,t,n=0){let r=90===n||270===n;return{width:r?t:e,height:r?e:t}}function n(e,n,r){let a,o,l,s,c=t.includes(r.rotation??0)?r.rotation??0:0,h=i(e,n,c),d=e=>Math.min(1,Math.max(0,e)),u=Math.round(d(r.x)*h.width),m=Math.round(d(r.y)*h.height),g=Math.max(1,Math.min(h.width-u,Math.round(d(r.width)*h.width))),p=Math.max(1,Math.min(h.height-m,Math.round(d(r.height)*h.height)));switch(c){case 90:a=m,o=h.width-u-g,l=p,s=g;break;case 180:a=e-u-g,o=n-m-p,l=g,s=p;break;case 270:a=e-m-p,o=u,l=p,s=g;break;default:a=u,o=m,l=g,s=p}return{rotation:c,frameWidth:h.width,frameHeight:h.height,fx:u,fy:m,fw:g,fh:p,sx:a,sy:o,sw:l,sh:s,outputWidth:g,outputHeight:p}}function r(e,t,i,n,r){if(0===t.length)return;let a=r.width/n.sw,o=r.height/n.sh;for(let r of(e.save(),e.fillStyle="#ffffff",e.strokeStyle="#ffffff",e.lineCap="round",e.lineJoin="round",t)){if(0===r.points.length)continue;let t=r.points.map(e=>({x:(e.x*i.width-n.sx)*a,y:(e.y*i.height-n.sy)*o})),l=Math.max(.5,r.radius*i.width*a);if(1===t.length){e.beginPath(),e.arc(t[0].x,t[0].y,l,0,2*Math.PI),e.fill();continue}for(let i of(e.beginPath(),e.moveTo(t[0].x,t[0].y),t.slice(1)))e.lineTo(i.x,i.y);e.lineWidth=2*l,e.stroke()}e.restore()}function a(e,t,i,n,o,l=[]){switch(e.fillStyle="#ffffff",e.fillRect(0,0,n,o),e.imageSmoothingEnabled=!0,e.imageSmoothingQuality="high",e.save(),i.rotation){case 90:e.translate(n,0),e.rotate(Math.PI/2);break;case 180:e.translate(n,o),e.rotate(Math.PI);break;case 270:e.translate(0,o),e.rotate(-Math.PI/2)}let s=90===i.rotation||270===i.rotation;e.drawImage(t,i.sx,i.sy,i.sw,i.sh,0,0,s?o:n,s?n:o),e.restore(),r(e,l,{width:i.frameWidth,height:i.frameHeight},{sx:i.fx,sy:i.fy,sw:i.fw,sh:i.fh},{width:n,height:o})}async function o(e,t){let{naturalWidth:i,naturalHeight:r}=e;return Promise.all(t.map(t=>new Promise((o,l)=>{let s=n(i,r,t),c=document.createElement("canvas");c.width=s.outputWidth,c.height=s.outputHeight;let h=c.getContext("2d");h?(a(h,e,s,s.outputWidth,s.outputHeight,t.erase??[]),c.toBlob(e=>e?o(e):l(Error("Canvas is empty")),"image/jpeg",.95)):l(Error("Canvas is not supported"))})))}e.s(["c",0,function(e,t,i,n,a){r(e,t,i,n,a)},"B",0,function(e){let t=e.match(/^data:(image\/(?:png|jpe?g|webp|gif));base64,([\s\S]+)$/);if(!t)return null;try{let e=atob(t[2]),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return new Blob([i],{type:t[1]})}catch{return null}},"Y",0,o,"D",0,a,"w",0,function(e,t,i,n){let r=e=>Math.min(1,Math.max(0,e)),a=r(Math.min(e,i)),o=r(Math.min(t,n));return{x:a,y:o,width:r(Math.max(e,i))-a,height:r(Math.max(t,n))-o}},"h",0,n,"s",0,i,"f",0,function(e){return/^(blob:|data:image\/)/i.test(e)?e:void 0}],895133);let l={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class s extends Error{code;format;constructor(e,t,i){super(e,void 0===i?void 0:{cause:i}),this.code=e,this.format=t,this.name="ImageDecodeError"}}let c=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),h=new Set(["mif1","msf1","mif2"]),d=new Set(["avif","avis"]);function u(e,t,i=l){let n=Math.min(1,i.maxLongEdge/Math.max(e,t),Math.sqrt(i.maxPixels/Math.max(1,e*t)));return{width:Math.max(1,Math.floor(e*n)),height:Math.max(1,Math.floor(t*n)),scale:n}}async function m(e){let t,i;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let n=await (t=URL.createObjectURL(e),(i=new Image).decoding="async",new Promise((e,n)=>{i.onload=()=>e(i),i.onerror=()=>n(Error("IMAGE_ELEMENT_DECODE_FAILED")),i.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!n.naturalWidth||!n.naturalHeight)throw Error("IMAGE_EMPTY");return n}async function g(t){let{heicTo:i}=await e.A(462684);return i({blob:t,type:"image/jpeg",quality:.95})}function p(e,t){return new Promise((i,n)=>{e.toBlob(e=>e?i(e):n(Error("CANVAS_EMPTY")),"image/jpeg",t)})}function f(e,t,i,n,r){let o,l=((o=document.createElement("canvas")).width=i,o.height=n,o),s=l.getContext("2d");if(!s)throw Error("CANVAS_UNSUPPORTED");return a(s,e,t,i,n,r),l}async function w(e,t){var i;let r,a=performance.now(),o=await e.arrayBuffer(),l=performance.now()-a,w=function(e){let t=(t,i)=>String.fromCharCode(...e.subarray(t,i));if(e.length>=3&&255===e[0]&&216===e[1]&&255===e[2])return"jpeg";if(e.length>=8&&137===e[0]&&"PNG"===t(1,4))return"png";if(e.length>=12&&"RIFF"===t(0,4)&&"WEBP"===t(8,12))return"webp";if(e.length>=6&&("GIF87a"===t(0,6)||"GIF89a"===t(0,6)))return"gif";if(e.length>=2&&"BM"===t(0,2))return"bmp";if(e.length>=12&&"ftyp"===t(4,8)){let i=Math.min(e.length,(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0||e.length),n=[t(8,12)];for(let e=16;e+4<=i;e+=4)n.push(t(e,e+4));if(n.some(e=>c.has(e)))return"heic";if(n.some(e=>d.has(e)))return"avif";if(n.some(e=>h.has(e)))return"heic"}return"unknown"}(new Uint8Array(o,0,Math.min(o.byteLength,64))),y=e.type||"",b=performance.now(),v="native",C=new Blob([o],{type:y||"application/octet-stream"});try{r=await m(C)}catch(e){if("heic"!==w)throw new s("unknown"===w?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",w,e);t?.();try{r=await m(await g(C)),v="heic"}catch(e){throw new s("HEIC_DECODE_FAILED",w,e)}}let{width:k,height:j}=(i=r)instanceof HTMLImageElement?{width:i.naturalWidth,height:i.naturalHeight}:{width:i.width,height:i.height};if(!k||!j)throw new s("IMAGE_DECODE_FAILED",w);let M=u(k,j,{maxLongEdge:1600,maxPixels:1/0}),E=n(k,j,x),N=await p(f(r,E,M.width,M.height),.85),D=URL.createObjectURL(N),_=performance.now()-b;return{source:r,width:k,height:j,format:w,decoder:v,previewUrl:D,sourceType:y,sourceBytes:e.size,timings:{read:Math.round(l),convert:Math.round(_)},dispose:()=>{URL.revokeObjectURL(D),r instanceof HTMLImageElement||r.close()}}}let x={x:0,y:0,width:1,height:1};async function y(e,t=x,i=l){var r;let a=performance.now(),o=n(e.width,e.height,t),s=u(o.outputWidth,o.outputHeight,i),c=f(e.source,o,s.width,s.height,t.erase),h=performance.now()-a,d=performance.now(),m=i.startQuality,g=await p(c,m);for(let n=0;g.size>i.maxBytes&&n<12;n++)m-.05>=i.minQuality-1e-9?m=Math.round((m-.05)*100)/100:(s={width:Math.max(1,Math.floor(.85*s.width)),height:Math.max(1,Math.floor(.85*s.height)),scale:.85*s.scale},c=f(e.source,o,s.width,s.height,t.erase)),g=await p(c,m);return{dataUrl:await (r=g,new Promise((e,t)=>{let i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>t(i.error??Error("READ_FAILED")),i.readAsDataURL(r)})),width:s.width,height:s.height,bytes:g.size,quality:m,timings:{crop:Math.round(h),compress:Math.round(performance.now()-d)}}}e.s(["K",0,l,"o",0,s,"N",0,function(e,t){return{sourceType:e.sourceType||e.format,sourceBytes:e.sourceBytes,sourceWidth:e.width,sourceHeight:e.height,outputWidth:t.width,outputHeight:t.height,outputBytes:t.bytes,decoder:e.decoder,quality:t.quality}},"p",0,w,"X",0,y],213761)},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,i="zh"){return("en"===i?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,i){return(i||"").trim()?"wrong_attempt":t(e)}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let i=e.trim().toLowerCase();return i?t[i]??null:null}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,314381,3198,e=>{var t=e.i(456420);let i={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],314381);var r=e.i(843476),a=e.i(271645),o=e.i(632781);let l={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};l.node;let s=(0,t.f)(l),c={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};c.node;let h=(0,t.f)(c);var d=e.i(395925),u=e.i(741120),m=e.i(759659),g=e.i(519455),p=e.i(111110),f=e.i(294114),w=e.i(201276),x=e.i(113381);let y=null;function b(e,t,i){let n=e?.firstElementChild;n&&(n.style.width="100%",n.style.height=`${i}px`,t?.setSize(e?.offsetWidth||n.offsetWidth||800,i))}function v(e,t){let i=(0,x.L)(e,t);for(let e of i)w.V.warn("[GGB]","命令执行失败",{...e});return i.map(e=>e.command+":"+e.message).join("\n")||void 0}e.s(["f",0,function({commands:e,height:t=700,showToolBar:i=!1,showAlgebraInput:n=!1,showMenuBar:l=!1,className:c="",onRegenerate:C,onDelete:k}){let{t:j}=(0,p.b)(),M=(0,a.useRef)(null),E=(0,a.useRef)(null),N=(0,a.useRef)(void 0),D=(0,a.useId)(),_=(0,a.useRef)(`ggb-${D.replace(/[^a-zA-Z0-9_-]/g,"")}`),[R,S]=(0,a.useState)(!0),[L,I]=(0,a.useState)(null),[P,H]=(0,a.useState)(!0),[z,$]=(0,a.useState)(!1),[A,B]=(0,a.useState)(!1),Y=(0,a.useMemo)(()=>(0,x.i)(e),[e]);(0,a.useEffect)(()=>{if(0===Y.length)return;let e=!1,r=_.current,a=M.current;return(y||(y=new Promise((e,t)=>{if(window.GGBApplet)return void e();let i=document.createElement("script");i.src="https://www.geogebra.org/apps/deployggb.js",i.async=!0,i.onload=()=>e(),i.onerror=()=>{y=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(i)}))).then(()=>{if(e)return;let o=window.GGBApplet;if(!o){I(j.geogebra.notLoaded),S(!1);return}if(a){a.innerHTML=`<div id="${r}" style="width:100%;height:${t}px"></div>`;try{new o({appName:"classic",width:"100%",height:t,showToolBar:i,showAlgebraInput:n,showMenuBar:l,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:i=>{e||(E.current=i,b(a,i,t),N.current=v(i,Y),S(!1))}},!0).inject(r)}catch(t){w.V.error("[GGB]","Init failed",{error:t}),e||(I(j.geogebra.initFailed),S(!1))}}}).catch(t=>{w.V.error("[GGB]","Script load failed",{error:t}),e||(I(j.geogebra.scriptFailed),S(!1))}),()=>{e=!0;try{let e=E.current;e?.remove&&e.remove()}catch(e){w.V.warn("[GGB]","Cleanup failed",{error:e})}E.current=null,a&&(a.innerHTML="")}},[Y,i,n,l]),(0,a.useEffect)(()=>{b(M.current,E.current,P?700:t)},[P,t]);let U=(0,a.useCallback)(()=>{let e=E.current;if(e)try{e.resetConstruction(),setTimeout(()=>{E.current&&(N.current=v(E.current,Y))},300)}catch(e){w.V.warn("[GGB]","Reset failed",{error:e})}},[Y]),O=(0,a.useCallback)(async()=>{if(C&&!z){$(!0);try{await C(N.current)}finally{$(!1)}}},[C,z]),X=(0,a.useCallback)(async()=>{if(k&&!A&&await (0,f.u)(j.geogebra.confirmDelete,{destructive:!0})){B(!0);try{await k()}catch{f.c.error(j.geogebra.deleteFailed)}finally{B(!1)}}},[k,A,j]);return 0===Y.length?null:(0,r.jsxs)("div",{className:`relative rounded-lg border bg-card ${c}`,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:j.geogebra.title}),R&&(0,r.jsx)(o.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[C&&(0,r.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:O,title:j.geogebra.regenerate,disabled:z||R,children:[z?(0,r.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(u.f,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:j.geogebra.regenerate})]}),k&&(0,r.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:X,title:j.geogebra.delete,disabled:A||z,children:[A?(0,r.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:j.geogebra.delete})]}),(0,r.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:U,title:j.geogebra.reset,disabled:R,children:(0,r.jsx)(d.f,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>H(e=>!e),title:P?j.geogebra.shrink:j.geogebra.enlarge,children:P?(0,r.jsx)(h,{className:"h-3.5 w-3.5"}):(0,r.jsx)(s,{className:"h-3.5 w-3.5"})})]})]}),(0,r.jsx)("div",{ref:M,style:{width:"100%"}}),R&&(0,r.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,r.jsx)(o.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:j.geogebra.loading})]})}),L&&(0,r.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:L})]})}],3198)},856522,e=>{var t=e.i(456420);let i={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],856522)},786563,e=>{var t=e.i(456420);let i={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],786563)},837817,232660,e=>{var t=e.i(456420);let i={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],837817);var r=e.i(271645),a={x:0,y:0,width:0,height:0,unit:"px"},o=(e,t,i)=>Math.min(Math.max(e,t),i),l=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function s(e,t,i){return"%"===e.unit?{...a,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/i*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/i*100:0}}function c(e,t,i){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*i/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*i/100:0}:{...a,...e,unit:"px"}}function h(e,t,i,n,r,a=0,o=0,l=n,s=r){let c={...e},d=Math.min(a,n),u=Math.min(o,r),m=Math.min(l,n),g=Math.min(s,r);t&&(t>1?(u=(d=o?o*t:d)/t,m=l*t):(d=(u=a?a/t:u)*t,g=s/t)),c.y<0&&(c.height=Math.max(c.height+c.y,u),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,d),c.x=0);let p=n-(c.x+c.width);p<0&&(c.x=Math.min(c.x,n-d),c.width+=p);let f=r-(c.y+c.height);if(f<0&&(c.y=Math.min(c.y,r-u),c.height+=f),c.width<d&&(("sw"===i||"nw"==i)&&(c.x-=d-c.width),c.width=d),c.height<u&&(("nw"===i||"ne"==i)&&(c.y-=u-c.height),c.height=u),c.width>m&&(("sw"===i||"nw"==i)&&(c.x-=m-c.width),c.width=m),c.height>g&&(("nw"===i||"ne"==i)&&(c.y-=g-c.height),c.height=g),t){let e=c.width/c.height;if(e<t){let e=Math.max(c.width/t,u);("nw"===i||"ne"==i)&&(c.y-=e-c.height),c.height=e}else if(e>t){let e=Math.max(c.height*t,d);("sw"===i||"nw"==i)&&(c.x-=e-c.width),c.width=e}}return c}var d={capture:!0,passive:!1},u=0,m=class e extends r.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,r.createRef)();mediaRef=(0,r.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${u++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:i,width:n,height:r}=e.getBoundingClientRect();return{x:t,y:i,width:n,height:r}}componentDidUpdate(e){let{crop:t,onComplete:i}=this.props;if(i&&!e.crop&&t){let{width:e,height:n}=this.getBox();e&&n&&i(c(t,e,n),s(t,e,n))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,d),this.document.addEventListener("pointerup",this.onDocPointerDone,d),this.document.addEventListener("pointercancel",this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,d),this.document.removeEventListener("pointerup",this.onDocPointerDone,d),this.document.removeEventListener("pointercancel",this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:i}=this.props,n=this.getBox();if(!t)return;let r=c(t,n.width,n.height);if(i)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=e.clientX,l=e.clientY,s=r.x,h=r.y;if(a){let t=e.clientX-n.x,i=e.clientY-n.y,c=0,d=0;"ne"===a||"e"==a?(c=t-(r.x+r.width),d=i-r.y,s=r.x,h=r.y+r.height):"se"===a||"s"===a?(c=t-(r.x+r.width),d=i-(r.y+r.height),s=r.x,h=r.y):"sw"===a||"w"==a?(c=t-r.x,d=i-(r.y+r.height),s=r.x+r.width,h=r.y):("nw"===a||"n"==a)&&(c=t-r.x,d=i-r.y,s=r.x+r.width,h=r.y+r.height),o=s+n.x+c,l=h+n.y+d}this.evData={startClientX:o,startClientY:l,startCropX:s,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:i,locked:n,keepSelection:r,onChange:a}=this.props,o=this.getBox();if(i||n||r&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-o.x,h=e.clientY-o.y,d={unit:"px",x:l,y:h,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(c(d,o.width,o.height),s(d,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:i,disabled:n,onChange:r,onDragStart:a}=this.props,o=this.getBox();if(n||!i||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));let{evData:h}=this;h.clientX=e.clientX,h.clientY=e.clientY,l(i,t=h.isResize?this.resizeCrop():this.dragCrop())||r(c(t,o.width,o.height),s(t,o.width,o.height))};onComponentKeyDown=t=>{let{crop:i,disabled:n,onChange:r,onComplete:a}=this.props;if(n)return;let l=t.key,h=!1;if(!i)return;let d=this.getBox(),u=this.makePixelCrop(d),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===l?(u.x-=m,h=!0):"ArrowRight"===l?(u.x+=m,h=!0):"ArrowUp"===l?(u.y-=m,h=!0):"ArrowDown"===l&&(u.y+=m,h=!0),h){t.cancelable&&t.preventDefault(),u.x=o(u.x,0,d.width-u.width),u.y=o(u.y,0,d.height-u.height);let e=c(u,d.width,d.height),i=s(u,d.width,d.height);r(e,i),a&&a(e,i)}};onHandlerKeyDown=(t,i)=>{var n,r;let a,{aspect:o=0,crop:d,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(u||!d||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=h((n=c(d,y.width,y.height),r=t.key,a={...n},"ArrowLeft"===r?"nw"===i?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"w"===i?(a.x-=b,a.width+=b):"sw"===i?(a.x-=b,a.width+=b,a.height+=b):"ne"===i?(a.y+=b,a.width-=b,a.height-=b):"e"===i?a.width-=b:"se"===i&&(a.width-=b,a.height-=b):"ArrowRight"===r&&("nw"===i?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"w"===i?(a.x+=b,a.width-=b):"sw"===i?(a.x+=b,a.width-=b,a.height-=b):"ne"===i?(a.y-=b,a.width+=b,a.height+=b):"e"===i?a.width+=b:"se"===i&&(a.width+=b,a.height+=b)),"ArrowUp"===r?"nw"===i?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"n"===i?(a.y-=b,a.height+=b):"ne"===i?(a.y-=b,a.width+=b,a.height+=b):"sw"===i?(a.x+=b,a.width-=b,a.height-=b):"s"===i?a.height-=b:"se"===i&&(a.width-=b,a.height-=b):"ArrowDown"===r&&("nw"===i?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"n"===i?(a.y+=b,a.height-=b):"ne"===i?(a.y+=b,a.width-=b,a.height-=b):"sw"===i?(a.x-=b,a.width+=b,a.height+=b):"s"===i?a.height+=b:"se"===i&&(a.width+=b,a.height+=b)),a),o,i,y.width,y.height,m,g,p,f);if(!l(d,v)){let e=s(v,y.width,y.height);w(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:i,onComplete:n,onDragEnd:r}=this.props,a=this.getBox();this.unbindDocMove(),!(i||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,r&&r(e),n&&n(c(t,a.width,a.height),s(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),i=this.makePixelCrop(t),n=e.clientX-e.startClientX,r=e.clientY-e.startClientY;return i.x=o(e.startCropX+n,0,t.width-i.width),i.y=o(e.startCropY+r,0,t.height-i.height),i}getPointRegion(e,t,i,n){let{evData:r}=this,a=r.clientX-e.x,o=r.clientY-e.y,l;return l=n&&t?"nw"===t||"n"===t||"ne"===t:o<r.startCropY,(i&&t?"nw"===t||"w"===t||"sw"===t:a<r.startCropX)?l?"nw":"sw":l?"ne":"se"}resolveMinDimensions(e,t,i=0,n=0){let r=Math.min(i,e.width),a=Math.min(n,e.height);return t&&(r||a)?t>1?r?[r,r/t]:[a*t,a]:a?[a*t,a]:[r,r/t]:[r,a]}resizeCrop(){let{evData:t}=this,{aspect:i=0,maxWidth:n,maxHeight:r}=this.props,a=this.getBox(),[l,s]=this.resolveMinDimensions(a,i,this.props.minWidth,this.props.minHeight),c=this.makePixelCrop(a),d=this.getPointRegion(a,t.ord,l,s),u=t.ord||d,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(l&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-l)),(s&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-s));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===d?(p.x=t.startCropX,p.width=m,i?p.height=p.width/i:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===d?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,i?p.height=p.width/i:p.height=g):"sw"===d?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),i?p.height=p.width/i:p.height=g):"nw"===d&&(p.x=t.startCropX+m,p.width=Math.abs(m),i?(p.height=p.width/i,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=h(p,i,d,a.width,a.height,l,s,n,r);return i||e.xyOrds.indexOf(u)>-1?c=f:e.xOrds.indexOf(u)>-1?(c.x=f.x,c.width=f.width):e.yOrds.indexOf(u)>-1&&(c.y=f.y,c.height=f.height),c.x=o(c.x,0,a.width-c.width),c.y=o(c.y,0,a.height-c.height),c}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:i,locked:n,renderSelectionAddon:a,ruleOfThirds:o,crop:l}=this.props,s=this.getCropStyle();if(l)return r.default.createElement("div",{style:s,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!i&&!n&&r.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},r.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),r.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),r.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&r.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),r.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return c({...a,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:i,className:n,crop:a,disabled:o,locked:l,style:s,ruleOfThirds:c}=this.props,{cropIsActive:h,newCropIsBeingDrawn:d}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",n,h&&"ReactCrop--active",o&&"ReactCrop--disabled",l&&"ReactCrop--locked",d&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&i&&"ReactCrop--circular-crop",a&&c&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",i&&"ReactCrop--no-animate");return r.default.createElement("div",{ref:this.componentRef,className:m,style:s},r.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?r.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},r.default.createElement("defs",null,r.default.createElement("mask",{id:`hole-${this.instanceId}`},r.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),i?r.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):r.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),r.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};e.s(["f",0,m],232660)},469937,e=>{var t=e.i(843476),i=e.i(786563),n=e.i(111110),r=e.i(975157);let a=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:o,disabled:l,size:s="sm",showUnrated:c=!0,className:h}){let{t:d}=(0,n.b)(),u=e??0,m="sm"===s?"h-3.5 w-3.5":"h-5 w-5",g=u?d.difficulty.starsLabel.replace("{n}",String(u)):d.difficulty.unrated;return o?(0,t.jsxs)("span",{className:(0,r.f)("inline-flex items-center gap-0.5",h),role:"group","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:d.difficulty.clearHint,children:[a.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>o(e===u?null:e),"aria-label":d.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(i.f,{className:(0,r.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&c&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:d.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,r.f)("inline-flex items-center",h),role:"img","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:g,children:a.map(e=>(0,t.jsx)(i.f,{className:(0,r.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):c?(0,t.jsx)("span",{className:(0,r.f)("text-xs text-muted-foreground",h),children:d.difficulty.unrated}):null}])},12130,271945,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(456420);let r={name:"eraser",size:24,node:[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]};r.node;let a=(0,n.f)(r);var o=e.i(395925);let l={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};l.node;let s=(0,n.f)(l);var c=e.i(759659),h=e.i(837817),d=e.i(232660),u=e.i(519455),m=e.i(776639),g=e.i(263676),p=e.i(111110),f=e.i(895133);let w={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},x=(0,i.forwardRef)(function({imageSrc:e,regions:n,onChange:r,imageStyle:a=w,onImageLoad:o},l){let{t:s}=(0,p.b)(),c=(0,i.useRef)(null),h=(0,i.useRef)(null),[d,u]=(0,i.useState)(null),m=e=>{let t=c.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},x=()=>{d&&d.width>=.02&&d.height>=.02&&r([...n,d]),h.current=null,u(null)},y=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:l,src:e,alt:"",draggable:!1,style:a,onLoad:o,className:"block"}),(0,t.jsxs)("div",{ref:c,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(c.current?.setPointerCapture(e.pointerId),h.current=m(e),u(null))},onPointerMove:e=>{if(!h.current)return;let t=m(e);u((0,f.w)(h.current.x,h.current.y,t.x,t.y))},onPointerUp:x,onPointerCancel:x,children:[n.map((e,i)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:y(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:i+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":s.batchImport.removeRegion.replace("{index}",String(i+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>r(n.filter((e,t)=>t!==i)),children:(0,t.jsx)(g.X,{className:"h-3 w-3"})})]},i)),d&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:y(d)})]})]})}),y={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};y.node;let b=(0,n.f)(y),v={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};v.node;let C=(0,n.f)(v);function k({zoom:e,onZoomIn:i,onZoomOut:n,onReset:r}){let{t:a}=(0,p.b)(),o="outline-none focus-visible:ring-2 focus-visible:ring-white/70",l=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${o}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:l,onClick:n,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(C,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${o}`,onClick:r,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:l,onClick:i,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(b,{className:"h-4 w-4"})})]})}var j=e.i(201276),M=e.i(804536);let E="image-cropper-mode",N=["single","auto","multi"];e.s(["U",0,N,"p",0,E,"S",0,["image","text","file","direct"],"c",0,"question-input-mode","k",0,["image","text"]],271945);let D={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}},_=[{key:"thin",pixels:3},{key:"medium",pixels:7},{key:"thick",pixels:14}];e.s(["f",0,function({imageSrc:e,open:n,onClose:r,onCropComplete:l,onMultiCropComplete:g,onRegionsSelected:w,allowMulti:y=!0,onAutoSplit:b,onAddPart:v,partCount:C=0,eraseEnabled:R=!0}){let{t:S}=(0,p.b)(),L=(0,f.f)(e),[I,P]=(0,i.useState)({src:e,rotation:0}),H=I.src===e?I.rotation:0,[z,$]=(0,i.useState)(null),A=0===H?L:z&&z.src===L&&z.rotation===H?z.url:L;(0,i.useEffect)(()=>{if(!L||0===H)return;let e=!1,t=null,i=new Image;return i.decoding="async",i.src=L,i.decode().then(()=>{if(e)return;let n=(0,f.h)(i.naturalWidth,i.naturalHeight,{x:0,y:0,width:1,height:1,rotation:H}),r=(0,f.s)(i.naturalWidth,i.naturalHeight,H),a=document.createElement("canvas");a.width=r.width,a.height=r.height;let o=a.getContext("2d");o&&((0,f.D)(o,i,n,r.width,r.height),a.toBlob(i=>{i&&!e&&$({src:L,rotation:H,url:t=URL.createObjectURL(i)})},"image/jpeg",.9))}).catch(e=>{j.V.warn("[ImageCropper]","Rotate preview failed",{error:e})}),()=>{e=!0,t&&URL.revokeObjectURL(t)}},[L,H]);let[B,Y]=(0,i.useState)(),U=(0,i.useRef)(null),[O,X]=(0,M.y)(E,N,"single"),W=["single",...b?["auto"]:[],...g||w&&y?["multi"]:[]],T=W.includes(O)?O:"single",[F,K]=(0,i.useState)(null),G=null===F?D[T]:{...D[T],maxHeight:`${Math.max(0,F-16)}px`},{containerRef:V,container:q,zoom:Z,imageStyle:Q,measureImage:J,zoomIn:ee,zoomOut:et,reset:ei}=function(e){let[t,n]=(0,i.useState)(null),r=(0,i.useRef)(null),a=(0,i.useCallback)(e=>{r.current=e,n(e)},[]),[o,l]=(0,i.useState)(1),s=(0,i.useRef)(1),[c,h]=(0,i.useState)(null),d=(0,i.useRef)(null),u=(0,i.useRef)(!1),m=(0,i.useCallback)((e,t,i)=>{let n=r.current,a=s.current,o=Math.min(5,Math.max(1,e));if(!n||o===a)return;if(1===a){let e=n.querySelector("img");e&&h(e.clientWidth)}let c=n.getBoundingClientRect(),u=(t??c.left+c.width/2)-c.left,m=(i??c.top+c.height/2)-c.top;d.current={viewX:u,viewY:m,contentX:n.scrollLeft+u,contentY:n.scrollTop+m,ratio:o/a},s.current=o,l(o)},[]);(0,i.useLayoutEffect)(()=>{let e=r.current,t=d.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,d.current=null)},[o]),(0,i.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(s.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},i=null,n=e=>{let[t,i]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-i.clientX,t.clientY-i.clientY),centerX:(t.clientX+i.clientX)/2,centerY:(t.clientY+i.clientY)/2}},r=e=>{2===e.touches.length&&(i={distance:n(e.touches).distance,zoom:s.current},u.current=!0)},a=e=>{if(!i||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:r,centerY:a}=n(e.touches);i.distance>0&&m(i.zoom*(t/i.distance),r,a)},o=e=>{e.touches.length<2&&(i=null,u.current=!1)},l=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",r,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",l,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",r),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",l,{capture:!0})}},[t,m]);let g=(0,i.useCallback)(e=>{e&&1===s.current&&h(e.clientWidth)},[]),p=(0,i.useCallback)(()=>m(1.25*s.current),[m]),f=(0,i.useCallback)(()=>m(s.current/1.25),[m]),w=(0,i.useCallback)(()=>{s.current=1,d.current=null,l(1)},[]),x=1!==o&&c?{...e,width:c*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,container:t,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:f,reset:w}}(G);(0,i.useEffect)(()=>{ei()},[e,ei]),(0,i.useEffect)(()=>{if(!q)return;let e=new ResizeObserver(([e])=>K(e.contentRect.height));return e.observe(q),()=>e.disconnect()},[q]),(0,i.useEffect)(()=>{let e=q?.querySelector("img");J(e instanceof HTMLImageElement?e:null)},[q,G.maxHeight,Z,J]);let[en,er]=(0,i.useState)({src:e,regions:[]}),ea=en.src===e?en.regions:[],eo=t=>er({src:e,regions:t}),el=(0,i.useRef)(null),[es,ec]=(0,i.useState)({src:e,strokes:[]}),eh=(0,i.useMemo)(()=>es.src===e?es.strokes:[],[es,e]),ed=t=>ec(i=>({src:e,strokes:"function"==typeof t?t(i.strokes):t})),eu=t=>{P({src:e,rotation:((H+t)%360+360)%360}),Y(void 0),eo([]),ed([]),ei()},[em,eg]=(0,i.useState)(!1),[ep,ef]=(0,i.useState)("medium"),[ew,ex]=(0,i.useState)(0),ey=(0,i.useRef)(null),eb=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!R||"multi"===T)return;let e=ey.current,t=U.current;if(!e||!t||0===t.clientWidth)return;e.width=t.clientWidth,e.height=t.clientHeight;let i=e.getContext("2d");i&&(i.clearRect(0,0,e.width,e.height),(0,f.c)(i,eh,{width:e.width,height:e.height},{sx:0,sy:0,sw:e.width,sh:e.height},{width:e.width,height:e.height}))},[R,T,eh,ew,Z,e,G.maxHeight]),(0,i.useEffect)(()=>{eg(!1),eb.current=null},[e]);let ev=_.find(e=>e.key===ep)?.pixels??7,eC=e=>{let t=ey.current.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}},ek=()=>{eb.current=null},ej={single:S.batchImport.singleMode,auto:S.batchImport.autoMode,multi:S.batchImport.multiMode},eM={thin:S.common.cropper.brushThin,medium:S.common.cropper.brushMedium,thick:S.common.cropper.brushThick},eE=async()=>{if(0!==ea.length){if(w){w(ea.map(e=>({...e,rotation:H})),!0),eo([]);return}if(el.current&&g)try{g(await (0,f.Y)(el.current,ea.map(e=>({...e,rotation:0})))),eo([])}catch(e){j.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},eN=()=>({...B&&B.width>0&&B.height>0?{x:B.x/100,y:B.y/100,width:B.width/100,height:B.height/100}:{x:0,y:0,width:1,height:1},rotation:H,...eh.length?{erase:eh}:{}}),eD=async()=>{let e=eN();if("auto"===T&&b)return void b(e);if(w)return void w([e],!1);if(U.current&&l)try{let[t]=await (0,f.Y)(U.current,[{...e,rotation:0}]);l(t)}catch(e){j.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(m.N,{open:n,onOpenChange:e=>!e&&r(),children:(0,t.jsxs)(m.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(m.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(m.F,{children:S.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:V,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===T?(0,t.jsx)(x,{ref:el,imageSrc:A,regions:ea,onChange:eo,imageStyle:Q,onImageLoad:e=>J(e.currentTarget)}):(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)(d.f,{crop:B,onChange:(e,t)=>Y(t),disabled:em,children:(0,t.jsx)("img",{ref:U,alt:"Crop me",src:A,onLoad:function(e){Y({unit:"%",x:0,y:0,width:100,height:100}),J(e.currentTarget),ex(e=>e+1)},style:Q,className:"block"})}),R&&(0,t.jsx)("canvas",{ref:ey,"aria-hidden":!0,className:`absolute inset-0 ${em?"cursor-crosshair":"pointer-events-none"}`,style:{touchAction:"none"},onPointerDown:e=>{if(!em||0!==e.button)return;e.preventDefault(),ey.current?.setPointerCapture(e.pointerId);let t=ey.current;eb.current=eh.length,ed([...eh,{points:[eC(e)],radius:t?ev/t.clientWidth:.006}])},onPointerMove:e=>{let t=eb.current;if(null===t)return;let i=eC(e);ed(e=>e.map((e,n)=>{if(n!==t)return e;let r=e.points[e.points.length-1];return r&&5e-4>Math.abs(r.x-i.x)&&5e-4>Math.abs(r.y-i.y)?e:{...e,points:[...e.points,i]}}))},onPointerUp:ek,onPointerCancel:ek})]})})}),(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex gap-1 rounded-md bg-background/90 p-1 shadow-sm",children:[(0,t.jsx)(u.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>eu(-90),"aria-label":S.common.cropper.rotateLeft,title:S.common.cropper.rotateLeft,children:(0,t.jsx)(o.f,{className:"h-4 w-4"})}),(0,t.jsx)(u.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>eu(90),"aria-label":S.common.cropper.rotateRight,title:S.common.cropper.rotateRight,children:(0,t.jsx)(s,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(k,{zoom:Z,onZoomIn:ee,onZoomOut:et,onReset:ei})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[W.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===W.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:W.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":T===e,onClick:()=>{ei(),X(e),"multi"===e&&(eg(!1),ed([]))},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${T===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:ej[e]},e))}),R&&"multi"!==T&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(u.f,{variant:em?"secondary":"outline",size:"sm",onClick:()=>{eg(e=>!e),eb.current=null},className:"flex items-center gap-2",children:[(0,t.jsx)(a,{className:"h-4 w-4"}),em?S.common.cropper.eraseDone:S.common.cropper.erase]}),em&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-md bg-muted p-1",children:_.map(({key:e})=>(0,t.jsx)("button",{type:"button","aria-pressed":ep===e,onClick:()=>ef(e),className:`rounded px-2 py-1 text-xs font-medium ${ep===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:eM[e]},e))}),eh.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:()=>ed(eh.slice(0,-1)),className:"flex items-center gap-1.5",children:[(0,t.jsx)(h.f,{className:"h-4 w-4"}),S.common.cropper.undoErase]}),(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:()=>ed([]),className:"flex items-center gap-1.5",children:[(0,t.jsx)(c.f,{className:"h-4 w-4"}),S.common.cropper.clearErase]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===T?`${S.batchImport.hint} ${S.batchImport.regionCount.replace("{count}",String(ea.length))}`:em?S.common.cropper.eraseHint:"auto"===T?S.batchImport.autoHint:C>0?S.upload.parts.cropHint.replace("{n}",String(C+1)):S.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end",children:["multi"===T&&ea.length>0&&(0,t.jsx)(u.f,{variant:"ghost",onClick:()=>eo([]),children:S.batchImport.clear}),(0,t.jsx)(u.f,{variant:"outline",onClick:r,children:S.common.cancel||"Cancel"}),"multi"===T?(0,t.jsx)(u.f,{onClick:eE,disabled:0===ea.length,children:S.batchImport.start.replace("{count}",String(ea.length))}):(0,t.jsxs)(t.Fragment,{children:["single"===T&&v&&(0,t.jsx)(u.f,{variant:"secondary",onClick:()=>v(eN()),"data-testid":"crop-add-part",children:S.upload.parts.addNext}),(0,t.jsx)(u.f,{onClick:eD,children:"auto"===T?S.batchImport.autoStart:C>0?S.upload.parts.confirm.replace("{count}",String(C+1)):S.common.confirm||"Confirm"})]})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(456420);let r={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};r.node;let a=(0,n.f)(r);var o=e.i(772382),l=e.i(511445),s=e.i(624687),c=e.i(111110),h=e.i(975157);e.s(["f",0,function({value:e,onChange:n,className:r,...d}){let{t:u}=(0,c.b)(),[m,g]=(0,i.useState)("source"),p=(0,i.useId)(),f=[{mode:"source",label:u.markdownEditor.source,icon:a},{mode:"preview",label:u.markdownEditor.preview,icon:o.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:f.map(({mode:e,label:i,icon:n})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,h.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(n,{className:"h-3.5 w-3.5"}),i]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(s.f,{value:e,onChange:e=>n(e.target.value),className:r,...d}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(967489),r=e.i(856423),a=e.i(41931),o=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:s,className:c}){let[h,d]=(0,i.useState)([]),{t:u}=(0,l.b)();return(0,i.useEffect)(()=>{(async()=>{try{let e=await a.k.get("/api/notebooks");d(e)}catch(e){o.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(n.d,{value:e,onValueChange:s,children:[(0,t.jsx)(n.P,{className:c,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(n.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(n.r,{children:0===h.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):h.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}])},674166,e=>{var t=e.i(843476),i=e.i(967489),n=e.i(470279);e.s(["f",0,function({value:e,onChange:r,disabled:a}){let{groups:o,loading:l}=(0,n.f)(),s=o.filter(e=>e.isActive);return(0,t.jsxs)(i.d,{value:e,onValueChange:r,disabled:a||l,children:[(0,t.jsx)(i.P,{children:(0,t.jsx)(i.U,{placeholder:"选择卷别"})}),(0,t.jsx)(i.r,{children:s.map(e=>(0,t.jsx)(i.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),i=e.i(111110),n=e.i(398019),r=e.i(184110),a=e.i(975157);let o={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:s,className:c}){let{t:h}=(0,i.b)();if(!e)return null;let d=(0,r.V)(l),u=(0,r.o)(s);return(0,t.jsx)("figure",{className:(0,a.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,n.d)(e),alt:h.figure.alt,className:(0,a.f)(o[u],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===u?{marginLeft:0,marginRight:"auto"}:"right"===u?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:d/100,maxWidth:`${Math.min(d,100)}%`}})})}])},574041,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(263676),r=e.i(487486),a=e.i(793479),o=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:s,placeholder:c="Enter tags...",className:h="",enterHint:d,subject:u,gradeStage:m}){let[g,p]=(0,i.useState)(""),[f,w]=(0,i.useState)([]),[x,y]=(0,i.useState)(!1),[b,v]=(0,i.useState)(0),C=(0,i.useRef)(null),k=(0,i.useRef)(null),j=(0,i.useCallback)(async t=>{try{let i=new URLSearchParams({q:t});u&&i.append("subject",u),m&&i.append("stage",m);let n=((await o.k.get(`/api/tags/suggestions?${i.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(n.slice(0,20)),y(n.length>0),v(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,i.useEffect)(()=>{g.trim()&&j(g)},[g,j]);let M=t=>{t.trim()&&!e.includes(t.trim())&&(s([...e,t.trim()]),p(""),w([]),y(!1),v(0))},E=t=>{s(e.filter(e=>e!==t))};return(0,i.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||C.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${h}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(r.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>E(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(n.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(a.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&f[b]?M(f[b]):g.trim()&&M(g)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),v(0)):"Backspace"===t.key&&!g&&e.length>0&&E(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?c:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,i)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${i===b?"bg-accent":""}`,onClick:()=>M(e),onMouseEnter:()=>v(i),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:d?`${d} "${g}"`:`Press Enter to create "${g}"`})]})}])},184110,e=>{let t=["left","center","right"],i="center";function n(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,i,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,n,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:i},"V",0,function(e){return n(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},804536,e=>{var t=e.i(271645);let i=new Map,n=new Set;function r(e){return n.add(e),window.addEventListener("storage",e),()=>{n.delete(e),window.removeEventListener("storage",e)}}function a(e,a,o){let l=(0,t.useSyncExternalStore)(r,()=>(function(e){if(i.has(e))return i.get(e)??null;try{return window.localStorage.getItem(e)}catch{return null}})(e),()=>null);return[(0,t.useMemo)(()=>a(l),[a,l]),(0,t.useCallback)(t=>(function(e,t){try{window.localStorage.setItem(e,t),i.delete(e)}catch{i.set(e,t)}n.forEach(e=>e())})(e,o(t)),[e,o])]}let o=e=>e;e.s(["y",0,function(e,i,n){return a(e,(0,t.useCallback)(e=>i.includes(e??"")?e:n,[i,n]),o)},"x",0,a])},213761,895133,e=>{let t=[0,90,180,270];function i(e,t,n=0){let r=90===n||270===n;return{width:r?t:e,height:r?e:t}}function n(e,n,r){let a,o,l,s,c=t.includes(r.rotation??0)?r.rotation??0:0,h=i(e,n,c),d=e=>Math.min(1,Math.max(0,e)),u=Math.round(d(r.x)*h.width),m=Math.round(d(r.y)*h.height),g=Math.max(1,Math.min(h.width-u,Math.round(d(r.width)*h.width))),p=Math.max(1,Math.min(h.height-m,Math.round(d(r.height)*h.height)));switch(c){case 90:a=m,o=h.width-u-g,l=p,s=g;break;case 180:a=e-u-g,o=n-m-p,l=g,s=p;break;case 270:a=e-m-p,o=u,l=p,s=g;break;default:a=u,o=m,l=g,s=p}return{rotation:c,frameWidth:h.width,frameHeight:h.height,fx:u,fy:m,fw:g,fh:p,sx:a,sy:o,sw:l,sh:s,outputWidth:g,outputHeight:p}}function r(e,t,i,n,r){if(0===t.length)return;let a=r.width/n.sw,o=r.height/n.sh;for(let r of(e.save(),e.fillStyle="#ffffff",e.strokeStyle="#ffffff",e.lineCap="round",e.lineJoin="round",t)){if(0===r.points.length)continue;let t=r.points.map(e=>({x:(e.x*i.width-n.sx)*a,y:(e.y*i.height-n.sy)*o})),l=Math.max(.5,r.radius*i.width*a);if(1===t.length){e.beginPath(),e.arc(t[0].x,t[0].y,l,0,2*Math.PI),e.fill();continue}for(let i of(e.beginPath(),e.moveTo(t[0].x,t[0].y),t.slice(1)))e.lineTo(i.x,i.y);e.lineWidth=2*l,e.stroke()}e.restore()}function a(e,t,i,n,o,l=[]){switch(e.fillStyle="#ffffff",e.fillRect(0,0,n,o),e.imageSmoothingEnabled=!0,e.imageSmoothingQuality="high",e.save(),i.rotation){case 90:e.translate(n,0),e.rotate(Math.PI/2);break;case 180:e.translate(n,o),e.rotate(Math.PI);break;case 270:e.translate(0,o),e.rotate(-Math.PI/2)}let s=90===i.rotation||270===i.rotation;e.drawImage(t,i.sx,i.sy,i.sw,i.sh,0,0,s?o:n,s?n:o),e.restore(),r(e,l,{width:i.frameWidth,height:i.frameHeight},{sx:i.fx,sy:i.fy,sw:i.fw,sh:i.fh},{width:n,height:o})}async function o(e,t){let{naturalWidth:i,naturalHeight:r}=e;return Promise.all(t.map(t=>new Promise((o,l)=>{let s=n(i,r,t),c=document.createElement("canvas");c.width=s.outputWidth,c.height=s.outputHeight;let h=c.getContext("2d");h?(a(h,e,s,s.outputWidth,s.outputHeight,t.erase??[]),c.toBlob(e=>e?o(e):l(Error("Canvas is empty")),"image/jpeg",.95)):l(Error("Canvas is not supported"))})))}e.s(["c",0,function(e,t,i,n,a){r(e,t,i,n,a)},"B",0,function(e){let t=e.match(/^data:(image\/(?:png|jpe?g|webp|gif));base64,([\s\S]+)$/);if(!t)return null;try{let e=atob(t[2]),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return new Blob([i],{type:t[1]})}catch{return null}},"Y",0,o,"D",0,a,"w",0,function(e,t,i,n){let r=e=>Math.min(1,Math.max(0,e)),a=r(Math.min(e,i)),o=r(Math.min(t,n));return{x:a,y:o,width:r(Math.max(e,i))-a,height:r(Math.max(t,n))-o}},"h",0,n,"s",0,i,"f",0,function(e){return/^(blob:|data:image\/)/i.test(e)?e:void 0}],895133);let l={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class s extends Error{code;format;constructor(e,t,i){super(e,void 0===i?void 0:{cause:i}),this.code=e,this.format=t,this.name="ImageDecodeError"}}let c=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),h=new Set(["mif1","msf1","mif2"]),d=new Set(["avif","avis"]);function u(e,t,i=l){let n=Math.min(1,i.maxLongEdge/Math.max(e,t),Math.sqrt(i.maxPixels/Math.max(1,e*t)));return{width:Math.max(1,Math.floor(e*n)),height:Math.max(1,Math.floor(t*n)),scale:n}}async function m(e){let t,i;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let n=await (t=URL.createObjectURL(e),(i=new Image).decoding="async",new Promise((e,n)=>{i.onload=()=>e(i),i.onerror=()=>n(Error("IMAGE_ELEMENT_DECODE_FAILED")),i.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!n.naturalWidth||!n.naturalHeight)throw Error("IMAGE_EMPTY");return n}async function g(t){let{heicTo:i}=await e.A(462684);return i({blob:t,type:"image/jpeg",quality:.95})}function p(e,t,i="image/jpeg"){let{promise:n,resolve:r,reject:a}=Promise.withResolvers();return e.toBlob(e=>e?r(e):a(Error("CANVAS_EMPTY")),i,t),n}async function f(e,t){let i=await p(e,t,"image/webp");return"image/webp"===i.type||"image/jpeg"===i.type?i:p(e,t,"image/jpeg")}function w(e,t,i,n,r){let o,l=((o=document.createElement("canvas")).width=i,o.height=n,o),s=l.getContext("2d");if(!s)throw Error("CANVAS_UNSUPPORTED");return a(s,e,t,i,n,r),l}async function x(e,t){var i;let r,a=performance.now(),o=await e.arrayBuffer(),l=performance.now()-a,f=function(e){let t=(t,i)=>String.fromCharCode(...e.subarray(t,i));if(e.length>=3&&255===e[0]&&216===e[1]&&255===e[2])return"jpeg";if(e.length>=8&&137===e[0]&&"PNG"===t(1,4))return"png";if(e.length>=12&&"RIFF"===t(0,4)&&"WEBP"===t(8,12))return"webp";if(e.length>=6&&("GIF87a"===t(0,6)||"GIF89a"===t(0,6)))return"gif";if(e.length>=2&&"BM"===t(0,2))return"bmp";if(e.length>=12&&"ftyp"===t(4,8)){let i=Math.min(e.length,(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0||e.length),n=[t(8,12)];for(let e=16;e+4<=i;e+=4)n.push(t(e,e+4));if(n.some(e=>c.has(e)))return"heic";if(n.some(e=>d.has(e)))return"avif";if(n.some(e=>h.has(e)))return"heic"}return"unknown"}(new Uint8Array(o,0,Math.min(o.byteLength,64))),x=e.type||"",b=performance.now(),v="native",C=new Blob([o],{type:x||"application/octet-stream"});try{r=await m(C)}catch(e){if("heic"!==f)throw new s("unknown"===f?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",f,e);t?.();try{r=await m(await g(C)),v="heic"}catch(e){throw new s("HEIC_DECODE_FAILED",f,e)}}let{width:k,height:j}=(i=r)instanceof HTMLImageElement?{width:i.naturalWidth,height:i.naturalHeight}:{width:i.width,height:i.height};if(!k||!j)throw new s("IMAGE_DECODE_FAILED",f);let M=u(k,j,{maxLongEdge:1600,maxPixels:1/0}),E=n(k,j,y),N=await p(w(r,E,M.width,M.height),.85),D=URL.createObjectURL(N),_=performance.now()-b;return{source:r,width:k,height:j,format:f,decoder:v,previewUrl:D,sourceType:x,sourceBytes:e.size,timings:{read:Math.round(l),convert:Math.round(_)},dispose:()=>{URL.revokeObjectURL(D),r instanceof HTMLImageElement||r.close()}}}let y={x:0,y:0,width:1,height:1};async function b(e,t=y,i=l){var r;let a=performance.now(),o=n(e.width,e.height,t),s=u(o.outputWidth,o.outputHeight,i),c=w(e.source,o,s.width,s.height,t.erase),h=performance.now()-a,d=performance.now(),m=i.startQuality,g=await f(c,m);for(let n=0;g.size>i.maxBytes&&n<12;n++)m-.05>=i.minQuality-1e-9?m=Math.round((m-.05)*100)/100:(s={width:Math.max(1,Math.floor(.85*s.width)),height:Math.max(1,Math.floor(.85*s.height)),scale:.85*s.scale},c=w(e.source,o,s.width,s.height,t.erase)),g=await f(c,m);return{dataUrl:await (r=g,new Promise((e,t)=>{let i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>t(i.error??Error("READ_FAILED")),i.readAsDataURL(r)})),width:s.width,height:s.height,bytes:g.size,quality:m,timings:{crop:Math.round(h),compress:Math.round(performance.now()-d)}}}e.s(["K",0,l,"o",0,s,"N",0,function(e,t){return{sourceType:e.sourceType||e.format,sourceBytes:e.sourceBytes,sourceWidth:e.width,sourceHeight:e.height,outputWidth:t.width,outputHeight:t.height,outputBytes:t.bytes,decoder:e.decoder,quality:t.quality}},"p",0,x,"X",0,b],213761)},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,i="zh"){return("en"===i?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,i){return(i||"").trim()?"wrong_attempt":t(e)}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let i=e.trim().toLowerCase();return i?t[i]??null:null}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("science")||t.includes("科学")?"science":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var s=e.i(456420);let t={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],711241)},474544,e=>{var s=e.i(456420);let t={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],474544)},786563,e=>{var s=e.i(456420);let t={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],786563)},118924,e=>{var s=e.i(843476),t=e.i(271645),a=e.i(522016),i=e.i(618566),r=e.i(711241),n=e.i(975153),l=e.i(456420);let c={name:"list-ordered",size:24,node:[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]};c.node;let o=(0,l.f)(c);var d=e.i(632781),m=e.i(741120),u=e.i(666696),x=e.i(548161),f=e.i(772382);let g={name:"skip-forward",size:24,node:[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]};g.node;let h=(0,l.f)(g);var p=e.i(583967),v=e.i(511445),j=e.i(149704),w=e.i(519455),b=e.i(515288),N=e.i(624687),y=e.i(111110),k=e.i(41931),S=e.i(469817),C=e.i(294114),z=e.i(201276);function $({onClose:e}){let{t:a}=(0,y.b)(),[i,r]=(0,t.useState)(null),[n,l]=(0,t.useState)(!0),[c,o]=(0,t.useState)(null),[m,u]=(0,t.useState)(0),[g,P]=(0,t.useState)(!1),[R,M]=(0,t.useState)(!1),[T,A]=(0,t.useState)(""),[F,U]=(0,t.useState)(!1),[I,L]=(0,t.useState)(null),[O,_]=(0,t.useState)(!1),H=(0,t.useCallback)(async()=>{l(!0),o(null);try{let e=[];for(let s=1;;s+=1){let t=await k.k.get(`/api/review/due?page=${s}&pageSize=${S.$}`);if(e.push(...t.items),0===t.items.length||s>=t.totalPages)break}r(e),u(0),_(0===e.length)}catch(e){z.V.error("[ReviewSession]","Failed to load due reviews",{error:e}),o(a.review.sessionLoadFailed)}finally{l(!1)}},[a.review.sessionLoadFailed]);(0,t.useEffect)(()=>{H()},[H]);let V=e=>{P(!1),M(!1),A(""),L(null),!i||e+1>=i.length?_(!0):u(e+1)},W=async(e,s)=>{let t=i?.[m];if(t){U(!0),L(null);try{await k.k.post("/api/practice/record",{errorItemId:t.id,result:e,source:"review",...s?{mistakeAnalysis:s}:{}}),C.c.success("correct"===e?a.review.sessionCorrectSaved:a.review.sessionWrongSaved),V(m)}catch(e){z.V.error("[ReviewSession]","Failed to save review result",{error:e}),L(a.review.sessionSaveFailed)}finally{U(!1)}}};if(n)return(0,s.jsx)("div",{className:"flex justify-center py-12",children:(0,s.jsx)(d.f,{className:"h-7 w-7 animate-spin text-muted-foreground"})});if(c)return(0,s.jsx)(b.N,{className:"border-destructive/30",children:(0,s.jsxs)(b.O,{className:"pt-6 space-y-3 text-center",children:[(0,s.jsx)("p",{className:"text-sm text-destructive",children:c}),(0,s.jsx)(w.f,{variant:"outline",onClick:()=>void H(),children:a.review.sessionRetry})]})});if(!i||O)return(0,s.jsx)(b.N,{className:"border-green-500",children:(0,s.jsxs)(b.O,{className:"pt-6 space-y-3 text-center",children:[(0,s.jsx)(x.f,{className:"mx-auto h-10 w-10 text-green-600"}),(0,s.jsx)("h2",{className:"text-xl font-bold",children:a.review.sessionCompleted}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:a.review.sessionCompletedHint}),(0,s.jsx)(w.f,{onClick:e,children:a.review.sessionBack})]})});let q=i[m],B=a.review.sessionProgress.replace("{current}",String(m+1)).replace("{total}",String(i.length));return(0,s.jsxs)(b.N,{className:"border-primary/40",children:[(0,s.jsx)(b.Y,{children:(0,s.jsxs)(b.v,{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("span",{children:a.review.sessionTitle}),(0,s.jsx)("span",{className:"text-sm font-normal text-muted-foreground",children:B})]})}),(0,s.jsxs)(b.O,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(v.f,{content:q.questionText,className:"font-medium"}),(0,s.jsx)(j.f,{svg:q.figureSvg,scale:q.figureScale,align:q.figureAlign}),!q.questionText&&q.originalImageUrl&&(0,s.jsx)("img",{src:q.originalImageUrl,alt:a.detail.originalProblem||"Original Problem",className:"mx-auto max-h-96 max-w-full rounded border bg-white object-contain"}),!q.questionText&&!q.originalImageUrl&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground italic",children:a.review.sessionNoQuestion})]}),g?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"rounded-lg border bg-muted/40 p-4",children:[(0,s.jsx)("h4",{className:"mb-1 font-semibold text-green-600",children:a.practice.correctAnswer}),(0,s.jsx)(v.f,{content:q.answerText,className:"font-semibold"})]}),q.analysis&&(0,s.jsxs)("div",{className:"rounded-lg border p-4",children:[(0,s.jsx)("h4",{className:"mb-1 font-semibold",children:a.practice.detailedAnalysis}),(0,s.jsx)(v.f,{content:q.analysis})]}),(0,s.jsxs)("div",{className:"flex flex-col justify-center gap-2 sm:flex-row",children:[(0,s.jsxs)(w.f,{onClick:()=>void W("correct"),disabled:F,className:"bg-green-600 hover:bg-green-700",children:[(0,s.jsx)(x.f,{className:"mr-2 h-4 w-4"}),a.review.sessionCorrect]}),(0,s.jsxs)(w.f,{variant:"outline",onClick:()=>M(!0),disabled:F,className:"border-red-300 text-red-600 hover:bg-red-50 dark:border-red-900 dark:text-red-400 dark:hover:bg-red-950/40",children:[(0,s.jsx)(p.f,{className:"mr-2 h-4 w-4"}),a.review.sessionWrong]})]}),R&&(0,s.jsxs)("div",{className:"space-y-2 rounded-md border bg-muted/20 p-3",children:[(0,s.jsx)("label",{htmlFor:"review-wrong-reason",className:"text-sm font-medium",children:a.review.sessionReason}),(0,s.jsx)(N.f,{id:"review-wrong-reason",value:T,onChange:e=>A(e.target.value),placeholder:a.review.sessionReasonPlaceholder,rows:3,disabled:F}),(0,s.jsxs)(w.f,{onClick:()=>void W("wrong",T.trim()),disabled:F||!T.trim(),children:[F?(0,s.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):null,a.review.sessionSaveWrong]})]})]}):(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsxs)(w.f,{variant:"outline",onClick:()=>P(!0),children:[(0,s.jsx)(f.f,{className:"mr-2 h-4 w-4"}),a.review.sessionReveal]})}),I&&(0,s.jsx)("p",{className:"text-sm text-destructive",children:I}),(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsxs)(w.f,{variant:"ghost",size:"sm",onClick:()=>V(m),disabled:F,children:[(0,s.jsx)(h,{className:"mr-1.5 h-3.5 w-3.5"}),a.review.sessionSkip]})})]})]})}var P=e.i(912505),R=e.i(393842),M=e.i(658512),T=e.i(215519),A=e.i(306831),F=e.i(35209);let U=[1,2,4,7,15,30];function I(){let e,{t:l}=(0,y.b)(),{timeZone:c}=(0,T.M)();(0,F.f)(l.review.title);let d=(0,i.useRouter)(),x=(0,i.usePathname)(),f=(0,i.useSearchParams)(),g=Number.isInteger(e=Number(f.get("page")))&&e>0?e:1,[h,p]=(0,t.useState)(null),[v,j]=(0,t.useState)(!1),b=(0,t.useCallback)(async e=>{try{p(await k.k.get(`/api/review/due?page=${e}&pageSize=${S.$}`))}catch(e){z.V.error("[Review]","Failed to fetch due reviews",{error:e})}},[]);(0,t.useEffect)(()=>{b(g)},[g,b]);let N=e=>{let s=new URLSearchParams(f.toString());1===e?s.delete("page"):s.set("page",String(e));let t=s.toString();d.replace(t?`${x}?${t}`:x,{scroll:!1})},C=()=>{j(!1),b(g)},I=(0,A.d)(new Date,c).start,L=!!h&&h.total>0;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(R.f,{title:l.review.title,description:l.review.desc,actions:L&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"rounded-full bg-primary/10 px-3 py-1 text-sm font-medium text-primary",children:l.review.dueCount.replace("{count}",String(h.total))}),v?(0,s.jsxs)(w.f,{variant:"outline",size:"sm",onClick:C,children:[(0,s.jsx)(r.f,{className:"mr-1.5 h-3.5 w-3.5"}),l.review.sessionBack]}):(0,s.jsxs)(w.f,{size:"sm",onClick:()=>j(!0),children:[(0,s.jsx)(o,{className:"mr-1.5 h-3.5 w-3.5"}),l.review.sessionStart]})]})}),!v&&h&&h.total>0&&(0,s.jsx)(M.f,{page:g,totalPages:h.totalPages,total:h.total,pageSize:h.pageSize,onPageChange:N,showSummary:!1}),v&&L?(0,s.jsx)($,{onClose:C}):(0,s.jsxs)(s.Fragment,{children:[!h&&(0,s.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6},(e,t)=>(0,s.jsx)("div",{className:"h-52 animate-pulse rounded-2xl bg-muted"},t))}),h&&0===h.total&&(0,s.jsx)(P.f,{icon:n.f,title:l.review.empty,description:l.review.emptyHint}),h&&h.items.length>0&&(0,s.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:h.items.map(e=>{let t;return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsx)(u.f,{item:e,selectMode:!1,selected:!1,onToggleSelect:()=>{},selectedTag:null,onTagClick:()=>{}})}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 px-1 text-xs text-muted-foreground",children:[(0,s.jsxs)("span",{children:[(t=(0,A.r)(e.nextReviewAt,"MM/dd",c),new Date(e.nextReviewAt)<I?l.review.overdue.replace("{date}",t):l.review.dueOn.replace("{date}",t))," · ",l.review.round.replace("{round}",String(e.reviewStage+1)).replace("{total}",String(U.length))]}),(0,s.jsx)(a.default,{href:`/practice?id=${e.id}`,children:(0,s.jsxs)(w.f,{variant:"outline",size:"sm",className:"h-8",children:[(0,s.jsx)(m.f,{className:"mr-1.5 h-3.5 w-3.5"}),l.review.practice]})})]})]},e.id)})}),h&&(0,s.jsx)(M.f,{page:g,totalPages:h.totalPages,total:h.total,pageSize:h.pageSize,onPageChange:N})]})]})}e.s(["default",0,function(){return(0,s.jsx)("main",{className:"mx-auto max-w-6xl space-y-6 px-4 py-6 md:px-8 md:py-8",children:(0,s.jsx)(t.Suspense,{fallback:(0,s.jsx)("div",{className:"flex justify-center p-8",children:(0,s.jsx)(d.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),children:(0,s.jsx)(I,{})})})}],118924)},469937,e=>{var s=e.i(843476),t=e.i(786563),a=e.i(111110),i=e.i(975157);let r=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:c="sm",showUnrated:o=!0,className:d}){let{t:m}=(0,a.b)(),u=e??0,x="sm"===c?"h-3.5 w-3.5":"h-5 w-5",f=u?m.difficulty.starsLabel.replace("{n}",String(u)):m.difficulty.unrated;return n?(0,s.jsxs)("span",{className:(0,i.f)("inline-flex items-center gap-0.5",d),role:"group","aria-label":`${m.difficulty.label}${m.common.colon}${f}`,title:m.difficulty.clearHint,children:[r.map(e=>(0,s.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===u?null:e),"aria-label":m.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,s.jsx)(t.f,{className:(0,i.f)(x,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&o&&(0,s.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:m.difficulty.unrated})]}):u?(0,s.jsx)("span",{className:(0,i.f)("inline-flex items-center",d),role:"img","aria-label":`${m.difficulty.label}${m.common.colon}${f}`,title:f,children:r.map(e=>(0,s.jsx)(t.f,{className:(0,i.f)(x,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):o?(0,s.jsx)("span",{className:(0,i.f)("text-xs text-muted-foreground",d),children:m.difficulty.unrated}):null}])},846968,e=>{var s=e.i(843476),t=e.i(548161),a=e.i(474544),i=e.i(741120),r=e.i(487486),n=e.i(111110);let l={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:a.f},reviewing:{className:"bg-primary/10 text-primary",icon:i.f},mastered:{className:"bg-success/15 text-success",icon:t.f}};e.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:e,className:t=""}){let{t:a}=(0,n.b)(),{className:i,icon:c}=l[e],o="mastered"===e?a.notebook.mastered:"reviewing"===e?a.notebook.reviewing:a.notebook.review;return(0,s.jsx)(r.f,{variant:"secondary",className:`${i} ${t}`,children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(c,{className:"h-3 w-3"})," ",o]})})}])},149704,e=>{var s=e.i(843476),t=e.i(111110),a=e.i(398019),i=e.i(184110),r=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:c,className:o}){let{t:d}=(0,t.b)();if(!e)return null;let m=(0,i.V)(l),u=(0,i.o)(c);return(0,s.jsx)("figure",{className:(0,r.f)("question-figure my-3",o),children:(0,s.jsx)("img",{src:(0,a.d)(e),alt:d.figure.alt,className:(0,r.f)(n[u],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===u?{marginLeft:0,marginRight:"auto"}:"right"===u?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:m/100,maxWidth:`${Math.min(m,100)}%`}})})}])},590546,e=>{var s=e.i(843476),t=e.i(618566),a=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:r}){let n=(0,t.useRouter)();return(0,s.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:r,children:(0,s.jsx)(i.f,{className:"h-5 w-5"})})}])},912505,e=>{var s=e.i(843476),t=e.i(975157);e.s(["f",0,function({icon:e,title:a,description:i,action:r,className:n}){return(0,s.jsxs)("div",{className:(0,t.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",n),children:[(0,s.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,s.jsx)(e,{className:"h-7 w-7"})}),(0,s.jsx)("p",{className:"font-medium",children:a}),i&&(0,s.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:i}),r&&(0,s.jsx)("div",{className:"mt-5",children:r})]})}])},393842,e=>{var s=e.i(843476),t=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:r,actions:n,titleAddon:l,className:c}){return(0,s.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",c),children:[r&&(0,s.jsx)(t.f,{fallbackUrl:r,className:"-ml-2 shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),i&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),n&&(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}])},469817,e=>{e.s(["$",0,18,"u",0,5,"A",0,200])},184110,e=>{let s=["left","center","right"],t="center";function a(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,t,"n",0,100,"j",0,s,"a",0,200,"_",0,10,"x",0,a,"o",0,function(e){return"string"==typeof e&&s.includes(e)?e:t},"V",0,function(e){return a(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},35209,e=>{var s=e.i(271645),t=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,t.b)(),i=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=i},[i])}])},991722,e=>{function s(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,t="zh"){return("en"===t?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[s(e)]},"h",0,s,"x",0,function(e,t){return(t||"").trim()?"wrong_attempt":s(e)}])},428602,e=>{e.s(["f",0,function(e){if(e.tags&&e.tags.length>0)return e.tags.map(e=>e.name);if(!e.knowledgePoints)return[];try{let s=JSON.parse(e.knowledgePoints);return Array.isArray(s)?s.filter(e=>"string"==typeof e):[]}catch{return[]}}])}])})();
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,198591,e=>{"use strict";var t=e.i(843476),a=e.i(271645),n=e.i(618566),s=e.i(519455),l=e.i(393842),i=e.i(86963),r=e.i(77071),o=e.i(515281),c=e.i(759659),d=e.i(522016),u=e.i(456420);let m={name:"git-compare-arrows",size:24,node:[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]};m.node;let h=(0,u.f)(m);var g=e.i(444594),p=e.i(218964),f=e.i(77043),x=e.i(566595),b=e.i(666696),j=e.i(716327);let y={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};y.node;let k=(0,u.f)(y);var v=e.i(755146),w=e.i(111110);function S({mastery:e,timeRange:a,onMasteryChange:n,onTimeRangeChange:l}){let{t:i}=(0,w.b)(),r=[{value:"all",label:i.filter.all||"All"},{value:"new",label:i.filter.review||"To Review"},{value:"reviewing",label:i.filter.reviewing||"Reviewing"},{value:"mastered",label:i.filter.mastered||"Mastered"}],o=[{value:"all",label:i.filter.allTime||"All Time"},{value:"week",label:i.filter.lastWeek||"Last Week"},{value:"month",label:i.filter.lastMonth||"Last Month"}];return(0,t.jsxs)(v.G,{children:[(0,t.jsx)(v.X,{asChild:!0,children:(0,t.jsxs)(s.f,{variant:"outline",size:"sm",className:"h-10",children:[(0,t.jsx)(k,{className:"mr-2 h-4 w-4"}),i.notebook.filter,(0,t.jsx)(j.f,{className:"ml-2 h-4 w-4"})]})}),(0,t.jsxs)(v.L,{align:"end",className:"w-48",children:[(0,t.jsx)(v.B,{children:i.filter.masteryStatus||"Mastery Status"}),r.map(({value:a,label:s})=>(0,t.jsxs)(v.r,{onClick:()=>n(a),children:[e===a&&"✓ ",s]},a)),(0,t.jsx)(v.U,{}),(0,t.jsx)(v.B,{children:i.filter.timeRange||"Time Range"}),o.map(({value:e,label:n})=>(0,t.jsxs)(v.r,{onClick:()=>l(e),children:[a===e&&"✓ ",n]},e))]})]})}var N=e.i(470279);function C({value:e,onChange:a}){let{t:n}=(0,w.b)(),{groups:l,loading:i}=(0,N.f)(),r=l.filter(e=>e.isActive);return i?null:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(s.f,{variant:"all"===e?"default":"outline",size:"sm",className:"rounded-full",onClick:()=>a("all"),children:n.filter.all||"All"}),r.map(n=>(0,t.jsx)(s.f,{variant:e===n.id?"default":"outline",size:"sm",className:"rounded-full",onClick:()=>a(n.id),children:n.name},n.id))]})}var T=e.i(401280);function D({value:e,onChange:a}){let{t:n}=(0,w.b)(),l=t=>{a(e.includes(t)?e.filter(e=>e!==t):[...e,t])};return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[T.V.map(a=>(0,t.jsx)(s.f,{type:"button",variant:e.includes(a)?"default":"outline",size:"sm",className:"rounded-full",onClick:()=>l(a),children:n.questionType.names[a]||a},a)),(0,t.jsx)(s.f,{type:"button",variant:e.includes(T.O)?"default":"outline",size:"sm",className:"rounded-full",onClick:()=>l(T.O),children:n.questionType.notSet})]})}let q={name:"arrow-right-left",size:24,node:[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]};q.node;let A=(0,u.f)(q),E={name:"file-braces",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],aliases:["file-json"]};E.node;let P=(0,u.f)(E);var R=e.i(263676),$=e.i(257428),I=e.i(776639),F=e.i(185592),M=e.i(359260),L=e.i(294114),z=e.i(201276),J=e.i(303163),O=e.i(974881);let U=/^data:image\/(png|jpeg|jpg|webp);base64,(.+)$/;async function V(e){if(!/^data:image\/webp;base64,/.test(e)||"u"<typeof document||"function"!=typeof createImageBitmap)return e;try{let t=await createImageBitmap(await (await fetch(e)).blob());try{let a=document.createElement("canvas");a.width=t.width,a.height=t.height;let n=a.getContext("2d");if(!n)return e;return n.drawImage(t,0,0),a.toDataURL("image/jpeg",.9)}finally{t.close()}}catch{return e}}async function B(t,a){let{Document:n,Packer:s}=await e.A(181571),l=new n({sections:[{children:function(e,t){let a,n,s,l=t.includeAnswers??!0,i=t.includeImages??!1,r=t.maxImageWidthPx??480,o=[];t.title&&o.push(new O.Paragraph({heading:O.HeadingLevel.HEADING_1,alignment:O.AlignmentType.CENTER,children:[new O.TextRun(t.title)]}));let c=(n=[],s=null,e.forEach((e,t)=>{let l=null;if(e.section?.trim())l=e.section.trim();else{var i;let t;e.questionType?.trim()&&(i=e.questionType.trim(),l=(t=(0,T.P)(i))?T.H[t]:i)}s&&a===l||(s={heading:l,items:[]},n.push(s),a=l),s.items.push({question:e,number:t+1})}),n),d=c.some(e=>null!==e.heading),u=0;for(let e of c){if(d&&null!==e.heading){var m,h;o.push(new O.Paragraph({heading:O.HeadingLevel.HEADING_2,children:[new O.TextRun((m=u,h=e.heading,/^(第[一二三四五六七八九十百千零\d]+(部分|大题|节)|[一二三四五六七八九十]{1,3}、|(Part|Section)\s+[A-Z0-9IVX]+\b)/i.test(h)?h:`第${function e(t){let a=["零","一","二","三","四","五","六","七","八","九"];if(t<=0)return String(t);if(t<10)return a[t];if(t<100){let e=Math.floor(t/10),n=t%10;return(e>1?a[e]:"")+"十"+(n>0?a[n]:"")}if(t<1e3){let n=Math.floor(t/100),s=t%100;return 0===s?a[n]+"百":s<10?a[n]+"百零"+a[s]:s<20?a[n]+"百一"+e(s):a[n]+"百"+e(s)}let n=Math.floor(t/1e3),s=t%1e3;return a[n]+"千"+(s>0?e(s):"")}(m+1)}大题 ${h}`))]})),u+=1}for(let{question:t,number:a}of e.items)if((t.text??"").replace(/\r\n?/g,"\n").split("\n").forEach((e,t)=>{o.push(new O.Paragraph({children:[new O.TextRun(0===t?`${a}.${e}`:e)]}))}),i&&t.images?.length)for(let e of t.images){let t=function(e){let t,a=e.match(U);if(!a)return null;try{let e=atob(a[2]);t=new Uint8Array(e.length);for(let a=0;a<e.length;a++)t[a]=e.charCodeAt(a)}catch{return null}let n=function(e){if(e.length>=24&&137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=t.getUint32(16,!1),n=t.getUint32(20,!1);return a>0&&n>0?{width:a,height:n}:null}if(e.length>=4&&255===e[0]&&216===e[1]){let t=2;for(;t+9<e.length;){if(255!==e[t]){t++;continue}let a=e[t+1];if(a>=192&&a<=207&&196!==a&&200!==a&&204!==a){let a=new DataView(e.buffer,e.byteOffset,e.byteLength),n=a.getUint16(t+5,!1),s=a.getUint16(t+7,!1);if(s>0&&n>0)return{width:s,height:n};break}let n=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint16(t+2,!1);if(n<2)break;t+=2+n}}return null}(t);if(!n)return null;let s=a[1].toLowerCase();return"webp"===s?null:{bytes:t,type:"png"===s?"png":"jpg",widthPx:n.width,heightPx:n.height}}(e.dataUrl);if(!t)continue;let a=function(e,t,a){if(e<=a)return{width:e,height:t};let n=Math.max(1,Math.round(t*a/e));return{width:a,height:n}}(t.widthPx,t.heightPx,r);o.push(new O.Paragraph({children:[new O.ImageRun({type:t.type,data:t.bytes,transformation:{width:a.width,height:a.height}})]}))}}if(l){let t=e.map((e,t)=>({question:e,number:t+1})).filter(({question:e})=>e.answer?.trim()||e.analysis?.trim());if(t.length>0)for(let{question:e,number:a}of(o.push(new O.Paragraph({heading:O.HeadingLevel.HEADING_2,children:[new O.TextRun("参考答案")]})),t)){let t=e.answer?.trim()??"",n=e.analysis?.trim()??"",s=n?`答案:${t} 解析:${n}`:`答案:${t}`;o.push(new O.Paragraph({children:[new O.TextRun(`${a}.${s}`)]}))}}return o}(a.includeImages?await Promise.all(t.map(async e=>e.images?.length?{...e,images:await Promise.all(e.images.map(async e=>({...e,dataUrl:await V(e.dataUrl)})))}:e)):t,a)}]});return s.toBlob(l)}var H=e.i(407198);let _=/^([A-F])\s*[.、.::]\s*(.*)$/,K=["A","B","C","D","E","F"],G=[60,20,20,20,20,20,40,30,8,12,10,14,16,16,8];async function W(t){let a,{default:n}=await e.A(810068),{data:s,sheet:l,columns:i,stickyRowsCount:r}={data:[(a=function(e){let t=[H.I.slice()];for(let n of e){var a;let{text:e,options:s}=function(e){let t=e.split("\n"),a=[],n=t.length,s=t.length-1;for(;s>=0;){let e=t[s].trim();if(""===e){s--;continue}let l=e.match(_);if(!l)break;let i=K.indexOf(l[1]);if(-1===i)break;a.unshift({labelIndex:i,value:l[2]}),n=--s+1}for(let e=0;e<a.length;e++)if(a[e].labelIndex!==e){a.length=0,n=t.length;break}let l=t.slice(0,n);for(;l.length>0&&""===l[l.length-1].trim();)l.pop();return 0===a.length?{text:e,options:[]}:{text:l.join("\n"),options:a.map(e=>e.value)}}(n.text??"");t.push([e,s[0]??"",s[1]??"",s[2]??"",s[3]??"",n.answer??"",n.analysis??"",n.knowledgePoints?.length?n.knowledgePoints.join("、"):"","number"!=typeof(a=n.difficultyStars)||!Number.isInteger(a)||a<1||a>5?"":String(a),function(e){if(!e)return"";let t=(0,T.P)(e);return t?T.H[t]:e}(n.questionType),n.subject??"",n.gradeSemester??"",n.source??"",n.section??"",n.label??""])}return t}(t))[0].map(e=>({value:e,fontWeight:"bold",wrap:!0})),...a.slice(1).map(e=>e.map(e=>({value:e,wrap:!0})))],sheet:"题目",columns:G.map(e=>({width:e})),stickyRowsCount:1};return n(s,{sheet:l,columns:i,stickyRowsCount:r}).toBlob()}let X="error-list-export-format";function Y(){try{let e=window.localStorage.getItem(X);return"excel"===e||"word"===e||"json"===e?e:"json"}catch{return"json"}}function Q({open:e,onOpenChange:n,selectedIds:l}){let{t:i}=(0,w.b)(),[r,o]=(0,a.useState)(Y),[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!0),[h,g]=(0,a.useState)(""),[p,f]=(0,a.useState)(!1),x=async()=>{let e=await fetch("/api/error-items/export-questions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:l,includeImages:c})});if(!e.ok)throw Error((await e.json().catch(()=>({}))).message||"Export failed");let t=Number(e.headers.get("X-Export-Skipped")??"0"),a=await e.json();return{questions:Array.isArray(a?.questions)?a.questions:[],skipped:t}},b=async()=>{if(0!==l.length){f(!0);try{let e=new Date().toISOString().slice(0,10).replace(/-/g,""),t=0,a=!1;if("excel"===r){let{questions:n,skipped:s}=await x();t=s;let l=await W(n);a=await (0,M.P)(l,`wrong-notebook-questions-${e}.xlsx`)}else if("word"===r){let{questions:n,skipped:s}=await x();t=s;let l=h.trim()||`${i.notebook.exportJsonDialog.defaultDocxTitle} ${new Date().toISOString().slice(0,10)}`,r=await B(n,{title:l,includeAnswers:u,includeImages:c});a=await (0,M.P)(r,`wrong-notebook-questions-${e}.docx`)}else{let n=await fetch("/api/error-items/export-questions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:l,includeImages:c})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.message||"Export failed")}t=Number(n.headers.get("X-Export-Skipped")??"0");let s=await n.blob(),i=n.headers.get("Content-Disposition")?.match(/filename="(.+)"/);a=await (0,M.P)(s,i?i[1]:`wrong-notebook-questions-${e}.json`)}a&&t>0?(L.c.success(i.notebook.exportJsonDialog.success),L.c.warning(i.notebook.exportJsonDialog.emptyQuestionWarning.replace("{count}",String(t)))):a&&L.c.success(i.notebook.exportJsonDialog.success),a&&n(!1)}catch(e){z.V.error("[ErrorList]","Export questions failed",{error:e}),L.c.error(i.notebook.exportJsonDialog.failed+":"+(0,J.Z)(e))}finally{f(!1)}}};return(0,t.jsx)(I.N,{open:e,onOpenChange:n,children:(0,t.jsxs)(I.d,{children:[(0,t.jsxs)(I.s,{children:[(0,t.jsx)(I.F,{children:i.notebook.exportJsonDialog.title}),(0,t.jsx)(I.C,{children:i.notebook.exportJsonDialog.description})]}),(0,t.jsx)("div",{className:"py-2",children:(0,t.jsx)(F.f,{options:[{value:"json",label:i.notebook.exportJsonDialog.formatJson},{value:"excel",label:i.notebook.exportJsonDialog.formatExcel},{value:"word",label:i.notebook.exportJsonDialog.formatWord}],value:r,onChange:e=>{o(e);try{window.localStorage.setItem(X,e)}catch{}}})}),"excel"===r&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i.notebook.exportJsonDialog.excelNote}),"word"===r&&(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{htmlFor:"docx-title",className:"text-sm",children:i.notebook.exportJsonDialog.docxTitleLabel}),(0,t.jsx)("input",{id:"docx-title",type:"text",value:h,onChange:e=>g(e.target.value),placeholder:`${i.notebook.exportJsonDialog.defaultDocxTitle} ${new Date().toISOString().slice(0,10)}`,className:"w-full rounded-md border bg-background px-3 py-2 text-sm"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)($.f,{id:"include-answers",checked:u,onCheckedChange:e=>m(!0===e)}),(0,t.jsx)("label",{htmlFor:"include-answers",className:"text-sm cursor-pointer",children:i.notebook.exportJsonDialog.includeAnswers})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)($.f,{id:"include-images",checked:c,onCheckedChange:e=>d(!0===e)}),(0,t.jsx)("label",{htmlFor:"include-images",className:"text-sm cursor-pointer",children:i.notebook.exportJsonDialog.includeImages})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i.notebook.exportJsonDialog.wordNote})]}),"json"===r&&(0,t.jsxs)("div",{className:"flex items-center space-x-2 py-2",children:[(0,t.jsx)($.f,{id:"include-images",checked:c,onCheckedChange:e=>d(!0===e)}),(0,t.jsx)("label",{htmlFor:"include-images",className:"text-sm cursor-pointer",children:i.notebook.exportJsonDialog.includeImages})]}),(0,t.jsxs)(I.c,{children:[(0,t.jsx)(s.f,{variant:"outline",onClick:()=>n(!1),disabled:p,children:i.notebook.exportJsonDialog.cancel}),(0,t.jsx)(s.f,{onClick:b,disabled:p||0===l.length,children:p?i.notebook.exportJsonDialog.exporting:i.notebook.exportJsonDialog.export})]})]})})}var Z=e.i(438465),ee=e.i(41931);function et({ids:e,open:n,onOpenChange:l,onMoved:i}){let{t:r}=(0,w.b)(),[o,c]=(0,a.useState)(""),[d,u]=(0,a.useState)(!1),m=async()=>{if(o){u(!0);try{let{moved:t}=await ee.k.post("/api/error-items/batch-move",{ids:e,subjectId:o});L.c.success(r.notebook.moveSuccess.replace("{count}",String(t))),c(""),l(!1),i()}catch(e){z.V.error("[MoveToNotebookDialog]","Batch move failed",{error:e}),L.c.error(r.notebook.moveFailed)}finally{u(!1)}}};return(0,t.jsx)(I.N,{open:n,onOpenChange:l,children:(0,t.jsxs)(I.d,{children:[(0,t.jsxs)(I.s,{children:[(0,t.jsx)(I.F,{children:r.notebook.moveDialogTitle}),(0,t.jsx)(I.C,{children:r.notebook.moveDialogDescription.replace("{count}",String(e.length))})]}),(0,t.jsxs)("div",{className:"space-y-2 py-4",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:r.notebook.moveTargetLabel}),(0,t.jsx)(Z.f,{value:o||void 0,onChange:c})]}),(0,t.jsxs)(I.c,{children:[(0,t.jsx)(s.f,{variant:"outline",onClick:()=>l(!1),disabled:d,children:r.common.cancel}),(0,t.jsx)(s.f,{onClick:m,disabled:!o||d,children:d?r.notebook.moving:r.notebook.moveConfirm})]})]})})}var ea=e.i(632781),en=e.i(307364),es=e.i(511445);function el({ids:e}){let{t:n}=(0,w.b)(),[l,i]=(0,a.useState)(!1),[r,o]=(0,a.useState)(null),[c,u]=(0,a.useState)(!1),[m,g]=(0,a.useState)(null),[p,f]=(0,a.useState)(0),[x,b]=e,j=()=>{u(!0),o(null),g(null),f(e=>e+1)};return(0,a.useEffect)(()=>{if(!l||!x||!b)return;let e=!0;return ee.k.post("/api/error-items/similarity",{ids:[x,b]}).then(t=>{e&&o(t)}).catch(t=>{e&&(g("Question text is required for similarity comparison"===t?.data?.message?n.questionSimilarity.missingText:n.questionSimilarity.failed),z.V.error("[Similarity]","相似度比较失败",{error:t instanceof Error?t.message:String(t)}))}).finally(()=>{e&&u(!1)}),()=>{e=!1}},[l,x,b,p,n.questionSimilarity.failed,n.questionSimilarity.missingText]),(0,t.jsxs)(I.N,{open:l,onOpenChange:e=>{i(e),e&&j()},children:[(0,t.jsx)(I.a,{asChild:!0,children:(0,t.jsxs)(s.f,{variant:"outline",disabled:2!==e.length,title:n.questionSimilarity.selectTwo,children:[(0,t.jsx)(h,{className:"mr-2 h-4 w-4"}),n.questionSimilarity.title]})}),(0,t.jsxs)(I.d,{className:"w-[calc(100vw-2rem)] sm:max-w-3xl max-h-[85vh] overflow-y-auto",children:[(0,t.jsxs)(I.s,{children:[(0,t.jsx)(I.F,{children:n.questionSimilarity.title}),(0,t.jsx)(I.C,{children:n.questionSimilarity.description})]}),c&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",role:"status",children:[(0,t.jsx)(ea.f,{className:"h-4 w-4 animate-spin"}),n.common.loading]}),m&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:m}),m&&(0,t.jsx)(s.f,{variant:"outline",onClick:j,children:n.questionSimilarity.retry}),r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted p-4",role:"status",children:[(0,t.jsx)("p",{className:"text-sm",children:n.questionSimilarity.score}),(0,t.jsxs)("p",{className:"text-3xl font-bold tabular-nums",children:[Number((100*r.similarity).toFixed(4)),"%"]}),(0,t.jsx)("p",{className:"text-sm",children:n.questionSimilarity.threshold.replace("{threshold}",String(r.threshold))}),(0,t.jsx)("p",{className:"text-sm font-medium",children:r.duplicate?n.questionSimilarity.duplicate:n.questionSimilarity.different})]}),(0,t.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:r.items.map((e,a)=>(0,t.jsxs)("div",{className:"min-w-0 space-y-2 rounded-lg border p-3",children:[(0,t.jsxs)(d.default,{href:`/error-items/${e.id}`,className:"text-sm font-medium text-primary hover:underline",children:[n.questionSimilarity.question.replace("{index}",String(a+1))," · ",e.shortId||"-"]}),e.notebookName&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.notebookName}),(0,t.jsx)("div",{className:"max-h-56 overflow-auto text-sm",children:(0,t.jsx)(es.f,{content:e.questionText})})]},e.id))})]}),(0,t.jsx)(en.f,{onSaved:j})]})]})}function ei({selectedIds:e,deleting:n,onCancel:l,onDelete:i,onMoved:r}){let{t:o}=(0,w.b)(),[d,u]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"pb-safe fixed bottom-0 left-0 right-0 z-50 border-t bg-card/95 p-4 shadow-lg backdrop-blur",children:[(0,t.jsxs)("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground",children:[(0,t.jsx)("p",{children:o.notebook.selectedCount.replace("{count}",String(e.length))}),(0,t.jsx)("p",{className:"text-xs",children:o.questionSimilarity.selectTwo})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(el,{ids:e}),(0,t.jsxs)(s.f,{variant:"outline",onClick:()=>u(!0),disabled:0===e.length,children:[(0,t.jsx)(P,{className:"mr-2 h-4 w-4"}),o.notebook.exportJson]}),(0,t.jsxs)(s.f,{variant:"outline",onClick:()=>h(!0),disabled:0===e.length,children:[(0,t.jsx)(A,{className:"mr-2 h-4 w-4"}),o.notebook.moveToNotebook]}),(0,t.jsxs)(s.f,{variant:"outline",onClick:l,children:[(0,t.jsx)(R.X,{className:"mr-2 h-4 w-4"}),o.notebook.cancelSelect]}),(0,t.jsxs)(s.f,{variant:"destructive",onClick:i,disabled:0===e.length||n,children:[(0,t.jsx)(c.f,{className:"mr-2 h-4 w-4"}),o.notebook.deleteSelected]})]})]}),(0,t.jsx)(Q,{open:d,onOpenChange:u,selectedIds:e}),(0,t.jsx)(et,{ids:e,open:m,onOpenChange:h,onMoved:r})]})}var er=e.i(215519),eo=e.i(306831),ec=e.i(967489),ed=e.i(597138);let eu={1:["一年级"],2:["二年级"],3:["三年级"],4:["四年级"],5:["五年级"],6:["六年级"],7:["七年级上","七年级下","七年级"],8:["八年级上","八年级下","八年级"],9:["九年级上","九年级下","九年级"],10:["高一上","高一下","高一"],11:["高二上","高二下","高二"],12:["高三上","高三下","高三"],13:["大一","大一上","大一下"],14:["大二","大二上","大二下"],15:["大三","大三上","大三下"],16:["大四","大四上","大四下"]};function em({gradeSemester:e,tag:n,subjectName:s,tagSet:l="default",onFilterChange:i,className:r}){let{t:o}=(0,w.b)(),{timeZone:c}=(0,er.M)(),[d,u]=(0,a.useState)(e||""),[m,h]=(0,a.useState)(""),[g,p]=(0,a.useState)(n||""),[f,x]=(0,a.useState)([]),[b,j]=(0,a.useState)(!0),[y,k]=(0,a.useState)([]),[v,S]=(0,a.useState)(e);e!==v&&(S(e),void 0!==e&&u(e));let[N,C]=(0,a.useState)(n);n!==N&&(C(n),void 0!==n&&p(n||""));let T=(0,a.useCallback)((e,t)=>{let a=(0,eo.c)(new Date,c),n=a.getFullYear(),s=(a.getMonth()+1>=9?n:n-1)-t+1;return"primary"===e?s:"junior_high"===e?s+6:"senior_high"===e?s+9:"university"===e?s+12:0},[c]),D=(0,a.useCallback)((e,t)=>{let a=[];return e?"primary"===e?a=[1,2,3,4,5,6]:"junior_high"===e?(a=[7,8,9],t&&T(e,t)>=10&&a.push(10,11,12)):a="senior_high"===e?[10,11,12]:"university"===e?[13,14,15,16]:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]:a=[1,2,3,4,5,6,7,8,9,10,11,12],a.flatMap(e=>eu[e]||[])},[T]);(0,a.useEffect)(()=>{(async()=>{j(!0);try{let e=await ee.k.get("/api/user"),t=D(e.educationStage,e.enrollmentYear);k(t);let a=s?(0,ed.f)(s):"math";try{let e=await ee.k.get(`/api/tags?subject=${a}&tagSet=${encodeURIComponent(l)}`);x(e.tags)}catch(e){z.V.warn("[KnowledgeFilter]","Failed to fetch tags for subject",{subject:a,tagSet:l,error:e}),x([])}}catch(e){z.V.error("[KnowledgeFilter]","Failed to load filter data",{error:e})}finally{j(!1)}})()},[s,l,D]);let q=f.find(e=>e.name===d),A=q?.children||[],E=A.find(e=>e.name===m),P=e=>0===e.children.length?[e.name]:e.children.flatMap(e=>P(e)),R=E?[...new Set(P(E))]:[],$=y.filter(e=>f.some(t=>t.name===e));return(0,t.jsxs)("div",{className:`flex gap-2 ${r}`,children:[(0,t.jsxs)(ec.d,{value:d,onValueChange:e=>{u(e),h(""),p(""),i({gradeSemester:"all"===e?void 0:e,chapter:void 0,tag:void 0})},disabled:b,children:[(0,t.jsx)(ec.P,{className:"w-[140px]",children:(0,t.jsx)(ec.U,{placeholder:o.filter?.gradeShort||"Grade"})}),(0,t.jsxs)(ec.r,{children:[(0,t.jsx)(ec.T,{value:"all",children:o.filter?.allGrades||"All grades"}),$.map(e=>(0,t.jsx)(ec.T,{value:e,children:e},e))]})]}),(0,t.jsxs)(ec.d,{value:m,onValueChange:e=>{h(e),p(""),i({gradeSemester:"all"===d?void 0:d,chapter:"all"===e?void 0:e,tag:void 0})},disabled:!d||"all"===d,children:[(0,t.jsx)(ec.P,{className:"w-[180px]",children:(0,t.jsx)(ec.U,{placeholder:o.filter?.chapter||"Chapter"})}),(0,t.jsxs)(ec.r,{children:[(0,t.jsx)(ec.T,{value:"all",children:o.filter?.allChapters||"All chapters"}),A.map(e=>(0,t.jsx)(ec.T,{value:e.name,children:e.name.replace(/^第\d+章\s*/,"")},e.id))]})]}),(0,t.jsxs)(ec.d,{value:g,onValueChange:e=>{p(e),i({gradeSemester:"all"===d?void 0:d,chapter:"all"===m?void 0:m,tag:"all"===e?void 0:e})},disabled:!m||"all"===m,children:[(0,t.jsx)(ec.P,{className:"w-[140px]",children:(0,t.jsx)(ec.U,{placeholder:o.filter?.knowledgePoint||"Tag"})}),(0,t.jsxs)(ec.r,{children:[(0,t.jsx)(ec.T,{value:"all",children:o.filter?.allKnowledgePoints||"All tags"}),R.map(e=>(0,t.jsx)(ec.T,{value:e,children:e},e))]})]})]})}var eh=e.i(487486),eg=e.i(912505),ep=e.i(793479),ef=e.i(658512),ex=e.i(469817),eb=e.i(905110);function ej(e){let t=new URLSearchParams;return e.subjectId&&t.append("subjectId",e.subjectId),e.search&&t.append("query",e.search),"all"!==e.mastery&&t.append("mastery",e.mastery),"all"!==e.timeRange&&t.append("timeRange",e.timeRange),e.tag&&t.append("tag",e.tag),e.gradeSemester&&t.append("gradeSemester",e.gradeSemester),e.chapter&&t.append("chapter",e.chapter),"all"!==e.paperLevel&&t.append("paperLevel",e.paperLevel),e.questionTypes.length>0&&t.append("questionTypes",e.questionTypes.join(",")),t}var ey=e.i(380935),ek=e.i(164549);function ev({subjectId:e,subjectName:l,tagSet:i="default",initialMastery:r,initialTag:o}){let{t:c}=(0,w.b)(),d=(0,n.useRouter)(),[u,m]=(0,a.useState)([]),[j,y]=(0,a.useState)(!0),[k,v]=(0,a.useState)(""),[N,q]=(0,a.useState)(r??"all"),[A,E]=(0,a.useState)("all"),[P,R]=(0,a.useState)(""),[$,I]=(0,a.useState)(""),[F,M]=(0,a.useState)("all"),[J,O]=(0,a.useState)([]),[U,V]=(0,a.useState)(o??null),[B,H]=(0,a.useState)(1),_=ex.$,[K,G]=(0,a.useState)(0),[W,X]=(0,a.useState)(0),[Y,Q]=(0,a.useState)(!1),[Z,et]=(0,a.useState)(new Set),[ea,en]=(0,a.useState)(!1),es=(0,a.useMemo)(()=>({subjectId:e,search:k,mastery:N,timeRange:A,tag:U,gradeSemester:P,chapter:$,paperLevel:F,questionTypes:J.map(e=>e===T.O?"none":e)}),[e,k,N,A,U,P,$,F,J]),el=()=>{Q(!Y),et(new Set)},er=(0,a.useCallback)(async()=>{y(!0);try{let e=ej(es);e.append("page",B.toString()),e.append("pageSize",_.toString());let t=await ee.k.get(`/api/error-items/list?${e.toString()}`);m(t.items),G(t.total),X(t.totalPages)}catch(e){z.V.error("[ErrorList]","Failed to fetch error items",{error:e})}finally{y(!1)}},[es,B,_]),eo=async()=>{if(0===Z.size)return;let e=(c.notebook?.confirmBatchDelete||"Delete {count} items?").replace("{count}",Z.size.toString());if(await (0,L.u)(e,{destructive:!0})){en(!0);try{await ee.k.post("/api/error-items/batch-delete",{ids:Array.from(Z)}),L.c.success(c.notebook?.batchDeleteSuccess||"Deleted successfully"),Q(!1),et(new Set),er()}catch(e){z.V.error("[ErrorList]","Batch delete failed",{error:e}),L.c.error(c.common?.messages?.deleteFailed||"Delete failed")}finally{en(!1)}}},ec=(0,a.useRef)(es);return(0,a.useEffect)(()=>{let e=ec.current!==es;(ec.current=es,e&&1!==B)?H(1):er()},[B,es,er]),(0,t.jsxs)("div",{className:`space-y-6 ${Y?"pb-40 sm:pb-24":""}`,children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row",children:[(0,t.jsxs)("div",{className:"relative w-full lg:flex-1",children:[(0,t.jsx)(x.f,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(ep.f,{placeholder:c.notebook.search,title:c.shortId.searchHint,className:"h-10 rounded-xl bg-card pl-9",value:k,onChange:e=>v(e.target.value),onKeyDown:async e=>{let t=k.trim();if("Enter"!==e.key||!(0,ek.f)(t))return;let a=await (0,ey.f)(t);a&&d.push(`/error-items/${a}`)}})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(S,{mastery:N,timeRange:A,onMasteryChange:q,onTimeRangeChange:E}),(0,t.jsxs)(s.f,{variant:"outline",size:"sm",className:"h-10",onClick:()=>d.push(`/print-preview?${ej(es).toString()}`),children:[(0,t.jsx)(f.f,{className:"mr-2 h-4 w-4"}),c.notebook?.exportPrint||"Export for Print"]}),!Y&&(0,t.jsxs)(s.f,{variant:"outline",size:"sm",className:"h-10",onClick:el,children:[(0,t.jsx)(h,{className:"mr-2 h-4 w-4"}),c.questionSimilarity.title]}),(0,t.jsxs)(s.f,{variant:Y?"secondary":"outline",size:"sm",className:"h-10",onClick:el,children:[(0,t.jsx)(p.f,{className:"mr-2 h-4 w-4"}),Y?c.notebook?.cancelSelect||"Cancel":c.notebook?.selectMode||"Select"]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-stretch sm:items-center",children:[(0,t.jsx)("div",{className:"w-full sm:w-auto",children:(0,t.jsx)(em,{gradeSemester:P,tag:U,onFilterChange:({gradeSemester:e,chapter:t,tag:a})=>{void 0!==e&&R(e),void 0!==t&&I(t),V(void 0===a?null:a),e?t||I(""):(R(""),I(""),V(null)),H(1)},subjectName:l,tagSet:i})}),(0,t.jsx)(C,{value:F,onChange:M})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:c.questionType.label}),(0,t.jsx)(D,{value:J,onChange:O})]}),U&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[c.filter.filteringByTag||"Filtering by tag",":"]}),(0,t.jsxs)(eh.f,{variant:"secondary",className:"cursor-pointer",onClick:()=>V(null),children:[U,(0,t.jsx)("span",{className:"ml-1 text-xs",children:"×"})]})]}),!j&&0===u.length&&(0,t.jsx)(eg.f,{icon:g.f,title:c.notebook.emptyList,description:c.notebook.emptyListHint}),j&&0===u.length&&(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6},(e,a)=>(0,t.jsx)("div",{className:"h-44 animate-pulse rounded-2xl bg-muted"},a))}),(0,t.jsx)("div",{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-3 transition-opacity ${j?"opacity-60":""}`,children:u.map(e=>(0,t.jsx)(b.f,{item:e,selectMode:Y,selected:Z.has(e.id),onToggleSelect:()=>{var t;return t=e.id,void et(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},selectedTag:U,onTagClick:e=>V(U===e?null:e)},e.id))}),(0,t.jsx)(ef.f,{page:B,totalPages:W,total:K,pageSize:_,onPageChange:H}),Y&&(0,t.jsx)(ei,{selectedIds:[...Z],deleting:ea,onCancel:el,onDelete:eo,onMoved:()=>{Q(!1),et(new Set),er()}})]})}function ew(e){let s=(0,n.useSearchParams)(),l=(0,a.useMemo)(()=>{let e,t,a;return e={},t=s.get("mastery"),(0,eb.A)(t)&&(e.mastery=t),(a=s.get("tag"))&&(e.tag=a),e},[s]);return(0,t.jsx)(ev,{...e,initialMastery:l.mastery,initialTag:l.tag})}function eS(e){return(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(ew,{...e})})}var eN=e.i(110204);function eC({open:e,onOpenChange:n,currentName:l,onRename:i}){let[r,o]=(0,a.useState)(l),[c,d]=(0,a.useState)(!1),{t:u}=(0,w.b)(),[m,h]=(0,a.useState)(l);l!==m&&(h(l),o(l));let g=async()=>{if(!r.trim())return void L.c.warning(u.notebooks?.renameDialog?.enterName||"Please enter notebook name");d(!0);try{await i(r.trim()),n(!1)}catch(e){z.V.error("[RenameNotebook]","Failed to rename notebook",{error:e})}finally{d(!1)}};return(0,t.jsx)(I.N,{open:e,onOpenChange:n,children:(0,t.jsxs)(I.d,{children:[(0,t.jsx)(I.s,{children:(0,t.jsx)(I.F,{children:u.notebooks?.renameDialog?.title||"Rename Notebook"})}),(0,t.jsx)("div",{className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eN.f,{htmlFor:"rename-name",children:u.notebooks?.renameDialog?.nameLabel||"New Name"}),(0,t.jsx)(ep.f,{id:"rename-name",placeholder:u.notebooks?.renameDialog?.placeholder||"Enter new notebook name",value:r,onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&g()})]})}),(0,t.jsxs)(I.c,{children:[(0,t.jsx)(s.f,{variant:"outline",onClick:()=>n(!1),children:u.common.cancel}),(0,t.jsx)(s.f,{onClick:g,disabled:c||!r.trim(),children:c?u.notebooks?.renameDialog?.renaming||"Renaming...":u.notebooks?.renameDialog?.rename||"Rename"})]})]})})}var eT=e.i(328623),eD=e.i(132411);function eq({notebookId:e,onFinished:n}){let{t:l}=(0,w.b)(),[i,r]=(0,a.useState)(null),[o,c]=(0,a.useState)(null),d=(0,a.useRef)(!1),u=`notebook:${e}:retag`,{running:m,refresh:h}=(0,eD.f)(u),g=(0,a.useCallback)(()=>{ee.k.get(`/api/notebooks/${e}/retag`).then(e=>{d.current&&e&&!e.running&&n?.(),d.current=!!e?.running,r(e)}).catch(()=>void 0)},[e,n]);(0,a.useEffect)(g,[g]),(0,a.useEffect)(()=>{if(!i?.running)return;let e=setTimeout(g,2e3);return()=>clearTimeout(e)},[i,g]);let p=(0,a.useRef)(!1);(0,a.useEffect)(()=>{if(m){p.current=!0;return}p.current&&(p.current=!1,n?.())},[m,n]);let f=async()=>{if(await (0,L.u)(l.retag.notebookConfirm)){c(null);try{let t=await ee.k.post(`/api/notebooks/${e}/retag`,{});if(0===t.total)return void c(l.retag.empty);d.current=t.running,r(t)}catch(e){e instanceof ee.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING"?(L.c.info(l.errors.TASK_ALREADY_RUNNING),await h()):c(l.retag.itemFailed)}}},x=o??(i?.running?l.retag.progress.replace("{done}",String(i.done)).replace("{total}",String(i.total)):i?.finishedAt&&i.total>0?l.retag.finished.replace("{success}",String(i.total-i.failed)).replace("{failed}",String(i.failed)):null),b=!!m||!!i?.running;return(0,t.jsxs)("div",{className:"flex flex-col items-start sm:items-end gap-1",children:[(0,t.jsxs)(s.f,{variant:"outline",size:"sm",onClick:f,disabled:b,"aria-label":l.retag.notebookButton,children:[b?(0,t.jsx)(ea.f,{className:"h-4 w-4 animate-spin sm:mr-2"}):(0,t.jsx)(eT.f,{className:"h-4 w-4 sm:mr-2"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:l.retag.notebookButton})]}),x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x})]})}var eA=e.i(709830),eE=e.i(35209);e.s(["default",0,function(){let e=(0,n.useParams)(),u=(0,n.useRouter)(),{t:m}=(0,w.b)(),[h,g]=(0,a.useState)(null);(0,eE.f)(m.notebooks.title,h?.name);let[p,f]=(0,a.useState)(!0),[x,b]=(0,a.useState)(!1),[j,y]=(0,a.useState)(0),k=(0,a.useCallback)(async e=>{try{let t=await ee.k.get(`/api/notebooks/${e}`);g(t)}catch(e){z.V.error("[NotebookDetail]","Failed to fetch notebook",{error:e}),L.c.error(m.notebooks?.notFound||"Notebook not found"),u.push("/notebooks")}finally{f(!1)}},[u,m]);(0,a.useEffect)(()=>{e.id&&k(e.id)},[e.id,k]);let v=async e=>{h&&g(await ee.k.put(`/api/notebooks/${h.id}`,{name:e}))},S=async()=>{if(h)try{let e=await ee.k.get(`/api/notebooks/${h.id}`);if((e._count?.errorItems||0)>0)return void L.c.warning(m.notebooks?.deleteNotEmpty||"Please clear all items in this notebook first.");if(!await (0,L.u)((m.notebooks?.deleteConfirm||"Are you sure?").replace("{name}",h.name),{destructive:!0}))return;await ee.k.delete(`/api/notebooks/${h.id}`),u.replace("/notebooks")}catch(e){z.V.error("[NotebookDetail]","Failed to delete notebook",{error:e}),L.c.error((0,J.d)(e)||m.notebooks?.deleteError||"Failed to delete")}};return p?(0,t.jsx)(i.f,{label:m.common.loading}):h?(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(l.f,{backHref:"/notebooks",title:h.name,titleAddon:(0,t.jsx)(s.f,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground",onClick:()=>b(!0),title:m.notebooks?.rename||"Rename",children:(0,t.jsx)(o.f,{className:"h-4 w-4"})}),description:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eA.E,{notebook:h})," · ",(m.notebooks?.totalErrors||"Total {count} errors").replace("{count}",(h._count?.errorItems||0).toString())]}),actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.f,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:S,"aria-label":m.common.delete,children:[(0,t.jsx)(c.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:m.common.delete})]}),(0,t.jsx)(eq,{notebookId:h.id,onFinished:()=>y(e=>e+1)}),(0,t.jsx)(d.default,{href:`/notebooks/${h.id}/add`,children:(0,t.jsxs)(s.f,{"aria-label":m.notebooks?.addError||"Add Error",children:[(0,t.jsx)(r.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:m.notebooks?.addError||"Add Error"})]})})]})}),(0,t.jsx)(eS,{subjectId:h.id,subjectName:h.name,tagSet:h.tagSet||"default"},j),(0,t.jsx)(eC,{open:x,onOpenChange:b,currentName:h.name,onRename:v})]})}):null}],198591)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[711241,e=>{var l=e.i(456420);let i={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};i.node;let t=(0,l.f)(i);e.s(["f",0,t],711241)},562215,e=>{var l=e.i(456420);let i={name:"crop",size:24,node:[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]};i.node;let t=(0,l.f)(i);e.s(["f",0,t],562215)},590546,e=>{var l=e.i(843476),i=e.i(618566),t=e.i(519455),c=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let s=(0,i.useRouter)();return(0,l.jsx)(t.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(e)},className:n,children:(0,l.jsx)(c.f,{className:"h-5 w-5"})})}])},912505,e=>{var l=e.i(843476),i=e.i(975157);e.s(["f",0,function({icon:e,title:t,description:c,action:n,className:s}){return(0,l.jsxs)("div",{className:(0,i.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",s),children:[(0,l.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,l.jsx)(e,{className:"h-7 w-7"})}),(0,l.jsx)("p",{className:"font-medium",children:t}),c&&(0,l.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:c}),n&&(0,l.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var l=e.i(843476),i=e.i(590546),t=e.i(975157);e.s(["f",0,function({title:e,description:c,backHref:n,actions:s,titleAddon:a,className:o}){return(0,l.jsxs)("div",{className:(0,t.f)("flex items-start gap-3",o),children:[n&&(0,l.jsx)(i.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,l.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),a]}),c&&(0,l.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:c})]}),s&&(0,l.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}])},86963,e=>{var l=e.i(843476),i=e.i(632781);e.s(["f",0,function({label:e}){return(0,l.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,l.jsx)(i.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,l.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var l=e.i(271645),i=e.i(111110);e.s(["f",0,function(...e){let{t}=(0,i.b)(),c=[t.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,l.useEffect)(()=>{document.title=c},[c])}])},401280,e=>{let l={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let i=e.trim().toLowerCase();return i?l[i]??null:null}])}],462684,e=>{e.v(l=>Promise.all(["static/chunks/2hh64gi4pmlk2.js"].map(l=>e.l(l))).then(()=>l(506175)))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[711241,e=>{var s=e.i(456420);let t={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],711241)},576248,e=>{var s=e.i(456420);let t={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],576248)},474544,e=>{var s=e.i(456420);let t={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],474544)},562215,e=>{var s=e.i(456420);let t={name:"crop",size:24,node:[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],562215)},520732,e=>{var s=e.i(843476),t=e.i(271645),a=e.i(149704),r=e.i(519455),i=e.i(793479),l=e.i(111110),n=e.i(294114),d=e.i(184110),c=e.i(201276);e.s(["f",0,function({svg:e,scale:m,align:o,previewScaleOverride:x,previewAlignOverride:u,onSave:f}){let{t:h}=(0,l.b)(),g=(0,t.useId)(),p=(0,d.V)(m),b=(0,d.o)(o),[y,j]=(0,t.useState)(null),[v,N]=(0,t.useState)(null),[w,k]=(0,t.useState)(!1),S=y??String(p),A=""!==S.trim()&&(0,d.x)(Number(S)),T=A?Number(S):p,C=v??b,$=x??T,M=u??C,z=null!==y&&(!A||Number(S)!==p)||null!==v&&v!==b;if(!e)return null;let R=async e=>{if(e.preventDefault(),A&&z&&!w){k(!0);try{await f(T,C),j(null),N(null),n.c.success(h.common.messages.saveSuccess)}catch(e){c.V.error("[FigureScale]","保存配图比例失败",{error:e}),n.c.error(h.common.messages.saveFailed)}finally{k(!1)}}};return(0,s.jsxs)("div",{children:[(0,s.jsx)(a.f,{svg:e,scale:$,align:M}),(0,s.jsxs)("form",{onSubmit:R,className:"figure-scale-editor-controls space-y-2 rounded-md border p-3 print:hidden",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,s.jsx)("label",{htmlFor:g,children:h.figure.scale}),(0,s.jsx)(i.f,{id:g,type:"number",min:d._,max:d.a,step:1,value:S,disabled:w,"aria-describedby":`${g}-hint`,"aria-invalid":!A,onChange:e=>j(e.target.value),className:"h-8 w-20"}),(0,s.jsx)("span",{children:"%"}),(0,s.jsx)(r.f,{type:"button",variant:"outline",size:"sm",disabled:w||A&&T===d.n,onClick:()=>j(String(d.n)),children:h.figure.resetScale}),(0,s.jsxs)("div",{role:"group","aria-label":h.figure.align,className:"inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:h.figure.align}),d.j.map(e=>(0,s.jsx)(r.f,{type:"button",variant:C===e?"default":"outline",size:"sm",disabled:w,"aria-pressed":C===e,onClick:()=>N(e===b?null:e),children:h.figure.aligns[e]},e))]}),(0,s.jsx)(r.f,{type:"submit",size:"sm",disabled:w||!z||!A,children:w?h.common.progress.saving:h.common.save}),z&&(0,s.jsx)(r.f,{type:"button",variant:"ghost",size:"sm",disabled:w,onClick:()=>{j(null),N(null)},children:h.common.cancel})]}),(0,s.jsx)("input",{type:"range",min:d._,max:d.a,step:1,value:T,disabled:w,"aria-label":h.figure.scaleSlider,"aria-describedby":`${g}-hint`,onChange:e=>j(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,s.jsx)("p",{id:`${g}-hint`,className:"text-xs text-muted-foreground",children:h.figure.scaleHint})]})]})}])},991686,e=>{var s=e.i(843476),t=e.i(271645),a=e.i(522016),r=e.i(215519),i=e.i(306831),l=e.i(716327),n=e.i(456539),d=e.i(632781),c=e.i(77071),m=e.i(328623),o=e.i(759659),x=e.i(487486),u=e.i(519455),f=e.i(515288),h=e.i(511445),g=e.i(856522),p=e.i(793479),b=e.i(393733),y=e.i(111110),j=e.i(41931);function v({errorItemId:e,onSaved:a,onCancel:l}){let{t:n}=(0,y.b)(),{timeZone:c}=(0,r.M)(),m=(0,i.r)(new Date,"yyyy-MM-dd",c),[o,x]=(0,t.useState)(null),[f,h]=(0,t.useState)(m),[N,w]=(0,t.useState)(!1),[k,S]=(0,t.useState)(null),A=async()=>{if(o&&f){w(!0),S(null);try{await j.k.post("/api/practice/record",{errorItemId:e,result:o,source:"manual",takenAt:(0,i.$)(f,c)}),a()}catch{S(n.mastery.resultSaveFailed)}finally{w(!1)}}};return(0,s.jsxs)("div",{className:"space-y-3 rounded-md border bg-muted/30 p-3",children:[(0,s.jsx)(b.f,{value:o,onChange:x,disabled:N}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,s.jsx)("label",{htmlFor:`practice-date-${e}`,className:"text-sm font-medium",children:n.mastery.recordDate}),(0,s.jsx)(p.f,{id:`practice-date-${e}`,type:"date",value:f,max:m,onChange:e=>h(e.target.value),className:"sm:w-48"}),(0,s.jsxs)("div",{className:"flex gap-2 sm:ml-auto",children:[(0,s.jsx)(u.f,{variant:"outline",size:"sm",onClick:l,disabled:N,className:"flex-1 sm:flex-none",children:n.exam.cancel}),(0,s.jsxs)(u.f,{size:"sm",onClick:A,disabled:N||!o||!f,className:"flex-1 sm:flex-none",children:[N?(0,s.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(g.f,{className:"mr-2 h-4 w-4"}),n.mastery.saveResult]})]})]}),k&&(0,s.jsx)("p",{className:"text-sm text-destructive",children:k})]})}var N=e.i(149704),w=e.i(294114),k=e.i(905110);let S={correct:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900",wrong:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",not_attempted:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900"};e.s(["K",0,function({errorItemId:e,onMasteryStatusChange:g}){let{timeZone:p}=(0,r.M)(),{t:b}=(0,y.b)(),[A,T]=(0,t.useState)(null),[C,$]=(0,t.useState)(null),[M,z]=(0,t.useState)(0),[R,E]=(0,t.useState)(!1),H=(0,t.useCallback)(()=>{j.k.get(`/api/error-items/${e}/practice-records`).then(e=>{T(e),g?.(e.masteryStatus)}).catch(()=>void 0)},[e,g]);(0,t.useEffect)(H,[H]);let F=()=>{z(0),H()},I=async e=>{if(await (0,w.u)(b.mastery.deleteRecordConfirm,{destructive:!0}))try{await j.k.delete(`/api/practice/record/${e}`),F()}catch{w.c.error(b.mastery.deleteRecordFailed)}},P=A?.records[0],D=!!P&&(!A?.masteryEvaluatedAt||new Date(P.createdAt)>new Date(A.masteryEvaluatedAt));if((0,t.useEffect)(()=>{if(!D||M>=20)return;let e=setTimeout(()=>{z(e=>e+1),H()},4e3);return()=>clearTimeout(e)},[D,M,H]),!A)return null;let q=A.masteryProbability,O=null===q?null:Math.round(100*q),U=null===O?"":(0,k.m)(q,A.masteryThreshold)?"bg-green-500":O>=30?"bg-amber-500":"bg-red-500",_=b.practice.difficulty;return(0,s.jsxs)(f.N,{children:[(0,s.jsx)(f.Y,{children:(0,s.jsxs)(f.v,{className:"flex items-center gap-2 text-base",children:[(0,s.jsx)(m.f,{className:"h-4 w-4 text-primary"}),b.mastery.probability]})}),(0,s.jsxs)(f.O,{className:"space-y-4",children:[null===O?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:D?b.mastery.pending:b.mastery.notEvaluated}):(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,s.jsxs)("span",{className:"text-3xl font-bold",children:[O,"%"]}),(0,s.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[D&&(0,s.jsx)(d.f,{className:"h-3 w-3 animate-spin"}),(0,s.jsx)(x.f,{variant:"outline",children:"ai"===A.masterySource?b.mastery.aiEvaluated:b.mastery.estimated})]})]}),(0,s.jsx)("div",{className:"h-2 w-full rounded-full bg-muted overflow-hidden",children:(0,s.jsx)("div",{className:`h-full ${U} transition-all`,style:{width:`${O}%`}})}),A.masteryReason&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:A.masteryReason}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:b.mastery.thresholdHint.replace("{threshold}",String(A.masteryThreshold))})]}),(0,s.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("h4",{className:"text-sm font-semibold",children:b.mastery.history}),!R&&(0,s.jsxs)(u.f,{variant:"outline",size:"sm",onClick:()=>E(!0),children:[(0,s.jsx)(c.f,{className:"mr-1 h-4 w-4"}),b.mastery.addRecord]})]}),R&&(0,s.jsx)(v,{errorItemId:e,onCancel:()=>E(!1),onSaved:()=>{E(!1),F()}}),0===A.records.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground italic",children:b.mastery.noHistory}):(0,s.jsx)("ul",{className:"divide-y rounded-md border",children:A.records.map(e=>(0,s.jsxs)("li",{className:"p-3 text-sm space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 flex-wrap items-center gap-2 text-left",onClick:()=>$(C===e.id?null:e.id),children:[(0,s.jsx)("span",{className:"text-muted-foreground tabular-nums",children:(0,i.r)(e.createdAt,"yyyy-MM-dd HH:mm",p)}),(0,s.jsx)(x.f,{variant:"outline",className:S[e.result]||"",children:b.mastery.results[e.result]||e.result}),e.difficulty&&(0,s.jsx)(x.f,{variant:"secondary",children:_[e.difficulty]||e.difficulty}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.exam?`${b.mastery.sources.exam} \xb7 ${e.exam.title}`:b.mastery.sources[e.source]||b.mastery.sources.practice}),(e.questionText||e.mistakeAnalysis||e.wrongAnswerText)&&(0,s.jsx)("span",{className:"ml-auto text-muted-foreground",children:C===e.id?(0,s.jsx)(n.f,{className:"h-4 w-4"}):(0,s.jsx)(l.f,{className:"h-4 w-4"})})]}),(0,s.jsx)("button",{type:"button","aria-label":b.mastery.deleteRecord,title:b.mastery.deleteRecord,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-red-50 dark:hover:bg-red-950/40 hover:text-red-600 dark:hover:text-red-400",onClick:()=>I(e.id),children:(0,s.jsx)(o.f,{className:"h-4 w-4"})})]}),C===e.id&&(e.questionText||e.mistakeAnalysis||e.wrongAnswerText)&&(0,s.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[(0,s.jsx)(h.f,{content:e.questionText}),(0,s.jsx)(N.f,{svg:e.figureSvg}),e.wrongAnswerText&&(0,s.jsxs)("div",{className:"border-t pt-2",children:[(0,s.jsx)("p",{className:"mb-1 font-medium",children:b.editor.wrongAnswerText}),(0,s.jsx)(h.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,s.jsxs)("div",{className:"border-t pt-2",children:[(0,s.jsx)("p",{className:"mb-1 font-medium",children:b.editor.mistakeAnalysis}),(0,s.jsx)(h.f,{content:e.mistakeAnalysis})]}),e.originalImageUrl&&(0,s.jsx)("img",{src:e.originalImageUrl,alt:b.editor.wrongAnswerText,className:"max-h-96 max-w-full rounded object-contain"}),e.answerText&&(0,s.jsx)("div",{className:"border-t pt-2",children:(0,s.jsx)(h.f,{content:e.answerText,className:"font-semibold"})}),e.exam&&(0,s.jsx)(a.default,{href:`/exams/${e.exam.paperId}`,className:"text-xs text-primary hover:underline",children:e.exam.title})]})]},e.id))})]})]})]})},"x",0,S],991686)},846968,e=>{var s=e.i(843476),t=e.i(548161),a=e.i(474544),r=e.i(741120),i=e.i(487486),l=e.i(111110);let n={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:a.f},reviewing:{className:"bg-primary/10 text-primary",icon:r.f},mastered:{className:"bg-success/15 text-success",icon:t.f}};e.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:e,className:t=""}){let{t:a}=(0,l.b)(),{className:r,icon:d}=n[e],c="mastered"===e?a.notebook.mastered:"reviewing"===e?a.notebook.reviewing:a.notebook.review;return(0,s.jsx)(i.f,{variant:"secondary",className:`${r} ${t}`,children:(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(d,{className:"h-3 w-3"})," ",c]})})}])},393733,931454,e=>{var s=e.i(843476),t=e.i(548161),a=e.i(576248),r=e.i(583967),i=e.i(111110);let l=[{value:"correct",icon:t.f,active:"border-green-600 bg-green-50 dark:bg-green-950/40 text-green-700 dark:text-green-300"},{value:"wrong",icon:r.f,active:"border-red-600 bg-red-50 dark:bg-red-950/40 text-red-700 dark:text-red-300"},{value:"not_attempted",icon:a.f,active:"border-amber-600 bg-amber-50 dark:bg-amber-950/40 text-amber-700 dark:text-amber-300"}];e.s(["f",0,function({value:e,onChange:t,disabled:a,size:r="md"}){let{t:n}=(0,i.b)(),d="sm"===r?"px-2 py-1 text-xs":"px-3 py-2 text-sm";return(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2",role:"radiogroup",children:l.map(({value:i,icon:l,active:c})=>(0,s.jsxs)("button",{type:"button",role:"radio","aria-checked":e===i,disabled:a,onClick:()=>t(i),className:`flex items-center justify-center gap-1 rounded-md border font-medium transition-colors disabled:opacity-60 ${d} ${e===i?c:"border-input hover:bg-muted"}`,children:[(0,s.jsx)(l,{className:"sm"===r?"h-3 w-3":"h-4 w-4"}),n.mastery.results[i]]},i))})}],393733);var n=e.i(534693);e.s(["f",()=>n.f],931454)},912505,e=>{var s=e.i(843476),t=e.i(975157);e.s(["f",0,function({icon:e,title:a,description:r,action:i,className:l}){return(0,s.jsxs)("div",{className:(0,t.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",l),children:[(0,s.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,s.jsx)(e,{className:"h-7 w-7"})}),(0,s.jsx)("p",{className:"font-medium",children:a}),r&&(0,s.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),i&&(0,s.jsx)("div",{className:"mt-5",children:i})]})}])},86963,e=>{var s=e.i(843476),t=e.i(632781);e.s(["f",0,function({label:e}){return(0,s.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,s.jsx)(t.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,s.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var s=e.i(271645),t=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,t.b)(),r=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=r},[r])}])},428602,e=>{e.s(["f",0,function(e){if(e.tags&&e.tags.length>0)return e.tags.map(e=>e.name);if(!e.knowledgePoints)return[];try{let s=JSON.parse(e.knowledgePoints);return Array.isArray(s)?s.filter(e=>"string"==typeof e):[]}catch{return[]}}])}],462684,e=>{e.v(s=>Promise.all(["static/chunks/2hh64gi4pmlk2.js"].map(s=>e.l(s))).then(()=>s(506175)))}]);