wrong-notebook 2026.10.31-4 → 2026.11.1-2
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 +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +14 -0
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/page.js.nft.json +1 -1
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
- package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/admin/dashboard/route.js +1 -1
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/detail/route.js +1 -1
- 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.nft.json +1 -1
- package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +1 -1
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +1 -1
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +1 -1
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +1 -1
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/figure/route.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/reanswer/route.js +1 -1
- 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 +6 -6
- 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 +6 -3
- package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js +1 -1
- 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.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +14 -14
- package/.next/server/app/api/error-items/route.js.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +1 -1
- 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 +1 -1
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +1 -1
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +1 -1
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +6 -6
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +1 -1
- 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 +15 -15
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/initialize/route.js.nft.json +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.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +6 -6
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/[id]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/paper-groups/[id]/route/build-manifest.json +12 -0
- package/.next/server/app/api/paper-groups/[id]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/paper-groups/[id]/route.js +12 -0
- package/.next/server/app/api/paper-groups/[id]/route.js.map +5 -0
- package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/paper-groups/[id]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/paper-groups/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/paper-groups/route/build-manifest.json +12 -0
- package/.next/server/app/api/paper-groups/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/paper-groups/route.js +12 -0
- package/.next/server/app/api/paper-groups/route.js.map +5 -0
- package/.next/server/app/api/paper-groups/route.js.nft.json +1 -0
- package/.next/server/app/api/paper-groups/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/practice/generate/route.js +1 -1
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +1 -1
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +1 -1
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +1 -1
- 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/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +1 -1
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +11 -11
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/page.js.nft.json +1 -1
- package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
- package/.next/server/app/initialize/page.js.nft.json +1 -1
- package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/practice/page.js.nft.json +1 -1
- package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
- package/.next/server/app/print-preview/page.js.nft.json +1 -1
- package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
- package/.next/server/app/register/page.js.nft.json +1 -1
- package/.next/server/app/register/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page.js.nft.json +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/setup/page.js.nft.json +1 -1
- package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/server/app/stats/page.js.nft.json +1 -1
- package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tags/page.js.nft.json +1 -1
- package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +2 -0
- package/.next/server/chunks/{[root-of-the-server]__1d5uqlu5q008p._.js → [root-of-the-server]__01nvw5ogtwc0h._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0423hh3mg9u0j._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__06nk0robdprys._.js → [root-of-the-server]__08d1atgxt3ymf._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0_uvtfu0yr-na._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1mupbedevo0sa._.js → [root-of-the-server]__0c2729fcpi3-x._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1-36vz3p1o-t1._.js → [root-of-the-server]__0hmb6jibheznj._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0nujsu6qbn-8o._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0alblz4_uxesb._.js → [root-of-the-server]__0pe0tw33dv504._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__209bfnnc4kkd3._.js → [root-of-the-server]__0sxr-ing62eg7._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0z99q93n88cro._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__145w7mwgp8ujm._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1mm69hpl71v9e._.js → [root-of-the-server]__19v5yvii0w7r3._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1v1p83o4ygnyt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1yrozlry-psmk._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1zwat9xocdoqz._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__065p5m2qghilm._.js → [root-of-the-server]__20jkc-_5uj_zc._.js} +1 -1
- package/.next/server/chunks/_008zx49yrqg5a._.js +3 -0
- package/.next/server/chunks/{_17xgce88yoq84._.js → _03udbqs8_z944._.js} +1 -1
- package/.next/server/chunks/_0431fxnqiloso._.js +1 -1
- package/.next/server/chunks/_0_rhee7wb6tcg._.js +1 -1
- package/.next/server/chunks/_0jgk7kwvf4_6i._.js +3 -0
- package/.next/server/chunks/_0po48rvqz03dg._.js +3 -0
- package/.next/server/chunks/_10tpt8iizl4v3._.js +1 -1
- package/.next/server/chunks/_12i51zlq-xxrl._.js +1 -1
- package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
- package/.next/server/chunks/_1_ns7o3cqznv6._.js +1 -1
- package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
- package/.next/server/chunks/_1be-y660a8z-q._.js +1 -1
- package/.next/server/chunks/_1dvka-waihfum._.js +1 -1
- package/.next/server/chunks/_1ex6ovo_j2jzv._.js +1 -1
- package/.next/server/chunks/_1fgb9ve_nfat4._.js +1 -1
- package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
- package/.next/server/chunks/_1m-yyz-pl9-03._.js +1 -1
- package/.next/server/chunks/_1ox156inx113o._.js +3 -0
- package/.next/server/chunks/_1zvf_gki7-g0n._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_paper-groups_[id]_route_actions_0qa-ktg9az6px.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_paper-groups_route_actions_1if4ddoduarbj.js +3 -0
- package/.next/server/chunks/src_lib_0ptvn4_15zxu0._.js +1 -1
- package/.next/server/chunks/src_lib_0ximwux0rcb__._.js +1 -1
- package/.next/server/chunks/src_lib_1h4xeb9lyx31r._.js +1 -1
- package/.next/server/chunks/src_lib_1mo2a48k4wa7n._.js +3 -0
- 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_retag_ts_0eu8ld_86kt3a._.js +1 -1
- package/.next/server/chunks/src_lib_tag-recognition_ts_1wkzrdiapau86._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0-0k8bt9jcf8b._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0fy6mc47ccfce._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1dby5q1e2rwrm._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1eutot_8-s4s4._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1hcp3uk2sxb8s._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1jdb2axhv5dqd._.js +3 -0
- package/.next/server/chunks/ssr/_02zfjls23g-o4._.js +3 -0
- package/.next/server/chunks/ssr/{_0ott13fp7-ogy._.js → _037_l3ca0s_0m._.js} +1 -1
- package/.next/server/chunks/ssr/_07-atqwd3wqya._.js +3 -0
- package/.next/server/chunks/ssr/{_0lex0cqdz7zpi._.js → _0b0yopxl37va_._.js} +2 -2
- package/.next/server/chunks/ssr/_0j4vduk13imjn._.js +3 -0
- package/.next/server/chunks/ssr/_0rm0irv0xu4bg._.js +3 -0
- package/.next/server/chunks/ssr/_0yrywyu_og4rx._.js +3 -0
- package/.next/server/chunks/ssr/{_1l077fud26z-i._.js → _1-z85ugzufqk6._.js} +2 -2
- package/.next/server/chunks/ssr/_16dhqh84g_-pd._.js +1 -1
- package/.next/server/chunks/ssr/_16dxmyb5enou2._.js +3 -0
- package/.next/server/chunks/ssr/_16mxitac-h_mk._.js +3 -0
- package/.next/server/chunks/ssr/_1_hw62m8ju2bw._.js +3 -0
- package/.next/server/chunks/ssr/_1cc3psc9rvrwn._.js +3 -0
- package/.next/server/chunks/ssr/_1d91l8e5qt82w._.js +3 -0
- package/.next/server/chunks/ssr/_1iapvddj39zp7._.js +3 -0
- package/.next/server/chunks/ssr/_1qekjxy0_mnkp._.js +3 -0
- package/.next/server/chunks/ssr/_1qgg_ll5hkjaf._.js +2 -2
- package/.next/server/chunks/ssr/_1r8-39vwdjrgs._.js +3 -0
- package/.next/server/chunks/ssr/_1rgoz5udzbn3d._.js +3 -0
- package/.next/server/chunks/ssr/_1ux6eqqkupo6v._.js +2 -2
- package/.next/server/chunks/ssr/{src_0hbb4l46hkkx0._.js → src_0e73j7l6j__rh._.js} +2 -2
- package/.next/server/chunks/ssr/src_0ipwcihawso27._.js +3 -0
- package/.next/server/chunks/ssr/src_1m8frpkuirkx8._.js +1 -1
- package/.next/server/chunks/ssr/src_1vhiktxz2_jj3._.js +3 -0
- package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
- package/.next/server/chunks/ssr/src_app_exams_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_page_tsx_1chiuahujsxm1._.js +1 -1
- package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
- package/.next/server/chunks/ssr/src_components_create-notebook-dialog_tsx_0c5teagim70r7._.js +1 -1
- package/.next/server/chunks/ssr/src_components_exam_exam-status-badge_tsx_0rozdbhlqsq71._.js +3 -0
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +10 -10
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0-djefxn9k6wm.js +1 -0
- package/.next/static/chunks/0313mdq1ehw6t.js +1 -0
- package/.next/static/chunks/0ajfstfi1ibjf.js +1 -0
- package/.next/static/chunks/0evgpd-c9a459.js +1 -0
- package/.next/static/chunks/0i1q2hqzk7ojc.css +3 -0
- package/.next/static/chunks/0kvdkkwcp0gk_.js +1 -0
- package/.next/static/chunks/{3u2t8l45o5ai-.js → 0x1mzyuhk1omf.js} +3 -3
- package/.next/static/chunks/0zj83pnid72u3.js +1 -0
- package/.next/static/chunks/0zx49lemqph3o.js +1 -0
- package/.next/static/chunks/{3m602ro466gws.js → 15j2y67akjikk.js} +1 -1
- package/.next/static/chunks/{2f2eqqck1ucy5.js → 1__y-wfj49ciy.js} +1 -1
- package/.next/static/chunks/{1nelcopq5fipp.js → 1c36uw_9rc8oc.js} +1 -1
- package/.next/static/chunks/{0kbwvt6gwikw-.js → 1gvev34tv39bd.js} +1 -1
- package/.next/static/chunks/25emavlvjqnb_.js +6 -0
- package/.next/static/chunks/2h1-bjeib7r-u.js +1 -0
- package/.next/static/chunks/{2x835xwpv6xv9.js → 2hihgd7vu8tw5.js} +1 -1
- package/.next/static/chunks/2r4x8vhlmc092.js +1 -0
- package/.next/static/chunks/2upf0inu0om06.js +1 -0
- package/.next/static/chunks/2yp2zha1v39fv.js +1 -0
- package/.next/static/chunks/34wbfnz7ytbpy.js +1 -0
- package/.next/static/chunks/3cyz6w014ooxj.js +191 -0
- package/.next/static/chunks/3oq365ly8o1te.js +1 -0
- package/.next/static/chunks/3v700vp0e3t5_.js +1 -0
- package/.next/static/chunks/{2aab9ef-dj9_m.js → 3vtuwbfv7mxt8.js} +1 -1
- package/.next/static/chunks/42p60iwe4ayfi.js +4 -0
- package/.next/static/chunks/454mslxlxj999.js +1 -0
- package/README.en.md +2 -2
- package/package.json +1 -1
- package/prisma/migrations/20261031195209_add_paper_group/migration.sql +106 -0
- package/prisma/migrations/20261031200339_add_tag_set/migration.sql +43 -0
- package/prisma/migrations/20261031204515_add_question_figure_scale/migration.sql +15 -0
- package/prisma/schema.prisma +27 -3
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__0742cu03ar47c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0c8fgr3zelpik._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1d221u0rrj5vn._.js +0 -3
- package/.next/server/chunks/_1vtmdpk7p4al9._.js +0 -3
- package/.next/server/chunks/src_lib_10is5pyogge95._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__01kx6r00ld-i3._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0ik_fqcvo5l-d._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0jg0uiu38i5wt._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0rgld9k_-8w_i._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__101mpt9jhd3bj._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1aqinuht44szz._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1z9766wv6dj8z._.js +0 -3
- package/.next/server/chunks/ssr/_0-ach07vhfvmq._.js +0 -3
- package/.next/server/chunks/ssr/_02d_2cjn8qw3w._.js +0 -3
- package/.next/server/chunks/ssr/_0am6ugw1ulqzu._.js +0 -3
- package/.next/server/chunks/ssr/_0ecx95vqjqdc3._.js +0 -3
- package/.next/server/chunks/ssr/_0gs_f7ri8ab-t._.js +0 -3
- package/.next/server/chunks/ssr/_0ha8gl7l6aod0._.js +0 -3
- package/.next/server/chunks/ssr/_0l21zysfjab-0._.js +0 -3
- package/.next/server/chunks/ssr/_0pf9e0usy7ohp._.js +0 -3
- package/.next/server/chunks/ssr/_0smjb872ux0bv._.js +0 -3
- package/.next/server/chunks/ssr/_0tqz2g6uwot_g._.js +0 -3
- package/.next/server/chunks/ssr/_1dioymlnwdhgc._.js +0 -3
- package/.next/server/chunks/ssr/_1m9s9225s4ark._.js +0 -3
- package/.next/server/chunks/ssr/_1sy8ii-gy-3z_._.js +0 -3
- package/.next/server/chunks/ssr/_1ti86x9v9qlrp._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1_edg73v2-k_y._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1ez-_7m3ru8ad._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_circle-alert_mjs_0i9c9zsf1d3_1._.js +0 -3
- package/.next/server/chunks/ssr/src_0av4wv_56wg9j._.js +0 -3
- package/.next/server/chunks/ssr/src_0wxvmqdi_0uno._.js +0 -3
- package/.next/server/chunks/ssr/src_1-cqlnizwbrvz._.js +0 -3
- package/.next/server/chunks/ssr/src_13u20tdu4gmgj._.js +0 -3
- package/.next/server/chunks/ssr/src_components_1lbiuzxejiwvf._.js +0 -3
- package/.next/static/chunks/0hcvfgiy9-3ss.js +0 -6
- package/.next/static/chunks/0hxzktxn-ob8a.js +0 -1
- package/.next/static/chunks/0m120lsbhh8yv.js +0 -1
- package/.next/static/chunks/0niljyr6lth9t.js +0 -1
- package/.next/static/chunks/0ok4hus-aa3mo.js +0 -1
- package/.next/static/chunks/19xbzv_pt8doo.js +0 -4
- package/.next/static/chunks/1asg7-kor1mp8.js +0 -1
- package/.next/static/chunks/1k250olgigdg-.js +0 -1
- package/.next/static/chunks/1srbpgydt7ksr.js +0 -1
- package/.next/static/chunks/1t48_lbryoxu_.js +0 -191
- package/.next/static/chunks/1w5n49a92m6od.js +0 -1
- package/.next/static/chunks/1zm8q8qoykg0h.js +0 -1
- package/.next/static/chunks/2dcd2mlj33lw_.js +0 -1
- package/.next/static/chunks/2mu1ha8i_vrsp.js +0 -1
- package/.next/static/chunks/2u3b6_dh_so3z.css +0 -3
- package/.next/static/chunks/39z_ykj6io3w_.js +0 -1
- package/.next/static/chunks/3_yxkdzuf9365.js +0 -1
- package/.next/static/chunks/3cwg2_rjdz-8j.js +0 -1
- package/.next/static/chunks/3rv338thn950a.js +0 -1
- package/.next/static/chunks/3snkn29ynibmr.js +0 -1
- /package/.next/static/{JmrJZEztiNCQYonhTuZh_ → a_s4-LHOy7Mv_E61U1tOg}/_buildManifest.js +0 -0
- /package/.next/static/{JmrJZEztiNCQYonhTuZh_ → a_s4-LHOy7Mv_E61U1tOg}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{JmrJZEztiNCQYonhTuZh_ → a_s4-LHOy7Mv_E61U1tOg}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let a={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};a.node;let n=(0,t.f)(a);e.s(["f",0,n],711241)},77043,e=>{var t=e.i(456420);let a={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};a.node;let n=(0,t.f)(a);e.s(["f",0,n],77043)},580685,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(618566),s=e.i(762368),i=e.i(77043),r=e.i(519455),l=e.i(257428),o=e.i(967489),c=e.i(590546),d=e.i(511445),m=e.i(149704),
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let a={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};a.node;let n=(0,t.f)(a);e.s(["f",0,n],711241)},77043,e=>{var t=e.i(456420);let a={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};a.node;let n=(0,t.f)(a);e.s(["f",0,n],77043)},580685,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(618566),s=e.i(762368),i=e.i(77043),r=e.i(519455),l=e.i(257428),o=e.i(967489),c=e.i(590546),d=e.i(511445),m=e.i(149704),u=e.i(111110),x=e.i(35209),h=e.i(41931);let f=`
|
|
2
2
|
.exam-sheet { max-width: 210mm; margin: 0 auto; padding: 16px; color: #111; background: #fff; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.6; }
|
|
3
3
|
.exam-sheet h1 { text-align: center; font-size: 22px; margin: 0 0 8px; }
|
|
4
4
|
.exam-sheet .exam-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; font-size: 14px; margin-bottom: 20px; }
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
.exam-sheet .markdown-content table { border-collapse: collapse; }
|
|
18
18
|
.exam-sheet .markdown-content td, .exam-sheet .markdown-content th { border: 1px solid #999; padding: 2px 6px; }
|
|
19
19
|
@media print { .exam-sheet { padding: 0; max-width: none; } @page { size: A4; margin: 15mm; } }
|
|
20
|
-
`;function p(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}let g=["auto","none","small","medium","large"],b="exam-print-answer-space",j={none:0,small:60,medium:120,large:240},w={choice:40,judgment:32,fill:64,solution:180};function k(e){return"string"==typeof e&&g.includes(e)}let y=/(?:(?:^|\s{2,})([A-D])\s*[..、::]|[((]([A-D])[))])/gm,v=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,N=/_{3,}|(?:\\_){2,}|\\underline|(\s*)|\(\s+\)|填空/,C=/(\s*(\d{1,2})\s*)/g,_=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;e.s(["default",0,function(){let e=(0,n.useParams)(),{t:g,language:S}=(0,
|
|
20
|
+
`;function p(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}let g=["auto","none","small","medium","large"],b="exam-print-answer-space",j={none:0,small:60,medium:120,large:240},w={choice:40,judgment:32,fill:64,solution:180};function k(e){return"string"==typeof e&&g.includes(e)}let y=/(?:(?:^|\s{2,})([A-D])\s*[..、::]|[((]([A-D])[))])/gm,v=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,N=/_{3,}|(?:\\_){2,}|\\underline|(\s*)|\(\s+\)|填空/,C=/(\s*(\d{1,2})\s*)/g,_=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;e.s(["default",0,function(){let e=(0,n.useParams)(),{t:g,language:S}=(0,u.b)(),[R,T]=(0,a.useState)(null);(0,x.f)(g.exam.title,R?.title,g.pageTitle.examPrint);let[q,z]=(0,a.useState)(!0),[E,L]=(0,a.useState)("auto"),P=(0,a.useRef)(null);if((0,a.useEffect)(()=>{let e=null;try{e=localStorage.getItem(b)}catch{}k(e)&&L(e)},[]),(0,a.useEffect)(()=>{h.f.get(`/api/exams/${e.id}`).then(T).catch(()=>T(null))},[e.id]),!R)return(0,t.jsx)("div",{className:"p-8 text-center",children:g.common.loading});let A=R.questions.filter(e=>"ready"===e.status&&e.questionText);return(0,t.jsxs)("main",{className:"min-h-screen bg-white",children:[(0,t.jsx)("style",{children:f}),(0,t.jsx)("div",{className:"print:hidden sticky top-0 z-10 border-b bg-background p-3 shadow-sm",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex flex-wrap items-center gap-3",children:[(0,t.jsx)(c.f,{fallbackUrl:`/exams/${R.id}`}),(0,t.jsx)("span",{className:"font-semibold",children:g.exam.printTitle}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(l.f,{checked:q,onCheckedChange:e=>z(!0===e)}),g.exam.includeAnswers]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"shrink-0",children:g.exam.answerSpace}),(0,t.jsxs)(o.d,{value:E,onValueChange:e=>{if(k(e)){L(e);try{localStorage.setItem(b,e)}catch{}}},children:[(0,t.jsx)(o.P,{className:"h-8 w-40",children:(0,t.jsx)(o.U,{})}),(0,t.jsxs)(o.r,{children:[(0,t.jsx)(o.T,{value:"auto",children:g.exam.answerSpaceAuto}),(0,t.jsx)(o.T,{value:"none",children:g.exam.answerSpaceNone}),(0,t.jsx)(o.T,{value:"small",children:g.exam.answerSpaceSmall}),(0,t.jsx)(o.T,{value:"medium",children:g.exam.answerSpaceMedium}),(0,t.jsx)(o.T,{value:"large",children:g.exam.answerSpaceLarge})]})]})]}),(0,t.jsxs)("div",{className:"flex gap-2 sm:ml-auto",children:[(0,t.jsxs)(r.f,{variant:"outline",size:"sm",onClick:()=>{var e;if(!P.current)return;let t=function(e,t,a="zh-CN"){return`<!doctype html>
|
|
21
21
|
<html lang="${p(a)}">
|
|
22
22
|
<head>
|
|
23
23
|
<meta charset="utf-8">
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
${t}
|
|
31
31
|
</body>
|
|
32
32
|
</html>
|
|
33
|
-
`}(R.title,P.current.outerHTML,"en"===S?"en":"zh-CN"),a=URL.createObjectURL(new Blob([t],{type:"text/html;charset=utf-8"})),n=document.createElement("a");n.href=a,e=R.title,n.download=`${e.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,n.click(),URL.revokeObjectURL(a)},children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4"}),g.exam.downloadHtml]}),(0,t.jsxs)(r.f,{size:"sm",onClick:()=>window.print(),children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),g.exam.printNow]})]}),"auto"===
|
|
33
|
+
`}(R.title,P.current.outerHTML,"en"===S?"en":"zh-CN"),a=URL.createObjectURL(new Blob([t],{type:"text/html;charset=utf-8"})),n=document.createElement("a");n.href=a,e=R.title,n.download=`${e.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,n.click(),URL.revokeObjectURL(a)},children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4"}),g.exam.downloadHtml]}),(0,t.jsxs)(r.f,{size:"sm",onClick:()=>window.print(),children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),g.exam.printNow]})]}),"auto"===E&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:g.exam.answerSpaceAutoHint}),A.length<R.questions.length&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:g.exam.notReadyHint})]})}),(0,t.jsxs)("div",{ref:P,className:"exam-sheet",children:[(0,t.jsx)("h1",{children:R.title}),(0,t.jsxs)("div",{className:"exam-meta",children:[(0,t.jsxs)("span",{children:[g.exam.nameLine,g.common.colon,"________"]}),(0,t.jsxs)("span",{children:[g.exam.dateLine,g.common.colon,"________"]}),(0,t.jsxs)("span",{children:[g.exam.scoreLine,g.common.colon,"________"]})]}),A.map((e,a)=>(0,t.jsxs)("section",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[a+1,"."]}),(0,t.jsxs)("span",{className:"exam-source",children:[g.exam.sourceLabel,": ",e.sourceShortId]})]}),(0,t.jsx)(d.f,{content:e.questionText}),(0,t.jsx)(m.f,{svg:e.figureSvg}),(0,t.jsx)("div",{className:"exam-answer-space",style:{minHeight:`${function(e,t){let a;if("auto"!==e)return j[e];let n=(a=new Set(Array.from(t.matchAll(y),e=>e[1]??e[2]))).has("A")&&a.has("B")&&a.has("C")?"choice":v.test(t)?"judgment":N.test(t)?"fill":"solution";if("solution"!==n)return w[n];let s=(function(e){let t=new Set;for(let a of e.matchAll(C))t.add(a[1]);for(let a of e.matchAll(_))t.add(a[1]);return Math.max(1,t.size)}(t)-1)*100;return Math.min(480,w.solution+s)}(E,e.questionText)}px`}})]},e.id)),q&&(0,t.jsxs)("section",{className:"exam-answer-key",children:[(0,t.jsx)("h2",{children:g.exam.answerKey}),A.map((e,a)=>(0,t.jsxs)("div",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[a+1,"."]}),(0,t.jsxs)("span",{className:"exam-source",children:[g.exam.sourceLabel,": ",e.sourceShortId]})]}),e.answerText&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[g.exam.answerLabel,g.common.colon]}),(0,t.jsx)(d.f,{content:e.answerText})]}),e.analysis&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[g.exam.analysisLabel,g.common.colon]}),(0,t.jsx)(d.f,{content:e.analysis})]})]},e.id))]})]})]})}],580685)},149704,184110,e=>{var t=e.i(843476),a=e.i(111110);function n(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}function s(e){return n(e)?e:100}e.s(["n",0,100,"a",0,200,"_",0,10,"x",0,n,"V",0,s],184110);var i=e.i(975157);e.s(["f",0,function({svg:e,scale:n,className:r}){let{t:l}=(0,a.b)();if(!e)return null;let o=s(n);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",r),children:(0,t.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:l.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360,zoom:o/100,maxWidth:`${Math.min(o,100)}%`}})})}],149704)},590546,e=>{var t=e.i(843476),a=e.i(618566),n=e.i(519455),s=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let r=(0,a.useRouter)();return(0,t.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{r.push(e)},className:i,children:(0,t.jsx)(s.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(820783),s=e.i(30030),i=e.i(981140),r=e.i(369340),l=e.i(635804),o=e.i(296626),c=e.i(248425),d=Object.defineProperty,m=(e,t)=>d(e,"name",{value:t,configurable:!0}),u="Checkbox",[x,h]=(0,s.f)(u),[f,p]=x(u);function g(e){let{__scopeCheckbox:n,checked:s,children:i,defaultChecked:l,disabled:o,form:c,name:d,onCheckedChange:m,required:x,value:h="on",internal_do_not_use_render:p}=e,[g,b]=(0,r.f)({prop:s,defaultProp:l??!1,onChange:m,caller:u}),[j,w]=a.useState(null),[k,N]=a.useState(null),[C,_]=a.useState(null),S=!j||!!c||!!j.closest("form"),R={checked:g,disabled:o,setChecked:b,control:j,setControl:w,name:d,form:c,value:h,userClick:C,onUserClick:_,required:x,defaultChecked:!v(l)&&l,isFormControl:S,bubbleInput:k,setBubbleInput:N};return(0,t.jsx)(f,{scope:n,...R,children:y(p)?p(R):i})}m(g,"CheckboxProvider");var b=a.forwardRef(m(function({__scopeCheckbox:e,onKeyDown:s,onClick:r,...l},o){let{control:d,value:u,disabled:x,checked:h,required:f,setControl:g,setChecked:b,onUserClick:j,isFormControl:w,bubbleInput:k}=p("CheckboxTrigger",e),y=(0,n.f)(o,g),C=a.useRef(h);return a.useEffect(()=>{let e=d?.form;if(e){let t=m(()=>b(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,b]),(0,t.jsx)(c.V.button,{type:"button",role:"checkbox","aria-checked":v(h)?"mixed":h,"aria-required":f,"data-state":N(h),"data-disabled":x?"":void 0,disabled:x,value:u,...l,ref:y,onKeyDown:(0,i.f)(s,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.f)(r,e=>{let t=e.isPropagationStopped();j({requestedChecked:!!v(h)||!h,hasConsumerStoppedPropagation:t}),b(e=>!!v(e)||!e),k&&w&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),j=a.forwardRef(m(function(e,a){let{__scopeCheckbox:n,name:s,checked:i,defaultChecked:r,required:l,disabled:o,value:c,onCheckedChange:d,form:m,...u}=e;return(0,t.jsx)(g,{__scopeCheckbox:n,checked:i,defaultChecked:r,disabled:o,required:l,onCheckedChange:d,name:s,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...u,ref:a,__scopeCheckbox:n}),e&&(0,t.jsx)(k,{__scopeCheckbox:n})]})})},"Checkbox")),w=a.forwardRef(m(function(e,a){let{__scopeCheckbox:n,forceMount:s,...i}=e,r=p("CheckboxIndicator",n);return(0,t.jsx)(o.f,{present:s||v(r.checked)||!0===r.checked,children:(0,t.jsx)(c.V.span,{"data-state":N(r.checked),"data-disabled":r.disabled?"":void 0,...i,ref:a,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),k=a.forwardRef(m(function({__scopeCheckbox:e,onClick:s,...r},o){let{control:d,userClick:m,checked:u,defaultChecked:x,required:h,disabled:f,name:g,value:b,form:j,bubbleInput:w,setBubbleInput:k}=p("CheckboxBubbleInput",e),y=(0,n.f)(o,k),N=(0,l.f)(d),C=a.useRef(!1),_=a.useRef(u),S=a.useRef(m),R=a.useRef(null);a.useEffect(()=>{if(!w)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=_.current!==u;_.current=u;let a=null!==m&&m!==S.current;if(S.current=m,a)R.current=t?null:m,t&&(w.indeterminate=v(u),e.call(w,!v(u)&&u)),w.dispatchEvent(new Event("click",{bubbles:!m.hasConsumerStoppedPropagation}));else if(t){let t=R.current;R.current=null;let a=t?.requestedChecked===u;C.current=!0,w.indeterminate=v(u),e.call(w,!v(u)&&u),w.dispatchEvent(new Event("click",{bubbles:!(a&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[w,u,m]);let T=a.useRef(!v(u)&&u);return(0,t.jsx)(c.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??T.current,required:h,disabled:f,name:g,value:b,form:j,...r,tabIndex:-1,ref:y,onClick:(0,i.f)(s,e=>{C.current&&e.stopPropagation()}),style:{...r.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function y(e){return"function"==typeof e}function v(e){return"indeterminate"===e}function N(e){return v(e)?"indeterminate":e?"checked":"unchecked"}m(y,"isFunction"),m(v,"isIndeterminate"),m(N,"getState");var C=e.i(689664),_=e.i(975157);let S=a.forwardRef(({className:e,...a},n)=>(0,t.jsx)(j,{ref:n,className:(0,_.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...a,children:(0,t.jsx)(w,{className:(0,_.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));S.displayName=j.displayName,e.s(["f",0,S],257428)},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:n}=(0,a.b)(),s=[n.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=s},[s])}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],711241)},474544,e=>{var t=e.i(456420);let r={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],474544)},118924,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(522016),i=e.i(975153),a=e.i(741120),s=e.i(666696),l=e.i(519455),c=e.i(912505),o=e.i(393842),d=e.i(658512),u=e.i(111110),f=e.i(215519),m=e.i(41931),x=e.i(469817),p=e.i(306831),g=e.i(201276),h=e.i(35209);let b=[1,2,4,7,15,30];e.s(["default",0,function(){let{t:e}=(0,u.b)(),{timeZone:v}=(0,f.M)();(0,h.f)(e.review.title);let[w,y]=(0,r.useState)(null),[j,k]=(0,r.useState)(1),N=(0,r.useCallback)(async e=>{try{y(await m.f.get(`/api/review/due?page=${e}&pageSize=${x.$}`))}catch(e){g.V.error("[Review]","Failed to fetch due reviews",{error:e})}},[]);(0,r.useEffect)(()=>{N(j)},[j,N]);let C=(0,p.d)(new Date,v).start;return(0,t.jsxs)("main",{className:"mx-auto max-w-6xl space-y-6 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(o.f,{title:e.review.title,description:e.review.desc,actions:w&&w.total>0&&(0,t.jsx)("span",{className:"rounded-full bg-primary/10 px-3 py-1 text-sm font-medium text-primary",children:e.review.dueCount.replace("{count}",String(w.total))})}),!w&&(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6},(e,r)=>(0,t.jsx)("div",{className:"h-52 animate-pulse rounded-2xl bg-muted"},r))}),w&&0===w.total&&(0,t.jsx)(c.f,{icon:i.f,title:e.review.empty,description:e.review.emptyHint}),w&&w.items.length>0&&(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:w.items.map(r=>{let i;return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(s.f,{item:r,selectMode:!1,selected:!1,onToggleSelect:()=>{},selectedTag:null,onTagClick:()=>{}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[(i=(0,p.r)(r.nextReviewAt,"MM/dd",v),new Date(r.nextReviewAt)<C?e.review.overdue.replace("{date}",i):e.review.dueOn.replace("{date}",i))," · ",e.review.round.replace("{round}",String(r.reviewStage+1)).replace("{total}",String(b.length))]}),(0,t.jsx)(n.default,{href:`/practice?id=${r.id}`,children:(0,t.jsxs)(l.f,{variant:"outline",size:"sm",className:"h-8",children:[(0,t.jsx)(a.f,{className:"mr-1.5 h-3.5 w-3.5"}),e.review.practice]})})]})]},r.id)})}),w&&(0,t.jsx)(d.f,{page:j,totalPages:w.totalPages,total:w.total,pageSize:w.pageSize,onPageChange:k})]})}],118924)},469937,62825,e=>{var t=e.i(843476),r=e.i(456420);let n={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};n.node;let i=(0,r.f)(n);var a=e.i(111110),s=e.i(975157);let l=[1,2,3,4,5];function c(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["f",0,function({value:e,onChange:r,disabled:n,size:c="sm",showUnrated:o=!0,className:d}){let{t:u}=(0,a.b)(),f=e??0,m="sm"===c?"h-3.5 w-3.5":"h-5 w-5",x=f?u.difficulty.starsLabel.replace("{n}",String(f)):u.difficulty.unrated;return r?(0,t.jsxs)("span",{className:(0,s.f)("inline-flex items-center gap-0.5",d),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:u.difficulty.clearHint,children:[l.map(e=>(0,t.jsx)("button",{type:"button",disabled:n,onClick:()=>r(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)(i,{className:(0,s.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,s.f)("inline-flex items-center",d),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:x,children:l.map(e=>(0,t.jsx)(i,{className:(0,s.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,s.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:"未判断"})[c(e)]},"h",0,c,"x",0,function(e,t){return(t||"").trim()?"wrong_attempt":c(e)}],62825)},846968,e=>{var t=e.i(843476),r=e.i(548161),n=e.i(474544),i=e.i(741120),a=e.i(487486),s=e.i(111110);let l={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:n.f},reviewing:{className:"bg-primary/10 text-primary",icon:i.f},mastered:{className:"bg-success/15 text-success",icon:r.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:r=""}){let{t:n}=(0,s.b)(),{className:i,icon:c}=l[e],o="mastered"===e?n.notebook.mastered:"reviewing"===e?n.notebook.reviewing:n.notebook.review;return(0,t.jsx)(a.f,{variant:"secondary",className:`${i} ${r}`,children:(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(c,{className:"h-3 w-3"})," ",o]})})}])},590546,e=>{var t=e.i(843476),r=e.i(618566),n=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:a}){let s=(0,r.useRouter)();return(0,t.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{s.push(e)},className:a,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),r=e.i(271645),n=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,x]=(0,i.f)(f),[p,g]=m(f);function h(e){let{__scopeCheckbox:n,checked:i,children:a,defaultChecked:l,disabled:c,form:o,name:d,onCheckedChange:u,required:m,value:x="on",internal_do_not_use_render:g}=e,[h,b]=(0,s.f)({prop:i,defaultProp:l??!1,onChange:u,caller:f}),[v,w]=r.useState(null),[y,N]=r.useState(null),[C,S]=r.useState(null),R=!v||!!o||!!v.closest("form"),P={checked:h,disabled:c,setChecked:b,control:v,setControl:w,name:d,form:o,value:x,userClick:C,onUserClick:S,required:m,defaultChecked:!k(l)&&l,isFormControl:R,bubbleInput:y,setBubbleInput:N};return(0,t.jsx)(p,{scope:n,...P,children:j(g)?g(P):a})}u(h,"CheckboxProvider");var b=r.forwardRef(u(function({__scopeCheckbox:e,onKeyDown:i,onClick:s,...l},c){let{control:d,value:f,disabled:m,checked:x,required:p,setControl:h,setChecked:b,onUserClick:v,isFormControl:w,bubbleInput:y}=g("CheckboxTrigger",e),j=(0,n.f)(c,h),C=r.useRef(x);return r.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":k(x)?"mixed":x,"aria-required":p,"data-state":N(x),"data-disabled":m?"":void 0,disabled:m,value:f,...l,ref:j,onKeyDown:(0,a.f)(i,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,a.f)(s,e=>{let t=e.isPropagationStopped();v({requestedChecked:!!k(x)||!x,hasConsumerStoppedPropagation:t}),b(e=>!!k(e)||!e),y&&w&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),v=r.forwardRef(u(function(e,r){let{__scopeCheckbox:n,name:i,checked:a,defaultChecked:s,required:l,disabled:c,value:o,onCheckedChange:d,form:u,...f}=e;return(0,t.jsx)(h,{__scopeCheckbox:n,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:r,__scopeCheckbox:n}),e&&(0,t.jsx)(y,{__scopeCheckbox:n})]})})},"Checkbox")),w=r.forwardRef(u(function(e,r){let{__scopeCheckbox:n,forceMount:i,...a}=e,s=g("CheckboxIndicator",n);return(0,t.jsx)(c.f,{present:i||k(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:r,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),y=r.forwardRef(u(function({__scopeCheckbox:e,onClick:i,...s},c){let{control:d,userClick:u,checked:f,defaultChecked:m,required:x,disabled:p,name:h,value:b,form:v,bubbleInput:w,setBubbleInput:y}=g("CheckboxBubbleInput",e),j=(0,n.f)(c,y),N=(0,l.f)(d),C=r.useRef(!1),S=r.useRef(f),R=r.useRef(u),P=r.useRef(null);r.useEffect(()=>{if(!w)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=S.current!==f;S.current=f;let r=null!==u&&u!==R.current;if(R.current=u,r)P.current=t?null:u,t&&(w.indeterminate=k(f),e.call(w,!k(f)&&f)),w.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(t){let t=P.current;P.current=null;let r=t?.requestedChecked===f;C.current=!0,w.indeterminate=k(f),e.call(w,!k(f)&&f),w.dispatchEvent(new Event("click",{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[w,f,u]);let E=r.useRef(!k(f)&&f);return(0,t.jsx)(o.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??E.current,required:x,disabled:p,name:h,value:b,form:v,...s,tabIndex:-1,ref:j,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 j(e){return"function"==typeof e}function k(e){return"indeterminate"===e}function N(e){return k(e)?"indeterminate":e?"checked":"unchecked"}u(j,"isFunction"),u(k,"isIndeterminate"),u(N,"getState");var C=e.i(689664),S=e.i(975157);let R=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(v,{ref:n,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),...r,children:(0,t.jsx)(w,{className:(0,S.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));R.displayName=v.displayName,e.s(["f",0,R],257428)},912505,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({icon:e,title:n,description:i,action:a,className:s}){return(0,t.jsxs)("div",{className:(0,r.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",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:n}),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),r=e.i(590546),n=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,n.f)("flex items-start gap-3",c),children:[a&&(0,t.jsx)(r.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})]})}])},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[]}}])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:n}=(0,r.b)(),i=[n.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,714073,e=>{var t=e.i(843476),s=e.i(271645),i=e.i(522016),a=e.i(618566),l=e.i(632781),r=e.i(480342),n=e.i(217255),d=e.i(519455),c=e.i(793479),o=e.i(111110),m=e.i(553753),u=e.i(201276);function h({token:e,onAlreadyInitialized:i}){let{t:r}=(0,o.b)(),x=r.auth.initialize,f=(0,a.useRouter)(),[p,j]=(0,s.useState)(x.defaultName),[g,v]=(0,s.useState)(m.J),[b,N]=(0,s.useState)(""),[y,w]=(0,s.useState)(""),[k,z]=(0,s.useState)(""),[S,C]=(0,s.useState)(!1),T=async t=>{if(t.preventDefault(),z(""),b!==y)return void z(x.passwordMismatch);if(b.length<6||b===m.v)return void z(x.passwordHint);C(!0);try{let t=await fetch("/api/initialize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,name:p,email:g,password:b})});if(!t.ok){let e=await t.json().catch(()=>({}));409===t.status&&"ALREADY_EXISTS"===e.code?z(x.emailExists):409===t.status?i():403===t.status?z(x.invalidLink):z(x.failed);return}let s=await (0,n.signIn)("credentials",{redirect:!1,email:g.trim(),password:b});if(s?.error)return void z(x.signInFailed);f.replace("/setup"),f.refresh()}catch(e){u.V.error("[Initialize]","Failed to create admin",{error:e}),z(x.failed)}finally{C(!1)}};return(0,t.jsxs)("form",{onSubmit:T,className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:x.desc}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"name",className:"text-sm font-medium",children:x.name}),(0,t.jsx)(c.f,{id:"name",value:p,onChange:e=>j(e.target.value),maxLength:50,required:!0})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"email",className:"text-sm font-medium",children:r.auth.email}),(0,t.jsx)(c.f,{id:"email",type:"email",autoComplete:"username",value:g,onChange:e=>v(e.target.value),required:!0})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"password",className:"text-sm font-medium",children:r.auth.password}),(0,t.jsx)(c.f,{id:"password",type:"password",autoComplete:"new-password",value:b,onChange:e=>N(e.target.value),minLength:6,required:!0}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x.passwordHint})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"confirmPassword",className:"text-sm font-medium",children:r.auth.confirmPassword}),(0,t.jsx)(c.f,{id:"confirmPassword",type:"password",autoComplete:"new-password",value:y,onChange:e=>w(e.target.value),minLength:6,required:!0})]}),k&&(0,t.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-center text-sm text-destructive",children:k}),(0,t.jsxs)(d.f,{type:"submit",size:"lg",className:"w-full",disabled:S,children:[S&&(0,t.jsx)(l.f,{className:"mr-2 h-4 w-4 animate-spin"}),S?x.submitting:x.submit]})]})}var x=e.i(465822),f=e.i(515288),p=e.i(35209);function j(){let{t:e}=(0,o.b)(),r=e.auth.initialize,n=(0,a.useSearchParams)().get("token")||"",[d,c]=(0,s.useState)(null);return((0,s.useEffect)(()=>{fetch("/api/register/status").then(e=>e.json()).then(e=>c(!0===e.initialized)).catch(e=>{u.V.error("[Initialize]","Failed to check initialization status",{error:e}),c(!1)})},[]),null===d)?(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(l.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):d?(0,t.jsxs)("div",{className:"space-y-4 py-2 text-center",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:r.alreadyInitialized}),(0,t.jsx)(i.default,{href:"/login",className:"text-primary hover:underline",children:r.goLogin})]}):n?(0,t.jsx)(h,{token:n,onAlreadyInitialized:()=>c(!0)}):(0,t.jsx)(x.f,{})}e.s(["default",0,function(){let{t:e}=(0,o.b)();return(0,p.f)(e.auth.initialize.pageTitle),(0,t.jsx)(r.f,{children:(0,t.jsxs)(f.N,{className:"w-full rounded-2xl border-0 shadow-xl shadow-indigo-500/5 ring-1 ring-border",children:[(0,t.jsx)(f.Y,{children:(0,t.jsx)(f.v,{className:"text-2xl text-center",children:e.auth.initialize.title})}),(0,t.jsx)(f.O,{children:(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(l.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),children:(0,t.jsx)(j,{})})})]})})}],714073)},480342,e=>{var t=e.i(843476),s=e.i(325164),i=e.i(111110);e.s(["f",0,function({children:e,wide:a=!1}){let{t:l}=(0,i.b)();return(0,t.jsxs)("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -left-32 -top-32 h-96 w-96 rounded-full bg-indigo-400/25 blur-3xl"}),(0,t.jsx)("div",{className:"pointer-events-none absolute -bottom-40 -right-24 h-[28rem] w-[28rem] rounded-full bg-violet-400/20 blur-3xl"}),(0,t.jsxs)("div",{className:`relative w-full space-y-6 py-8 ${a?"max-w-xl":"max-w-md"}`,children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,t.jsx)(s.default,{src:"/icons/icon.png",alt:"",width:64,height:64,className:"rounded-2xl shadow-lg shadow-indigo-500/30",priority:!0,unoptimized:!0}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xl font-bold tracking-tight",children:l.pageTitle.base}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:l.app.subtitle})]})]}),e]})]})}])},465822,e=>{var t=e.i(843476),s=e.i(482022),i=e.i(456420);let a={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};a.node;let l=(0,i.f)(a);var r=e.i(111110),n=e.i(637691);e.s(["f",0,function(){let{t:e,language:i}=(0,r.b)(),a=e.auth.setupGuide,d=`${n.f}/wiki/${"en"===i?"Deployment-en":"Deployment"}`;return(0,t.jsxs)("div",{className:"space-y-2 rounded-lg border border-amber-300 bg-amber-50 p-4 text-sm text-amber-950 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-100",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(l,{className:"h-4 w-4 shrink-0"}),a.title]}),(0,t.jsx)("p",{children:a.intro}),(0,t.jsxs)("ul",{className:"list-disc space-y-1 pl-5",children:[(0,t.jsx)("li",{children:a.desktop}),(0,t.jsx)("li",{children:a.docker}),(0,t.jsx)("li",{children:a.npm}),(0,t.jsx)("li",{children:a.tokenFile})]}),(0,t.jsxs)("a",{href:d,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 font-medium underline-offset-2 hover:underline",children:[a.docs,(0,t.jsx)(s.f,{className:"h-3.5 w-3.5"})]})]})}],465822)},553753,e=>{e.s(["J",0,"admin@localhost","v",0,"123456"])},35209,e=>{var t=e.i(271645),s=e.i(111110);e.s(["f",0,function(...e){let{t:i}=(0,s.b)(),a=[i.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=a},[a])}])}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let a={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],711241)},576248,e=>{var t=e.i(456420);let a={name:"circle-question-mark",size:24,node:[["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"}]],aliases:["help-circle","circle-help"]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],576248)},77043,e=>{var t=e.i(456420);let a={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],77043)},856522,e=>{var t=e.i(456420);let a={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],856522)},328623,e=>{var t=e.i(456420);let a={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],328623)},591124,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(522016),r=e.i(618566),i=e.i(215519),l=e.i(306831),n=e.i(456420);let d={name:"clipboard-check",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]};d.node;let m=(0,n.f)(d);var c=e.i(632781),o=e.i(77043),x=e.i(395925),u=e.i(856522),f=e.i(759659),h=e.i(519455),g=e.i(793479),p=e.i(590546),b=e.i(86963),y=e.i(716327),j=e.i(456539),v=e.i(263676),N=e.i(487486),w=e.i(515288),k=e.i(511445),S=e.i(991686),C=e.i(393733),q=e.i(149704),M=e.i(741120),T=e.i(931454),R=e.i(111110),$=e.i(41931),A=e.i(201276),z=e.i(294114);function I({paperId:e,question:s,onDone:r}){let{t:i,language:l}=(0,R.b)(),[n,d]=(0,a.useState)(null),m=0===s.attempts.length&&!!s.errorItemId&&"pending"!==s.status,o="ready"===s.status&&!!s.questionText?.trim();if(!m&&!o)return null;let x=async t=>{let a="question"===t?i.exam.regenerateQuestionConfirm:i.exam.regenerateAnswerConfirm;if(await (0,z.u)(a)){d(t);try{let a=await $.f.post(`/api/exams/${e}/questions/${s.id}/regenerate`,{mode:t,language:l},{timeout:6e5,recoverable:!0});r(a)}catch(s){let e=s?.data?.message||"",a=i.errors[e];A.V.error("[ExamRegenerate]","Failed to regenerate exam question",{mode:t,code:e}),z.c.error("HAS_RESULTS"===e?i.exam.regenerateHasResults:"string"==typeof a?a:i.exam.regenerateFailed)}finally{d(null)}}};return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[m&&(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:()=>x("question"),disabled:null!==n,children:["question"===n?(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(M.f,{className:"mr-1 h-4 w-4"}),"question"===n?i.exam.regenerating:i.exam.regenerateQuestion]}),o&&(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:()=>x("answer"),disabled:null!==n,children:["answer"===n?(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(T.f,{className:"mr-1 h-4 w-4"}),"answer"===n?i.exam.regenerating:i.exam.regenerateAnswer]})]})}function E({paperId:e,question:r,editingResult:n,onResultChange:d,onDeleteAttempt:m,onRegenerated:o}){let{t:x}=(0,R.b)(),{timeZone:u}=(0,i.M)(),[f,h]=(0,a.useState)(!1),g=void 0!==n,p=(()=>{if(!r.error)return"";if("SOURCE_DELETED"===r.error)return x.exam.sourceDeleted;let e=r.error.split(":")[0].trim(),t=x.errors[e];return"string"==typeof t?t:r.error})();return(0,t.jsx)(w.N,{children:(0,t.jsxs)(w.O,{className:"space-y-3 pt-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsxs)("span",{className:"font-semibold",children:[r.order,"."]}),r.errorItemId?(0,t.jsxs)(s.default,{href:`/error-items/${r.errorItemId}`,className:"font-mono text-xs text-primary hover:underline",children:[x.exam.source," ",r.sourceShortId]}):(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[r.sourceShortId," · ",x.exam.sourceDeleted]}),r.notebookName&&(0,t.jsx)(N.f,{variant:"secondary",children:r.notebookName})]}),r.attempts.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:r.attempts.map((e,a)=>(0,t.jsxs)(N.f,{variant:"outline",className:`gap-1 font-normal ${S.x[e.result]||""}`,children:[(0,t.jsx)("span",{children:x.exam.attemptLabel.replace("{n}",String(a+1))}),(0,t.jsx)("span",{className:"tabular-nums",children:(0,l.r)(e.createdAt,"MM-dd",u)}),(0,t.jsx)("span",{className:"font-semibold",children:x.mastery.results[e.result]}),g&&m&&(0,t.jsx)("button",{type:"button","aria-label":x.mastery.deleteRecord,className:"-mr-1 rounded hover:bg-black/10",onClick:()=>m(e.id),children:(0,t.jsx)(v.X,{className:"h-3 w-3"})})]},e.id))}),"pending"===r.status&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(c.f,{className:"h-4 w-4 animate-spin"}),x.exam.questionPending]}),"failed"===r.status&&(0,t.jsxs)("p",{className:"text-sm text-destructive",children:[x.exam.questionFailed,p?`${x.common.colon}${p}`:""]}),"ready"===r.status&&r.questionText&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k.f,{content:r.questionText}),(0,t.jsx)(q.f,{svg:r.figureSvg}),(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>h(!f),children:[f?(0,t.jsx)(j.f,{className:"h-3 w-3"}):(0,t.jsx)(y.f,{className:"h-3 w-3"}),x.exam.showAnswer]}),f&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[r.answerText&&(0,t.jsx)(k.f,{content:r.answerText,className:"font-semibold"}),r.analysis&&(0,t.jsx)(k.f,{content:r.analysis})]})]}),!g&&o&&(0,t.jsx)(I,{paperId:e,question:r,onDone:o}),g&&"ready"===r.status&&r.errorItemId&&d&&(0,t.jsx)(C.f,{value:n,onChange:d,size:"sm"})]})})}var H=e.i(663661),D=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,i.M)(),n=(0,r.useParams)(),d=(0,r.useRouter)(),{t:y,language:j}=(0,R.b)(),v=n.id,[N,w]=(0,a.useState)(null);(0,D.f)(y.exam.title,N?.title);let[k,S]=(0,a.useState)(!1),[C,q]=(0,a.useState)(null),[M,T]=(0,a.useState)((0,l.r)(new Date,"yyyy-MM-dd",e)),[A,I]=(0,a.useState)(!1),[F,U]=(0,a.useState)(null),O=(0,a.useCallback)(async()=>{try{w(await $.f.get(`/api/exams/${v}`))}catch{S(!0)}},[v]);if((0,a.useEffect)(()=>{O()},[O]),(0,a.useEffect)(()=>{if(N?.status!=="generating")return;let e=setTimeout(O,3e3);return()=>clearTimeout(e)},[N,O]),k)return(0,t.jsx)("div",{className:"p-8 text-center",children:y.exam.notFound});if(!N)return(0,t.jsx)(b.f,{label:y.common.loading});let _=N.questions.filter(e=>"ready"===e.status).length,P=N.questions.some(e=>e.attempts.length>0),V=N.questions.some(e=>"failed"===e.status),K=N.questions.filter(e=>"ready"===e.status&&e.errorItemId),L=C?K.filter(e=>C[e.id]).length:0,B=async()=>{if(C&&0!==L){I(!0),U(null);try{await $.f.post(`/api/exams/${N.id}/results`,{takenAt:(0,l.$)(M,e),results:K.filter(e=>C[e.id]).map(e=>({questionId:e.id,result:C[e.id]}))}),q(null),U(y.exam.resultsSaved),await O()}catch{U(y.exam.resultsSaveFailed)}finally{I(!1)}}},Q=async e=>{if(await (0,z.u)(y.mastery.deleteRecordConfirm,{destructive:!0}))try{await $.f.delete(`/api/practice/record/${e}`),await O()}catch{U(y.mastery.deleteRecordFailed)}},Y=async()=>{await $.f.post(`/api/exams/${N.id}/retry`,{language:j}),await O()},X=async()=>{await (0,z.u)(y.exam.deleteConfirm,{destructive:!0})&&(await $.f.delete(`/api/exams/${N.id}`),d.push("/exams"))};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 pb-24",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(p.f,{fallbackUrl:"/exams",className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,t.jsx)("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight break-words",children:N.title}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(H.f,{status:N.status,recorded:P}),(0,t.jsx)("span",{children:y.exam.progress.replace("{ready}",String(_)).replace("{total}",String(N.questions.length))}),(0,t.jsx)("span",{children:(0,l.r)(N.createdAt,"yyyy-MM-dd HH:mm",e)})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(s.default,{href:`/exams/${N.id}/print`,children:(0,t.jsxs)(h.f,{variant:"outline",size:"sm",disabled:0===_,children:[(0,t.jsx)(o.f,{className:"mr-2 h-4 w-4"}),y.exam.print]})}),!C&&K.length>0&&(0,t.jsxs)(h.f,{size:"sm",onClick:()=>{U(null),q({}),T((0,l.r)(new Date,"yyyy-MM-dd",e))},children:[(0,t.jsx)(m,{className:"mr-2 h-4 w-4"}),y.exam.recordResults]}),V&&"generating"!==N.status&&(0,t.jsxs)(h.f,{variant:"outline",size:"sm",onClick:Y,children:[(0,t.jsx)(x.f,{className:"mr-2 h-4 w-4"}),y.exam.retryFailed]}),(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:X,className:"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-950/40 sm:ml-auto",children:[(0,t.jsx)(f.f,{className:"mr-2 h-4 w-4"}),y.exam.delete]})]}),N.questions.length<N.requestedCount&&(0,t.jsx)("p",{className:"rounded-md border border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-950/40 p-3 text-sm text-amber-800 dark:text-amber-200",children:y.exam.fewerThanRequested.replaceAll("{actual}",String(N.questions.length))}),F&&(0,t.jsx)("p",{className:"rounded-md border p-3 text-sm",children:F}),C&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border bg-muted/30 p-3",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,t.jsx)("label",{htmlFor:"exam-taken-at",className:"text-sm font-medium",children:y.exam.takenAt}),(0,t.jsx)(g.f,{id:"exam-taken-at",type:"date",value:M,onChange:e=>T(e.target.value),className:"sm:w-48"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y.exam.recordHint})]}),(0,t.jsx)("div",{className:"space-y-3",children:N.questions.map(e=>(0,t.jsx)(E,{paperId:N.id,question:e,editingResult:C?C[e.id]??null:void 0,onResultChange:t=>q(a=>a?{...a,[e.id]:t}:a),onDeleteAttempt:Q,onRegenerated:O},e.id))}),C&&(0,t.jsx)("div",{className:"fixed inset-x-0 bottom-16 z-30 border-t bg-background/95 p-3 backdrop-blur md:bottom-0",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-end gap-2",children:[0===L&&(0,t.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:y.exam.noResultSelected}),(0,t.jsx)(h.f,{variant:"outline",onClick:()=>q(null),disabled:A,children:y.exam.cancel}),(0,t.jsxs)(h.f,{onClick:B,disabled:A||!M||0===L,children:[A?(0,t.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(u.f,{className:"mr-2 h-4 w-4"}),y.exam.saveResults]})]})})]})})}],591124)},663661,e=>{var t=e.i(843476),a=e.i(487486),s=e.i(111110);let r={generating:"bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 border-blue-200 dark:border-blue-900",ready:"bg-indigo-100 dark:bg-indigo-900/40 text-indigo-700 dark:text-indigo-300 border-indigo-200 dark:border-indigo-900",partial:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900",failed:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",completed:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900"};e.s(["f",0,function({status:e,recorded:i}){let{t:l}=(0,s.b)(),n=i&&("ready"===e||"partial"===e)?"completed":e;return(0,t.jsx)(a.f,{variant:"outline",className:r[n],children:l.exam.status[n]})}])},991686,931454,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(522016),r=e.i(215519),i=e.i(306831),l=e.i(716327),n=e.i(456539),d=e.i(632781),m=e.i(77071),c=e.i(328623),o=e.i(759659),x=e.i(487486),u=e.i(519455),f=e.i(515288),h=e.i(511445),g=e.i(856522),p=e.i(793479),b=e.i(393733),y=e.i(111110),j=e.i(41931);function v({errorItemId:e,onSaved:s,onCancel:l}){let{t:n}=(0,y.b)(),{timeZone:m}=(0,r.M)(),c=(0,i.r)(new Date,"yyyy-MM-dd",m),[o,x]=(0,a.useState)(null),[f,h]=(0,a.useState)(c),[N,w]=(0,a.useState)(!1),[k,S]=(0,a.useState)(null),C=async()=>{if(o&&f){w(!0),S(null);try{await j.f.post("/api/practice/record",{errorItemId:e,result:o,source:"manual",takenAt:(0,i.$)(f,m)}),s()}catch{S(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)(b.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)(p.f,{id:`practice-date-${e}`,type:"date",value:f,max:c,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:C,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)(g.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),k=e.i(905110);let S={correct:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900",wrong:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",not_attempted:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900"};e.s(["K",0,function({errorItemId:e,onMasteryStatusChange:g}){let{timeZone:p}=(0,r.M)(),{t:b}=(0,y.b)(),[C,q]=(0,a.useState)(null),[M,T]=(0,a.useState)(null),[R,$]=(0,a.useState)(0),[A,z]=(0,a.useState)(!1),I=(0,a.useCallback)(()=>{j.f.get(`/api/error-items/${e}/practice-records`).then(e=>{q(e),g?.(e.masteryStatus)}).catch(()=>void 0)},[e,g]);(0,a.useEffect)(I,[I]);let E=()=>{$(0),I()},H=async e=>{if(await (0,w.u)(b.mastery.deleteRecordConfirm,{destructive:!0}))try{await j.f.delete(`/api/practice/record/${e}`),E()}catch{w.c.error(b.mastery.deleteRecordFailed)}},D=C?.records[0],F=!!D&&(!C?.masteryEvaluatedAt||new Date(D.createdAt)>new Date(C.masteryEvaluatedAt));if((0,a.useEffect)(()=>{if(!F||R>=20)return;let e=setTimeout(()=>{$(e=>e+1),I()},4e3);return()=>clearTimeout(e)},[F,R,I]),!C)return null;let U=C.masteryProbability,O=null===U?null:Math.round(100*U),_=null===O?"":(0,k.m)(U,C.masteryThreshold)?"bg-green-500":O>=30?"bg-amber-500":"bg-red-500",P=b.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)(c.f,{className:"h-4 w-4 text-primary"}),b.mastery.probability]})}),(0,t.jsxs)(f.O,{className:"space-y-4",children:[null===O?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:F?b.mastery.pending:b.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:[O,"%"]}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[F&&(0,t.jsx)(d.f,{className:"h-3 w-3 animate-spin"}),(0,t.jsx)(x.f,{variant:"outline",children:"ai"===C.masterySource?b.mastery.aiEvaluated:b.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 ${_} transition-all`,style:{width:`${O}%`}})}),C.masteryReason&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:C.masteryReason}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.mastery.thresholdHint.replace("{threshold}",String(C.masteryThreshold))})]}),(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:b.mastery.history}),!A&&(0,t.jsxs)(u.f,{variant:"outline",size:"sm",onClick:()=>z(!0),children:[(0,t.jsx)(m.f,{className:"mr-1 h-4 w-4"}),b.mastery.addRecord]})]}),A&&(0,t.jsx)(v,{errorItemId:e,onCancel:()=>z(!1),onSaved:()=>{z(!1),E()}}),0===C.records.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:b.mastery.noHistory}):(0,t.jsx)("ul",{className:"divide-y rounded-md border",children:C.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:()=>T(M===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",p)}),(0,t.jsx)(x.f,{variant:"outline",className:S[e.result]||"",children:b.mastery.results[e.result]||e.result}),e.difficulty&&(0,t.jsx)(x.f,{variant:"secondary",children:P[e.difficulty]||e.difficulty}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.exam?`${b.mastery.sources.exam} \xb7 ${e.exam.title}`:b.mastery.sources[e.source]||b.mastery.sources.practice}),e.questionText&&(0,t.jsx)("span",{className:"ml-auto text-muted-foreground",children:M===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":b.mastery.deleteRecord,title:b.mastery.deleteRecord,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-red-50 dark:hover:bg-red-950/40 hover:text-red-600 dark:hover:text-red-400",onClick:()=>H(e.id),children:(0,t.jsx)(o.f,{className:"h-4 w-4"})})]}),M===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:b.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:b.editor.mistakeAnalysis}),(0,t.jsx)(h.f,{content:e.mistakeAnalysis})]}),e.originalImageUrl&&(0,t.jsx)("img",{src:e.originalImageUrl,alt:b.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)(s.default,{href:`/exams/${e.exam.paperId}`,className:"text-xs text-primary hover:underline",children:e.exam.title})]})]},e.id))})]})]})]})},"x",0,S],991686);var C=e.i(534693);e.s(["f",()=>C.f],931454)},393733,e=>{var t=e.i(843476),a=e.i(548161),s=e.i(576248),r=e.i(583967),i=e.i(111110);let l=[{value:"correct",icon:a.f,active:"border-green-600 bg-green-50 dark:bg-green-950/40 text-green-700 dark:text-green-300"},{value:"wrong",icon:r.f,active:"border-red-600 bg-red-50 dark:bg-red-950/40 text-red-700 dark:text-red-300"},{value:"not_attempted",icon:s.f,active:"border-amber-600 bg-amber-50 dark:bg-amber-950/40 text-amber-700 dark:text-amber-300"}];e.s(["f",0,function({value:e,onChange:a,disabled:s,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:m})=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":e===i,disabled:s,onClick:()=>a(i),className:`flex items-center justify-center gap-1 rounded-md border font-medium transition-colors disabled:opacity-60 ${d} ${e===i?m:"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))})}])},149704,e=>{var t=e.i(843476),a=e.i(111110),s=e.i(975157);e.s(["f",0,function({svg:e,className:r}){let{t:i}=(0,a.b)();return e?(0,t.jsx)("figure",{className:(0,s.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)},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let l=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{l.push(e)},className:i,children:(0,t.jsx)(r.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})}])},86963,e=>{var t=e.i(843476),a=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(a.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),r=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let a={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],711241)},576248,e=>{var t=e.i(456420);let a={name:"circle-question-mark",size:24,node:[["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"}]],aliases:["help-circle","circle-help"]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],576248)},77043,e=>{var t=e.i(456420);let a={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],77043)},856522,e=>{var t=e.i(456420);let a={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],856522)},328623,e=>{var t=e.i(456420);let a={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],328623)},591124,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(522016),r=e.i(618566),i=e.i(215519),l=e.i(306831),n=e.i(456420);let d={name:"clipboard-check",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]};d.node;let m=(0,n.f)(d);var c=e.i(632781),o=e.i(77043),x=e.i(395925),u=e.i(856522),f=e.i(759659),h=e.i(519455),g=e.i(793479),p=e.i(590546),b=e.i(86963),y=e.i(716327),j=e.i(456539),v=e.i(263676),N=e.i(487486),k=e.i(515288),w=e.i(511445),S=e.i(991686),C=e.i(393733),q=e.i(149704),M=e.i(741120),T=e.i(931454),R=e.i(111110),$=e.i(41931),A=e.i(201276),z=e.i(294114);function I({paperId:e,question:s,onDone:r}){let{t:i,language:l}=(0,R.b)(),[n,d]=(0,a.useState)(null),m=0===s.attempts.length&&!!s.errorItemId&&"pending"!==s.status,o="ready"===s.status&&!!s.questionText?.trim();if(!m&&!o)return null;let x=async t=>{let a="question"===t?i.exam.regenerateQuestionConfirm:i.exam.regenerateAnswerConfirm;if(await (0,z.u)(a)){d(t);try{let a=await $.f.post(`/api/exams/${e}/questions/${s.id}/regenerate`,{mode:t,language:l},{timeout:6e5,recoverable:!0});r(a)}catch(s){let e=s?.data?.message||"",a=i.errors[e];A.V.error("[ExamRegenerate]","Failed to regenerate exam question",{mode:t,code:e}),z.c.error("HAS_RESULTS"===e?i.exam.regenerateHasResults:"string"==typeof a?a:i.exam.regenerateFailed)}finally{d(null)}}};return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[m&&(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:()=>x("question"),disabled:null!==n,children:["question"===n?(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(M.f,{className:"mr-1 h-4 w-4"}),"question"===n?i.exam.regenerating:i.exam.regenerateQuestion]}),o&&(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:()=>x("answer"),disabled:null!==n,children:["answer"===n?(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(T.f,{className:"mr-1 h-4 w-4"}),"answer"===n?i.exam.regenerating:i.exam.regenerateAnswer]})]})}function E({paperId:e,question:r,editingResult:n,onResultChange:d,onDeleteAttempt:m,onRegenerated:o}){let{t:x}=(0,R.b)(),{timeZone:u}=(0,i.M)(),[f,h]=(0,a.useState)(!1),g=void 0!==n,p=(()=>{if(!r.error)return"";if("SOURCE_DELETED"===r.error)return x.exam.sourceDeleted;let e=r.error.split(":")[0].trim(),t=x.errors[e];return"string"==typeof t?t:r.error})();return(0,t.jsx)(k.N,{children:(0,t.jsxs)(k.O,{className:"space-y-3 pt-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsxs)("span",{className:"font-semibold",children:[r.order,"."]}),r.errorItemId?(0,t.jsxs)(s.default,{href:`/error-items/${r.errorItemId}`,className:"font-mono text-xs text-primary hover:underline",children:[x.exam.source," ",r.sourceShortId]}):(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[r.sourceShortId," · ",x.exam.sourceDeleted]}),r.notebookName&&(0,t.jsx)(N.f,{variant:"secondary",children:r.notebookName})]}),r.attempts.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:r.attempts.map((e,a)=>(0,t.jsxs)(N.f,{variant:"outline",className:`gap-1 font-normal ${S.x[e.result]||""}`,children:[(0,t.jsx)("span",{children:x.exam.attemptLabel.replace("{n}",String(a+1))}),(0,t.jsx)("span",{className:"tabular-nums",children:(0,l.r)(e.createdAt,"MM-dd",u)}),(0,t.jsx)("span",{className:"font-semibold",children:x.mastery.results[e.result]}),g&&m&&(0,t.jsx)("button",{type:"button","aria-label":x.mastery.deleteRecord,className:"-mr-1 rounded hover:bg-black/10",onClick:()=>m(e.id),children:(0,t.jsx)(v.X,{className:"h-3 w-3"})})]},e.id))}),"pending"===r.status&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(c.f,{className:"h-4 w-4 animate-spin"}),x.exam.questionPending]}),"failed"===r.status&&(0,t.jsxs)("p",{className:"text-sm text-destructive",children:[x.exam.questionFailed,p?`${x.common.colon}${p}`:""]}),"ready"===r.status&&r.questionText&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.f,{content:r.questionText}),(0,t.jsx)(q.f,{svg:r.figureSvg}),(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>h(!f),children:[f?(0,t.jsx)(j.f,{className:"h-3 w-3"}):(0,t.jsx)(y.f,{className:"h-3 w-3"}),x.exam.showAnswer]}),f&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[r.answerText&&(0,t.jsx)(w.f,{content:r.answerText,className:"font-semibold"}),r.analysis&&(0,t.jsx)(w.f,{content:r.analysis})]})]}),!g&&o&&(0,t.jsx)(I,{paperId:e,question:r,onDone:o}),g&&"ready"===r.status&&r.errorItemId&&d&&(0,t.jsx)(C.f,{value:n,onChange:d,size:"sm"})]})})}var H=e.i(663661),D=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,i.M)(),n=(0,r.useParams)(),d=(0,r.useRouter)(),{t:y,language:j}=(0,R.b)(),v=n.id,[N,k]=(0,a.useState)(null);(0,D.f)(y.exam.title,N?.title);let[w,S]=(0,a.useState)(!1),[C,q]=(0,a.useState)(null),[M,T]=(0,a.useState)((0,l.r)(new Date,"yyyy-MM-dd",e)),[A,I]=(0,a.useState)(!1),[F,U]=(0,a.useState)(null),V=(0,a.useCallback)(async()=>{try{k(await $.f.get(`/api/exams/${v}`))}catch{S(!0)}},[v]);if((0,a.useEffect)(()=>{V()},[V]),(0,a.useEffect)(()=>{if(N?.status!=="generating")return;let e=setTimeout(V,3e3);return()=>clearTimeout(e)},[N,V]),w)return(0,t.jsx)("div",{className:"p-8 text-center",children:y.exam.notFound});if(!N)return(0,t.jsx)(b.f,{label:y.common.loading});let O=N.questions.filter(e=>"ready"===e.status).length,P=N.questions.some(e=>e.attempts.length>0),_=N.questions.some(e=>"failed"===e.status),K=N.questions.filter(e=>"ready"===e.status&&e.errorItemId),L=C?K.filter(e=>C[e.id]).length:0,B=async()=>{if(C&&0!==L){I(!0),U(null);try{await $.f.post(`/api/exams/${N.id}/results`,{takenAt:(0,l.$)(M,e),results:K.filter(e=>C[e.id]).map(e=>({questionId:e.id,result:C[e.id]}))}),q(null),U(y.exam.resultsSaved),await V()}catch{U(y.exam.resultsSaveFailed)}finally{I(!1)}}},Q=async e=>{if(await (0,z.u)(y.mastery.deleteRecordConfirm,{destructive:!0}))try{await $.f.delete(`/api/practice/record/${e}`),await V()}catch{U(y.mastery.deleteRecordFailed)}},W=async()=>{await $.f.post(`/api/exams/${N.id}/retry`,{language:j}),await V()},X=async()=>{await (0,z.u)(y.exam.deleteConfirm,{destructive:!0})&&(await $.f.delete(`/api/exams/${N.id}`),d.push("/exams"))};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 pb-24",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(p.f,{fallbackUrl:"/exams",className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,t.jsx)("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight break-words",children:N.title}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(H.f,{status:N.status,recorded:P}),(0,t.jsx)("span",{children:y.exam.progress.replace("{ready}",String(O)).replace("{total}",String(N.questions.length))}),(0,t.jsx)("span",{children:(0,l.r)(N.createdAt,"yyyy-MM-dd HH:mm",e)})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(s.default,{href:`/exams/${N.id}/print`,children:(0,t.jsxs)(h.f,{variant:"outline",size:"sm",disabled:0===O,children:[(0,t.jsx)(o.f,{className:"mr-2 h-4 w-4"}),y.exam.print]})}),!C&&K.length>0&&(0,t.jsxs)(h.f,{size:"sm",onClick:()=>{U(null),q({}),T((0,l.r)(new Date,"yyyy-MM-dd",e))},children:[(0,t.jsx)(m,{className:"mr-2 h-4 w-4"}),y.exam.recordResults]}),_&&"generating"!==N.status&&(0,t.jsxs)(h.f,{variant:"outline",size:"sm",onClick:W,children:[(0,t.jsx)(x.f,{className:"mr-2 h-4 w-4"}),y.exam.retryFailed]}),(0,t.jsxs)(h.f,{variant:"ghost",size:"sm",onClick:X,className:"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-950/40 sm:ml-auto",children:[(0,t.jsx)(f.f,{className:"mr-2 h-4 w-4"}),y.exam.delete]})]}),N.questions.length<N.requestedCount&&(0,t.jsx)("p",{className:"rounded-md border border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-950/40 p-3 text-sm text-amber-800 dark:text-amber-200",children:y.exam.fewerThanRequested.replaceAll("{actual}",String(N.questions.length))}),F&&(0,t.jsx)("p",{className:"rounded-md border p-3 text-sm",children:F}),C&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border bg-muted/30 p-3",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,t.jsx)("label",{htmlFor:"exam-taken-at",className:"text-sm font-medium",children:y.exam.takenAt}),(0,t.jsx)(g.f,{id:"exam-taken-at",type:"date",value:M,onChange:e=>T(e.target.value),className:"sm:w-48"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y.exam.recordHint})]}),(0,t.jsx)("div",{className:"space-y-3",children:N.questions.map(e=>(0,t.jsx)(E,{paperId:N.id,question:e,editingResult:C?C[e.id]??null:void 0,onResultChange:t=>q(a=>a?{...a,[e.id]:t}:a),onDeleteAttempt:Q,onRegenerated:V},e.id))}),C&&(0,t.jsx)("div",{className:"fixed inset-x-0 bottom-16 z-30 border-t bg-background/95 p-3 backdrop-blur md:bottom-0",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-end gap-2",children:[0===L&&(0,t.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:y.exam.noResultSelected}),(0,t.jsx)(h.f,{variant:"outline",onClick:()=>q(null),disabled:A,children:y.exam.cancel}),(0,t.jsxs)(h.f,{onClick:B,disabled:A||!M||0===L,children:[A?(0,t.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(u.f,{className:"mr-2 h-4 w-4"}),y.exam.saveResults]})]})})]})})}],591124)},663661,e=>{var t=e.i(843476),a=e.i(487486),s=e.i(111110);let r={generating:"bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 border-blue-200 dark:border-blue-900",ready:"bg-indigo-100 dark:bg-indigo-900/40 text-indigo-700 dark:text-indigo-300 border-indigo-200 dark:border-indigo-900",partial:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900",failed:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",completed:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900"};e.s(["f",0,function({status:e,recorded:i}){let{t:l}=(0,s.b)(),n=i&&("ready"===e||"partial"===e)?"completed":e;return(0,t.jsx)(a.f,{variant:"outline",className:r[n],children:l.exam.status[n]})}])},991686,931454,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(522016),r=e.i(215519),i=e.i(306831),l=e.i(716327),n=e.i(456539),d=e.i(632781),m=e.i(77071),c=e.i(328623),o=e.i(759659),x=e.i(487486),u=e.i(519455),f=e.i(515288),h=e.i(511445),g=e.i(856522),p=e.i(793479),b=e.i(393733),y=e.i(111110),j=e.i(41931);function v({errorItemId:e,onSaved:s,onCancel:l}){let{t:n}=(0,y.b)(),{timeZone:m}=(0,r.M)(),c=(0,i.r)(new Date,"yyyy-MM-dd",m),[o,x]=(0,a.useState)(null),[f,h]=(0,a.useState)(c),[N,k]=(0,a.useState)(!1),[w,S]=(0,a.useState)(null),C=async()=>{if(o&&f){k(!0),S(null);try{await j.f.post("/api/practice/record",{errorItemId:e,result:o,source:"manual",takenAt:(0,i.$)(f,m)}),s()}catch{S(n.mastery.resultSaveFailed)}finally{k(!1)}}};return(0,t.jsxs)("div",{className:"space-y-3 rounded-md border bg-muted/30 p-3",children:[(0,t.jsx)(b.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)(p.f,{id:`practice-date-${e}`,type:"date",value:f,max:c,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:C,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)(g.f,{className:"mr-2 h-4 w-4"}),n.mastery.saveResult]})]})]}),w&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:w})]})}var N=e.i(149704),k=e.i(294114),w=e.i(905110);let S={correct:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900",wrong:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",not_attempted:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900"};e.s(["K",0,function({errorItemId:e,onMasteryStatusChange:g}){let{timeZone:p}=(0,r.M)(),{t:b}=(0,y.b)(),[C,q]=(0,a.useState)(null),[M,T]=(0,a.useState)(null),[R,$]=(0,a.useState)(0),[A,z]=(0,a.useState)(!1),I=(0,a.useCallback)(()=>{j.f.get(`/api/error-items/${e}/practice-records`).then(e=>{q(e),g?.(e.masteryStatus)}).catch(()=>void 0)},[e,g]);(0,a.useEffect)(I,[I]);let E=()=>{$(0),I()},H=async e=>{if(await (0,k.u)(b.mastery.deleteRecordConfirm,{destructive:!0}))try{await j.f.delete(`/api/practice/record/${e}`),E()}catch{k.c.error(b.mastery.deleteRecordFailed)}},D=C?.records[0],F=!!D&&(!C?.masteryEvaluatedAt||new Date(D.createdAt)>new Date(C.masteryEvaluatedAt));if((0,a.useEffect)(()=>{if(!F||R>=20)return;let e=setTimeout(()=>{$(e=>e+1),I()},4e3);return()=>clearTimeout(e)},[F,R,I]),!C)return null;let U=C.masteryProbability,V=null===U?null:Math.round(100*U),O=null===V?"":(0,w.m)(U,C.masteryThreshold)?"bg-green-500":V>=30?"bg-amber-500":"bg-red-500",P=b.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)(c.f,{className:"h-4 w-4 text-primary"}),b.mastery.probability]})}),(0,t.jsxs)(f.O,{className:"space-y-4",children:[null===V?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:F?b.mastery.pending:b.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:[V,"%"]}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[F&&(0,t.jsx)(d.f,{className:"h-3 w-3 animate-spin"}),(0,t.jsx)(x.f,{variant:"outline",children:"ai"===C.masterySource?b.mastery.aiEvaluated:b.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 ${O} transition-all`,style:{width:`${V}%`}})}),C.masteryReason&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:C.masteryReason}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.mastery.thresholdHint.replace("{threshold}",String(C.masteryThreshold))})]}),(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:b.mastery.history}),!A&&(0,t.jsxs)(u.f,{variant:"outline",size:"sm",onClick:()=>z(!0),children:[(0,t.jsx)(m.f,{className:"mr-1 h-4 w-4"}),b.mastery.addRecord]})]}),A&&(0,t.jsx)(v,{errorItemId:e,onCancel:()=>z(!1),onSaved:()=>{z(!1),E()}}),0===C.records.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:b.mastery.noHistory}):(0,t.jsx)("ul",{className:"divide-y rounded-md border",children:C.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:()=>T(M===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",p)}),(0,t.jsx)(x.f,{variant:"outline",className:S[e.result]||"",children:b.mastery.results[e.result]||e.result}),e.difficulty&&(0,t.jsx)(x.f,{variant:"secondary",children:P[e.difficulty]||e.difficulty}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.exam?`${b.mastery.sources.exam} \xb7 ${e.exam.title}`:b.mastery.sources[e.source]||b.mastery.sources.practice}),e.questionText&&(0,t.jsx)("span",{className:"ml-auto text-muted-foreground",children:M===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":b.mastery.deleteRecord,title:b.mastery.deleteRecord,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-red-50 dark:hover:bg-red-950/40 hover:text-red-600 dark:hover:text-red-400",onClick:()=>H(e.id),children:(0,t.jsx)(o.f,{className:"h-4 w-4"})})]}),M===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:b.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:b.editor.mistakeAnalysis}),(0,t.jsx)(h.f,{content:e.mistakeAnalysis})]}),e.originalImageUrl&&(0,t.jsx)("img",{src:e.originalImageUrl,alt:b.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)(s.default,{href:`/exams/${e.exam.paperId}`,className:"text-xs text-primary hover:underline",children:e.exam.title})]})]},e.id))})]})]})]})},"x",0,S],991686);var C=e.i(534693);e.s(["f",()=>C.f],931454)},393733,e=>{var t=e.i(843476),a=e.i(548161),s=e.i(576248),r=e.i(583967),i=e.i(111110);let l=[{value:"correct",icon:a.f,active:"border-green-600 bg-green-50 dark:bg-green-950/40 text-green-700 dark:text-green-300"},{value:"wrong",icon:r.f,active:"border-red-600 bg-red-50 dark:bg-red-950/40 text-red-700 dark:text-red-300"},{value:"not_attempted",icon:s.f,active:"border-amber-600 bg-amber-50 dark:bg-amber-950/40 text-amber-700 dark:text-amber-300"}];e.s(["f",0,function({value:e,onChange:a,disabled:s,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:m})=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":e===i,disabled:s,onClick:()=>a(i),className:`flex items-center justify-center gap-1 rounded-md border font-medium transition-colors disabled:opacity-60 ${d} ${e===i?m:"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))})}])},149704,184110,e=>{var t=e.i(843476),a=e.i(111110);function s(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}function r(e){return s(e)?e:100}e.s(["n",0,100,"a",0,200,"_",0,10,"x",0,s,"V",0,r],184110);var i=e.i(975157);e.s(["f",0,function({svg:e,scale:s,className:l}){let{t:n}=(0,a.b)();if(!e)return null;let d=r(s);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",l),children:(0,t.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:n.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360,zoom:d/100,maxWidth:`${Math.min(d,100)}%`}})})}],149704)},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let l=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{l.push(e)},className:i,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},86963,e=>{var t=e.i(843476),a=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(a.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),r=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let s={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],711241)},576248,e=>{var t=e.i(456420);let s={name:"circle-question-mark",size:24,node:[["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"}]],aliases:["help-circle","circle-help"]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],576248)},474544,e=>{var t=e.i(456420);let s={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],474544)},856522,e=>{var t=e.i(456420);let s={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],856522)},328623,e=>{var t=e.i(456420);let s={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],328623)},469937,62825,e=>{var t=e.i(843476),s=e.i(456420);let a={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};a.node;let r=(0,s.f)(a);var n=e.i(111110),i=e.i(975157);let l=[1,2,3,4,5];function d(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["f",0,function({value:e,onChange:s,disabled:a,size:d="sm",showUnrated:c=!0,className:o}){let{t:m}=(0,n.b)(),u=e??0,x="sm"===d?"h-3.5 w-3.5":"h-5 w-5",f=u?m.difficulty.starsLabel.replace("{n}",String(u)):m.difficulty.unrated;return s?(0,t.jsxs)("span",{className:(0,i.f)("inline-flex items-center gap-0.5",o),role:"group","aria-label":`${m.difficulty.label}${m.common.colon}${f}`,title:m.difficulty.clearHint,children:[l.map(e=>(0,t.jsx)("button",{type:"button",disabled:a,onClick:()=>s(e===u?null:e),"aria-label":m.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,i.f)(x,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&c&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:m.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,i.f)("inline-flex items-center",o),role:"img","aria-label":`${m.difficulty.label}${m.common.colon}${f}`,title:f,children:l.map(e=>(0,t.jsx)(r,{className:(0,i.f)(x,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):c?(0,t.jsx)("span",{className:(0,i.f)("text-xs text-muted-foreground",o),children:m.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:"未判断"})[d(e)]},"h",0,d,"x",0,function(e,t){return(t||"").trim()?"wrong_attempt":d(e)}],62825)},991686,931454,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(716327),l=e.i(456539),d=e.i(632781),c=e.i(77071),o=e.i(328623),m=e.i(759659),u=e.i(487486),x=e.i(519455),f=e.i(515288),g=e.i(511445),h=e.i(856522),p=e.i(793479),b=e.i(393733),y=e.i(111110),v=e.i(41931);function j({errorItemId:e,onSaved:a,onCancel:i}){let{t:l}=(0,y.b)(),{timeZone:c}=(0,r.M)(),o=(0,n.r)(new Date,"yyyy-MM-dd",c),[m,u]=(0,s.useState)(null),[f,g]=(0,s.useState)(o),[N,w]=(0,s.useState)(!1),[k,$]=(0,s.useState)(null),S=async()=>{if(m&&f){w(!0),$(null);try{await v.f.post("/api/practice/record",{errorItemId:e,result:m,source:"manual",takenAt:(0,n.$)(f,c)}),a()}catch{$(l.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)(b.f,{value:m,onChange:u,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:l.mastery.recordDate}),(0,t.jsx)(p.f,{id:`practice-date-${e}`,type:"date",value:f,max:o,onChange:e=>g(e.target.value),className:"sm:w-48"}),(0,t.jsxs)("div",{className:"flex gap-2 sm:ml-auto",children:[(0,t.jsx)(x.f,{variant:"outline",size:"sm",onClick:i,disabled:N,className:"flex-1 sm:flex-none",children:l.exam.cancel}),(0,t.jsxs)(x.f,{size:"sm",onClick:S,disabled:N||!m||!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)(h.f,{className:"mr-2 h-4 w-4"}),l.mastery.saveResult]})]})]}),k&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:k})]})}var N=e.i(149704),w=e.i(294114),k=e.i(905110);let $={correct:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900",wrong:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",not_attempted:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900"};e.s(["K",0,function({errorItemId:e,onMasteryStatusChange:h}){let{timeZone:p}=(0,r.M)(),{t:b}=(0,y.b)(),[S,M]=(0,s.useState)(null),[C,T]=(0,s.useState)(null),[A,E]=(0,s.useState)(0),[z,R]=(0,s.useState)(!1),_=(0,s.useCallback)(()=>{v.f.get(`/api/error-items/${e}/practice-records`).then(e=>{M(e),h?.(e.masteryStatus)}).catch(()=>void 0)},[e,h]);(0,s.useEffect)(_,[_]);let D=()=>{E(0),_()},H=async e=>{if(await (0,w.u)(b.mastery.deleteRecordConfirm,{destructive:!0}))try{await v.f.delete(`/api/practice/record/${e}`),D()}catch{w.c.error(b.mastery.deleteRecordFailed)}},U=S?.records[0],q=!!U&&(!S?.masteryEvaluatedAt||new Date(U.createdAt)>new Date(S.masteryEvaluatedAt));if((0,s.useEffect)(()=>{if(!q||A>=20)return;let e=setTimeout(()=>{E(e=>e+1),_()},4e3);return()=>clearTimeout(e)},[q,A,_]),!S)return null;let I=S.masteryProbability,L=null===I?null:Math.round(100*I),P=null===L?"":(0,k.m)(I,S.masteryThreshold)?"bg-green-500":L>=30?"bg-amber-500":"bg-red-500",F=b.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)(o.f,{className:"h-4 w-4 text-primary"}),b.mastery.probability]})}),(0,t.jsxs)(f.O,{className:"space-y-4",children:[null===L?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:q?b.mastery.pending:b.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:[L,"%"]}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[q&&(0,t.jsx)(d.f,{className:"h-3 w-3 animate-spin"}),(0,t.jsx)(u.f,{variant:"outline",children:"ai"===S.masterySource?b.mastery.aiEvaluated:b.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 ${P} transition-all`,style:{width:`${L}%`}})}),S.masteryReason&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:S.masteryReason}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.mastery.thresholdHint.replace("{threshold}",String(S.masteryThreshold))})]}),(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:b.mastery.history}),!z&&(0,t.jsxs)(x.f,{variant:"outline",size:"sm",onClick:()=>R(!0),children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),b.mastery.addRecord]})]}),z&&(0,t.jsx)(j,{errorItemId:e,onCancel:()=>R(!1),onSaved:()=>{R(!1),D()}}),0===S.records.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:b.mastery.noHistory}):(0,t.jsx)("ul",{className:"divide-y rounded-md border",children:S.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:()=>T(C===e.id?null:e.id),children:[(0,t.jsx)("span",{className:"text-muted-foreground tabular-nums",children:(0,n.r)(e.createdAt,"yyyy-MM-dd HH:mm",p)}),(0,t.jsx)(u.f,{variant:"outline",className:$[e.result]||"",children:b.mastery.results[e.result]||e.result}),e.difficulty&&(0,t.jsx)(u.f,{variant:"secondary",children:F[e.difficulty]||e.difficulty}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.exam?`${b.mastery.sources.exam} \xb7 ${e.exam.title}`:b.mastery.sources[e.source]||b.mastery.sources.practice}),e.questionText&&(0,t.jsx)("span",{className:"ml-auto text-muted-foreground",children:C===e.id?(0,t.jsx)(l.f,{className:"h-4 w-4"}):(0,t.jsx)(i.f,{className:"h-4 w-4"})})]}),(0,t.jsx)("button",{type:"button","aria-label":b.mastery.deleteRecord,title:b.mastery.deleteRecord,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-red-50 dark:hover:bg-red-950/40 hover:text-red-600 dark:hover:text-red-400",onClick:()=>H(e.id),children:(0,t.jsx)(m.f,{className:"h-4 w-4"})})]}),C===e.id&&e.questionText&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[(0,t.jsx)(g.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:b.editor.wrongAnswerText}),(0,t.jsx)(g.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:b.editor.mistakeAnalysis}),(0,t.jsx)(g.f,{content:e.mistakeAnalysis})]}),e.originalImageUrl&&(0,t.jsx)("img",{src:e.originalImageUrl,alt:b.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)(g.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,$],991686);var S=e.i(534693);e.s(["f",()=>S.f],931454)},846968,e=>{var t=e.i(843476),s=e.i(548161),a=e.i(474544),r=e.i(741120),n=e.i(487486),i=e.i(111110);let l={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,i.b)(),{className:r,icon:d}=l[e],c="mastered"===e?a.notebook.mastered:"reviewing"===e?a.notebook.reviewing:a.notebook.review;return(0,t.jsx)(n.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(548161),a=e.i(576248),r=e.i(583967),n=e.i(111110);let i=[{value:"correct",icon:s.f,active:"border-green-600 bg-green-50 dark:bg-green-950/40 text-green-700 dark:text-green-300"},{value:"wrong",icon:r.f,active:"border-red-600 bg-red-50 dark:bg-red-950/40 text-red-700 dark:text-red-300"},{value:"not_attempted",icon:a.f,active:"border-amber-600 bg-amber-50 dark:bg-amber-950/40 text-amber-700 dark:text-amber-300"}];e.s(["f",0,function({value:e,onChange:s,disabled:a,size:r="md"}){let{t:l}=(0,n.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:i.map(({value:n,icon:i,active:c})=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":e===n,disabled:a,onClick:()=>s(n),className:`flex items-center justify-center gap-1 rounded-md border font-medium transition-colors disabled:opacity-60 ${d} ${e===n?c:"border-input hover:bg-muted"}`,children:[(0,t.jsx)(i,{className:"sm"===r?"h-3 w-3":"h-4 w-4"}),l.mastery.results[n]]},n))})}])},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:n}=(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:n.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360}})}):null}],149704)},574041,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(263676),r=e.i(487486),n=e.i(793479),i=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:d,placeholder:c="Enter tags...",className:o="",enterHint:m,subject:u,gradeStage:x}){let[f,g]=(0,s.useState)(""),[h,p]=(0,s.useState)([]),[b,y]=(0,s.useState)(!1),[v,j]=(0,s.useState)(0),N=(0,s.useRef)(null),w=(0,s.useRef)(null),k=(0,s.useCallback)(async t=>{try{let s=new URLSearchParams({q:t});u&&s.append("subject",u),x&&s.append("stage",x);let a=((await i.f.get(`/api/tags/suggestions?${s.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));p(a.slice(0,20)),y(a.length>0),j(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,x,e]);(0,s.useEffect)(()=>{f.trim()&&k(f)},[f,k]);let $=t=>{t.trim()&&!e.includes(t.trim())&&(d([...e,t.trim()]),g(""),p([]),y(!1),j(0))},S=t=>{d(e.filter(e=>e!==t))};return(0,s.useEffect)(()=>{let e=e=>{!w.current||w.current.contains(e.target)||N.current?.contains(e.target)||y(!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=>{g(e.target.value),e.target.value.trim()||(p([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&h[v]?$(h[v]):f.trim()&&$(f)):"ArrowDown"===t.key?(t.preventDefault(),j(e=>Math.min(e+1,h.length-1))):"ArrowUp"===t.key?(t.preventDefault(),j(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),j(0)):"Backspace"===t.key&&!f&&e.length>0&&S(e[e.length-1])},onFocus:()=>{h.length>0&&y(!0)},placeholder:0===e.length?c:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),b&&h.length>0&&(0,t.jsx)("div",{ref:w,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:h.map((e,s)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${s===v?"bg-accent":""}`,onClick:()=>$(e),onMouseEnter:()=>j(s),children:e},e))}),f&&!b&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:m?`${m} "${f}"`:`Press Enter to create "${f}"`})]})}])},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: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})]})}])},86963,e=>{var t=e.i(843476),s=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(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[]}}])},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),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
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let s={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],711241)},576248,e=>{var t=e.i(456420);let s={name:"circle-question-mark",size:24,node:[["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"}]],aliases:["help-circle","circle-help"]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],576248)},474544,e=>{var t=e.i(456420);let s={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],474544)},856522,e=>{var t=e.i(456420);let s={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],856522)},328623,e=>{var t=e.i(456420);let s={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],328623)},469937,62825,e=>{var t=e.i(843476),s=e.i(456420);let a={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};a.node;let r=(0,s.f)(a);var n=e.i(111110),i=e.i(975157);let l=[1,2,3,4,5];function c(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["f",0,function({value:e,onChange:s,disabled:a,size:c="sm",showUnrated:d=!0,className:o}){let{t:m}=(0,n.b)(),u=e??0,x="sm"===c?"h-3.5 w-3.5":"h-5 w-5",f=u?m.difficulty.starsLabel.replace("{n}",String(u)):m.difficulty.unrated;return s?(0,t.jsxs)("span",{className:(0,i.f)("inline-flex items-center gap-0.5",o),role:"group","aria-label":`${m.difficulty.label}${m.common.colon}${f}`,title:m.difficulty.clearHint,children:[l.map(e=>(0,t.jsx)("button",{type:"button",disabled:a,onClick:()=>s(e===u?null:e),"aria-label":m.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,i.f)(x,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:m.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,i.f)("inline-flex items-center",o),role:"img","aria-label":`${m.difficulty.label}${m.common.colon}${f}`,title:f,children:l.map(e=>(0,t.jsx)(r,{className:(0,i.f)(x,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,i.f)("text-xs text-muted-foreground",o),children:m.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:"未判断"})[c(e)]},"h",0,c,"x",0,function(e,t){return(t||"").trim()?"wrong_attempt":c(e)}],62825)},991686,931454,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(716327),l=e.i(456539),c=e.i(632781),d=e.i(77071),o=e.i(328623),m=e.i(759659),u=e.i(487486),x=e.i(519455),f=e.i(515288),h=e.i(511445),g=e.i(856522),p=e.i(793479),y=e.i(393733),b=e.i(111110),v=e.i(41931);function j({errorItemId:e,onSaved:a,onCancel:i}){let{t:l}=(0,b.b)(),{timeZone:d}=(0,r.M)(),o=(0,n.r)(new Date,"yyyy-MM-dd",d),[m,u]=(0,s.useState)(null),[f,h]=(0,s.useState)(o),[N,w]=(0,s.useState)(!1),[k,$]=(0,s.useState)(null),S=async()=>{if(m&&f){w(!0),$(null);try{await v.f.post("/api/practice/record",{errorItemId:e,result:m,source:"manual",takenAt:(0,n.$)(f,d)}),a()}catch{$(l.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)(y.f,{value:m,onChange:u,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:l.mastery.recordDate}),(0,t.jsx)(p.f,{id:`practice-date-${e}`,type:"date",value:f,max:o,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)(x.f,{variant:"outline",size:"sm",onClick:i,disabled:N,className:"flex-1 sm:flex-none",children:l.exam.cancel}),(0,t.jsxs)(x.f,{size:"sm",onClick:S,disabled:N||!m||!f,className:"flex-1 sm:flex-none",children:[N?(0,t.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(g.f,{className:"mr-2 h-4 w-4"}),l.mastery.saveResult]})]})]}),k&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:k})]})}var N=e.i(149704),w=e.i(294114),k=e.i(905110);let $={correct:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900",wrong:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",not_attempted:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900"};e.s(["K",0,function({errorItemId:e,onMasteryStatusChange:g}){let{timeZone:p}=(0,r.M)(),{t:y}=(0,b.b)(),[S,M]=(0,s.useState)(null),[C,T]=(0,s.useState)(null),[A,z]=(0,s.useState)(0),[E,R]=(0,s.useState)(!1),_=(0,s.useCallback)(()=>{v.f.get(`/api/error-items/${e}/practice-records`).then(e=>{M(e),g?.(e.masteryStatus)}).catch(()=>void 0)},[e,g]);(0,s.useEffect)(_,[_]);let D=()=>{z(0),_()},H=async e=>{if(await (0,w.u)(y.mastery.deleteRecordConfirm,{destructive:!0}))try{await v.f.delete(`/api/practice/record/${e}`),D()}catch{w.c.error(y.mastery.deleteRecordFailed)}},I=S?.records[0],U=!!I&&(!S?.masteryEvaluatedAt||new Date(I.createdAt)>new Date(S.masteryEvaluatedAt));if((0,s.useEffect)(()=>{if(!U||A>=20)return;let e=setTimeout(()=>{z(e=>e+1),_()},4e3);return()=>clearTimeout(e)},[U,A,_]),!S)return null;let q=S.masteryProbability,L=null===q?null:Math.round(100*q),P=null===L?"":(0,k.m)(q,S.masteryThreshold)?"bg-green-500":L>=30?"bg-amber-500":"bg-red-500",F=y.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)(o.f,{className:"h-4 w-4 text-primary"}),y.mastery.probability]})}),(0,t.jsxs)(f.O,{className:"space-y-4",children:[null===L?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:U?y.mastery.pending:y.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:[L,"%"]}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[U&&(0,t.jsx)(c.f,{className:"h-3 w-3 animate-spin"}),(0,t.jsx)(u.f,{variant:"outline",children:"ai"===S.masterySource?y.mastery.aiEvaluated:y.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 ${P} transition-all`,style:{width:`${L}%`}})}),S.masteryReason&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:S.masteryReason}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y.mastery.thresholdHint.replace("{threshold}",String(S.masteryThreshold))})]}),(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:y.mastery.history}),!E&&(0,t.jsxs)(x.f,{variant:"outline",size:"sm",onClick:()=>R(!0),children:[(0,t.jsx)(d.f,{className:"mr-1 h-4 w-4"}),y.mastery.addRecord]})]}),E&&(0,t.jsx)(j,{errorItemId:e,onCancel:()=>R(!1),onSaved:()=>{R(!1),D()}}),0===S.records.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:y.mastery.noHistory}):(0,t.jsx)("ul",{className:"divide-y rounded-md border",children:S.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:()=>T(C===e.id?null:e.id),children:[(0,t.jsx)("span",{className:"text-muted-foreground tabular-nums",children:(0,n.r)(e.createdAt,"yyyy-MM-dd HH:mm",p)}),(0,t.jsx)(u.f,{variant:"outline",className:$[e.result]||"",children:y.mastery.results[e.result]||e.result}),e.difficulty&&(0,t.jsx)(u.f,{variant:"secondary",children:F[e.difficulty]||e.difficulty}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.exam?`${y.mastery.sources.exam} \xb7 ${e.exam.title}`:y.mastery.sources[e.source]||y.mastery.sources.practice}),e.questionText&&(0,t.jsx)("span",{className:"ml-auto text-muted-foreground",children:C===e.id?(0,t.jsx)(l.f,{className:"h-4 w-4"}):(0,t.jsx)(i.f,{className:"h-4 w-4"})})]}),(0,t.jsx)("button",{type:"button","aria-label":y.mastery.deleteRecord,title:y.mastery.deleteRecord,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-red-50 dark:hover:bg-red-950/40 hover:text-red-600 dark:hover:text-red-400",onClick:()=>H(e.id),children:(0,t.jsx)(m.f,{className:"h-4 w-4"})})]}),C===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:y.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:y.editor.mistakeAnalysis}),(0,t.jsx)(h.f,{content:e.mistakeAnalysis})]}),e.originalImageUrl&&(0,t.jsx)("img",{src:e.originalImageUrl,alt:y.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,$],991686);var S=e.i(534693);e.s(["f",()=>S.f],931454)},846968,e=>{var t=e.i(843476),s=e.i(548161),a=e.i(474544),r=e.i(741120),n=e.i(487486),i=e.i(111110);let l={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,i.b)(),{className:r,icon:c}=l[e],d="mastered"===e?a.notebook.mastered:"reviewing"===e?a.notebook.reviewing:a.notebook.review;return(0,t.jsx)(n.f,{variant:"secondary",className:`${r} ${s}`,children:(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(c,{className:"h-3 w-3"})," ",d]})})}])},393733,e=>{var t=e.i(843476),s=e.i(548161),a=e.i(576248),r=e.i(583967),n=e.i(111110);let i=[{value:"correct",icon:s.f,active:"border-green-600 bg-green-50 dark:bg-green-950/40 text-green-700 dark:text-green-300"},{value:"wrong",icon:r.f,active:"border-red-600 bg-red-50 dark:bg-red-950/40 text-red-700 dark:text-red-300"},{value:"not_attempted",icon:a.f,active:"border-amber-600 bg-amber-50 dark:bg-amber-950/40 text-amber-700 dark:text-amber-300"}];e.s(["f",0,function({value:e,onChange:s,disabled:a,size:r="md"}){let{t:l}=(0,n.b)(),c="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:i.map(({value:n,icon:i,active:d})=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":e===n,disabled:a,onClick:()=>s(n),className:`flex items-center justify-center gap-1 rounded-md border font-medium transition-colors disabled:opacity-60 ${c} ${e===n?d:"border-input hover:bg-muted"}`,children:[(0,t.jsx)(i,{className:"sm"===r?"h-3 w-3":"h-4 w-4"}),l.mastery.results[n]]},n))})}])},149704,184110,e=>{var t=e.i(843476),s=e.i(111110);function a(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}function r(e){return a(e)?e:100}e.s(["n",0,100,"a",0,200,"_",0,10,"x",0,a,"V",0,r],184110);var n=e.i(975157);e.s(["f",0,function({svg:e,scale:a,className:i}){let{t:l}=(0,s.b)();if(!e)return null;let c=r(a);return(0,t.jsx)("figure",{className:(0,n.f)("question-figure my-3",i),children:(0,t.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:l.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360,zoom:c/100,maxWidth:`${Math.min(c,100)}%`}})})}],149704)},574041,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(263676),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:m,subject:u,gradeStage:x}){let[f,h]=(0,s.useState)(""),[g,p]=(0,s.useState)([]),[y,b]=(0,s.useState)(!1),[v,j]=(0,s.useState)(0),N=(0,s.useRef)(null),w=(0,s.useRef)(null),k=(0,s.useCallback)(async t=>{try{let s=new URLSearchParams({q:t});u&&s.append("subject",u),x&&s.append("stage",x);let a=((await i.f.get(`/api/tags/suggestions?${s.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));p(a.slice(0,20)),b(a.length>0),j(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,x,e]);(0,s.useEffect)(()=>{f.trim()&&k(f)},[f,k]);let $=t=>{t.trim()&&!e.includes(t.trim())&&(c([...e,t.trim()]),h(""),p([]),b(!1),j(0))},S=t=>{c(e.filter(e=>e!==t))};return(0,s.useEffect)(()=>{let e=e=>{!w.current||w.current.contains(e.target)||N.current?.contains(e.target)||b(!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()||(p([]),b(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&g[v]?$(g[v]):f.trim()&&$(f)):"ArrowDown"===t.key?(t.preventDefault(),j(e=>Math.min(e+1,g.length-1))):"ArrowUp"===t.key?(t.preventDefault(),j(e=>Math.max(e-1,0))):"Escape"===t.key?(b(!1),j(0)):"Backspace"===t.key&&!f&&e.length>0&&S(e[e.length-1])},onFocus:()=>{g.length>0&&b(!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"})]}),y&&g.length>0&&(0,t.jsx)("div",{ref:w,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:g.map((e,s)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${s===v?"bg-accent":""}`,onClick:()=>$(e),onMouseEnter:()=>j(s),children:e},e))}),f&&!y&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:m?`${m} "${f}"`:`Press Enter to create "${f}"`})]})}])},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})]})}])},86963,e=>{var t=e.i(843476),s=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(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[]}}])},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),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 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var s=e.i(456420);let a={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],711241)},399847,e=>{var s=e.i(456420);let a={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],399847)},474544,e=>{var s=e.i(456420);let a={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],474544)},505311,13285,e=>{var s=e.i(456420);let a={name:"pen-tool",size:24,node:[["path",{d:"m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18",key:"93nyr4"}],["path",{d:"M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z",key:"lnux7s"}],["path",{d:"m3 3 6.586 6.586",key:"1igwcn"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],505311);let r={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};r.node;let i=(0,s.f)(r);e.s(["f",0,i],13285)},945514,e=>{var s=e.i(843476),a=e.i(271645),t=e.i(217255),r=e.i(618566),i=e.i(111110),d=e.i(35209),n=e.i(215519),l=e.i(306831),c=e.i(41931),o=e.i(201276),m=e.i(632781),x=e.i(711241),u=e.i(901279),h=e.i(856423),f=e.i(505311),b=e.i(13285),j=e.i(456420);let N={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]};N.node;let p=(0,j.f)(N),y={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};y.node;let g=(0,j.f)(y);var v=e.i(548161),w=e.i(474544),k=e.i(399847),D=e.i(772382),M=e.i(519455),z=e.i(515288),A=e.i(487486);e.s(["default",0,function(){let{timeZone:e}=(0,n.M)(),{data:j,status:N}=(0,t.useSession)(),y=(0,r.useRouter)(),C=(0,r.useParams)(),{t:O}=(0,i.b)(),[R,T]=(0,a.useState)(null);(0,d.f)(O.admin.dashboard.title,R?.user.name||R?.user.email);let[S,E]=(0,a.useState)(!0),q=C.id,Y=(0,a.useCallback)(async()=>{E(!0);try{let e=await c.f.get(`/api/admin/users/${q}/detail`);T(e)}catch(e){o.V.error("[AdminUserDetail]","Failed to fetch user detail",{error:e})}finally{E(!1)}},[q]);if((0,a.useEffect)(()=>{if("loading"!==N){if(!j?.user||"admin"!==j.user.role)return void y.push("/");Y()}},[j,N,y,Y]),"loading"===N||S)return(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,s.jsx)(m.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!R)return(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[60vh] gap-4",children:[(0,s.jsx)("p",{className:"text-muted-foreground",children:O.common?.error||"Error"}),(0,s.jsx)(M.f,{onClick:Y,children:O.admin?.dashboard?.retry||"Retry"})]});let P=[{key:"new",label:O.admin?.dashboard?.masteryNew||"To Review",count:R.masteryDistribution.new,icon:k.f,color:"text-red-500"},{key:"reviewing",label:O.admin?.dashboard?.masteryReviewing||"Reviewing",count:R.masteryDistribution.reviewing,icon:w.f,color:"text-yellow-500"},{key:"mastered",label:O.admin?.dashboard?.masteryMastered||"Mastered",count:R.masteryDistribution.mastered,icon:v.f,color:"text-green-500"}],B=R.masteryDistribution.new+R.masteryDistribution.reviewing+R.masteryDistribution.mastered;return(0,s.jsxs)("div",{className:"max-w-5xl mx-auto p-4 sm:p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)(M.f,{variant:"ghost",size:"sm",onClick:()=>y.push("/admin"),children:[(0,s.jsx)(x.f,{className:"h-4 w-4 mr-1"}),O.common?.back||"Back"]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"p-2 rounded-full bg-blue-50 dark:bg-blue-950/30",children:(0,s.jsx)(u.f,{className:"h-6 w-6 text-blue-500"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-bold",children:R.user.name||"N/A"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:R.user.email})]}),"admin"===R.user.role&&(0,s.jsx)(A.f,{variant:"default",children:O.admin?.admin||"Admin"}),(0,s.jsx)(A.f,{variant:R.user.isActive?"default":"destructive",children:R.user.isActive?O.admin?.active||"Active":O.admin?.disabled||"Disabled"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(b.f,{className:"h-5 w-5 text-purple-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:R.notebookCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:O.admin?.dashboard?.notebooks||"Notebooks"})]})}),(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(h.f,{className:"h-5 w-5 text-red-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:R.errorCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:O.admin?.dashboard?.errors||"Errors"})]})}),(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(f.f,{className:"h-5 w-5 text-green-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:R.practiceCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:O.admin?.dashboard?.practice||"Practice"})]})}),(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(p,{className:"h-5 w-5 text-blue-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:R.recent7DaysCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:O.admin?.dashboard?.recent7Days||"Last 7 Days"})]})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(b.f,{className:"h-4 w-4 text-purple-500"}),O.admin?.dashboard?.userNotebooks||"Notebooks"]})}),(0,s.jsx)(z.O,{children:0===R.notebooks.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:O.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-2",children:R.notebooks.map(e=>(0,s.jsxs)("div",{className:"flex justify-between items-center p-2 rounded-lg bg-muted/30",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,s.jsx)(A.f,{variant:"secondary",className:"text-xs",children:(O.admin?.dashboard?.questionCount||"{count} questions").replace("{count}",String(e.errorCount))})]},e.id))})})]}),(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(v.f,{className:"h-4 w-4 text-green-500"}),O.admin?.dashboard?.masteryDistribution||"Mastery Distribution"]})}),(0,s.jsx)(z.O,{children:0===B?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:O.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-3",children:P.map(e=>{let a=B>0?Math.round(e.count/B*100):0;return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm items-center",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-medium",children:[(0,s.jsx)(e.icon,{className:`h-4 w-4 ${e.color}`}),e.label]}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e.count," (",a,"%)"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,s.jsx)("div",{className:"h-2 rounded-full bg-current opacity-60 transition-all duration-500",style:{width:`${a}%`}})})]},e.key)})})})]})]}),R.subjectDistribution.length>0&&(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(g,{className:"h-4 w-4 text-blue-500"}),O.admin?.dashboard?.subjectDistribution||"Subject Distribution"]})}),(0,s.jsx)(z.O,{children:(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:R.subjectDistribution.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/30",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,s.jsx)(A.f,{variant:"secondary",children:e.count})]},e.name))})})]}),(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(D.f,{className:"h-4 w-4 text-orange-500"}),O.admin?.dashboard?.recentErrors||"Recent Error Items"]})}),(0,s.jsx)(z.O,{children:0===R.recentErrorItems.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:O.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-2",children:R.recentErrorItems.map(a=>(0,s.jsxs)("div",{className:"flex items-start justify-between p-3 rounded-lg bg-muted/30 gap-3",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:a.questionText||a.ocrText||O.admin?.dashboard?.noQuestionText}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[a.subject&&(0,s.jsx)(A.f,{variant:"outline",className:"text-xs",children:a.subject.name}),"mastered"===a.masteryStatus&&(0,s.jsx)(A.f,{variant:"default",className:"text-xs",children:O.admin?.dashboard?.masteryMastered||"Mastered"}),"reviewing"===a.masteryStatus&&(0,s.jsx)(A.f,{variant:"secondary",className:"text-xs",children:O.admin?.dashboard?.masteryReviewing||"Reviewing"}),"new"===a.masteryStatus&&(0,s.jsx)(A.f,{variant:"outline",className:"text-xs",children:O.admin?.dashboard?.masteryNew||"To Review"})]})]}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:(0,l.r)(a.createdAt,"yyyy-MM-dd",e)})]},a.id))})})]})]})}],945514)},515288,e=>{var s=e.i(843476),a=e.i(975157);e.s(["N",0,function({className:e,...t}){return(0,s.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),...t})},"O",0,function({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,a.f)("px-6",e),...t})},"u",0,function({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card-description",className:(0,a.f)("text-muted-foreground text-sm",e),...t})},"Y",0,function({className:e,...t}){return(0,s.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),...t})},"v",0,function({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,a.f)("leading-none font-semibold",e),...t})}])},35209,e=>{var s=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t}=(0,a.b)(),r=[t.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=r},[r])}])}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var s=e.i(456420);let a={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],711241)},399847,e=>{var s=e.i(456420);let a={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],399847)},474544,e=>{var s=e.i(456420);let a={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],474544)},505311,13285,e=>{var s=e.i(456420);let a={name:"pen-tool",size:24,node:[["path",{d:"m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18",key:"93nyr4"}],["path",{d:"M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z",key:"lnux7s"}],["path",{d:"m3 3 6.586 6.586",key:"1igwcn"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]};a.node;let t=(0,s.f)(a);e.s(["f",0,t],505311);let r={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};r.node;let i=(0,s.f)(r);e.s(["f",0,i],13285)},945514,e=>{var s=e.i(843476),a=e.i(271645),t=e.i(217255),r=e.i(618566),i=e.i(111110),d=e.i(35209),l=e.i(215519),n=e.i(306831),c=e.i(41931),m=e.i(201276),o=e.i(632781),x=e.i(711241),h=e.i(901279),u=e.i(856423),f=e.i(505311),b=e.i(13285),j=e.i(456420);let N={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]};N.node;let y=(0,j.f)(N),p={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};p.node;let g=(0,j.f)(p);var v=e.i(548161),w=e.i(474544),k=e.i(399847),D=e.i(772382),M=e.i(519455),z=e.i(515288),A=e.i(487486);e.s(["default",0,function(){let{timeZone:e}=(0,l.M)(),{data:j,status:N}=(0,t.useSession)(),p=(0,r.useRouter)(),C=(0,r.useParams)(),{t:R}=(0,i.b)(),[O,T]=(0,a.useState)(null);(0,d.f)(R.admin.dashboard.title,O?.user.name||O?.user.email);let[S,E]=(0,a.useState)(!0),q=C.id,P=(0,a.useCallback)(async()=>{E(!0);try{let e=await c.f.get(`/api/admin/users/${q}/detail`);T(e)}catch(e){m.V.error("[AdminUserDetail]","Failed to fetch user detail",{error:e})}finally{E(!1)}},[q]);if((0,a.useEffect)(()=>{if("loading"!==N){if(!j?.user||"admin"!==j.user.role)return void p.push("/");P()}},[j,N,p,P]),"loading"===N||S)return(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,s.jsx)(o.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!O)return(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[60vh] gap-4",children:[(0,s.jsx)("p",{className:"text-muted-foreground",children:R.common?.error||"Error"}),(0,s.jsx)(M.f,{onClick:P,children:R.admin?.dashboard?.retry||"Retry"})]});let Y=[{key:"new",label:R.admin?.dashboard?.masteryNew||"To Review",count:O.masteryDistribution.new,icon:k.f,color:"text-red-500"},{key:"reviewing",label:R.admin?.dashboard?.masteryReviewing||"Reviewing",count:O.masteryDistribution.reviewing,icon:w.f,color:"text-yellow-500"},{key:"mastered",label:R.admin?.dashboard?.masteryMastered||"Mastered",count:O.masteryDistribution.mastered,icon:v.f,color:"text-green-500"}],B=O.masteryDistribution.new+O.masteryDistribution.reviewing+O.masteryDistribution.mastered;return(0,s.jsxs)("div",{className:"max-w-5xl mx-auto p-4 sm:p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)(M.f,{variant:"ghost",size:"sm",onClick:()=>p.push("/admin"),children:[(0,s.jsx)(x.f,{className:"h-4 w-4 mr-1"}),R.common?.back||"Back"]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"p-2 rounded-full bg-blue-50 dark:bg-blue-950/30",children:(0,s.jsx)(h.f,{className:"h-6 w-6 text-blue-500"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-bold",children:O.user.name||"N/A"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:O.user.email})]}),"admin"===O.user.role&&(0,s.jsx)(A.f,{variant:"default",children:R.admin?.admin||"Admin"}),(0,s.jsx)(A.f,{variant:O.user.isActive?"default":"destructive",children:O.user.isActive?R.admin?.active||"Active":R.admin?.disabled||"Disabled"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(b.f,{className:"h-5 w-5 text-purple-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:O.notebookCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:R.admin?.dashboard?.notebooks||"Notebooks"})]})}),(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(u.f,{className:"h-5 w-5 text-red-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:O.errorCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:R.admin?.dashboard?.errors||"Errors"})]})}),(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(f.f,{className:"h-5 w-5 text-green-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:O.practiceCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:R.admin?.dashboard?.practice||"Practice"})]})}),(0,s.jsx)(z.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(z.O,{className:"p-4 text-center",children:[(0,s.jsx)(y,{className:"h-5 w-5 text-blue-500 mx-auto mb-1"}),(0,s.jsx)("div",{className:"text-2xl font-bold",children:O.recent7DaysCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:R.admin?.dashboard?.recent7Days||"Last 7 Days"})]})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(b.f,{className:"h-4 w-4 text-purple-500"}),R.admin?.dashboard?.userNotebooks||"Notebooks"]})}),(0,s.jsx)(z.O,{children:0===O.notebooks.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:R.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-2",children:O.notebooks.map(e=>(0,s.jsxs)("div",{className:"flex justify-between items-center p-2 rounded-lg bg-muted/30",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,s.jsx)(A.f,{variant:"secondary",className:"text-xs",children:(R.admin?.dashboard?.questionCount||"{count} questions").replace("{count}",String(e.errorCount))})]},e.id))})})]}),(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(v.f,{className:"h-4 w-4 text-green-500"}),R.admin?.dashboard?.masteryDistribution||"Mastery Distribution"]})}),(0,s.jsx)(z.O,{children:0===B?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:R.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-3",children:Y.map(e=>{let a=B>0?Math.round(e.count/B*100):0;return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm items-center",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-medium",children:[(0,s.jsx)(e.icon,{className:`h-4 w-4 ${e.color}`}),e.label]}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e.count," (",a,"%)"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,s.jsx)("div",{className:"h-2 rounded-full bg-current opacity-60 transition-all duration-500",style:{width:`${a}%`}})})]},e.key)})})})]})]}),O.subjectDistribution.length>0&&(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(g,{className:"h-4 w-4 text-blue-500"}),R.admin?.dashboard?.subjectDistribution||"Subject Distribution"]})}),(0,s.jsx)(z.O,{children:(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:O.subjectDistribution.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/30",children:[(0,s.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,s.jsx)(A.f,{variant:"secondary",children:e.count})]},e.name))})})]}),(0,s.jsxs)(z.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(z.Y,{className:"pb-2",children:(0,s.jsxs)(z.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(D.f,{className:"h-4 w-4 text-orange-500"}),R.admin?.dashboard?.recentErrors||"Recent Error Items"]})}),(0,s.jsx)(z.O,{children:0===O.recentErrorItems.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:R.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-2",children:O.recentErrorItems.map(a=>(0,s.jsxs)("div",{className:"flex items-start justify-between p-3 rounded-lg bg-muted/30 gap-3",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:a.questionText||a.ocrText||R.admin?.dashboard?.noQuestionText}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[a.subject&&(0,s.jsx)(A.f,{variant:"outline",className:"text-xs",children:a.subject.name}),"mastered"===a.masteryStatus&&(0,s.jsx)(A.f,{variant:"default",className:"text-xs",children:R.admin?.dashboard?.masteryMastered||"Mastered"}),"reviewing"===a.masteryStatus&&(0,s.jsx)(A.f,{variant:"secondary",className:"text-xs",children:R.admin?.dashboard?.masteryReviewing||"Reviewing"}),"new"===a.masteryStatus&&(0,s.jsx)(A.f,{variant:"outline",className:"text-xs",children:R.admin?.dashboard?.masteryNew||"To Review"})]})]}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:(0,n.r)(a.createdAt,"yyyy-MM-dd",e)})]},a.id))})})]})]})}],945514)},35209,e=>{var s=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t}=(0,a.b)(),r=[t.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=r},[r])}])}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var s=e.i(456420);let t={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],711241)},399847,e=>{var s=e.i(456420);let t={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],399847)},474544,e=>{var s=e.i(456420);let t={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],474544)},505311,13285,e=>{var s=e.i(456420);let t={name:"pen-tool",size:24,node:[["path",{d:"m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18",key:"93nyr4"}],["path",{d:"M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z",key:"lnux7s"}],["path",{d:"m3 3 6.586 6.586",key:"1igwcn"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],505311);let r={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};r.node;let i=(0,s.f)(r);e.s(["f",0,i],13285)},7219,e=>{var s=e.i(456420);let t={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],7219)},672906,e=>{var s=e.i(843476),t=e.i(271645),a=e.i(217255),r=e.i(618566),i=e.i(632781),d=e.i(456420);let l={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};l.node;let n=(0,d.f)(l);var c=e.i(519455),o=e.i(393842),m=e.i(515288),x=e.i(856423),h=e.i(505311),u=e.i(13285),f=e.i(7219),b=e.i(548161),j=e.i(474544),g=e.i(399847),p=e.i(749803);function N({data:e,t}){let a=[{title:t.admin?.dashboard?.totalUsers||"Total Users",value:e.overview.totalUsers,icon:n,color:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-950/30"},{title:t.admin?.dashboard?.totalErrors||"Total Errors",value:e.overview.totalErrorItems,icon:x.f,color:"text-red-500",bgColor:"bg-red-50 dark:bg-red-950/30"},{title:t.admin?.dashboard?.totalPractice||"Total Practice",value:e.overview.totalPracticeRecords,icon:h.f,color:"text-green-500",bgColor:"bg-green-50 dark:bg-green-950/30"},{title:t.admin?.dashboard?.totalNotebooks||"Total Notebooks",value:e.overview.totalSubjects,icon:u.f,color:"text-purple-500",bgColor:"bg-purple-50 dark:bg-purple-950/30"}];return(0,s.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:a.map(e=>(0,s.jsx)(m.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(m.O,{className:"p-4 flex items-center gap-4",children:[(0,s.jsx)("div",{className:`p-3 rounded-xl ${e.bgColor}`,children:(0,s.jsx)(e.icon,{className:`h-6 w-6 ${e.color}`})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e.title}),(0,s.jsx)("p",{className:"text-2xl font-bold",children:e.value})]})]})},e.title))})}function v({data:e,t}){let a=Math.max(...e.dailyTrend.map(e=>e.count),1);return(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(m.Y,{className:"pb-2",children:(0,s.jsxs)(m.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(f.f,{className:"h-4 w-4 text-orange-500"}),t.admin?.dashboard?.recentTrend||"Recent 7-Day Trend"]})}),(0,s.jsx)(m.O,{children:(0,s.jsx)("div",{className:"flex items-end gap-2 h-40",children:e.dailyTrend.map(e=>{let t=a>0?e.count/a*100:0,r=e.date.slice(5).replace("-","/");return(0,s.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1",children:[(0,s.jsx)("span",{className:"text-xs font-medium",children:e.count>0?e.count:""}),(0,s.jsx)("div",{className:"w-full relative",style:{height:"100px"},children:(0,s.jsx)("div",{className:"absolute bottom-0 w-full bg-gradient-to-t from-orange-500 to-orange-400 rounded-t-md transition-all duration-500 min-h-[4px]",style:{height:`${Math.max(t,4)}%`}})}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:r})]},e.date)})})})]})}function y({data:e,t}){let a=e.subjectDistribution.reduce((e,s)=>e+s.count,0),r=["bg-blue-500","bg-green-500","bg-orange-500","bg-purple-500","bg-red-500","bg-cyan-500","bg-yellow-500","bg-pink-500","bg-indigo-500"];return(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(m.Y,{className:"pb-2",children:(0,s.jsxs)(m.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(p.f,{className:"h-4 w-4 text-blue-500"}),t.admin?.dashboard?.subjectDistribution||"Subject Distribution"]})}),(0,s.jsx)(m.O,{children:0===a?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:t.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-3",children:e.subjectDistribution.map((e,t)=>{let i=a>0?Math.round(e.count/a*100):0;return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e.count," (",i,"%)"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2.5",children:(0,s.jsx)("div",{className:`h-2.5 rounded-full ${r[t%r.length]} transition-all duration-500`,style:{width:`${i}%`}})})]},e.name)})})})]})}function w({data:e,t}){let a=e.masteryDistribution.new+e.masteryDistribution.reviewing+e.masteryDistribution.mastered,r=[{key:"new",label:t.admin?.dashboard?.masteryNew||"To Review",count:e.masteryDistribution.new,icon:g.f,color:"text-red-500",bg:"bg-red-500"},{key:"reviewing",label:t.admin?.dashboard?.masteryReviewing||"Reviewing",count:e.masteryDistribution.reviewing,icon:j.f,color:"text-yellow-500",bg:"bg-yellow-500"},{key:"mastered",label:t.admin?.dashboard?.masteryMastered||"Mastered",count:e.masteryDistribution.mastered,icon:b.f,color:"text-green-500",bg:"bg-green-500"}];return(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(m.Y,{className:"pb-2",children:(0,s.jsxs)(m.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(b.f,{className:"h-4 w-4 text-green-500"}),t.admin?.dashboard?.masteryDistribution||"Mastery Distribution"]})}),(0,s.jsx)(m.O,{children:0===a?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:t.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-3",children:r.map(e=>{let t=a>0?Math.round(e.count/a*100):0;return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm items-center",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-medium",children:[(0,s.jsx)(e.icon,{className:`h-4 w-4 ${e.color}`}),e.label]}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e.count," (",t,"%)"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2.5",children:(0,s.jsx)("div",{className:`h-2.5 rounded-full ${e.bg} transition-all duration-500`,style:{width:`${t}%`}})})]},e.key)})})})]})}var k=e.i(716327),D=e.i(456539),A=e.i(772382),M=e.i(487486),C=e.i(111110),z=e.i(215519),T=e.i(306831);function R({users:e,onViewDetail:a}){let{timeZone:r}=(0,z.M)(),{t:i}=(0,C.b)(),[d,l]=(0,t.useState)(null);return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"hidden md:block border rounded-lg overflow-hidden",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-muted/50",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"text-left p-3 font-medium",children:i.admin?.dashboard?.userName||"Username"}),(0,s.jsx)("th",{className:"text-left p-3 font-medium",children:i.admin?.dashboard?.email||"Email"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.notebooks||"Notebooks"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.errors||"Errors"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.practice||"Practice"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.status||"Status"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.registeredAt||"Registered At"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.actions||"Actions"})]})}),(0,s.jsx)("tbody",{children:e.map(e=>(0,s.jsxs)("tr",{className:"border-t hover:bg-muted/30 transition-colors",children:[(0,s.jsx)("td",{className:"p-3",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name||"N/A"}),"admin"===e.role&&(0,s.jsx)(M.f,{variant:"default",className:"text-xs",children:i.admin?.admin||"Admin"})]})}),(0,s.jsx)("td",{className:"p-3 text-muted-foreground",children:e.email}),(0,s.jsx)("td",{className:"p-3 text-center",children:e.notebookCount}),(0,s.jsx)("td",{className:"p-3 text-center font-medium",children:e.errorCount}),(0,s.jsx)("td",{className:"p-3 text-center",children:e.practiceCount}),(0,s.jsx)("td",{className:"p-3 text-center",children:(0,s.jsx)(M.f,{variant:e.isActive?"default":"destructive",className:"text-xs",children:e.isActive?i.admin?.active||"Active":i.admin?.disabled||"Disabled"})}),(0,s.jsx)("td",{className:"p-3 text-center text-muted-foreground text-xs",children:(0,T.r)(e.createdAt,"yyyy-MM-dd",r)}),(0,s.jsx)("td",{className:"p-3 text-center",children:(0,s.jsx)(c.f,{variant:"ghost",size:"sm",onClick:()=>a(e.id),title:i.admin?.dashboard?.viewDetail||"View Detail",children:(0,s.jsx)(A.f,{className:"h-4 w-4"})})})]},e.id))})]})}),(0,s.jsx)("div",{className:"md:hidden space-y-3",children:e.map(e=>(0,s.jsx)(m.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(m.O,{className:"p-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start cursor-pointer",onClick:()=>l(d===e.id?null:e.id),children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name||"N/A"}),"admin"===e.role&&(0,s.jsx)(M.f,{variant:"default",className:"text-xs",children:i.admin?.admin||"Admin"})]}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:e.email})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(M.f,{variant:e.isActive?"default":"destructive",className:"text-xs",children:e.isActive?i.admin?.active||"Active":i.admin?.disabled||"Disabled"}),d===e.id?(0,s.jsx)(D.f,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(k.f,{className:"h-4 w-4 text-muted-foreground"})]})]}),d===e.id&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t grid grid-cols-3 gap-3 text-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-lg font-bold",children:e.notebookCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:i.admin?.dashboard?.notebooks||"Notebooks"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-lg font-bold text-red-500",children:e.errorCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:i.admin?.dashboard?.errors||"Errors"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-lg font-bold text-green-500",children:e.practiceCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:i.admin?.dashboard?.practice||"Practice"})]})]}),d===e.id&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,T.r)(e.createdAt,"yyyy-MM-dd",r)}),(0,s.jsxs)(c.f,{variant:"ghost",size:"sm",onClick:()=>a(e.id),children:[(0,s.jsx)(A.f,{className:"h-4 w-4 mr-1"}),i.admin?.dashboard?.viewDetail||"View Detail"]})]})]})},e.id))})]})}var E=e.i(41931),O=e.i(201276),S=e.i(35209);e.s(["default",0,function(){let{data:e,status:d}=(0,a.useSession)(),l=(0,r.useRouter)(),{t:x}=(0,C.b)(),[h,u]=(0,t.useState)(null);(0,S.f)(x.admin.dashboard.title);let[f,b]=(0,t.useState)(!0),j=(0,t.useCallback)(async()=>{b(!0);try{let e=await E.f.get("/api/admin/dashboard");u(e)}catch(e){O.V.error("[AdminDashboard]","Failed to fetch dashboard data",{error:e})}finally{b(!1)}},[]);return((0,t.useEffect)(()=>{if("loading"!==d){if(!e?.user||"admin"!==e.user.role)return void l.push("/");j()}},[e,d,l,j]),"loading"===d||f)?(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,s.jsx)(i.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):h?(0,s.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8",children:[(0,s.jsx)(o.f,{title:x.admin?.dashboard?.title||"Admin Dashboard",description:x.admin?.dashboard?.subtitle||"View all users and error statistics"}),(0,s.jsx)(N,{data:h,t:x}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsx)(v,{data:h,t:x}),(0,s.jsx)(w,{data:h,t:x})]}),(0,s.jsx)(y,{data:h,t:x}),(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsxs)(m.Y,{className:"pb-2",children:[(0,s.jsxs)(m.v,{className:"text-lg flex items-center gap-2",children:[(0,s.jsx)(n,{className:"h-5 w-5 text-blue-500"}),x.admin?.dashboard?.userList||"User List"]}),(0,s.jsx)(m.u,{children:x.admin?.dashboard?.userListDesc||"All registered users and their error entry status"})]}),(0,s.jsx)(m.O,{children:(0,s.jsx)(R,{users:h.userStats,onViewDetail:e=>l.push(`/admin/user/${e}`)})})]})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[60vh] gap-4",children:[(0,s.jsx)("p",{className:"text-muted-foreground",children:x.common?.error||"Error"}),(0,s.jsx)(c.f,{onClick:j,children:x.admin?.dashboard?.retry||"Retry"})]})}],672906)},590546,e=>{var s=e.i(843476),t=e.i(618566),a=e.i(519455),r=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let d=(0,t.useRouter)();return(0,s.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{d.push(e)},className:i,children:(0,s.jsx)(r.f,{className:"h-5 w-5"})})}])},515288,e=>{var s=e.i(843476),t=e.i(975157);e.s(["N",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card",className:(0,t.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,s.jsx)("div",{"data-slot":"card-content",className:(0,t.f)("px-6",e),...a})},"u",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card-description",className:(0,t.f)("text-muted-foreground text-sm",e),...a})},"Y",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,t.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,s.jsx)("div",{"data-slot":"card-title",className:(0,t.f)("leading-none font-semibold",e),...a})}])},393842,e=>{var s=e.i(843476),t=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:r,backHref:i,actions:d,titleAddon:l,className:n}){return(0,s.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",n),children:[i&&(0,s.jsx)(t.f,{fallbackUrl:i,className:"-ml-2 shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),r&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:r})]}),d&&(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:d})]})}])},35209,e=>{var s=e.i(271645),t=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,t.b)(),r=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=r},[r])}])}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var s=e.i(456420);let t={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],711241)},399847,e=>{var s=e.i(456420);let t={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],399847)},474544,e=>{var s=e.i(456420);let t={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],474544)},505311,13285,e=>{var s=e.i(456420);let t={name:"pen-tool",size:24,node:[["path",{d:"m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18",key:"93nyr4"}],["path",{d:"M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z",key:"lnux7s"}],["path",{d:"m3 3 6.586 6.586",key:"1igwcn"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],505311);let i={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};i.node;let r=(0,s.f)(i);e.s(["f",0,r],13285)},7219,e=>{var s=e.i(456420);let t={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],7219)},672906,e=>{var s=e.i(843476),t=e.i(271645),a=e.i(217255),i=e.i(618566),r=e.i(632781),d=e.i(456420);let l={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};l.node;let n=(0,d.f)(l);var c=e.i(519455),o=e.i(393842),m=e.i(515288),x=e.i(856423),h=e.i(505311),u=e.i(13285),f=e.i(7219),b=e.i(548161),j=e.i(474544),g=e.i(399847),p=e.i(749803);function N({data:e,t}){let a=[{title:t.admin?.dashboard?.totalUsers||"Total Users",value:e.overview.totalUsers,icon:n,color:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-950/30"},{title:t.admin?.dashboard?.totalErrors||"Total Errors",value:e.overview.totalErrorItems,icon:x.f,color:"text-red-500",bgColor:"bg-red-50 dark:bg-red-950/30"},{title:t.admin?.dashboard?.totalPractice||"Total Practice",value:e.overview.totalPracticeRecords,icon:h.f,color:"text-green-500",bgColor:"bg-green-50 dark:bg-green-950/30"},{title:t.admin?.dashboard?.totalNotebooks||"Total Notebooks",value:e.overview.totalSubjects,icon:u.f,color:"text-purple-500",bgColor:"bg-purple-50 dark:bg-purple-950/30"}];return(0,s.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:a.map(e=>(0,s.jsx)(m.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(m.O,{className:"p-4 flex items-center gap-4",children:[(0,s.jsx)("div",{className:`p-3 rounded-xl ${e.bgColor}`,children:(0,s.jsx)(e.icon,{className:`h-6 w-6 ${e.color}`})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e.title}),(0,s.jsx)("p",{className:"text-2xl font-bold",children:e.value})]})]})},e.title))})}function v({data:e,t}){let a=Math.max(...e.dailyTrend.map(e=>e.count),1);return(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(m.Y,{className:"pb-2",children:(0,s.jsxs)(m.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(f.f,{className:"h-4 w-4 text-orange-500"}),t.admin?.dashboard?.recentTrend||"Recent 7-Day Trend"]})}),(0,s.jsx)(m.O,{children:(0,s.jsx)("div",{className:"flex items-end gap-2 h-40",children:e.dailyTrend.map(e=>{let t=a>0?e.count/a*100:0,i=e.date.slice(5).replace("-","/");return(0,s.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1",children:[(0,s.jsx)("span",{className:"text-xs font-medium",children:e.count>0?e.count:""}),(0,s.jsx)("div",{className:"w-full relative",style:{height:"100px"},children:(0,s.jsx)("div",{className:"absolute bottom-0 w-full bg-gradient-to-t from-orange-500 to-orange-400 rounded-t-md transition-all duration-500 min-h-[4px]",style:{height:`${Math.max(t,4)}%`}})}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:i})]},e.date)})})})]})}function y({data:e,t}){let a=e.subjectDistribution.reduce((e,s)=>e+s.count,0),i=["bg-blue-500","bg-green-500","bg-orange-500","bg-purple-500","bg-red-500","bg-cyan-500","bg-yellow-500","bg-pink-500","bg-indigo-500"];return(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(m.Y,{className:"pb-2",children:(0,s.jsxs)(m.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(p.f,{className:"h-4 w-4 text-blue-500"}),t.admin?.dashboard?.subjectDistribution||"Subject Distribution"]})}),(0,s.jsx)(m.O,{children:0===a?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:t.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-3",children:e.subjectDistribution.map((e,t)=>{let r=a>0?Math.round(e.count/a*100):0;return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e.count," (",r,"%)"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2.5",children:(0,s.jsx)("div",{className:`h-2.5 rounded-full ${i[t%i.length]} transition-all duration-500`,style:{width:`${r}%`}})})]},e.name)})})})]})}function w({data:e,t}){let a=e.masteryDistribution.new+e.masteryDistribution.reviewing+e.masteryDistribution.mastered,i=[{key:"new",label:t.admin?.dashboard?.masteryNew||"To Review",count:e.masteryDistribution.new,icon:g.f,color:"text-red-500",bg:"bg-red-500"},{key:"reviewing",label:t.admin?.dashboard?.masteryReviewing||"Reviewing",count:e.masteryDistribution.reviewing,icon:j.f,color:"text-yellow-500",bg:"bg-yellow-500"},{key:"mastered",label:t.admin?.dashboard?.masteryMastered||"Mastered",count:e.masteryDistribution.mastered,icon:b.f,color:"text-green-500",bg:"bg-green-500"}];return(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsx)(m.Y,{className:"pb-2",children:(0,s.jsxs)(m.v,{className:"text-base flex items-center gap-2",children:[(0,s.jsx)(b.f,{className:"h-4 w-4 text-green-500"}),t.admin?.dashboard?.masteryDistribution||"Mastery Distribution"]})}),(0,s.jsx)(m.O,{children:0===a?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:t.admin?.dashboard?.noData||"No Data"}):(0,s.jsx)("div",{className:"space-y-3",children:i.map(e=>{let t=a>0?Math.round(e.count/a*100):0;return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm items-center",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-medium",children:[(0,s.jsx)(e.icon,{className:`h-4 w-4 ${e.color}`}),e.label]}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e.count," (",t,"%)"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2.5",children:(0,s.jsx)("div",{className:`h-2.5 rounded-full ${e.bg} transition-all duration-500`,style:{width:`${t}%`}})})]},e.key)})})})]})}var k=e.i(716327),D=e.i(456539),A=e.i(772382),M=e.i(487486),C=e.i(111110),z=e.i(215519),T=e.i(306831);function R({users:e,onViewDetail:a}){let{timeZone:i}=(0,z.M)(),{t:r}=(0,C.b)(),[d,l]=(0,t.useState)(null);return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"hidden md:block border rounded-lg overflow-hidden",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-muted/50",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"text-left p-3 font-medium",children:r.admin?.dashboard?.userName||"Username"}),(0,s.jsx)("th",{className:"text-left p-3 font-medium",children:r.admin?.dashboard?.email||"Email"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.notebooks||"Notebooks"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.errors||"Errors"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.practice||"Practice"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.status||"Status"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.registeredAt||"Registered At"}),(0,s.jsx)("th",{className:"text-center p-3 font-medium",children:r.admin?.dashboard?.actions||"Actions"})]})}),(0,s.jsx)("tbody",{children:e.map(e=>(0,s.jsxs)("tr",{className:"border-t hover:bg-muted/30 transition-colors",children:[(0,s.jsx)("td",{className:"p-3",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name||"N/A"}),"admin"===e.role&&(0,s.jsx)(M.f,{variant:"default",className:"text-xs",children:r.admin?.admin||"Admin"})]})}),(0,s.jsx)("td",{className:"p-3 text-muted-foreground",children:e.email}),(0,s.jsx)("td",{className:"p-3 text-center",children:e.notebookCount}),(0,s.jsx)("td",{className:"p-3 text-center font-medium",children:e.errorCount}),(0,s.jsx)("td",{className:"p-3 text-center",children:e.practiceCount}),(0,s.jsx)("td",{className:"p-3 text-center",children:(0,s.jsx)(M.f,{variant:e.isActive?"default":"destructive",className:"text-xs",children:e.isActive?r.admin?.active||"Active":r.admin?.disabled||"Disabled"})}),(0,s.jsx)("td",{className:"p-3 text-center text-muted-foreground text-xs",children:(0,T.r)(e.createdAt,"yyyy-MM-dd",i)}),(0,s.jsx)("td",{className:"p-3 text-center",children:(0,s.jsx)(c.f,{variant:"ghost",size:"sm",onClick:()=>a(e.id),title:r.admin?.dashboard?.viewDetail||"View Detail",children:(0,s.jsx)(A.f,{className:"h-4 w-4"})})})]},e.id))})]})}),(0,s.jsx)("div",{className:"md:hidden space-y-3",children:e.map(e=>(0,s.jsx)(m.N,{className:"border-0 shadow-sm",children:(0,s.jsxs)(m.O,{className:"p-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start cursor-pointer",onClick:()=>l(d===e.id?null:e.id),children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name||"N/A"}),"admin"===e.role&&(0,s.jsx)(M.f,{variant:"default",className:"text-xs",children:r.admin?.admin||"Admin"})]}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:e.email})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(M.f,{variant:e.isActive?"default":"destructive",className:"text-xs",children:e.isActive?r.admin?.active||"Active":r.admin?.disabled||"Disabled"}),d===e.id?(0,s.jsx)(D.f,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(k.f,{className:"h-4 w-4 text-muted-foreground"})]})]}),d===e.id&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t grid grid-cols-3 gap-3 text-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-lg font-bold",children:e.notebookCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:r.admin?.dashboard?.notebooks||"Notebooks"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-lg font-bold text-red-500",children:e.errorCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:r.admin?.dashboard?.errors||"Errors"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-lg font-bold text-green-500",children:e.practiceCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:r.admin?.dashboard?.practice||"Practice"})]})]}),d===e.id&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,T.r)(e.createdAt,"yyyy-MM-dd",i)}),(0,s.jsxs)(c.f,{variant:"ghost",size:"sm",onClick:()=>a(e.id),children:[(0,s.jsx)(A.f,{className:"h-4 w-4 mr-1"}),r.admin?.dashboard?.viewDetail||"View Detail"]})]})]})},e.id))})]})}var E=e.i(41931),S=e.i(201276),$=e.i(35209);e.s(["default",0,function(){let{data:e,status:d}=(0,a.useSession)(),l=(0,i.useRouter)(),{t:x}=(0,C.b)(),[h,u]=(0,t.useState)(null);(0,$.f)(x.admin.dashboard.title);let[f,b]=(0,t.useState)(!0),j=(0,t.useCallback)(async()=>{b(!0);try{let e=await E.f.get("/api/admin/dashboard");u(e)}catch(e){S.V.error("[AdminDashboard]","Failed to fetch dashboard data",{error:e})}finally{b(!1)}},[]);return((0,t.useEffect)(()=>{if("loading"!==d){if(!e?.user||"admin"!==e.user.role)return void l.push("/");j()}},[e,d,l,j]),"loading"===d||f)?(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,s.jsx)(r.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):h?(0,s.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8",children:[(0,s.jsx)(o.f,{title:x.admin?.dashboard?.title||"Admin Dashboard",description:x.admin?.dashboard?.subtitle||"View all users and error statistics"}),(0,s.jsx)(N,{data:h,t:x}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsx)(v,{data:h,t:x}),(0,s.jsx)(w,{data:h,t:x})]}),(0,s.jsx)(y,{data:h,t:x}),(0,s.jsxs)(m.N,{className:"border-0 shadow-sm",children:[(0,s.jsxs)(m.Y,{className:"pb-2",children:[(0,s.jsxs)(m.v,{className:"text-lg flex items-center gap-2",children:[(0,s.jsx)(n,{className:"h-5 w-5 text-blue-500"}),x.admin?.dashboard?.userList||"User List"]}),(0,s.jsx)(m.u,{children:x.admin?.dashboard?.userListDesc||"All registered users and their error entry status"})]}),(0,s.jsx)(m.O,{children:(0,s.jsx)(R,{users:h.userStats,onViewDetail:e=>l.push(`/admin/user/${e}`)})})]})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[60vh] gap-4",children:[(0,s.jsx)("p",{className:"text-muted-foreground",children:x.common?.error||"Error"}),(0,s.jsx)(c.f,{onClick:j,children:x.admin?.dashboard?.retry||"Retry"})]})}],672906)},590546,e=>{var s=e.i(843476),t=e.i(618566),a=e.i(519455),i=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:r}){let d=(0,t.useRouter)();return(0,s.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{d.push(e)},className:r,children:(0,s.jsx)(i.f,{className:"h-5 w-5"})})}])},393842,e=>{var s=e.i(843476),t=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:r,actions:d,titleAddon:l,className:n}){return(0,s.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",n),children:[r&&(0,s.jsx)(t.f,{fallbackUrl:r,className:"-ml-2 shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),i&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),d&&(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:d})]})}])},35209,e=>{var s=e.i(271645),t=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,t.b)(),i=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=i},[i])}])}])})();
|