wrong-notebook 2026.11.11 → 2026.11.12-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.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +8 -0
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/page.js.nft.json +1 -1
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
- package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/admin/cnm-tags/route.js +2 -2
- package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/dashboard/route.js +17 -17
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/export/route.js +2 -2
- package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/route.js +2 -2
- package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/eula/accept/route.js +2 -2
- package/.next/server/app/api/admin/eula/accept/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/system-reset/route.js +2 -2
- package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/telemetry/route.js +2 -2
- package/.next/server/app/api/admin/telemetry/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/detail/route.js +17 -17
- package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/route.js +2 -2
- package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/route.js +2 -2
- package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +9 -9
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +12 -12
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +18 -18
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +20 -20
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/delete/route.js +2 -2
- package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/figure/route.js +13 -13
- package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js +15 -15
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/geogebra/route.js +17 -17
- package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/image/route.js +2 -2
- package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/notes/route.js +2 -2
- package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/practice-records/route.js +2 -2
- package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/reanswer/route.js +19 -19
- package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/retag/route.js +21 -21
- package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/route.js +2 -2
- package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +17 -17
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js +17 -17
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/answer-space/route.js +2 -2
- package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/batch-delete/route.js +2 -2
- package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/batch-move/route.js +2 -2
- package/.next/server/app/api/error-items/batch-move/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/clear/route.js +2 -2
- package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/export-questions/route.js +6 -6
- package/.next/server/app/api/error-items/export-questions/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/list/route.js +2 -2
- package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +20 -20
- package/.next/server/app/api/error-items/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/short/[shortId]/route.js +2 -2
- package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/similarity/route.js +2 -2
- package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
- package/.next/server/app/api/eula/status/route.js +2 -2
- package/.next/server/app/api/eula/status/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +18 -18
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/results/route.js +16 -16
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +15 -15
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +20 -20
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +14 -14
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +10 -9
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +14 -14
- package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/health/route.js.nft.json +1 -1
- package/.next/server/app/api/import/route.js +17 -17
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +24 -24
- package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/fix-text/route.js +17 -17
- package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/read/route.js +22 -22
- package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/retry/route.js +24 -24
- package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/route.js +22 -22
- package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/start/route.js +22 -22
- package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/route.js +22 -22
- package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js +20 -20
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/figure/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/import-tasks/[id]/figure/route/build-manifest.json +12 -0
- package/.next/server/app/api/import-tasks/[id]/figure/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/import-tasks/[id]/figure/route.js +38 -0
- package/.next/server/app/api/import-tasks/[id]/figure/route.js.map +5 -0
- package/.next/server/app/api/import-tasks/[id]/figure/route.js.nft.json +1 -0
- package/.next/server/app/api/import-tasks/[id]/figure/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/import-tasks/[id]/read/route.js +20 -20
- package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/retry/route.js +19 -19
- package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/route.js +20 -20
- package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/route.js +22 -22
- package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/initialize/route.js +2 -2
- package/.next/server/app/api/initialize/route.js.nft.json +1 -1
- package/.next/server/app/api/logs/frontend/route.js +2 -2
- package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route.js +20 -20
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js +2 -2
- package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/login/route.js +2 -2
- package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/route.js +2 -2
- package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +18 -18
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/route.js +2 -2
- package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/route.js +2 -2
- package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +15 -15
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/[id]/route.js +2 -2
- package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/route.js +2 -2
- package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +19 -19
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +13 -13
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +12 -12
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +12 -12
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/question-banks/[id]/questions/[qid]/route.js +19 -19
- package/.next/server/app/api/question-banks/[id]/questions/[qid]/route.js.nft.json +1 -1
- package/.next/server/app/api/question-banks/[id]/route.js +2 -2
- package/.next/server/app/api/question-banks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/question-banks/route.js +15 -15
- package/.next/server/app/api/question-banks/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +15 -15
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js +2 -2
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/register/status/route.js +1 -1
- package/.next/server/app/api/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/requests/[id]/route.js +2 -2
- package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +16 -16
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +2 -2
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js +2 -2
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/activity/route.js +2 -2
- package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js +2 -2
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js +2 -2
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/repeated-mistakes/route.js +14 -14
- package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/weak-tags/route.js +17 -17
- package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/route.js +2 -2
- package/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/stats/route.js +2 -2
- package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js +2 -2
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/telemetry/route.js +2 -2
- package/.next/server/app/api/telemetry/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/[id]/route.js +10 -9
- package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js +10 -10
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/route.js +12 -12
- package/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/status/route.js +11 -10
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
- package/.next/server/app/api/user/ai-consent/route.js +2 -2
- package/.next/server/app/api/user/ai-consent/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +17 -17
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- package/.next/server/app/api/version/route.js.nft.json +1 -1
- package/.next/server/app/banks/page.js.nft.json +1 -1
- package/.next/server/app/banks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/eula/page.js.nft.json +1 -1
- package/.next/server/app/eula/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/page.js.nft.json +1 -1
- package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
- package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
- package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-tasks/page.js.nft.json +1 -1
- package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/initialize/page.js.nft.json +1 -1
- package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/practice/page.js.nft.json +1 -1
- package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
- package/.next/server/app/print-preview/page.js.nft.json +1 -1
- package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
- package/.next/server/app/register/page.js.nft.json +1 -1
- package/.next/server/app/register/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page.js.nft.json +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/setup/page.js.nft.json +1 -1
- package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/server/app/stats/page.js.nft.json +1 -1
- package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tags/page.js.nft.json +1 -1
- package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/chunks/1oeh_server_app_api_import-tasks_[id]_figure_route_actions_07t3sxicgrvqr.js +3 -0
- package/.next/server/chunks/[externals]_sharp_1oez0x5rqseka._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__07dbynh_bs54x._.js → [root-of-the-server]__0-r2vceyjczka._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__00hfrpu611kxz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__013623_984_wi._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0095ttqaxkura._.js → [root-of-the-server]__01jyhq0v_cplw._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__00gh00nfppv7c._.js → [root-of-the-server]__01s81h4r_wr7k._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__01y74y1sbftpl._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__04k-j5q4c3fxh._.js → [root-of-the-server]__02h788neoqam-._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__04g1e8vi5hfmd._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__05atxd5g005-v._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__05uvm20_ghlnt._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0lrgjyg38b9j1._.js → [root-of-the-server]__05zjk4mg9o5bv._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__003zs5cdrhp0h._.js → [root-of-the-server]__06-rcig4c1yoi._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__062hvv8ak-oyy._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0641i4sk5le-6._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0afxho639gukq._.js → [root-of-the-server]__07wwsmnm6c7tk._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__089m-6oa-1kno._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0967yqvt09vz7._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0a_ecneq0n2b5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0akyh53zxosbo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0brk57wvbcfpl._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0cii6-t-ut8rq._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0dcdxupilu8ps._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0clg30mkk8i71._.js → [root-of-the-server]__0djdn_u8nx3u7._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0gj0qch0bepug._.js → [root-of-the-server]__0dnuv-9lcdxy8._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0eey2k4ofnktm._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0evv12a34qcy6._.js +4 -4
- package/.next/server/chunks/[root-of-the-server]__0f5q7s0be5giy._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0nmxuavodh1jp._.js → [root-of-the-server]__0g488rb67hy0-._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0gthpb6naqjok._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0gzv8vk-d9emt._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__06g_4_o5xkej2._.js → [root-of-the-server]__0h6pglkyy2x3q._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0h847w3u8eb36._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0hez9_c-ql0l9._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__06zr2kkbkdddm._.js → [root-of-the-server]__0hvn2l27vwx0v._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0j1zb5bzw2xv8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0jjzw3cvnav4v._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1qh6ja_35h8e9._.js → [root-of-the-server]__0jzs_wjt-0rfc._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0k9j7fqmb4exm._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0kp13lo3ui21-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0l_-7s2on-68u._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0lgvndry1slzy._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0llcnfms-yrs4._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0nhx-q7q39svl._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0o7_7cyj3bn7f._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0o_r0mba36419._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0pocdr1ee9wrc._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0qzdou15f0nqi._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0r0zkh318us2a._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0rc-e3e9tdpd8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0rfhyd4wlbfsr._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0rn3n8kt44idx._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0rp9uv98dzbks._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0rppsy2asakww._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0rrg8wylziciz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0sr8vnpwvch60._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0svu2z4tuq3gc._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0t_lgrjb84q9r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0uamrne8reway._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0re-_v5h69w84._.js → [root-of-the-server]__0vf9vw20h61ti._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0vmrcy5nfzxfa._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0wdh-wbumllhk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0wy320i-uiwbo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0xb185_p8aooa._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0xejmebuz3k8i._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0xo-zdn9rs3o8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0xrbxtd_3u4sa._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0eu-sj70e2vc_._.js → [root-of-the-server]__0xwmebw7zp9tt._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0yrlrh1p4cec7._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0yrpuslw7wzra._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0zamz3etpuhq4._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__10ql7etwm_88-._.js → [root-of-the-server]__1-wk5ean1w4p1._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0i0wx-z-qadeh._.js → [root-of-the-server]__11rmrrnyv5b4p._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__12u3l0tebwh50._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__15iidg73pqdyw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__16vgkd1nbih47._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__178zx6aeday20._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__18rq0m4-obnu5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__19_kfpiw060ww._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1_3nn0g7kp6bt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1a46lw8uo36i5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1assq-8cgzn69._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1bbtj9n-_vgqf._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1c7b35-fdxgfn._.js → [root-of-the-server]__1buxopu3mpdl0._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1c4k2j-vj_c4w._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1c_v_a0qajr1b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1cvo0cuc69r5x._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1e8_j43j1t1m3._.js +4 -4
- package/.next/server/chunks/[root-of-the-server]__1ekfctwwvxhhx._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1fndyj3k-9qht._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1goozrpjh5dhf._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__074shufbnm6ni._.js → [root-of-the-server]__1hesgf_s-d142._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1i9p9-997567t._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1il8wpv38s2q1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1itwjaosu_pc4._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1k0dtosqlnvel._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1k67g4w53li1h._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1kjyafxshmutx._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1kucx2jgzzdfv._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1l63lc79i6lzk._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1lu98yoyk9xgv._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1mg93bb--5j6n._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1mudwm3o1ce5v._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1nflmic-zdbs7._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1oh9gjy8j_p0p._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1owyqp175q-5j._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1polyx47npwja._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1q6q9n_tozwzv._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1qmbbudn1-e1n._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1sbck_cb7he3n._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1ttyfy9dd2omo._.js → [root-of-the-server]__1u_tog_9ppp6g._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1ujkugqt8idce._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ukyh4_c7az0t._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1uvva2pl7fdcg._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1uxgz59p3wbmp._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1uzikfdr7_qck._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1vjgmkf6i-x1b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1vonc1_0_mxxe._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1w9y_vm2scbhn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1whbzt_ur5lvt._.js +3 -0
- package/.next/server/chunks/_0-b-yoyb6zjkc._.js +3 -0
- package/.next/server/chunks/{_17dkyjg1d51kw._.js → _04_gplm_vpnmc._.js} +1 -1
- package/.next/server/chunks/{_101n94i9f9jx_._.js → _095yf3i01g28p._.js} +1 -1
- package/.next/server/chunks/{_0b6eoc8pstjna._.js → _0dhbpyuf83y2o._.js} +1 -1
- package/.next/server/chunks/_0dnxlicg7tx6u._.js +3 -0
- package/.next/server/chunks/_0dx_p2ysozhgf._.js +841 -0
- package/.next/server/chunks/{_0vidw039o5x0k._.js → _0i1c91qa8oj31._.js} +1 -1
- package/.next/server/chunks/{_0xlf42pjv7whr._.js → _0jb5ab0xc3c7y._.js} +1 -1
- package/.next/server/chunks/{_1beds3k7qxfby._.js → _0jm058p_78ekx._.js} +1 -1
- package/.next/server/chunks/{_1wdbh7n2egysd._.js → _0ogiiv8sxw73u._.js} +1 -1
- package/.next/server/chunks/_0pwgjewofdq3e._.js +841 -0
- package/.next/server/chunks/{_1-nifxdtdpf_3._.js → _0s-6w2kg279kq._.js} +1 -1
- package/.next/server/chunks/{_1efoql5qkyxx7._.js → _0sc_5yy08ea6p._.js} +1 -1
- package/.next/server/chunks/_0tqcx59z8zd0h._.js +841 -0
- package/.next/server/chunks/{_10iqdc8-yics0._.js → _0ulpt4wfpigjk._.js} +1 -1
- package/.next/server/chunks/{_00uecgrfe4u3v._.js → _113pyiw74ak3j._.js} +1 -1
- package/.next/server/chunks/_17zw8m241gfs3._.js +1 -1
- package/.next/server/chunks/{_1t19v24mb3ia0._.js → _1956v4ld1ovus._.js} +1 -1
- package/.next/server/chunks/{_1feimqjhlznj8._.js → _19x-7yu46vx3k._.js} +1 -1
- package/.next/server/chunks/_1a0msd7dpzbda._.js +3 -0
- package/.next/server/chunks/_1cfply45lnr-v._.js +3 -0
- package/.next/server/chunks/_1eqnx6dcz6a03._.js +4 -4
- package/.next/server/chunks/{_08znit_7g_ij-._.js → _1lw2_a_07qroy._.js} +1 -1
- package/.next/server/chunks/_1n183a1sca95j._.js +841 -0
- package/.next/server/chunks/_1ooq1_fguyb4w._.js +4 -4
- package/.next/server/chunks/_1pcqwf-fb4sdr._.js +3 -0
- package/.next/server/chunks/_1pvqo-qnv-nqm._.js +1 -1
- package/.next/server/chunks/{_0lefxjtzxvqe3._.js → _1qy44t5i_818z._.js} +1 -1
- package/.next/server/chunks/{_1q6syu3thw-it._.js → _1rs9mf471vkaj._.js} +1 -1
- package/.next/server/chunks/_1uy09ha0hf55x._.js +3 -0
- package/.next/server/chunks/_1v6bg00q81vb-._.js +1 -1
- package/.next/server/chunks/_1yeszprfll4cs._.js +3 -0
- package/.next/server/chunks/{_02h2mvtyvz-d4._.js → _1ypqw07g8jd_n._.js} +2 -2
- package/.next/server/chunks/{src_lib_08pkzyxoaihvr._.js → src_lib_00uau0bqmpvis._.js} +1 -1
- package/.next/server/chunks/{src_lib_1o3tjd1o5cimp._.js → src_lib_09bx-uxwxed4-._.js} +1 -1
- package/.next/server/chunks/{src_lib_0wnimconywq6b._.js → src_lib_0_-jpw7s-8ecj._.js} +1 -1
- package/.next/server/chunks/{src_lib_0h-tponh1-7j6._.js → src_lib_0jpf045jl52g2._.js} +1 -1
- package/.next/server/chunks/{src_lib_1sq92-zezp0_w._.js → src_lib_0ms2ela_oq337._.js} +1 -1
- package/.next/server/chunks/{src_lib_0j02yeqekyrst._.js → src_lib_0r93_bc9ivv-1._.js} +1 -1
- package/.next/server/chunks/{src_lib_0ugn3ny6rrd7v._.js → src_lib_0w7hq3kllb8fm._.js} +1 -1
- package/.next/server/chunks/src_lib_0xbzfk8i26a49._.js +3 -0
- package/.next/server/chunks/{src_lib_0lmersyim_y14._.js → src_lib_0zvev6trtcwx1._.js} +1 -1
- package/.next/server/chunks/src_lib_15mqgve64x8-5._.js +3 -0
- package/.next/server/chunks/src_lib_1e9dyictf98m_._.js +3 -0
- package/.next/server/chunks/src_lib_1fsvsl9tcr4l3._.js +3 -0
- package/.next/server/chunks/src_lib_1m687lzqosan4._.js +3 -0
- package/.next/server/chunks/src_lib_1mi27lltp518i._.js +3 -0
- package/.next/server/chunks/{src_lib_1lhg90rnfvakd._.js → src_lib_1n_nr7-ex_2jg._.js} +1 -1
- package/.next/server/chunks/src_lib_1tdv7ldmphkg6._.js +3 -0
- package/.next/server/chunks/src_lib_1vlf46urukq7z._.js +3 -0
- package/.next/server/chunks/{src_lib_14vlkix_t4jf2._.js → src_lib_20kah0e9oxkct._.js} +1 -1
- package/.next/server/chunks/src_lib_config_index_ts_14-9cq9wn5r30._.js +1 -1
- package/.next/server/chunks/src_lib_error-list_1o9rfcd_k01kv._.js +1 -1
- package/.next/server/chunks/src_lib_figure-svg_ts_1fiy7od-bmqnp._.js +3 -0
- package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +1 -1
- package/.next/server/chunks/src_lib_question_0uw17e6at-i_h._.js +1 -1
- package/.next/server/chunks/src_lib_seq-no_seq-no_ts_0j4u6wdt1alkz._.js +3 -0
- package/.next/server/chunks/{src_lib_telemetry_server_ts_03b98rv_b2seb._.js → src_lib_telemetry_server_ts_00f83-9rm2y-g._.js} +1 -1
- package/.next/server/chunks/{src_lib_telemetry_server_ts_0mdq-bx1yd8hn._.js → src_lib_telemetry_server_ts_03m2wrq9mhqmy._.js} +1 -1
- package/.next/server/chunks/src_lib_telemetry_server_ts_0_290xuag9bk5._.js +1 -1
- package/.next/server/chunks/{src_lib_telemetry_server_ts_02pcxs3asq5uc._.js → src_lib_telemetry_server_ts_0avmta_fv98hh._.js} +1 -1
- package/.next/server/chunks/{src_lib_telemetry_server_ts_03-yhnattpl91._.js → src_lib_telemetry_server_ts_0r0-kds9criy8._.js} +1 -1
- package/.next/server/chunks/src_lib_telemetry_server_ts_0xkkbyrxnwwnl._.js +3 -0
- package/.next/server/chunks/src_lib_telemetry_server_ts_1jtchrrgcoul1._.js +3 -0
- package/.next/server/chunks/src_lib_telemetry_server_ts_1pqqp2kf9ck61._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__1abszuh7g1t6l._.js → [root-of-the-server]__10unzufmav9zw._.js} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0l72nsu73r1ie._.js → [root-of-the-server]__1mg9k8tfno_09._.js} +1 -1
- package/.next/server/chunks/ssr/_0-n_0o1abjz82._.js +27 -0
- package/.next/server/chunks/ssr/_03atl17c9_-vx._.js +27 -0
- package/.next/server/chunks/ssr/_05k02824g2tpo._.js +1 -1
- package/.next/server/chunks/ssr/_0bciku5a2h26m._.js +3 -0
- package/.next/server/chunks/ssr/_0env0bwoisi0c._.js +27 -0
- package/.next/server/chunks/ssr/_0qiirfq71m0ty._.js +1 -1
- package/.next/server/chunks/ssr/_0xlbgtld9_r3o._.js +1 -1
- package/.next/server/chunks/ssr/{_1dl7pg0vhu_7m._.js → _0ziiroepnqofs._.js} +2 -2
- package/.next/server/chunks/ssr/{_13546ppmec5po._.js → _1-h4lwdk_0mmw._.js} +2 -2
- package/.next/server/chunks/ssr/_10ivi6sd9yfpo._.js +3 -0
- package/.next/server/chunks/ssr/_128aje59sq0aw._.js +3 -0
- package/.next/server/chunks/ssr/_1dx7u1_w4db4k._.js +3 -0
- package/.next/server/chunks/ssr/_1ifkzsu9-qoq1._.js +3 -0
- package/.next/server/chunks/ssr/_1m7f_7kfoqzo_._.js +1 -1
- package/.next/server/chunks/ssr/_1q2ycfcq7dkpb._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_0howjysrkg79j._.js → node_modules_0deqqlqvj1a1o._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_0gnkuxqh809kz._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_0h9ta63mxl6gx._.js → node_modules_10xv23_q8lfn_._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_1yn2jiaa6_mg5._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_0lnmp65mgz816.js → node_modules_heic-to_dist_csp_heic-to_1n_v7tldjfiru.js} +1 -1
- package/.next/server/chunks/ssr/src_05l93k3zbix2t._.js +3 -0
- package/.next/server/chunks/ssr/src_1-khp-yw2gt4c._.js +3 -0
- package/.next/server/chunks/ssr/src_130ww76krpws_._.js +1 -1
- package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
- package/.next/server/chunks/ssr/src_1qo2yxfbt1sy_._.js +3 -0
- package/.next/server/chunks/ssr/src_1xvnkkhvub372._.js +1 -1
- package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
- package/.next/server/chunks/ssr/src_app_import-batches_[id]_page_tsx_0mhg_vriwmkkw._.js +1 -1
- package/.next/server/chunks/ssr/src_app_import-tasks_[id]_page_tsx_0_grj11-jdqqc._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
- package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +3 -3
- package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
- package/.next/server/chunks/ssr/src_components_correction-editor_tsx_1p7z02t66tndx._.js +3 -3
- package/.next/server/chunks/ssr/src_components_error-list_error-item-card_tsx_1zsiqsrj-jjd7._.js +1 -1
- package/.next/server/chunks/ssr/src_components_exam_exam-status-badge_tsx_0rozdbhlqsq71._.js +3 -0
- package/.next/server/chunks/ssr/src_components_import-tasks_import-task-card_tsx_01r47qh8ryspb._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +17 -23
- package/.next/server/chunks/ssr/src_components_regenerate-figure-button_tsx_192vheo8-vjk8._.js +3 -0
- package/.next/server/chunks/ssr/src_contexts_LanguageContext_tsx_0r6xucmeu1k5z._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_0773v8b5gb93o._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_1qhs590-z9xnh._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_1sh_-tq3rk_q3._.js +3 -0
- package/.next/server/chunks/ssr/src_lib_1z8akixo3j8ti._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{1inmkqwqys755.js → 0-qegqxruurc3.js} +1 -1
- package/.next/static/chunks/04stcxch-i9qh.js +25 -0
- package/.next/static/chunks/0dc_n2xk5zd91.js +1 -0
- package/.next/static/chunks/0f_c5x7iw_zv8.css +3 -0
- package/.next/static/chunks/0x3-d2etp7q2a.js +16 -0
- package/.next/static/chunks/0zivil0520_ld.js +16 -0
- package/.next/static/chunks/10eu5r75zudvr.js +6 -0
- package/.next/static/chunks/{1s6os79cobfn_.js → 11j7t5iljen8x.js} +1 -1
- package/.next/static/chunks/131ggx8zkjsbo.js +25 -0
- package/.next/static/chunks/1cr9hgf4scqy2.js +1 -0
- package/.next/static/chunks/{05o2so3pmerou.js → 1hpf-0s8plyn9.js} +6 -6
- package/.next/static/chunks/1ibhiaqcn1uus.js +9 -0
- package/.next/static/chunks/{0xwz3h9d_e7kb.js → 1iq_4mjmtcew5.js} +1 -1
- package/.next/static/chunks/1na9ehxfr43xo.js +1 -0
- package/.next/static/chunks/1nr8kof_vhti_.js +1 -0
- package/.next/static/chunks/{3_xu3ke2zp8fv.js → 1tcgtsir3l_ag.js} +1 -1
- package/.next/static/chunks/{0jujm58tnoh6g.js → 1vor8pe1wgr3p.js} +1 -1
- package/.next/static/chunks/210a3wjue6a_4.js +1 -0
- package/.next/static/chunks/2ind4-0ptuzzz.js +1 -0
- package/.next/static/chunks/2l68c92ptk45y.js +37 -0
- package/.next/static/chunks/2l7tdxiv63wo4.js +2 -0
- package/.next/static/chunks/2la51tl94aeid.js +2 -0
- package/.next/static/chunks/2p3_vg4r1uzob.js +1 -0
- package/.next/static/chunks/2ypkmlirtgvw8.js +258 -0
- package/.next/static/chunks/{229eh2g7m2yeo.js → 33ek6omo-pplm.js} +1 -1
- package/.next/static/chunks/36shjdf6v5iqq.js +1 -0
- package/.next/static/chunks/3b5i3d4tmkg5d.js +1 -0
- package/.next/static/chunks/3u_zln7q59xr5.js +1 -0
- package/.next/static/chunks/{11-wz53_clo14.js → 3y96p9bhgoeyp.js} +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20261111000001_error_item_seq_no/migration.sql +17 -0
- package/prisma/schema.prisma +3 -0
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__02cwazw3laf8n._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__03mzwpgmelgxq._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__07za3z2qd-ri5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__09a7mqqvpb5iw._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__09uxdlb0atubd._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0as_tqxtximnv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0b110dxj2qk5d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0bey3smu2frko._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0cyq3g7ztpx7w._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0dxid01zcz8sh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gspnsyl2sr50._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0h7v77lf4fj2l._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0hfzltniz674f._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0iw2v5f6ccxl0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0iz5qf7p--9io._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0o64d13on6cmz._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0oou2pf7_339_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0pfjf0rwvysy7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0pzhwzricdm-8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0q7tfn1jdwvpx._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0qcuz-9of1fv5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0shmk9rqg_zs_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0sthzz27i2a2z._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0svsyv06lv5b6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0u5ilae_0p228._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ve9pg6dcdyog._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0vf7un104o30d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0vg4zd1ewm4lh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0vyu7gon1mqle._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0w9f5-xtpane-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0wb0hryzh-40d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0xryaobvas7wn._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0y88hdobvv_cu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ykbbyo6dhbr6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0yqilo886f-ap._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__10gksjgitow13._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11abvzxq0gnxd._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11k2f-h9fwj0r._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__132wdxrrngo1f._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1338_d0rrpmqi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__13k69ibnw4thj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__14971xq-txgd-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__159kla6_fcldu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__167-list_13wk._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__16lnqkbxm2wvd._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__190kzk1zqnnnh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1_1_1tvp-qw4m._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1_n49ooywukvu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1a71wr5gfcvuh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1bc2146vwwx0n._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1chl_j6-66d0z._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1d_eia02z8s27._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1dg09yxfyy2d-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1fp_biblbk1dj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1h4469dzsx9y_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1hg-nksvhu11h._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1hq4b2pmltb_l._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1hr87f6mg8xi6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1i04dsau7foki._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1i8ob9ye9_osl._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1jaf9l240am9o._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1jcv8k2sx2ptr._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1juyqvp5sctaz._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1kqyyoqumu2k3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ktelnqkakjyk._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1kxlw9suxnfs2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1nmtvzuc1uv-5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1oaxm5scx4anf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1oc9d5av5hr08._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1opijjenrark5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1otoj-v6_5y0o._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1qbwy5a1mwohf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1rfpsbaml9gvv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1rzzqjvucnhdy._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1s9wsfyjfjfsw._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1svy-pnpe1pwu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1t6v0c67wrtj7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1tcmfyputqswh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1uk_9g9b1wxp5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1v5j-xo97hloh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1wt1lpxbrwtyt._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1y7j4fig86u8c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1z61l-vv1munx._.js +0 -3
- package/.next/server/chunks/_0-4_eys63g0m9._.js +0 -16
- package/.next/server/chunks/_07_mi9-a9cp01._.js +0 -3
- package/.next/server/chunks/_0b2q7l141kz7e._.js +0 -3
- package/.next/server/chunks/_0f13poypqhhoi._.js +0 -3
- package/.next/server/chunks/_0fsupxpep5knb._.js +0 -16
- package/.next/server/chunks/_0j_08_iij6lec._.js +0 -3
- package/.next/server/chunks/_0sreqb-d5c0h6._.js +0 -16
- package/.next/server/chunks/_1c-nysoxl9gha._.js +0 -16
- package/.next/server/chunks/_1lxrt-tu_a2ul._.js +0 -3
- package/.next/server/chunks/_1u9u2jcj407s4._.js +0 -3
- package/.next/server/chunks/src_lib_0tg0r917l7yn-._.js +0 -3
- package/.next/server/chunks/src_lib_0whd_w99i5vmm._.js +0 -3
- package/.next/server/chunks/src_lib_1-q39dava8lyt._.js +0 -3
- package/.next/server/chunks/src_lib_10ykmf7h-50q1._.js +0 -3
- package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +0 -765
- package/.next/server/chunks/src_lib_1ejhz5p1wt0op._.js +0 -3
- package/.next/server/chunks/src_lib_1hq7hqwsh9h5t._.js +0 -3
- package/.next/server/chunks/src_lib_1v7rk87xys5cb._.js +0 -3
- package/.next/server/chunks/src_lib_1z4t4i-xke74u._.js +0 -3
- package/.next/server/chunks/src_lib_2019ko5qy0_13._.js +0 -3
- package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +0 -3
- package/.next/server/chunks/src_lib_telemetry_server_ts_121v_vzqx287h._.js +0 -3
- package/.next/server/chunks/src_lib_telemetry_server_ts_1cd1qcjm2imrt._.js +0 -3
- package/.next/server/chunks/src_lib_telemetry_server_ts_1n-wydymc9ayv._.js +0 -3
- package/.next/server/chunks/src_lib_telemetry_server_ts_1nwnpm99c4ae8._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__127jl-l56wp65._.js +0 -3
- package/.next/server/chunks/ssr/_0-nyc5xhnkj97._.js +0 -3
- package/.next/server/chunks/ssr/_00bsw28n2tkm8._.js +0 -3
- package/.next/server/chunks/ssr/_02_avk2sj3zf5._.js +0 -3
- package/.next/server/chunks/ssr/_0p3bqrojxwfs0._.js +0 -3
- package/.next/server/chunks/ssr/_1bpiiswbxudjs._.js +0 -3
- package/.next/server/chunks/ssr/_1ctycpq4tb8xw._.js +0 -3
- package/.next/server/chunks/ssr/_1gdar99uip6w4._.js +0 -3
- package/.next/server/chunks/ssr/_1ywwrbmzxhzuj._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_1gehjcp51qewp._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1qsyz9_vm6jfk._.js +0 -3
- package/.next/server/chunks/ssr/src_18crt94jrdkoz._.js +0 -3
- package/.next/server/chunks/ssr/src_components_image-cropper_tsx_0pcp8-ifruyx-._.js +0 -3
- package/.next/server/chunks/ssr/src_components_tag-input_tsx_0b9sxffna5c9i._.js +0 -3
- package/.next/static/chunks/0ce17zvy849pt.js +0 -1
- package/.next/static/chunks/0f9-00nh1upvn.js +0 -8
- package/.next/static/chunks/0l7p1okxbynzl.js +0 -6
- package/.next/static/chunks/0q-ubzpc3zt00.js +0 -264
- package/.next/static/chunks/0q3d845nwr3t9.js +0 -1
- package/.next/static/chunks/0qp2dju3vke54.js +0 -1
- package/.next/static/chunks/1vyad-frr447h.js +0 -2
- package/.next/static/chunks/1xe6wsozi5dph.js +0 -9
- package/.next/static/chunks/2-_veplkr98_e.js +0 -9
- package/.next/static/chunks/2g9sfd_hxpx8t.js +0 -9
- package/.next/static/chunks/2pg8rnt3z7y03.js +0 -9
- package/.next/static/chunks/2vka298e6x3mn.js +0 -13
- package/.next/static/chunks/2wrdjh0-kibv1.js +0 -1
- package/.next/static/chunks/2wwddiemqx680.js +0 -1
- package/.next/static/chunks/2xm7gxq5_ot8y.js +0 -1
- package/.next/static/chunks/348vc_z8o0lz1.js +0 -1
- package/.next/static/chunks/34r6_zyo8ux86.js +0 -1
- package/.next/static/chunks/3pu4qklwvr6i6.js +0 -1
- package/.next/static/chunks/3t23a8b3wz2sp.css +0 -3
- package/.next/static/chunks/3xonrwoptfy0c.js +0 -1
- package/.next/static/chunks/3ywx02bmgr0jm.js +0 -1
- package/.next/static/chunks/42kbpcy0oxrc-.js +0 -1
- package/.next/static/chunks/44v-w00lig6l4.js +0 -1
- /package/.next/static/{sPKUtI8kdV20M33Qv4OHi → xSCsOTmsNV4FbnY3KtfyD}/_buildManifest.js +0 -0
- /package/.next/static/{sPKUtI8kdV20M33Qv4OHi → xSCsOTmsNV4FbnY3KtfyD}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{sPKUtI8kdV20M33Qv4OHi → xSCsOTmsNV4FbnY3KtfyD}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let n={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],711241)},77043,e=>{var t=e.i(456420);let n={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],77043)},580685,e=>{var t=e.i(843476),n=e.i(271645),a=e.i(618566),
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let n={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],711241)},77043,e=>{var t=e.i(456420);let n={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};n.node;let a=(0,t.f)(n);e.s(["f",0,a],77043)},580685,e=>{var t=e.i(843476),n=e.i(271645),a=e.i(618566),l=e.i(762368),i=e.i(77043),s=e.i(519455),r=e.i(257428),o=e.i(967489),c=e.i(590546),u=e.i(339023),m=e.i(111110),d=e.i(35209),x=e.i(41931);let f=`
|
|
2
2
|
.exam-sheet { max-width: 210mm; margin: 0 auto; padding: 16px; color: #111; background: #fff; color-scheme: light; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.6; }
|
|
3
3
|
.exam-sheet h1 { text-align: center; font-size: 22px; margin: 0 0 8px; }
|
|
4
4
|
.exam-sheet .exam-full-score { text-align: center; font-size: 14px; margin: 0 0 8px; }
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
.exam-sheet .markdown-content table { border-collapse: collapse; }
|
|
23
23
|
.exam-sheet .markdown-content td, .exam-sheet .markdown-content th { border: 1px solid #999; padding: 2px 6px; }
|
|
24
24
|
@media print { .exam-sheet { padding: 0; max-width: none; } .exam-sheet .figure-scale-editor-controls, .exam-sheet .answer-space-controls { display: none; } @page { size: A4; margin: 15mm; } }
|
|
25
|
-
`;function
|
|
26
|
-
<html lang="${
|
|
25
|
+
`;function h(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}var p=e.i(122330),g=e.i(442861),b=e.i(520732),j=e.i(511445),w=e.i(84583),v=e.i(920808),y=e.i(763896),S=e.i(336653);function _({question:e,displayNumber:n,scoreUnit:a,answerSpace:l,customSpaces:i,uniformPreview:s,onSaveFigureScale:r,onChangeCustomSpace:o}){let c,{t:u}=(0,m.b)();return(0,t.jsxs)("section",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[n,".","number"==typeof e.score&&`(${(0,y.s)(e.score)} ${a})`]}),(0,t.jsxs)("span",{className:"exam-source",children:[u.exam.sourceLabel,": ",e.sourceShortId]})]}),(0,t.jsx)(v.f,{content:e.questionText}),(0,t.jsx)(b.f,{svg:e.figureSvg,scale:e.figureScale,align:e.figureAlign,previewScaleOverride:s.scale,previewAlignOverride:s.align,onSave:(t,n)=>r(e.id,t,n)},`${e.id}-${e.figureScale??100}-${e.figureAlign??"center"}`),(c=(0,p.z)(l,e.questionText,i[e.id]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"exam-answer-space",style:{minHeight:`${c}px`}}),(0,t.jsx)(w.f,{effectivePx:c,isCustom:"number"==typeof i[e.id],onChange:t=>o(e.id,t),onReset:()=>o(e.id,null)})]}))]})}function k({section:e}){let{t:n}=(0,m.b)(),a=null!==e.scoreTotal?n.exam.sectionSummaryScored.replace("{count}",String(e.count)).replace("{total}",String(e.scoreTotal)):n.exam.sectionSummary.replace("{count}",String(e.count));return(0,t.jsxs)("div",{className:"exam-section-head",children:[(0,t.jsx)("h2",{children:e.title}),(0,t.jsxs)("span",{className:"exam-section-summary",children:[a,null!==e.scoreTotal&&e.unscored>0&&(0,t.jsxs)("span",{children:["(",n.exam.sectionSummaryUnscored.replace("{count}",String(e.unscored)),")"]})]})]})}let N=(0,n.forwardRef)(function({paper:e,includeAnswers:n,answerSpace:a,customSpaces:l,uniformPreview:i,onSaveFigureScale:s,onChangeCustomSpace:r},o){let{t:c,language:u}=(0,m.b)(),d=e.questions.filter(e=>"ready"===e.status&&e.questionText),x=(0,y.n)(d.map(e=>e.score??null)).total,f="en"===u?"pts":"分",h=e.groupByType?(0,S.f)(d,u):null,p=(e,n)=>(0,t.jsx)(_,{question:e,displayNumber:n,scoreUnit:f,answerSpace:a,customSpaces:l,uniformPreview:i,onSaveFigureScale:s,onChangeCustomSpace:r},e.id),g=e=>e.map(e=>(0,t.jsxs)("div",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[e.displayNumber,"."]}),(0,t.jsxs)("span",{className:"exam-source",children:[c.exam.sourceLabel,": ",e.question.sourceShortId]})]}),e.question.answerText&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[c.exam.answerLabel,c.common.colon]}),(0,t.jsx)(j.f,{content:e.question.answerText})]}),e.question.analysis&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[c.exam.analysisLabel,c.common.colon]}),(0,t.jsx)(j.f,{content:e.question.analysis})]})]},e.question.id));return(0,t.jsxs)("div",{ref:o,className:"exam-sheet",children:[(0,t.jsx)("h1",{children:e.title}),null!==x&&(0,t.jsx)("p",{className:"exam-full-score",children:c.exam.fullScore.replace("{total}",(0,y.s)(x))}),(0,t.jsxs)("div",{className:"exam-meta",children:[(0,t.jsxs)("span",{children:[c.exam.nameLine,c.common.colon,"________"]}),(0,t.jsxs)("span",{children:[c.exam.dateLine,c.common.colon,"________"]}),(0,t.jsxs)("span",{children:[c.exam.scoreLine,c.common.colon,"________"]})]}),h?h.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)(k,{section:e}),e.items.map(e=>p(e.question,e.displayNumber))]},e.title)):d.map((e,t)=>p(e,t+1)),n&&(0,t.jsxs)("section",{className:"exam-answer-key",children:[(0,t.jsx)("h2",{children:c.exam.answerKey}),h?h.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)(k,{section:e}),g(e.items)]},e.title)):g(d.map((e,t)=>({question:e,displayNumber:t+1})))]})]})}),$=[];e.s(["default",0,function(){let e=(0,a.useParams)(),{t:b,language:j}=(0,m.b)(),[w,v]=(0,n.useState)(null);(0,d.f)(b.exam.title,w?.title,b.pageTitle.examPrint);let[y,S]=(0,n.useState)(!0),[_,k]=(0,n.useState)(p.q),[z,C]=(0,n.useState)({scale:null,align:null}),I=(0,n.useRef)(null),A=w?.id,q=(0,n.useCallback)(async e=>{if(A){if(e.length>1&&e.every(e=>null===e.answerSpacePx))return void await x.k.patch(`/api/exams/${A}`,{answerSpacePx:null});await Promise.all(e.map(({id:e,answerSpacePx:t})=>x.k.patch(`/api/exams/${A}`,{questionId:e,answerSpacePx:t})))}},[A]),{customSpaces:T,setSpace:F,resetAll:M,saveFailed:R}=(0,g.f)(w?.questions??$,q);if((0,n.useEffect)(()=>{let e=null;try{e=localStorage.getItem(p.p)}catch{}(0,p.I)(e)&&k(e)},[]),(0,n.useEffect)(()=>{x.k.get(`/api/exams/${e.id}`).then(v).catch(()=>v(null))},[e.id]),!w)return(0,t.jsx)("div",{className:"p-8 text-center",children:b.common.loading});let V=w.questions.filter(e=>"ready"===e.status&&e.questionText&&!!e.figureSvg),P=w.questions.filter(e=>"ready"===e.status&&e.questionText).length,L=async(e,t,n)=>{await x.k.patch(`/api/exams/${w.id}`,{questionId:e,figureScale:t,figureAlign:n}),v(a=>a?{...a,questions:a.questions.map(a=>a.id===e?{...a,figureScale:t,figureAlign:n}:a)}:a)},O=async e=>{await x.k.patch(`/api/exams/${w.id}`,e),v(t=>t?{...t,questions:t.questions.map(t=>({...t,...e}))}:t)};return(0,t.jsxs)("main",{className:"min-h-screen bg-white",children:[(0,t.jsx)("style",{children:f}),(0,t.jsx)("div",{className:"print:hidden sticky top-0 z-10 border-b bg-background p-3 shadow-sm",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex flex-wrap items-center gap-3",children:[(0,t.jsx)(c.f,{fallbackUrl:`/exams/${w.id}`}),(0,t.jsx)("span",{className:"font-semibold",children:b.exam.printTitle}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(r.f,{checked:y,onCheckedChange:e=>S(!0===e)}),b.exam.includeAnswers]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"shrink-0",children:b.exam.answerSpace}),(0,t.jsxs)(o.d,{value:_,onValueChange:e=>{if((0,p.I)(e)){k(e);try{localStorage.setItem(p.p,e)}catch{}}},children:[(0,t.jsx)(o.P,{className:"h-8 w-40",children:(0,t.jsx)(o.U,{})}),(0,t.jsxs)(o.r,{children:[(0,t.jsx)(o.T,{value:"auto",children:b.exam.answerSpaceAuto}),(0,t.jsx)(o.T,{value:"none",children:b.exam.answerSpaceNone}),(0,t.jsx)(o.T,{value:"small",children:b.exam.answerSpaceSmall}),(0,t.jsx)(o.T,{value:"medium",children:b.exam.answerSpaceMedium}),(0,t.jsx)(o.T,{value:"large",children:b.exam.answerSpaceLarge})]})]}),Object.keys(T).length>0&&(0,t.jsx)(s.f,{type:"button",variant:"ghost",size:"sm",onClick:M,children:b.exam.resetAllQuestionAnswerSpaces})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,t.jsxs)(s.f,{variant:"outline",size:"sm",onClick:()=>{var e;if(!I.current)return;let t=I.current.cloneNode(!0);t.querySelectorAll(".figure-scale-editor-controls, .answer-space-controls, .print\\:hidden").forEach(e=>e.remove());let n=function(e,t,n="zh-CN"){return`<!doctype html>
|
|
26
|
+
<html lang="${h(n)}">
|
|
27
27
|
<head>
|
|
28
28
|
<meta charset="utf-8">
|
|
29
29
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
30
|
-
<title>${
|
|
30
|
+
<title>${h(e)}</title>
|
|
31
31
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.19.1/dist/katex.min.css">
|
|
32
|
-
<style>body { margin: 0; background: #fff; }${
|
|
32
|
+
<style>body { margin: 0; background: #fff; }${f}</style>
|
|
33
33
|
</head>
|
|
34
34
|
<body>
|
|
35
35
|
${t}
|
|
36
36
|
</body>
|
|
37
37
|
</html>
|
|
38
|
-
`}(w.title,t.outerHTML,"en"===j?"en":"zh-CN"),a=URL.createObjectURL(new Blob([n],{type:"text/html;charset=utf-8"})),i=document.createElement("a");i.href=a,e=w.title,i.download=`${e.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,i.click(),URL.revokeObjectURL(a)},children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),b.exam.downloadHtml]}),(0,t.jsxs)(s.f,{size:"sm",onClick:()=>window.print(),children:[(0,t.jsx)(l.f,{className:"mr-2 h-4 w-4"}),b.exam.printNow]})]}),"auto"===_&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:b.exam.answerSpaceAutoHint}),R&&(0,t.jsx)("p",{className:"w-full text-xs text-destructive",children:b.exam.answerSpaceSaveFailed}),P<w.questions.length&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:b.exam.notReadyHint}),V.length>0&&(0,t.jsx)(u.f,{scales:V.map(e=>e.figureScale),aligns:V.map(e=>e.figureAlign),onPreviewChange:I,onSave:O})]})}),(0,t.jsx)(N,{ref:q,paper:w,includeAnswers:y,answerSpace:_,customSpaces:T,uniformPreview:C,onSaveFigureScale:L,onChangeCustomSpace:F})]})}],580685)},520732,e=>{var t=e.i(843476),n=e.i(271645),a=e.i(149704),i=e.i(519455),l=e.i(793479),s=e.i(111110),r=e.i(294114),c=e.i(184110),o=e.i(201276);e.s(["f",0,function({svg:e,scale:u,align:m,previewScaleOverride:d,previewAlignOverride:x,onSave:h}){let{t:f}=(0,s.b)(),p=(0,n.useId)(),g=(0,c.V)(u),b=(0,c.o)(m),[j,w]=(0,n.useState)(null),[v,y]=(0,n.useState)(null),[S,_]=(0,n.useState)(!1),k=j??String(g),N=""!==k.trim()&&(0,c.x)(Number(k)),z=N?Number(k):g,C=v??b,I=d??z,q=x??C,A=null!==j&&(!N||Number(k)!==g)||null!==v&&v!==b;if(!e)return null;let $=async e=>{if(e.preventDefault(),N&&A&&!S){_(!0);try{await h(z,C),w(null),y(null),r.c.success(f.common.messages.saveSuccess)}catch(e){o.V.error("[FigureScale]","保存配图比例失败",{error:e}),r.c.error(f.common.messages.saveFailed)}finally{_(!1)}}};return(0,t.jsxs)("div",{children:[(0,t.jsx)(a.f,{svg:e,scale:I,align:q}),(0,t.jsxs)("form",{onSubmit:$,className:"figure-scale-editor-controls space-y-2 rounded-md border p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:p,children:f.figure.scale}),(0,t.jsx)(l.f,{id:p,type:"number",min:c._,max:c.a,step:1,value:k,disabled:S,"aria-describedby":`${p}-hint`,"aria-invalid":!N,onChange:e=>w(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(i.f,{type:"button",variant:"outline",size:"sm",disabled:S||N&&z===c.n,onClick:()=>w(String(c.n)),children:f.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":f.figure.align,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:f.figure.align}),c.j.map(e=>(0,t.jsx)(i.f,{type:"button",variant:C===e?"default":"outline",size:"sm",disabled:S,"aria-pressed":C===e,onClick:()=>y(e===b?null:e),children:f.figure.aligns[e]},e))]}),(0,t.jsx)(i.f,{type:"submit",size:"sm",disabled:S||!A||!N,children:S?f.common.progress.saving:f.common.save}),A&&(0,t.jsx)(i.f,{type:"button",variant:"ghost",size:"sm",disabled:S,onClick:()=>{w(null),y(null)},children:f.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:c._,max:c.a,step:1,value:z,disabled:S,"aria-label":f.figure.scaleSlider,"aria-describedby":`${p}-hint`,onChange:e=>w(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${p}-hint`,className:"text-xs text-muted-foreground",children:f.figure.scaleHint})]})]})}])},339023,763896,336653,e=>{var t=e.i(843476),n=e.i(271645),a=e.i(519455),i=e.i(793479),l=e.i(111110),s=e.i(294114),r=e.i(184110),c=e.i(201276);function o(e){let t=0,n=0;for(let a of e)"number"==typeof a&&Number.isFinite(a)&&(t+=1,n+=a);return{scored:t,unscored:e.length-t,total:t>0?Math.round(10*n)/10:null}}e.s(["f",0,function({scales:e,aligns:o,onPreviewChange:u,onSave:m}){let{t:d}=(0,l.b)(),x=(0,n.useId)(),h=e.map(r.V),f=new Set(h).size<=1,p=h[0]??r.n,g=(o??e.map(()=>r.E)).map(r.o),b=new Set(g).size<=1,j=g[0]??r.E,[w,v]=(0,n.useState)(null),[y,S]=(0,n.useState)(null),[_,k]=(0,n.useState)(!1);if(0===e.length)return null;let N=w??String(p),z=""!==N.trim()&&(0,r.x)(Number(N)),C=z?Number(N):p,I=y??j,q=null!==w||null!==y,A=null!==w?!z||!f||Number(N)!==p:!q&&!f,$=null!==y?!b||y!==j:!q&&!b,T=A||$,F=(e,t)=>{let n=null!==e&&""!==e.trim()&&(0,r.x)(Number(e))?Number(e):null;u?.({scale:n,align:t})},M=e=>{v(e),F(e,y)},R=async e=>{if(e.preventDefault(),z&&T&&!_){k(!0);try{let e={};null===w&&(q||f)||(e.figureScale=C),null===y&&(q||b)||(e.figureAlign=I),await m(e),v(null),S(null),u?.({scale:null,align:null}),s.c.success(d.common.messages.saveSuccess)}catch(e){c.V.error("[ExamFigureScale]","统一保存试卷配图设置失败",{error:e}),s.c.error(d.common.messages.saveFailed)}finally{k(!1)}}};return(0,t.jsxs)("form",{onSubmit:R,className:"figure-scale-editor-controls w-full space-y-2 rounded-md border bg-background p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:x,className:"font-medium",children:d.exam.uniformFigureScale}),(0,t.jsx)(i.f,{id:x,type:"number",min:r._,max:r.a,step:1,value:N,disabled:_,"aria-describedby":`${x}-hint`,"aria-invalid":!z,onChange:e=>M(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(a.f,{type:"button",variant:"outline",size:"sm",disabled:_||f&&z&&C===r.n,onClick:()=>M(String(r.n)),children:d.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":d.exam.uniformFigureAlign,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:d.exam.uniformFigureAlign}),r.j.map(e=>(0,t.jsx)(a.f,{type:"button",variant:I===e&&(null!==y||b)?"default":"outline",size:"sm",disabled:_,"aria-pressed":I===e&&(null!==y||b),onClick:()=>{var t;S(t=b&&e===j?null:e),F(w,t)},children:d.figure.aligns[e]},e))]}),(0,t.jsx)(a.f,{type:"submit",size:"sm",disabled:_||!T||!z,children:_?d.common.progress.saving:d.common.save}),q&&(0,t.jsx)(a.f,{type:"button",variant:"ghost",size:"sm",disabled:_,onClick:()=>{v(null),S(null),u?.({scale:null,align:null})},children:d.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:r._,max:r.a,step:1,value:C,disabled:_,"aria-label":d.exam.uniformFigureScaleSlider,"aria-describedby":`${x}-hint`,onChange:e=>M(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${x}-hint`,className:"text-xs text-muted-foreground",children:d.exam.uniformFigureScaleHint})]})}],339023),e.s(["D",0,1e3,"s",0,function(e){return Number.isInteger(e)?String(e):e.toFixed(1)},"H",0,function(e){return null===e||"number"!=typeof e||!Number.isFinite(e)||e<.001||e>1e3||Math.abs(10*e-Math.round(10*e))>1e-6?null:Math.round(10*e)/10},"n",0,o],763896);var u=e.i(401280);let m=["一","二","三","四","五","六","七","八","九","十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十"],d=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX"];e.s(["f",0,function(e,t){let n=new Map;for(let e of u.V)n.set(e,[]);for(let t of[...e].sort((e,t)=>e.order-t.order))n.get(function(e){let t=e.questionType??e.errorItemQuestionType??null;return u.V.includes(t??"")?t:"other"}(t)).push(t);let a=[],i=1,l=0;for(let e of u.V){let s=n.get(e);if(0===s.length)continue;let r=o(s.map(e=>e.score??null));a.push({type:"other"===e?null:e,title:function(e,t,n){let a="zh"===n?u.H[e]:u.u[e];return"zh"===n?`${m[t]}、${a}`:`Part ${d[t]}. ${a}`}(e,l,t),items:s.map(e=>({question:e,displayNumber:i++})),count:s.length,scoreTotal:r.total,unscored:r.unscored}),l+=1}return a}],336653)},84583,920808,e=>{var t=e.i(843476),n=e.i(519455),a=e.i(111110),i=e.i(122330);e.s(["f",0,function({effectivePx:e,isCustom:l,onChange:s,onReset:r}){let{t:c}=(0,a.b)(),o=(0,i.O)(e);return(0,t.jsxs)("div",{className:"answer-space-controls print:hidden flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-2 pt-1",children:[(0,t.jsxs)("span",{children:[c.exam.questionAnswerSpace,": ",o,"px"]}),(0,t.jsx)(n.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":c.exam.decreaseAnswerSpace,disabled:o<=i.r,onClick:()=>s((0,i.O)(o-i.W)),children:"-"}),(0,t.jsx)("input",{type:"range",min:i.r,max:i.R,step:10,value:o,"aria-label":c.exam.questionAnswerSpaceSlider,onChange:e=>s((0,i.O)(Number(e.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,t.jsx)(n.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":c.exam.increaseAnswerSpace,disabled:o>=i.R,onClick:()=>s((0,i.O)(o+i.W)),children:"+"}),l&&(0,t.jsx)(n.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:r,children:c.exam.resetQuestionAnswerSpace})]})}],84583);var l=e.i(271645),s=e.i(511445),r=e.i(369939);let c=["A","B","C","D"];function o(e){return RegExp(`^(?:${e}\\s*[..::、]|[((]${e}[))])`)}function u(e){let t=e.replace(/\$+/g,"").replace(/\\[a-zA-Z]+/g,"").replace(/[{}^_\\]/g,""),n=0;for(let e of t)n+=e.codePointAt(0)>=11904?2:1;return n}let m={4:"grid-cols-2 sm:grid-cols-4 print:grid-cols-4",2:"grid-cols-1 sm:grid-cols-2 print:grid-cols-2",1:"grid-cols-1"};e.s(["f",0,function({content:e}){let n=(0,l.useMemo)(()=>(function(e){if(!e)return null;let{masked:t,segments:n}=(0,r.F)(e.replace(/\\n/g,"\n")),a=(0,r.n)(t,"\n").split("\n"),i=a.findIndex(e=>o("A").test(e.trim()));if(i<0)return null;let l=[],s=0,m=i;for(let e=i;e<a.length&&s<c.length;e+=1){let t=a[e].trim();if(!t)continue;if(!o(c[s]).test(t))break;let n=function(e,t){let n=[],a=e,i=t;for(;i<c.length;){var l;let e=a.match(o(c[i]))[0];a=a.slice(e.length);let t=i+1<c.length?a.match((l=c[i+1],RegExp(`\\s(?:${l}\\s*[..::、]|[((]${l}[))])`))):null,s=t?.index??a.length;if(n.push({label:e.trim(),content:a.slice(0,s).trim()}),i+=1,!t)break;a=a.slice(s).trimStart()}return{options:n,next:i}}(t,s);l.push(...n.options),s=n.next,m=e+1}if(l.length<3||m-i<2)return null;let d=a.slice(m).join("\n").trim();if(s<c.length&&d)return null;let x=e=>(0,r.i)(e,n),h=l.map(e=>({label:e.label,content:x(e.content)}));return{stem:x(a.slice(0,i).join("\n").trim()),options:h,after:x(d),columns:function(e){if(e.some(({content:e})=>/!\[|\|/.test(e)))return 1;let t=Math.max(...e.map(({label:e,content:t})=>u(e)+1+u(t)));return t<=14?4:t<=34?2:1}(h)}})(e),[e]);return n?(0,t.jsxs)(t.Fragment,{children:[n.stem&&(0,t.jsx)(s.f,{content:n.stem}),(0,t.jsx)("div",{className:`choice-options mb-3 grid gap-x-6 gap-y-1 ${m[n.columns]}`,children:n.options.map(e=>(0,t.jsxs)("div",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0",children:e.label}),(0,t.jsx)(s.f,{content:e.content,className:"flex-1 [&_p]:mb-0"})]},e.label))}),n.after&&(0,t.jsx)(s.f,{content:n.after})]}):(0,t.jsx)(s.f,{content:e})}],920808)},149704,e=>{var t=e.i(843476),n=e.i(111110),a=e.i(398019),i=e.i(184110),l=e.i(975157);let s={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:r,align:c,className:o}){let{t:u}=(0,n.b)();if(!e)return null;let m=(0,i.V)(r),d=(0,i.o)(c);return(0,t.jsx)("figure",{className:(0,l.f)("question-figure my-3",o),children:(0,t.jsx)("img",{src:(0,a.d)(e),alt:u.figure.alt,className:(0,l.f)(s[d],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===d?{marginLeft:0,marginRight:"auto"}:"right"===d?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:m/100,maxWidth:`${Math.min(m,100)}%`}})})}])},590546,e=>{var t=e.i(843476),n=e.i(618566),a=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:l}){let s=(0,n.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(e)},className:l,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},122330,e=>{let t=["auto","none","small","medium","large"],n={none:0,small:60,medium:120,large:240},a={choice:12,judgment:12,fill:16,solution:240};function i(e){return Number.isFinite(e)?Math.min(600,Math.max(0,Math.round(e))):0}let l=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,s=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,r=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,c=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,o=/(\s*(\d{1,2})\s*)/g,u=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function m(e){let t=new Set;for(let n of e.matchAll(o))t.add(n[1]);for(let n of e.matchAll(u))t.add(n[1]);return Math.max(1,t.size)}e.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,i,"I",0,function(e){return"string"==typeof e&&t.includes(e)},"T",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<0||e>600?null:e},"z",0,function(e,t,o){let u;if("number"==typeof o&&Number.isFinite(o))return i(o);if("auto"!==e)return n[e];let d=(u=new Set(Array.from(t.matchAll(l),e=>e[1]??e[2]??e[3]))).has("A")&&u.has("B")&&u.has("C")?"choice":s.test(t)?"judgment":m(t)>1||c.test(t)?"solution":r.test(t)?"fill":"solution";if("solution"!==d)return a[d];let x=(m(t)-1)*120;return Math.min(560,a.solution+x)}])},184110,e=>{let t=["left","center","right"],n="center";function a(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,n,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,a,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:n},"V",0,function(e){return a(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},442861,e=>{var t=e.i(271645),n=e.i(122330),a=e.i(201276);e.s(["f",0,function(e,i){let[l,s]=(0,t.useState)({}),[r,c]=(0,t.useState)(!1),o=(0,t.useRef)(new Map),u=(0,t.useRef)(null),m=(0,t.useRef)(i);(0,t.useEffect)(()=>{m.current=i},[i]);let d=(0,t.useMemo)(()=>{let t={};for(let a of e){let e=a.id in l?l[a.id]:(0,n.T)(a.answerSpacePx);"number"==typeof e&&(t[a.id]=e)}return t},[e,l]),x=(0,t.useCallback)(()=>{if(u.current&&(clearTimeout(u.current),u.current=null),0===o.current.size)return;let e=Array.from(o.current,([e,t])=>({id:e,answerSpacePx:t}));o.current.clear(),m.current(e).then(()=>c(!1)).catch(e=>{c(!0),a.V.error("[AnswerSpace]","Failed to save answer space",{error:e})})},[]);(0,t.useEffect)(()=>x,[x]);let h=(0,t.useCallback)((e,t)=>{if(0!==e.length){for(let{id:t,answerSpacePx:n}of(s(t=>{let n={...t};for(let{id:t,answerSpacePx:a}of e)n[t]=a;return n}),e))o.current.set(t,n);if(t)return void x();u.current&&clearTimeout(u.current),u.current=setTimeout(x,600)}},[x]),f=(0,t.useCallback)((e,t)=>{h([{id:e,answerSpacePx:t}],null===t)},[h]),p=(0,t.useCallback)(()=>{h(Object.keys(d).map(e=>({id:e,answerSpacePx:null})),!0)},[d,h]);return{customSpaces:d,setSpace:f,resetAll:p,saveFailed:r}}])},35209,e=>{var t=e.i(271645),n=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,n.b)(),i=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let n=e.trim().toLowerCase();return n?t[n]??null:null}])}])})();
|
|
38
|
+
`}(w.title,t.outerHTML,"en"===j?"en":"zh-CN"),a=URL.createObjectURL(new Blob([n],{type:"text/html;charset=utf-8"})),l=document.createElement("a");l.href=a,e=w.title,l.download=`${e.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,l.click(),URL.revokeObjectURL(a)},children:[(0,t.jsx)(l.f,{className:"mr-2 h-4 w-4"}),b.exam.downloadHtml]}),(0,t.jsxs)(s.f,{size:"sm",onClick:()=>window.print(),children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),b.exam.printNow]})]}),"auto"===_&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:b.exam.answerSpaceAutoHint}),R&&(0,t.jsx)("p",{className:"w-full text-xs text-destructive",children:b.exam.answerSpaceSaveFailed}),P<w.questions.length&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:b.exam.notReadyHint}),V.length>0&&(0,t.jsx)(u.f,{scales:V.map(e=>e.figureScale),aligns:V.map(e=>e.figureAlign),onPreviewChange:C,onSave:O})]})}),(0,t.jsx)(N,{ref:I,paper:w,includeAnswers:y,answerSpace:_,customSpaces:T,uniformPreview:z,onSaveFigureScale:L,onChangeCustomSpace:F})]})}],580685)},520732,e=>{var t=e.i(843476),n=e.i(271645),a=e.i(149704),l=e.i(519455),i=e.i(793479),s=e.i(111110),r=e.i(294114),o=e.i(184110),c=e.i(201276);e.s(["f",0,function({svg:e,scale:u,align:m,previewScaleOverride:d,previewAlignOverride:x,onSave:f}){let{t:h}=(0,s.b)(),p=(0,n.useId)(),g=(0,o.V)(u),b=(0,o.o)(m),[j,w]=(0,n.useState)(null),[v,y]=(0,n.useState)(null),[S,_]=(0,n.useState)(!1),k=j??String(g),N=""!==k.trim()&&(0,o.x)(Number(k)),$=N?Number(k):g,z=v??b,C=d??$,I=x??z,A=null!==j&&(!N||Number(k)!==g)||null!==v&&v!==b;if(!e)return null;let q=async e=>{if(e.preventDefault(),N&&A&&!S){_(!0);try{await f($,z),w(null),y(null),r.c.success(h.common.messages.saveSuccess)}catch(e){c.V.error("[FigureScale]","保存配图比例失败",{error:e}),r.c.error(h.common.messages.saveFailed)}finally{_(!1)}}};return(0,t.jsxs)("div",{children:[(0,t.jsx)(a.f,{svg:e,scale:C,align:I}),(0,t.jsxs)("form",{onSubmit:q,className:"figure-scale-editor-controls space-y-2 rounded-md border p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:p,children:h.figure.scale}),(0,t.jsx)(i.f,{id:p,type:"number",min:o._,max:o.a,step:1,value:k,disabled:S,"aria-describedby":`${p}-hint`,"aria-invalid":!N,onChange:e=>w(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(l.f,{type:"button",variant:"outline",size:"sm",disabled:S||N&&$===o.n,onClick:()=>w(String(o.n)),children:h.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":h.figure.align,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:h.figure.align}),o.j.map(e=>(0,t.jsx)(l.f,{type:"button",variant:z===e?"default":"outline",size:"sm",disabled:S,"aria-pressed":z===e,onClick:()=>y(e===b?null:e),children:h.figure.aligns[e]},e))]}),(0,t.jsx)(l.f,{type:"submit",size:"sm",disabled:S||!A||!N,children:S?h.common.progress.saving:h.common.save}),A&&(0,t.jsx)(l.f,{type:"button",variant:"ghost",size:"sm",disabled:S,onClick:()=>{w(null),y(null)},children:h.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:o._,max:o.a,step:1,value:$,disabled:S,"aria-label":h.figure.scaleSlider,"aria-describedby":`${p}-hint`,onChange:e=>w(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${p}-hint`,className:"text-xs text-muted-foreground",children:h.figure.scaleHint})]})]})}])},339023,763896,336653,e=>{var t=e.i(843476),n=e.i(271645),a=e.i(519455),l=e.i(793479),i=e.i(111110),s=e.i(294114),r=e.i(184110),o=e.i(201276);function c(e){let t=0,n=0;for(let a of e)"number"==typeof a&&Number.isFinite(a)&&(t+=1,n+=a);return{scored:t,unscored:e.length-t,total:t>0?Math.round(10*n)/10:null}}e.s(["f",0,function({scales:e,aligns:c,onPreviewChange:u,onSave:m}){let{t:d}=(0,i.b)(),x=(0,n.useId)(),f=e.map(r.V),h=new Set(f).size<=1,p=f[0]??r.n,g=(c??e.map(()=>r.E)).map(r.o),b=new Set(g).size<=1,j=g[0]??r.E,[w,v]=(0,n.useState)(null),[y,S]=(0,n.useState)(null),[_,k]=(0,n.useState)(!1);if(0===e.length)return null;let N=w??String(p),$=""!==N.trim()&&(0,r.x)(Number(N)),z=$?Number(N):p,C=y??j,I=null!==w||null!==y,A=null!==w?!$||!h||Number(N)!==p:!I&&!h,q=null!==y?!b||y!==j:!I&&!b,T=A||q,F=(e,t)=>{let n=null!==e&&""!==e.trim()&&(0,r.x)(Number(e))?Number(e):null;u?.({scale:n,align:t})},M=e=>{v(e),F(e,y)},R=async e=>{if(e.preventDefault(),$&&T&&!_){k(!0);try{let e={};null===w&&(I||h)||(e.figureScale=z),null===y&&(I||b)||(e.figureAlign=C),await m(e),v(null),S(null),u?.({scale:null,align:null}),s.c.success(d.common.messages.saveSuccess)}catch(e){o.V.error("[ExamFigureScale]","统一保存试卷配图设置失败",{error:e}),s.c.error(d.common.messages.saveFailed)}finally{k(!1)}}};return(0,t.jsxs)("form",{onSubmit:R,className:"figure-scale-editor-controls w-full space-y-2 rounded-md border bg-background p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:x,className:"font-medium",children:d.exam.uniformFigureScale}),(0,t.jsx)(l.f,{id:x,type:"number",min:r._,max:r.a,step:1,value:N,disabled:_,"aria-describedby":`${x}-hint`,"aria-invalid":!$,onChange:e=>M(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(a.f,{type:"button",variant:"outline",size:"sm",disabled:_||h&&$&&z===r.n,onClick:()=>M(String(r.n)),children:d.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":d.exam.uniformFigureAlign,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:d.exam.uniformFigureAlign}),r.j.map(e=>(0,t.jsx)(a.f,{type:"button",variant:C===e&&(null!==y||b)?"default":"outline",size:"sm",disabled:_,"aria-pressed":C===e&&(null!==y||b),onClick:()=>{var t;S(t=b&&e===j?null:e),F(w,t)},children:d.figure.aligns[e]},e))]}),(0,t.jsx)(a.f,{type:"submit",size:"sm",disabled:_||!T||!$,children:_?d.common.progress.saving:d.common.save}),I&&(0,t.jsx)(a.f,{type:"button",variant:"ghost",size:"sm",disabled:_,onClick:()=>{v(null),S(null),u?.({scale:null,align:null})},children:d.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:r._,max:r.a,step:1,value:z,disabled:_,"aria-label":d.exam.uniformFigureScaleSlider,"aria-describedby":`${x}-hint`,onChange:e=>M(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${x}-hint`,className:"text-xs text-muted-foreground",children:d.exam.uniformFigureScaleHint})]})}],339023),e.s(["D",0,1e3,"s",0,function(e){return Number.isInteger(e)?String(e):e.toFixed(1)},"H",0,function(e){return null===e||"number"!=typeof e||!Number.isFinite(e)||e<.001||e>1e3||Math.abs(10*e-Math.round(10*e))>1e-6?null:Math.round(10*e)/10},"n",0,c],763896);var u=e.i(401280);let m=["一","二","三","四","五","六","七","八","九","十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十"],d=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX"];e.s(["f",0,function(e,t){let n=new Map;for(let e of u.V)n.set(e,[]);for(let t of[...e].sort((e,t)=>e.order-t.order))n.get(function(e){let t=e.questionType??e.errorItemQuestionType??null;return u.V.includes(t??"")?t:"other"}(t)).push(t);let a=[],l=1,i=0;for(let e of u.V){let s=n.get(e);if(0===s.length)continue;let r=c(s.map(e=>e.score??null));a.push({type:"other"===e?null:e,title:function(e,t,n){let a="zh"===n?u.H[e]:u.u[e];return"zh"===n?`${m[t]}、${a}`:`Part ${d[t]}. ${a}`}(e,i,t),items:s.map(e=>({question:e,displayNumber:l++})),count:s.length,scoreTotal:r.total,unscored:r.unscored}),i+=1}return a}],336653)},84583,920808,e=>{var t=e.i(843476),n=e.i(519455),a=e.i(111110),l=e.i(122330);e.s(["f",0,function({effectivePx:e,isCustom:i,onChange:s,onReset:r}){let{t:o}=(0,a.b)(),c=(0,l.O)(e);return(0,t.jsxs)("div",{className:"answer-space-controls print:hidden flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-2 pt-1",children:[(0,t.jsxs)("span",{children:[o.exam.questionAnswerSpace,": ",c,"px"]}),(0,t.jsx)(n.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":o.exam.decreaseAnswerSpace,disabled:c<=l.r,onClick:()=>s((0,l.O)(c-l.W)),children:"-"}),(0,t.jsx)("input",{type:"range",min:l.r,max:l.R,step:10,value:c,"aria-label":o.exam.questionAnswerSpaceSlider,onChange:e=>s((0,l.O)(Number(e.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,t.jsx)(n.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":o.exam.increaseAnswerSpace,disabled:c>=l.R,onClick:()=>s((0,l.O)(c+l.W)),children:"+"}),i&&(0,t.jsx)(n.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:r,children:o.exam.resetQuestionAnswerSpace})]})}],84583);var i=e.i(271645),s=e.i(511445),r=e.i(369939);let o=["A","B","C","D"];function c(e){return RegExp(`^(?:${e}\\s*[..::、]|[((]${e}[))])`)}function u(e){let t=e.replace(/\$+/g,"").replace(/\\[a-zA-Z]+/g,"").replace(/[{}^_\\]/g,""),n=0;for(let e of t)n+=e.codePointAt(0)>=11904?2:1;return n}let m={4:"grid-cols-2 sm:grid-cols-4 print:grid-cols-4",2:"grid-cols-1 sm:grid-cols-2 print:grid-cols-2",1:"grid-cols-1"};e.s(["f",0,function({content:e}){let n=(0,i.useMemo)(()=>(function(e){if(!e)return null;let{masked:t,segments:n}=(0,r.F)(e.replace(/\\n/g,"\n")),a=(0,r.n)(t,"\n").split("\n"),l=a.findIndex(e=>c("A").test(e.trim()));if(l<0)return null;let i=[],s=0,m=l;for(let e=l;e<a.length&&s<o.length;e+=1){let t=a[e].trim();if(!t)continue;if(!c(o[s]).test(t))break;let n=function(e,t){let n=[],a=e,l=t;for(;l<o.length;){var i;let e=a.match(c(o[l]))[0];a=a.slice(e.length);let t=l+1<o.length?a.match((i=o[l+1],RegExp(`\\s(?:${i}\\s*[..::、]|[((]${i}[))])`))):null,s=t?.index??a.length;if(n.push({label:e.trim(),content:a.slice(0,s).trim()}),l+=1,!t)break;a=a.slice(s).trimStart()}return{options:n,next:l}}(t,s);i.push(...n.options),s=n.next,m=e+1}if(i.length<3||m-l<2)return null;let d=a.slice(m).join("\n").trim();if(s<o.length&&d)return null;let x=e=>(0,r.i)(e,n),f=i.map(e=>({label:e.label,content:x(e.content)}));return{stem:x(a.slice(0,l).join("\n").trim()),options:f,after:x(d),columns:function(e){if(e.some(({content:e})=>/!\[|\|/.test(e)))return 1;let t=Math.max(...e.map(({label:e,content:t})=>u(e)+1+u(t)));return t<=14?4:t<=34?2:1}(f)}})(e),[e]);return n?(0,t.jsxs)(t.Fragment,{children:[n.stem&&(0,t.jsx)(s.f,{content:n.stem}),(0,t.jsx)("div",{className:`choice-options mb-3 grid gap-x-6 gap-y-1 ${m[n.columns]}`,children:n.options.map(e=>(0,t.jsxs)("div",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0",children:e.label}),(0,t.jsx)(s.f,{content:e.content,className:"flex-1 [&_p]:mb-0"})]},e.label))}),n.after&&(0,t.jsx)(s.f,{content:n.after})]}):(0,t.jsx)(s.f,{content:e})}],920808)},149704,e=>{var t=e.i(843476),n=e.i(111110),a=e.i(398019),l=e.i(184110),i=e.i(975157);let s={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:r,align:o,className:c}){let{t:u}=(0,n.b)();if(!e)return null;let m=(0,l.V)(r),d=(0,l.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,a.d)(e),alt:u.figure.alt,className:(0,i.f)(s[d],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===d?{marginLeft:0,marginRight:"auto"}:"right"===d?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:m/100,maxWidth:`${Math.min(m,100)}%`}})})}])},590546,e=>{var t=e.i(843476),n=e.i(618566),a=e.i(519455),l=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let s=(0,n.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(e)},className:i,children:(0,t.jsx)(l.f,{className:"h-5 w-5"})})}])},122330,e=>{let t=["auto","none","small","medium","large"],n={none:0,small:60,medium:120,large:240},a={choice:12,judgment:12,fill:16,solution:240};function l(e){return Number.isFinite(e)?Math.min(600,Math.max(0,Math.round(e))):0}let i=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,s=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,r=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,o=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,c=/(\s*(\d{1,2})\s*)/g,u=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function m(e){let t=new Set;for(let n of e.matchAll(c))t.add(n[1]);for(let n of e.matchAll(u))t.add(n[1]);return Math.max(1,t.size)}e.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,l,"I",0,function(e){return"string"==typeof e&&t.includes(e)},"T",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<0||e>600?null:e},"z",0,function(e,t,c){let u;if("number"==typeof c&&Number.isFinite(c))return l(c);if("auto"!==e)return n[e];let d=(u=new Set(Array.from(t.matchAll(i),e=>e[1]??e[2]??e[3]))).has("A")&&u.has("B")&&u.has("C")?"choice":s.test(t)?"judgment":m(t)>1||o.test(t)?"solution":r.test(t)?"fill":"solution";if("solution"!==d)return a[d];let x=(m(t)-1)*120;return Math.min(560,a.solution+x)}])},184110,e=>{let t=["left","center","right"],n="center";function a(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,n,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,a,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:n},"V",0,function(e){return a(e)?e:100}])},398019,e=>{let t=/<([a-zA-Z][\w:.-]*)((?:\s+[^\s=>/"']+\s*=\s*(?:"[^"]*"|'[^']*'))+)\s*(\/?)>/g,n=/([^\s=>/"']+)\s*=\s*("[^"]*"|'[^']*')/g;e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.replace(t,(e,t,a,l)=>{let i=[...a.matchAll(n)].map(([,e,t])=>({key:e,value:t})),s=new Map;for(let{key:e}of i)s.set(e,(s.get(e)??0)+1);if(![...s.values()].some(e=>e>1))return e;let r=l?"/>":">",o=new Map;for(let{key:e,value:t}of i)o.has(e)||o.set(e,t);let c=e=>e.slice(1,-1).trim(),u=i.filter(e=>"x2"===e.key).map(e=>c(e.value)),m=i.filter(e=>"y2"===e.key).map(e=>c(e.value));if("line"===t.toLowerCase()&&u.length>1&&u.length===m.length&&o.has("x1")&&o.has("y1")){let e=[`${c(o.get("x1"))},${c(o.get("y1"))}`,...u.map((e,t)=>`${e},${m[t]}`)],t=[...o].filter(([e])=>!["x1","y1","x2","y2","fill"].includes(e)),n=[`points="${e.join(" ")}"`,'fill="none"',...t.map(([e,t])=>`${e}=${t}`)];return`<polyline ${n.join(" ")}${r}`}return`<${t} ${[...o].map(([e,t])=>`${e}=${t}`).join(" ")}${r}`}))}`}])},442861,e=>{var t=e.i(271645),n=e.i(122330),a=e.i(201276);e.s(["f",0,function(e,l){let[i,s]=(0,t.useState)({}),[r,o]=(0,t.useState)(!1),c=(0,t.useRef)(new Map),u=(0,t.useRef)(null),m=(0,t.useRef)(l);(0,t.useEffect)(()=>{m.current=l},[l]);let d=(0,t.useMemo)(()=>{let t={};for(let a of e){let e=a.id in i?i[a.id]:(0,n.T)(a.answerSpacePx);"number"==typeof e&&(t[a.id]=e)}return t},[e,i]),x=(0,t.useCallback)(()=>{if(u.current&&(clearTimeout(u.current),u.current=null),0===c.current.size)return;let e=Array.from(c.current,([e,t])=>({id:e,answerSpacePx:t}));c.current.clear(),m.current(e).then(()=>o(!1)).catch(e=>{o(!0),a.V.error("[AnswerSpace]","Failed to save answer space",{error:e})})},[]);(0,t.useEffect)(()=>x,[x]);let f=(0,t.useCallback)((e,t)=>{if(0!==e.length){for(let{id:t,answerSpacePx:n}of(s(t=>{let n={...t};for(let{id:t,answerSpacePx:a}of e)n[t]=a;return n}),e))c.current.set(t,n);if(t)return void x();u.current&&clearTimeout(u.current),u.current=setTimeout(x,600)}},[x]),h=(0,t.useCallback)((e,t)=>{f([{id:e,answerSpacePx:t}],null===t)},[f]),p=(0,t.useCallback)(()=>{f(Object.keys(d).map(e=>({id:e,answerSpacePx:null})),!0)},[d,f]);return{customSpaces:d,setSpace:h,resetAll:p,saveFailed:r}}])},35209,e=>{var t=e.i(271645),n=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,n.b)(),l=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=l},[l])}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let n=e.trim().toLowerCase();return n?t[n]??null:null}])}])})();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],711241)},399847,e=>{var t=e.i(456420);let r={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],399847)},615568,168148,e=>{var t=e.i(456420);let r={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],615568);var a=e.i(843476),i=e.i(271645),n=e.i(30030),l=e.i(248425),o=Object.defineProperty,c=(e,t)=>o(e,"name",{value:t,configurable:!0}),d="Progress",[u,m]=(0,n.f)(d),[f,x]=u(d),g=i.forwardRef(c(function(e,t){let{__scopeProgress:r,value:s=null,max:i,getValueLabel:n=p,...o}=e;(i||0===i)&&!y(i)&&console.error(k(`${i}`,"Progress"));let c=y(i)?i:100;null===s||w(s,c)||console.error(N(`${s}`,"Progress"));let d=w(s,c)?s:null,u=j(d)?n(d,c):void 0;return(0,a.jsx)(f,{scope:r,value:d,max:c,children:(0,a.jsx)(l.V.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":j(d)?d:void 0,"aria-valuetext":u,role:"progressbar","data-state":v(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})},"Progress")),h=i.forwardRef(c(function(e,t){let{__scopeProgress:r,...s}=e,i=x("ProgressIndicator",r);return(0,a.jsx)(l.V.div,{"data-state":v(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...s,ref:t})},"ProgressIndicator"));function p(e,t){return`${Math.round(e/t*100)}%`}function v(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function j(e){return"number"==typeof e}function y(e){return j(e)&&!isNaN(e)&&e>0}function w(e,t){return j(e)&&!isNaN(e)&&e<=t&&e>=0}function k(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 N(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\`.`}c(p,"defaultGetValueLabel"),c(v,"getProgressState"),c(j,"isNumber"),c(y,"isValidMaxNumber"),c(w,"isValidValueNumber"),c(k,"getInvalidMaxError"),c(N,"getInvalidValueError");var b=e.i(975157);let S=i.forwardRef(({className:e,value:t,...r},s)=>(0,a.jsx)(g,{ref:s,value:t,className:(0,b.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,a.jsx)(h,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=g.displayName,e.s(["f",0,S],168148)},422337,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(522016),a=e.i(618566),i=e.i(980105),n=e.i(866531),l=e.i(731335),o=e.i(759659),c=e.i(164682),d=e.i(519455),u=e.i(111110);function m({originalImageUrl:e,endpoint:r,target:s,reload:a,hasFigure:i,onChange:n}){let{t:l}=(0,u.b)();return(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,t.jsx)(c.f,{endpoint:r,target:s,reload:a,originalImageUrl:e,onDone:n}),i&&(0,t.jsxs)(d.f,{variant:"outline",size:"sm",onClick:()=>n({hasFigure:!1,figureSvg:null}),className:"flex items-center gap-2",children:[(0,t.jsx)(o.f,{className:"h-4 w-4"}),l.figure.remove]})]})}var f=e.i(497346),x=e.i(912505),g=e.i(393842),h=e.i(86963),p=e.i(41931),v=e.i(201276),j=e.i(127175),y=e.i(35209),w=e.i(532377),k=e.i(901219),N=e.i(339501),b=e.i(183444);e.s(["default",0,function(){let e=(0,a.useParams)(),o=(0,a.useRouter)(),c=e.id,{t:S}=(0,u.b)();(0,y.f)(S.importTasks.title);let{task:T,notFound:_,refresh:A}=(0,k.a)(c),I=(0,w.f)(A),E=(0,b.f)("[ImportTask]"),C=(0,N.f)(T?.status==="analyzing"||T?.status==="saving"),R=(0,r.useRef)(null),[O,F]=(0,r.useState)(null),V=T?.status==="review";(0,r.useEffect)(()=>{if(!V)return;let e=!1;return(0,j.h)(c,{image:!0}).then(t=>{e||F({id:c,data:t.imageData})}).catch(e=>v.V.error("[ImportTask]","Failed to load task image",{error:e})),()=>{e=!0}},[c,V]);let[z,P]=(0,r.useState)(null);if((0,r.useEffect)(()=>{p.k.get("/api/notebooks").then(P).catch(e=>{v.V.error("[ImportTask]","Failed to fetch notebooks",{error:e}),P([])})},[]),(0,r.useEffect)(()=>{T&&R.current!==T.id&&T.unread&&(R.current=T.id,I.markRead(T))},[T,I]),_)return(0,t.jsx)("main",{className:"mx-auto max-w-3xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsx)(x.f,{icon:i.f,title:S.importTasks.notFound,action:(0,t.jsx)(s.default,{href:"/import-tasks",children:(0,t.jsx)(d.f,{children:S.importTasks.viewTasks})})})});if(!T||"review"===T.status&&(!z||O?.id!==c))return(0,t.jsx)(h.f,{});let U=T.result?.subject,q=U?z?.find(e=>e.name.includes(U)||U.includes(e.name)):void 0,$=T.batchId?`/import-batches/${T.batchId}`:"/import-tasks",L=async()=>{let e=await (0,j.h)(c);return{hasFigure:e.result?.hasFigure===!0,figureSvg:e.result?.figureSvg??null}},M=async e=>{let t=T.targetSubjectId??e.subjectId??null,r=await E.run(()=>(0,j.I)(T.id,{...e,subjectId:t}),t,!T.batchId);r&&(T.batchId||!t)&&o.push($),r||A()};return(0,t.jsxs)("main",{className:`mx-auto space-y-4 px-4 py-6 md:px-8 md:py-8 ${"review"===T.status?"max-w-6xl":"max-w-3xl"}`,children:[(0,t.jsx)(g.f,{backHref:$,title:T.batchId?S.importBatch.title:S.importTasks.title,description:S.importTasks.status[T.status]}),(0,t.jsx)(f.f,{message:E.saveError,onDismiss:E.dismissSaveError}),"review"===T.status&&T.result?(0,t.jsx)(n.f,{initialData:{...T.result,source:T.result.source??T.source},imagePreview:O?.data??null,onSave:M,onCancel:()=>o.push($),initialSubjectId:T.targetSubjectId||T.subjectId||q?.id,figureTools:(e,r)=>(0,t.jsx)(m,{originalImageUrl:O?.data??null,endpoint:`/api/import-tasks/${c}/figure`,target:`import-task:${c}:figure`,reload:L,hasFigure:!!(e.hasFigure||e.figureSvg),onChange:e=>r(e)})}):(0,t.jsx)(l.f,{task:T,now:C,onViewItem:()=>I.viewItem(T),onRetry:()=>I.retry(T),onDiscard:async()=>{await I.discard(T)&&o.push($)}})]})}],422337)},866531,497346,183444,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(632781),a=e.i(741120),i=e.i(856522),n=e.i(314381),l=e.i(3198),o=e.i(519455),c=e.i(111110),d=e.i(41931),u=e.i(294114),m=e.i(201276);function f({data:e,onChange:a}){let{t:i}=(0,c.b)(),[x,g]=(0,r.useState)(!1),[h,p]=(0,r.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(i.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(i.geogebra.answerRequired);g(!0),p(null);try{let t=await d.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||i.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),p(i.geogebra.analyzeFailed)}finally{g(!1)}};return e.geogebraCommands?(0,t.jsx)(l.f,{commands:e.geogebraCommands,height:350,onRegenerate:v,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)(n.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:v,disabled:x,children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),i.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),i.geogebra.generate]})})]}),h&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:h}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var x=e.i(469937),g=e.i(28342),h=e.i(793479),p=e.i(438465),v=e.i(674166),j=e.i(110204),y=e.i(967489),w=e.i(401280);function k({data:e,paperLevel:r,onChange:s}){let{t:a}=(0,c.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(p.f,{value:e.subjectId,onChange:e=>s({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{htmlFor:"correction-source",children:a.editor.source||"Source"}),(0,t.jsx)(h.f,{id:"correction-source",value:e.source??"",onChange:e=>s({source:e.target.value||null}),placeholder:a.editor.sourcePlaceholder||"e.g. Midterm exam"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.questionType.label||"Question Type"}),(0,t.jsxs)(y.d,{value:e.questionType||"",onValueChange:e=>s({questionType:e===w.O?null:e}),children:[(0,t.jsx)(y.P,{children:(0,t.jsx)(y.U,{placeholder:a.questionType.notSet||"Not set"})}),(0,t.jsxs)(y.r,{children:[(0,t.jsx)(y.T,{value:w.O,children:a.questionType.clear||"Clear"}),w.V.map(e=>(0,t.jsx)(y.T,{value:e,children:a.questionType.names?.[e]||e},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)(j.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(g.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>s({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(v.f,{value:r,onChange:e=>s({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(x.f,{size:"md",value:e.difficultyStars,onChange:e=>s({difficultyStars:e})})})]})]})}var N=e.i(141176),b=e.i(515288);function S({data:e,onChange:r}){let{t:s}=(0,c.b)();return(0,t.jsxs)(b.N,{children:[(0,t.jsx)(b.Y,{children:(0,t.jsx)(b.v,{children:s.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(b.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:s.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(y.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>r({mistakeStatus:e}),children:[(0,t.jsx)(y.P,{children:(0,t.jsx)(y.U,{})}),(0,t.jsxs)(y.r,{children:[(0,t.jsx)(y.T,{value:"not_attempted",children:s.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(y.T,{value:"wrong_attempt",children:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(y.T,{value:"unknown",children:s.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(N.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:s.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(N.f,{value:e.mistakeAnalysis||"",onChange:e=>r({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:s.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var T=e.i(511445),_=e.i(149704);function A({title:e,children:r,className:s}){return(0,t.jsxs)(b.N,{children:[(0,t.jsx)(b.Y,{children:(0,t.jsx)(b.v,{children:e})}),(0,t.jsx)(b.O,{className:s,children:r})]})}function I({data:e,children:r,figureTools:s}){let{t:a}=(0,c.b)(),i={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)(A,{title:a.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(T.f,{content:e.questionText}),(0,t.jsx)(_.f,{svg:e.figureSvg}),s]}),r,(0,t.jsx)(A,{title:a.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(T.f,{content:e.answerText})}),(0,t.jsx)(A,{title:a.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(T.f,{content:e.analysis})}),(0,t.jsxs)(A,{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,i[e.mistakeStatus]??i.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)(T.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)(T.f,{content:e.mistakeAnalysis})]})]})]})}var E=e.i(377037),C=e.i(574041),R=e.i(215519),O=e.i(306831);e.i(676167);var F=e.i(597138),V=e.i(991722),z=e.i(470279),P=e.i(303163);e.s(["f",0,function({initialData:e,onSave:n,onCancel:l,imagePreview:x,initialSubjectId:g,aiTimeout:h,figureTools:p}){let{timeZone:v}=(0,R.M)(),{t:y,language:w}=(0,c.b)(),T=e=>e.trim()?e:"",[_,A]=(0,r.useState)({...e,answerText:T(e.answerText),analysis:T(e.analysis),wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:g,gradeSemester:e.gradeSemester||""}),U=(0,r.useRef)(!1),q=(0,r.useRef)(null),$=e=>{"gradeSemester"in e&&(U.current=!0),A(t=>({...t,...e}))},{groups:L}=(0,z.f)(),M=(()=>{if(_.paperLevel)return _.paperLevel;let e="number"==typeof _.difficultyStars&&_.difficultyStars>=4?"b":"a";return L.find(t=>t.key===e&&t.isActive)?.id||""})(),D=_.paperLevel??M,[G,H]=(0,r.useState)(!1),[Q,B]=(0,r.useState)(!1),[W,J]=(0,r.useState)(!1),[Y,Z]=(0,r.useState)(void 0),[K,X]=(0,r.useState)([]);(0,r.useEffect)(()=>{d.k.get("/api/notebooks").then(X).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),d.k.get("/api/user").then(e=>{if(J(!!e?.enableGeogebra),e){let t=function(e,t=O.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,r=new Date,s="en",a=O.J){let i=(0,O.c)(r,a),n=i.getFullYear(),l=i.getMonth()+1,o=n-t,c="2nd";l>=9?(o+=1,c="1st"):c=l<2?"1st":"2nd";let d="zh"===s,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]||[],f=`${o}`;if(f=o>0&&o<=m.length?m[o-1]:o>m.length?d?"已毕业":"Graduated":d?"学前":"Pre-school",!d)return`${f}, ${u}`;{let e="1st"===c?"上":"下";return`${f}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,v);A(e=>e.gradeSemester||U.current?e:{...e,gradeSemester:t||""}),Z(e.educationStage||void 0)}}).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[w,v]);let ee=async()=>{if(!_.questionText.trim())return void u.c.warning(y.editor.enterQuestionFirst||"Please enter question text first");H(!0);try{let e=function({questionText:e,language:t,subject:r,imagePreview:s,gradeSemester:a,subjectId:i}){let n={questionText:e,language:t,subject:r};return s&&(n.imageBase64=s),a&&(n.gradeSemester=a),i&&(n.subjectId=i),n}({questionText:_.questionText,language:w,subject:_.subject,imagePreview:x,gradeSemester:_.gradeSemester??void 0,subjectId:_.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:h});let t=await d.k.post("/api/reanswer",e,{timeout:h||18e4,recoverable:!0});A(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,V.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars,questionType:t.questionType??e.questionType})),u.c.success(y.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(s){let e,t,r;m.V.error("[CorrectionEditor]","Reanswer failed",{error:s}),u.c.error((e=(0,P.d)(s)||"",r=(t=y.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||y.errors?.AI_AUTH_ERROR||r:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||y.errors?.AI_CONNECTION_FAILED||r:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||y.errors?.AI_RESPONSE_ERROR)||r))}finally{H(!1)}},et=async()=>{if(!_.subjectId)return void u.c.warning(y.editor.messages?.selectNotebook||"Please select a notebook");if(!Q){B(!0);try{await n({..._,paperLevel:D,mistakeStatus:(0,V.x)(_.mistakeStatus,_.wrongAnswerText)})}finally{B(!1)}}},er=y.editor.placeholder||"Supports Markdown and LaTeX...",es=(0,F.f)(K.find(e=>e.id===_.subjectId)?.name||null)||(0,F.f)(_.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:y.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:y.editor.cancel}),(0,t.jsxs)(o.f,{onClick:et,disabled:Q,children:[Q?(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),Q?y.common?.pleaseWait||"Please wait...":y.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[x&&(0,t.jsx)(b.N,{children:(0,t.jsx)(b.O,{className:"p-4",children:(0,t.jsx)("img",{src:x,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(k,{data:_,paperLevel:D,onChange:$}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:y.editor.question}),(0,t.jsx)(N.f,{value:_.questionText,onChange:e=>$({questionText:e}),textareaRef:q,className:"min-h-[150px] font-mono text-sm",placeholder:er}),(0,t.jsx)(E.f,{value:_.questionText,onChange:e=>$({questionText:e}),textareaRef:q,subject:es}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:ee,disabled:G||!_.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:G?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),y.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),y.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y.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)(j.f,{children:y.editor.tags}),(0,t.jsx)(C.f,{value:_.knowledgePoints,onChange:e=>$({knowledgePoints:e}),placeholder:y.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:y.editor.createTagHint,subject:es,gradeStage:Y}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:y.editor.answer}),(0,t.jsx)(N.f,{value:_.answerText,onChange:e=>$({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:er})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.f,{children:y.editor.analysis}),(0,t.jsx)(N.f,{value:_.analysis,onChange:e=>$({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:er})]}),(0,t.jsx)(S,{data:_,onChange:$})]}),(0,t.jsx)(I,{data:_,figureTools:p?.(_,e=>A(t=>({...t,...e}))),children:W&&(0,t.jsx)(f,{data:_,onChange:$})})]})]})}],866531);var U=e.i(853138),q=e.i(263676);e.s(["f",0,function({message:e,onDismiss:r}){let{t:s}=(0,c.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)(U.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":s.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(q.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var $=e.i(618566),L=e.i(707212);function M(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function D(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let r=t.errors[e];return"string"==typeof r?r:void 0}e.s(["f",0,function(e){let{t}=(0,c.b)(),s=(0,$.useRouter)(),[a,i]=(0,r.useState)(null),n=async(r,a,n=!0)=>{i(null);try{let e=await r();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),n&&(e.duplicate?s.push(`/error-items/${e.id}`):a&&s.push(`/notebooks/${a}`)),!0}catch(s){m.V.error(e,"Save failed",{errorMessage:(0,P.d)(s)??(0,P.Z)(s)});let r=function(e,t){let r=M(e),s=M(r?.data),a="number"==typeof r?.status?r.status:void 0,i=(0,P.d)(e),n=D(i,t)??D(s?.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=n??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,P.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let c=M(s?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=D(c?.reason,t);e&&(o+=`
|
|
7
|
+
${e}`)}return 400===a&&(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 s=M(e),a=s?.path,i=Array.isArray(a)&&"string"==typeof a[0]?r[a[0]]:void 0;if(!i)return[];let n=s?.maximum,l=t.questionSave.invalidField;return s?.code==="too_big"&&"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&(l="array"===s.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",i).replace("{maximum}",String(n))]})})(s?.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)}`),a&&(o+=` (HTTP ${a})`),o}(s,t);return i(r),(0,L.t)((0,P.d)(s))||u.c.error(r),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},731335,532377,339501,e=>{var t=e.i(843476),r=e.i(399847),s=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),c=e.i(487486),d=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(66760),x=e.i(215519),g=e.i(306831);let h=["read","convert","crop","compress","upload"],p=["receive","analyze","save"];function v(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let r=Math.round(t);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var j=e.i(975157);let y={analyzing:50,saving:90},w={analyzing:l.f,saving:l.f,review:o.f,saved:s.f,failed:r.f};e.s(["f",0,function({task:e,now:r,onReview:s,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),k=(0,f.T)()({shortId:e.errorItemShortId,seqNo:e.errorItemSeqNo}),{timeZone:N}=(0,x.M)(),b=w[e.status],S="analyzing"===e.status||"saving"===e.status,T=o.errors,_=e.error?"string"==typeof T[e.error]?T[e.error]:e.error:null,A=function(e){let t=[];for(let r of h){let s=e?.client?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}for(let r of p){let s=e?.server?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}return t}(e.timings),I=S&&r?r-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,j.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(b,{className:(0,j.f)("mt-0.5 h-4 w-4 shrink-0",S&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(c.f,{children:o.importTasks.unread})]}),S&&(0,t.jsx)(u.f,{value:y[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(y[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",k||"-")}),_&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:_}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,g.r)(e.createdAt,"MM-dd HH:mm",N))]}),null!==I&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",v(I))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),A.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:A.map(({stage:e,ms:r})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",v(r)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(d.f,{size:"sm",onClick:s,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(d.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(d.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(d.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var k=e.i(618566),N=e.i(767077),b=e.i(294114),S=e.i(201276),T=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),r=(0,k.useRouter)(),s=e=>{e.unread&&(0,T.N)(e.id).catch(e=>S.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),r.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),r.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async r=>{try{await (0,T.R)(r.id),b.c.info(t.importTasks.retried)}catch(e){b.c.error((0,N.f)(e,t))}e?.()},discard:async r=>{if(!await (0,b.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,T.x)(r.id),b.c.success(t.importTasks.discarded),s=!0}catch(e){b.c.error((0,N.f)(e,t))}return e?.(),s}}}],532377);var _=e.i(271645);e.s(["f",0,function(e,t=1e3){let[r,s]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{if(!e)return;let r=setInterval(()=>s(Date.now()),t);return()=>clearInterval(r)},[e,t]),r}],339501)},164682,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(632781),a=e.i(456420);let i={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"}]]};i.node;let n=(0,a.f)(i);var l=e.i(519455),o=e.i(12130),c=e.i(111110),d=e.i(41931),u=e.i(294114),m=e.i(201276),f=e.i(132411),x=e.i(895133),g=e.i(213761);e.s(["f",0,function({errorItemId:e,endpoint:a,target:i,reload:h,originalImageUrl:p,onDone:v}){let{t:j}=(0,c.b)(),[y,w]=(0,r.useState)(!1),[k,N]=(0,r.useState)(!1),[b,S]=(0,r.useState)(null),T=a??`/api/error-items/${e}/figure`,_=i??`error-item:${e}:figure`,A=(0,r.useCallback)(async()=>{let t=await d.k.get(`/api/error-items/${e}`);return{hasFigure:t.hasFigure,figureSvg:t.figureSvg}},[e]),I=h??A,{running:E,refresh:C}=(0,f.f)(_),R=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(E){R.current=!0;return}R.current&&(R.current=!1,I().then(v).catch(e=>m.V.warn("[RegenerateFigure]","Failed to reload figure",{error:e})))},[E,I,v]),(0,r.useEffect)(()=>()=>b?.dispose(),[b]);let O=async e=>{w(!0);try{let t=await d.k.post(T,e?{imageBase64:e}:{},{recoverable:!0});v(t),t.figureSvg||u.c.warning(j.figure.noFigure)}catch(e){if(e instanceof d.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")u.c.info(j.errors.TASK_ALREADY_RUNNING),await C();else{let t=e?.data?.message||"",r=j.errors[t];m.V.error("[RegenerateFigure]","Failed to regenerate figure",{code:t}),u.c.error("NO_ORIGINAL_IMAGE"===t?j.figure.noImage:"string"==typeof r?r:j.figure.failed)}}finally{w(!1)}},F=async()=>{let e=p?(0,x.B)(p):null;if(!e)return void await O();N(!0);try{S(await (0,g.p)(e))}catch(e){m.V.warn("[RegenerateFigure]","Failed to decode original image",{error:e}),u.c.error(e instanceof g.o?j.upload.decodeErrors[e.code].replace("{format}",e.format.toUpperCase()):j.figure.noImage)}finally{N(!1)}},V=async e=>{if(b&&0!==e.length){S(null);try{let t=await (0,g.X)(b,e[0]);b.dispose(),await O(t.dataUrl)}catch(e){m.V.error("[RegenerateFigure]","Failed to crop figure",{error:e}),u.c.error(j.figure.failed)}}},z=k||y||!!E;return(0,t.jsxs)(t.Fragment,{children:[b&&(0,t.jsx)(o.f,{imageSrc:b.previewUrl,open:!0,onClose:()=>S(null),allowMulti:!1,eraseEnabled:!1,onRegionsSelected:e=>void V(e)}),(0,t.jsxs)(l.f,{variant:"outline",size:"sm",onClick:F,disabled:z,className:"flex items-center gap-2",children:[z?(0,t.jsx)(s.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(n,{className:"h-4 w-4"}),z?j.figure.regenerating:j.figure.regenerate]})]})}],164682)},590546,e=>{var t=e.i(843476),r=e.i(618566),s=e.i(519455),a=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let n=(0,r.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:i,children:(0,t.jsx)(a.f,{className:"h-5 w-5"})})}])},912505,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:a,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,r.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",n),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),a&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:a}),i&&(0,t.jsx)("div",{className:"mt-5",children:i})]})}])},393842,e=>{var t=e.i(843476),r=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:a,backHref:i,actions:n,titleAddon:l,className:o}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",o),children:[i&&(0,t.jsx)(r.f,{fallbackUrl:i,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]}),a&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:a})]}),n&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}])},86963,e=>{var t=e.i(843476),r=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(r.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,r.b)(),a=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=a},[a])}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,r){let s=r.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=r.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return r.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`${s} (${t})`}return s}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let r=e.trim().toLowerCase();return r?t[r]??null:null}])}])})();
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
- less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
|
|
4
4
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
5
5
|
|
|
6
|
-
Defaulting to \`null\`.`}d(v,"defaultGetValueLabel"),d(g,"getProgressState"),d(j,"isNumber"),d(y,"isValidMaxNumber"),d(k,"isValidValueNumber"),d(N,"getInvalidMaxError"),d(b,"getInvalidValueError");var w=e.i(975157);let T=i.forwardRef(({className:e,value:t,...a},s)=>(0,r.jsx)(x,{ref:s,value:t,className:(0,w.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,r.jsx)(h,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));T.displayName=x.displayName,e.s(["f",0,T],168148)},419327,e=>{var t=e.i(843476),a=e.i(522016),s=e.i(980105),r=e.i(399847),i=e.i(551757),n=e.i(13285),l=e.i(632781),c=e.i(615568),d=e.i(487486),o=e.i(519455),m=e.i(111110),u=e.i(215519),p=e.i(306831),f=e.i(975157);let x={splitting:l.f,processing:l.f,draft:c.f,attention:r.f,failed:r.f,done:i.f};function h({batch:e}){let{t:s}=(0,m.b)(),{timeZone:r}=(0,u.M)(),i=x[e.phase],l="splitting"===e.phase||"processing"===e.phase,c="started"===e.status?e.counts.total:e.itemCount,{counts:v}=e,g="started"===e.status?[v.saved>0&&s.importBatch.counts.saved.replace("{count}",String(v.saved-v.duplicate)),v.duplicate>0&&s.importBatch.counts.duplicate.replace("{count}",String(v.duplicate)),v.review>0&&s.importBatch.counts.review.replace("{count}",String(v.review)),v.failed>0&&s.importBatch.counts.failed.replace("{count}",String(v.failed)),v.active>0&&s.importBatch.counts.active.replace("{count}",String(v.active))].filter(Boolean):[];return(0,t.jsxs)("div",{className:(0,f.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-batch-card","data-phase":e.phase,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(i,{className:(0,f.f)("mt-0.5 h-4 w-4 shrink-0",l&&"animate-spin text-primary","done"===e.phase&&"text-green-600",("failed"===e.phase||"attention"===e.phase)&&"text-destructive")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(n.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-medium",children:c>0?s.importBatch.batchOf.replace("{count}",String(c)):s.importBatch.title}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[s.importBatch.source[e.source]," · ",s.importBatch.phase[e.phase]]}),e.unread&&(0,t.jsx)(d.f,{children:s.importTasks.unread})]}),e.excerpt&&(0,t.jsx)("p",{className:"line-clamp-2 break-words text-muted-foreground",children:e.excerpt}),g.length>0&&(0,t.jsx)("p",{className:"text-xs",children:g.join(" · ")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.importTasks.createdAt.replace("{time}",(0,p.r)(e.createdAt,"MM-dd HH:mm",r))})]})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(o.f,{asChild:!0,size:"sm",variant:"draft"===e.phase||"attention"===e.phase?"default":"outline",children:(0,t.jsx)(a.default,{href:`/import-batches/${e.id}`,children:s.importBatch.open})})})]})}var v=e.i(731335),g=e.i(912505),j=e.i(393842),y=e.i(86963),k=e.i(35209),N=e.i(532377),b=e.i(901219),w=e.i(339501);e.s(["default",0,function(){let{t:e}=(0,m.b)();(0,k.f)(e.importTasks.title);let{data:r,refresh:i}=(0,b.b)(),n=(0,N.f)(i),l=(0,w.f)((r?.activeCount??0)>0);return(0,t.jsxs)("main",{className:"mx-auto max-w-3xl space-y-4 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(j.f,{backHref:"/",title:e.importTasks.title,description:e.importTasks.description}),r?0!==r.tasks.length||r.batches?.length?(0,t.jsx)("ul",{className:"space-y-3",children:[...(r.batches??[]).map(e=>({kind:"batch",createdAt:e.createdAt,batch:e})),...r.tasks.map(e=>({kind:"task",createdAt:e.createdAt,task:e}))].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)).map(e=>"batch"===e.kind?(0,t.jsx)("li",{children:(0,t.jsx)(h,{batch:e.batch})},`batch-${e.batch.id}`):(0,t.jsx)("li",{children:(0,t.jsx)(v.f,{task:e.task,now:l,onReview:()=>n.openReview(e.task),onViewItem:()=>n.viewItem(e.task),onRetry:()=>n.retry(e.task),onDiscard:()=>n.discard(e.task)})},e.task.id))}):(0,t.jsx)(g.f,{icon:s.f,title:e.importTasks.empty,action:(0,t.jsx)(a.default,{href:"/",children:(0,t.jsx)(o.f,{children:e.importTasks.backHome})})}):(0,t.jsx)(y.f,{}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.importTasks.retentionHint})]})}],419327)},731335,532377,339501,e=>{var t=e.i(843476),a=e.i(399847),s=e.i(551757),r=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,r.f)(i);var l=e.i(632781),c=e.i(615568),d=e.i(487486),o=e.i(519455),m=e.i(168148),u=e.i(111110),p=e.i(215519),f=e.i(306831);let x=["read","convert","crop","compress","upload"],h=["receive","analyze","save"];function v(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let a=Math.round(t);return`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`}var g=e.i(975157);let j={analyzing:50,saving:90},y={analyzing:l.f,saving:l.f,review:c.f,saved:s.f,failed:a.f};e.s(["f",0,function({task:e,now:a,onReview:s,onViewItem:r,onRetry:i,onDiscard:l}){let{t:c}=(0,u.b)(),{timeZone:k}=(0,p.M)(),N=y[e.status],b="analyzing"===e.status||"saving"===e.status,w=c.errors,T=e.error?"string"==typeof w[e.error]?w[e.error]:e.error:null,I=function(e){let t=[];for(let a of x){let s=e?.client?.[a];"number"==typeof s&&t.push({stage:a,ms:s})}for(let a of h){let s=e?.server?.[a];"number"==typeof s&&t.push({stage:a,ms:s})}return t}(e.timings),z=b&&a?a-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,g.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(N,{className:(0,g.f)("mt-0.5 h-4 w-4 shrink-0",b&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:c.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:c.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:c.importTasks.unread})]}),b&&(0,t.jsx)(m.f,{value:j[e.status],"aria-label":c.importTasks.stageEstimate,"aria-valuetext":c.common.progress.estimated.replace("{percent}",String(j[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?c.importTasks.duplicateSaved:c.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),T&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:T}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),c.importTasks.createdAt.replace("{time}",(0,f.r)(e.createdAt,"MM-dd HH:mm",k))]}),null!==z&&(0,t.jsx)("span",{children:c.importTasks.elapsed.replace("{time}",v(z))}),e.attempts>1&&(0,t.jsx)("span",{children:c.importTasks.attempts.replace("{count}",String(e.attempts))})]}),I.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:I.map(({stage:e,ms:a})=>(0,t.jsxs)("li",{children:[c.importTasks.timings[e]," ",v(a)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(o.f,{size:"sm",onClick:s,children:c.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&r&&(0,t.jsx)(o.f,{size:"sm",variant:"outline",onClick:r,children:c.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(o.f,{size:"sm",onClick:i,children:c.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(o.f,{size:"sm",variant:"ghost",onClick:l,children:c.importTasks.discard})]})]})}],731335);var k=e.i(618566),N=e.i(767077),b=e.i(294114),w=e.i(201276),T=e.i(127175);e.s(["f",0,function(e){let{t}=(0,u.b)(),a=(0,k.useRouter)(),s=e=>{e.unread&&(0,T.N)(e.id).catch(e=>w.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),a.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),a.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async a=>{try{await (0,T.R)(a.id),b.c.info(t.importTasks.retried)}catch(e){b.c.error((0,N.f)(e,t))}e?.()},discard:async a=>{if(!await (0,b.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,T.x)(a.id),b.c.success(t.importTasks.discarded),s=!0}catch(e){b.c.error((0,N.f)(e,t))}return e?.(),s}}}],532377);var I=e.i(271645);e.s(["f",0,function(e,t=1e3){let[a,s]=(0,I.useState)(()=>Date.now());return(0,I.useEffect)(()=>{if(!e)return;let a=setInterval(()=>s(Date.now()),t);return()=>clearInterval(a)},[e,t]),a}],339501)},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let n=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:i,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},912505,e=>{var t=e.i(843476),a=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:r,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,a.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",n),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),r&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),i&&(0,t.jsx)("div",{className:"mt-5",children:i})]})}])},393842,e=>{var t=e.i(843476),a=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:r,backHref:i,actions:n,titleAddon:l,className:c}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",c),children:[i&&(0,t.jsx)(a.f,{fallbackUrl:i,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]}),r&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:r})]}),n&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}])},86963,e=>{var t=e.i(843476),a=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(a.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),r=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,a){let s=a.common?.messages?.analysisFailed||"Analysis failed, please try again",r=(0,t.d)(e);if(r){let e=a.errors??{};if(!(r in e))return r;let t=e[r];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return a.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`${s} (${t})`}return s}])}])})();
|
|
6
|
+
Defaulting to \`null\`.`}d(v,"defaultGetValueLabel"),d(g,"getProgressState"),d(j,"isNumber"),d(y,"isValidMaxNumber"),d(k,"isValidValueNumber"),d(N,"getInvalidMaxError"),d(b,"getInvalidValueError");var w=e.i(975157);let T=i.forwardRef(({className:e,value:t,...a},s)=>(0,r.jsx)(x,{ref:s,value:t,className:(0,w.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,r.jsx)(h,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));T.displayName=x.displayName,e.s(["f",0,T],168148)},419327,e=>{var t=e.i(843476),a=e.i(522016),s=e.i(980105),r=e.i(399847),i=e.i(551757),n=e.i(13285),l=e.i(632781),c=e.i(615568),d=e.i(487486),o=e.i(519455),m=e.i(111110),u=e.i(215519),p=e.i(306831),f=e.i(975157);let x={splitting:l.f,processing:l.f,draft:c.f,attention:r.f,failed:r.f,done:i.f};function h({batch:e}){let{t:s}=(0,m.b)(),{timeZone:r}=(0,u.M)(),i=x[e.phase],l="splitting"===e.phase||"processing"===e.phase,c="started"===e.status?e.counts.total:e.itemCount,{counts:v}=e,g="started"===e.status?[v.saved>0&&s.importBatch.counts.saved.replace("{count}",String(v.saved-v.duplicate)),v.duplicate>0&&s.importBatch.counts.duplicate.replace("{count}",String(v.duplicate)),v.review>0&&s.importBatch.counts.review.replace("{count}",String(v.review)),v.failed>0&&s.importBatch.counts.failed.replace("{count}",String(v.failed)),v.active>0&&s.importBatch.counts.active.replace("{count}",String(v.active))].filter(Boolean):[];return(0,t.jsxs)("div",{className:(0,f.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-batch-card","data-phase":e.phase,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(i,{className:(0,f.f)("mt-0.5 h-4 w-4 shrink-0",l&&"animate-spin text-primary","done"===e.phase&&"text-green-600",("failed"===e.phase||"attention"===e.phase)&&"text-destructive")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(n.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-medium",children:c>0?s.importBatch.batchOf.replace("{count}",String(c)):s.importBatch.title}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[s.importBatch.source[e.source]," · ",s.importBatch.phase[e.phase]]}),e.unread&&(0,t.jsx)(d.f,{children:s.importTasks.unread})]}),e.excerpt&&(0,t.jsx)("p",{className:"line-clamp-2 break-words text-muted-foreground",children:e.excerpt}),g.length>0&&(0,t.jsx)("p",{className:"text-xs",children:g.join(" · ")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.importTasks.createdAt.replace("{time}",(0,p.r)(e.createdAt,"MM-dd HH:mm",r))})]})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(o.f,{asChild:!0,size:"sm",variant:"draft"===e.phase||"attention"===e.phase?"default":"outline",children:(0,t.jsx)(a.default,{href:`/import-batches/${e.id}`,children:s.importBatch.open})})})]})}var v=e.i(731335),g=e.i(912505),j=e.i(393842),y=e.i(86963),k=e.i(35209),N=e.i(532377),b=e.i(901219),w=e.i(339501);e.s(["default",0,function(){let{t:e}=(0,m.b)();(0,k.f)(e.importTasks.title);let{data:r,refresh:i}=(0,b.b)(),n=(0,N.f)(i),l=(0,w.f)((r?.activeCount??0)>0);return(0,t.jsxs)("main",{className:"mx-auto max-w-3xl space-y-4 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(j.f,{backHref:"/",title:e.importTasks.title,description:e.importTasks.description}),r?0!==r.tasks.length||r.batches?.length?(0,t.jsx)("ul",{className:"space-y-3",children:[...(r.batches??[]).map(e=>({kind:"batch",createdAt:e.createdAt,batch:e})),...r.tasks.map(e=>({kind:"task",createdAt:e.createdAt,task:e}))].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)).map(e=>"batch"===e.kind?(0,t.jsx)("li",{children:(0,t.jsx)(h,{batch:e.batch})},`batch-${e.batch.id}`):(0,t.jsx)("li",{children:(0,t.jsx)(v.f,{task:e.task,now:l,onReview:()=>n.openReview(e.task),onViewItem:()=>n.viewItem(e.task),onRetry:()=>n.retry(e.task),onDiscard:()=>n.discard(e.task)})},e.task.id))}):(0,t.jsx)(g.f,{icon:s.f,title:e.importTasks.empty,action:(0,t.jsx)(a.default,{href:"/",children:(0,t.jsx)(o.f,{children:e.importTasks.backHome})})}):(0,t.jsx)(y.f,{}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.importTasks.retentionHint})]})}],419327)},731335,532377,339501,e=>{var t=e.i(843476),a=e.i(399847),s=e.i(551757),r=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,r.f)(i);var l=e.i(632781),c=e.i(615568),d=e.i(487486),o=e.i(519455),m=e.i(168148),u=e.i(111110),p=e.i(66760),f=e.i(215519),x=e.i(306831);let h=["read","convert","crop","compress","upload"],v=["receive","analyze","save"];function g(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let a=Math.round(t);return`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`}var j=e.i(975157);let y={analyzing:50,saving:90},k={analyzing:l.f,saving:l.f,review:c.f,saved:s.f,failed:a.f};e.s(["f",0,function({task:e,now:a,onReview:s,onViewItem:r,onRetry:i,onDiscard:l}){let{t:c}=(0,u.b)(),N=(0,p.T)()({shortId:e.errorItemShortId,seqNo:e.errorItemSeqNo}),{timeZone:b}=(0,f.M)(),w=k[e.status],T="analyzing"===e.status||"saving"===e.status,I=c.errors,z=e.error?"string"==typeof I[e.error]?I[e.error]:e.error:null,M=function(e){let t=[];for(let a of h){let s=e?.client?.[a];"number"==typeof s&&t.push({stage:a,ms:s})}for(let a of v){let s=e?.server?.[a];"number"==typeof s&&t.push({stage:a,ms:s})}return t}(e.timings),A=T&&a?a-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,j.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(w,{className:(0,j.f)("mt-0.5 h-4 w-4 shrink-0",T&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:c.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:c.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:c.importTasks.unread})]}),T&&(0,t.jsx)(m.f,{value:y[e.status],"aria-label":c.importTasks.stageEstimate,"aria-valuetext":c.common.progress.estimated.replace("{percent}",String(y[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?c.importTasks.duplicateSaved:c.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",N||"-")}),z&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:z}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),c.importTasks.createdAt.replace("{time}",(0,x.r)(e.createdAt,"MM-dd HH:mm",b))]}),null!==A&&(0,t.jsx)("span",{children:c.importTasks.elapsed.replace("{time}",g(A))}),e.attempts>1&&(0,t.jsx)("span",{children:c.importTasks.attempts.replace("{count}",String(e.attempts))})]}),M.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:M.map(({stage:e,ms:a})=>(0,t.jsxs)("li",{children:[c.importTasks.timings[e]," ",g(a)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(o.f,{size:"sm",onClick:s,children:c.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&r&&(0,t.jsx)(o.f,{size:"sm",variant:"outline",onClick:r,children:c.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(o.f,{size:"sm",onClick:i,children:c.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(o.f,{size:"sm",variant:"ghost",onClick:l,children:c.importTasks.discard})]})]})}],731335);var N=e.i(618566),b=e.i(767077),w=e.i(294114),T=e.i(201276),I=e.i(127175);e.s(["f",0,function(e){let{t}=(0,u.b)(),a=(0,N.useRouter)(),s=e=>{e.unread&&(0,I.N)(e.id).catch(e=>T.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),a.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),a.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async a=>{try{await (0,I.R)(a.id),w.c.info(t.importTasks.retried)}catch(e){w.c.error((0,b.f)(e,t))}e?.()},discard:async a=>{if(!await (0,w.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,I.x)(a.id),w.c.success(t.importTasks.discarded),s=!0}catch(e){w.c.error((0,b.f)(e,t))}return e?.(),s}}}],532377);var z=e.i(271645);e.s(["f",0,function(e,t=1e3){let[a,s]=(0,z.useState)(()=>Date.now());return(0,z.useEffect)(()=>{if(!e)return;let a=setInterval(()=>s(Date.now()),t);return()=>clearInterval(a)},[e,t]),a}],339501)},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let n=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:i,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},912505,e=>{var t=e.i(843476),a=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:r,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,a.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",n),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),r&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),i&&(0,t.jsx)("div",{className:"mt-5",children:i})]})}])},393842,e=>{var t=e.i(843476),a=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:r,backHref:i,actions:n,titleAddon:l,className:c}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",c),children:[i&&(0,t.jsx)(a.f,{fallbackUrl:i,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]}),r&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:r})]}),n&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}])},86963,e=>{var t=e.i(843476),a=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(a.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),r=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,a){let s=a.common?.messages?.analysisFailed||"Analysis failed, please try again",r=(0,t.d)(e);if(r){let e=a.errors??{};if(!(r in e))return r;let t=e[r];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return a.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`${s} (${t})`}return s}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
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),f=e.i(3198),h=e.i(519455),x=e.i(111110),p=e.i(41931),v=e.i(303163),j=e.i(201276),y=e.i(294114),b=e.i(132411);function N({errorItemId:e,commands:s,onUpdate:r}){let{t:n}=(0,x.b)(),[i,l]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),u=`error-item:${e}:geogebra`,{running:d,refresh:w}=(0,b.f)(u),k=(0,a.useRef)(!1);(0,a.useEffect)(()=>{if(d){k.current=!0;return}k.current&&(k.current=!1,p.k.get(`/api/error-items/${e}`).then(e=>{e.geogebraCommands&&r({geogebraCommands:e.geogebraCommands})}).catch(e=>j.V.warn("[ErrorDetail]","Failed to reload GeoGebra commands",{error:e})))},[d,e,r]);let A=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(e){if(e instanceof p.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")y.c.info(n.errors.TASK_ALREADY_RUNNING),await w();else{j.V.error("[ErrorDetail]","GeoGebra analysis failed",{error:e});let t=(0,v.d)(e)||(0,v.Z)(e);t.includes("AI_AUTH_ERROR")?c(n.geogebra.authFailed):t.includes("AI_CONNECTION")?c(n.geogebra.connectionFailed):c(n.geogebra.analyzeFailed)}}finally{l(!1)}},S=async t=>{await p.k.put(`/api/error-items/${e}`,{geogebraCommands:t}),r({geogebraCommands:t})},I=async()=>{await p.k.delete(`/api/error-items/${e}/geogebra`),r({geogebraCommands:null})};if(s)return(0,t.jsx)(f.f,{commands:s,height:700,showToolBar:!0,showAlgebraInput:!1,showMenuBar:!1,onRegenerate:A,onSaveCommands:S,onDelete:I});let C=i||!!d;return(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)(h.f,{variant:"outline",size:"sm",onClick:A,disabled:C,children:C?(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 w({src:e,onClose:a}){let{t:s}=(0,x.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 k=e.i(141176),A=e.i(511445),S=e.i(515288);let I={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"]};I.node;let C=(0,i.f)(I);var E=e.i(856522),T=e.i(263676);function R({onClick:e,label:a}){let{t:s}=(0,x.b)();return(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:e,children:[(0,t.jsx)(C,{className:"h-4 w-4 mr-1"}),a||s.common?.edit||"Edit"]})}function L({onSave:e,onCancel:a,children:s}){let{t:r}=(0,x.b)();return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(h.f,{size:"sm",onClick:e,children:[(0,t.jsx)(E.f,{className:"h-4 w-4 mr-1"}),r.common?.save||"Save"]}),(0,t.jsxs)(h.f,{size:"sm",variant:"outline",onClick:a,children:[(0,t.jsx)(T.X,{className:"h-4 w-4 mr-1"}),r.common?.cancel||"Cancel"]}),s]})}function F({title:e,actions:a}){return(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[e,a]})}function M({read:e,save:t,logLabel:s,successMessage:r,failureMessage:n}){let{t:i}=(0,x.b)(),[l,o]=(0,a.useState)(!1),[c,u]=(0,a.useState)(e),d=async()=>{try{await t(c),o(!1),y.c.success(r||i.common?.messages?.saveSuccess||"Saved successfully")}catch(e){j.V.error("[ErrorDetail]",`Failed to save ${s}`,{error:e}),y.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 $({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 f=M({read:()=>a||"",save:s,logLabel:r}),h=(0,t.jsx)(k.f,{value:f.value,onChange:f.setValue,placeholder:i,rows:n,className:"w-full font-mono text-sm"});return(0,t.jsxs)(S.N,{className:c,children:[(0,t.jsx)(S.Y,{children:(0,t.jsx)(F,{title:(0,t.jsx)(S.v,{className:u,children:e}),actions:!f.editing&&(0,t.jsxs)("div",{className:"flex flex-wrap justify-end",children:[m,(0,t.jsx)(R,{onClick:f.start})]})})}),(0,t.jsxs)(S.O,{className:"space-y-4",children:[f.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}),h]}):h,(0,t.jsx)(L,{onSave:f.submit,onCancel:f.cancel})]}):!a&&o?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:o}):(0,t.jsx)(A.f,{content:a,className:d}),g]})]})}var z=e.i(624687);function U({item:e,onUpdate:a}){let{t:s}=(0,x.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)(S.N,{children:[(0,t.jsx)(S.Y,{children:(0,t.jsx)(F,{title:(0,t.jsx)(S.v,{children:s.detail.yourNotes}),actions:!r.editing&&(0,t.jsx)(R,{onClick:r.start,label:s.detail.editNotes})})}),(0,t.jsx)(S.O,{children:r.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(z.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})})})]})}var D=e.i(377037),V=e.i(164682);let _={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"}]]};_.node;let q=(0,i.f)(_);var O=e.i(12130),G=e.i(213761);function H({errorItemId:e,hasImage:s,onDone:r}){let{t:n}=(0,x.b)(),i=(0,a.useRef)(null),[l,o]=(0,a.useState)(!1),[c,u]=(0,a.useState)(null);(0,a.useEffect)(()=>()=>c?.dispose(),[c]);let d=async()=>{(!s||await (0,y.u)(n.replaceImage.confirm))&&i.current?.click()},m=async e=>{if(e){o(!0);try{u(await (0,G.p)(e))}catch(e){y.c.error(e instanceof G.o?n.upload.decodeErrors[e.code].replace("{format}",e.format.toUpperCase()):n.replaceImage.invalid)}finally{o(!1)}}},f=async t=>{if(c&&0!==t.length){o(!0);try{let{dataUrl:a}=await (0,G.X)(c,t[0]);u(null);let s=await p.k.put(`/api/error-items/${e}/image`,{imageDataUrl:a});r(s.originalImageUrl),y.c.success(n.replaceImage.done)}catch(t){let e=t?.data?.message||"";j.V.error("[ReplaceImage]","Failed to replace original image",{code:e}),y.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/*,.heic,.heif",className:"hidden",onChange:e=>{m(e.target.files?.[0]),e.target.value=""}}),c&&(0,t.jsx)(O.f,{imageSrc:c.previewUrl,open:!l,onClose:()=>u(null),allowMulti:!1,onRegionsSelected:e=>void f(e)}),(0,t.jsxs)(h.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)(q,{className:"h-4 w-4"}),l?n.replaceImage.uploading:s?n.replaceImage.replace:n.replaceImage.add]})]})}var K=e.i(562215);let Y=/^data:(image\/(?:png|jpe?g|webp|gif));base64,([\s\S]+)$/;function P({errorItemId:e,imageUrl:s,onDone:r}){let{t:n}=(0,x.b)(),[i,l]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null);(0,a.useEffect)(()=>()=>o?.dispose(),[o]);let u=async()=>{if(!await (0,y.u)(n.replaceImage.cropConfirm))return;let e=function(e){let t=e.match(Y);if(!t)return null;try{let e=atob(t[2]),a=new Uint8Array(e.length);for(let t=0;t<e.length;t++)a[t]=e.charCodeAt(t);return new Blob([a],{type:t[1]})}catch{return null}}(s);if(!e)return void y.c.error(n.replaceImage.cropNoImage);l(!0);try{c(await (0,G.p)(e))}catch(e){j.V.warn("[CropOriginal]","Failed to decode original image",{error:e}),y.c.error(e instanceof G.o?n.upload.decodeErrors[e.code].replace("{format}",e.format.toUpperCase()):n.replaceImage.invalid)}finally{l(!1)}},d=async t=>{if(o&&0!==t.length){l(!0);try{let{dataUrl:a}=await (0,G.X)(o,t[0]);c(null);let s=await p.k.put(`/api/error-items/${e}/image`,{imageDataUrl:a});r(s.originalImageUrl),y.c.success(n.replaceImage.cropDone)}catch(t){let e=function(e){if("object"!=typeof e||null===e||!("data"in e))return"";let t=e.data;return"object"==typeof t&&null!==t&&"message"in t&&"string"==typeof t.message?t.message:""}(t);j.V.error("[CropOriginal]","Failed to crop original image",{code:e}),y.c.error("INVALID_IMAGE"===e?n.replaceImage.invalid:n.replaceImage.cropFailed)}finally{l(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[o&&(0,t.jsx)(O.f,{imageSrc:o.previewUrl,open:!i,onClose:()=>c(null),allowMulti:!1,onRegionsSelected:e=>void d(e)}),(0,t.jsxs)(h.f,{variant:"outline",size:"sm",onClick:u,disabled:i,className:"flex items-center gap-2",children:[i?(0,t.jsx)(g.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(K.f,{className:"h-4 w-4"}),i?n.replaceImage.uploading:n.replaceImage.crop]})]})}var B=e.i(520732),X=e.i(438465),W=e.i(28342),Q=e.i(674166),Z=e.i(793479),J=e.i(967489),ee=e.i(401280),et=e.i(470279);function ea({item:e,onChanged:a}){var s;let{t:r}=(0,x.b)(),n=r.common?.notSet||"Not set",{groups:i}=(0,et.f)(),l=M({read:()=>({source:e.source||"",subjectId:e.subjectId||null,gradeSemester:e.gradeSemester||"",paperLevel:e.paperLevel||"",questionType:e.questionType||""}),save:async t=>{let{subjectId:s,paperLevel:r,questionType:n,source:i,...l}=t;await p.k.put(`/api/error-items/${e.id}`,{...(i.trim()||null)!==(e.source||null)?{source:i.trim()||null}:{},...l,...r!==(e.paperLevel||"")?{paperLevel:r||null}:{},...s!==(e.subjectId||null)?{subjectId:s}:{},...n!==(e.questionType||"")?{questionType:n||null}:{}}),await a()},logLabel:"metadata",successMessage:r.common?.messages?.metaUpdateSuccess||"Metadata updated successfully!",failureMessage:r.common?.messages?.updateFailed||"Update failed"}),o=e=>l.setValue({...l.value,...e});return(0,t.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,t.jsx)(F,{title:(0,t.jsx)("h4",{className:"text-sm font-semibold",children:r.detail?.questionInfo||"Question Info"}),actions:!l.editing&&(0,t.jsx)(R,{onClick:l.start})}),l.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:r.notebooks?.title||"Notebook"}),(0,t.jsx)(X.f,{value:l.value.subjectId||void 0,onChange:e=>o({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"detail-source",className:"text-sm text-muted-foreground",children:r.detail.source||"Source"}),(0,t.jsx)(Z.f,{id:"detail-source",value:l.value.source,onChange:e=>o({source:e.target.value}),placeholder:r.detail.sourcePlaceholder||"e.g. Midterm exam",maxLength:200})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:r.questionType.label||"Question Type"}),(0,t.jsxs)(J.d,{value:l.value.questionType,onValueChange:e=>o({questionType:e===ee.O?"":e}),children:[(0,t.jsx)(J.P,{children:(0,t.jsx)(J.U,{placeholder:r.questionType.notSet||"Not set"})}),(0,t.jsxs)(J.r,{children:[(0,t.jsx)(J.T,{value:ee.O,children:r.questionType.clear||"Clear"}),ee.V.map(e=>(0,t.jsx)(J.T,{value:e,children:r.questionType.names?.[e]||e},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:r.editor.gradeSemester}),(0,t.jsx)(W.f,{id:"detail-grade-semester",value:l.value.gradeSemester,onChange:e=>o({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:r.filter.paperLevel}),(0,t.jsx)(Q.f,{value:l.value.paperLevel,onChange:e=>o({paperLevel:e})})]}),(0,t.jsx)(L,{onSave:l.submit,onCancel:l.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:[r.notebooks?.title||"Notebook",":"]}),(0,t.jsx)("span",{className:"font-medium",children:e.subject?.name||n})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[r.detail.source||"Source",":"]}),(0,t.jsx)("span",{className:"font-medium",children:e.source||n})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[r.questionType.label||"Question Type",":"]}),(0,t.jsx)("span",{className:"font-medium",children:(s=e.questionType)?r.questionType.names?.[s]||s:n})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[r.editor.gradeSemester,":"]}),(0,t.jsx)("span",{className:"font-medium",children:e.gradeSemester||n})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[r.filter.paperLevel,":"]}),(0,t.jsx)("span",{className:"font-medium",children:(e=>{if(!e)return n;let t=i.find(t=>t.id===e);return t?.name||e})(e.paperLevel)})]})]})]})}var es=e.i(487486),er=e.i(328623);function en({errorItemId:e,onDone:s,onSuggested:r,onReload:n}){let{t:i}=(0,x.b)(),[l,o]=(0,a.useState)(!1),c=`error-item:${e}:retag`,{running:u,refresh:d}=(0,b.f)(c),m=(0,a.useRef)(!1),f=(0,a.useRef)(!1),v=async()=>{o(!0),m.current=!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(e){if(e instanceof p.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")y.c.info(i.errors.TASK_ALREADY_RUNNING),m.current=!1,await d();else{let t=e?.data?.message||"",a=i.errors[t];j.V.error("[RetagItem]","Failed to regenerate tags",{code:t}),y.c.error("NO_TAGS_SELECTED"===t?i.retag.noTags:"string"==typeof a?a:i.retag.itemFailed)}}finally{o(!1)}};(0,a.useEffect)(()=>{if(u){f.current=!0;return}f.current&&!m.current&&n?.(),f.current=!1,m.current=!1},[u,n]);let N=l||!!u;return(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:v,disabled:N,children:[N?(0,t.jsx)(g.f,{className:"h-4 w-4 mr-1 animate-spin"}):(0,t.jsx)(er.f,{className:"h-4 w-4 mr-1"}),r?N?i.retag.suggestRunning:i.retag.suggestButton:N?i.retag.itemRunning:i.retag.itemButton]})}var ei=e.i(574041),el=e.i(597138),eo=e.i(428602);function ec({item:e,educationStage:a,onChanged:s}){let{t:r}=(0,x.b)(),n=(0,eo.f)(e),i=M({read:()=>(0,eo.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)(F,{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)(en,{errorItemId:e.id,onDone:s,onReload:s}),(0,t.jsx)(R,{onClick:i.start})]})}),i.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(ei.f,{value:i.value,onChange:i.setValue,placeholder:r.editor?.tagsPlaceholder||"Enter or select knowledge tags...",subject:(0,el.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)(en,{errorItemId:e.id,onSuggested:i.setValue})})]}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,t.jsx)(es.f,{variant:"secondary",children:e},e))})]})}var eu=e.i(580860);let ed={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"}]]};ed.node;let em=(0,i.f)(ed);function eg({src:e,alt:a,showLabel:s,hideLabel:r,visible:n,onVisibleChange:i,onEnlarge:l,variant:o="ghost",actions:c}){let{t:u}=(0,x.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e&&(0,t.jsx)(h.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)(eu.f,{className:"h-4 w-4"}),r]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(em,{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 ef({item:e,educationStage:s,saveFields:r,onUpdate:n,reload:i,onEnlarge:l}){let{t:o}=(0,x.b)(),[c,u]=(0,a.useState)(!1),d=M({read:()=>e.questionText,save:e=>r({questionText:e}),logLabel:"question"}),m=(0,a.useRef)(null);return(0,t.jsxs)(S.N,{children:[(0,t.jsx)(S.Y,{children:(0,t.jsx)(F,{title:(0,t.jsx)(S.v,{children:o.detail.question}),actions:!d.editing&&(0,t.jsx)(R,{onClick:d.start})})}),(0,t.jsxs)(S.O,{className:"space-y-4",children:[d.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(k.f,{value:d.value,onChange:d.setValue,textareaRef:m,placeholder:"Enter question text...",rows:8,className:"w-full font-mono text-sm"}),(0,t.jsx)(D.f,{value:d.value,onChange:d.setValue,textareaRef:m,subject:e.subject?.name}),(0,t.jsx)(L,{onSave:d.submit,onCancel:d.cancel})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.f,{content:e.questionText}),(0,t.jsx)(B.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)(ec,{item:e,educationStage:s,onChanged:i}),(0,t.jsx)(ea,{item:e,onChanged:i}),(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(eg,{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:[e.originalImageUrl&&(0,t.jsx)(P,{errorItemId:e.id,imageUrl:e.originalImageUrl,onDone:e=>{n({originalImageUrl:e}),u(!0)}}),(0,t.jsx)(H,{errorItemId:e.id,hasImage:!!e.originalImageUrl,onDone:e=>{n({originalImageUrl:e}),u(!0)}}),e.originalImageUrl&&(0,t.jsx)(V.f,{errorItemId:e.id,originalImageUrl:e.originalImageUrl,onDone:n})]})})})]})]})}var eh=e.i(991722);function ex({item:e,saveFields:s,onEnlarge:r}){let{t:n,language:i}=(0,x.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,eh.x)(t,e)}),logLabel:"wrong answer"});return(0,t.jsxs)(S.N,{children:[(0,t.jsx)(S.Y,{children:(0,t.jsx)(F,{title:(0,t.jsx)(S.v,{children:n.editor?.wrongAnswerText||"Wrong Answer / Work"}),actions:!c.editing&&(0,t.jsx)(R,{onClick:c.start})})}),(0,t.jsx)(S.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)(J.d,{value:c.value.status,onValueChange:e=>c.setValue({...c.value,status:e}),children:[(0,t.jsx)(J.P,{children:(0,t.jsx)(J.U,{})}),(0,t.jsxs)(J.r,{children:[(0,t.jsx)(J.T,{value:"not_attempted",children:n.editor?.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(J.T,{value:"wrong_attempt",children:n.editor?.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(J.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)(k.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)(es.f,{variant:"secondary",children:(0,eh.i)(e.mistakeStatus,i)}),e.wrongAnswerText?(0,t.jsx)(A.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)(eg,{src:e.wrongAnswerImageUrl,alt:n.detail.wrongAnswerImageAlt,showLabel:n.detail.viewImage,hideLabel:n.detail.hideImage,visible:l,onVisibleChange:o,onEnlarge:r})})]})})]})}let ep={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"]};ep.node;let ev=(0,i.f)(ep);var ej=e.i(716400),ey=e.i(369939);let eb=new Set(["ne","neq","nabla","nu","not","notin","ni","nexists","ngeq","nleq","nmid","nparallel","nsubseteq"]);function eN(e){return e.length>80?`${e.slice(0,80)}…`:e}let ew=["questionText","answerText","analysis","wrongAnswerText","mistakeAnalysis"];function ek({errorItemId:e,fields:s,onDone:r,onReload:n}){let{t:i}=(0,x.b)(),[l,o]=(0,a.useState)(!1),c=`error-item:${e}:fix-latex`,{running:u,refresh:d}=(0,b.f)(c),m=(0,a.useRef)(!1),f=(0,a.useRef)(!1),v=(0,a.useMemo)(()=>Object.values(function(e){let t={};for(let a of ew){let s=function(e){if(!e?.trim())return[];let{masked:t,segments:a}=(0,ey.F)(e),s=[];for(let e of a)try{ej.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:eN(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")||eb.has(e.slice(1)));return l.length>0&&s.push({snippet:eN(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]),N=async()=>{o(!0),m.current=!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=>i.fixLatex.fields[e]).join(i.common.listSeparator);y.c.info(0===t.issuesBefore?i.fixLatex.noIssues:0===t.fixedFields.length?i.fixLatex.notFixed:0===t.issuesAfter?i.fixLatex.fixedAll.replace("{fields}",a):i.fixLatex.fixedPartly.replace("{fields}",a).replace("{count}",String(t.issuesAfter)))}catch(e){if(e instanceof p.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")y.c.info(i.errors.TASK_ALREADY_RUNNING),m.current=!1,await d();else{let t=e?.data?.message||"",a=i.errors[t];j.V.error("[FixLatex]","Failed to fix LaTeX",{code:t}),y.c.error("string"==typeof a?a:i.fixLatex.failed)}}finally{o(!1)}};(0,a.useEffect)(()=>{if(u){f.current=!0;return}f.current&&!m.current&&n?.(),f.current=!1,m.current=!1},[u,n]);let w=l||!!u;return 0!==v||w?(0,t.jsxs)(h.f,{variant:"outline",size:"sm",onClick:N,disabled:w,className:"border-amber-500 text-amber-700 dark:text-amber-400",title:i.fixLatex.issuesFound.replace("{count}",String(v)),children:[w?(0,t.jsx)(g.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(ev,{className:"mr-2 h-4 w-4"}),w?i.fixLatex.running:i.fixLatex.button,!w&&v>0&&(0,t.jsxs)("span",{className:"ml-1",children:["(",v,")"]})]}):null}var eA=e.i(991686),eS=e.i(846968),eI=e.i(931454);function eC({errorItemId:e,onDone:s,onReload:r}){let{t:n,language:i}=(0,x.b)(),[l,o]=(0,a.useState)(!1),c=`error-item:${e}:reanswer`,{running:u,refresh:d}=(0,b.f)(c),m=(0,a.useRef)(!1),f=(0,a.useRef)(!1),v=async()=>{if(await (0,y.u)(n.reanswerItem.confirm)){o(!0),m.current=!0;try{let t=await p.k.post(`/api/error-items/${e}/reanswer`,{language:i},{timeout:6e5,recoverable:!0});s(t)}catch(e){if(e instanceof p.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")y.c.info(n.errors.TASK_ALREADY_RUNNING),m.current=!1,await d();else{let t=e?.data?.message||"",a=n.errors[t];j.V.error("[RegenerateAnswer]","Failed to regenerate answer",{code:t}),y.c.error("NO_QUESTION_TEXT"===t?n.reanswerItem.noQuestionText:"string"==typeof a?a:n.reanswerItem.failed)}}finally{o(!1)}}};(0,a.useEffect)(()=>{if(u){f.current=!0;return}f.current&&!m.current&&r?.(),f.current=!1,m.current=!1},[u,r]);let N=l||!!u;return(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:v,disabled:N,children:[N?(0,t.jsx)(g.f,{className:"h-4 w-4 mr-1 animate-spin"}):(0,t.jsx)(eI.f,{className:"h-4 w-4 mr-1"}),N?n.reanswerItem.running:n.reanswerItem.button]})}var eE=e.i(689664),eT=e.i(508734),eR=e.i(66760),eL=e.i(488626);function eF({shortId:e,seqNo:s,className:r=""}){let{t:n}=(0,x.b)(),{numbering:i}=(0,eR.I)(),[l,o]=(0,a.useState)(!1),c=(0,eL.D)({shortId:e,seqNo:s},i);if(!c)return null;let u=c.startsWith("#"),d=async e=>{e.preventDefault(),e.stopPropagation();try{await navigator.clipboard.writeText(c),o(!0),setTimeout(()=>o(!1),1500)}catch{window.prompt(n.shortId.copy,c)}};return(0,t.jsxs)("button",{type:"button",onClick:d,title:l?n.shortId.copied:n.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 ${r}`,children:[!u&&(0,t.jsx)("span",{children:n.shortId.label}),(0,t.jsx)("span",{className:"font-semibold text-foreground",children:c}),l?(0,t.jsx)(eE.f,{className:"h-3 w-3 text-green-600"}):(0,t.jsx)(eT.f,{className:"h-3 w-3"})]})}let eM={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"}]]};eM.node;let e$=(0,i.f)(eM),ez={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"}]]};ez.node;let eU=(0,i.f)(ez),eD={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"}]]};eD.node;let eV=(0,i.f)(eD),e_={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"}]]};e_.node;let eq=(0,i.f)(e_),eO={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"}]]};eO.node;let eG=(0,i.f)(eO);var eH=e.i(21357),eK=e.i(395925);let eY={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"}]]};eY.node;let eP=(0,i.f)(eY),eB={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"}]]};eB.node;let eX=(0,i.f)(eB);var eW=e.i(975157);function eQ({supported:e,enabled:a,rate:s,fullscreen:r,onToggle:n,onCycleRate:i}){let{t:l}=(0,x.b)(),o=(0,eW.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)(h.f,{variant:"ghost",size:"sm",className:(0,eW.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)(eP,{className:"h-4 w-4"}):(0,t.jsx)(eX,{className:"h-4 w-4"})})}),a&&e&&(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",className:(0,eW.f)(o,"px-1.5 text-xs tabular-nums"),onClick:i,"aria-label":l.svgAnimation.voiceRate,title:l.svgAnimation.voiceRate,children:[s,"×"]})]})}let eZ=/<metadata\b[^>]*\bid\s*=\s*["']narration["'][^>]*>([\s\S]*?)<\/metadata\s*>/gi,eJ={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};function e0(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?e3(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 e1(e){for(let t of e.matchAll(eZ)){let e=e0(t[1].replace(/&(#x[0-9a-f]+|#\d+|lt|gt|amp|quot|apos);/gi,(e,t)=>{if("#"!==t[0])return eJ[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 e2=/<(?:animate|animateTransform|animateMotion|set)\b[^>]*>/gi;function e4(e,t){let a=e.match(RegExp(`\\s${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i"));return a?(a[2]??a[3]??"").trim():null}function e3(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 e5=new Set(["opacity","visibility","display","fill-opacity"]);function e8(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(e5.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 e3((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),e0(r.map(({begin:e,text:t})=>({begin:e,text:t})))}var e6=e.i(79058);let e7={zh:["zh","cmn"],en:["en"]};function e9(){return"speechSynthesis"in window&&"u">typeof SpeechSynthesisUtterance?window.speechSynthesis:null}let te=!1;function tt(){let e=e9();if(!e||te)return;te=!0;let t=new SpeechSynthesisUtterance(" ");t.volume=0,e.speak(t)}let ta=[1,1.25,1.5,.75],ts="svg-narration-enabled",tr="svg-narration-rate";function tn(e){try{return localStorage.getItem(e)}catch{return null}}function ti(e,t){try{localStorage.setItem(e,t)}catch{}}function tl(e,t){return Math.max(8e3,400*e.length/t+5e3)}function to(e,t){let a=-1;for(let s=0;s<e.length&&e[s].begin<=t+.05;s++)a=s;return a}function tc(e){let t=Math.max(0,Math.floor(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function tu({svg:e,errorItemId:s}){let{t:r,language:n}=(0,x.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,f]=(0,a.useState)(0),[p,v]=(0,a.useState)(!1),[j,y]=(0,a.useState)(!1),b=p||j,N=(0,a.useMemo)(()=>(function(e){let t=0;for(let a of e.match(e2)||[]){let e=e4(a,"begin"),s=null===e?0:e3(e.split(";")[0]);if(null===s)continue;let r=e4(a,"repeatCount");if("indefinite"!==r&&"indefinite"!==e4(a,"repeatDur"))t=Math.max(t,s+(e3(e4(a,"dur"))??0)*(r&&Number.isFinite(Number(r))?Number(r):1))}return t})(e),[e]),w=(0,a.useMemo)(()=>(function(e){let t=e.match(/<svg\b[^>]*>/i)?.[0]??"",a=e4(t,"viewBox")?.split(/[\s,]+/).map(Number);if(a?.length===4&&a[2]>0&&a[3]>0)return a[2]/a[3];let s=parseFloat(e4(t,"width")??""),r=parseFloat(e4(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)(()=>e1(e),[e]),[S,I]=(0,a.useState)(null),C=A??S,E=(0,a.useCallback)(()=>{let e=l.current?.contentDocument;return"function"==typeof e?.getAnimations?e.getAnimations():[]},[]),T=function({segments:e,language:t,errorItemId:s,holdAnimation:r}){let{supported:n,mode:i,modeRef:l,voiceRef:o}=function(e){let[t,s]=(0,a.useState)(!1),[r,n]=(0,a.useState)("browser"),i=(0,a.useRef)(void 0),l=(0,a.useRef)("browser");return(0,a.useEffect)(()=>{let e=!0;return(0,e6.v)().then(t=>{e&&(l.current=t,n(t))}),()=>{e=!1}},[]),(0,a.useEffect)(()=>{let t=e9();if(!t)return;let a=()=>{let a,r,n,l=t.getVoices();a=e7[e],r=l.filter(e=>a.some(t=>e.lang.toLowerCase().startsWith(t))),n="zh"===e?/^(zh|cmn)[-_](cn|hans)/i:/^en[-_]us/i,i.current=r.find(e=>n.test(e.lang)&&e.localService)??r.find(e=>n.test(e.lang))??r[0],s(0===l.length||!!i.current)};return a(),t.addEventListener?.("voiceschanged",a),()=>t.removeEventListener?.("voiceschanged",a)},[e]),{supported:t,mode:r,modeRef:l,voiceRef:i}}(t),[c,u]=(0,a.useState)(!1),[d,m]=(0,a.useState)(1),[g,f]=(0,a.useState)(!1),[h,x]=(0,a.useState)(!1),p=(0,a.useRef)(!1),v=(0,a.useRef)(!1),j=(0,a.useRef)(1),y=(0,a.useRef)(r);(0,a.useEffect)(()=>{y.current=r},[r]),(0,a.useEffect)(()=>{g&&(0,e6.E)()},[g]),(0,a.useEffect)(()=>{v.current="1"===tn(ts),u(v.current);let e=Number(tn(tr));ta.includes(e)&&(j.current=e,m(e))},[]);let b=(0,a.useRef)(null);(0,a.useEffect)(()=>{let a=b.current;a&&(a.deps.segments=e,a.deps.language=t,a.deps.enabled=v.current,a.deps.mode=l.current,a.deps.voice=o.current,a.deps.rate=j.current)}),(0,a.useEffect)(()=>{let a={segments:e,language:t,enabled:v.current,mode:l.current,voice:o.current,rate:j.current,setSpeaking:f,setHolding:x,hold:e=>{y.current(e)}},s=function(e){let t=-1,a=!1,s=null,r=0,n=null,i=!1,l=!1;function o(){i&&(i=!1,null===s&&(e.setHolding(!1),e.hold(!1)))}function c(t,r){r(),t()&&(n=null,a=!1,e.setSpeaking(!1),o(),null!==s&&(s=null,e.setHolding(!1),e.hold(!1)))}function u(t,a,s,r){if(!t()||l)return;l=!0,o();let n=e9();if(!n)return void c(t,s);let i=new SpeechSynthesisUtterance(a.text);i.lang=e.voice?.lang??("en"===e.language?"en-US":"zh-CN"),e.voice&&(i.voice=e.voice),i.rate=e.rate,i.onend=()=>c(t,s),i.onerror=()=>c(t,s),i.onstart=()=>r(tl(a.text,i.rate)),r(2500),n.speak(i)}return{update:function(d){let m=e.segments;if(!e.enabled||!m?.length||null!==s)return;if(a){let a=t+1;if(a>=m.length)return;let r=a>0?m[a].begin-m[a-1].begin:m[a].begin;if(d<m[a].begin-Math.min(.8,r/2))return;s=a,e.setHolding(!0),e.hold(!0);return}let g=to(m,d);g<=t||(t=g,function(t){let d,m=e.segments,g=m?.[t];if(!g)return;let f=r,h={},x=()=>r===f&&n===h,p=()=>clearTimeout(d),v=e=>{clearTimeout(d),d=setTimeout(()=>c(x,p),e)};if(l=!1,n=h,a=!0,e.setSpeaking(!0),"cloud"!==e.mode)return u(x,g,p,v);let j=e.language,y=m?.[t+1];y&&(0,e6.U)(y.text,j).catch(()=>void 0);let b=setTimeout(()=>{x()&&null===s&&(i=!0,e.setHolding(!0),e.hold(!0))},300);(0,e6.U)(g.text,j).then(t=>{let a=(0,e6.l)();if(!x())return;if(!a){clearTimeout(b),u(x,g,p,v);return}let s=e=>()=>{x()&&!l&&e()};a.onplaying=s(()=>{clearTimeout(b),o(),v(tl(g.text,a.playbackRate))}),a.onended=s(()=>c(x,p)),a.onerror=s(()=>u(x,g,p,v)),a.src=t,a.playbackRate=e.rate,v(8e3),a.play().catch(s(()=>{clearTimeout(b),u(x,g,p,v)}))},()=>{clearTimeout(b),u(x,g,p,v)})}(g))},stop:function(l){r++,n=null,a=!1,e.setSpeaking(!1),(null!==s||i)&&(s=null,i=!1,e.setHolding(!1),e.hold(!1)),t=e.segments?to(e.segments,l)-1:-1,e9()?.cancel(),"cloud"===e.mode&&(0,e6.l)()?.pause()},dispose:function(){r++,e9()?.cancel(),"cloud"===e.mode&&(0,e6.l)()?.pause()}}}(a);return b.current={playback:s,deps:a},()=>{s.dispose(),b.current=null}},[]);let N=(0,a.useCallback)(()=>b.current?.playback??null,[]);(0,a.useEffect)(()=>()=>{N()?.dispose()},[e,N]);let w=(0,a.useCallback)(e=>{N()?.stop(e)},[N]),k=(0,a.useCallback)(e=>{N()?.update(e)},[N]),A=(0,a.useCallback)(()=>{v.current&&(tt(),"cloud"===l.current&&(0,e6.p)())},[l]),S=(0,a.useCallback)((e,t)=>{p.current=!0,N()?.stop(t),v.current=e,u(e),ti(ts,e?"1":"0"),A()},[N,A]),I=(0,a.useCallback)(()=>{var e;let t,a=(e=j.current,t=ta.indexOf(e),ta[(t+1)%ta.length]);if(j.current=a,m(a),"cloud"===l.current){let e=(0,e6.l)();e&&(e.playbackRate=a)}ti(tr,String(a))},[l]);return(0,a.useEffect)(()=>{let e="cloud"===i&&!(0,e6.h)();if(!c||(te||!e9())&&!e)return;let t=()=>{tt(),e&&(0,e6.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,i]),(0,a.useEffect)(()=>{c&&"cloud"===i&&e?.length&&(0,e6.w)(e.map(e=>e.text),t,s).catch(()=>void 0)},[c,i,e,t,s]),(0,a.useEffect)(()=>{if("cloud"!==i||!e?.length||v.current)return;let a=!0;return(0,e6.z)(e.map(e=>e.text),t).then(e=>{a&&e&&!v.current&&!p.current&&(v.current=!0,u(!0))}),()=>{a=!1}},[i,e,t]),{supported:n||"cloud"===i,enabled:c,rate:d,speaking:g,holding:h,setEnabled:S,cycleRate:I,update:k,stop:w,prime:A}}({segments:C,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])}),R=T.enabled&&(T.holding||!d&&T.speaking),{stop:L,update:F,prime:M}=T,$=(0,a.useCallback)(()=>{o.current?.pauseAnimations(),E().forEach(e=>e.pause()),m(!1)},[E]),z=(0,a.useCallback)(()=>{L(o.current?.getCurrentTime()??0),$()},[$,L]),U=(0,a.useCallback)(e=>{o.current?.setCurrentTime(e),E().forEach(t=>{t.currentTime=1e3*e}),f(e),L(e)},[E,L]),D=(0,a.useCallback)(()=>{let e=o.current;e&&(N>0&&e.getCurrentTime()>=N&&U(0),e.unpauseAnimations(),E().forEach(e=>e.play()),m(!0),M())},[E,N,U,M]),V=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(F(a),N>0&&a>=N){o.current?.setCurrentTime(N),$(),f(N);return}f(a),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[d,N,$,F]),(0,t.jsxs)("div",{ref:i,className:(0,eW.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,L(0),$(),o.current?.setCurrentTime(0),E().forEach(e=>{e.currentTime=0}),I(o.current?e8(o.current):null),f(0),u(o.current?e:null)},className:(0,eW.f)("mx-auto block rounded border bg-white transition-shadow",!b&&"w-full max-w-3xl",R&&"border-primary ring-2 ring-primary/40"),style:{visibility:c===e?"visible":"hidden",...b?{aspectRatio:w,width:`min(100%, calc((100dvh - 96px) * ${w}))`}:{aspectRatio:w}}}),(0,t.jsxs)("div",{className:(0,eW.f)("mx-auto flex w-full items-center gap-2",b?"max-w-5xl text-white":"max-w-3xl"),children:[(0,t.jsx)(h.f,{variant:"outline",size:"sm",className:"h-8 w-8 shrink-0 p-0 text-foreground",onClick:d?z:D,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)(eG,{className:"h-4 w-4"}):(0,t.jsx)(eH.f,{className:"h-4 w-4"})}),(0,t.jsx)(h.f,{variant:"ghost",size:"sm",className:(0,eW.f)("h-8 w-8 shrink-0 p-0",b&&"text-white hover:bg-white/20 hover:text-white"),onClick:()=>{U(0),D()},disabled:c!==e,"aria-label":r.svgAnimation.replay,title:r.svgAnimation.replay,children:(0,t.jsx)(eK.f,{className:"h-4 w-4"})}),N>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"range",min:0,max:N,step:.1,value:Math.min(g,N),onChange:e=>U(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,eW.f)("shrink-0 text-xs tabular-nums",b?"text-white/80":"text-muted-foreground"),children:[tc(g)," / ",tc(N)]})]}),(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[!!C?.length&&(0,t.jsx)(eQ,{supported:T.supported,enabled:T.enabled,rate:T.rate,fullscreen:b,onToggle:()=>T.setEnabled(!T.enabled,o.current?.getCurrentTime()??0),onCycleRate:T.cycleRate}),(0,t.jsx)(h.f,{variant:"ghost",size:"sm",className:(0,eW.f)("h-8 w-8 shrink-0 p-0",b&&"text-white hover:bg-white/20 hover:text-white"),onClick:V,"aria-label":b?r.svgAnimation.exitFullscreen:r.svgAnimation.fullscreen,title:b?r.svgAnimation.exitFullscreen:r.svgAnimation.fullscreen,children:b?(0,t.jsx)(eq,{className:"h-4 w-4"}):(0,t.jsx)(eV,{className:"h-4 w-4"})})]})]})]})}function td({svg:e,errorItemId:s,disabled:r,onBusyChange:n}){let{t:i,language:l}=(0,x.b)(),[o,c]=(0,a.useState)(!1),[u,d]=(0,a.useState)(!1),m=(0,a.useMemo)(()=>(function(e){let t=e1(e);if(t)return t;try{let t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;return"svg"===t.nodeName?e8(t):null}catch{return null}})(e),[e]),f=s?`error-item:${s}:tts-voice:${l}`:null,{running:N,refresh:w}=(0,b.f)(f);if((0,a.useEffect)(()=>{let e=!0;return(0,e6.v)().then(t=>{e&&c("cloud"===t)}),()=>{e=!1}},[]),!o||!m?.length)return null;let k=async()=>{d(!0),n(!0);try{await (0,e6.H)(m.map(e=>e.text),l,s),y.c.success(i.svgAnimation.voiceRegenerateDone)}catch(e){if(e instanceof p.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")y.c.info(i.errors.TASK_ALREADY_RUNNING),await w();else{let t=(0,v.d)(e)||"";j.V.error("[SvgAnimation]","Failed to regenerate cloud voice",{code:t,error:(0,v.Z)(e)});let a=(0,v.L)(e),s="TTS_DISABLED"===t?i.svgAnimation.voiceRegenerateDisabled:i.svgAnimation.voiceRegenerateFailed;y.c.error(a?`${s} (${a})`:s)}}finally{d(!1),n(!1)}},A=u||!!N;return(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:k,disabled:r||A,title:i.svgAnimation.voiceRegenerateHint,children:[A?(0,t.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(eK.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:A?i.svgAnimation.voiceRegenerating:i.svgAnimation.voiceRegenerate})]})}function tm({errorItemId:e,svgAnimation:s,hasOtherLanguage:r,onChange:n}){let{t:i,language:l}=(0,x.b)(),[o,d]=(0,a.useState)(!1),[m,f]=(0,a.useState)(!1),[N,w]=(0,a.useState)(!1),[k,A]=(0,a.useState)(!1),[S,I]=(0,a.useState)(null),C=(0,a.useMemo)(()=>!!s&&!!e1(s),[s]),E=`error-item:${e}:svg-animation:${l}`,T=`error-item:${e}:svg-narration:${l}`,{running:R,refresh:L}=(0,b.f)(E),{running:F,refresh:M}=(0,b.f)(T),$=(0,a.useRef)(!1),z=(0,a.useRef)(!1);(0,a.useEffect)(()=>{if(R){$.current=!0;return}$.current&&($.current=!1,p.k.get(`/api/error-items/${e}`).then(e=>n(l,"en"===l?e.svgAnimationEn??null:e.svgAnimation??null)).catch(e=>j.V.warn("[SvgAnimation]","Failed to reload animation",{error:e})))},[R,e,l,n]),(0,a.useEffect)(()=>{if(F){z.current=!0;return}z.current&&(z.current=!1,p.k.get(`/api/error-items/${e}`).then(e=>n(l,"en"===l?e.svgAnimationEn??null:e.svgAnimation??null)).catch(e=>j.V.warn("[SvgAnimation]","Failed to reload narration",{error:e})))},[F,e,l,n]);let U=(e,t)=>{let a=i.errors[e];return"string"==typeof a?a:t},D=async()=>{d(!0),I(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(e){if(e instanceof p.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")y.c.info(i.errors.TASK_ALREADY_RUNNING),await L();else{let t=(0,v.d)(e)||"";j.V.error("[SvgAnimation]","Failed to generate SVG animation",{code:t,error:(0,v.Z)(e)}),I("NO_QUESTION_TEXT"===t?i.svgAnimation.noQuestionText:"NO_VALID_ANIMATION"===t?i.svgAnimation.invalid:U(t,i.svgAnimation.failed))}}finally{d(!1)}},V=async()=>{w(!0),I(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),y.c.success(i.svgAnimation.narrationDone)}catch(e){if(e instanceof p.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING")y.c.info(i.errors.TASK_ALREADY_RUNNING),await M();else{let t=(0,v.d)(e)||"";j.V.error("[SvgAnimation]","Failed to generate SVG narration",{code:t,error:(0,v.Z)(e)}),I("NO_VALID_NARRATION"===t?i.svgAnimation.narrationInvalid:U(t,i.svgAnimation.narrationFailed))}}finally{w(!1)}},_=async()=>{if(await (0,y.u)(i.svgAnimation.confirmDelete,{destructive:!0})){f(!0);try{await p.k.delete(`/api/error-items/${e}/svg-animation?language=${l}`),n(l,null),I(null)}catch(e){j.V.error("[SvgAnimation]","Failed to delete SVG animation",{error:e instanceof Error?e.message:String(e)}),y.c.error(i.svgAnimation.deleteFailed)}finally{f(!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)(eU,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.svgAnimation.title})]}),(0,t.jsxs)(h.f,{variant:"outline",size:"sm",onClick:D,disabled:o||!!R,children:[o||R?(0,t.jsx)(g.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(eU,{className:"mr-2 h-4 w-4"}),o||R?i.svgAnimation.generating:i.svgAnimation.generate]})]}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:S}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:r?i.svgAnimation.otherLanguageAvailable:i.svgAnimation.hint})]});let q=o||!!R||m||N||!!F||k;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}),q&&(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)(h.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:V,disabled:q,title:i.svgAnimation.narrationHint,children:[N||F?(0,t.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(e$,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N||F?i.svgAnimation.narrationGenerating:C?i.svgAnimation.narrationRegenerate:i.svgAnimation.narrationGenerate})]}),(0,t.jsx)(td,{svg:s,errorItemId:e,disabled:q,onBusyChange:A}),(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:D,disabled:q,children:[o||R?(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||R?i.svgAnimation.generating:i.svgAnimation.regenerate})]}),(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:_,disabled:q,children:[(0,t.jsx)(u.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:i.svgAnimation.delete})]})]})]}),S&&(0,t.jsx)("p",{className:"px-3 pt-2 text-xs text-destructive",children:S}),(0,t.jsx)("div",{className:"p-2 sm:p-3",children:(0,t.jsx)(tu,{svg:s,errorItemId:e})})]})}var tg=e.i(912505),tf=e.i(86963),th=e.i(35209);e.s(["default",0,function(){let e=(0,r.useParams)(),i=(0,r.useRouter)(),{t:l,language:m}=(0,x.b)(),[g,f]=(0,a.useState)(null),v=(0,eR.T)();(0,th.f)(l.detail.title,g?.subject?.name,g?v(g):null);let[b,k]=(0,a.useState)(!0),[A,S]=(0,a.useState)(null),[I,C]=(0,a.useState)(!1),[E,T]=(0,a.useState)(void 0),[R,L]=(0,a.useState)(!1),[F,M]=(0,a.useState)(!0),[z,D]=(0,a.useState)(null),[V,_]=(0,a.useState)(!1),q=(0,a.useCallback)(async e=>{try{let t=await p.k.get(`/api/error-items/${e}`);f(t)}catch(e){j.V.error("[ErrorDetail]","Failed to fetch error item",{error:e}),y.c.error(l.common?.messages?.loadFailed||"Failed to load item"),i.push("/notebooks")}finally{k(!1)}},[i,l]);(0,a.useEffect)(()=>{p.k.get("/api/user").then(e=>{e&&e.educationStage&&T(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 O=(0,a.useCallback)(e=>{f(t=>t&&{...t,...e})},[]),G=async e=>{g&&(await p.k.put(`/api/error-items/${g.id}`,e),O(e))},H=async()=>{g&&await q(g.id)},K=async e=>{if(!g)return;let t=g.difficultyStars??null;O({difficultyStars:e}),_(!0);try{let t=await p.k.put(`/api/error-items/${g.id}`,{difficultyStars:e});O({paperLevel:t.paperLevel})}catch(e){O({difficultyStars:t}),j.V.error("[ErrorDetail]","Failed to save difficulty",{error:e}),y.c.error(l.difficulty.saveFailed)}finally{_(!1)}},Y=(0,a.useCallback)((e,t)=>{O({["en"===e?"svgAnimationEn":"svgAnimation"]:t})},[O]),P=async()=>{if(g&&await (0,y.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`),y.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}),y.c.error(l.common?.messages?.deleteFailed||"Delete failed")}};return b?(0,t.jsx)(tf.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)(h.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)(eF,{shortId:g.shortId,seqNo:g.seqNo}),(0,t.jsx)(d.f,{size:"md",value:g.difficultyStars,onChange:K,disabled:V})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(ek,{errorItemId:g.id,fields:g,onDone:O,onReload:H}),(0,t.jsx)(s.default,{href:`/practice?id=${g.id}`,children:(0,t.jsxs)(h.f,{variant:"outline",size:"sm",children:[(0,t.jsx)(c.f,{className:"mr-2 h-4 w-4"}),l.detail.practice]})}),z&&(0,t.jsx)(eS.x,{status:z,className:"h-8 self-center px-3"}),(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:P,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)(ef,{item:g,educationStage:E,saveFields:G,onUpdate:O,reload:H,onEnlarge:S}),(0,t.jsx)(eA.K,{errorItemId:g.id,onMasteryStatusChange:D}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsx)($,{title:l.detail.correctAnswer,value:g.answerText,onSave:e=>G({answerText:e}),logLabel:"answer",rows:5,placeholder:"Enter answer...",cardClassName:"border-primary/20",titleClassName:"text-primary",contentClassName:"font-semibold",headerActions:(0,t.jsx)(eC,{errorItemId:g.id,onDone:e=>O({answerText:e.answerText??"",analysis:e.analysis??""}),onReload:H}),children:g.referenceImageUrl&&(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(eg,{src:g.referenceImageUrl,alt:l.detail.referenceImageAlt,showLabel:l.detail.viewImage,hideLabel:l.detail.hideImage,visible:I,onVisibleChange:C,onEnlarge:S})})}),(0,t.jsx)(ex,{item:g,saveFields:G,onEnlarge:S})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsx)($,{title:l.detail.analysis,value:g.analysis,onSave:e=>G({analysis:e}),logLabel:"analysis",rows:12,placeholder:"Enter analysis..."}),(0,t.jsx)($,{title:l.detail?.mistakeAnalysis||"Mistake Analysis",value:g.mistakeAnalysis,onSave:e=>G({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:[F&&(0,t.jsx)(tm,{errorItemId:g.id,svgAnimation:"en"===m?g.svgAnimationEn:g.svgAnimation,hasOtherLanguage:!!("en"===m?g.svgAnimation:g.svgAnimationEn),onChange:Y},m),R&&(0,t.jsx)(N,{errorItemId:g.id,commands:g.geogebraCommands,onUpdate:O}),(0,t.jsx)(U,{item:g,onUpdate:O})]})]}),(0,t.jsx)(w,{src:A,onClose:()=>S(null)})]}):(0,t.jsx)(tg.f,{icon:o,title:l.detail.notFound||"Item not found",className:"m-4 md:m-8"})}],204573)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let s={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],711241)},566595,e=>{var t=e.i(456420);let s={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],566595)},666944,e=>{var t=e.i(843476),s=e.i(271645),n=e.i(618566),r=e.i(519455),a=e.i(590546),i=e.i(716327),l=e.i(456539),o=e.i(566595),c=e.i(793479),m=e.i(111110),u=e.i(66760),d=e.i(488626);function p(e){if(e.tags&&e.tags.length>0)return e.tags.map(e=>e.name);try{let t=JSON.parse(e.knowledgePoints||"[]");return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}async function x(e){let t=[];for(let s=1;;s+=1){let n=await e(s);if(t.push(...n.items),0===n.items.length||s>=n.totalPages)return t}}function h({items:e,selectedIds:n,selectedCount:a,printNumbers:x,onToggle:f,onSelectionChange:g}){let{t:w}=(0,m.b)(),v=(0,u.T)(),[b,j]=(0,s.useState)(e.length<=20),[y,S]=(0,s.useState)(""),N=(0,s.useMemo)(()=>e.filter(e=>{let t;return!(t=y.trim().toLowerCase())||[e.questionText??"",e.shortId??"",(0,d.S)(e.seqNo)??"",...p(e)].some(e=>e.toLowerCase().includes(t))}),[e,y]),A=y.trim().length>0,P=e=>g(function(e,t,s){let n=new Set(e);for(let r of t)"select"!==s&&("invert"!==s||e.has(r))?n.delete(r):n.add(r);return n}(n,N.map(e=>e.id),e));return(0,t.jsxs)("div",{className:"rounded-md border bg-muted/20 p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-sm font-medium hover:text-primary","aria-expanded":b,onClick:()=>j(e=>!e),children:[b?(0,t.jsx)(l.f,{className:"h-4 w-4"}):(0,t.jsx)(i.f,{className:"h-4 w-4"}),w.printPreview.selectItems," (",a,"/",e.length,")"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(r.f,{variant:"outline",size:"sm",onClick:()=>P("select"),children:A?w.printPreview.selectFiltered:w.printPreview.selectAll}),(0,t.jsx)(r.f,{variant:"outline",size:"sm",onClick:()=>P("clear"),children:A?w.printPreview.clearFiltered:w.printPreview.clearSelection}),(0,t.jsx)(r.f,{variant:"outline",size:"sm",onClick:()=>P("invert"),children:w.printPreview.invertSelection})]})]}),b&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(o.f,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(c.f,{type:"search",value:y,onChange:e=>S(e.target.value),placeholder:w.printPreview.searchPlaceholder,"aria-label":w.printPreview.searchPlaceholder,className:"h-8 pl-8 text-sm"})]}),(0,t.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3 max-h-[40vh] overflow-y-auto pr-1",children:[N.map(e=>{let s=x.get(e.id);return(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded border bg-background p-2 text-xs cursor-pointer hover:border-primary/50",children:[(0,t.jsx)("input",{type:"checkbox",checked:n.has(e.id),onChange:()=>f(e.id),className:"mt-0.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,t.jsxs)("span",{className:"line-clamp-2",children:[void 0!==s&&(0,t.jsxs)("span",{className:"font-semibold",children:[w.printPreview.questionNumber.replace("{num}",String(s)),w.common.colon]}),v(e)&&(0,t.jsxs)("span",{className:"font-mono text-muted-foreground",children:[v(e)," "]}),e.questionText]})]},e.id)}),0===N.length&&(0,t.jsx)("p",{className:"col-span-full py-2 text-center text-xs text-muted-foreground",children:w.printPreview.noSearchResult})]})]})]})}var f=e.i(122330);function g({checked:e,onChange:s,label:n}){return(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,t.jsx)("input",{type:"checkbox",checked:e,onChange:e=>s(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),n]})}function w({options:e,onChange:s,hasCustomSpaces:n,onResetCustomSpaces:a}){let{t:i}=(0,m.b)(),l=e.answerSpace??"auto";return(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,t.jsxs)("span",{className:"whitespace-nowrap text-xs sm:text-sm",children:[i.printPreview?.imageScale||"Image Scale",": ",e.imageScale,"%"]}),(0,t.jsx)("input",{type:"range",min:"30",max:"100",value:e.imageScale,onChange:e=>s({imageScale:Number(e.target.value)}),className:"w-16 sm:w-20 accent-primary"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs sm:text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,t.jsxs)("label",{htmlFor:"print-preview-answer-space",className:"whitespace-nowrap",children:[i.exam.answerSpace,":"]}),(0,t.jsxs)("select",{id:"print-preview-answer-space",value:l,onChange:e=>{(0,f.I)(e.target.value)&&s({answerSpace:e.target.value})},className:"bg-background border rounded px-2 py-0.5 text-xs sm:text-sm",children:[(0,t.jsx)("option",{value:"auto",children:i.exam.answerSpaceAuto}),(0,t.jsx)("option",{value:"none",children:i.exam.answerSpaceNone}),(0,t.jsx)("option",{value:"small",children:i.exam.answerSpaceSmall}),(0,t.jsx)("option",{value:"medium",children:i.exam.answerSpaceMedium}),(0,t.jsx)("option",{value:"large",children:i.exam.answerSpaceLarge})]}),n&&a&&(0,t.jsx)(r.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:a,children:i.exam.resetAllQuestionAnswerSpaces})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 sm:gap-4",children:[(0,t.jsx)(g,{checked:e.showQuestionText,onChange:e=>s({showQuestionText:e}),label:i.printPreview?.showQuestionText||"Question Text"}),(0,t.jsx)(g,{checked:e.showAnswers,onChange:e=>s({showAnswers:e}),label:i.printPreview?.showAnswers||"Show Answers"}),(0,t.jsx)(g,{checked:e.showAnalysis,onChange:e=>s({showAnalysis:e}),label:i.printPreview?.showAnalysis||"Show Analysis"}),(0,t.jsx)(g,{checked:e.showTags,onChange:e=>s({showTags:e}),label:i.printPreview?.showTags||"Show Tags"})]})]})}var v=e.i(263676),b=e.i(511445),j=e.i(84583),y=e.i(920808),S=e.i(149704);let N=(0,s.memo)(function({item:e,index:s,options:n,reserveAnswerSpace:r,customAnswerSpacePx:a,onCustomAnswerSpaceChange:i,paperGroupName:l,onRemove:o}){let{t:c}=(0,m.b)(),d=(0,u.T)()(e),x=p(e),h=r?(0,f.z)(n.answerSpace??"auto",e.questionText||"",a):0;return(0,t.jsxs)("div",{className:`mb-4 border-b last:border-b-0 print:break-inside-avoid [content-visibility:auto] [contain-intrinsic-size:auto_480px] print:[content-visibility:visible] ${r?"pb-4":"pb-6"}`,children:[(0,t.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 leading-7",children:[(0,t.jsx)("span",{className:"text-lg font-bold",children:c.printPreview?.questionNumber?.replace("{num}",String(s+1))||`Question ${s+1}`}),d&&(0,t.jsx)("span",{className:"font-mono text-sm text-muted-foreground whitespace-nowrap",children:c.printPreview.source.replace("{id}",d)}),e.subject&&(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:e.subject.name}),e.gradeSemester&&(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:e.gradeSemester}),l&&(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[c.printPreview?.paperLevel||"Paper Level",": ",l]}),n.showTags&&x.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"font-semibold",children:[c.printPreview?.knowledgePoints||"Knowledge Points",":"]}),x.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-muted rounded text-sm",children:e},`${e}-${s}`))]}),o&&(0,t.jsxs)("button",{type:"button",className:"print:hidden ml-auto flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-destructive",onClick:()=>o(e.id),children:[(0,t.jsx)(v.X,{className:"h-3.5 w-3.5"}),c.printPreview.removeFromPrint]})]}),n.showQuestionText&&e.questionText?(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(y.f,{content:e.questionText}),(0,t.jsx)(S.f,{svg:e.figureSvg,scale:e.figureScale,align:e.figureAlign})]}):e.originalImageUrl&&(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)("img",{src:e.originalImageUrl,alt:c.detail?.originalProblem||"Question Image",loading:"lazy",decoding:"async",className:"h-auto border rounded",style:{maxWidth:`${n.imageScale}%`}})}),n.showAnswers&&e.answerText&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("h3",{className:"font-semibold mb-2",children:[c.printPreview?.referenceAnswer||"Reference Answer",":"]}),(0,t.jsx)(b.f,{content:e.answerText})]}),n.showAnalysis&&e.analysis&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("h3",{className:"font-semibold mb-2",children:[c.printPreview?.analysis||"Analysis",":"]}),(0,t.jsx)(b.f,{content:e.analysis})]}),r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"print-answer-space",style:{minHeight:`${h}px`}}),i&&(0,t.jsx)(j.f,{effectivePx:h,isCustom:"number"==typeof a,onChange:t=>i(e.id,t),onReset:()=>i(e.id,null)})]})]})});var A=e.i(41931),P=e.i(35209),k=e.i(442861),C=e.i(469817),T=e.i(201276);async function $(e,{timeoutMs:t=3e4,onProgress:s}={}){let n,r=Array.from(e.querySelectorAll("img")),a=0;s?.(a,r.length);let i=Promise.all(r.map(async e=>{e.loading="eager",await (e.complete?Promise.resolve():new Promise(t=>{e.addEventListener("load",()=>t(),{once:!0}),e.addEventListener("error",()=>t(),{once:!0})})),a+=1,s?.(a,r.length)})),l=new Promise(e=>{n=setTimeout(e,t)});await Promise.race([i,l]),clearTimeout(n)}let z="print-preview-options",M={showQuestionText:!1,showAnswers:!1,showAnalysis:!1,showTags:!1,imageScale:70,answerSpace:"auto"},R=["showQuestionText","showAnswers","showAnalysis","showTags"];var I=e.i(470279);async function F(e){for(let t of function(e,t){let s=[];for(let n=0;n<e.length;n+=t)s.push(e.slice(n,n+t));return s}(e,C.A))await A.k.put("/api/error-items/answer-space",{items:t})}function L(){var e,i,l,o,c,u;let d=(0,n.useSearchParams)(),{t:p}=(0,m.b)(),[g,v]=(0,s.useState)([]);(0,P.f)(p.printPreview.title);let[b,j]=(0,s.useState)(!0),[y,S]=(0,s.useState)(M);(0,s.useEffect)(()=>{S(function(){try{return function(e){let t,s={...M};if(!e)return s;try{t=JSON.parse(e)}catch{return s}if(!t||"object"!=typeof t)return s;let n=t;for(let e of R)"boolean"==typeof n[e]&&(s[e]=n[e]);return"number"==typeof n.imageScale&&Number.isFinite(n.imageScale)&&(s.imageScale=Math.min(100,Math.max(30,Math.round(n.imageScale)))),(0,f.I)(n.answerSpace)&&(s.answerSpace=n.answerSpace),s}(localStorage.getItem(z))}catch{return{...M}}}())},[]);let[L,q]=(0,s.useState)(new Set),{customSpaces:O,setSpace:Q,resetAll:E,saveFailed:_}=(0,k.f)(g,F),U=(0,s.useCallback)(async()=>{try{let e=await x(e=>{let t=new URLSearchParams(d.toString());return t.set("page",String(e)),t.set("pageSize",String(C.A)),t.set("view","print"),A.k.get(`/api/error-items/list?${t.toString()}`)});v(e),q(new Set(e.map(e=>e.id)))}catch(e){T.V.error("[PrintPreview]","Failed to fetch items",{error:e})}finally{j(!1)}},[d]);(0,s.useEffect)(()=>{U()},[U]);let B=(0,s.useRef)(null),[D,W]=(0,s.useState)(null),K=async()=>{B.current&&await $(B.current,{onProgress:(e,t)=>W({loaded:e,total:t})}),W(null),window.print()},{groups:V}=(0,I.f)(),H=(0,s.useMemo)(()=>new Map(V.map(e=>[e.id,e.name])),[V]),J=(0,s.useMemo)(()=>g.filter(e=>L.has(e.id)),[g,L]),Z=(0,s.useMemo)(()=>new Map(J.map((e,t)=>[e.id,t+1])),[J]),G=(e=y.showAnswers,i=y.showAnalysis,!e&&!i),X=(l=g.length,(o=J.length)===l?String(l):`${o}/${l}`),Y=(c=g.length,u=J.length,0===c?"noItems":0===u?"noSelection":null),ee=(0,s.useCallback)(e=>{q(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),et=(0,s.useCallback)(e=>{q(t=>{let s=new Set(t);return s.delete(e),s})},[]);return b?(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,t.jsx)("p",{className:"text-muted-foreground",children:p.common.loading})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"print:hidden sticky top-0 z-10 bg-background border-b p-3 sm:p-4 shadow-sm",children:(0,t.jsxs)("div",{className:"max-w-6xl mx-auto space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(a.f,{fallbackUrl:"/notebooks"}),(0,t.jsxs)("h1",{className:"text-lg sm:text-xl font-bold flex-1",children:[p.printPreview?.title||"Print Preview"," (",X," ",p.notebooks?.items||"items",")"]}),(0,t.jsx)(r.f,{onClick:K,size:"sm",className:"whitespace-nowrap",disabled:0===J.length||null!==D,children:D?p.printPreview.loadingImages.replace("{loaded}",String(D.loaded)).replace("{total}",String(D.total)):p.printPreview?.printButton||"Print / Save PDF"})]}),(0,t.jsx)(w,{options:y,onChange:e=>S(t=>{let s={...t,...e};try{localStorage.setItem(z,JSON.stringify(s))}catch{}return s}),hasCustomSpaces:Object.keys(O).length>0,onResetCustomSpaces:E}),_&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:p.exam.answerSpaceSaveFailed})]})}),(0,t.jsx)("div",{className:"print:hidden border-b p-3 sm:p-4",children:(0,t.jsx)("div",{className:"max-w-6xl mx-auto",children:(0,t.jsx)(h,{items:g,selectedIds:L,selectedCount:J.length,printNumbers:Z,onToggle:ee,onSelectionChange:q})})}),(0,t.jsxs)("div",{ref:B,className:"max-w-4xl mx-auto p-8 print:p-0",children:[J.map((e,s)=>(0,t.jsx)(N,{item:e,index:s,options:y,reserveAnswerSpace:G,customAnswerSpacePx:O[e.id],onCustomAnswerSpaceChange:Q,paperGroupName:e.paperLevel?H.get(e.paperLevel)??e.paperLevel:null,onRemove:et},e.id)),Y&&(0,t.jsx)("div",{className:"text-center py-12 text-muted-foreground",children:"noSelection"===Y?p.printPreview?.noSelection||"No items selected":p.printPreview?.noItems||"No matching error items"})]})]})}e.s(["default",0,function(){let{t:e}=(0,m.b)();return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:e.common.loading}),children:(0,t.jsx)(L,{})})}],666944)},84583,920808,e=>{var t=e.i(843476),s=e.i(519455),n=e.i(111110),r=e.i(122330);e.s(["f",0,function({effectivePx:e,isCustom:a,onChange:i,onReset:l}){let{t:o}=(0,n.b)(),c=(0,r.O)(e);return(0,t.jsxs)("div",{className:"answer-space-controls print:hidden flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-2 pt-1",children:[(0,t.jsxs)("span",{children:[o.exam.questionAnswerSpace,": ",c,"px"]}),(0,t.jsx)(s.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":o.exam.decreaseAnswerSpace,disabled:c<=r.r,onClick:()=>i((0,r.O)(c-r.W)),children:"-"}),(0,t.jsx)("input",{type:"range",min:r.r,max:r.R,step:10,value:c,"aria-label":o.exam.questionAnswerSpaceSlider,onChange:e=>i((0,r.O)(Number(e.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,t.jsx)(s.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":o.exam.increaseAnswerSpace,disabled:c>=r.R,onClick:()=>i((0,r.O)(c+r.W)),children:"+"}),a&&(0,t.jsx)(s.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:l,children:o.exam.resetQuestionAnswerSpace})]})}],84583);var a=e.i(271645),i=e.i(511445),l=e.i(369939);let o=["A","B","C","D"];function c(e){return RegExp(`^(?:${e}\\s*[..::、]|[((]${e}[))])`)}function m(e){let t=e.replace(/\$+/g,"").replace(/\\[a-zA-Z]+/g,"").replace(/[{}^_\\]/g,""),s=0;for(let e of t)s+=e.codePointAt(0)>=11904?2:1;return s}let u={4:"grid-cols-2 sm:grid-cols-4 print:grid-cols-4",2:"grid-cols-1 sm:grid-cols-2 print:grid-cols-2",1:"grid-cols-1"};e.s(["f",0,function({content:e}){let s=(0,a.useMemo)(()=>(function(e){if(!e)return null;let{masked:t,segments:s}=(0,l.F)(e.replace(/\\n/g,"\n")),n=(0,l.n)(t,"\n").split("\n"),r=n.findIndex(e=>c("A").test(e.trim()));if(r<0)return null;let a=[],i=0,u=r;for(let e=r;e<n.length&&i<o.length;e+=1){let t=n[e].trim();if(!t)continue;if(!c(o[i]).test(t))break;let s=function(e,t){let s=[],n=e,r=t;for(;r<o.length;){var a;let e=n.match(c(o[r]))[0];n=n.slice(e.length);let t=r+1<o.length?n.match((a=o[r+1],RegExp(`\\s(?:${a}\\s*[..::、]|[((]${a}[))])`))):null,i=t?.index??n.length;if(s.push({label:e.trim(),content:n.slice(0,i).trim()}),r+=1,!t)break;n=n.slice(i).trimStart()}return{options:s,next:r}}(t,i);a.push(...s.options),i=s.next,u=e+1}if(a.length<3||u-r<2)return null;let d=n.slice(u).join("\n").trim();if(i<o.length&&d)return null;let p=e=>(0,l.i)(e,s),x=a.map(e=>({label:e.label,content:p(e.content)}));return{stem:p(n.slice(0,r).join("\n").trim()),options:x,after:p(d),columns:function(e){if(e.some(({content:e})=>/!\[|\|/.test(e)))return 1;let t=Math.max(...e.map(({label:e,content:t})=>m(e)+1+m(t)));return t<=14?4:t<=34?2:1}(x)}})(e),[e]);return s?(0,t.jsxs)(t.Fragment,{children:[s.stem&&(0,t.jsx)(i.f,{content:s.stem}),(0,t.jsx)("div",{className:`choice-options mb-3 grid gap-x-6 gap-y-1 ${u[s.columns]}`,children:s.options.map(e=>(0,t.jsxs)("div",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0",children:e.label}),(0,t.jsx)(i.f,{content:e.content,className:"flex-1 [&_p]:mb-0"})]},e.label))}),s.after&&(0,t.jsx)(i.f,{content:s.after})]}):(0,t.jsx)(i.f,{content:e})}],920808)},149704,e=>{var t=e.i(843476),s=e.i(111110),n=e.i(398019),r=e.i(184110),a=e.i(975157);let i={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:c}){let{t:m}=(0,s.b)();if(!e)return null;let u=(0,r.V)(l),d=(0,r.o)(o);return(0,t.jsx)("figure",{className:(0,a.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,n.d)(e),alt:m.figure.alt,className:(0,a.f)(i[d],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===d?{marginLeft:0,marginRight:"auto"}:"right"===d?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},590546,e=>{var t=e.i(843476),s=e.i(618566),n=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:a}){let i=(0,s.useRouter)();return(0,t.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:a,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},469817,e=>{e.s(["$",0,18,"u",0,5,"A",0,200])},122330,e=>{let t=["auto","none","small","medium","large"],s={none:0,small:60,medium:120,large:240},n={choice:12,judgment:12,fill:16,solution:240};function r(e){return Number.isFinite(e)?Math.min(600,Math.max(0,Math.round(e))):0}let a=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,i=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,l=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,o=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,c=/(\s*(\d{1,2})\s*)/g,m=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function u(e){let t=new Set;for(let s of e.matchAll(c))t.add(s[1]);for(let s of e.matchAll(m))t.add(s[1]);return Math.max(1,t.size)}e.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,r,"I",0,function(e){return"string"==typeof e&&t.includes(e)},"T",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<0||e>600?null:e},"z",0,function(e,t,c){let m;if("number"==typeof c&&Number.isFinite(c))return r(c);if("auto"!==e)return s[e];let d=(m=new Set(Array.from(t.matchAll(a),e=>e[1]??e[2]??e[3]))).has("A")&&m.has("B")&&m.has("C")?"choice":i.test(t)?"judgment":u(t)>1||o.test(t)?"solution":l.test(t)?"fill":"solution";if("solution"!==d)return n[d];let p=(u(t)-1)*120;return Math.min(560,n.solution+p)}])},184110,e=>{let t=["left","center","right"],s="center";function n(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,s,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,n,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:s},"V",0,function(e){return n(e)?e:100}])},398019,e=>{let t=/<([a-zA-Z][\w:.-]*)((?:\s+[^\s=>/"']+\s*=\s*(?:"[^"]*"|'[^']*'))+)\s*(\/?)>/g,s=/([^\s=>/"']+)\s*=\s*("[^"]*"|'[^']*')/g;e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.replace(t,(e,t,n,r)=>{let a=[...n.matchAll(s)].map(([,e,t])=>({key:e,value:t})),i=new Map;for(let{key:e}of a)i.set(e,(i.get(e)??0)+1);if(![...i.values()].some(e=>e>1))return e;let l=r?"/>":">",o=new Map;for(let{key:e,value:t}of a)o.has(e)||o.set(e,t);let c=e=>e.slice(1,-1).trim(),m=a.filter(e=>"x2"===e.key).map(e=>c(e.value)),u=a.filter(e=>"y2"===e.key).map(e=>c(e.value));if("line"===t.toLowerCase()&&m.length>1&&m.length===u.length&&o.has("x1")&&o.has("y1")){let e=[`${c(o.get("x1"))},${c(o.get("y1"))}`,...m.map((e,t)=>`${e},${u[t]}`)],t=[...o].filter(([e])=>!["x1","y1","x2","y2","fill"].includes(e)),s=[`points="${e.join(" ")}"`,'fill="none"',...t.map(([e,t])=>`${e}=${t}`)];return`<polyline ${s.join(" ")}${l}`}return`<${t} ${[...o].map(([e,t])=>`${e}=${t}`).join(" ")}${l}`}))}`}])},442861,e=>{var t=e.i(271645),s=e.i(122330),n=e.i(201276);e.s(["f",0,function(e,r){let[a,i]=(0,t.useState)({}),[l,o]=(0,t.useState)(!1),c=(0,t.useRef)(new Map),m=(0,t.useRef)(null),u=(0,t.useRef)(r);(0,t.useEffect)(()=>{u.current=r},[r]);let d=(0,t.useMemo)(()=>{let t={};for(let n of e){let e=n.id in a?a[n.id]:(0,s.T)(n.answerSpacePx);"number"==typeof e&&(t[n.id]=e)}return t},[e,a]),p=(0,t.useCallback)(()=>{if(m.current&&(clearTimeout(m.current),m.current=null),0===c.current.size)return;let e=Array.from(c.current,([e,t])=>({id:e,answerSpacePx:t}));c.current.clear(),u.current(e).then(()=>o(!1)).catch(e=>{o(!0),n.V.error("[AnswerSpace]","Failed to save answer space",{error:e})})},[]);(0,t.useEffect)(()=>p,[p]);let x=(0,t.useCallback)((e,t)=>{if(0!==e.length){for(let{id:t,answerSpacePx:s}of(i(t=>{let s={...t};for(let{id:t,answerSpacePx:n}of e)s[t]=n;return s}),e))c.current.set(t,s);if(t)return void p();m.current&&clearTimeout(m.current),m.current=setTimeout(p,600)}},[p]),h=(0,t.useCallback)((e,t)=>{x([{id:e,answerSpacePx:t}],null===t)},[x]),f=(0,t.useCallback)(()=>{x(Object.keys(d).map(e=>({id:e,answerSpacePx:null})),!0)},[d,x]);return{customSpaces:d,setSpace:h,resetAll:f,saveFailed:l}}])},35209,e=>{var t=e.i(271645),s=e.i(111110);e.s(["f",0,function(...e){let{t:n}=(0,s.b)(),r=[n.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}])})();
|