wrong-notebook 2026.10.25 → 2026.10.29-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +2 -0
- package/.next/build-manifest.json +54 -43
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +12 -0
- package/.next/server/app/_global-error/page/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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/dashboard/route.js +3 -3
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/system-reset/route.js +1 -1
- 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 +3 -3
- 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 +1 -1
- package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/route.js +1 -1
- package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +2 -2
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +3 -3
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +12 -3
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +3 -3
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/[...nextauth]/route.js +1 -1
- package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/delete/route.js +1 -1
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +3 -3
- 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 +3 -3
- 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 +1 -1
- package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js +3 -3
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/batch-delete/route.js +1 -1
- 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 +1 -1
- package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/list/route.js +2 -2
- package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +4 -4
- package/.next/server/app/api/error-items/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/short/[shortId]/route.js +1 -1
- 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 +1 -1
- 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 +14 -13
- 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 +6 -6
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +14 -13
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +12 -11
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +10 -9
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +1 -1
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +3 -3
- 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 +9 -9
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/logs/frontend/route.js +1 -1
- package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/login/route.js +1 -1
- package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/route.js +1 -1
- package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +3 -3
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/route.js +1 -1
- package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/route.js +1 -1
- package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +9 -9
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +3 -3
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +3 -3
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +3 -3
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +3 -3
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +3 -3
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +15 -6
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/setup/route/build-manifest.json +12 -0
- package/.next/server/app/api/setup/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/setup/route.js +13 -0
- package/.next/server/app/api/setup/route.js.map +5 -0
- package/.next/server/app/api/setup/route.js.nft.json +1 -0
- package/.next/server/app/api/setup/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/stats/practice/clear/route.js +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js +1 -1
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/route.js +1 -1
- 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/tags/suggestions/route.js +1 -1
- package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js +1 -1
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +14 -4
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/login/page/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/app-paths-manifest.json +3 -0
- package/.next/server/app/setup/page/build-manifest.json +22 -0
- package/.next/server/app/setup/page/next-font-manifest.json +11 -0
- package/.next/server/app/setup/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/setup/page/server-reference-manifest.json +4 -0
- package/.next/server/app/setup/page.js +14 -0
- package/.next/server/app/setup/page.js.map +5 -0
- package/.next/server/app/setup/page.js.nft.json +1 -0
- package/.next/server/app/setup/page_client-reference-manifest.js +3 -0
- package/.next/server/app/stats/page/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- package/.next/server/app/tags/page.js +2 -1
- package/.next/server/app/tags/page.js.nft.json +1 -1
- package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +2 -0
- package/.next/server/chunks/{[root-of-the-server]__0-12_rul4y06m._.js → [root-of-the-server]__0-je7m4evwez4._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__05-dvjb11wbvo._.js → [root-of-the-server]__015ejcb8twm6c._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0rbh_oqaajxmo._.js → [root-of-the-server]__03g_n15zojhn2._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0-lanxvfyc5w7._.js → [root-of-the-server]__04jqbxsugsx8b._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1g2qwf_mnzqly._.js → [root-of-the-server]__04vkejt7399qm._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0jb_3-yu-o6ms._.js → [root-of-the-server]__05d1rfm7p02tv._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0b3ss-8ztcftu._.js → [root-of-the-server]__067bnq3j3z-3_._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__09944y8f_7dhf._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__023qntqk9nbma._.js → [root-of-the-server]__0a62guogezjl6._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0aequ2pnoemzu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0axigtqmxeqri._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0e7_0-o90esy-._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0nj600_104dqn._.js → [root-of-the-server]__0f505ene-6a0j._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0zr9l7lnr1i0l._.js → [root-of-the-server]__0gql12o_mf7e8._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0-jhvuvprdrmu._.js → [root-of-the-server]__0lt6zgk4xq6fk._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0msiy_bvtvaqo._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1-9hu4j35d9ao._.js → [root-of-the-server]__0of1031_q21po._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0p6a773hclr9v._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0zjg773epx4r_._.js → [root-of-the-server]__0qo744v4hy8lp._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0ugdj4xtzfkaa._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ul_64h5yov45._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0uwpcliduox5r._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0ayraoa4xz-qt._.js → [root-of-the-server]__0uzkv_2-76muc._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1imiyrtb6t6zp._.js → [root-of-the-server]__0v0mt3v8gyonn._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0vqoda1k-uvtz._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__20i0-g_8_okaf._.js → [root-of-the-server]__0vqtidz1lisc6._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0q_db5a74evdw._.js → [root-of-the-server]__0wm4qw5cu0956._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1ya630gfyks-f._.js → [root-of-the-server]__0y48od_b_qxct._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0zxrtk19v5vnf._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0zxxkvf-ns40a._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1-i5zhzxr_18g._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__10_vi76_sexvg._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__10lamgabz68ix._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__10ncpx-zqhwkz._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__03nsgjsm70ted._.js → [root-of-the-server]__118rtr0shk1ii._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__11nevdba2vhtt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__120v9prxhhv-r._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__03rln5n_21ad0._.js → [root-of-the-server]__17aiova74blq9._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__18afyxml-gm3x._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0my6t3vz24mmo._.js → [root-of-the-server]__1930xo407ogqu._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1jhz19cuxjpmb._.js → [root-of-the-server]__1_8btngjew64q._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1bvjyahgm4s-0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1d39wr4nvawz9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1d69wiqapuvpg._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1e5_zprqk0ss2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1exrwdj9xu3yd._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1gyn69y2kixvz._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__12tt2pf5nuueu._.js → [root-of-the-server]__1hrdz_-5s3775._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1lbtlpnl59fx4._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1lkrb23gahy9p._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0qb8n1h-am-es._.js → [root-of-the-server]__1mw7gimyq75e7._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1nrc0f_1unz0b._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1-302_px1h0qz._.js → [root-of-the-server]__1pfiautl3zc2f._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1q-qp9_6drnjc._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1uamx3r_5niri._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ubqs9ptth-gi._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0icc6dvauvb15._.js → [root-of-the-server]__1wjrhbs_gcrzx._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1wvpsikw739ko._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1yribihoxvucv._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1zir6sprvzk4t._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1zt-23c4kv6ca._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0brc9a9ftklux._.js → [root-of-the-server]__20qx2tzclhhfh._.js} +1 -1
- package/.next/server/chunks/_0-ne-bwuvd_6w._.js +1 -1
- package/.next/server/chunks/_09o9zamz75n5d._.js +3 -0
- package/.next/server/chunks/_0_rhee7wb6tcg._.js +3 -0
- package/.next/server/chunks/_0gxi3zrkhyvx_._.js +1 -1
- package/.next/server/chunks/{_0ekrwj-qx_6uh._.js → _0q-x4ftphyse4._.js} +2 -2
- package/.next/server/chunks/_0tz5wpjdgntj3._.js +1 -1
- package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
- package/.next/server/chunks/_1_273cgnpyl9j._.js +1 -1
- package/.next/server/chunks/_1_ns7o3cqznv6._.js +1 -1
- package/.next/server/chunks/{_0x3ltk09eli_f._.js → _1btq785jvvco6._.js} +2 -2
- package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_setup_route_actions_0txsuev7wlgqs.js +3 -0
- package/.next/server/chunks/src_lib_15kwif87cuv22._.js +1 -1
- package/.next/server/chunks/src_lib_1k0xki4wmn54_._.js +1 -1
- package/.next/server/chunks/src_lib_1wm8ay-jqxakc._.js +1 -1
- package/.next/server/chunks/src_lib_exam_ts_0d3a4q4r41hcf._.js +1 -1
- package/.next/server/chunks/src_lib_mastery_ts_0ybi94uxn8ut6._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__05d1gc-h-sk6z._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__06cr_rl6w07mf._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0d-q1qjhzf_nt._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__1b9f3v7g4ocyf._.js → [root-of-the-server]__0wbg4fz5qe7h-._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__14c291vzuew0p._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1_zton0k4t3va._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1kh02fdj3kar7._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__1xfc5gf4weasu._.js → [root-of-the-server]__1zh2txrawxztj._.js} +1 -1
- package/.next/server/chunks/ssr/_00np6xqvkg6u-._.js +1 -1
- package/.next/server/chunks/ssr/_04ziy8_ak_olr._.js +3 -0
- package/.next/server/chunks/ssr/_05alwt3w7oor-._.js +3 -0
- package/.next/server/chunks/ssr/_06k5kn4q-1k90._.js +3 -0
- package/.next/server/chunks/ssr/_0h6qsip9mphaq._.js +1 -1
- package/.next/server/chunks/ssr/_0iy-5lwc8jb9d._.js +3 -0
- package/.next/server/chunks/ssr/_0lpyto7r47jl8._.js +3 -0
- package/.next/server/chunks/ssr/_0ms6yihjxbuy1._.js +3 -0
- package/.next/server/chunks/ssr/_0oksf3a6pbj88._.js +3 -0
- package/.next/server/chunks/ssr/{_110r17vqu8gol._.js → _0p61m7hr-1evu._.js} +1 -1
- package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
- package/.next/server/chunks/ssr/_0trykmkw0cncr._.js +32 -0
- package/.next/server/chunks/ssr/{_1-bq77e5afl30._.js → _0vq069p6upfdb._.js} +1 -1
- package/.next/server/chunks/ssr/{_1f1l6ubybak3a._.js → _0z-gzl29_yrkq._.js} +2 -2
- package/.next/server/chunks/ssr/{_1prnv9r-jt4dy._.js → _10gxtgntt3mjd._.js} +1 -1
- package/.next/server/chunks/ssr/_11xqn1cgzpe6k._.js +3 -0
- package/.next/server/chunks/ssr/_1g8mzz6qxv2mr._.js +1 -1
- package/.next/server/chunks/ssr/_1gjb-bqi25yci._.js +3 -0
- package/.next/server/chunks/ssr/_1mw-oovvzrn8_._.js +3 -0
- package/.next/server/chunks/ssr/_1tg3c_6clbzhd._.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_setup_page_actions_0u1sm0sllb5ji.js +3 -0
- package/.next/server/chunks/ssr/node_modules_004qzwkmt-_w5._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_@radix-ui_0jungqz8-8rpt._.js → node_modules_00hekemtvh207._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0th0mlz3ys-17._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1tz6jn4lbq7wr._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_next_dist_0ufsi7bhcumza._.js → node_modules_next_dist_0rsvep-qefr2x._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1a9z9hjfg293y.js +3 -0
- package/.next/server/chunks/ssr/src_0_rgx1hl-1b6i._.js +3 -0
- package/.next/server/chunks/ssr/src_0av4wv_56wg9j._.js +3 -0
- package/.next/server/chunks/ssr/src_0wxvmqdi_0uno._.js +3 -0
- package/.next/server/chunks/ssr/src_13u20tdu4gmgj._.js +1 -1
- package/.next/server/chunks/ssr/src_1jhctayt9gxoc._.js +3 -0
- package/.next/server/chunks/ssr/src_app_exams_[id]_page_tsx_0xcjflkgkwzgd._.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_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_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
- package/.next/server/chunks/ssr/src_app_setup_page_tsx_0szlnxow_9skp._.js +3 -0
- package/.next/server/chunks/ssr/src_components_04xv7f-d7_fyc._.js +3 -0
- package/.next/server/chunks/ssr/src_components_1lbiuzxejiwvf._.js +3 -0
- package/.next/server/chunks/ssr/src_components_create-notebook-dialog_tsx_0c5teagim70r7._.js +3 -0
- 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_mastery-panel_tsx_1--j5c7mhomdp._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +10 -10
- package/.next/server/edge/chunks/node_modules_0um8zwzayafzq._.js +1 -1
- package/.next/server/middleware-build-manifest.js +54 -43
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +4 -0
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/02bal925qbinj.js +1 -0
- package/.next/static/chunks/0bie9b-vo6ccs.js +1 -0
- package/.next/static/chunks/0g5r7y3bbmc-b.js +1 -0
- package/.next/static/chunks/{0aqlzwgn78ncm.js → 0p-3zwi9dqdk8.js} +1 -1
- package/.next/static/chunks/0r7n8__w9jr5w.js +1 -0
- package/.next/static/chunks/0t58h5wfgi75w.js +3 -0
- package/.next/static/chunks/0znojfm3iv2d7.js +1 -0
- package/.next/static/chunks/{3mb_v650fie_i.js → 1fkaya2t7r343.js} +1 -1
- package/.next/static/chunks/1kx-lcqi4aref.js +191 -0
- package/.next/static/chunks/1qa6rlj01hnl5.js +1 -0
- package/.next/static/chunks/{093w4w_19h9qh.js → 263d57goy87o4.js} +2 -2
- package/.next/static/chunks/29cafv3hz5hzj.js +1 -0
- package/.next/static/chunks/2h685ie6ojjd6.js +1 -0
- package/.next/static/chunks/2q9n-d4_9bhp2.js +1 -0
- package/.next/static/chunks/2rgflf9-3s4ud.js +1 -0
- package/.next/static/chunks/{2l-1t8-pfq4ph.js → 2t6ygiu56xwkx.js} +1 -1
- package/.next/static/chunks/2ucdm1a-llop_.js +1 -0
- package/.next/static/chunks/314x1g250-zss.js +1 -0
- package/.next/static/chunks/{29m8r4g8_em2g.js → 3icoc8gklzn52.js} +1 -1
- package/.next/static/chunks/3jb_u6u63wui6.js +1 -0
- package/.next/static/chunks/3tc0l--v631lz.js +1 -0
- package/.next/static/chunks/3wxogk-dqqw8w.js +1 -0
- package/.next/static/chunks/3zt-rwod7li6h.js +1 -0
- package/.next/static/chunks/40q-bbhsqichn.js +1 -0
- package/.next/static/chunks/43xs7yzz06q0y.css +3 -0
- package/README.md +1 -1
- package/bin/wrong-notebook.js +1 -1
- package/launcher.js +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20261029000000_add_mastery_threshold/migration.sql +2 -0
- package/prisma/schema.prisma +1 -0
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__00l2rz_disfkg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0dmllzem7rfag._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gx76tnihfcyv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0h7igxq4ub38i._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0jjisfje72sqz._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0kskkg4ve55lv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0mbd9_76yhyaf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0q4s9a9wy51vm._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0u2_q8y9hl1u-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0v3k8_i3f2v13._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0vu6_38lbzxar._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0wcet8-wl-oad._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__13z5coff9j0sa._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__14n5uude1fj4h._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__17pktht8hd051._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__18lmdddgrhac8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__199tod2f3vhny._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1bep0vcwbtlfu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1esyxu40fpnyx._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1iux__qytdtm5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1jthkkelxfeb0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1k7cmt02s_syx._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1kvcjw9quzr0w._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1p08ff3pxle05._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1rfqipe89aq-u._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1uscfmw0q-en5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ve3j8ooyhjgv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1yslrvk_y61kt._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1zyka21s1ahtj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20sulb1y6n1b8._.js +0 -3
- package/.next/server/chunks/_0c25unp5_llaq._.js +0 -3
- package/.next/server/chunks/node_modules_zod_v4_classic_external_19886v847zvfd.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0i73t4kmj3-mp._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__18i084ru7sq9w._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1i2zrji0j2c3l._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1upv9f0hlagx7._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1urwx866fvhi4._.js +0 -3
- package/.next/server/chunks/ssr/_0bsjhzelppbjh._.js +0 -3
- package/.next/server/chunks/ssr/_0di9wj37_9zhf._.js +0 -3
- package/.next/server/chunks/ssr/_0ng735s0jio00._.js +0 -3
- package/.next/server/chunks/ssr/_0t2jed64ec8vu._.js +0 -3
- package/.next/server/chunks/ssr/_0uvml2k65e53w._.js +0 -3
- package/.next/server/chunks/ssr/_1-sbpqghw1pn7._.js +0 -3
- package/.next/server/chunks/ssr/_14d3enlxi54zl._.js +0 -3
- package/.next/server/chunks/ssr/_1b9b1aq5b_1sj._.js +0 -3
- package/.next/server/chunks/ssr/_1g12ubvpxwe-j._.js +0 -3
- package/.next/server/chunks/ssr/_1i0mdte5du0e1._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_@radix-ui_0im69oqv_i2ki._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1_p6srzucwl-s._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1g_su6v6_1gmz._.js +0 -3
- package/.next/server/chunks/ssr/src_app_tags_page_tsx_1h2vkk4hv_zlp._.js +0 -3
- package/.next/static/chunks/08wadcj8wbdsy.js +0 -1
- package/.next/static/chunks/0e7mao0hn_nw4.js +0 -1
- package/.next/static/chunks/0pdeh9usti0bj.js +0 -3
- package/.next/static/chunks/14a1tth-1ddn-.js +0 -1
- package/.next/static/chunks/15e5p9740moee.js +0 -1
- package/.next/static/chunks/181--wh89vylg.js +0 -1
- package/.next/static/chunks/1_h2h09t_394a.js +0 -1
- package/.next/static/chunks/1enxsrqonvvxr.js +0 -1
- package/.next/static/chunks/1m3ompn8ev8gr.js +0 -1
- package/.next/static/chunks/1nimjc5xqpgag.js +0 -191
- package/.next/static/chunks/1v_ioerabkr4s.js +0 -1
- package/.next/static/chunks/1wqqkfg03tuu1.js +0 -1
- package/.next/static/chunks/2ir3p1tlsazez.js +0 -1
- package/.next/static/chunks/2tayqxc443yyh.js +0 -1
- package/.next/static/chunks/2v3rvsf6-bnfs.js +0 -1
- package/.next/static/chunks/30eew6y-03vg8.js +0 -1
- package/.next/static/chunks/32oh815gi42ey.js +0 -1
- package/.next/static/chunks/3gvzs1nxarb0s.js +0 -1
- package/.next/static/chunks/3r4z_6i5z0hd5.js +0 -1
- package/.next/static/chunks/3wm2jhitfeeue.js +0 -1
- package/.next/static/chunks/43gsd2ww2f2iy.css +0 -3
- /package/.next/static/{5uNP139l0DCSagwPDMOvD → xoHWvK4hz8MHVRTlw1P-_}/_buildManifest.js +0 -0
- /package/.next/static/{5uNP139l0DCSagwPDMOvD → xoHWvK4hz8MHVRTlw1P-_}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{5uNP139l0DCSagwPDMOvD → xoHWvK4hz8MHVRTlw1P-_}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,871689,e=>{let t=(0,e.i(475254).f)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,t],871689)},908821,e=>{let t=(0,e.i(475254).f)("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);e.s(["f",0,t])},952801,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(522016),r=e.i(215519),n=e.i(306831),i=e.i(178583),l=e.i(107233),c=e.i(519455),d=e.i(515288),o=e.i(912505),u=e.i(393842),m=e.i(86963),x=e.i(618566),f=e.i(531278),h=e.i(908821),h=h,p=e.i(257428),g=e.i(793479),b=e.i(110204),j=e.i(574041),v=e.i(111110),y=e.i(41931);let N=["unmastered","mastered","all"],k=["least_practiced","random"],w=["easy","medium","hard","harder"];function C(){let{t:e,language:a}=(0,v.b)(),r=(0,x.useRouter)(),[n,i]=(0,s.useState)([]),[l,o]=(0,s.useState)([]),[u,m]=(0,s.useState)([]),[C,S]=(0,s.useState)("unmastered"),[E,R]=(0,s.useState)("least_practiced"),[M,P]=(0,s.useState)(10),[I,T]=(0,s.useState)("medium"),[_,L]=(0,s.useState)(""),[O,$]=(0,s.useState)(!1),[D,F]=(0,s.useState)(null);(0,s.useEffect)(()=>{y.f.get("/api/notebooks").then(e=>{i(e),1===e.length&&o([e[0].id])}).catch(()=>i([]))},[]);let q=async t=>{if(t.preventDefault(),0===l.length)return void F(e.exam.noNotebook);$(!0),F(null);try{let e=await y.f.post("/api/exams",{subjectIds:l,tagNames:u,scope:C,pickRule:E,count:M,difficulty:I,title:_.trim()||void 0,language:a});r.push(`/exams/${e.id}`)}catch(t){F("NO_SOURCE_ITEMS"===t?.data?.message?e.exam.noSource:e.common.messages?.saveFailed||"Failed"),$(!1)}},H=e.practice.difficulty;return(0,t.jsxs)(d.N,{children:[(0,t.jsx)(d.Y,{children:(0,t.jsx)(d.v,{className:"text-lg",children:e.exam.createTitle})}),(0,t.jsx)(d.O,{children:(0,t.jsxs)("form",{onSubmit:q,className:"space-y-5",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(b.f,{children:e.exam.notebooks}),n.length>1&&(0,t.jsx)("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>o(l.length===n.length?[]:n.map(e=>e.id)),children:e.exam.selectAll})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:n.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 rounded-md border p-2 text-sm cursor-pointer hover:bg-muted/50",children:[(0,t.jsx)(p.f,{checked:l.includes(e.id),onCheckedChange:()=>{var t;return t=e.id,void o(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}}),(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:e._count?.errorItems??""})]},e.id))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.tags}),(0,t.jsx)(j.f,{value:u,onChange:m,placeholder:e.exam.tagsPlaceholder})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.scope}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-md bg-muted p-1",children:N.map(s=>(0,t.jsx)("button",{type:"button",onClick:()=>S(s),className:`rounded px-2 py-1.5 text-sm transition-colors ${C===s?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.scopes[s]},s))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-count",children:e.exam.count}),(0,t.jsx)(g.f,{id:"exam-count",type:"number",min:1,max:50,value:M,onChange:e=>P(Math.min(50,Math.max(1,parseInt(e.target.value,10)||1)))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-difficulty",children:e.exam.difficulty}),(0,t.jsx)("select",{id:"exam-difficulty",value:I,onChange:e=>T(e.target.value),className:"h-9 w-full rounded-md border bg-background px-3 text-sm",children:w.map(e=>(0,t.jsx)("option",{value:e,children:H[e]},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.pickRule}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",children:k.map(s=>(0,t.jsx)("button",{type:"button",onClick:()=>R(s),className:`rounded px-2 py-1.5 text-sm transition-colors ${E===s?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.pickRules[s]},s))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.exam.pickRuleHints[E]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-title",children:e.exam.titleLabel}),(0,t.jsx)(g.f,{id:"exam-title",value:_,maxLength:100,onChange:e=>L(e.target.value)})]}),D&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:D}),(0,t.jsxs)(c.f,{type:"submit",disabled:O,className:"w-full sm:w-auto",children:[O?(0,t.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(h.f,{className:"mr-2 h-4 w-4"}),O?e.exam.creating:e.exam.generate]})]})})]})}var S=e.i(663661),E=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,r.M)(),{t:x}=(0,v.b)();(0,E.f)(x.exam.title);let[f,h]=(0,s.useState)(null),[p,g]=(0,s.useState)(!1);(0,s.useEffect)(()=>{y.f.get("/api/exams").then(e=>{h(e),0===e.length&&g(!0)}).catch(()=>h([]))},[]);let b=x.practice.difficulty;return(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(u.f,{title:x.exam.title,description:x.exam.subtitle,actions:!p&&(0,t.jsxs)(c.f,{onClick:()=>g(!0),"aria-label":x.exam.create,children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:x.exam.create})]})}),p&&(0,t.jsx)(C,{}),(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:x.exam.list}),null===f?(0,t.jsx)(m.f,{}):0===f.length?(0,t.jsx)(o.f,{icon:i.f,title:x.exam.empty,className:"py-10"}):(0,t.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(s=>(0,t.jsx)(a.default,{href:`/exams/${s.id}`,children:(0,t.jsx)(d.N,{className:"h-full rounded-2xl transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md",children:(0,t.jsxs)(d.O,{className:"space-y-2 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 shrink-0 text-primary"}),s.title]}),(0,t.jsx)(S.f,{status:s.status})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:(0,n.r)(s.createdAt,"yyyy-MM-dd HH:mm",e)}),(0,t.jsx)("span",{children:x.exam.questionCount.replace("{count}",String(s.questionCount))}),(0,t.jsx)("span",{children:x.exam.scopes[s.scope]}),(0,t.jsx)("span",{children:b[s.difficulty]||s.difficulty}),(0,t.jsx)("span",{children:s.recordedCount>0?x.exam.recorded:x.exam.notRecorded})]})]})})},s.id))})]})]})})}],952801)},663661,e=>{var t=e.i(843476),s=e.i(487486),a=e.i(111110);let r={generating:"bg-blue-100 text-blue-700 border-blue-200",ready:"bg-green-100 text-green-700 border-green-200",partial:"bg-amber-100 text-amber-700 border-amber-200",failed:"bg-red-100 text-red-700 border-red-200"};e.s(["f",0,function({status:e}){let{t:n}=(0,a.b)();return(0,t.jsx)(s.f,{variant:"outline",className:r[e],children:n.exam.status[e]})}])},574041,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(37727),r=e.i(487486),n=e.i(793479),i=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:c,placeholder:d="Enter tags...",className:o="",enterHint:u,subject:m,gradeStage:x}){let[f,h]=(0,s.useState)(""),[p,g]=(0,s.useState)([]),[b,j]=(0,s.useState)(!1),[v,y]=(0,s.useState)(0),N=(0,s.useRef)(null),k=(0,s.useRef)(null),w=(0,s.useCallback)(async t=>{try{let s=new URLSearchParams({q:t});m&&s.append("subject",m),x&&s.append("stage",x);let a=((await i.f.get(`/api/tags/suggestions?${s.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));g(a.slice(0,20)),j(a.length>0),y(0)}catch(e){l.f.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,x,e]);(0,s.useEffect)(()=>{f.trim()&&w(f)},[f,w]);let C=t=>{t.trim()&&!e.includes(t.trim())&&(c([...e,t.trim()]),h(""),g([]),j(!1),y(0))},S=t=>{c(e.filter(e=>e!==t))};return(0,s.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||N.current?.contains(e.target)||j(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${o}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(r.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>S(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.f,{ref:N,type:"text",value:f,onChange:e=>{h(e.target.value),e.target.value.trim()||(g([]),j(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&p[v]?C(p[v]):f.trim()&&C(f)):"ArrowDown"===t.key?(t.preventDefault(),y(e=>Math.min(e+1,p.length-1))):"ArrowUp"===t.key?(t.preventDefault(),y(e=>Math.max(e-1,0))):"Escape"===t.key?(j(!1),y(0)):"Backspace"===t.key&&!f&&e.length>0&&S(e[e.length-1])},onFocus:()=>{p.length>0&&j(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),b&&p.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:p.map((e,s)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${s===v?"bg-accent":""}`,onClick:()=>C(e),onMouseEnter:()=>y(s),children:e},e))}),f&&!b&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${f}"`:`Press Enter to create "${f}"`})]})}])},590546,e=>{var t=e.i(843476),s=e.i(618566),a=e.i(519455),r=e.i(871689);e.s(["f",0,function({fallbackUrl:e,className:n}){let i=(0,s.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:n,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},515288,e=>{var t=e.i(843476),s=e.i(975157);e.s(["N",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,s.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})},"O",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,s.f)("px-6",e),...a})},"u",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,s.f)("text-muted-foreground text-sm",e),...a})},"Y",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,s.f)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})},"v",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,s.f)("leading-none font-semibold",e),...a})}])},257428,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(820783),r=e.i(30030),n=e.i(981140),i=e.i(369340),l=e.i(635804),c=e.i(296626),d=e.i(248425),o=Object.defineProperty,u=(e,t)=>o(e,"name",{value:t,configurable:!0}),m="Checkbox",[x,f]=(0,r.f)(m),[h,p]=x(m);function g(e){let{__scopeCheckbox:a,checked:r,children:n,defaultChecked:l,disabled:c,form:d,name:o,onCheckedChange:u,required:x,value:f="on",internal_do_not_use_render:p}=e,[g,b]=(0,i.f)({prop:r,defaultProp:l??!1,onChange:u,caller:m}),[j,v]=s.useState(null),[y,w]=s.useState(null),[C,S]=s.useState(null),E=!j||!!d||!!j.closest("form"),R={checked:g,disabled:c,setChecked:b,control:j,setControl:v,name:o,form:d,value:f,userClick:C,onUserClick:S,required:x,defaultChecked:!k(l)&&l,isFormControl:E,bubbleInput:y,setBubbleInput:w};return(0,t.jsx)(h,{scope:a,...R,children:N(p)?p(R):n})}u(g,"CheckboxProvider");var b=s.forwardRef(u(function({__scopeCheckbox:e,onKeyDown:r,onClick:i,...l},c){let{control:o,value:m,disabled:x,checked:f,required:h,setControl:g,setChecked:b,onUserClick:j,isFormControl:v,bubbleInput:y}=p("CheckboxTrigger",e),N=(0,a.f)(c,g),C=s.useRef(f);return s.useEffect(()=>{let e=o?.form;if(e){let t=u(()=>b(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,b]),(0,t.jsx)(d.V.button,{type:"button",role:"checkbox","aria-checked":k(f)?"mixed":f,"aria-required":h,"data-state":w(f),"data-disabled":x?"":void 0,disabled:x,value:m,...l,ref:N,onKeyDown:(0,n.f)(r,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,n.f)(i,e=>{let t=e.isPropagationStopped();j({requestedChecked:!!k(f)||!f,hasConsumerStoppedPropagation:t}),b(e=>!!k(e)||!e),y&&v&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),j=s.forwardRef(u(function(e,s){let{__scopeCheckbox:a,name:r,checked:n,defaultChecked:i,required:l,disabled:c,value:d,onCheckedChange:o,form:u,...m}=e;return(0,t.jsx)(g,{__scopeCheckbox:a,checked:n,defaultChecked:i,disabled:c,required:l,onCheckedChange:o,name:r,form:u,value:d,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...m,ref:s,__scopeCheckbox:a}),e&&(0,t.jsx)(y,{__scopeCheckbox:a})]})})},"Checkbox")),v=s.forwardRef(u(function(e,s){let{__scopeCheckbox:a,forceMount:r,...n}=e,i=p("CheckboxIndicator",a);return(0,t.jsx)(c.f,{present:r||k(i.checked)||!0===i.checked,children:(0,t.jsx)(d.V.span,{"data-state":w(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),y=s.forwardRef(u(function({__scopeCheckbox:e,onClick:r,...i},c){let{control:o,userClick:u,checked:m,defaultChecked:x,required:f,disabled:h,name:g,value:b,form:j,bubbleInput:v,setBubbleInput:y}=p("CheckboxBubbleInput",e),N=(0,a.f)(c,y),w=(0,l.f)(o),C=s.useRef(!1),S=s.useRef(m),E=s.useRef(u),R=s.useRef(null);s.useEffect(()=>{if(!v)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=S.current!==m;S.current=m;let s=null!==u&&u!==E.current;if(E.current=u,s)R.current=t?null:u,t&&(v.indeterminate=k(m),e.call(v,!k(m)&&m)),v.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(t){let t=R.current;R.current=null;let s=t?.requestedChecked===m;C.current=!0,v.indeterminate=k(m),e.call(v,!k(m)&&m),v.dispatchEvent(new Event("click",{bubbles:!(s&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[v,m,u]);let M=s.useRef(!k(m)&&m);return(0,t.jsx)(d.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??M.current,required:f,disabled:h,name:g,value:b,form:j,...i,tabIndex:-1,ref:N,onClick:(0,n.f)(r,e=>{C.current&&e.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function N(e){return"function"==typeof e}function k(e){return"indeterminate"===e}function w(e){return k(e)?"indeterminate":e?"checked":"unchecked"}u(N,"isFunction"),u(k,"isIndeterminate"),u(w,"getState");var C=e.i(643531),S=e.i(975157);let E=s.forwardRef(({className:e,...s},a)=>(0,t.jsx)(j,{ref:a,className:(0,S.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...s,children:(0,t.jsx)(v,{className:(0,S.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));E.displayName=j.displayName,e.s(["f",0,E],257428)},912505,e=>{var t=e.i(843476),s=e.i(975157);e.s(["f",0,function({icon:e,title:a,description:r,action:n,className:i}){return(0,t.jsxs)("div",{className:(0,s.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",i),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:a}),r&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),n&&(0,t.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var t=e.i(843476),s=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:r,backHref:n,actions:i,titleAddon:l,className:c}){return(0,t.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",c),children:[n&&(0,t.jsx)(s.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),r&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:r})]}),i&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:i})]})}])},86963,e=>{var t=e.i(843476),s=e.i(531278);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),s=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,s.b)(),r=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}])})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,871689,e=>{let t=(0,e.i(475254).f)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,t],871689)},503116,e=>{let t=(0,e.i(475254).f)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["f",0,t],503116)},356909,e=>{let t=(0,e.i(475254).f)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["f",0,t],356909)},908821,e=>{let t=(0,e.i(475254).f)("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);e.s(["f",0,t])},991686,868983,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(522016),r=e.i(215519),i=e.i(306831),l=e.i(664659),n=e.i(655900),d=e.i(531278),c=e.i(107233),m=e.i(283086),o=e.i(727612),x=e.i(487486),u=e.i(519455),f=e.i(515288),h=e.i(511445),p=e.i(356909),y=e.i(793479),g=e.i(393733),b=e.i(111110),j=e.i(41931);function v({errorItemId:e,onSaved:a,onCancel:l}){let{t:n}=(0,b.b)(),{timeZone:c}=(0,r.M)(),m=(0,i.r)(new Date,"yyyy-MM-dd",c),[o,x]=(0,s.useState)(null),[f,h]=(0,s.useState)(m),[N,w]=(0,s.useState)(!1),[k,M]=(0,s.useState)(null),A=async()=>{if(o&&f){w(!0),M(null);try{await j.f.post("/api/practice/record",{errorItemId:e,result:o,source:"manual",takenAt:(0,i.$)(f,c)}),a()}catch{M(n.mastery.resultSaveFailed)}finally{w(!1)}}};return(0,t.jsxs)("div",{className:"space-y-3 rounded-md border bg-muted/30 p-3",children:[(0,t.jsx)(g.f,{value:o,onChange:x,disabled:N}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,t.jsx)("label",{htmlFor:`practice-date-${e}`,className:"text-sm font-medium",children:n.mastery.recordDate}),(0,t.jsx)(y.f,{id:`practice-date-${e}`,type:"date",value:f,max:m,onChange:e=>h(e.target.value),className:"sm:w-48"}),(0,t.jsxs)("div",{className:"flex gap-2 sm:ml-auto",children:[(0,t.jsx)(u.f,{variant:"outline",size:"sm",onClick:l,disabled:N,className:"flex-1 sm:flex-none",children:n.exam.cancel}),(0,t.jsxs)(u.f,{size:"sm",onClick:A,disabled:N||!o||!f,className:"flex-1 sm:flex-none",children:[N?(0,t.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(p.f,{className:"mr-2 h-4 w-4"}),n.mastery.saveResult]})]})]}),k&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:k})]})}var N=e.i(149704),w=e.i(294114);let k={correct:"bg-green-100 text-green-700 border-green-200",wrong:"bg-red-100 text-red-700 border-red-200",not_attempted:"bg-amber-100 text-amber-700 border-amber-200"};e.s(["K",0,function({errorItemId:e,onMasteryStatusChange:p}){let{timeZone:y}=(0,r.M)(),{t:g}=(0,b.b)(),[M,A]=(0,s.useState)(null),[T,S]=(0,s.useState)(null),[$,C]=(0,s.useState)(0),[R,H]=(0,s.useState)(!1),E=(0,s.useCallback)(()=>{j.f.get(`/api/error-items/${e}/practice-records`).then(e=>{A(e),p?.(e.masteryStatus)}).catch(()=>void 0)},[e,p]);(0,s.useEffect)(E,[E]);let q=()=>{C(0),E()},z=async e=>{if(await (0,w.u)(g.mastery.deleteRecordConfirm,{destructive:!0}))try{await j.f.delete(`/api/practice/record/${e}`),q()}catch{w.c.error(g.mastery.deleteRecordFailed)}},I=M?.records[0],O=!!I&&(!M?.masteryEvaluatedAt||new Date(I.createdAt)>new Date(M.masteryEvaluatedAt));if((0,s.useEffect)(()=>{if(!O||$>=20)return;let e=setTimeout(()=>{C(e=>e+1),E()},4e3);return()=>clearTimeout(e)},[O,$,E]),!M)return null;let P=M.masteryProbability,U=null===P?null:Math.round(100*P),D=null===U?"":null!==P&&P>=.5?"bg-green-500":U>=30?"bg-amber-500":"bg-red-500",_=g.practice.difficulty;return(0,t.jsxs)(f.N,{children:[(0,t.jsx)(f.Y,{children:(0,t.jsxs)(f.v,{className:"flex items-center gap-2 text-base",children:[(0,t.jsx)(m.f,{className:"h-4 w-4 text-primary"}),g.mastery.probability]})}),(0,t.jsxs)(f.O,{className:"space-y-4",children:[null===U?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:O?g.mastery.pending:g.mastery.notEvaluated}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsxs)("span",{className:"text-3xl font-bold",children:[U,"%"]}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[O&&(0,t.jsx)(d.f,{className:"h-3 w-3 animate-spin"}),(0,t.jsx)(x.f,{variant:"outline",children:"ai"===M.masterySource?g.mastery.aiEvaluated:g.mastery.estimated})]})]}),(0,t.jsx)("div",{className:"h-2 w-full rounded-full bg-muted overflow-hidden",children:(0,t.jsx)("div",{className:`h-full ${D} transition-all`,style:{width:`${U}%`}})}),M.masteryReason&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:M.masteryReason}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g.mastery.thresholdHint})]}),(0,t.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-semibold",children:g.mastery.history}),!R&&(0,t.jsxs)(u.f,{variant:"outline",size:"sm",onClick:()=>H(!0),children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),g.mastery.addRecord]})]}),R&&(0,t.jsx)(v,{errorItemId:e,onCancel:()=>H(!1),onSaved:()=>{H(!1),q()}}),0===M.records.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:g.mastery.noHistory}):(0,t.jsx)("ul",{className:"divide-y rounded-md border",children:M.records.map(e=>(0,t.jsxs)("li",{className:"p-3 text-sm space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 flex-wrap items-center gap-2 text-left",onClick:()=>S(T===e.id?null:e.id),children:[(0,t.jsx)("span",{className:"text-muted-foreground tabular-nums",children:(0,i.r)(e.createdAt,"yyyy-MM-dd HH:mm",y)}),(0,t.jsx)(x.f,{variant:"outline",className:k[e.result]||"",children:g.mastery.results[e.result]||e.result}),e.difficulty&&(0,t.jsx)(x.f,{variant:"secondary",children:_[e.difficulty]||e.difficulty}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.exam?`${g.mastery.sources.exam} \xb7 ${e.exam.title}`:g.mastery.sources[e.source]||g.mastery.sources.practice}),e.questionText&&(0,t.jsx)("span",{className:"ml-auto text-muted-foreground",children:T===e.id?(0,t.jsx)(n.f,{className:"h-4 w-4"}):(0,t.jsx)(l.f,{className:"h-4 w-4"})})]}),(0,t.jsx)("button",{type:"button","aria-label":g.mastery.deleteRecord,title:g.mastery.deleteRecord,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-red-50 hover:text-red-600",onClick:()=>z(e.id),children:(0,t.jsx)(o.f,{className:"h-4 w-4"})})]}),T===e.id&&e.questionText&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[(0,t.jsx)(h.f,{content:e.questionText}),(0,t.jsx)(N.f,{svg:e.figureSvg}),e.wrongAnswerText&&(0,t.jsxs)("div",{className:"border-t pt-2",children:[(0,t.jsx)("p",{className:"mb-1 font-medium",children:g.editor.wrongAnswerText}),(0,t.jsx)(h.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{className:"border-t pt-2",children:[(0,t.jsx)("p",{className:"mb-1 font-medium",children:g.editor.mistakeAnalysis}),(0,t.jsx)(h.f,{content:e.mistakeAnalysis})]}),e.originalImageUrl&&(0,t.jsx)("img",{src:e.originalImageUrl,alt:g.editor.wrongAnswerText,className:"max-h-96 max-w-full rounded object-contain"}),e.answerText&&(0,t.jsx)("div",{className:"border-t pt-2",children:(0,t.jsx)(h.f,{content:e.answerText,className:"font-semibold"})}),e.exam&&(0,t.jsx)(a.default,{href:`/exams/${e.exam.paperId}`,className:"text-xs text-primary hover:underline",children:e.exam.title})]})]},e.id))})]})]})]})},"x",0,k],991686);var M=e.i(908821);e.s(["f",()=>M.f],868983)},846968,e=>{var t=e.i(843476),s=e.i(269638),a=e.i(503116),r=e.i(16715),i=e.i(487486),l=e.i(111110);let n={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:a.f},reviewing:{className:"bg-primary/10 text-primary",icon:r.f},mastered:{className:"bg-success/15 text-success",icon:s.f}};e.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:e,className:s=""}){let{t:a}=(0,l.b)(),{className:r,icon:d}=n[e],c="mastered"===e?a.notebook.mastered:"reviewing"===e?a.notebook.reviewing:a.notebook.review;return(0,t.jsx)(i.f,{variant:"secondary",className:`${r} ${s}`,children:(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(d,{className:"h-3 w-3"})," ",c]})})}])},393733,e=>{var t=e.i(843476),s=e.i(269638);let a=(0,e.i(475254).f)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var r=e.i(373884),i=e.i(111110);let l=[{value:"correct",icon:s.f,active:"border-green-600 bg-green-50 text-green-700"},{value:"wrong",icon:r.f,active:"border-red-600 bg-red-50 text-red-700"},{value:"not_attempted",icon:a,active:"border-amber-600 bg-amber-50 text-amber-700"}];e.s(["f",0,function({value:e,onChange:s,disabled:a,size:r="md"}){let{t:n}=(0,i.b)(),d="sm"===r?"px-2 py-1 text-xs":"px-3 py-2 text-sm";return(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",role:"radiogroup",children:l.map(({value:i,icon:l,active:c})=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":e===i,disabled:a,onClick:()=>s(i),className:`flex items-center justify-center gap-1 rounded-md border font-medium transition-colors disabled:opacity-60 ${d} ${e===i?c:"border-input hover:bg-muted"}`,children:[(0,t.jsx)(l,{className:"sm"===r?"h-3 w-3":"h-4 w-4"}),n.mastery.results[i]]},i))})}],393733)},149704,e=>{var t=e.i(843476),s=e.i(111110),a=e.i(975157);e.s(["f",0,function({svg:e,className:r}){let{t:i}=(0,s.b)();return e?(0,t.jsx)("figure",{className:(0,a.f)("question-figure my-3",r),children:(0,t.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:i.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360}})}):null}],149704)},515288,e=>{var t=e.i(843476),s=e.i(975157);e.s(["N",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,s.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})},"O",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,s.f)("px-6",e),...a})},"u",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,s.f)("text-muted-foreground text-sm",e),...a})},"Y",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,s.f)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})},"v",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,s.f)("leading-none font-semibold",e),...a})}])},912505,e=>{var t=e.i(843476),s=e.i(975157);e.s(["f",0,function({icon:e,title:a,description:r,action:i,className:l}){return(0,t.jsxs)("div",{className:(0,s.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",l),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:a}),r&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),i&&(0,t.jsx)("div",{className:"mt-5",children:i})]})}])},86963,e=>{var t=e.i(843476),s=e.i(531278);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},990745,e=>{e.s(["f",0,function(e){if(e.tags&&e.tags.length>0)return e.tags.map(e=>e.name);if(!e.knowledgePoints)return[];try{let t=JSON.parse(e.knowledgePoints);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}])},35209,e=>{var t=e.i(271645),s=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,s.b)(),r=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}])})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,72664,3198,e=>{var t=e.i(475254);let r=(0,t.f)("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);e.s(["f",0,r],72664);var i=e.i(843476),a=e.i(271645),n=e.i(531278);let s=(0,t.f)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),o=(0,t.f)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);var l=e.i(367240),d=e.i(16715),h=e.i(727612),c=e.i(519455),u=e.i(111110),m=e.i(294114),g=e.i(201276);let p=null,f=["setcoordsystem","setaxesvisible","setgridvisible","setcolor","setlinethickness","setlinestyle","setpointsize","setpointstyle","setlabelvisible","setcaption","setvisible","setfilling","setvalue","setfixed","setbackgroundcolor"];function w(e,t,r){let i=e?.firstElementChild;i&&(i.style.width="100%",i.style.height=`${r}px`,t?.setSize(e?.offsetWidth||i.offsetWidth||800,r))}function x(e,t){for(let r of t)try{if(function(e){let t=e.toLowerCase().trim();return f.some(e=>t.startsWith(e+"("))}(r)){let t=function(e){let t=e.match(/^(\w+)\(([\s\S]+)\)$/);if(!t)return null;try{let e=t[2].trim();if(e.startsWith("[")&&e.endsWith("]"))return{m:t[1],a:JSON.parse(e)};if(/^-?\d+(\.\d+)?$/.test(e))return{m:t[1],a:[Number(e)]};if("true"===e||"false"===e)return{m:t[1],a:["true"===e]};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{m:t[1],a:[e.slice(1,-1)]};let r=e.split(",").map(e=>e.trim()).map(e=>/^-?\d+(\.\d+)?$/.test(e)?Number(e):"true"===e||"false"===e?"true"===e:e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e);return{m:t[1],a:r}}catch{return null}}(r),i=t?e[t.m]:void 0;t&&"function"==typeof i&&i.apply(e,t.a)}else{let t=r.trim();t&&!/[<>'"]/.test(t)?e.evalCommand(t):g.f.warn("[GGB]","Blocked potentially unsafe command",{command:r.substring(0,50)})}}catch(e){g.f.warn("[GGB]","Command failed",{command:r,error:e})}}e.s(["f",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:f=!1,showMenuBar:y=!1,className:b="",onRegenerate:v,onDelete:C}){let{t:k}=(0,u.b)(),j=(0,a.useRef)(null),D=(0,a.useRef)(null),N=(0,a.useId)(),M=(0,a.useRef)(`ggb-${N.replace(/[^a-zA-Z0-9_-]/g,"")}`),[R,E]=(0,a.useState)(!0),[S,$]=(0,a.useState)(null),[I,_]=(0,a.useState)(!0),[P,B]=(0,a.useState)(!1),[H,A]=(0,a.useState)(!1),L=(0,a.useMemo)(()=>(function(e){if(!e?.trim())return[];let t=e.trim();if(t.startsWith("["))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&""!==e.trim())}catch{}return t.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//"))})(e),[e]);(0,a.useEffect)(()=>{if(0===L.length)return;let e=!1,i=M.current,a=j.current;return(p||(p=new Promise((e,t)=>{if(window.GGBApplet)return void e();let r=document.createElement("script");r.src="https://www.geogebra.org/apps/deployggb.js",r.async=!0,r.onload=()=>e(),r.onerror=()=>{p=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let n=window.GGBApplet;if(!n){$(k.geogebra.notLoaded),E(!1);return}if(a){a.innerHTML=`<div id="${i}" style="width:100%;height:${t}px"></div>`;try{new n({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:f,showMenuBar:y,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(D.current=r,w(a,r,t),x(r,L),E(!1))}},!0).inject(i)}catch(t){g.f.error("[GGB]","Init failed",{error:t}),e||($(k.geogebra.initFailed),E(!1))}}}).catch(t=>{g.f.error("[GGB]","Script load failed",{error:t}),e||($(k.geogebra.scriptFailed),E(!1))}),()=>{e=!0;try{let e=D.current;e?.remove&&e.remove()}catch(e){g.f.warn("[GGB]","Cleanup failed",{error:e})}D.current=null,a&&(a.innerHTML="")}},[L,r,f,y]),(0,a.useEffect)(()=>{w(j.current,D.current,I?700:t)},[I,t]);let z=(0,a.useCallback)(()=>{let e=D.current;if(e)try{e.resetConstruction(),setTimeout(()=>{D.current&&x(D.current,L)},300)}catch(e){g.f.warn("[GGB]","Reset failed",{error:e})}},[L]),X=(0,a.useCallback)(async()=>{if(v&&!P){B(!0);try{await v()}finally{B(!1)}}},[v,P]),K=(0,a.useCallback)(async()=>{if(C&&!H&&await (0,m.u)(k.geogebra.confirmDelete,{destructive:!0})){A(!0);try{await C()}catch{m.c.error(k.geogebra.deleteFailed)}finally{A(!1)}}},[C,H,k]);return 0===L.length?null:(0,i.jsxs)("div",{className:`relative rounded-lg border bg-card ${b}`,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:k.geogebra.title}),R&&(0,i.jsx)(n.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[v&&(0,i.jsxs)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:X,title:k.geogebra.regenerate,disabled:P||R,children:[P?(0,i.jsx)(n.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(d.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.regenerate})]}),C&&(0,i.jsxs)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:K,title:k.geogebra.delete,disabled:H||P,children:[H?(0,i.jsx)(n.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(h.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.delete})]}),(0,i.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:z,title:k.geogebra.reset,disabled:R,children:(0,i.jsx)(l.f,{className:"h-3.5 w-3.5"})}),(0,i.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>_(e=>!e),title:I?k.geogebra.shrink:k.geogebra.enlarge,children:I?(0,i.jsx)(o,{className:"h-3.5 w-3.5"}):(0,i.jsx)(s,{className:"h-3.5 w-3.5"})})]})]}),(0,i.jsx)("div",{ref:j,style:{width:"100%"}}),R&&(0,i.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,i.jsx)(n.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm text-muted-foreground",children:k.geogebra.loading})]})}),S&&(0,i.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:S})]})}],3198)},283086,e=>{let t=(0,e.i(475254).f)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["f",0,t],283086)},469937,62825,e=>{var t=e.i(843476);let r=(0,e.i(475254).f)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var i=e.i(111110),a=e.i(975157);let n=[1,2,3,4,5];function s(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["f",0,function({value:e,onChange:s,disabled:o,size:l="sm",showUnrated:d=!0,className:h}){let{t:c}=(0,i.b)(),u=e??0,m="sm"===l?"h-3.5 w-3.5":"h-5 w-5",g=u?c.difficulty.starsLabel.replace("{n}",String(u)):c.difficulty.unrated;return s?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",h),role:"group","aria-label":`${c.difficulty.label}:${g}`,title:c.difficulty.clearHint,children:[n.map(e=>(0,t.jsx)("button",{type:"button",disabled:o,onClick:()=>s(e===u?null:e),"aria-label":c.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(r,{className:(0,a.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:c.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",h),role:"img","aria-label":`${c.difficulty.label}:${g}`,title:g,children:n.map(e=>(0,t.jsx)(r,{className:(0,a.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",h),children:c.difficulty.unrated}):null}],469937),e.s(["i",0,function(e,t="zh"){return("en"===t?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[s(e)]},"h",0,s,"x",0,function(e,t){return(t||"").trim()?"wrong_attempt":s(e)}],62825)},12130,e=>{var t=e.i(843476),r=e.i(271645),i=r,a={x:0,y:0,width:0,height:0,unit:"px"},n=(e,t,r)=>Math.min(Math.max(e,t),r),s=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function o(e,t,r){return"%"===e.unit?{...a,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function l(e,t,r){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...a,...e,unit:"px"}}function d(e,t,r,i,a,n=0,s=0,o=i,l=a){let h={...e},c=Math.min(n,i),u=Math.min(s,a),m=Math.min(o,i),g=Math.min(l,a);t&&(t>1?(u=(c=s?s*t:c)/t,m=o*t):(c=(u=n?n/t:u)*t,g=l/t)),h.y<0&&(h.height=Math.max(h.height+h.y,u),h.y=0),h.x<0&&(h.width=Math.max(h.width+h.x,c),h.x=0);let p=i-(h.x+h.width);p<0&&(h.x=Math.min(h.x,i-c),h.width+=p);let f=a-(h.y+h.height);if(f<0&&(h.y=Math.min(h.y,a-u),h.height+=f),h.width<c&&(("sw"===r||"nw"==r)&&(h.x-=c-h.width),h.width=c),h.height<u&&(("nw"===r||"ne"==r)&&(h.y-=u-h.height),h.height=u),h.width>m&&(("sw"===r||"nw"==r)&&(h.x-=m-h.width),h.width=m),h.height>g&&(("nw"===r||"ne"==r)&&(h.y-=g-h.height),h.height=g),t){let e=h.width/h.height;if(e<t){let e=Math.max(h.width/t,u);("nw"===r||"ne"==r)&&(h.y-=e-h.height),h.height=e}else if(e>t){let e=Math.max(h.height*t,c);("sw"===r||"nw"==r)&&(h.x-=e-h.width),h.width=e}}return h}var h={capture:!0,passive:!1},c=0,u=class e extends i.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,i.createRef)();mediaRef=(0,i.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${c++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:r,width:i,height:a}=e.getBoundingClientRect();return{x:t,y:r,width:i,height:a}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:i}=this.getBox();e&&i&&r(l(t,e,i),o(t,e,i))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,h),this.document.addEventListener("pointerup",this.onDocPointerDone,h),this.document.addEventListener("pointercancel",this.onDocPointerDone,h),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,h),this.document.removeEventListener("pointerup",this.onDocPointerDone,h),this.document.removeEventListener("pointercancel",this.onDocPointerDone,h),!1)}onCropPointerDown=e=>{let{crop:t,disabled:r}=this.props,i=this.getBox();if(!t)return;let a=l(t,i.width,i.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let n=e.target.dataset.ord,s=e.clientX,o=e.clientY,d=a.x,h=a.y;if(n){let t=e.clientX-i.x,r=e.clientY-i.y,l=0,c=0;"ne"===n||"e"==n?(l=t-(a.x+a.width),c=r-a.y,d=a.x,h=a.y+a.height):"se"===n||"s"===n?(l=t-(a.x+a.width),c=r-(a.y+a.height),d=a.x,h=a.y):"sw"===n||"w"==n?(l=t-a.x,c=r-(a.y+a.height),d=a.x+a.width,h=a.y):("nw"===n||"n"==n)&&(l=t-a.x,c=r-a.y,d=a.x+a.width,h=a.y+a.height),s=d+i.x+l,o=h+i.y+c}this.evData={startClientX:s,startClientY:o,startCropX:d,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!!n,ord:n},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:r,locked:i,keepSelection:a,onChange:n}=this.props,s=this.getBox();if(r||i||a&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let d=e.clientX-s.x,h=e.clientY-s.y,c={unit:"px",x:d,y:h,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:d,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,n(l(c,s.width,s.height),o(c,s.width,s.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:r,disabled:i,onChange:a,onDragStart:n}=this.props,d=this.getBox();if(i||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,n&&n(e));let{evData:h}=this;h.clientX=e.clientX,h.clientY=e.clientY,s(r,t=h.isResize?this.resizeCrop():this.dragCrop())||a(l(t,d.width,d.height),o(t,d.width,d.height))};onComponentKeyDown=t=>{let{crop:r,disabled:i,onChange:a,onComplete:s}=this.props;if(i)return;let d=t.key,h=!1;if(!r)return;let c=this.getBox(),u=this.makePixelCrop(c),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===d?(u.x-=m,h=!0):"ArrowRight"===d?(u.x+=m,h=!0):"ArrowUp"===d?(u.y-=m,h=!0):"ArrowDown"===d&&(u.y+=m,h=!0),h){t.cancelable&&t.preventDefault(),u.x=n(u.x,0,c.width-u.width),u.y=n(u.y,0,c.height-u.height);let e=l(u,c.width,c.height),r=o(u,c.width,c.height);a(e,r),s&&s(e,r)}};onHandlerKeyDown=(t,r)=>{var i,a;let n,{aspect:h=0,crop:c,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(u||!c||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=d((i=l(c,y.width,y.height),a=t.key,n={...i},"ArrowLeft"===a?"nw"===r?(n.x-=b,n.y-=b,n.width+=b,n.height+=b):"w"===r?(n.x-=b,n.width+=b):"sw"===r?(n.x-=b,n.width+=b,n.height+=b):"ne"===r?(n.y+=b,n.width-=b,n.height-=b):"e"===r?n.width-=b:"se"===r&&(n.width-=b,n.height-=b):"ArrowRight"===a&&("nw"===r?(n.x+=b,n.y+=b,n.width-=b,n.height-=b):"w"===r?(n.x+=b,n.width-=b):"sw"===r?(n.x+=b,n.width-=b,n.height-=b):"ne"===r?(n.y-=b,n.width+=b,n.height+=b):"e"===r?n.width+=b:"se"===r&&(n.width+=b,n.height+=b)),"ArrowUp"===a?"nw"===r?(n.x-=b,n.y-=b,n.width+=b,n.height+=b):"n"===r?(n.y-=b,n.height+=b):"ne"===r?(n.y-=b,n.width+=b,n.height+=b):"sw"===r?(n.x+=b,n.width-=b,n.height-=b):"s"===r?n.height-=b:"se"===r&&(n.width-=b,n.height-=b):"ArrowDown"===a&&("nw"===r?(n.x+=b,n.y+=b,n.width-=b,n.height-=b):"n"===r?(n.y+=b,n.height-=b):"ne"===r?(n.y+=b,n.width-=b,n.height-=b):"sw"===r?(n.x-=b,n.width+=b,n.height+=b):"s"===r?n.height+=b:"se"===r&&(n.width+=b,n.height+=b)),n),h,r,y.width,y.height,m,g,p,f);if(!s(c,v)){let e=o(v,y.width,y.height);w(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:r,onComplete:i,onDragEnd:a}=this.props,n=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,a&&a(e),i&&i(l(t,n.width,n.height),o(t,n.width,n.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),i=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return r.x=n(e.startCropX+i,0,t.width-r.width),r.y=n(e.startCropY+a,0,t.height-r.height),r}getPointRegion(e,t,r,i){let{evData:a}=this,n=a.clientX-e.x,s=a.clientY-e.y,o;return o=i&&t?"nw"===t||"n"===t||"ne"===t:s<a.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:n<a.startCropX)?o?"nw":"sw":o?"ne":"se"}resolveMinDimensions(e,t,r=0,i=0){let a=Math.min(r,e.width),n=Math.min(i,e.height);return t&&(a||n)?t>1?a?[a,a/t]:[n*t,n]:n?[n*t,n]:[a,a/t]:[a,n]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:i,maxHeight:a}=this.props,s=this.getBox(),[o,l]=this.resolveMinDimensions(s,r,this.props.minWidth,this.props.minHeight),h=this.makePixelCrop(s),c=this.getPointRegion(s,t.ord,o,l),u=t.ord||c,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(o&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-o)),(l&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-l));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===c?(p.x=t.startCropX,p.width=m,r?p.height=p.width/r:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===c?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,r?p.height=p.width/r:p.height=g):"sw"===c?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),r?p.height=p.width/r:p.height=g):"nw"===c&&(p.x=t.startCropX+m,p.width=Math.abs(m),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=d(p,r,c,s.width,s.height,o,l,i,a);return r||e.xyOrds.indexOf(u)>-1?h=f:e.xOrds.indexOf(u)>-1?(h.x=f.x,h.width=f.width):e.yOrds.indexOf(u)>-1&&(h.y=f.y,h.height=f.height),h.x=n(h.x,0,s.width-h.width),h.y=n(h.y,0,s.height-h.height),h}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:a,renderSelectionAddon:n,ruleOfThirds:s,crop:o}=this.props,l=this.getCropStyle();if(o)return i.default.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!a&&i.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},i.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),n&&i.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},n(this.state)),s&&i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return l({...a,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:a,crop:n,disabled:s,locked:o,style:l,ruleOfThirds:d}=this.props,{cropIsActive:h,newCropIsBeingDrawn:c}=this.state,u=n?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",a,h&&"ReactCrop--active",s&&"ReactCrop--disabled",o&&"ReactCrop--locked",c&&"ReactCrop--new-crop",n&&e&&"ReactCrop--fixed-aspect",n&&r&&"ReactCrop--circular-crop",n&&d&&"ReactCrop--rule-of-thirds",!this.dragStarted&&n&&!n.width&&!n.height&&"ReactCrop--invisible-crop",r&&"ReactCrop--no-animate");return i.default.createElement("div",{ref:this.componentRef,className:m,style:l},i.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),n?i.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},i.default.createElement("defs",null,i.default.createElement("mask",{id:`hole-${this.instanceId}`},i.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),r?i.default.createElement("ellipse",{cx:`${n.x+n.width/2}${n.unit}`,cy:`${n.y+n.height/2}${n.unit}`,rx:`${n.width/2}${n.unit}`,ry:`${n.height/2}${n.unit}`,fill:"black"}):i.default.createElement("rect",{x:`${n.x}${n.unit}`,y:`${n.y}${n.unit}`,width:`${n.width}${n.unit}`,height:`${n.height}${n.unit}`,fill:"black"}))),i.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}},m=e.i(519455),g=e.i(776639),p=e.i(37727),f=e.i(111110);async function w(e,t){let{naturalWidth:r,naturalHeight:i}=e;return Promise.all(t.map(t=>new Promise((a,n)=>{let s=document.createElement("canvas"),o=Math.round(t.x*r),l=Math.round(t.y*i);s.width=Math.max(1,Math.round(t.width*r)),s.height=Math.max(1,Math.round(t.height*i));let d=s.getContext("2d");d?(d.drawImage(e,o,l,s.width,s.height,0,0,s.width,s.height),s.toBlob(e=>e?a(e):n(Error("Canvas is empty")),"image/jpeg",.95)):n(Error("Canvas is not supported"))})))}let x=(0,r.forwardRef)(function({imageSrc:e,regions:i,onChange:a},n){let{t:s}=(0,f.b)(),o=(0,r.useRef)(null),l=(0,r.useRef)(null),[d,h]=(0,r.useState)(null),c=e=>{let t=o.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},u=()=>{d&&d.width>=.02&&d.height>=.02&&a([...i,d]),l.current=null,h(null)},m=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:n,src:e,alt:"",draggable:!1,style:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},className:"block"}),(0,t.jsxs)("div",{ref:o,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(o.current?.setPointerCapture(e.pointerId),l.current=c(e),h(null))},onPointerMove:e=>{var t,r,i,a;let n,s,o;if(!l.current)return;let d=c(e);h((t=l.current.x,r=l.current.y,i=d.x,a=d.y,s=(n=e=>Math.min(1,Math.max(0,e)))(Math.min(t,i)),o=n(Math.min(r,a)),{x:s,y:o,width:n(Math.max(t,i))-s,height:n(Math.max(r,a))-o}))},onPointerUp:u,onPointerCancel:u,children:[i.map((e,r)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:m(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:r+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":s.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>a(i.filter((e,t)=>t!==r)),children:(0,t.jsx)(p.X,{className:"h-3 w-3"})})]},r)),d&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:m(d)})]})]})});var y=e.i(201276);e.s(["f",0,function({imageSrc:e,open:i,onClose:a,onCropComplete:n,onMultiCropComplete:s}){let{t:o}=(0,f.b)(),[l,d]=(0,r.useState)(),[h,c]=(0,r.useState)(),p=(0,r.useRef)(null),[b,v]=(0,r.useState)("single"),[C,k]=(0,r.useState)({src:e,regions:[]}),j=C.src===e?C.regions:[],D=t=>k({src:e,regions:t}),N=(0,r.useRef)(null),M=async()=>{if(N.current&&0!==j.length&&s)try{s(await w(N.current,j)),D([])}catch(e){y.f.error("[ImageCropper]","Multi-image crop failed",{error:e})}},R=async(e,t)=>{let r=document.createElement("canvas"),i=e.naturalWidth/e.width,a=e.naturalHeight/e.height;r.width=t.width*i,r.height=t.height*a;let n=r.getContext("2d");return n?(n.drawImage(e,t.x*i,t.y*a,t.width*i,t.height*a,0,0,t.width*i,t.height*a),new Promise((e,t)=>{r.toBlob(r=>{r?e(r):t(Error("Canvas is empty"))},"image/jpeg")})):null},E=async()=>{if(h&&p.current)try{let e=await R(p.current,h);e&&n(e)}catch(e){y.f.error("[ImageCropper]","Crop failed",{error:e})}else if(!h&&e)try{let t=await fetch(e),r=await t.blob();n(r)}catch(e){y.f.error("[ImageCropper]","Failed to load original image",{error:e})}};return(0,t.jsx)(g.N,{open:i,onOpenChange:e=>!e&&a(),children:(0,t.jsxs)(g.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(g.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(g.F,{children:o.common.cropper?.title||"Crop Image"})}),(0,t.jsx)("div",{className:"flex-1 bg-black w-full overflow-auto flex items-center justify-center p-4",children:"multi"===b?(0,t.jsx)(x,{ref:N,imageSrc:e,regions:j,onChange:D}):(0,t.jsx)(u,{crop:l,onChange:(e,t)=>d(t),onComplete:e=>c(e),className:"max-h-full",children:(0,t.jsx)("img",{ref:p,alt:"Crop me",src:e,onLoad:function(e){let{width:t,height:r}=e.currentTarget;d({unit:"%",x:0,y:0,width:100,height:100}),c({unit:"px",x:0,y:0,width:t,height:r})},style:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"}})})}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[s&&(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:w-80",children:["single","multi"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>v(e),className:`rounded px-3 py-1.5 text-sm font-medium transition-colors ${b===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:"single"===e?o.batchImport.singleMode:o.batchImport.multiMode},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===b?`${o.batchImport.hint} ${o.batchImport.regionCount.replace("{count}",String(j.length))}`:o.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===b&&j.length>0&&(0,t.jsx)(m.f,{variant:"ghost",onClick:()=>D([]),children:o.batchImport.clear}),(0,t.jsx)(m.f,{variant:"outline",onClick:a,children:o.common.cancel||"Cancel"}),"multi"===b?(0,t.jsx)(m.f,{onClick:M,disabled:0===j.length,children:o.batchImport.start.replace("{count}",String(j.length))}):(0,t.jsx)(m.f,{onClick:E,children:o.common.confirm||"Confirm"})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),r=e.i(271645);let i=(0,e.i(475254).f)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);var a=e.i(286536),n=e.i(511445),s=e.i(624687),o=e.i(111110),l=e.i(975157);e.s(["f",0,function({value:e,onChange:d,className:h,...c}){let{t:u}=(0,o.b)(),[m,g]=(0,r.useState)("source"),p=(0,r.useId)(),f=[{mode:"source",label:u.markdownEditor.source,icon:i},{mode:"preview",label:u.markdownEditor.preview,icon:a.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:f.map(({mode:e,label:r,icon:i})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,l.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(i,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(s.f,{value:e,onChange:e=>d(e.target.value),className:h,...c}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(n.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),r=e.i(271645),i=e.i(967489),a=e.i(810980),n=e.i(41931),s=e.i(201276),o=e.i(111110);e.s(["f",0,function({value:e,onChange:l,className:d}){let[h,c]=(0,r.useState)([]),{t:u}=(0,o.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await n.f.get("/api/notebooks");c(e)}catch(e){s.f.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(i.d,{value:e,onValueChange:l,children:[(0,t.jsx)(i.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(i.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(i.r,{children:0===h.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):h.map(e=>(0,t.jsx)(i.T,{value:e.id,children:e.name},e.id))})]})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),i=e.i(37727),a=e.i(487486),n=e.i(793479),s=e.i(41931),o=e.i(201276);e.s(["f",0,function({value:e=[],onChange:l,placeholder:d="Enter tags...",className:h="",enterHint:c,subject:u,gradeStage:m}){let[g,p]=(0,r.useState)(""),[f,w]=(0,r.useState)([]),[x,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(0),C=(0,r.useRef)(null),k=(0,r.useRef)(null),j=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});u&&r.append("subject",u),m&&r.append("stage",m);let i=((await s.f.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(i.slice(0,20)),y(i.length>0),v(0)}catch(e){o.f.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,r.useEffect)(()=>{g.trim()&&j(g)},[g,j]);let D=t=>{t.trim()&&!e.includes(t.trim())&&(l([...e,t.trim()]),p(""),w([]),y(!1),v(0))},N=t=>{l(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||C.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${h}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>N(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(i.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&f[b]?D(f[b]):g.trim()&&D(g)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),v(0)):"Backspace"===t.key&&!g&&e.length>0&&N(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===b?"bg-accent":""}`,onClick:()=>D(e),onMouseEnter:()=>v(r),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:c?`${c} "${g}"`:`Press Enter to create "${g}"`})]})}])},28928,e=>{var t=e.i(201276);async function r(e,i=1,a=1920,n=.8){return new Promise((r,s)=>{let o=new FileReader;o.onload=o=>{let l=new Image;l.onload=()=>{let o=document.createElement("canvas"),d=o.getContext("2d");if(!d)return void s(Error("无法获取 Canvas 上下文"));let h=l.width,c=l.height;h>a&&(c=c*a/h,h=a),o.width=h,o.height=c,d.drawImage(l,0,0,h,c);let u=n,m=o.toDataURL("image/jpeg",u),g=3*m.length/4/1024/1024;for(;g>i&&u>.1;){u-=.1;let e=3*(m=o.toDataURL("image/jpeg",u)).length/4/1024/1024;if(t.f.info("[ImageCompress]","Compression step",{quality:Number(u.toFixed(1)),sizeMB:Number(e.toFixed(2))},{sendToBackend:!1}),e<=i)break}t.f.info("[ImageCompress]","Compression finished",{originalMB:Number((e.size/1024/1024).toFixed(2)),compressedMB:Number((3*m.length/4/1024/1024).toFixed(2))}),r(m)},l.onerror=()=>s(Error("图片加载失败")),l.src=o.target?.result},o.onerror=()=>s(Error("文件读取失败")),o.readAsDataURL(e)})}async function i(e){let i=e.size/1024/1024;return(t.f.info("[ImageCompress]","File size checked",{sizeMB:Number(i.toFixed(2))},{sendToBackend:!1}),i>1)?(t.f.info("[ImageCompress]","File exceeds threshold, compressing",void 0,{sendToBackend:!1}),await r(e,1)):(t.f.info("[ImageCompress]","File size OK, no compression needed",void 0,{sendToBackend:!1}),new Promise((t,r)=>{let i=new FileReader;i.onload=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)}))}e.s(["f",0,i])},952122,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])},943710,e=>{e.s(["f",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<1||e>5?null:e<=3?"a":"b"}])}])})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63804,e=>{let t=(0,e.i(475254).f)("list-checks",[["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"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]);e.s(["f",0,t],63804)},620278,e=>{let t=(0,e.i(475254).f)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);e.s(["f",0,t],620278)},952683,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(618566),i=e.i(968553),n=e.i(674558),l=e.i(283086),r=e.i(747819),o=e.i(178119),d=e.i(515288),c=e.i(519455),m=e.i(624687),u=e.i(110204),h=e.i(356909),x=e.i(531278),p=e.i(286536),g=e.i(185873),g=g,f=e.i(367240),j=e.i(111110),v=e.i(511445),y=e.i(574041),b=e.i(438465),w=e.i(967489),k=e.i(952122),N=e.i(294114);function S({onSubmit:e,defaultNotebookId:a,defaultNotebookName:i,isSaving:l}){let{t:r}=(0,j.b)(),[o,C]=(0,s.useState)(null),[A,T]=(0,s.useState)(""),[P,E]=(0,s.useState)(""),[I,H]=(0,s.useState)(""),[z,q]=(0,s.useState)(""),[B,M]=(0,s.useState)(""),[D,F]=(0,s.useState)("unknown"),[K,U]=(0,s.useState)([]),[$,L]=(0,s.useState)(a||""),[O,R]=(0,s.useState)(""),[W,_]=(0,s.useState)("a"),Q=async()=>{if(A.trim()){if(!$)return void N.c.warning(r.editor.messages?.selectNotebook||"Please select a notebook");await e({questionText:A.trim(),answerText:P.trim(),analysis:I.trim(),wrongAnswerText:z.trim(),mistakeAnalysis:B.trim(),mistakeStatus:D,knowledgePoints:K,subjectId:$,gradeSemester:O||void 0,paperLevel:W})}},V=e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),A.trim()&&$&&!l&&Q())},G=[{key:"question",label:r.editor?.question||"Question Text",value:A,setter:T,placeholder:r.directEntry.questionPlaceholder,minHeight:"min-h-[180px]",required:!0},{key:"answer",label:r.editor?.answer||"Answer",value:P,setter:E,placeholder:r.directEntry.answerPlaceholder,minHeight:"min-h-[120px]"},{key:"analysis",label:r.editor?.analysis||"Analysis / Explanation",value:I,setter:H,placeholder:r.directEntry.analysisPlaceholder,minHeight:"min-h-[150px]"},{key:"wrongAnswer",label:r.editor?.wrongAnswerText||"Wrong Answer / Work",value:z,setter:q,placeholder:r.directEntry.wrongAnswerPlaceholder,minHeight:"min-h-[100px]"},{key:"mistakeAnalysis",label:r.editor?.mistakeAnalysis||"Mistake Cause Analysis",value:B,setter:M,placeholder:r.directEntry.mistakeAnalysisPlaceholder,minHeight:"min-h-[100px]"}];return(0,t.jsx)(d.N,{className:"rounded-2xl",children:(0,t.jsxs)(d.O,{className:"p-6 space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:r.directEntry.title})]}),(0,t.jsxs)(c.f,{variant:"ghost",size:"sm",onClick:()=>{T(""),E(""),H(""),q(""),M(""),F("unknown"),U([]),R(""),_("a")},disabled:l,className:"text-muted-foreground hover:text-destructive",children:[(0,t.jsx)(f.f,{className:"h-4 w-4 mr-1"}),r.directEntry.reset]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(u.f,{children:[r.editor?.selectNotebook||"Select Notebook"," *"]}),(0,t.jsx)(b.f,{value:$,onChange:L})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:r.editor?.gradeSemester||"Grade/Semester"}),(0,t.jsx)("input",{type:"text",value:O,onChange:e=>R(e.target.value),placeholder:r.directEntry.gradeSemesterPlaceholder,className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:r.editor?.paperLevel||"Paper Level"}),(0,t.jsxs)(w.d,{value:W,onValueChange:_,children:[(0,t.jsx)(w.P,{children:(0,t.jsx)(w.U,{})}),(0,t.jsxs)(w.r,{children:[(0,t.jsx)(w.T,{value:"a",children:r.editor?.paperLevels?.a||"Paper A"}),(0,t.jsx)(w.T,{value:"b",children:r.editor?.paperLevels?.b||"Paper B"}),(0,t.jsx)(w.T,{value:"other",children:r.editor?.paperLevels?.other||"Other"})]})]})]})]}),G.map(e=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(u.f,{className:e.required?"text-primary font-semibold":"",children:[e.label," ",e.required&&"*"]}),(0,t.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>C(o===e.key?null:e.key),disabled:!e.value,children:o===e.key?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.f,{className:"h-3 w-3 mr-1"}),r.directEntry.edit]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.f,{className:"h-3 w-3 mr-1"}),r.directEntry.preview]})})]}),o===e.key?(0,t.jsx)("div",{className:`rounded-md border bg-muted/30 p-4 ${e.minHeight} overflow-auto cursor-pointer`,onClick:()=>C(null),children:(0,t.jsx)(v.f,{content:e.value})}):(0,t.jsx)(m.f,{value:e.value,onChange:t=>e.setter(t.target.value),onKeyDown:V,placeholder:e.placeholder,className:`${e.minHeight} font-mono text-sm resize-y`,disabled:l})]},e.key)),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:r.editor?.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(w.d,{value:D,onValueChange:e=>F(e),children:[(0,t.jsx)(w.P,{className:"w-[200px]",children:(0,t.jsx)(w.U,{})}),(0,t.jsxs)(w.r,{children:[(0,t.jsx)(w.T,{value:"not_attempted",children:r.editor?.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(w.T,{value:"wrong_attempt",children:r.editor?.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(w.T,{value:"unknown",children:r.editor?.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(u.f,{children:r.editor?.tags||"Knowledge Points (Press Enter to add)"}),(0,t.jsx)(y.f,{value:K,onChange:U,placeholder:r.editor?.tagsPlaceholder||"Enter knowledge tags, select from suggestions...",enterHint:r.editor?.createTagHint,subject:(0,k.f)(i||null)||void 0}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r.editor?.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 pt-2",children:[(0,t.jsx)(c.f,{onClick:Q,disabled:!A.trim()||!$||l,className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",size:"lg",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.f,{className:"mr-2 h-4 w-4 animate-spin"}),r.directEntry.saving]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.f,{className:"mr-2 h-4 w-4"}),r.directEntry.save]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:r.directEntry.hint})]})]})})}var C=e.i(522016),A=e.i(217255),T=e.i(810980),P=e.i(551804),E=e.i(63804),I=e.i(620278);let H=()=>()=>{};function z({href:e,icon:s,label:a,value:i}){return(0,t.jsxs)(C.default,{href:e,className:"rounded-xl bg-white/15 px-4 py-3 backdrop-blur-sm transition-colors hover:bg-white/20",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-white/75",children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:a})]}),(0,t.jsx)("div",{className:"mt-1 text-2xl font-bold tabular-nums",children:i??"–"})]})}function q({notebookCount:e,itemCount:a,dueCount:i,targetNotebook:n}){let{t:l,language:r}=(0,j.b)(),{data:o}=(0,A.useSession)(),d=(0,s.useSyncExternalStore)(H,()=>new Date().getHours(),()=>null),c=null===d?l.common.welcome.replace(/[,,\s]+$/,""):d<12?l.home.greetingMorning:d<18?l.home.greetingAfternoon:l.home.greetingEvening,m=o?.user?.name||o?.user?.email||"";return(0,t.jsxs)("section",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-indigo-600 via-indigo-500 to-violet-500 p-5 text-white shadow-lg shadow-indigo-500/20 md:p-7",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -right-10 -top-12 h-44 w-44 rounded-full bg-white/10 blur-2xl"}),(0,t.jsx)("div",{className:"pointer-events-none absolute -bottom-16 right-24 h-40 w-40 rounded-full bg-fuchsia-300/20 blur-2xl"}),(0,t.jsxs)("div",{className:"relative flex flex-col gap-5 md:flex-row md:items-end md:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("h1",{className:"text-xl font-bold tracking-tight md:text-2xl",children:[c,m&&`${"zh"===r?",":", "}${m}`]}),(0,t.jsx)("p",{className:"max-w-md text-sm text-white/80",children:l.home.heroSubtitle}),n&&(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/15 px-3 py-1 text-xs font-medium",children:[(0,t.jsx)(I.f,{className:"h-3.5 w-3.5"}),l.home.targetNotebook.replace("{name}",n)]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 md:w-96",children:[(0,t.jsx)(z,{href:"/notebooks",icon:T.f,label:l.home.notebookCount,value:e}),(0,t.jsx)(z,{href:"/notebooks",icon:E.f,label:l.home.itemCount,value:a}),(0,t.jsx)(z,{href:"/review",icon:P.f,label:l.home.dueCount,value:i})]})]})]})}var B=e.i(12130),M=e.i(430634),D=e.i(717448),F=e.i(798469),K=e.i(86963),U=e.i(956738),$=e.i(185592),L=e.i(41931),O=e.i(201276),R=e.i(35209),W=e.i(267275);function _(){let{t:e}=(0,j.b)();(0,R.f)(e.pageTitle.home);let d=(0,a.useSearchParams)().get("notebook"),[c,m]=(0,s.useState)([]),[u,h]=(0,s.useState)(null),[x,p]=(0,s.useState)(null),[g,f]=(0,s.useState)("image"),v=d||u,y=v?c.find(e=>e.id===v):void 0,b=(0,W.f)({logPrefix:"[Home]",analyzeSubjectId:v,importSubjectId:d,textNotebook:y&&{id:y.id,name:y.name},onParsed:e=>{let t=e.subject&&c.find(t=>t.name.includes(e.subject)||e.subject.includes(t.name));t&&h(t.id)}});(0,s.useEffect)(()=>{L.f.get("/api/notebooks").then(e=>m(e)).catch(e=>O.f.error("[Home]","Failed to fetch notebooks",{error:e})),L.f.get("/api/review/due?pageSize=1").then(e=>p(e.total)).catch(e=>O.f.error("[Home]","Failed to fetch due reviews",{error:e}))},[]);let w=async e=>{b.setAnalysisStep("saving"),await b.saveQuestion({...e,wrongAnswerText:e.wrongAnswerText||null,mistakeAnalysis:e.mistakeAnalysis||null,mistakeStatus:e.mistakeStatus||"unknown",originalImageUrl:""}),b.setAnalysisStep("idle")},k=c.reduce((e,t)=>e+(t._count?.errorItems||0),0),N=[{value:"image",icon:i.f,label:e.app?.uploadImage||"Take Photo"},{value:"text",icon:l.f,label:e.app?.manualInput||"Manual Input"},{value:"direct",icon:n.f,label:e.app?.directInput||"Manual Entry"}];return(0,t.jsxs)("main",{className:"min-h-screen",children:[(0,t.jsx)(U.f,{status:b.analysisStep}),(0,t.jsxs)("div",{className:`mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8 ${"review"===b.step?"max-w-6xl":"max-w-4xl"}`,children:["upload"===b.step&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(q,{notebookCount:c.length,itemCount:k,dueCount:x,targetNotebook:d?y?.name:void 0}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)($.f,{options:N,value:g,onChange:f}),b.lastImported&&(0,t.jsx)(M.f,{imported:b.lastImported,onDismiss:b.dismissImported}),b.batchBlobs?(0,t.jsx)(r.f,{blobs:b.batchBlobs,subjectId:d,timeout:b.aiTimeout,onClose:b.closeBatch}):"image"===g?(0,t.jsx)(F.f,{onImageSelect:b.selectImage,isAnalyzing:b.isBusy}):"text"===g?(0,t.jsx)(D.f,{onSubmit:b.submitText,isAnalyzing:b.isBusy,defaultNotebookName:y?.name}):(0,t.jsx)(S,{onSubmit:w,defaultNotebookId:v||void 0,defaultNotebookName:y?.name,isSaving:"saving"===b.analysisStep})]})]}),b.croppingImage&&(0,t.jsx)(B.f,{imageSrc:b.croppingImage,open:b.isCropperOpen,onClose:b.closeCropper,onCropComplete:b.cropComplete,onMultiCropComplete:b.startBatch}),"review"===b.step&&b.parsedData&&(0,t.jsx)(o.f,{initialData:b.parsedData,onSave:b.saveReviewed,onCancel:b.cancelReview,imagePreview:b.currentImage,initialSubjectId:v||void 0,aiTimeout:b.aiTimeout})]})]})}e.s(["default",0,function(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)(K.f,{}),children:(0,t.jsx)(_,{})})}],952683)},86963,e=>{var t=e.i(843476),s=e.i(531278);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])}])})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,871689,e=>{let t=(0,e.i(475254).f)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,t],871689)},463059,e=>{let t=(0,e.i(475254).f)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["f",0,t],463059)},503116,e=>{let t=(0,e.i(475254).f)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["f",0,t],503116)},63804,e=>{let t=(0,e.i(475254).f)("list-checks",[["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"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]);e.s(["f",0,t],63804)},788699,e=>{let t=(0,e.i(475254).f)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["f",0,t],788699)},303281,e=>{let t=(0,e.i(475254).f)("printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);e.s(["f",0,t],303281)},283086,e=>{let t=(0,e.i(475254).f)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["f",0,t],283086)},469937,62825,e=>{var t=e.i(843476);let n=(0,e.i(475254).f)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var r=e.i(111110),i=e.i(975157);let a=[1,2,3,4,5];function s(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["f",0,function({value:e,onChange:s,disabled:l,size:c="sm",showUnrated:o=!0,className:d}){let{t:u}=(0,r.b)(),f=e??0,m="sm"===c?"h-3.5 w-3.5":"h-5 w-5",h=f?u.difficulty.starsLabel.replace("{n}",String(f)):u.difficulty.unrated;return s?(0,t.jsxs)("span",{className:(0,i.f)("inline-flex items-center gap-0.5",d),role:"group","aria-label":`${u.difficulty.label}:${h}`,title:u.difficulty.clearHint,children:[a.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>s(e===f?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=f,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(n,{className:(0,i.f)(m,e<=f?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!f&&o&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):f?(0,t.jsx)("span",{className:(0,i.f)("inline-flex items-center",d),role:"img","aria-label":`${u.difficulty.label}:${h}`,title:h,children:a.map(e=>(0,t.jsx)(n,{className:(0,i.f)(m,e<=f?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):o?(0,t.jsx)("span",{className:(0,i.f)("text-xs text-muted-foreground",d),children:u.difficulty.unrated}):null}],469937),e.s(["i",0,function(e,t="zh"){return("en"===t?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[s(e)]},"h",0,s,"x",0,function(e,t){return(t||"").trim()?"wrong_attempt":s(e)}],62825)},846968,e=>{var t=e.i(843476),n=e.i(269638),r=e.i(503116),i=e.i(16715),a=e.i(487486),s=e.i(111110);let l={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:r.f},reviewing:{className:"bg-primary/10 text-primary",icon:i.f},mastered:{className:"bg-success/15 text-success",icon:n.f}};e.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:e,className:n=""}){let{t:r}=(0,s.b)(),{className:i,icon:c}=l[e],o="mastered"===e?r.notebook.mastered:"reviewing"===e?r.notebook.reviewing:r.notebook.review;return(0,t.jsx)(a.f,{variant:"secondary",className:`${i} ${n}`,children:(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(c,{className:"h-3 w-3"})," ",o]})})}])},709830,76824,e=>{var t=e.i(843476),n=e.i(111110),r=e.i(952122);let i=["primary","junior_high","senior_high"],a="primary",s=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function l(e){return"string"==typeof e&&s.includes(e)}function c(e){var t;let n=l(e.subjectKey)?e.subjectKey:(0,r.f)(e.name);return{stage:"string"==typeof(t=e.stage)&&i.includes(t)?e.stage:a,subject:n&&l(n)?n:null}}function o(){let{t:e}=(0,n.b)();return{stageLabel:t=>({primary:e.auth.primary,junior_high:e.auth.juniorHigh,senior_high:e.auth.seniorHigh})[t],subjectLabel:t=>e.tags.subjects[t]}}e.s(["j",0,a,"c",0,i,"W",0,{primary:["math","english"],junior_high:s,senior_high:s},"v",0,c],76824),e.s(["E",0,function({notebook:e,className:n}){let{stageLabel:r,subjectLabel:i}=o(),a=c(e);return(0,t.jsxs)("span",{className:n,children:[r(a.stage),a.subject?` \xb7 ${i(a.subject)}`:""]})},"O",0,o],709830)},67153,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(776639),i=e.i(519455),a=e.i(793479),s=e.i(110204),l=e.i(111110),c=e.i(294114),o=e.i(201276);e.s(["f",0,function({open:e,onOpenChange:d,currentName:u,onRename:f}){let[m,h]=(0,n.useState)(u),[p,g]=(0,n.useState)(!1),{t:x}=(0,l.b)(),[b,y]=(0,n.useState)(u);u!==b&&(y(u),h(u));let k=async()=>{if(!m.trim())return void c.c.warning(x.notebooks?.renameDialog?.enterName||"Please enter notebook name");g(!0);try{await f(m.trim()),d(!1)}catch(e){o.f.error("[RenameNotebook]","Failed to rename notebook",{error:e})}finally{g(!1)}};return(0,t.jsx)(r.N,{open:e,onOpenChange:d,children:(0,t.jsxs)(r.d,{children:[(0,t.jsx)(r.s,{children:(0,t.jsx)(r.F,{children:x.notebooks?.renameDialog?.title||"Rename Notebook"})}),(0,t.jsx)("div",{className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(s.f,{htmlFor:"rename-name",children:x.notebooks?.renameDialog?.nameLabel||"New Name"}),(0,t.jsx)(a.f,{id:"rename-name",placeholder:x.notebooks?.renameDialog?.placeholder||"Enter new notebook name",value:m,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&k()})]})}),(0,t.jsxs)(r.c,{children:[(0,t.jsx)(i.f,{variant:"outline",onClick:()=>d(!1),children:x.common.cancel}),(0,t.jsx)(i.f,{onClick:k,disabled:p||!m.trim(),children:p?x.notebooks?.renameDialog?.renaming||"Renaming...":x.notebooks?.renameDialog?.rename||"Rename"})]})]})})}])},590546,e=>{var t=e.i(843476),n=e.i(618566),r=e.i(519455),i=e.i(871689);e.s(["f",0,function({fallbackUrl:e,className:a}){let s=(0,n.useRouter)();return(0,t.jsx)(r.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(e)},className:a,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},515288,e=>{var t=e.i(843476),n=e.i(975157);e.s(["N",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,n.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})},"O",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,n.f)("px-6",e),...r})},"u",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,n.f)("text-muted-foreground text-sm",e),...r})},"Y",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,n.f)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})},"v",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,n.f)("leading-none font-semibold",e),...r})}])},257428,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(820783),i=e.i(30030),a=e.i(981140),s=e.i(369340),l=e.i(635804),c=e.i(296626),o=e.i(248425),d=Object.defineProperty,u=(e,t)=>d(e,"name",{value:t,configurable:!0}),f="Checkbox",[m,h]=(0,i.f)(f),[p,g]=m(f);function x(e){let{__scopeCheckbox:r,checked:i,children:a,defaultChecked:l,disabled:c,form:o,name:d,onCheckedChange:u,required:m,value:h="on",internal_do_not_use_render:g}=e,[x,b]=(0,s.f)({prop:i,defaultProp:l??!1,onChange:u,caller:f}),[y,k]=n.useState(null),[j,N]=n.useState(null),[C,R]=n.useState(null),_=!y||!!o||!!y.closest("form"),E={checked:x,disabled:c,setChecked:b,control:y,setControl:k,name:d,form:o,value:h,userClick:C,onUserClick:R,required:m,defaultChecked:!w(l)&&l,isFormControl:_,bubbleInput:j,setBubbleInput:N};return(0,t.jsx)(p,{scope:r,...E,children:v(g)?g(E):a})}u(x,"CheckboxProvider");var b=n.forwardRef(u(function({__scopeCheckbox:e,onKeyDown:i,onClick:s,...l},c){let{control:d,value:f,disabled:m,checked:h,required:p,setControl:x,setChecked:b,onUserClick:y,isFormControl:k,bubbleInput:j}=g("CheckboxTrigger",e),v=(0,r.f)(c,x),C=n.useRef(h);return n.useEffect(()=>{let e=d?.form;if(e){let t=u(()=>b(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,b]),(0,t.jsx)(o.V.button,{type:"button",role:"checkbox","aria-checked":w(h)?"mixed":h,"aria-required":p,"data-state":N(h),"data-disabled":m?"":void 0,disabled:m,value:f,...l,ref:v,onKeyDown:(0,a.f)(i,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,a.f)(s,e=>{let t=e.isPropagationStopped();y({requestedChecked:!!w(h)||!h,hasConsumerStoppedPropagation:t}),b(e=>!!w(e)||!e),j&&k&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),y=n.forwardRef(u(function(e,n){let{__scopeCheckbox:r,name:i,checked:a,defaultChecked:s,required:l,disabled:c,value:o,onCheckedChange:d,form:u,...f}=e;return(0,t.jsx)(x,{__scopeCheckbox:r,checked:a,defaultChecked:s,disabled:c,required:l,onCheckedChange:d,name:i,form:u,value:o,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...f,ref:n,__scopeCheckbox:r}),e&&(0,t.jsx)(j,{__scopeCheckbox:r})]})})},"Checkbox")),k=n.forwardRef(u(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,s=g("CheckboxIndicator",r);return(0,t.jsx)(c.f,{present:i||w(s.checked)||!0===s.checked,children:(0,t.jsx)(o.V.span,{"data-state":N(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),j=n.forwardRef(u(function({__scopeCheckbox:e,onClick:i,...s},c){let{control:d,userClick:u,checked:f,defaultChecked:m,required:h,disabled:p,name:x,value:b,form:y,bubbleInput:k,setBubbleInput:j}=g("CheckboxBubbleInput",e),v=(0,r.f)(c,j),N=(0,l.f)(d),C=n.useRef(!1),R=n.useRef(f),_=n.useRef(u),E=n.useRef(null);n.useEffect(()=>{if(!k)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=R.current!==f;R.current=f;let n=null!==u&&u!==_.current;if(_.current=u,n)E.current=t?null:u,t&&(k.indeterminate=w(f),e.call(k,!w(f)&&f)),k.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(t){let t=E.current;E.current=null;let n=t?.requestedChecked===f;C.current=!0,k.indeterminate=w(f),e.call(k,!w(f)&&f),k.dispatchEvent(new Event("click",{bubbles:!(n&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[k,f,u]);let S=n.useRef(!w(f)&&f);return(0,t.jsx)(o.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??S.current,required:h,disabled:p,name:x,value:b,form:y,...s,tabIndex:-1,ref:v,onClick:(0,a.f)(i,e=>{C.current&&e.stopPropagation()}),style:{...s.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function v(e){return"function"==typeof e}function w(e){return"indeterminate"===e}function N(e){return w(e)?"indeterminate":e?"checked":"unchecked"}u(v,"isFunction"),u(w,"isIndeterminate"),u(N,"getState");var C=e.i(643531),R=e.i(975157);let _=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(y,{ref:r,className:(0,R.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...n,children:(0,t.jsx)(k,{className:(0,R.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));_.displayName=y.displayName,e.s(["f",0,_],257428)},912505,e=>{var t=e.i(843476),n=e.i(975157);e.s(["f",0,function({icon:e,title:r,description:i,action:a,className:s}){return(0,t.jsxs)("div",{className:(0,n.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",s),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:r}),i&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:i}),a&&(0,t.jsx)("div",{className:"mt-5",children:a})]})}])},393842,e=>{var t=e.i(843476),n=e.i(590546),r=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:a,actions:s,titleAddon:l,className:c}){return(0,t.jsxs)("div",{className:(0,r.f)("flex items-start gap-3",c),children:[a&&(0,t.jsx)(n.f,{fallbackUrl:a,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),i&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),s&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s})]})}])},86963,e=>{var t=e.i(843476),n=e.i(531278);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},469817,e=>{e.s(["$",0,18,"u",0,5,"A",0,200])},990745,e=>{e.s(["f",0,function(e){if(e.tags&&e.tags.length>0)return e.tags.map(e=>e.name);if(!e.knowledgePoints)return[];try{let t=JSON.parse(e.knowledgePoints);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}])},952122,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])},35209,e=>{var t=e.i(271645),n=e.i(111110);e.s(["f",0,function(...e){let{t:r}=(0,n.b)(),i=[r.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])},833547,747279,e=>{var t=e.i(41931);async function n(e){try{return(await t.f.get(`/api/error-items/short/${encodeURIComponent(e)}`)).id}catch{return null}}e.s(["f",0,n],833547);let r=RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{6}$");e.s(["f",0,function(e){return"string"==typeof e&&r.test(e)}],747279)}])})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,871689,e=>{let t=(0,e.i(475254).f)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,t],871689)},813572,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(618566),i=e.i(968553),o=e.i(283086),r=e.i(747819),n=e.i(178119),l=e.i(12130),c=e.i(430634),d=e.i(717448),m=e.i(798469),u=e.i(393842),f=e.i(956738),p=e.i(185592),x=e.i(111110),h=e.i(41931),g=e.i(201276),b=e.i(35209),j=e.i(267275);e.s(["default",0,function(){let e=(0,s.useParams)(),v=(0,s.useRouter)(),N=e.id,{t:y}=(0,x.b)(),[I,k]=(0,a.useState)(null);(0,b.f)(y.notebooks.title,I?.name,y.pageTitle.addError);let[C,w]=(0,a.useState)("image"),S=(0,j.f)({logPrefix:"[AddErrorItem]",analyzeSubjectId:N,importSubjectId:N,textNotebook:{id:N,name:I?.name||""},fixedSubjectId:N});return((0,a.useEffect)(()=>{h.f.get(`/api/notebooks/${N}`).then(e=>k(e)).catch(e=>{g.f.error("[AddErrorItem]","Failed to fetch notebook",{error:e}),v.push("/notebooks")})},[N,v]),I)?(0,t.jsxs)("main",{className:"min-h-screen",children:[(0,t.jsx)(f.f,{status:S.analysisStep}),(0,t.jsxs)("div",{className:`mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8 ${"review"===S.step?"max-w-6xl":"max-w-4xl"}`,children:[(0,t.jsx)(u.f,{backHref:`/notebooks/${N}`,title:y.app.addError,description:I.name}),"upload"===S.step&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(p.f,{options:[{value:"image",icon:i.f,label:y.app?.uploadImage||"Take Photo"},{value:"text",icon:o.f,label:y.app?.manualInput||"Manual Input"}],value:C,onChange:w}),S.lastImported&&(0,t.jsx)(c.f,{imported:S.lastImported,onDismiss:S.dismissImported}),S.batchBlobs?(0,t.jsx)(r.f,{blobs:S.batchBlobs,subjectId:N,timeout:S.aiTimeout,onClose:S.closeBatch}):"image"===C?(0,t.jsx)(m.f,{onImageSelect:S.selectImage,isAnalyzing:S.isBusy}):(0,t.jsx)(d.f,{onSubmit:S.submitText,isAnalyzing:S.isBusy,defaultNotebookName:I.name})]}),"review"===S.step&&S.parsedData&&(0,t.jsx)(n.f,{initialData:S.parsedData,imagePreview:S.currentImage,onSave:S.saveReviewed,onCancel:S.cancelReview,initialSubjectId:N,aiTimeout:S.aiTimeout})]}),(0,t.jsx)(l.f,{imageSrc:S.croppingImage||"",open:S.isCropperOpen,onClose:S.closeCropper,onCropComplete:S.cropComplete,onMultiCropComplete:S.startBatch})]}):(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,t.jsx)("p",{className:"text-muted-foreground",children:y.common.loading})})}])},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),i=e.i(871689);e.s(["f",0,function({fallbackUrl:e,className:o}){let r=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{r.push(e)},className:o,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},515288,e=>{var t=e.i(843476),a=e.i(975157);e.s(["N",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,a.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...s})},"O",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.f)("px-6",e),...s})},"u",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,a.f)("text-muted-foreground text-sm",e),...s})},"Y",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.f)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...s})},"v",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,a.f)("leading-none font-semibold",e),...s})}])},393842,e=>{var t=e.i(843476),a=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:o,actions:r,titleAddon:n,className:l}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",l),children:[o&&(0,t.jsx)(a.f,{fallbackUrl:o,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),n]}),i&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),r&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:r})]})}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),i=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])}])})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,198591,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(618566),a=e.i(519455),o=e.i(393842),l=e.i(86963),i=e.i(107233),s=e.i(788699),d=e.i(522016),c=e.i(475254);let u=(0,c.f)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),f=(0,c.f)("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);var m=e.i(63804),p=e.i(303281);let h=(0,c.f)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var g=e.i(666696),x=e.i(664659);let v=(0,c.f)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);var j=e.i(981140),w=e.i(820783),b=e.i(30030),y=e.i(369340),S=e.i(248425),k=e.i(75830),C=e.i(586318),N=e.i(726330),M=e.i(303536),R=e.i(765491),D=e.i(610772),T=e.i(853660),P=e.i(774606),I=e.i(296626),E=e.i(842727),_=e.i(991918),F=e.i(30207),L=e.i(186312),O=e.i(985369),A=Object.defineProperty,K=(e,t)=>A(e,"name",{value:t,configurable:!0}),q=["Enter"," "],z=["ArrowUp","PageDown","End"],B=["ArrowDown","PageUp","Home",...z],V={ltr:[...q,"ArrowRight"],rtl:[...q,"ArrowLeft"]},$={ltr:["ArrowLeft"],rtl:["ArrowRight"]},U="Menu",[G,H,X]=(0,k.f)(U),[Y,W]=(0,b.f)(U,[X,T.y,E.B]),Q=(0,T.y)(),Z=(0,E.B)(),[J,ee]=Y(U),[et,en]=Y(U),er=K(e=>{let{__scopeMenu:r,open:a=!1,children:o,dir:l,onOpenChange:i,modal:s=!0}=e,d=Q(r),[c,u]=n.useState(null),f=n.useRef(!1),m=(0,F.f)(i),p=(0,C.f)(l);return n.useEffect(()=>{let e=K(()=>{f.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},"handleKeyDown"),t=K(()=>f.current=!1,"handlePointer");return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),n.useEffect(()=>{if(!a)return;let e=K(()=>m(!1),"handleBlur");return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[a,m]),(0,t.jsx)(T.F,{...d,children:(0,t.jsx)(J,{scope:r,open:a,onOpenChange:m,content:c,onContentChange:u,children:(0,t.jsx)(et,{scope:r,onClose:n.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:f,dir:p,modal:s,children:o})})})},"Menu"),ea=n.forwardRef(K(function(e,n){let{__scopeMenu:r,...a}=e,o=Q(r);return(0,t.jsx)(T.g,{...o,...a,ref:n})},"MenuAnchor")),eo="MenuPortal",[el,ei]=Y(eo,{forceMount:void 0}),es=K(e=>{let{__scopeMenu:n,forceMount:r,children:a,container:o}=e,l=ee(eo,n);return(0,t.jsx)(el,{scope:n,forceMount:r,children:(0,t.jsx)(I.f,{present:r||l.open,children:(0,t.jsx)(P.f,{asChild:!0,container:o,children:a})})})},"MenuPortal"),ed="MenuContent",[ec,eu]=Y(ed),ef=n.forwardRef(K(function(e,n){let r=ei(ed,e.__scopeMenu),{forceMount:a=r.forceMount,...o}=e,l=ee(ed,e.__scopeMenu),i=en(ed,e.__scopeMenu);return(0,t.jsx)(G.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(I.f,{present:a||l.open,children:(0,t.jsx)(G.Slot,{scope:e.__scopeMenu,children:i.modal?(0,t.jsx)(em,{...o,ref:n}):(0,t.jsx)(ep,{...o,ref:n})})})})},"MenuContent")),em=n.forwardRef(K(function(e,r){let a=ee(ed,e.__scopeMenu),o=n.useRef(null),l=(0,w.f)(r,o);return n.useEffect(()=>{let e=o.current;if(e)return(0,L.f)(e)},[]),(0,t.jsx)(eg,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:(0,j.f)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})},"MenuRootContentModal")),ep=n.forwardRef(K(function(e,n){let r=ee(ed,e.__scopeMenu);return(0,t.jsx)(eg,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),eh=(0,_.B)("MenuContent.ScrollLock"),eg=n.forwardRef(K(function(e,r){let{__scopeMenu:a,loop:o=!1,trapFocus:l,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:d,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,disableOutsideScroll:g,...x}=e,v=ee(ed,a),b=en(ed,a),y=Q(a),S=Z(a),k=H(a),[C,D]=n.useState(null),P=n.useRef(null),[I,_]=n.useState(null);(0,R.i)(I);let{nodes:F,registry:L}=(0,R.D)(),A=!!(l||g),q=(0,w.f)(r,P,v.onContentChange,_),V=n.useRef(0),$=n.useRef(""),U=n.useRef(0),G=n.useRef(null),X=n.useRef("right"),Y=n.useRef(0),W=n.useMemo(()=>g?[P,...F.map(e=>({current:e}))]:[],[P,F,g]),J=g?O.f:n.Fragment,et=K(e=>{let t=$.current+e,n=k().filter(e=>!e.disabled),r=document.activeElement,a=n.find(e=>e.ref.current===r)?.textValue,o=eB(n.map(e=>e.textValue),t,a),l=n.find(e=>e.textValue===o)?.ref.current;function i(e){$.current=e,window.clearTimeout(V.current),""!==e&&(V.current=window.setTimeout(()=>i(""),1e3))}K(i,"updateSearch"),i(t),l&&setTimeout(()=>l.focus())},"handleTypeaheadSearch");n.useEffect(()=>()=>window.clearTimeout(V.current),[]),(0,M.f)();let er=n.useCallback(e=>X.current===G.current?.side&&e$(e,G.current?.area),[]);return(0,t.jsx)(ec,{scope:a,searchRef:$,onItemEnter:n.useCallback(e=>{er(e)&&e.preventDefault()},[er]),onItemLeave:n.useCallback(e=>{er(e)||(P.current?.focus(),D(null))},[er]),onTriggerLeave:n.useCallback(e=>{er(e)&&e.preventDefault()},[er]),pointerGraceTimerRef:U,onPointerGraceIntentChange:n.useCallback(e=>{G.current=e},[]),children:(0,t.jsx)(R.l,{registry:A?L:null,children:(0,t.jsx)(J,{...g?{as:eh,allowPinchZoom:!0,shards:W}:void 0,children:(0,t.jsx)(R.v,{asChild:!0,trapped:l,branches:F,onMountAutoFocus:(0,j.f)(i,e=>{e.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,t.jsx)(N.V,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,children:(0,t.jsx)(E.F,{asChild:!0,...S,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:D,onEntryFocus:(0,j.f)(c,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,t.jsx)(T.c,{role:"menu","aria-orientation":"vertical","data-state":eO(v.open),"data-radix-menu-content":"",dir:b.dir,...y,...x,ref:q,style:{outline:"none",...x.style},onKeyDown:(0,j.f)(x.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&et(e.key));let a=P.current;if(e.target!==a||!B.includes(e.key))return;e.preventDefault();let o=k().filter(e=>!e.disabled).map(e=>e.ref.current);z.includes(e.key)&&o.reverse(),eq(o)}),onBlur:(0,j.f)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(V.current),$.current="")}),onPointerMove:(0,j.f)(e.onPointerMove,eU(e=>{let t=e.target,n=Y.current!==e.clientX;e.currentTarget.contains(t)&&n&&(X.current=e.clientX>Y.current?"right":"left",Y.current=e.clientX)}))})})})})})})})},"MenuContentImpl")),ex=n.forwardRef(K(function(e,n){let{__scopeMenu:r,...a}=e;return(0,t.jsx)(S.V.div,{...a,ref:n})},"MenuLabel")),ev="MenuItem",ej="menu.itemSelect",ew=n.forwardRef(K(function(e,r){let{disabled:a=!1,onSelect:o,...l}=e,i=n.useRef(null),s=en(ev,e.__scopeMenu),d=eu(ev,e.__scopeMenu),c=(0,w.f)(r,i),u=n.useRef(!1),f=K(()=>{let e=i.current;if(!a&&e){let t=new CustomEvent(ej,{bubbles:!0,cancelable:!0});e.addEventListener(ej,e=>o?.(e),{once:!0}),(0,S.u)(e,t),t.defaultPrevented?u.current=!1:s.onClose()}},"handleSelect");return(0,t.jsx)(eb,{...l,ref:c,disabled:a,onClick:(0,j.f)(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:(0,j.f)(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:(0,j.f)(e.onKeyDown,e=>{a||e.target!==e.currentTarget||(""===d.searchRef.current||" "!==e.key)&&q.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},"MenuItem")),eb=n.forwardRef(K(function(e,r){let{__scopeMenu:a,disabled:o=!1,textValue:l,...i}=e,s=eu(ev,a),d=Z(a),c=n.useRef(null),u=(0,w.f)(r,c),[f,m]=n.useState(!1),[p,h]=n.useState("");return n.useEffect(()=>{let e=c.current;e&&h((e.textContent??"").trim())},[i.children]),(0,t.jsx)(G.ItemSlot,{scope:a,disabled:o,textValue:l??p,children:(0,t.jsx)(E.M,{asChild:!0,...d,focusable:!o,children:(0,t.jsx)(S.V.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:u,onPointerMove:(0,j.f)(e.onPointerMove,eU(e=>{o?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,j.f)(e.onPointerLeave,eU(e=>s.onItemLeave(e))),onFocus:(0,j.f)(e.onFocus,()=>m(!0)),onBlur:(0,j.f)(e.onBlur,()=>m(!1))})})})},"MenuItemImpl")),ey=n.forwardRef(K(function(e,n){let{checked:r=!1,onCheckedChange:a,...o}=e;return(0,t.jsx)(eM,{scope:e.__scopeMenu,checked:r,children:(0,t.jsx)(ew,{role:"menuitemcheckbox","aria-checked":eA(r)?"mixed":r,...o,ref:n,"data-state":eK(r),onSelect:(0,j.f)(o.onSelect,()=>a?.(!!eA(r)||!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),[eS,ek]=Y("MenuRadioGroup",{value:void 0,onValueChange:K(()=>{},"onValueChange")}),eC=n.forwardRef(K(function(e,n){let{value:r,...a}=e,o=ek("MenuRadioItem",e.__scopeMenu),l=r===o.value;return(0,t.jsx)(eM,{scope:e.__scopeMenu,checked:l,children:(0,t.jsx)(ew,{role:"menuitemradio","aria-checked":l,...a,ref:n,"data-state":eK(l),onSelect:(0,j.f)(a.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),eN="MenuItemIndicator",[eM,eR]=Y(eN,{checked:!1}),eD=n.forwardRef(K(function(e,n){let{__scopeMenu:r,forceMount:a,...o}=e,l=eR(eN,r);return(0,t.jsx)(I.f,{present:a||eA(l.checked)||!0===l.checked,children:(0,t.jsx)(S.V.span,{...o,ref:n,"data-state":eK(l.checked)})})},"MenuItemIndicator")),eT=n.forwardRef(K(function(e,n){let{__scopeMenu:r,...a}=e;return(0,t.jsx)(S.V.div,{role:"separator","aria-orientation":"horizontal",...a,ref:n})},"MenuSeparator")),eP="MenuSub",[eI,eE]=Y(eP),e_=(e=>{let{__scopeMenu:r,children:a,open:o=!1,onOpenChange:l}=e,i=ee(eP,r),s=Q(r),[d,c]=n.useState(null),[u,f]=n.useState(null),m=(0,F.f)(l);return n.useEffect(()=>(!1===i.open&&m(!1),()=>m(!1)),[i.open,m]),(0,t.jsx)(T.F,{...s,children:(0,t.jsx)(J,{scope:r,open:o,onOpenChange:m,content:u,onContentChange:f,children:(0,t.jsx)(eI,{scope:r,contentId:(0,D.f)(),triggerId:(0,D.f)(),trigger:d,onTriggerChange:c,children:a})})})},"MenuSubTrigger"),eF=n.forwardRef(K(function(e,r){let a=ee(e_,e.__scopeMenu),o=en(e_,e.__scopeMenu),l=eE(e_,e.__scopeMenu),i=eu(e_,e.__scopeMenu),s=n.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},f=n.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);n.useEffect(()=>f,[f]),n.useEffect(()=>{let e=d.current;return()=>{window.clearTimeout(e),c(null)}},[d,c]);let m=(0,w.f)(r,l.onTriggerChange);return(0,t.jsx)(ea,{asChild:!0,...u,children:(0,t.jsx)(eb,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?l.contentId:void 0,"data-state":eO(a.open),...e,ref:m,onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:(0,j.f)(e.onPointerMove,eU(t=>{i.onItemEnter(t),!t.defaultPrevented&&(e.disabled||a.open||s.current||(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{a.onOpenChange(!0),f()},100)))})),onPointerLeave:(0,j.f)(e.onPointerLeave,eU(e=>{f();let t=a.content?.getBoundingClientRect();if(t){let n=a.content?.dataset.side,r="right"===n,o=t[r?"left":"right"],l=t[r?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+(r?-5:5),y:e.clientY},{x:o,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:o,y:t.bottom}],side:n}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:(0,j.f)(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(""===i.searchRef.current||" "!==t.key)&&V[o.dir].includes(t.key)&&(a.onOpenChange(!0),a.content?.focus(),t.preventDefault())})})})},"MenuSubTrigger")),eL=n.forwardRef(K(function(e,r){let a=ei(ed,e.__scopeMenu),{forceMount:o=a.forceMount,align:l="start",...i}=e,s=ee(ed,e.__scopeMenu),d=en(ed,e.__scopeMenu),c=eE("MenuSubContent",e.__scopeMenu),u=n.useRef(null),f=(0,w.f)(r,u);return(0,t.jsx)(G.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(I.f,{present:o||s.open,children:(0,t.jsx)(G.Slot,{scope:e.__scopeMenu,children:(0,t.jsx)(eg,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:f,align:l,side:"rtl"===d.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{d.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,j.f)(e.onFocusOutside,e=>{e.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:(0,j.f)(e.onEscapeKeyDown,e=>{d.onClose(),e.preventDefault()}),onKeyDown:(0,j.f)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=$[d.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},"MenuSubContent"));function eO(e){return e?"open":"closed"}function eA(e){return"indeterminate"===e}function eK(e){return eA(e)?"indeterminate":e?"checked":"unchecked"}function eq(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ez(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function eB(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=n?e.indexOf(n):-1,o=ez(e,Math.max(a,0));1===r.length&&(o=o.filter(e=>e!==n));let l=o.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function eV(e,t){let{x:n,y:r}=e,a=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){let l=t[e],i=t[o],s=l.x,d=l.y,c=i.x,u=i.y;d>r!=u>r&&n<(c-s)*(r-d)/(u-d)+s&&(a=!a)}return a}function e$(e,t){return!!t&&eV({x:e.clientX,y:e.clientY},t)}function eU(e){return t=>"mouse"===t.pointerType?e(t):void 0}K(eO,"getOpenState"),K(eA,"isIndeterminate"),K(eK,"getCheckedState"),K(eq,"focusFirst"),K(ez,"wrapArray"),K(eB,"getNextMatch"),K(eV,"isPointInPolygon"),K(e$,"isPointerInGraceArea"),K(eU,"whenMouse");var eG=Object.defineProperty,eH=(e,t)=>eG(e,"name",{value:t,configurable:!0}),eX="DropdownMenu",[eY,eW]=(0,b.f)(eX,[W]),eQ=W(),[eZ,eJ]=eY(eX),e0=eH(e=>{let{__scopeDropdownMenu:r,children:a,dir:o,open:l,defaultOpen:i,onOpenChange:s,modal:d=!0}=e,c=eQ(r),u=n.useRef(null),[f,m]=(0,y.f)({prop:l,defaultProp:i??!1,onChange:s,caller:eX});return(0,t.jsx)(eZ,{scope:r,triggerId:(0,D.f)(),triggerRef:u,contentId:(0,D.f)(),open:f,onOpenChange:m,onOpenToggle:n.useCallback(()=>m(e=>!e),[m]),modal:d,children:(0,t.jsx)(er,{...c,open:f,onOpenChange:m,dir:o,modal:d,children:a})})},"DropdownMenu"),e1=n.forwardRef(eH(function(e,n){let{__scopeDropdownMenu:r,disabled:a=!1,...o}=e,l=eJ("DropdownMenuTrigger",r),i=eQ(r),s=(0,w.f)(n,l.triggerRef);return(0,t.jsx)(ea,{asChild:!0,...i,children:(0,t.jsx)(S.V.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...o,ref:s,onPointerDown:(0,j.f)(e.onPointerDown,e=>{!a&&0===e.button&&!1===e.ctrlKey&&(l.onOpenToggle(),l.open||e.preventDefault())}),onKeyDown:(0,j.f)(e.onKeyDown,e=>{!a&&(["Enter"," "].includes(e.key)&&l.onOpenToggle(),"ArrowDown"===e.key&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})},"DropdownMenuTrigger")),e2=eH(e=>{let{__scopeDropdownMenu:n,...r}=e,a=eQ(n);return(0,t.jsx)(es,{...a,...r})},"DropdownMenuPortal"),e4=n.forwardRef(eH(function(e,r){let{__scopeDropdownMenu:a,...o}=e,l=eJ("DropdownMenuContent",a),i=eQ(a),s=n.useRef(!1);return(0,t.jsx)(ef,{id:l.contentId,"aria-labelledby":l.triggerId,...i,...o,ref:r,onCloseAutoFocus:(0,j.f)(e.onCloseAutoFocus,e=>{s.current||l.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:(0,j.f)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;(!l.modal||r)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),e3=n.forwardRef(eH(function(e,n){let{__scopeDropdownMenu:r,...a}=e,o=eQ(r);return(0,t.jsx)(ex,{...o,...a,ref:n})},"DropdownMenuLabel")),e5=n.forwardRef(eH(function(e,n){let{__scopeDropdownMenu:r,...a}=e,o=eQ(r);return(0,t.jsx)(ew,{...o,...a,ref:n})},"DropdownMenuItem")),e6=n.forwardRef(eH(function(e,n){let{__scopeDropdownMenu:r,...a}=e,o=eQ(r);return(0,t.jsx)(ey,{...o,...a,ref:n})},"DropdownMenuCheckboxItem")),e7=n.forwardRef(eH(function(e,n){let{__scopeDropdownMenu:r,...a}=e,o=eQ(r);return(0,t.jsx)(eC,{...o,...a,ref:n})},"DropdownMenuRadioItem")),e9=n.forwardRef(eH(function(e,n){let{__scopeDropdownMenu:r,...a}=e,o=eQ(r);return(0,t.jsx)(eD,{...o,...a,ref:n})},"DropdownMenuItemIndicator")),e8=n.forwardRef(eH(function(e,n){let{__scopeDropdownMenu:r,...a}=e,o=eQ(r);return(0,t.jsx)(eT,{...o,...a,ref:n})},"DropdownMenuSeparator")),te=n.forwardRef(eH(function(e,n){let{__scopeDropdownMenu:r,...a}=e,o=eQ(r);return(0,t.jsx)(eF,{...o,...a,ref:n})},"DropdownMenuSubTrigger")),tt=n.forwardRef(eH(function(e,n){let{__scopeDropdownMenu:r,...a}=e,o=eQ(r);return(0,t.jsx)(eL,{...o,...a,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),tn=e.i(643531),tr=e.i(463059);let ta=(0,c.f)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var to=e.i(975157);(n.forwardRef(({className:e,inset:n,children:r,...a},o)=>(0,t.jsxs)(te,{ref:o,className:(0,to.f)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",e),...a,children:[r,(0,t.jsx)(tr.f,{className:"ml-auto h-4 w-4"})]}))).displayName=te.displayName,(n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(tt,{ref:r,className:(0,to.f)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}))).displayName=tt.displayName;let tl=n.forwardRef(({className:e,sideOffset:n=4,...r},a)=>(0,t.jsx)(e2,{children:(0,t.jsx)(e4,{ref:a,sideOffset:n,className:(0,to.f)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));tl.displayName=e4.displayName;let ti=n.forwardRef(({className:e,inset:n,...r},a)=>(0,t.jsx)(e5,{ref:a,className:(0,to.f)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",e),...r}));ti.displayName=e5.displayName,(n.forwardRef(({className:e,children:n,checked:r,...a},o)=>(0,t.jsxs)(e6,{ref:o,className:(0,to.f)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...a,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(e9,{children:(0,t.jsx)(tn.f,{className:"h-4 w-4"})})}),n]}))).displayName=e6.displayName,(n.forwardRef(({className:e,children:n,...r},a)=>(0,t.jsxs)(e7,{ref:a,className:(0,to.f)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(e9,{children:(0,t.jsx)(ta,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=e7.displayName;let ts=n.forwardRef(({className:e,inset:n,...r},a)=>(0,t.jsx)(e3,{ref:a,className:(0,to.f)("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}));ts.displayName=e3.displayName;let td=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(e8,{ref:r,className:(0,to.f)("-mx-1 my-1 h-px bg-muted",e),...n}));td.displayName=e8.displayName;var tc=e.i(111110);function tu({mastery:e,timeRange:n,onMasteryChange:r,onTimeRangeChange:o}){let{t:l}=(0,tc.b)(),i=[{value:"all",label:l.filter.all||"All"},{value:"new",label:l.filter.review||"To Review"},{value:"reviewing",label:l.filter.reviewing||"Reviewing"},{value:"mastered",label:l.filter.mastered||"Mastered"}],s=[{value:"all",label:l.filter.allTime||"All Time"},{value:"week",label:l.filter.lastWeek||"Last Week"},{value:"month",label:l.filter.lastMonth||"Last Month"}];return(0,t.jsxs)(e0,{children:[(0,t.jsx)(e1,{asChild:!0,children:(0,t.jsxs)(a.f,{variant:"outline",size:"sm",className:"h-10",children:[(0,t.jsx)(v,{className:"mr-2 h-4 w-4"}),l.notebook.filter,(0,t.jsx)(x.f,{className:"ml-2 h-4 w-4"})]})}),(0,t.jsxs)(tl,{align:"end",className:"w-48",children:[(0,t.jsx)(ts,{children:l.filter.masteryStatus||"Mastery Status"}),i.map(({value:n,label:a})=>(0,t.jsxs)(ti,{onClick:()=>r(n),children:[e===n&&"✓ ",a]},n)),(0,t.jsx)(td,{}),(0,t.jsx)(ts,{children:l.filter.timeRange||"Time Range"}),s.map(({value:e,label:r})=>(0,t.jsxs)(ti,{onClick:()=>o(e),children:[n===e&&"✓ ",r]},e))]})]})}function tf({value:e,onChange:n}){let{t:r}=(0,tc.b)(),o=[{value:"all",label:r.filter.all||"All"},{value:"a",label:r.editor.paperLevels?.a||"Paper A"},{value:"b",label:r.editor.paperLevels?.b||"Paper B"},{value:"other",label:r.editor.paperLevels?.other||"Other"}];return(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(r=>(0,t.jsx)(a.f,{variant:e===r.value?"default":"outline",size:"sm",className:"rounded-full",onClick:()=>n(r.value),children:r.label},r.value))})}var tm=e.i(727612),tp=e.i(37727),th=e.i(531278),tg=e.i(776639),tx=e.i(307364),tv=e.i(511445),tj=e.i(41931),tw=e.i(201276);function tb({ids:e}){let{t:r}=(0,tc.b)(),[o,l]=(0,n.useState)(!1),[i,s]=(0,n.useState)(null),[c,f]=(0,n.useState)(!1),[m,p]=(0,n.useState)(null),[h,g]=(0,n.useState)(0),[x,v]=e,j=()=>{f(!0),s(null),p(null),g(e=>e+1)};return(0,n.useEffect)(()=>{if(!o||!x||!v)return;let e=!0;return tj.f.post("/api/error-items/similarity",{ids:[x,v]}).then(t=>{e&&s(t)}).catch(t=>{e&&(p("Question text is required for similarity comparison"===t?.data?.message?r.questionSimilarity.missingText:r.questionSimilarity.failed),tw.f.error("[Similarity]","相似度比较失败",{error:t instanceof Error?t.message:String(t)}))}).finally(()=>{e&&f(!1)}),()=>{e=!1}},[o,x,v,h,r.questionSimilarity.failed,r.questionSimilarity.missingText]),(0,t.jsxs)(tg.N,{open:o,onOpenChange:e=>{l(e),e&&j()},children:[(0,t.jsx)(tg.a,{asChild:!0,children:(0,t.jsxs)(a.f,{variant:"outline",disabled:2!==e.length,title:r.questionSimilarity.selectTwo,children:[(0,t.jsx)(u,{className:"mr-2 h-4 w-4"}),r.questionSimilarity.title]})}),(0,t.jsxs)(tg.d,{className:"w-[calc(100vw-2rem)] sm:max-w-3xl max-h-[85vh] overflow-y-auto",children:[(0,t.jsxs)(tg.s,{children:[(0,t.jsx)(tg.F,{children:r.questionSimilarity.title}),(0,t.jsx)(tg.C,{children:r.questionSimilarity.description})]}),c&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",role:"status",children:[(0,t.jsx)(th.f,{className:"h-4 w-4 animate-spin"}),r.common.loading]}),m&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:m}),m&&(0,t.jsx)(a.f,{variant:"outline",onClick:j,children:r.questionSimilarity.retry}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted p-4",role:"status",children:[(0,t.jsx)("p",{className:"text-sm",children:r.questionSimilarity.score}),(0,t.jsxs)("p",{className:"text-3xl font-bold tabular-nums",children:[Number((100*i.similarity).toFixed(4)),"%"]}),(0,t.jsx)("p",{className:"text-sm",children:r.questionSimilarity.threshold.replace("{threshold}",String(i.threshold))}),(0,t.jsx)("p",{className:"text-sm font-medium",children:i.duplicate?r.questionSimilarity.duplicate:r.questionSimilarity.different})]}),(0,t.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:i.items.map((e,n)=>(0,t.jsxs)("div",{className:"min-w-0 space-y-2 rounded-lg border p-3",children:[(0,t.jsxs)(d.default,{href:`/error-items/${e.id}`,className:"text-sm font-medium text-primary hover:underline",children:[r.questionSimilarity.question.replace("{index}",String(n+1))," · ",e.shortId||"-"]}),e.notebookName&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.notebookName}),(0,t.jsx)("div",{className:"max-h-56 overflow-auto text-sm",children:(0,t.jsx)(tv.f,{content:e.questionText})})]},e.id))})]}),(0,t.jsx)(tx.f,{onSaved:j})]})]})}function ty({selectedIds:e,deleting:n,onCancel:r,onDelete:o}){let{t:l}=(0,tc.b)();return(0,t.jsx)("div",{className:"pb-safe fixed bottom-0 left-0 right-0 z-50 border-t bg-card/95 p-4 shadow-lg backdrop-blur",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground",children:[(0,t.jsx)("p",{children:l.notebook.selectedCount.replace("{count}",String(e.length))}),(0,t.jsx)("p",{className:"text-xs",children:l.questionSimilarity.selectTwo})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(tb,{ids:e}),(0,t.jsxs)(a.f,{variant:"outline",onClick:r,children:[(0,t.jsx)(tp.X,{className:"mr-2 h-4 w-4"}),l.notebook.cancelSelect]}),(0,t.jsxs)(a.f,{variant:"destructive",onClick:o,disabled:0===e.length||n,children:[(0,t.jsx)(tm.f,{className:"mr-2 h-4 w-4"}),l.notebook.deleteSelected]})]})]})})}var tS=e.i(215519),tk=e.i(306831),tC=e.i(967489),tN=e.i(952122);let tM={1:["一年级"],2:["二年级"],3:["三年级"],4:["四年级"],5:["五年级"],6:["六年级"],7:["七年级上","七年级下","七年级"],8:["八年级上","八年级下","八年级"],9:["九年级上","九年级下","九年级"],10:["高一上","高一下","高一"],11:["高二上","高二下","高二"],12:["高三上","高三下","高三"]};function tR({gradeSemester:e,tag:r,subjectName:a,onFilterChange:o,className:l}){let{t:i}=(0,tc.b)(),{timeZone:s}=(0,tS.M)(),[d,c]=(0,n.useState)(e||""),[u,f]=(0,n.useState)(""),[m,p]=(0,n.useState)(r||""),[h,g]=(0,n.useState)([]),[x,v]=(0,n.useState)(!0),[j,w]=(0,n.useState)([]),[b,y]=(0,n.useState)(e);e!==b&&(y(e),void 0!==e&&c(e));let[S,k]=(0,n.useState)(r);r!==S&&(k(r),void 0!==r&&p(r||""));let C=(0,n.useCallback)((e,t)=>{let n=(0,tk.c)(new Date,s),r=n.getFullYear(),a=(n.getMonth()+1>=9?r:r-1)-t+1;return"primary"===e?a:"junior_high"===e?a+6:"senior_high"===e?a+9:0},[s]),N=(0,n.useCallback)((e,t)=>{let n=[];return e?"primary"===e?n=[1,2,3,4,5,6]:"junior_high"===e?(n=[7,8,9],t&&C(e,t)>=10&&n.push(10,11,12)):n="senior_high"===e?[10,11,12]:[1,2,3,4,5,6,7,8,9,10,11,12]:n=[1,2,3,4,5,6,7,8,9,10,11,12],n.flatMap(e=>tM[e]||[])},[C]);(0,n.useEffect)(()=>{(async()=>{v(!0);try{let e=await tj.f.get("/api/user"),t=N(e.educationStage,e.enrollmentYear);w(t);let n=a?(0,tN.f)(a):"math";try{let e=await tj.f.get(`/api/tags?subject=${n}`);g(e.tags)}catch(e){tw.f.warn("[KnowledgeFilter]","Failed to fetch tags for subject",{subject:n,error:e}),g([])}}catch(e){tw.f.error("[KnowledgeFilter]","Failed to load filter data",{error:e})}finally{v(!1)}})()},[a,N]);let M=h.find(e=>e.name===d),R=M?.children||[],D=R.find(e=>e.name===u),T=e=>0===e.children.length?[e.name]:e.children.flatMap(e=>T(e)),P=D?[...new Set(T(D))]:[],I=j.filter(e=>h.some(t=>t.name===e));return(0,t.jsxs)("div",{className:`flex gap-2 ${l}`,children:[(0,t.jsxs)(tC.d,{value:d,onValueChange:e=>{c(e),f(""),p(""),o({gradeSemester:"all"===e?void 0:e,chapter:void 0,tag:void 0})},disabled:x,children:[(0,t.jsx)(tC.P,{className:"w-[140px]",children:(0,t.jsx)(tC.U,{placeholder:i.filter?.gradeShort||"Grade"})}),(0,t.jsxs)(tC.r,{children:[(0,t.jsx)(tC.T,{value:"all",children:i.filter?.allGrades||"All grades"}),I.map(e=>(0,t.jsx)(tC.T,{value:e,children:e},e))]})]}),(0,t.jsxs)(tC.d,{value:u,onValueChange:e=>{f(e),p(""),o({gradeSemester:"all"===d?void 0:d,chapter:"all"===e?void 0:e,tag:void 0})},disabled:!d||"all"===d,children:[(0,t.jsx)(tC.P,{className:"w-[180px]",children:(0,t.jsx)(tC.U,{placeholder:i.filter?.chapter||"Chapter"})}),(0,t.jsxs)(tC.r,{children:[(0,t.jsx)(tC.T,{value:"all",children:i.filter?.allChapters||"All chapters"}),R.map(e=>(0,t.jsx)(tC.T,{value:e.name,children:e.name.replace(/^第\d+章\s*/,"")},e.id))]})]}),(0,t.jsxs)(tC.d,{value:m,onValueChange:e=>{p(e),o({gradeSemester:"all"===d?void 0:d,chapter:"all"===u?void 0:u,tag:"all"===e?void 0:e})},disabled:!u||"all"===u,children:[(0,t.jsx)(tC.P,{className:"w-[140px]",children:(0,t.jsx)(tC.U,{placeholder:i.filter?.knowledgePoint||"Tag"})}),(0,t.jsxs)(tC.r,{children:[(0,t.jsx)(tC.T,{value:"all",children:i.filter?.allKnowledgePoints||"All tags"}),P.map(e=>(0,t.jsx)(tC.T,{value:e,children:e},e))]})]})]})}var tD=e.i(487486),tT=e.i(912505),tP=e.i(793479),tI=e.i(658512),tE=e.i(469817);function t_(e){let t=new URLSearchParams;return e.subjectId&&t.append("subjectId",e.subjectId),e.search&&t.append("query",e.search),"all"!==e.mastery&&t.append("mastery",e.mastery),"all"!==e.timeRange&&t.append("timeRange",e.timeRange),e.tag&&t.append("tag",e.tag),e.gradeSemester&&t.append("gradeSemester",e.gradeSemester),e.chapter&&t.append("chapter",e.chapter),"all"!==e.paperLevel&&t.append("paperLevel",e.paperLevel),t}var tF=e.i(294114),tL=e.i(833547),tO=e.i(747279);function tA({subjectId:e,subjectName:o}={}){let{t:l}=(0,tc.b)(),i=(0,r.useRouter)(),[s,d]=(0,n.useState)([]),[c,x]=(0,n.useState)(!0),[v,j]=(0,n.useState)(""),[w,b]=(0,n.useState)("all"),[y,S]=(0,n.useState)("all"),[k,C]=(0,n.useState)(""),[N,M]=(0,n.useState)(""),[R,D]=(0,n.useState)("all"),[T,P]=(0,n.useState)(null),[I,E]=(0,n.useState)(1),_=tE.$,[F,L]=(0,n.useState)(0),[O,A]=(0,n.useState)(0),[K,q]=(0,n.useState)(!1),[z,B]=(0,n.useState)(new Set),[V,$]=(0,n.useState)(!1),U=(0,n.useMemo)(()=>({subjectId:e,search:v,mastery:w,timeRange:y,tag:T,gradeSemester:k,chapter:N,paperLevel:R}),[e,v,w,y,T,k,N,R]),G=()=>{q(!K),B(new Set)},H=(0,n.useCallback)(async()=>{x(!0);try{let e=t_(U);e.append("page",I.toString()),e.append("pageSize",_.toString());let t=await tj.f.get(`/api/error-items/list?${e.toString()}`);d(t.items),L(t.total),A(t.totalPages)}catch(e){tw.f.error("[ErrorList]","Failed to fetch error items",{error:e})}finally{x(!1)}},[U,I,_]),X=async()=>{if(0===z.size)return;let e=(l.notebook?.confirmBatchDelete||"Delete {count} items?").replace("{count}",z.size.toString());if(await (0,tF.u)(e,{destructive:!0})){$(!0);try{await tj.f.post("/api/error-items/batch-delete",{ids:Array.from(z)}),tF.c.success(l.notebook?.batchDeleteSuccess||"Deleted successfully"),q(!1),B(new Set),H()}catch(e){tw.f.error("[ErrorList]","Batch delete failed",{error:e}),tF.c.error(l.common?.messages?.deleteFailed||"Delete failed")}finally{$(!1)}}},Y=(0,n.useRef)(U);return(0,n.useEffect)(()=>{let e=Y.current!==U;(Y.current=U,e&&1!==I)?E(1):H()},[I,U,H]),(0,t.jsxs)("div",{className:`space-y-6 ${K?"pb-40 sm:pb-24":""}`,children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row",children:[(0,t.jsxs)("div",{className:"relative w-full lg:flex-1",children:[(0,t.jsx)(h,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(tP.f,{placeholder:l.notebook.search,title:l.shortId.searchHint,className:"h-10 rounded-xl bg-card pl-9",value:v,onChange:e=>j(e.target.value),onKeyDown:async e=>{let t=v.trim();if("Enter"!==e.key||!(0,tO.f)(t))return;let n=await (0,tL.f)(t);n&&i.push(`/error-items/${n}`)}})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(tu,{mastery:w,timeRange:y,onMasteryChange:b,onTimeRangeChange:S}),(0,t.jsxs)(a.f,{variant:"outline",size:"sm",className:"h-10",onClick:()=>i.push(`/print-preview?${t_(U).toString()}`),children:[(0,t.jsx)(p.f,{className:"mr-2 h-4 w-4"}),l.notebook?.exportPrint||"Export for Print"]}),!K&&(0,t.jsxs)(a.f,{variant:"outline",size:"sm",className:"h-10",onClick:G,children:[(0,t.jsx)(u,{className:"mr-2 h-4 w-4"}),l.questionSimilarity.title]}),(0,t.jsxs)(a.f,{variant:K?"secondary":"outline",size:"sm",className:"h-10",onClick:G,children:[(0,t.jsx)(m.f,{className:"mr-2 h-4 w-4"}),K?l.notebook?.cancelSelect||"Cancel":l.notebook?.selectMode||"Select"]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-stretch sm:items-center",children:[(0,t.jsx)("div",{className:"w-full sm:w-auto",children:(0,t.jsx)(tR,{gradeSemester:k,tag:T,onFilterChange:({gradeSemester:e,chapter:t,tag:n})=>{void 0!==e&&C(e),void 0!==t&&M(t),P(void 0===n?null:n),e?t||M(""):(C(""),M(""),P(null)),E(1)},subjectName:o})}),(0,t.jsx)(tf,{value:R,onChange:D})]}),T&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[l.filter.filteringByTag||"Filtering by tag",":"]}),(0,t.jsxs)(tD.f,{variant:"secondary",className:"cursor-pointer",onClick:()=>P(null),children:[T,(0,t.jsx)("span",{className:"ml-1 text-xs",children:"×"})]})]}),!c&&0===s.length&&(0,t.jsx)(tT.f,{icon:f,title:l.notebook.emptyList,description:l.notebook.emptyListHint}),c&&0===s.length&&(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6},(e,n)=>(0,t.jsx)("div",{className:"h-44 animate-pulse rounded-2xl bg-muted"},n))}),(0,t.jsx)("div",{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-3 transition-opacity ${c?"opacity-60":""}`,children:s.map(e=>(0,t.jsx)(g.f,{item:e,selectMode:K,selected:z.has(e.id),onToggleSelect:()=>{var t;return t=e.id,void B(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},selectedTag:T,onTagClick:e=>P(T===e?null:e)},e.id))}),(0,t.jsx)(tI.f,{page:I,totalPages:O,total:F,pageSize:_,onPageChange:E}),K&&(0,t.jsx)(ty,{selectedIds:[...z],deleting:V,onCancel:G,onDelete:X})]})}var tK=e.i(67153),tq=e.i(283086);function tz({notebookId:e,onFinished:r}){let{t:o}=(0,tc.b)(),[l,i]=(0,n.useState)(null),[s,d]=(0,n.useState)(null),c=(0,n.useRef)(!1),u=(0,n.useCallback)(()=>{tj.f.get(`/api/notebooks/${e}/retag`).then(e=>{c.current&&e&&!e.running&&r?.(),c.current=!!e?.running,i(e)}).catch(()=>void 0)},[e,r]);(0,n.useEffect)(u,[u]),(0,n.useEffect)(()=>{if(!l?.running)return;let e=setTimeout(u,2e3);return()=>clearTimeout(e)},[l,u]);let f=async()=>{if(await (0,tF.u)(o.retag.notebookConfirm)){d(null);try{let t=await tj.f.post(`/api/notebooks/${e}/retag`,{});if(0===t.total)return void d(o.retag.empty);c.current=t.running,i(t)}catch{d(o.retag.itemFailed)}}},m=s??(l?.running?o.retag.progress.replace("{done}",String(l.done)).replace("{total}",String(l.total)):l?.finishedAt&&l.total>0?o.retag.finished.replace("{success}",String(l.total-l.failed)).replace("{failed}",String(l.failed)):null);return(0,t.jsxs)("div",{className:"flex flex-col items-start sm:items-end gap-1",children:[(0,t.jsxs)(a.f,{variant:"outline",size:"sm",onClick:f,disabled:l?.running,"aria-label":o.retag.notebookButton,children:[l?.running?(0,t.jsx)(th.f,{className:"h-4 w-4 animate-spin sm:mr-2"}):(0,t.jsx)(tq.f,{className:"h-4 w-4 sm:mr-2"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:o.retag.notebookButton})]}),m&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:m})]})}var tB=e.i(709830),tV=e.i(35209);e.s(["default",0,function(){let e=(0,r.useParams)(),c=(0,r.useRouter)(),{t:u}=(0,tc.b)(),[f,m]=(0,n.useState)(null);(0,tV.f)(u.notebooks.title,f?.name);let[p,h]=(0,n.useState)(!0),[g,x]=(0,n.useState)(!1),[v,j]=(0,n.useState)(0),w=(0,n.useCallback)(async e=>{try{let t=await tj.f.get(`/api/notebooks/${e}`);m(t)}catch(e){tw.f.error("[NotebookDetail]","Failed to fetch notebook",{error:e}),tF.c.error(u.notebooks?.notFound||"Notebook not found"),c.push("/notebooks")}finally{h(!1)}},[c,u]);(0,n.useEffect)(()=>{e.id&&w(e.id)},[e.id,w]);let b=async e=>{f&&m(await tj.f.put(`/api/notebooks/${f.id}`,{name:e}))};return p?(0,t.jsx)(l.f,{label:u.common.loading}):f?(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(o.f,{backHref:"/notebooks",title:f.name,titleAddon:(0,t.jsx)(a.f,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground",onClick:()=>x(!0),title:u.notebooks?.rename||"Rename",children:(0,t.jsx)(s.f,{className:"h-4 w-4"})}),description:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tB.E,{notebook:f})," · ",(u.notebooks?.totalErrors||"Total {count} errors").replace("{count}",(f._count?.errorItems||0).toString())]}),actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tz,{notebookId:f.id,onFinished:()=>j(e=>e+1)}),(0,t.jsx)(d.default,{href:`/notebooks/${f.id}/add`,children:(0,t.jsxs)(a.f,{"aria-label":u.notebooks?.addError||"Add Error",children:[(0,t.jsx)(i.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:u.notebooks?.addError||"Add Error"})]})})]})}),(0,t.jsx)(tA,{subjectId:f.id,subjectName:f.name},v),(0,t.jsx)(tK.f,{open:g,onOpenChange:x,currentName:f.name,onRename:b})]})}):null}],198591)}]);
|