wrong-notebook 2026.11.2-2 → 2026.11.3-1

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 (673) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +15 -0
  3. package/.next/build-manifest.json +36 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +112 -0
  6. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/admin/page.js.nft.json +1 -1
  16. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
  18. package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/admin/cnm-tags/route.js +6 -5
  20. package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
  21. package/.next/server/app/api/admin/dashboard/route.js +16 -15
  22. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  23. package/.next/server/app/api/admin/debug-logs/export/route.js +5 -4
  24. package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
  25. package/.next/server/app/api/admin/debug-logs/route.js +5 -4
  26. package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
  27. package/.next/server/app/api/admin/migrate-tags/route.js +5 -4
  28. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  29. package/.next/server/app/api/admin/system-reset/route.js +5 -4
  30. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  31. package/.next/server/app/api/admin/users/[id]/detail/route.js +16 -15
  32. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  33. package/.next/server/app/api/admin/users/[id]/route.js +5 -4
  34. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  35. package/.next/server/app/api/admin/users/route.js +5 -4
  36. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  37. package/.next/server/app/api/ai/models/route.js +11 -10
  38. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  39. package/.next/server/app/api/ai/test/route.js +10 -9
  40. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  41. package/.next/server/app/api/analytics/route.js +12 -11
  42. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  43. package/.next/server/app/api/analyze/route.js +16 -14
  44. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  45. package/.next/server/app/api/auth/[...nextauth]/route.js +4 -3
  46. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  47. package/.next/server/app/api/error-items/[id]/delete/route.js +5 -4
  48. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  49. package/.next/server/app/api/error-items/[id]/figure/route.js +14 -13
  50. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  51. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +16 -15
  52. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  53. package/.next/server/app/api/error-items/[id]/geogebra/route.js +12 -11
  54. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  55. package/.next/server/app/api/error-items/[id]/image/route.js +4 -3
  56. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  57. package/.next/server/app/api/error-items/[id]/notes/route.js +5 -4
  58. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  59. package/.next/server/app/api/error-items/[id]/practice-records/route.js +4 -3
  60. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  61. package/.next/server/app/api/error-items/[id]/reanswer/route.js +14 -13
  62. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  63. package/.next/server/app/api/error-items/[id]/retag/route.js +15 -14
  64. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  65. package/.next/server/app/api/error-items/[id]/route.js +6 -5
  66. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  67. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +14 -13
  68. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
  69. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +14 -13
  70. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  71. package/.next/server/app/api/error-items/answer-space/route/app-paths-manifest.json +3 -0
  72. package/.next/server/app/api/error-items/answer-space/route/build-manifest.json +12 -0
  73. package/.next/server/app/api/error-items/answer-space/route/server-reference-manifest.json +4 -0
  74. package/.next/server/app/api/error-items/answer-space/route.js +14 -0
  75. package/.next/server/app/api/error-items/answer-space/route.js.map +5 -0
  76. package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -0
  77. package/.next/server/app/api/error-items/answer-space/route_client-reference-manifest.js +3 -0
  78. package/.next/server/app/api/error-items/batch-delete/route.js +5 -4
  79. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  80. package/.next/server/app/api/error-items/clear/route.js +5 -4
  81. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  82. package/.next/server/app/api/error-items/list/route.js +6 -5
  83. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  84. package/.next/server/app/api/error-items/route.js +20 -18
  85. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  86. package/.next/server/app/api/error-items/short/[shortId]/route.js +4 -3
  87. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  88. package/.next/server/app/api/error-items/similarity/route.js +6 -5
  89. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  90. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +15 -14
  91. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  92. package/.next/server/app/api/exams/[id]/results/route.js +17 -16
  93. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  94. package/.next/server/app/api/exams/[id]/retry/route.js +16 -15
  95. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  96. package/.next/server/app/api/exams/[id]/route.js +17 -15
  97. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  98. package/.next/server/app/api/exams/route.js +17 -16
  99. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  100. package/.next/server/app/api/export/route.js +10 -8
  101. package/.next/server/app/api/export/route.js.nft.json +1 -1
  102. package/.next/server/app/api/geogebra-analyze/route.js +13 -12
  103. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  104. package/.next/server/app/api/health/route.js +3 -2
  105. package/.next/server/app/api/health/route.js.nft.json +1 -1
  106. package/.next/server/app/api/import/route.js +20 -18
  107. package/.next/server/app/api/import/route.js.nft.json +1 -1
  108. package/.next/server/app/api/import-batches/[id]/confirm-all/route/app-paths-manifest.json +3 -0
  109. package/.next/server/app/api/import-batches/[id]/confirm-all/route/build-manifest.json +12 -0
  110. package/.next/server/app/api/import-batches/[id]/confirm-all/route/server-reference-manifest.json +4 -0
  111. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +34 -0
  112. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.map +5 -0
  113. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -0
  114. package/.next/server/app/api/import-batches/[id]/confirm-all/route_client-reference-manifest.js +3 -0
  115. package/.next/server/app/api/import-batches/[id]/read/route/app-paths-manifest.json +3 -0
  116. package/.next/server/app/api/import-batches/[id]/read/route/build-manifest.json +12 -0
  117. package/.next/server/app/api/import-batches/[id]/read/route/server-reference-manifest.json +4 -0
  118. package/.next/server/app/api/import-batches/[id]/read/route.js +34 -0
  119. package/.next/server/app/api/import-batches/[id]/read/route.js.map +5 -0
  120. package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -0
  121. package/.next/server/app/api/import-batches/[id]/read/route_client-reference-manifest.js +3 -0
  122. package/.next/server/app/api/import-batches/[id]/retry/route/app-paths-manifest.json +3 -0
  123. package/.next/server/app/api/import-batches/[id]/retry/route/build-manifest.json +12 -0
  124. package/.next/server/app/api/import-batches/[id]/retry/route/server-reference-manifest.json +4 -0
  125. package/.next/server/app/api/import-batches/[id]/retry/route.js +34 -0
  126. package/.next/server/app/api/import-batches/[id]/retry/route.js.map +5 -0
  127. package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -0
  128. package/.next/server/app/api/import-batches/[id]/retry/route_client-reference-manifest.js +3 -0
  129. package/.next/server/app/api/import-batches/[id]/route/app-paths-manifest.json +3 -0
  130. package/.next/server/app/api/import-batches/[id]/route/build-manifest.json +12 -0
  131. package/.next/server/app/api/import-batches/[id]/route/server-reference-manifest.json +4 -0
  132. package/.next/server/app/api/import-batches/[id]/route.js +34 -0
  133. package/.next/server/app/api/import-batches/[id]/route.js.map +5 -0
  134. package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -0
  135. package/.next/server/app/api/import-batches/[id]/route_client-reference-manifest.js +3 -0
  136. package/.next/server/app/api/import-batches/[id]/start/route/app-paths-manifest.json +3 -0
  137. package/.next/server/app/api/import-batches/[id]/start/route/build-manifest.json +12 -0
  138. package/.next/server/app/api/import-batches/[id]/start/route/server-reference-manifest.json +4 -0
  139. package/.next/server/app/api/import-batches/[id]/start/route.js +34 -0
  140. package/.next/server/app/api/import-batches/[id]/start/route.js.map +5 -0
  141. package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -0
  142. package/.next/server/app/api/import-batches/[id]/start/route_client-reference-manifest.js +3 -0
  143. package/.next/server/app/api/import-batches/route/app-paths-manifest.json +3 -0
  144. package/.next/server/app/api/import-batches/route/build-manifest.json +12 -0
  145. package/.next/server/app/api/import-batches/route/server-reference-manifest.json +4 -0
  146. package/.next/server/app/api/import-batches/route.js +34 -0
  147. package/.next/server/app/api/import-batches/route.js.map +5 -0
  148. package/.next/server/app/api/import-batches/route.js.nft.json +1 -0
  149. package/.next/server/app/api/import-batches/route_client-reference-manifest.js +3 -0
  150. package/.next/server/app/api/import-tasks/[id]/confirm/route/app-paths-manifest.json +3 -0
  151. package/.next/server/app/api/import-tasks/[id]/confirm/route/build-manifest.json +12 -0
  152. package/.next/server/app/api/import-tasks/[id]/confirm/route/server-reference-manifest.json +4 -0
  153. package/.next/server/app/api/import-tasks/[id]/confirm/route.js +33 -0
  154. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.map +5 -0
  155. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -0
  156. package/.next/server/app/api/import-tasks/[id]/confirm/route_client-reference-manifest.js +3 -0
  157. package/.next/server/app/api/import-tasks/[id]/read/route/app-paths-manifest.json +3 -0
  158. package/.next/server/app/api/import-tasks/[id]/read/route/build-manifest.json +12 -0
  159. package/.next/server/app/api/import-tasks/[id]/read/route/server-reference-manifest.json +4 -0
  160. package/.next/server/app/api/import-tasks/[id]/read/route.js +33 -0
  161. package/.next/server/app/api/import-tasks/[id]/read/route.js.map +5 -0
  162. package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -0
  163. package/.next/server/app/api/import-tasks/[id]/read/route_client-reference-manifest.js +3 -0
  164. package/.next/server/app/api/import-tasks/[id]/retry/route/app-paths-manifest.json +3 -0
  165. package/.next/server/app/api/import-tasks/[id]/retry/route/build-manifest.json +12 -0
  166. package/.next/server/app/api/import-tasks/[id]/retry/route/server-reference-manifest.json +4 -0
  167. package/.next/server/app/api/import-tasks/[id]/retry/route.js +33 -0
  168. package/.next/server/app/api/import-tasks/[id]/retry/route.js.map +5 -0
  169. package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -0
  170. package/.next/server/app/api/import-tasks/[id]/retry/route_client-reference-manifest.js +3 -0
  171. package/.next/server/app/api/import-tasks/[id]/route/app-paths-manifest.json +3 -0
  172. package/.next/server/app/api/import-tasks/[id]/route/build-manifest.json +12 -0
  173. package/.next/server/app/api/import-tasks/[id]/route/server-reference-manifest.json +4 -0
  174. package/.next/server/app/api/import-tasks/[id]/route.js +33 -0
  175. package/.next/server/app/api/import-tasks/[id]/route.js.map +5 -0
  176. package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -0
  177. package/.next/server/app/api/import-tasks/[id]/route_client-reference-manifest.js +3 -0
  178. package/.next/server/app/api/import-tasks/route/app-paths-manifest.json +3 -0
  179. package/.next/server/app/api/import-tasks/route/build-manifest.json +12 -0
  180. package/.next/server/app/api/import-tasks/route/server-reference-manifest.json +4 -0
  181. package/.next/server/app/api/import-tasks/route.js +34 -0
  182. package/.next/server/app/api/import-tasks/route.js.map +5 -0
  183. package/.next/server/app/api/import-tasks/route.js.nft.json +1 -0
  184. package/.next/server/app/api/import-tasks/route_client-reference-manifest.js +3 -0
  185. package/.next/server/app/api/initialize/route.js +5 -4
  186. package/.next/server/app/api/initialize/route.js.nft.json +1 -1
  187. package/.next/server/app/api/logs/frontend/route.js +4 -3
  188. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  189. package/.next/server/app/api/minimax-code/checkin/route.js +6 -5
  190. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  191. package/.next/server/app/api/minimax-code/login/route.js +5 -4
  192. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  193. package/.next/server/app/api/minimax-code/route.js +5 -4
  194. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  195. package/.next/server/app/api/notebooks/[id]/retag/route.js +13 -12
  196. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  197. package/.next/server/app/api/notebooks/[id]/route.js +5 -4
  198. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  199. package/.next/server/app/api/notebooks/route.js +5 -4
  200. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  201. package/.next/server/app/api/openclaw/batch-upload/route.js +17 -16
  202. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  203. package/.next/server/app/api/paper-groups/[id]/route.js +5 -4
  204. package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
  205. package/.next/server/app/api/paper-groups/route.js +6 -5
  206. package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
  207. package/.next/server/app/api/practice/generate/route.js +14 -13
  208. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  209. package/.next/server/app/api/practice/grade/route.js +13 -12
  210. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  211. package/.next/server/app/api/practice/record/[id]/route.js +11 -10
  212. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  213. package/.next/server/app/api/practice/record/route.js +13 -12
  214. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  215. package/.next/server/app/api/reanswer/route.js +15 -14
  216. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  217. package/.next/server/app/api/register/route.js +6 -5
  218. package/.next/server/app/api/register/route.js.nft.json +1 -1
  219. package/.next/server/app/api/register/status/route.js +5 -4
  220. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  221. package/.next/server/app/api/requests/[id]/route.js +6 -5
  222. package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
  223. package/.next/server/app/api/review/due/route.js +15 -14
  224. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  225. package/.next/server/app/api/settings/route.js +9 -8
  226. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  227. package/.next/server/app/api/setup/route.js +6 -5
  228. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  229. package/.next/server/app/api/stats/practice/clear/route.js +5 -4
  230. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  231. package/.next/server/app/api/stats/practice/route.js +5 -4
  232. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  233. package/.next/server/app/api/tags/route.js +4 -3
  234. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  235. package/.next/server/app/api/tags/stats/route.js +5 -4
  236. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  237. package/.next/server/app/api/tags/suggestions/route.js +4 -3
  238. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  239. package/.next/server/app/api/tasks/route.js +5 -4
  240. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  241. package/.next/server/app/api/tts/[id]/route.js +8 -7
  242. package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
  243. package/.next/server/app/api/tts/batch/route.js +12 -11
  244. package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
  245. package/.next/server/app/api/tts/route.js +8 -7
  246. package/.next/server/app/api/tts/route.js.nft.json +1 -1
  247. package/.next/server/app/api/tts/status/route.js +10 -9
  248. package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
  249. package/.next/server/app/api/user/route.js +14 -13
  250. package/.next/server/app/api/user/route.js.nft.json +1 -1
  251. package/.next/server/app/api/version/route.js +3 -2
  252. package/.next/server/app/api/version/route.js.nft.json +1 -1
  253. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  254. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  255. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  256. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  257. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  258. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  259. package/.next/server/app/exams/page.js.nft.json +1 -1
  260. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  261. package/.next/server/app/favicon.ico/route.js +3 -2
  262. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  263. package/.next/server/app/import-batches/[id]/page/app-paths-manifest.json +3 -0
  264. package/.next/server/app/import-batches/[id]/page/build-manifest.json +22 -0
  265. package/.next/server/app/import-batches/[id]/page/next-font-manifest.json +11 -0
  266. package/.next/server/app/import-batches/[id]/page/react-loadable-manifest.json +1 -0
  267. package/.next/server/app/import-batches/[id]/page/server-reference-manifest.json +4 -0
  268. package/.next/server/app/import-batches/[id]/page.js +14 -0
  269. package/.next/server/app/import-batches/[id]/page.js.map +5 -0
  270. package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -0
  271. package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +3 -0
  272. package/.next/server/app/import-tasks/[id]/page/app-paths-manifest.json +3 -0
  273. package/.next/server/app/import-tasks/[id]/page/build-manifest.json +22 -0
  274. package/.next/server/app/import-tasks/[id]/page/next-font-manifest.json +11 -0
  275. package/.next/server/app/import-tasks/[id]/page/react-loadable-manifest.json +1 -0
  276. package/.next/server/app/import-tasks/[id]/page/server-reference-manifest.json +4 -0
  277. package/.next/server/app/import-tasks/[id]/page.js +14 -0
  278. package/.next/server/app/import-tasks/[id]/page.js.map +5 -0
  279. package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -0
  280. package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +3 -0
  281. package/.next/server/app/import-tasks/page/app-paths-manifest.json +3 -0
  282. package/.next/server/app/import-tasks/page/build-manifest.json +22 -0
  283. package/.next/server/app/import-tasks/page/next-font-manifest.json +11 -0
  284. package/.next/server/app/import-tasks/page/react-loadable-manifest.json +1 -0
  285. package/.next/server/app/import-tasks/page/server-reference-manifest.json +4 -0
  286. package/.next/server/app/import-tasks/page.js +14 -0
  287. package/.next/server/app/import-tasks/page.js.map +5 -0
  288. package/.next/server/app/import-tasks/page.js.nft.json +1 -0
  289. package/.next/server/app/import-tasks/page_client-reference-manifest.js +3 -0
  290. package/.next/server/app/initialize/page.js.nft.json +1 -1
  291. package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
  292. package/.next/server/app/login/page.js.nft.json +1 -1
  293. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  294. package/.next/server/app/manifest.webmanifest/route.js +3 -2
  295. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  296. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  297. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  298. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  299. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  300. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  301. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  302. package/.next/server/app/page.js.nft.json +1 -1
  303. package/.next/server/app/page_client-reference-manifest.js +1 -1
  304. package/.next/server/app/practice/page.js.nft.json +1 -1
  305. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  306. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  307. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  308. package/.next/server/app/register/page.js.nft.json +1 -1
  309. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  310. package/.next/server/app/review/page.js.nft.json +1 -1
  311. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  312. package/.next/server/app/setup/page.js.nft.json +1 -1
  313. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  314. package/.next/server/app/stats/page.js.nft.json +1 -1
  315. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  316. package/.next/server/app/tags/page.js.nft.json +1 -1
  317. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  318. package/.next/server/app-paths-manifest.json +15 -0
  319. package/.next/server/chunks/1oeh_server_app_api_error-items_answer-space_route_actions_02_4xy5gtmofu.js +3 -0
  320. package/.next/server/chunks/1oeh_server_app_api_import-batches_[id]_confirm-all_route_actions_1u0e8at9dph0_.js +3 -0
  321. package/.next/server/chunks/1oeh_server_app_api_import-batches_[id]_read_route_actions_1nrzqz1at4s64.js +3 -0
  322. package/.next/server/chunks/1oeh_server_app_api_import-batches_[id]_retry_route_actions_1u5hn2zjw-sj-.js +3 -0
  323. package/.next/server/chunks/1oeh_server_app_api_import-batches_[id]_start_route_actions_1o5tg4uk8s-ch.js +3 -0
  324. package/.next/server/chunks/1oeh_server_app_api_import-tasks_[id]_confirm_route_actions_0cj5phaug2e76.js +3 -0
  325. package/.next/server/chunks/1oeh_server_app_api_import-tasks_[id]_retry_route_actions_1g7rekf8h4rkk.js +3 -0
  326. package/.next/server/chunks/{[externals]__0c36n-dcv5nqc._.js → [externals]__0fgpzedhhntg9._.js} +1 -1
  327. package/.next/server/chunks/[externals]__14rv088xdnlo4._.js +3 -0
  328. package/.next/server/chunks/{[externals]__1lhov-pp9xqtz._.js → [externals]__1i7c9m3y35e80._.js} +1 -1
  329. package/.next/server/chunks/{[root-of-the-server]__0455yyxule6q_._.js → [root-of-the-server]__0-ipecoww0k_f._.js} +1 -1
  330. package/.next/server/chunks/{[root-of-the-server]__00jyo3io99_dn._.js → [root-of-the-server]__0-rtxg7i50p0s._.js} +2 -2
  331. package/.next/server/chunks/{[root-of-the-server]__0hm2dh8ziz93k._.js → [root-of-the-server]__02oqd6w58wymi._.js} +1 -1
  332. package/.next/server/chunks/[root-of-the-server]__0401xgmcbb_7u._.js +3 -0
  333. package/.next/server/chunks/[root-of-the-server]__04pdmyloqh744._.js +5 -0
  334. package/.next/server/chunks/{[root-of-the-server]__07uf7ctm4sjo4._.js → [root-of-the-server]__04tx90mwz-58t._.js} +1 -1
  335. package/.next/server/chunks/[root-of-the-server]__05615yr7zmo6t._.js +3 -0
  336. package/.next/server/chunks/{[root-of-the-server]__06lmwv-4d1slg._.js → [root-of-the-server]__05iw617rx9m75._.js} +1 -1
  337. package/.next/server/chunks/{[root-of-the-server]__0n0c-mpolar22._.js → [root-of-the-server]__06675jta6pa74._.js} +2 -2
  338. package/.next/server/chunks/[root-of-the-server]__06ocjahusp01i._.js +3 -0
  339. package/.next/server/chunks/{[root-of-the-server]__1m8b6why7f1uj._.js → [root-of-the-server]__06pk7x8wdbyel._.js} +2 -2
  340. package/.next/server/chunks/[root-of-the-server]__08crf3zxl7fnv._.js +3 -0
  341. package/.next/server/chunks/{[root-of-the-server]__0m8bcdajibej0._.js → [root-of-the-server]__092b1e081ocu6._.js} +1 -1
  342. package/.next/server/chunks/{[root-of-the-server]__0vz0xv_w6vbpq._.js → [root-of-the-server]__092h03ec6f_1u._.js} +1 -1
  343. package/.next/server/chunks/{[root-of-the-server]__12fkzjxvspcin._.js → [root-of-the-server]__094fb72-14c6v._.js} +1 -1
  344. package/.next/server/chunks/{[root-of-the-server]__0_ahztuh3lr_n._.js → [root-of-the-server]__0982_75un5k3v._.js} +1 -1
  345. package/.next/server/chunks/{[root-of-the-server]__0sxr-ing62eg7._.js → [root-of-the-server]__09wdoeko-mqnp._.js} +1 -1
  346. package/.next/server/chunks/{[root-of-the-server]__1fj6upsvfxy4r._.js → [root-of-the-server]__0_fisu5brhyk_._.js} +1 -1
  347. package/.next/server/chunks/[root-of-the-server]__0_uvtfu0yr-na._.js +4 -4
  348. package/.next/server/chunks/[root-of-the-server]__0a13lncff9jx-._.js +3 -0
  349. package/.next/server/chunks/[root-of-the-server]__0b1s_-vbl79om._.js +3 -0
  350. package/.next/server/chunks/{[root-of-the-server]__0rnr17a382rjx._.js → [root-of-the-server]__0cu0eqoslaz4-._.js} +2 -2
  351. package/.next/server/chunks/{[root-of-the-server]__0u36j_9ml4et6._.js → [root-of-the-server]__0d_zoa2_linlk._.js} +1 -1
  352. package/.next/server/chunks/{[root-of-the-server]__145w7mwgp8ujm._.js → [root-of-the-server]__0f2xi-1x_bd0j._.js} +2 -2
  353. package/.next/server/chunks/{[root-of-the-server]__18uhupcdidftm._.js → [root-of-the-server]__0fnte1x8xdn5o._.js} +1 -1
  354. package/.next/server/chunks/[root-of-the-server]__0fxqs6p28o57m._.js +3 -0
  355. package/.next/server/chunks/[root-of-the-server]__0h3er81lqy7-3._.js +3 -0
  356. package/.next/server/chunks/{[root-of-the-server]__1f_lrxzw_n-6-._.js → [root-of-the-server]__0ha1sdqrzak3j._.js} +2 -2
  357. package/.next/server/chunks/{[root-of-the-server]__1ptzu7aqoga2n._.js → [root-of-the-server]__0hcbw1sliw973._.js} +2 -2
  358. package/.next/server/chunks/{[root-of-the-server]__00kq2qcxfg-kq._.js → [root-of-the-server]__0impq05z-6_x5._.js} +2 -2
  359. package/.next/server/chunks/{[root-of-the-server]__08t21dbk1cidn._.js → [root-of-the-server]__0jw-1uedp5s7y._.js} +2 -2
  360. package/.next/server/chunks/[root-of-the-server]__0jy5w86h0qg50._.js +3 -0
  361. package/.next/server/chunks/{[root-of-the-server]__18z_cczwqkonn._.js → [root-of-the-server]__0kehix4ojdnhw._.js} +2 -2
  362. package/.next/server/chunks/[root-of-the-server]__0kw7hbup538-8._.js +3 -0
  363. package/.next/server/chunks/{[root-of-the-server]__0xqsrh251_yms._.js → [root-of-the-server]__0l-amyqoswdni._.js} +1 -1
  364. package/.next/server/chunks/{[root-of-the-server]__1v1p83o4ygnyt._.js → [root-of-the-server]__0l__ty_n0br2x._.js} +2 -2
  365. package/.next/server/chunks/[root-of-the-server]__0mhtpz84f1vct._.js +3 -0
  366. package/.next/server/chunks/[root-of-the-server]__0mks6j_xgzj06._.js +3 -0
  367. package/.next/server/chunks/[root-of-the-server]__0nujsu6qbn-8o._.js +4 -4
  368. package/.next/server/chunks/{[root-of-the-server]__0nw6t7u627b2m._.js → [root-of-the-server]__0nv9vais_avpm._.js} +2 -2
  369. package/.next/server/chunks/{[root-of-the-server]__0kmy5264opoz7._.js → [root-of-the-server]__0odw8n6b44k3x._.js} +2 -2
  370. package/.next/server/chunks/[root-of-the-server]__0ol6aiama1k_-._.js +3 -0
  371. package/.next/server/chunks/[root-of-the-server]__0pce90ecznpjr._.js +3 -0
  372. package/.next/server/chunks/[root-of-the-server]__0pgghfs5ue4ff._.js +3 -0
  373. package/.next/server/chunks/{[root-of-the-server]__11ztapi1pi7j-._.js → [root-of-the-server]__0pkist00_xrfj._.js} +1 -1
  374. package/.next/server/chunks/[root-of-the-server]__0q3uk_5f9t6mb._.js +3 -0
  375. package/.next/server/chunks/[root-of-the-server]__0qw6cz355p_eb._.js +3 -0
  376. package/.next/server/chunks/[root-of-the-server]__0rwxa2doabk45._.js +3 -0
  377. package/.next/server/chunks/[root-of-the-server]__0s3z-zsl35ueb._.js +3 -0
  378. package/.next/server/chunks/[root-of-the-server]__0smf8z8cd59g3._.js +3 -0
  379. package/.next/server/chunks/[root-of-the-server]__0sujbuwv8y6bp._.js +3 -0
  380. package/.next/server/chunks/[root-of-the-server]__0tg572v-6f3wo._.js +3 -0
  381. package/.next/server/chunks/[root-of-the-server]__0to77zh5fihef._.js +3 -0
  382. package/.next/server/chunks/[root-of-the-server]__0u04aced_0ug4._.js +3 -0
  383. package/.next/server/chunks/[root-of-the-server]__0ujhtand4ld8w._.js +3 -0
  384. package/.next/server/chunks/[root-of-the-server]__0ultckrjp1h-q._.js +3 -0
  385. package/.next/server/chunks/[root-of-the-server]__0xkb9fyy9z_rr._.js +3 -0
  386. package/.next/server/chunks/[root-of-the-server]__0xqbpgtwhqhpl._.js +3 -0
  387. package/.next/server/chunks/[root-of-the-server]__0xwxn3blv1fe1._.js +3 -0
  388. package/.next/server/chunks/[root-of-the-server]__0y0skjc_7v7cr._.js +3 -0
  389. package/.next/server/chunks/{[root-of-the-server]__0ym21tuxqrmc4._.js → [root-of-the-server]__0y_zzgunl38y2._.js} +2 -2
  390. package/.next/server/chunks/{[root-of-the-server]__1d1gxff_c2o28._.js → [root-of-the-server]__1-0-1pwy7s8ak._.js} +2 -2
  391. package/.next/server/chunks/[root-of-the-server]__1-90b1cy_787j._.js +3 -0
  392. package/.next/server/chunks/{[root-of-the-server]__1oedx4ko_1hl9._.js → [root-of-the-server]__1-z3uulycjf_q._.js} +2 -2
  393. package/.next/server/chunks/[root-of-the-server]__121tnm6bol8ow._.js +3 -0
  394. package/.next/server/chunks/[root-of-the-server]__134n229bo2v1d._.js +3 -0
  395. package/.next/server/chunks/[root-of-the-server]__13_k7w8nrx7ie._.js +1 -1
  396. package/.next/server/chunks/[root-of-the-server]__13ofz2qkhwdmd._.js +3 -0
  397. package/.next/server/chunks/{[root-of-the-server]__0os8s3dtzx4gi._.js → [root-of-the-server]__16p-11g6suxzy._.js} +2 -2
  398. package/.next/server/chunks/[root-of-the-server]__18tzik6wyd5b2._.js +3 -0
  399. package/.next/server/chunks/[root-of-the-server]__19qwvtmhzhh9_._.js +3 -0
  400. package/.next/server/chunks/[root-of-the-server]__1_-sordu1ka96._.js +3 -0
  401. package/.next/server/chunks/[root-of-the-server]__1_2jbd6rjhbu6._.js +3 -0
  402. package/.next/server/chunks/[root-of-the-server]__1_qwjiy9wg14j._.js +3 -0
  403. package/.next/server/chunks/[root-of-the-server]__1al4_7mvxprle._.js +3 -0
  404. package/.next/server/chunks/[root-of-the-server]__1cbejfw8sum3r._.js +3 -0
  405. package/.next/server/chunks/[root-of-the-server]__1cbhqd8d3ozuv._.js +3 -0
  406. package/.next/server/chunks/[root-of-the-server]__1cxpqdzozndhn._.js +3 -0
  407. package/.next/server/chunks/[root-of-the-server]__1dh0adu5iobp3._.js +3 -0
  408. package/.next/server/chunks/{[root-of-the-server]__0btfk_sy3o9wa._.js → [root-of-the-server]__1drs4rr5x286d._.js} +1 -1
  409. package/.next/server/chunks/[root-of-the-server]__1eli1ues3akzx._.js +3 -0
  410. package/.next/server/chunks/[root-of-the-server]__1exbv92f97wbe._.js +3 -0
  411. package/.next/server/chunks/[root-of-the-server]__1fe2v2mv5-rgo._.js +3 -0
  412. package/.next/server/chunks/[root-of-the-server]__1grfx7nsqj28h._.js +3 -0
  413. package/.next/server/chunks/[root-of-the-server]__1h0fzi033rztm._.js +3 -0
  414. package/.next/server/chunks/[root-of-the-server]__1ixotu0p11op8._.js +3 -0
  415. package/.next/server/chunks/[root-of-the-server]__1j0l1jz1c3mpt._.js +3 -0
  416. package/.next/server/chunks/[root-of-the-server]__1jneum6lwgjph._.js +3 -0
  417. package/.next/server/chunks/[root-of-the-server]__1mg_zqw3nheiu._.js +3 -0
  418. package/.next/server/chunks/[root-of-the-server]__1mn422yguinbn._.js +3 -0
  419. package/.next/server/chunks/[root-of-the-server]__1ndg27r3ft7-f._.js +3 -0
  420. package/.next/server/chunks/[root-of-the-server]__1p60tmt2t1ve3._.js +3 -0
  421. package/.next/server/chunks/[root-of-the-server]__1qgitdeliyhex._.js +3 -0
  422. package/.next/server/chunks/[root-of-the-server]__1qxr6vtllrbku._.js +3 -0
  423. package/.next/server/chunks/{[root-of-the-server]__14wezz97rhtz9._.js → [root-of-the-server]__1r7a3lg45ng01._.js} +2 -2
  424. package/.next/server/chunks/[root-of-the-server]__1rcg5kj7i_3lc._.js +3 -0
  425. package/.next/server/chunks/{[root-of-the-server]__1n21o3aq7pxla._.js → [root-of-the-server]__1rh7o4i0_it3x._.js} +2 -2
  426. package/.next/server/chunks/[root-of-the-server]__1rylv89ttw-vw._.js +3 -0
  427. package/.next/server/chunks/{[root-of-the-server]__1o9pbkx7ejxu0._.js → [root-of-the-server]__1s-y00c3-nc_-._.js} +1 -1
  428. package/.next/server/chunks/[root-of-the-server]__1ue577i7esus5._.js +3 -0
  429. package/.next/server/chunks/[root-of-the-server]__1vvqeqc6b1ri5._.js +3 -0
  430. package/.next/server/chunks/[root-of-the-server]__1wp-sh9b360mc._.js +3 -0
  431. package/.next/server/chunks/[root-of-the-server]__1wphfm1f8cos4._.js +3 -0
  432. package/.next/server/chunks/[root-of-the-server]__1xkmo8s1c258u._.js +3 -0
  433. package/.next/server/chunks/{[root-of-the-server]__18nv1yn5xh03v._.js → [root-of-the-server]__1z51x426cuske._.js} +2 -2
  434. package/.next/server/chunks/[root-of-the-server]__1zg0z12pshrxg._.js +3 -0
  435. package/.next/server/chunks/[root-of-the-server]__20vlnu0zllzzp._.js +3 -0
  436. package/.next/server/chunks/_01bayc6kg7upi._.js +3 -0
  437. package/.next/server/chunks/_0431fxnqiloso._.js +1 -1
  438. package/.next/server/chunks/_05ans30vcd4s-._.js +3 -0
  439. package/.next/server/chunks/_0_rhee7wb6tcg._.js +1 -1
  440. package/.next/server/chunks/_0ge95_bkwrkmc._.js +3 -0
  441. package/.next/server/chunks/_0lmh33cdt_1fr._.js +3 -0
  442. package/.next/server/chunks/_0pzdohc1mz5ts._.js +3 -0
  443. package/.next/server/chunks/_0suqhfy3e5sv6._.js +3 -0
  444. package/.next/server/chunks/_0xv7-7d6dyo9-._.js +3 -0
  445. package/.next/server/chunks/{_1wulydy4wg9ow._.js → _0xx4y9tk1qclc._.js} +2 -2
  446. package/.next/server/chunks/_0ymqtnritje40._.js +3 -0
  447. package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
  448. package/.next/server/chunks/_1647rfjflw_iq._.js +3 -0
  449. package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
  450. package/.next/server/chunks/_1duugm0s3-6nw._.js +3 -0
  451. package/.next/server/chunks/_1e_ts14olqd90._.js +3 -0
  452. package/.next/server/chunks/{_10tpt8iizl4v3._.js → _1fq28h_w2e0th._.js} +7 -4
  453. package/.next/server/chunks/_1gdet1v2zk2gy._.js +3 -0
  454. package/.next/server/chunks/{_1dvka-waihfum._.js → _1gngd154ci72t._.js} +7 -4
  455. package/.next/server/chunks/_1j10upti9l6da._.js +3 -0
  456. package/.next/server/chunks/{_11_p1ahjjply_._.js → _1pvqo-qnv-nqm._.js} +2 -2
  457. package/.next/server/chunks/{_0dicq393_0h3i._.js → _1rreh3rgx8xan._.js} +1 -1
  458. package/.next/server/chunks/_1s5-ldt8xhtpp._.js +1 -1
  459. package/.next/server/chunks/_1s55l1bx-1cxp._.js +3 -0
  460. package/.next/server/chunks/_1srq5kxah38r6._.js +3 -0
  461. package/.next/server/chunks/_1tahh9ric8la3._.js +3 -0
  462. package/.next/server/chunks/_1tvl0cm629nyc._.js +3 -0
  463. package/.next/server/chunks/_1ui0r0p4npnpi._.js +11 -0
  464. package/.next/server/chunks/_next-internal_server_app_api_import-batches_[id]_route_actions_0_mc245t1pbwl.js +3 -0
  465. package/.next/server/chunks/_next-internal_server_app_api_import-batches_route_actions_0pi56cpanyvac.js +3 -0
  466. package/.next/server/chunks/_next-internal_server_app_api_import-tasks_[id]_read_route_actions_116wza5ukp0c2.js +3 -0
  467. package/.next/server/chunks/_next-internal_server_app_api_import-tasks_[id]_route_actions_1fvi-v9pgzuli.js +3 -0
  468. package/.next/server/chunks/_next-internal_server_app_api_import-tasks_route_actions_0d08bh7zurcp_.js +3 -0
  469. package/.next/server/chunks/node_modules_next_dist_0n2og9jackhd2._.js +54 -0
  470. package/.next/server/chunks/src_0bhf345rd7jho._.js +1 -1
  471. package/.next/server/chunks/src_lib_0sbu2x2ff_rnz._.js +3 -0
  472. package/.next/server/chunks/src_lib_10is5pyogge95._.js +1 -1
  473. package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +49 -16
  474. package/.next/server/chunks/src_lib_1qvj-3jt4jbq7._.js +3 -0
  475. package/.next/server/chunks/src_lib_1xdguwkq8k_gz._.js +3 -0
  476. package/.next/server/chunks/src_lib_1zjmo0u3pnxig._.js +3 -0
  477. package/.next/server/chunks/src_lib_constants_pagination_ts_0tz3fg9ib3b-w._.js +1 -1
  478. package/.next/server/chunks/src_lib_import-batches_ts_0aekmggdwo_9-._.js +3 -0
  479. package/.next/server/chunks/src_lib_import-tasks_ts_1f4ejsy00-v1t._.js +3 -0
  480. package/.next/server/chunks/src_lib_question-analysis_ts_15_8r_pxmtd06._.js +3 -0
  481. package/.next/server/chunks/src_lib_tag-hierarchy_ts_1illun--8v3_9._.js +3 -0
  482. package/.next/server/chunks/ssr/{[root-of-the-server]__0_eqpxqkvkrs_._.js → [root-of-the-server]__00_c9kpvx5075._.js} +1 -1
  483. package/.next/server/chunks/ssr/[root-of-the-server]__0_bi5ljcm1i1c._.js +3 -0
  484. package/.next/server/chunks/ssr/[root-of-the-server]__0r_5r-242wwqy._.js +3 -0
  485. package/.next/server/chunks/ssr/{[root-of-the-server]__0d4mrtd9tdni-._.js → [root-of-the-server]__0vgnixmnie9dg._.js} +1 -1
  486. package/.next/server/chunks/ssr/[root-of-the-server]__1l68oxzjvj18_._.js +3 -0
  487. package/.next/server/chunks/ssr/[root-of-the-server]__1mrj6vygoasvv._.js +3 -0
  488. package/.next/server/chunks/ssr/{[root-of-the-server]__1eu3xw3zls5xt._.js → [root-of-the-server]__1o5pa8m50qyqa._.js} +1 -1
  489. package/.next/server/chunks/ssr/[root-of-the-server]__1ynp6nm1gttsf._.js +3 -0
  490. package/.next/server/chunks/ssr/[root-of-the-server]__1zupg0zigit-2._.js +3 -0
  491. package/.next/server/chunks/ssr/[root-of-the-server]__2019hdxvtb4e0._.js +3 -0
  492. package/.next/server/chunks/ssr/_05szyj465au6e._.js +3 -0
  493. package/.next/server/chunks/ssr/_0cmd1ubdlo_by._.js +1 -1
  494. package/.next/server/chunks/ssr/_0f2k-q7kimi4o._.js +3 -0
  495. package/.next/server/chunks/ssr/_0ks-0g-tu__3m._.js +3 -0
  496. package/.next/server/chunks/ssr/_0lzeodofsq9pe._.js +1 -1
  497. package/.next/server/chunks/ssr/_0mvuvawj5-r--._.js +3 -0
  498. package/.next/server/chunks/ssr/_0nt5dm7rmsp4f._.js +3 -0
  499. package/.next/server/chunks/ssr/{_07-atqwd3wqya._.js → _0oslwj90y-3j0._.js} +1 -1
  500. package/.next/server/chunks/ssr/_0ozptnii2nxuw._.js +1 -1
  501. package/.next/server/chunks/ssr/_0s318kewgu2zg._.js +3 -0
  502. package/.next/server/chunks/ssr/_0ueequ0gysrs-._.js +3 -0
  503. package/.next/server/chunks/ssr/_15fdum1ye-k0z._.js +3 -0
  504. package/.next/server/chunks/ssr/_19hxsrrruepym._.js +3 -0
  505. package/.next/server/chunks/ssr/{_1l_v9_8-5wv_d._.js → _1b8cip9y91_br._.js} +1 -1
  506. package/.next/server/chunks/ssr/_1hbrn0tcfh7hd._.js +3 -0
  507. package/.next/server/chunks/ssr/_1j3yr2arbxd6a._.js +3 -0
  508. package/.next/server/chunks/ssr/_1qgg_ll5hkjaf._.js +1 -9
  509. package/.next/server/chunks/ssr/_1ujx-n3muyaxs._.js +32 -0
  510. package/.next/server/chunks/ssr/_1ux6eqqkupo6v._.js +1 -9
  511. package/.next/server/chunks/ssr/_1w1qijzykerpu._.js +3 -0
  512. package/.next/server/chunks/ssr/_next-internal_server_app_import-batches_[id]_page_actions_1hnz0a7dq8meb.js +3 -0
  513. package/.next/server/chunks/ssr/_next-internal_server_app_import-tasks_[id]_page_actions_0ln1lwiey8bbi.js +3 -0
  514. package/.next/server/chunks/ssr/_next-internal_server_app_import-tasks_page_actions_1h7cqbj1cojed.js +3 -0
  515. package/.next/server/chunks/ssr/node_modules_05hncuf8243qe._.js +3 -0
  516. package/.next/server/chunks/ssr/node_modules_0_qoz7biz6-x_._.js +3 -0
  517. package/.next/server/chunks/ssr/node_modules_11z4lth_9u_hn._.js +2 -2
  518. package/.next/server/chunks/ssr/node_modules_17lx40fyvpom3._.js +3 -0
  519. package/.next/server/chunks/ssr/node_modules_@radix-ui_1i8eumxju2gpw._.js +3 -0
  520. package/.next/server/chunks/ssr/node_modules_heic-to_dist_csp_heic-to_1a1i_ppryp81y.js +3 -0
  521. package/.next/server/chunks/ssr/node_modules_heic-to_dist_csp_heic-to_1myi81wrj4gw4.js +3 -0
  522. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_06p81-gtz_2cm._.js +3 -0
  523. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1bq471wvtkwrl._.js +3 -0
  524. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_pencil-line_mjs_1xkf12pwlzan2._.js +8 -0
  525. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0-4c5fuxx178f.js +3 -0
  526. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0d5g5-w_y282q.js +3 -0
  527. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0pdc0gl8iqtfa.js +3 -0
  528. package/.next/server/chunks/ssr/node_modules_react-image-crop_dist_index_0khmp4mv3j9zr.js +3 -0
  529. package/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_0n-w9zu3b6q41.js +57 -0
  530. package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
  531. package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +6 -6
  532. package/.next/server/chunks/ssr/src_app_import-batches_[id]_page_tsx_0mhg_vriwmkkw._.js +3 -0
  533. package/.next/server/chunks/ssr/src_app_import-tasks_[id]_page_tsx_0_grj11-jdqqc._.js +3 -0
  534. package/.next/server/chunks/ssr/src_app_import-tasks_page_tsx_01983hytm-x08._.js +3 -0
  535. package/.next/server/chunks/ssr/src_app_notebooks_[id]_add_page_tsx_179tow1ql6vc_._.js +1 -1
  536. package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +1 -1
  537. package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
  538. package/.next/server/chunks/ssr/src_components_correction-editor_tsx_1p7z02t66tndx._.js +6 -0
  539. package/.next/server/chunks/ssr/src_components_image-cropper_tsx_0pcp8-ifruyx-._.js +3 -0
  540. package/.next/server/chunks/ssr/src_components_import-tasks_import-task-card_tsx_01r47qh8ryspb._.js +3 -0
  541. package/.next/server/chunks/ssr/src_components_print-preview_answer-space-control_tsx_02kuswyxklzp_._.js +1 -31
  542. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +10 -64
  543. package/.next/server/chunks/ssr/src_lib_question-split_text_ts_0h4uz23xrlybm._.js +6 -0
  544. package/.next/server/middleware-build-manifest.js +36 -3
  545. package/.next/server/next-font-manifest.js +1 -1
  546. package/.next/server/next-font-manifest.json +12 -0
  547. package/.next/server/pages/500.html +1 -1
  548. package/.next/server/preview-props.json +3 -3
  549. package/.next/server/server-reference-manifest.js +1 -1
  550. package/.next/server/server-reference-manifest.json +1 -1
  551. package/.next/static/chunks/02wft51kf3t9f.js +1 -0
  552. package/.next/static/chunks/0_ar7dth9hybc.js +1 -0
  553. package/.next/static/chunks/0p6ox1l56khn2.js +3 -0
  554. package/.next/static/chunks/0t9po-y0g3nwu.js +12 -0
  555. package/.next/static/chunks/0v8w72ij3d-3v.js +1 -0
  556. package/.next/static/chunks/0x9-b30mhne-_.js +1 -0
  557. package/.next/static/chunks/{1g13qcek7-0du.js → 16h0nz5l970cx.js} +1 -1
  558. package/.next/static/chunks/171ff2ttsrlg8.js +1 -0
  559. package/.next/static/chunks/1746y345zti-9.js +33 -0
  560. package/.next/static/chunks/1ar7mttk9ne1t.js +12 -0
  561. package/.next/static/chunks/1upvap68fad8i.js +1 -0
  562. package/.next/static/chunks/21-zw9_-z7wy0.js +1 -0
  563. package/.next/static/chunks/210o9wkszynk8.js +55 -0
  564. package/.next/static/chunks/26_q5epdikurm.js +1 -0
  565. package/.next/static/chunks/289znh7431pug.js +1 -0
  566. package/.next/static/chunks/29hn5lj1csc6m.js +6 -0
  567. package/.next/static/chunks/2hh64gi4pmlk2.js +1 -0
  568. package/.next/static/chunks/2ic9ath-r3jvf.js +193 -0
  569. package/.next/static/chunks/2notwq6aaf_l7.css +3 -0
  570. package/.next/static/chunks/3-se55-6uc0mx.js +2 -0
  571. package/.next/static/chunks/32hs1wu90i-g2.js +9 -0
  572. package/.next/static/chunks/38fux_rbsoiif.js +1 -0
  573. package/.next/static/chunks/38vt_4ntvy02e.js +1 -0
  574. package/.next/static/chunks/3b34ougp2g-5y.js +1 -0
  575. package/.next/static/chunks/3c3cp7uzfhnyr.js +1 -0
  576. package/.next/static/chunks/3gy-_kb72v5lr.js +1 -0
  577. package/.next/static/chunks/3lsj4waqfw7eq.js +1 -0
  578. package/.next/static/chunks/3ucxgsy-rkjn9.js +9 -0
  579. package/.next/static/chunks/3wr-25ch-9chk.js +1 -0
  580. package/.next/static/chunks/4441xuc3i-yb7.js +1 -0
  581. package/package.json +1 -1
  582. package/prisma/migrations/20261102102339_add_custom_answer_space/migration.sql +5 -0
  583. package/prisma/migrations/20261103011313_add_import_tasks/migration.sql +37 -0
  584. package/prisma/migrations/20261103052754_add_import_batches/migration.sql +79 -0
  585. package/prisma/schema.prisma +77 -0
  586. package/prisma/seed.db +0 -0
  587. package/public/third-party-licenses/heic-to/GPL-3.0.txt +674 -0
  588. package/public/third-party-licenses/heic-to/NOTICE.txt +76 -0
  589. package/public/third-party-licenses/heic-to/emscripten-LICENSE.txt +102 -0
  590. package/public/third-party-licenses/heic-to/heic-to-LICENSE.txt +177 -0
  591. package/public/third-party-licenses/heic-to/libde265-1.0.16-COPYING.txt +871 -0
  592. package/public/third-party-licenses/heic-to/libheif-1.23.6-COPYING.txt +871 -0
  593. package/.next/server/chunks/[root-of-the-server]__01nvw5ogtwc0h._.js +0 -3
  594. package/.next/server/chunks/[root-of-the-server]__02dkbynj2vxld._.js +0 -3
  595. package/.next/server/chunks/[root-of-the-server]__05n74a-t4yfhk._.js +0 -3
  596. package/.next/server/chunks/[root-of-the-server]__05u_glm0nzz-u._.js +0 -3
  597. package/.next/server/chunks/[root-of-the-server]__0c2729fcpi3-x._.js +0 -3
  598. package/.next/server/chunks/[root-of-the-server]__0gaai286hkspk._.js +0 -3
  599. package/.next/server/chunks/[root-of-the-server]__0jy-eooky8kei._.js +0 -3
  600. package/.next/server/chunks/[root-of-the-server]__0kljn4jodzvqk._.js +0 -3
  601. package/.next/server/chunks/[root-of-the-server]__0pn5idap1logb._.js +0 -3
  602. package/.next/server/chunks/[root-of-the-server]__0tflqqgyujt1r._.js +0 -3
  603. package/.next/server/chunks/[root-of-the-server]__0z99q93n88cro._.js +0 -3
  604. package/.next/server/chunks/[root-of-the-server]__1-g1cu85bv1bg._.js +0 -3
  605. package/.next/server/chunks/[root-of-the-server]__1-hfmp3groi95._.js +0 -56
  606. package/.next/server/chunks/[root-of-the-server]__10l89psqaisak._.js +0 -3
  607. package/.next/server/chunks/[root-of-the-server]__1236d6g1_51pt._.js +0 -3
  608. package/.next/server/chunks/[root-of-the-server]__12_laap0hyw4p._.js +0 -3
  609. package/.next/server/chunks/[root-of-the-server]__12cpc3g7-oi86._.js +0 -3
  610. package/.next/server/chunks/[root-of-the-server]__13pd8ofsmrv7k._.js +0 -3
  611. package/.next/server/chunks/[root-of-the-server]__13zeb46abilr5._.js +0 -3
  612. package/.next/server/chunks/[root-of-the-server]__142g4s902bza-._.js +0 -3
  613. package/.next/server/chunks/[root-of-the-server]__1460_07yt08m0._.js +0 -3
  614. package/.next/server/chunks/[root-of-the-server]__15mf1z85mft8d._.js +0 -3
  615. package/.next/server/chunks/[root-of-the-server]__15ypu4q7xi8ig._.js +0 -3
  616. package/.next/server/chunks/[root-of-the-server]__1610s5zvyss1k._.js +0 -3
  617. package/.next/server/chunks/[root-of-the-server]__16864lw9bhmwl._.js +0 -3
  618. package/.next/server/chunks/[root-of-the-server]__19a62id_4lwka._.js +0 -3
  619. package/.next/server/chunks/[root-of-the-server]__1b42xh9458czy._.js +0 -3
  620. package/.next/server/chunks/[root-of-the-server]__1dreyiratyfvo._.js +0 -3
  621. package/.next/server/chunks/[root-of-the-server]__1elqmd_7a9bto._.js +0 -3
  622. package/.next/server/chunks/[root-of-the-server]__1gvnk0s0_zrpo._.js +0 -3
  623. package/.next/server/chunks/[root-of-the-server]__1hwftfenrsu3p._.js +0 -3
  624. package/.next/server/chunks/[root-of-the-server]__1lafe11jnkmlv._.js +0 -3
  625. package/.next/server/chunks/[root-of-the-server]__1m1wi2f60x1fk._.js +0 -3
  626. package/.next/server/chunks/[root-of-the-server]__1o-0-f8rlbavp._.js +0 -3
  627. package/.next/server/chunks/[root-of-the-server]__1r7wz_id6mvlj._.js +0 -3
  628. package/.next/server/chunks/[root-of-the-server]__1r_x7moz0opqt._.js +0 -3
  629. package/.next/server/chunks/[root-of-the-server]__1rx3b8m_g_p57._.js +0 -3
  630. package/.next/server/chunks/[root-of-the-server]__1wh65tfd7apxx._.js +0 -3
  631. package/.next/server/chunks/[root-of-the-server]__1wsyku681k2uq._.js +0 -3
  632. package/.next/server/chunks/[root-of-the-server]__1ximu6k5bljjj._.js +0 -3
  633. package/.next/server/chunks/[root-of-the-server]__20jkc-_5uj_zc._.js +0 -3
  634. package/.next/server/chunks/_03udbqs8_z944._.js +0 -3
  635. package/.next/server/chunks/_1_ns7o3cqznv6._.js +0 -3
  636. package/.next/server/chunks/_1rr_juv5pj1at._.js +0 -3
  637. package/.next/server/chunks/_1upqhtax8p96-._.js +0 -3
  638. package/.next/server/chunks/src_lib_question-deduplication_ts_1p1bik-vwl9ue._.js +0 -3
  639. package/.next/server/chunks/ssr/[root-of-the-server]__0mf_ugip8jvfl._.js +0 -3
  640. package/.next/server/chunks/ssr/[root-of-the-server]__1jhmaiw3yp6gx._.js +0 -3
  641. package/.next/server/chunks/ssr/[root-of-the-server]__1x6b2a-bbo2py._.js +0 -3
  642. package/.next/server/chunks/ssr/_02zfjls23g-o4._.js +0 -3
  643. package/.next/server/chunks/ssr/_0j4vduk13imjn._.js +0 -3
  644. package/.next/server/chunks/ssr/_0ltqx22v65imo._.js +0 -32
  645. package/.next/server/chunks/ssr/_0tr-7klbcz1r7._.js +0 -3
  646. package/.next/server/chunks/ssr/_0yrywyu_og4rx._.js +0 -3
  647. package/.next/server/chunks/ssr/_1-i5cy964i_s9._.js +0 -3
  648. package/.next/server/chunks/ssr/_1-z85ugzufqk6._.js +0 -3
  649. package/.next/server/chunks/ssr/_10stgw6io7x93._.js +0 -3
  650. package/.next/server/chunks/ssr/_11xqn1cgzpe6k._.js +0 -3
  651. package/.next/server/chunks/ssr/_1cc3psc9rvrwn._.js +0 -3
  652. package/.next/server/chunks/ssr/_1hp7fzio98dms._.js +0 -3
  653. package/.next/server/chunks/ssr/node_modules_0efju2pv0_0yw._.js +0 -3
  654. package/.next/static/chunks/01lfibj7hk--1.js +0 -1
  655. package/.next/static/chunks/06bfusm1eqhzt.js +0 -4
  656. package/.next/static/chunks/0fu1xttg42yzk.js +0 -1
  657. package/.next/static/chunks/0mp9tvylhyxid.js +0 -1
  658. package/.next/static/chunks/0xuzdy0dn7jkp.js +0 -63
  659. package/.next/static/chunks/1fa2xv93zl8oj.js +0 -1
  660. package/.next/static/chunks/1ou17klnb8gu_.js +0 -1
  661. package/.next/static/chunks/21v7--q2m3c4_.js +0 -1
  662. package/.next/static/chunks/22gdddnfj38h6.js +0 -1
  663. package/.next/static/chunks/2btkflolmab19.css +0 -3
  664. package/.next/static/chunks/2dml0yrklxocr.js +0 -31
  665. package/.next/static/chunks/2hjp9cnvepyzy.js +0 -247
  666. package/.next/static/chunks/2mu8zu6zd59z2.js +0 -1
  667. package/.next/static/chunks/2xibor-sxcc67.js +0 -1
  668. package/.next/static/chunks/3_e_larybjcr5.js +0 -1
  669. package/.next/static/chunks/3au-yz7ullfnr.js +0 -9
  670. package/.next/static/chunks/3zs0fu6zcu0lb.js +0 -1
  671. /package/.next/static/{jqVIU6HRwaZt62YD8QH_p → UGLvq52Fbq8nQxM1BjZlP}/_buildManifest.js +0 -0
  672. /package/.next/static/{jqVIU6HRwaZt62YD8QH_p → UGLvq52Fbq8nQxM1BjZlP}/_clientMiddlewareManifest.js +0 -0
  673. /package/.next/static/{jqVIU6HRwaZt62YD8QH_p → UGLvq52Fbq8nQxM1BjZlP}/_ssgManifest.js +0 -0
@@ -0,0 +1,33 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let a={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};a.node;let n=(0,t.f)(a);e.s(["f",0,n],711241)},77043,e=>{var t=e.i(456420);let a={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};a.node;let n=(0,t.f)(a);e.s(["f",0,n],77043)},580685,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(618566),s=e.i(762368),i=e.i(77043),r=e.i(519455),l=e.i(257428),c=e.i(967489),o=e.i(590546),u=e.i(520732),m=e.i(339023),d=e.i(511445),x=e.i(84583),f=e.i(111110),h=e.i(35209),p=e.i(41931);let g=`
2
+ .exam-sheet { max-width: 210mm; margin: 0 auto; padding: 16px; color: #111; background: #fff; color-scheme: light; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.6; }
3
+ .exam-sheet h1 { text-align: center; font-size: 22px; margin: 0 0 8px; }
4
+ .exam-sheet .exam-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; font-size: 14px; margin-bottom: 20px; }
5
+ .exam-sheet .exam-meta span { min-width: 120px; }
6
+ .exam-sheet .exam-question { break-inside: avoid; page-break-inside: avoid; padding: 12px 0; border-bottom: 1px dashed #ccc; }
7
+ .exam-sheet .exam-question-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
8
+ .exam-sheet .exam-source { font-family: ui-monospace, Menlo, monospace; font-weight: 400; font-size: 12px; color: #666; white-space: nowrap; }
9
+ .exam-sheet .exam-answer-space { min-height: 0; }
10
+ .exam-sheet .exam-answer-key { break-before: page; page-break-before: always; padding-top: 8px; }
11
+ .exam-sheet .exam-answer-key h2 { text-align: center; font-size: 18px; margin: 0 0 12px; }
12
+ .exam-sheet .exam-label { font-weight: 600; color: #444; }
13
+ .exam-sheet .markdown-content p { margin: 4px 0; }
14
+ .exam-sheet .markdown-content img { max-width: 100%; }
15
+ .exam-sheet .question-figure { margin: 8px 0; break-inside: avoid; page-break-inside: avoid; }
16
+ .exam-sheet .question-figure img { display: block; margin: 0 auto; max-width: 100%; max-height: 360px; background: #fff; }
17
+ .exam-sheet .markdown-content table { border-collapse: collapse; }
18
+ .exam-sheet .markdown-content td, .exam-sheet .markdown-content th { border: 1px solid #999; padding: 2px 6px; }
19
+ @media print { .exam-sheet { padding: 0; max-width: none; } .exam-sheet .figure-scale-editor-controls, .exam-sheet .answer-space-controls { display: none; } @page { size: A4; margin: 15mm; } }
20
+ `;function b(e){return e.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}var v=e.i(995677),j=e.i(192635);let w=[];e.s(["default",0,function(){let e=(0,n.useParams)(),{t:y,language:k}=(0,f.b)(),[S,N]=(0,a.useState)(null);(0,h.f)(y.exam.title,S?.title,y.pageTitle.examPrint);let[C,_]=(0,a.useState)(!0),[z,A]=(0,a.useState)(v.q),[q,R]=(0,a.useState)({scale:null,align:null}),T=(0,a.useRef)(null),$=S?.id,E=(0,a.useCallback)(async e=>{if($){if(e.length>1&&e.every(e=>null===e.answerSpacePx))return void await p.k.patch(`/api/exams/${$}`,{answerSpacePx:null});await Promise.all(e.map(({id:e,answerSpacePx:t})=>p.k.patch(`/api/exams/${$}`,{questionId:e,answerSpacePx:t})))}},[$]),{customSpaces:P,setSpace:F,resetAll:I,saveFailed:L}=(0,j.f)(S?.questions??w,E);if((0,a.useEffect)(()=>{let e=null;try{e=localStorage.getItem(v.p)}catch{}(0,v.I)(e)&&A(e)},[]),(0,a.useEffect)(()=>{p.k.get(`/api/exams/${e.id}`).then(N).catch(()=>N(null))},[e.id]),!S)return(0,t.jsx)("div",{className:"p-8 text-center",children:y.common.loading});let M=S.questions.filter(e=>"ready"===e.status&&e.questionText),H=M.filter(e=>!!e.figureSvg),O=async(e,t,a)=>{await p.k.patch(`/api/exams/${S.id}`,{questionId:e,figureScale:t,figureAlign:a}),N(n=>n?{...n,questions:n.questions.map(n=>n.id===e?{...n,figureScale:t,figureAlign:a}:n)}:n)},V=async e=>{await p.k.patch(`/api/exams/${S.id}`,e),N(t=>t?{...t,questions:t.questions.map(t=>({...t,...e}))}:t)};return(0,t.jsxs)("main",{className:"min-h-screen bg-white",children:[(0,t.jsx)("style",{children:g}),(0,t.jsx)("div",{className:"print:hidden sticky top-0 z-10 border-b bg-background p-3 shadow-sm",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex flex-wrap items-center gap-3",children:[(0,t.jsx)(o.f,{fallbackUrl:`/exams/${S.id}`}),(0,t.jsx)("span",{className:"font-semibold",children:y.exam.printTitle}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(l.f,{checked:C,onCheckedChange:e=>_(!0===e)}),y.exam.includeAnswers]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"shrink-0",children:y.exam.answerSpace}),(0,t.jsxs)(c.d,{value:z,onValueChange:e=>{if((0,v.I)(e)){A(e);try{localStorage.setItem(v.p,e)}catch{}}},children:[(0,t.jsx)(c.P,{className:"h-8 w-40",children:(0,t.jsx)(c.U,{})}),(0,t.jsxs)(c.r,{children:[(0,t.jsx)(c.T,{value:"auto",children:y.exam.answerSpaceAuto}),(0,t.jsx)(c.T,{value:"none",children:y.exam.answerSpaceNone}),(0,t.jsx)(c.T,{value:"small",children:y.exam.answerSpaceSmall}),(0,t.jsx)(c.T,{value:"medium",children:y.exam.answerSpaceMedium}),(0,t.jsx)(c.T,{value:"large",children:y.exam.answerSpaceLarge})]})]}),Object.keys(P).length>0&&(0,t.jsx)(r.f,{type:"button",variant:"ghost",size:"sm",onClick:I,children:y.exam.resetAllQuestionAnswerSpaces})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,t.jsxs)(r.f,{variant:"outline",size:"sm",onClick:()=>{var e;if(!T.current)return;let t=T.current.cloneNode(!0);t.querySelectorAll(".figure-scale-editor-controls, .answer-space-controls, .print\\:hidden").forEach(e=>e.remove());let a=function(e,t,a="zh-CN"){return`<!doctype html>
21
+ <html lang="${b(a)}">
22
+ <head>
23
+ <meta charset="utf-8">
24
+ <meta name="viewport" content="width=device-width, initial-scale=1">
25
+ <title>${b(e)}</title>
26
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.19.1/dist/katex.min.css">
27
+ <style>body { margin: 0; background: #fff; }${g}</style>
28
+ </head>
29
+ <body>
30
+ ${t}
31
+ </body>
32
+ </html>
33
+ `}(S.title,t.outerHTML,"en"===k?"en":"zh-CN"),n=URL.createObjectURL(new Blob([a],{type:"text/html;charset=utf-8"})),s=document.createElement("a");s.href=n,e=S.title,s.download=`${e.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,s.click(),URL.revokeObjectURL(n)},children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4"}),y.exam.downloadHtml]}),(0,t.jsxs)(r.f,{size:"sm",onClick:()=>window.print(),children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),y.exam.printNow]})]}),"auto"===z&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:y.exam.answerSpaceAutoHint}),L&&(0,t.jsx)("p",{className:"w-full text-xs text-destructive",children:y.exam.answerSpaceSaveFailed}),M.length<S.questions.length&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:y.exam.notReadyHint}),H.length>0&&(0,t.jsx)(m.f,{scales:H.map(e=>e.figureScale),aligns:H.map(e=>e.figureAlign),onPreviewChange:R,onSave:V})]})}),(0,t.jsxs)("div",{ref:T,className:"exam-sheet",children:[(0,t.jsx)("h1",{children:S.title}),(0,t.jsxs)("div",{className:"exam-meta",children:[(0,t.jsxs)("span",{children:[y.exam.nameLine,y.common.colon,"________"]}),(0,t.jsxs)("span",{children:[y.exam.dateLine,y.common.colon,"________"]}),(0,t.jsxs)("span",{children:[y.exam.scoreLine,y.common.colon,"________"]})]}),M.map((e,a)=>{let n;return(0,t.jsxs)("section",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[a+1,"."]}),(0,t.jsxs)("span",{className:"exam-source",children:[y.exam.sourceLabel,": ",e.sourceShortId]})]}),(0,t.jsx)(d.f,{content:e.questionText}),(0,t.jsx)(u.f,{svg:e.figureSvg,scale:e.figureScale,align:e.figureAlign,previewScaleOverride:q.scale,previewAlignOverride:q.align,onSave:(t,a)=>O(e.id,t,a)},`${e.id}-${e.figureScale??100}-${e.figureAlign??"center"}`),(n=(0,v.z)(z,e.questionText,P[e.id]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"exam-answer-space",style:{minHeight:`${n}px`}}),(0,t.jsx)(x.f,{effectivePx:n,isCustom:"number"==typeof P[e.id],onChange:t=>F(e.id,t),onReset:()=>F(e.id,null)})]}))]},e.id)}),C&&(0,t.jsxs)("section",{className:"exam-answer-key",children:[(0,t.jsx)("h2",{children:y.exam.answerKey}),M.map((e,a)=>(0,t.jsxs)("div",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[a+1,"."]}),(0,t.jsxs)("span",{className:"exam-source",children:[y.exam.sourceLabel,": ",e.sourceShortId]})]}),e.answerText&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[y.exam.answerLabel,y.common.colon]}),(0,t.jsx)(d.f,{content:e.answerText})]}),e.analysis&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[y.exam.analysisLabel,y.common.colon]}),(0,t.jsx)(d.f,{content:e.analysis})]})]},e.id))]})]})]})}],580685)},520732,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(149704),s=e.i(519455),i=e.i(793479),r=e.i(111110),l=e.i(294114),c=e.i(184110),o=e.i(201276);e.s(["f",0,function({svg:e,scale:u,align:m,previewScaleOverride:d,previewAlignOverride:x,onSave:f}){let{t:h}=(0,r.b)(),p=(0,a.useId)(),g=(0,c.V)(u),b=(0,c.o)(m),[v,j]=(0,a.useState)(null),[w,y]=(0,a.useState)(null),[k,S]=(0,a.useState)(!1),N=v??String(g),C=""!==N.trim()&&(0,c.x)(Number(N)),_=C?Number(N):g,z=w??b,A=d??_,q=x??z,R=null!==v&&(!C||Number(N)!==g)||null!==w&&w!==b;if(!e)return null;let T=async e=>{if(e.preventDefault(),C&&R&&!k){S(!0);try{await f(_,z),j(null),y(null),l.c.success(h.common.messages.saveSuccess)}catch(e){o.V.error("[FigureScale]","保存配图比例失败",{error:e}),l.c.error(h.common.messages.saveFailed)}finally{S(!1)}}};return(0,t.jsxs)("div",{children:[(0,t.jsx)(n.f,{svg:e,scale:A,align:q}),(0,t.jsxs)("form",{onSubmit:T,className:"figure-scale-editor-controls space-y-2 rounded-md border p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:p,children:h.figure.scale}),(0,t.jsx)(i.f,{id:p,type:"number",min:c._,max:c.a,step:1,value:N,disabled:k,"aria-describedby":`${p}-hint`,"aria-invalid":!C,onChange:e=>j(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(s.f,{type:"button",variant:"outline",size:"sm",disabled:k||C&&_===c.n,onClick:()=>j(String(c.n)),children:h.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":h.figure.align,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:h.figure.align}),c.j.map(e=>(0,t.jsx)(s.f,{type:"button",variant:z===e?"default":"outline",size:"sm",disabled:k,"aria-pressed":z===e,onClick:()=>y(e===b?null:e),children:h.figure.aligns[e]},e))]}),(0,t.jsx)(s.f,{type:"submit",size:"sm",disabled:k||!R||!C,children:k?h.common.progress.saving:h.common.save}),R&&(0,t.jsx)(s.f,{type:"button",variant:"ghost",size:"sm",disabled:k,onClick:()=>{j(null),y(null)},children:h.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:c._,max:c.a,step:1,value:_,disabled:k,"aria-label":h.figure.scaleSlider,"aria-describedby":`${p}-hint`,onChange:e=>j(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${p}-hint`,className:"text-xs text-muted-foreground",children:h.figure.scaleHint})]})]})}])},339023,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(519455),s=e.i(793479),i=e.i(111110),r=e.i(294114),l=e.i(184110),c=e.i(201276);e.s(["f",0,function({scales:e,aligns:o,onPreviewChange:u,onSave:m}){let{t:d}=(0,i.b)(),x=(0,a.useId)(),f=e.map(l.V),h=new Set(f).size<=1,p=f[0]??l.n,g=(o??e.map(()=>l.E)).map(l.o),b=new Set(g).size<=1,v=g[0]??l.E,[j,w]=(0,a.useState)(null),[y,k]=(0,a.useState)(null),[S,N]=(0,a.useState)(!1);if(0===e.length)return null;let C=j??String(p),_=""!==C.trim()&&(0,l.x)(Number(C)),z=_?Number(C):p,A=y??v,q=null!==j||null!==y,R=null!==j?!_||!h||Number(C)!==p:!q&&!h,T=null!==y?!b||y!==v:!q&&!b,$=R||T,E=(e,t)=>{let a=null!==e&&""!==e.trim()&&(0,l.x)(Number(e))?Number(e):null;u?.({scale:a,align:t})},P=e=>{w(e),E(e,y)},F=async e=>{if(e.preventDefault(),_&&$&&!S){N(!0);try{let e={};null===j&&(q||h)||(e.figureScale=z),null===y&&(q||b)||(e.figureAlign=A),await m(e),w(null),k(null),u?.({scale:null,align:null}),r.c.success(d.common.messages.saveSuccess)}catch(e){c.V.error("[ExamFigureScale]","统一保存试卷配图设置失败",{error:e}),r.c.error(d.common.messages.saveFailed)}finally{N(!1)}}};return(0,t.jsxs)("form",{onSubmit:F,className:"figure-scale-editor-controls w-full space-y-2 rounded-md border bg-background p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:x,className:"font-medium",children:d.exam.uniformFigureScale}),(0,t.jsx)(s.f,{id:x,type:"number",min:l._,max:l.a,step:1,value:C,disabled:S,"aria-describedby":`${x}-hint`,"aria-invalid":!_,onChange:e=>P(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(n.f,{type:"button",variant:"outline",size:"sm",disabled:S||h&&_&&z===l.n,onClick:()=>P(String(l.n)),children:d.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":d.exam.uniformFigureAlign,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:d.exam.uniformFigureAlign}),l.j.map(e=>(0,t.jsx)(n.f,{type:"button",variant:A===e&&(null!==y||b)?"default":"outline",size:"sm",disabled:S,"aria-pressed":A===e&&(null!==y||b),onClick:()=>{var t;k(t=b&&e===v?null:e),E(j,t)},children:d.figure.aligns[e]},e))]}),(0,t.jsx)(n.f,{type:"submit",size:"sm",disabled:S||!$||!_,children:S?d.common.progress.saving:d.common.save}),q&&(0,t.jsx)(n.f,{type:"button",variant:"ghost",size:"sm",disabled:S,onClick:()=>{w(null),k(null),u?.({scale:null,align:null})},children:d.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:l._,max:l.a,step:1,value:z,disabled:S,"aria-label":d.exam.uniformFigureScaleSlider,"aria-describedby":`${x}-hint`,onChange:e=>P(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${x}-hint`,className:"text-xs text-muted-foreground",children:d.exam.uniformFigureScaleHint})]})}])},84583,995677,192635,e=>{var t=e.i(843476),a=e.i(519455),n=e.i(111110);let s=["auto","none","small","medium","large"],i={none:0,small:60,medium:120,large:240},r={choice:12,judgment:12,fill:16,solution:240};function l(e){return Number.isFinite(e)?Math.min(600,Math.max(0,Math.round(e))):0}function c(e){return"number"!=typeof e||!Number.isInteger(e)||e<0||e>600?null:e}let o=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,u=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,m=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,d=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,x=/(\s*(\d{1,2})\s*)/g,f=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function h(e){let t=new Set;for(let a of e.matchAll(x))t.add(a[1]);for(let a of e.matchAll(f))t.add(a[1]);return Math.max(1,t.size)}e.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,l,"I",0,function(e){return"string"==typeof e&&s.includes(e)},"T",0,c,"z",0,function(e,t,a){let n;if("number"==typeof a&&Number.isFinite(a))return l(a);if("auto"!==e)return i[e];let s=(n=new Set(Array.from(t.matchAll(o),e=>e[1]??e[2]??e[3]))).has("A")&&n.has("B")&&n.has("C")?"choice":u.test(t)?"judgment":h(t)>1||d.test(t)?"solution":m.test(t)?"fill":"solution";if("solution"!==s)return r[s];let c=(h(t)-1)*120;return Math.min(560,r.solution+c)}],995677),e.s(["f",0,function({effectivePx:e,isCustom:s,onChange:i,onReset:r}){let{t:c}=(0,n.b)(),o=l(e);return(0,t.jsxs)("div",{className:"answer-space-controls print:hidden flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-2 pt-1",children:[(0,t.jsxs)("span",{children:[c.exam.questionAnswerSpace,": ",o,"px"]}),(0,t.jsx)(a.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":c.exam.decreaseAnswerSpace,disabled:o<=0,onClick:()=>i(l(o-20)),children:"-"}),(0,t.jsx)("input",{type:"range",min:0,max:600,step:10,value:o,"aria-label":c.exam.questionAnswerSpaceSlider,onChange:e=>i(l(Number(e.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,t.jsx)(a.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":c.exam.increaseAnswerSpace,disabled:o>=600,onClick:()=>i(l(o+20)),children:"+"}),s&&(0,t.jsx)(a.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:r,children:c.exam.resetQuestionAnswerSpace})]})}],84583);var p=e.i(271645),g=e.i(201276);e.s(["f",0,function(e,t){let[a,n]=(0,p.useState)({}),[s,i]=(0,p.useState)(!1),r=(0,p.useRef)(new Map),l=(0,p.useRef)(null),o=(0,p.useRef)(t);(0,p.useEffect)(()=>{o.current=t},[t]);let u=(0,p.useMemo)(()=>{let t={};for(let n of e){let e=n.id in a?a[n.id]:c(n.answerSpacePx);"number"==typeof e&&(t[n.id]=e)}return t},[e,a]),m=(0,p.useCallback)(()=>{if(l.current&&(clearTimeout(l.current),l.current=null),0===r.current.size)return;let e=Array.from(r.current,([e,t])=>({id:e,answerSpacePx:t}));r.current.clear(),o.current(e).then(()=>i(!1)).catch(e=>{i(!0),g.V.error("[AnswerSpace]","Failed to save answer space",{error:e})})},[]);(0,p.useEffect)(()=>m,[m]);let d=(0,p.useCallback)((e,t)=>{if(0!==e.length){for(let{id:t,answerSpacePx:a}of(n(t=>{let a={...t};for(let{id:t,answerSpacePx:n}of e)a[t]=n;return a}),e))r.current.set(t,a);if(t)return void m();l.current&&clearTimeout(l.current),l.current=setTimeout(m,600)}},[m]),x=(0,p.useCallback)((e,t)=>{d([{id:e,answerSpacePx:t}],null===t)},[d]),f=(0,p.useCallback)(()=>{d(Object.keys(u).map(e=>({id:e,answerSpacePx:null})),!0)},[u,d]);return{customSpaces:u,setSpace:x,resetAll:f,saveFailed:s}}],192635)},149704,e=>{var t=e.i(843476),a=e.i(111110),n=e.i(398019),s=e.i(184110),i=e.i(975157);let r={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:c,className:o}){let{t:u}=(0,a.b)();if(!e)return null;let m=(0,s.V)(l),d=(0,s.o)(c);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",o),children:(0,t.jsx)("img",{src:(0,n.f)(e),alt:u.figure.alt,className:(0,i.f)(r[d],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===d?{marginLeft:0,marginRight:"auto"}:"right"===d?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:m/100,maxWidth:`${Math.min(m,100)}%`}})})}])},590546,e=>{var t=e.i(843476),a=e.i(618566),n=e.i(519455),s=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let r=(0,a.useRouter)();return(0,t.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{r.push(e)},className:i,children:(0,t.jsx)(s.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(820783),s=e.i(30030),i=e.i(981140),r=e.i(369340),l=e.i(635804),c=e.i(296626),o=e.i(248425),u=Object.defineProperty,m=(e,t)=>u(e,"name",{value:t,configurable:!0}),d="Checkbox",[x,f]=(0,s.f)(d),[h,p]=x(d);function g(e){let{__scopeCheckbox:n,checked:s,children:i,defaultChecked:l,disabled:c,form:o,name:u,onCheckedChange:m,required:x,value:f="on",internal_do_not_use_render:p}=e,[g,b]=(0,r.f)({prop:s,defaultProp:l??!1,onChange:m,caller:d}),[v,j]=a.useState(null),[w,S]=a.useState(null),[N,C]=a.useState(null),_=!v||!!o||!!v.closest("form"),z={checked:g,disabled:c,setChecked:b,control:v,setControl:j,name:u,form:o,value:f,userClick:N,onUserClick:C,required:x,defaultChecked:!k(l)&&l,isFormControl:_,bubbleInput:w,setBubbleInput:S};return(0,t.jsx)(h,{scope:n,...z,children:y(p)?p(z):i})}m(g,"CheckboxProvider");var b=a.forwardRef(m(function({__scopeCheckbox:e,onKeyDown:s,onClick:r,...l},c){let{control:u,value:d,disabled:x,checked:f,required:h,setControl:g,setChecked:b,onUserClick:v,isFormControl:j,bubbleInput:w}=p("CheckboxTrigger",e),y=(0,n.f)(c,g),N=a.useRef(f);return a.useEffect(()=>{let e=u?.form;if(e){let t=m(()=>b(N.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[u,b]),(0,t.jsx)(o.V.button,{type:"button",role:"checkbox","aria-checked":k(f)?"mixed":f,"aria-required":h,"data-state":S(f),"data-disabled":x?"":void 0,disabled:x,value:d,...l,ref:y,onKeyDown:(0,i.f)(s,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.f)(r,e=>{let t=e.isPropagationStopped();v({requestedChecked:!!k(f)||!f,hasConsumerStoppedPropagation:t}),b(e=>!!k(e)||!e),w&&j&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),v=a.forwardRef(m(function(e,a){let{__scopeCheckbox:n,name:s,checked:i,defaultChecked:r,required:l,disabled:c,value:o,onCheckedChange:u,form:m,...d}=e;return(0,t.jsx)(g,{__scopeCheckbox:n,checked:i,defaultChecked:r,disabled:c,required:l,onCheckedChange:u,name:s,form:m,value:o,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...d,ref:a,__scopeCheckbox:n}),e&&(0,t.jsx)(w,{__scopeCheckbox:n})]})})},"Checkbox")),j=a.forwardRef(m(function(e,a){let{__scopeCheckbox:n,forceMount:s,...i}=e,r=p("CheckboxIndicator",n);return(0,t.jsx)(c.f,{present:s||k(r.checked)||!0===r.checked,children:(0,t.jsx)(o.V.span,{"data-state":S(r.checked),"data-disabled":r.disabled?"":void 0,...i,ref:a,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),w=a.forwardRef(m(function({__scopeCheckbox:e,onClick:s,...r},c){let{control:u,userClick:m,checked:d,defaultChecked:x,required:f,disabled:h,name:g,value:b,form:v,bubbleInput:j,setBubbleInput:w}=p("CheckboxBubbleInput",e),y=(0,n.f)(c,w),S=(0,l.f)(u),N=a.useRef(!1),C=a.useRef(d),_=a.useRef(m),z=a.useRef(null);a.useEffect(()=>{if(!j)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=C.current!==d;C.current=d;let a=null!==m&&m!==_.current;if(_.current=m,a)z.current=t?null:m,t&&(j.indeterminate=k(d),e.call(j,!k(d)&&d)),j.dispatchEvent(new Event("click",{bubbles:!m.hasConsumerStoppedPropagation}));else if(t){let t=z.current;z.current=null;let a=t?.requestedChecked===d;N.current=!0,j.indeterminate=k(d),e.call(j,!k(d)&&d),j.dispatchEvent(new Event("click",{bubbles:!(a&&t.hasConsumerStoppedPropagation)})),N.current=!1}},[j,d,m]);let A=a.useRef(!k(d)&&d);return(0,t.jsx)(o.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??A.current,required:f,disabled:h,name:g,value:b,form:v,...r,tabIndex:-1,ref:y,onClick:(0,i.f)(s,e=>{N.current&&e.stopPropagation()}),style:{...r.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function y(e){return"function"==typeof e}function k(e){return"indeterminate"===e}function S(e){return k(e)?"indeterminate":e?"checked":"unchecked"}m(y,"isFunction"),m(k,"isIndeterminate"),m(S,"getState");var N=e.i(689664),C=e.i(975157);let _=a.forwardRef(({className:e,...a},n)=>(0,t.jsx)(v,{ref:n,className:(0,C.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...a,children:(0,t.jsx)(j,{className:(0,C.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(N.f,{className:"h-4 w-4"})})}));_.displayName=v.displayName,e.s(["f",0,_],257428)},184110,e=>{let t=["left","center","right"],a="center";function n(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,a,"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:a},"V",0,function(e){return n(e)?e:100}])},398019,e=>{e.s(["f",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:n}=(0,a.b)(),s=[n.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=s},[s])}])}])})();
@@ -0,0 +1,12 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,314381,3198,e=>{var t=e.i(456420);let r={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"}]]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],314381);var n=e.i(843476),i=e.i(271645),s=e.i(632781);let o={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"}]]};o.node;let l=(0,t.f)(o),d={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"}]]};d.node;let c=(0,t.f)(d);var h=e.i(395925),u=e.i(741120),m=e.i(759659),g=e.i(519455),p=e.i(111110),f=e.i(294114),x=e.i(201276),w=e.i(113381);let y=null;function v(e,t,r){let a=e?.firstElementChild;a&&(a.style.width="100%",a.style.height=`${r}px`,t?.setSize(e?.offsetWidth||a.offsetWidth||800,r))}function b(e,t){let r=(0,w.L)(e,t);for(let e of r)x.V.warn("[GGB]","命令执行失败",{...e});return r.map(e=>e.command+":"+e.message).join("\n")||void 0}e.s(["f",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:a=!1,showMenuBar:o=!1,className:d="",onRegenerate:j,onDelete:k}){let{t:N}=(0,p.b)(),C=(0,i.useRef)(null),S=(0,i.useRef)(null),E=(0,i.useRef)(void 0),I=(0,i.useId)(),A=(0,i.useRef)(`ggb-${I.replace(/[^a-zA-Z0-9_-]/g,"")}`),[D,M]=(0,i.useState)(!0),[R,T]=(0,i.useState)(null),[_,L]=(0,i.useState)(!0),[$,P]=(0,i.useState)(!1),[O,U]=(0,i.useState)(!1),z=(0,i.useMemo)(()=>(0,w.i)(e),[e]);(0,i.useEffect)(()=>{if(0===z.length)return;let e=!1,n=A.current,i=C.current;return(y||(y=new Promise((e,t)=>{if(window.GGBApplet)return void e();let r=document.createElement("script");r.src="https://www.geogebra.org/apps/deployggb.js",r.async=!0,r.onload=()=>e(),r.onerror=()=>{y=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let s=window.GGBApplet;if(!s){T(N.geogebra.notLoaded),M(!1);return}if(i){i.innerHTML=`<div id="${n}" style="width:100%;height:${t}px"></div>`;try{new s({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:a,showMenuBar:o,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(S.current=r,v(i,r,t),E.current=b(r,z),M(!1))}},!0).inject(n)}catch(t){x.V.error("[GGB]","Init failed",{error:t}),e||(T(N.geogebra.initFailed),M(!1))}}}).catch(t=>{x.V.error("[GGB]","Script load failed",{error:t}),e||(T(N.geogebra.scriptFailed),M(!1))}),()=>{e=!0;try{let e=S.current;e?.remove&&e.remove()}catch(e){x.V.warn("[GGB]","Cleanup failed",{error:e})}S.current=null,i&&(i.innerHTML="")}},[z,r,a,o]),(0,i.useEffect)(()=>{v(C.current,S.current,_?700:t)},[_,t]);let H=(0,i.useCallback)(()=>{let e=S.current;if(e)try{e.resetConstruction(),setTimeout(()=>{S.current&&(E.current=b(S.current,z))},300)}catch(e){x.V.warn("[GGB]","Reset failed",{error:e})}},[z]),F=(0,i.useCallback)(async()=>{if(j&&!$){P(!0);try{await j(E.current)}finally{P(!1)}}},[j,$]),V=(0,i.useCallback)(async()=>{if(k&&!O&&await (0,f.u)(N.geogebra.confirmDelete,{destructive:!0})){U(!0);try{await k()}catch{f.c.error(N.geogebra.deleteFailed)}finally{U(!1)}}},[k,O,N]);return 0===z.length?null:(0,n.jsxs)("div",{className:`relative rounded-lg border bg-card ${d}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:N.geogebra.title}),D&&(0,n.jsx)(s.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[j&&(0,n.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:F,title:N.geogebra.regenerate,disabled:$||D,children:[$?(0,n.jsx)(s.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(u.f,{className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{children:N.geogebra.regenerate})]}),k&&(0,n.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:V,title:N.geogebra.delete,disabled:O||$,children:[O?(0,n.jsx)(s.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{children:N.geogebra.delete})]}),(0,n.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:H,title:N.geogebra.reset,disabled:D,children:(0,n.jsx)(h.f,{className:"h-3.5 w-3.5"})}),(0,n.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>L(e=>!e),title:_?N.geogebra.shrink:N.geogebra.enlarge,children:_?(0,n.jsx)(c,{className:"h-3.5 w-3.5"}):(0,n.jsx)(l,{className:"h-3.5 w-3.5"})})]})]}),(0,n.jsx)("div",{ref:C,style:{width:"100%"}}),D&&(0,n.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,n.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,n.jsx)(s.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,n.jsx)("span",{className:"text-sm text-muted-foreground",children:N.geogebra.loading})]})}),R&&(0,n.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:R})]})}],3198)},399847,e=>{var t=e.i(456420);let r={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],399847)},13285,e=>{var t=e.i(456420);let r={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],13285)},615568,168148,61425,e=>{var t=e.i(456420);let r={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],615568);var n=e.i(843476),i=e.i(271645),s=e.i(30030),o=e.i(248425),l=Object.defineProperty,d=(e,t)=>l(e,"name",{value:t,configurable:!0}),c="Progress",[h,u]=(0,s.f)(c),[m,g]=h(c),p=i.forwardRef(d(function(e,t){let{__scopeProgress:r,value:a=null,max:i,getValueLabel:s=x,...l}=e;(i||0===i)&&!v(i)&&console.error(j(`${i}`,"Progress"));let d=v(i)?i:100;null===a||b(a,d)||console.error(k(`${a}`,"Progress"));let c=b(a,d)?a:null,h=y(c)?s(c,d):void 0;return(0,n.jsx)(m,{scope:r,value:c,max:d,children:(0,n.jsx)(o.V.div,{"aria-valuemax":d,"aria-valuemin":0,"aria-valuenow":y(c)?c:void 0,"aria-valuetext":h,role:"progressbar","data-state":w(c,d),"data-value":c??void 0,"data-max":d,...l,ref:t})})},"Progress")),f=i.forwardRef(d(function(e,t){let{__scopeProgress:r,...a}=e,i=g("ProgressIndicator",r);return(0,n.jsx)(o.V.div,{"data-state":w(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...a,ref:t})},"ProgressIndicator"));function x(e,t){return`${Math.round(e/t*100)}%`}function w(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function y(e){return"number"==typeof e}function v(e){return y(e)&&!isNaN(e)&&e>0}function b(e,t){return y(e)&&!isNaN(e)&&e<=t&&e>=0}function j(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`}function k(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
2
+ - a positive number
3
+ - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
4
+ - \`null\` or \`undefined\` if the progress is indeterminate.
5
+
6
+ Defaulting to \`null\`.`}d(x,"defaultGetValueLabel"),d(w,"getProgressState"),d(y,"isNumber"),d(v,"isValidMaxNumber"),d(b,"isValidValueNumber"),d(j,"getInvalidMaxError"),d(k,"getInvalidValueError");var N=e.i(975157);let C=i.forwardRef(({className:e,value:t,...r},a)=>(0,n.jsx)(p,{ref:a,value:t,className:(0,N.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,n.jsx)(f,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));C.displayName=p.displayName,e.s(["f",0,C],168148);var S=e.i(303163);e.s(["f",0,function(e,t){let r=t.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,S.d)(e);if(a){let e=t.errors??{};if(!(a in e))return a;let n=e[a];return"string"==typeof n?n:r}let n=(0,S.Z)(e);if(n.includes("fetch")||n.includes("network"))return t.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${r} (${t})`}return r}],61425)},856522,e=>{var t=e.i(456420);let r={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"}]]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],856522)},232660,213761,e=>{var t=e.i(271645),r={x:0,y:0,width:0,height:0,unit:"px"},a=(e,t,r)=>Math.min(Math.max(e,t),r),n=(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 i(e,t,a){return"%"===e.unit?{...r,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/a*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/a*100:0}}function s(e,t,a){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*a/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*a/100:0}:{...r,...e,unit:"px"}}function o(e,t,r,a,n,i=0,s=0,l=a,d=n){let c={...e},h=Math.min(i,a),u=Math.min(s,n),m=Math.min(l,a),g=Math.min(d,n);t&&(t>1?(u=(h=s?s*t:h)/t,m=l*t):(h=(u=i?i/t:u)*t,g=d/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,h),c.x=0);let p=a-(c.x+c.width);p<0&&(c.x=Math.min(c.x,a-h),c.width+=p);let f=n-(c.y+c.height);if(f<0&&(c.y=Math.min(c.y,n-u),c.height+=f),c.width<h&&(("sw"===r||"nw"==r)&&(c.x-=h-c.width),c.width=h),c.height<u&&(("nw"===r||"ne"==r)&&(c.y-=u-c.height),c.height=u),c.width>m&&(("sw"===r||"nw"==r)&&(c.x-=m-c.width),c.width=m),c.height>g&&(("nw"===r||"ne"==r)&&(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"===r||"ne"==r)&&(c.y-=e-c.height),c.height=e}else if(e>t){let e=Math.max(c.height*t,h);("sw"===r||"nw"==r)&&(c.x-=e-c.width),c.width=e}}return c}var l={capture:!0,passive:!1},d=0,c=class e extends t.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,t.createRef)();mediaRef=(0,t.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${d++}`;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:r,width:a,height:n}=e.getBoundingClientRect();return{x:t,y:r,width:a,height:n}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:a}=this.getBox();e&&a&&r(s(t,e,a),i(t,e,a))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,l),this.document.addEventListener("pointerup",this.onDocPointerDone,l),this.document.addEventListener("pointercancel",this.onDocPointerDone,l),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,l),this.document.removeEventListener("pointerup",this.onDocPointerDone,l),this.document.removeEventListener("pointercancel",this.onDocPointerDone,l),!1)}onCropPointerDown=e=>{let{crop:t,disabled:r}=this.props,a=this.getBox();if(!t)return;let n=s(t,a.width,a.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let i=e.target.dataset.ord,o=e.clientX,l=e.clientY,d=n.x,c=n.y;if(i){let t=e.clientX-a.x,r=e.clientY-a.y,s=0,h=0;"ne"===i||"e"==i?(s=t-(n.x+n.width),h=r-n.y,d=n.x,c=n.y+n.height):"se"===i||"s"===i?(s=t-(n.x+n.width),h=r-(n.y+n.height),d=n.x,c=n.y):"sw"===i||"w"==i?(s=t-n.x,h=r-(n.y+n.height),d=n.x+n.width,c=n.y):("nw"===i||"n"==i)&&(s=t-n.x,h=r-n.y,d=n.x+n.width,c=n.y+n.height),o=d+a.x+s,l=c+a.y+h}this.evData={startClientX:o,startClientY:l,startCropX:d,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!!i,ord:i},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:r,locked:a,keepSelection:n,onChange:o}=this.props,l=this.getBox();if(r||a||n&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let d=e.clientX-l.x,c=e.clientY-l.y,h={unit:"px",x:d,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:d,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,o(s(h,l.width,l.height),i(h,l.width,l.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:r,disabled:a,onChange:o,onDragStart:l}=this.props,d=this.getBox();if(a||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,l&&l(e));let{evData:c}=this;c.clientX=e.clientX,c.clientY=e.clientY,n(r,t=c.isResize?this.resizeCrop():this.dragCrop())||o(s(t,d.width,d.height),i(t,d.width,d.height))};onComponentKeyDown=t=>{let{crop:r,disabled:n,onChange:o,onComplete:l}=this.props;if(n)return;let d=t.key,c=!1;if(!r)return;let h=this.getBox(),u=this.makePixelCrop(h),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===d?(u.x-=m,c=!0):"ArrowRight"===d?(u.x+=m,c=!0):"ArrowUp"===d?(u.y-=m,c=!0):"ArrowDown"===d&&(u.y+=m,c=!0),c){t.cancelable&&t.preventDefault(),u.x=a(u.x,0,h.width-u.width),u.y=a(u.y,0,h.height-u.height);let e=s(u,h.width,h.height),r=i(u,h.width,h.height);o(e,r),l&&l(e,r)}};onHandlerKeyDown=(t,r)=>{var a,l;let d,{aspect:c=0,crop:h,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:x,onComplete:w}=this.props,y=this.getBox();if(u||!h||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let v=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,b=o((a=s(h,y.width,y.height),l=t.key,d={...a},"ArrowLeft"===l?"nw"===r?(d.x-=v,d.y-=v,d.width+=v,d.height+=v):"w"===r?(d.x-=v,d.width+=v):"sw"===r?(d.x-=v,d.width+=v,d.height+=v):"ne"===r?(d.y+=v,d.width-=v,d.height-=v):"e"===r?d.width-=v:"se"===r&&(d.width-=v,d.height-=v):"ArrowRight"===l&&("nw"===r?(d.x+=v,d.y+=v,d.width-=v,d.height-=v):"w"===r?(d.x+=v,d.width-=v):"sw"===r?(d.x+=v,d.width-=v,d.height-=v):"ne"===r?(d.y-=v,d.width+=v,d.height+=v):"e"===r?d.width+=v:"se"===r&&(d.width+=v,d.height+=v)),"ArrowUp"===l?"nw"===r?(d.x-=v,d.y-=v,d.width+=v,d.height+=v):"n"===r?(d.y-=v,d.height+=v):"ne"===r?(d.y-=v,d.width+=v,d.height+=v):"sw"===r?(d.x+=v,d.width-=v,d.height-=v):"s"===r?d.height-=v:"se"===r&&(d.width-=v,d.height-=v):"ArrowDown"===l&&("nw"===r?(d.x+=v,d.y+=v,d.width-=v,d.height-=v):"n"===r?(d.y+=v,d.height-=v):"ne"===r?(d.y+=v,d.width-=v,d.height-=v):"sw"===r?(d.x-=v,d.width+=v,d.height+=v):"s"===r?d.height+=v:"se"===r&&(d.width+=v,d.height+=v)),d),c,r,y.width,y.height,m,g,p,f);if(!n(h,b)){let e=i(b,y.width,y.height);x(b,e),w&&w(b,e)}};onDocPointerDone=e=>{let{crop:t,disabled:r,onComplete:a,onDragEnd:n}=this.props,o=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,n&&n(e),a&&a(s(t,o.width,o.height),i(t,o.width,o.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(),r=this.makePixelCrop(t),n=e.clientX-e.startClientX,i=e.clientY-e.startClientY;return r.x=a(e.startCropX+n,0,t.width-r.width),r.y=a(e.startCropY+i,0,t.height-r.height),r}getPointRegion(e,t,r,a){let{evData:n}=this,i=n.clientX-e.x,s=n.clientY-e.y,o;return o=a&&t?"nw"===t||"n"===t||"ne"===t:s<n.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:i<n.startCropX)?o?"nw":"sw":o?"ne":"se"}resolveMinDimensions(e,t,r=0,a=0){let n=Math.min(r,e.width),i=Math.min(a,e.height);return t&&(n||i)?t>1?n?[n,n/t]:[i*t,i]:i?[i*t,i]:[n,n/t]:[n,i]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:n,maxHeight:i}=this.props,s=this.getBox(),[l,d]=this.resolveMinDimensions(s,r,this.props.minWidth,this.props.minHeight),c=this.makePixelCrop(s),h=this.getPointRegion(s,t.ord,l,d),u=t.ord||h,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(l&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-l)),(d&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-d));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===h?(p.x=t.startCropX,p.width=m,r?p.height=p.width/r:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===h?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,r?p.height=p.width/r:p.height=g):"sw"===h?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),r?p.height=p.width/r:p.height=g):"nw"===h&&(p.x=t.startCropX+m,p.width=Math.abs(m),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=o(p,r,h,s.width,s.height,l,d,n,i);return r||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=a(c.x,0,s.width-c.width),c.y=a(c.y,0,s.height-c.height),c}renderCropSelection(){let{ariaLabels:r=e.defaultProps.ariaLabels,disabled:a,locked:n,renderSelectionAddon:i,ruleOfThirds:s,crop:o}=this.props,l=this.getCropStyle();if(o)return t.default.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":r.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!a&&!n&&t.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},t.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":r.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":r.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":r.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":r.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":r.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":r.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":r.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":r.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),i&&t.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},i(this.state)),s&&t.default.createElement(t.default.Fragment,null,t.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),t.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return s({...r,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:r,circularCrop:a,className:n,crop:i,disabled:s,locked:o,style:l,ruleOfThirds:d}=this.props,{cropIsActive:c,newCropIsBeingDrawn:h}=this.state,u=i?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",n,c&&"ReactCrop--active",s&&"ReactCrop--disabled",o&&"ReactCrop--locked",h&&"ReactCrop--new-crop",i&&e&&"ReactCrop--fixed-aspect",i&&a&&"ReactCrop--circular-crop",i&&d&&"ReactCrop--rule-of-thirds",!this.dragStarted&&i&&!i.width&&!i.height&&"ReactCrop--invisible-crop",a&&"ReactCrop--no-animate");return t.default.createElement("div",{ref:this.componentRef,className:m,style:l},t.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},r),i?t.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},t.default.createElement("defs",null,t.default.createElement("mask",{id:`hole-${this.instanceId}`},t.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),a?t.default.createElement("ellipse",{cx:`${i.x+i.width/2}${i.unit}`,cy:`${i.y+i.height/2}${i.unit}`,rx:`${i.width/2}${i.unit}`,ry:`${i.height/2}${i.unit}`,fill:"black"}):t.default.createElement("rect",{x:`${i.x}${i.unit}`,y:`${i.y}${i.unit}`,width:`${i.width}${i.unit}`,height:`${i.height}${i.unit}`,fill:"black"}))),t.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};e.s(["f",0,c],232660);let h={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class u extends Error{code;format;constructor(e,t,r){super(e,void 0===r?void 0:{cause:r}),this.code=e,this.format=t,this.name="ImageDecodeError"}}let m=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),g=new Set(["mif1","msf1","mif2"]),p=new Set(["avif","avis"]);function f(e,t,r=h){let a=Math.min(1,r.maxLongEdge/Math.max(e,t),Math.sqrt(r.maxPixels/Math.max(1,e*t)));return{width:Math.max(1,Math.floor(e*a)),height:Math.max(1,Math.floor(t*a)),scale:a}}async function x(e){let t,r;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let a=await (t=URL.createObjectURL(e),(r=new Image).decoding="async",new Promise((e,a)=>{r.onload=()=>e(r),r.onerror=()=>a(Error("IMAGE_ELEMENT_DECODE_FAILED")),r.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!a.naturalWidth||!a.naturalHeight)throw Error("IMAGE_EMPTY");return a}async function w(t){let{heicTo:r}=await e.A(462684);return r({blob:t,type:"image/jpeg",quality:.95})}function y(e,t){return new Promise((r,a)=>{e.toBlob(e=>e?r(e):a(Error("CANVAS_EMPTY")),"image/jpeg",t)})}function v(e,t,r,a,n,i,s){let o,l=((o=document.createElement("canvas")).width=i,o.height=s,o),d=l.getContext("2d");if(!d)throw Error("CANVAS_UNSUPPORTED");return d.fillStyle="#ffffff",d.fillRect(0,0,i,s),d.imageSmoothingEnabled=!0,d.imageSmoothingQuality="high",d.drawImage(e,t,r,a,n,0,0,i,s),l}async function b(e,t){var r;let a,n=performance.now(),i=await e.arrayBuffer(),s=performance.now()-n,o=function(e){let t=(t,r)=>String.fromCharCode(...e.subarray(t,r));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 r=Math.min(e.length,(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0||e.length),a=[t(8,12)];for(let e=16;e+4<=r;e+=4)a.push(t(e,e+4));if(a.some(e=>m.has(e)))return"heic";if(a.some(e=>p.has(e)))return"avif";if(a.some(e=>g.has(e)))return"heic"}return"unknown"}(new Uint8Array(i,0,Math.min(i.byteLength,64))),l=e.type||"",d=performance.now(),c="native",h=new Blob([i],{type:l||"application/octet-stream"});try{a=await x(h)}catch(e){if("heic"!==o)throw new u("unknown"===o?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",o,e);t?.();try{a=await x(await w(h)),c="heic"}catch(e){throw new u("HEIC_DECODE_FAILED",o,e)}}let{width:b,height:j}=(r=a)instanceof HTMLImageElement?{width:r.naturalWidth,height:r.naturalHeight}:{width:r.width,height:r.height};if(!b||!j)throw new u("IMAGE_DECODE_FAILED",o);let k=f(b,j,{maxLongEdge:1600,maxPixels:1/0}),N=await y(v(a,0,0,b,j,k.width,k.height),.85),C=URL.createObjectURL(N),S=performance.now()-d;return{source:a,width:b,height:j,format:o,decoder:c,previewUrl:C,sourceType:l,sourceBytes:e.size,timings:{read:Math.round(s),convert:Math.round(S)},dispose:()=>{URL.revokeObjectURL(C),a instanceof HTMLImageElement||a.close()}}}let j={x:0,y:0,width:1,height:1};async function k(e,t=j,r=h){var a;let n=performance.now(),i=e=>Math.min(1,Math.max(0,e)),s=Math.round(i(t.x)*e.width),o=Math.round(i(t.y)*e.height),l=Math.max(1,Math.min(e.width-s,Math.round(i(t.width)*e.width))),d=Math.max(1,Math.min(e.height-o,Math.round(i(t.height)*e.height))),c=f(l,d,r),u=v(e.source,s,o,l,d,c.width,c.height),m=performance.now()-n,g=performance.now(),p=r.startQuality,x=await y(u,p);for(let t=0;x.size>r.maxBytes&&t<12;t++)p-.05>=r.minQuality-1e-9?p=Math.round((p-.05)*100)/100:(c={width:Math.max(1,Math.floor(.85*c.width)),height:Math.max(1,Math.floor(.85*c.height)),scale:.85*c.scale},u=v(e.source,s,o,l,d,c.width,c.height)),x=await y(u,p);return{dataUrl:await (a=x,new Promise((e,t)=>{let r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>t(r.error??Error("READ_FAILED")),r.readAsDataURL(a)})),width:c.width,height:c.height,bytes:x.size,quality:p,timings:{crop:Math.round(m),compress:Math.round(performance.now()-g)}}}e.s(["o",0,u,"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,b,"X",0,k],213761)},866531,497346,752012,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(632781),n=e.i(741120),i=e.i(856522),s=e.i(314381),o=e.i(3198),l=e.i(519455),d=e.i(111110),c=e.i(41931),h=e.i(294114),u=e.i(201276);function m({data:e,onChange:n}){let{t:i}=(0,d.b)(),[g,p]=(0,r.useState)(!1),[f,x]=(0,r.useState)(null),w=async()=>{if(!e.questionText.trim())return void h.c.warning(i.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void h.c.warning(i.geogebra.answerRequired);p(!0),x(null);try{let t=await c.k.post("/api/geogebra-analyze",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis},{timeout:18e4,recoverable:!0});t.suitable&&t.commands&&t.commands.length>0?n({geogebraCommands:JSON.stringify(t.commands)}):x(t.description||i.geogebra.notSuitable)}catch(e){u.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),x(i.geogebra.analyzeFailed)}finally{p(!1)}};return e.geogebraCommands?(0,t.jsx)(o.f,{commands:e.geogebraCommands,height:350,onRegenerate:w,onDelete:async()=>n({geogebraCommands:void 0})}):e.questionText.trim()&&e.answerText.trim()?(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(s.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.geogebra.title})]}),(0,t.jsx)(l.f,{variant:"outline",size:"sm",onClick:w,disabled:g,children:g?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4 animate-spin"}),i.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4"}),i.geogebra.generate]})})]}),f&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:f}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var g=e.i(469937),p=e.i(28342),f=e.i(438465),x=e.i(674166),w=e.i(110204);function y({data:e,paperLevel:r,onChange:a}){let{t:n}=(0,d.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{children:n.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(f.f,{value:e.subjectId,onChange:e=>a({subjectId:e})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{htmlFor:"correction-grade-semester",children:n.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(p.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>a({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{children:n.editor.paperLevel||"Paper Level"}),(0,t.jsx)(x.f,{value:r,onChange:e=>a({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{children:n.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(g.f,{size:"md",value:e.difficultyStars,onChange:e=>a({difficultyStars:e})})})]})]})}var v=e.i(141176),b=e.i(515288),j=e.i(967489);function k({data:e,onChange:r}){let{t:a}=(0,d.b)();return(0,t.jsxs)(b.N,{children:[(0,t.jsx)(b.Y,{children:(0,t.jsx)(b.v,{children:a.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(b.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{children:a.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(j.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>r({mistakeStatus:e}),children:[(0,t.jsx)(j.P,{children:(0,t.jsx)(j.U,{})}),(0,t.jsxs)(j.r,{children:[(0,t.jsx)(j.T,{value:"not_attempted",children:a.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(j.T,{value:"wrong_attempt",children:a.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(j.T,{value:"unknown",children:a.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{children:a.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(v.f,{value:e.wrongAnswerText||"",onChange:t=>r({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:a.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{children:a.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(v.f,{value:e.mistakeAnalysis||"",onChange:e=>r({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:a.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var N=e.i(511445),C=e.i(149704);function S({title:e,children:r,className:a}){return(0,t.jsxs)(b.N,{children:[(0,t.jsx)(b.Y,{children:(0,t.jsx)(b.v,{children:e})}),(0,t.jsx)(b.O,{className:a,children:r})]})}function E({data:e,children:r}){let{t:a}=(0,d.b)(),n={wrong_attempt:a.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:a.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:a.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(S,{title:a.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(N.f,{content:e.questionText}),(0,t.jsx)(C.f,{svg:e.figureSvg})]}),r,(0,t.jsx)(S,{title:a.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(N.f,{content:e.answerText})}),(0,t.jsx)(S,{title:a.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(N.f,{content:e.analysis})}),(0,t.jsxs)(S,{title:a.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[a.editor.mistakeStatus||"Attempt Status",a.common.colon,n[e.mistakeStatus]??n.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:a.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(N.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:a.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(N.f,{content:e.mistakeAnalysis})]})]})]})}var I=e.i(574041),A=e.i(215519),D=e.i(306831);e.i(676167);var M=e.i(952122),R=e.i(62825),T=e.i(664030),_=e.i(303163);e.s(["f",0,function({initialData:e,onSave:s,onCancel:o,imagePreview:g,initialSubjectId:p,aiTimeout:f}){let{timeZone:x}=(0,A.M)(),{t:j,language:N}=(0,d.b)(),[C,S]=(0,r.useState)({...e,wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:p,gradeSemester:e.gradeSemester||""}),L=(0,r.useRef)(!1),$=e=>{"gradeSemester"in e&&(L.current=!0),S(t=>({...t,...e}))},{groups:P}=(0,T.f)(),O=(()=>{if(C.paperLevel)return C.paperLevel;let e="number"==typeof C.difficultyStars&&C.difficultyStars>=4?"b":"a";return P.find(t=>t.key===e&&t.isActive)?.id||""})(),U=C.paperLevel??O,[z,H]=(0,r.useState)(!1),[F,V]=(0,r.useState)(!1),[B,Y]=(0,r.useState)(!1),[G,X]=(0,r.useState)(void 0),[q,K]=(0,r.useState)([]);(0,r.useEffect)(()=>{c.k.get("/api/notebooks").then(K).catch(e=>u.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),c.k.get("/api/user").then(e=>{if(Y(!!e?.enableGeogebra),e){let t=function(e,t=D.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,r=new Date,a="en",n=D.J){let i=(0,D.c)(r,n),s=i.getFullYear(),o=i.getMonth()+1,l=s-t,d="2nd";o>=9?(l+=1,d="1st"):d=o<2?"1st":"2nd";let c="zh"===a,h=c?"1st"===d?"上期":"下期":"1st"===d?"1st Semester":"2nd Semester",u=(c?{primary:["一年级","二年级","三年级","四年级","五年级","六年级"],junior_high:["初一","初二","初三"],senior_high:["高一","高二","高三"],university:["大一","大二","大三","大四"]}:{primary:["Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6"],junior_high:["Junior High Grade 1","Junior High Grade 2","Junior High Grade 3"],senior_high:["Senior High Grade 1","Senior High Grade 2","Senior High Grade 3"],university:["Freshman","Sophomore","Junior","Senior"]})[e]||[],m=`${l}`;if(m=l>0&&l<=u.length?u[l-1]:l>u.length?c?"已毕业":"Graduated":c?"学前":"Pre-school",!c)return`${m}, ${h}`;{let e="1st"===d?"上":"下";return`${m}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,x);S(e=>e.gradeSemester||L.current?e:{...e,gradeSemester:t||""}),X(e.educationStage||void 0)}}).catch(e=>u.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[N,x]);let W=async()=>{if(!C.questionText.trim())return void h.c.warning(j.editor.enterQuestionFirst||"Please enter question text first");H(!0);try{let e=function({questionText:e,language:t,subject:r,imagePreview:a,gradeSemester:n,subjectId:i}){let s={questionText:e,language:t,subject:r};return a&&(s.imageBase64=a),n&&(s.gradeSemester=n),i&&(s.subjectId=i),s}({questionText:C.questionText,language:N,subject:C.subject,imagePreview:g,gradeSemester:C.gradeSemester??void 0,subjectId:C.subjectId});u.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:f});let t=await c.k.post("/api/reanswer",e,{timeout:f||18e4,recoverable:!0});S(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,R.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars})),h.c.success(j.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(a){let e,t,r;u.V.error("[CorrectionEditor]","Reanswer failed",{error:a}),h.c.error((e=(0,_.d)(a)||"",r=(t=j.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||j.errors?.AI_AUTH_ERROR||r:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||j.errors?.AI_CONNECTION_FAILED||r:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||j.errors?.AI_RESPONSE_ERROR)||r))}finally{H(!1)}},Q=async()=>{if(!C.subjectId)return void h.c.warning(j.editor.messages?.selectNotebook||"Please select a notebook");if(!F){V(!0);try{await s({...C,paperLevel:U,mistakeStatus:(0,R.x)(C.mistakeStatus,C.wrongAnswerText)})}finally{V(!1)}}},Z=j.editor.placeholder||"Supports Markdown and LaTeX...",J=(0,M.f)(q.find(e=>e.id===C.subjectId)?.name||null)||(0,M.f)(C.subject||null)||void 0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:j.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(l.f,{variant:"outline",onClick:o,children:j.editor.cancel}),(0,t.jsxs)(l.f,{onClick:Q,disabled:F,children:[F?(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),F?j.common?.pleaseWait||"Please wait...":j.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[g&&(0,t.jsx)(b.N,{children:(0,t.jsx)(b.O,{className:"p-4",children:(0,t.jsx)("img",{src:g,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(y,{data:C,paperLevel:U,onChange:$}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{children:j.editor.question}),(0,t.jsx)(v.f,{value:C.questionText,onChange:e=>$({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:Z}),(0,t.jsx)(l.f,{variant:"default",size:"sm",onClick:W,disabled:z||!C.questionText.trim(),className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",children:z?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4 animate-spin"}),j.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),j.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:j.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{children:j.editor.tags}),(0,t.jsx)(I.f,{value:C.knowledgePoints,onChange:e=>$({knowledgePoints:e}),placeholder:j.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:j.editor.createTagHint,subject:J,gradeStage:G}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:j.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{children:j.editor.answer}),(0,t.jsx)(v.f,{value:C.answerText,onChange:e=>$({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:Z})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(w.f,{children:j.editor.analysis}),(0,t.jsx)(v.f,{value:C.analysis,onChange:e=>$({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:Z})]}),(0,t.jsx)(k,{data:C,onChange:$})]}),(0,t.jsx)(E,{data:C,children:B&&(0,t.jsx)(m,{data:C,onChange:$})})]})]})}],866531);var L=e.i(853138),$=e.i(263676);e.s(["f",0,function({message:e,onDismiss:r}){let{t:a}=(0,d.b)();return e?(0,t.jsxs)("div",{role:"alert",className:"flex items-start gap-3 rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[(0,t.jsx)(L.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:e}),(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":a.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)($.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var P=e.i(618566);function O(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function U(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let r=t.errors[e];return"string"==typeof r?r:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),a=(0,P.useRouter)(),[n,i]=(0,r.useState)(null),s=async(r,n,s=!0)=>{i(null);try{let e=await r();return h.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),s&&(e.duplicate?a.push(`/error-items/${e.id}`):n&&a.push(`/notebooks/${n}`)),!0}catch(a){u.V.error(e,"Save failed",{errorMessage:(0,_.d)(a)??(0,_.Z)(a)});let r=function(e,t){let r=O(e),a=O(r?.data),n="number"==typeof r?.status?r.status:void 0,i=(0,_.d)(e),s=U(i,t)??U(a?.code,t),o={400:t.errors.QUESTION_SAVE_INVALID_INPUT,401:t.errors.QUESTION_SAVE_UNAUTHORIZED,403:t.errors.QUESTION_SAVE_FORBIDDEN,408:t.errors.QUESTION_SAVE_TIMEOUT,409:t.errors.QUESTION_SAVE_CONFLICT,413:t.errors.QUESTION_SAVE_TOO_LARGE,429:t.errors.QUESTION_SAVE_RATE_LIMITED,502:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:t.errors.QUESTION_SAVE_TIMEOUT},l=s??(n?o[n]:void 0)??t.errors.QUESTION_SAVE_FAILED;!n&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,_.Z)(e)))&&(l=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=O(a?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=U(d?.reason,t);e&&(l+=`
7
+ ${e}`)}return 400===n&&(l+=(function(e,t){if(!Array.isArray(e))return[];let r={questionText:t.editor.question,answerText:t.editor.answer,analysis:t.editor.analysis,wrongAnswerText:t.editor.wrongAnswerText,mistakeAnalysis:t.editor.mistakeAnalysis,knowledgePoints:t.editor.tags,subjectId:t.editor.selectNotebook,gradeSemester:t.editor.gradeSemester,paperLevel:t.editor.paperLevel};return e.slice(0,3).flatMap(e=>{let a=O(e),n=a?.path,i=Array.isArray(n)&&"string"==typeof n[0]?r[n[0]]:void 0;if(!i)return[];let s=a?.maximum,o=t.questionSave.invalidField;return a?.code==="too_big"&&"number"==typeof s&&Number.isSafeInteger(s)&&s>=0&&(o="array"===a.origin?t.questionSave.tooMany:t.questionSave.tooLong),[o.replace("{field}",i).replace("{maximum}",String(s))]})})(a?.details,t).map(e=>`
8
+ ${e}`).join("")),"string"==typeof d?.databaseCode&&/^P\d{4}$/.test(d.databaseCode)&&(l+=`
9
+ ${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),n&&(l+=` (HTTP ${n})`),l}(a,t);return i(r),"AI_DAILY_LIMIT_EXCEEDED"!==(0,_.d)(a)&&h.c.error(r),!1}};return{saveError:n,setSaveError:i,dismissSaveError:()=>i(null),run:s}}],752012)},469937,62825,e=>{var t=e.i(843476),r=e.i(456420);let a={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"}]]};a.node;let n=(0,r.f)(a);var i=e.i(111110),s=e.i(975157);let o=[1,2,3,4,5];function l(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["f",0,function({value:e,onChange:r,disabled:a,size:l="sm",showUnrated:d=!0,className:c}){let{t:h}=(0,i.b)(),u=e??0,m="sm"===l?"h-3.5 w-3.5":"h-5 w-5",g=u?h.difficulty.starsLabel.replace("{n}",String(u)):h.difficulty.unrated;return r?(0,t.jsxs)("span",{className:(0,s.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${h.difficulty.label}${h.common.colon}${g}`,title:h.difficulty.clearHint,children:[o.map(e=>(0,t.jsx)("button",{type:"button",disabled:a,onClick:()=>r(e===u?null:e),"aria-label":h.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)(n,{className:(0,s.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:h.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,s.f)("inline-flex items-center",c),role:"img","aria-label":`${h.difficulty.label}${h.common.colon}${g}`,title:g,children:o.map(e=>(0,t.jsx)(n,{className:(0,s.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,s.f)("text-xs text-muted-foreground",c),children:h.difficulty.unrated}):null}],469937),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:"未判断"})[l(e)]},"h",0,l,"x",0,function(e,t){return(t||"").trim()?"wrong_attempt":l(e)}],62825)},12130,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(232660),n=e.i(519455),i=e.i(776639),s=e.i(263676),o=e.i(111110);async function l(e,t){let{naturalWidth:r,naturalHeight:a}=e;return Promise.all(t.map(t=>new Promise((n,i)=>{let s=document.createElement("canvas"),o=Math.round(t.x*r),l=Math.round(t.y*a);s.width=Math.max(1,Math.round(t.width*r)),s.height=Math.max(1,Math.round(t.height*a));let d=s.getContext("2d");d?(d.drawImage(e,o,l,s.width,s.height,0,0,s.width,s.height),s.toBlob(e=>e?n(e):i(Error("Canvas is empty")),"image/jpeg",.95)):i(Error("Canvas is not supported"))})))}let d={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},c=(0,r.forwardRef)(function({imageSrc:e,regions:a,onChange:n,imageStyle:i=d,onImageLoad:l},c){let{t:h}=(0,o.b)(),u=(0,r.useRef)(null),m=(0,r.useRef)(null),[g,p]=(0,r.useState)(null),f=e=>{let t=u.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},x=()=>{g&&g.width>=.02&&g.height>=.02&&n([...a,g]),m.current=null,p(null)},w=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:c,src:e,alt:"",draggable:!1,style:i,onLoad:l,className:"block"}),(0,t.jsxs)("div",{ref:u,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(u.current?.setPointerCapture(e.pointerId),m.current=f(e),p(null))},onPointerMove:e=>{var t,r,a,n;let i,s,o;if(!m.current)return;let l=f(e);p((t=m.current.x,r=m.current.y,a=l.x,n=l.y,s=(i=e=>Math.min(1,Math.max(0,e)))(Math.min(t,a)),o=i(Math.min(r,n)),{x:s,y:o,width:i(Math.max(t,a))-s,height:i(Math.max(r,n))-o}))},onPointerUp:x,onPointerCancel:x,children:[a.map((e,r)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:w(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:r+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":h.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>n(a.filter((e,t)=>t!==r)),children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},r)),g&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:w(g)})]})]})});var h=e.i(456420);let u={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"}]]};u.node;let m=(0,h.f)(u),g={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"}]]};g.node;let p=(0,h.f)(g);function f({zoom:e,onZoomIn:r,onZoomOut:a,onReset:n}){let{t:i}=(0,o.b)(),s="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 ${s}`;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:a,disabled:e<=1,"aria-label":i.common.cropper.zoomOut,title:i.common.cropper.zoomOut,children:(0,t.jsx)(p,{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 ${s}`,onClick:n,"aria-label":i.common.cropper.resetZoom,title:i.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:l,onClick:r,disabled:e>=5,"aria-label":i.common.cropper.zoomIn,title:i.common.cropper.zoomIn,children:(0,t.jsx)(m,{className:"h-4 w-4"})})]})}var x=e.i(201276);let w={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}};e.s(["f",0,function({imageSrc:e,open:s,onClose:d,onCropComplete:h,onMultiCropComplete:u,onRegionsSelected:m,allowMulti:g=!0,onAutoSplit:p}){let{t:y}=(0,o.b)(),v=/^(blob:|data:image\/)/i.test(e)?e:void 0,[b,j]=(0,r.useState)(),k=(0,r.useRef)(null),[N,C]=(0,r.useState)("single"),{containerRef:S,zoom:E,imageStyle:I,measureImage:A,zoomIn:D,zoomOut:M,reset:R}=function(e){let[t,a]=(0,r.useState)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)(e=>{n.current=e,a(e)},[]),[s,o]=(0,r.useState)(1),l=(0,r.useRef)(1),[d,c]=(0,r.useState)(null),h=(0,r.useRef)(null),u=(0,r.useRef)(!1),m=(0,r.useCallback)((e,t,r)=>{let a=n.current,i=l.current,s=Math.min(5,Math.max(1,e));if(!a||s===i)return;if(1===i){let e=a.querySelector("img");e&&c(e.clientWidth)}let d=a.getBoundingClientRect(),u=(t??d.left+d.width/2)-d.left,m=(r??d.top+d.height/2)-d.top;h.current={viewX:u,viewY:m,contentX:a.scrollLeft+u,contentY:a.scrollTop+m,ratio:s/i},l.current=s,o(s)},[]);(0,r.useLayoutEffect)(()=>{let e=n.current,t=h.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,h.current=null)},[s]),(0,r.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(l.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},r=null,a=e=>{let[t,r]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-r.clientX,t.clientY-r.clientY),centerX:(t.clientX+r.clientX)/2,centerY:(t.clientY+r.clientY)/2}},n=e=>{2===e.touches.length&&(r={distance:a(e.touches).distance,zoom:l.current},u.current=!0)},i=e=>{if(!r||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:n,centerY:i}=a(e.touches);r.distance>0&&m(r.zoom*(t/r.distance),n,i)},s=e=>{e.touches.length<2&&(r=null,u.current=!1)},o=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",n,{passive:!0}),t.addEventListener("touchmove",i,{passive:!1}),t.addEventListener("touchend",s),t.addEventListener("touchcancel",s),t.addEventListener("pointermove",o,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",n),t.removeEventListener("touchmove",i),t.removeEventListener("touchend",s),t.removeEventListener("touchcancel",s),t.removeEventListener("pointermove",o,{capture:!0})}},[t,m]);let g=(0,r.useCallback)(e=>{e&&1===l.current&&c(e.clientWidth)},[]),p=(0,r.useCallback)(()=>m(1.25*l.current),[m]),f=(0,r.useCallback)(()=>m(l.current/1.25),[m]),x=(0,r.useCallback)(()=>{l.current=1,h.current=null,o(1)},[]),w=1!==s&&d?{...e,width:d*s,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:i,zoom:s,imageStyle:w,measureImage:g,zoomIn:p,zoomOut:f,reset:x}}(w[N]);(0,r.useEffect)(()=>{R()},[e,R]);let[T,_]=(0,r.useState)({src:e,regions:[]}),L=T.src===e?T.regions:[],$=t=>_({src:e,regions:t}),P=(0,r.useRef)(null),O=["single",...p?["auto"]:[],...u||m&&g?["multi"]:[]],U={single:y.batchImport.singleMode,auto:y.batchImport.autoMode,multi:y.batchImport.multiMode},z=async()=>{if(0!==L.length){if(m){m(L,!0),$([]);return}if(P.current&&u)try{u(await l(P.current,L)),$([])}catch(e){x.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},H=async()=>{let e=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};if("auto"===N&&p)return void p(e);if(m)return void m([e],!1);if(k.current&&h)try{let[t]=await l(k.current,[e]);h(t)}catch(e){x.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(i.N,{open:s,onOpenChange:e=>!e&&d(),children:(0,t.jsxs)(i.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(i.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(i.F,{children:y.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:S,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===N?(0,t.jsx)(c,{ref:P,imageSrc:v,regions:L,onChange:$,imageStyle:I,onImageLoad:e=>A(e.currentTarget)}):(0,t.jsx)(a.f,{crop:b,onChange:(e,t)=>j(t),children:(0,t.jsx)("img",{ref:k,alt:"Crop me",src:v,onLoad:function(e){j({unit:"%",x:0,y:0,width:100,height:100}),A(e.currentTarget)},style:I})})})}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(f,{zoom:E,onZoomIn:D,onZoomOut:M,onReset:R})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[O.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===O.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:O.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":N===e,onClick:()=>{R(),C(e)},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${N===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:U[e]},e))}),(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"===N?`${y.batchImport.hint} ${y.batchImport.regionCount.replace("{count}",String(L.length))}`:"auto"===N?y.batchImport.autoHint:y.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===N&&L.length>0&&(0,t.jsx)(n.f,{variant:"ghost",onClick:()=>$([]),children:y.batchImport.clear}),(0,t.jsx)(n.f,{variant:"outline",onClick:d,children:y.common.cancel||"Cancel"}),"multi"===N?(0,t.jsx)(n.f,{onClick:z,disabled:0===L.length,children:y.batchImport.start.replace("{count}",String(L.length))}):(0,t.jsx)(n.f,{onClick:H,children:"auto"===N?y.batchImport.autoStart:y.common.confirm||"Confirm"})]})]})]})]})})}],12130)},731335,579321,927904,e=>{var t=e.i(843476),r=e.i(399847),a=e.i(551757),n=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let s=(0,n.f)(i);var o=e.i(632781),l=e.i(615568),d=e.i(487486),c=e.i(519455),h=e.i(168148),u=e.i(111110),m=e.i(215519),g=e.i(306831);let p=["read","convert","crop","compress","upload"],f=["receive","analyze","save"];function x(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let r=Math.round(t);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var w=e.i(975157);let y={analyzing:50,saving:90},v={analyzing:o.f,saving:o.f,review:l.f,saved:a.f,failed:r.f};e.s(["f",0,function({task:e,now:r,onReview:a,onViewItem:n,onRetry:i,onDiscard:o}){let{t:l}=(0,u.b)(),{timeZone:b}=(0,m.M)(),j=v[e.status],k="analyzing"===e.status||"saving"===e.status,N=l.errors,C=e.error?"string"==typeof N[e.error]?N[e.error]:e.error:null,S=function(e){let t=[];for(let r of p){let a=e?.client?.[r];"number"==typeof a&&t.push({stage:r,ms:a})}for(let r of f){let a=e?.server?.[r];"number"==typeof a&&t.push({stage:r,ms:a})}return t}(e.timings),E=k&&r?r-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,w.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(j,{className:(0,w.f)("mt-0.5 h-4 w-4 shrink-0",k&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:l.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:l.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:l.importTasks.unread})]}),k&&(0,t.jsx)(h.f,{value:y[e.status],"aria-label":l.importTasks.stageEstimate,"aria-valuetext":l.common.progress.estimated.replace("{percent}",String(y[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:l.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?l.importTasks.duplicateSaved:l.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),C&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:C}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(s,{className:"h-3 w-3"}),l.importTasks.createdAt.replace("{time}",(0,g.r)(e.createdAt,"MM-dd HH:mm",b))]}),null!==E&&(0,t.jsx)("span",{children:l.importTasks.elapsed.replace("{time}",x(E))}),e.attempts>1&&(0,t.jsx)("span",{children:l.importTasks.attempts.replace("{count}",String(e.attempts))})]}),S.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:S.map(({stage:e,ms:r})=>(0,t.jsxs)("li",{children:[l.importTasks.timings[e]," ",x(r)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&a&&(0,t.jsx)(c.f,{size:"sm",onClick:a,children:l.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&n&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:n,children:l.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:l.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&o&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:o,children:l.importTasks.discard})]})]})}],731335);var b=e.i(618566),j=e.i(61425),k=e.i(294114),N=e.i(201276),C=e.i(116331);e.s(["f",0,function(e){let{t}=(0,u.b)(),r=(0,b.useRouter)(),a=e=>{e.unread&&(0,C.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{a(e),r.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(a(e),r.push(`/error-items/${e.errorItemId}`))},markRead:a,retry:async r=>{try{await (0,C.R)(r.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,j.f)(e,t))}e?.()},discard:async r=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let a=!1;try{await (0,C.x)(r.id),k.c.success(t.importTasks.discarded),a=!0}catch(e){k.c.error((0,j.f)(e,t))}return e?.(),a}}}],579321);var S=e.i(271645);e.s(["f",0,function(e,t=1e3){let[r,a]=(0,S.useState)(()=>Date.now());return(0,S.useEffect)(()=>{if(!e)return;let r=setInterval(()=>a(Date.now()),t);return()=>clearInterval(r)},[e,t]),r}],927904)},141176,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(456420);let n={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"]};n.node;let i=(0,a.f)(n);var s=e.i(772382),o=e.i(511445),l=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:a,className:n,...h}){let{t:u}=(0,d.b)(),[m,g]=(0,r.useState)("source"),p=(0,r.useId)(),f=[{mode:"source",label:u.markdownEditor.source,icon:i},{mode:"preview",label:u.markdownEditor.preview,icon:s.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:r,icon:a})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,c.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)(a,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(l.f,{value:e,onChange:e=>a(e.target.value),className:n,...h}):(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)(o.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,674166,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(967489),n=e.i(856423),i=e.i(41931),s=e.i(201276),o=e.i(111110);e.s(["f",0,function({value:e,onChange:l,className:d}){let[c,h]=(0,r.useState)([]),{t:u}=(0,o.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");h(e)}catch(e){s.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(a.d,{value:e,onValueChange:l,children:[(0,t.jsx)(a.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(a.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(a.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(a.T,{value:e.id,children:e.name},e.id))})]})}],438465);var l=e.i(664030);e.s(["f",0,function({value:e,onChange:r,disabled:n}){let{groups:i,loading:s}=(0,l.f)(),o=i.filter(e=>e.isActive);return(0,t.jsxs)(a.d,{value:e,onValueChange:r,disabled:n||s,children:[(0,t.jsx)(a.P,{children:(0,t.jsx)(a.U,{placeholder:"选择卷别"})}),(0,t.jsx)(a.r,{children:o.map(e=>(0,t.jsx)(a.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),r=e.i(111110),a=e.i(398019),n=e.i(184110),i=e.i(975157);let s={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:o,align:l,className:d}){let{t:c}=(0,r.b)();if(!e)return null;let h=(0,n.V)(o),u=(0,n.o)(l);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,a.f)(e),alt:c.figure.alt,className:(0,i.f)(s[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:h/100,maxWidth:`${Math.min(h,100)}%`}})})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(263676),n=e.i(487486),i=e.i(793479),s=e.i(41931),o=e.i(201276);e.s(["f",0,function({value:e=[],onChange:l,placeholder:d="Enter tags...",className:c="",enterHint:h,subject:u,gradeStage:m}){let[g,p]=(0,r.useState)(""),[f,x]=(0,r.useState)([]),[w,y]=(0,r.useState)(!1),[v,b]=(0,r.useState)(0),j=(0,r.useRef)(null),k=(0,r.useRef)(null),N=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});u&&r.append("subject",u),m&&r.append("stage",m);let a=((await s.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));x(a.slice(0,20)),y(a.length>0),b(0)}catch(e){o.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,r.useEffect)(()=>{g.trim()&&N(g)},[g,N]);let C=t=>{t.trim()&&!e.includes(t.trim())&&(l([...e,t.trim()]),p(""),x([]),y(!1),b(0))},S=t=>{l(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||j.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${c}`,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)(n.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>S(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(i.f,{ref:j,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(x([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&f[v]?C(f[v]):g.trim()&&C(g)):"ArrowDown"===t.key?(t.preventDefault(),b(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),b(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),b(0)):"Backspace"===t.key&&!g&&e.length>0&&S(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),w&&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,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===v?"bg-accent":""}`,onClick:()=>C(e),onMouseEnter:()=>b(r),children:e},e))}),g&&!w&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:h?`${h} "${g}"`:`Press Enter to create "${g}"`})]})}])},184110,e=>{let t=["left","center","right"],r="center";function a(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,r,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,a,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:r},"V",0,function(e){return a(e)?e:100}])},398019,e=>{e.s(["f",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},952122,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}])},825624,575557,364002,e=>{let t=/^[\s  ]+/,r="一二三四五六七八九十",a=[{family:"dot",pattern:/^(\d{1,3})\s*[..](?!\d)\s*/},{family:"comma",pattern:/^(\d{1,3})\s*[、,,](?!\d)\s*/},{family:"paren",pattern:/^(\d{1,3})\s*[))]\s*/},{family:"colon",pattern:/^(\d{1,3})\s*[::](?!\d)\s*/},{family:"ti",pattern:/^第\s*(\d{1,3}|[一二三四五六七八九十]{1,3})\s*题\s*[..、::]?\s*/},{family:"example",pattern:/^(?:例题?|练习|习题)\s*(\d{1,3})\s*[..、::]?\s*/},{family:"q",pattern:/^(?:Q|Question|Problem|Exercise)\s*(\d{1,3})\s*[..::)]?\s+/i},{family:"cn",pattern:/^([一二三四五六七八九十]{1,3})\s*[、..]\s*/}];function n(e){let n=e.replace(t,"");for(let{family:e,pattern:t}of a){let a=n.match(t);if(!a||n.length<=a[0].length)continue;let i=function(e){if(/^\d+$/.test(e))return Number(e);if("十"===e)return 10;let t=e.indexOf("十");return -1===t?r.indexOf(e)+1:10*(0===t?1:r.indexOf(e[0])+1)+(t===e.length-1?0:r.indexOf(e[t+1])+1)}(a[1]);if(Number.isFinite(i)&&!(i<=0))return{value:i,family:e,prefixLength:a[0].length,label:a[1]}}return null}function i(e){let t=[];for(let r of e)(r||0!==t.length&&""!==t[t.length-1])&&t.push(r);for(;t.length>0&&""===t[t.length-1];)t.pop();return t.join("\n")}let s=/(姓名|班级|学号|日期|得分|分数|评分|考号|座位号|家长签字|用时|Name\s*[::_]|Class\s*[::_]|Date\s*[::_]|Score\s*[::_])|_{3,}|共\s*\d+\s*(道|题|小题)|做完|答案(见|在)|最后一页|满分\s*\d+\s*分/i,o=/(阅读|材料|短文|文章|选文|诗歌|古诗|文言文|下[面列]的?(表格|图表|统计|信息)|根据.{0,20}(回答|完成)|passage|read the|according to the)/i,l=/^(参考答案|答案与解析|答案|Answers?|Answer Key)\s*[::]?$/i,d=/^(第[一二三四五六七八九十]+(部分|大题|节)|(Part|Section)\s+[A-Z0-9IVX]+\b)/i,c=/(选择|填空|判断|计算|解答|应用|解决问题|操作|作图|阅读|写作|作文|综合|口算|听力|单项|完形|题)/,h=/(\d{1,3})\s*[~~\-—–至到]\s*(\d{1,3})\s*(?:小?题|questions?)/i,u=/(小问|小题|下列问题|以下问题|下列各题|下面各题|完成下列|回答下列|回答以下|following questions|answer the following)/i;function m(e){let t=[],r=[];for(let a of e)a?r.push(a):r.length&&(t.push(r.join("\n")),r=[]);return r.length&&t.push(r.join("\n")),t}function g(e,t){let r=[];for(let a=0;a<e.length;a++){let n=e[a],i=[n];for(let r=a+1;r<e.length;r++){let a=e[r],s=i[i.length-1];if(a.family!==n.family)continue;let o=1===a.value&&[...t].some(e=>e>s.line&&e<a.line);(a.value===s.value+1||o)&&i.push(a)}i.length>r.length&&(r=i)}return r}function p(e,t,r){return!!d.test(e)||!!t&&"cn"===t.family&&"cn"!==r&&null!==r&&(e.length<=40||c.test(e.slice(0,20)))}function f(e){let t=e.match(h);if(!t)return null;let r=Number(t[1]),a=Number(t[2]);return r<=a?{from:r,to:a}:null}e.s(["S",0,60,"i",0,2e4,"J",0,function(e,r={}){let a=e.length>2e4,c=e.slice(0,2e4).replace(/\r\n?/g,"\n").split("\n").map(e=>e.replace(t,"").replace(/[\s ]+$/,"")),x=c.map(e=>e?n(e):null),w=c.length;for(let e=0;e<c.length;e++)if(l.test(c[e])){w=e;break}let y=[],v=[];for(let e=0;e<w;e++){let t=x[e];t&&("cn"===t.family?v:y).push({...t,line:e})}let b=new Set;for(let e=0;e<w;e++)(d.test(c[e])||x[e]?.family==="cn")&&b.add(e);let j=g(y,b);if(j.length<2){let e=g(v,new Set);e.length>=2&&(j=e)}let k=i(c.slice(0,w)),N=w<c.length?m(c.slice(w)):[],C=e=>({questions:k?[{label:null,text:k,material:null,section:null}]:[],ignored:N,detected:!1,ambiguous:e,candidateCount:e?j.length:+!!k,overflow:0,tooLong:a});if(j.length<2)return C(!1);let S=j[0].family;if(!r.forceNumbered&&function(e,t,r,a){let n=null;for(let i=t-1;i>=0;i--)if(e[i]){n=p(e[i],a[i],r)?null:e[i];break}return!(!n||s.test(n)||h.test(n))&&("paren"===r?n.length>=15||/[。?!?!::,,;;]$/.test(n):/[::]$/.test(n)&&u.test(n))}(c,j[0].line,S,x))return C(!0);let E=new Set(j.map(e=>e.line)),I=[],A=[],D=null,M=[],R=[],T=(e,t)=>{for(let r of m(e))(!s.test(r)||!(r.length<80))&&(o.test(r)||r.length>=80&&/[。!?.!?;;]/.test(r))?M.push({text:r,range:f(r)}):t?I.push(r):D&&!A.some(e=>e.section===D)?D=`${D}
10
+ ${r}`:I.push(r)},_=j[0].line,L=[];for(let e=0;e<_;e++)c[e]&&p(c[e],x[e],S)?(T(L.splice(0),!0),D=c[e],R=[]):L.push(c[e]);T(L,!0);for(let e=0;e<j.length;e++){let r=j[e].line,a=e+1<j.length?j[e+1].line:w;M.length&&(R=[...R.filter(e=>e.range),...M],M=[]);let s=a,l=null;for(let e=r+1;e<a;e++)if(c[e]&&!E.has(e)&&p(c[e],x[e],S)){s=e,l=c[e];break}let d=c.slice(r,s),h=m(d),u=[];for(;h.length>1&&o.test(h[h.length-1].slice(0,30));)u.unshift(h.pop());let g=u.length?h.join("\n"):i(d),y=j[e].value,v=R.filter(e=>!e.range||y>=e.range.from&&y<=e.range.to);for(let r of(A.push({label:j[e].label,text:function(e){let r=e.split("\n"),a=r[0]?.replace(t,"")??"",i=n(a);return i&&"cn"!==i.family&&(r[0]=a.slice(i.prefixLength)),r.join("\n")}(g),material:v.length?v.map(e=>e.text).join("\n\n"):null,section:D}),u))M.push({text:r,range:f(r)});null!==l&&(D=l,R=[],T(c.slice(s+1,a),!1))}let $=A.slice(60);return{questions:A.slice(0,60),ignored:[...I,...N,...$.map(e=>{var t;let r,a;return r=(t=e).text.trim(),(a=t.material?.trim())?`${a}
11
+
12
+ ${r}`:r})],detected:!0,ambiguous:!1,candidateCount:A.length,overflow:$.length,tooLong:a}}],825624);var x=e.i(41931),w=e.i(116331);async function y(e){let t;for(let r=0;r<3;r++)try{return await e()}catch(e){if(t=e,!function(e){let t=e?.status;return void 0===t||408===t||502===t||503===t||504===t}(e)||2===r)break;await new Promise(e=>setTimeout(e,1e3*(r+1)))}throw t}async function v(e,t=(0,w.c)()){let{batch:r}=await y(()=>x.k.post("/api/import-batches",{...e,clientRequestId:t,subjectId:e.subjectId||void 0,targetSubjectId:e.targetSubjectId||void 0,paperLevel:e.paperLevel||void 0},{timeout:12e4}));return(0,w.P)(),r}async function b(e,t={}){let r=t.image?"?include=image":"",{batch:a}=await x.k.get(`/api/import-batches/${encodeURIComponent(e)}${r}`);return a}async function j(e,t,r){let{batch:a}=await x.k.patch(`/api/import-batches/${encodeURIComponent(e)}`,{version:t,draft:r});return a}async function k(e,t,r){let{batch:a}=await y(()=>x.k.post(`/api/import-batches/${encodeURIComponent(e)}/start`,{version:t,images:r},{timeout:12e4}));return(0,w.P)(),a}async function N(e){let{batch:t}=await x.k.post(`/api/import-batches/${encodeURIComponent(e)}/retry`,{});return(0,w.P)(),t}async function C(e){let t=await x.k.post(`/api/import-batches/${encodeURIComponent(e)}/confirm-all`,{});return(0,w.P)(),t}async function S(e){await x.k.delete(`/api/import-batches/${encodeURIComponent(e)}`),(0,w.P)()}async function E(e){await x.k.post(`/api/import-batches/${encodeURIComponent(e)}/read`,{}),(0,w.P)()}async function I(){try{return!!(await x.k.get("/api/user")).confirmBeforeImport}catch{return!1}}async function A(e,t){let r=await x.k.post("/api/error-items",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis,wrongAnswerText:e.wrongAnswerText||null,mistakeAnalysis:e.mistakeAnalysis||null,mistakeStatus:e.mistakeStatus||"unknown",knowledgePoints:e.knowledgePoints||[],difficultyStars:e.difficultyStars??null,recognizedGradeSemester:e.gradeSemester??null,hasFigure:e.hasFigure??!1,figureSvg:e.figureSvg??null,subjectId:t.subjectId||void 0,subjectName:t.subjectId?void 0:e.subject,originalImageUrl:t.imageUrl||"",paperLevel:t.paperLevel||void 0});return{id:r.id,shortId:r.shortId??null,subjectId:r.subjectId??null,notebookName:r.subject?.name??null,duplicate:r.duplicate}}e.s(["J",0,C,"n",0,function(e){return e?.status===409?e.data?.details?.batch??null:null},"v",0,v,"o",0,S,"w",0,b,"f",0,E,"s",0,N,"S",0,j,"g",0,k],575557),e.i(201276),e.s(["x",0,I,"a",0,A],364002)}])})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,981140,e=>{var t=Object.defineProperty,r=(e,r)=>t(e,"name",{value:r,configurable:!0}),n=!!("u">typeof window&&window.document&&window.document.createElement);function o(e,t,{checkForDefaultPrevented:n=!0}={}){return r(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function i(e){if(!n)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function a(e){return"IFRAME"===e.tagName}r(o,"composeEventHandlers"),r(function(e){if(!n)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),r(i,"getOwnerDocument"),r(function e(t,r=!1){let{activeElement:n}=i(t);if(!n?.nodeName)return null;if(a(n)&&n.contentDocument)return e(n.contentDocument.body,r);if(r){let e=n.getAttribute("aria-activedescendant");if(e){let t=i(n).getElementById(e);if(t)return t}}return n},"getActiveElement"),r(a,"isFrame"),e.s(["f",0,o])},705844,e=>{e.s(["f",0,!1])},30030,e=>{var t=e.i(271645),r=e.i(843476),n=Object.defineProperty,o=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,n=[]){let u=[];function s(n,i){let a=t.createContext(i);a.displayName=n+"Context";let s=u.length;u=[...u,i];let l=o(n=>{let{scope:o,children:i,...u}=n,l=o?.[e]?.[s]||a,c=t.useMemo(()=>u,Object.values(u));return(0,r.jsx)(l.Provider,{value:c,children:i})},"Provider");function c(r,o,u={}){let{optional:l=!1}=u,f=o?.[e]?.[s]||a,d=t.useContext(f);if(d)return d;if(void 0!==i)return i;if(!l)throw Error(`\`${r}\` must be used within \`${n}\``)}return l.displayName=n+"Provider",o(c,"useContext"),[l,c]}o(s,"createContext");let l=o(()=>{let r=u.map(e=>t.createContext(e));return o(function(n){let o=n?.[e]||r;return t.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])},"useScope")},"createScope");return l.scopeName=e,[s,a(l,...n)]}function a(...e){let r=e[0];if(1===e.length)return r;let n=o(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return o(function(e){let o=n.reduce((t,{useScope:r,scopeName:n})=>{let o=r(e)[`__scope${n}`];return{...t,...o}},{});return t.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=r.scopeName,n}o(function(e,n){let i=t.createContext(n);i.displayName=e+"Context";let a=o(e=>{let{children:n,...o}=e,a=t.useMemo(()=>o,Object.values(o));return(0,r.jsx)(i.Provider,{value:a,children:n})},"Provider");function u(r,o={}){let{optional:a=!1}=o,s=t.useContext(i);if(s)return s;if(void 0!==n)return n;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return a.displayName=e+"Provider",o(u,"useContext"),[a,u]},"createContext"),o(i,"createContextScope"),o(a,"composeContextScopes"),e.s(["f",0,i])},296626,e=>{var t=e.i(271645),r=e.i(934620),n=Object.defineProperty,o=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,r){return t.useReducer((e,t)=>r[e][t]??e,e)}o(i,"useStateMachine");var a=o(e=>{let{present:r,children:n}=e,o=u(r),i="function"==typeof n?n({present:o.isPresent}):t.Children.only(n),a=l(o.ref,f(i));return"function"==typeof n||o.isPresent?t.cloneElement(i,{ref:a}):null},"Presence");function u(e){let[n,a]=t.useState(),u=t.useRef(null),s=t.useRef(e),l=t.useRef("none"),f=t.useRef(void 0),[d,p]=i(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return t.useEffect(()=>{"mounted"===d?(l.current=f.current??c(u.current),f.current=void 0):l.current="none"},[d]),(0,r.f)(()=>{let t=u.current,r=s.current;if(r!==e){let n=l.current,o=c(t);e?(f.current=o,p("MOUNT")):"none"===o||t?.display==="none"?p("UNMOUNT"):r&&n!==o?p("ANIMATION_OUT"):p("UNMOUNT"),s.current=e}},[e,p]),(0,r.f)(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=o(r=>{let o=c(u.current).includes(CSS.escape(r.animationName));if(r.target===n&&o&&(p("ANIMATION_END"),!s.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},"handleAnimationEnd"),i=o(e=>{e.target===n&&(l.current=c(u.current))},"handleAnimationStart");return n.addEventListener("animationstart",i),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",i),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}p("ANIMATION_END")},[n,p]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:t.useCallback(e=>{if(e){let t=getComputedStyle(e);u.current=t,f.current=c(t)}else u.current=null;a(e)},[])}}function s(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function l(...e){let r=t.useRef(e);return r.current=e,t.useCallback(e=>{let t=r.current,n=!1,o=t.map(t=>{let r=s(t,e);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let e=0;e<o.length;e++){let r=o[e];"function"==typeof r?r():s(t[e],null)}}},[])}function c(e){return e?.animationName||"none"}function f(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}o(u,"usePresence"),o(s,"setRef"),o(l,"useStableComposedRefs"),o(c,"getAnimationName"),o(f,"getElementRef"),e.s(["f",0,a])},248425,e=>{var t=e.i(271645),r=e.i(174080),n=e.i(991918),o=e.i(843476),i=Object.defineProperty,a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let i=(0,n.B)(`Primitive.${r}`),a=t.forwardRef((e,t)=>{let{asChild:n,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(n?i:r,{...a,ref:t})});return a.displayName=`Primitive.${r}`,{...e,[r]:a}},{});function u(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}i(u,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),e.s(["V",0,a,"u",0,u])},369340,e=>{var t=e.i(271645),r=e.i(705844),n=e.i(934620),o=Object.defineProperty,i=t[" useEffectEvent ".trim().toString()],a=t[" useInsertionEffect ".trim().toString()];function u(e){if("function"==typeof i)return i(e);let r=t.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof a?a(()=>{r.current=e}):(0,n.f)(()=>{r.current=e}),t.useMemo(()=>(...e)=>r.current?.(...e),[])}o(u,"name",{value:"useEffectEvent",configurable:!0});var s=Object.defineProperty,l=(e,t)=>s(e,"name",{value:t,configurable:!0}),c=t[" useInsertionEffect ".trim().toString()]||n.f;function f({prop:e,defaultProp:n,onChange:o=l(()=>{},"onChange"),caller:i}){let[a,u,s]=d({defaultProp:n,onChange:o}),c=void 0!==e,m=c?e:a;if(r.f){let r=t.useRef(void 0!==e);t.useEffect(()=>{let e=r.current;if(e!==c){let t=c?"controlled":"uncontrolled";console.warn(`${i} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}r.current=c},[c,i])}return[m,t.useCallback(t=>{if(c){let r=p(t)?t(e):t;r!==e&&s.current?.(r)}else u(t)},[c,e,u,s])]}function d({defaultProp:e,onChange:r}){let[n,o]=t.useState(e),i=t.useRef(n),a=t.useRef(r);return c(()=>{a.current=r},[r]),t.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,o,a]}function p(e){return"function"==typeof e}l(f,"useControllableState"),l(d,"useUncontrolledState"),l(p,"isFunction");var m=Symbol("RADIX:SYNC_STATE");l(function(e,n,o,i){let{prop:a,defaultProp:s,onChange:l,caller:c}=n,f=void 0!==a,d=u(l);if(r.f){let e=t.useRef(void 0!==a);t.useEffect(()=>{let t=e.current;if(t!==f){let e=f?"controlled":"uncontrolled";console.warn(`${c} is changing from ${t?"controlled":"uncontrolled"} to ${e}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}e.current=f},[f,c])}let p=[{...o,state:s}];i&&p.push(i);let[h,g]=t.useReducer((t,r)=>{if(r.type===m)return{...t,state:r.state};let n=e(t,r);return f&&!Object.is(n.state,t.state)&&d(n.state),n},...p),v=h.state,y=t.useRef(v);t.useEffect(()=>{y.current!==v&&(y.current=v,f||d(v))},[v,y,f]);let b=t.useMemo(()=>void 0!==a?{...h,state:a}:h,[h,a]);return t.useEffect(()=>{f&&!Object.is(a,h.state)&&g({type:m,state:a})},[a,h.state,f]),[b,g]},"useControllableStateReducer"),e.s(["f",0,f],369340)},934620,e=>{var t=e.i(271645),r=globalThis?.document?t.useLayoutEffect:()=>{};e.s(["f",0,r])},635804,e=>{var t=e.i(271645),r=e.i(934620);function n(e){let[n,o]=t.useState(void 0);return(0,r.f)(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let n=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if("borderBoxSize"in n){let e=n.borderBoxSize,o=Array.isArray(e)?e[0]:e;t=o.inlineSize,r=o.blockSize}else t=e.offsetWidth,r=e.offsetHeight;o({width:t,height:r})})});return r.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}o(void 0)},[e]),n}(0,Object.defineProperty)(n,"name",{value:"useSize",configurable:!0}),e.s(["f",0,n])},689664,e=>{var t=e.i(456420);let r={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],689664)},716327,456539,e=>{var t=e.i(456420);let r={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],716327);let o={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};o.node;let i=(0,t.f)(o);e.s(["f",0,i],456539)},632781,e=>{var t=e.i(456420);let r={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],632781)},741120,e=>{var t=e.i(456420);let r={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],741120)},759659,e=>{var t=e.i(456420);let r={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],759659)},263676,e=>{var t=e.i(456420);let r={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};r.node;let n=(0,t.f)(r);e.s(["X",0,n],263676)},522016,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return v},useLinkStatus:function(){return b}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(190809),a=e.r(843476),u=i._(e.r(271645)),s=e.r(195057),l=e.r(8372),c=e.r(818581),f=e.r(718967),d=e.r(405550),p=e.r(388540),m=e.r(91949),h=e.r(573668),g=e.r(509396);function v(t){var r;let n,o,i,[v,b]=(0,u.useOptimistic)(m.IDLE_LINK_STATUS),w=(0,u.useRef)(null),{href:E,as:x,children:S,prefetch:N=null,passHref:P,replace:C,shallow:O,scroll:T,onClick:M,onMouseEnter:j,onTouchStart:R,legacyBehavior:A=!1,onNavigate:_,transitionTypes:k,ref:I,unstable_dynamicOnHover:D,...$}=t;n=S,A&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let L=u.default.useContext(l.AppRouterContext),U=!1!==N,z=!1===N?"none":!0===N?"full":"auto",F="none"!==z?"auto"===z?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,B="string"==typeof(r=x||E)?r:(0,s.formatUrl)(r);if(A){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");o=u.default.Children.only(n)}let V=A?o&&"object"==typeof o&&o.ref:I,W,q=u.default.useCallback(e=>(null!==L&&(w.current=(0,m.mountLinkInstance)(e,B,L,F,U,b,W)),()=>{w.current&&((0,m.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,m.unmountPrefetchableInstance)(e)}),[U,B,L,F,b,W]),K={ref:(0,c.useMergedRef)(q,V),onClick(t){A||"function"!=typeof M||M(t),A&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!L||t.defaultPrevented||function(t,r,n,o,i,a,u,s="none"){if("u">typeof window){let l,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((l=t.currentTarget.getAttribute("target"))&&"_self"!==l||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),a){let e=!1;if(a({preventDefault:()=>{e=!0}}),e)return}let{navigate:f}=e.r(132916);f(r,o?"replace":"push",!1===i?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,u,s)}}(t,B,w,C,T,_,k,z)},onMouseEnter(e){A||"function"!=typeof j||j(e),A&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),L&&U&&(0,m.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){A||"function"!=typeof R||R(e),A&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),L&&U&&(0,m.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,f.isAbsoluteUrl)(B)?K.href=B:A&&!P&&("a"!==o.type||"href"in o.props)||(K.href=(0,d.addBasePath)(B)),i=A?u.default.cloneElement(o,K):(0,a.jsx)("a",{...$,...K,children:n}),(0,a.jsx)(y.Provider,{value:v,children:i})}let y=(0,u.createContext)(m.IDLE_LINK_STATUS),b=()=>(0,u.useContext)(y);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},818581,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(271645);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=i(e,n)),t&&(o.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},195057,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return u},formatWithValidation:function(){return l},urlObjectKeys:function(){return s}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(190809)._(e.r(998183)),a=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",u=e.hash||"",s=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:r&&(l=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(l+=":"+e.port)),s&&"object"==typeof s&&(s=String(i.urlQueryToSearchParams(s)));let c=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==l?(l="//"+(l||""),o&&"/"!==o[0]&&(o="/"+o)):l||(l=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${l}${o}${c}${u}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return u(e)}},573668,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(718967),o=e.r(652817);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},718967,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return E},MissingStaticPage:function(){return w},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return h},ST:function(){return g},WEB_VITALS:function(){return i},execOnce:function(){return a},getDisplayName:function(){return f},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return s},isResSent:function(){return d},loadGetInitialProps:function(){return m},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return x}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=["CLS","FCP","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let u=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&u.test(e)};function l(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function f(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function m(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await m(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Error(`"${f(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let h="u">typeof performance,g=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class w extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class E extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function x(e){return JSON.stringify({message:e.message,stack:e.stack})}},487486,e=>{var t=e.i(843476),r=e.i(991918),n=e.i(225913),o=e.i(975157);let i=(0,n.f)("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});e.s(["f",0,function({className:e,variant:n,asChild:a=!1,...u}){let s=a?r.M:"span";return(0,t.jsx)(s,{"data-slot":"badge",className:(0,o.f)(i({variant:n}),e),...u})}])},515288,e=>{var t=e.i(843476),r=e.i(975157);e.s(["N",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,r.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...n})},"O",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.f)("px-6",e),...n})},"u",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.f)("text-muted-foreground text-sm",e),...n})},"Y",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.f)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...n})},"v",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.f)("leading-none font-semibold",e),...n})}])},793479,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({className:e,type:n,...o}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.f)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}])},215519,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(306831);let o=(0,r.createContext)({timeZone:n.J,setTimeZone:()=>void 0});e.s(["n",0,function({children:e,initialTimeZone:i=n.J}){let[a,u]=(0,r.useState)(i);return(0,t.jsx)(o.Provider,{value:{timeZone:a,setTimeZone:u},children:e})},"M",0,function(){return(0,r.useContext)(o)}])},41931,294114,e=>{let t={success:2500,info:3500,warning:4500,error:5e3},r={toasts:[],confirm:null},n=1,o=new Set;function i(e){r=e,o.forEach(e=>e(r))}function a(e){i({...r,toasts:r.toasts.filter(t=>t.id!==e)})}function u(e,o){let u="string"==typeof o?o:String(o??"");if(!u)return;let s=n++;i({...r,toasts:[...r.toasts.slice(-3),{id:s,type:e,message:u}]}),setTimeout(()=>a(s),t[e])}let s={success:e=>u("success",e),error:e=>u("error",e),info:e=>u("info",e),warning:e=>u("warning",e)};e.s(["u",0,function(e,t={}){return 0===o.size?Promise.resolve("function"==typeof window.confirm&&window.confirm(e)):(r.confirm?.resolve(!1),new Promise(o=>{let a=n++;i({...r,confirm:{...t,id:a,message:e,resolve:e=>{r.confirm?.id===a&&i({...r,confirm:null}),o(e)}}})}))},"p",0,a,"M",0,function(e){return o.add(e),e(r),()=>{o.delete(e)}},"c",0,s],294114);var l=e.i(869253);class c extends Error{status;statusText;data;constructor(e,t,r){super(`API Error: ${e} ${t}`),this.status=e,this.statusText=t,this.data=r,this.name="ApiError"}}function f(e){if("object"!=typeof e||null===e||!("code"in e)||"AI_DAILY_LIMIT_EXCEEDED"!==e.code)return;let t="zh";try{"en"===localStorage.getItem("app-language")&&(t="en")}catch{}s.warning(l.f[t].errors.AI_DAILY_LIMIT_EXCEEDED)}let d=e=>new Promise(t=>setTimeout(t,e));async function p(e,t,r){let n=Date.now();for(;Date.now()<t;){let t=null;try{t=await m(`/api/requests/${e}`,{method:"GET",timeout:15e3})}catch(e){if(e instanceof c&&404===e.status&&Date.now()-n>6e3)throw r}if(t?.state==="done"){if(t.status>=200&&t.status<300)return t.body??{};throw 429===t.status&&f(t.body),new c(t.status,"",t.body)}await d(3e3)}throw new c(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"})}async function m(e,t={}){let r,{params:n,headers:o,timeout:i=6e4,recoverable:a,...u}=t,s=a?(r=new Uint8Array(16),crypto.getRandomValues(r),Array.from(r,e=>e.toString(16).padStart(2,"0")).join("")):null,l=Date.now(),d=e;if(n){let e=new URLSearchParams(n);d+=`?${e.toString()}`}let h=new AbortController,g=setTimeout(()=>h.abort(),i);try{let e=await fetch(d,{headers:{"Content-Type":"application/json",...s?{"X-Request-Id":s}:{},...o},signal:h.signal,...u});if(clearTimeout(g),!e.ok){let t,r=await e.text();try{t=JSON.parse(r)}catch{t=r}throw 429===e.status&&f(t),new c(e.status,e.statusText,t)}if(204===e.status)return{};try{return await e.json()}catch{return{}}}catch(e){if(clearTimeout(g),e instanceof Error&&"AbortError"===e.name)throw new c(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"});if(s&&e instanceof TypeError)return p(s,l+i,e);throw e}}e.s(["a",0,c,"k",0,{get:(e,t)=>m(e,{...t,method:"GET"}),post:(e,t,r)=>m(e,{...r,method:"POST",body:JSON.stringify(t)}),put:(e,t,r)=>m(e,{...r,method:"PUT",body:JSON.stringify(t)}),patch:(e,t,r)=>m(e,{...r,method:"PATCH",body:JSON.stringify(t)}),delete:(e,t)=>m(e,{...t,method:"DELETE"})}],41931)},303163,e=>{e.s(["L",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"details"in t)return"string"==typeof t.details&&t.details?t.details:void 0},"d",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"message"in t)return"string"==typeof t.message?t.message:void 0},"Z",0,function(e){return e instanceof Error?e.message:String(e)}])},664030,e=>{var t=e.i(271645),r=e.i(41931),n=e.i(201276);let o=null,i=0,a=new Set;e.s(["f",0,function(){let[e,u]=(0,t.useState)(o??[]),[s,l]=(0,t.useState)(!o),[c,f]=(0,t.useState)(null),d=(0,t.useCallback)(async(e=!1)=>{let t=Date.now();if(!e&&o&&t-i<3e4){u(o),l(!1);return}try{l(!0);let e=await r.k.get("/api/paper-groups");o=e,i=t,a.forEach(t=>t(e)),f(null)}catch(e){n.V.error("[usePaperGroups]","Failed to fetch paper groups",{error:e}),f("Failed to load paper groups")}finally{l(!1)}},[]);return(0,t.useEffect)(()=>(a.add(u),d(),()=>{a.delete(u)}),[d]),{groups:e,loading:s,error:c,refetch:(0,t.useCallback)(()=>(o=null,i=0,d(!0)),[d])}}])}])})();
@@ -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)},399847,e=>{var s=e.i(456420);let t={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],399847)},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)},13285,e=>{var s=e.i(456420);let t={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],13285)},505311,e=>{var s=e.i(456420);let t={name:"pen-tool",size:24,node:[["path",{d:"m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18",key:"93nyr4"}],["path",{d:"M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z",key:"lnux7s"}],["path",{d:"m3 3 6.586 6.586",key:"1igwcn"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],505311)},7219,e=>{var s=e.i(456420);let t={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],7219)},672906,e=>{var s=e.i(843476),t=e.i(271645),a=e.i(217255),i=e.i(618566),r=e.i(632781),d=e.i(456420);let l={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};l.node;let n=(0,d.f)(l);var c=e.i(519455),o=e.i(393842),m=e.i(515288),x=e.i(856423),h=e.i(505311),u=e.i(13285),b=e.i(7219),f=e.i(548161),j=e.i(474544),g=e.i(399847),p=e.i(749803);function N({data:e,t}){let a=[{title:t.admin?.dashboard?.totalUsers||"Total Users",value:e.overview.totalUsers,icon:n,color:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-950/30"},{title:t.admin?.dashboard?.totalErrors||"Total Errors",value:e.overview.totalErrorItems,icon:x.f,color:"text-red-500",bgColor:"bg-red-50 dark:bg-red-950/30"},{title:t.admin?.dashboard?.totalPractice||"Total Practice",value:e.overview.totalPracticeRecords,icon:h.f,color:"text-green-500",bgColor:"bg-green-50 dark:bg-green-950/30"},{title:t.admin?.dashboard?.totalNotebooks||"Total Notebooks",value:e.overview.totalSubjects,icon:u.f,color:"text-purple-500",bgColor:"bg-purple-50 dark:bg-purple-950/30"}];return(0,s.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:a.map(e=>(0,s.jsx)(m.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(m.O,{className:"p-4 flex items-center gap-4",children:[(0,s.jsx)("div",{className:`p-3 rounded-xl ${e.bgColor}`,children:(0,s.jsx)(e.icon,{className:`h-6 w-6 ${e.color}`})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e.title}),(0,s.jsx)("p",{className:"text-2xl font-bold",children:e.value})]})]})},e.title))})}function v({data:e,t}){let a=Math.max(...e.dailyTrend.map(e=>e.count),1);return(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(m.Y,{className:"pb-2",children:(0,s.jsxs)(m.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(b.f,{className:"h-4 w-4 text-orange-500"}),t.admin?.dashboard?.recentTrend||"Recent 7-Day Trend"]})}),(0,s.jsx)(m.O,{children:(0,s.jsx)("div",{className:"flex items-end gap-2 h-40",children:e.dailyTrend.map(e=>{let t=a>0?e.count/a*100:0,i=e.date.slice(5).replace("-","/");return(0,s.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1",children:[(0,s.jsx)("span",{className:"text-xs font-medium",children:e.count>0?e.count:""}),(0,s.jsx)("div",{className:"w-full relative",style:{height:"100px"},children:(0,s.jsx)("div",{className:"absolute bottom-0 w-full bg-gradient-to-t from-orange-500 to-orange-400 rounded-t-md transition-all duration-500 min-h-[4px]",style:{height:`${Math.max(t,4)}%`}})}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:i})]},e.date)})})})]})}function y({data:e,t}){let a=e.subjectDistribution.reduce((e,s)=>e+s.count,0),i=["bg-blue-500","bg-green-500","bg-orange-500","bg-purple-500","bg-red-500","bg-cyan-500","bg-yellow-500","bg-pink-500","bg-indigo-500"];return(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(m.Y,{className:"pb-2",children:(0,s.jsxs)(m.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(p.f,{className:"h-4 w-4 text-blue-500"}),t.admin?.dashboard?.subjectDistribution||"Subject Distribution"]})}),(0,s.jsx)(m.O,{children:0===a?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:t.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-3",children:e.subjectDistribution.map((e,t)=>{let r=a>0?Math.round(e.count/a*100):0;return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e.count," (",r,"%)"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2.5",children:(0,s.jsx)("div",{className:`h-2.5 rounded-full ${i[t%i.length]} transition-all duration-500`,style:{width:`${r}%`}})})]},e.name)})})})]})}function w({data:e,t}){let a=e.masteryDistribution.new+e.masteryDistribution.reviewing+e.masteryDistribution.mastered,i=[{key:"new",label:t.admin?.dashboard?.masteryNew||"To Review",count:e.masteryDistribution.new,icon:g.f,color:"text-red-500",bg:"bg-red-500"},{key:"reviewing",label:t.admin?.dashboard?.masteryReviewing||"Reviewing",count:e.masteryDistribution.reviewing,icon:j.f,color:"text-yellow-500",bg:"bg-yellow-500"},{key:"mastered",label:t.admin?.dashboard?.masteryMastered||"Mastered",count:e.masteryDistribution.mastered,icon:f.f,color:"text-green-500",bg:"bg-green-500"}];return(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(m.Y,{className:"pb-2",children:(0,s.jsxs)(m.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(f.f,{className:"h-4 w-4 text-green-500"}),t.admin?.dashboard?.masteryDistribution||"Mastery Distribution"]})}),(0,s.jsx)(m.O,{children:0===a?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:t.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-3",children:i.map(e=>{let t=a>0?Math.round(e.count/a*100):0;return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm items-center",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-medium",children:[(0,s.jsx)(e.icon,{className:`h-4 w-4 ${e.color}`}),e.label]}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e.count," (",t,"%)"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2.5",children:(0,s.jsx)("div",{className:`h-2.5 rounded-full ${e.bg} transition-all duration-500`,style:{width:`${t}%`}})})]},e.key)})})})]})}var k=e.i(716327),D=e.i(456539),A=e.i(772382),M=e.i(487486),C=e.i(111110),z=e.i(215519),T=e.i(306831);function R({users:e,onViewDetail:a}){let{timeZone:i}=(0,z.M)(),{t:r}=(0,C.b)(),[d,l]=(0,t.useState)(null);return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"hidden md:block border rounded-lg overflow-hidden",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-muted/50",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"text-left p-3 font-medium",children:r.admin?.dashboard?.userName||"Username"}),(0,s.jsx)("th",{className:"text-left p-3 font-medium",children:r.admin?.dashboard?.email||"Email"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.notebooks||"Notebooks"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.errors||"Errors"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.practice||"Practice"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.status||"Status"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.registeredAt||"Registered At"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.actions||"Actions"})]})}),(0,s.jsx)("tbody",{children:e.map(e=>(0,s.jsxs)("tr",{className:"border-t hover:bg-muted/30 transition-colors",children:[(0,s.jsx)("td",{className:"p-3",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name||"N/A"}),"admin"===e.role&&(0,s.jsx)(M.f,{variant:"default",className:"text-xs",children:r.admin?.admin||"Admin"})]})}),(0,s.jsx)("td",{className:"p-3 text-muted-foreground",children:e.email}),(0,s.jsx)("td",{className:"p-3 text-center",children:e.notebookCount}),(0,s.jsx)("td",{className:"p-3 text-center font-medium",children:e.errorCount}),(0,s.jsx)("td",{className:"p-3 text-center",children:e.practiceCount}),(0,s.jsx)("td",{className:"p-3 text-center",children:(0,s.jsx)(M.f,{variant:e.isActive?"default":"destructive",className:"text-xs",children:e.isActive?r.admin?.active||"Active":r.admin?.disabled||"Disabled"})}),(0,s.jsx)("td",{className:"p-3 text-center text-muted-foreground text-xs",children:(0,T.r)(e.createdAt,"yyyy-MM-dd",i)}),(0,s.jsx)("td",{className:"p-3 text-center",children:(0,s.jsx)(c.f,{variant:"ghost",size:"sm",onClick:()=>a(e.id),title:r.admin?.dashboard?.viewDetail||"View Detail",children:(0,s.jsx)(A.f,{className:"h-4 w-4"})})})]},e.id))})]})}),(0,s.jsx)("div",{className:"md:hidden space-y-3",children:e.map(e=>(0,s.jsx)(m.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(m.O,{className:"p-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start cursor-pointer",onClick:()=>l(d===e.id?null:e.id),children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name||"N/A"}),"admin"===e.role&&(0,s.jsx)(M.f,{variant:"default",className:"text-xs",children:r.admin?.admin||"Admin"})]}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:e.email})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(M.f,{variant:e.isActive?"default":"destructive",className:"text-xs",children:e.isActive?r.admin?.active||"Active":r.admin?.disabled||"Disabled"}),d===e.id?(0,s.jsx)(D.f,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(k.f,{className:"h-4 w-4 text-muted-foreground"})]})]}),d===e.id&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t grid grid-cols-3 gap-3 text-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-lg font-bold",children:e.notebookCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:r.admin?.dashboard?.notebooks||"Notebooks"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-lg font-bold text-red-500",children:e.errorCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:r.admin?.dashboard?.errors||"Errors"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-lg font-bold text-green-500",children:e.practiceCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:r.admin?.dashboard?.practice||"Practice"})]})]}),d===e.id&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,T.r)(e.createdAt,"yyyy-MM-dd",i)}),(0,s.jsxs)(c.f,{variant:"ghost",size:"sm",onClick:()=>a(e.id),children:[(0,s.jsx)(A.f,{className:"h-4 w-4 mr-1"}),r.admin?.dashboard?.viewDetail||"View Detail"]})]})]})},e.id))})]})}var E=e.i(41931),S=e.i(201276),$=e.i(35209);e.s(["default",0,function(){let{data:e,status:d}=(0,a.useSession)(),l=(0,i.useRouter)(),{t:x}=(0,C.b)(),[h,u]=(0,t.useState)(null);(0,$.f)(x.admin.dashboard.title);let[b,f]=(0,t.useState)(!0),j=(0,t.useCallback)(async()=>{f(!0);try{let e=await E.k.get("/api/admin/dashboard");u(e)}catch(e){S.V.error("[AdminDashboard]","Failed to fetch dashboard data",{error:e})}finally{f(!1)}},[]);return((0,t.useEffect)(()=>{if("loading"!==d){if(!e?.user||"admin"!==e.user.role)return void l.push("/");j()}},[e,d,l,j]),"loading"===d||b)?(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,s.jsx)(r.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):h?(0,s.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8",children:[(0,s.jsx)(o.f,{title:x.admin?.dashboard?.title||"Admin Dashboard",description:x.admin?.dashboard?.subtitle||"View all users and error statistics"}),(0,s.jsx)(N,{data:h,t:x}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsx)(v,{data:h,t:x}),(0,s.jsx)(w,{data:h,t:x})]}),(0,s.jsx)(y,{data:h,t:x}),(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsxs)(m.Y,{className:"pb-2",children:[(0,s.jsxs)(m.v,{className:"text-lg flex items-center gap-2",children:[(0,s.jsx)(n,{className:"h-5 w-5 text-blue-500"}),x.admin?.dashboard?.userList||"User List"]}),(0,s.jsx)(m.u,{children:x.admin?.dashboard?.userListDesc||"All registered users and their error entry status"})]}),(0,s.jsx)(m.O,{children:(0,s.jsx)(R,{users:h.userStats,onViewDetail:e=>l.push(`/admin/user/${e}`)})})]})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[60vh] gap-4",children:[(0,s.jsx)("p",{className:"text-muted-foreground",children:x.common?.error||"Error"}),(0,s.jsx)(c.f,{onClick:j,children:x.admin?.dashboard?.retry||"Retry"})]})}],672906)},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 d=(0,t.useRouter)();return(0,s.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{d.push(e)},className:r,children:(0,s.jsx)(i.f,{className:"h-5 w-5"})})}])},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:d,titleAddon:l,className:n}){return(0,s.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",n),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})]}),d&&(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:d})]})}])},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])}])}])})();