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
@@ -1 +0,0 @@
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 n=(0,t.f)(r);e.s(["f",0,n],314381);var i=e.i(843476),a=e.i(271645),o=e.i(632781);let s={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"}]]};s.node;let l=(0,t.f)(s),h={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"}]]};h.node;let d=(0,t.f)(h);var c=e.i(395925),u=e.i(741120),m=e.i(759659),g=e.i(519455),p=e.i(111110),w=e.i(294114),x=e.i(201276),f=e.i(113381);let y=null;function b(e,t,r){let n=e?.firstElementChild;n&&(n.style.width="100%",n.style.height=`${r}px`,t?.setSize(e?.offsetWidth||n.offsetWidth||800,r))}function v(e,t){let r=(0,f.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:n=!1,showMenuBar:s=!1,className:h="",onRegenerate:C,onDelete:j}){let{t:k}=(0,p.b)(),D=(0,a.useRef)(null),N=(0,a.useRef)(null),R=(0,a.useRef)(void 0),M=(0,a.useId)(),E=(0,a.useRef)(`ggb-${M.replace(/[^a-zA-Z0-9_-]/g,"")}`),[S,I]=(0,a.useState)(!0),[L,P]=(0,a.useState)(null),[z,$]=(0,a.useState)(!0),[Y,X]=(0,a.useState)(!1),[_,B]=(0,a.useState)(!1),H=(0,a.useMemo)(()=>(0,f.i)(e),[e]);(0,a.useEffect)(()=>{if(0===H.length)return;let e=!1,i=E.current,a=D.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 o=window.GGBApplet;if(!o){P(k.geogebra.notLoaded),I(!1);return}if(a){a.innerHTML=`<div id="${i}" style="width:100%;height:${t}px"></div>`;try{new o({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:n,showMenuBar:s,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(N.current=r,b(a,r,t),R.current=v(r,H),I(!1))}},!0).inject(i)}catch(t){x.V.error("[GGB]","Init failed",{error:t}),e||(P(k.geogebra.initFailed),I(!1))}}}).catch(t=>{x.V.error("[GGB]","Script load failed",{error:t}),e||(P(k.geogebra.scriptFailed),I(!1))}),()=>{e=!0;try{let e=N.current;e?.remove&&e.remove()}catch(e){x.V.warn("[GGB]","Cleanup failed",{error:e})}N.current=null,a&&(a.innerHTML="")}},[H,r,n,s]),(0,a.useEffect)(()=>{b(D.current,N.current,z?700:t)},[z,t]);let A=(0,a.useCallback)(()=>{let e=N.current;if(e)try{e.resetConstruction(),setTimeout(()=>{N.current&&(R.current=v(N.current,H))},300)}catch(e){x.V.warn("[GGB]","Reset failed",{error:e})}},[H]),K=(0,a.useCallback)(async()=>{if(C&&!Y){X(!0);try{await C(R.current)}finally{X(!1)}}},[C,Y]),O=(0,a.useCallback)(async()=>{if(j&&!_&&await (0,w.u)(k.geogebra.confirmDelete,{destructive:!0})){B(!0);try{await j()}catch{w.c.error(k.geogebra.deleteFailed)}finally{B(!1)}}},[j,_,k]);return 0===H.length?null:(0,i.jsxs)("div",{className:`relative rounded-lg border bg-card ${h}`,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:k.geogebra.title}),S&&(0,i.jsx)(o.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[C&&(0,i.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:K,title:k.geogebra.regenerate,disabled:Y||S,children:[Y?(0,i.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(u.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.regenerate})]}),j&&(0,i.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:O,title:k.geogebra.delete,disabled:_||Y,children:[_?(0,i.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.delete})]}),(0,i.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:A,title:k.geogebra.reset,disabled:S,children:(0,i.jsx)(c.f,{className:"h-3.5 w-3.5"})}),(0,i.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>$(e=>!e),title:z?k.geogebra.shrink:k.geogebra.enlarge,children:z?(0,i.jsx)(d,{className:"h-3.5 w-3.5"}):(0,i.jsx)(l,{className:"h-3.5 w-3.5"})})]})]}),(0,i.jsx)("div",{ref:D,style:{width:"100%"}}),S&&(0,i.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,i.jsx)(o.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm text-muted-foreground",children:k.geogebra.loading})]})}),L&&(0,i.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:L})]})}],3198)},141176,12130,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(456420);let i={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"]};i.node;let a=(0,n.f)(i);var o=e.i(772382),s=e.i(511445),l=e.i(624687),h=e.i(111110),d=e.i(975157);e.s(["f",0,function({value:e,onChange:n,className:i,...c}){let{t:u}=(0,h.b)(),[m,g]=(0,r.useState)("source"),p=(0,r.useId)(),w=[{mode:"source",label:u.markdownEditor.source,icon:a},{mode:"preview",label:u.markdownEditor.preview,icon:o.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:w.map(({mode:e,label:r,icon:n})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,d.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(n,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(l.f,{value:e,onChange:e=>n(e.target.value),className:i,...c}):(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)(s.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176);var c=r,u={x:0,y:0,width:0,height:0,unit:"px"},m=(e,t,r)=>Math.min(Math.max(e,t),r),g=(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 p(e,t,r){return"%"===e.unit?{...u,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function w(e,t,r){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...u,...e,unit:"px"}}function x(e,t,r,n,i,a=0,o=0,s=n,l=i){let h={...e},d=Math.min(a,n),c=Math.min(o,i),u=Math.min(s,n),m=Math.min(l,i);t&&(t>1?(c=(d=o?o*t:d)/t,u=s*t):(d=(c=a?a/t:c)*t,m=l/t)),h.y<0&&(h.height=Math.max(h.height+h.y,c),h.y=0),h.x<0&&(h.width=Math.max(h.width+h.x,d),h.x=0);let g=n-(h.x+h.width);g<0&&(h.x=Math.min(h.x,n-d),h.width+=g);let p=i-(h.y+h.height);if(p<0&&(h.y=Math.min(h.y,i-c),h.height+=p),h.width<d&&(("sw"===r||"nw"==r)&&(h.x-=d-h.width),h.width=d),h.height<c&&(("nw"===r||"ne"==r)&&(h.y-=c-h.height),h.height=c),h.width>u&&(("sw"===r||"nw"==r)&&(h.x-=u-h.width),h.width=u),h.height>m&&(("nw"===r||"ne"==r)&&(h.y-=m-h.height),h.height=m),t){let e=h.width/h.height;if(e<t){let e=Math.max(h.width/t,c);("nw"===r||"ne"==r)&&(h.y-=e-h.height),h.height=e}else if(e>t){let e=Math.max(h.height*t,d);("sw"===r||"nw"==r)&&(h.x-=e-h.width),h.width=e}}return h}var f={capture:!0,passive:!1},y=0,b=class e extends c.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,c.createRef)();mediaRef=(0,c.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${y++}`;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:n,height:i}=e.getBoundingClientRect();return{x:t,y:r,width:n,height:i}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:n}=this.getBox();e&&n&&r(w(t,e,n),p(t,e,n))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,f),this.document.addEventListener("pointerup",this.onDocPointerDone,f),this.document.addEventListener("pointercancel",this.onDocPointerDone,f),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,f),this.document.removeEventListener("pointerup",this.onDocPointerDone,f),this.document.removeEventListener("pointercancel",this.onDocPointerDone,f),!1)}onCropPointerDown=e=>{let{crop:t,disabled:r}=this.props,n=this.getBox();if(!t)return;let i=w(t,n.width,n.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=e.clientX,s=e.clientY,l=i.x,h=i.y;if(a){let t=e.clientX-n.x,r=e.clientY-n.y,d=0,c=0;"ne"===a||"e"==a?(d=t-(i.x+i.width),c=r-i.y,l=i.x,h=i.y+i.height):"se"===a||"s"===a?(d=t-(i.x+i.width),c=r-(i.y+i.height),l=i.x,h=i.y):"sw"===a||"w"==a?(d=t-i.x,c=r-(i.y+i.height),l=i.x+i.width,h=i.y):("nw"===a||"n"==a)&&(d=t-i.x,c=r-i.y,l=i.x+i.width,h=i.y+i.height),o=l+n.x+d,s=h+n.y+c}this.evData={startClientX:o,startClientY:s,startCropX:l,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:r,locked:n,keepSelection:i,onChange:a}=this.props,o=this.getBox();if(r||n||i&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let s=e.clientX-o.x,l=e.clientY-o.y,h={unit:"px",x:s,y:l,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:s,startCropY:l,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(w(h,o.width,o.height),p(h,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:r,disabled:n,onChange:i,onDragStart:a}=this.props,o=this.getBox();if(n||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));let{evData:s}=this;s.clientX=e.clientX,s.clientY=e.clientY,g(r,t=s.isResize?this.resizeCrop():this.dragCrop())||i(w(t,o.width,o.height),p(t,o.width,o.height))};onComponentKeyDown=t=>{let{crop:r,disabled:n,onChange:i,onComplete:a}=this.props;if(n)return;let o=t.key,s=!1;if(!r)return;let l=this.getBox(),h=this.makePixelCrop(l),d=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===o?(h.x-=d,s=!0):"ArrowRight"===o?(h.x+=d,s=!0):"ArrowUp"===o?(h.y-=d,s=!0):"ArrowDown"===o&&(h.y+=d,s=!0),s){t.cancelable&&t.preventDefault(),h.x=m(h.x,0,l.width-h.width),h.y=m(h.y,0,l.height-h.height);let e=w(h,l.width,l.height),r=p(h,l.width,l.height);i(e,r),a&&a(e,r)}};onHandlerKeyDown=(t,r)=>{var n,i;let a,{aspect:o=0,crop:s,disabled:l,minWidth:h=0,minHeight:d=0,maxWidth:c,maxHeight:u,onChange:m,onComplete:f}=this.props,y=this.getBox();if(l||!s||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=x((n=w(s,y.width,y.height),i=t.key,a={...n},"ArrowLeft"===i?"nw"===r?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"w"===r?(a.x-=b,a.width+=b):"sw"===r?(a.x-=b,a.width+=b,a.height+=b):"ne"===r?(a.y+=b,a.width-=b,a.height-=b):"e"===r?a.width-=b:"se"===r&&(a.width-=b,a.height-=b):"ArrowRight"===i&&("nw"===r?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"w"===r?(a.x+=b,a.width-=b):"sw"===r?(a.x+=b,a.width-=b,a.height-=b):"ne"===r?(a.y-=b,a.width+=b,a.height+=b):"e"===r?a.width+=b:"se"===r&&(a.width+=b,a.height+=b)),"ArrowUp"===i?"nw"===r?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"n"===r?(a.y-=b,a.height+=b):"ne"===r?(a.y-=b,a.width+=b,a.height+=b):"sw"===r?(a.x+=b,a.width-=b,a.height-=b):"s"===r?a.height-=b:"se"===r&&(a.width-=b,a.height-=b):"ArrowDown"===i&&("nw"===r?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"n"===r?(a.y+=b,a.height-=b):"ne"===r?(a.y+=b,a.width-=b,a.height-=b):"sw"===r?(a.x-=b,a.width+=b,a.height+=b):"s"===r?a.height+=b:"se"===r&&(a.width+=b,a.height+=b)),a),o,r,y.width,y.height,h,d,c,u);if(!g(s,v)){let e=p(v,y.width,y.height);m(v,e),f&&f(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:r,onComplete:n,onDragEnd:i}=this.props,a=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),n&&n(w(t,a.width,a.height),p(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),n=e.clientX-e.startClientX,i=e.clientY-e.startClientY;return r.x=m(e.startCropX+n,0,t.width-r.width),r.y=m(e.startCropY+i,0,t.height-r.height),r}getPointRegion(e,t,r,n){let{evData:i}=this,a=i.clientX-e.x,o=i.clientY-e.y,s;return s=n&&t?"nw"===t||"n"===t||"ne"===t:o<i.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:a<i.startCropX)?s?"nw":"sw":s?"ne":"se"}resolveMinDimensions(e,t,r=0,n=0){let i=Math.min(r,e.width),a=Math.min(n,e.height);return t&&(i||a)?t>1?i?[i,i/t]:[a*t,a]:a?[a*t,a]:[i,i/t]:[i,a]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:n,maxHeight:i}=this.props,a=this.getBox(),[o,s]=this.resolveMinDimensions(a,r,this.props.minWidth,this.props.minHeight),l=this.makePixelCrop(a),h=this.getPointRegion(a,t.ord,o,s),d=t.ord||h,c=t.clientX-t.startClientX,u=t.clientY-t.startClientY;(o&&"nw"===d||"w"===d||"sw"===d)&&(c=Math.min(c,-o)),(s&&"nw"===d||"n"===d||"ne"===d)&&(u=Math.min(u,-s));let g={unit:"px",x:0,y:0,width:0,height:0};"ne"===h?(g.x=t.startCropX,g.width=c,r?g.height=g.width/r:g.height=Math.abs(u),g.y=t.startCropY-g.height):"se"===h?(g.x=t.startCropX,g.y=t.startCropY,g.width=c,r?g.height=g.width/r:g.height=u):"sw"===h?(g.x=t.startCropX+c,g.y=t.startCropY,g.width=Math.abs(c),r?g.height=g.width/r:g.height=u):"nw"===h&&(g.x=t.startCropX+c,g.width=Math.abs(c),r?(g.height=g.width/r,g.y=t.startCropY-g.height):(g.height=Math.abs(u),g.y=t.startCropY+u));let p=x(g,r,h,a.width,a.height,o,s,n,i);return r||e.xyOrds.indexOf(d)>-1?l=p:e.xOrds.indexOf(d)>-1?(l.x=p.x,l.width=p.width):e.yOrds.indexOf(d)>-1&&(l.y=p.y,l.height=p.height),l.x=m(l.x,0,a.width-l.width),l.y=m(l.y,0,a.height-l.height),l}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:n,renderSelectionAddon:i,ruleOfThirds:a,crop:o}=this.props,s=this.getCropStyle();if(o)return c.default.createElement("div",{style:s,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!n&&c.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},c.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),c.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),c.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),c.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),i&&c.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},i(this.state)),a&&c.default.createElement(c.default.Fragment,null,c.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),c.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return w({...u,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:n,crop:i,disabled:a,locked:o,style:s,ruleOfThirds:l}=this.props,{cropIsActive:h,newCropIsBeingDrawn:d}=this.state,u=i?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",n,h&&"ReactCrop--active",a&&"ReactCrop--disabled",o&&"ReactCrop--locked",d&&"ReactCrop--new-crop",i&&e&&"ReactCrop--fixed-aspect",i&&r&&"ReactCrop--circular-crop",i&&l&&"ReactCrop--rule-of-thirds",!this.dragStarted&&i&&!i.width&&!i.height&&"ReactCrop--invisible-crop",r&&"ReactCrop--no-animate");return c.default.createElement("div",{ref:this.componentRef,className:m,style:s},c.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),i?c.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},c.default.createElement("defs",null,c.default.createElement("mask",{id:`hole-${this.instanceId}`},c.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),r?c.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"}):c.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"}))),c.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}},v=e.i(519455),C=e.i(776639),j=e.i(263676);async function k(e,t){let{naturalWidth:r,naturalHeight:n}=e;return Promise.all(t.map(t=>new Promise((i,a)=>{let o=document.createElement("canvas"),s=Math.round(t.x*r),l=Math.round(t.y*n);o.width=Math.max(1,Math.round(t.width*r)),o.height=Math.max(1,Math.round(t.height*n));let h=o.getContext("2d");h?(h.drawImage(e,s,l,o.width,o.height,0,0,o.width,o.height),o.toBlob(e=>e?i(e):a(Error("Canvas is empty")),"image/jpeg",.95)):a(Error("Canvas is not supported"))})))}let D={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},N=(0,r.forwardRef)(function({imageSrc:e,regions:n,onChange:i,imageStyle:a=D,onImageLoad:o},s){let{t:l}=(0,h.b)(),d=(0,r.useRef)(null),c=(0,r.useRef)(null),[u,m]=(0,r.useState)(null),g=e=>{let t=d.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},p=()=>{u&&u.width>=.02&&u.height>=.02&&i([...n,u]),c.current=null,m(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:s,src:e,alt:"",draggable:!1,style:a,onLoad:o,className:"block"}),(0,t.jsxs)("div",{ref:d,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(d.current?.setPointerCapture(e.pointerId),c.current=g(e),m(null))},onPointerMove:e=>{var t,r,n,i;let a,o,s;if(!c.current)return;let l=g(e);m((t=c.current.x,r=c.current.y,n=l.x,i=l.y,o=(a=e=>Math.min(1,Math.max(0,e)))(Math.min(t,n)),s=a(Math.min(r,i)),{x:o,y:s,width:a(Math.max(t,n))-o,height:a(Math.max(r,i))-s}))},onPointerUp:p,onPointerCancel:p,children:[n.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":l.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>i(n.filter((e,t)=>t!==r)),children:(0,t.jsx)(j.X,{className:"h-3 w-3"})})]},r)),u&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:w(u)})]})]})}),R={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"}]]};R.node;let M=(0,n.f)(R),E={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"}]]};E.node;let S=(0,n.f)(E);function I({zoom:e,onZoomIn:r,onZoomOut:n,onReset:i}){let{t:a}=(0,h.b)(),o="outline-none focus-visible:ring-2 focus-visible:ring-white/70",s=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${o}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:s,onClick:n,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(S,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${o}`,onClick:i,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:s,onClick:r,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(M,{className:"h-4 w-4"})})]})}var L=e.i(201276);let P={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}};e.s(["f",0,function({imageSrc:e,open:n,onClose:i,onCropComplete:a,onMultiCropComplete:o}){let{t:s}=(0,h.b)(),l=/^(blob:|data:image\/)/i.test(e)?e:void 0,[d,c]=(0,r.useState)(),u=(0,r.useRef)(null),[m,g]=(0,r.useState)("single"),{containerRef:p,zoom:w,imageStyle:x,measureImage:f,zoomIn:y,zoomOut:j,reset:D}=function(e){let[t,n]=(0,r.useState)(null),i=(0,r.useRef)(null),a=(0,r.useCallback)(e=>{i.current=e,n(e)},[]),[o,s]=(0,r.useState)(1),l=(0,r.useRef)(1),[h,d]=(0,r.useState)(null),c=(0,r.useRef)(null),u=(0,r.useRef)(!1),m=(0,r.useCallback)((e,t,r)=>{let n=i.current,a=l.current,o=Math.min(5,Math.max(1,e));if(!n||o===a)return;if(1===a){let e=n.querySelector("img");e&&d(e.clientWidth)}let h=n.getBoundingClientRect(),u=(t??h.left+h.width/2)-h.left,m=(r??h.top+h.height/2)-h.top;c.current={viewX:u,viewY:m,contentX:n.scrollLeft+u,contentY:n.scrollTop+m,ratio:o/a},l.current=o,s(o)},[]);(0,r.useLayoutEffect)(()=>{let e=i.current,t=c.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,c.current=null)},[o]),(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,n=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}},i=e=>{2===e.touches.length&&(r={distance:n(e.touches).distance,zoom:l.current},u.current=!0)},a=e=>{if(!r||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:i,centerY:a}=n(e.touches);r.distance>0&&m(r.zoom*(t/r.distance),i,a)},o=e=>{e.touches.length<2&&(r=null,u.current=!1)},s=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",s,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",i),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",s,{capture:!0})}},[t,m]);let g=(0,r.useCallback)(e=>{e&&1===l.current&&d(e.clientWidth)},[]),p=(0,r.useCallback)(()=>m(1.25*l.current),[m]),w=(0,r.useCallback)(()=>m(l.current/1.25),[m]),x=(0,r.useCallback)(()=>{l.current=1,c.current=null,s(1)},[]),f=1!==o&&h?{...e,width:h*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,zoom:o,imageStyle:f,measureImage:g,zoomIn:p,zoomOut:w,reset:x}}(P[m]);(0,r.useEffect)(()=>{D()},[e,D]);let[R,M]=(0,r.useState)({src:e,regions:[]}),E=R.src===e?R.regions:[],S=t=>M({src:e,regions:t}),z=(0,r.useRef)(null),$=async()=>{if(z.current&&0!==E.length&&o)try{o(await k(z.current,E)),S([])}catch(e){L.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}},Y=async()=>{if(!u.current)return;let e=d&&d.width>0&&d.height>0?{x:d.x/100,y:d.y/100,width:d.width/100,height:d.height/100}:{x:0,y:0,width:1,height:1};try{let[t]=await k(u.current,[e]);a(t)}catch(e){L.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(C.N,{open:n,onOpenChange:e=>!e&&i(),children:(0,t.jsxs)(C.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(C.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(C.F,{children:s.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:p,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===m?(0,t.jsx)(N,{ref:z,imageSrc:l,regions:E,onChange:S,imageStyle:x,onImageLoad:e=>f(e.currentTarget)}):(0,t.jsx)(b,{crop:d,onChange:(e,t)=>c(t),children:(0,t.jsx)("img",{ref:u,alt:"Crop me",src:l,onLoad:function(e){c({unit:"%",x:0,y:0,width:100,height:100}),f(e.currentTarget)},style:x})})})}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(I,{zoom:w,onZoomIn:y,onZoomOut:j,onReset:D})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[o&&(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:w-80",children:["single","multi"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{D(),g(e)},className:`rounded px-3 py-1.5 text-sm font-medium transition-colors ${m===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:"single"===e?s.batchImport.singleMode:s.batchImport.multiMode},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"===m?`${s.batchImport.hint} ${s.batchImport.regionCount.replace("{count}",String(E.length))}`:s.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===m&&E.length>0&&(0,t.jsx)(v.f,{variant:"ghost",onClick:()=>S([]),children:s.batchImport.clear}),(0,t.jsx)(v.f,{variant:"outline",onClick:i,children:s.common.cancel||"Cancel"}),"multi"===m?(0,t.jsx)(v.f,{onClick:$,disabled:0===E.length,children:s.batchImport.start.replace("{count}",String(E.length))}):(0,t.jsx)(v.f,{onClick:Y,children:s.common.confirm||"Confirm"})]})]})]})]})})}],12130)},438465,674166,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(967489),i=e.i(856423),a=e.i(41931),o=e.i(201276),s=e.i(111110);e.s(["f",0,function({value:e,onChange:l,className:h}){let[d,c]=(0,r.useState)([]),{t:u}=(0,s.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await a.k.get("/api/notebooks");c(e)}catch(e){o.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(n.d,{value:e,onValueChange:l,children:[(0,t.jsx)(n.P,{className:h,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(n.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(n.r,{children:0===d.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):d.map(e=>(0,t.jsx)(n.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:i}){let{groups:a,loading:o}=(0,l.f)(),s=a.filter(e=>e.isActive);return(0,t.jsxs)(n.d,{value:e,onValueChange:r,disabled:i||o,children:[(0,t.jsx)(n.P,{children:(0,t.jsx)(n.U,{placeholder:"选择卷别"})}),(0,t.jsx)(n.r,{children:s.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}],674166)},28928,e=>{var t=e.i(201276);async function r(e,n=1,i=1920,a=.8){return new Promise((r,o)=>{let s=new FileReader;s.onload=s=>{let l=new Image;l.onload=()=>{let s=document.createElement("canvas"),h=s.getContext("2d");if(!h)return void o(Error("无法获取 Canvas 上下文"));let d=l.width,c=l.height;d>i&&(c=c*i/d,d=i),s.width=d,s.height=c,h.drawImage(l,0,0,d,c);let u=a,m=s.toDataURL("image/jpeg",u),g=3*m.length/4/1024/1024;for(;g>n&&u>.1;){u-=.1;let e=3*(m=s.toDataURL("image/jpeg",u)).length/4/1024/1024;if(t.V.info("[ImageCompress]","Compression step",{quality:Number(u.toFixed(1)),sizeMB:Number(e.toFixed(2))},{sendToBackend:!1}),e<=n)break}t.V.info("[ImageCompress]","Compression finished",{originalMB:Number((e.size/1024/1024).toFixed(2)),compressedMB:Number((3*m.length/4/1024/1024).toFixed(2))}),r(m)},l.onerror=()=>o(Error("图片加载失败")),l.src=s.target?.result},s.onerror=()=>o(Error("文件读取失败")),s.readAsDataURL(e)})}async function n(e){let n=e.size/1024/1024;return(t.V.info("[ImageCompress]","File size checked",{sizeMB:Number(n.toFixed(2))},{sendToBackend:!1}),n>1)?(t.V.info("[ImageCompress]","File exceeds threshold, compressing",void 0,{sendToBackend:!1}),await r(e,1)):(t.V.info("[ImageCompress]","File size OK, no compression needed",void 0,{sendToBackend:!1}),new Promise((t,r)=>{let n=new FileReader;n.onload=()=>t(n.result),n.onerror=r,n.readAsDataURL(e)}))}e.s(["f",0,n])}])})();
@@ -1 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var s=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 t=(0,s.f)(a);e.s(["f",0,t],711241)},399847,e=>{var s=e.i(456420);let a={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"]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],399847)},474544,e=>{var s=e.i(456420);let a={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],474544)},505311,13285,e=>{var s=e.i(456420);let a={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"}]]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],505311);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 i=(0,s.f)(r);e.s(["f",0,i],13285)},945514,e=>{var s=e.i(843476),a=e.i(271645),t=e.i(217255),r=e.i(618566),i=e.i(111110),d=e.i(35209),l=e.i(215519),n=e.i(306831),c=e.i(41931),m=e.i(201276),o=e.i(632781),x=e.i(711241),h=e.i(901279),u=e.i(856423),f=e.i(505311),b=e.i(13285),j=e.i(456420);let N={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]};N.node;let y=(0,j.f)(N),p={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};p.node;let g=(0,j.f)(p);var v=e.i(548161),w=e.i(474544),k=e.i(399847),D=e.i(772382),M=e.i(519455),z=e.i(515288),A=e.i(487486);e.s(["default",0,function(){let{timeZone:e}=(0,l.M)(),{data:j,status:N}=(0,t.useSession)(),p=(0,r.useRouter)(),C=(0,r.useParams)(),{t:R}=(0,i.b)(),[O,T]=(0,a.useState)(null);(0,d.f)(R.admin.dashboard.title,O?.user.name||O?.user.email);let[S,E]=(0,a.useState)(!0),q=C.id,P=(0,a.useCallback)(async()=>{E(!0);try{let e=await c.k.get(`/api/admin/users/${q}/detail`);T(e)}catch(e){m.V.error("[AdminUserDetail]","Failed to fetch user detail",{error:e})}finally{E(!1)}},[q]);if((0,a.useEffect)(()=>{if("loading"!==N){if(!j?.user||"admin"!==j.user.role)return void p.push("/");P()}},[j,N,p,P]),"loading"===N||S)return(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,s.jsx)(o.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!O)return(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:R.common?.error||"Error"}),(0,s.jsx)(M.f,{onClick:P,children:R.admin?.dashboard?.retry||"Retry"})]});let Y=[{key:"new",label:R.admin?.dashboard?.masteryNew||"To Review",count:O.masteryDistribution.new,icon:k.f,color:"text-red-500"},{key:"reviewing",label:R.admin?.dashboard?.masteryReviewing||"Reviewing",count:O.masteryDistribution.reviewing,icon:w.f,color:"text-yellow-500"},{key:"mastered",label:R.admin?.dashboard?.masteryMastered||"Mastered",count:O.masteryDistribution.mastered,icon:v.f,color:"text-green-500"}],B=O.masteryDistribution.new+O.masteryDistribution.reviewing+O.masteryDistribution.mastered;return(0,s.jsxs)("div",{className:"max-w-5xl mx-auto p-4 sm:p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)(M.f,{variant:"ghost",size:"sm",onClick:()=>p.push("/admin"),children:[(0,s.jsx)(x.f,{className:"h-4 w-4 mr-1"}),R.common?.back||"Back"]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"p-2 rounded-full bg-blue-50 dark:bg-blue-950/30",children:(0,s.jsx)(h.f,{className:"h-6 w-6 text-blue-500"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-bold",children:O.user.name||"N/A"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:O.user.email})]}),"admin"===O.user.role&&(0,s.jsx)(A.f,{variant:"default",children:R.admin?.admin||"Admin"}),(0,s.jsx)(A.f,{variant:O.user.isActive?"default":"destructive",children:O.user.isActive?R.admin?.active||"Active":R.admin?.disabled||"Disabled"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(b.f,{className:"h-5 w-5 text-purple-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:O.notebookCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:R.admin?.dashboard?.notebooks||"Notebooks"})]})}),(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(u.f,{className:"h-5 w-5 text-red-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:O.errorCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:R.admin?.dashboard?.errors||"Errors"})]})}),(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(f.f,{className:"h-5 w-5 text-green-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:O.practiceCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:R.admin?.dashboard?.practice||"Practice"})]})}),(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(y,{className:"h-5 w-5 text-blue-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:O.recent7DaysCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:R.admin?.dashboard?.recent7Days||"Last 7 Days"})]})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(b.f,{className:"h-4 w-4 text-purple-500"}),R.admin?.dashboard?.userNotebooks||"Notebooks"]})}),(0,s.jsx)(z.O,{children:0===O.notebooks.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:R.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-2",children:O.notebooks.map(e=>(0,s.jsxs)("div",{className:"flex justify-between items-center p-2 rounded-lg bg-muted/30",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,s.jsx)(A.f,{variant:"secondary",className:"text-xs",children:(R.admin?.dashboard?.questionCount||"{count} questions").replace("{count}",String(e.errorCount))})]},e.id))})})]}),(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(v.f,{className:"h-4 w-4 text-green-500"}),R.admin?.dashboard?.masteryDistribution||"Mastery Distribution"]})}),(0,s.jsx)(z.O,{children:0===B?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:R.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-3",children:Y.map(e=>{let a=B>0?Math.round(e.count/B*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," (",a,"%)"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,s.jsx)("div",{className:"h-2 rounded-full bg-current opacity-60 transition-all duration-500",style:{width:`${a}%`}})})]},e.key)})})})]})]}),O.subjectDistribution.length>0&&(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(g,{className:"h-4 w-4 text-blue-500"}),R.admin?.dashboard?.subjectDistribution||"Subject Distribution"]})}),(0,s.jsx)(z.O,{children:(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:O.subjectDistribution.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/30",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,s.jsx)(A.f,{variant:"secondary",children:e.count})]},e.name))})})]}),(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(D.f,{className:"h-4 w-4 text-orange-500"}),R.admin?.dashboard?.recentErrors||"Recent Error Items"]})}),(0,s.jsx)(z.O,{children:0===O.recentErrorItems.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:R.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-2",children:O.recentErrorItems.map(a=>(0,s.jsxs)("div",{className:"flex items-start justify-between p-3 rounded-lg bg-muted/30 gap-3",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:a.questionText||a.ocrText||R.admin?.dashboard?.noQuestionText}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[a.subject&&(0,s.jsx)(A.f,{variant:"outline",className:"text-xs",children:a.subject.name}),"mastered"===a.masteryStatus&&(0,s.jsx)(A.f,{variant:"default",className:"text-xs",children:R.admin?.dashboard?.masteryMastered||"Mastered"}),"reviewing"===a.masteryStatus&&(0,s.jsx)(A.f,{variant:"secondary",className:"text-xs",children:R.admin?.dashboard?.masteryReviewing||"Reviewing"}),"new"===a.masteryStatus&&(0,s.jsx)(A.f,{variant:"outline",className:"text-xs",children:R.admin?.dashboard?.masteryNew||"To Review"})]})]}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:(0,n.r)(a.createdAt,"yyyy-MM-dd",e)})]},a.id))})})]})]})}],945514)},35209,e=>{var s=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t}=(0,a.b)(),r=[t.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=r},[r])}])}])})();
@@ -1 +0,0 @@
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 s=(0,t.f)(a);e.s(["f",0,s],711241)},856522,e=>{var t=e.i(456420);let a={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"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],856522)},328623,e=>{var t=e.i(456420);let a={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],328623)},813572,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(618566),i=e.i(518515),n=e.i(328623),r=e.i(747819),l=e.i(866531),o=e.i(12130),c=e.i(430634),u=e.i(497346),d=e.i(717448),m=e.i(798469),f=e.i(393842),p=e.i(956738),g=e.i(185592),h=e.i(111110),x=e.i(41931),b=e.i(201276),v=e.i(35209),y=e.i(267275);e.s(["default",0,function(){let e=(0,s.useParams)(),j=(0,s.useRouter)(),k=e.id,{t:w}=(0,h.b)(),[N,S]=(0,a.useState)(null);(0,v.f)(w.notebooks.title,N?.name,w.pageTitle.addError);let[C,I]=(0,a.useState)("image"),E=(0,y.f)({logPrefix:"[AddErrorItem]",analyzeSubjectId:k,importSubjectId:k,textNotebook:{id:k,name:N?.name||""},fixedSubjectId:k});return((0,a.useEffect)(()=>{x.k.get(`/api/notebooks/${k}`).then(e=>S(e)).catch(e=>{b.V.error("[AddErrorItem]","Failed to fetch notebook",{error:e}),j.push("/notebooks")})},[k,j]),N)?(0,t.jsxs)("main",{className:"min-h-screen",children:[(0,t.jsx)(p.f,{status:E.analysisStep}),(0,t.jsxs)("div",{className:`mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8 ${"review"===E.step?"max-w-6xl":"max-w-4xl"}`,children:[(0,t.jsx)(u.f,{message:E.saveError,onDismiss:E.dismissSaveError}),(0,t.jsx)(f.f,{backHref:`/notebooks/${k}`,title:w.app.addError,description:N.name}),"upload"===E.step&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(g.f,{options:[{value:"image",icon:i.f,label:w.app?.uploadImage||"Take Photo"},{value:"text",icon:n.f,label:w.app?.manualInput||"Manual Input"}],value:C,onChange:I}),E.lastImported&&(0,t.jsx)(c.f,{imported:E.lastImported,onDismiss:E.dismissImported}),E.batchBlobs?(0,t.jsx)(r.f,{blobs:E.batchBlobs,subjectId:k,timeout:E.aiTimeout,onClose:E.closeBatch}):"image"===C?(0,t.jsx)(m.f,{onImageSelect:E.selectImage,isAnalyzing:E.isBusy}):(0,t.jsx)(d.f,{onSubmit:E.submitText,isAnalyzing:E.isBusy,defaultNotebookName:N.name})]}),"review"===E.step&&E.parsedData&&(0,t.jsx)(l.f,{initialData:E.parsedData,imagePreview:E.currentImage,onSave:E.saveReviewed,onCancel:E.cancelReview,initialSubjectId:k,aiTimeout:E.aiTimeout})]}),(0,t.jsx)(o.f,{imageSrc:E.croppingImage||"",open:E.isCropperOpen,onClose:E.closeCropper,onCropComplete:E.cropComplete,onMultiCropComplete:E.startBatch})]}):(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,t.jsx)("p",{className:"text-muted-foreground",children:w.common.loading})})}])},469937,62825,e=>{var t=e.i(843476),a=e.i(456420);let s={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"}]]};s.node;let i=(0,a.f)(s);var n=e.i(111110),r=e.i(975157);let l=[1,2,3,4,5];function o(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["f",0,function({value:e,onChange:a,disabled:s,size:o="sm",showUnrated:c=!0,className:u}){let{t:d}=(0,n.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",p=m?d.difficulty.starsLabel.replace("{n}",String(m)):d.difficulty.unrated;return a?(0,t.jsxs)("span",{className:(0,r.f)("inline-flex items-center gap-0.5",u),role:"group","aria-label":`${d.difficulty.label}${d.common.colon}${p}`,title:d.difficulty.clearHint,children:[l.map(e=>(0,t.jsx)("button",{type:"button",disabled:s,onClick:()=>a(e===m?null:e),"aria-label":d.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(i,{className:(0,r.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&c&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:d.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,r.f)("inline-flex items-center",u),role:"img","aria-label":`${d.difficulty.label}${d.common.colon}${p}`,title:p,children:l.map(e=>(0,t.jsx)(i,{className:(0,r.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):c?(0,t.jsx)("span",{className:(0,r.f)("text-xs text-muted-foreground",u),children:d.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:"未判断"})[o(e)]},"h",0,o,"x",0,function(e,t){return(t||"").trim()?"wrong_attempt":o(e)}],62825)},149704,e=>{var t=e.i(843476),a=e.i(111110),s=e.i(398019),i=e.i(184110),n=e.i(975157);let r={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:c}){let{t:u}=(0,a.b)();if(!e)return null;let d=(0,i.V)(l),m=(0,i.o)(o);return(0,t.jsx)("figure",{className:(0,n.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,s.f)(e),alt:u.figure.alt,className:(0,n.f)(r[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:d/100,maxWidth:`${Math.min(d,100)}%`}})})}])},574041,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(263676),i=e.i(487486),n=e.i(793479),r=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:o,placeholder:c="Enter tags...",className:u="",enterHint:d,subject:m,gradeStage:f}){let[p,g]=(0,a.useState)(""),[h,x]=(0,a.useState)([]),[b,v]=(0,a.useState)(!1),[y,j]=(0,a.useState)(0),k=(0,a.useRef)(null),w=(0,a.useRef)(null),N=(0,a.useCallback)(async t=>{try{let a=new URLSearchParams({q:t});m&&a.append("subject",m),f&&a.append("stage",f);let s=((await r.k.get(`/api/tags/suggestions?${a.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));x(s.slice(0,20)),v(s.length>0),j(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,f,e]);(0,a.useEffect)(()=>{p.trim()&&N(p)},[p,N]);let S=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),x([]),v(!1),j(0))},C=t=>{o(e.filter(e=>e!==t))};return(0,a.useEffect)(()=>{let e=e=>{!w.current||w.current.contains(e.target)||k.current?.contains(e.target)||v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${u}`,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)(i.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>C(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.f,{ref:k,type:"text",value:p,onChange:e=>{g(e.target.value),e.target.value.trim()||(x([]),v(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),y>=0&&h[y]?S(h[y]):p.trim()&&S(p)):"ArrowDown"===t.key?(t.preventDefault(),j(e=>Math.min(e+1,h.length-1))):"ArrowUp"===t.key?(t.preventDefault(),j(e=>Math.max(e-1,0))):"Escape"===t.key?(v(!1),j(0)):"Backspace"===t.key&&!p&&e.length>0&&C(e[e.length-1])},onFocus:()=>{h.length>0&&v(!0)},placeholder:0===e.length?c:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),b&&h.length>0&&(0,t.jsx)("div",{ref:w,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:h.map((e,a)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${a===y?"bg-accent":""}`,onClick:()=>S(e),onMouseEnter:()=>j(a),children:e},e))}),p&&!b&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:d?`${d} "${p}"`:`Press Enter to create "${p}"`})]})}])},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let r=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{r.push(e)},className:n,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},393842,e=>{var t=e.i(843476),a=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:n,actions:r,titleAddon:l,className:o}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",o),children:[n&&(0,t.jsx)(a.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),i&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),r&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:r})]})}])},184110,e=>{let t=["left","center","right"],a="center";function s(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,s,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:a},"V",0,function(e){return s(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}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),i=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])}])})();
@@ -1,9 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,518515,e=>{var t=e.i(456420);let r={name:"camera",size:24,node:[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],518515)},325597,7891,e=>{var t=e.i(456420);let r={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],aliases:["edit-3"]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],7891),e.s(["f",0,a],325597)},747819,364002,866531,430634,497346,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(522016),s=e.i(548161),n=e.i(632781),i=e.i(395925),l=e.i(583967),o=e.i(519455),c=e.i(515288),d=e.i(111110),u=e.i(201276),m=e.i(41931),p=e.i(28928);async function f(){try{return!!(await m.k.get("/api/user")).confirmBeforeImport}catch{return!1}}async function g(e,t){let r=await m.k.post("/api/analyze",{imageBase64:e,language:t.language,subjectId:t.subjectId||void 0},{timeout:t.timeout,recoverable:!0});if(!r||"object"!=typeof r)throw Error("Invalid API response: data is null or not an object");return r}async function h(e,t){let r=await m.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}}async function x(e,t){let r=await (0,p.f)(e instanceof File?e:new File([e],"question.jpg",{type:e.type||"image/jpeg"}));t.onStage?.("analyzing");let a=await g(r,t);return t.onStage?.("saving"),h(a,{subjectId:t.subjectId,imageUrl:r,paperLevel:t.paperLevel})}function v({item:e}){let{t:r}=(0,d.b)(),a=r.batchImport.status[e.status];return"success"===e.status?(0,t.jsxs)("span",{className:"flex items-start gap-1 text-green-700 dark:text-green-300",children:[(0,t.jsx)(s.f,{className:"h-4 w-4 shrink-0 mt-0.5"}),e.imported?.duplicate?r.importFlow.duplicate:a]}):"failed"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-destructive",children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),a]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:["pending"!==e.status&&(0,t.jsx)(n.f,{className:"h-4 w-4 animate-spin"}),a]})}function y({blob:e}){let a=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let t=URL.createObjectURL(e);return a.current&&(a.current.src=t),()=>URL.revokeObjectURL(t)},[e]),(0,t.jsx)("img",{ref:a,alt:"",className:"h-20 w-20 shrink-0 rounded object-contain bg-muted"})}e.s(["x",0,f,"w",0,x,"a",0,h],364002),e.s(["f",0,function({blobs:e,subjectId:s,timeout:n,onClose:l}){let{t:m,language:p}=(0,d.b)(),[f,g]=(0,r.useState)(()=>e.map(()=>({status:"pending"}))),h=(0,r.useRef)(!1),w=(0,r.useCallback)((e,t)=>{g(r=>r.map((r,a)=>a===e?{...r,...t}:r))},[]),b=(0,r.useCallback)(async t=>{w(t,{status:"analyzing",error:void 0});try{let r=await x(e[t],{language:p,subjectId:s,timeout:n,onStage:e=>w(t,{status:e})});w(t,{status:"success",imported:r})}catch(s){let e=s?.data,r=e?.message||(s instanceof Error?s.message:String(s)),a=m.errors[r];w(t,{status:"failed",error:"string"==typeof a?a:r}),u.V.error("[BatchImport]","Question import failed",{index:t,error:r})}},[e,p,s,n,m.errors,w]),j=(0,r.useCallback)(async e=>{let t=[...e],r=async()=>{for(;t.length>0;)await b(t.shift())};await Promise.all(Array.from({length:Math.min(3,t.length)},r))},[b]);(0,r.useEffect)(()=>{h.current||(h.current=!0,j(e.map((e,t)=>t)))},[e,j]);let N=f.filter(e=>"success"===e.status).length,k=f.flatMap((e,t)=>"failed"===e.status?[t]:[]),S=f.some(e=>"pending"===e.status||"analyzing"===e.status||"saving"===e.status);return(0,t.jsxs)(c.N,{children:[(0,t.jsxs)(c.Y,{className:"flex flex-row items-center justify-between gap-2 space-y-0",children:[(0,t.jsx)(c.v,{className:"text-base",children:m.batchImport.title}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:m.batchImport.summary.replace("{done}",String(N)).replace("{total}",String(f.length)).replace("{failed}",String(k.length))})]}),(0,t.jsxs)(c.O,{className:"space-y-4",children:[(0,t.jsx)("ul",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:f.map((r,s)=>(0,t.jsxs)("li",{className:"flex gap-3 rounded-lg border p-3",children:[(0,t.jsx)(y,{blob:e[s]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1 text-sm",children:[(0,t.jsx)("div",{className:"font-medium",children:m.batchImport.question.replace("{index}",String(s+1))}),(0,t.jsx)(v,{item:r}),"success"===r.status&&r.imported&&(0,t.jsxs)(a.default,{href:`/error-items/${r.imported.id}`,className:"block truncate text-xs text-primary hover:underline",children:[r.imported.notebookName," · ",r.imported.shortId]}),"failed"===r.status&&(0,t.jsxs)(t.Fragment,{children:[r.error&&(0,t.jsx)("p",{className:"line-clamp-2 text-xs text-destructive",children:r.error}),(0,t.jsxs)(o.f,{size:"sm",variant:"outline",className:"h-7",onClick:()=>b(s),children:[(0,t.jsx)(i.f,{className:"mr-1 h-3 w-3"}),m.batchImport.retry]})]})]})]},s))}),(0,t.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end gap-2",children:[k.length>1&&!S&&(0,t.jsxs)(o.f,{variant:"outline",onClick:()=>j(k),children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),m.batchImport.retryFailed]}),(0,t.jsx)(o.f,{onClick:l,disabled:S,children:m.batchImport.finish})]})]})]})}],747819);var w=e.i(741120),b=e.i(856522),j=e.i(314381),N=e.i(3198),k=e.i(294114);function S({data:e,onChange:a}){let{t:s}=(0,d.b)(),[i,l]=(0,r.useState)(!1),[c,p]=(0,r.useState)(null),f=async()=>{if(!e.questionText.trim())return void k.c.warning(s.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void k.c.warning(s.geogebra.answerRequired);l(!0),p(null);try{let t=await m.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?a({geogebraCommands:JSON.stringify(t.commands)}):p(t.description||s.geogebra.notSuitable)}catch(e){u.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),p(s.geogebra.analyzeFailed)}finally{l(!1)}};return e.geogebraCommands?(0,t.jsx)(N.f,{commands:e.geogebraCommands,height:350,onRegenerate:f,onDelete:async()=>a({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)(j.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:s.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:f,disabled:i,children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4 animate-spin"}),s.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.f,{className:"mr-2 h-4 w-4"}),s.geogebra.generate]})})]}),c&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:c}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:s.geogebra.hint})]}):null}var A=e.i(469937),E=e.i(28342),T=e.i(438465),I=e.i(674166),D=e.i(110204);function C({data:e,paperLevel:r,onChange:a}){let{t:s}=(0,d.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(D.f,{children:s.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(T.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)(D.f,{htmlFor:"correction-grade-semester",children:s.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(E.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)(D.f,{children:s.editor.paperLevel||"Paper Level"}),(0,t.jsx)(I.f,{value:r,onChange:e=>a({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(D.f,{children:s.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(A.f,{size:"md",value:e.difficultyStars,onChange:e=>a({difficultyStars:e})})})]})]})}var F=e.i(141176),P=e.i(967489);function R({data:e,onChange:r}){let{t:a}=(0,d.b)();return(0,t.jsxs)(c.N,{children:[(0,t.jsx)(c.Y,{children:(0,t.jsx)(c.v,{children:a.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(c.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(D.f,{children:a.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(P.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>r({mistakeStatus:e}),children:[(0,t.jsx)(P.P,{children:(0,t.jsx)(P.U,{})}),(0,t.jsxs)(P.r,{children:[(0,t.jsx)(P.T,{value:"not_attempted",children:a.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(P.T,{value:"wrong_attempt",children:a.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(P.T,{value:"unknown",children:a.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(D.f,{children:a.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(F.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)(D.f,{children:a.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(F.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 O=e.i(511445),_=e.i(149704);function L({title:e,children:r,className:a}){return(0,t.jsxs)(c.N,{children:[(0,t.jsx)(c.Y,{children:(0,t.jsx)(c.v,{children:e})}),(0,t.jsx)(c.O,{className:a,children:r})]})}function M({data:e,children:r}){let{t:a}=(0,d.b)(),s={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)(L,{title:a.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(O.f,{content:e.questionText}),(0,t.jsx)(_.f,{svg:e.figureSvg})]}),r,(0,t.jsx)(L,{title:a.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(O.f,{content:e.answerText})}),(0,t.jsx)(L,{title:a.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(O.f,{content:e.analysis})}),(0,t.jsxs)(L,{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,s[e.mistakeStatus]??s.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)(O.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)(O.f,{content:e.mistakeAnalysis})]})]})]})}var U=e.i(574041),$=e.i(215519),V=e.i(306831);e.i(676167);var z=e.i(952122),q=e.i(62825),G=e.i(664030),B=e.i(303163);e.s(["f",0,function({initialData:e,onSave:a,onCancel:s,imagePreview:i,initialSubjectId:l,aiTimeout:p}){let{timeZone:f}=(0,$.M)(),{t:g,language:h}=(0,d.b)(),[x,v]=(0,r.useState)({...e,wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:l,gradeSemester:e.gradeSemester||""}),y=(0,r.useRef)(!1),j=e=>{"gradeSemester"in e&&(y.current=!0),v(t=>({...t,...e}))},{groups:N}=(0,G.f)(),A=(()=>{if(x.paperLevel)return x.paperLevel;let e="number"==typeof x.difficultyStars&&x.difficultyStars>=4?"b":"a";return N.find(t=>t.key===e&&t.isActive)?.id||""})(),E=x.paperLevel??A,[T,I]=(0,r.useState)(!1),[P,O]=(0,r.useState)(!1),[_,L]=(0,r.useState)(!1),[H,W]=(0,r.useState)(void 0),[Q,Z]=(0,r.useState)([]);(0,r.useEffect)(()=>{m.k.get("/api/notebooks").then(Z).catch(e=>u.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),m.k.get("/api/user").then(e=>{if(L(!!e?.enableGeogebra),e){let t=function(e,t=V.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,r=new Date,a="en",s=V.J){let n=(0,V.c)(r,s),i=n.getFullYear(),l=n.getMonth()+1,o=i-t,c="2nd";l>=9?(o+=1,c="1st"):c=l<2?"1st":"2nd";let d="zh"===a,u=d?"1st"===c?"上期":"下期":"1st"===c?"1st Semester":"2nd Semester",m=(d?{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]||[],p=`${o}`;if(p=o>0&&o<=m.length?m[o-1]:o>m.length?d?"已毕业":"Graduated":d?"学前":"Pre-school",!d)return`${p}, ${u}`;{let e="1st"===c?"上":"下";return`${p}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,f);v(e=>e.gradeSemester||y.current?e:{...e,gradeSemester:t||""}),W(e.educationStage||void 0)}}).catch(e=>u.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[h,f]);let K=async()=>{if(!x.questionText.trim())return void k.c.warning(g.editor.enterQuestionFirst||"Please enter question text first");I(!0);try{let e=function({questionText:e,language:t,subject:r,imagePreview:a,gradeSemester:s,subjectId:n}){let i={questionText:e,language:t,subject:r};return a&&(i.imageBase64=a),s&&(i.gradeSemester=s),n&&(i.subjectId=n),i}({questionText:x.questionText,language:h,subject:x.subject,imagePreview:i,gradeSemester:x.gradeSemester??void 0,subjectId:x.subjectId});u.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:p});let t=await m.k.post("/api/reanswer",e,{timeout:p||18e4,recoverable:!0});v(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,q.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars})),k.c.success(g.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(a){let e,t,r;u.V.error("[CorrectionEditor]","Reanswer failed",{error:a}),k.c.error((e=(0,B.d)(a)||"",r=(t=g.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||g.errors?.AI_AUTH_ERROR||r:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||g.errors?.AI_CONNECTION_FAILED||r:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||g.errors?.AI_RESPONSE_ERROR)||r))}finally{I(!1)}},Y=async()=>{if(!x.subjectId)return void k.c.warning(g.editor.messages?.selectNotebook||"Please select a notebook");if(!P){O(!0);try{await a({...x,paperLevel:E,mistakeStatus:(0,q.x)(x.mistakeStatus,x.wrongAnswerText)})}finally{O(!1)}}},J=g.editor.placeholder||"Supports Markdown and LaTeX...",X=(0,z.f)(Q.find(e=>e.id===x.subjectId)?.name||null)||(0,z.f)(x.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:g.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:s,children:g.editor.cancel}),(0,t.jsxs)(o.f,{onClick:Y,disabled:P,children:[P?(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(b.f,{className:"mr-2 h-4 w-4"}),P?g.common?.pleaseWait||"Please wait...":g.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[i&&(0,t.jsx)(c.N,{children:(0,t.jsx)(c.O,{className:"p-4",children:(0,t.jsx)("img",{src:i,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(C,{data:x,paperLevel:E,onChange:j}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(D.f,{children:g.editor.question}),(0,t.jsx)(F.f,{value:x.questionText,onChange:e=>j({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:J}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:K,disabled:T||!x.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:T?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4 animate-spin"}),g.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.f,{className:"mr-2 h-4 w-4"}),g.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g.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)(D.f,{children:g.editor.tags}),(0,t.jsx)(U.f,{value:x.knowledgePoints,onChange:e=>j({knowledgePoints:e}),placeholder:g.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:g.editor.createTagHint,subject:X,gradeStage:H}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(D.f,{children:g.editor.answer}),(0,t.jsx)(F.f,{value:x.answerText,onChange:e=>j({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:J})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(D.f,{children:g.editor.analysis}),(0,t.jsx)(F.f,{value:x.analysis,onChange:e=>j({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:J})]}),(0,t.jsx)(R,{data:x,onChange:j})]}),(0,t.jsx)(M,{data:x,children:_&&(0,t.jsx)(S,{data:x,onChange:j})})]})]})}],866531);var H=e.i(263676);e.s(["f",0,function({imported:e,onDismiss:r}){let{t:n}=(0,d.b)(),i=(e.duplicate?n.importFlow.duplicate:n.importFlow.imported).replace("{notebook}",e.notebookName||"-").replace("{id}",e.shortId||"-");return(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 rounded-lg border border-green-300 dark:border-green-800 bg-green-50 dark:bg-green-950/40 p-3 text-sm text-green-800 dark:text-green-200",role:"status",children:[(0,t.jsxs)("span",{className:"flex items-start gap-2 flex-1",children:[(0,t.jsx)(s.f,{className:"h-4 w-4 mt-0.5 shrink-0"}),i]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,t.jsx)(a.default,{href:`/error-items/${e.id}`,children:(0,t.jsx)(o.f,{size:"sm",variant:"outline",className:"bg-background",children:n.importFlow.viewItem})}),(0,t.jsx)(o.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:r,"aria-label":n.detail.close,children:(0,t.jsx)(H.X,{className:"h-4 w-4"})})]})]})}],430634);var W=e.i(853138);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)(W.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)(H.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346)},717448,798469,956738,185592,267275,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(515288),s=e.i(519455),n=e.i(624687),i=e.i(110204),l=e.i(632781),o=e.i(325597),c=e.i(328623),d=e.i(111110);e.s(["f",0,function({onSubmit:e,isAnalyzing:u,defaultNotebookName:m}){let{t:p}=(0,d.b)(),[f,g]=(0,r.useState)(""),h=async()=>{f.trim()&&await e(f.trim())};return(0,t.jsx)(a.N,{className:"rounded-2xl",children:(0,t.jsxs)(a.O,{className:"p-6 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground mb-2",children:[(0,t.jsx)(o.f,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:p.app?.textInputHint||"Enter question text"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.f,{htmlFor:"question-text",children:p.editor?.question||"Question Text"}),(0,t.jsx)(n.f,{id:"question-text",value:f,onChange:e=>g(e.target.value),onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),f.trim()&&!u&&h())},placeholder:p.app?.textInputPlaceholder||"Paste or type question text here...\nSupports Markdown and LaTeX formulas (e.g. $x^2 + y^2 = 1$)\n\nCtrl+Enter to submit",className:"min-h-[200px] font-mono text-sm resize-y",disabled:u})]}),m&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[p.notebooks?.title||"My Notebooks",": ",m]}),(0,t.jsx)(s.f,{onClick:h,disabled:!f.trim()||u,className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 font-medium text-white hover:from-indigo-700 hover:to-violet-600",size:"lg",children:u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.f,{className:"mr-2 h-4 w-4 animate-spin"}),p.editor?.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.f,{className:"mr-2 h-4 w-4"}),p.app?.aiSolve||"AI Solve"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:p.app?.textInputTip||"After entering the question, AI will automatically solve and generate analysis"})]})})}],717448);let u=new Map([["avif","image/avif"],["bmp","image/bmp"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["gif","image/gif"],["gz","application/gzip"],["htm","text/html"],["html","text/html"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","application/javascript"],["json","application/json"],["md","text/markdown"],["mjs","application/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["ogg","audio/ogg"],["pdf","application/pdf"],["png","image/png"],["ppt","application/powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["svg","image/svg+xml"],["tif","image/tiff"],["tiff","image/tiff"],["txt","text/plain"],["wasm","application/wasm"],["wav","audio/x-wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["zip","application/zip"]]);var m=class extends Error{constructor(e){super("DataTransferItem is not a file"),this.item=e,this.name="UnexpectedObjectError"}};function p(e,t,r){let{webkitRelativePath:a}=e,s="string"==typeof t?t:"string"==typeof a&&a.length>0?a:`./${e.name}`;return"string"!=typeof e.path&&f(e,"path",s),void 0!==r&&Object.defineProperty(e,"handle",{value:r,writable:!1,configurable:!1,enumerable:!0}),f(e,"relativePath",s),e}function f(e,t,r){Object.defineProperty(e,t,{value:r,writable:!1,configurable:!1,enumerable:!0})}let g=[".DS_Store","Thumbs.db"];async function h(e,{mimeTypes:t=u}={}){return(await x(e)).map(e=>"path"in e?function(e,t=u){let{name:r}=e;if(r&&-1!==r.lastIndexOf(".")&&!e.type){let a=r.split(".").pop().toLowerCase(),s=t.get(a);s&&Object.defineProperty(e,"type",{value:s,writable:!1,configurable:!1,enumerable:!0})}return e}(e,t):e)}async function x(e){var t,r,a;if(v(e)&&v(e.dataTransfer))return w(e.dataTransfer,e.type);if(v(t=e)&&v(t.clipboardData)){let t;return b(((t=j((r=e.clipboardData).items).filter(e=>"file"===e.kind).map(e=>e.getAsFile()).filter(e=>null!==e)).length>0?t:j(r.files)).map(e=>p(e)))}if(v(a=e)&&v(a.target))return j(e.target.files).map(e=>p(e));return Array.isArray(e)&&e.every(e=>"getFile"in e&&"function"==typeof e.getFile)?y(e):[]}function v(e){return"object"==typeof e&&null!==e}async function y(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>p(e))}async function w(e,t){let r=j(e.items).filter(e=>"file"===e.kind);return"drop"!==t?r:b(function e(t){let r=[];for(let a of t)Array.isArray(a)?r.push(...e(a)):r.push(a);return r}(await Promise.all(r.map(N))))}function b(e){return e.filter(e=>-1===g.indexOf(e.name))}function j(e){return null===e?[]:Array.from(e)}async function N(e){if("function"!=typeof e.webkitGetAsEntry)return k(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let r=await S(e);return r?.kind==="directory"?A(r,`/${r.name}`):T(t)}return k(e,t)}async function k(e,t){let r=e.getAsFile(),a=await S(e);if(null!=a){let e=r??await a.getFile();return e.handle=a,p(e)}if(!r)throw new m(e);return p(r,t?.fullPath??void 0)}async function S(e){if(globalThis.isSecureContext&&"function"==typeof e.getAsFileSystemHandle)return e.getAsFileSystemHandle()}async function A(e,t){let r=[];for await(let a of e.values()){let e=`${t}/${a.name}`;if("directory"===a.kind)r.push(...await A(a,e));else{let t=await a.getFile();r.push(p(t,e,a))}}return r}async function E(e){return e.isDirectory?T(e):I(e)}function T(e){let t=e.createReader();return new Promise((e,r)=>{let a=[];!function s(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(E));a.push(e),s()}else try{e(await Promise.all(a))}catch(e){r(e)}},e=>{r(e)})}()})}async function I(e){return new Promise((t,r)=>{e.file(r=>{t(p(r,e.fullPath))},e=>{r(e)})})}let D=function(e,t){if(e&&t){let r=(Array.isArray(t)?t:t.split(",")).filter(e=>""!==e.trim());if(0===r.length)return!0;let a=e.name||"",s=(e.type||"").toLowerCase(),n=s.replace(/\/.*$/,"");return r.some(e=>{let t=e.trim().toLowerCase();return"."===t.charAt(0)?a.toLowerCase().endsWith(t):t.endsWith("/*")?n===t.replace(/\/.*$/,""):s===t})}return!0},C=["KB","MB","GB","TB","PB"];function F(e){if(e<1024)return`${e} ${1===e?"byte":"bytes"}`;let t=e/1024,r=0;for(;t>=1024&&r<C.length-1;)t/=1024,r++;return`${Number(t.toFixed(2))} ${C[r]}`}function P(e){return{code:"file-too-large",message:`File is larger than ${F(e)}`}}function R(e){return{code:"file-too-small",message:`File is smaller than ${F(e)}`}}let O={code:"too-many-files",message:"Too many files"};function _(e,t){let r="application/x-moz-file"===e.type||D(e,t??"")||""===e.type&&"function"==typeof e.getAsFile;return[r,r?null:function(e=""){let t=e.split(","),r=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:"file-invalid-type",message:`File type must be ${r}`}}(t)]}function L(e,t,r){if(M(e.size)){if(M(t)&&M(r)){if(e.size>r)return[!1,P(r)];if(e.size<t)return[!1,R(t)]}else if(M(t)&&e.size<t)return[!1,R(t)];else if(M(r)&&e.size>r)return[!1,P(r)]}return[!0,null]}function M(e){return null!=e}function U(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function $(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>"Files"===e||"application/x-moz-file"===e)||Array.prototype.some.call(t.items??[],V):!!e.target&&!!e.target.files}function V(e){return"object"==typeof e&&null!==e&&"file"===e.kind}function z(e){e.preventDefault()}function q(...e){return(t,...r)=>e.some(e=>(!U(t)&&e&&e(t,...r),U(t)))}function G(e){return Array.isArray(e)?e:"string"==typeof e?[e]:[]}function B(e){if(M(e))return Array.isArray(e)?e.filter(e=>M(e)&&M(e.accept)):[{accept:e}]}function H(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(M(e))return Object.entries(e).reduce((e,[r,a])=>{let s=G(a);return t&&r.endsWith("/*")&&s.some(Q)?e.push(...s):e.push(r,...s),e},[]).filter(e=>W(e)||Q(e)).join(",")}function W(e){return"audio/*"===e||"video/*"===e||"image/*"===e||"text/*"===e||"application/*"===e||/\w+\/[-+.\w]+/g.test(e)}function Q(e){return/^.*\.[\w]+$/.test(e)}(0,r.forwardRef)(({children:e,...a},s)=>{let{open:n,...i}=K(a);return(0,r.useImperativeHandle)(s,()=>({open:n}),[n]),(0,t.jsx)(t.Fragment,{children:e?.({...i,open:n})})}).displayName="Dropzone";let Z={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function K(e={}){let{accept:t,disabled:a=!1,getFilesFromEvent:s=h,maxSize:n=1/0,minSize:i=0,multiple:l=!0,maxFiles:o=0,onDragEnter:c,onDragLeave:d,onDragOver:u,onDrop:m,onDropAccepted:p,onDropRejected:f,onFileDialogCancel:g,onFileDialogOpen:x,useFsAccessApi:v=!1,autoFocus:y=!1,preventDropOnDocument:w=!0,noClick:b=!1,noKeyboard:j=!1,noDrag:N=!1,noDragEventsBubbling:k=!1,noPaste:S=!1,onError:A,validator:E,getErrorMessage:T}=e,I=(0,r.useMemo)(()=>(function(e){let t=B(e);if(!M(t))return;let r={};for(let e of t)for(let[t,a]of Object.entries(e.accept)){let e=r[t]??(r[t]=[]);for(let t of G(a))e.includes(t)||e.push(t)}return r})(t),[t]),D=(0,r.useMemo)(()=>H(I),[I]),C=(0,r.useMemo)(()=>H(I,{omitWildcardMimeTypesWithExtensions:!0}),[I]),F=(0,r.useMemo)(()=>(function(e){let t=B(e);if(!M(t))return;let r=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let r=!0;return W(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),r=!1),(Array.isArray(t)||"string"==typeof t)&&G(t).every(Q)||(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),r=!1),r}).reduce((e,[t,r])=>(e[t]=G(r),e),{});return{description:M(e.description)&&""!==e.description?e.description:function(e){let t=[],r=Object.keys(e);for(let r of Object.values(e))for(let e of G(r))t.includes(e)||t.push(e);return t.length>0?t.join(", "):r.length>0?r.join(", "):"Files"}(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return r.length>0?r:void 0})(t),[t]),P=(0,r.useMemo)(()=>"function"==typeof x?x:J,[x]),R=(0,r.useMemo)(()=>"function"==typeof g?g:J,[g]),V=(0,r.useRef)(null),X=(0,r.useRef)(null),[ee,et]=(0,r.useReducer)(Y,Z),{isFocused:er,isFileDialogActive:ea}=ee,es=(0,r.useRef)(ea);es.current=ea;let en=(0,r.useRef)(null),ei=(0,r.useCallback)(()=>{en.current?.abort();let e=new AbortController;return en.current=e,et({type:"setProcessing",isProcessing:!0}),e.signal},[]),el=(0,r.useCallback)(e=>{e.aborted||et({type:"setProcessing",isProcessing:!1})},[]);(0,r.useEffect)(()=>()=>en.current?.abort(),[]);let eo=(0,r.useRef)("u">typeof window&&window.isSecureContext&&v&&"showOpenFilePicker"in window),ec=()=>{!eo.current&&ea&&setTimeout(()=>{if(X.current){let{files:e}=X.current;e?.length||(et({type:"closeDialog"}),R())}},300)};(0,r.useEffect)(()=>(window.addEventListener("focus",ec,!1),()=>{window.removeEventListener("focus",ec,!1)}),[X,ea,R,eo]);let ed=(0,r.useRef)([]),eu=(0,r.useRef)([]),em=e=>{V.current&&e.target&&V.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),ed.current=[])};(0,r.useEffect)(()=>(w&&(document.addEventListener("dragover",z,!1),document.addEventListener("drop",em,!1)),()=>{w&&(document.removeEventListener("dragover",z),document.removeEventListener("drop",em))}),[V,w]),(0,r.useEffect)(()=>{let e=e=>{e.target&&(eu.current=[...eu.current,e.target]),$(e)&&et({isDragGlobal:!0,type:"setDragGlobal"})},t=e=>{eu.current=eu.current.filter(t=>t!==e.target&&null!==t),eu.current.length>0||et({isDragGlobal:!1,type:"setDragGlobal"})},r=()=>{eu.current=[],et({isDragGlobal:!1,type:"setDragGlobal"})},a=()=>{eu.current=[],et({isDragGlobal:!1,type:"setDragGlobal"})};return document.addEventListener("dragenter",e,!1),document.addEventListener("dragleave",t,!1),document.addEventListener("dragend",r,!1),document.addEventListener("drop",a,!1),()=>{document.removeEventListener("dragenter",e),document.removeEventListener("dragleave",t),document.removeEventListener("dragend",r),document.removeEventListener("drop",a)}},[V]),(0,r.useEffect)(()=>(!a&&y&&V.current&&V.current.focus(),()=>{}),[V,y,a]);let ep=(0,r.useCallback)(e=>{A?A(e):console.error(e)},[A]),ef=(0,r.useCallback)(e=>{e.preventDefault(),e.persist?.(),eT(e),!es.current&&(ed.current=[...ed.current,e.target],$(e)&&Promise.resolve(s(e)).then(t=>{if(U(e)&&!k)return;let r=t.length>0?function({files:e,accept:t,minSize:r,maxSize:a,multiple:s,maxFiles:n=0,validator:i,getErrorMessage:l}){let o=[],c=[],d=(e,t)=>l&&"u">typeof File&&t instanceof File?{...e,message:l(e,t)}:e;e.forEach(e=>{let[s,n]=_(e,t),[i,l]=L(e,r,a);s&&i?o.push(e):c.push({file:e,errors:[n,l].filter(e=>null!=e).map(t=>d(t,e))})});let u=s?n>=1?n:1/0:1;return(o.length>u&&o.slice(u).forEach(e=>{c.push({file:e,errors:[d(O,e)]})}),c.length>0)?{verdict:"reject",rejections:c}:{verdict:i?"unknown":"accept",rejections:c}}({files:t,accept:D,minSize:i,maxSize:n,multiple:l,maxFiles:o,validator:E,getErrorMessage:T}):null;et({isDragAccept:r?.verdict==="accept",isDragReject:r?.verdict==="reject",isDragUnknown:r?.verdict==="unknown",isDragActive:!0,dragFileRejections:r?.rejections??[],type:"setDraggedFiles"}),c&&c(e)}).catch(e=>ep(e)))},[s,c,ep,k,D,i,n,l,o,E,T]),eg=(0,r.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),eT(e),es.current)return!1;let t=$(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch{}return t&&u&&u(e),!1},[u,k]),eh=(0,r.useCallback)(e=>{e.preventDefault(),e.persist?.(),eT(e);let t=ed.current.filter(e=>V.current?.contains(e)),r=t.indexOf(e.target);-1!==r&&t.splice(r,1),ed.current=t,!(t.length>0)&&(et({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),$(e)&&d&&d(e))},[V,d,k]),ex=(0,r.useCallback)(async(e,t,r)=>{let a,s=(e,t)=>T?{...e,message:T(e,t)}:e,c=e=>{let r=[],a=[];e.forEach(({file:e,accepted:t,acceptError:n,sizeMatch:i,sizeError:l,customErrors:o})=>{let c=!o||Array.isArray(o)&&0===o.length;if(t&&i&&c)r.push(e);else{let t=[n,l];o&&(t=t.concat(o)),a.push({file:e,errors:t.filter(e=>null!=e).map(t=>s(t,e))})}});let n=l?o>=1?o:1/0:1;r.length>n&&r.splice(n).forEach(e=>{a.push({file:e,errors:[s(O,e)]})}),et({acceptedFiles:r,fileRejections:a,type:"setFiles"}),m&&m(r,a,t),a.length>0&&f&&f(a,t),r.length>0&&p&&p(r,t)},d=e.map(e=>{let[t,r]=_(e,C),[a,s]=L(e,i,n);return{file:e,accepted:t,acceptError:r,sizeMatch:a,sizeError:s,customErrors:E?E(e):null}});if(!d.some(({customErrors:e})=>null!=e&&"function"==typeof e.then))return void c(d);try{a=await Promise.all(d.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){r.aborted||(el(r),ep(e));return}r.aborted||c(a)},[et,l,C,i,n,o,m,p,f,E,T,ep,el]),ev=(0,r.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),eT(e),ed.current=[],(!es.current||!e.dataTransfer)&&(et({type:"reset"}),$(e))){let t=ei();Promise.resolve(s(e)).then(r=>{if(!t.aborted)return U(e)&&!k?void el(t):ex(r,e,t)}).catch(e=>{t.aborted||(el(t),ep(e))})}},[s,ex,ep,k,ei,el]),ey=(0,r.useCallback)(e=>{if(!$(e))return;e.preventDefault(),e.persist?.(),eT(e);let t=ei();Promise.resolve(s(e)).then(r=>{if(!t.aborted)return U(e)&&!k?void el(t):ex(r,e,t)}).catch(e=>{t.aborted||(el(t),ep(e))})},[s,ex,ep,k,ei,el]),ew=(0,r.useCallback)(()=>{if(eo.current){let e;et({type:"openDialog"}),P(),window.showOpenFilePicker({multiple:l,types:F}).then(t=>(e=ei(),s(t))).then(t=>{if(et({type:"closeDialog"}),!e.aborted)return ex(t,null,e)}).catch(t=>{(e&&el(e),t instanceof DOMException&&("AbortError"===t.name||t.code===t.ABORT_ERR))?(R(t),et({type:"closeDialog"})):t instanceof DOMException&&("SecurityError"===t.name||t.code===t.SECURITY_ERR)||t instanceof DOMException&&"NotAllowedError"===t.name?(eo.current=!1,X.current?(X.current.value="",X.current.click()):ep(Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ep(t)});return}X.current&&(et({type:"openDialog"}),P(),X.current.value="",X.current.click())},[et,P,R,v,ex,ep,F,l,ei,el]),eb=(0,r.useCallback)(e=>{V.current?.isEqualNode(e.target)&&(" "===e.key||"Enter"===e.key||32===e.keyCode||13===e.keyCode)&&(e.preventDefault(),ew())},[V,ew]),ej=(0,r.useCallback)(()=>{et({type:"focus"})},[]),eN=(0,r.useCallback)(()=>{et({type:"blur"})},[]),ek=(0,r.useCallback)(()=>{b||(function(e=window.navigator.userAgent){return -1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")||-1!==e.indexOf("Edge/")}()?setTimeout(ew,0):ew())},[b,ew]),eS=e=>a?null:e,eA=e=>j?null:eS(e),eE=e=>N?null:eS(e),eT=e=>{k&&e.stopPropagation()},eI=(0,r.useMemo)(()=>({refKey:e="ref",role:t,onKeyDown:r,onFocus:s,onBlur:n,onClick:i,onDragEnter:l,onDragOver:o,onDragLeave:c,onDrop:d,onPaste:u,...m}={})=>{let p;return{onKeyDown:eA(q(r,eb)),onFocus:eA(q(s,ej)),onBlur:eA(q(n,eN)),onClick:eS(q(i,ek)),onDragEnter:eE(q(l,ef)),onDragOver:eE(q(o,eg)),onDragLeave:eE(q(c,eh)),onDrop:eE(q(d,ev)),onPaste:(p=q(u,ey),S?null:eS(p)),role:"string"==typeof t&&""!==t?t:"presentation",[e]:V,...!a&&!j?{tabIndex:0}:{},...a?{"aria-disabled":!0}:{},...m}},[V,eb,ej,eN,ek,ef,eg,eh,ev,ey,j,N,S,a]),eD=(0,r.useCallback)(e=>{e.stopPropagation()},[]),eC=(0,r.useMemo)(()=>({refKey:e="ref",onChange:t,onClick:r,...a}={})=>({accept:C,multiple:l,type:"file","aria-label":"file upload",style:{border:0,display:"block",height:0,margin:0,maxWidth:0,opacity:0,overflow:"hidden",padding:0,width:0},onChange:eS(q(t,ev)),onClick:eS(q(r,eD)),tabIndex:-1,[e]:X,...a}),[X,t,l,ev,a]);return{...ee,isFocused:er&&!a,getRootProps:eI,getInputProps:eC,rootRef:V,inputRef:X,open:eS(ew)}}function Y(e,t){switch(t.type){case"focus":return{...e,isFocused:!0};case"blur":return{...e,isFocused:!1};case"openDialog":return{...Z,isFileDialogActive:!0};case"closeDialog":return{...e,isFileDialogActive:!1};case"setDraggedFiles":return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case"setProcessing":return{...e,isProcessing:t.isProcessing};case"setFiles":return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case"setDragGlobal":return{...e,isDragGlobal:t.isDragGlobal};case"reset":return{...Z};default:return e}}function J(){}var X=e.i(456420);let ee={name:"cloud-upload",size:24,node:[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],aliases:["upload-cloud"]};ee.node;let et=(0,X.f)(ee);var er=e.i(446513);let ea={name:"clipboard-paste",size:24,node:[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]};ea.node;let es=(0,X.f)(ea);var en=e.i(201276),ei=e.i(294114);let el=()=>()=>{};function eo(){return(0,r.useSyncExternalStore)(el,()=>!0,()=>!1)}e.s(["f",0,function({onImageSelect:e,isAnalyzing:n}){let{t:i}=(0,d.b)(),[o,c]=(0,r.useState)(!1),u=eo();(0,r.useEffect)(()=>{"Notification"in window&&"default"===Notification.permission&&Notification.requestPermission()},[]);let{getRootProps:m,getInputProps:p,isDragActive:f}=K({onDrop:(0,r.useCallback)(t=>{let r=t[0];r&&e(r)},[e]),accept:{"image/*":[".jpeg",".jpg",".png"]},maxFiles:1,disabled:n}),g=(0,r.useCallback)(t=>{let r=t.type||"image/png",a=r.split("/")[1]||"png";e(t instanceof File&&t.name?t:new File([t],`clipboard-${Date.now()}.${a}`,{type:r}))},[e]);(0,r.useEffect)(()=>{let e=e=>{if(n)return;let t=e.target;if(t&&(t.isContentEditable||["INPUT","TEXTAREA"].includes(t.tagName)))return;let r=Array.from(e.clipboardData?.items??[]).find(e=>"file"===e.kind&&e.type.startsWith("image/")),a=r?.getAsFile();a&&(e.preventDefault(),g(a))};return window.addEventListener("paste",e),()=>window.removeEventListener("paste",e)},[n,g]);let h=async()=>{if(!(u&&"u">typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.read))return void ei.c.warning(i.upload.pasteNotSupported);try{for(let e of(await navigator.clipboard.read())){let t=e.types.find(e=>e.startsWith("image/"));if(t){let r=await e.getType(t);g(r);return}}ei.c.warning(i.upload.pasteNoImage)}catch(e){en.V.warn("[UploadZone]","Clipboard read failed",{error:e instanceof Error?e.message:String(e)}),e instanceof Error&&"NotAllowedError"===e.name?ei.c.warning(i.upload.pastePermissionDenied):ei.c.error(i.upload.pasteFailed)}},x=()=>u&&"u">typeof navigator&&"mediaDevices"in navigator&&"getDisplayMedia"in navigator.mediaDevices,v=async()=>{if(!x())return void ei.c.warning(i.upload.screenshotNotSupported);c(!0);try{let t;"CaptureController"in window&&(t=new window.CaptureController);let r={video:!0,audio:!1,preferCurrentTab:!1};t&&(r.controller=t);let a=await navigator.mediaDevices.getDisplayMedia(r),[s]=a.getVideoTracks(),n=s.getSettings().displaySurface;if(t&&("browser"===n||"window"===n))try{t.setFocusBehavior("no-focus-change"),en.V.info("[UploadZone]","Screenshot focus behavior set to no-change",void 0,{sendToBackend:!1})}catch(e){en.V.warn("[UploadZone]","Unable to set screenshot focus behavior",{error:e})}let i=document.createElement("video");if(i.srcObject=a,i.muted=!0,i.autoplay=!0,i.playsInline=!0,await new Promise((e,t)=>{i.onloadedmetadata=()=>{i.play().then(()=>{e()}).catch(t)},i.onerror=t}),await new Promise(e=>setTimeout(e,500)),0===i.videoWidth||0===i.videoHeight)throw Error("视频没有有效尺寸");let l=document.createElement("canvas");l.width=i.videoWidth,l.height=i.videoHeight;let o=l.getContext("2d");if(!o)throw Error("无法获取canvas上下文");o.drawImage(i,0,0),a.getTracks().forEach(e=>e.stop()),l.toBlob(t=>{t?(e(new File([t],`screenshot-${Date.now()}.png`,{type:"image/png"})),en.V.info("[UploadZone]","Screenshot captured",void 0,{sendToBackend:!1})):ei.c.error("截图转换失败")},"image/png",1)}catch(e){en.V.error("[UploadZone]","Screenshot failed",{error:e}),e instanceof Error&&("NotAllowedError"===e.name?ei.c.warning(i.upload.screenshotPermissionDenied):ei.c.error(`${i.upload.screenshotFailed}: ${e.message}`))}finally{c(!1)}};return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(a.N,{...m(),className:`group cursor-pointer rounded-2xl border-2 border-dashed shadow-none transition-all hover:border-primary/60 hover:bg-accent/40 ${f?"border-primary bg-accent/60":"border-border bg-card"}`,children:(0,t.jsxs)(a.O,{className:"flex min-h-[260px] flex-col items-center justify-center space-y-4 py-10 text-center md:min-h-[300px]",children:[(0,t.jsx)("input",{...p()}),(0,t.jsx)("div",{className:"rounded-2xl bg-accent p-4 text-primary transition-transform group-hover:scale-105",children:n?(0,t.jsx)(l.f,{className:"h-10 w-10 animate-spin"}):(0,t.jsx)(et,{className:"h-10 w-10"})}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:n?i.app.analyzing:i.upload.analyze}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n?i.app.analyzing:i.app.dragDrop}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:i.upload.support})]})]})}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:flex-wrap items-stretch sm:items-start justify-center gap-4",children:[u&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsxs)(s.f,{variant:"outline",onClick:h,disabled:n,className:"flex items-center gap-2 w-full sm:w-auto",children:[(0,t.jsx)(es,{className:"h-4 w-4"}),i.upload.paste]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:i.upload.pasteDesc})]}),x()&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsxs)(s.f,{variant:"outline",onClick:v,disabled:n||o,className:"flex items-center gap-2 w-full sm:w-auto",children:[o?(0,t.jsx)(l.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(er.f,{className:"h-4 w-4"}),o?i.common.pleaseWait:i.upload.screenshot]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:i.upload.screenshotDesc})]})]})]})}],798469);var ec=e.i(30030),ed=e.i(248425),eu=Object.defineProperty,em=(e,t)=>eu(e,"name",{value:t,configurable:!0}),ep="Progress",[ef,eg]=(0,ec.f)(ep),[eh,ex]=ef(ep),ev=r.forwardRef(em(function(e,r){let{__scopeProgress:a,value:s=null,max:n,getValueLabel:i=ew,...l}=e;(n||0===n)&&!eN(n)&&console.error(eS(`${n}`,"Progress"));let o=eN(n)?n:100;null===s||ek(s,o)||console.error(eA(`${s}`,"Progress"));let c=ek(s,o)?s:null,d=ej(c)?i(c,o):void 0;return(0,t.jsx)(eh,{scope:a,value:c,max:o,children:(0,t.jsx)(ed.V.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":ej(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":eb(c,o),"data-value":c??void 0,"data-max":o,...l,ref:r})})},"Progress")),ey=r.forwardRef(em(function(e,r){let{__scopeProgress:a,...s}=e,n=ex("ProgressIndicator",a);return(0,t.jsx)(ed.V.div,{"data-state":eb(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...s,ref:r})},"ProgressIndicator"));function ew(e,t){return`${Math.round(e/t*100)}%`}function eb(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function ej(e){return"number"==typeof e}function eN(e){return ej(e)&&!isNaN(e)&&e>0}function ek(e,t){return ej(e)&&!isNaN(e)&&e<=t&&e>=0}function eS(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 eA(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\`.`}em(ew,"defaultGetValueLabel"),em(eb,"getProgressState"),em(ej,"isNumber"),em(eN,"isValidMaxNumber"),em(ek,"isValidValueNumber"),em(eS,"getInvalidMaxError"),em(eA,"getInvalidValueError");var eE=e.i(975157);let eT=r.forwardRef(({className:e,value:r,...a},s)=>(0,t.jsx)(ev,{ref:s,value:r,className:(0,eE.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,t.jsx)(ey,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}})}));eT.displayName=ev.displayName;let eI={compressing:10,uploading:20,analyzing:50,processing:85,saving:95};function eD({status:e,message:a,className:s}){let n,{t:i}=(0,d.b)(),[o]=(0,r.useState)(()=>Date.now()),[c,u]=(0,r.useState)(0);(0,r.useEffect)(()=>{let e=setInterval(()=>{u(Math.max(0,Math.floor((Date.now()-o)/1e3)))},1e3);return()=>clearInterval(e)},[o]);let m=eI[e],p=i.common.progress.estimated.replace("{percent}",String(m));return(0,t.jsx)("div",{className:(0,eE.f)("fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",s),children:(0,t.jsx)("div",{className:"w-full max-w-md p-6 space-y-6 bg-card rounded-lg border shadow-lg mx-4",children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-4 text-center",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(l.f,{className:"h-12 w-12 animate-spin text-primary"}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center"})]}),(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold tracking-tight","aria-live":"polite",children:a||i.common.progress[e]}),(0,t.jsx)(eT,{value:m,"aria-label":p,"aria-valuetext":p,className:"h-2 w-full"})]}),(0,t.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 text-sm text-muted-foreground tabular-nums",children:[(0,t.jsx)("span",{children:p}),(0,t.jsx)("span",{role:"timer","aria-live":"off",children:i.common.progress.elapsed.replace("{time}",(n=[Math.floor(c/60)%60,c%60],c>=3600&&n.unshift(Math.floor(c/3600)),n.map(e=>String(e).padStart(2,"0")).join(":")))})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i.common.progress.estimateHint})]})})})}e.s(["f",0,function({status:e,message:r,className:a}){return eo()&&"idle"!==e?(0,t.jsx)(eD,{status:e,message:r,className:a}):null}],956738),e.s(["f",0,function({options:e,value:r,onChange:a,className:s}){return(0,t.jsx)("div",{className:(0,eE.f)("grid gap-1 rounded-xl bg-muted p-1",s),style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},role:"tablist",children:e.map(({value:e,label:s,icon:n})=>{let i=e===r;return(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":i,className:(0,eE.f)("flex items-center justify-center gap-1.5 rounded-lg px-2 py-2.5 text-sm font-medium transition-all",i?"bg-card text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>a(e),children:[n&&(0,t.jsx)(n,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:s})]},e)})})}],185592);var eC=e.i(618566),eF=e.i(303163);function eP(e,t){let r=t.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,eF.d)(e);if(a){let e=t.errors??{};if(!(a in e))return a;let s=e[a];return"string"==typeof s?s:r}let s=(0,eF.Z)(e);if(s.includes("fetch")||s.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}var eR=e.i(41931),eO=e.i(28928),e_=e.i(62825),eL=e.i(364002);function eM(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function eU(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({logPrefix:e,analyzeSubjectId:t,importSubjectId:a,textNotebook:s,fixedSubjectId:n,onParsed:i}){let{t:l,language:o}=(0,d.b)(),c=(0,eC.useRouter)(),[u,m]=(0,r.useState)("upload"),[p,f]=(0,r.useState)("idle"),[g,h]=(0,r.useState)(null),[x,v]=(0,r.useState)(null),[y,w]=(0,r.useState)(null),[b,j]=(0,r.useState)(null),[N,k]=(0,r.useState)(!1),[S,A]=(0,r.useState)(!1),[E,T]=(0,r.useState)(null),[I,D]=(0,r.useState)(null),[C,F]=(0,r.useState)(null),P=y?.timeouts?.analyze||18e4,R=P+1e4;(0,r.useEffect)(()=>()=>{b&&URL.revokeObjectURL(b)},[b]),(0,r.useEffect)(()=>{(0,eL.x)().then(A),eR.k.get("/api/settings").then(w).catch(t=>en.V.error(e,"Failed to fetch config",{error:t}))},[e]),(0,r.useEffect)(()=>{if("idle"===p)return;let e=setTimeout(()=>{en.V.warn("[Progress]","处理超时,关闭进度提示",{analysisStep:p,safetyTimeout:R}),f("idle")},R);return()=>clearTimeout(e)},[p,R]);let O=async(t,r,s)=>{if(!S){f("saving");let n=await (0,eL.a)(t,{subjectId:a,imageUrl:r,paperLevel:s});T(n),v(null),en.V.info(e,"Imported without review",{id:n.id});return}v(r),h(t),m("review")},_=async r=>{let a=Date.now();en.V.info(e,"Starting analysis flow",{apiTimeout:P,safetyTimeout:R});try{f("compressing");let s=await (0,eO.f)(r);f("analyzing");let n=await eR.k.post("/api/analyze",{imageBase64:s,language:o,subjectId:t||void 0},{timeout:P,recoverable:!0});if(!n||"object"!=typeof n)throw Error("Invalid API response: data is null or not an object");f("processing"),S&&i?.(n),await O(n,s),en.V.info(e,"Analysis completed",{totalDuration:Date.now()-a})}catch(t){en.V.error(e,"Analysis failed",{errorDuration:Date.now()-a,error:(0,eF.Z)(t)}),ei.c.error(eP(t,l))}finally{f("idle")}},L=async t=>{D(null);let r=Date.now();en.V.info(e,"Starting text-based analysis",{textLength:t.length});try{f("analyzing");let a=await eR.k.post("/api/reanswer",{questionText:t,language:o,forImport:!0,subject:s?.name,subjectId:s?.id},{timeout:P,recoverable:!0});f("processing"),await O({questionText:t,answerText:a.answerText,analysis:a.analysis,knowledgePoints:a.knowledgePoints||[],wrongAnswerText:a.wrongAnswerText||"",mistakeAnalysis:a.mistakeAnalysis||"",mistakeStatus:(0,e_.h)(a.mistakeStatus),subject:a.subject||"其他",requiresImage:!1,difficultyStars:a.difficultyStars??null,gradeSemester:a.gradeSemester??null},null),en.V.info(e,"Text analysis completed",{totalDuration:Date.now()-r})}catch(t){en.V.error(e,"Text analysis failed",{errorDuration:Date.now()-r,error:(0,eF.Z)(t)}),ei.c.error(eP(t,l))}finally{f("idle")}},M=async t=>{D(null);try{let e=await eR.k.post("/api/error-items",t);return ei.c.success(e.duplicate?l.importFlow.duplicate:l.common.messages.saveSuccess),e.duplicate?c.push(`/error-items/${e.id}`):t.subjectId&&c.push(`/notebooks/${t.subjectId}`),!0}catch(r){en.V.error(e,"Save failed",{errorMessage:(0,eF.d)(r)??(0,eF.Z)(r)});let t=function(e,t){let r=eM(e),a=eM(r?.data),s="number"==typeof r?.status?r.status:void 0,n=(0,eF.d)(e),i=eU(n,t)??eU(a?.code,t),l={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},o=i??(s?l[s]:void 0)??t.errors.QUESTION_SAVE_FAILED;!s&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,eF.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let c=eM(a?.details);if("QUESTION_SAVE_GRADE_FAILED"===n){let e=eU(c?.reason,t);e&&(o+=`
7
- ${e}`)}return 400===s&&(o+=(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=eM(e),s=a?.path,n=Array.isArray(s)&&"string"==typeof s[0]?r[s[0]]:void 0;if(!n)return[];let i=a?.maximum,l=t.questionSave.invalidField;return a?.code==="too_big"&&"number"==typeof i&&Number.isSafeInteger(i)&&i>=0&&(l="array"===a.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",n).replace("{maximum}",String(i))]})})(a?.details,t).map(e=>`
8
- ${e}`).join("")),"string"==typeof c?.databaseCode&&/^P\d{4}$/.test(c.databaseCode)&&(o+=`
9
- ${t.questionSave.databaseCode.replace("{code}",c.databaseCode)}`),s&&(o+=` (HTTP ${s})`),o}(r,l);return D(t),"AI_DAILY_LIMIT_EXCEEDED"!==(0,eF.d)(r)&&ei.c.error(t),!1}},U=async e=>{await M({...e,originalImageUrl:x||"",...n?{subjectId:n}:{}})&&(m("upload"),h(null),v(null))};return{step:u,cancelReview:()=>{m("upload"),D(null)},saveError:I,dismissSaveError:()=>D(null),analysisStep:p,setAnalysisStep:f,isBusy:"idle"!==p,parsedData:g,currentImage:x,aiTimeout:P,croppingImage:b,isCropperOpen:N,closeCropper:()=>k(!1),lastImported:E,dismissImported:()=>T(null),batchBlobs:C,closeBatch:()=>F(null),selectImage:e=>{T(null),D(null),j(URL.createObjectURL(e)),k(!0)},cropComplete:e=>{k(!1),_(new File([e],"cropped-image.jpg",{type:"image/jpeg"}))},startBatch:e=>{k(!1),T(null),D(null),F(e)},submitText:L,saveQuestion:M,saveReviewed:U}}],267275)}])})();
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,204573,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(522016),r=e.i(618566),n=e.i(711241),i=e.i(456420);let l={name:"file-question-mark",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]],aliases:["file-question"]};l.node;let o=(0,i.f)(l);var c=e.i(741120),u=e.i(759659),d=e.i(469937),m=e.i(314381),g=e.i(632781),h=e.i(3198),x=e.i(519455),f=e.i(111110),p=e.i(41931),v=e.i(303163),j=e.i(201276);function y({errorItemId:e,commands:s,onUpdate:r}){let{t:n}=(0,f.b)(),[i,l]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),u=async()=>{l(!0),c(null);try{let t=await p.k.post(`/api/error-items/${e}/geogebra`,{},{recoverable:!0});t.suitable&&t.commands.length>0?r({geogebraCommands:JSON.stringify(t.commands)}):c(t.description||n.geogebra.notSuitable)}catch(t){j.V.error("[ErrorDetail]","GeoGebra analysis failed",{error:t});let e=(0,v.d)(t)||(0,v.Z)(t);e.includes("AI_AUTH_ERROR")?c(n.geogebra.authFailed):e.includes("AI_CONNECTION")?c(n.geogebra.connectionFailed):c(n.geogebra.analyzeFailed)}finally{l(!1)}},d=async t=>{await p.k.put(`/api/error-items/${e}`,{geogebraCommands:t}),r({geogebraCommands:t})},b=async()=>{await p.k.delete(`/api/error-items/${e}/geogebra`),r({geogebraCommands:null})};return s?(0,t.jsx)(h.f,{commands:s,height:700,showToolBar:!0,showAlgebraInput:!1,showMenuBar:!1,onRegenerate:u,onSaveCommands:d,onDelete:b}):(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)(m.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:n.geogebra.title})]}),(0,t.jsx)(x.f,{variant:"outline",size:"sm",onClick:u,disabled:i,children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.f,{className:"mr-2 h-4 w-4 animate-spin"}),n.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.f,{className:"mr-2 h-4 w-4"}),n.geogebra.generate]})})]}),o&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:o}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:n.geogebra.hint})]})}function b({src:e,onClose:a}){let{t:s}=(0,f.b)();return e?(0,t.jsx)("div",{className:"fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",onClick:a,children:(0,t.jsxs)("div",{className:"relative max-w-7xl max-h-full",children:[(0,t.jsx)("button",{className:"absolute -top-12 right-0 text-white hover:text-gray-300 text-lg font-semibold bg-black/50 px-4 py-2 rounded",onClick:a,children:s.detail?.close||"✕ Close"}),(0,t.jsx)("img",{src:e,alt:"Full size",className:"max-w-full max-h-[90vh] object-contain rounded-lg",onClick:e=>e.stopPropagation()}),(0,t.jsx)("p",{className:"text-center text-white/70 text-sm mt-4",children:s.detail?.clickOutside||"Click outside to close"})]})}):null}var w=e.i(141176),N=e.i(511445),k=e.i(515288);let A={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};A.node;let S=(0,i.f)(A);var C=e.i(856522),I=e.i(263676);function E({onClick:e,label:a}){let{t:s}=(0,f.b)();return(0,t.jsxs)(x.f,{variant:"ghost",size:"sm",onClick:e,children:[(0,t.jsx)(S,{className:"h-4 w-4 mr-1"}),a||s.common?.edit||"Edit"]})}function L({onSave:e,onCancel:a,children:s}){let{t:r}=(0,f.b)();return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(x.f,{size:"sm",onClick:e,children:[(0,t.jsx)(C.f,{className:"h-4 w-4 mr-1"}),r.common?.save||"Save"]}),(0,t.jsxs)(x.f,{size:"sm",variant:"outline",onClick:a,children:[(0,t.jsx)(I.X,{className:"h-4 w-4 mr-1"}),r.common?.cancel||"Cancel"]}),s]})}function T({title:e,actions:a}){return(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[e,a]})}var F=e.i(294114);function M({read:e,save:t,logLabel:s,successMessage:r,failureMessage:n}){let{t:i}=(0,f.b)(),[l,o]=(0,a.useState)(!1),[c,u]=(0,a.useState)(e),d=async()=>{try{await t(c),o(!1),F.c.success(r||i.common?.messages?.saveSuccess||"Saved successfully")}catch(e){j.V.error("[ErrorDetail]",`Failed to save ${s}`,{error:e}),F.c.error(n||i.common?.messages?.saveFailed||"Save failed")}};return{editing:l,value:c,setValue:u,start:()=>{u(e()),o(!0)},cancel:()=>o(!1),submit:d}}function z({title:e,value:a,onSave:s,logLabel:r,rows:n,placeholder:i,editorLabel:l,emptyText:o,cardClassName:c,titleClassName:u,contentClassName:d,headerActions:m,children:g}){let h=M({read:()=>a||"",save:s,logLabel:r}),x=(0,t.jsx)(w.f,{value:h.value,onChange:h.setValue,placeholder:i,rows:n,className:"w-full font-mono text-sm"});return(0,t.jsxs)(k.N,{className:c,children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(T,{title:(0,t.jsx)(k.v,{className:u,children:e}),actions:!h.editing&&(0,t.jsxs)("div",{className:"flex flex-wrap justify-end",children:[m,(0,t.jsx)(E,{onClick:h.start})]})})}),(0,t.jsxs)(k.O,{className:"space-y-4",children:[h.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[l?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:l}),x]}):x,(0,t.jsx)(L,{onSave:h.submit,onCancel:h.cancel})]}):!a&&o?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:o}):(0,t.jsx)(N.f,{content:a,className:d}),g]})]})}var R=e.i(624687);function $({item:e,onUpdate:a}){let{t:s}=(0,f.b)(),r=M({read:()=>e.userNotes||"",save:async t=>{await p.k.patch(`/api/error-items/${e.id}/notes`,{userNotes:t}),a({userNotes:t})},logLabel:"notes",successMessage:s.common?.messages?.noteSaveSuccess||"Notes saved successfully"});return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(T,{title:(0,t.jsx)(k.v,{children:s.detail.yourNotes}),actions:!r.editing&&(0,t.jsx)(E,{onClick:r.start,label:s.detail.editNotes})})}),(0,t.jsx)(k.O,{children:r.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(R.f,{value:r.value,onChange:e=>r.setValue(e.target.value),placeholder:s.detail.notesPlaceholder||"Enter your notes...",rows:5,className:"w-full"}),(0,t.jsx)(L,{onSave:r.submit,onCancel:r.cancel})]}):(0,t.jsx)("div",{className:"whitespace-pre-wrap",children:e.userNotes?(0,t.jsx)("p",{className:"text-foreground",children:e.userNotes}):(0,t.jsx)("p",{className:"text-muted-foreground italic",children:s.detail.noNotes})})})]})}let V={name:"shapes",size:24,node:[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]};V.node;let O=(0,i.f)(V);function U({errorItemId:e,onDone:s}){let{t:r}=(0,f.b)(),[n,i]=(0,a.useState)(!1),l=async()=>{i(!0);try{let t=await p.k.post(`/api/error-items/${e}/figure`,{},{recoverable:!0});s(t),t.figureSvg||F.c.warning(r.figure.noFigure)}catch(a){let e=a?.data?.message||"",t=r.errors[e];j.V.error("[RegenerateFigure]","Failed to regenerate figure",{code:e}),F.c.error("NO_ORIGINAL_IMAGE"===e?r.figure.noImage:"string"==typeof t?t:r.figure.failed)}finally{i(!1)}};return(0,t.jsxs)(x.f,{variant:"outline",size:"sm",onClick:l,disabled:n,className:"flex items-center gap-2",children:[n?(0,t.jsx)(g.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(O,{className:"h-4 w-4"}),n?r.figure.regenerating:r.figure.regenerate]})}let q={name:"image-plus",size:24,node:[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};q.node;let D=(0,i.f)(q);var _=e.i(12130),P=e.i(28928);function H({errorItemId:e,hasImage:s,onDone:r}){let{t:n}=(0,f.b)(),i=(0,a.useRef)(null),[l,o]=(0,a.useState)(!1),[c,u]=(0,a.useState)(null);(0,a.useEffect)(()=>()=>{c&&URL.revokeObjectURL(c)},[c]);let d=async()=>{(!s||await (0,F.u)(n.replaceImage.confirm))&&i.current?.click()},m=async t=>{u(null),o(!0);try{let a=new File([t],"question-image.jpg",{type:t.type||"image/jpeg"}),s=await (0,P.f)(a),i=await p.k.put(`/api/error-items/${e}/image`,{imageDataUrl:s});r(i.originalImageUrl),F.c.success(n.replaceImage.done)}catch(t){let e=t?.data?.message||"";j.V.error("[ReplaceImage]","Failed to replace original image",{code:e}),F.c.error("INVALID_IMAGE"===e?n.replaceImage.invalid:n.replaceImage.failed)}finally{o(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:i,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",className:"hidden",onChange:e=>{(e=>{if(e){if(!e.type.startsWith("image/"))return F.c.error(n.replaceImage.invalid);u(URL.createObjectURL(e))}})(e.target.files?.[0]),e.target.value=""}}),c&&(0,t.jsx)(_.f,{imageSrc:c,open:!0,onClose:()=>u(null),onCropComplete:m}),(0,t.jsxs)(x.f,{variant:"outline",size:"sm",onClick:d,disabled:l,className:"flex items-center gap-2",children:[l?(0,t.jsx)(g.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(D,{className:"h-4 w-4"}),l?n.replaceImage.uploading:s?n.replaceImage.replace:n.replaceImage.add]})]})}var G=e.i(520732),B=e.i(438465),W=e.i(28342),X=e.i(674166),Z=e.i(664030);function K({item:e,onChanged:a}){let{t:s}=(0,f.b)(),r=s.common?.notSet||"Not set",{groups:n}=(0,Z.f)(),i=M({read:()=>({subjectId:e.subjectId||null,gradeSemester:e.gradeSemester||"",paperLevel:e.paperLevel||""}),save:async t=>{let{subjectId:s,paperLevel:r,...n}=t;await p.k.put(`/api/error-items/${e.id}`,{...n,...r!==(e.paperLevel||"")?{paperLevel:r||null}:{},...s!==(e.subjectId||null)?{subjectId:s}:{}}),await a()},logLabel:"metadata",successMessage:s.common?.messages?.metaUpdateSuccess||"Metadata updated successfully!",failureMessage:s.common?.messages?.updateFailed||"Update failed"}),l=e=>i.setValue({...i.value,...e});return(0,t.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,t.jsx)(T,{title:(0,t.jsx)("h4",{className:"text-sm font-semibold",children:s.detail?.questionInfo||"Question Info"}),actions:!i.editing&&(0,t.jsx)(E,{onClick:i.start})}),i.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:s.notebooks?.title||"Notebook"}),(0,t.jsx)(B.f,{value:i.value.subjectId||void 0,onChange:e=>l({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"detail-grade-semester",className:"text-sm text-muted-foreground",children:s.editor.gradeSemester}),(0,t.jsx)(W.f,{id:"detail-grade-semester",value:i.value.gradeSemester,onChange:e=>l({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:s.filter.paperLevel}),(0,t.jsx)(X.f,{value:i.value.paperLevel,onChange:e=>l({paperLevel:e})})]}),(0,t.jsx)(L,{onSave:i.submit,onCancel:i.cancel})]}):(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[s.notebooks?.title||"Notebook",":"]}),(0,t.jsx)("span",{className:"font-medium",children:e.subject?.name||r})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[s.editor.gradeSemester,":"]}),(0,t.jsx)("span",{className:"font-medium",children:e.gradeSemester||r})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[s.filter.paperLevel,":"]}),(0,t.jsx)("span",{className:"font-medium",children:(e=>{if(!e)return r;let t=n.find(t=>t.id===e);return t?.name||e})(e.paperLevel)})]})]})]})}var Q=e.i(487486),Y=e.i(328623);function J({errorItemId:e,onDone:s,onSuggested:r}){let{t:n}=(0,f.b)(),[i,l]=(0,a.useState)(!1),o=async()=>{l(!0);try{if(r){let t=await p.k.post(`/api/error-items/${e}/retag`,{preview:!0},{recoverable:!0});r(t.tags)}else await p.k.post(`/api/error-items/${e}/retag`,{},{recoverable:!0}),s?.()}catch(a){let e=a?.data?.message||"",t=n.errors[e];j.V.error("[RetagItem]","Failed to regenerate tags",{code:e}),F.c.error("NO_TAGS_SELECTED"===e?n.retag.noTags:"string"==typeof t?t:n.retag.itemFailed)}finally{l(!1)}};return(0,t.jsxs)(x.f,{variant:"ghost",size:"sm",onClick:o,disabled:i,children:[i?(0,t.jsx)(g.f,{className:"h-4 w-4 mr-1 animate-spin"}):(0,t.jsx)(Y.f,{className:"h-4 w-4 mr-1"}),r?i?n.retag.suggestRunning:n.retag.suggestButton:i?n.retag.itemRunning:n.retag.itemButton]})}var ee=e.i(574041),et=e.i(952122),ea=e.i(990745);function es({item:e,educationStage:a,onChanged:s}){let{t:r}=(0,f.b)(),n=(0,ea.f)(e),i=M({read:()=>(0,ea.f)(e),save:async t=>{await p.k.put(`/api/error-items/${e.id}`,{knowledgePoints:t}),await s()},logLabel:"tags",successMessage:r.common?.messages?.tagUpdateSuccess||"Tags updated successfully!",failureMessage:r.common?.messages?.updateFailed||"Update failed"});return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(T,{title:(0,t.jsx)("h4",{className:"text-sm font-semibold",children:r.editor?.tags||"Knowledge Tags"}),actions:!i.editing&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(J,{errorItemId:e.id,onDone:s}),(0,t.jsx)(E,{onClick:i.start})]})}),i.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(ee.f,{value:i.value,onChange:i.setValue,placeholder:r.editor?.tagsPlaceholder||"Enter or select knowledge tags...",subject:(0,et.f)(e.subject?.name||null)||void 0,gradeStage:a}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r.editor?.tagsHint||"Select from standard or custom tags"}),(0,t.jsx)(L,{onSave:i.submit,onCancel:i.cancel,children:(0,t.jsx)(J,{errorItemId:e.id,onSuggested:i.setValue})})]}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,t.jsx)(Q.f,{variant:"secondary",children:e},e))})]})}var er=e.i(580860);let en={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};en.node;let ei=(0,i.f)(en);function el({src:e,alt:a,showLabel:s,hideLabel:r,visible:n,onVisibleChange:i,onEnlarge:l,variant:o="ghost",actions:c}){let{t:u}=(0,f.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e&&(0,t.jsx)(x.f,{variant:o,size:"sm",onClick:()=>i(!n),className:`flex items-center gap-2 ${"ghost"===o?"text-muted-foreground":""}`,children:n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(er.f,{className:"h-4 w-4"}),r]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{className:"h-4 w-4"}),s]})}),c]}),e&&n&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("img",{src:e,alt:a,className:"w-full rounded-lg border cursor-pointer hover:opacity-90 transition-opacity",onClick:()=>l(e)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1 text-center",children:u.detail?.clickToEnlarge||"Click to enlarge"})]})]})}function eo({item:e,educationStage:s,saveFields:r,onUpdate:n,reload:i,onEnlarge:l}){let{t:o}=(0,f.b)(),[c,u]=(0,a.useState)(!1),d=M({read:()=>e.questionText,save:e=>r({questionText:e}),logLabel:"question"});return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(T,{title:(0,t.jsx)(k.v,{children:o.detail.question}),actions:!d.editing&&(0,t.jsx)(E,{onClick:d.start})})}),(0,t.jsxs)(k.O,{className:"space-y-4",children:[d.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(w.f,{value:d.value,onChange:d.setValue,placeholder:"Enter question text...",rows:8,className:"w-full font-mono text-sm"}),(0,t.jsx)(L,{onSave:d.submit,onCancel:d.cancel})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.f,{content:e.questionText}),(0,t.jsx)(G.f,{svg:e.figureSvg,scale:e.figureScale,align:e.figureAlign,onSave:(e,t)=>r({figureScale:e,figureAlign:t})},`${e.id}-${e.figureScale??100}-${e.figureAlign??"center"}`)]}),(0,t.jsx)(es,{item:e,educationStage:s,onChanged:i}),(0,t.jsx)(K,{item:e,onChanged:i}),(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(el,{src:e.originalImageUrl,alt:o.detail.originalProblem||"Original Problem",showLabel:o.replaceImage?.view||"View original image",hideLabel:o.replaceImage?.hide||"Hide original image",variant:"outline",visible:c,onVisibleChange:u,onEnlarge:l,actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H,{errorItemId:e.id,hasImage:!!e.originalImageUrl,onDone:e=>{n({originalImageUrl:e}),u(!0)}}),e.originalImageUrl&&(0,t.jsx)(U,{errorItemId:e.id,onDone:n})]})})})]})]})}var ec=e.i(967489),eu=e.i(62825);function ed({item:e,saveFields:s,onEnlarge:r}){let{t:n,language:i}=(0,f.b)(),[l,o]=(0,a.useState)(!1),c=M({read:()=>({text:e.wrongAnswerText||"",status:e.mistakeStatus||"unknown"}),save:({text:e,status:t})=>s({wrongAnswerText:e,mistakeStatus:(0,eu.x)(t,e)}),logLabel:"wrong answer"});return(0,t.jsxs)(k.N,{children:[(0,t.jsx)(k.Y,{children:(0,t.jsx)(T,{title:(0,t.jsx)(k.v,{children:n.editor?.wrongAnswerText||"Wrong Answer / Work"}),actions:!c.editing&&(0,t.jsx)(E,{onClick:c.start})})}),(0,t.jsx)(k.O,{className:"space-y-4",children:c.editing?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:n.editor?.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(ec.d,{value:c.value.status,onValueChange:e=>c.setValue({...c.value,status:e}),children:[(0,t.jsx)(ec.P,{children:(0,t.jsx)(ec.U,{})}),(0,t.jsxs)(ec.r,{children:[(0,t.jsx)(ec.T,{value:"not_attempted",children:n.editor?.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(ec.T,{value:"wrong_attempt",children:n.editor?.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(ec.T,{value:"unknown",children:n.editor?.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:n.editor?.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(w.f,{value:c.value.text,onChange:e=>c.setValue({text:e,status:e.trim()?"wrong_attempt":c.value.status}),rows:5,className:"w-full font-mono text-sm"})]}),(0,t.jsx)(L,{onSave:c.submit,onCancel:c.cancel})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(Q.f,{variant:"secondary",children:(0,eu.i)(e.mistakeStatus,i)}),e.wrongAnswerText?(0,t.jsx)(N.f,{content:e.wrongAnswerText}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:n.detail?.noMistakeAnalysis||"No mistake analysis yet."}),e.wrongAnswerImageUrl&&(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(el,{src:e.wrongAnswerImageUrl,alt:n.detail.wrongAnswerImageAlt,showLabel:n.detail.viewImage,hideLabel:n.detail.hideImage,visible:l,onVisibleChange:o,onEnlarge:r})})]})})]})}let em={name:"square-function",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],aliases:["function-square"]};em.node;let eg=(0,i.f)(em);var eh=e.i(716400),ex=e.i(369939);let ef=new Set(["ne","neq","nabla","nu","not","notin","ni","nexists","ngeq","nleq","nmid","nparallel","nsubseteq"]);function ep(e){return e.length>80?`${e.slice(0,80)}…`:e}let ev=["questionText","answerText","analysis","wrongAnswerText","mistakeAnalysis"];function ej({errorItemId:e,fields:s,onDone:r}){let{t:n}=(0,f.b)(),[i,l]=(0,a.useState)(!1),o=(0,a.useMemo)(()=>Object.values(function(e){let t={};for(let a of ev){let s=function(e){if(!e?.trim())return[];let{masked:t,segments:a}=(0,ex.F)(e),s=[];for(let e of a)try{eh.f.renderToString(e.tex,{displayMode:e.displayMode,throwOnError:!0,strict:"ignore"})}catch(a){let t=a instanceof Error?a.message.replace(/^KaTeX parse error:\s*/,""):String(a);s.push({snippet:ep(e.source),message:t})}let r=t.replace(/@@MATH\d+@@/g," "),n=r.replace(/\\\$/g,"").match(/\$/g);n&&s.push({snippet:"$",message:`有 ${n.length} 个未配对的 $ 定界符`});let i=r.match(/\\[()[\]]/g);i&&s.push({snippet:i.join(" "),message:"有未配对的 \\( \\) 或 \\[ \\] 定界符"});let l=[...new Set(r.match(/\\[a-zA-Z]{2,}/g)||[])].filter(e=>!e.startsWith("\\n")||ef.has(e.slice(1)));return l.length>0&&s.push({snippet:ep(l.join(" ")),message:"LaTeX 命令没有放在 $…$ 中,会原样显示"}),s}(e[a]);s.length>0&&(t[a]=s)}return t}(s)).reduce((e,t)=>e+(t?.length??0),0),[s]),c=async()=>{l(!0);try{let t=await p.k.post(`/api/error-items/${e}/fix-latex`,{},{timeout:3e5,recoverable:!0});r(t.updated);let a=t.fixedFields.map(e=>n.fixLatex.fields[e]).join(n.common.listSeparator);F.c.info(0===t.issuesBefore?n.fixLatex.noIssues:0===t.fixedFields.length?n.fixLatex.notFixed:0===t.issuesAfter?n.fixLatex.fixedAll.replace("{fields}",a):n.fixLatex.fixedPartly.replace("{fields}",a).replace("{count}",String(t.issuesAfter)))}catch(a){let e=a?.data?.message||"",t=n.errors[e];j.V.error("[FixLatex]","Failed to fix LaTeX",{code:e}),F.c.error("string"==typeof t?t:n.fixLatex.failed)}finally{l(!1)}};return 0!==o||i?(0,t.jsxs)(x.f,{variant:"outline",size:"sm",onClick:c,disabled:i,className:"border-amber-500 text-amber-700 dark:text-amber-400",title:n.fixLatex.issuesFound.replace("{count}",String(o)),children:[i?(0,t.jsx)(g.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(eg,{className:"mr-2 h-4 w-4"}),i?n.fixLatex.running:n.fixLatex.button,!i&&o>0&&(0,t.jsxs)("span",{className:"ml-1",children:["(",o,")"]})]}):null}var ey=e.i(991686),eb=e.i(846968),ew=e.i(931454);function eN({errorItemId:e,onDone:s}){let{t:r,language:n}=(0,f.b)(),[i,l]=(0,a.useState)(!1),o=async()=>{if(await (0,F.u)(r.reanswerItem.confirm)){l(!0);try{let t=await p.k.post(`/api/error-items/${e}/reanswer`,{language:n},{timeout:6e5,recoverable:!0});s(t)}catch(a){let e=a?.data?.message||"",t=r.errors[e];j.V.error("[RegenerateAnswer]","Failed to regenerate answer",{code:e}),F.c.error("NO_QUESTION_TEXT"===e?r.reanswerItem.noQuestionText:"string"==typeof t?t:r.reanswerItem.failed)}finally{l(!1)}}};return(0,t.jsxs)(x.f,{variant:"ghost",size:"sm",onClick:o,disabled:i,children:[i?(0,t.jsx)(g.f,{className:"h-4 w-4 mr-1 animate-spin"}):(0,t.jsx)(ew.f,{className:"h-4 w-4 mr-1"}),i?r.reanswerItem.running:r.reanswerItem.button]})}var ek=e.i(689664);let eA={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};eA.node;let eS=(0,i.f)(eA);function eC({shortId:e,className:s=""}){let{t:r}=(0,f.b)(),[n,i]=(0,a.useState)(!1);if(!e)return null;let l=async t=>{t.preventDefault(),t.stopPropagation();try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{window.prompt(r.shortId.copy,e)}};return(0,t.jsxs)("button",{type:"button",onClick:l,title:n?r.shortId.copied:r.shortId.copy,className:`inline-flex items-center gap-1 rounded-md border bg-muted/50 px-2 py-0.5 font-mono text-xs text-muted-foreground hover:text-foreground transition-colors ${s}`,children:[(0,t.jsx)("span",{children:r.shortId.label}),(0,t.jsx)("span",{className:"font-semibold text-foreground",children:e}),n?(0,t.jsx)(ek.f,{className:"h-3 w-3 text-green-600"}):(0,t.jsx)(eS,{className:"h-3 w-3"})]})}let eI={name:"audio-lines",size:24,node:[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]};eI.node;let eE=(0,i.f)(eI),eL={name:"clapperboard",size:24,node:[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]]};eL.node;let eT=(0,i.f)(eL),eF={name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]};eF.node;let eM=(0,i.f)(eF),ez={name:"minimize",size:24,node:[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]};ez.node;let eR=(0,i.f)(ez),e$={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};e$.node;let eV=(0,i.f)(e$);var eO=e.i(21357),eU=e.i(395925);let eq={name:"volume-2",size:24,node:[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]};eq.node;let eD=(0,i.f)(eq),e_={name:"volume-x",size:24,node:[["path",{d:"M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z",key:"1p7khw"}],["path",{d:"m16.5 14.5 5-5",key:"cul3yw"}],["path",{d:"m16.5 9.5 5 5",key:"1akey5"}]]};e_.node;let eP=(0,i.f)(e_);var eH=e.i(975157);function eG({supported:e,enabled:a,rate:s,fullscreen:r,onToggle:n,onCycleRate:i}){let{t:l}=(0,f.b)(),o=(0,eH.f)("h-8 shrink-0",r&&"text-white hover:bg-white/20 hover:text-white"),c=e?a?l.svgAnimation.voiceOff:l.svgAnimation.voiceOn:l.svgAnimation.voiceUnsupported;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{title:c,className:"shrink-0",children:(0,t.jsx)(x.f,{variant:"ghost",size:"sm",className:(0,eH.f)(o,"w-8 p-0",a&&e&&!r&&"text-primary"),onClick:n,disabled:!e,"aria-label":c,"aria-pressed":a&&e,children:a&&e?(0,t.jsx)(eD,{className:"h-4 w-4"}):(0,t.jsx)(eP,{className:"h-4 w-4"})})}),a&&e&&(0,t.jsxs)(x.f,{variant:"ghost",size:"sm",className:(0,eH.f)(o,"px-1.5 text-xs tabular-nums"),onClick:i,"aria-label":l.svgAnimation.voiceRate,title:l.svgAnimation.voiceRate,children:[s,"×"]})]})}let eB=/<metadata\b[^>]*\bid\s*=\s*["']narration["'][^>]*>([\s\S]*?)<\/metadata\s*>/gi,eW={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};function eX(e){let t=e;if("string"==typeof t){let e=t.indexOf("["),a=t.lastIndexOf("]");if(-1===e||a<e)return null;try{t=JSON.parse(t.slice(e,a+1))}catch{return null}}if(!Array.isArray(t))return null;let a=[];for(let e of t){if(!e||"object"!=typeof e)continue;let{begin:t,text:s}=e,r="number"==typeof t?t:"string"==typeof t?eY(t):null;if(null===r||!Number.isFinite(r)||r<0||"string"!=typeof s)continue;let n=s.replace(/\s+/g," ").trim();n&&a.push({begin:Math.round(100*r)/100,text:n})}a.sort((e,t)=>e.begin-t.begin);let s=[];for(let e of a){let t=s[s.length-1];t&&t.begin===e.begin?t.text=`${t.text} ${e.text}`:s.push({...e})}let r=s.slice(0,20).map(e=>({...e,text:e.text.slice(0,300)}));return r.length>0?r:null}function eZ(e){for(let t of e.matchAll(eB)){let e=eX(t[1].replace(/&(#x[0-9a-f]+|#\d+|lt|gt|amp|quot|apos);/gi,(e,t)=>{if("#"!==t[0])return eW[t.toLowerCase()];let a="x"===t[1]||"X"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1));return Number.isFinite(a)&&a<=1114111?String.fromCodePoint(a):e}));if(e)return e}return null}let eK=/<(?:animate|animateTransform|animateMotion|set)\b[^>]*>/gi;function eQ(e,t){let a=e.match(RegExp(`\\s${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i"));return a?(a[2]??a[3]??"").trim():null}function eY(e){if(!e)return null;let t=e.trim(),a=t.match(/^(?:(\d+):)?(\d+):(\d+(?:\.\d+)?)$/);if(a)return 3600*Number(a[1]??0)+60*Number(a[2])+Number(a[3]);let s=t.match(/^(\d+(?:\.\d+)?)(h|min|s|ms)?$/);if(!s)return null;let r={h:3600,min:60,s:1,ms:.001}[s[2]??"s"]??1;return Number(s[1])*r}let eJ=new Set(["opacity","visibility","display","fill-opacity"]);function e0(e){let t=e.getAttribute("viewBox")?.split(/[\s,]+/).map(Number),a=t?.length===4&&t[3]>0?t[1]+t[3]:parseFloat(e.getAttribute("height")??"");if(!(a>0))return null;let s=t?.length===4?t[1]+.78*t[3]:.78*a,r=[];for(let t of Array.from(e.querySelectorAll("text"))){if(t.closest("defs, metadata"))continue;let a=parseFloat(t.getAttribute("y")??t.querySelector("tspan[y]")?.getAttribute("y")??"");if(!(a>=s))continue;let n=Array.from(t.querySelectorAll("tspan")),i=(n.length>0?n.map(e=>e.textContent??"").join(" "):t.textContent??"").replace(/\s+/g," ").trim(),l=function(e,t){for(let a=e;a&&a!==t;a=a.parentElement)for(let e of Array.from(a.children)){let t=e.localName;if("set"!==t&&"animate"!==t)continue;let a=e.getAttribute("attributeName")??"";if(eJ.has(a)&&!function(e,t){if(null===t)return!1;let a=t.trim();return"visibility"===e?"hidden"===a:"display"===e?"none"===a:0===Number(a)}(a,e.getAttribute("to")??e.getAttribute("values")?.split(";").pop()??null))return eY((e.getAttribute("begin")??"0").split(";")[0])}return 0}(t,e);i&&null!==l&&r.push({begin:l,y:a,text:i})}return r.sort((e,t)=>e.begin-t.begin||e.y-t.y),eX(r.map(({begin:e,text:t})=>({begin:e,text:t})))}var e1=e.i(79058);let e2=[1,1.25,1.5,.75],e4="svg-narration-enabled",e3="svg-narration-rate";function e5(e){try{return localStorage.getItem(e)}catch{return null}}function e8(e,t){try{localStorage.setItem(e,t)}catch{}}let e6={zh:["zh","cmn"],en:["en"]};function e7(){return"speechSynthesis"in window&&"u">typeof SpeechSynthesisUtterance?window.speechSynthesis:null}let e9=!1;function te(){let e=e7();if(!e||e9)return;e9=!0;let t=new SpeechSynthesisUtterance(" ");t.volume=0,e.speak(t)}function tt(e,t){return Math.max(8e3,400*e.length/t+5e3)}function ta(e,t){let a=-1;for(let s=0;s<e.length&&e[s].begin<=t+.05;s++)a=s;return a}function ts(e){let t=Math.max(0,Math.floor(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function tr({svg:e,errorItemId:s}){let{t:r,language:n}=(0,f.b)(),i=(0,a.useRef)(null),l=(0,a.useRef)(null),o=(0,a.useRef)(null),[c,u]=(0,a.useState)(null),[d,m]=(0,a.useState)(!1),[g,h]=(0,a.useState)(0),[p,v]=(0,a.useState)(!1),[j,y]=(0,a.useState)(!1),b=p||j,w=(0,a.useMemo)(()=>(function(e){let t=0;for(let a of e.match(eK)||[]){let e=eQ(a,"begin"),s=null===e?0:eY(e.split(";")[0]);if(null===s)continue;let r=eQ(a,"repeatCount");if("indefinite"!==r&&"indefinite"!==eQ(a,"repeatDur"))t=Math.max(t,s+(eY(eQ(a,"dur"))??0)*(r&&Number.isFinite(Number(r))?Number(r):1))}return t})(e),[e]),N=(0,a.useMemo)(()=>(function(e){let t=e.match(/<svg\b[^>]*>/i)?.[0]??"",a=eQ(t,"viewBox")?.split(/[\s,]+/).map(Number);if(a?.length===4&&a[2]>0&&a[3]>0)return a[2]/a[3];let s=parseFloat(eQ(t,"width")??""),r=parseFloat(eQ(t,"height")??"");return s>0&&r>0?s/r:1.6})(e),[e]),k=(0,a.useMemo)(()=>`<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:"><style>html,body{margin:0;height:100%;background:#fff;overflow:hidden}svg{display:block;width:100%;height:100%}</style></head><body>${e}</body></html>`,[e]),A=(0,a.useMemo)(()=>eZ(e),[e]),[S,C]=(0,a.useState)(null),I=A??S,E=(0,a.useCallback)(()=>{let e=l.current?.contentDocument;return"function"==typeof e?.getAnimations?e.getAnimations():[]},[]),L=function({segments:e,language:t,errorItemId:s,holdAnimation:r}){let[n,i]=(0,a.useState)(!1),[l,o]=(0,a.useState)("browser"),[c,u]=(0,a.useState)(!1),[d,m]=(0,a.useState)(1),[g,h]=(0,a.useState)(!1),[x,f]=(0,a.useState)(!1),p=(0,a.useRef)(void 0),v=(0,a.useRef)(-1),j=(0,a.useRef)(!1),y=(0,a.useRef)(null),b=(0,a.useRef)(0),w=(0,a.useRef)(null),N=(0,a.useRef)(null),k=(0,a.useRef)(!1),A=(0,a.useRef)("browser"),S=(0,a.useRef)(!1),C=(0,a.useRef)(!1),I=(0,a.useRef)(1),E=(0,a.useRef)(r);(0,a.useEffect)(()=>{E.current=r},[r]),(0,a.useEffect)(()=>{C.current="1"===e5(e4),u(C.current);let e=Number(e5(e3));e2.includes(e)&&(I.current=e,m(e))},[]),(0,a.useEffect)(()=>{let e=!0;return(0,e1.v)().then(t=>{e&&(A.current=t,o(t))}),()=>{e=!1}},[]),(0,a.useEffect)(()=>{let e=e7();if(!e)return;let a=()=>{let a,s,r,n=e.getVoices();a=e6[t],s=n.filter(e=>a.some(t=>e.lang.toLowerCase().startsWith(t))),r="zh"===t?/^(zh|cmn)[-_](cn|hans)/i:/^en[-_]us/i,p.current=s.find(e=>r.test(e.lang)&&e.localService)??s.find(e=>r.test(e.lang))??s[0],i(0===n.length||!!p.current)};return a(),e.addEventListener?.("voiceschanged",a),()=>e.removeEventListener?.("voiceschanged",a)},[t]);let L=(0,a.useCallback)(()=>{k.current&&(k.current=!1,null===y.current&&(f(!1),E.current(!1)))},[]),T=(0,a.useCallback)(a=>{let s,r=e?.[a];if(!r)return;let n=b.current,i={},l=()=>n===b.current&&w.current===i,o=e=>{clearTimeout(s),s=setTimeout(c,e)};function c(){clearTimeout(s),l()&&(w.current=null,N.current=null,j.current=!1,h(!1),L(),null!==y.current&&(y.current=null,f(!1),E.current(!1)))}let u=!1,d=()=>{if(!l()||u)return;u=!0,L();let e=e7();if(!e)return void c();let a=new SpeechSynthesisUtterance(r.text);a.lang=p.current?.lang??("en"===t?"en-US":"zh-CN"),p.current&&(a.voice=p.current),a.rate=I.current,a.onend=c,a.onerror=c,a.onstart=()=>o(tt(r.text,a.rate)),o(2500),N.current=a,e.speak(a)};if(w.current=i,j.current=!0,h(!0),"cloud"!==A.current)return void d();let m=e?.[a+1];m&&(0,e1.U)(m.text,t).catch(()=>void 0);let g=setTimeout(()=>{l()&&null===y.current&&(k.current=!0,f(!0),E.current(!0))},300);(0,e1.U)(r.text,t).then(e=>{let t=(0,e1.l)();if(!l())return;if(!t){clearTimeout(g),d();return}let a=e=>()=>{l()&&!u&&e()};t.onplaying=a(()=>{clearTimeout(g),L(),o(tt(r.text,t.playbackRate))}),t.onended=a(c),t.onerror=a(d),t.src=e,t.playbackRate=I.current,o(8e3),t.play().catch(a(()=>{clearTimeout(g),d()}))},()=>{clearTimeout(g),d()})},[e,t,L]),F=(0,a.useCallback)(t=>{b.current++,w.current=null,N.current=null,j.current=!1,h(!1),(null!==y.current||k.current)&&(y.current=null,k.current=!1,f(!1),E.current(!1)),v.current=e?ta(e,t)-1:-1,e7()?.cancel(),"cloud"===A.current&&(0,e1.l)()?.pause()},[e]),M=(0,a.useCallback)(t=>{if(!C.current||!e?.length||null!==y.current)return;if(j.current){let a=v.current+1;if(a>=e.length)return;let s=a>0?e[a].begin-e[a-1].begin:e[a].begin;if(t<e[a].begin-Math.min(.8,s/2))return;y.current=a,f(!0),E.current(!0);return}let a=ta(e,t);a<=v.current||(v.current=a,T(a))},[e,T]),z=(0,a.useCallback)(()=>{C.current&&(te(),"cloud"===A.current&&(0,e1.p)())},[]),R=(0,a.useCallback)((e,t)=>{S.current=!0,F(t),C.current=e,u(e),e8(e4,e?"1":"0"),z()},[F,z]),$=(0,a.useCallback)(()=>{let e=e2[(e2.indexOf(I.current)+1)%e2.length];if(I.current=e,m(e),"cloud"===A.current){let t=(0,e1.l)();t&&(t.playbackRate=e)}e8(e3,String(e))},[]);return(0,a.useEffect)(()=>{let e="cloud"===l&&!(0,e1.h)();if(!c||(e9||!e7())&&!e)return;let t=()=>{te(),e&&(0,e1.p)()};return document.addEventListener("click",t,{capture:!0,once:!0}),document.addEventListener("touchend",t,{capture:!0,once:!0}),()=>{document.removeEventListener("click",t,{capture:!0}),document.removeEventListener("touchend",t,{capture:!0})}},[c,l]),(0,a.useEffect)(()=>{c&&"cloud"===l&&e?.length&&(0,e1.w)(e.map(e=>e.text),t,s).catch(()=>void 0)},[c,l,e,t,s]),(0,a.useEffect)(()=>{if("cloud"!==l||!e?.length||C.current)return;let a=!0;return(0,e1.z)(e.map(e=>e.text),t).then(e=>{a&&e&&!C.current&&!S.current&&(C.current=!0,u(!0))}),()=>{a=!1}},[l,e,t]),(0,a.useEffect)(()=>()=>{b.current++,e7()?.cancel(),"cloud"===A.current&&(0,e1.l)()?.pause()},[e]),{supported:n||"cloud"===l,enabled:c,rate:d,speaking:g,holding:x,setEnabled:R,cycleRate:$,update:M,stop:F,prime:z}}({segments:I,language:n,errorItemId:s,holdAnimation:(0,a.useCallback)(e=>{e?o.current?.pauseAnimations():o.current?.unpauseAnimations(),E().forEach(t=>e?t.pause():t.play())},[E])}),T=L.enabled&&(L.holding||!d&&L.speaking),{stop:F,update:M,prime:z}=L,R=(0,a.useCallback)(()=>{o.current?.pauseAnimations(),E().forEach(e=>e.pause()),m(!1)},[E]),$=(0,a.useCallback)(()=>{F(o.current?.getCurrentTime()??0),R()},[R,F]),V=(0,a.useCallback)(e=>{o.current?.setCurrentTime(e),E().forEach(t=>{t.currentTime=1e3*e}),h(e),F(e)},[E,F]),O=(0,a.useCallback)(()=>{let e=o.current;e&&(w>0&&e.getCurrentTime()>=w&&V(0),e.unpauseAnimations(),E().forEach(e=>e.play()),m(!0),z())},[E,w,V,z]),U=async()=>{if(j)return void y(!1);if(document.fullscreenElement)return void await document.exitFullscreen().catch(()=>void 0);let e=i.current;if(e&&"function"==typeof e.requestFullscreen)try{await e.requestFullscreen();return}catch{}y(!0)};return(0,a.useEffect)(()=>{let e=()=>v(document.fullscreenElement===i.current);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),(0,a.useEffect)(()=>{if(!j)return;let e=e=>{"Escape"===e.key&&y(!1)},t=document.body.style.overflow;return document.body.style.overflow="hidden",document.addEventListener("keydown",e),()=>{document.body.style.overflow=t,document.removeEventListener("keydown",e)}},[j]),(0,a.useEffect)(()=>{if(!d)return;let e=0,t=()=>{let a=o.current?.getCurrentTime()??0;if(M(a),w>0&&a>=w){o.current?.setCurrentTime(w),R(),h(w);return}h(a),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[d,w,R,M]),(0,t.jsxs)("div",{ref:i,className:(0,eH.f)("space-y-2",b&&"flex flex-col items-center justify-center bg-black p-4",j&&"fixed inset-0 z-50"),children:[(0,t.jsx)("iframe",{ref:l,srcDoc:k,sandbox:"allow-same-origin",title:r.svgAnimation.alt,onLoad:()=>{o.current=l.current?.contentDocument?.querySelector("svg")??null,F(0),R(),o.current?.setCurrentTime(0),E().forEach(e=>{e.currentTime=0}),C(o.current?e0(o.current):null),h(0),u(o.current?e:null)},className:(0,eH.f)("mx-auto block rounded border bg-white transition-shadow",!b&&"w-full max-w-3xl",T&&"border-primary ring-2 ring-primary/40"),style:{visibility:c===e?"visible":"hidden",...b?{aspectRatio:N,width:`min(100%, calc((100dvh - 96px) * ${N}))`}:{aspectRatio:N}}}),(0,t.jsxs)("div",{className:(0,eH.f)("mx-auto flex w-full items-center gap-2",b?"max-w-5xl text-white":"max-w-3xl"),children:[(0,t.jsx)(x.f,{variant:"outline",size:"sm",className:"h-8 w-8 shrink-0 p-0 text-foreground",onClick:d?$:O,disabled:c!==e,"aria-label":d?r.svgAnimation.pause:r.svgAnimation.play,title:d?r.svgAnimation.pause:r.svgAnimation.play,children:d?(0,t.jsx)(eV,{className:"h-4 w-4"}):(0,t.jsx)(eO.f,{className:"h-4 w-4"})}),(0,t.jsx)(x.f,{variant:"ghost",size:"sm",className:(0,eH.f)("h-8 w-8 shrink-0 p-0",b&&"text-white hover:bg-white/20 hover:text-white"),onClick:()=>{V(0),O()},disabled:c!==e,"aria-label":r.svgAnimation.replay,title:r.svgAnimation.replay,children:(0,t.jsx)(eU.f,{className:"h-4 w-4"})}),w>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"range",min:0,max:w,step:.1,value:Math.min(g,w),onChange:e=>V(Number(e.target.value)),"aria-label":r.svgAnimation.progress,className:"h-2 min-w-0 flex-1 cursor-pointer accent-primary"}),(0,t.jsxs)("span",{className:(0,eH.f)("shrink-0 text-xs tabular-nums",b?"text-white/80":"text-muted-foreground"),children:[ts(g)," / ",ts(w)]})]}),(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[!!I?.length&&(0,t.jsx)(eG,{supported:L.supported,enabled:L.enabled,rate:L.rate,fullscreen:b,onToggle:()=>L.setEnabled(!L.enabled,o.current?.getCurrentTime()??0),onCycleRate:L.cycleRate}),(0,t.jsx)(x.f,{variant:"ghost",size:"sm",className:(0,eH.f)("h-8 w-8 shrink-0 p-0",b&&"text-white hover:bg-white/20 hover:text-white"),onClick:U,"aria-label":b?r.svgAnimation.exitFullscreen:r.svgAnimation.fullscreen,title:b?r.svgAnimation.exitFullscreen:r.svgAnimation.fullscreen,children:b?(0,t.jsx)(eR,{className:"h-4 w-4"}):(0,t.jsx)(eM,{className:"h-4 w-4"})})]})]})]})}function tn({svg:e,errorItemId:s,disabled:r,onBusyChange:n}){let{t:i,language:l}=(0,f.b)(),[o,c]=(0,a.useState)(!1),[u,d]=(0,a.useState)(!1),m=(0,a.useMemo)(()=>(function(e){let t=eZ(e);if(t)return t;try{let t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;return"svg"===t.nodeName?e0(t):null}catch{return null}})(e),[e]);if((0,a.useEffect)(()=>{let e=!0;return(0,e1.v)().then(t=>{e&&c("cloud"===t)}),()=>{e=!1}},[]),!o||!m?.length)return null;let h=async()=>{d(!0),n(!0);try{await (0,e1.H)(m.map(e=>e.text),l,s),F.c.success(i.svgAnimation.voiceRegenerateDone)}catch(s){let e=(0,v.d)(s)||"";j.V.error("[SvgAnimation]","Failed to regenerate cloud voice",{code:e,error:(0,v.Z)(s)});let t=(0,v.L)(s),a="TTS_DISABLED"===e?i.svgAnimation.voiceRegenerateDisabled:i.svgAnimation.voiceRegenerateFailed;F.c.error(t?`${a} (${t})`:a)}finally{d(!1),n(!1)}};return(0,t.jsxs)(x.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:h,disabled:r||u,title:i.svgAnimation.voiceRegenerateHint,children:[u?(0,t.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(eU.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u?i.svgAnimation.voiceRegenerating:i.svgAnimation.voiceRegenerate})]})}function ti({errorItemId:e,svgAnimation:s,hasOtherLanguage:r,onChange:n}){let{t:i,language:l}=(0,f.b)(),[o,d]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[w,N]=(0,a.useState)(!1),[k,A]=(0,a.useState)(null),S=(0,a.useMemo)(()=>!!s&&!!eZ(s),[s]),C=(e,t)=>{let a=i.errors[e];return"string"==typeof a?a:t},I=async()=>{d(!0),A(null);try{let t=await p.k.post(`/api/error-items/${e}/svg-animation`,{language:l},{timeout:6e5,recoverable:!0});n(l,t.svgAnimation)}catch(t){let e=(0,v.d)(t)||"";j.V.error("[SvgAnimation]","Failed to generate SVG animation",{code:e,error:(0,v.Z)(t)}),A("NO_QUESTION_TEXT"===e?i.svgAnimation.noQuestionText:"NO_VALID_ANIMATION"===e?i.svgAnimation.invalid:C(e,i.svgAnimation.failed))}finally{d(!1)}},E=async()=>{b(!0),A(null);try{let t=await p.k.post(`/api/error-items/${e}/svg-animation/narration`,{language:l},{timeout:3e5,recoverable:!0});n(l,t.svgAnimation),F.c.success(i.svgAnimation.narrationDone)}catch(t){let e=(0,v.d)(t)||"";j.V.error("[SvgAnimation]","Failed to generate SVG narration",{code:e,error:(0,v.Z)(t)}),A("NO_VALID_NARRATION"===e?i.svgAnimation.narrationInvalid:C(e,i.svgAnimation.narrationFailed))}finally{b(!1)}},L=async()=>{if(await (0,F.u)(i.svgAnimation.confirmDelete,{destructive:!0})){h(!0);try{await p.k.delete(`/api/error-items/${e}/svg-animation?language=${l}`),n(l,null),A(null)}catch(e){j.V.error("[SvgAnimation]","Failed to delete SVG animation",{error:e instanceof Error?e.message:String(e)}),F.c.error(i.svgAnimation.deleteFailed)}finally{h(!1)}}};if(!s)return(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(eT,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.svgAnimation.title})]}),(0,t.jsxs)(x.f,{variant:"outline",size:"sm",onClick:I,disabled:o,children:[o?(0,t.jsx)(g.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(eT,{className:"mr-2 h-4 w-4"}),o?i.svgAnimation.generating:i.svgAnimation.generate]})]}),k&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:k}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:r?i.svgAnimation.otherLanguageAvailable:i.svgAnimation.hint})]});let T=o||m||y||w;return(0,t.jsxs)("div",{className:"rounded-lg border bg-card",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2 border-b bg-muted/30",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i.svgAnimation.title}),T&&(0,t.jsx)(g.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,t.jsxs)(x.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:E,disabled:T,title:i.svgAnimation.narrationHint,children:[y?(0,t.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(eE,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:y?i.svgAnimation.narrationGenerating:S?i.svgAnimation.narrationRegenerate:i.svgAnimation.narrationGenerate})]}),(0,t.jsx)(tn,{svg:s,errorItemId:e,disabled:T,onBusyChange:N}),(0,t.jsxs)(x.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:I,disabled:T,children:[o?(0,t.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:o?i.svgAnimation.generating:i.svgAnimation.regenerate})]}),(0,t.jsxs)(x.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:L,disabled:T,children:[(0,t.jsx)(u.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:i.svgAnimation.delete})]})]})]}),k&&(0,t.jsx)("p",{className:"px-3 pt-2 text-xs text-destructive",children:k}),(0,t.jsx)("div",{className:"p-2 sm:p-3",children:(0,t.jsx)(tr,{svg:s,errorItemId:e})})]})}var tl=e.i(912505),to=e.i(86963),tc=e.i(35209);e.s(["default",0,function(){let e=(0,r.useParams)(),i=(0,r.useRouter)(),{t:l,language:m}=(0,f.b)(),[g,h]=(0,a.useState)(null);(0,tc.f)(l.detail.title,g?.subject?.name,g?.shortId);let[v,w]=(0,a.useState)(!0),[N,k]=(0,a.useState)(null),[A,S]=(0,a.useState)(!1),[C,I]=(0,a.useState)(void 0),[E,L]=(0,a.useState)(!1),[T,M]=(0,a.useState)(!0),[R,V]=(0,a.useState)(null),[O,U]=(0,a.useState)(!1),q=(0,a.useCallback)(async e=>{try{let t=await p.k.get(`/api/error-items/${e}`);h(t)}catch(e){j.V.error("[ErrorDetail]","Failed to fetch error item",{error:e}),F.c.error(l.common?.messages?.loadFailed||"Failed to load item"),i.push("/notebooks")}finally{w(!1)}},[i,l]);(0,a.useEffect)(()=>{p.k.get("/api/user").then(e=>{e&&e.educationStage&&I(e.educationStage),L(!!e?.enableGeogebra),M(e?.enableSvgAnimation!==!1)}).catch(e=>j.V.error("[ErrorDetail]","Failed to fetch user info",{error:e})),e.id&&q(e.id)},[e.id,q]);let D=(0,a.useCallback)(e=>{h(t=>t&&{...t,...e})},[]),_=async e=>{g&&(await p.k.put(`/api/error-items/${g.id}`,e),D(e))},P=async()=>{g&&await q(g.id)},H=async e=>{if(!g)return;let t=g.difficultyStars??null;D({difficultyStars:e}),U(!0);try{let t=await p.k.put(`/api/error-items/${g.id}`,{difficultyStars:e});D({paperLevel:t.paperLevel})}catch(e){D({difficultyStars:t}),j.V.error("[ErrorDetail]","Failed to save difficulty",{error:e}),F.c.error(l.difficulty.saveFailed)}finally{U(!1)}},G=(0,a.useCallback)((e,t)=>{D({["en"===e?"svgAnimationEn":"svgAnimation"]:t})},[D]),B=async()=>{if(g&&await (0,F.u)(l.common?.messages?.confirmDelete||"Are you sure you want to delete this error item?",{destructive:!0}))try{await p.k.delete(`/api/error-items/${g.id}/delete`),F.c.success(l.common?.messages?.deleteSuccess||"Deleted successfully"),i.push(g.subjectId?`/notebooks/${g.subjectId}`:"/notebooks")}catch(e){j.V.error("[ErrorDetail]","Failed to delete error item",{error:e}),F.c.error(l.common?.messages?.deleteFailed||"Delete failed")}};return v?(0,t.jsx)(to.f,{label:l.common.loading}):g?(0,t.jsxs)("main",{className:"min-h-screen",children:[(0,t.jsxs)("div",{className:"mx-auto max-w-6xl space-y-6 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[(0,t.jsx)(s.default,{href:g.subjectId?`/notebooks/${g.subjectId}`:"/notebooks",children:(0,t.jsx)(x.f,{variant:"ghost",size:"icon",className:"-ml-2",children:(0,t.jsx)(n.f,{className:"h-5 w-5"})})}),(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:l.detail.title}),(0,t.jsx)(eC,{shortId:g.shortId}),(0,t.jsx)(d.f,{size:"md",value:g.difficultyStars,onChange:H,disabled:O})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(ej,{errorItemId:g.id,fields:g,onDone:D}),(0,t.jsx)(s.default,{href:`/practice?id=${g.id}`,children:(0,t.jsxs)(x.f,{variant:"outline",size:"sm",children:[(0,t.jsx)(c.f,{className:"mr-2 h-4 w-4"}),l.detail.practice]})}),R&&(0,t.jsx)(eb.x,{status:R,className:"h-8 self-center px-3"}),(0,t.jsxs)(x.f,{variant:"ghost",size:"sm",onClick:B,className:"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-950/40",children:[(0,t.jsx)(u.f,{className:"mr-2 h-4 w-4"}),l.detail.delete||"Delete"]})]})]}),(0,t.jsx)(eo,{item:g,educationStage:C,saveFields:_,onUpdate:D,reload:P,onEnlarge:k}),(0,t.jsx)(ey.K,{errorItemId:g.id,onMasteryStatusChange:V}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsx)(z,{title:l.detail.correctAnswer,value:g.answerText,onSave:e=>_({answerText:e}),logLabel:"answer",rows:5,placeholder:"Enter answer...",cardClassName:"border-primary/20",titleClassName:"text-primary",contentClassName:"font-semibold",headerActions:(0,t.jsx)(eN,{errorItemId:g.id,onDone:e=>D({answerText:e.answerText??"",analysis:e.analysis??""})}),children:g.referenceImageUrl&&(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(el,{src:g.referenceImageUrl,alt:l.detail.referenceImageAlt,showLabel:l.detail.viewImage,hideLabel:l.detail.hideImage,visible:A,onVisibleChange:S,onEnlarge:k})})}),(0,t.jsx)(ed,{item:g,saveFields:_,onEnlarge:k})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsx)(z,{title:l.detail.analysis,value:g.analysis,onSave:e=>_({analysis:e}),logLabel:"analysis",rows:12,placeholder:"Enter analysis..."}),(0,t.jsx)(z,{title:l.detail?.mistakeAnalysis||"Mistake Analysis",value:g.mistakeAnalysis,onSave:e=>_({mistakeAnalysis:e}),logLabel:"mistake analysis",rows:8,editorLabel:l.editor?.mistakeAnalysis||"Mistake Cause Analysis",emptyText:l.detail?.noMistakeAnalysis||"No mistake analysis yet."})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[T&&(0,t.jsx)(ti,{errorItemId:g.id,svgAnimation:"en"===m?g.svgAnimationEn:g.svgAnimation,hasOtherLanguage:!!("en"===m?g.svgAnimation:g.svgAnimationEn),onChange:G},m),E&&(0,t.jsx)(y,{errorItemId:g.id,commands:g.geogebraCommands,onUpdate:D}),(0,t.jsx)($,{item:g,onUpdate:D})]})]}),(0,t.jsx)(b,{src:N,onClose:()=>k(null)})]}):(0,t.jsx)(tl.f,{icon:o,title:l.detail.notFound||"Item not found",className:"m-4 md:m-8"})}],204573)}]);