wrong-notebook 2026.11.4-2 → 2026.11.4-3
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/build-manifest.json +3 -3
- 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 +8 -6
- package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/dashboard/route.js +14 -13
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/export/route.js +7 -6
- 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 +6 -5
- package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js +5 -3
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/system-reset/route.js +5 -5
- package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/detail/route.js +14 -13
- 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 +7 -5
- package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/route.js +8 -7
- package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +14 -13
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +15 -13
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +16 -16
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +18 -17
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/delete/route.js +5 -5
- 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 -12
- 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 +14 -13
- 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 +20 -18
- 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 +6 -5
- 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 +8 -5
- 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 +5 -4
- 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 +16 -14
- 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 +19 -18
- 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 +9 -6
- 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 +16 -14
- 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 +16 -14
- 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 +6 -6
- 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 +8 -5
- package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/clear/route.js +5 -5
- package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/list/route.js +8 -8
- 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 +5 -4
- 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 +4 -3
- package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +18 -17
- 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 +17 -17
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +17 -17
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +18 -17
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +17 -17
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +9 -8
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +17 -16
- 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 +23 -22
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +25 -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 +19 -19
- 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 +24 -23
- 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 +25 -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 +24 -23
- 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 +24 -23
- package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/route.js +24 -23
- package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js +23 -22
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/read/route.js +23 -22
- 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 +24 -23
- 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 +23 -22
- package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/route.js +24 -23
- package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/initialize/route.js +1 -1
- package/.next/server/app/api/initialize/route.js.nft.json +1 -1
- package/.next/server/app/api/logs/frontend/route.js +6 -4
- package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js +6 -5
- package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/login/route.js +6 -5
- package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/route.js +7 -6
- package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +16 -16
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/route.js +8 -4
- package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/route.js +8 -6
- package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +19 -18
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/[id]/route.js +5 -4
- package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/route.js +4 -3
- package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +18 -17
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +14 -13
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +15 -14
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +17 -16
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +18 -17
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js +5 -5
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/register/status/route.js +5 -5
- package/.next/server/app/api/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/requests/[id]/route.js +5 -4
- package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +15 -14
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +8 -7
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js +7 -6
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/activity/route.js +7 -6
- package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js +5 -5
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js +7 -6
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/repeated-mistakes/route.js +16 -16
- package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/weak-tags/route.js +16 -16
- package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/route.js +7 -4
- package/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/stats/route.js +1 -1
- package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js +5 -4
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/[id]/route.js +9 -8
- package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js +10 -9
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/route.js +9 -8
- package/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/status/route.js +9 -9
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +15 -15
- 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/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/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/chunks/[externals]__1j5vgk-wr4vpe._.js +3 -0
- package/.next/server/chunks/[externals]_fs_0pplqgcyv2l7l._.js +3 -0
- package/.next/server/chunks/[externals]_fs_1d5jh8vp8y6zt._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__05tyrbfzivoeq._.js → [root-of-the-server]__0-5ex-1jwf2so._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__01-14hxale6jz._.js → [root-of-the-server]__000xbr1s0pxwr._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__00_59ioz3-clx._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__00cl_lnn-40t3._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__01rm65xnqj0z-._.js → [root-of-the-server]__00cvwb7xtihiy._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__00g0do0mkiaol._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__02nbzp-n9g9_o._.js → [root-of-the-server]__00u81uwtn433h._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__09pkxauucdf_0._.js → [root-of-the-server]__02osgjesv2sc1._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0z0knsep33lsx._.js → [root-of-the-server]__02rd5j6up78m2._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__02t-_4nuz92ls._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0384w26qgo9xm._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__04ofq5esp33on._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__04rit3x7n87ku._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__006u92h_madgn._.js → [root-of-the-server]__05d81asaxsts8._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__06dvthqk5vh87._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0n5l60oyv1n-1._.js → [root-of-the-server]__06i2kswg2zb80._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1eu_g0k_nr3i-._.js → [root-of-the-server]__0702vmlo8jrsa._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__075pb7_pb654o._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0k4cyyyh6z6_p._.js → [root-of-the-server]__08wi504al-t3f._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0bmczgpuggwki._.js → [root-of-the-server]__0_gf1ay3sa41e._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0_zz_zj6cp7hy._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0bgi7pc7dogwe._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0cjj_9c_1d-eb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0d315c1v02ny0._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0eba9rni-2_tw._.js → [root-of-the-server]__0dyqmjzl1b_1f._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0ehph__dmu6pf._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0evv12a34qcy6._.js +27 -0
- package/.next/server/chunks/[root-of-the-server]__0fdvaccw9slrb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0fr_y2a0149cd._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0fscx2v333vm8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0g9zoc0653-fw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0h-qm7nop9330._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0hcbw1sliw973._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0hsl0y0knqi-1._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__029n0r2v92pcc._.js → [root-of-the-server]__0htnw-q6r_ple._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0lqv0n5j2fg24._.js → [root-of-the-server]__0i3k26mx8ndsy._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0ifmgp3wd_za_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0joi1yae2ehm4._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0imuc7gi1ii-e._.js → [root-of-the-server]__0k0dc64mmh6m3._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0kehix4ojdnhw._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0l104gjwyuf1b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0l5ybk_p285gl._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0lgbdth9-z6qg._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0lm6l50r5n5di._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0lsvd81f6kf59._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0oh43a4yzv1os._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0si2-m5an9zl7._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0svdqovwfpro2._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0fx0s5_6sjw-d._.js → [root-of-the-server]__0tn4z733mbm06._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0torie7kq-_7m._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0tvp4sm4zx3wt._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0geynfn2xmdle._.js → [root-of-the-server]__0tzkw11a1tdju._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0uhfq-cs0r44u._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0unr-g_-8kx90._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0v6kysx0rq-1m._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vrag-4p6eznc._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vrs8pd3vzslw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0wfpx1grz3ds6._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0x-02x70-ewqa._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ya2x1q-h3scx._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0zhm5smhb-gdm._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0zmnn5ww2etgw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__10_9ca38kz5au._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1kiolpvl5u4e-._.js → [root-of-the-server]__10gw_yrtllol4._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__11d2q9o0f28s0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__11oto6h82pnhn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__12wn_ef3w7f8l._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__132-2tja1hzjw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__13aq01o_yamyz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__13x167nrb3y6w._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1438_x9vkg2ow._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__14qqa5fifm2rn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__16jaf2eom1mlc._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__16pezaw35f9j1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__16qwprn5u6gjt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__176zyagwjex4i._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__180yz6lfwyg1x._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__197qvpegys2sj._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__19cfobnhf4rgh._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__19r0-5tk-zh9i._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1_sr40zcjsx6y._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1c_nbrrytj02e._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1dgb5al4upb9v._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1dkmclmcfr_o2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1e8_j43j1t1m3._.js +27 -0
- package/.next/server/chunks/[root-of-the-server]__1fmsngpmgt-p-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1frkpeaqco77c._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1gfpzuz6qe78x._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1gvappei6o8kd._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1h0tye6lfskvl._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hc_s6bb3tqn2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hy_enkxk2q7n._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1icr5yq0kmxsk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1j92hfszx6_cs._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1jd9zchusdb14._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1jey4pj050ie1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ji7iwt_w00lv._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1okwln3g2ifvb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1oy49h1nfcsne._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1p4_cgasfcy73._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1s21nmek1dpsc._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1sk7ctcxmkco3._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1sl3foar6w087._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ui10_ypv4qrw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1v5o1ch2vz7iw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1vm13gnfyoh6u._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1vrtsz6125q__._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1wnuzqkneu1ws._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1xv0q7bppzr-w._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1yzqi7jexvvzc._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1zq5g6-uodrek._.js +3 -0
- package/.next/server/chunks/_0-ne-bwuvd_6w._.js +1 -1
- package/.next/server/chunks/_011-ll5i30j2e._.js +1 -1
- package/.next/server/chunks/_01bayc6kg7upi._.js +1 -1
- package/.next/server/chunks/_029zt0rilrwvt._.js +1 -1
- package/.next/server/chunks/_03ovgh1-4xf3f._.js +1 -1
- package/.next/server/chunks/_03wxfgqq6wpf_._.js +3 -0
- package/.next/server/chunks/_0431fxnqiloso._.js +1 -1
- package/.next/server/chunks/_05ans30vcd4s-._.js +1 -1
- package/.next/server/chunks/{_04rjm4ctjqrba._.js → _06pseal2zu-71._.js} +2 -2
- package/.next/server/chunks/_076-jjzrfdsdk._.js +1 -1
- package/.next/server/chunks/_07amw8ha9rney._.js +1 -1
- package/.next/server/chunks/_0819wmh2_bgt-._.js +3 -0
- package/.next/server/chunks/{_1fki7pamd4s-7._.js → _087uva8dkvxwz._.js} +2 -2
- package/.next/server/chunks/_08i9pskmlafnp._.js +1 -1
- package/.next/server/chunks/_09o9zamz75n5d._.js +1 -1
- package/.next/server/chunks/_0_3_65z6ak-5i._.js +1 -1
- package/.next/server/chunks/_0_5s2mrhxb3-u._.js +3 -0
- package/.next/server/chunks/_0_e736ff6uhew._.js +1 -1
- package/.next/server/chunks/_0anbzuivml30d._.js +1 -1
- package/.next/server/chunks/{_0edfmbz_jbxsu._.js → _0b9gke5b17vzh._.js} +2 -2
- package/.next/server/chunks/_0d66myj_8567o._.js +1 -1
- package/.next/server/chunks/_0gxi3zrkhyvx_._.js +1 -1
- package/.next/server/chunks/_0h1rbua_hqkox._.js +1 -1
- package/.next/server/chunks/_0hk9z9rqga4x-._.js +1 -1
- package/.next/server/chunks/_0kjatc7pcrkvz._.js +1 -1
- package/.next/server/chunks/_0kreo-8xn80hb._.js +1 -1
- package/.next/server/chunks/_0l2j3br2g32zp._.js +1 -1
- package/.next/server/chunks/_0lepv-j_r8kfv._.js +3 -0
- package/.next/server/chunks/_0lmh33cdt_1fr._.js +1 -1
- package/.next/server/chunks/_0lob14xk0ko5z._.js +1 -1
- package/.next/server/chunks/_0mt2ctbvzfero._.js +1 -1
- package/.next/server/chunks/_0p-sas2zxy3iv._.js +1 -1
- package/.next/server/chunks/_0po48rvqz03dg._.js +1 -1
- package/.next/server/chunks/_0pzdohc1mz5ts._.js +1 -1
- package/.next/server/chunks/_0qaoat396e0_3._.js +1 -1
- package/.next/server/chunks/_0r8u30vd4lix4._.js +3 -0
- package/.next/server/chunks/_0r9ejvgz0l0-0._.js +1 -1
- package/.next/server/chunks/_0rnn090b4_3pb._.js +3 -0
- package/.next/server/chunks/_0suqhfy3e5sv6._.js +1 -1
- package/.next/server/chunks/{_03dn7v_h3d-v8._.js → _0tkov27xr068i._.js} +8 -7
- package/.next/server/chunks/_0tl0cy5j96d7h._.js +1 -1
- package/.next/server/chunks/_0tz5wpjdgntj3._.js +1 -1
- package/.next/server/chunks/_0wegi_sv1s4wx._.js +1 -1
- package/.next/server/chunks/_0xv7-7d6dyo9-._.js +1 -1
- package/.next/server/chunks/_0xx4y9tk1qclc._.js +1 -1
- package/.next/server/chunks/_0zs7jfzzshbfq._.js +1 -1
- package/.next/server/chunks/_11w6ynlxuzl55._.js +1 -1
- package/.next/server/chunks/_12fz_vwm9jemi._.js +3 -0
- package/.next/server/chunks/_12i51zlq-xxrl._.js +1 -1
- package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
- package/.next/server/chunks/_12xi_xqvtrn3k._.js +3 -0
- package/.next/server/chunks/_13ffmxv8qrwi0._.js +1 -1
- package/.next/server/chunks/_14w9nrdlajz24._.js +1 -1
- package/.next/server/chunks/_15fpgekhvv214._.js +1 -1
- package/.next/server/chunks/{_043-r529chcri._.js → _1638xaazsmf2m._.js} +8 -7
- package/.next/server/chunks/_1647rfjflw_iq._.js +1 -1
- package/.next/server/chunks/_1654ui1ph-3x8._.js +3 -0
- package/.next/server/chunks/_16jdov0rxh99d._.js +1 -1
- package/.next/server/chunks/_17zw8m241gfs3._.js +1 -1
- package/.next/server/chunks/_18amra5328v90._.js +1 -1
- package/.next/server/chunks/_18hm5aaxkr500._.js +1 -1
- package/.next/server/chunks/_1_273cgnpyl9j._.js +1 -1
- package/.next/server/chunks/_1a1aqmie1d3u_._.js +1 -1
- package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
- package/.next/server/chunks/_1ab7h8-how0le._.js +3 -0
- package/.next/server/chunks/_1ahefh9733vmk._.js +3 -0
- package/.next/server/chunks/_1ahi8466v1b3l._.js +1 -1
- package/.next/server/chunks/_1almac7c09mp4._.js +3 -0
- package/.next/server/chunks/_1b-7g4thtxfnp._.js +3 -0
- package/.next/server/chunks/_1b0269xt-c8f7._.js +1 -1
- package/.next/server/chunks/_1b7qjlv0nxovi._.js +1 -1
- package/.next/server/chunks/_1be-y660a8z-q._.js +1 -1
- package/.next/server/chunks/_1cydcmia78z15._.js +1 -1
- package/.next/server/chunks/_1e8w9uuebtrcb._.js +1 -1
- package/.next/server/chunks/_1ev3hw7jrpp8r._.js +3 -0
- package/.next/server/chunks/_1ex6ovo_j2jzv._.js +1 -1
- package/.next/server/chunks/_1gdet1v2zk2gy._.js +1 -1
- package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
- package/.next/server/chunks/_1hp9mnz19v199._.js +1 -1
- package/.next/server/chunks/_1j10upti9l6da._.js +1 -1
- package/.next/server/chunks/_1j8kqz21_i728._.js +1 -1
- package/.next/server/chunks/_1muwmr6j76v3m._.js +1 -1
- package/.next/server/chunks/_1pvqo-qnv-nqm._.js +1 -1
- package/.next/server/chunks/_1q65ai1_dwgjp._.js +1 -1
- package/.next/server/chunks/_1s5-ldt8xhtpp._.js +1 -1
- package/.next/server/chunks/_1s55l1bx-1cxp._.js +1 -1
- package/.next/server/chunks/_1sp0xk1c5jx5r._.js +1 -1
- package/.next/server/chunks/_1srq5kxah38r6._.js +1 -1
- package/.next/server/chunks/_1t632kndbc0tj._.js +3 -0
- package/.next/server/chunks/_1tahh9ric8la3._.js +1 -1
- package/.next/server/chunks/_1tvl0cm629nyc._.js +1 -1
- package/.next/server/chunks/_1u6r2cuueltfn._.js +3 -0
- package/.next/server/chunks/{_1-6i59jd1zhly._.js → _1vddun9dxzaqo._.js} +8 -7
- package/.next/server/chunks/_1xpj9uk-9zhl8._.js +1 -1
- package/.next/server/chunks/_1z_ujac_e_65s._.js +1 -1
- package/.next/server/chunks/_1zbkha-v5mkk0._.js +3 -0
- package/.next/server/chunks/_1zvf_gki7-g0n._.js +1 -1
- package/.next/server/chunks/{_0r0hnbjdq-k9-._.js → _20snsd6f1xc63._.js} +2 -2
- package/.next/server/chunks/_20tjujotvor53._.js +1 -1
- package/.next/server/chunks/node_modules_@anthropic-ai_sdk_1ulo822751toa._.js +3 -0
- package/.next/server/chunks/node_modules_zod_v4_classic_external_0qoqh-q5drsgn.js +4 -4
- package/.next/server/chunks/node_modules_zod_v4_classic_external_14kwlambv9opd.js +3 -0
- package/.next/server/chunks/node_modules_zod_v4_classic_external_17gmk506tz413.js +3 -0
- package/.next/server/chunks/node_modules_zod_v4_classic_external_1exeae-p81c94.js +3 -0
- package/.next/server/chunks/node_modules_zod_v4_classic_external_1giv406od1whf.js +3 -0
- package/.next/server/chunks/node_modules_zod_v4_classic_external_1wq100x5o7-hi.js +3 -0
- package/.next/server/chunks/node_modules_zod_v4_classic_external_1x8fhte3frhrw.js +3 -0
- package/.next/server/chunks/src_lib_0cmg152v4yi6o._.js +3 -0
- package/.next/server/chunks/src_lib_0dxltm34zaclb._.js +3 -0
- package/.next/server/chunks/src_lib_0g4wu08m-gibu._.js +3 -0
- package/.next/server/chunks/src_lib_0l0j89xrerf8m._.js +3 -0
- package/.next/server/chunks/src_lib_0osgsup3n2ypg._.js +3 -0
- package/.next/server/chunks/src_lib_0so-2topfosjo._.js +3 -0
- package/.next/server/chunks/src_lib_0whd_w99i5vmm._.js +3 -0
- package/.next/server/chunks/src_lib_0zeksho3data7._.js +3 -0
- package/.next/server/chunks/src_lib_15op6xa369-51._.js +3 -0
- package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +131 -131
- package/.next/server/chunks/src_lib_1d0nldjpxxl8t._.js +3 -0
- package/.next/server/chunks/src_lib_1d99xj4d-pofa._.js +3 -0
- package/.next/server/chunks/src_lib_1v5vdsc8-zp2z._.js +3 -0
- package/.next/server/chunks/src_lib_ai_index_ts_0m0hlq4d9zy9i._.js +1 -1
- package/.next/server/chunks/{src_lib_exam_ts_0d3a4q4r41hcf._.js → src_lib_exam_exam_ts_18c3t7bnr1z5k._.js} +2 -2
- package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +3 -0
- package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +3 -0
- package/.next/server/chunks/src_lib_mastery-status_ts_0e9jnp-14tby5._.js +3 -0
- package/.next/server/chunks/src_lib_minimax-code_checkin_ts_1j1mpuxc1vgoz._.js +1 -1
- package/.next/server/chunks/src_lib_notebook-scope_ts_06eipvr6xztlf._.js +3 -0
- package/.next/server/chunks/src_lib_question_0uw17e6at-i_h._.js +3 -0
- package/.next/server/chunks/src_lib_question_question-analysis_ts_1-3x2cfxlr3fs._.js +3 -0
- package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +3 -0
- package/.next/server/chunks/src_lib_recoverable-response_ts_00y54idhlj_0e._.js +3 -0
- package/.next/server/chunks/src_lib_schemas_error-items_ts_0vdof4417rd3y._.js +3 -0
- package/.next/server/chunks/src_lib_short-id_0adg7-htn2dq_._.js +3 -0
- package/.next/server/chunks/src_lib_tags_retag_ts_09s5xwrzcy144._.js +3 -0
- package/.next/server/chunks/src_lib_tags_seed_1_ej3w-2450a0._.js +3 -0
- package/.next/server/chunks/src_lib_tts_19zri-v8-l_4u._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0sb3jhytba2xr._.js → [root-of-the-server]__01epe_65_8e8r._.js} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0ht0nkzazbnl9._.js → [root-of-the-server]__0iqnvufl6qrve._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0mqo18mv_ooyq._.js → [root-of-the-server]__0xjcdrflb40xr._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0x_ihemma9171._.js → [root-of-the-server]__0z7upqzuqtse6._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__03208_liub81h._.js → [root-of-the-server]__1babe6vdwxbtq._.js} +2 -2
- package/.next/server/chunks/ssr/_0gsk7ce3mjc-h._.js +3 -0
- package/.next/server/chunks/ssr/_0haie2cnycj6w._.js +32 -0
- package/.next/server/chunks/ssr/{_01qu892bisrf0._.js → _0j-r3zhz2ucmg._.js} +2 -2
- package/.next/server/chunks/ssr/{_0zacgi5-qgqwr._.js → _0mfy8kk0_omxw._.js} +1 -1
- package/.next/server/chunks/ssr/_0mvuvawj5-r--._.js +1 -1
- package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
- package/.next/server/chunks/ssr/_0svbyo-zufys9._.js +3 -0
- package/.next/server/chunks/ssr/{_186fwf-hcr_ua._.js → _101w__e2w9gr0._.js} +2 -2
- package/.next/server/chunks/ssr/_19hxsrrruepym._.js +1 -1
- package/.next/server/chunks/ssr/_1qgg_ll5hkjaf._.js +1 -1
- package/.next/server/chunks/ssr/{_1xv0q8o3g3r5d._.js → _1s3gqrczubor-._.js} +2 -2
- package/.next/server/chunks/ssr/{_1a4u3f5sc05kb._.js → _1th-xa6ci3ryc._.js} +2 -2
- package/.next/server/chunks/ssr/_1ux6eqqkupo6v._.js +1 -1
- package/.next/server/chunks/ssr/{_1pdnzaad7hk0d._.js → _1x_zn17exkc4t._.js} +2 -2
- package/.next/server/chunks/ssr/{_0w83jztp72o20._.js → _20593q3u-y025._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_02k42jp0_uoqr._.js → node_modules_16_nl7nawmp3n._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_0byqh-lbfcigr.js → node_modules_heic-to_dist_csp_heic-to_0i0ydbk94w-r3.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_19_dv9gdzg_e7.js → node_modules_heic-to_dist_csp_heic-to_1h62imz_ct0w_.js} +1 -1
- package/.next/server/chunks/ssr/src_0_qzoo_03n_v-._.js +3 -0
- package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
- package/.next/server/chunks/ssr/{src_0z149pjrheeb7._.js → src_1iewbwi2267a1._.js} +2 -2
- package/.next/server/chunks/ssr/{src_1jhctayt9gxoc._.js → src_1o5f_wr8vv-x0._.js} +2 -2
- package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
- package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +1 -1
- package/.next/server/chunks/ssr/src_app_exams_page_tsx_17_d4_gy2i1ds._.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_import-tasks_page_tsx_01983hytm-x08._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_[id]_add_page_tsx_179tow1ql6vc_._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.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 +1 -1
- 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 +2 -2
- 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_import-tasks_import-task-card_tsx_01r47qh8ryspb._.js +1 -1
- package/.next/server/chunks/ssr/src_components_print-preview_answer-space-control_tsx_02kuswyxklzp_._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +10 -10
- package/.next/server/chunks/ssr/{src_lib_1vv0-aje_e-zh._.js → src_lib_0773v8b5gb93o._.js} +2 -2
- package/.next/server/chunks/ssr/{src_lib_0-wirad5ziskp._.js → src_lib_1qhs590-z9xnh._.js} +2 -2
- package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +3 -0
- package/.next/server/chunks/ssr/src_lib_short-id_short-id-client_ts_03nnd3s0tat3l._.js +3 -0
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/{1pdlii0oox0-7.js → 037g92rz3qjm_.js} +1 -1
- package/.next/static/chunks/{2cfz0fumc6ghe.js → 045cs_rolnmjd.js} +1 -1
- package/.next/static/chunks/077y4nms_vzwe.js +1 -0
- package/.next/static/chunks/{1746y345zti-9.js → 0eize8lf2hp4i.js} +2 -2
- package/.next/static/chunks/{3tv07cyoo_hat.js → 0gxr8rcvy4zzg.js} +1 -1
- package/.next/static/chunks/0njrl9jn2yde_.js +1 -0
- package/.next/static/chunks/{02wft51kf3t9f.js → 0ovv_fq59i4y4.js} +1 -1
- package/.next/static/chunks/{1uaqnxl-xshw6.js → 0uay0bmznf3g-.js} +1 -1
- package/.next/static/chunks/{0wcwopwk4us6h.js → 0vlsab1wxbcnl.js} +2 -2
- package/.next/static/chunks/{31-r0kqqw-wfd.js → 0xwz3h9d_e7kb.js} +1 -1
- package/.next/static/chunks/{17-num1x7o1m2.js → 1-dh1gads_tda.js} +1 -1
- package/.next/static/chunks/{0_xcjg47jv3ur.js → 1-qu_z3i5b8ul.js} +1 -1
- package/.next/static/chunks/164mvykuvwd-0.js +1 -0
- package/.next/static/chunks/{3oz37kz8n7y3b.js → 18bumc8ezaiy4.js} +1 -1
- package/.next/static/chunks/{42rupczfyygo1.js → 1ado9no6s8r2t.js} +1 -1
- package/.next/static/chunks/{2r5aeenvfl93p.js → 1j8eduwold2uf.js} +1 -1
- package/.next/static/chunks/{3fh32b9da9l_5.js → 1k2m_f0nu22fb.js} +1 -1
- package/.next/static/chunks/{3s_fq__cff-ps.js → 1pw6djqafgpo7.js} +2 -2
- package/.next/static/chunks/{2ebh36q8lvor_.js → 1xpxy-ja2ym0o.js} +1 -1
- package/.next/static/chunks/2jt0139jd2-i3.js +12 -0
- package/.next/static/chunks/2qjb14pd2n3x_.js +1 -0
- package/.next/static/chunks/2s6ae7khf13mi.js +12 -0
- package/.next/static/chunks/33fakli20_bmk.js +1 -0
- package/.next/static/chunks/{1egd1e1483_lj.js → 34dstd5pyqifj.js} +1 -1
- package/.next/static/chunks/{2924d0kl-68z7.js → 39lbv0arntrnf.js} +10 -10
- package/.next/static/chunks/3_w-p8241f5rv.js +1 -0
- package/.next/static/chunks/{3wch6vphcivq5.js → 3j92h-4k4_o_f.js} +1 -1
- package/.next/static/chunks/{4441xuc3i-yb7.js → 3rnbnqcge4lza.js} +1 -1
- package/.next/static/chunks/{2qqyq-iqkv_oa.js → 3snn9aaz5n95k.js} +2 -2
- package/.next/static/chunks/{1o_q928xcfjs3.js → 43btem6mtf_gh.js} +1 -1
- package/dist-scripts/scripts/rebuild-system-tags.js +11 -107
- package/dist-scripts/scripts/seed-chinese-primary.js +1 -1
- package/dist-scripts/src/lib/logger.js +1 -0
- package/dist-scripts/src/lib/tags/seed/rebuild.js +103 -0
- package/dist-scripts/src/lib/{seed-chinese-tags.js → tags/seed/seed-chinese-tags.js} +2 -1
- package/package.json +1 -1
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__012pau7crikop._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__01jc87mm42cex._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__01newhoirvvb2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__02oqd6w58wymi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__057qz9ucs7lib._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__06_pvs6rg70ri._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__06jad9cnzeci-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0_uvtfu0yr-na._.js +0 -27
- package/.next/server/chunks/[root-of-the-server]__0_vinl1oembls._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ahni9caaouya._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0aq01totjzgkp._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0b5mh_vi6e246._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0b5qyqwq6mk5v._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0b79cd6lae7ep._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0b_zf20owrv7l._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0cel4yig3zcho._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0cu5jz9b3f0i1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0d818ux928r5h._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0dclcdg0hwxxj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0e13o3ny66zb3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0fg20m1i6x4y9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0fhy87hr0_glw._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0fnte1x8xdn5o._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0glupa52ge074._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gphporvvjc0d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gs7-3gi0pdws._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0i2mt6zjxbq--._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ijq_d0gr5zo8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0iqp1f0-yvbhw._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0jk-9m6ra-_um._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0jvusk64khb-a._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0k0c90ih7n0te._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0maxg52nxqrzi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ml-m3il4unb6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0nkrql6or-tf_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0nujsu6qbn-8o._.js +0 -27
- package/.next/server/chunks/[root-of-the-server]__0ovdiut1h8kkt._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0p5_lv_pjxr5f._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0p8wlug4uvmvi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ptn9j1rleieh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0r7f34_38kmvk._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0u3m78xhq8b3l._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ualui9b50ufh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ujfft7untkmq._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0vw7u-y__gk7p._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0w53aflmo1keg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0wdjzoxwwh6bn._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0wx65sza19ou-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0xj_313186tqc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0yv_kznxz5qzn._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zldj8zxo-hvc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1-djdd7tnb-n7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__109pj952qxtan._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__10gp75p89v9a2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__111jxitdjhuoj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__112w8xm57okk5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__12h4ckd6f76pb._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__12ig6-5hpb7s-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__13_k7w8nrx7ie._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__14c50fhuh_abo._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__14jpfgwnpc9gl._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__14m8fewwq1xs6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__15qkqztuygnfg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__166997w1su5wq._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__16xl11-irmhu3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__19i64i9v32y8o._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__19jqc7tzna13p._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1asgy7sah0mo6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1av1l48rnghpa._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1azaa45m60iqm._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1d159cxbdta68._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1dmp3ynxbcyjz._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1dom1le7wqh7d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1e5tjfwab0exu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1f-7-l2abs15s._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1fe2v2mv5-rgo._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1fepss7g57apj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ff3h7ockrpdf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1g11271g0z55n._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1g6jrwm72xr8a._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1he8kk4382-0h._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1hk5kgctlp2wn._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1j44_t992y-1-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1k4f33-z95_7c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1k4pnhbw4rgzs._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1kx3a0dm7l2wl._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1lea5m7hl1n7f._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1m7pja8jp27eh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1m_y4afrn94oy._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ruzcenko2gi1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1sf2oa2wkqf_0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1t6aypqxgjkg_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1tffqae521gxo._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1to25zgnk7xk-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1u5c7agj_phnb._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1vbof6uu4he_-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1wfhdwfdvc6j3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1y0n2tg-0l636._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1zc0bmdyn1lg4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1zqfz2rc4i280._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__207c97dbcdb0z._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20cdqectwle3j._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20dy4zclqbnw8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__212aaltyh6kc2._.js +0 -3
- package/.next/server/chunks/_01y7-j4vx6cu5._.js +0 -3
- package/.next/server/chunks/_0_rhee7wb6tcg._.js +0 -3
- package/.next/server/chunks/_0at03z7sgwdv3._.js +0 -3
- package/.next/server/chunks/_0ge95_bkwrkmc._.js +0 -3
- package/.next/server/chunks/_0lj59y-ytysr5._.js +0 -3
- package/.next/server/chunks/_0v762_h-sp94d._.js +0 -3
- package/.next/server/chunks/_0vshwghrjetxu._.js +0 -3
- package/.next/server/chunks/_0z0zrluul2idw._.js +0 -3
- package/.next/server/chunks/_1a1oatugfke1p._.js +0 -3
- package/.next/server/chunks/_1fgb9ve_nfat4._.js +0 -3
- package/.next/server/chunks/_1fsfy4c3rj36b._.js +0 -3
- package/.next/server/chunks/_1hc_es1a3cl6a._.js +0 -3
- package/.next/server/chunks/_1m-yyz-pl9-03._.js +0 -3
- package/.next/server/chunks/_1ns6y6y2tq8sh._.js +0 -3
- package/.next/server/chunks/_1yujnc0thk8ab._.js +0 -3
- package/.next/server/chunks/_211va-dk9519v._.js +0 -3
- package/.next/server/chunks/src_lib_0_g_0q-n01g-x._.js +0 -3
- package/.next/server/chunks/src_lib_0au5a9-5rxkab._.js +0 -3
- package/.next/server/chunks/src_lib_0d7kmnt7v2np8._.js +0 -3
- package/.next/server/chunks/src_lib_0fedb0fkc3km1._.js +0 -3
- package/.next/server/chunks/src_lib_0okewfjk6p2ci._.js +0 -3
- package/.next/server/chunks/src_lib_0ptvn4_15zxu0._.js +0 -3
- package/.next/server/chunks/src_lib_0rb6u4i7kn30r._.js +0 -3
- package/.next/server/chunks/src_lib_0svj7bkzyw9oc._.js +0 -3
- package/.next/server/chunks/src_lib_10is5pyogge95._.js +0 -3
- package/.next/server/chunks/src_lib_12j7n__96zd0q._.js +0 -3
- package/.next/server/chunks/src_lib_13hd5uoi-53hn._.js +0 -3
- package/.next/server/chunks/src_lib_1chbt4n9_vpoj._.js +0 -3
- package/.next/server/chunks/src_lib_1geq39r7va9gy._.js +0 -3
- package/.next/server/chunks/src_lib_1h4xeb9lyx31r._.js +0 -3
- package/.next/server/chunks/src_lib_1qvj-3jt4jbq7._.js +0 -3
- package/.next/server/chunks/src_lib_1smlosz37xitx._.js +0 -3
- package/.next/server/chunks/src_lib_1squodf4swo_a._.js +0 -3
- package/.next/server/chunks/src_lib_1uei_xjjj3g7_._.js +0 -3
- package/.next/server/chunks/src_lib_1vt5vsj108u_q._.js +0 -3
- package/.next/server/chunks/src_lib_api-errors_ts_1gfd4ojz7efro._.js +0 -3
- package/.next/server/chunks/src_lib_figure-scale_ts_215n0ebzz7mr7._.js +0 -3
- package/.next/server/chunks/src_lib_import-batches_ts_0aekmggdwo_9-._.js +0 -3
- package/.next/server/chunks/src_lib_import-tasks_ts_1f4ejsy00-v1t._.js +0 -3
- package/.next/server/chunks/src_lib_question-analysis_ts_15_8r_pxmtd06._.js +0 -3
- package/.next/server/chunks/src_lib_question-deduplication_ts_1p1bik-vwl9ue._.js +0 -3
- package/.next/server/chunks/src_lib_retag_ts_0eu8ld_86kt3a._.js +0 -3
- package/.next/server/chunks/ssr/_01rfvhncgnpvl._.js +0 -3
- package/.next/server/chunks/ssr/_11820i-k62560._.js +0 -3
- package/.next/server/chunks/ssr/_1ujx-n3muyaxs._.js +0 -32
- package/.next/server/chunks/ssr/src_1vhiktxz2_jj3._.js +0 -3
- package/.next/server/chunks/ssr/src_lib_short-id-client_ts_1v7n6pg50kguj._.js +0 -3
- package/.next/static/chunks/0-hqh6zs3hidn.js +0 -12
- package/.next/static/chunks/02xikk3wlibg1.js +0 -1
- package/.next/static/chunks/0e6ximjg-pqgt.js +0 -1
- package/.next/static/chunks/0y5zywo-ll2w3.js +0 -1
- package/.next/static/chunks/17dk_oppf9-hv.js +0 -12
- package/.next/static/chunks/38vt_4ntvy02e.js +0 -1
- /package/.next/static/{E10D9dv115hLNvX7vE6qA → P3mJPGERki1060-s7tC9h}/_buildManifest.js +0 -0
- /package/.next/static/{E10D9dv115hLNvX7vE6qA → P3mJPGERki1060-s7tC9h}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{E10D9dv115hLNvX7vE6qA → P3mJPGERki1060-s7tC9h}/_ssgManifest.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/biology.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/chemistry.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/chinese.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/english.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/geography.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/history.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/index.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/math-gaosi.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/math.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/physics.js +0 -0
- /package/dist-scripts/src/lib/{tag-data → tags/data}/politics.js +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1661,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(111110),r=e.i(217255),i=e.i(41931),n=e.i(303163),l=e.i(201276);let c=["system","light","dark"],o="system",d="app-theme";function m(e){return"string"==typeof e&&c.includes(e)}let u=(0,s.createContext)({preference:o,theme:"light",setPreference:()=>void 0}),p="(prefers-color-scheme: dark)",h=new Set;function x(e){return h.add(e),window.addEventListener("storage",e),()=>{h.delete(e),window.removeEventListener("storage",e)}}function g(){try{let e=localStorage.getItem(d);return m(e)?e:o}catch{return o}}function f(e){try{localStorage.setItem(d,e)}catch{}h.forEach(e=>e())}function j(e){let t=window.matchMedia(p);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}let v=()=>window.matchMedia(p).matches;function b({children:e}){let{data:a,status:c}=(0,r.useSession)(),d="authenticated"===c,p=a?.user?.email,h=(0,s.useSyncExternalStore)(x,g,()=>o),y=(0,s.useSyncExternalStore)(j,v,()=>!1),w="system"===h?y?"dark":"light":h;(0,s.useEffect)(()=>{let e=document.documentElement,t=t=>{e.classList.toggle("dark","dark"===t),e.style.colorScheme=t};t(w);let s=()=>t("light"),a=()=>t(w);return window.addEventListener("beforeprint",s),window.addEventListener("afterprint",a),()=>{window.removeEventListener("beforeprint",s),window.removeEventListener("afterprint",a)}},[w]),(0,s.useEffect)(()=>{if(!d||!p)return;let e=!1;return i.k.get("/api/user").then(t=>{!e&&m(t.themePreference)&&t.themePreference!==g()&&f(t.themePreference)}).catch(e=>{l.V.warn("[Theme]","Failed to load theme preference",{error:(0,n.Z)(e)})}),()=>{e=!0}},[d,p]);let k=(0,s.useCallback)(e=>{f(e),d&&i.k.patch("/api/user",{themePreference:e}).catch(e=>{l.V.warn("[Theme]","Failed to save theme preference",{error:(0,n.Z)(e)})})},[d]),N=(0,s.useMemo)(()=>({preference:h,theme:w,setPreference:k}),[h,w,k]);return(0,t.jsx)(u.Provider,{value:N,children:e})}var y=e.i(215519),w=e.i(325164),k=e.i(522016),N=e.i(618566),S=e.i(367784),C=e.i(456420);let T={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};T.node;let A=(0,C.f)(T);var E=e.i(632781),z=e.i(980105),M=e.i(294114),F=e.i(768339),_=e.i(975157);function D({className:e}){let{t:r}=(0,a.b)(),{data:i}=(0,F.b)(),n=(0,s.useRef)(null);if((0,s.useEffect)(()=>{if(!i)return;let e=new Set([...i.tasks.filter(e=>"analyzing"===e.status||"saving"===e.status).map(e=>e.id),...(i.batches??[]).filter(e=>"splitting"===e.phase||"processing"===e.phase).map(e=>`batch:${e.id}`)]),t=new Set([...i.tasks.filter(e=>e.unread).map(e=>e.id),...(i.batches??[]).filter(e=>e.unread).map(e=>`batch:${e.id}`)]),s=n.current;s&&[...s].some(s=>!e.has(s)&&t.has(s))&&M.c.info(r.importTasks.finishedToast),n.current=e},[i,r.importTasks.finishedToast]),!i||0===i.tasks.length&&!i.batches?.length)return null;let{activeCount:l,unreadCount:c}=i,o=l>0?r.importTasks.entryActive.replace("{count}",String(l)):r.importTasks.entry;return(0,t.jsxs)(k.default,{href:"/import-tasks",className:(0,_.f)("relative flex h-9 items-center gap-1.5 rounded-full border px-3 text-sm font-medium transition-colors hover:bg-muted",c>0?"border-primary/50 text-primary":"text-muted-foreground",e),"data-testid":"import-tasks-entry","aria-label":c>0?`${o} \xb7 ${r.importTasks.entryUnread.replace("{count}",String(c))}`:o,children:[l>0?(0,t.jsx)(E.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(z.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"whitespace-nowrap",children:o}),c>0&&(0,t.jsx)("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1 text-xs text-white","data-testid":"import-tasks-unread",children:c})]})}var L=e.i(853138),$=e.i(749803);let R={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};R.node;let I=(0,C.f)(R),G={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};G.node;let P=(0,C.f)(G);var q=e.i(999092);let V={name:"message-square-text",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]};V.node;let U=(0,C.f)(V),O={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};O.node;let H=(0,C.f)(O);var B=e.i(901279),K=e.i(994533),Y=e.i(519455),W=e.i(776639),Z=e.i(677572),J=e.i(306831),X=e.i(487486),Q=e.i(699375),ee=e.i(793479),et=e.i(110204);let es=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("div",{className:"relative w-full overflow-auto",children:(0,t.jsx)("table",{ref:a,className:(0,_.f)("w-full caption-bottom text-sm",e),...s})}));es.displayName="Table";let ea=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("thead",{ref:a,className:(0,_.f)("[&_tr]:border-b",e),...s}));ea.displayName="TableHeader";let er=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("tbody",{ref:a,className:(0,_.f)("[&_tr:last-child]:border-0",e),...s}));er.displayName="TableBody",(s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("tfoot",{ref:a,className:(0,_.f)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...s}))).displayName="TableFooter";let ei=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("tr",{ref:a,className:(0,_.f)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...s}));ei.displayName="TableRow";let en=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("th",{ref:a,className:(0,_.f)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...s}));en.displayName="TableHead";let el=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("td",{ref:a,className:(0,_.f)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...s}));el.displayName="TableCell",(s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("caption",{ref:a,className:(0,_.f)("mt-4 text-sm text-muted-foreground",e),...s}))).displayName="TableCaption";var ec=e.i(759659);let eo={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};eo.node;let ed=(0,C.f)(eo);var em=e.i(548161);function eu(){var e;let{t:r}=(0,a.b)(),[n,c]=(0,s.useState)(String(5)),[o,d]=(0,s.useState)(!1),m=(0,s.useCallback)(async()=>{try{let e=await i.k.get("/api/settings");c(String(e.aiConcurrencyLimit??5))}catch(e){l.V.error("[AiConcurrencyLimitSetting]","Failed to fetch config",{error:e})}},[]);(0,s.useEffect)(()=>{m()},[m]);let u=Number(n),p=""!==n.trim()&&"number"==typeof(e=u)&&Number.isInteger(e)&&e>=1&&e<=100,h=async()=>{if(p){d(!0);try{await i.k.post("/api/settings",{aiConcurrencyLimit:u}),M.c.success(r.admin.aiConcurrencyLimitSaved)}catch(e){l.V.error("[AiConcurrencyLimitSetting]","Failed to update AI concurrency limit",{error:e}),M.c.error(r.common.error)}finally{d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg bg-muted/30 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(et.f,{htmlFor:"ai-concurrency-limit",className:"text-base",children:r.admin.aiConcurrencyLimit}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r.admin.aiConcurrencyLimitDesc})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)(ee.f,{id:"ai-concurrency-limit",type:"number",min:1,max:100,step:1,inputMode:"numeric",value:n,onChange:e=>c(e.target.value),"aria-invalid":!p,className:"w-24"}),(0,t.jsxs)(Y.f,{size:"sm",onClick:h,disabled:o||!p,children:[o&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),r.common.save]})]})]})}function ep(){let{timeZone:e}=(0,y.M)(),{data:c}=(0,r.useSession)(),{t:o}=(0,a.b)(),[d,m]=(0,s.useState)([]),[u,p]=(0,s.useState)(!0),[h,x]=(0,s.useState)(!1),[g,f]=(0,s.useState)(!1),[j,v]=(0,s.useState)("0"),[b,w]=(0,s.useState)(!1),k=(0,s.useCallback)(async()=>{p(!0);try{let e=await i.k.get("/api/admin/users");m(e)}catch(e){l.V.error("[UserManagement]","Failed to fetch users",{error:e})}finally{p(!1)}},[]),N=(0,s.useCallback)(async()=>{try{let e=await i.k.get("/api/settings");x(!0===e.allowRegistration),v(String(e.aiDailyLimit??0))}catch(e){l.V.error("[UserManagement]","Failed to fetch config",{error:e})}},[]);(0,s.useEffect)(()=>{k(),N()},[k,N]);let S=async e=>{f(!0);try{await i.k.post("/api/settings",{allowRegistration:e}),x(e)}catch(e){l.V.error("[UserManagement]","Failed to update registration setting",{error:e}),M.c.error(o.common.error)}finally{f(!1)}},C=Number(j),T=""!==j.trim()&&Number.isInteger(C)&&C>=0,A=async()=>{if(T){w(!0);try{await i.k.post("/api/settings",{aiDailyLimit:C}),M.c.success(o.admin.aiDailyLimitSaved)}catch(e){l.V.error("[UserManagement]","Failed to update AI daily limit",{error:e}),M.c.error(o.common.error)}finally{w(!1)}}},z=async e=>{let t=e.isActive?o.admin.confirmDisable:o.admin.confirmEnable;if(await (0,M.u)(t))try{await i.k.patch(`/api/admin/users/${e.id}`,{isActive:!e.isActive}),k()}catch(e){l.V.error("[UserManagement]","Failed to update user status",{error:e}),M.c.error(o.common.error)}},F=async e=>{if(await (0,M.u)(o.admin.confirmDelete,{destructive:!0}))try{await i.k.delete(`/api/admin/users/${e.id}`),k()}catch(t){l.V.error("[UserManagement]","Failed to delete user",{error:t});let e=(0,n.d)(t)||o.common.error;M.c.error(e)}};return u?(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(E.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(et.f,{className:"text-base",children:o.admin?.allowRegistration||"Allow New Registrations"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:o.admin?.allowRegistrationDesc||"When disabled, new users cannot register"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[g&&(0,t.jsx)(E.f,{className:"h-4 w-4 animate-spin"}),(0,t.jsx)(Q.f,{checked:h,onCheckedChange:S,disabled:g})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg bg-muted/30 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(et.f,{htmlFor:"ai-daily-limit",className:"text-base",children:o.admin.aiDailyLimit}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:o.admin.aiDailyLimitDesc})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)(ee.f,{id:"ai-daily-limit",type:"number",min:0,step:1,inputMode:"numeric",value:j,onChange:e=>v(e.target.value),"aria-invalid":!T,className:"w-24"}),(0,t.jsxs)(Y.f,{size:"sm",onClick:A,disabled:b||!T,children:[b&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),o.common.save]})]})]}),(0,t.jsx)(eu,{}),(0,t.jsx)("div",{className:"sm:hidden space-y-3",children:d.map(s=>(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-card space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium",children:s.name||"N/A"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:s.email})]}),(0,t.jsx)(X.f,{variant:"admin"===s.role?"default":"secondary",children:"admin"===s.role?o.admin.admin:o.admin.user})]}),(0,t.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[o.admin.errors,": ",s._count.errorItems," | ",o.admin.practiceCount,": ",s._count.practiceRecords," | ",o.admin.aiUsageToday,": ",s.aiUsageToday]}),(0,t.jsx)(X.f,{variant:s.isActive?"default":"destructive",className:"text-xs",children:s.isActive?o.admin.active:o.admin.disabled})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center pt-2 border-t",children:[(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,J.r)(s.createdAt,"yyyy-MM-dd",e)}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>z(s),disabled:s.id===c?.user?.id,children:s.isActive?(0,t.jsx)(ed,{className:"h-4 w-4 text-orange-500"}):(0,t.jsx)(em.f,{className:"h-4 w-4 text-green-500"})}),(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>F(s),disabled:s.id===c?.user?.id,children:(0,t.jsx)(ec.f,{className:"h-4 w-4 text-destructive"})})]})]})]},s.id))}),(0,t.jsx)("div",{className:"hidden sm:block border rounded-lg overflow-hidden",children:(0,t.jsxs)(es,{children:[(0,t.jsx)(ea,{children:(0,t.jsxs)(ei,{children:[(0,t.jsx)(en,{children:o.admin.nameEmail}),(0,t.jsx)(en,{children:o.admin.role}),(0,t.jsx)(en,{children:o.admin.stats}),(0,t.jsx)(en,{children:o.admin.createdAt}),(0,t.jsx)(en,{children:o.admin.status}),(0,t.jsx)(en,{className:"text-right",children:o.admin.actions})]})}),(0,t.jsx)(er,{children:d.map(s=>(0,t.jsxs)(ei,{children:[(0,t.jsxs)(el,{children:[(0,t.jsx)("div",{className:"font-medium",children:s.name||"N/A"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:s.email})]}),(0,t.jsx)(el,{children:(0,t.jsx)(X.f,{variant:"admin"===s.role?"default":"secondary",children:"admin"===s.role?o.admin.admin:o.admin.user})}),(0,t.jsxs)(el,{children:[(0,t.jsxs)("div",{className:"text-sm",children:[o.admin.errors,": ",s._count.errorItems]}),(0,t.jsxs)("div",{className:"text-sm",children:[o.admin.practiceCount,": ",s._count.practiceRecords]}),(0,t.jsxs)("div",{className:"text-sm",children:[o.admin.aiUsageToday,": ",s.aiUsageToday]})]}),(0,t.jsx)(el,{children:(0,J.r)(s.createdAt,"yyyy-MM-dd",e)}),(0,t.jsx)(el,{children:(0,t.jsx)(X.f,{variant:s.isActive?"default":"destructive",children:s.isActive?o.admin.active:o.admin.disabled})}),(0,t.jsxs)(el,{className:"text-right space-x-2",children:[(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>z(s),disabled:s.id===c?.user?.id,title:s.isActive?o.admin.disable:o.admin.enable,children:s.isActive?(0,t.jsx)(ed,{className:"h-4 w-4 text-orange-500"}):(0,t.jsx)(em.f,{className:"h-4 w-4 text-green-500"})}),(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>F(s),disabled:s.id===c?.user?.id,title:o.admin.delete,children:(0,t.jsx)(ec.f,{className:"h-4 w-4 text-destructive"})})]})]},s.id))})]})})]})}var eh=e.i(482022);let ex={name:"scroll-text",size:24,node:[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]};ex.node;let eg=(0,C.f)(ex);function ef(e){return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[(0,t.jsx)("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"}),(0,t.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]})}let ej={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};ej.node;let ev=(0,C.f)(ej);var eb=e.i(81968);let ey=()=>()=>void 0;function ew(){let{t:e}=(0,a.b)(),r=(0,s.useSyncExternalStore)(ey,eb.f,()=>null);return r?r.isStandalone?.()?(0,t.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:e.settings?.about?.androidStandalone||"Running on this device. Data is stored only on this device."}):(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"break-all",children:[e.settings?.about?.androidServer||"Server",": ",r.getServerUrl()]}),(0,t.jsxs)(Y.f,{variant:"outline",className:"gap-2",onClick:()=>r.changeServer(),children:[(0,t.jsx)(ev,{className:"h-4 w-4"}),e.settings?.about?.changeServer||"Change server"]})]}):null}var ek=e.i(637691);function eN(){let{t:e}=(0,a.b)(),[r,i]=(0,s.useState)("");(0,s.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>i(e.version)).catch(()=>{})},[]);let n=[{href:ek.f,icon:ef,label:e.settings?.about?.github||"GitHub Repository"},{href:`${ek.f}/releases`,icon:eg,label:e.settings?.about?.releaseNotes||"Release Notes"},{href:`${ek.f}/issues`,icon:U,label:e.settings?.about?.feedback||"Feedback"}];return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-6 py-8 text-center bg-muted/30 rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-2xl font-bold",children:e.app?.title||"Smart Error Notebook"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:e.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 text-sm text-muted-foreground border px-4 py-2 rounded-full bg-background",children:[(0,t.jsx)(P,{className:"h-4 w-4"}),(0,t.jsxs)("span",{children:[e.settings?.about?.version||"Version",": v",r||"unknown"]})]}),(0,t.jsx)(ew,{}),(0,t.jsx)("div",{className:"flex flex-col sm:flex-row flex-wrap justify-center gap-4 w-full sm:w-auto px-4 sm:px-0",children:n.map(({href:e,icon:s,label:a})=>(0,t.jsx)(Y.f,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,t.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,t.jsx)(s,{className:"h-4 w-4"}),a,(0,t.jsx)(eh.f,{className:"h-3 w-3 ml-1 opacity-50"})]})},e))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:e.settings?.about?.copyright||"© 2026 margrop · Based on wttwins/wrong-notebook · MIT License"})]})}var eS=e.i(37038),eC=e.i(967489),eT=e.i(676167);let eA={name:"",email:"",educationStage:"",enrollmentYear:"",currentGrade:"",currentSemester:"",password:""};function eE(){let{t:e}=(0,a.b)(),[r,c]=(0,s.useState)(eA),[o,d]=(0,s.useState)(""),[m,u]=(0,s.useState)(!0),[p,h]=(0,s.useState)(!1),x=(0,s.useCallback)(async()=>{try{let e=await i.k.get("/api/user"),t=e.fixedGradeSemester?(0,eT.p)(e.fixedGradeSemester):null;c({name:e.name||"",email:e.email||"",educationStage:e.educationStage||"",enrollmentYear:e.enrollmentYear||"",currentGrade:t?.grade||"",currentSemester:t?.semester||"",password:""})}catch(e){l.V.error("[AccountSettings]","Failed to fetch profile",{error:e})}finally{u(!1)}},[]);(0,s.useEffect)(()=>{x()},[x]);let g=async()=>{if(r.password&&r.password!==o)return void M.c.error(e.settings?.messages?.passwordMismatch||"Passwords do not match");h(!0);try{let t={name:r.name,email:r.email,educationStage:r.educationStage};r.enrollmentYear&&(t.enrollmentYear=parseInt(r.enrollmentYear.toString())),r.password&&(t.password=r.password),r.currentGrade&&r.currentSemester?t.fixedGradeSemester=`${r.currentGrade}${r.currentSemester}`:r.currentGrade||(t.fixedGradeSemester=null),await i.k.patch("/api/user",t),M.c.success(e.settings?.messages?.profileUpdated||"Profile updated"),c(e=>({...e,password:""})),d(""),window.location.reload()}catch(t){l.V.error("[AccountSettings]","Failed to update profile",{error:(0,n.d)(t)??(0,n.Z)(t)}),M.c.error((0,n.d)(t)||e.settings?.messages?.updateFailed||"Update failed")}finally{h(!1)}};return m?(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(E.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,t.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.auth?.name||"Name"}),(0,t.jsx)(ee.f,{value:r.name||"",onChange:e=>c({...r,name:e.target.value})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.auth?.email||"Email"}),(0,t.jsx)(ee.f,{value:r.email||"",onChange:e=>c({...r,email:e.target.value}),type:"email"})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.auth?.educationStage||"Education Stage"}),(0,t.jsxs)(eC.d,{value:r.educationStage||"",onValueChange:e=>c({...r,educationStage:e,currentGrade:(0,eT.c)(e).includes(r.currentGrade)?r.currentGrade:"",currentSemester:(0,eT.c)(e).includes(r.currentGrade)?r.currentSemester:""}),children:[(0,t.jsx)(eC.P,{children:(0,t.jsx)(eC.U,{placeholder:e.auth?.selectStage||"Select Stage"})}),(0,t.jsxs)(eC.r,{children:[(0,t.jsx)(eC.T,{value:"primary",children:e.auth?.primary||"Primary School"}),(0,t.jsx)(eC.T,{value:"junior_high",children:e.auth?.juniorHigh||"Junior High"}),(0,t.jsx)(eC.T,{value:"senior_high",children:e.auth?.seniorHigh||"Senior High"}),(0,t.jsx)(eC.T,{value:"university",children:e.auth?.university||"University"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.auth?.enrollmentYear||"Enrollment Year"}),(0,t.jsx)(ee.f,{type:"number",value:r.enrollmentYear||"",onChange:e=>c({...r,enrollmentYear:e.target.value}),placeholder:"YYYY"})]})]}),r.educationStage&&(0,eT.c)(r.educationStage).length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.settings?.account?.currentGrade||"Current Grade & Semester"}),(0,t.jsxs)(eC.d,{value:r.currentGrade||"",onValueChange:e=>c({...r,currentGrade:e,currentSemester:e?r.currentSemester||"上":""}),children:[(0,t.jsx)(eC.P,{children:(0,t.jsx)(eC.U,{placeholder:e.settings?.account?.selectGrade||"Select Grade"})}),(0,t.jsx)(eC.r,{children:(0,eT.c)(r.educationStage).map(e=>(0,t.jsx)(eC.T,{value:e,children:e},e))})]})]}),r.currentGrade&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.settings?.account?.selectSemester||"Select Semester"}),(0,t.jsxs)(eC.d,{value:r.currentSemester||"",onValueChange:e=>c({...r,currentSemester:e}),children:[(0,t.jsx)(eC.P,{children:(0,t.jsx)(eC.U,{placeholder:e.settings?.account?.selectSemester||"Select Semester"})}),(0,t.jsxs)(eC.r,{children:[(0,t.jsx)(eC.T,{value:"上",children:e.settings?.account?.firstSemester||"1st Semester"}),(0,t.jsx)(eC.T,{value:"下",children:e.settings?.account?.secondSemester||"2nd Semester"})]})]})]})]}),r.currentGrade&&r.currentSemester&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground -mt-2",children:e.settings?.account?.gradeAppliedHint||"New questions will default to this grade. You can also configure AI grade recognition in General Settings."}),(0,t.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,t.jsx)(eS.f,{value:r.password,onChange:e=>c({...r,password:e.target.value}),placeholder:"******",minLength:6})]}),r.password&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.auth?.confirmPassword||"Confirm Password"}),(0,t.jsx)(eS.f,{value:o,onChange:e=>d(e.target.value),placeholder:"******",minLength:6})]})]}),(0,t.jsxs)(Y.f,{onClick:g,disabled:p,className:"w-full",children:[p&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.settings?.account?.update||"Update Profile"]})]})}var ez=e.i(10038),eM=e.i(856423);let eF={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};eF.node;let e_=(0,C.f)(eF);var eD=e.i(411382),eL=e.i(54105),e$=e.i(978056),eR=e.i(772325);let eI="https://github.com/xiaoyang111222/cn-math-taxonomy",eG="https://raw.githubusercontent.com/xiaoyang111222/cn-math-taxonomy/HEAD/data/topics.json",eP=eD.z.object({id:eL.z.string().optional(),name:eL.z.string().trim().min(1),subject:eL.z.string().nullish(),grade:e$.z.number().int(),semester:eL.z.string().nullish(),chapter:eL.z.string().nullish()}).passthrough();eR.z.array(eP).min(1);let eq="/api/admin/cnm-tags";function eV(){let{t:e}=(0,a.b)(),r=e.admin.cnmTags,[n,c]=(0,s.useState)(null),[o,d]=(0,s.useState)(!1),m=(0,s.useRef)(null),u=(0,s.useCallback)(async()=>{try{c(await i.k.get(eq))}catch(e){l.V.warn("[CnmTagImportSettings]","Failed to load status",{error:e})}},[]);(0,s.useEffect)(()=>{u()},[u]);let p=async e=>{if(e){d(!0);try{let t;try{t=JSON.parse(await e.text())}catch{M.c.error(r.invalidFile);return}let s=await i.k.post(eq,{topics:t},{timeout:3e5});c(s.status),M.c.success(r.imported.replace("{created}",String(s.result.created)).replace("{skipped}",String(s.result.skipped)))}catch(t){l.V.error("[CnmTagImportSettings]","Import failed",{error:t});let e=t instanceof i.a&&400===t.status;M.c.error(e?r.invalidFile:r.failed)}finally{d(!1),m.current&&(m.current.value="")}}},h=n?.knowledgePoints??0;return(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border p-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,t.jsx)(eM.f,{className:"h-4 w-4"}),r.title]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r.desc})]}),(0,t.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:r.downloadHint}),(0,t.jsx)("a",{href:eG,target:"_blank",rel:"noopener noreferrer",className:"block break-all text-primary underline",children:eG}),(0,t.jsxs)("p",{children:[r.sourceLabel," ",(0,t.jsx)("a",{href:eI,target:"_blank",rel:"noopener noreferrer",className:"break-all text-primary underline",children:eI})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n?h>0?r.status.replace("{count}",String(h)):r.notImported:""}),(0,t.jsx)("input",{ref:m,type:"file",accept:".json,application/json",className:"hidden",onChange:e=>p(e.target.files?.[0]),disabled:o}),(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",className:"w-full sm:w-auto",onClick:()=>m.current?.click(),disabled:o,children:[o?(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(e_,{className:"mr-2 h-4 w-4"}),o?r.importing:r.select]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r.note})]})}var eU=e.i(741120);let eO={info:{card:"border-blue-200 dark:border-blue-900 bg-blue-50 dark:bg-blue-950/40",title:"text-blue-900 dark:text-blue-200 font-bold",desc:"text-blue-800 dark:text-blue-200 font-medium",button:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800"},danger:{card:"border-red-200 dark:border-red-900 bg-red-50 dark:bg-red-950/40",title:"text-red-700 dark:text-red-300 font-medium",desc:"text-red-600 dark:text-red-400",button:""},critical:{card:"border-red-600/50 bg-red-100/50 dark:bg-red-900/40",title:"text-red-900 dark:text-red-200 font-bold",desc:"text-red-800 dark:text-red-200 font-medium",button:"bg-red-700 hover:bg-red-800"}};function eH({title:e,description:s,tone:a,busy:r,icon:i,onClick:n}){let l=eO[a];return(0,t.jsxs)("div",{className:`p-4 border rounded-lg ${l.card}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:`text-sm flex items-center gap-2 ${l.title}`,children:e}),(0,t.jsx)(Y.f,{variant:"info"===a?"outline":"destructive",size:"sm",onClick:n,disabled:r,className:l.button,children:r?(0,t.jsx)(E.f,{className:"h-4 w-4 animate-spin"}):i})]}),(0,t.jsx)("p",{className:`text-xs mt-2 ${l.desc}`,children:s})]})}function eB({isAdmin:e}){let{t:r}=(0,a.b)(),[n,c]=(0,s.useState)(null),o=async(e,t,s,a)=>{c(e);try{M.c.success(await t()),a&&window.location.reload()}catch(t){l.V.error("[DangerZoneSettings]",`${e} failed`,{error:t}),M.c.error(s)}finally{c(null)}},d=r.settings?.clearSuccess||"Success",m=r.settings?.clearError||"Failed",u=async()=>{await (0,M.u)(r.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})&&await o("migrateTags",async()=>{let e=await i.k.post("/api/admin/migrate-tags",{});return`${d}: ${e.count||0} tags migrated.`},r.settings?.clearError||"Failed to migrate tags",!1)},p=async()=>{await (0,M.u)(r.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})&&await o("clearPractice",async()=>(await i.k.delete("/api/stats/practice/clear"),d),m,!0)},h=async()=>{await (0,M.u)(r.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})&&await o("clearErrors",async()=>(await i.k.delete("/api/error-items/clear"),d),m,!0)},x=async()=>{if(!await (0,M.u)(r.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let e=prompt(r.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==e){null!==e&&M.c.error(r.common?.error||"Confirmation failed");return}await o("systemReset",async()=>(await i.k.post("/api/admin/system-reset",{}),r.settings?.clearSuccess||"Success - System Reset Complete"),r.settings?.clearError||"Failed to reset system",!0)};return(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsx)(eH,{tone:"info",title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eU.f,{className:"h-4 w-4"}),r.settings?.migrateTags||"Migrate Tags"]}),description:r.settings?.migrateTagsDesc||"Re-populates standard tags from file",busy:"migrateTags"===n,icon:(0,t.jsx)(eU.f,{className:"h-4 w-4"}),onClick:u}),(0,t.jsx)(eH,{tone:"danger",title:r.settings?.clearData||"Clear Practice Data",description:r.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible.",busy:"clearPractice"===n,icon:(0,t.jsx)(ec.f,{className:"h-4 w-4"}),onClick:p}),(0,t.jsx)(eH,{tone:"danger",title:r.settings?.clearErrorData||"Clear Error Data",description:r.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible.",busy:"clearErrors"===n,icon:(0,t.jsx)(ec.f,{className:"h-4 w-4"}),onClick:h}),e&&(0,t.jsx)(eH,{tone:"critical",title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.f,{className:"h-4 w-4"}),r.settings?.systemReset||"System Initialization"]}),description:r.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data.",busy:"systemReset"===n,icon:(0,t.jsx)(ec.f,{className:"h-4 w-4"}),onClick:x})]})}var eK=e.i(551757),eY=e.i(762368);async function eW(e,t){let s=await fetch(e);if(!s.ok)throw Error((await s.json().catch(()=>({}))).message||"Download failed");let a=await s.blob(),r=window.URL.createObjectURL(a),i=document.createElement("a");i.href=r;let n=s.headers.get("Content-Disposition")?.match(/filename="(.+)"/);i.download=n?n[1]:t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(r)}function eZ({isAdmin:e}){let{t:r}=(0,a.b)(),[n,c]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)(null),p=async e=>{if(!e||await (0,M.u)(r.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){c(!0);try{await eW(e?"/api/export?all=true":"/api/export",e?"wrong-notebook-export-all.json":"wrong-notebook-export.json"),M.c.success(r.settings?.exportSuccess||"Export successful")}catch(t){l.V.error("[DataBackupSettings]",e?"Export all failed":"Export failed",{error:t}),M.c.error(r.settings?.exportFailed||"Export failed")}finally{c(!1)}}},h=async e=>{if(!m)return;let t=e?r.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.":r.settings?.importConfirm||"Are you sure you want to import?";if(await (0,M.u)(t)){d(!0);try{let t=JSON.parse(await m.text()),{stats:s}=await i.k.post(e?"/api/import?all=true":"/api/import",t);M.c.success((r.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records, {papers} exam papers and {voices} cloud voice clips.").replace("{subjects}",String(s.subjectsCreated)).replace("{tags}",String(s.tagsCreated)).replace("{items}",String(s.errorItemsCreated)).replace("{schedules}",String(s.reviewSchedulesCreated)).replace("{records}",String(s.practiceRecordsCreated)).replace("{papers}",String(s.examPapersCreated??0)).replace("{voices}",String(s.ttsSpeechesImported??0)).replace("{duplicates}",String(s.duplicateErrorItems??0))),u(null),window.location.reload()}catch(t){l.V.error("[DataBackupSettings]",e?"Import all failed":"Import failed",{error:t}),M.c.error(r.settings?.importFailed||"Import failed")}finally{d(!1)}}},x=(e,s)=>e?(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}):s;return(0,t.jsxs)("div",{className:"p-4 border border-blue-200 dark:border-blue-900 rounded-lg bg-blue-50 dark:bg-blue-950/40",children:[(0,t.jsx)("h4",{className:"text-sm font-bold text-blue-900 dark:text-blue-200 mb-3",children:r.settings?.dataManagement||"Data Management"}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("span",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium",children:r.settings?.exportData||"Export Data"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>p(!1),disabled:n,className:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800",children:[x(n,(0,t.jsx)(eY.f,{className:"mr-2 h-4 w-4"})),r.settings?.exportData||"Export"]}),e&&(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>p(!0),disabled:n,className:"bg-orange-100 dark:bg-orange-900/40 hover:bg-orange-200 dark:hover:bg-orange-900/60 text-orange-900 dark:text-orange-200 border-orange-300 dark:border-orange-800",children:[x(n,(0,t.jsx)(eY.f,{className:"mr-2 h-4 w-4"})),r.settings?.exportAllData||"Export All"]})]})]}),(0,t.jsx)("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:r.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("span",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium",children:r.settings?.importData||"Import Data"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"file",accept:".json",onChange:e=>u(e.target.files?.[0]??m),className:"hidden",id:"import-file-input",disabled:o}),(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:o,className:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800",children:[x(o,(0,t.jsx)(e_,{className:"mr-2 h-4 w-4"})),m?.name||r.settings?.selectFile||"Select File"]}),m&&(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>h(!1),disabled:o,className:"bg-green-100 dark:bg-green-900/40 hover:bg-green-200 dark:hover:bg-green-900/60 text-green-900 dark:text-green-200 border-green-300 dark:border-green-800",children:[x(o,(0,t.jsx)(eK.f,{className:"mr-2 h-4 w-4"})),r.settings?.importData||"Import"]}),m&&e&&(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>h(!0),disabled:o,className:"bg-orange-100 dark:bg-orange-900/40 hover:bg-orange-200 dark:hover:bg-orange-900/60 text-orange-900 dark:text-orange-200 border-orange-300 dark:border-orange-800",children:[x(o,(0,t.jsx)(eK.f,{className:"mr-2 h-4 w-4"})),r.settings?.importAllData||"Import All"]})]})]}),(0,t.jsx)("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:r.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]})}let eJ={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};eJ.node;let eX=(0,C.f)(eJ),eQ="/api/admin/debug-logs";function e0(){let{t:e}=(0,a.b)(),{timeZone:r}=(0,y.M)(),n=e.admin.debugLog,[c,o]=(0,s.useState)(null),[d,m]=(0,s.useState)(!1),u=(0,s.useCallback)(async()=>{try{o(await i.k.get(eQ))}catch(e){l.V.warn("[DebugLogSettings]","Failed to load debug status",{error:e})}},[]);(0,s.useEffect)(()=>{u()},[u]),(0,s.useEffect)(()=>{if(!c?.enabled)return;let e=setInterval(u,5e3);return()=>clearInterval(e)},[c?.enabled,u]);let p=async(e,t)=>{m(!0);try{await e(),M.c.success(t)}catch(e){l.V.error("[DebugLogSettings]","Debug log action failed",{error:e}),M.c.error(n.failed)}finally{m(!1)}},h=e=>e?(0,J.r)(e,"yyyy-MM-dd HH:mm",r):"",x=c?.enabled?n.enabledHint.replace("{since}",h(c.enabledAt)).replace("{until}",h(c.expiresAt)):n.disabledHint,g=(c?.entryCount??0)>0;return(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(et.f,{htmlFor:"debug-mode-switch",className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(eX,{className:"h-4 w-4"}),n.title]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.desc})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:n.enable}),(0,t.jsx)(Q.f,{id:"debug-mode-switch",checked:!!c?.enabled,onCheckedChange:e=>p(async()=>{o(await i.k.post(eQ,{enabled:e}))},e?n.enabled:n.disabled),disabled:d||!c})]})]}),(0,t.jsxs)("p",{className:`text-xs ${c?.enabled?"text-orange-600":"text-muted-foreground"}`,children:[x,c&&(0,t.jsxs)(t.Fragment,{children:[" ",n.entries.replace("{count}",String(c.entryCount)),c.droppedCount>0&&n.dropped.replace("{count}",String(c.droppedCount))]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>p(async()=>{await eW(`${eQ}/export`,"wrong-notebook-debug.json"),await u()},n.exported),disabled:d||!g,className:"sm:flex-1",children:[d?(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(eY.f,{className:"mr-2 h-4 w-4"}),n.export]}),(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>p(async()=>{o(await i.k.delete(eQ))},n.cleared),disabled:d||!g,children:[(0,t.jsx)(ec.f,{className:"mr-2 h-4 w-4"}),n.clear]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.privacyNote})]})}var e1=e.i(307364);function e2({field:e,label:r,description:n}){let{t:c}=(0,a.b)(),[o,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)(!1),[p,h]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null),f=`preference-${e}`;(0,s.useEffect)(()=>{i.k.get("/api/user").then(t=>d(!!t[e])).catch(()=>void 0).finally(()=>u(!0))},[e]);let j=async t=>{d(t),h(!0);try{await i.k.patch("/api/user",{[e]:t}),g(c.importFlow.preferenceSaved)}catch(s){d(!t),g(c.importFlow.preferenceSaveFailed),l.V.error("[Settings]","Failed to save user preference",{field:e,error:s instanceof Error?s.message:String(s)})}finally{h(!1)}};return(0,t.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsx)(et.f,{htmlFor:f,children:r}),(0,t.jsx)(Q.f,{id:f,checked:o,onCheckedChange:j,disabled:!m||p})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n}),x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x})]})}function e4(){let{t:e}=(0,a.b)();return(0,t.jsx)(e2,{field:"enableGeogebra",label:e.importFlow.enableGeogebra,description:e.importFlow.enableGeogebraDesc})}function e3(){let{t:e}=(0,a.b)();return(0,t.jsx)(e2,{field:"confirmBeforeImport",label:e.importFlow.confirmBeforeImport,description:e.importFlow.confirmBeforeImportDesc})}var e5=e.i(905110);function e6(){let{t:e}=(0,a.b)(),[r,n]=(0,s.useState)(String(e5.z)),[c,o]=(0,s.useState)(null),[d,m]=(0,s.useState)(!0),[u,p]=(0,s.useState)(!1),[h,x]=(0,s.useState)(null),g=Number(r),f=""!==r.trim()&&Number.isInteger(g)&&g>=e5.P&&g<=e5.o,j=(0,s.useCallback)(async()=>{m(!0),x(null);try{let e=(await i.k.get("/api/user")).masteryThreshold??e5.z;n(String(e)),o(e)}catch(t){x(e.mastery.thresholdLoadFailed),l.V.error("[Settings]","加载已掌握阈值失败",{error:t instanceof Error?t.message:String(t)})}finally{m(!1)}},[e.mastery.thresholdLoadFailed]);(0,s.useEffect)(()=>{j()},[j]);let v=async()=>{if(f&&null!==c){p(!0),x(null);try{let t=(await i.k.patch("/api/user",{masteryThreshold:g})).masteryThreshold??g;o(t),n(String(t)),x(e.importFlow.preferenceSaved)}catch(t){x(e.importFlow.preferenceSaveFailed),l.V.error("[Settings]","保存已掌握阈值失败",{error:t instanceof Error?t.message:String(t)})}finally{p(!1)}}};return(0,t.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,t.jsx)(et.f,{htmlFor:"mastery-threshold",children:e.mastery.thresholdLabel}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(ee.f,{id:"mastery-threshold",type:"number",min:e5.P,max:e5.o,step:1,value:r,onChange:e=>{n(e.target.value),x(null)},disabled:d||u||null===c,className:"w-28","aria-describedby":"mastery-threshold-hint"}),(0,t.jsx)("span",{"aria-hidden":"true",children:"%"}),(0,t.jsxs)(Y.f,{type:"button",size:"sm",variant:"outline",onClick:v,disabled:d||u||null===c||!f||g===c,children:[(d||u)&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.importFlow.saveThreshold]}),!d&&null===c&&(0,t.jsx)(Y.f,{type:"button",size:"sm",variant:"outline",onClick:j,children:e.importFlow.retryLoad})]}),(0,t.jsx)("p",{id:"mastery-threshold-hint",className:"text-xs text-muted-foreground",children:e.mastery.thresholdDescription}),null!==c&&!f&&(0,t.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:e.mastery.thresholdInvalid}),h&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:h})]})}var e8=e.i(28342);function e9(){let{t:e}=(0,a.b)(),[r,c]=(0,s.useState)({gradeRecognitionMode:"fixed",fixedGradeSemester:null}),[o,d]=(0,s.useState)(null),[m,u]=(0,s.useState)(!0),[p,h]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null),f=(0,s.useRef)(0),j=(0,s.useCallback)(async()=>{let t=++f.current;u(!0),g(null);try{let e=await i.k.get("/api/user");if(t!==f.current)return;let s={gradeRecognitionMode:e.gradeRecognitionMode??"fixed",fixedGradeSemester:e.fixedGradeSemester??null};c(s),d(s)}catch(s){if(t!==f.current)return;g(e.questionGrade.loadFailed),l.V.error("[QuestionGradeSetting]","加载录入年级规则失败",{error:(0,n.Z)(s)})}finally{t===f.current&&u(!1)}},[e.questionGrade.loadFailed]);(0,s.useEffect)(()=>{j()},[j]);let v=async()=>{h(!0),g(null);try{let t=await i.k.patch("/api/user",r),s={gradeRecognitionMode:t.gradeRecognitionMode??r.gradeRecognitionMode,fixedGradeSemester:t.fixedGradeSemester??null};c(s),d(s),g(e.importFlow.preferenceSaved)}catch(t){g(e.importFlow.preferenceSaveFailed),l.V.error("[QuestionGradeSetting]","保存录入年级规则失败",{error:(0,n.Z)(t)})}finally{h(!1)}},b=m||p||null===o,y=o?.gradeRecognitionMode===r.gradeRecognitionMode&&o?.fixedGradeSemester===r.fixedGradeSemester;return(0,t.jsxs)("div",{className:"space-y-3 border-t pt-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{htmlFor:"question-grade-mode",children:e.questionGrade.label}),(0,t.jsxs)("select",{id:"question-grade-mode",value:r.gradeRecognitionMode,disabled:b,onChange:e=>{c({...r,gradeRecognitionMode:e.target.value}),g(null)},className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",children:[(0,t.jsx)("option",{value:"fixed",children:e.questionGrade.fixed}),(0,t.jsx)("option",{value:"ai",children:e.questionGrade.ai})]})]}),"fixed"===r.gradeRecognitionMode&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{htmlFor:"question-fixed-grade",children:e.editor.gradeSemester}),(0,t.jsx)(e8.f,{id:"question-fixed-grade",value:r.fixedGradeSemester??"",disabled:b,onChange:e=>{c({...r,fixedGradeSemester:e||null}),g(null)}})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"fixed"===r.gradeRecognitionMode?e.questionGrade.fixedDescription:e.questionGrade.aiDescription}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.questionGrade.description}),(0,t.jsxs)(Y.f,{type:"button",variant:"outline",size:"sm",disabled:b||y,onClick:v,children:[(m||p)&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.questionGrade.save]}),!m&&null===o&&(0,t.jsx)(Y.f,{type:"button",variant:"outline",size:"sm",onClick:j,children:e.importFlow.retryLoad}),x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:x})]})}function e7(){let{t:e}=(0,a.b)();return(0,t.jsx)(e2,{field:"enableSvgAnimation",label:e.importFlow.enableSvgAnimation,description:e.importFlow.enableSvgAnimationDesc})}function te({value:e,onChange:s,disabled:r}){let{t:i}=(0,a.b)();return(0,t.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,t.jsx)(et.f,{htmlFor:"app-time-zone",children:i.settings.general.timeZoneLabel}),(0,t.jsx)(ee.f,{id:"app-time-zone",value:e,onChange:e=>s(e.target.value),disabled:r,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,t.jsx)("datalist",{id:"app-time-zones",children:["Asia/Shanghai","Asia/Hong_Kong","Asia/Tokyo","Asia/Singapore","Europe/London","America/New_York","America/Los_Angeles","UTC"].map(e=>(0,t.jsx)("option",{value:e},e))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i.settings.general.timeZoneDesc})]})}function tt({config:e,setConfig:s,isAdmin:r,disabled:i}){let{t:n,language:l,setLanguage:c}=(0,a.b)(),{timeZone:o}=(0,y.M)(),d=e=>s(t=>({...t,timeouts:{...t.timeouts,analyze:1e3*e}}));return(0,t.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:n.settings?.language||"Language"}),(0,t.jsxs)(eC.d,{value:l,onValueChange:e=>c(e),children:[(0,t.jsx)(eC.P,{children:(0,t.jsx)(eC.U,{})}),(0,t.jsxs)(eC.r,{children:[(0,t.jsx)(eC.T,{value:"zh",children:"中文 (Chinese)"}),(0,t.jsx)(eC.T,{value:"en",children:"English"})]})]})]}),(0,t.jsx)(te,{value:e.timeZone??o,onChange:e=>s(t=>({...t,timeZone:e})),disabled:!r||i}),r&&(0,t.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,t.jsx)(et.f,{children:n.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,t.jsx)(ee.f,{type:"number",value:e.timeouts?.analyze?e.timeouts.analyze/1e3:"",onChange:e=>{let t=""===e.target.value?0:parseInt(e.target.value);d(isNaN(t)?0:t)},onBlur:()=>{let t=(e.timeouts?.analyze||0)/1e3,s=Math.min(600,Math.max(120,t));s!==t&&d(s)},min:120,max:600}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,t.jsx)(e3,{}),(0,t.jsx)(e9,{}),(0,t.jsx)(e7,{}),(0,t.jsx)(e4,{}),(0,t.jsx)(e1.f,{}),(0,t.jsx)(e6,{})]})}var ts=e.i(226091),ta=e.i(77071),tr=e.i(515288),ti=e.i(664030);function tn(){let{t:e}=(0,a.b)(),{groups:r,loading:n,refetch:c}=(0,ti.f)(),[o,d]=(0,s.useState)(""),[m,u]=(0,s.useState)(!1),p=async()=>{let t=o.trim();if(t){u(!0);try{await i.k.post("/api/paper-groups",{name:t}),d(""),M.c.success(e.common?.messages?.saveSuccess||"Saved"),c()}catch(t){l.V.error("[PaperGroupSettings]","Failed to add group",{error:t}),M.c.error(e.common?.messages?.saveFailed||"Failed to save")}finally{u(!1)}}},h=async(t,s)=>{let a=window.prompt(e.settings?.paperGroups?.renamePrompt||"Rename group",s);if(a&&a.trim()!==s)try{await i.k.patch(`/api/paper-groups/${t}`,{name:a.trim()}),M.c.success(e.common?.messages?.saveSuccess||"Saved"),c()}catch(t){l.V.error("[PaperGroupSettings]","Failed to rename group",{error:t}),M.c.error(e.common?.messages?.saveFailed||"Failed to save")}},x=async(t,s)=>{try{await i.k.patch(`/api/paper-groups/${t}`,{isActive:!s}),M.c.success(e.common?.messages?.saveSuccess||"Saved"),c()}catch(t){l.V.error("[PaperGroupSettings]","Failed to toggle group",{error:t}),M.c.error(e.common?.messages?.saveFailed||"Failed to save")}},g=async(t,s,a)=>{if(a>0){let r=(e.settings?.paperGroups?.deleteConfirmWithItems||'Group "{name}" has {count} questions. Deleting will clear their group assignment. Continue?').replace("{name}",s).replace("{count}",String(a));if(!await (0,M.u)(r,{destructive:!0}))return;try{await i.k.delete(`/api/paper-groups/${t}?clear=true`),M.c.success(e.common?.messages?.deleteSuccess||"Deleted"),c()}catch(t){l.V.error("[PaperGroupSettings]","Failed to delete group",{error:t}),M.c.error(e.common?.messages?.deleteFailed||"Delete failed")}return}let r=(e.settings?.paperGroups?.deleteConfirm||'Delete group "{name}"?').replace("{name}",s);if(await (0,M.u)(r,{destructive:!0}))try{await i.k.delete(`/api/paper-groups/${t}`),M.c.success(e.common?.messages?.deleteSuccess||"Deleted"),c()}catch(t){l.V.error("[PaperGroupSettings]","Failed to delete group",{error:t}),M.c.error(e.common?.messages?.deleteFailed||"Delete failed")}};return n?(0,t.jsx)(tr.N,{children:(0,t.jsx)(tr.O,{className:"py-12 flex items-center justify-center",children:(0,t.jsx)(E.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}):(0,t.jsxs)(tr.N,{children:[(0,t.jsxs)(tr.Y,{children:[(0,t.jsxs)(tr.v,{className:"flex items-center gap-2 text-lg",children:[(0,t.jsx)(ts.f,{className:"h-5 w-5"}),e.settings?.paperGroups?.title||"Paper Groups"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.settings?.paperGroups?.desc||"Customize paper groups like Unit Test, Midterm, Final. Default groups A/B/Other can be renamed but not deleted."})]}),(0,t.jsxs)(tr.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(ee.f,{value:o,onChange:e=>d(e.target.value),placeholder:e.settings?.paperGroups?.addPlaceholder||"e.g. Unit Test",onKeyDown:e=>{"Enter"===e.key&&p()}}),(0,t.jsxs)(Y.f,{onClick:p,disabled:m||!o.trim(),children:[m?(0,t.jsx)(E.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(ta.f,{className:"h-4 w-4 mr-1"}),e.common?.add||"Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:r.map(s=>(0,t.jsxs)("div",{className:`flex items-center justify-between rounded-lg border p-3 ${!s.isActive?"opacity-50":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"font-medium",children:s.name}),s.key&&(0,t.jsx)(X.f,{variant:"secondary",className:"text-xs",children:e.settings?.paperGroups?.systemBadge||"Default"}),!s.isActive&&(0,t.jsx)(X.f,{variant:"outline",className:"text-xs",children:e.common?.inactive||"Inactive"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>h(s.id,s.name),children:e.common?.rename||"Rename"}),(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>x(s.id,s.isActive),children:s.isActive?e.common?.deactivate||"Deactivate":e.common?.activate||"Activate"}),!s.key&&(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>g(s.id,s.name,s._count?.errorItems||0),children:(0,t.jsx)(ec.f,{className:"h-4 w-4"})})]})]},s.id))})]})]})}var tl=e.i(624687),tc=e.i(247167);let to="[REDACTED]",td=/api[-_]?key|password|passwd|secret|authorization|cookie|credential|private[-_]?key|^(access|refresh|id|auth|api|bearer|session|csrf|setup)?[-_]?token$/i,tm=Symbol.for("wrong-notebook.debug-log");function tu(){let e=globalThis,t=e[tm];return t||(t={enabledAt:null,entries:[],totalSize:0,dropped:0},e[tm]=t),t}function tp(e){let t=e.replace(/data:([\w.+-]+\/[\w.+-]+);base64,[A-Za-z0-9+/=]+/g,(e,t)=>`[data:${t}, ${e.length} chars]`).replace(/(Bearer\s+)[\w\-.~+/]+=*/gi,`$1${to}`).replace(/\bsk-[A-Za-z0-9_-]{8,}/g,to).replace(/([?&](?:key|api_key|apikey|token|access_token)=)[^&\s"']+/gi,`$1${to}`);return t.length>1e4&&(t=`${t.slice(0,1e4)}…[truncated ${t.length-1e4} chars]`),t}function th(e,t,s,a=new Date){if(function(e=Date.now()){let t=tu();return null!==t.enabledAt&&(!(e-t.enabledAt>=864e5)||(t.enabledAt=null,!1))}(a.getTime()))try{let r={...function e(t,s=0,a=new WeakSet){if(null==t)return t;if("string"==typeof t)return tp(t);if("number"==typeof t||"boolean"==typeof t)return t;if("bigint"==typeof t)return t.toString();if("function"==typeof t||"symbol"==typeof t)return String(t);if(t instanceof Date)return t.toISOString();if(t instanceof Error){let r={name:t.name,message:tp(t.message)};return t.stack&&(r.stack=tp(t.stack)),void 0!==t.code&&(r.code=e(t.code,s+1,a)),void 0!==t.status&&(r.status=e(t.status,s+1,a)),void 0!==t.cause&&s<8&&(r.cause=e(t.cause,s+1,a)),r}if("object"!=typeof t)return String(t);if(a.has(t))return"[Circular]";if(s>=8)return"[Object]";if(a.add(t),Array.isArray(t)){let r=t.slice(0,100).map(t=>e(t,s+1,a));return t.length>100&&r.push(`…[${t.length-100} more items]`),r}return ArrayBuffer.isView(t)||t instanceof ArrayBuffer?`[Binary ${t.byteLength} bytes]`:Object.fromEntries(Object.entries(t).map(([t,r])=>[t,td.test(t)&&null!=r&&""!==r?to:e(r,s+1,a)]))}(t),time:a.toISOString(),level:e,msg:tp(s)},i=JSON.stringify(r).length,n=tu();for(n.entries.push({entry:r,size:i}),n.totalSize+=i;n.entries.length>5e3||n.totalSize>0x1400000&&n.entries.length>1;){let e=n.entries.shift();if(!e)break;n.totalSize-=e.size,n.dropped+=1}}catch{}}let tx={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};function tg(e,t={}){let s,a=tx[e],r=(s=tc.default.env.LOG_LEVEL?.toLowerCase())&&void 0!==tx[s]?tx[s]:tx.info;return(s,i)=>{let n,l,c=new Date;if("string"==typeof s?(n={},l=s):(n=s,l=i||""),th(e,{...t,...n},l,c),!(a<r)){let s=JSON.stringify({level:e,time:c.toISOString(),...t,...n,msg:l});switch(e){case"error":case"fatal":console.error(s);break;case"warn":console.warn(s);break;default:console.log(s)}}}}let tf=function e(t={}){return t.module,{trace:tg("trace",t),debug:tg("debug",t),info:tg("info",t),warn:tg("warn",t),error:tg("error",t),fatal:tg("fatal",t),child:s=>e({...t,...s}),box:(e,s,a="📋")=>{th("info",{...t,..."string"==typeof s?{content:s}:s},e);{let a="string"==typeof s?{content:s}:s||{};console.log(JSON.stringify({level:"info",time:new Date().toISOString(),...t,title:e,...a,msg:e}));return}},divider:(e="-")=>{}}}({env:"production"});var tj=e.i(113381);tf.child({module:"ai:prompts"});let tv=`请参考《高思学校竞赛数学导引》(每讲分兴趣篇、拓展篇、超越篇,题目左侧标 1~5 颗星)的星级标准,结合题目所在年级评定难度:
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1661,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(111110),r=e.i(217255),i=e.i(41931),n=e.i(303163),l=e.i(201276);let c=["system","light","dark"],o="system",d="app-theme";function m(e){return"string"==typeof e&&c.includes(e)}let u=(0,s.createContext)({preference:o,theme:"light",setPreference:()=>void 0}),p="(prefers-color-scheme: dark)",h=new Set;function x(e){return h.add(e),window.addEventListener("storage",e),()=>{h.delete(e),window.removeEventListener("storage",e)}}function g(){try{let e=localStorage.getItem(d);return m(e)?e:o}catch{return o}}function f(e){try{localStorage.setItem(d,e)}catch{}h.forEach(e=>e())}function j(e){let t=window.matchMedia(p);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}let v=()=>window.matchMedia(p).matches;function b({children:e}){let{data:a,status:c}=(0,r.useSession)(),d="authenticated"===c,p=a?.user?.email,h=(0,s.useSyncExternalStore)(x,g,()=>o),y=(0,s.useSyncExternalStore)(j,v,()=>!1),w="system"===h?y?"dark":"light":h;(0,s.useEffect)(()=>{let e=document.documentElement,t=t=>{e.classList.toggle("dark","dark"===t),e.style.colorScheme=t};t(w);let s=()=>t("light"),a=()=>t(w);return window.addEventListener("beforeprint",s),window.addEventListener("afterprint",a),()=>{window.removeEventListener("beforeprint",s),window.removeEventListener("afterprint",a)}},[w]),(0,s.useEffect)(()=>{if(!d||!p)return;let e=!1;return i.k.get("/api/user").then(t=>{!e&&m(t.themePreference)&&t.themePreference!==g()&&f(t.themePreference)}).catch(e=>{l.V.warn("[Theme]","Failed to load theme preference",{error:(0,n.Z)(e)})}),()=>{e=!0}},[d,p]);let k=(0,s.useCallback)(e=>{f(e),d&&i.k.patch("/api/user",{themePreference:e}).catch(e=>{l.V.warn("[Theme]","Failed to save theme preference",{error:(0,n.Z)(e)})})},[d]),N=(0,s.useMemo)(()=>({preference:h,theme:w,setPreference:k}),[h,w,k]);return(0,t.jsx)(u.Provider,{value:N,children:e})}var y=e.i(215519),w=e.i(325164),k=e.i(522016),N=e.i(618566),S=e.i(367784),C=e.i(456420);let T={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};T.node;let A=(0,C.f)(T);var E=e.i(632781),z=e.i(980105),M=e.i(294114),F=e.i(901219),_=e.i(975157);function D({className:e}){let{t:r}=(0,a.b)(),{data:i}=(0,F.b)(),n=(0,s.useRef)(null);if((0,s.useEffect)(()=>{if(!i)return;let e=new Set([...i.tasks.filter(e=>"analyzing"===e.status||"saving"===e.status).map(e=>e.id),...(i.batches??[]).filter(e=>"splitting"===e.phase||"processing"===e.phase).map(e=>`batch:${e.id}`)]),t=new Set([...i.tasks.filter(e=>e.unread).map(e=>e.id),...(i.batches??[]).filter(e=>e.unread).map(e=>`batch:${e.id}`)]),s=n.current;s&&[...s].some(s=>!e.has(s)&&t.has(s))&&M.c.info(r.importTasks.finishedToast),n.current=e},[i,r.importTasks.finishedToast]),!i||0===i.tasks.length&&!i.batches?.length)return null;let{activeCount:l,unreadCount:c}=i,o=l>0?r.importTasks.entryActive.replace("{count}",String(l)):r.importTasks.entry;return(0,t.jsxs)(k.default,{href:"/import-tasks",className:(0,_.f)("relative flex h-9 items-center gap-1.5 rounded-full border px-3 text-sm font-medium transition-colors hover:bg-muted",c>0?"border-primary/50 text-primary":"text-muted-foreground",e),"data-testid":"import-tasks-entry","aria-label":c>0?`${o} \xb7 ${r.importTasks.entryUnread.replace("{count}",String(c))}`:o,children:[l>0?(0,t.jsx)(E.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(z.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"whitespace-nowrap",children:o}),c>0&&(0,t.jsx)("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1 text-xs text-white","data-testid":"import-tasks-unread",children:c})]})}var L=e.i(853138),$=e.i(749803);let R={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};R.node;let I=(0,C.f)(R),G={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};G.node;let P=(0,C.f)(G);var q=e.i(999092);let V={name:"message-square-text",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]};V.node;let U=(0,C.f)(V),O={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};O.node;let H=(0,C.f)(O);var B=e.i(901279),K=e.i(994533),Y=e.i(519455),W=e.i(776639),Z=e.i(677572),J=e.i(306831),X=e.i(487486),Q=e.i(699375),ee=e.i(793479),et=e.i(110204);let es=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("div",{className:"relative w-full overflow-auto",children:(0,t.jsx)("table",{ref:a,className:(0,_.f)("w-full caption-bottom text-sm",e),...s})}));es.displayName="Table";let ea=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("thead",{ref:a,className:(0,_.f)("[&_tr]:border-b",e),...s}));ea.displayName="TableHeader";let er=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("tbody",{ref:a,className:(0,_.f)("[&_tr:last-child]:border-0",e),...s}));er.displayName="TableBody",(s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("tfoot",{ref:a,className:(0,_.f)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...s}))).displayName="TableFooter";let ei=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("tr",{ref:a,className:(0,_.f)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...s}));ei.displayName="TableRow";let en=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("th",{ref:a,className:(0,_.f)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...s}));en.displayName="TableHead";let el=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("td",{ref:a,className:(0,_.f)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...s}));el.displayName="TableCell",(s.forwardRef(({className:e,...s},a)=>(0,t.jsx)("caption",{ref:a,className:(0,_.f)("mt-4 text-sm text-muted-foreground",e),...s}))).displayName="TableCaption";var ec=e.i(759659);let eo={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};eo.node;let ed=(0,C.f)(eo);var em=e.i(548161);function eu(){var e;let{t:r}=(0,a.b)(),[n,c]=(0,s.useState)(String(5)),[o,d]=(0,s.useState)(!1),m=(0,s.useCallback)(async()=>{try{let e=await i.k.get("/api/settings");c(String(e.aiConcurrencyLimit??5))}catch(e){l.V.error("[AiConcurrencyLimitSetting]","Failed to fetch config",{error:e})}},[]);(0,s.useEffect)(()=>{m()},[m]);let u=Number(n),p=""!==n.trim()&&"number"==typeof(e=u)&&Number.isInteger(e)&&e>=1&&e<=100,h=async()=>{if(p){d(!0);try{await i.k.post("/api/settings",{aiConcurrencyLimit:u}),M.c.success(r.admin.aiConcurrencyLimitSaved)}catch(e){l.V.error("[AiConcurrencyLimitSetting]","Failed to update AI concurrency limit",{error:e}),M.c.error(r.common.error)}finally{d(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg bg-muted/30 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(et.f,{htmlFor:"ai-concurrency-limit",className:"text-base",children:r.admin.aiConcurrencyLimit}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r.admin.aiConcurrencyLimitDesc})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)(ee.f,{id:"ai-concurrency-limit",type:"number",min:1,max:100,step:1,inputMode:"numeric",value:n,onChange:e=>c(e.target.value),"aria-invalid":!p,className:"w-24"}),(0,t.jsxs)(Y.f,{size:"sm",onClick:h,disabled:o||!p,children:[o&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),r.common.save]})]})]})}function ep(){let{timeZone:e}=(0,y.M)(),{data:c}=(0,r.useSession)(),{t:o}=(0,a.b)(),[d,m]=(0,s.useState)([]),[u,p]=(0,s.useState)(!0),[h,x]=(0,s.useState)(!1),[g,f]=(0,s.useState)(!1),[j,v]=(0,s.useState)("0"),[b,w]=(0,s.useState)(!1),k=(0,s.useCallback)(async()=>{p(!0);try{let e=await i.k.get("/api/admin/users");m(e)}catch(e){l.V.error("[UserManagement]","Failed to fetch users",{error:e})}finally{p(!1)}},[]),N=(0,s.useCallback)(async()=>{try{let e=await i.k.get("/api/settings");x(!0===e.allowRegistration),v(String(e.aiDailyLimit??0))}catch(e){l.V.error("[UserManagement]","Failed to fetch config",{error:e})}},[]);(0,s.useEffect)(()=>{k(),N()},[k,N]);let S=async e=>{f(!0);try{await i.k.post("/api/settings",{allowRegistration:e}),x(e)}catch(e){l.V.error("[UserManagement]","Failed to update registration setting",{error:e}),M.c.error(o.common.error)}finally{f(!1)}},C=Number(j),T=""!==j.trim()&&Number.isInteger(C)&&C>=0,A=async()=>{if(T){w(!0);try{await i.k.post("/api/settings",{aiDailyLimit:C}),M.c.success(o.admin.aiDailyLimitSaved)}catch(e){l.V.error("[UserManagement]","Failed to update AI daily limit",{error:e}),M.c.error(o.common.error)}finally{w(!1)}}},z=async e=>{let t=e.isActive?o.admin.confirmDisable:o.admin.confirmEnable;if(await (0,M.u)(t))try{await i.k.patch(`/api/admin/users/${e.id}`,{isActive:!e.isActive}),k()}catch(e){l.V.error("[UserManagement]","Failed to update user status",{error:e}),M.c.error(o.common.error)}},F=async e=>{if(await (0,M.u)(o.admin.confirmDelete,{destructive:!0}))try{await i.k.delete(`/api/admin/users/${e.id}`),k()}catch(t){l.V.error("[UserManagement]","Failed to delete user",{error:t});let e=(0,n.d)(t)||o.common.error;M.c.error(e)}};return u?(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(E.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(et.f,{className:"text-base",children:o.admin?.allowRegistration||"Allow New Registrations"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:o.admin?.allowRegistrationDesc||"When disabled, new users cannot register"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[g&&(0,t.jsx)(E.f,{className:"h-4 w-4 animate-spin"}),(0,t.jsx)(Q.f,{checked:h,onCheckedChange:S,disabled:g})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg bg-muted/30 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(et.f,{htmlFor:"ai-daily-limit",className:"text-base",children:o.admin.aiDailyLimit}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:o.admin.aiDailyLimitDesc})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)(ee.f,{id:"ai-daily-limit",type:"number",min:0,step:1,inputMode:"numeric",value:j,onChange:e=>v(e.target.value),"aria-invalid":!T,className:"w-24"}),(0,t.jsxs)(Y.f,{size:"sm",onClick:A,disabled:b||!T,children:[b&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),o.common.save]})]})]}),(0,t.jsx)(eu,{}),(0,t.jsx)("div",{className:"sm:hidden space-y-3",children:d.map(s=>(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-card space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium",children:s.name||"N/A"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:s.email})]}),(0,t.jsx)(X.f,{variant:"admin"===s.role?"default":"secondary",children:"admin"===s.role?o.admin.admin:o.admin.user})]}),(0,t.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[o.admin.errors,": ",s._count.errorItems," | ",o.admin.practiceCount,": ",s._count.practiceRecords," | ",o.admin.aiUsageToday,": ",s.aiUsageToday]}),(0,t.jsx)(X.f,{variant:s.isActive?"default":"destructive",className:"text-xs",children:s.isActive?o.admin.active:o.admin.disabled})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center pt-2 border-t",children:[(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,J.r)(s.createdAt,"yyyy-MM-dd",e)}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>z(s),disabled:s.id===c?.user?.id,children:s.isActive?(0,t.jsx)(ed,{className:"h-4 w-4 text-orange-500"}):(0,t.jsx)(em.f,{className:"h-4 w-4 text-green-500"})}),(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>F(s),disabled:s.id===c?.user?.id,children:(0,t.jsx)(ec.f,{className:"h-4 w-4 text-destructive"})})]})]})]},s.id))}),(0,t.jsx)("div",{className:"hidden sm:block border rounded-lg overflow-hidden",children:(0,t.jsxs)(es,{children:[(0,t.jsx)(ea,{children:(0,t.jsxs)(ei,{children:[(0,t.jsx)(en,{children:o.admin.nameEmail}),(0,t.jsx)(en,{children:o.admin.role}),(0,t.jsx)(en,{children:o.admin.stats}),(0,t.jsx)(en,{children:o.admin.createdAt}),(0,t.jsx)(en,{children:o.admin.status}),(0,t.jsx)(en,{className:"text-right",children:o.admin.actions})]})}),(0,t.jsx)(er,{children:d.map(s=>(0,t.jsxs)(ei,{children:[(0,t.jsxs)(el,{children:[(0,t.jsx)("div",{className:"font-medium",children:s.name||"N/A"}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:s.email})]}),(0,t.jsx)(el,{children:(0,t.jsx)(X.f,{variant:"admin"===s.role?"default":"secondary",children:"admin"===s.role?o.admin.admin:o.admin.user})}),(0,t.jsxs)(el,{children:[(0,t.jsxs)("div",{className:"text-sm",children:[o.admin.errors,": ",s._count.errorItems]}),(0,t.jsxs)("div",{className:"text-sm",children:[o.admin.practiceCount,": ",s._count.practiceRecords]}),(0,t.jsxs)("div",{className:"text-sm",children:[o.admin.aiUsageToday,": ",s.aiUsageToday]})]}),(0,t.jsx)(el,{children:(0,J.r)(s.createdAt,"yyyy-MM-dd",e)}),(0,t.jsx)(el,{children:(0,t.jsx)(X.f,{variant:s.isActive?"default":"destructive",children:s.isActive?o.admin.active:o.admin.disabled})}),(0,t.jsxs)(el,{className:"text-right space-x-2",children:[(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>z(s),disabled:s.id===c?.user?.id,title:s.isActive?o.admin.disable:o.admin.enable,children:s.isActive?(0,t.jsx)(ed,{className:"h-4 w-4 text-orange-500"}):(0,t.jsx)(em.f,{className:"h-4 w-4 text-green-500"})}),(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>F(s),disabled:s.id===c?.user?.id,title:o.admin.delete,children:(0,t.jsx)(ec.f,{className:"h-4 w-4 text-destructive"})})]})]},s.id))})]})})]})}var eh=e.i(482022);let ex={name:"scroll-text",size:24,node:[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]};ex.node;let eg=(0,C.f)(ex);function ef(e){return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[(0,t.jsx)("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"}),(0,t.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]})}let ej={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};ej.node;let ev=(0,C.f)(ej);var eb=e.i(81968);let ey=()=>()=>void 0;function ew(){let{t:e}=(0,a.b)(),r=(0,s.useSyncExternalStore)(ey,eb.f,()=>null);return r?r.isStandalone?.()?(0,t.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:e.settings?.about?.androidStandalone||"Running on this device. Data is stored only on this device."}):(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"break-all",children:[e.settings?.about?.androidServer||"Server",": ",r.getServerUrl()]}),(0,t.jsxs)(Y.f,{variant:"outline",className:"gap-2",onClick:()=>r.changeServer(),children:[(0,t.jsx)(ev,{className:"h-4 w-4"}),e.settings?.about?.changeServer||"Change server"]})]}):null}var ek=e.i(637691);function eN(){let{t:e}=(0,a.b)(),[r,i]=(0,s.useState)("");(0,s.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>i(e.version)).catch(()=>{})},[]);let n=[{href:ek.f,icon:ef,label:e.settings?.about?.github||"GitHub Repository"},{href:`${ek.f}/releases`,icon:eg,label:e.settings?.about?.releaseNotes||"Release Notes"},{href:`${ek.f}/issues`,icon:U,label:e.settings?.about?.feedback||"Feedback"}];return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-6 py-8 text-center bg-muted/30 rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-2xl font-bold",children:e.app?.title||"Smart Error Notebook"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:e.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 text-sm text-muted-foreground border px-4 py-2 rounded-full bg-background",children:[(0,t.jsx)(P,{className:"h-4 w-4"}),(0,t.jsxs)("span",{children:[e.settings?.about?.version||"Version",": v",r||"unknown"]})]}),(0,t.jsx)(ew,{}),(0,t.jsx)("div",{className:"flex flex-col sm:flex-row flex-wrap justify-center gap-4 w-full sm:w-auto px-4 sm:px-0",children:n.map(({href:e,icon:s,label:a})=>(0,t.jsx)(Y.f,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,t.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,t.jsx)(s,{className:"h-4 w-4"}),a,(0,t.jsx)(eh.f,{className:"h-3 w-3 ml-1 opacity-50"})]})},e))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:e.settings?.about?.copyright||"© 2026 margrop · Based on wttwins/wrong-notebook · MIT License"})]})}var eS=e.i(37038),eC=e.i(967489),eT=e.i(676167);let eA={name:"",email:"",educationStage:"",enrollmentYear:"",currentGrade:"",currentSemester:"",password:""};function eE(){let{t:e}=(0,a.b)(),[r,c]=(0,s.useState)(eA),[o,d]=(0,s.useState)(""),[m,u]=(0,s.useState)(!0),[p,h]=(0,s.useState)(!1),x=(0,s.useCallback)(async()=>{try{let e=await i.k.get("/api/user"),t=e.fixedGradeSemester?(0,eT.p)(e.fixedGradeSemester):null;c({name:e.name||"",email:e.email||"",educationStage:e.educationStage||"",enrollmentYear:e.enrollmentYear||"",currentGrade:t?.grade||"",currentSemester:t?.semester||"",password:""})}catch(e){l.V.error("[AccountSettings]","Failed to fetch profile",{error:e})}finally{u(!1)}},[]);(0,s.useEffect)(()=>{x()},[x]);let g=async()=>{if(r.password&&r.password!==o)return void M.c.error(e.settings?.messages?.passwordMismatch||"Passwords do not match");h(!0);try{let t={name:r.name,email:r.email,educationStage:r.educationStage};r.enrollmentYear&&(t.enrollmentYear=parseInt(r.enrollmentYear.toString())),r.password&&(t.password=r.password),r.currentGrade&&r.currentSemester?t.fixedGradeSemester=`${r.currentGrade}${r.currentSemester}`:r.currentGrade||(t.fixedGradeSemester=null),await i.k.patch("/api/user",t),M.c.success(e.settings?.messages?.profileUpdated||"Profile updated"),c(e=>({...e,password:""})),d(""),window.location.reload()}catch(t){l.V.error("[AccountSettings]","Failed to update profile",{error:(0,n.d)(t)??(0,n.Z)(t)}),M.c.error((0,n.d)(t)||e.settings?.messages?.updateFailed||"Update failed")}finally{h(!1)}};return m?(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(E.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,t.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.auth?.name||"Name"}),(0,t.jsx)(ee.f,{value:r.name||"",onChange:e=>c({...r,name:e.target.value})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.auth?.email||"Email"}),(0,t.jsx)(ee.f,{value:r.email||"",onChange:e=>c({...r,email:e.target.value}),type:"email"})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.auth?.educationStage||"Education Stage"}),(0,t.jsxs)(eC.d,{value:r.educationStage||"",onValueChange:e=>c({...r,educationStage:e,currentGrade:(0,eT.c)(e).includes(r.currentGrade)?r.currentGrade:"",currentSemester:(0,eT.c)(e).includes(r.currentGrade)?r.currentSemester:""}),children:[(0,t.jsx)(eC.P,{children:(0,t.jsx)(eC.U,{placeholder:e.auth?.selectStage||"Select Stage"})}),(0,t.jsxs)(eC.r,{children:[(0,t.jsx)(eC.T,{value:"primary",children:e.auth?.primary||"Primary School"}),(0,t.jsx)(eC.T,{value:"junior_high",children:e.auth?.juniorHigh||"Junior High"}),(0,t.jsx)(eC.T,{value:"senior_high",children:e.auth?.seniorHigh||"Senior High"}),(0,t.jsx)(eC.T,{value:"university",children:e.auth?.university||"University"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.auth?.enrollmentYear||"Enrollment Year"}),(0,t.jsx)(ee.f,{type:"number",value:r.enrollmentYear||"",onChange:e=>c({...r,enrollmentYear:e.target.value}),placeholder:"YYYY"})]})]}),r.educationStage&&(0,eT.c)(r.educationStage).length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.settings?.account?.currentGrade||"Current Grade & Semester"}),(0,t.jsxs)(eC.d,{value:r.currentGrade||"",onValueChange:e=>c({...r,currentGrade:e,currentSemester:e?r.currentSemester||"上":""}),children:[(0,t.jsx)(eC.P,{children:(0,t.jsx)(eC.U,{placeholder:e.settings?.account?.selectGrade||"Select Grade"})}),(0,t.jsx)(eC.r,{children:(0,eT.c)(r.educationStage).map(e=>(0,t.jsx)(eC.T,{value:e,children:e},e))})]})]}),r.currentGrade&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.settings?.account?.selectSemester||"Select Semester"}),(0,t.jsxs)(eC.d,{value:r.currentSemester||"",onValueChange:e=>c({...r,currentSemester:e}),children:[(0,t.jsx)(eC.P,{children:(0,t.jsx)(eC.U,{placeholder:e.settings?.account?.selectSemester||"Select Semester"})}),(0,t.jsxs)(eC.r,{children:[(0,t.jsx)(eC.T,{value:"上",children:e.settings?.account?.firstSemester||"1st Semester"}),(0,t.jsx)(eC.T,{value:"下",children:e.settings?.account?.secondSemester||"2nd Semester"})]})]})]})]}),r.currentGrade&&r.currentSemester&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground -mt-2",children:e.settings?.account?.gradeAppliedHint||"New questions will default to this grade. You can also configure AI grade recognition in General Settings."}),(0,t.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,t.jsx)(eS.f,{value:r.password,onChange:e=>c({...r,password:e.target.value}),placeholder:"******",minLength:6})]}),r.password&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:e.auth?.confirmPassword||"Confirm Password"}),(0,t.jsx)(eS.f,{value:o,onChange:e=>d(e.target.value),placeholder:"******",minLength:6})]})]}),(0,t.jsxs)(Y.f,{onClick:g,disabled:p,className:"w-full",children:[p&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.settings?.account?.update||"Update Profile"]})]})}var ez=e.i(10038),eM=e.i(856423);let eF={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};eF.node;let e_=(0,C.f)(eF);var eD=e.i(411382),eL=e.i(54105),e$=e.i(978056),eR=e.i(772325);let eI="https://github.com/xiaoyang111222/cn-math-taxonomy",eG="https://raw.githubusercontent.com/xiaoyang111222/cn-math-taxonomy/HEAD/data/topics.json",eP=eD.z.object({id:eL.z.string().optional(),name:eL.z.string().trim().min(1),subject:eL.z.string().nullish(),grade:e$.z.number().int(),semester:eL.z.string().nullish(),chapter:eL.z.string().nullish()}).passthrough();eR.z.array(eP).min(1);let eq="/api/admin/cnm-tags";function eV(){let{t:e}=(0,a.b)(),r=e.admin.cnmTags,[n,c]=(0,s.useState)(null),[o,d]=(0,s.useState)(!1),m=(0,s.useRef)(null),u=(0,s.useCallback)(async()=>{try{c(await i.k.get(eq))}catch(e){l.V.warn("[CnmTagImportSettings]","Failed to load status",{error:e})}},[]);(0,s.useEffect)(()=>{u()},[u]);let p=async e=>{if(e){d(!0);try{let t;try{t=JSON.parse(await e.text())}catch{M.c.error(r.invalidFile);return}let s=await i.k.post(eq,{topics:t},{timeout:3e5});c(s.status),M.c.success(r.imported.replace("{created}",String(s.result.created)).replace("{skipped}",String(s.result.skipped)))}catch(t){l.V.error("[CnmTagImportSettings]","Import failed",{error:t});let e=t instanceof i.a&&400===t.status;M.c.error(e?r.invalidFile:r.failed)}finally{d(!1),m.current&&(m.current.value="")}}},h=n?.knowledgePoints??0;return(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border p-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,t.jsx)(eM.f,{className:"h-4 w-4"}),r.title]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r.desc})]}),(0,t.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:r.downloadHint}),(0,t.jsx)("a",{href:eG,target:"_blank",rel:"noopener noreferrer",className:"block break-all text-primary underline",children:eG}),(0,t.jsxs)("p",{children:[r.sourceLabel," ",(0,t.jsx)("a",{href:eI,target:"_blank",rel:"noopener noreferrer",className:"break-all text-primary underline",children:eI})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n?h>0?r.status.replace("{count}",String(h)):r.notImported:""}),(0,t.jsx)("input",{ref:m,type:"file",accept:".json,application/json",className:"hidden",onChange:e=>p(e.target.files?.[0]),disabled:o}),(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",className:"w-full sm:w-auto",onClick:()=>m.current?.click(),disabled:o,children:[o?(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(e_,{className:"mr-2 h-4 w-4"}),o?r.importing:r.select]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r.note})]})}var eU=e.i(741120);let eO={info:{card:"border-blue-200 dark:border-blue-900 bg-blue-50 dark:bg-blue-950/40",title:"text-blue-900 dark:text-blue-200 font-bold",desc:"text-blue-800 dark:text-blue-200 font-medium",button:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800"},danger:{card:"border-red-200 dark:border-red-900 bg-red-50 dark:bg-red-950/40",title:"text-red-700 dark:text-red-300 font-medium",desc:"text-red-600 dark:text-red-400",button:""},critical:{card:"border-red-600/50 bg-red-100/50 dark:bg-red-900/40",title:"text-red-900 dark:text-red-200 font-bold",desc:"text-red-800 dark:text-red-200 font-medium",button:"bg-red-700 hover:bg-red-800"}};function eH({title:e,description:s,tone:a,busy:r,icon:i,onClick:n}){let l=eO[a];return(0,t.jsxs)("div",{className:`p-4 border rounded-lg ${l.card}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:`text-sm flex items-center gap-2 ${l.title}`,children:e}),(0,t.jsx)(Y.f,{variant:"info"===a?"outline":"destructive",size:"sm",onClick:n,disabled:r,className:l.button,children:r?(0,t.jsx)(E.f,{className:"h-4 w-4 animate-spin"}):i})]}),(0,t.jsx)("p",{className:`text-xs mt-2 ${l.desc}`,children:s})]})}function eB({isAdmin:e}){let{t:r}=(0,a.b)(),[n,c]=(0,s.useState)(null),o=async(e,t,s,a)=>{c(e);try{M.c.success(await t()),a&&window.location.reload()}catch(t){l.V.error("[DangerZoneSettings]",`${e} failed`,{error:t}),M.c.error(s)}finally{c(null)}},d=r.settings?.clearSuccess||"Success",m=r.settings?.clearError||"Failed",u=async()=>{await (0,M.u)(r.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})&&await o("migrateTags",async()=>{let e=await i.k.post("/api/admin/migrate-tags",{});return`${d}: ${e.count||0} tags migrated.`},r.settings?.clearError||"Failed to migrate tags",!1)},p=async()=>{await (0,M.u)(r.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})&&await o("clearPractice",async()=>(await i.k.delete("/api/stats/practice/clear"),d),m,!0)},h=async()=>{await (0,M.u)(r.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})&&await o("clearErrors",async()=>(await i.k.delete("/api/error-items/clear"),d),m,!0)},x=async()=>{if(!await (0,M.u)(r.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let e=prompt(r.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==e){null!==e&&M.c.error(r.common?.error||"Confirmation failed");return}await o("systemReset",async()=>(await i.k.post("/api/admin/system-reset",{}),r.settings?.clearSuccess||"Success - System Reset Complete"),r.settings?.clearError||"Failed to reset system",!0)};return(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsx)(eH,{tone:"info",title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eU.f,{className:"h-4 w-4"}),r.settings?.migrateTags||"Migrate Tags"]}),description:r.settings?.migrateTagsDesc||"Re-populates standard tags from file",busy:"migrateTags"===n,icon:(0,t.jsx)(eU.f,{className:"h-4 w-4"}),onClick:u}),(0,t.jsx)(eH,{tone:"danger",title:r.settings?.clearData||"Clear Practice Data",description:r.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible.",busy:"clearPractice"===n,icon:(0,t.jsx)(ec.f,{className:"h-4 w-4"}),onClick:p}),(0,t.jsx)(eH,{tone:"danger",title:r.settings?.clearErrorData||"Clear Error Data",description:r.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible.",busy:"clearErrors"===n,icon:(0,t.jsx)(ec.f,{className:"h-4 w-4"}),onClick:h}),e&&(0,t.jsx)(eH,{tone:"critical",title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.f,{className:"h-4 w-4"}),r.settings?.systemReset||"System Initialization"]}),description:r.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data.",busy:"systemReset"===n,icon:(0,t.jsx)(ec.f,{className:"h-4 w-4"}),onClick:x})]})}var eK=e.i(551757),eY=e.i(762368);async function eW(e,t){let s=await fetch(e);if(!s.ok)throw Error((await s.json().catch(()=>({}))).message||"Download failed");let a=await s.blob(),r=window.URL.createObjectURL(a),i=document.createElement("a");i.href=r;let n=s.headers.get("Content-Disposition")?.match(/filename="(.+)"/);i.download=n?n[1]:t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(r)}function eZ({isAdmin:e}){let{t:r}=(0,a.b)(),[n,c]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)(null),p=async e=>{if(!e||await (0,M.u)(r.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){c(!0);try{await eW(e?"/api/export?all=true":"/api/export",e?"wrong-notebook-export-all.json":"wrong-notebook-export.json"),M.c.success(r.settings?.exportSuccess||"Export successful")}catch(t){l.V.error("[DataBackupSettings]",e?"Export all failed":"Export failed",{error:t}),M.c.error(r.settings?.exportFailed||"Export failed")}finally{c(!1)}}},h=async e=>{if(!m)return;let t=e?r.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.":r.settings?.importConfirm||"Are you sure you want to import?";if(await (0,M.u)(t)){d(!0);try{let t=JSON.parse(await m.text()),{stats:s}=await i.k.post(e?"/api/import?all=true":"/api/import",t);M.c.success((r.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records, {papers} exam papers and {voices} cloud voice clips.").replace("{subjects}",String(s.subjectsCreated)).replace("{tags}",String(s.tagsCreated)).replace("{items}",String(s.errorItemsCreated)).replace("{schedules}",String(s.reviewSchedulesCreated)).replace("{records}",String(s.practiceRecordsCreated)).replace("{papers}",String(s.examPapersCreated??0)).replace("{voices}",String(s.ttsSpeechesImported??0)).replace("{duplicates}",String(s.duplicateErrorItems??0))),u(null),window.location.reload()}catch(t){l.V.error("[DataBackupSettings]",e?"Import all failed":"Import failed",{error:t}),M.c.error(r.settings?.importFailed||"Import failed")}finally{d(!1)}}},x=(e,s)=>e?(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}):s;return(0,t.jsxs)("div",{className:"p-4 border border-blue-200 dark:border-blue-900 rounded-lg bg-blue-50 dark:bg-blue-950/40",children:[(0,t.jsx)("h4",{className:"text-sm font-bold text-blue-900 dark:text-blue-200 mb-3",children:r.settings?.dataManagement||"Data Management"}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("span",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium",children:r.settings?.exportData||"Export Data"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>p(!1),disabled:n,className:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800",children:[x(n,(0,t.jsx)(eY.f,{className:"mr-2 h-4 w-4"})),r.settings?.exportData||"Export"]}),e&&(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>p(!0),disabled:n,className:"bg-orange-100 dark:bg-orange-900/40 hover:bg-orange-200 dark:hover:bg-orange-900/60 text-orange-900 dark:text-orange-200 border-orange-300 dark:border-orange-800",children:[x(n,(0,t.jsx)(eY.f,{className:"mr-2 h-4 w-4"})),r.settings?.exportAllData||"Export All"]})]})]}),(0,t.jsx)("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:r.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("span",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium",children:r.settings?.importData||"Import Data"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"file",accept:".json",onChange:e=>u(e.target.files?.[0]??m),className:"hidden",id:"import-file-input",disabled:o}),(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:o,className:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800",children:[x(o,(0,t.jsx)(e_,{className:"mr-2 h-4 w-4"})),m?.name||r.settings?.selectFile||"Select File"]}),m&&(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>h(!1),disabled:o,className:"bg-green-100 dark:bg-green-900/40 hover:bg-green-200 dark:hover:bg-green-900/60 text-green-900 dark:text-green-200 border-green-300 dark:border-green-800",children:[x(o,(0,t.jsx)(eK.f,{className:"mr-2 h-4 w-4"})),r.settings?.importData||"Import"]}),m&&e&&(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>h(!0),disabled:o,className:"bg-orange-100 dark:bg-orange-900/40 hover:bg-orange-200 dark:hover:bg-orange-900/60 text-orange-900 dark:text-orange-200 border-orange-300 dark:border-orange-800",children:[x(o,(0,t.jsx)(eK.f,{className:"mr-2 h-4 w-4"})),r.settings?.importAllData||"Import All"]})]})]}),(0,t.jsx)("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:r.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]})}let eJ={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};eJ.node;let eX=(0,C.f)(eJ),eQ="/api/admin/debug-logs";function e0(){let{t:e}=(0,a.b)(),{timeZone:r}=(0,y.M)(),n=e.admin.debugLog,[c,o]=(0,s.useState)(null),[d,m]=(0,s.useState)(!1),u=(0,s.useCallback)(async()=>{try{o(await i.k.get(eQ))}catch(e){l.V.warn("[DebugLogSettings]","Failed to load debug status",{error:e})}},[]);(0,s.useEffect)(()=>{u()},[u]),(0,s.useEffect)(()=>{if(!c?.enabled)return;let e=setInterval(u,5e3);return()=>clearInterval(e)},[c?.enabled,u]);let p=async(e,t)=>{m(!0);try{await e(),M.c.success(t)}catch(e){l.V.error("[DebugLogSettings]","Debug log action failed",{error:e}),M.c.error(n.failed)}finally{m(!1)}},h=e=>e?(0,J.r)(e,"yyyy-MM-dd HH:mm",r):"",x=c?.enabled?n.enabledHint.replace("{since}",h(c.enabledAt)).replace("{until}",h(c.expiresAt)):n.disabledHint,g=(c?.entryCount??0)>0;return(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(et.f,{htmlFor:"debug-mode-switch",className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(eX,{className:"h-4 w-4"}),n.title]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.desc})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:n.enable}),(0,t.jsx)(Q.f,{id:"debug-mode-switch",checked:!!c?.enabled,onCheckedChange:e=>p(async()=>{o(await i.k.post(eQ,{enabled:e}))},e?n.enabled:n.disabled),disabled:d||!c})]})]}),(0,t.jsxs)("p",{className:`text-xs ${c?.enabled?"text-orange-600":"text-muted-foreground"}`,children:[x,c&&(0,t.jsxs)(t.Fragment,{children:[" ",n.entries.replace("{count}",String(c.entryCount)),c.droppedCount>0&&n.dropped.replace("{count}",String(c.droppedCount))]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>p(async()=>{await eW(`${eQ}/export`,"wrong-notebook-debug.json"),await u()},n.exported),disabled:d||!g,className:"sm:flex-1",children:[d?(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(eY.f,{className:"mr-2 h-4 w-4"}),n.export]}),(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>p(async()=>{o(await i.k.delete(eQ))},n.cleared),disabled:d||!g,children:[(0,t.jsx)(ec.f,{className:"mr-2 h-4 w-4"}),n.clear]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.privacyNote})]})}var e1=e.i(307364);function e2({field:e,label:r,description:n}){let{t:c}=(0,a.b)(),[o,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)(!1),[p,h]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null),f=`preference-${e}`;(0,s.useEffect)(()=>{i.k.get("/api/user").then(t=>d(!!t[e])).catch(()=>void 0).finally(()=>u(!0))},[e]);let j=async t=>{d(t),h(!0);try{await i.k.patch("/api/user",{[e]:t}),g(c.importFlow.preferenceSaved)}catch(s){d(!t),g(c.importFlow.preferenceSaveFailed),l.V.error("[Settings]","Failed to save user preference",{field:e,error:s instanceof Error?s.message:String(s)})}finally{h(!1)}};return(0,t.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsx)(et.f,{htmlFor:f,children:r}),(0,t.jsx)(Q.f,{id:f,checked:o,onCheckedChange:j,disabled:!m||p})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n}),x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x})]})}function e4(){let{t:e}=(0,a.b)();return(0,t.jsx)(e2,{field:"enableGeogebra",label:e.importFlow.enableGeogebra,description:e.importFlow.enableGeogebraDesc})}function e3(){let{t:e}=(0,a.b)();return(0,t.jsx)(e2,{field:"confirmBeforeImport",label:e.importFlow.confirmBeforeImport,description:e.importFlow.confirmBeforeImportDesc})}var e5=e.i(905110);function e6(){let{t:e}=(0,a.b)(),[r,n]=(0,s.useState)(String(e5.z)),[c,o]=(0,s.useState)(null),[d,m]=(0,s.useState)(!0),[u,p]=(0,s.useState)(!1),[h,x]=(0,s.useState)(null),g=Number(r),f=""!==r.trim()&&Number.isInteger(g)&&g>=e5.P&&g<=e5.o,j=(0,s.useCallback)(async()=>{m(!0),x(null);try{let e=(await i.k.get("/api/user")).masteryThreshold??e5.z;n(String(e)),o(e)}catch(t){x(e.mastery.thresholdLoadFailed),l.V.error("[Settings]","加载已掌握阈值失败",{error:t instanceof Error?t.message:String(t)})}finally{m(!1)}},[e.mastery.thresholdLoadFailed]);(0,s.useEffect)(()=>{j()},[j]);let v=async()=>{if(f&&null!==c){p(!0),x(null);try{let t=(await i.k.patch("/api/user",{masteryThreshold:g})).masteryThreshold??g;o(t),n(String(t)),x(e.importFlow.preferenceSaved)}catch(t){x(e.importFlow.preferenceSaveFailed),l.V.error("[Settings]","保存已掌握阈值失败",{error:t instanceof Error?t.message:String(t)})}finally{p(!1)}}};return(0,t.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,t.jsx)(et.f,{htmlFor:"mastery-threshold",children:e.mastery.thresholdLabel}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(ee.f,{id:"mastery-threshold",type:"number",min:e5.P,max:e5.o,step:1,value:r,onChange:e=>{n(e.target.value),x(null)},disabled:d||u||null===c,className:"w-28","aria-describedby":"mastery-threshold-hint"}),(0,t.jsx)("span",{"aria-hidden":"true",children:"%"}),(0,t.jsxs)(Y.f,{type:"button",size:"sm",variant:"outline",onClick:v,disabled:d||u||null===c||!f||g===c,children:[(d||u)&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.importFlow.saveThreshold]}),!d&&null===c&&(0,t.jsx)(Y.f,{type:"button",size:"sm",variant:"outline",onClick:j,children:e.importFlow.retryLoad})]}),(0,t.jsx)("p",{id:"mastery-threshold-hint",className:"text-xs text-muted-foreground",children:e.mastery.thresholdDescription}),null!==c&&!f&&(0,t.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:e.mastery.thresholdInvalid}),h&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:h})]})}var e8=e.i(28342);function e9(){let{t:e}=(0,a.b)(),[r,c]=(0,s.useState)({gradeRecognitionMode:"fixed",fixedGradeSemester:null}),[o,d]=(0,s.useState)(null),[m,u]=(0,s.useState)(!0),[p,h]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null),f=(0,s.useRef)(0),j=(0,s.useCallback)(async()=>{let t=++f.current;u(!0),g(null);try{let e=await i.k.get("/api/user");if(t!==f.current)return;let s={gradeRecognitionMode:e.gradeRecognitionMode??"fixed",fixedGradeSemester:e.fixedGradeSemester??null};c(s),d(s)}catch(s){if(t!==f.current)return;g(e.questionGrade.loadFailed),l.V.error("[QuestionGradeSetting]","加载录入年级规则失败",{error:(0,n.Z)(s)})}finally{t===f.current&&u(!1)}},[e.questionGrade.loadFailed]);(0,s.useEffect)(()=>{j()},[j]);let v=async()=>{h(!0),g(null);try{let t=await i.k.patch("/api/user",r),s={gradeRecognitionMode:t.gradeRecognitionMode??r.gradeRecognitionMode,fixedGradeSemester:t.fixedGradeSemester??null};c(s),d(s),g(e.importFlow.preferenceSaved)}catch(t){g(e.importFlow.preferenceSaveFailed),l.V.error("[QuestionGradeSetting]","保存录入年级规则失败",{error:(0,n.Z)(t)})}finally{h(!1)}},b=m||p||null===o,y=o?.gradeRecognitionMode===r.gradeRecognitionMode&&o?.fixedGradeSemester===r.fixedGradeSemester;return(0,t.jsxs)("div",{className:"space-y-3 border-t pt-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{htmlFor:"question-grade-mode",children:e.questionGrade.label}),(0,t.jsxs)("select",{id:"question-grade-mode",value:r.gradeRecognitionMode,disabled:b,onChange:e=>{c({...r,gradeRecognitionMode:e.target.value}),g(null)},className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",children:[(0,t.jsx)("option",{value:"fixed",children:e.questionGrade.fixed}),(0,t.jsx)("option",{value:"ai",children:e.questionGrade.ai})]})]}),"fixed"===r.gradeRecognitionMode&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{htmlFor:"question-fixed-grade",children:e.editor.gradeSemester}),(0,t.jsx)(e8.f,{id:"question-fixed-grade",value:r.fixedGradeSemester??"",disabled:b,onChange:e=>{c({...r,fixedGradeSemester:e||null}),g(null)}})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"fixed"===r.gradeRecognitionMode?e.questionGrade.fixedDescription:e.questionGrade.aiDescription}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.questionGrade.description}),(0,t.jsxs)(Y.f,{type:"button",variant:"outline",size:"sm",disabled:b||y,onClick:v,children:[(m||p)&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.questionGrade.save]}),!m&&null===o&&(0,t.jsx)(Y.f,{type:"button",variant:"outline",size:"sm",onClick:j,children:e.importFlow.retryLoad}),x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:x})]})}function e7(){let{t:e}=(0,a.b)();return(0,t.jsx)(e2,{field:"enableSvgAnimation",label:e.importFlow.enableSvgAnimation,description:e.importFlow.enableSvgAnimationDesc})}function te({value:e,onChange:s,disabled:r}){let{t:i}=(0,a.b)();return(0,t.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,t.jsx)(et.f,{htmlFor:"app-time-zone",children:i.settings.general.timeZoneLabel}),(0,t.jsx)(ee.f,{id:"app-time-zone",value:e,onChange:e=>s(e.target.value),disabled:r,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,t.jsx)("datalist",{id:"app-time-zones",children:["Asia/Shanghai","Asia/Hong_Kong","Asia/Tokyo","Asia/Singapore","Europe/London","America/New_York","America/Los_Angeles","UTC"].map(e=>(0,t.jsx)("option",{value:e},e))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i.settings.general.timeZoneDesc})]})}function tt({config:e,setConfig:s,isAdmin:r,disabled:i}){let{t:n,language:l,setLanguage:c}=(0,a.b)(),{timeZone:o}=(0,y.M)(),d=e=>s(t=>({...t,timeouts:{...t.timeouts,analyze:1e3*e}}));return(0,t.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:n.settings?.language||"Language"}),(0,t.jsxs)(eC.d,{value:l,onValueChange:e=>c(e),children:[(0,t.jsx)(eC.P,{children:(0,t.jsx)(eC.U,{})}),(0,t.jsxs)(eC.r,{children:[(0,t.jsx)(eC.T,{value:"zh",children:"中文 (Chinese)"}),(0,t.jsx)(eC.T,{value:"en",children:"English"})]})]})]}),(0,t.jsx)(te,{value:e.timeZone??o,onChange:e=>s(t=>({...t,timeZone:e})),disabled:!r||i}),r&&(0,t.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,t.jsx)(et.f,{children:n.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,t.jsx)(ee.f,{type:"number",value:e.timeouts?.analyze?e.timeouts.analyze/1e3:"",onChange:e=>{let t=""===e.target.value?0:parseInt(e.target.value);d(isNaN(t)?0:t)},onBlur:()=>{let t=(e.timeouts?.analyze||0)/1e3,s=Math.min(600,Math.max(120,t));s!==t&&d(s)},min:120,max:600}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,t.jsx)(e3,{}),(0,t.jsx)(e9,{}),(0,t.jsx)(e7,{}),(0,t.jsx)(e4,{}),(0,t.jsx)(e1.f,{}),(0,t.jsx)(e6,{})]})}var ts=e.i(226091),ta=e.i(77071),tr=e.i(515288),ti=e.i(470279);function tn(){let{t:e}=(0,a.b)(),{groups:r,loading:n,refetch:c}=(0,ti.f)(),[o,d]=(0,s.useState)(""),[m,u]=(0,s.useState)(!1),p=async()=>{let t=o.trim();if(t){u(!0);try{await i.k.post("/api/paper-groups",{name:t}),d(""),M.c.success(e.common?.messages?.saveSuccess||"Saved"),c()}catch(t){l.V.error("[PaperGroupSettings]","Failed to add group",{error:t}),M.c.error(e.common?.messages?.saveFailed||"Failed to save")}finally{u(!1)}}},h=async(t,s)=>{let a=window.prompt(e.settings?.paperGroups?.renamePrompt||"Rename group",s);if(a&&a.trim()!==s)try{await i.k.patch(`/api/paper-groups/${t}`,{name:a.trim()}),M.c.success(e.common?.messages?.saveSuccess||"Saved"),c()}catch(t){l.V.error("[PaperGroupSettings]","Failed to rename group",{error:t}),M.c.error(e.common?.messages?.saveFailed||"Failed to save")}},x=async(t,s)=>{try{await i.k.patch(`/api/paper-groups/${t}`,{isActive:!s}),M.c.success(e.common?.messages?.saveSuccess||"Saved"),c()}catch(t){l.V.error("[PaperGroupSettings]","Failed to toggle group",{error:t}),M.c.error(e.common?.messages?.saveFailed||"Failed to save")}},g=async(t,s,a)=>{if(a>0){let r=(e.settings?.paperGroups?.deleteConfirmWithItems||'Group "{name}" has {count} questions. Deleting will clear their group assignment. Continue?').replace("{name}",s).replace("{count}",String(a));if(!await (0,M.u)(r,{destructive:!0}))return;try{await i.k.delete(`/api/paper-groups/${t}?clear=true`),M.c.success(e.common?.messages?.deleteSuccess||"Deleted"),c()}catch(t){l.V.error("[PaperGroupSettings]","Failed to delete group",{error:t}),M.c.error(e.common?.messages?.deleteFailed||"Delete failed")}return}let r=(e.settings?.paperGroups?.deleteConfirm||'Delete group "{name}"?').replace("{name}",s);if(await (0,M.u)(r,{destructive:!0}))try{await i.k.delete(`/api/paper-groups/${t}`),M.c.success(e.common?.messages?.deleteSuccess||"Deleted"),c()}catch(t){l.V.error("[PaperGroupSettings]","Failed to delete group",{error:t}),M.c.error(e.common?.messages?.deleteFailed||"Delete failed")}};return n?(0,t.jsx)(tr.N,{children:(0,t.jsx)(tr.O,{className:"py-12 flex items-center justify-center",children:(0,t.jsx)(E.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}):(0,t.jsxs)(tr.N,{children:[(0,t.jsxs)(tr.Y,{children:[(0,t.jsxs)(tr.v,{className:"flex items-center gap-2 text-lg",children:[(0,t.jsx)(ts.f,{className:"h-5 w-5"}),e.settings?.paperGroups?.title||"Paper Groups"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.settings?.paperGroups?.desc||"Customize paper groups like Unit Test, Midterm, Final. Default groups A/B/Other can be renamed but not deleted."})]}),(0,t.jsxs)(tr.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(ee.f,{value:o,onChange:e=>d(e.target.value),placeholder:e.settings?.paperGroups?.addPlaceholder||"e.g. Unit Test",onKeyDown:e=>{"Enter"===e.key&&p()}}),(0,t.jsxs)(Y.f,{onClick:p,disabled:m||!o.trim(),children:[m?(0,t.jsx)(E.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(ta.f,{className:"h-4 w-4 mr-1"}),e.common?.add||"Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:r.map(s=>(0,t.jsxs)("div",{className:`flex items-center justify-between rounded-lg border p-3 ${!s.isActive?"opacity-50":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"font-medium",children:s.name}),s.key&&(0,t.jsx)(X.f,{variant:"secondary",className:"text-xs",children:e.settings?.paperGroups?.systemBadge||"Default"}),!s.isActive&&(0,t.jsx)(X.f,{variant:"outline",className:"text-xs",children:e.common?.inactive||"Inactive"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>h(s.id,s.name),children:e.common?.rename||"Rename"}),(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:()=>x(s.id,s.isActive),children:s.isActive?e.common?.deactivate||"Deactivate":e.common?.activate||"Activate"}),!s.key&&(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>g(s.id,s.name,s._count?.errorItems||0),children:(0,t.jsx)(ec.f,{className:"h-4 w-4"})})]})]},s.id))})]})]})}var tl=e.i(624687),tc=e.i(247167);let to="[REDACTED]",td=/api[-_]?key|password|passwd|secret|authorization|cookie|credential|private[-_]?key|^(access|refresh|id|auth|api|bearer|session|csrf|setup)?[-_]?token$/i,tm=Symbol.for("wrong-notebook.debug-log");function tu(){let e=globalThis,t=e[tm];return t||(t={enabledAt:null,entries:[],totalSize:0,dropped:0},e[tm]=t),t}function tp(e){let t=e.replace(/data:([\w.+-]+\/[\w.+-]+);base64,[A-Za-z0-9+/=]+/g,(e,t)=>`[data:${t}, ${e.length} chars]`).replace(/(Bearer\s+)[\w\-.~+/]+=*/gi,`$1${to}`).replace(/\bsk-[A-Za-z0-9_-]{8,}/g,to).replace(/([?&](?:key|api_key|apikey|token|access_token)=)[^&\s"']+/gi,`$1${to}`);return t.length>1e4&&(t=`${t.slice(0,1e4)}…[truncated ${t.length-1e4} chars]`),t}function th(e,t,s,a=new Date){if(function(e=Date.now()){let t=tu();return null!==t.enabledAt&&(!(e-t.enabledAt>=864e5)||(t.enabledAt=null,!1))}(a.getTime()))try{let r={...function e(t,s=0,a=new WeakSet){if(null==t)return t;if("string"==typeof t)return tp(t);if("number"==typeof t||"boolean"==typeof t)return t;if("bigint"==typeof t)return t.toString();if("function"==typeof t||"symbol"==typeof t)return String(t);if(t instanceof Date)return t.toISOString();if(t instanceof Error){let r={name:t.name,message:tp(t.message)};return t.stack&&(r.stack=tp(t.stack)),void 0!==t.code&&(r.code=e(t.code,s+1,a)),void 0!==t.status&&(r.status=e(t.status,s+1,a)),void 0!==t.cause&&s<8&&(r.cause=e(t.cause,s+1,a)),r}if("object"!=typeof t)return String(t);if(a.has(t))return"[Circular]";if(s>=8)return"[Object]";if(a.add(t),Array.isArray(t)){let r=t.slice(0,100).map(t=>e(t,s+1,a));return t.length>100&&r.push(`…[${t.length-100} more items]`),r}return ArrayBuffer.isView(t)||t instanceof ArrayBuffer?`[Binary ${t.byteLength} bytes]`:Object.fromEntries(Object.entries(t).map(([t,r])=>[t,td.test(t)&&null!=r&&""!==r?to:e(r,s+1,a)]))}(t),time:a.toISOString(),level:e,msg:tp(s)},i=JSON.stringify(r).length,n=tu();for(n.entries.push({entry:r,size:i}),n.totalSize+=i;n.entries.length>5e3||n.totalSize>0x1400000&&n.entries.length>1;){let e=n.entries.shift();if(!e)break;n.totalSize-=e.size,n.dropped+=1}}catch{}}let tx={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};function tg(e,t={}){let s,a=tx[e],r=(s=tc.default.env.LOG_LEVEL?.toLowerCase())&&void 0!==tx[s]?tx[s]:tx.info;return(s,i)=>{let n,l,c=new Date;if("string"==typeof s?(n={},l=s):(n=s,l=i||""),th(e,{...t,...n},l,c),!(a<r)){let s=JSON.stringify({level:e,time:c.toISOString(),...t,...n,msg:l});switch(e){case"error":case"fatal":console.error(s);break;case"warn":console.warn(s);break;default:console.log(s)}}}}(function e(t={}){return t.module,{trace:tg("trace",t),debug:tg("debug",t),info:tg("info",t),warn:tg("warn",t),error:tg("error",t),fatal:tg("fatal",t),child:s=>e({...t,...s}),box:(e,s,a="📋")=>{th("info",{...t,..."string"==typeof s?{content:s}:s},e);{let a="string"==typeof s?{content:s}:s||{};console.log(JSON.stringify({level:"info",time:new Date().toISOString(),...t,title:e,...a,msg:e}));return}},divider:(e="-")=>{}}})({env:"production"}).child({module:"ai:prompts"});let tf=`请参考《高思学校竞赛数学导引》(每讲分兴趣篇、拓展篇、超越篇,题目左侧标 1~5 颗星)的星级标准,结合题目所在年级评定难度:
|
|
2
2
|
- 1 星:课本基础题,直接套用概念、公式或简单计算即可(相当于兴趣篇前几题)。
|
|
3
3
|
- 2 星:校内拔高题,需要两三步推理或简单综合(相当于兴趣篇后几题)。
|
|
4
4
|
- 3 星:常规奥数题,小升初、杯赛常见难度,需要掌握该专题的典型方法(相当于拓展篇)。
|
|
5
5
|
- 4 星:较难奥数题,需要构造、分类讨论、转化或多种方法综合(相当于拓展篇末题、超越篇前几题)。
|
|
6
6
|
- 5 星:竞赛压轴题,集训队水平,思路巧妙、步骤长(相当于超越篇难题)。
|
|
7
|
-
非数学学科按同样的 1~5 级划分:1 星为基础识记,3 星为综合应用,5 星为竞赛或压轴难度。`,
|
|
7
|
+
非数学学科按同样的 1~5 级划分:1 星为基础识记,3 星为综合应用,5 星为竞赛或压轴难度。`,tj=`- 输出一个完整的 <svg> 元素,包含 xmlns="http://www.w3.org/2000/svg" 和 viewBox(建议宽 400~600),不要用 Markdown 代码块包裹。
|
|
8
8
|
- 白色背景、黑色线条(stroke="#000",线宽 1.5~2),需要区分的区域可用浅灰填充;不要使用彩色装饰。
|
|
9
9
|
- 按原图比例和相对位置绘制,保留原题印刷标注:顶点字母、数字、长度、角度、单位、箭头和虚线等,文字用 <text>(font-size 14~18);必须过滤掉人在图上手写的草稿、演算、思考批注、圈画和涂改痕迹。
|
|
10
10
|
- 只使用基本图形元素:line、polyline、polygon、rect、circle、ellipse、path、text、g、defs、marker。
|
|
11
|
-
- 严禁使用 <image>、<script>、<foreignObject>、外部链接、外部字体或事件属性。`,
|
|
11
|
+
- 严禁使用 <image>、<script>、<foreignObject>、外部链接、外部字体或事件属性。`,tv=String.raw`- 行内公式用 $...$,独立公式用 $$...$$;不要用 \(...\) 或 \[...\],每个 $ 必须成对出现。
|
|
12
12
|
- 所有 LaTeX 命令(如 \frac、\sqrt、\times、\angle)都必须写在 $...$ 内,公式外不能出现反斜杠命令。
|
|
13
13
|
- 只使用 KaTeX 支持的命令和环境:方程组用 \begin{cases}...\end{cases},多行推导用 \begin{aligned}...\end{aligned}(放在 $$...$$ 中),不要用 align、eqnarray、\newcommand、\usepackage、\label、\tag 等。
|
|
14
14
|
- 大括号 {} 必须成对,\left 与 \right 必须成对,\begin{...} 与 \end{...} 必须对应。
|
|
15
15
|
- 公式中的中文写在 \text{...} 里,或放到公式外;百分号写成 \%,美元符号写成 \$。
|
|
16
|
-
- 反斜杠只写一个(\frac),不要写成 \\frac;换行符 \\ 只能用在 cases、aligned 等环境里。`,
|
|
16
|
+
- 反斜杠只写一个(\frac),不要写成 \\frac;换行符 \\ 只能用在 cases、aligned 等环境里。`,tb=`【角色与核心任务 (ROLE AND CORE TASK)】
|
|
17
17
|
你是一位世界顶尖的、经验丰富的、专业的跨学科考试分析专家(Interdisciplinary Exam Analysis Expert)。你的核心任务是极致准确地分析用户提供的考试题目图片,全面理解所有文本、图表和隐含约束,并提供一个完整、高度结构化且专业的解决方案。
|
|
18
18
|
|
|
19
19
|
{{language_instruction}}
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
<figure_svg>
|
|
43
43
|
如果 has_figure 为 true,用 SVG 重新绘制题目配图:
|
|
44
|
-
${
|
|
44
|
+
${tj}
|
|
45
45
|
如果 has_figure 为 false,请留空。
|
|
46
46
|
</figure_svg>
|
|
47
47
|
|
|
@@ -55,7 +55,7 @@ ${tb}
|
|
|
55
55
|
|
|
56
56
|
<difficulty_stars>
|
|
57
57
|
只填写 1 到 5 之间的一个整数,表示题目难度星级。
|
|
58
|
-
${
|
|
58
|
+
${tf}
|
|
59
59
|
</difficulty_stars>
|
|
60
60
|
|
|
61
61
|
<mistake_analysis>
|
|
@@ -132,10 +132,10 @@ ${tv}
|
|
|
132
132
|
3. **内容完整**:如果包含子问题,请在 question_text 中完整列出。
|
|
133
133
|
4. **禁止图片**:严禁包含任何图片链接或 markdown 图片语法。
|
|
134
134
|
5. **LaTeX 规范**:
|
|
135
|
-
${
|
|
135
|
+
${tv}
|
|
136
136
|
|
|
137
137
|
{{grade_instruction}}
|
|
138
|
-
{{provider_hints}}`,
|
|
138
|
+
{{provider_hints}}`,ty=`你是一位资深的K12教育题目生成专家,具备跨学科的题目创作能力。你的核心任务是**根据以下原题和知识点,举一反三生成高质量教学题目**,帮助学生巩固知识并拓展解题思路。
|
|
139
139
|
### 角色定义
|
|
140
140
|
1. **学科全能专家**
|
|
141
141
|
- 精通K12阶段所有学科(数学/语文/英语/物理/化学/生物/历史/地理/政治)
|
|
@@ -187,7 +187,7 @@ ${ty}
|
|
|
187
187
|
###关键格式与内容约束 (CRITICAL RULES) !!!
|
|
188
188
|
1. **纯文本**:内容作为纯文本处理,**不要转义反斜杠**。
|
|
189
189
|
2. **LaTeX 规范**:
|
|
190
|
-
${
|
|
190
|
+
${tv}
|
|
191
191
|
|
|
192
192
|
{{grade_instruction}}
|
|
193
|
-
{{provider_hints}}`;tj.I.join("、"),tj.r.join("、");var tN=e.i(395925);function tS({name:e,description:s}){return(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-2 text-xs py-1",children:[(0,t.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-primary shrink-0 w-fit",children:`{{${e}}}`}),(0,t.jsx)("span",{className:"text-muted-foreground",children:s})]})}function tC(){let{t:e}=(0,a.b)();return(0,t.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-950/40 border border-amber-200 dark:border-amber-900 rounded-md p-3 flex items-start gap-3 text-amber-900 dark:text-amber-200 text-sm mb-4",children:[(0,t.jsx)(L.f,{className:"h-5 w-5 shrink-0 text-amber-600"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"font-medium",children:e.settings?.prompts?.caution||"Modify with Caution"}),(0,t.jsx)("p",{className:"text-amber-800/90 dark:text-amber-200 text-xs",children:e.settings?.prompts?.warning||"Variables in {{brackets}} are used to inject dynamic content. Please preserve these variables, otherwise the AI providing may fail to get question context or return invalid formats."})]})]})}function tT({config:e,onUpdate:s}){let{t:r}=(0,a.b)(),i=e.prompts?.analyze||tw,n=e.prompts?.similar||tk,l=async e=>{await (0,M.u)(r.settings?.prompts?.resetConfirm||"Are you sure you want to reset to default?",{destructive:!0})&&s(e,"analyze"===e?tw:tk)},c=(e,t)=>{s(e,t)};return(0,t.jsx)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:(0,t.jsxs)(Z.i,{defaultValue:"analyze",className:"w-full",children:[(0,t.jsxs)(Z.U,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(Z.k,{value:"analyze",children:r.settings?.prompts?.analysisTab||"Analysis Prompt"}),(0,t.jsx)(Z.k,{value:"similar",children:r.settings?.prompts?.similarTab||"Similar Question Prompt"})]}),(0,t.jsx)(Z.S,{value:"analyze",className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)(et.f,{className:"text-base font-semibold",children:r.settings?.prompts?.customAnalysis||"Custom Analysis Template"}),(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>l("analyze"),children:[(0,t.jsx)(tN.f,{className:"w-4 h-4 mr-2"}),r.settings?.prompts?.reset||"Reset Default"]})]}),(0,t.jsx)(tC,{}),(0,t.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,t.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,t.jsx)(P,{className:"h-3.5 w-3.5"}),r.settings?.prompts?.variables||"Available Variables"]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(tS,{name:"language_instruction",description:r.settings?.prompts?.vars?.languageInstruction||"Injects instructions based on target language (e.g., keep English questions in English but analysis in Chinese)."}),(0,t.jsx)(tS,{name:"knowledge_points_list",description:r.settings?.prompts?.vars?.knowledgePointsList||"Injects the standard list of knowledge point tags for the specific subject."}),(0,t.jsx)(tS,{name:"provider_hints",description:r.settings?.prompts?.vars?.providerHints||"Provider compatibility hints that follow the application output contract."})]})]}),(0,t.jsx)(tl.f,{value:i,onChange:e=>c("analyze",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:tw})]})}),(0,t.jsx)(Z.S,{value:"similar",className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)(et.f,{className:"text-base font-semibold",children:r.settings?.prompts?.customSimilar||"Custom Similar Question Template"}),(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>l("similar"),children:[(0,t.jsx)(tN.f,{className:"w-4 h-4 mr-2"}),r.settings?.prompts?.reset||"Reset Default"]})]}),(0,t.jsx)(tC,{}),(0,t.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,t.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,t.jsx)(P,{className:"h-3.5 w-3.5"}),r.settings?.prompts?.variables||"Available Variables"]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(tS,{name:"difficulty_level",description:r.settings?.prompts?.vars?.difficultyLevel||"Target difficulty level."}),(0,t.jsx)(tS,{name:"difficulty_instruction",description:r.settings?.prompts?.vars?.difficultyInstruction||"Specific writing instructions for the target difficulty."}),(0,t.jsx)(tS,{name:"original_question",description:r.settings?.prompts?.vars?.originalQuestion||"The full text of the original question."}),(0,t.jsx)(tS,{name:"knowledge_points",description:r.settings?.prompts?.vars?.knowledgePoints||"List of knowledge points to test."}),(0,t.jsx)(tS,{name:"language_instruction",description:r.settings?.prompts?.vars?.languageInstructionShort||"Language formatting instructions."})]})]}),(0,t.jsx)(tl.f,{value:n,onChange:e=>c("similar",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:tk})]})})]})})}var tA=e.i(21357),tE=e.i(434901),tz=e.i(753817),tM=e.i(128093),tF=e.i(79058);let t_=["browser","minimax","qwen","glm","stepfun","volcengine","volcengine-agent","openai"];t_.filter(e=>"browser"!==e);let tD={minimax:{model:"speech-2.8-hd",voice:"male-qn-jingying"},qwen:{model:"qwen-audio-3.0-tts-plus",voice:"longanlufeng"},glm:{model:"glm-tts",voice:"xiaochen"},stepfun:{model:"stepaudio-2.5-tts",voice:"qingniandaxuesheng"},volcengine:{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},"volcengine-agent":{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},openai:{model:"gpt-4o-mini-tts",voice:"cedar"}},tL={minimax:{apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",model:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http",voice:"https://platform.minimax.cn/docs/faq/system-voice-id",endpoint:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http"},qwen:{apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",model:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide",voice:"https://help.aliyun.com/zh/model-studio/qwen-audio-tts-voice-list",endpoint:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide"},glm:{apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",model:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",voice:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",endpoint:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3"},stepfun:{apiKey:"https://platform.stepfun.com/docs/zh/step-plan/integrations/audio-api",model:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio",voice:"https://platform.stepfun.com/docs/zh/guides/developer/tts",endpoint:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio"},volcengine:{apiKey:"https://www.volcengine.com/docs/6561/196768",model:"https://www.volcengine.com/docs/6561/1598757",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://www.volcengine.com/docs/6561/1598757"},openai:{apiKey:"https://platform.openai.com/docs/quickstart",model:"https://developers.openai.com/api/docs/guides/text-to-speech",voice:"https://developers.openai.com/api/docs/guides/text-to-speech",endpoint:"https://developers.openai.com/api/docs/guides/text-to-speech"},"volcengine-agent":{apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",model:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh"}},t$={volcengine:"https://docs.volcengine.com/docs/ark/free-inference-quota?lang=zh"};function tR({config:e,setConfig:r,saving:c,onSave:o}){var d;let{t:m,language:u}=(0,a.b)(),p=m.settings.tts,[h,x]=(0,s.useState)(!1),[g,f]=(0,s.useState)(null),j=e.tts?.mode??"browser",v="browser"!==j&&"string"==typeof(d=j)&&t_.includes(d)?j:null,b=v?e.tts?.[v]:void 0,y=(e,t)=>{v&&r(s=>({...s,tts:{...s.tts,[v]:{...s.tts?.[v],[e]:t}}}))},w=!!v&&("volcengine"===v||"openai"===v),k=v?function(e,t){if("openai"===t){let t=e.openai?.instances?.find(t=>t.id===e.openai?.activeInstanceId);return t?{apiKey:t.apiKey,baseUrl:t.baseUrl}:void 0}return e[t]}(e,v):void 0,N=w?b?.apiKey:k?.apiKey,S=async()=>{(0,tF.p)(),x(!0),f(null);try{await o();let{id:e,version:t}=await i.k.post("/api/tts",{text:p.previewText,language:u},{timeout:12e4,recoverable:!0}),s=(0,tF.l)();if(!s)return;s.src=`/api/tts/${e}?v=${t}`,s.playbackRate=1,await s.play()}catch(t){l.V.error("[TtsSettings]","Preview failed",{error:t});let e=(0,n.d)(t);M.c.error("TTS_NOT_CONFIGURED"===e?p.notConfigured:"TTS_PROVIDER_ERROR"===e?p.providerError:p.previewFailed),f((0,n.L)(t)??null)}finally{x(!1)}};return(0,t.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:p.title}),(0,t.jsxs)(eC.d,{value:j,onValueChange:e=>r(t=>({...t,tts:{...t.tts,mode:e}})),children:[(0,t.jsx)(eC.P,{children:(0,t.jsx)(eC.U,{})}),(0,t.jsx)(eC.r,{children:t_.map(e=>(0,t.jsx)(eC.T,{value:e,children:p.modes[e]},e))})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:v?p.cloudHint:p.browserHint})]}),v&&(0,t.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[t$[v]&&(0,t.jsxs)("div",{className:"rounded-md border border-green-200 bg-green-50 p-3 text-xs text-green-800 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",children:[p.freeTrial," ",(0,t.jsx)("a",{href:t$[v],target:"_blank",rel:"noopener noreferrer",className:"underline",children:p.freeTrialLink})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(tE.f,{label:"openai"===v?"OpenAI API Key":w?p.speechApiKey:`${(0,tM.z)(v,u)} API Key`,href:tL[v].apiKey,linkText:m.settings.ai.docLinks.apiKey}),(0,t.jsx)(eS.f,{value:N||"",onChange:e=>{var t;return t=e.target.value,void(v&&(w?y("apiKey",t):r(e=>({...e,[v]:{...e[v],apiKey:t}}))))},placeholder:"qwen"===v?"sk-sp-...":w?"":"sk-..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p.apiKeyHint[v]})]}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(tE.f,{label:p.model,href:tL[v].model,linkText:p.docs}),(0,t.jsx)(ee.f,{value:b?.model||"",onChange:e=>y("model",e.target.value),placeholder:tD[v].model})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(tE.f,{label:p.voice,href:tL[v].voice,linkText:p.voiceList}),(0,t.jsx)(ee.f,{value:b?.voice||"",onChange:e=>y("voice",e.target.value),placeholder:tD[v].voice})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p.voiceHint[v]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(tE.f,{label:p.endpoint,href:tL[v].endpoint,linkText:p.docs}),(0,t.jsx)(ee.f,{value:b?.endpoint||"",onChange:e=>y("endpoint",e.target.value),placeholder:function(e,t){if("volcengine"===e)return"https://openspeech.bytedance.com/api/v3/tts/unidirectional";if("volcengine-agent"===e)return"https://openspeech.bytedance.com/api/v3/plan/tts/unidirectional";if("openai"===e)return`${(t?.baseUrl||"https://api.openai.com/v1").replace(/\/+$/,"")}/audio/speech`;let{baseUrl:s}=(0,tM.k)(e,t);if("minimax"===e)return`${s.replace(/\/+$/,"")}/t2a_v2`;if("glm"===e||"stepfun"===e)return`${s.replace(/\/+$/,"")}/audio/speech`;try{return`${new URL(s).origin}/api/v1/services/audio/tts/SpeechSynthesizer`}catch{return""}}(v,k)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p.endpointHint})]})]},v),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[v&&(0,t.jsxs)(Y.f,{variant:"outline",onClick:S,disabled:c||h,className:"sm:w-auto",children:[h?(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(tA.f,{className:"mr-2 h-4 w-4"}),p.preview]}),(0,t.jsxs)(Y.f,{onClick:()=>void o(),disabled:c||h,className:"flex-1",children:[c&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),p.save]})]}),v&&g&&(0,t.jsx)("div",{className:"rounded-md border border-red-200 bg-red-50 p-2 dark:border-red-900 dark:bg-red-950/40",children:(0,t.jsx)(tz.f,{detail:g})})]})}var tI=e.i(835467);function tG({value:e,icon:s,label:a}){return(0,t.jsxs)(Z.k,{value:e,className:"px-2 sm:px-3",children:[s,(0,t.jsx)("span",{className:"hidden sm:inline",children:a})]})}function tP(){let{setTimeZone:e}=(0,y.M)(),{data:n}=(0,r.useSession)(),c=n?.user?.role==="admin",{t:o}=(0,a.b)(),d=(0,N.useRouter)(),[m,u]=(0,s.useState)(!1),p=(0,s.useRef)(null),[h,x]=(0,s.useState)(!1),[g,f]=(0,s.useState)(!1),[j,v]=(0,s.useState)({aiProvider:"minimax"}),b=(0,s.useCallback)(async()=>{f(!0);try{v(await i.k.get("/api/settings"))}catch(e){l.V.error("[SettingsDialog]","Failed to fetch settings",{error:e})}finally{f(!1)}},[]);(0,s.useEffect)(()=>{m&&b()},[m,b]);let w=async()=>{let t=(0,tI.f)(j,o);if(t)return void M.c.error(t);x(!0);try{let t=await i.k.post("/api/settings",j);v(t),e(t.timeZone||J.J),M.c.success(o.settings?.messages?.saved||"Settings saved"),p.current?.scrollTo({top:0,behavior:"smooth"})}catch(e){l.V.error("[SettingsDialog]","Failed to save settings",{error:e}),M.c.error(o.settings?.messages?.saveFailed||"Failed to save")}finally{x(!1)}},k=e=>(0,t.jsxs)(Y.f,{onClick:w,disabled:h,className:"w-full",children:[h&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),e]});return(0,t.jsxs)(W.N,{open:m,onOpenChange:u,children:[(0,t.jsx)(W.a,{asChild:!0,children:(0,t.jsxs)(Y.f,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,t.jsx)(H,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"sr-only",children:o.settings?.title||"Settings"})]})}),(0,t.jsxs)(W.d,{ref:p,className:"w-[calc(100vw-2rem)] sm:max-w-[900px] max-h-[85vh] overflow-y-auto",children:[(0,t.jsxs)(W.s,{children:[(0,t.jsx)(W.F,{children:o.settings?.title||"Settings"}),(0,t.jsx)(W.C,{children:o.settings?.desc||"Manage your preferences and data."})]}),(0,t.jsxs)(Z.i,{defaultValue:"general",className:"w-full",children:[(0,t.jsxs)(Z.U,{className:`grid w-full grid-cols-4 ${c?"sm:grid-cols-7":"sm:grid-cols-4"} gap-1 h-auto`,children:[(0,t.jsx)(tG,{value:"general",icon:(0,t.jsx)(q.f,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.general||"General"}),(0,t.jsx)(tG,{value:"account",icon:(0,t.jsx)(B.f,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.account||"Account"}),c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tG,{value:"ai",icon:(0,t.jsx)(I,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.ai||"AI Provider"}),(0,t.jsx)(tG,{value:"prompts",icon:(0,t.jsx)(U,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.prompts||"Prompts"}),(0,t.jsx)(tG,{value:"admin",icon:(0,t.jsx)(A,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.admin||"User Management"})]}),(0,t.jsx)(tG,{value:"danger",icon:(0,t.jsx)(L.f,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.danger||"Danger"}),(0,t.jsx)(tG,{value:"about",icon:(0,t.jsx)(P,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.about||"About"})]}),(0,t.jsxs)(Z.S,{value:"general",className:"space-y-4 py-4",children:[(0,t.jsx)(tt,{config:j,setConfig:v,isAdmin:c,disabled:g||h}),(0,t.jsx)(tn,{}),c&&k(o.settings?.save||"Save Settings")]}),(0,t.jsx)(Z.S,{value:"account",className:"space-y-4 py-4",children:(0,t.jsx)(eE,{})}),(0,t.jsxs)(Z.S,{value:"ai",className:"space-y-4 py-4",children:[(0,t.jsx)(ez.f,{config:j,setConfig:v,loading:g,saving:h,onSave:w}),!g&&(0,t.jsx)(tR,{config:j,setConfig:v,saving:h,onSave:w})]}),(0,t.jsxs)(Z.S,{value:"prompts",className:"space-y-4 py-4",children:[(0,t.jsx)(tT,{config:j,onUpdate:(e,t)=>v(s=>({...s,prompts:{...s.prompts,[e]:t}}))}),k(o.settings?.prompts?.save||"Save Prompt Settings")]}),c&&(0,t.jsxs)(Z.S,{value:"admin",className:"space-y-4 py-4",children:[(0,t.jsxs)(Y.f,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{u(!1),d.push("/admin")},children:[(0,t.jsx)($.f,{className:"h-4 w-4"}),o.admin?.dashboard?.title||"Admin Dashboard"]}),(0,t.jsxs)(Y.f,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{u(!1),d.push("/setup")},children:[(0,t.jsx)(K.f,{className:"h-4 w-4"}),o.setup.rerun]}),(0,t.jsx)(e0,{}),(0,t.jsx)(eV,{}),(0,t.jsx)("div",{className:"border-t pt-4",children:(0,t.jsx)(ep,{})})]}),(0,t.jsx)(Z.S,{value:"danger",className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eZ,{isAdmin:c}),(0,t.jsx)(eB,{isAdmin:c})]})}),(0,t.jsx)(Z.S,{value:"about",className:"space-y-4 py-4",children:(0,t.jsx)(eN,{})})]})]})]})}var tq=e.i(446513);let tV={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};tV.node;let tU=(0,C.f)(tV),tO={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};tO.node;let tH=(0,C.f)(tO);var tB=e.i(755146);let tK={system:tq.f,light:tH,dark:tU};function tY(){let{t:e}=(0,a.b)(),{preference:r,setPreference:i}=(0,s.useContext)(u),n=tK[r],l=`${e.theme.toggle}: ${e.theme[r]}`;return(0,t.jsxs)(tB.G,{children:[(0,t.jsx)(tB.X,{asChild:!0,children:(0,t.jsx)(Y.f,{variant:"ghost",size:"icon",className:"rounded-full",title:l,"aria-label":l,children:(0,t.jsx)(n,{className:"h-5 w-5"})})}),(0,t.jsx)(tB.L,{align:"end",children:(0,t.jsx)(tB.O,{value:r,onValueChange:e=>{m(e)&&i(e)},children:c.map(s=>{let a=tK[s];return(0,t.jsxs)(tB.T,{value:s,className:"gap-2",children:[(0,t.jsx)(a,{className:"h-4 w-4"}),e.theme[s]]},s)})})})]})}var tW=e.i(975153);let tZ={name:"circle-plus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],aliases:["plus-circle"]};tZ.node;let tJ=(0,C.f)(tZ),tX=[/^\/login/,/^\/register/,/^\/setup/,/^\/print-preview/,/^\/exams\/[^/]+\/print/],tQ=[{key:"home",href:"/",icon:tJ,match:e=>"/"===e},{key:"notebooks",href:"/notebooks",icon:eM.f,match:e=>e.startsWith("/notebooks")||e.startsWith("/error-items")||e.startsWith("/practice")},{key:"review",href:"/review",icon:tW.f,match:e=>e.startsWith("/review")},{key:"stats",href:"/stats",icon:$.f,match:e=>e.startsWith("/stats")||e.startsWith("/tags")},{key:"exams",href:"/exams",icon:ts.f,match:e=>e.startsWith("/exams")}];function t0({children:e}){var n;let c,o,d=(0,N.usePathname)()||"/",{t:m}=(0,a.b)(),{data:u,status:p}=(0,r.useSession)(),h=u?.user?.role==="admin",x=tX.some(e=>e.test(d));if(n=h&&!x,c=(0,N.useRouter)(),o=(0,s.useRef)(!1),(0,s.useEffect)(()=>{n&&!o.current&&(o.current=!0,i.k.get("/api/setup").then(e=>{e.needsSetup&&c.replace("/setup")}).catch(e=>l.V.warn("[Setup]","Failed to check setup status",{error:e})))},[n,c]),x||"unauthenticated"===p)return(0,t.jsx)(t.Fragment,{children:e});let g=u?.user?.name||u?.user?.email||"";return(0,t.jsxs)("div",{className:"min-h-screen",children:[(0,t.jsx)("header",{className:"sticky top-0 z-40 border-b bg-card/80 backdrop-blur-md supports-[backdrop-filter]:bg-card/70 print:hidden",children:(0,t.jsxs)("div",{className:"mx-auto flex h-14 max-w-6xl items-center gap-3 px-4 md:h-16 md:px-8",children:[(0,t.jsxs)(k.default,{href:"/",className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)(w.default,{src:"/icons/icon.png",alt:"",width:32,height:32,className:"rounded-lg",priority:!0,unoptimized:!0}),(0,t.jsx)("span",{className:"hidden text-base font-semibold tracking-tight sm:inline",children:m.pageTitle.base})]}),(0,t.jsx)("nav",{className:"ml-4 hidden items-center gap-1 md:flex",children:tQ.map(e=>{let s=e.match(d),a=e.icon;return(0,t.jsxs)(k.default,{href:e.href,className:(0,_.f)("flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors",s?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),"aria-current":s?"page":void 0,children:[(0,t.jsx)(a,{className:"h-4 w-4"}),m.nav[e.key]]},e.key)})}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[g&&(0,t.jsxs)("span",{className:"mr-2 hidden max-w-40 items-center gap-2 truncate text-sm text-muted-foreground lg:flex",children:[(0,t.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary",children:g.slice(0,1).toUpperCase()}),(0,t.jsx)("span",{className:"truncate",children:g})]}),h&&(0,t.jsx)(k.default,{href:"/admin",title:m.nav.admin,children:(0,t.jsxs)(Y.f,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,t.jsx)(A,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"sr-only",children:m.nav.admin})]})}),(0,t.jsx)(D,{className:"mr-1"}),(0,t.jsx)(tY,{}),(0,t.jsx)(tP,{}),(0,t.jsx)(Y.f,{variant:"ghost",size:"icon",className:"rounded-full text-muted-foreground hover:text-destructive",onClick:()=>(0,r.signOut)({callbackUrl:"/login"}),title:m.app.logout,children:(0,t.jsx)(S.f,{className:"h-5 w-5"})})]})]})}),(0,t.jsx)("div",{className:"pb-20 md:pb-0",children:e}),(0,t.jsx)("nav",{className:"pb-safe fixed inset-x-0 bottom-0 z-40 border-t bg-card/90 backdrop-blur-md md:hidden print:hidden",children:(0,t.jsx)("div",{className:"grid h-16",style:{gridTemplateColumns:`repeat(${tQ.length}, minmax(0, 1fr))`},children:tQ.map(e=>{let s=e.match(d),a=e.icon;return(0,t.jsxs)(k.default,{href:e.href,className:(0,_.f)("flex flex-col items-center justify-center gap-1 text-[11px] font-medium transition-colors",s?"text-primary":"text-muted-foreground"),"aria-current":s?"page":void 0,children:[(0,t.jsx)("span",{className:(0,_.f)("flex h-7 w-12 items-center justify-center rounded-full transition-colors",s&&"bg-accent"),children:(0,t.jsx)(a,{className:"h-5 w-5"})}),m.nav[e.key]]},e.key)})})})]})}let t1={name:"list-todo",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]};t1.node;let t2=(0,C.f)(t1);var t4=e.i(583967);let t3=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/];function t5(){let{t:e}=(0,a.b)(),{timeZone:n}=(0,y.M)(),{status:l}=(0,r.useSession)(),c=(0,N.usePathname)(),[o,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)([]),[p,h]=(0,s.useState)(()=>Date.now()),x="authenticated"!==l||t3.some(e=>e.test(c||"")),g=(0,s.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{let e=await i.k.get("/api/tasks");u(e.tasks),h(Date.now())}catch{}},[]);if((0,s.useEffect)(()=>{if(x)return;let e=setTimeout(g,0),t=setInterval(g,o?2e3:15e3);return()=>{clearTimeout(e),clearInterval(t)}},[x,o,g]),x)return null;let f=m.filter(e=>"running"===e.status).length,j=m.some(e=>"running"!==e.status),v=async()=>{try{let e=await i.k.delete("/api/tasks");u(e.tasks)}catch{}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(Y.f,{variant:"outline",size:"icon",className:"fixed bottom-20 right-4 z-40 h-11 w-11 rounded-full shadow-lg md:bottom-6 md:right-6 print:hidden",onClick:()=>d(!0),"aria-label":e.backgroundTasks.title,title:e.backgroundTasks.title,children:[f>0?(0,t.jsx)(E.f,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(t2,{className:"h-5 w-5"}),f>0&&(0,t.jsx)("span",{className:"absolute -right-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs text-primary-foreground",children:f})]}),(0,t.jsx)(W.N,{open:o,onOpenChange:d,children:(0,t.jsxs)(W.d,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,t.jsxs)(W.s,{children:[(0,t.jsx)(W.F,{children:e.backgroundTasks.title}),(0,t.jsx)(W.C,{children:e.backgroundTasks.description})]}),0===m.length?(0,t.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:e.backgroundTasks.empty}):(0,t.jsx)("ul",{className:"space-y-2",children:m.map(s=>{var a,r;let i;return(0,t.jsx)("li",{className:"rounded-md border p-3 text-sm",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:["running"===s.status&&(0,t.jsx)(E.f,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-primary"}),"succeeded"===s.status&&(0,t.jsx)(eK.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),"failed"===s.status&&(0,t.jsx)(t4.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"font-medium",children:[e.backgroundTasks.kinds[s.kind],(0,t.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",e.backgroundTasks.status[s.status]]})]}),s.subject&&(0,t.jsx)("div",{className:"break-words text-muted-foreground",children:s.subject}),s.progress&&s.progress.total>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-muted",children:(0,t.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.round(s.progress.done/s.progress.total*100)}%`}})}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e.backgroundTasks.progress.replace("{done}",String(s.progress.done)).replace("{total}",String(s.progress.total)),s.progress.failed>0&&` \xb7 ${e.backgroundTasks.failedCount.replace("{count}",String(s.progress.failed))}`]})]}),s.error&&(0,t.jsx)("div",{className:"text-xs text-destructive",children:(t=>{if(!t)return null;let s=e.backgroundTasks.errors[t]??e.errors[t];return"string"==typeof s?s:t})(s.error)}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:e.backgroundTasks.startedAt.replace("{time}",(0,J.r)(s.startedAt,"HH:mm:ss",n))}),(0,t.jsx)("span",{children:e.backgroundTasks.elapsed.replace("{time}",(a=s.startedAt,r=s.finishedAt,i=Math.max(0,Math.round(((r?Date.parse(r):p)-Date.parse(a))/1e3)),`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`))}),s.link&&(0,t.jsx)(k.default,{href:s.link,className:"text-primary hover:underline",onClick:()=>d(!1),children:e.backgroundTasks.view})]})]})]})},s.id)})}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.backgroundTasks.retentionHint}),j&&(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:v,children:e.backgroundTasks.clearFinished})]})]})})]})}var t6=e.i(263676);let t8={success:{icon:eK.f,className:"text-success"},error:{icon:t4.f,className:"text-destructive"},warning:{icon:L.f,className:"text-warning"},info:{icon:P,className:"text-primary"}};function t9(){let{t:e}=(0,a.b)(),[r,i]=(0,s.useState)([]),[n,l]=(0,s.useState)(null);return(0,s.useEffect)(()=>(0,M.M)(e=>{i(e.toasts),l(e.confirm)}),[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pointer-events-none fixed inset-x-0 top-3 z-[100] flex flex-col items-center gap-2 px-4 print:hidden",role:"status","aria-live":"polite",children:r.map(s=>{let{icon:a,className:r}=t8[s.type];return(0,t.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-sm items-start gap-3 rounded-xl border bg-card/95 px-4 py-3 text-sm shadow-lg backdrop-blur animate-in fade-in slide-in-from-top-2 duration-200",children:[(0,t.jsx)(a,{className:(0,_.f)("mt-0.5 h-4 w-4 shrink-0",r)}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:s.message}),(0,t.jsx)("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>(0,M.p)(s.id),"aria-label":e.common.close,children:(0,t.jsx)(t6.X,{className:"h-3.5 w-3.5"})})]},s.id)})}),(0,t.jsx)(W.N,{open:!!n,onOpenChange:e=>{e||n?.resolve(!1)},children:(0,t.jsxs)(W.d,{className:"sm:max-w-md",children:[(0,t.jsxs)(W.s,{children:[(0,t.jsxs)(W.F,{className:"flex items-center gap-2",children:[n?.destructive&&(0,t.jsx)(L.f,{className:"h-5 w-5 text-destructive"}),n?.title||e.common.confirmTitle]}),(0,t.jsx)(W.C,{className:"whitespace-pre-line pt-1 text-left leading-relaxed",children:n?.message})]}),(0,t.jsxs)(W.c,{className:"gap-2",children:[(0,t.jsx)(Y.f,{variant:"outline",onClick:()=>n?.resolve(!1),children:n?.cancelText||e.common.cancel}),(0,t.jsx)(Y.f,{variant:n?.destructive?"destructive":"default",onClick:()=>n?.resolve(!0),autoFocus:!0,children:n?.confirmText||e.common.confirm})]})]})})]})}function t7(){return(0,s.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js",{scope:"/"}).catch(e=>{l.V.warn("[PWA]","Service worker registration failed",{error:String(e)})})},[]),null}e.s(["Providers",0,function({children:e,timeZone:i}){return(0,s.useEffect)(()=>(0,l.m)(),[]),(0,t.jsx)(r.SessionProvider,{children:(0,t.jsx)(b,{children:(0,t.jsx)(a.w,{children:(0,t.jsxs)(y.n,{initialTimeZone:i,children:[(0,t.jsx)(t0,{children:e}),(0,t.jsx)(t5,{}),(0,t.jsx)(t9,{}),(0,t.jsx)(t7,{})]})})})})}],1661)}]);
|
|
193
|
+
{{provider_hints}}`;var tw=e.i(113381);tw.I.join("、"),tw.r.join("、");var tk=e.i(395925);function tN({name:e,description:s}){return(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-2 text-xs py-1",children:[(0,t.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-primary shrink-0 w-fit",children:`{{${e}}}`}),(0,t.jsx)("span",{className:"text-muted-foreground",children:s})]})}function tS(){let{t:e}=(0,a.b)();return(0,t.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-950/40 border border-amber-200 dark:border-amber-900 rounded-md p-3 flex items-start gap-3 text-amber-900 dark:text-amber-200 text-sm mb-4",children:[(0,t.jsx)(L.f,{className:"h-5 w-5 shrink-0 text-amber-600"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"font-medium",children:e.settings?.prompts?.caution||"Modify with Caution"}),(0,t.jsx)("p",{className:"text-amber-800/90 dark:text-amber-200 text-xs",children:e.settings?.prompts?.warning||"Variables in {{brackets}} are used to inject dynamic content. Please preserve these variables, otherwise the AI providing may fail to get question context or return invalid formats."})]})]})}function tC({config:e,onUpdate:s}){let{t:r}=(0,a.b)(),i=e.prompts?.analyze||tb,n=e.prompts?.similar||ty,l=async e=>{await (0,M.u)(r.settings?.prompts?.resetConfirm||"Are you sure you want to reset to default?",{destructive:!0})&&s(e,"analyze"===e?tb:ty)},c=(e,t)=>{s(e,t)};return(0,t.jsx)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:(0,t.jsxs)(Z.i,{defaultValue:"analyze",className:"w-full",children:[(0,t.jsxs)(Z.U,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(Z.k,{value:"analyze",children:r.settings?.prompts?.analysisTab||"Analysis Prompt"}),(0,t.jsx)(Z.k,{value:"similar",children:r.settings?.prompts?.similarTab||"Similar Question Prompt"})]}),(0,t.jsx)(Z.S,{value:"analyze",className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)(et.f,{className:"text-base font-semibold",children:r.settings?.prompts?.customAnalysis||"Custom Analysis Template"}),(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>l("analyze"),children:[(0,t.jsx)(tk.f,{className:"w-4 h-4 mr-2"}),r.settings?.prompts?.reset||"Reset Default"]})]}),(0,t.jsx)(tS,{}),(0,t.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,t.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,t.jsx)(P,{className:"h-3.5 w-3.5"}),r.settings?.prompts?.variables||"Available Variables"]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(tN,{name:"language_instruction",description:r.settings?.prompts?.vars?.languageInstruction||"Injects instructions based on target language (e.g., keep English questions in English but analysis in Chinese)."}),(0,t.jsx)(tN,{name:"knowledge_points_list",description:r.settings?.prompts?.vars?.knowledgePointsList||"Injects the standard list of knowledge point tags for the specific subject."}),(0,t.jsx)(tN,{name:"provider_hints",description:r.settings?.prompts?.vars?.providerHints||"Provider compatibility hints that follow the application output contract."})]})]}),(0,t.jsx)(tl.f,{value:i,onChange:e=>c("analyze",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:tb})]})}),(0,t.jsx)(Z.S,{value:"similar",className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)(et.f,{className:"text-base font-semibold",children:r.settings?.prompts?.customSimilar||"Custom Similar Question Template"}),(0,t.jsxs)(Y.f,{variant:"outline",size:"sm",onClick:()=>l("similar"),children:[(0,t.jsx)(tk.f,{className:"w-4 h-4 mr-2"}),r.settings?.prompts?.reset||"Reset Default"]})]}),(0,t.jsx)(tS,{}),(0,t.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,t.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,t.jsx)(P,{className:"h-3.5 w-3.5"}),r.settings?.prompts?.variables||"Available Variables"]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(tN,{name:"difficulty_level",description:r.settings?.prompts?.vars?.difficultyLevel||"Target difficulty level."}),(0,t.jsx)(tN,{name:"difficulty_instruction",description:r.settings?.prompts?.vars?.difficultyInstruction||"Specific writing instructions for the target difficulty."}),(0,t.jsx)(tN,{name:"original_question",description:r.settings?.prompts?.vars?.originalQuestion||"The full text of the original question."}),(0,t.jsx)(tN,{name:"knowledge_points",description:r.settings?.prompts?.vars?.knowledgePoints||"List of knowledge points to test."}),(0,t.jsx)(tN,{name:"language_instruction",description:r.settings?.prompts?.vars?.languageInstructionShort||"Language formatting instructions."})]})]}),(0,t.jsx)(tl.f,{value:n,onChange:e=>c("similar",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:ty})]})})]})})}var tT=e.i(21357),tA=e.i(434901),tE=e.i(753817),tz=e.i(128093),tM=e.i(79058);let tF=["browser","minimax","qwen","glm","stepfun","volcengine","volcengine-agent","openai"];tF.filter(e=>"browser"!==e);let t_={minimax:{model:"speech-2.8-hd",voice:"male-qn-jingying"},qwen:{model:"qwen-audio-3.0-tts-plus",voice:"longanlufeng"},glm:{model:"glm-tts",voice:"xiaochen"},stepfun:{model:"stepaudio-2.5-tts",voice:"qingniandaxuesheng"},volcengine:{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},"volcengine-agent":{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},openai:{model:"gpt-4o-mini-tts",voice:"cedar"}},tD={minimax:{apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",model:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http",voice:"https://platform.minimax.cn/docs/faq/system-voice-id",endpoint:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http"},qwen:{apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",model:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide",voice:"https://help.aliyun.com/zh/model-studio/qwen-audio-tts-voice-list",endpoint:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide"},glm:{apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",model:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",voice:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",endpoint:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3"},stepfun:{apiKey:"https://platform.stepfun.com/docs/zh/step-plan/integrations/audio-api",model:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio",voice:"https://platform.stepfun.com/docs/zh/guides/developer/tts",endpoint:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio"},volcengine:{apiKey:"https://www.volcengine.com/docs/6561/196768",model:"https://www.volcengine.com/docs/6561/1598757",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://www.volcengine.com/docs/6561/1598757"},openai:{apiKey:"https://platform.openai.com/docs/quickstart",model:"https://developers.openai.com/api/docs/guides/text-to-speech",voice:"https://developers.openai.com/api/docs/guides/text-to-speech",endpoint:"https://developers.openai.com/api/docs/guides/text-to-speech"},"volcengine-agent":{apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",model:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh"}},tL={volcengine:"https://docs.volcengine.com/docs/ark/free-inference-quota?lang=zh"};function t$({config:e,setConfig:r,saving:c,onSave:o}){var d;let{t:m,language:u}=(0,a.b)(),p=m.settings.tts,[h,x]=(0,s.useState)(!1),[g,f]=(0,s.useState)(null),j=e.tts?.mode??"browser",v="browser"!==j&&"string"==typeof(d=j)&&tF.includes(d)?j:null,b=v?e.tts?.[v]:void 0,y=(e,t)=>{v&&r(s=>({...s,tts:{...s.tts,[v]:{...s.tts?.[v],[e]:t}}}))},w=!!v&&("volcengine"===v||"openai"===v),k=v?function(e,t){if("openai"===t){let t=e.openai?.instances?.find(t=>t.id===e.openai?.activeInstanceId);return t?{apiKey:t.apiKey,baseUrl:t.baseUrl}:void 0}return e[t]}(e,v):void 0,N=w?b?.apiKey:k?.apiKey,S=async()=>{(0,tM.p)(),x(!0),f(null);try{await o();let{id:e,version:t}=await i.k.post("/api/tts",{text:p.previewText,language:u},{timeout:12e4,recoverable:!0}),s=(0,tM.l)();if(!s)return;s.src=`/api/tts/${e}?v=${t}`,s.playbackRate=1,await s.play()}catch(t){l.V.error("[TtsSettings]","Preview failed",{error:t});let e=(0,n.d)(t);M.c.error("TTS_NOT_CONFIGURED"===e?p.notConfigured:"TTS_PROVIDER_ERROR"===e?p.providerError:p.previewFailed),f((0,n.L)(t)??null)}finally{x(!1)}};return(0,t.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(et.f,{children:p.title}),(0,t.jsxs)(eC.d,{value:j,onValueChange:e=>r(t=>({...t,tts:{...t.tts,mode:e}})),children:[(0,t.jsx)(eC.P,{children:(0,t.jsx)(eC.U,{})}),(0,t.jsx)(eC.r,{children:tF.map(e=>(0,t.jsx)(eC.T,{value:e,children:p.modes[e]},e))})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:v?p.cloudHint:p.browserHint})]}),v&&(0,t.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[tL[v]&&(0,t.jsxs)("div",{className:"rounded-md border border-green-200 bg-green-50 p-3 text-xs text-green-800 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",children:[p.freeTrial," ",(0,t.jsx)("a",{href:tL[v],target:"_blank",rel:"noopener noreferrer",className:"underline",children:p.freeTrialLink})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(tA.f,{label:"openai"===v?"OpenAI API Key":w?p.speechApiKey:`${(0,tz.z)(v,u)} API Key`,href:tD[v].apiKey,linkText:m.settings.ai.docLinks.apiKey}),(0,t.jsx)(eS.f,{value:N||"",onChange:e=>{var t;return t=e.target.value,void(v&&(w?y("apiKey",t):r(e=>({...e,[v]:{...e[v],apiKey:t}}))))},placeholder:"qwen"===v?"sk-sp-...":w?"":"sk-..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p.apiKeyHint[v]})]}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(tA.f,{label:p.model,href:tD[v].model,linkText:p.docs}),(0,t.jsx)(ee.f,{value:b?.model||"",onChange:e=>y("model",e.target.value),placeholder:t_[v].model})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(tA.f,{label:p.voice,href:tD[v].voice,linkText:p.voiceList}),(0,t.jsx)(ee.f,{value:b?.voice||"",onChange:e=>y("voice",e.target.value),placeholder:t_[v].voice})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p.voiceHint[v]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(tA.f,{label:p.endpoint,href:tD[v].endpoint,linkText:p.docs}),(0,t.jsx)(ee.f,{value:b?.endpoint||"",onChange:e=>y("endpoint",e.target.value),placeholder:function(e,t){if("volcengine"===e)return"https://openspeech.bytedance.com/api/v3/tts/unidirectional";if("volcengine-agent"===e)return"https://openspeech.bytedance.com/api/v3/plan/tts/unidirectional";if("openai"===e)return`${(t?.baseUrl||"https://api.openai.com/v1").replace(/\/+$/,"")}/audio/speech`;let{baseUrl:s}=(0,tz.k)(e,t);if("minimax"===e)return`${s.replace(/\/+$/,"")}/t2a_v2`;if("glm"===e||"stepfun"===e)return`${s.replace(/\/+$/,"")}/audio/speech`;try{return`${new URL(s).origin}/api/v1/services/audio/tts/SpeechSynthesizer`}catch{return""}}(v,k)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p.endpointHint})]})]},v),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[v&&(0,t.jsxs)(Y.f,{variant:"outline",onClick:S,disabled:c||h,className:"sm:w-auto",children:[h?(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(tT.f,{className:"mr-2 h-4 w-4"}),p.preview]}),(0,t.jsxs)(Y.f,{onClick:()=>void o(),disabled:c||h,className:"flex-1",children:[c&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),p.save]})]}),v&&g&&(0,t.jsx)("div",{className:"rounded-md border border-red-200 bg-red-50 p-2 dark:border-red-900 dark:bg-red-950/40",children:(0,t.jsx)(tE.f,{detail:g})})]})}var tR=e.i(835467);function tI({value:e,icon:s,label:a}){return(0,t.jsxs)(Z.k,{value:e,className:"px-2 sm:px-3",children:[s,(0,t.jsx)("span",{className:"hidden sm:inline",children:a})]})}function tG(){let{setTimeZone:e}=(0,y.M)(),{data:n}=(0,r.useSession)(),c=n?.user?.role==="admin",{t:o}=(0,a.b)(),d=(0,N.useRouter)(),[m,u]=(0,s.useState)(!1),p=(0,s.useRef)(null),[h,x]=(0,s.useState)(!1),[g,f]=(0,s.useState)(!1),[j,v]=(0,s.useState)({aiProvider:"minimax"}),b=(0,s.useCallback)(async()=>{f(!0);try{v(await i.k.get("/api/settings"))}catch(e){l.V.error("[SettingsDialog]","Failed to fetch settings",{error:e})}finally{f(!1)}},[]);(0,s.useEffect)(()=>{m&&b()},[m,b]);let w=async()=>{let t=(0,tR.f)(j,o);if(t)return void M.c.error(t);x(!0);try{let t=await i.k.post("/api/settings",j);v(t),e(t.timeZone||J.J),M.c.success(o.settings?.messages?.saved||"Settings saved"),p.current?.scrollTo({top:0,behavior:"smooth"})}catch(e){l.V.error("[SettingsDialog]","Failed to save settings",{error:e}),M.c.error(o.settings?.messages?.saveFailed||"Failed to save")}finally{x(!1)}},k=e=>(0,t.jsxs)(Y.f,{onClick:w,disabled:h,className:"w-full",children:[h&&(0,t.jsx)(E.f,{className:"mr-2 h-4 w-4 animate-spin"}),e]});return(0,t.jsxs)(W.N,{open:m,onOpenChange:u,children:[(0,t.jsx)(W.a,{asChild:!0,children:(0,t.jsxs)(Y.f,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,t.jsx)(H,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"sr-only",children:o.settings?.title||"Settings"})]})}),(0,t.jsxs)(W.d,{ref:p,className:"w-[calc(100vw-2rem)] sm:max-w-[900px] max-h-[85vh] overflow-y-auto",children:[(0,t.jsxs)(W.s,{children:[(0,t.jsx)(W.F,{children:o.settings?.title||"Settings"}),(0,t.jsx)(W.C,{children:o.settings?.desc||"Manage your preferences and data."})]}),(0,t.jsxs)(Z.i,{defaultValue:"general",className:"w-full",children:[(0,t.jsxs)(Z.U,{className:`grid w-full grid-cols-4 ${c?"sm:grid-cols-7":"sm:grid-cols-4"} gap-1 h-auto`,children:[(0,t.jsx)(tI,{value:"general",icon:(0,t.jsx)(q.f,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.general||"General"}),(0,t.jsx)(tI,{value:"account",icon:(0,t.jsx)(B.f,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.account||"Account"}),c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tI,{value:"ai",icon:(0,t.jsx)(I,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.ai||"AI Provider"}),(0,t.jsx)(tI,{value:"prompts",icon:(0,t.jsx)(U,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.prompts||"Prompts"}),(0,t.jsx)(tI,{value:"admin",icon:(0,t.jsx)(A,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.admin||"User Management"})]}),(0,t.jsx)(tI,{value:"danger",icon:(0,t.jsx)(L.f,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.danger||"Danger"}),(0,t.jsx)(tI,{value:"about",icon:(0,t.jsx)(P,{className:"h-4 w-4 sm:mr-2"}),label:o.settings?.tabs?.about||"About"})]}),(0,t.jsxs)(Z.S,{value:"general",className:"space-y-4 py-4",children:[(0,t.jsx)(tt,{config:j,setConfig:v,isAdmin:c,disabled:g||h}),(0,t.jsx)(tn,{}),c&&k(o.settings?.save||"Save Settings")]}),(0,t.jsx)(Z.S,{value:"account",className:"space-y-4 py-4",children:(0,t.jsx)(eE,{})}),(0,t.jsxs)(Z.S,{value:"ai",className:"space-y-4 py-4",children:[(0,t.jsx)(ez.f,{config:j,setConfig:v,loading:g,saving:h,onSave:w}),!g&&(0,t.jsx)(t$,{config:j,setConfig:v,saving:h,onSave:w})]}),(0,t.jsxs)(Z.S,{value:"prompts",className:"space-y-4 py-4",children:[(0,t.jsx)(tC,{config:j,onUpdate:(e,t)=>v(s=>({...s,prompts:{...s.prompts,[e]:t}}))}),k(o.settings?.prompts?.save||"Save Prompt Settings")]}),c&&(0,t.jsxs)(Z.S,{value:"admin",className:"space-y-4 py-4",children:[(0,t.jsxs)(Y.f,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{u(!1),d.push("/admin")},children:[(0,t.jsx)($.f,{className:"h-4 w-4"}),o.admin?.dashboard?.title||"Admin Dashboard"]}),(0,t.jsxs)(Y.f,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{u(!1),d.push("/setup")},children:[(0,t.jsx)(K.f,{className:"h-4 w-4"}),o.setup.rerun]}),(0,t.jsx)(e0,{}),(0,t.jsx)(eV,{}),(0,t.jsx)("div",{className:"border-t pt-4",children:(0,t.jsx)(ep,{})})]}),(0,t.jsx)(Z.S,{value:"danger",className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eZ,{isAdmin:c}),(0,t.jsx)(eB,{isAdmin:c})]})}),(0,t.jsx)(Z.S,{value:"about",className:"space-y-4 py-4",children:(0,t.jsx)(eN,{})})]})]})]})}var tP=e.i(446513);let tq={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};tq.node;let tV=(0,C.f)(tq),tU={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};tU.node;let tO=(0,C.f)(tU);var tH=e.i(755146);let tB={system:tP.f,light:tO,dark:tV};function tK(){let{t:e}=(0,a.b)(),{preference:r,setPreference:i}=(0,s.useContext)(u),n=tB[r],l=`${e.theme.toggle}: ${e.theme[r]}`;return(0,t.jsxs)(tH.G,{children:[(0,t.jsx)(tH.X,{asChild:!0,children:(0,t.jsx)(Y.f,{variant:"ghost",size:"icon",className:"rounded-full",title:l,"aria-label":l,children:(0,t.jsx)(n,{className:"h-5 w-5"})})}),(0,t.jsx)(tH.L,{align:"end",children:(0,t.jsx)(tH.O,{value:r,onValueChange:e=>{m(e)&&i(e)},children:c.map(s=>{let a=tB[s];return(0,t.jsxs)(tH.T,{value:s,className:"gap-2",children:[(0,t.jsx)(a,{className:"h-4 w-4"}),e.theme[s]]},s)})})})]})}var tY=e.i(975153);let tW={name:"circle-plus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],aliases:["plus-circle"]};tW.node;let tZ=(0,C.f)(tW),tJ=[/^\/login/,/^\/register/,/^\/setup/,/^\/print-preview/,/^\/exams\/[^/]+\/print/],tX=[{key:"home",href:"/",icon:tZ,match:e=>"/"===e},{key:"notebooks",href:"/notebooks",icon:eM.f,match:e=>e.startsWith("/notebooks")||e.startsWith("/error-items")||e.startsWith("/practice")},{key:"review",href:"/review",icon:tY.f,match:e=>e.startsWith("/review")},{key:"stats",href:"/stats",icon:$.f,match:e=>e.startsWith("/stats")||e.startsWith("/tags")},{key:"exams",href:"/exams",icon:ts.f,match:e=>e.startsWith("/exams")}];function tQ({children:e}){var n;let c,o,d=(0,N.usePathname)()||"/",{t:m}=(0,a.b)(),{data:u,status:p}=(0,r.useSession)(),h=u?.user?.role==="admin",x=tJ.some(e=>e.test(d));if(n=h&&!x,c=(0,N.useRouter)(),o=(0,s.useRef)(!1),(0,s.useEffect)(()=>{n&&!o.current&&(o.current=!0,i.k.get("/api/setup").then(e=>{e.needsSetup&&c.replace("/setup")}).catch(e=>l.V.warn("[Setup]","Failed to check setup status",{error:e})))},[n,c]),x||"unauthenticated"===p)return(0,t.jsx)(t.Fragment,{children:e});let g=u?.user?.name||u?.user?.email||"";return(0,t.jsxs)("div",{className:"min-h-screen",children:[(0,t.jsx)("header",{className:"sticky top-0 z-40 border-b bg-card/80 backdrop-blur-md supports-[backdrop-filter]:bg-card/70 print:hidden",children:(0,t.jsxs)("div",{className:"mx-auto flex h-14 max-w-6xl items-center gap-3 px-4 md:h-16 md:px-8",children:[(0,t.jsxs)(k.default,{href:"/",className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)(w.default,{src:"/icons/icon.png",alt:"",width:32,height:32,className:"rounded-lg",priority:!0,unoptimized:!0}),(0,t.jsx)("span",{className:"hidden text-base font-semibold tracking-tight sm:inline",children:m.pageTitle.base})]}),(0,t.jsx)("nav",{className:"ml-4 hidden items-center gap-1 md:flex",children:tX.map(e=>{let s=e.match(d),a=e.icon;return(0,t.jsxs)(k.default,{href:e.href,className:(0,_.f)("flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors",s?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),"aria-current":s?"page":void 0,children:[(0,t.jsx)(a,{className:"h-4 w-4"}),m.nav[e.key]]},e.key)})}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[g&&(0,t.jsxs)("span",{className:"mr-2 hidden max-w-40 items-center gap-2 truncate text-sm text-muted-foreground lg:flex",children:[(0,t.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary",children:g.slice(0,1).toUpperCase()}),(0,t.jsx)("span",{className:"truncate",children:g})]}),h&&(0,t.jsx)(k.default,{href:"/admin",title:m.nav.admin,children:(0,t.jsxs)(Y.f,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,t.jsx)(A,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"sr-only",children:m.nav.admin})]})}),(0,t.jsx)(D,{className:"mr-1"}),(0,t.jsx)(tK,{}),(0,t.jsx)(tG,{}),(0,t.jsx)(Y.f,{variant:"ghost",size:"icon",className:"rounded-full text-muted-foreground hover:text-destructive",onClick:()=>(0,r.signOut)({callbackUrl:"/login"}),title:m.app.logout,children:(0,t.jsx)(S.f,{className:"h-5 w-5"})})]})]})}),(0,t.jsx)("div",{className:"pb-20 md:pb-0",children:e}),(0,t.jsx)("nav",{className:"pb-safe fixed inset-x-0 bottom-0 z-40 border-t bg-card/90 backdrop-blur-md md:hidden print:hidden",children:(0,t.jsx)("div",{className:"grid h-16",style:{gridTemplateColumns:`repeat(${tX.length}, minmax(0, 1fr))`},children:tX.map(e=>{let s=e.match(d),a=e.icon;return(0,t.jsxs)(k.default,{href:e.href,className:(0,_.f)("flex flex-col items-center justify-center gap-1 text-[11px] font-medium transition-colors",s?"text-primary":"text-muted-foreground"),"aria-current":s?"page":void 0,children:[(0,t.jsx)("span",{className:(0,_.f)("flex h-7 w-12 items-center justify-center rounded-full transition-colors",s&&"bg-accent"),children:(0,t.jsx)(a,{className:"h-5 w-5"})}),m.nav[e.key]]},e.key)})})})]})}let t0={name:"list-todo",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]};t0.node;let t1=(0,C.f)(t0);var t2=e.i(583967);let t4=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/];function t3(){let{t:e}=(0,a.b)(),{timeZone:n}=(0,y.M)(),{status:l}=(0,r.useSession)(),c=(0,N.usePathname)(),[o,d]=(0,s.useState)(!1),[m,u]=(0,s.useState)([]),[p,h]=(0,s.useState)(()=>Date.now()),x="authenticated"!==l||t4.some(e=>e.test(c||"")),g=(0,s.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{let e=await i.k.get("/api/tasks");u(e.tasks),h(Date.now())}catch{}},[]);if((0,s.useEffect)(()=>{if(x)return;let e=setTimeout(g,0),t=setInterval(g,o?2e3:15e3);return()=>{clearTimeout(e),clearInterval(t)}},[x,o,g]),x)return null;let f=m.filter(e=>"running"===e.status).length,j=m.some(e=>"running"!==e.status),v=async()=>{try{let e=await i.k.delete("/api/tasks");u(e.tasks)}catch{}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(Y.f,{variant:"outline",size:"icon",className:"fixed bottom-20 right-4 z-40 h-11 w-11 rounded-full shadow-lg md:bottom-6 md:right-6 print:hidden",onClick:()=>d(!0),"aria-label":e.backgroundTasks.title,title:e.backgroundTasks.title,children:[f>0?(0,t.jsx)(E.f,{className:"h-5 w-5 animate-spin"}):(0,t.jsx)(t1,{className:"h-5 w-5"}),f>0&&(0,t.jsx)("span",{className:"absolute -right-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs text-primary-foreground",children:f})]}),(0,t.jsx)(W.N,{open:o,onOpenChange:d,children:(0,t.jsxs)(W.d,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,t.jsxs)(W.s,{children:[(0,t.jsx)(W.F,{children:e.backgroundTasks.title}),(0,t.jsx)(W.C,{children:e.backgroundTasks.description})]}),0===m.length?(0,t.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:e.backgroundTasks.empty}):(0,t.jsx)("ul",{className:"space-y-2",children:m.map(s=>{var a,r;let i;return(0,t.jsx)("li",{className:"rounded-md border p-3 text-sm",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:["running"===s.status&&(0,t.jsx)(E.f,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-primary"}),"succeeded"===s.status&&(0,t.jsx)(eK.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),"failed"===s.status&&(0,t.jsx)(t2.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"font-medium",children:[e.backgroundTasks.kinds[s.kind],(0,t.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",e.backgroundTasks.status[s.status]]})]}),s.subject&&(0,t.jsx)("div",{className:"break-words text-muted-foreground",children:s.subject}),s.progress&&s.progress.total>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-muted",children:(0,t.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.round(s.progress.done/s.progress.total*100)}%`}})}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e.backgroundTasks.progress.replace("{done}",String(s.progress.done)).replace("{total}",String(s.progress.total)),s.progress.failed>0&&` \xb7 ${e.backgroundTasks.failedCount.replace("{count}",String(s.progress.failed))}`]})]}),s.error&&(0,t.jsx)("div",{className:"text-xs text-destructive",children:(t=>{if(!t)return null;let s=e.backgroundTasks.errors[t]??e.errors[t];return"string"==typeof s?s:t})(s.error)}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:e.backgroundTasks.startedAt.replace("{time}",(0,J.r)(s.startedAt,"HH:mm:ss",n))}),(0,t.jsx)("span",{children:e.backgroundTasks.elapsed.replace("{time}",(a=s.startedAt,r=s.finishedAt,i=Math.max(0,Math.round(((r?Date.parse(r):p)-Date.parse(a))/1e3)),`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`))}),s.link&&(0,t.jsx)(k.default,{href:s.link,className:"text-primary hover:underline",onClick:()=>d(!1),children:e.backgroundTasks.view})]})]})]})},s.id)})}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.backgroundTasks.retentionHint}),j&&(0,t.jsx)(Y.f,{variant:"ghost",size:"sm",onClick:v,children:e.backgroundTasks.clearFinished})]})]})})]})}var t5=e.i(263676);let t6={success:{icon:eK.f,className:"text-success"},error:{icon:t2.f,className:"text-destructive"},warning:{icon:L.f,className:"text-warning"},info:{icon:P,className:"text-primary"}};function t8(){let{t:e}=(0,a.b)(),[r,i]=(0,s.useState)([]),[n,l]=(0,s.useState)(null);return(0,s.useEffect)(()=>(0,M.M)(e=>{i(e.toasts),l(e.confirm)}),[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pointer-events-none fixed inset-x-0 top-3 z-[100] flex flex-col items-center gap-2 px-4 print:hidden",role:"status","aria-live":"polite",children:r.map(s=>{let{icon:a,className:r}=t6[s.type];return(0,t.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-sm items-start gap-3 rounded-xl border bg-card/95 px-4 py-3 text-sm shadow-lg backdrop-blur animate-in fade-in slide-in-from-top-2 duration-200",children:[(0,t.jsx)(a,{className:(0,_.f)("mt-0.5 h-4 w-4 shrink-0",r)}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:s.message}),(0,t.jsx)("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>(0,M.p)(s.id),"aria-label":e.common.close,children:(0,t.jsx)(t5.X,{className:"h-3.5 w-3.5"})})]},s.id)})}),(0,t.jsx)(W.N,{open:!!n,onOpenChange:e=>{e||n?.resolve(!1)},children:(0,t.jsxs)(W.d,{className:"sm:max-w-md",children:[(0,t.jsxs)(W.s,{children:[(0,t.jsxs)(W.F,{className:"flex items-center gap-2",children:[n?.destructive&&(0,t.jsx)(L.f,{className:"h-5 w-5 text-destructive"}),n?.title||e.common.confirmTitle]}),(0,t.jsx)(W.C,{className:"whitespace-pre-line pt-1 text-left leading-relaxed",children:n?.message})]}),(0,t.jsxs)(W.c,{className:"gap-2",children:[(0,t.jsx)(Y.f,{variant:"outline",onClick:()=>n?.resolve(!1),children:n?.cancelText||e.common.cancel}),(0,t.jsx)(Y.f,{variant:n?.destructive?"destructive":"default",onClick:()=>n?.resolve(!0),autoFocus:!0,children:n?.confirmText||e.common.confirm})]})]})})]})}function t9(){return(0,s.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js",{scope:"/"}).catch(e=>{l.V.warn("[PWA]","Service worker registration failed",{error:String(e)})})},[]),null}e.s(["Providers",0,function({children:e,timeZone:i}){return(0,s.useEffect)(()=>(0,l.m)(),[]),(0,t.jsx)(r.SessionProvider,{children:(0,t.jsx)(b,{children:(0,t.jsx)(a.w,{children:(0,t.jsxs)(y.n,{initialTimeZone:i,children:[(0,t.jsx)(tQ,{children:e}),(0,t.jsx)(t3,{}),(0,t.jsx)(t8,{}),(0,t.jsx)(t9,{})]})})})})}],1661)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[711241,e=>{var a=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 t=(0,a.f)(s);e.s(["f",0,t],711241)},399847,e=>{var a=e.i(456420);let s={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"]};s.node;let t=(0,a.f)(s);e.s(["f",0,t],399847)},13285,e=>{var a=e.i(456420);let s={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};s.node;let t=(0,a.f)(s);e.s(["f",0,t],13285)},813572,e=>{var a=e.i(843476),s=e.i(271645),t=e.i(618566),i=e.i(518515),n=e.i(328623),l=e.i(747819),r=e.i(866531),o=e.i(12130),c=e.i(430634),d=e.i(576019),m=e.i(847483),p=e.i(497346),u=e.i(717448),f=e.i(798469),x=e.i(393842),h=e.i(956738),g=e.i(185592),j=e.i(111110),v=e.i(41931),k=e.i(201276),y=e.i(35209),b=e.i(598053),I=e.i(315092);e.s(["default",0,function(){let e=(0,t.useParams)(),N=(0,t.useRouter)(),S=e.id,{t:T}=(0,j.b)(),[w,P]=(0,s.useState)(null);(0,y.f)(T.notebooks.title,w?.name,T.pageTitle.addError);let[C,z]=(0,s.useState)("image"),A=(0,b.f)({logPrefix:"[AddErrorItem]",analyzeSubjectId:S,importSubjectId:S,textNotebook:{id:S,name:w?.name||""},fixedSubjectId:S});return((0,s.useEffect)(()=>{v.k.get(`/api/notebooks/${S}`).then(e=>P(e)).catch(e=>{k.V.error("[AddErrorItem]","Failed to fetch notebook",{error:e}),N.push("/notebooks")})},[S,N]),w)?(0,a.jsxs)("main",{className:"min-h-screen",children:[(0,a.jsx)(h.f,{status:A.analysisStep,completed:A.completedStages}),(0,a.jsxs)("div",{className:`mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8 ${"review"===A.step?"max-w-6xl":"max-w-4xl"}`,children:[(0,a.jsx)(p.f,{message:A.saveError,onDismiss:A.dismissSaveError}),(0,a.jsx)(x.f,{backHref:`/notebooks/${S}`,title:T.app.addError,description:w.name}),"upload"===A.step&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(g.f,{options:[{value:"image",icon:i.f,label:T.app?.uploadImage||"Take Photo"},{value:"text",icon:n.f,label:T.app?.manualInput||"Manual Input"}],value:C,onChange:z}),A.pendingTask&&(0,a.jsx)(d.f,{task:A.pendingTask,onRefresh:A.refreshPendingTask,onDismiss:A.dismissPendingTask}),A.lastImported&&(0,a.jsx)(c.f,{imported:A.lastImported,onDismiss:A.dismissImported}),A.batchImages?(0,a.jsx)(l.f,{images:A.batchImages,subjectId:S,onClose:A.closeBatch}):"image"===C?(0,a.jsxs)(a.Fragment,{children:[A.parts.length>0&&(0,a.jsx)(m.f,{parts:A.parts.map(e=>e.dataUrl),busy:A.isBusy,onFinish:()=>void A.finishParts(),onDiscard:A.discardParts}),(0,a.jsx)(f.f,{onImageSelect:A.selectImage,isAnalyzing:A.isBusy})]}):(0,a.jsx)(u.f,{onSubmit:A.submitText,isAnalyzing:A.isBusy,defaultNotebookName:w.name,onCreateBatch:A.createTextBatch,creatingBatch:A.creatingBatch})]}),"review"===A.step&&A.parsedData&&(0,a.jsx)(r.f,{initialData:A.parsedData,imagePreview:A.currentImage,onSave:A.saveReviewed,onCancel:A.cancelReview,initialSubjectId:S,aiTimeout:A.aiTimeout})]}),(0,a.jsx)(o.f,{imageSrc:A.croppingImage||"",open:A.isCropperOpen,onClose:A.closeCropper,onRegionsSelected:A.cropRegions,allowMulti:0===A.parts.length,onAutoSplit:0===A.parts.length?A.autoSplitImage:void 0,onAddPart:A.parts.length<I.u-1?A.addPart:void 0,partCount:A.parts.length})]}):(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,a.jsx)("p",{className:"text-muted-foreground",children:T.common.loading})})}])},590546,e=>{var a=e.i(843476),s=e.i(618566),t=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let l=(0,s.useRouter)();return(0,a.jsx)(t.f,{variant:"ghost",size:"icon",onClick:()=>{l.push(e)},className:n,children:(0,a.jsx)(i.f,{className:"h-5 w-5"})})}])},393842,e=>{var a=e.i(843476),s=e.i(590546),t=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:n,actions:l,titleAddon:r,className:o}){return(0,a.jsxs)("div",{className:(0,t.f)("flex items-start gap-3",o),children:[n&&(0,a.jsx)(s.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),r]}),i&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),l&&(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:l})]})}])},35209,e=>{var a=e.i(271645),s=e.i(111110);e.s(["f",0,function(...e){let{t}=(0,s.b)(),i=[t.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,a.useEffect)(()=>{document.title=i},[i])}])}],462684,e=>{e.v(a=>Promise.all(["static/chunks/2hh64gi4pmlk2.js"].map(a=>e.l(a))).then(()=>a(506175)))}]);
|